1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
|
dnl ## Process this file with autoconf to produce a configure script
AC_PREREQ(2.13)
AC_INIT(main/http_main.c)
dnl ## This is the central place where Apache's version should be kept.
AM_INIT_AUTOMAKE(apache, 2.0-dev)
AM_CONFIG_HEADER(include/ap_config_auto.h)
APACHE_VERSION=$VERSION
AC_SUBST(APACHE_VERSION)
dnl XXX - make will sometimes die as annoyingly as automake with this option.
dnl just remake and continue
AM_MAINTAINER_MODE
dnl We want this one before the checks, so the checks can modify CFLAGS
test -z "$CFLAGS" && auto_cflags=1
dnl Needed for APACHE_MODULE() to work
cwd=`pwd`
dnl ## Run configure for packages Apache uses
AC_CONFIG_SUBDIRS(lib/apr)
dnl ## Check for programs
AC_PROG_AWK
AC_PROG_CC
AC_PROG_CPP
AC_PROG_INSTALL
dnl AC_PROG_RANLIB
dnl AC_PATH_PROG(PERL_PATH, perl)
dnl various OS checks that apparently set required flags
AC_AIX
AC_ISC_POSIX
AC_MINIX
dnl ## Check for libraries
dnl ## Check for header files
dnl I think these are just used all over the place, so just check for
dnl them at the base of the tree. If some are specific to a single
dnl directory, they should be moved (Comment #Spoon)
AC_HEADER_STDC
AC_CHECK_HEADERS( \
unistd.h \
sys/stat.h \
sys/time.h \
sys/types.h \
sys/socket.h \
netinet/in.h \
arpa/inet.h \
netdb.h \
pwd.h \
grp.h \
)
AC_HEADER_SYS_WAIT
dnl ## Check for C preprocessor symbols
AC_CHECK_DEFINE(EAGAIN, errno.h)
dnl ## Check for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_C_INLINE
AC_TYPE_PID_T
dnl ## Check for library functions
dnl See Comment #Spoon
AC_CHECK_FUNCS( \
strdup \
strcasecmp \
strncasecmp \
strstr \
strerror \
initgroups \
waitpid \
difftime \
gettimeofday \
memmove \
bzero \
)
AC_CHECK_FUNCS(inet_addr inet_network, break, [
AC_MSG_ERROR(inet_addr function not found)
])
AC_FUNC_SELECT_ARGTYPES
dnl Check if we'll actually need to cast select args all the time
if test "$ac_cv_func_select_arg1" != "int" \
-o "$ac_cv_func_select_arg234" != "fd_set *" \
-o "$ac_cv_func_select_arg5" != "struct timeval *" ; then
AC_DEFINE(SELECT_NEEDS_CAST,,
[Define if arguments to select() aren't what we expect])
fi
AM_PROG_LIBTOOL
dnl ## Checking command-line options
test -n "$GCC" && test "$USE_MAINTAINER_MODE" = "yes" && \
CFLAGS="$CFLAGS -g -Wall -Wmissing-prototypes -Wstrict-prototypes -Wmissing-declarations"
INCLUDES="-I\$(top_srcdir)/include -I\$(top_srcdir)/lib/apr/include"
AC_SUBST(INCLUDES)
dnl reading config stubs
esyscmd(./helpers/config-stubs .)
INCLUDES="$INCLUDES -I\$(top_srcdir)/\$(OS_DIR)"
AC_SUBST(EXTRA_LIBS)
AC_SUBST(REGEX_DIR)
AC_SUBST(REGEX_LIB)
AC_SUBST(MPM_LIB)
AC_SUBST(OS)
AC_SUBST(OS_DIR)
dnl ## Build modules.c
rm -f $srcdir/modules.c
echo $MODLIST | $AWK -f $srcdir/helpers/build-modules-c.awk > $srcdir/modules.c
AC_OUTPUT([Makefile ap/Makefile main/Makefile modules/Makefile
modules/standard/Makefile os/Makefile $APACHE_OUTPUT_FILES])
|