From: Paul Ramsey Date: Wed, 4 Jan 2012 02:07:12 +0000 (+0000) Subject: Try to make json-c detection slightly more automatic. X-Git-Tag: 2.0.0alpha1~207 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=28cb31e6dd2e29d88140821a4fcb786cfeeaca8d;p=postgis Try to make json-c detection slightly more automatic. git-svn-id: http://svn.osgeo.org/postgis/trunk@8668 b70326c6-7e19-0410-871a-916f4a2858ee --- diff --git a/configure.ac b/configure.ac index 5220c1166..aada5be96 100644 --- a/configure.ac +++ b/configure.ac @@ -639,31 +639,30 @@ if test ! "x$JSONDIR" = "x"; then dnl Add the include directory to JSON_CPPFLAGS JSON_CPPFLAGS="-I$JSONDIR/include" JSON_LDFLAGS="-L$JSONDIR/lib -ljson" - - dnl Check that we can find the json/json.h header file - CPPFLAGS_SAVE="$CPPFLAGS" - CPPFLAGS="$JSON_CPPFLAGS" - AC_CHECK_HEADER([json/json.h], [], [AC_MSG_ERROR([could not find json/json.h - you may need to specify the directory of a json-c installation using --with-jsondir])]) - CPPFLAGS="$CPPFLAGS_SAVE" - - dnl Ensure we can link against libjson - LIBS_SAVE="$LIBS" - LIBS="$JSON_LDFLAGS" - AC_CHECK_LIB([json], [json_object_get], - [], - [AC_MSG_ERROR([could not find libjson - you may need to specify the directory of a json-c installation using --with-jsondir])], - []) - LIBS="$LIBS_SAVE" - HAVE_JSON=Yes else AC_MSG_ERROR([the --with-jsondir directory "$JSONDIR" cannot be found]) fi fi fi +dnl Check that we can find the json/json.h header file +CPPFLAGS_SAVE="$CPPFLAGS" +CPPFLAGS="$JSON_CPPFLAGS" +AC_CHECK_HEADER([json/json.h], [HAVE_JSON=Yes], []) +CPPFLAGS="$CPPFLAGS_SAVE" + +dnl Ensure we can link against libjson +LIBS_SAVE="$LIBS" +LIBS="$JSON_LDFLAGS" +AC_CHECK_LIB([json], [json_object_get], [HAVE_JSON=Yes], [], []) +LIBS="$LIBS_SAVE" + +if test "$HAVE_JSON" = "Yes"; then + AC_DEFINE([HAVE_LIBJSON],1) +fi + AC_SUBST([JSON_CPPFLAGS]) AC_SUBST([JSON_LDFLAGS]) -AC_SUBST([HAVE_JSON]) dnl =========================================================================== dnl Detect GTK+2.0 for GUI