@@ -7,43 +7,24 @@ AC_ARG_WITH(libmodsecurity,
7
7
[ FILE is the path to libmodsecurity install dir; defaults to "/usr/local/modsecurity/".] ) ] ,
8
8
[
9
9
if test "$withval" = "yes"; then
10
- V3PATH=/usr/local/modsecurity/
10
+ AC_SUBST ( CPPFLAGS , "$CPPFLAGS - I/usr/local/modsecurity/include/ - L/usr/local/modsecurity/lib/" )
11
+ V3INCLUDE="/usr/local/modsecurity/include/"
12
+ V3LIB="/usr/local/modsecurity/lib/"
11
13
else
12
- V3PATH="$withval"
13
- if test -f "${V3PATH}lib/libmodsecurity.so"; then
14
- V3LIB="${V3PATH}lib/"
15
- fi
16
- if test -f "${V3PATH}include/modsecurity/modsecurity.h"; then
17
- V3INCLUDE="${V3PATH}include/"
18
- fi
14
+ AC_SUBST ( CPPFLAGS , "$CPPFLAGS - I${withval}/include/ - L${withval}/lib/" )
15
+ V3INCLUDE="${withval}/include/"
16
+ V3LIB="${withval}/lib/"
19
17
fi
20
18
] )
21
19
22
- if test -z "$V3PATH"; then
23
- for i in /usr/local/modsecurity/ \
24
- /usr/local/sbin \
25
- /usr/local/bin \
26
- /usr/sbin \
27
- /usr/bin \
28
- /usr;
29
- do
30
- if test -f "$i/lib/libmodsecurity.so"; then
31
- V3LIB="$i/lib/"
32
- fi
33
- if test -f "$i/lib64/libmodsecurity.so"; then
34
- V3LIB="$i/lib64/"
35
- fi
36
- if test -f "$i/include/modsecurity/modsecurity.h"; then
37
- V3INCLUDE="$i/include/"
38
- # TODO: test if V3LIB is set
39
- break
40
- fi
41
- done
42
- fi
43
- if test -n "$V3LIB" -a "$V3LIB" != "no" -a -x "$V3LIB" ; then
44
- AC_MSG_NOTICE ( found libmodsecurity at $V3LIB )
45
- else
46
- AC_MSG_ERROR ( couldn't find libmodsecurity )
47
- fi
20
+ dnl Check the ModSecurity libraries (modsecurity)
21
+
22
+ AC_CHECK_LIB ( [ modsecurity] , [ msc_init] , [
23
+ AC_DEFINE ( [ HAVE_MODSECURITYLIB] , [ 1] ,
24
+ [ Define to 1 if you have the `libmodsecurity' library (-lmodsecurity).] ) ] , [
25
+ AC_MSG_ERROR ( [ ModSecurity libraries not found!] ) ] )
26
+
27
+ AC_CHECK_HEADERS ( [ modsecurity/modsecurity.h] , [ ] , [
28
+ AC_MSG_ERROR ( [ ModSecurity headers not found...] ) ] )
48
29
] )
49
30
0 commit comments