From 41d7430442d0f64bd6465ddc87e876856e405e93 Mon Sep 17 00:00:00 2001 From: theirix Date: Fri, 1 Apr 2016 17:18:23 +0300 Subject: Call configure with args from autogen --- autogen.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/autogen.sh b/autogen.sh index 6d4876e5f..492ef3bf6 100755 --- a/autogen.sh +++ b/autogen.sh @@ -30,4 +30,4 @@ if test -z $AUTORECONF; then fi autoreconf -ivf -./configure +./configure $* -- cgit v1.2.3 From 6f95182751bcaee42260cfffe8ab891fc4406b95 Mon Sep 17 00:00:00 2001 From: theirix Date: Fri, 1 Apr 2016 17:18:33 +0300 Subject: Improved detection of json-c package. - Improved detection code for json-c package to use pkg-config with custom search path that includes /usr/local - Added optional option --disable-json-c to disable json-c package for reducing runtime dependencies. --- configure.ac | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/configure.ac b/configure.ac index d2dfc4357..e65baea81 100644 --- a/configure.ac +++ b/configure.ac @@ -61,17 +61,20 @@ else fi fi -PKG_CONFIG=$(which pkg-config) - -if test -d /usr/local/include/json-c/; then : - CFLAGS="$CFLAGS -I/usr/local/include/json-c/" - LDFLAGS="$LDFLAGS -L/usr/local/lib -ljson-c" -else - if ! test -z "$PKG_CONFIG"; then : - CFLAGS="$CFLAGS $(pkg-config --cflags json-c)" - LDFLAGS="$LDFLAGS $(pkg-config --libs json-c)" - fi -fi +AC_ARG_ENABLE([json-c], + AS_HELP_STRING([--disable-json-c], [Disable json-c support])) + +AS_IF([test "x$enable_json_c" != "xno"], [ + PKG_CONFIG_PATH=/usr/local/share/pkgconfig:$PKG_CONFIG_PATH + pkg-config --exists json-c + AS_IF([test "$?" == "0"], + [ + CFLAGS="$CFLAGS $(pkg-config --cflags json-c)" + LDFLAGS="$LDFLAGS $(pkg-config --libs json-c)" + AC_CHECK_LIB(json-c, json_object_new_object, AC_DEFINE_UNQUOTED(HAVE_JSON_C, 1, [The JSON-C library is present])) + ], + []) + ]) OLD_LIBS=$LIBS LIBS="-L/opt/napatech3/lib $LIBS" @@ -81,7 +84,6 @@ AC_CHECK_LIB([ntapi], [], [] ) LIBS=$OLD_LIBS -AC_CHECK_LIB(json-c, json_object_new_object, AC_DEFINE_UNQUOTED(HAVE_JSON_C, 1, [The JSON-C library is present])) AC_CHECK_LIB(pthread, pthread_setaffinity_np, AC_DEFINE_UNQUOTED(HAVE_PTHREAD_SETAFFINITY_NP, 1, [libc has pthread_setaffinity_np])) -- cgit v1.2.3