]> granicus.if.org Git - apache/blob - configure.in
Overall UNIX build system improvements:
[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 REENTRANCY_FLAGS
35
36 dnl various OS checks that apparently set required flags
37 AC_AIX
38 AC_ISC_POSIX
39 AC_MINIX
40
41 dnl ## Check for libraries
42
43 dnl ## Check for header files
44
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)
48
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.
52
53 AC_HEADER_STDC
54 AC_CHECK_HEADERS( \
55 string.h \
56 stdlib.h \
57 ctype.h \
58 limits.h \
59 unistd.h \
60 sys/stat.h \
61 sys/time.h \
62 sys/types.h \
63 sys/socket.h \
64 netinet/in.h \
65 netinet/tcp.h \
66 arpa/inet.h \
67 netdb.h \
68 pwd.h \
69 grp.h \
70 )
71 AC_HEADER_SYS_WAIT
72 AC_STRUCT_TM
73
74 dnl ## Check for C preprocessor symbols
75
76 AC_CHECK_DEFINE(EAGAIN, errno.h)
77
78 dnl ## Check for typedefs, structures, and compiler characteristics.
79
80 AC_C_CONST
81 AC_C_INLINE
82 AC_TYPE_PID_T
83
84 dnl ## Check for library functions
85
86 dnl See Comment #Spoon
87
88 AC_CHECK_FUNCS( \
89 strdup \
90 strcasecmp \
91 strncasecmp \
92 strstr \
93 strerror \
94 initgroups \
95 waitpid \
96 gettimeofday \
97 memmove \
98 bzero \
99 )
100
101 AC_CHECK_LIB(nsl, gethostbyname)
102 AC_CHECK_LIB(nsl, gethostname)
103 AC_CHECK_LIB(socket, socket)
104 AC_CHECK_LIB(resolv, sethostent)
105
106 AC_CHECK_FUNCS(inet_addr inet_network, break, [
107   AC_MSG_ERROR(inet_addr function not found)
108 ])
109
110 APACHE_INADDR_NONE
111
112 APACHE_EBCDIC
113
114 AC_FUNC_SELECT_ARGTYPES
115
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
120
121     AC_DEFINE(SELECT_NEEDS_CAST,,
122         [Define if arguments to select() aren't what we expect])
123 fi
124
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"
130
131 APACHE_ENABLE_LAYOUT
132 APACHE_ENABLE_MODULES
133 APACHE_ENABLE_SHARED
134
135 INCLUDES="-I\$(top_srcdir)/include -I\$(top_srcdir)/lib/apr/include"
136 APACHE_SUBST(INCLUDES)
137
138 dnl reading config stubs
139 esyscmd(./helpers/config-stubs .)
140
141 INCLUDES="$INCLUDES -I\$(top_srcdir)/\$(OS_DIR)"
142 EXTRA_LIBS="$EXTRA_LIBS $LIBS"
143 EXTRA_LDFLAGS="$LDFLAGS"
144 LIBS=""
145 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)
153 APACHE_SUBST(OS)
154 APACHE_SUBST(OS_DIR)
155 APACHE_SUBST(BUILTIN_LIBS)
156 APACHE_SUBST(LIBPRE)
157
158 AM_DISABLE_SHARED
159 AM_PROG_LIBTOOL
160 APACHE_LIBTOOL_SILENT
161
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
164 fi
165
166 AC_ARG_WITH(program-name,
167 [  --with-program-name=alternate executable name],[
168   progname="$withval" ], [
169   progname="httpd"] )
170
171 APACHE_FAST_OUTPUT(Makefile ap/Makefile lib/Makefile main/Makefile
172             modules/Makefile os/Makefile support/Makefile)
173
174 APACHE_FAST_GENERATE
175         
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
179
180 AC_OUTPUT_COMMANDS([
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
185
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}"
190 else
191     rm -f ${path_h}.new && \
192     echo "${path_h} unchanged"
193 fi
194 ],[
195 path_h=./include/ap_config_path.h
196 prefix=$prefix
197 exec_prefix=$exec_prefix
198 bindir=$bindir
199 progname=$progname
200 ])
201
202 AC_OUTPUT($APACHE_OUTPUT_FILES)
203
204