@@ -12,6 +12,12 @@ AC_ARG_WITH([zmq-headers],
12
12
[ ]
13
13
[ with_zmq_headers=default] )
14
14
15
+ AC_ARG_WITH ( [ pcre-config] ,
16
+ [ AC_HELP_STRING ([ --with-pcre-config] ,
17
+ [ Path to PCRE configuration for mqexec filtering] )] ,
18
+ [ pcre_config_prog=$withval] )
19
+ AC_PATH_PROG ( PCRE_CONFIG , [ pcre-config] , $pcre_config_prog )
20
+
15
21
AC_PROG_CC
16
22
AC_PROG_LIBTOOL
17
23
@@ -33,6 +39,21 @@ AC_FUNC_REALLOC
33
39
AC_FUNC_STRTOD
34
40
35
41
m4_include ( [ libev/libev.m4] )
42
+ if test "x$PCRE_CONFIG" != "x"; then
43
+ CFLAGS_SAVE=$CFLAGS
44
+ LIBS_SAVE=$LIBS
45
+ CFLAGS="$CFLAGS $($PCRE_CONFIG --cflags)"
46
+ LIBS="$LIBS $($PCRE_CONFIG --libs)"
47
+ AC_CHECK_HEADER ( [ pcre.h] , [ ] ,
48
+ AC_MSG_FAILURE ( [ PCRE was enabled but headers weren't found] ) , [ ] )
49
+ AC_CHECK_LIB ( [ pcre] , [ pcre_compile] , [ ] ,
50
+ AC_MSG_FAILURE ( [ PCRE was enabled but libraries weren't found] ) , [ ] )
51
+ CFLAGS=$CFLAGS_SAVE
52
+ LIBS=$LIBS_SAVE
53
+ AC_SUBST ( [ PCRE_HEADERS] , $ ( $PCRE_CONFIG -- cflags ))
54
+ AC_SUBST ( [ PCRE_LIBS] , $ ( $PCRE_CONFIG -- libs ))
55
+ AC_DEFINE ( [ HAVE_PCRE] , [ ] , [ PCRE Libraries are installed] )
56
+ fi
36
57
37
58
AC_CONFIG_FILES ( [ Makefile mods/Makefile dnxmq/Makefile] )
38
59
AC_CONFIG_SUBDIRS ( [ jansson] )
0 commit comments