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,42 +4,70 @@ dnl Sets:
|
||||
dnl CURL_CFLAGS
|
||||
dnl CURL_LIBS
|
||||
|
||||
CURL_CONFIG="curl-config"
|
||||
CURL_CONFIG=""
|
||||
CURL_CFLAGS=""
|
||||
CURL_LIBS=""
|
||||
CURL_MIN_VERSION="7.15.1"
|
||||
|
||||
AC_DEFUN([CHECK_CURL],
|
||||
[dnl
|
||||
|
||||
AC_ARG_WITH(
|
||||
curl,
|
||||
[AC_HELP_STRING([--with-curl=PATH],[Path to the curl prefix])],
|
||||
curl_path="$withval",
|
||||
:)
|
||||
|
||||
dnl # Determine curl lib directory
|
||||
if test -z "${curl_path}"; then
|
||||
test_paths="/usr/local /usr"
|
||||
else
|
||||
test_paths="${curl_path}"
|
||||
fi
|
||||
[AC_HELP_STRING([--with-curl=PATH],[Path to curl prefix or config script])],
|
||||
[test_paths="${with_curl}"],
|
||||
[test_paths="/usr/local/libcurl /usr/local/curl /usr/local /opt/libcurl /opt/curl /opt /usr"])
|
||||
|
||||
AC_MSG_CHECKING([for libcurl config script])
|
||||
|
||||
for x in ${test_paths}; do
|
||||
if test -e "${x}/bin/${CURL_CONFIG}"; then
|
||||
with_curl="${x}/bin"
|
||||
dnl # Determine if the script was specified and use it directly
|
||||
if test ! -d "$x" -a -e "$x"; then
|
||||
CURL_CONFIG="`basename $x`"
|
||||
curl_path=`echo $x | sed "s/\/\?${CURL_CONFIG}\$//"`
|
||||
break
|
||||
fi
|
||||
|
||||
dnl # Try known config script names/locations
|
||||
for CURL_CONFIG in curl-config; do
|
||||
if test -e "${x}/bin/${CURL_CONFIG}"; then
|
||||
curl_path="${x}/bin"
|
||||
break
|
||||
elif test -e "${x}/${CURL_CONFIG}"; then
|
||||
curl_path="${x}"
|
||||
break
|
||||
else
|
||||
curl_path=""
|
||||
fi
|
||||
done
|
||||
if test -n "$curl_path"; then
|
||||
break
|
||||
else
|
||||
with_curl=""
|
||||
fi
|
||||
done
|
||||
if test -n "${with_curl}"; then
|
||||
CURL_CONFIG="${with_curl}/${CURL_CONFIG}"
|
||||
|
||||
if test -n "${curl_path}"; then
|
||||
CURL_CONFIG="${curl_path}/${CURL_CONFIG}"
|
||||
AC_MSG_RESULT([${CURL_CONFIG}])
|
||||
CURL_CFLAGS="`${CURL_CONFIG} --cflags`"
|
||||
if test "$verbose_output" -eq 1; then AC_MSG_NOTICE(curl CFLAGS: $CURL_CFLAGS); fi
|
||||
CURL_LIBS="`${CURL_CONFIG} --libs`"
|
||||
if test "$verbose_output" -eq 1; then AC_MSG_NOTICE(curl LIBS: $CURL_LIBS); fi
|
||||
CURL_VERSION=`${CURL_CONFIG} --version | sed 's/^[[^0-9]][[^[:space:]]][[^[:space:]]]*[[[:space:]]]*//'`
|
||||
if test "$verbose_output" -eq 1; then AC_MSG_NOTICE(curl VERSION: $CURL_VERSION); fi
|
||||
CFLAGS=$save_CFLAGS
|
||||
LDFLAGS=$save_LDFLAGS
|
||||
|
||||
dnl # Check version is ok
|
||||
AC_MSG_CHECKING([if libcurl is at least v${CURL_MIN_VERSION}])
|
||||
curl_min_ver=`echo ${CURL_MIN_VERSION} | awk -F. '{print (\$ 1 * 1000000) + (\$ 2 * 1000) + \$ 3}'`
|
||||
curl_ver=`echo ${CURL_VERSION} | awk -F. '{print (\$ 1 * 1000000) + (\$ 2 * 1000) + \$ 3}'`
|
||||
if test "$curl_min_ver" -le "$curl_ver"; then
|
||||
AC_MSG_RESULT([yes])
|
||||
else
|
||||
AC_MSG_RESULT([no])
|
||||
AC_MSG_NOTICE([NOTE: curl library may be too old: $CURL_VERSION])
|
||||
fi
|
||||
|
||||
else
|
||||
AC_MSG_RESULT([no])
|
||||
fi
|
||||
|
Reference in New Issue
Block a user