From 5e478a8c0c0ef6159761591cc0248f58da339634 Mon Sep 17 00:00:00 2001 From: Sandro Santilli Date: Tue, 5 Mar 2013 09:10:26 +0000 Subject: [PATCH] Make libjson-c optional adding --without-json configure switch (#2202) git-svn-id: http://svn.osgeo.org/postgis/trunk@11144 b70326c6-7e19-0410-871a-916f4a2858ee --- NEWS | 1 + README.postgis | 2 +- configure.ac | 9 +++++++++ liblwgeom/cunit/cu_tester.c | 3 +++ 4 files changed, 14 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index 297c62446..122be673c 100644 --- a/NEWS +++ b/NEWS @@ -115,6 +115,7 @@ PostGIS 2.1.0 - Proper support for raster band's isnodata flag in core API and loader. - Additional default values for parameters of ST_Aspect and ST_HillShade - #2178, ST_Summary now advertises presence of known srid with an [S] flag + - #2202, Make libjson-c optional (--without-json configure switch) * Fixes * diff --git a/README.postgis b/README.postgis index e4e1b15c8..12454e918 100644 --- a/README.postgis +++ b/README.postgis @@ -66,7 +66,7 @@ this to work. The loader, and hence PostGIS, requires GNU gettext 0.14 or higher (typically in libc on GNU/Linux, in which case 0.17 is required). -* JSON-C (Required, Version 0.9 or higher) +* JSON-C (Optional, Version 0.9 or higher) JSON-C is used to import GeoJSON via the function ST_GeomFromGeoJson(). diff --git a/configure.ac b/configure.ac index 929d2e8fd..308bd9e6f 100644 --- a/configure.ac +++ b/configure.ac @@ -699,9 +699,16 @@ dnl =========================================================================== dnl Detect if json-c installed dnl =========================================================================== +CHECK_JSON=yes HAVE_JSON=no AC_SUBST([HAVE_JSON]) +AC_ARG_WITH([json], + [AS_HELP_STRING([--without-json], [build without json-c support])], + [CHECK_JSON="$withval"], []) + +if test "$CHECK_JSON" != "no"; then dnl { + AC_ARG_WITH([jsondir], [AS_HELP_STRING([--with-jsondir=PATH], [specify the json-c installation directory])], [JSONDIR="$withval"], [JSONDIR=]) @@ -751,6 +758,8 @@ fi AC_SUBST([JSON_CPPFLAGS]) AC_SUBST([JSON_LDFLAGS]) +fi dnl } + dnl =========================================================================== dnl Detect GTK+2.0 for GUI dnl =========================================================================== diff --git a/liblwgeom/cunit/cu_tester.c b/liblwgeom/cunit/cu_tester.c index 4fc8ffe85..4c0c01a94 100644 --- a/liblwgeom/cunit/cu_tester.c +++ b/liblwgeom/cunit/cu_tester.c @@ -15,6 +15,7 @@ #include "CUnit/Basic.h" #include "liblwgeom_internal.h" #include "cu_tester.h" +#include "../postgis_config.h" /* Internal funcs */ static void @@ -80,7 +81,9 @@ int main(int argc, char *argv[]) stringbuffer_suite, surface_suite, homogenize_suite, +#if HAVE_JSON in_geojson_suite, +#endif out_gml_suite, out_kml_suite, out_geojson_suite, -- 2.40.0