AC_PREREQ(2.50) AC_INIT AC_CONFIG_HEADER(mod_wombat_config.h) AC_CONFIG_AUX_DIR(build) sinclude(build/ac-macros/lua.m4) AC_MSG_NOTICE(looking for Apache module support via DSO through APXS) AC_ARG_WITH(apxs, [AS_HELP_STRING([[--with-apxs[=FILE]]], [FILE is the path to apxs; defaults to "apxs".])], [ if test "$withval" = "yes"; then APXS=apxs else APXS="$withval" fi ]) if test -z "$APXS"; then for i in /usr/sbin \ /usr/local/apache/bin \ /usr/local/apache2/bin \ /usr/local/sbin ; do if test -f "$i/apxs2"; then APXS="$i/apxs2" break elif test -f "$i/apxs"; then APXS="$i/apxs" break fi done fi # arbitrarily picking the same version subversion looks for, don't know how # accurate this really is, but at least it'll force us to have apache2... HTTPD_WANTED_MMN=20020903 if test -n "$APXS" -a "$APXS" != "no" -a -x "$APXS" ; then APXS_INCLUDE="`$APXS -q INCLUDEDIR`" if test -r $APXS_INCLUDE/httpd.h; then AC_MSG_NOTICE(found apxs at $APXS) AC_MSG_NOTICE(checking httpd version) AC_EGREP_CPP(VERSION_OK, [ #include "$APXS_INCLUDE/ap_mmn.h" #if AP_MODULE_MAGIC_AT_LEAST($HTTPD_WANTED_MMN,0) VERSION_OK #endif], [AC_MSG_NOTICE(httpd is recent enough)], [AC_MSG_ERROR(apache is too old, mmn must be at least $HTTPD_WANTED_MMN)]) fi else AC_MSG_ERROR(couldn't find APXS) fi CHECK_LUA() # XXX we should actually check, instead of just assuming apreq2 is there AC_MSG_NOTICE([checking for apreq2]) AC_ARG_WITH(apreq2, [[ --with-apreq2[=DIR] look for apreq2 in DIR.]], [ if test "$withval" = "yes" ; then AC_MSG_ERROR([--with-apreq2 requires an argument.]) else APREQ2_DIR=$withval fi ]) save_CPPFLAGS=$CPPFLAGS APXS_INCLUDES="`$APXS -q EXTRA_INCLUDES`" CPPFLAGS="$APXS_INCLUDES -I$APREQ2_DIR/include/apreq2 $CPPFLAGS" AC_CHECK_HEADERS([apreq2/apreq_module_apache2.h apreq.h], [], [AC_MSG_ERROR([APREQ headers not found. Try --with-apreq2])]) CPPFLAGS=$save_CPPFLAGS AC_SUBST(APXS) AC_SUBST(APREQ2_DIR) AC_CONFIG_FILES([Makefile]) AC_OUTPUT