AC_INIT AM_INIT_AUTOMAKE(mod_lk, 0.1) AC_PROG_CC AM_PROG_LIBTOOL # macro to parse --with-apache parameter # macro name "APACHE_DIR" # from http://threebit.net/tutorials/apache2_modules/tut1/tutorial1.html AC_DEFUN([APACHE_DIR],[ AC_ARG_WITH( apache, [ --with-apache[=DIR] Apache server directory], , [with_apache="no"] ) AC_MSG_CHECKING(for Apache directory) if test "$with_apache" = "no"; then AC_MSG_ERROR( You need to specify the apache directory using --with-apache) else # make sure that a well known include file exists if test -e $with_apache/include/httpd.h; then apache_dir=$with_apache AC_MSG_RESULT(APACHE found!) else AC_MSG_ERROR( $with_apache not found. Check the value you specified with --with-apache) fi fi ]) # run it APACHE_DIR # Save the location of apache into the "apache_dir" variable. # The AC_SUBST macro causes the variable to be saved in config.status AC_SUBST(apache_dir) # Write config.status and the Makefile AC_OUTPUT(Makefile)