diff --git a/configure b/configure index 27c770f3f..b79dd3231 100755 --- a/configure +++ b/configure @@ -643,11 +643,11 @@ CARES_LIBS CARES_CFLAGS ARGON2_LIBS ARGON2_CFLAGS +PCRE2_LIBS +PCRE2_CFLAGS PKG_CONFIG_LIBDIR PKG_CONFIG_PATH PKG_CONFIG -PCRE2_LIBS -PCRE2_CFLAGS FD_SETSIZE LDFLAGS_PRIVATELIBS PIDFILE @@ -1456,7 +1456,7 @@ Optional Packages: Require opers to invite themselves to +s/+p channels --with-disable-extendedban-stacking Disable extended ban stacking - --with-system-pcre2 Use the system pcre2 package instead of bundled, + --without-system-pcre2 Use the system pcre2 package instead of bundled, discovered using pkg-config --without-system-argon2 Use bundled version instead of system argon2 library. Normally autodetected via pkg-config @@ -8460,7 +8460,7 @@ fi if test "${with_system_pcre2+set}" = set; then : withval=$with_system_pcre2; else - with_system_pcre2=no + with_system_pcre2=yes fi @@ -8839,6 +8839,7 @@ done export PATH_SEPARATOR +has_system_pcre2="no" @@ -8959,46 +8960,7 @@ $as_echo "no" >&6; } PKG_CONFIG="" fi fi -if test "x$with_system_pcre2" = "xno"; then : - -pcre2_version="10.32" -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: extracting PCRE2 regex library" >&5 -$as_echo "extracting PCRE2 regex library" >&6; } -cur_dir=`pwd` -cd extras -rm -rf pcre2-$pcre2_version pcre2 -if test "x$ac_cv_path_GUNZIP" = "x" ; then - tar xfz pcre2.tar.gz -else - cp pcre2.tar.gz pcre2.tar.gz.bak - gunzip -f pcre2.tar.gz - cp pcre2.tar.gz.bak pcre2.tar.gz - tar xf pcre2.tar -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: configuring PCRE2 regex library" >&5 -$as_echo "configuring PCRE2 regex library" >&6; } -cd pcre2-$pcre2_version -./configure --enable-jit --enable-shared --disable-unicode --prefix=$cur_dir/extras/pcre2 --libdir=$PRIVATELIBDIR || exit 1 -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: compiling PCRE2 regex library" >&5 -$as_echo "compiling PCRE2 regex library" >&6; } -$ac_cv_prog_MAKER || exit 1 -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: installing PCRE2 regex library" >&5 -$as_echo "installing PCRE2 regex library" >&6; } -$ac_cv_prog_MAKER install || exit 1 -PCRE2_CFLAGS="-I$cur_dir/extras/pcre2/include" - - -PCRE2_LIBS= -if test -n "$ac_cv_path_PKGCONFIG"; then : - PCRE2_LIBS="`$ac_cv_path_PKGCONFIG --libs libpcre2-8.pc`" -fi -if test -z "$PCRE2_LIBS"; then : - PCRE2_LIBS="$PRIVATELIBDIR/libpcre2-8.so" -fi - -cd $cur_dir - -else +if test "x$with_system_pcre2" = "xyes"; then : pkg_failed=no @@ -9059,38 +9021,60 @@ fi # Put the nasty error message in config.log where it belongs echo "$PCRE2_PKG_ERRORS" >&5 - as_fn_error $? "Package requirements (libpcre2-8 >= 10.00) were not met: - -$PCRE2_PKG_ERRORS - -Consider adjusting the PKG_CONFIG_PATH environment variable if you -installed software in a non-standard prefix. - -Alternatively, you may set the environment variables PCRE2_CFLAGS -and PCRE2_LIBS to avoid the need to call pkg-config. -See the pkg-config man page for more details." "$LINENO" 5 + has_system_pcre2=no elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it -is in your PATH or set the PKG_CONFIG environment variable to the full -path to pkg-config. - -Alternatively, you may set the environment variables PCRE2_CFLAGS -and PCRE2_LIBS to avoid the need to call pkg-config. -See the pkg-config man page for more details. - -To get pkg-config, see . -See \`config.log' for more details" "$LINENO" 5; } + has_system_pcre2=no else PCRE2_CFLAGS=$pkg_cv_PCRE2_CFLAGS PCRE2_LIBS=$pkg_cv_PCRE2_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } - + has_system_pcre2=yes +if test "x$PRIVATELIBDIR" != "x"; then : + rm -f "$PRIVATELIBDIR/"libpcre2* fi +fi +fi + +if test "$has_system_pcre2" = "no"; then : + +pcre2_version="10.32" +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: extracting PCRE2 regex library" >&5 +$as_echo "extracting PCRE2 regex library" >&6; } +cur_dir=`pwd` +cd extras +rm -rf pcre2-$pcre2_version pcre2 +if test "x$ac_cv_path_GUNZIP" = "x" ; then + tar xfz pcre2.tar.gz +else + cp pcre2.tar.gz pcre2.tar.gz.bak + gunzip -f pcre2.tar.gz + cp pcre2.tar.gz.bak pcre2.tar.gz + tar xf pcre2.tar +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: configuring PCRE2 regex library" >&5 +$as_echo "configuring PCRE2 regex library" >&6; } +cd pcre2-$pcre2_version +./configure --enable-jit --enable-shared --disable-unicode --prefix=$cur_dir/extras/pcre2 --libdir=$PRIVATELIBDIR || exit 1 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: compiling PCRE2 regex library" >&5 +$as_echo "compiling PCRE2 regex library" >&6; } +$ac_cv_prog_MAKER || exit 1 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: installing PCRE2 regex library" >&5 +$as_echo "installing PCRE2 regex library" >&6; } +$ac_cv_prog_MAKER install || exit 1 +PCRE2_CFLAGS="-I$cur_dir/extras/pcre2/include" + +PCRE2_LIBS= +if test -n "$ac_cv_path_PKGCONFIG"; then : + PCRE2_LIBS="`$ac_cv_path_PKGCONFIG --libs libpcre2-8.pc`" +fi +if test -z "$PCRE2_LIBS"; then : + PCRE2_LIBS="$PRIVATELIBDIR/libpcre2-8.so" +fi + +cd $cur_dir fi diff --git a/configure.ac b/configure.ac index 6d0db616f..a21abc652 100644 --- a/configure.ac +++ b/configure.ac @@ -692,7 +692,7 @@ AC_ARG_WITH(operoverride-verify, [AS_HELP_STRING([--with-operoverride-verify], [ AC_ARG_WITH(disable-extendedban-stacking, [AS_HELP_STRING([--with-disable-extendedban-stacking], [Disable extended ban stacking])], [AS_IF([test $withval = "yes"], [AC_DEFINE([DISABLE_STACKED_EXTBANS], [], [Define to disable extended ban stacking (~q:~c:\#chan, etc)])])]) -AC_ARG_WITH(system-pcre2, [AS_HELP_STRING([--with-system-pcre2], [Use the system pcre2 package instead of bundled, discovered using pkg-config])], [], [with_system_pcre2=no]) +AC_ARG_WITH(system-pcre2, [AS_HELP_STRING([--without-system-pcre2], [Use the system pcre2 package instead of bundled, discovered using pkg-config])], [], [with_system_pcre2=yes]) AC_ARG_WITH(system-argon2, [AS_HELP_STRING([--without-system-argon2], [Use bundled version instead of system argon2 library. Normally autodetected via pkg-config])], [], [with_system_argon2=yes]) AC_ARG_WITH(system-cares, [AS_HELP_STRING([--without-system-cares], [Use bundled version instead of system c-ares. Normally autodetected via pkg-config.])], [], [with_system_cares=yes]) CHECK_SSL @@ -757,7 +757,13 @@ dnl fail on certain solaris boxes. We might as dnl well set it here. export PATH_SEPARATOR -AS_IF([test "x$with_system_pcre2" = "xno"],[ +dnl Use system pcre2 when available, unless --without-system-pcre2. +has_system_pcre2="no" +AS_IF([test "x$with_system_pcre2" = "xyes"],[ +PKG_CHECK_MODULES([PCRE2], libpcre2-8 >= 10.00,[has_system_pcre2=yes +AS_IF([test "x$PRIVATELIBDIR" != "x"], [rm -f "$PRIVATELIBDIR/"libpcre2*])],[has_system_pcre2=no])]) + +AS_IF([test "$has_system_pcre2" = "no"], [ dnl REMEMBER TO CHANGE WITH A NEW PCRE2 RELEASE! pcre2_version="10.32" AC_MSG_RESULT(extracting PCRE2 regex library) @@ -783,7 +789,6 @@ AC_MSG_RESULT(installing PCRE2 regex library) $ac_cv_prog_MAKER install || exit 1 PCRE2_CFLAGS="-I$cur_dir/extras/pcre2/include" AC_SUBST(PCRE2_CFLAGS) - PCRE2_LIBS= dnl See c-ares's compilation section for more info on this hack. dnl ensure that we're linking against the bundled version of pcre2 @@ -796,9 +801,6 @@ AS_IF([test -z "$PCRE2_LIBS"], [PCRE2_LIBS="$PRIVATELIBDIR/libpcre2-8.so"]) AC_SUBST(PCRE2_LIBS) cd $cur_dir -],[ -dnl use pkgconfig for pcre2: -PKG_CHECK_MODULES([PCRE2], libpcre2-8 >= 10.00) ]) dnl Use system argon2 when available, unless --without-system-argon2