From 7d6fa1f2dcf87f485a1c07cadbbdf090b11649dd Mon Sep 17 00:00:00 2001 From: Amos Jeffries Date: Sun, 29 Dec 2024 20:34:13 +1300 Subject: [PATCH] Add --with-regex build option --- configure.ac | 16 ++++++++++------ doc/release-notes/release-7.sgml.in | 6 ++++++ src/Makefile.am | 16 ++++++++-------- 3 files changed, 24 insertions(+), 14 deletions(-) diff --git a/configure.ac b/configure.ac index 3b06f8bae72..73b76f08a5b 100644 --- a/configure.ac +++ b/configure.ac @@ -1772,7 +1772,6 @@ AC_CHECK_HEADERS( \ poll.h \ priv.h \ pwd.h \ - regex.h \ sched.h \ siginfo.h \ signal.h \ @@ -2148,9 +2147,6 @@ AC_CHECK_FUNCS(\ pthread_setschedparam \ pthread_sigmask \ putenv \ - regcomp \ - regexec \ - regfree \ res_init \ __res_init \ rint \ @@ -2387,8 +2383,16 @@ AS_IF([test "x$enable_zph_qos" = "xyes"],[ [Enable support for QOS netfilter mark preservation]) ]) -AC_CHECK_LIB(regex, regexec, [REGEXLIB="-lregex"],[REGEXLIB='']) -AC_SUBST(REGEXLIB) +dnl Look for libregex with regcomp() API +SQUID_AUTO_LIB(regex,[GNU Regex],[LIBREGEX]) +SQUID_CHECK_LIB_WORKS(regex,[ + PKG_CHECK_MODULES([LIBREGEX],[libregex],[:],[:]) + CPPFLAGS="$LIBREGEX_CFLAGS $CPPFLAGS" + LIBS="$LIBREGEX_PATH $LIBREGEX_LIBS $LIBS" + AC_CHECK_HEADERS([regex.h],[ + LIBREGEX_LIBS="$LIBREGEX_PATH -lregex" + ]) +]) SQUID_DETECT_UDP_SND_BUFSIZE SQUID_DETECT_UDP_RECV_BUFSIZE diff --git a/doc/release-notes/release-7.sgml.in b/doc/release-notes/release-7.sgml.in index 0b46f76e917..cbb455d862b 100644 --- a/doc/release-notes/release-7.sgml.in +++ b/doc/release-notes/release-7.sgml.in @@ -262,6 +262,12 @@ This section gives an account of those changes in three categories: New options