[postgis-tickets] r15307 - Add check for pkg-config

Sandro Santilli strk at kbt.io
Tue Feb 7 13:42:32 PST 2017


Author: strk
Date: 2017-02-07 13:42:32 -0800 (Tue, 07 Feb 2017)
New Revision: 15307

Modified:
   trunk/configure.ac
Log:
Add check for pkg-config

Patch by Bj?\195?\182rn Harrtell

References #3661

Modified: trunk/configure.ac
===================================================================
--- trunk/configure.ac	2017-02-07 06:11:45 UTC (rev 15306)
+++ trunk/configure.ac	2017-02-07 21:42:32 UTC (rev 15307)
@@ -897,7 +897,16 @@
 fi dnl }
 
 
+dnl ===========================================================================
+dnl Detect if pkg-config installed
+dnl ===========================================================================
+# check for pkg-config
+AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
+if test "$PKG_CONFIG" = "no"; then
+   AC_MSG_WARN([Cannot find pkg-config, make sure it is installed in your PATH])
+fi
 
+
 dnl ===========================================================================
 dnl Detect if protobuf-c installed
 dnl ===========================================================================
@@ -940,8 +949,13 @@
 AC_CHECK_LIB([protobuf-c], [protobuf_c_message_check], [HAVE_PROTOBUF=yes; PROTOBUF_LDFLAGS="${PROTOBUF_LDFLAGS} -lprotobuf-c"], [HAVE_PROTOBUF=no])
 LIBS="$LIBS_SAVE"
 
-dnl Ensure libprotobuf-c is of minimum required version
-PKG_CHECK_MODULES([PROTOBUFC], [libprotobuf-c >= 1.1.0], [HAVE_PROTOBUF=yes], [HAVE_PROTOBUF=no])
+if test "$PKG_CONFIG" = "no"; then
+	AC_MSG_WARN([Cannot find pkg-config, disabling protobuf support.])
+	HAVE_PROTOBUF=no
+else
+	dnl Ensure libprotobuf-c is of minimum required version
+	PKG_CHECK_MODULES([PROTOBUFC], [libprotobuf-c >= 1.1.0], [HAVE_PROTOBUF=yes], [HAVE_PROTOBUF=no])
+fi
 
 if test "$HAVE_PROTOBUF" = "yes"; then
 	AC_PATH_PROG(PROTOCC, protoc-c)



More information about the postgis-tickets mailing list