Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 520694
Collapse All | Expand All

(-)a/configure.ac (-55 / +13 lines)
Lines 780-840 dnl =========================================================================== Link Here
780
dnl Detect if json-c installed
780
dnl Detect if json-c installed
781
dnl ===========================================================================
781
dnl ===========================================================================
782
782
783
CHECK_JSON=yes
783
PKG_CHECK_MODULES([JSON], [json],
784
HAVE_JSON=no
784
                  [
785
HAVE_JSON_C=no
785
                      HAVE_JSON=yes
786
787
AC_ARG_WITH([json],
788
	[AS_HELP_STRING([--without-json], [build without json-c support])],
789
	[CHECK_JSON="$withval"], [])
790
791
if test "$CHECK_JSON" != "no"; then dnl {
792
793
AC_ARG_WITH([jsondir],
794
	[AS_HELP_STRING([--with-jsondir=PATH], [specify the json-c installation directory])],
795
	[JSONDIR="$withval"], [JSONDIR=])
796
797
if test ! "x$JSONDIR" = "x"; then
798
	dnl Make sure that the directory exists
799
	if test "x$JSONDIR" = "xyes"; then
800
		AC_MSG_ERROR([you must specify a parameter to --with-jsondir, e.g. --with-jsondir=/path/to])
801
	else
802
		AC_MSG_RESULT([Using user-specified json-c directory: $JSONDIR])
803
804
		dnl Add the include directory to JSON_CPPFLAGS
805
		JSON_CPPFLAGS="-I$JSONDIR/include"
806
		JSON_LDFLAGS="-L$JSONDIR/lib"
807
	fi
808
fi
809
810
dnl Check that we can find the json/json.h header file
811
CPPFLAGS_SAVE="$CPPFLAGS"
812
CPPFLAGS="$JSON_CPPFLAGS"
813
AC_CHECK_HEADER([json/json.h], [HAVE_JSON=yes], [
814
  AC_CHECK_HEADER([json-c/json.h], [HAVE_JSON=yes; HAVE_JSON_C=yes], [])
815
])      
816
CPPFLAGS="$CPPFLAGS_SAVE"
817
818
dnl Ensure we can link against libjson
819
LIBS_SAVE="$LIBS"
820
LIBS="$JSON_LDFLAGS"
821
AC_CHECK_LIB([json-c], [json_object_get], [HAVE_JSON=yes; JSON_LDFLAGS="${JSON_LDFLAGS} -ljson-c"], [
822
  AC_CHECK_LIB([json], [json_object_get], [HAVE_JSON=yes; JSON_LDFLAGS="${JSON_LDFLAGS} -ljson"], [], [])
823
], [])
824
LIBS="$LIBS_SAVE"
825
826
if test "$HAVE_JSON" = "yes"; then
827
	AC_DEFINE([HAVE_LIBJSON], 1, [Define to 1 if libjson is present])
786
	AC_DEFINE([HAVE_LIBJSON], 1, [Define to 1 if libjson is present])
828
fi
787
                  ],
829
if test "$HAVE_JSON_C" = "yes"; then
788
                  [
830
  AC_DEFINE([HAVE_LIBJSON_C], 1, [Define to 1 if libjson resides in a json-c subdir])
789
                      PKG_CHECK_MODULES([JSON], [json-c],
831
fi
790
                      [
832
791
                          HAVE_JSON=yes
833
AC_SUBST([JSON_CPPFLAGS])
792
	                  AC_DEFINE([HAVE_LIBJSON], 1, [Define to 1 if libjson is present])
834
AC_SUBST([JSON_LDFLAGS])
793
                      ],
835
AC_SUBST([HAVE_JSON])
794
                      [HAVE_JSON=no])
836
795
                  ])
837
fi dnl }
838
796
839
dnl ===========================================================================
797
dnl ===========================================================================
840
dnl Detect GTK+2.0 for GUI
798
dnl Detect GTK+2.0 for GUI
Lines 927-933 AC_DEFINE_UNQUOTED([POSTGIS_USE_STATS], [1], [Enable use of ANALYZE statistics]) Link Here
927
CPPFLAGS="$PGSQL_CPPFLAGS $GEOS_CPPFLAGS $PROJ_CPPFLAGS $XML2_CPPFLAGS $SFCGAL_CPPFLAGS $CPPFLAGS"
885
CPPFLAGS="$PGSQL_CPPFLAGS $GEOS_CPPFLAGS $PROJ_CPPFLAGS $XML2_CPPFLAGS $SFCGAL_CPPFLAGS $CPPFLAGS"
928
AC_MSG_RESULT([CPPFLAGS: $CPPFLAGS])
886
AC_MSG_RESULT([CPPFLAGS: $CPPFLAGS])
929
887
930
SHLIB_LINK="$PGSQL_LDFLAGS $GEOS_LDFLAGS $PROJ_LDFLAGS -lgeos_c -lproj $JSON_LDFLAGS $XML2_LDFLAGS $SFCGAL_LDFLAGS"
888
SHLIB_LINK="$PGSQL_LDFLAGS $GEOS_LDFLAGS $PROJ_LDFLAGS -lgeos_c -lproj $JSON_LIBS $XML2_LDFLAGS $SFCGAL_LDFLAGS"
931
AC_SUBST([SHLIB_LINK])
889
AC_SUBST([SHLIB_LINK])
932
dnl AC_MSG_RESULT([SHLIB_LINK: $SHLIB_LINK])
890
dnl AC_MSG_RESULT([SHLIB_LINK: $SHLIB_LINK])
933
891
(-)a/liblwgeom/Makefile.in (-2 / +2 lines)
Lines 11-18 Link Here
11
# **********************************************************************
11
# **********************************************************************
12
12
13
CC = @CC@
13
CC = @CC@
14
CFLAGS = @CFLAGS@ @PICFLAGS@ @WARNFLAGS@ @GEOS_CPPFLAGS@ @PROJ_CPPFLAGS@ @JSON_CPPFLAGS@
14
CFLAGS = @CFLAGS@ @PICFLAGS@ @WARNFLAGS@ @GEOS_CPPFLAGS@ @PROJ_CPPFLAGS@ @JSON_CFLAGS@
15
LDFLAGS = @LDFLAGS@ @GEOS_LDFLAGS@ -lgeos_c @PROJ_LDFLAGS@ -lproj @JSON_LDFLAGS@
15
LDFLAGS = @LDFLAGS@ @GEOS_LDFLAGS@ -lgeos_c @PROJ_LDFLAGS@ -lproj @JSON_LIBS@
16
NUMERICFLAGS = @NUMERICFLAGS@
16
NUMERICFLAGS = @NUMERICFLAGS@
17
top_builddir = @top_builddir@
17
top_builddir = @top_builddir@
18
prefix = @prefix@
18
prefix = @prefix@
(-)a/liblwgeom/lwin_geojson.c (-7 / +2 lines)
Lines 19-31 Link Here
19
19
20
#include <string.h>
20
#include <string.h>
21
21
22
#ifdef HAVE_LIBJSON_C
22
#include <json.h>
23
#include <json-c/json.h>
23
#include <json_object_private.h>
24
#include <json-c/json_object_private.h>
25
#else
26
#include <json/json.h>
27
#include <json/json_object_private.h>
28
#endif
29
24
30
#ifndef JSON_C_VERSION
25
#ifndef JSON_C_VERSION
31
// Adds support for libjson < 0.10
26
// Adds support for libjson < 0.10

Return to bug 520694