]> granicus.if.org Git - postgis/commitdiff
Bail out if user specified json dir isn't correct (#1688)
authorSandro Santilli <strk@keybit.net>
Thu, 15 Mar 2012 09:54:29 +0000 (09:54 +0000)
committerSandro Santilli <strk@keybit.net>
Thu, 15 Mar 2012 09:54:29 +0000 (09:54 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@9503 b70326c6-7e19-0410-871a-916f4a2858ee

configure.ac

index a20f832cf13ffcc96f1a0acd197201f9e9b0c3e8..a0ec974d5afe20993c6ce2975e2f1477e6d22171 100644 (file)
@@ -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