mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-09-30 19:47:47 +03:00
Refactor code and build system to use libpcre2 as the default
This commit is contained in:
@@ -18,17 +18,17 @@ AC_DEFUN([CHECK_PCRE2],
|
||||
AC_ARG_WITH(
|
||||
pcre2,
|
||||
[AS_HELP_STRING([--with-pcre2=PATH],[Path to pcre2 prefix or config script])],
|
||||
, with_pcre2=no)
|
||||
[test_paths="${with_pcre2}"],
|
||||
[with_pcre2="yes"])
|
||||
|
||||
AS_CASE(["${with_pcre2}"],
|
||||
[no], [test_paths=],
|
||||
[yes], [test_paths="/usr/local/libpcre2 /usr/local/pcre2 /usr/local /opt/libpcre2 /opt/pcre2 /opt /usr"],
|
||||
[test_paths="${with_pcre2}"])
|
||||
[no], [test_paths=],
|
||||
[yes], [test_paths="/usr/local/libpcre2 /usr/local/pcre2 /usr/local /opt/libpcre2 /opt/pcre2 /opt /usr"],
|
||||
[test_paths="${with_pcre2}"])
|
||||
|
||||
if test "x${with_pcre2}" = "x" || test "x${with_pcre2}" = "xno"; then
|
||||
AC_MSG_NOTICE([pcre2 not specified; omitting check])
|
||||
if test "x${with_pcre}" != "x" || test "x${with_pcre}" != "xno"; then
|
||||
AC_MSG_NOTICE([pcre specified; omitting check for pcre2])
|
||||
else
|
||||
|
||||
AC_MSG_CHECKING([for libpcre2 config script])
|
||||
|
||||
for x in ${test_paths}; do
|
||||
@@ -86,8 +86,8 @@ else
|
||||
ifelse([$2], , AC_MSG_ERROR([pcre2 library is required]), $2)
|
||||
else
|
||||
AC_MSG_NOTICE([using pcre2 v${PCRE2_VERSION}])
|
||||
PCRE2_CFLAGS="-DWITH_PCRE2 ${PCRE2_CFLAGS}"
|
||||
ifelse([$1], , , $1)
|
||||
PCRE2_CFLAGS="${PCRE2_CFLAGS}"
|
||||
ifelse([$1], , , $1)
|
||||
fi
|
||||
fi
|
||||
])
|
||||
|
Reference in New Issue
Block a user