$as_echo "#define HAVE_PCREPOSIX_H 1" >>confdefs.h
- REGEX=yes
- REGEX_EXTENDED=yes
- REGEX_PCRE=yes
- LIBS="-lpcre -lpcreposix $LIBS"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pcre_compile in -lpcre" >&5
+$as_echo_n "checking for pcre_compile in -lpcre... " >&6; }
+if ${ac_cv_lib_pcre_pcre_compile+:} false; then :
+ $as_echo_n "(cached) " >&6
else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lpcre $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char pcre_compile ();
+int
+main ()
+{
+return pcre_compile ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_pcre_pcre_compile=yes
+else
+ ac_cv_lib_pcre_pcre_compile=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pcre_pcre_compile" >&5
+$as_echo "$ac_cv_lib_pcre_pcre_compile" >&6; }
+if test "x$ac_cv_lib_pcre_pcre_compile" = xyes; then :
+
+
+$as_echo "#define HAVE_LIBPCRE 1" >>confdefs.h
+
+ REGEX=yes
+ REGEX_EXTENDED=yes
+ REGEX_PCRE=yes
+ LIBS="-lpcre -lpcreposix $LIBS"
+
+
+fi
+
+
+fi
+
+if test "x$REGEX" != "xyes"; then
smart_try_dir=
if test "x$ac_cv_header_pcreposix_h" = "xyes"; then
AC_DEFINE(HAVE_REGEX_H, [1], [define if we have any regex])
AC_DEFINE(HAVE_PCREPOSIX_H, [1], [define this if we have the <pcreposix.h> header file])
- REGEX=yes
- REGEX_EXTENDED=yes
- REGEX_PCRE=yes
- LIBS="-lpcre -lpcreposix $LIBS"
+
+ AC_CHECK_LIB(pcre, pcre_compile,
+ [
+ AC_DEFINE(HAVE_LIBPCRE, 1, [Define to use libpcre library])
+ REGEX=yes
+ REGEX_EXTENDED=yes
+ REGEX_PCRE=yes
+ LIBS="-lpcre -lpcreposix $LIBS"
+ ]
+ )
dnl #
-dnl # Then fallback to POSIX regular expressions
+dnl # If no pcre, fallback to POSIX regular expressions
dnl #
-else
+fi
+
+if test "x$REGEX" != "xyes"; then
smart_try_dir=
FR_SMART_CHECK_INCLUDE(regex.h)
if test "x$ac_cv_header_regex_h" = "xyes"; then