1 dnl @synopsis AX_PATH_LIB_PCRE [(A/NA)]
3 dnl check for pcre lib and set PCRE_LIBS and PCRE_CFLAGS accordingly.
5 dnl also provide --with-pcre option that may point to the $prefix of
6 dnl the pcre installation - the macro will check $pcre/include and
7 dnl $pcre/lib to contain the necessary files.
9 dnl the usual two ACTION-IF-FOUND / ACTION-IF-NOT-FOUND are supported
10 dnl and they can take advantage of the LIBS/CFLAGS additions.
12 dnl @category InstalledPackages
13 dnl @author Guido U. Draheim <guidod@gmx.de>
14 dnl @version 2006-10-13
15 dnl @license GPLWithACException
17 AC_DEFUN([AX_PATH_LIB_PCRE],[dnl
18 AC_MSG_CHECKING([lib pcre])
20 [ --with-pcre[[=prefix]] compile xmlpcre part (via libpcre check)],,
22 if test ".$with_pcre" = ".no" ; then
23 AC_MSG_RESULT([disabled])
26 AC_MSG_RESULT([(testing)])
27 AC_CHECK_LIB(pcre, pcre_study)
28 if test "$ac_cv_lib_pcre_pcre_study" = "yes" ; then
30 AC_MSG_CHECKING([lib pcre])
31 AC_MSG_RESULT([$PCRE_LIBS])
34 OLDLDFLAGS="$LDFLAGS" ; LDFLAGS="$LDFLAGS -L$with_pcre/lib"
35 OLDCPPFLAGS="$CPPFLAGS" ; CPPFLAGS="$CPPFLAGS -I$with_pcre/include"
36 AC_CHECK_LIB(pcre, pcre_compile)
37 CPPFLAGS="$OLDCPPFLAGS"
39 if test "$ac_cv_lib_pcre_pcre_compile" = "yes" ; then
40 AC_MSG_RESULT(.setting PCRE_LIBS -L$with_pcre/lib -lpcre)
41 PCRE_LIBS="-L$with_pcre/lib -lpcre"
42 test -d "$with_pcre/include" && PCRE_CFLAGS="-I$with_pcre/include"
43 AC_MSG_CHECKING([lib pcre])
44 AC_MSG_RESULT([$PCRE_LIBS])
47 AC_MSG_CHECKING([lib pcre])
48 AC_MSG_RESULT([no, (WARNING)])
54 AC_SUBST([PCRE_CFLAGS])