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

PostGIS trac at osgeo.org
Mon Oct 7 04:34:18 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):

 Still doesn't work. Looks like AC_CHECK_LIB fails because $LIBS does not
 include -L$JSONDIR/lib

 I took inspiration from configure.ac from 2.5.3, and came up with the
 following (which works on my machine):
 {{{
 --- a/configure.ac
 +++ b/configure.ac
 @@ -929,19 +929,23 @@ if test "$CHECK_JSON" != "no"; then
              else
                      AC_MSG_RESULT([Using user-specified json-c directory:
 $JSONDIR])

 +                    JSON_LDFLAGS="-L$JSONDIR/lib"
 +                    LIBS_SAVE="$LIBS"
 +                    LIBS="$JSON_LDFLAGS"
                      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="-L$JSONDIR/lib
 -ljson-c"])
 +                                    AC_CHECK_LIB([json-c],
 [json_object_get], [HAVE_JSON_C=yes; JSON_LDFLAGS="${JSON_LDFLAGS}
 -ljson-c"])
                                  ],
                                  [
 AC_CHECK_FILE("$JSONDIR/include/json/json.h",
                                      [
 JSON_CPPFLAGS="-I$JSONDIR/include/json"
 -                                        AC_CHECK_LIB([json],
 [json_object_get], [HAVE_JSON=yes; JSON_LDFLAGS="-L$JSONDIR/lib -ljson"])
 +                                        AC_CHECK_LIB([json],
 [json_object_get], [HAVE_JSON=yes; JSON_LDFLAGS="${JSON_LDFLAGS} -ljson"])
                                      ],
                                      [AC_MSG_ERROR([Could not find header:
 json.h])])
                                  ])
 +                    LIBS="$LIBS_SAVE"
              fi
      elif test ! -z "$PKG_CONFIG"; then
         PKG_CHECK_MODULES([JSONC], [json-c], [

 }}}

-- 
Ticket URL: <https://trac.osgeo.org/postgis/ticket/4528#comment:3>
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