From 40f0c8fe04858acd724d6221dbf8a357259e5d6b Mon Sep 17 00:00:00 2001 From: Edward Rudd Date: Tue, 20 Jan 2004 16:27:35 +0000 Subject: split out version specific code code compiles under apache 1.3 and 2.0 updated apache m4 script to detect both verions (two minumums) defaulted install to not activate module in configuration file (use make activate) --- (limited to 'm4') diff --git a/m4/apache.m4 b/m4/apache.m4 index 1e29ac7..93319e3 100644 --- a/m4/apache.m4 +++ b/m4/apache.m4 @@ -1,41 +1,16 @@ -dnl CHECK_PATH_APACHE([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]]) -dnl Test for Apache apxs +dnl TEST_APACHE_VERSION([MINIMUM-VERSION [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]]) +dnl Test for Apache dnl -AC_DEFUN(CHECK_PATH_APACHE, +AC_DEFUN(TEST_APACHE_VERSION, [dnl -AC_ARG_WITH( - apxs, - [AC_HELP_STRING([--with-apxs=PATH],[Location to APXS binary (default: /usr)])], - apxs_prefix="$withval", - apxs_prefix="/usr" - ) -AC_ARG_ENABLE(apachetest, - [AC_HELP_STRING([--disable-apachetest],[Do not try to compile and run apache version test program])], - , - enable_apachetest=yes) - - AC_REQUIRE([AC_CANONICAL_TARGET]) - PATH="$apxs_prefix:$apxs_prefix/bin:$apxs_prefix/sbin:$PATH" - if test -x $apxs_prefix && test ! -d $apxs_prefix; then - APXS_BIN=$apxs_prefix - else - AC_PATH_PROG(APXS_BIN, apxs, no, [$PATH]) - fi - min_apache_version=ifelse([$1], ,1.3.1,$1) - AC_MSG_CHECKING(for Apache - version >= $min_apache_version) - no_apxs="" - if test "$APXS_BIN" == "no"; then - no_apxs=yes - else - APACHE_INCDIR=`$APXS_BIN -q INCLUDEDIR` - APACHE_CFLAGS=-I$APACHE_INCDIR - APACHE_MODDIR=`$APXS_BIN -q LIBEXECDIR` - if test "x$enable_apachetest" = "xyes" ; then - ac_save_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS $APACHE_CFLAGS" - AC_TRY_RUN([ + min_apache_version="$1" + no_apache="" + ac_save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS $APACHE_CFLAGS" + + AC_TRY_RUN([ #include #include #include @@ -80,37 +55,29 @@ int main (int argc, char *argv[]) ((major2 == major1) && (minor2 > minor1)) || ((major2 == major1) && (minor2 == minor1) && (micro2 >= micro1))) { - return 0; + exit(0); } else { - printf("\n*** This module requires apache version %d.%d.%d or greater\n", + /*printf("\n*** This module requires apache version %d.%d.%d or greater\n", major1, minor1, micro1); printf("*** I found version %d.%d.%d. Please verify the installation directory\n", major2, minor2, micro2); - printf("*** of apache with the --with-apxs configure option.\n"); - return 1; + printf("*** of apache with the --with-apxs configure option.\n");*/ + exit(1); } } -],, no_apxs=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"]) - CFLAGS="$ac_save_CFLAGS" - fi - fi - if test "x$no_apxs" = x ; then - AC_MSG_RESULT(yes) +],, no_apache=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"]) + CFLAGS="$ac_save_CFLAGS" + + if test "x$no_apache" = x ; then ifelse([$2], , :, [$2]) else - AC_MSG_RESULT(no) - if test "$APXS_BIN" = "no" ; then - echo "*** The apxs binary installed by apache could not be found" - echo "*** If apache is installed in PREFIX, make sure PREFIX/bin is in" - echo "*** your path, or use the --with-apxs configure option" + if test -f conf.apachetest ; then + : else - if test -f conf.apachetest ; then - : - else - echo "*** Could not run Apache test program, checking why..." - CFLAGS="$CFLAGS APACHE_CFLAGS" - AC_TRY_LINK([ + echo "*** Could not run Apache test program, checking why..." + CFLAGS="$CFLAGS APACHE_CFLAGS" + AC_TRY_LINK([ #include #include "httpd.h" @@ -118,17 +85,88 @@ int main(int argc, char *argv[]) { return 0; } #undef main #define main K_and_R_C_main -], [ return 0; ], - [ echo "*** The test program compiled, but failed to run. Check config.log" ], - [ echo "*** The test program failed to compile or link. Check config.log" ]) - CFLAGS="$ac_save_CFLAGS" - fi +], [ return 0; ], + [ echo "*** The test program compiled, but failed to run. Check config.log" ], + [ echo "*** The test program failed to compile or link. Check config.log" ]) + CFLAGS="$ac_save_CFLAGS" fi - APACHE_CFLAGS="" ifelse([$3], , :, [$3]) fi - AC_SUBST(APACHE_CFLAGS) - AC_SUBST(APACHE_INCDIR) - AC_SUBST(APACHE_MODDIR) rm -f conf.apachetest ]) + +dnl CHECK_PATH_APACHE([MINIMUM13-VERSION [, MINIMUM20-VERSION [, +dnl ACTION-IF-FOUND13 [, ACTION-IF-FOUND20 [, ACTION-IF-NOT-FOUND]]]) +dnl Test for Apache apxs +dnl +AC_DEFUN(CHECK_PATH_APACHE, +[dnl +AC_ARG_WITH( + apxs, + [AC_HELP_STRING([--with-apxs=PATH],[Location to APXS binary (default: /usr)])], + apxs_prefix="$withval", + apxs_prefix="/usr" + ) +AC_ARG_ENABLE( + apachetest, + [AC_HELP_STRING([--disable-apachetest],[Do not try to compile and run apache version test program])], + , + enable_apachetest=yes + ) + + PATH="$apxs_prefix:$apxs_prefix/bin:$apxs_prefix/sbin:$PATH" + if test -x $apxs_prefix -a ! -d $apxs_prefix; then + APXS_BIN=$apxs_prefix + else + AC_PATH_PROG(APXS_BIN, apxs, no, [$PATH]) + fi + min_apache13_version=ifelse([$1], ,no,$1) + min_apache20_version=ifelse([$2], ,no,$2) + no_apxs="" + if test "$APXS_BIN" = "no"; then + AC_MSG_ERROR([*** The apxs binary installed by apache could not be found!]) + AC_MSG_ERROR([*** If apache is installed in PREFIX, make sure PREFIX/bin is in]) + AC_MSG_ERROR([*** your path, or use the --with-apxs configure option]) + else + APACHE_INCDIR=`$APXS_BIN -q INCLUDEDIR` + APACHE_CFLAGS=-I$APACHE_INCDIR + APACHE_MODDIR=`$APXS_BIN -q LIBEXECDIR` + + if test "x$enable_apachetest" = "xyes" ; then + if test "$min_apache20_version" != "no"; then + AC_MSG_CHECKING(for Apache 2.0 version >= $min_apache20_version) + TEST_APACHE_VERSION($min_apache20_version, + AC_MSG_RESULT(yes) + AC_DEFINE(WITH_APACHE20,1,[Define to 1 if we are compiling with Apache 2.0.x]) + APACHE_VERSION="20" + APACHE_OUTPUT_NAME=$PACKAGE_NAME.la + APACHE_DEFS="-DWITH_APACHE20" + ifelse([$4], , , $4), + AC_MSG_RESULT(no) + if test "x$min_apache13_version" = "xno"; then + ifelse([$5], , , $5) + fi + ) + fi + if test "$min_apache13_version" != "no" -a "x$APACHE_VERSION" = "x"; then + AC_MSG_CHECKING(for Apache 1.3 version >= $min_apache13_version) + TEST_APACHE_VERSION($min_apache13_version, + AC_MSG_RESULT(yes) + AC_DEFINE(WITH_APACHE13,1,[Define to 1 if we are compiling with Apache 1.3.x]) + APACHE_VERSION="13" + APACHE_OUTPUT_NAME=$PACKAGE_NAME.so + APACHE_DEFS="-DWITH_APACHE13" + ifelse([$3], , , $3), + AC_MSG_RESULT(no) + ifelse([$5], , , $5) + ) + fi + fi + AC_SUBST(APACHE_DEFS) + AC_SUBST(APACHE_CFLAGS) + AC_SUBST(APACHE_INCDIR) + AC_SUBST(APACHE_MODDIR) + AC_SUBST(APACHE_VERSION) + AC_SUBST(APACHE_OUTPUT_NAME) + fi +]) diff --git a/m4/mod_ssl.m4 b/m4/mod_ssl.m4 index 457548e..6a852b9 100644 --- a/m4/mod_ssl.m4 +++ b/m4/mod_ssl.m4 @@ -15,7 +15,7 @@ AC_ARG_WITH( ssl_incdir="$withval", ) - if test "$ssl_val" = "yes"; then + if test "x$ssl_val" = "xyes"; then ac_save_CFLAGS=$CFLAGS ac_save_CPPFLAGS=$CPPFLAGS MOD_SSL_CFLAGS="-I/usr/include/openssl" -- cgit v0.9.2