mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-09-29 19:24:29 +03:00
Configure: do not check for pcre1 if pcre2 requested
This commit is contained in:
@@ -21,69 +21,73 @@ 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"])
|
[test_paths="/usr/local/libpcre /usr/local/pcre /usr/local /opt/libpcre /opt/pcre /opt /usr"])
|
||||||
|
|
||||||
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])
|
||||||
dnl # Determine pcre lib directory
|
|
||||||
if test -z "${with_pcre}"; then
|
|
||||||
test_paths="/usr/local/pcre /usr/local /usr"
|
|
||||||
else
|
else
|
||||||
test_paths="${with_pcre}"
|
AC_MSG_CHECKING([for libpcre config script])
|
||||||
fi
|
|
||||||
|
|
||||||
for x in ${test_paths}; do
|
dnl # Determine pcre lib directory
|
||||||
dnl # Determine if the script was specified and use it directly
|
if test -z "${with_pcre}"; then
|
||||||
if test ! -d "$x" -a -e "$x"; then
|
test_paths="/usr/local/pcre /usr/local /usr"
|
||||||
PCRE_CONFIG=$x
|
else
|
||||||
pcre_path="no"
|
test_paths="${with_pcre}"
|
||||||
break
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
dnl # Try known config script names/locations
|
for x in ${test_paths}; do
|
||||||
for PCRE_CONFIG in pcre-config; do
|
dnl # Determine if the script was specified and use it directly
|
||||||
if test -e "${x}/bin/${PCRE_CONFIG}"; then
|
if test ! -d "$x" -a -e "$x"; then
|
||||||
pcre_path="${x}/bin"
|
PCRE_CONFIG=$x
|
||||||
|
pcre_path="no"
|
||||||
break
|
break
|
||||||
elif test -e "${x}/${PCRE_CONFIG}"; then
|
fi
|
||||||
pcre_path="${x}"
|
|
||||||
|
dnl # Try known config script names/locations
|
||||||
|
for PCRE_CONFIG in pcre-config; do
|
||||||
|
if test -e "${x}/bin/${PCRE_CONFIG}"; then
|
||||||
|
pcre_path="${x}/bin"
|
||||||
|
break
|
||||||
|
elif test -e "${x}/${PCRE_CONFIG}"; then
|
||||||
|
pcre_path="${x}"
|
||||||
|
break
|
||||||
|
else
|
||||||
|
pcre_path=""
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
if test -n "$pcre_path"; then
|
||||||
break
|
break
|
||||||
else
|
|
||||||
pcre_path=""
|
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
if test -n "$pcre_path"; then
|
|
||||||
break
|
|
||||||
fi
|
|
||||||
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
|
||||||
|
AC_MSG_RESULT([${PCRE_CONFIG}])
|
||||||
|
PCRE_VERSION="`${PCRE_CONFIG} --version`"
|
||||||
|
if test "$verbose_output" -eq 1; then AC_MSG_NOTICE(pcre VERSION: $PCRE_VERSION); fi
|
||||||
|
PCRE_CFLAGS="`${PCRE_CONFIG} --cflags`"
|
||||||
|
if test "$verbose_output" -eq 1; then AC_MSG_NOTICE(pcre CFLAGS: $PCRE_CFLAGS); fi
|
||||||
|
PCRE_LDADD="`${PCRE_CONFIG} --libs`"
|
||||||
|
if test "$verbose_output" -eq 1; 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`"
|
||||||
|
if test "$verbose_output" -eq 1; then AC_MSG_NOTICE(pcre PCRE_LD_PATH: $PCRE_LD_PATH); fi
|
||||||
|
else
|
||||||
|
AC_MSG_RESULT([no])
|
||||||
fi
|
fi
|
||||||
AC_MSG_RESULT([${PCRE_CONFIG}])
|
|
||||||
PCRE_VERSION="`${PCRE_CONFIG} --version`"
|
AC_SUBST(PCRE_CONFIG)
|
||||||
if test "$verbose_output" -eq 1; then AC_MSG_NOTICE(pcre VERSION: $PCRE_VERSION); fi
|
AC_SUBST(PCRE_VERSION)
|
||||||
PCRE_CFLAGS="`${PCRE_CONFIG} --cflags`"
|
AC_SUBST(PCRE_CPPFLAGS)
|
||||||
if test "$verbose_output" -eq 1; then AC_MSG_NOTICE(pcre CFLAGS: $PCRE_CFLAGS); fi
|
AC_SUBST(PCRE_CFLAGS)
|
||||||
PCRE_LDADD="`${PCRE_CONFIG} --libs`"
|
AC_SUBST(PCRE_LDFLAGS)
|
||||||
if test "$verbose_output" -eq 1; then AC_MSG_NOTICE(pcre LDADD: $PCRE_LDADD); fi
|
AC_SUBST(PCRE_LDADD)
|
||||||
PCRE_LD_PATH="/`${PCRE_CONFIG} --libs | cut -d'/' -f2,3,4,5,6 | cut -d ' ' -f1`"
|
AC_SUBST(PCRE_LD_PATH)
|
||||||
if test "$verbose_output" -eq 1; then AC_MSG_NOTICE(pcre PCRE_LD_PATH: $PCRE_LD_PATH); fi
|
|
||||||
else
|
if test -z "${PCRE_VERSION}"; then
|
||||||
AC_MSG_RESULT([no])
|
AC_MSG_NOTICE([*** pcre library not found.])
|
||||||
|
else
|
||||||
|
AC_MSG_NOTICE([using pcre v${PCRE_VERSION}])
|
||||||
|
ifelse([$1], , , $1)
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
AC_SUBST(PCRE_CONFIG)
|
|
||||||
AC_SUBST(PCRE_VERSION)
|
|
||||||
AC_SUBST(PCRE_CPPFLAGS)
|
|
||||||
AC_SUBST(PCRE_CFLAGS)
|
|
||||||
AC_SUBST(PCRE_LDFLAGS)
|
|
||||||
AC_SUBST(PCRE_LDADD)
|
|
||||||
AC_SUBST(PCRE_LD_PATH)
|
|
||||||
|
|
||||||
if test -z "${PCRE_VERSION}"; then
|
|
||||||
AC_MSG_NOTICE([*** pcre library not found.])
|
|
||||||
else
|
|
||||||
AC_MSG_NOTICE([using pcre v${PCRE_VERSION}])
|
|
||||||
ifelse([$1], , , $1)
|
|
||||||
fi
|
|
||||||
])
|
])
|
||||||
|
Reference in New Issue
Block a user