Cleanup configure and add support for using apache src included libs (--with-httpd-src).

This commit is contained in:
brectanus 2008-01-08 19:03:24 +00:00
Родитель 7baf949929
Коммит 433ecf3427
6 изменённых файлов: 65 добавлений и 31 удалений

Просмотреть файл

@ -6,7 +6,7 @@ dnl APR_LDFLAGS
dnl APR_LIBS
dnl APR_LINK_LD
APR_CONFIG="apr-config"
APR_CONFIG=""
APR_CFLAGS=""
APR_LDFLAGS=""
APR_LIBS=""
@ -28,17 +28,22 @@ else
test_paths="${apr_path}"
fi
AC_MSG_CHECKING([for ${APR_CONFIG}])
AC_MSG_CHECKING([for libapr config script])
for x in ${test_paths}; do
if test -e "${x}/bin/${APR_CONFIG}"; then
with_apr="${x}"
break
else
with_apr=""
fi
for APR_CONFIG in apr-config apr-1-config; do
if test -e "${x}/bin/${APR_CONFIG}"; then
with_apr="${x}/bin"
break
elif test -e "${x}/${APR_CONFIG}"; then
with_apr="${x}"
break
else
with_apr=""
fi
done
done
if test -n "${with_apr}"; then
APR_CONFIG="${with_apr}/bin/${APR_CONFIG}"
APR_CONFIG="${with_apr}/${APR_CONFIG}"
AC_MSG_RESULT([${APR_CONFIG}])
APR_CFLAGS="`${APR_CONFIG} --includes`"
APR_LDFLAGS="`${APR_CONFIG} --ldflags`"

Просмотреть файл

@ -28,9 +28,12 @@ else
test_paths="${apu_path}"
fi
AC_MSG_CHECKING([for ${APU_CONFIG}])
AC_MSG_CHECKING([for libapr-util config script])
for x in ${test_paths}; do
if test -e "${x}/bin/${APU_CONFIG}"; then
with_apu="${x}/bin"
break
elif test -e "${x}/${APU_CONFIG}"; then
with_apu="${x}"
break
else
@ -38,7 +41,7 @@ for x in ${test_paths}; do
fi
done
if test -n "${with_apu}"; then
APU_CONFIG="${with_apu}/bin/${APU_CONFIG}"
APU_CONFIG="${with_apu}/${APU_CONFIG}"
AC_MSG_RESULT([${APU_CONFIG}])
APU_CFLAGS="`${APU_CONFIG} --includes`"
APU_LDFLAGS="`${APU_CONFIG} --ldflags`"
@ -59,7 +62,7 @@ if test -z "${APU_LIBS}"; then
AC_MSG_NOTICE([*** apu library not found.])
ifelse([$2], , AC_MSG_ERROR([apu library is required]), $2)
else
AC_MSG_NOTICE([using '${APU_LIBS}' for apu Library])
AC_MSG_NOTICE([using '${APU_LINK_LD}' for apu Library])
ifelse([$1], , , $1)
fi
])

Просмотреть файл

@ -25,17 +25,17 @@ else
test_paths="${lua_path}"
fi
AC_MSG_CHECKING([for ${LUA_CONFIG} for Lua])
AC_MSG_CHECKING([for pkg-config script for liblua])
for x in ${test_paths}; do
if test -e "${x}/bin/${LUA_CONFIG}"; then
with_lua="${x}"
with_lua="${x}/bin"
break
else
with_lua=""
fi
done
if test -n "${with_lua}"; then
LUA_CONFIG="${with_lua}/bin/${LUA_CONFIG}"
LUA_CONFIG="${with_lua}/${LUA_CONFIG}"
AC_MSG_RESULT([${LUA_CONFIG} ${LUA_PKGNAME}])
LUA_CFLAGS="`${LUA_CONFIG} ${LUA_PKGNAME} --cflags`"
LUA_LIBS="`${LUA_CONFIG} ${LUA_PKGNAME} --libs`"

Просмотреть файл

@ -24,9 +24,12 @@ else
test_paths="${pcre_path}"
fi
AC_MSG_CHECKING([for ${PCRE_CONFIG}])
AC_MSG_CHECKING([for libpcre config script])
for x in ${test_paths}; do
if test -e "${x}/bin/${PCRE_CONFIG}"; then
with_pcre="${x}/bin"
break
elif test -e "${x}/${PCRE_CONFIG}"; then
with_pcre="${x}"
break
else
@ -34,7 +37,7 @@ for x in ${test_paths}; do
fi
done
if test -n "${with_pcre}"; then
PCRE_CONFIG="${with_pcre}/bin/${PCRE_CONFIG}"
PCRE_CONFIG="${with_pcre}/${PCRE_CONFIG}"
AC_MSG_RESULT([${PCRE_CONFIG}])
PCRE_CFLAGS="`${PCRE_CONFIG} --cflags`"
PCRE_LIBS="`${PCRE_CONFIG} --libs`"

