]> granicus.if.org Git - postgis/commitdiff
Move geobuf version testing into configure
authorPaul Ramsey <pramsey@cleverelephant.ca>
Thu, 22 Aug 2019 18:26:43 +0000 (18:26 +0000)
committerPaul Ramsey <pramsey@cleverelephant.ca>
Thu, 22 Aug 2019 18:26:43 +0000 (18:26 +0000)
git-svn-id: http://svn.osgeo.org/postgis/branches/2.5@17767 b70326c6-7e19-0410-871a-916f4a2858ee

configure.ac
postgis/Makefile.in
regress/Makefile.in

index e6ed0e061a84077d4699e8f2c07fbd449686cecc..fbd5e08b997f4ab6b008b876094c60f44b3ff8d4 100644 (file)
@@ -940,6 +940,7 @@ dnl ===========================================================================
 
 CHECK_PROTOBUF=yes
 HAVE_PROTOBUF=yes
+HAVE_GEOBUF=no
 
 AC_ARG_WITH([protobuf],
        [AS_HELP_STRING([--without-protobuf], [build without protobuf-c support])],
@@ -1013,15 +1014,17 @@ if test "$CHECK_PROTOBUF" != "no"; then
        fi
 
        dnl all tests passed! turn on compile-time defines
-    if test "$HAVE_PROTOBUF" = "yes"; then
+       if test "$HAVE_PROTOBUF" = "yes"; then
                AC_DEFINE([HAVE_LIBPROTOBUF], [1], [Define to 1 if libprotobuf-c is present])
                AC_DEFINE_UNQUOTED([LIBPROTOBUF_VERSION], [$PROTOC_VERSION], [Numeric version number for libprotobuf-c])
                if test $PROTOC_VERSION -ge 1001000; then
                        AC_DEFINE([HAVE_GEOBUF], [1], [Define to 1 if libprotobuf is >= 1.1])
+                       HAVE_GEOBUF=yes
                fi
        fi
 
     AC_SUBST([HAVE_PROTOBUF])
+    AC_SUBST([HAVE_GEOBUF])
     AC_SUBST([PROTOC_VERSION])
     AC_SUBST([PROTOBUF_CPPFLAGS])
     AC_SUBST([PROTOBUF_LDFLAGS])
index 36cce5db2a3a040f9b3cc86b8355ee9f46710b7f..fed3cb855a2e3a59615ab8239ddc42e861e79d22 100644 (file)
@@ -56,7 +56,7 @@ endif
 
 ifeq (@HAVE_PROTOBUF@,yes)
 PROTOBUF_OBJ = vector_tile.pb-c.o
-ifeq ($(shell expr @PROTOC_VERSION@ ">=" 1001000),1)
+ifeq (@HAVE_GEOBUF@,yes)
 PROTOBUF_OBJ += geobuf.pb-c.o
 endif
 endif
@@ -206,7 +206,7 @@ geobuf.pb-c.c geobuf.pb-c.h: geobuf.proto
 ifeq (@HAVE_PROTOBUF@,yes)
 lwgeom_out_mvt.o: vector_tile.pb-c.h
 mvt.o: vector_tile.pb-c.h
-ifeq ($(shell expr $(PROTOC_VERSION) ">=" 1001000),1)
+ifeq (@HAVE_GEOBUF@,yes)
 lwgeom_out_geobuf.o: geobuf.pb-c.h
 geobuf.o: geobuf.pb-c.h
 endif
index 521b94093e9b7ce8aea53a88fa9178d7b224dc76..7ec544c8952933d8faac8dab31d40584860ee7d9 100644 (file)
@@ -22,7 +22,6 @@ POSTGIS_PROJ_VERSION=@POSTGIS_PROJ_VERSION@
 POSTGIS_MAJOR_VERSION=@POSTGIS_MAJOR_VERSION@
 POSTGIS_MINOR_VERSION=@POSTGIS_MINOR_VERSION@
 HAVE_JSON=@HAVE_JSON@
-HAVE_PROTOBUF=@HAVE_PROTOBUF@
 PROTOC_VERSION=@PROTOC_VERSION@
 HAVE_SFCGAL=@HAVE_SFCGAL@
 HAVE_BRIN=@HAVE_BRIN@
@@ -247,12 +246,13 @@ ifeq ($(HAVE_SPGIST),yes)
        regress_spgist_index_3d
 endif
 
-ifeq ($(HAVE_PROTOBUF),yes)
+
+ifeq (@HAVE_PROTOBUF@,yes)
        # protobuf-c adds:
        # ST_AsMVT, ST_AsGeobuf
        TESTS += \
                mvt
-ifeq ($(shell expr $(PROTOC_VERSION) ">=" 1001000),1)
+ifeq (@HAVE_GEOTOBUF@,yes)
        TESTS += \
                geobuf
 endif