mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-09-29 19:24:29 +03:00
Merge 2.5.x build changes back to trunk.
This commit is contained in:
@@ -4,7 +4,7 @@ dnl Sets:
|
||||
dnl PCRE_CFLAGS
|
||||
dnl PCRE_LIBS
|
||||
|
||||
PCRE_CONFIG="pcre-config"
|
||||
PCRE_CONFIG=""
|
||||
PCRE_CFLAGS=""
|
||||
PCRE_LIBS=""
|
||||
|
||||
@@ -13,34 +13,53 @@ AC_DEFUN([CHECK_PCRE],
|
||||
|
||||
AC_ARG_WITH(
|
||||
pcre,
|
||||
[AC_HELP_STRING([--with-pcre=PATH],[Path to the pcre prefix])],
|
||||
pcre_path="$withval",
|
||||
:)
|
||||
|
||||
dnl # Determine pcre lib directory
|
||||
if test -z "${pcre_path}"; then
|
||||
test_paths="/usr/local /usr"
|
||||
else
|
||||
test_paths="${pcre_path}"
|
||||
fi
|
||||
[AC_HELP_STRING([--with-pcre=PATH],[Path to pcre prefix or config script])],
|
||||
[test_paths="${with_pcre}"],
|
||||
[test_paths="/usr/local/libpcre /usr/local/pcre /usr/local /opt/libpcre /opt/pcre /opt /usr"])
|
||||
|
||||
AC_MSG_CHECKING([for libpcre config script])
|
||||
|
||||
dnl # Determine pcre lib directory
|
||||
if test -z "${with_pcre}"; then
|
||||
test_paths="/usr/local/pcre /usr/local /usr"
|
||||
else
|
||||
test_paths="${with_pcre}"
|
||||
fi
|
||||
|
||||
for x in ${test_paths}; do
|
||||
if test -e "${x}/bin/${PCRE_CONFIG}"; then
|
||||
with_pcre="${x}/bin"
|
||||
dnl # Determine if the script was specified and use it directly
|
||||
if test ! -d "$x" -a -e "$x"; then
|
||||
PCRE_CONFIG="`basename $x`"
|
||||
pcre_path=`echo $x | sed "s/\/\?${PCRE_CONFIG}\$//"`
|
||||
break
|
||||
elif test -e "${x}/${PCRE_CONFIG}"; then
|
||||
with_pcre="${x}"
|
||||
fi
|
||||
|
||||
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
|
||||
else
|
||||
with_pcre=""
|
||||
fi
|
||||
done
|
||||
if test -n "${with_pcre}"; then
|
||||
PCRE_CONFIG="${with_pcre}/${PCRE_CONFIG}"
|
||||
CFLAGS=$save_CFLAGS
|
||||
LDFLAGS=$save_LDFLAGS
|
||||
|
||||
if test -n "${pcre_path}"; then
|
||||
PCRE_CONFIG="${pcre_path}/${PCRE_CONFIG}"
|
||||
AC_MSG_RESULT([${PCRE_CONFIG}])
|
||||
PCRE_CFLAGS="`${PCRE_CONFIG} --cflags`"
|
||||
if test "$verbose_output" -eq 1; then AC_MSG_NOTICE(pcre CFLAGS: $PCRE_CFLAGS); fi
|
||||
PCRE_LIBS="`${PCRE_CONFIG} --libs`"
|
||||
if test "$verbose_output" -eq 1; then AC_MSG_NOTICE(pcre LIBS: $PCRE_LIBS); fi
|
||||
CFLAGS=$save_CFLAGS
|
||||
LDFLAGS=$save_LDFLAGS
|
||||
else
|
||||
@@ -51,10 +70,10 @@ AC_SUBST(PCRE_LIBS)
|
||||
AC_SUBST(PCRE_CFLAGS)
|
||||
|
||||
if test -z "${PCRE_LIBS}"; then
|
||||
AC_MSG_NOTICE([*** pcre library not found.])
|
||||
ifelse([$2], , AC_MSG_ERROR([pcre library is required]), $2)
|
||||
AC_MSG_NOTICE([*** pcre library not found.])
|
||||
ifelse([$2], , AC_MSG_ERROR([pcre library is required]), $2)
|
||||
else
|
||||
AC_MSG_NOTICE([using '${PCRE_LIBS}' for pcre Library])
|
||||
ifelse([$1], , , $1)
|
||||
AC_MSG_NOTICE([using '${PCRE_LIBS}' for pcre Library])
|
||||
ifelse([$1], , , $1)
|
||||
fi
|
||||
])
|
||||
|
Reference in New Issue
Block a user