manoj 99/11/29 15:47:49
Added: src Makefile.am acconfig.h.in acinclude.m4 buildconf configure.in modules.c src/ap Makefile.am src/helpers build-acconfig-header config-stubs src/lib Makefile.am src/main Makefile.am config.h.stub config.m4 src/modules Makefile.am config.m4 src/modules/mpm Makefile.am config.h.stub config.m4 src/modules/mpm/dexter Makefile.am config.m4 src/modules/mpm/mpmt_pthread Makefile.am config.m4 src/modules/mpm/prefork config.m4 src/modules/standard Makefile.am config.m4 src/os Makefile.am config.m4 src/os/unix Makefile.am config.m4 src/regex Makefile.am config.m4 Log: The second part of the big autoconf patch, which actually adds autoconf building to the tree. Revision Changes Path 1.1 apache-2.0/src/Makefile.am Index: Makefile.am =================================================================== AUTOMAKE_OPTIONS = foreign SUBDIRS=ap main modules os $(REGEX_DIR) bin_PROGRAMS = apache apache_SOURCES = modules.c buildmark.c apache_DEPENDENCIES = \ $(MOD_LTLIBS) \ $(MPM_LIB) \ main/libmain.la \ $(OS_DIR)/libos.la \ ap/libap.la \ lib/apr/libapr.a \ $(REGEX_LIB) apache_LDADD = $(apache_DEPENDENCIES) $(EXTRA_LIBS) 1.1 apache-2.0/src/acconfig.h.in <<Binary file>> 1.1 apache-2.0/src/acinclude.m4 Index: acinclude.m4 =================================================================== dnl dnl APACHE_MODULE(modname [, shared]) dnl dnl Includes an extension in the build. dnl dnl "modname" is the name of the modules/ subdir where the extension resides dnl "shared" can be set to "shared" or "yes" to build the extension as dnl a dynamically loadable library. dnl AC_DEFUN(APACHE_MODULE,[ if test -d "$cwd/$srcdir/modules/$1" ; then MOD_SUBDIRS="$MOD_SUBDIRS $1" if test "$2" != "shared" -a "$2" != "yes"; then libname=$(basename $1) _extlib="lib${libname}.a" MOD_LTLIBS="$MOD_LTLIBS modules/$1/lib${libname}.la" MOD_LIBS="$MOD_LIBS $1/$_extlib" MOD_STATIC="$MOD_STATIC $1" else MOD_SHARED="$MOD_SHARED $1" fi APACHE_OUTPUT(modules/$1/Makefile) fi ]) AC_SUBST(MOD_LTLIBS) dnl ## APACHE_OUTPUT(file) dnl ## adds "file" to the list of files generated by AC_OUTPUT dnl ## This macro can be used several times. AC_DEFUN(APACHE_OUTPUT, [ APACHE_OUTPUT_FILES="$APACHE_OUTPUT_FILES $1" ]) dnl dnl AC_ADD_LIBRARY(library) dnl dnl add a library to the link line dnl AC_DEFUN(AC_ADD_LIBRARY,[ APACHE_ONCE(LIBRARY, $1, [ EXTRA_LIBS="$EXTRA_LIBS -l$1" ]) ]) dnl dnl APACHE_ONCE(namespace, variable, code) dnl dnl execute code, if variable is not set in namespace dnl AC_DEFUN(APACHE_ONCE,[ unique=`echo $ac_n "$2$ac_c" | tr -c -d a-zA-Z0-9` cmd="echo $ac_n \"\$$1$unique$ac_c\"" if test -n "$unique" && test "`eval $cmd`" = "" ; then eval "$1$unique=set" $3 fi ]) 1.1 apache-2.0/src/buildconf Index: buildconf =================================================================== #!/bin/sh # TODO - Steal the new PHP buildconf and build.mk. # This will do for now, though supplied_flag=$1 # do some version checking for the tools we use if test "$1" = "--force"; then shift # this is a posix correct "test -nt" elif test "`ls -t buildconf buildconf.stamp 2>/dev/null |head -1`" != "buildconf"; then : else echo "buildconf: checking installation..." # autoconf will check for the version itself # automake 1.4 or newer am_version=`automake --version 2>/dev/null|head -1|sed -e 's/^[^0-9]*//' -e 's/[a-z]* *$//'` if test "$am_version" = ""; then echo "buildconf: automake not found." echo " You need automake version 1.4 or newer installed" echo " to build APACHE from CVS." exit 1 fi IFS=.; set $am_version; IFS=' ' if test "$1" = "1" -a "$2" -lt "4" || test "$1" -lt "1"; then echo "buildconf: automake version $am_version found." echo " You need automake version 1.4 or newer installed" echo " to build APACHE from CVS." exit 1 else echo "buildconf: automake version $am_version (ok)" fi # libtool 1.3.3 or newer lt_pversion=`libtool --version 2>/dev/null|sed -e 's/^[^0-9]*//' -e 's/[- ].*//'` if test "$lt_pversion" = ""; then echo "buildconf: libtool not found." echo " You need libtool version 1.3 or newer installed" echo " to build APACHE from CVS." exit 1 fi lt_version=`echo $lt_pversion|sed -e 's/\([a-z]*\)$/.\1/'` IFS=.; set $lt_version; IFS=' ' if test "$1" -gt "1" || test "$2" -gt "3" || test "$2" = "3" -a "$3" -ge "3" then echo "buildconf: libtool version $lt_pversion (ok)" else echo "buildconf: libtool version $lt_pversion found." echo " You need libtool version 1.3.3 or newer installed" echo " to build APACHE from CVS." exit 1 fi touch buildconf.stamp fi am_prefix=`which automake | sed -e 's#/[^/]*/[^/]*$##'` lt_prefix=`which libtool | sed -e 's#/[^/]*/[^/]*$##'` if test "$am_prefix" != "$lt_prefix"; then echo "buildconf: WARNING: automake and libtool are installed in different" echo " directories. This may cause aclocal to fail." echo "buildconf: continuing anyway" fi if test "$supplied_flag" = "--copy"; then automake_flags=--copy fi ./helpers/build-acconfig-header mv aclocal.m4 aclocal.m4.old 2>/dev/null aclocal if test "$?" != "0" -a "$am_prefix" != "$lt_prefix"; then echo "buildconf: ERROR: aclocal failed, probably because automake and" echo " libtool are installed with different prefixes;" echo " automake is installed in $am_prefix, but libtool in $lt_prefix." echo " Please re-install automake and/or libtool with a common prefix" echo " and try again." exit 1 fi if cmp aclocal.m4.old aclocal.m4 > /dev/null 2>&1; then echo "buildconf: keeping aclocal.m4" mv aclocal.m4.old aclocal.m4 else echo "buildconf: created or modified aclocal.m4" fi autoheader # find all Makefile.ams files="Makefile `find ap lib main modules regex os -name Makefile.am | sed 's#\.am##' | tr '\n' ' '`" # suppress stupid automake warning automake --add-missing --include-deps $automake_flags $files 2>&1 | grep -v \$APACHE_OUTPUT_FILES >&2 mv configure configure.old 2>/dev/null autoconf if cmp configure.old configure > /dev/null 2>&1; then echo "buildconf: keeping configure" mv configure.old configure else echo "buildconf: created or modified configure" fi 1.1 apache-2.0/src/configure.in Index: configure.in =================================================================== dnl ## Process this file with autoconf to produce a configure script AC_PREREQ(2.13) AC_INIT(main/http_main.c) AM_INIT_AUTOMAKE(apache, 2.0-dev) dnl This would be in src/include, but I think I've found an autoheader bug AM_CONFIG_HEADER(ap_config_auto.h) dnl ## This is the central place where Apache's version should be kept. APACHE_VERSION=$VERSION AC_SUBST(APACHE_VERSION) dnl XXX - doesn't actually work, because of the APACHE_OUTPUT_FILES error AM_MAINTAINER_MODE dnl We want this one before the checks, so the checks can modify CFLAGS test -z "$CFLAGS" && auto_cflags=1 dnl Needed for APACHE_MODULE() to work cwd=`pwd` dnl ## Check for programs dnl AC_PROG_AWK AC_PROG_CC AC_PROG_CPP AC_PROG_INSTALL dnl AC_PROG_RANLIB dnl AC_PATH_PROG(PERL_PATH, perl) dnl info autoconf says AIX needs this. Okay. AC_AIX dnl ## Check for libraries dnl ## Check for header files dnl I think these are just used all over the place, so just check for dnl them at the base of the tree. If some are specific to a single dnl directory, they should be moved (Comment #Spoon) AC_CHECK_HEADERS( \ unistd.h \ sys/times.h \ sys/time.h \ ) dnl ## Check for typedefs, structures, and compiler characteristics. AC_C_INLINE dnl ## Check for library functions dnl See Comment #Spoon AC_CHECK_FUNCS( \ strdup \ strcasecmp \ strncasecmp \ strstr \ strerror \ initgroups \ waitpid \ difftime \ gettimeofday \ memmove \ ) AM_PROG_LIBTOOL dnl ## Checking command-line options test -n "$GCC" && test "$USE_MAINTAINER_MODE" = "yes" && \ CFLAGS="$CFLAGS -g -Wall -Wmissing-prototypes -Wstrict-prototypes -Wmissing-declarations" INCLUDES="-I\$(top_srcdir)/include -I\$(top_srcdir)/lib/apr/include" AC_SUBST(INCLUDES) dnl reading config stubs esyscmd(./helpers/config-stubs .) INCLUDES="$INCLUDES -I\$(top_srcdir)/\$(OS_DIR)" AC_SUBST(EXTRA_LIBS) AC_SUBST(REGEX_DIR) AC_SUBST(REGEX_LIB) AC_SUBST(MPM_LIB) AC_SUBST(OS) AC_SUBST(OS_DIR) AC_OUTPUT([Makefile ap/Makefile main/Makefile lib/apr/Makefile os/Makefile $APACHE_OUTPUT_FILES]) 1.1 apache-2.0/src/modules.c Index: modules.c =================================================================== /* Stub modules.c file. Unfortunately, this only supports dexter at the * moment. It gets overwritten by the old-style configuration routines */ #include "httpd.h" #include "http_config.h" extern module core_module; extern module env_module; extern module config_log_module; extern module mime_module; extern module negotiation_module; extern module includes_module; extern module autoindex_module; extern module dir_module; extern module cgi_module; extern module asis_module; extern module imap_module; extern module action_module; extern module userdir_module; extern module alias_module; extern module access_module; extern module auth_module; extern module setenvif_module; extern module echo_module; extern module mpm_dexter_module; /* * Modules which implicitly form the * list of activated modules on startup, * i.e. these are the modules which are * initially linked into the Apache processing * [extendable under run-time via AddModule] */ module *ap_prelinked_modules[] = { &core_module, &env_module, &config_log_module, &mime_module, &negotiation_module, &includes_module, &autoindex_module, &dir_module, &cgi_module, &asis_module, &imap_module, &action_module, &userdir_module, &alias_module, &access_module, &auth_module, &setenvif_module, &echo_module, &mpm_dexter_module, NULL }; /* * Modules which initially form the * list of available modules on startup, * i.e. these are the modules which are * initially loaded into the Apache process * [extendable under run-time via LoadModule] */ module *ap_preloaded_modules[] = { &core_module, &env_module, &config_log_module, &mime_module, &negotiation_module, &includes_module, &autoindex_module, &dir_module, &cgi_module, &asis_module, &imap_module, &action_module, &userdir_module, &alias_module, &access_module, &auth_module, &setenvif_module, &echo_module, &mpm_dexter_module, NULL }; 1.1 apache-2.0/src/ap/Makefile.am Index: Makefile.am =================================================================== noinst_LTLIBRARIES=libap.la libap_la_SOURCES = ap_base64.c ap_sha1.c ap_buf.c ap_hooks.c 1.1 apache-2.0/src/helpers/build-acconfig-header Index: build-acconfig-header =================================================================== #!/bin/sh disclaimer="Do NOT edit - this file is generated by build-acconfig-header" # security check - simply overwriting existing files could be harmful if test -w acconfig.h.new ; then echo "Please remove acconfig.h.new and rerun this command" exit 1 fi echo "/* $disclaimer */" > acconfig.h.new cat acconfig.h.in >> acconfig.h.new for stubdir in `find $dir -type d`; do filename=$stubdir/config.h.stub if [ -r $filename ]; then echo "" >> acconfig.h.new echo "/*" >> acconfig.h.new echo " * From $filename" >> acconfig.h.new echo " */" >> acconfig.h.new cat $filename >> acconfig.h.new fi done cmp acconfig.h acconfig.h.new > /dev/null 2>&1 if test $? -ne 0 ; then mv acconfig.h.new acconfig.h else rm -f acconfig.h.new fi 1.1 apache-2.0/src/helpers/config-stubs Index: config-stubs =================================================================== #!/bin/sh dir=$1 for stubdir in `find $dir -type d`; do if [ -r $stubdir/config.m4 ]; then echo "sinclude($stubdir/config.m4)" fi done 1.1 apache-2.0/src/lib/Makefile.am Index: Makefile.am =================================================================== SUBDIRS = apr 1.1 apache-2.0/src/main/Makefile.am Index: Makefile.am =================================================================== noinst_LTLIBRARIES=libmain.la EXTRA_PROGRAMS = gen_uri_delims gen_test_char libmain_la_SOURCES = \ uri_delims.h test_char.h \ buff.c http_config.c http_core.c http_log.c http_main.c \ http_protocol.c http_request.c http_vhost.c util.c util_date.c \ util_script.c util_uri.c util_md5.c \ rfc1413.c http_connection.c iol_file.c listen.c gen_uri_delims_SOURCES = gen_uri_delims.c gen_test_char_SOURCES = gen_test_char.c uri_delims.h: gen_uri_delims ./gen_uri_delims > uri_delims.h test_char.h: gen_test_char ./gen_test_char > test_char.h util_uri.c: uri_delims.h util.c: test_char.h 1.1 apache-2.0/src/main/config.h.stub Index: config.h.stub =================================================================== /* Define if struct tm has a tm_gmtoff member */ #undef HAVE_GMTOFF /* Define if this platform has crypt() */ #undef HAVE_CRYPT /* Define if we should use mmap() to read files */ #undef USE_MMAP_FILES 1.1 apache-2.0/src/main/config.m4 Index: config.m4 =================================================================== dnl ## Check for libraries AC_CHECK_LIB(nsl, gethostname, [ AC_ADD_LIBRARY(nsl) ], []) AC_CHECK_LIB(socket, socket, [ AC_ADD_LIBRARY(socket) ], []) AC_CHECK_LIB(nsl, gethostbyaddr, [ AC_ADD_LIBRARY(nsl) ], []) AC_CHECK_LIB(crypt, crypt, [ AC_ADD_LIBRARY(crypt) AC_DEFINE(HAVE_CRYPT)], []) AC_CHECK_LIB(c, crypt, [ AC_DEFINE(HAVE_CRYPT)], []) dnl ## Check for header files AC_HEADER_STDC AC_CHECK_HEADERS( bstring.h \ crypt.h \ unistd.h \ sys/resource.h \ sys/select.h \ sys/processor.h \ ) dnl ## Check for typedefs, structures, and compiler characteristics. AC_CACHE_CHECK([for tm_gmtoff in struct tm], ac_cv_struct_tm_gmtoff, [AC_TRY_COMPILE([#include <sys/types.h> #include <$ac_cv_struct_tm>], [struct tm tm; tm.tm_gmtoff;], ac_cv_struct_tm_gmtoff=yes, ac_cv_struct_tm_gmtoff=no)]) if test "$ac_cv_struct_tm_gmtoff" = "yes"; then AC_DEFINE(HAVE_GMTOFF) fi dnl ## Check for library functions AC_CHECK_FUNCS( difftime \ syslog \ ) AC_FUNC_MMAP dnl XXX - is autoconf's detection routine good enough? if test "$ac_cv_func_mmap_fixed_mapped" = "yes"; then AC_DEFINE(USE_MMAP_FILES) fi 1.1 apache-2.0/src/modules/Makefile.am Index: Makefile.am =================================================================== ## Process this file with automake to produce Makefile.in SUBDIRS = mpm standard 1.1 apache-2.0/src/modules/config.m4 Index: config.m4 =================================================================== APACHE_OUTPUT(modules/Makefile) 1.1 apache-2.0/src/modules/mpm/Makefile.am Index: Makefile.am =================================================================== [EMAIL PROTECTED]@ 1.1 apache-2.0/src/modules/mpm/config.h.stub Index: config.h.stub =================================================================== /* Define if MPMs should use shmget to implement their shared memory */ #undef USE_SHMGET_SCOREBOARD /* Define if MPMs should use mmap to implement their shared memory */ #undef USE_MMAP_SCOREBOARD /* Define if all code should have #include <pthread.h> */ #undef PTHREAD_EVERYWHERE 1.1 apache-2.0/src/modules/mpm/config.m4 Index: config.m4 =================================================================== AC_MSG_CHECKING(which MPM to use) AC_ARG_WITH(mpm, [ --with-mpm=MPM Choose the process model, etc. for Apache to use.], [ if test "$withval" != "no" ; then apache_cv_mpm=$withval AC_MSG_RESULT($apache_cv_mpm) else AC_MSG_ERROR(An MPM must be specified) fi ],[ AC_MSG_ERROR(An MPM must be specified) ]) APACHE_OUTPUT(modules/mpm/Makefile) MPM_NAME=$apache_cv_mpm MPM_DIR=modules/mpm/$MPM_NAME MPM_LIB=$MPM_DIR/lib${MPM_NAME}.la AC_SUBST(MPM_NAME) dnl All the unix MPMs use shared memory; save a little duplication AC_DEFUN(APACHE_MPM_CHECK_SHMEM, [ AC_CHECK_FUNCS(shmget) AC_FUNC_MMAP AC_MSG_CHECKING(which shared memory mechanism to use) if test "$ac_cv_func_shmget" = "yes" ; then AC_DEFINE(USE_SHMGET_SCOREBOARD) AC_MSG_RESULT(shmget) elif test "$ac_cv_func_mmap" = "yes" ; then AC_DEFINE(USE_MMAP_SCOREBOARD) AC_MSG_RESULT(mmap) else AC_MSG_ERROR(No known shared memory system) fi ]) dnl Check for pthreads and attempt to support it AC_DEFUN(APACHE_MPM_PTHREAD, [ dnl XXX - We should be checking for the proper flags to use on a particular dnl platform. This will cover a couple of them, anyway CFLAGS="-pthread $CFLAGS" CXXFLAGS="-pthread $CXXFLAGS" AC_CHECK_HEADER(pthread.h, [ ],[ AC_MSG_ERROR(This MPM requires pthreads. Try --with-mpm=prefork.) ]) AC_CHECK_FUNC(pthread_create, [ ],[ AC_MSG_ERROR(Can't compile pthread code.) ]) dnl User threads libraries need pthread.h included everywhere AC_DEFINE(PTHREAD_EVERYWHERE) ]) 1.1 apache-2.0/src/modules/mpm/dexter/Makefile.am Index: Makefile.am =================================================================== noinst_LTLIBRARIES = libdexter.la libdexter_la_SOURCES = \ dexter.c scoreboard.c 1.1 apache-2.0/src/modules/mpm/dexter/config.m4 Index: config.m4 =================================================================== dnl ## XXX - Need a more thorough check of the proper flags to use if test "$MPM_NAME" = "dexter" ; then APACHE_OUTPUT(modules/mpm/$MPM_NAME/Makefile) APACHE_MPM_PTHREAD APACHE_MPM_CHECK_SHMEM fi 1.1 apache-2.0/src/modules/mpm/mpmt_pthread/Makefile.am Index: Makefile.am =================================================================== noinst_LTLIBRARIES = libmpmt_pthread.la libmpmt_pthread_la_SOURCES = \ mpmt_pthread.c scoreboard.c 1.1 apache-2.0/src/modules/mpm/mpmt_pthread/config.m4 Index: config.m4 =================================================================== dnl ## XXX - Need a more thorough check of the proper flags to use if test "$MPM_NAME" = "mpmt_pthread" ; then APACHE_OUTPUT(modules/mpm/$MPM_NAME/Makefile) APACHE_MPM_PTHREAD APACHE_MPM_CHECK_SHMEM fi 1.1 apache-2.0/src/modules/mpm/prefork/config.m4 Index: config.m4 =================================================================== if test "$MPM_NAME" = "prefork" ; then APACHE_OUTPUT(modules/mpm/$MPM_NAME/Makefile) APACHE_MPM_CHECK_SHMEM fi 1.1 apache-2.0/src/modules/standard/Makefile.am Index: Makefile.am =================================================================== # TODO - Modules should be selectable. Right now, the plan is to do this # by placing each module into its own subdirectory and placing a # config.m4 to allow or disallow it in there. noinst_LTLIBRARIES = libstandard.la libstandard_la_SOURCES = \ mod_env.c mod_log_config.c mod_mime.c mod_negotiation.c \ mod_include.c mod_autoindex.c mod_dir.c mod_cgi.c mod_asis.c \ mod_imap.c mod_actions.c mod_speling.c mod_userdir.c mod_alias.c \ mod_access.c mod_auth.c mod_setenvif.c mod_echo.c 1.1 apache-2.0/src/modules/standard/config.m4 Index: config.m4 =================================================================== APACHE_MODULE(standard) 1.1 apache-2.0/src/os/Makefile.am Index: Makefile.am =================================================================== SUBDIRS = @OS@ 1.1 apache-2.0/src/os/config.m4 Index: config.m4 =================================================================== AC_MSG_CHECKING(which OS this is) dnl ## XXX - I'm not sure, but this might not handle the non-Unix case yet OS=unix OS_DIR=os/$OS AC_MSG_RESULT([$OS]) APACHE_OUTPUT(os/$OS/Makefile) 1.1 apache-2.0/src/os/unix/Makefile.am Index: Makefile.am =================================================================== noinst_LTLIBRARIES=libos.la libos_la_SOURCES = os.c os-inline.c unixd.c iol_socket.c 1.1 apache-2.0/src/os/unix/config.m4 Index: config.m4 =================================================================== AC_CHECK_FUNCS( \ setsid \ killpg \ ) dnl XXX - This doesn't deal with _sys_siglist. Probably have to roll our own AC_DECL_SYS_SIGLIST 1.1 apache-2.0/src/regex/Makefile.am Index: Makefile.am =================================================================== noinst_LTLIBRARIES = libregex.la libregex_la_SOURCES = regcomp.c regexec.c regerror.c regfree.c 1.1 apache-2.0/src/regex/config.m4 Index: config.m4 =================================================================== AC_MSG_CHECKING(whether to use the provided HS regex library) AC_ARG_ENABLE(hsregex, [ --enable-hsregex Use the HS regex library ], [apache_cv_hsregex=$enableval], [apache_cv_hsregex=yes]) if test $apache_cv_hsregex = yes; then REGEX_LIB=regex/libregex.la REGEX_DIR=regex APACHE_OUTPUT(regex/Makefile) fi AC_MSG_RESULT($apache_cv_hsregex)