summaryrefslogtreecommitdiff
blob: a1b3fb290f501f91b60e59a90679fd6412d43704 (plain)
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
49
50
51
52
53
--- a/configure.ac
+++ b/configure.ac
@@ -192,29 +192,15 @@ If you're not interested in libesmtp sup
        fi
 
 if test "$LOGNORM" = "yes"; then
-       AC_MSG_RESULT([------- liblognorm support is enabled -------])
-       AC_CHECK_HEADER([liblognorm.h])
-       AC_CHECK_HEADERS([json/json.h json.h], [break], [AC_MSG_ERROR([json-c headers not found or not usable.
-This library is important for the correlation aspects of Sagan! Please see
-https://wiki.quadrantsec.com/bin/view/Main/LibLogNorm. To disable this feature
-use the --disable-lognorm flag.])]) 
-       AC_CHECK_LIB(estr, main,,AC_MSG_ERROR(The libestr library cannot be found.
-This library is important for the correlation aspects of Sagan! Please see
-https://wiki.quadrantsec.com/bin/view/Main/LibLogNorm. To disable this feature
-use the --disable-lognorm flag. ))
-       AC_CHECK_LIB(ee, main,,AC_MSG_ERROR(The libee library cannot be found.
-This library is important for the correlation aspects of Sagan! Please see
-https://wiki.quadrantsec.com/bin/view/Main/LibLogNorm. To disable this feature
-use the --disable-lognorm flag. ))
-       AC_CHECK_LIB(lognorm, main,,AC_MSG_ERROR(The liblognorm library cannot be found.
-This library is important for the correlation aspects of Sagan! Please see
-https://wiki.quadrantsec.com/bin/view/Main/LibLogNorm. To disable this feature
-use the --disable-lognorm flag. ))
-       AC_CHECK_LIB(json, json_object_put,, [ AC_CHECK_LIB(json-c, json_object_put,,AC_MSG_ERROR(The json library cannot be found.
-This library is important for the correlation aspects of Sagan! Please see
-https://wiki.quadrantsec.com/bin/view/Main/LibLogNorm. To disable this feature
-use the --disable-lognorm flag.)) ],)
-       fi
+	AC_MSG_RESULT([------- liblognorm support is enabled -------])
+
+	PKG_CHECK_MODULES(LIBEE, libee >= 0.3.2)
+	PKG_CHECK_MODULES(LIBESTR, libestr >= 0.1.9)
+	PKG_CHECK_MODULES([JSON_C], [json-c],, [
+		PKG_CHECK_MODULES([JSON_C], [json],,)
+	])
+	PKG_CHECK_MODULES(LIBLOGNORM, lognorm >= 1.0.2)
+fi
 
 if test "$LIBPCAP" = "yes"; then
        AC_MSG_RESULT([------- libpcap support is enabled -------])
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -2,6 +2,9 @@ AUTOMAKE_OPIONS=foreign no-dependencies
 
 bin_PROGRAMS = sagan
 
+sagan_CFLAGS = $(JSON_C_CFLAGS) $(LIBESTR_CFLAGS) $(LIBLOGNORM_CFLAGS)
+sagan_LDFLAGS = $(JSON_C_LIBS) $(LIBESTR_LIBS) $(LIBLOGNORM_LIBS)
+
 sagan_SOURCES = sagan.c \
 sagan-classifications.c \
 sagan-config.c \