From: Paul Ramsey Date: Thu, 22 Aug 2019 18:26:43 +0000 (+0000) Subject: Move geobuf version testing into configure X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f5f29b7cc16f9b72731622e37e1717b1c5fb0fee;p=postgis Move geobuf version testing into configure git-svn-id: http://svn.osgeo.org/postgis/branches/2.5@17767 b70326c6-7e19-0410-871a-916f4a2858ee --- diff --git a/configure.ac b/configure.ac index e6ed0e061..fbd5e08b9 100644 --- a/configure.ac +++ b/configure.ac @@ -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]) diff --git a/postgis/Makefile.in b/postgis/Makefile.in index 36cce5db2..fed3cb855 100644 --- a/postgis/Makefile.in +++ b/postgis/Makefile.in @@ -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 diff --git a/regress/Makefile.in b/regress/Makefile.in index 521b94093..7ec544c89 100644 --- a/regress/Makefile.in +++ b/regress/Makefile.in @@ -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