1 dnl Check for PCRE Libraries
2 dnl CHECK_PCRE(ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND])
11 AC_DEFUN([CHECK_PCRE],
16 [AC_HELP_STRING([--with-pcre=PATH],[Path to pcre prefix or config script])],
17 [test_paths="${with_pcre}"],
18 [test_paths="/usr/local/libpcre /usr/local/pcre /usr/local /opt/libpcre /opt/pcre /opt /usr"])
20 AC_MSG_CHECKING([for libpcre config script])
22 dnl # Determine pcre lib directory
23 if test -z "${with_pcre}"; then
24 test_paths="/usr/local/pcre /usr/local /usr"
26 test_paths="${with_pcre}"
29 for x in ${test_paths}; do
30 dnl # Determine if the script was specified and use it directly
31 if test ! -d "$x" -a -e "$x"; then
37 dnl # Try known config script names/locations
38 for PCRE_CONFIG in pcre-config; do
39 if test -e "${x}/bin/${PCRE_CONFIG}"; then
42 elif test -e "${x}/${PCRE_CONFIG}"; then
49 if test -n "$pcre_path"; then
56 if test -n "${pcre_path}"; then
57 if test "${pcre_path}" != "no"; then
58 PCRE_CONFIG="${pcre_path}/${PCRE_CONFIG}"
60 AC_MSG_RESULT([${PCRE_CONFIG}])
61 PCRE_CFLAGS="`${PCRE_CONFIG} --cflags`"
62 if test "$verbose_output" -eq 1; then AC_MSG_NOTICE(pcre CFLAGS: $PCRE_CFLAGS); fi
63 PCRE_LIBS="`${PCRE_CONFIG} --libs`"
64 if test "$verbose_output" -eq 1; then AC_MSG_NOTICE(pcre LIBS: $PCRE_LIBS); fi
74 if test -z "${PCRE_LIBS}"; then
75 AC_MSG_NOTICE([*** pcre library not found.])
76 ifelse([$2], , AC_MSG_ERROR([pcre library is required]), $2)
78 AC_MSG_NOTICE([using '${PCRE_LIBS}' for pcre Library])