aboutsummaryrefslogtreecommitdiffstats
path: root/testing/captagent/build.patch
blob: c4976559ccd072455b9f0a0cdcc52d2de80b4630 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
diff --git a/configure.ac b/configure.ac
index 525738c..4fbfa5b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -147,15 +147,8 @@ fi
 AC_CHECK_LIB(expat, XML_ParserCreate, , [AC_MSG_ERROR([captagent requires but cannot find libexpat])])
 AC_CHECK_LIB(pcap, pcap_open_live, ,[AC_CHECK_LIB(wpcap, pcap_open_live, ,[AC_MSG_ERROR([captagent requires but cannot find libpcap])])])
 
-AC_CHECK_LIB(json, json_object_get,[ JSON_LIBS="-ljson" ],[
-AC_CHECK_LIB(json-c, json_object_get,[ JSON_LIBS="-ljson-c" ],[
-echo "ERROR:  You need libjson to build CaptAgent API module.";
-echo "        Verify that you have libjson.a or libjson.so installed";
-echo "        If it is in a different directory, try using";
-echo "        the LDFLAGS to set its proper path.";
-AC_MSG_ERROR([Fatal:  libjson not found.])])])
-
-AC_CHECK_LIB(fl, yywrap, [ FLEX_LIBS="-lfl" ] , [AC_MSG_ERROR([captagent requires but cannot find libfl])])
+PKG_CHECK_MODULES(JSON, json-c)
+FLEX_LIBS="-lfl"
 
 AC_SUBST(PTHREAD_LIBS)
 AC_SUBST(DL_LIBS)
diff --git a/src/modules/transport/json/Makefile.am b/src/modules/transport/json/Makefile.am
index 5778a67..db5078e 100644
--- a/src/modules/transport/json/Makefile.am
+++ b/src/modules/transport/json/Makefile.am
@@ -4,7 +4,7 @@ SUBDIRS = .
 noinst_HEADERS = transport_json.h
 #
 transport_json_la_SOURCES = transport_json.c
-transport_json_la_CFLAGS = -Wall ${MODULE_CFLAGS}
+transport_json_la_CFLAGS = -Wall ${MODULE_CFLAGS} ${JSON_CFLAGS}
 transport_json_la_LDFLAGS = -module -avoid-version
 transport_json_la_LIBADD = ${PTHREAD_LIBS} ${EXPAT_LIBS} ${JSON_LIBS}
 transport_json_laconfdir = $(confdir)
diff --git a/src/modules/transport/json/transport_json.c b/src/modules/transport/json/transport_json.c
index 4c7ed4b..c6d3691 100644
--- a/src/modules/transport/json/transport_json.c
+++ b/src/modules/transport/json/transport_json.c
@@ -41,7 +41,7 @@
 #include <signal.h>
 #include <time.h>
 #include <pthread.h>
-#include <json/json.h>
+#include <json.h>
 
 #ifndef __FAVOR_BSD
 #define __FAVOR_BSD