]> granicus.if.org Git - apache/blob - configure.in
Missed this first time and forgot about it until now...
[apache] / configure.in
1 dnl ## Process this file with autoconf to produce a configure script
2
3 AC_PREREQ(2.13)
4 AC_INIT(acinclude.m4)
5
6 AC_CONFIG_HEADER(include/ap_config_auto.h)
7 AC_CONFIG_AUX_DIR(.)
8  
9 dnl ## This is the central place where Apache's version should be kept.
10 dnl AM_INIT_AUTOMAKE(apache, 2.0-dev)
11
12 VERSION="apache-2.0-dev"
13         
14 APACHE_VERSION=$VERSION
15 APACHE_SUBST(APACHE_VERSION)
16
17 test "$exec_prefix" = "NONE" && exec_prefix='${prefix}'
18 test "$prefix" = "NONE" && prefix='/usr/local'
19
20 dnl Absolute source/build directory
21 abs_srcdir=`(cd $srcdir && pwd)`
22 abs_builddir=`pwd`
23
24 APACHE_CONFIG_NICE(config.nice)
25
26 dnl If the source dir is not equal to the build dir, 
27 dnl then we are running in VPATH mode.
28
29 if test "$abs_builddir" != "$abs_srcdir"; then
30   USE_VPATH=1
31 fi
32
33 dnl
34 dnl ## Preload our OS configuration
35 APR_PRELOAD
36
37 dnl ## Check for programs
38
39 AC_PROG_AWK
40 AC_PROG_CC
41 AC_PROG_CPP
42 AC_PROG_INSTALL
43 AC_PROG_LN_S
44 dnl AC_PROG_RANLIB
45 dnl AC_PATH_PROG(PERL_PATH, perl)
46
47 REENTRANCY_FLAGS
48
49 dnl various OS checks that apparently set required flags
50 AC_AIX
51 AC_ISC_POSIX
52 AC_MINIX
53
54 dnl ## Check for libraries
55
56 dnl ## Check for header files
57
58 dnl I think these are just used all over the place, so just check for
59 dnl them at the base of the tree. If some are specific to a single
60 dnl directory, they should be moved (Comment #Spoon)
61
62 dnl Regarding standard header files: AC_HEADER_STDC doesn't set symbols
63 dnl HAVE_STRING_H, HAVE_STDLIB_H, etc., so those are checked for
64 dnl explicitly so that the normal HAVE_xxx_H symbol is defined.
65
66 AC_HEADER_STDC
67 AC_CHECK_HEADERS( \
68 string.h \
69 stdlib.h \
70 ctype.h \
71 limits.h \
72 unistd.h \
73 sys/time.h \
74 sys/types.h \
75 sys/socket.h \
76 netinet/in.h \
77 netinet/tcp.h \
78 arpa/inet.h \
79 netdb.h \
80 pwd.h \
81 grp.h \
82 strings.h
83 )
84 AC_HEADER_SYS_WAIT
85
86 dnl ## Check for typedefs, structures, and compiler characteristics.
87
88 AC_C_CONST
89
90 dnl ## Check for library functions
91
92 dnl See Comment #Spoon
93
94 AC_CHECK_FUNCS( \
95 initgroups \
96 )
97
98 AC_CHECK_LIB(nsl, gethostbyname)
99 AC_CHECK_LIB(nsl, gethostname)
100 AC_CHECK_LIB(socket, socket)
101 AC_CHECK_LIB(resolv, sethostent)
102
103 APACHE_INADDR_NONE
104
105 APACHE_EBCDIC
106
107 AC_ARG_WITH(optim,[  --with-optim="FLAGS"      compiler optimisation flags],
108         [OPTIM="$withval"])
109
110 AC_ARG_WITH(port,[  --with-port=PORT        Port on which to listen (default is 80)],
111         [PORT="$withval"],
112         [PORT=80])
113
114 AC_ARG_WITH(debug,[  --with-debug            Turn on debugging and compile time warnings],
115         [if test "$GCC" = "yes"; then CFLAGS="$CFLAGS -g -Wall"; else CFLAGS="$CFLAGS -g"; fi])
116
117 AC_ARG_WITH(maintainer-mode,[  --with-maintainer-mode   Turn on debugging and compile time warnings],
118         [if test "$GCC" = "yes"; then CFLAGS="$CFLAGS -g -Wall -Wmissing-prototypes -Wstrict-prototypes -Wmissing-declarations -DAP_DEBUG"; else CFLAGS="$CFLAGS -g"; fi])
119
120 APACHE_ENABLE_LAYOUT
121 APACHE_ENABLE_MODULES
122 APACHE_ENABLE_SHARED
123
124 INCLUDES="-I\$(top_srcdir)/include -I\$(top_srcdir)/lib/apr/include"
125 if test -n "$USE_VPATH"; then
126   INCLUDES="$INCLUDES -I\$(top_builddir)/include -I\$(top_builddir)/lib/apr/include"
127 fi
128
129 dnl reading config stubs
130 esyscmd(./helpers/config-stubs .)
131
132 INCLUDES="$INCLUDES -I\$(top_srcdir)/os/\$(OS_DIR)"
133 EXTRA_LIBS="$EXTRA_LIBS $LIBS"
134 EXTRA_LDFLAGS="$LDFLAGS"
135 LIBS=""
136 LDFLAGS=""
137 APACHE_SUBST(progname)
138 APACHE_SUBST(EXTRA_CFLAGS)
139 APACHE_SUBST(EXTRA_LDFLAGS)
140 APACHE_SUBST(EXTRA_LIBS)
141 APACHE_SUBST(INCLUDES)
142 APACHE_SUBST(MPM_LIB)
143 APACHE_SUBST(OS)
144 APACHE_SUBST(OS_DIR)
145 APACHE_SUBST(BUILTIN_LIBS)
146 APACHE_SUBST(LIBPRE)
147
148 AM_DISABLE_SHARED
149 AM_PROG_LIBTOOL
150 APACHE_LIBTOOL_SILENT
151
152 if test "$apache_need_shared" = "yes"; then
153   $SHELL $srcdir/ltconfig --output=shlibtool --disable-static --srcdir=$srcdir --cache-file=./config.cache $srcdir/ltmain.sh
154 fi
155
156 AC_ARG_WITH(program-name,
157 [  --with-program-name=alternate executable name],[
158   progname="$withval" ], [
159   progname="httpd"] )
160
161 dnl ### util_xml is always included, so we always need Expat (for now)
162 apache_need_expat=yes
163
164 dnl AP_LIB_DIRS specifies the additional libs from src/lib/ that we need
165 dnl AP_LIBS specifies the actual libraries. note we have two required libs.
166 AP_LIBS="lib/apr/\$(LIBPRE)apr.a lib/pcre/libpcre.la"
167 if test "$apache_need_sdbm" = "yes"; then
168   AP_LIB_DIRS="$AP_LIB_DIRS sdbm"
169   AP_LIBS="$AP_LIBS lib/sdbm/libsdbm.la"
170   INCLUDES="$INCLUDES -I\$(top_srcdir)/lib/sdbm"
171 fi
172 if test "$apache_need_expat" = "yes"; then
173   AP_LIB_DIRS="$AP_LIB_DIRS expat-lite"
174   AP_LIBS="$AP_LIBS lib/expat-lite/libexpat.la"
175   INCLUDES="$INCLUDES -I\$(top_srcdir)/lib/expat-lite"
176 fi
177 APACHE_SUBST(AP_LIB_DIRS)
178 APACHE_SUBST(AP_LIBS)
179
180 dnl check for endianness
181 if test "$cross_compiling" = "no"; then
182   AC_C_BIGENDIAN
183 else
184   AC_DEFINE(AP_UNKNOWN_BYTE_ORDER,1,
185                 [byte order is unknown due to cross-compilation])
186 fi
187
188 APACHE_FAST_OUTPUT(Makefile ap/Makefile lib/Makefile main/Makefile)
189 APACHE_FAST_OUTPUT(modules/Makefile os/Makefile support/Makefile lib/pcre/Makefile)
190 for i in $AP_LIB_DIRS; do
191   APACHE_FAST_OUTPUT(lib/$i/Makefile)
192 done
193
194 dnl ## Run configure for packages Apache uses
195 dnl ## This has been placed at this location for a reason.  This allows
196 dnl ## Apache to set some variable that APR needs (like whether to enable
197 dnl ## or disable threads), while still allowing APR to run and generate
198 dnl ## APRVARS before Apache generates it's Makefiles and the related files.
199 dnl ## This allows APR to detect libraries like dl and tell Apache that it
200 dnl ## needs to include or not include them.
201 RUN_SUBDIR_CONFIG_NOW(lib/apr)
202 . ./lib/apr/APRVARS
203
204 APACHE_GEN_CONFIG_VARS
205
206 dnl There needs to be a .deps file in the top build directory.
207 dnl All others are created dynamically by rules.mk.
208
209 touch .deps
210
211 dnl ## Build modules.c
212 rm -f $srcdir/modules.c
213 echo $MODLIST | $AWK -f $srcdir/helpers/build-modules-c.awk > $srcdir/modules.c
214
215 AC_OUTPUT_COMMANDS([
216 echo '/* Generated by configure */' > ${path_h}.new
217 echo "#define HTTPD_ROOT \"$prefix\"" >> ${path_h}.new
218 echo "#define SUEXEC_BIN \"$bindir/suexec\"" >> ${path_h}.new
219 echo "#define SERVER_CONFIG_FILE \"conf/$progname.conf\"" >> ${path_h}.new
220 echo "#define APACHE_MPM_DIR \"$mpmdir\"" >> ${path_h}.new
221
222 cmp ${path_h}.new ${path_h} >/dev/null 2>&1
223 if test $? -ne 0 ; then
224     rm -f ${path_h} && mv ${path_h}.new ${path_h} && \
225     echo "Updated ${path_h}"
226 else
227     rm -f ${path_h}.new && \
228     echo "${path_h} unchanged"
229 fi
230 ],[
231 path_h=./include/ap_config_path.h
232 prefix=$prefix
233 exec_prefix=$exec_prefix
234 bindir=$bindir
235 progname=$progname
236 mpmdir=$MPM_DIR
237 ])
238
239 AC_TYPE_RLIM_T
240
241 perlbin=`$srcdir/helpers/PrintPath perl`
242 AC_SUBST(perlbin)
243
244 AC_OUTPUT($APACHE_OUTPUT_FILES support/apxs,,[
245   APACHE_GEN_MAKEFILES
246 ])
247
248