]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Added checks for libpcre
authorAlan T. DeKok <aland@freeradius.org>
Tue, 2 Sep 2014 21:41:51 +0000 (17:41 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Tue, 2 Sep 2014 21:41:51 +0000 (17:41 -0400)
configure
configure.ac
src/include/autoconf.h.in

index 0ad2c47c56b77d9aa987f702557d364b3e3b5f93..d7715de9f8c2d50737f9cac5cddba69f4cf4e37d 100755 (executable)
--- a/configure
+++ b/configure
@@ -10911,12 +10911,60 @@ $as_echo "#define HAVE_REGEX_H 1" >>confdefs.h
 
 $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=
 
 
index 798c72ccb44e138c5986548ada5c59a5d759a830..8a73bfafb795082d0753eb56f505baedb658f960 100644 (file)
@@ -1665,15 +1665,23 @@ FR_SMART_CHECK_INCLUDE(pcreposix.h)
 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
index d547ab0083fefcade8dbf69407773c0d4a2c7fe9..72182c4fefdac4c868f250612157d7fa0ed4ac01 100644 (file)
 /* Define to 1 if you have the `pcap' library (-lpcap). */
 #undef HAVE_LIBPCAP
 
+/* Define to use libpcre library */
+#undef HAVE_LIBPCRE
+
 /* Define if you have a readline compatible library */
 #undef HAVE_LIBREADLINE