From 6cefab259d0b783b85df4518d0d48dab0e11389b Mon Sep 17 00:00:00 2001 From: Christopher Powell Date: Tue, 22 Jul 2003 04:17:59 +0000 Subject: Changes on the way to 1.19. This is probably going to be 1.19b1. Detail: * Hostnames are now converted to lowercase in the mass-virtual naming section. The loop that converts dots to underscores has been optimized as well. * Migration to autoconf * New directive LogSQLTableType allows one to specify the kind of table that the module makes during table creation (e.g. InnoDB, MyISAM). Thanks to Jim Turner for the suggestion and patch. If your MySQL server does not support the specified type, it will create a MyISAM table instead. * Directives can now be placed in the 'main' server config and will be inherited by the virtual hosts. This means a LOT less repetition: you only specify the item once to have it inherited, but it can still be overridden on a virtualhost level. --- (limited to 'configure.in') diff --git a/configure.in b/configure.in new file mode 100644 index 0000000..1103494 --- /dev/null +++ b/configure.in @@ -0,0 +1,186 @@ +dnl Process this file with autoconf to produce a configure script. +AC_INIT(mod_log_sql.c) + +AC_CONFIG_HEADER(config.h:config.in) + +dnl OVERRIDABLE DEFAULTS +APDSTDIR="/usr/local/apache" +APSRCDIR="/usr/local/src/apache-1.3.27" +MYSQLHDRDIR="/usr/include/mysql" +MYSQLLIBDIR="/usr/lib" + +dnl Check for command line arguments +AC_ARG_WITH( apache, + [ --with-apache=DIR Where to look for Apache's installation], + APDSTDIR=${withval}) + +APXSDIR="$APDSTDIR/bin" +APHDRDIR="$APDSTDIR/include" + +AC_ARG_WITH( apache-source, + [ --with-apache-source=DIR Where to look for Apache sources [${APSRCDIR}]], + APSRCDIR=${withval}) + +AC_ARG_WITH( apache-headers, + [ --with-apache-headers=DIR Where to look for Apache's header files], + APHDRDIR=${withval}) + +AC_ARG_WITH( apxs, + [ --with-apxs=DIR Where to look for apxs], + APXSDIR=${withval}) + +AC_ARG_WITH( mysql-headers, + [ --with-mysql-headers=DIR Where to look for MySQL headers], + MYSQLHDRDIR=${withval}) + +AC_ARG_WITH( mysql-libs, + [ --with-mysql-libs=DIR Where to look for MySQL libraries], + MYSQLLIBDIR=${withval}) + +AC_ARG_ENABLE( ssl, + [ --disable-ssl Do not attempt to compile in SSL support], + WITHSSL=0, + WITHSSL=1) + + +AC_SUBST(APDSTDIR) +AC_SUBST(APSRCDIR) +AC_SUBST(MYSQLHDRDIR) +AC_SUBST(MYSQLLIBDIR) +AC_SUBST(APXSDIR) +AC_SUBST(APHDRDIR) + +echo "Using the following locations:" +echo " Apache installed in $APDSTDIR" +echo " Apache source in $APSRCDIR" +echo " Apache headers in $APHDRDIR" +echo " apxs in $APXSDIR" +echo " MySQL headers in $MYSQLHDRDIR" +echo " MySQL libraries in $MYSQLLIBDIR" + + +AC_CANONICAL_HOST +case "$host" in + *-linux*) + AC_DEFINE(__LINUX) + ;; + *-netbsd*) + AC_DEFINE(__NETBSD) + ;; + *-openbsd*) + AC_DEFINE(__OPENBSD) + ;; + *-solaris*) + AC_DEFINE(__SOLARIS) + ;; + *-sunos4*) + AC_DEFINE(__SUNOS) + ;; + *-freebsd*) + AC_DEFINE(__FREEBSD) + ;; + *-bsdi*) + AC_DEFINE(__BSDI) + ;; + *-apple-darwin*) + AC_DEFINE(__MACOSX) + ;; +esac + + + +dnl ==================================================================== +dnl Checks for programs. +AC_PROG_CC +AC_PROG_INSTALL +AC_PROG_LN_S +AC_PROG_MAKE_SET +AC_PATH_PROG(RM, rm, no, $PATH:/usr/bin:/usr/local/bin) +if test $RM = no; then + AC_MSG_ERROR("rm not found in the PATH") +fi +AC_PATH_PROG(APXS, apxs, no, $APXSDIR) +if test $APXS = no; then + AC_MSG_ERROR("apxs not found. Please specify its location using --with-apxs") +fi + +AC_PATH_PROG(LYX,lyx,,$PATH:/usr/local/bin) +AC_PATH_PROG(LATEX,latex,,$PATH:/usr/local/bin) +AC_PATH_PROG(DVIPS,dvips,,$PATH:/usr/local/bin) +AC_PATH_PROG(LINKS,lynx,,$PATH:/usr/local/bin) +AC_PATH_PROG(L2H,latex2html,,$PATH:/usr/local/bin) + +AC_SUBST(RM) +AC_SUBST(LYX) +AC_SUBST(LATEX) +AC_SUBST(DVIPS) +AC_SUBST(LINKS) +AC_SUBST(L2H) + +dnl ==================================================================== +dnl Checks for libraries. +AC_CHECK_LIB(z, + main, + LIBS="$LIBS -lz", + AC_MSG_ERROR("libz not found. Compilation cannot continue without this library.") ) +AC_CHECK_FUNC( nanosleep, , + AC_CHECK_LIB(rt, + nanosleep, + LIBS="$LIBS -lrt", + AC_MSG_ERROR("nanosleep function not available in librt.") ) ) +AC_CHECK_LIB( mysqlclient, + mysql_init, + LIBS="$LIBS -lmysqlclient", + AC_MSG_ERROR("libmysqlclient not found. Please specify its location using --with-mysql-libs.") ) + +dnl ==================================================================== +dnl Checks for header files. +AC_HEADER_STDC +AC_HEADER_TIME +AC_CHECK_HEADERS($APDSTDIR/include/httpd.h $APDSTDIR/include/http_config.h $APDSTDIR/include/http_log.h $APDSTDIR/include/http_core.h, + , + [ echo "** A required header cannot be located." + echo " Please use the --with-apache option."; echo; exit 1]) +AC_CHECK_HEADERS($MYSQLHDRDIR/mysql.h $MYSQLHDRDIR/mysqld_error.h, + , + [ echo "** A required header cannot be located." + echo " Please use the --with-mysql-headers option."; echo; exit 1]) +if test $WITHSSL = 1; then +AC_CHECK_FILES($APSRCDIR/src/modules/ssl/mod_ssl.h, + AC_CHECK_HEADER(db1/ndbm.h,HAVE_MODSSL=1,HAVE_MODSSL=0), + HAVE_MODSSL=0) + if test $HAVE_MODSSL = 0; then + AC_MSG_WARN("SSL not enabled. Please use the --with-apache-source option if you want it enabled.") + fi +else + AC_MSG_WARN("SSL checking/capability disabled by commandline option.") + HAVE_MODSSL=0 +fi +AC_SUBST(HAVE_MODSSL) + +dnl ==================================================================== +dnl Checks for typedefs, structures, and compiler characteristics. +AC_C_CONST +AC_STRUCT_TM + +dnl ==================================================================== +dnl Checks for library functions. +AC_TYPE_SIGNAL +AC_FUNC_STRFTIME +AC_CHECK_FUNCS(strstr atoi mysql_real_connect mysql_escape_string mysql_real_escape_string, , AC_MSG_ERROR("a necessary function is not available.")) + +dnl ==================================================================== +dnl Create the Makefile +AC_OUTPUT(Makefile) + +dnl ==================================================================== +dnl Final output +echo +if test $HAVE_MODSSL = 1; then + echo "mod_ssl support has been compiled into this module" +else + echo "no mod_ssl support" +fi + +echo +dnl echo $LIBS -- cgit v0.9.2