During configure, do not check for pcre if pcre2 specified

This commit is contained in:
Martin Vierula 2022-11-10 07:50:52 -08:00
parent de01b02731
commit 791964a0ea
No known key found for this signature in database
GPG Key ID: F2FC4E45883BCBA4
2 changed files with 81 additions and 74 deletions

View File

@ -1,6 +1,8 @@
v3.x.y - YYYY-MMM-DD (to be released) v3.x.y - YYYY-MMM-DD (to be released)
------------------------------------- -------------------------------------
- During configure, do not check for pcre if pcre2 specified
[Issue #2750 - @dvershinin, @martinhsv]
- Use pkg-config to find libxml2 first - Use pkg-config to find libxml2 first
[Issue #2714 - @hughmcmaster] [Issue #2714 - @hughmcmaster]
- Fix two rule-reload memory leak issues - Fix two rule-reload memory leak issues

View File

@ -21,9 +21,13 @@ AC_ARG_WITH(
[test_paths="${with_pcre}"], [test_paths="${with_pcre}"],
[test_paths="/usr/local/libpcre /usr/local/pcre /usr/local /opt/libpcre /opt/pcre /opt /usr /opt/local"]) [test_paths="/usr/local/libpcre /usr/local/pcre /usr/local /opt/libpcre /opt/pcre /opt /usr /opt/local"])
AC_MSG_CHECKING([for libpcre config script]) if test "x${with_pcre2}" != "x" && test "x${with_pcre2}" != "xno"; then
AC_MSG_NOTICE([pcre2 specified; omitting check for pcre])
else
for x in ${test_paths}; do AC_MSG_CHECKING([for libpcre config script])
for x in ${test_paths}; do
dnl # Determine if the script was specified and use it directly dnl # Determine if the script was specified and use it directly
if test ! -d "$x" -a -e "$x"; then if test ! -d "$x" -a -e "$x"; then
PCRE_CONFIG=$x PCRE_CONFIG=$x
@ -46,9 +50,9 @@ for x in ${test_paths}; do
if test -n "$pcre_path"; then if test -n "$pcre_path"; then
break break
fi fi
done done
if test -n "${pcre_path}"; then if test -n "${pcre_path}"; then
if test "${pcre_path}" != "no"; then if test "${pcre_path}" != "no"; then
PCRE_CONFIG="${pcre_path}/${PCRE_CONFIG}" PCRE_CONFIG="${pcre_path}/${PCRE_CONFIG}"
fi fi
@ -61,11 +65,11 @@ if test -n "${pcre_path}"; then
if test ! -z "${PCRE_LDADD}"; then AC_MSG_NOTICE(pcre LDADD: $PCRE_LDADD); fi if test ! -z "${PCRE_LDADD}"; then AC_MSG_NOTICE(pcre LDADD: $PCRE_LDADD); fi
PCRE_LD_PATH="/`${PCRE_CONFIG} --libs | cut -d'/' -f2,3,4,5,6 | cut -d ' ' -f1`" PCRE_LD_PATH="/`${PCRE_CONFIG} --libs | cut -d'/' -f2,3,4,5,6 | cut -d ' ' -f1`"
if test ! -z "${PCRE_LD_PATH}"; then AC_MSG_NOTICE(pcre PCRE_LD_PATH: $PCRE_LD_PATH); fi if test ! -z "${PCRE_LD_PATH}"; then AC_MSG_NOTICE(pcre PCRE_LD_PATH: $PCRE_LD_PATH); fi
else else
AC_MSG_RESULT([no]) AC_MSG_RESULT([no])
fi fi
if test -n "${PCRE_VERSION}"; then if test -n "${PCRE_VERSION}"; then
AC_MSG_CHECKING(for PCRE JIT) AC_MSG_CHECKING(for PCRE JIT)
save_CFLAGS=$CFLAGS save_CFLAGS=$CFLAGS
save_LDFLAGS=$LDFLAGS save_LDFLAGS=$LDFLAGS
@ -87,22 +91,23 @@ if test -n "${PCRE_VERSION}"; then
CFLAGS=$save_CFLAGS CFLAGS=$save_CFLAGS
LDFLAGS=$save_LDFLAGS LDFLAGS=$save_LDFLAGS
LIBS=$save_LIBS LIBS=$save_LIBS
fi fi
AC_SUBST(PCRE_CONFIG) AC_SUBST(PCRE_CONFIG)
AC_SUBST(PCRE_VERSION) AC_SUBST(PCRE_VERSION)
AC_SUBST(PCRE_CPPFLAGS) AC_SUBST(PCRE_CPPFLAGS)
AC_SUBST(PCRE_CFLAGS) AC_SUBST(PCRE_CFLAGS)
AC_SUBST(PCRE_LDFLAGS) AC_SUBST(PCRE_LDFLAGS)
AC_SUBST(PCRE_LDADD) AC_SUBST(PCRE_LDADD)
AC_SUBST(PCRE_LD_PATH) AC_SUBST(PCRE_LD_PATH)
if test -z "${PCRE_VERSION}"; then if test -z "${PCRE_VERSION}"; then
AC_MSG_NOTICE([*** pcre library not found.]) AC_MSG_NOTICE([*** pcre library not found.])
ifelse([$2], , AC_MSG_ERROR([pcre library is required]), $2) ifelse([$2], , AC_MSG_ERROR([pcre library is required]), $2)
else else
AC_MSG_NOTICE([using pcre v${PCRE_VERSION}]) AC_MSG_NOTICE([using pcre v${PCRE_VERSION}])
ifelse([$1], , , $1) ifelse([$1], , , $1)
PCRE_LDADD="${PCRE_LDADD} -lpcre" PCRE_LDADD="${PCRE_LDADD} -lpcre"
fi
fi fi
]) ])