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
parent 7baf949929
commit 433ecf3427
6 changed files with 65 additions and 31 deletions

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -37,13 +37,7 @@ AC_FUNC_MALLOC
AC_FUNC_MEMCMP AC_FUNC_MEMCMP
AC_CHECK_FUNCS([atexit getcwd memset strcasecmp strchr strdup strerror strncasecmp strrchr strstr strtol]) AC_CHECK_FUNCS([atexit getcwd memset strcasecmp strchr strdup strerror strncasecmp strrchr strstr strtol])
# Include M4 macros # Find apxs
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)
AC_MSG_NOTICE(looking for Apache module support via DSO through APXS) AC_MSG_NOTICE(looking for Apache module support via DSO through APXS)
AC_ARG_WITH(apxs, AC_ARG_WITH(apxs,
[AS_HELP_STRING([[--with-apxs=FILE]], [AS_HELP_STRING([[--with-apxs=FILE]],
@@ -98,6 +92,27 @@ else
AC_MSG_ERROR(couldn't find APXS) AC_MSG_ERROR(couldn't find APXS)
fi 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 ### Defaults
@@ -107,7 +122,9 @@ EXTRA_CFLAGS="-Wc,-O2 -Wc,-g -Wc,-Wall -Wc,-Werror"
### Configure Options ### Configure Options
# DEBUG_CONF # 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 if test "$enableval" != "no"; then
debug_conf="-Wc,-DDEBUG_CONF" 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 # 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 if test "$enableval" != "no"; then
debug_cache="-Wc,-DCACHE_DEBUG" 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 # 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 if test "$enableval" != "no"; then
perf_meas="-Wc,-DPERFORMANCE_MEASUREMENT" perf_meas="-Wc,-DPERFORMANCE_MEASUREMENT"
@@ -146,7 +167,9 @@ AC_ARG_ENABLE(performance-measurement,AS_HELP_STRING(--enable-performance-measur
]) ])
# NO_MODSEC_API # 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 if test "$enableval" != "yes"; then
modsec_api="-Wc,-DNO_MODSEC_API" modsec_api="-Wc,-DNO_MODSEC_API"