Просмотреть файл

@ -24,17 +24,17 @@ else
test_paths="${libxml_path}"
fi
AC_MSG_CHECKING([for ${LIBXML_CONFIG}])
AC_MSG_CHECKING([for libxml2 config script])
for x in ${test_paths}; do
if test -e "${x}/bin/${LIBXML_CONFIG}"; then
with_libxml="${x}"
with_libxml="${x}/bin"
break
else
with_libxml=""
fi
done
if test -n "${with_libxml}"; then
LIBXML_CONFIG="${with_libxml}/bin/${LIBXML_CONFIG}"
LIBXML_CONFIG="${with_libxml}/${LIBXML_CONFIG}"
AC_MSG_RESULT([${LIBXML_CONFIG}])
LIBXML_CFLAGS="`${LIBXML_CONFIG} --cflags`"
LIBXML_LIBS="`${LIBXML_CONFIG} --libs`"

Просмотреть файл

@ -37,13 +37,7 @@ AC_FUNC_MALLOC
AC_FUNC_MEMCMP
AC_CHECK_FUNCS([atexit getcwd memset strcasecmp strchr strdup strerror strncasecmp strrchr strstr strtol])
# Include M4 macros
sinclude(build/find_pcre.m4)
sinclude(build/find_lua.m4)
sinclude(build/find_xml.m4)
sinclude(build/find_apr.m4)
sinclude(build/find_apu.m4)
# Find apxs
AC_MSG_NOTICE(looking for Apache module support via DSO through APXS)
AC_ARG_WITH(apxs,
[AS_HELP_STRING([[--with-apxs=FILE]],
@ -98,6 +92,27 @@ else
AC_MSG_ERROR(couldn't find APXS)
fi
# Use Apache httpd source srclib as base for pcre, apr and apu config scripts
AC_ARG_WITH(httpd-src,
[AS_HELP_STRING([[--with-httpd-src=PATH]],
[PATH is to the Apache httpd source tree where srclib will be used as a base for pcre, apr and apu config scripts.])],
[
if test -n "$withval"; then
pcre_path="$withval/srclib/pcre"
apr_path="$withval/srclib/apr"
apu_path="$withval/srclib/apr-util"
else
AC_MSG_ERROR(--with-httpd-src requires a path)
fi
])
# Include M4 macros
sinclude(build/find_pcre.m4)
sinclude(build/find_apr.m4)
sinclude(build/find_apu.m4)
sinclude(build/find_xml.m4)
sinclude(build/find_lua.m4)
### Defaults
@ -107,7 +122,9 @@ EXTRA_CFLAGS="-Wc,-O2 -Wc,-g -Wc,-Wall -Wc,-Werror"
### Configure Options
# DEBUG_CONF
AC_ARG_ENABLE(debug-conf,AS_HELP_STRING(--enable-debug-conf,Enable debug during configuration (testing only)),
AC_ARG_ENABLE(debug-conf,
AS_HELP_STRING([--enable-debug-conf],
[Enable debug during configuration.]),
[
if test "$enableval" != "no"; then
debug_conf="-Wc,-DDEBUG_CONF"
@ -120,7 +137,9 @@ AC_ARG_ENABLE(debug-conf,AS_HELP_STRING(--enable-debug-conf,Enable debug during
])
# CACHE_DEBUG
AC_ARG_ENABLE(debug-cache,AS_HELP_STRING(--enable-debug-cache,Enable debug for transformation caching (testing only)),
AC_ARG_ENABLE(debug-cache,
AS_HELP_STRING([--enable-debug-cache],
[Enable debug for transformation caching.]),
[
if test "$enableval" != "no"; then
debug_cache="-Wc,-DCACHE_DEBUG"
@ -133,7 +152,9 @@ AC_ARG_ENABLE(debug-cache,AS_HELP_STRING(--enable-debug-cache,Enable debug for t
])
# PERFORMANCE_MEASUREMENT
AC_ARG_ENABLE(performance-measurement,AS_HELP_STRING(--enable-performance-measurement,Enable performance-measurement stats (testing only)),
AC_ARG_ENABLE(performance-measurement,
AS_HELP_STRING([--enable-performance-measurement],
[Enable performance-measurement stats.]),
[
if test "$enableval" != "no"; then
perf_meas="-Wc,-DPERFORMANCE_MEASUREMENT"
@ -146,7 +167,9 @@ AC_ARG_ENABLE(performance-measurement,AS_HELP_STRING(--enable-performance-measur
])
# NO_MODSEC_API
AC_ARG_ENABLE(modsec-api,AS_HELP_STRING(--disable-modsec-api,Disable the API (compiling against some older Apache versions require this)),
AC_ARG_ENABLE(modsec-api,
AS_HELP_STRING([--disable-modsec-api],
[Disable the API; compiling against some older Apache versions require this.]),
[
if test "$enableval" != "yes"; then
modsec_api="-Wc,-DNO_MODSEC_API"