[postgis-tickets] [PostGIS] #4528: --with-jsondir is broken in 3.0.0

PostGIS trac at osgeo.org
Mon Oct 7 05:49:39 PDT 2019


#4528: --with-jsondir is broken in 3.0.0
------------------------+---------------------------
  Reporter:  jabakobob  |      Owner:  pramsey
      Type:  defect     |     Status:  closed
  Priority:  medium     |  Milestone:  PostGIS 3.0.0
 Component:  postgis    |    Version:
Resolution:  fixed      |   Keywords:
------------------------+---------------------------

Comment (by jabakobob):

 What about the `HAVE_LIBJSON_C` flag? As far as I understand it's not
 needed any more.

 I would suggest the following patch below to remove it. Am I missing
 something?


 {{{
 diff --git a/configure.ac b/configure.ac
 index 9af7282e4..78ac17ec3 100644
 --- a/configure.ac
 +++ b/configure.ac
 @@ -910,7 +910,6 @@ dnl
 ===========================================================================

  CHECK_JSON=yes
  HAVE_JSON=no
 -HAVE_JSON_C=no

  AC_ARG_WITH([json],
         [AS_HELP_STRING([--without-json], [build without json-c
 support])],
 @@ -935,7 +934,7 @@ if test "$CHECK_JSON" != "no"; then
                      AC_CHECK_FILE("$JSONDIR/include/json-c/json.h",
                                  [
 JSON_CPPFLAGS="-I$JSONDIR/include/json-c"
 -                                    AC_CHECK_LIB([json-c],
 [json_object_get], [HAVE_JSON_C=yes; JSON_LDFLAGS="${JSON_LDFLAGS}
 -ljson-c"])
 +                                    AC_CHECK_LIB([json-c],
 [json_object_get], [HAVE_JSON=yes; JSON_LDFLAGS="${JSON_LDFLAGS}
 -ljson-c"])
                                  ],
                                  [
 AC_CHECK_FILE("$JSONDIR/include/json/json.h",
 @@ -949,7 +948,7 @@ if test "$CHECK_JSON" != "no"; then
              fi
      elif test ! -z "$PKG_CONFIG"; then
         PKG_CHECK_MODULES([JSONC], [json-c], [
 -                HAVE_JSON_C=yes
 +                HAVE_JSON=yes
                  JSON_CPPFLAGS="$JSONC_CFLAGS"
                  JSON_LDFLAGS="$JSONC_LIBS"
              ], [])
 @@ -958,16 +957,10 @@ if test "$CHECK_JSON" != "no"; then
      if test "$HAVE_JSON" = "yes"; then
              AC_DEFINE([HAVE_LIBJSON], 1, [Define to 1 if libjson is
 present])
      fi
 -    if test "$HAVE_JSON_C" = "yes"; then
 -            AC_DEFINE([HAVE_LIBJSON], 1, [Define to 1 if libjson is
 present])
 -            AC_DEFINE([HAVE_LIBJSON_C], 1, [Define to 1 if libjson
 resides in a json-c subdir])
 -            HAVE_JSON=yes
 -    fi

      AC_SUBST([JSON_CPPFLAGS])
      AC_SUBST([JSON_LDFLAGS])
      AC_SUBST([HAVE_JSON])
 -    AC_SUBST([HAVE_LIBJSON_C])

  fi

 diff --git a/liblwgeom/lwin_geojson.c b/liblwgeom/lwin_geojson.c
 index 30a5564e9..415e01134 100644
 --- a/liblwgeom/lwin_geojson.c
 +++ b/liblwgeom/lwin_geojson.c
 @@ -28,7 +28,7 @@
  #include "lwgeom_log.h"
  #include "../postgis_config.h"

 -#if defined(HAVE_LIBJSON) || defined(HAVE_LIBJSON_C) /* --{ */
 +#if defined(HAVE_LIBJSON) /* --{ */

  #define JSON_C_VERSION_013 (13 << 8)

 @@ -403,7 +403,7 @@ parse_geojson(json_object *geojson, int *hasz)
         return NULL; /* Never reach */
  }

 -#endif /* HAVE_LIBJSON or HAVE_LIBJSON_C --} */
 +#endif /* HAVE_LIBJSON --} */

  LWGEOM *
  lwgeom_from_geojson(const char *geojson, char **srs)
 diff --git a/postgis/lwgeom_in_geojson.c b/postgis/lwgeom_in_geojson.c
 index 9d8bd7750..08b52a7e2 100644
 --- a/postgis/lwgeom_in_geojson.c
 +++ b/postgis/lwgeom_in_geojson.c
 @@ -32,7 +32,7 @@
  #include "liblwgeom.h"
  #include "lwgeom_export.h"

 -#if defined(HAVE_LIBJSON) || defined(HAVE_LIBJSON_C)
 +#if defined(HAVE_LIBJSON)

  #include <json.h>

 diff --git a/postgis_config.h.in b/postgis_config.h.in
 index 57afbecc0..abb6f3f02 100644
 --- a/postgis_config.h.in
 +++ b/postgis_config.h.in
 @@ -53,9 +53,6 @@
  /* Define to 1 if libjson is present */
  #undef HAVE_LIBJSON

 -/* Define to 1 if libjson resides in json-c subdir */
 -#undef HAVE_LIBJSON_C
 -
  /* Define to 1 if you have the `pq' library (-lpq). */
  #undef HAVE_LIBPQ
 }}}

-- 
Ticket URL: <https://trac.osgeo.org/postgis/ticket/4528#comment:6>
PostGIS <http://trac.osgeo.org/postgis/>
The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project.


More information about the postgis-tickets mailing list