From: Sandro Santilli Date: Tue, 7 Feb 2017 21:42:32 +0000 (+0000) Subject: Add check for pkg-config X-Git-Tag: 2.4.0alpha~176 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ac7d75c4277a9915f48b7304ff05c3792f0a9650;p=postgis Add check for pkg-config Patch by Björn Harrtell References #3661 git-svn-id: http://svn.osgeo.org/postgis/trunk@15307 b70326c6-7e19-0410-871a-916f4a2858ee --- 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)