]> granicus.if.org Git - apache/blob - configure.in
Tweak a message. No function change.
[apache] / configure.in
1 dnl
2 dnl Autoconf configuration for Apache httpd
3 dnl
4 dnl     Use ./buildconf to produce a configure script
5 dnl
6
7 AC_PREREQ(2.13)
8 AC_INIT(ABOUT_APACHE)
9
10 AC_CONFIG_HEADER(include/ap_config_auto.h)
11 AC_CONFIG_AUX_DIR(srclib/apr/build)
12
13 dnl #
14 dnl # Include our own M4 macros along with those for APR and libtool
15 dnl #
16 sinclude(srclib/apr/build/apr_common.m4)
17 sinclude(srclib/apr/build/apr_network.m4)
18 sinclude(srclib/apr/build/apr_threads.m4)
19 sinclude(srclib/apr/build/apr_hints.m4)
20 sinclude(srclib/apr/build/libtool.m4)
21 sinclude(hints.m4)
22 sinclude(acinclude.m4)
23
24 dnl ## Run configure for packages Apache uses
25 APR_SUBDIR_CONFIG(srclib/apr, "$apache_apr_flags --disable-shared")
26 APR_SUBDIR_CONFIG(srclib/apr-util, "--with-apr=../apr --disable-shared")
27 APR_SUBDIR_CONFIG(srclib/pcre)
28 . ./srclib/apr/APRVARS
29
30 dnl Generate ./config.nice for reproducing runs of configure
31 dnl
32 APR_CONFIG_NICE(config.nice)
33
34 dnl XXX we can't just use AC_PREFIX_DEFAULT because that isn't subbed in
35 dnl by configure until it is too late.  Is that how it should be or not?
36 dnl Something seems broken here.
37 AC_PREFIX_DEFAULT(/usr/local/apache2)
38 test "$prefix" = "NONE" && prefix='/usr/local/apache2'
39 test "$exec_prefix" = "NONE" && exec_prefix='${prefix}'
40
41 dnl Absolute source/build directory
42 abs_srcdir=`(cd $srcdir && pwd)`
43 abs_builddir=`pwd`
44
45 dnl If the source dir is not equal to the build dir, 
46 dnl then we are running in VPATH mode.
47
48 if test "$abs_builddir" != "$abs_srcdir"; then
49   USE_VPATH=1
50 fi
51
52 AC_CANONICAL_SYSTEM
53
54 case "$host_alias" in
55   *os2*)
56       # Use a custom made libtool replacement
57       echo "using aplibtool"
58       LIBTOOL="$abs_srcdir/srclib/apr/build/aplibtool"
59       SH_LIBTOOL="$LIBTOOL --shared --export-all"
60       CORE_IMPLIB_FILE="ApacheCoreOS2.la"
61       CORE_IMPLIB="$abs_srcdir/server/$CORE_IMPLIB_FILE"
62       MK_IMPLIB="emximp"
63       SHMOD_EXPORT_EXT="def"
64       other_targets="$other_targets os2core"
65       ;;
66   *)
67       SH_LIBTOOL='$(SHELL) $(top_builddir)/shlibtool --silent'
68       ;;
69 esac
70
71 dnl
72 dnl ## Preload our OS configuration
73 APR_PRELOAD
74 APACHE_PRELOAD
75
76 dnl
77 dnl Process command line arguments. This is done early in the process so the
78 dnl user can get feedback quickly in case of an error.
79 dnl
80 dnl ### need to move some of the arguments "up here"
81
82 dnl ## Check for programs
83
84 AC_PATH_PROG(RM, rm)
85 AC_PROG_AWK
86 AC_PROG_CC
87 AC_PROG_CPP
88 AC_PROG_INSTALL
89 AC_PROG_LN_S
90 AC_CHECK_TOOL(RANLIB, ranlib, true)
91 dnl AC_PATH_PROG(PERL_PATH, perl)
92
93 #
94 # Play with CPPFLAGS given what was learned from APR_PRELOAD.
95 #
96 # XXX: APR only sets this if threads are enabled.  Either APR should be
97 # fixed to always set it (most likely), or we should test for threads.
98 #
99 if test -n "$THREAD_CPPFLAGS"; then
100     CPPFLAGS="$CPPFLAGS $THREAD_CPPFLAGS"
101 fi
102
103 dnl various OS checks that apparently set required flags
104 AC_AIX
105 AC_ISC_POSIX
106 AC_MINIX
107
108 dnl ## Check for libraries
109
110 dnl ## Check for header files
111
112 dnl I think these are just used all over the place, so just check for
113 dnl them at the base of the tree. If some are specific to a single
114 dnl directory, they should be moved (Comment #Spoon)
115
116 dnl Regarding standard header files: AC_HEADER_STDC doesn't set symbols
117 dnl HAVE_STRING_H, HAVE_STDLIB_H, etc., so those are checked for
118 dnl explicitly so that the normal HAVE_xxx_H symbol is defined.
119
120 AC_HEADER_STDC
121 AC_CHECK_HEADERS( \
122 string.h \
123 limits.h \
124 unistd.h \
125 sys/socket.h \
126 pwd.h \
127 grp.h \
128 strings.h
129 )
130 AC_HEADER_SYS_WAIT
131
132 dnl ## Check for typedefs, structures, and compiler characteristics.
133
134 AC_C_CONST
135
136 dnl ## Check for library functions
137
138 dnl See Comment #Spoon
139
140 AC_CHECK_FUNCS( \
141 initgroups \
142 )
143
144 AC_CHECK_LIB(nsl, gethostbyname)
145 AC_CHECK_LIB(nsl, gethostname)
146 AC_CHECK_LIB(socket, socket)
147
148 AC_ARG_WITH(optim,[  --with-optim="FLAG"       obsolete (use OPTIM environment variable)],
149         [AC_MSG_ERROR('option --with-optim is obsolete; use OPTIM environment variable instead')])
150
151 AC_ARG_WITH(port,[  --with-port=PORT        Port on which to listen (default is 80)],
152         [if test "$withval" = "yes"; then AC_MSG_ERROR('option --with-port requires a value (the TCP port number)'); else PORT="$withval"; fi],
153         [PORT=80])
154
155 AC_ARG_ENABLE(debug,[  --enable-debug            Turn on debugging and compile time warnings],
156         [CFLAGS="$CFLAGS -g"; if test "$GCC" = "yes"; then CFLAGS="$CFLAGS -Wall"; fi])
157
158 AC_ARG_ENABLE(maintainer-mode,[  --enable-maintainer-mode  Turn on debugging and compile time warnings],
159         [CFLAGS="$CFLAGS -g"; if test "$GCC" = "yes"; then CFLAGS="$CFLAGS -Wall -Wmissing-prototypes -Wstrict-prototypes -Wmissing-declarations -DAP_DEBUG"; fi])
160
161 APACHE_ENABLE_LAYOUT
162 APACHE_ENABLE_MODULES
163
164 INCLUDES="-I\$(top_srcdir)/include -I\$(top_srcdir)/srclib/apr/include -I\$(top_srcdir)/srclib/apr-util/include"
165 if test -n "$USE_VPATH"; then
166   INCLUDES="$INCLUDES -I\$(top_builddir)/include -I\$(top_builddir)/srclib/apr/include"
167 fi
168
169 dnl reading config stubs
170 esyscmd(./build/config-stubs .)
171
172 INCLUDES="$INCLUDES -I\$(top_srcdir)/os/\$(OS_DIR)"
173 EXTRA_LIBS="$EXTRA_LIBS $LIBS"
174 EXTRA_LDFLAGS="$LDFLAGS"
175 LIBS=""
176 LDFLAGS=""
177 APACHE_SUBST(progname)
178 APACHE_SUBST(EXTRA_CFLAGS)
179 APACHE_SUBST(EXTRA_LDFLAGS)
180 APACHE_SUBST(EXTRA_LIBS)
181 APACHE_SUBST(INCLUDES)
182 APACHE_SUBST(MPM_LIB)
183 APACHE_SUBST(OS)
184 APACHE_SUBST(OS_DIR)
185 APACHE_SUBST(BUILTIN_LIBS)
186
187 AM_DISABLE_SHARED
188 if test -z "$LIBTOOL"; then
189   AM_PROG_LIBTOOL
190   APACHE_LIBTOOL_SILENT
191 fi
192
193 if test "$apache_need_shared" = "yes"; then
194   $SHELL $ac_aux_dir/ltconfig --output=shlibtool --disable-static --srcdir=$ac_aux_dir --cache-file=./config.cache $ac_aux_dir/ltmain.sh
195   case $PLATFORM in
196     *-ibm-aix*)
197       HTTPD_LDFLAGS="$HTTPD_LDFLAGS -Wl,-bE:$abs_srcdir/support/httpd.exp"
198       SH_LDFLAGS="$SH_LDFLAGS -Wl,-bI:$abs_srcdir/support/httpd.exp"
199       ;;
200     *os390)
201       CFLAGS="$CFLAGS -Wc,DLL,EXPORTALL"
202       ;;
203   esac
204 fi
205
206 AC_ARG_WITH(program-name,
207 [  --with-program-name     alternate executable name],[
208   progname="$withval" ], [
209   progname="httpd"] )
210
211 # SuExec parameters
212 AC_ARG_WITH(suexec-caller,
213 [  --with-suexec-caller    User allowed to call SuExec],[
214   AC_DEFINE_UNQUOTED(AP_HTTPD_USER, "$withval", [User allowed to call SuExec] ) ] )
215
216 AC_ARG_WITH(suexec-userdir,
217 [  --with-suexec-userdir   User subdirectory],[
218   AC_DEFINE_UNQUOTED(AP_USERDIR_SUFFIX, "$withval", [User subdirectory] ) ] )
219
220 AC_ARG_WITH(suexec-docroot,
221 [  --with-suexec-docroot   SuExec root directory],[
222   AC_DEFINE_UNQUOTED(AP_DOC_ROOT, "$withval", [SuExec root directory] ) ] )
223
224 AC_ARG_WITH(suexec-uidmin,
225 [  --with-suexec-uidmin    Minimal allowed UID],[
226   AC_DEFINE_UNQUOTED(AP_UID_MIN, $withval, [Minimum allowed UID] ) ] )
227
228 AC_ARG_WITH(suexec-gidmin,
229 [  --with-suexec-gidmin    Minimal allowed GID],[
230   AC_DEFINE_UNQUOTED(AP_GID_MIN, $withval, [Minimum allowed GID] ) ] )
231
232 AC_ARG_WITH(suexec-logfile,
233 [  --with-suexec-logfile   Set the logfile],[
234   AC_DEFINE_UNQUOTED(AP_LOG_EXEC, "$withval", [SuExec log file] ) ] )
235
236 AC_ARG_WITH(suexec-safepath,
237 [  --with-suexec-safepath  Set the safepath],[
238   AC_DEFINE_UNQUOTED(AP_SAFE_PATH, "$withval", [safe shell path for SuExec] ) ] )
239
240 AC_ARG_WITH(suexec-umask,
241 [  --with-suexec-umask     umask for suexec'd process],[
242   AC_DEFINE_UNQUOTED(AP_SUEXEC_UMASK, 0$withval, [umask for suexec'd process] ) ] )
243
244 dnl AP_LIB_DIRS specifies the additional libs from srclib/ that we need
245 dnl AP_LIBS specifies the actual libraries. note we have some required libs.
246 AP_LIBS="srclib/pcre/libpcre.la srclib/apr-util/libaprutil.la $AP_LIBS"
247
248 dnl APR should go after the other libs, so the right symbols can be picked up
249 AP_LIBS="$AP_LIBS srclib/apr/libapr.la"
250 APACHE_SUBST(AP_LIB_DIRS)
251 APACHE_SUBST(AP_LIBS)
252
253 AC_DEFINE(AP_USING_AUTOCONF, 1,
254                 [Using autoconf to configure Apache])
255
256 if test "$SINGLE_LISTEN_UNSERIALIZED_ACCEPT" = "1"; then
257     AC_DEFINE(SINGLE_LISTEN_UNSERIALIZED_ACCEPT, 1, 
258               [This platform doesn't suffer from the thundering herd problem])
259 fi
260
261 dnl check for endianness
262 if test "$cross_compiling" = "no"; then
263   AC_C_BIGENDIAN
264 else
265   AC_DEFINE(AP_UNKNOWN_BYTE_ORDER,1,
266                 [byte order is unknown due to cross-compilation])
267 fi
268
269 APACHE_FAST_OUTPUT(Makefile modules/Makefile srclib/Makefile) 
270 APACHE_FAST_OUTPUT(os/beos/Makefile os/os2/Makefile os/Makefile)
271 APACHE_FAST_OUTPUT(os/unix/Makefile server/Makefile)
272 APACHE_FAST_OUTPUT(support/Makefile srclib/pcre/Makefile)
273 for i in $AP_LIB_DIRS; do
274   APACHE_FAST_OUTPUT(srclib/$i/Makefile)
275 done
276
277 if test -d ./test; then
278     APACHE_FAST_OUTPUT(test/Makefile)
279 fi
280
281 dnl get the exported vars from APRUTIL
282 . ./srclib/apr-util/export_vars.sh
283 EXTRA_LIBS="$EXTRA_LIBS $APRUTIL_EXPORT_LIBS"
284 AP_LIBS="$AP_LIBS $LIBTOOL_LIBS"
285
286 APACHE_GEN_CONFIG_VARS
287
288 dnl ## Build modules.c
289 rm -f modules.c
290 echo $MODLIST | $AWK -f $srcdir/build/build-modules-c.awk > modules.c
291
292 AC_DEFINE_UNQUOTED(HTTPD_ROOT, "$prefix",
293         [Root directory of the Apache install area])
294 AC_DEFINE_UNQUOTED(SERVER_CONFIG_FILE, "conf/$progname.conf",
295         [Location of the config file, relative to the Apache root directory])
296 AC_DEFINE_UNQUOTED(APACHE_MPM_DIR, "$MPM_DIR",
297         [Location of the source for the current MPM])
298
299 perlbin=`$ac_aux_dir/PrintPath perl`
300 if test "x$perlbin" = "x"; then
301     perlbin="/replace/with/path/to/perl/interpreter"
302 fi
303 AC_SUBST(perlbin)
304
305 dnl If we are running on BSD/OS, we need to use the BSD .include syntax.
306
307 BSD_MAKEFILE=no
308 case "$host_alias" in
309 *bsdi*)
310     # Check whether they've installed GNU make
311     if make --version > /dev/null 2>&1; then
312         true
313     else
314         BSD_MAKEFILE=yes
315     fi
316     ;;
317 esac
318
319 AC_OUTPUT($APACHE_OUTPUT_FILES support/apxs support/apachectl support/dbmmanage support/log_server_status support/logresolve.pl support/phf_abuse_log.cgi support/split-logfile,,[
320   APACHE_GEN_MAKEFILES
321 ])
322