fix https://gnunet.org/bugs/view.php?id=4746
authorSchanzenbach, Martin <martin.schanzenbach@aisec.fraunhofer.de>
Sun, 24 Jun 2018 18:25:16 +0000 (20:25 +0200)
committerSchanzenbach, Martin <martin.schanzenbach@aisec.fraunhofer.de>
Sun, 24 Jun 2018 18:25:16 +0000 (20:25 +0200)
configure.ac

index 204859556e8df808e054b6a48f980e0086f4731e..99eeeba8a53cf64086daae3bafa59f66b0f23d48 100644 (file)
@@ -409,7 +409,32 @@ fi
 
 # check for jansson library
 jansson=0
-AC_CHECK_HEADER([jansson.h],jansson=1)
+AC_MSG_CHECKING(for libjansson)
+AC_ARG_WITH(jansson,
+   [  --with-jansson=PFX    base of libjansson installation],
+   [AC_MSG_RESULT([$with_jansson])
+    case $with_jansson in
+      no)
+        ;;
+      yes)
+        AC_CHECK_HEADERS(jansson.h,
+          AC_CHECK_LIB([jansson], [json_loads],
+            jansson=1))
+        ;;
+      *)
+        LDFLAGS="-L$with_jansson/lib $LDFLAGS"
+        CPPFLAGS="-I$with_jansson/include $CPPFLAGS"
+        AC_CHECK_HEADERS(jansson.h,
+          AC_CHECK_LIB([jansson], [json_loads],
+            EXT_LIB_PATH="-L$with_jansson/lib $EXT_LIB_PATH"
+            jansson=1))
+        ;;
+    esac
+   ],
+   [AC_MSG_RESULT([--with-jansson not specified])
+    AC_CHECK_HEADERS(jansson.h,
+     AC_CHECK_LIB([jansson], [json_loads],
+      jansson=1))])
 AM_CONDITIONAL(HAVE_JANSSON, [test "$jansson" = 1])
 if test "x$jansson" = x1
 then
@@ -418,6 +443,7 @@ else
   AC_DEFINE([HAVE_JANSSON],[0],[Lacking jansson library])
 fi
 
+
 # check for libpulse(audio) library
 pulse=0
 AC_CHECK_LIB(pulse,pa_stream_peek,