]> granicus.if.org Git - apache/blob - configure.in
3a2a4a741f786be6537429f2df5e7146be7e618e
[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 dnl ## This is the central place where Apache's version should be kept.
7 dnl AM_INIT_AUTOMAKE(apache, 2.0-dev)
8
9 VERSION="apache-2.0-dev"
10         
11 AC_CONFIG_HEADER(include/ap_config_auto.h)
12
13 APACHE_VERSION=$VERSION
14 APACHE_SUBST(APACHE_VERSION)
15
16 test "$exec_prefix" = "NONE" && exec_prefix='${prefix}'
17 test "$prefix" = "NONE" && prefix='/usr/local'
18
19 dnl Needed for APACHE_MODULE() to work
20 cwd=`pwd`
21
22 dnl ## Run configure for packages Apache uses
23 AC_CONFIG_SUBDIRS(lib/apr)
24
25 dnl ## Check for programs
26
27 AC_PROG_AWK
28 AC_PROG_CC
29 AC_PROG_CPP
30 AC_PROG_INSTALL
31 dnl AC_PROG_RANLIB
32 dnl AC_PATH_PROG(PERL_PATH, perl)
33
34 dnl various OS checks that apparently set required flags
35 AC_AIX
36 AC_ISC_POSIX
37 AC_MINIX
38
39 dnl ## Check for libraries
40
41 dnl ## Check for header files
42
43 dnl I think these are just used all over the place, so just check for
44 dnl them at the base of the tree. If some are specific to a single
45 dnl directory, they should be moved (Comment #Spoon)
46
47 AC_HEADER_STDC
48 AC_CHECK_HEADERS( \
49 unistd.h \
50 sys/stat.h \
51 sys/time.h \
52 sys/types.h \
53 sys/socket.h \
54 netinet/in.h \
55 netinet/tcp.h \
56 arpa/inet.h \
57 netdb.h \
58 pwd.h \
59 grp.h \
60 )
61 AC_HEADER_SYS_WAIT
62 AC_STRUCT_TM
63
64 dnl ## Check for C preprocessor symbols
65
66 AC_CHECK_DEFINE(EAGAIN, errno.h)
67
68 dnl ## Check for typedefs, structures, and compiler characteristics.
69
70 AC_C_CONST
71 AC_C_INLINE
72 AC_TYPE_PID_T
73
74 dnl ## Check for library functions
75
76 dnl See Comment #Spoon
77
78 AC_CHECK_FUNCS( \
79 strdup \
80 strcasecmp \
81 strncasecmp \
82 strstr \
83 strerror \
84 initgroups \
85 waitpid \
86 gettimeofday \
87 memmove \
88 bzero \
89 )
90
91 AC_CHECK_LIB(nsl, gethostbyname)
92 AC_CHECK_LIB(nsl, gethostname)
93 AC_CHECK_LIB(socket, socket)
94 AC_CHECK_LIB(resolv, sethostent)
95
96 AC_CHECK_FUNCS(inet_addr inet_network, break, [
97   AC_MSG_ERROR(inet_addr function not found)
98 ])
99
100 APACHE_INADDR_NONE
101
102 APACHE_EBCDIC
103
104 REENTRANCY_FLAGS
105
106 AC_FUNC_SELECT_ARGTYPES
107
108 dnl Check if we'll actually need to cast select args all the time
109 if test "$ac_cv_func_select_arg1" != "int" \
110         -o "$ac_cv_func_select_arg234" != "fd_set *" \
111         -o "$ac_cv_func_select_arg5" != "struct timeval *" ; then
112
113     AC_DEFINE(SELECT_NEEDS_CAST,,
114         [Define if arguments to select() aren't what we expect])
115 fi
116
117 dnl ## Checking command-line options
118 test -n "$GCC" && test "$USE_MAINTAINER_MODE" = "yes" && \
119     EXTRA_CFLAGS="$EXTRA_CFLAGS -g -Wall -Wmissing-prototypes -Wstrict-prototypes -Wmissing-declarations"
120 test -n "$GCC" && test "$USE_MAINTAINER_MODE" = "y2" && \
121     EXTRA_CFLAGS="$EXTRA_CFLAGS -g -Wall -Werror -Wmissing-declarations"
122
123 APACHE_ENABLE_LAYOUT
124 APACHE_ENABLE_MODULES
125 APACHE_ENABLE_SHARED
126
127 INCLUDES="-I\$(top_srcdir)/include -I\$(top_srcdir)/lib/apr/include"
128 APACHE_SUBST(INCLUDES)
129
130 dnl reading config stubs
131 esyscmd(./helpers/config-stubs .)
132
133 INCLUDES="$INCLUDES -I\$(top_srcdir)/\$(OS_DIR)"
134 EXTRA_LIBS="$EXTRA_LIBS $LIBS"
135 EXTRA_LDFLAGS="$LDFLAGS"
136 LIBS=""
137 LDFLAGS=""
138 APACHE_SUBST(EXTRA_CFLAGS)
139 APACHE_SUBST(EXTRA_LDFLAGS)
140 APACHE_SUBST(EXTRA_LIBS)
141 APACHE_SUBST(REGEX_DIR)
142 APACHE_SUBST(REGEX_LIB)
143 APACHE_SUBST(MPM_LIB)
144 APACHE_SUBST(OS)
145 APACHE_SUBST(OS_DIR)
146 APACHE_SUBST(BUILTIN_LIBS)
147 APACHE_SUBST(LIBPRE)
148
149 AM_DISABLE_SHARED
150 AM_PROG_LIBTOOL
151 APACHE_LIBTOOL_SILENT
152
153 if test "$apache_need_shared" = "yes"; then
154   $SHELL $srcdir/ltconfig --output=shlibtool --disable-static --srcdir=$srcdir --cache-file=./config.cache $srcdir/ltmain.sh
155 fi
156
157 APACHE_FAST_OUTPUT(Makefile ap/Makefile lib/Makefile main/Makefile
158             modules/Makefile os/Makefile)
159 APACHE_FAST_GENERATE
160         
161 dnl ## Build modules.c
162 rm -f $srcdir/modules.c
163 echo $MODLIST | $AWK -f $srcdir/helpers/build-modules-c.awk > $srcdir/modules.c
164
165 AC_ARG_WITH(program-name,
166 [  --with-program-name=alternate executable name],[
167   progname="$withval" ], [
168   progname='httpd'] )
169
170 AC_OUTPUT_COMMANDS([
171 echo '/* Generated by configure */' > ${path_h}.new
172 echo "#define HTTPD_ROOT \"$prefix\"" >> ${path_h}.new
173 echo "#define SUEXEC_BIN \"$bindir/suexec\"" >> ${path_h}.new
174
175 cmp ${path_h}.new ${path_h} >/dev/null 2>&1
176 if test $? -ne 0 ; then
177     rm -f ${path_h} && mv ${path_h}.new ${path_h} && \
178     echo "Updated ${path_h}"
179 else
180     rm -f ${path_h}.new && \
181     echo "${path_h} unchanged"
182 fi
183 ],[
184 path_h=./include/ap_config_path.h
185 prefix=$prefix
186 exec_prefix=$exec_prefix
187 bindir=$bindir
188 ])
189
190 AC_OUTPUT($APACHE_OUTPUT_FILES Makefile)
191
192