-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathconfigure.in
196 lines (167 loc) · 4.16 KB
/
configure.in
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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
dnl $Id: configure.in,v 1.21.2.5 2002/07/28 02:38:32 jnelson Exp $
dnl Process this file with autoconf to produce a configure script.
AC_INIT(boa.c)
dnl Look for gunzip
AC_PATH_PROG(GUNZIP, gunzip)
AC_DEFINE_UNQUOTED(GUNZIP, "$ac_cv_path_GUNZIP")
dnl Checks for programs.
AC_PROG_LEX
AC_PROG_YACC
AC_PROG_CC
AC_PROG_CPP
AC_PROG_MAKE_SET
dnl Checks for libraries.
dnl Make config.h
AC_CONFIG_HEADER(config.h)
dnl Checks for header files.
AC_HEADER_DIRENT
AC_HEADER_STDC
AC_HEADER_SYS_WAIT
AC_CHECK_HEADERS(fcntl.h sys/fcntl.h limits.h sys/time.h sys/select.h)
AC_CHECK_HEADERS(getopt.h)
dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_TYPE_UID_T
AC_TYPE_PID_T
AC_HEADER_TIME
dnl Checks for library functions.
AC_FUNC_SETVBUF_REVERSED
AC_FUNC_MMAP
AC_CHECK_FUNCS(getcwd strdup strstr)
AC_CHECK_FUNCS(gethostname gethostbyname select socket inet_aton)
AC_CHECK_FUNCS(scandir alphasort)
AC_CHECK_STRUCT_FOR([
#if TIME_WITH_SYS_TIME
# include <sys/time.h>
# include <time.h>
#else
# if HAVE_SYS_TIME_H
# include <sys/time.h>
# else
# include <time.h>
# endif
#endif
],tm,tm_gmtoff)
if test "$ac_cv_struct_tm_has_tm_gmtoff" = "yes"; then
AC_DEFINE(HAVE_TM_GMTOFF)
fi
AC_CHECK_STRUCT_FOR([
#if TIME_WITH_SYS_TIME
# include <sys/time.h>
# include <time.h>
#else
# if HAVE_SYS_TIME_H
# include <sys/time.h>
# else
# include <time.h>
# endif
#endif
],tm,tm_zone)
if test "$ac_cv_struct_tm_has_tm_zone" = "yes"; then
AC_DEFINE(HAVE_TM_ZONE)
fi
AC_CHECK_STRUCT_FOR([
#include <sys/types.h>
#include <netinet/in.h>
],sockaddr_in,sin_len)
if test "$ac_cv_struct_sockaddr_in_has_sin_len" = "yes"; then
AC_DEFINE(HAVE_SIN_LEN)
fi
if test $ac_cv_func_socket = no; then
# socket is not in the default libraries.
AC_CHECK_LIB(socket, socket,
[ MYLIBS="$MYLIBS -lsocket" ])
fi
if test $ac_cv_func_inet_aton = no; then
# inet_aton is not in the default libraries.
AC_CHECK_LIB(resolv, inet_aton, MYLIBS="$MYLIBS -lresolv")
fi
if test $ac_cv_func_gethostname = no; then
AC_CHECK_LIB(nsl, gethostname, MYLIBS="$MYLIBS -lnsl")
fi
dnl May end up with duplicate -lnsl -- oh well
if test $ac_cv_func_gethostbyname = no; then
AC_CHECK_LIB(nsl, gethostbyname, MYLIBS="$MYLIBS -lnsl")
fi
LIBS="$LIBS $MYLIBS"
if test $ac_cv_func_scandir = no; then
# scandir not defined, add it
SCANDIR="scandir.o"
fi
if test $ac_cv_func_alphasort = no; then
# alphasort not defined, add it
ALPHASORT="alphasort.o"
fi
if test $ac_cv_func_strdup = no -o $ac_cv_func_strstr = no; then
# strdup or strstr not defined
STRUTIL="strutil.o"
fi
if test -n "$GCC"; then
dnl if we are running gcc, use -pipe
test -n "$GCC" && CFLAGS="$CFLAGS -pipe"
AC_MSG_CHECKING(compile and link profiling code)
AC_ARG_ENABLE(profiling,
[ --enable-profiling Compile and link profiling code],
[
if test "$enableval" = "yes" ; then
AC_MSG_RESULT(yes)
CFLAGS="$CFLAGS -pg"
LDFLAGS="$LDFLAGS -g -pg"
else
AC_MSG_RESULT(no)
fi
],
[
AC_MSG_RESULT(no)
])
fi
AC_MSG_CHECKING(whether to compile and link debugging code)
AC_ARG_ENABLE(debug,
[ --disable-debug Compile and link debugging code],
[
if test "$enableval" = "yes" ; then
AC_MSG_RESULT(yes)
LDFLAGS="$LDFLAGS -g"
test -n "$GCC" && CFLAGS="$CFLAGS -Wall"
else
AC_MSG_RESULT(no)
fi
],
[
AC_MSG_RESULT(yes)
LDFLAGS="$LDFLAGS -g"
test -n "$GCC" && CFLAGS="$CFLAGS -Wall"
])
AC_MSG_CHECKING(whether to link with the Dmalloc memory debugger/profiler)
AC_ARG_WITH(dmalloc,
[ --with-dmalloc link with the Dmalloc memory debugger/profiler],
[
if test "$withval" = "yes"; then
AC_MSG_RESULT(trying)
AC_CHECK_LIB(dmalloc, dmalloc_shutdown)
else
AC_MSG_RESULT(no)
fi
],
[
AC_MSG_RESULT(no)
])
AC_MSG_CHECKING(whether to link with the Electric Fence memory debugger)
AC_ARG_WITH(efence,
[ --with-efence link with the Electric Fence memory debugger ],
[
if test "$withval" = "yes"; then
AC_MSG_RESULT(trying)
AC_CHECK_LIB(efence, main)
else
AC_MSG_RESULT(no)
fi
],
[
AC_MSG_RESULT(no)
])
dnl For anything that wasn't found but we have source for
AC_SUBST(STRUTIL)
AC_SUBST(ALPHASORT)
AC_SUBST(SCANDIR)
AC_OUTPUT(Makefile)