]> granicus.if.org Git - apache/blob - configure.in
make distclean does not quite
[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 arpa/inet.h \
56 netdb.h \
57 pwd.h \
58 grp.h \
59 )
60 AC_HEADER_SYS_WAIT
61
62 dnl ## Check for C preprocessor symbols
63
64 AC_CHECK_DEFINE(EAGAIN, errno.h)
65
66 dnl ## Check for typedefs, structures, and compiler characteristics.
67
68 AC_C_CONST
69 AC_C_INLINE
70 AC_TYPE_PID_T
71
72 dnl ## Check for library functions
73
74 dnl See Comment #Spoon
75
76 AC_CHECK_FUNCS( \
77 strdup \
78 strcasecmp \
79 strncasecmp \
80 strstr \
81 strerror \
82 initgroups \
83 waitpid \
84 gettimeofday \
85 memmove \
86 bzero \
87 )
88
89 AC_CHECK_LIB(nsl, gethostbyname)
90 AC_CHECK_LIB(socket, socket)
91
92 AC_CHECK_FUNCS(inet_addr inet_network, break, [
93   AC_MSG_ERROR(inet_addr function not found)
94 ])
95
96 APACHE_INADDR_NONE
97
98 REENTRANCY_FLAGS
99
100 AC_FUNC_SELECT_ARGTYPES
101
102 dnl Check if we'll actually need to cast select args all the time
103 if test "$ac_cv_func_select_arg1" != "int" \
104         -o "$ac_cv_func_select_arg234" != "fd_set *" \
105         -o "$ac_cv_func_select_arg5" != "struct timeval *" ; then
106
107     AC_DEFINE(SELECT_NEEDS_CAST,,
108         [Define if arguments to select() aren't what we expect])
109 fi
110
111 dnl ## Checking command-line options
112 test -n "$GCC" && test "$USE_MAINTAINER_MODE" = "yes" && \
113     EXTRA_CFLAGS="$EXTRA_CFLAGS -g -Wall -Wmissing-prototypes -Wstrict-prototypes -Wmissing-declarations"
114
115 APACHE_ENABLE_LAYOUT
116 APACHE_ENABLE_MODULES
117 APACHE_ENABLE_SHARED
118
119 INCLUDES="-I\$(top_srcdir)/include -I\$(top_srcdir)/lib/apr/include"
120 APACHE_SUBST(INCLUDES)
121
122 dnl reading config stubs
123 esyscmd(./helpers/config-stubs .)
124
125 INCLUDES="$INCLUDES -I\$(top_srcdir)/\$(OS_DIR)"
126 EXTRA_LIBS="$EXTRA_LIBS $LIBS"
127 EXTRA_LDFLAGS="$LDFLAGS"
128 LIBS=""
129 LDFLAGS=""
130 APACHE_SUBST(EXTRA_CFLAGS)
131 APACHE_SUBST(EXTRA_LDFLAGS)
132 APACHE_SUBST(EXTRA_LIBS)
133 APACHE_SUBST(REGEX_DIR)
134 APACHE_SUBST(REGEX_LIB)
135 APACHE_SUBST(MPM_LIB)
136 APACHE_SUBST(OS)
137 APACHE_SUBST(OS_DIR)
138 APACHE_SUBST(BUILTIN_LIBS)
139
140 AM_DISABLE_SHARED
141 AM_PROG_LIBTOOL
142 APACHE_LIBTOOL_SILENT
143
144 if test "$apache_need_shared" = "yes"; then
145   $SHELL $srcdir/ltconfig --output=shlibtool --disable-static --srcdir=$srcdir --cache-file=./config.cache $srcdir/ltmain.sh
146 fi
147
148 EXTRA_CFLAGS="$EXTRA_CFLAGS \`\$(abs_srcdir)/apaci\`"
149
150 APACHE_FAST_OUTPUT(apaci Makefile ap/Makefile lib/Makefile main/Makefile
151            modules/Makefile os/Makefile)
152 APACHE_FAST_GENERATE
153         
154 dnl ## Build modules.c
155 rm -f $srcdir/modules.c
156 echo $MODLIST | $AWK -f $srcdir/helpers/build-modules-c.awk > $srcdir/modules.c
157
158 AC_SUBST(prefix)
159
160 AC_OUTPUT($APACHE_OUTPUT_FILES apaci)
161 chmod 744 apaci