From ac7d75c4277a9915f48b7304ff05c3792f0a9650 Mon Sep 17 00:00:00 2001 From: Sandro Santilli Date: Tue, 7 Feb 2017 21:42:32 +0000 Subject: [PATCH] Add check for pkg-config MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Patch by Björn Harrtell References #3661 git-svn-id: http://svn.osgeo.org/postgis/trunk@15307 b70326c6-7e19-0410-871a-916f4a2858ee --- configure.ac | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index 3bcd97bbd..19204c97c 100644 --- a/configure.ac +++ b/configure.ac @@ -897,6 +897,15 @@ AC_SUBST([HAVE_JSON]) 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 @@ -940,8 +949,13 @@ LIBS="$PROTOBUF_LDFLAGS" 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) -- 2.40.0