diff options
author | Luca Deri <lucaderi@thor.caida.org> | 2017-05-24 10:11:04 -0700 |
---|---|---|
committer | Luca Deri <lucaderi@thor.caida.org> | 2017-05-24 10:11:04 -0700 |
commit | e1efee8594ac0a2f18e3888dba4423bcdcbab085 (patch) | |
tree | 19db7f5f09ffb5887e7a9fe0be59b83125ed99e2 | |
parent | 993605d4f38e6e63a9ca6fee14a60688ae9df0de (diff) |
Added check for searching JSON-C in home directory if not installed
Fixed type
-rw-r--r-- | configure.ac | 10 | ||||
-rw-r--r-- | example/ndpiReader.c | 2 |
2 files changed, 10 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac index 825c7b56e..1507cc43b 100644 --- a/configure.ac +++ b/configure.ac @@ -79,7 +79,15 @@ AS_IF([test "x$enable_json_c" != "xno"], [ 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])) ], - []) + [ + JSONC_HOME="$HOME/json-c" + if test -d "$JSONC_HOME"; then : + CFLAGS="$CFLAGS -I $JSONC_HOME" + LDFLAGS="$LDFLAGS $JSONC_HOME/.libs/libjson-c.a" + AC_MSG_RESULT([Found json-c in $JSONC_HOME]) + AC_DEFINE_UNQUOTED(HAVE_JSON_C, 1, [The JSON-C library is present]) + fi + ]) ]) AC_CHECK_LIB(pthread, pthread_setaffinity_np, AC_DEFINE_UNQUOTED(HAVE_PTHREAD_SETAFFINITY_NP, 1, [libc has pthread_setaffinity_np])) diff --git a/example/ndpiReader.c b/example/ndpiReader.c index 6184ea380..c00d630f0 100644 --- a/example/ndpiReader.c +++ b/example/ndpiReader.c @@ -1314,7 +1314,7 @@ static void saveTopStats(FILE *fp, struct top_stats *stats, int direction, u_int } } - json_object_object_add(jsMain, (direction == DIR_SRC) ? "top.src.pckt.stats" : "top.dst.pckt.stats", jArray_filters); + json_object_object_add(jsMain, (direction == DIR_SRC) ? "top.src.pkts.stats" : "top.dst.pkts.stats", jArray_filters); /*sort top stats by ip addr count*/ HASH_SORT(stats, top_stats_sort); |