]> git.proxmox.com Git - mirror_frr.git/commitdiff
[configure] add configure support for PCRE Posix library
authorJeremy Jackson <jerj@coplanar.net>
Mon, 12 Jan 2009 21:06:12 +0000 (16:06 -0500)
committerPaul Jakma <paul@quagga.net>
Fri, 19 Jun 2009 14:01:16 +0000 (15:01 +0100)
Debian tried unsuccessfully to build with libpcreposix.  This adds proper
support to autoconf/configure.ac for it.

Based on the patch by C.J.  Adams-Collier in bug #483.

bgpd/bgp_{regex,routemap}.h: Pull in PCRE POSIX header if available.

bgpd/bgp_regex.h
bgpd/bgp_routemap.c
configure.ac

index 176b65a1069ac57cfc59e1b4b4155d1e4ec1b3d1..9fc832229aeeb93aee83677af78708b6728dfee0 100644 (file)
@@ -23,11 +23,15 @@ Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 
 #include <zebra.h>
 
-#ifdef HAVE_GNU_REGEX
-#include <regex.h>
+#ifdef HAVE_LIBPCREPOSIX
+# include <pcreposix.h>
 #else
-#include "regex-gnu.h"
-#endif /* HAVE_GNU_REGEX */
+# ifdef HAVE_GNU_REGEX
+#  include <regex.h>
+# else
+#  include "regex-gnu.h"
+# endif /* HAVE_GNU_REGEX */
+#endif /* HAVE_LIBPCREPOSIX */
 
 extern void bgp_regex_free (regex_t *regex);
 extern regex_t *bgp_regcomp (const char *str);
index 4fff0268e6bc808e777a82ec160ccee1d4f75bf9..aa7dbce1fecc3dc2ba1d841d27f3ad91806f947a 100644 (file)
@@ -28,11 +28,15 @@ Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 #include "plist.h"
 #include "memory.h"
 #include "log.h"
-#ifdef HAVE_GNU_REGEX
-#include <regex.h>
+#ifdef HAVE_LIBPCREPOSIX
+# include <pcreposix.h>
 #else
-#include "regex-gnu.h"
-#endif /* HAVE_GNU_REGEX */
+# ifdef HAVE_GNU_REGEX
+#  include <regex.h>
+# else
+#  include "regex-gnu.h"
+# endif /* HAVE_GNU_REGEX */
+#endif /* HAVE_LIBPCREPOSIX */
 #include "buffer.h"
 #include "sockunion.h"
 
index 3ac8384f555f92397279e826ca820674a22266ee..0b8724ee7b1d6123f4e6dc098c3910d96653a057 100755 (executable)
@@ -253,6 +253,8 @@ AC_ARG_ENABLE(gcc-rdynamic,
 [  --enable-gcc-rdynamic   enable gcc linking with -rdynamic for better backtraces])
 AC_ARG_ENABLE(time-check,
 [  --disable-time-check          disable slow thread warning messages])
+AC_ARG_ENABLE(pcreposix,
+[  --enable-pcreposix          enable using PCRE Posix libs for regex functions])
 
 if test x"${enable_gcc_ultra_verbose}" = x"yes" ; then
   CFLAGS="${CFLAGS} -W -Wcast-qual -Wstrict-prototypes"
@@ -1258,14 +1260,25 @@ AC_CHECK_FUNC(__inet_ntop, AC_DEFINE(HAVE_INET_NTOP,,__inet_ntop))
 AC_CHECK_FUNC(__inet_pton, AC_DEFINE(HAVE_INET_PTON,,__inet_pton))
 AC_CHECK_FUNC(__inet_aton, AC_DEFINE(HAVE_INET_ATON,,__inet_aton))
 
+dnl ---------------------------
+dnl check system has PCRE regexp
+dnl ---------------------------
+if test "x$enable_pcreposix" = "xyes"; then
+  AC_CHECK_LIB(pcreposix, pcreposix_regexec, ,[enable_pcreposix=no
+  AC_MSG_WARN([*** falling back to other regex library ***]) ])
+fi
+
+if test "x$enable_pcreposix" != "xyes"; then
 dnl ---------------------------
 dnl check system has GNU regexp
 dnl ---------------------------
-dnl AC_MSG_CHECKING(whether system has GNU regex)
+AC_MSG_CHECKING(whether system has GNU regex)
 AC_CHECK_LIB(c, regexec,
 [AC_DEFINE(HAVE_GNU_REGEX,,GNU regexp library)
  LIB_REGEX=""],
 [LIB_REGEX="regex.o"])
+fi
+AC_SUBST(HAVE_LIBPCREPOSIX)
 AC_SUBST(LIB_REGEX)
 
 dnl ------------------