1 dnl ## Process this file with autoconf to produce a configure script
6 dnl ## This is the central place where Apache's version should be kept.
7 dnl AM_INIT_AUTOMAKE(apache, 2.0-dev)
9 VERSION="apache-2.0-dev"
11 AC_CONFIG_HEADER(include/ap_config_auto.h)
13 APACHE_VERSION=$VERSION
14 APACHE_SUBST(APACHE_VERSION)
16 test "$exec_prefix" = "NONE" && exec_prefix='${prefix}'
17 test "$prefix" = "NONE" && prefix='/usr/local'
19 dnl Needed for APACHE_MODULE() to work
22 dnl ## Run configure for packages Apache uses
23 AC_CONFIG_SUBDIRS(lib/apr)
25 dnl ## Check for programs
32 dnl AC_PATH_PROG(PERL_PATH, perl)
36 dnl various OS checks that apparently set required flags
41 dnl ## Check for libraries
43 dnl ## Check for header files
45 dnl I think these are just used all over the place, so just check for
46 dnl them at the base of the tree. If some are specific to a single
47 dnl directory, they should be moved (Comment #Spoon)
49 dnl Regarding standard header files: AC_HEADER_STDC doesn't set symbols
50 dnl HAVE_STRING_H, HAVE_STDLIB_H, etc., so those are checked for
51 dnl explicitly so that the normal HAVE_xxx_H symbol is defined.
74 dnl ## Check for C preprocessor symbols
76 AC_CHECK_DEFINE(EAGAIN, errno.h)
78 dnl ## Check for typedefs, structures, and compiler characteristics.
84 dnl ## Check for library functions
86 dnl See Comment #Spoon
101 AC_CHECK_LIB(nsl, gethostbyname)
102 AC_CHECK_LIB(nsl, gethostname)
103 AC_CHECK_LIB(socket, socket)
104 AC_CHECK_LIB(resolv, sethostent)
106 AC_CHECK_FUNCS(inet_addr inet_network, break, [
107 AC_MSG_ERROR(inet_addr function not found)
114 AC_FUNC_SELECT_ARGTYPES
116 dnl Check if we'll actually need to cast select args all the time
117 if test "$ac_cv_func_select_arg1" != "int" \
118 -o "$ac_cv_func_select_arg234" != "fd_set *" \
119 -o "$ac_cv_func_select_arg5" != "struct timeval *" ; then
121 AC_DEFINE(SELECT_NEEDS_CAST,,
122 [Define if arguments to select() aren't what we expect])
125 dnl ## Checking command-line options
126 test -n "$GCC" && test "$USE_MAINTAINER_MODE" = "yes" && \
127 EXTRA_CFLAGS="$EXTRA_CFLAGS -g -Wall -Wmissing-prototypes -Wstrict-prototypes -Wmissing-declarations"
128 test -n "$GCC" && test "$USE_MAINTAINER_MODE" = "y2" && \
129 EXTRA_CFLAGS="$EXTRA_CFLAGS -g -Wall -Werror -Wmissing-declarations"
132 APACHE_ENABLE_MODULES
135 INCLUDES="-I\$(top_srcdir)/include -I\$(top_srcdir)/lib/apr/include"
136 APACHE_SUBST(INCLUDES)
138 dnl reading config stubs
139 esyscmd(./helpers/config-stubs .)
141 INCLUDES="$INCLUDES -I\$(top_srcdir)/\$(OS_DIR)"
142 EXTRA_LIBS="$EXTRA_LIBS $LIBS"
143 EXTRA_LDFLAGS="$LDFLAGS"
146 APACHE_SUBST(progname)
147 APACHE_SUBST(EXTRA_CFLAGS)
148 APACHE_SUBST(EXTRA_LDFLAGS)
149 APACHE_SUBST(EXTRA_LIBS)
150 APACHE_SUBST(REGEX_DIR)
151 APACHE_SUBST(REGEX_LIB)
152 APACHE_SUBST(MPM_LIB)
155 APACHE_SUBST(BUILTIN_LIBS)
160 APACHE_LIBTOOL_SILENT
162 if test "$apache_need_shared" = "yes"; then
163 $SHELL $srcdir/ltconfig --output=shlibtool --disable-static --srcdir=$srcdir --cache-file=./config.cache $srcdir/ltmain.sh
166 AC_ARG_WITH(program-name,
167 [ --with-program-name=alternate executable name],[
168 progname="$withval" ], [
171 APACHE_FAST_OUTPUT(Makefile ap/Makefile lib/Makefile main/Makefile
172 modules/Makefile os/Makefile support/Makefile)
176 dnl ## Build modules.c
177 rm -f $srcdir/modules.c
178 echo $MODLIST | $AWK -f $srcdir/helpers/build-modules-c.awk > $srcdir/modules.c
181 echo '/* Generated by configure */' > ${path_h}.new
182 echo "#define HTTPD_ROOT \"$prefix\"" >> ${path_h}.new
183 echo "#define SUEXEC_BIN \"$bindir/suexec\"" >> ${path_h}.new
184 echo "#define SERVER_CONFIG_FILE \"conf/$progname.conf\"" >> ${path_h}.new
186 cmp ${path_h}.new ${path_h} >/dev/null 2>&1
187 if test $? -ne 0 ; then
188 rm -f ${path_h} && mv ${path_h}.new ${path_h} && \
189 echo "Updated ${path_h}"
191 rm -f ${path_h}.new && \
192 echo "${path_h} unchanged"
195 path_h=./include/ap_config_path.h
197 exec_prefix=$exec_prefix
202 AC_OUTPUT($APACHE_OUTPUT_FILES)