summaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
authorDonatas Abraitis <donatas@opensourcerouting.org>2022-10-31 21:23:51 +0100
committerDonatas Abraitis <donatas@opensourcerouting.org>2022-11-07 20:23:53 +0100
commit061f5d1cb43938c30847e0ebb49e2b43be3aa4c2 (patch)
tree5651724c843b645650c1a025c4223f6b29eeddfe /configure.ac
parentdocker: Reuse all possible cores when building FRR for Alpine (diff)
downloadfrr-061f5d1cb43938c30847e0ebb49e2b43be3aa4c2.tar.xz
frr-061f5d1cb43938c30847e0ebb49e2b43be3aa4c2.zip
lib: Add PCRE2 support
Some results: ``` ==== PCRE ==== % ./a.out "^65001" "65001" comparing: ^65001 / 65001 ret status: 0 [14:31] donatas-pc donatas /home/donatas % ./a.out "^65001_" "65001" comparing: ^65001_ / 65001 ret status: 0 ===== PCRE2 ===== % ./a.out "^65001" "65001" comparing: ^65001 / 65001 ret status: 0 [14:30] donatas-pc donatas /home/donatas % ./a.out "^65001_" "65001" comparing: ^65001_ / 65001 ret status: 1 ``` Seems that if using PCRE2, we need to escape outer `()` chars and `|`. Sounds like a bug. But this is only with some older PCRE2 versions. With >= 10.36, I wasn't able to reproduce this, everything is fine and working as expected. Adding _FRR_PCRE2_POSIX definition because pcre2posix.h does not have include's guard. Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac12
1 files changed, 12 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 1a481ecd7..97c8ca451 100644
--- a/configure.ac
+++ b/configure.ac
@@ -712,6 +712,8 @@ AC_ARG_ENABLE([cpu-time],
AS_HELP_STRING([--disable-cpu-time], [disable cpu usage data gathering]))
AC_ARG_ENABLE([pcreposix],
AS_HELP_STRING([--enable-pcreposix], [enable using PCRE Posix libs for regex functions]))
+AC_ARG_ENABLE([pcre2posix],
+ AS_HELP_STRING([--enable-pcre2posix], [enable using PCRE2 Posix libs for regex functions]))
AC_ARG_ENABLE([fpm],
AS_HELP_STRING([--enable-fpm], [enable Forwarding Plane Manager support]))
AC_ARG_ENABLE([werror],
@@ -1659,6 +1661,16 @@ if test "$enable_pcreposix" = "yes"; then
fi
AC_SUBST([HAVE_LIBPCREPOSIX])
+dnl ---------------------------
+dnl check system has PCRE2 regexp
+dnl ---------------------------
+if test "$enable_pcre2posix" = "yes"; then
+ AC_CHECK_LIB([pcre2-posix], [regexec], [], [
+ AC_MSG_ERROR([--enable-pcre2posix given but unable to find libpcre2-posix])
+ ])
+fi
+AC_SUBST([HAVE_LIBPCRE2_POSIX])
+
dnl ##########################################################################
dnl test "$enable_clippy_only" != "yes"
fi