[PATCH (3.4) 1/2] configure: Fix --with-json=json-c/json-glib handling.
The tests that decide whether the user wanted to select json-c or json-glib were a little bit off, which resulted in anything other than --with-json=auto failing. This has now been corrected. Reported-by: Peter Czanik <czanik@balabit.hu> Signed-off-by: Gergely Nagy <algernon@balabit.hu> --- configure.in | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/configure.in b/configure.in index 995c202..f766888 100644 --- a/configure.in +++ b/configure.in @@ -606,11 +606,11 @@ fi dnl *************************************************************************** dnl json headers/libraries dnl *************************************************************************** -if test "x$with_json" = "xauto" || test "x$with_json" = "json-c"; then - PKG_CHECK_MODULES(JSON_C, json >= $JSON_C_MIN_VERSION,, JSON_C_LIBS="") +if test "x$with_json" = "xauto" || test "x$with_json" = "xjson-c"; then + PKG_CHECK_MODULES(JSON_C, json >= $JSON_C_MIN_VERSION) fi -if test "x$with_json" = "xauto" || test "x$with_json" = "json-glib"; then - PKG_CHECK_MODULES(JSON_GLIB, json-glib-1.0 >= $JSON_GLIB_MIN_VERSION,, JSON_GLIB_LIBS="") +if test "x$with_json" = "xauto" || test "x$with_json" = "xjson-glib"; then + PKG_CHECK_MODULES(JSON_GLIB, json-glib-1.0 >= $JSON_GLIB_MIN_VERSION) fi dnl *************************************************************************** -- 1.7.9
Add support for --without-json and --with-json=no, so that JSON support can be explicitly disabled, even when the dependencies are otherwise available. Requested-by: Peter Czanik <czanik@balabit.hu> Signed-off-by: Gergely Nagy <algernon@balabit.hu> --- configure.in | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/configure.in b/configure.in index f766888..e9e09a8 100644 --- a/configure.in +++ b/configure.in @@ -890,7 +890,7 @@ if test "x$enable_mongodb" = "xauto"; then AC_MSG_RESULT([$enable_mongodb]) fi -if test "x$with_json" != "xjson-glib" -a "x$with_json" != "xjson-c" -a "x$with_json" != "xauto"; then +if test "x$with_json" != "xjson-glib" -a "x$with_json" != "xjson-c" -a "x$with_json" != "xauto" -a "x$with_json" != "xno"; then # unknown --with-json argument AC_MSG_ERROR([Unknown JSON implementation ($with_json) specified, only json-glib, json-c and auto is known]) @@ -909,7 +909,7 @@ elif test \( "x$with_json" = "xauto" -o "x$with_json" = "xjson-glib" \) -a -n "$ AC_DEFINE_UNQUOTED(HAVE_JSON_GLIB, 1, [Have json-glib]) with_json="json-glib" -elif test "x$with_json" = "xauto"; then +elif test "x$with_json" = "xauto" -o "x$with_json" = "xno"; then # nothing found, but autodetect was selected JSON_LIBS="" -- 1.7.9
One of the previous patches broke --with-json=auto, making configure try to detect BOTH json-c and json-glib, and failing if any of them were missing. Signed-off-by: Gergely Nagy <algernon@balabit.hu> --- configure.in | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/configure.in b/configure.in index e9e09a8..d1a6ae1 100644 --- a/configure.in +++ b/configure.in @@ -607,10 +607,10 @@ dnl *************************************************************************** dnl json headers/libraries dnl *************************************************************************** if test "x$with_json" = "xauto" || test "x$with_json" = "xjson-c"; then - PKG_CHECK_MODULES(JSON_C, json >= $JSON_C_MIN_VERSION) + PKG_CHECK_MODULES(JSON_C, json >= $JSON_C_MIN_VERSION,, JSON_C_LIBS="") fi if test "x$with_json" = "xauto" || test "x$with_json" = "xjson-glib"; then - PKG_CHECK_MODULES(JSON_GLIB, json-glib-1.0 >= $JSON_GLIB_MIN_VERSION) + PKG_CHECK_MODULES(JSON_GLIB, json-glib-1.0 >= $JSON_GLIB_MIN_VERSION,, JSON_GLIB_LIBS="") fi dnl *************************************************************************** -- 1.7.9
Signed-off-by: Gergely Nagy <algernon@balabit.hu> --- configure.in | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/configure.in b/configure.in index d1a6ae1..615c3f1 100644 --- a/configure.in +++ b/configure.in @@ -174,6 +174,10 @@ AC_ARG_WITH(json, Use the JSON implementation specified] ,,with_json="auto") +AC_ARG_ENABLE(json, + [ --disable-json Disable JSON support (default: auto)], + [case "${enableval}" in yes) with_json="auto";; *) with_json="${enableval}";; esac],with_json="auto") + AC_ARG_WITH(libesmtp, AC_HELP_STRING([--with-libesmtp=DIR], [use libesmtp library from (prefix) directory DIR]),,) -- 1.7.9
Hi, I've applied all four of these patches, but I've combined them into a single patch, hopefully I haven't broken it. Thanks Gergely. On Mon, 2012-03-26 at 17:48 +0200, Gergely Nagy wrote:
Signed-off-by: Gergely Nagy <algernon@balabit.hu> --- configure.in | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/configure.in b/configure.in index d1a6ae1..615c3f1 100644 --- a/configure.in +++ b/configure.in @@ -174,6 +174,10 @@ AC_ARG_WITH(json, Use the JSON implementation specified] ,,with_json="auto")
+AC_ARG_ENABLE(json, + [ --disable-json Disable JSON support (default: auto)], + [case "${enableval}" in yes) with_json="auto";; *) with_json="${enableval}";; esac],with_json="auto") + AC_ARG_WITH(libesmtp, AC_HELP_STRING([--with-libesmtp=DIR], [use libesmtp library from (prefix) directory DIR]),,)
-- Bazsi
participants (2)
-
Balazs Scheidler
-
Gergely Nagy