From 16b3de036e06822cb59000c7890483115ebe4b91 Mon Sep 17 00:00:00 2001 From: Sandro Santilli Date: Thu, 15 Mar 2012 09:54:29 +0000 Subject: [PATCH] Bail out if user specified json dir isn't correct (#1688) git-svn-id: http://svn.osgeo.org/postgis/trunk@9503 b70326c6-7e19-0410-871a-916f4a2858ee --- configure.ac | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/configure.ac b/configure.ac index a20f832cf..a0ec974d5 100644 --- a/configure.ac +++ b/configure.ac @@ -697,15 +697,18 @@ if test ! "x$JSONDIR" = "x"; then if test "x$JSONDIR" = "xyes"; then AC_MSG_ERROR([you must specify a parameter to --with-jsondir, e.g. --with-jsondir=/path/to]) else - if test -d "$JSONDIR"; then - AC_MSG_RESULT([Using user-specified json-c directory: $JSONDIR]) - - dnl Add the include directory to JSON_CPPFLAGS - JSON_CPPFLAGS="-I$JSONDIR/include" - JSON_LDFLAGS="-L$JSONDIR/lib -ljson" - else - AC_MSG_ERROR([the --with-jsondir directory "$JSONDIR" cannot be found]) + dnl We need (libjson.so OR libjson.a) AND json/json.h + if test ! -e "${JSONDIR}/lib/libjson.so" -a \ + ! -e "${JSONDIR}/lib/libjson.a" -o \ + ! -e "${JSONDIR}/include/json/json.h" + then + AC_MSG_ERROR([Cannot find json dev files in "$JSONDIR"]) fi + AC_MSG_RESULT([Using user-specified json-c directory: $JSONDIR]) + + dnl Add the include directory to JSON_CPPFLAGS + JSON_CPPFLAGS="-I$JSONDIR/include" + JSON_LDFLAGS="-L$JSONDIR/lib -ljson" fi fi -- 2.40.0