]>
Commit | Line | Data |
---|---|---|
1b3db6d9 | 1 | |
2877b8a9 | 2 | dnl Configuration input file for Squid |
090089c4 | 3 | dnl |
52303a3d | 4 | dnl $Id: configure.in,v 1.497 2008/02/17 09:24:49 serassio Exp $ |
090089c4 | 5 | dnl |
090089c4 | 6 | dnl |
7 | dnl | |
39e4ea99 | 8 | AC_INIT(Squid Web Proxy, 3.HEAD-BZR, http://www.squid-cache.org/bugs/, squid) |
856e69c5 | 9 | AC_PREREQ(2.52) |
8d9ce05e | 10 | AM_CONFIG_HEADER(include/autoconf.h) |
71b12d7c | 11 | AC_CONFIG_AUX_DIR(cfgaux) |
8d9ce05e | 12 | AC_CONFIG_SRCDIR([src/main.cc]) |
25b6a907 | 13 | AM_INIT_AUTOMAKE([tar-ustar]) |
52303a3d | 14 | AC_REVISION($Revision: 1.497 $)dnl |
a2794549 | 15 | AC_PREFIX_DEFAULT(/usr/local/squid) |
246d7ffc | 16 | AM_MAINTAINER_MODE |
a2794549 | 17 | |
63e02610 | 18 | PRESET_CFLAGS="$CFLAGS" |
19 | PRESET_LDFLAGS="$LDFLAGS" | |
20 | ||
a2794549 | 21 | dnl Set default LDFLAGS |
22 | if test -z "$LDFLAGS"; then | |
23 | LDFLAGS="-g" | |
24 | fi | |
25 | ||
a2794549 | 26 | dnl Check for GNU cc |
27 | AC_PROG_CC | |
e6c4cdd6 | 28 | AM_PROG_CC_C_O |
c4b0db82 | 29 | AC_LANG_C |
29b8d8d6 | 30 | AC_PROG_CXX |
88d50a22 | 31 | AC_CANONICAL_HOST |
645aa936 | 32 | AC_DISABLE_SHARED |
33 | AC_PROG_LIBTOOL | |
f5691f9c | 34 | AC_LTDL_DLLIB |
645aa936 | 35 | AC_PROG_RANLIB |
88d50a22 | 36 | |
a2794549 | 37 | |
26675bf4 | 38 | CRYPTLIB='' |
00fa2c12 | 39 | REGEXLIB='' # -lregex |
40 | LIBREGEX='' # libregex.a | |
090089c4 | 41 | |
a2794549 | 42 | dnl find out the exe extension for this platform. If it's not empty, use it for CGI's as well. |
43 | AC_EXEEXT | |
44 | AC_OBJEXT | |
45 | ||
46 | if test -z "$EXEEXT"; then | |
47 | CGIEXT=".cgi" | |
48 | else | |
7aeb8001 | 49 | # automake automatically adds .exe when installing binaries |
50 | CGIEXT="" | |
a2794549 | 51 | fi |
7aeb8001 | 52 | AC_SUBST(CGIEXT) |
a2794549 | 53 | |
0e6d05ef | 54 | dnl this should be expanded to a list of platform sensible support requirements. |
55 | dnl (adding an option like --enable-cygwin-support doesn't make sense :]) - R Collins 2001 | |
df087e68 | 56 | case "$host_os" in |
4b26fae9 | 57 | mingw|mingw32|cygwin|cygwin32) |
a2794549 | 58 | AM_CONDITIONAL(ENABLE_WIN32SPECIFIC, true) |
df087e68 | 59 | ;; |
60 | *) | |
a2794549 | 61 | AM_CONDITIONAL(ENABLE_WIN32SPECIFIC, false) |
df087e68 | 62 | ;; |
63 | esac | |
df087e68 | 64 | |
4b26fae9 | 65 | case "$host_os" in |
66 | mingw|mingw32) | |
67 | AC_PATH_PROG(WIN32_PSAPI, psapi.dll, none) | |
68 | CFLAGS="$CFLAGS -mthreads" | |
69 | CXXFLAGS="$CXXFLAGS -mthreads" | |
70 | if test "$ac_cv_path_WIN32_PSAPI" = "none"; then | |
71 | echo "PSAPI.DLL is recommended to run Squid on Windows NT Platform" | |
72 | echo "Please see PSAPI.DLL section on doc/win32-relnotes.html." | |
73 | else | |
74 | AC_DEFINE(HAVE_WIN32_PSAPI,1,[Define if you have PSAPI.DLL on Windows systems]) | |
75 | LIBS="$LIBS -lpsapi" | |
76 | fi | |
790ebe36 | 77 | MINGW_LIBS="-lmingwex" |
b5d712b5 | 78 | AM_CONDITIONAL(USE_IPC_WIN32, true) |
790ebe36 | 79 | AC_SUBST(MINGW_LIBS) |
4b26fae9 | 80 | ;; |
b5d712b5 | 81 | *) |
82 | AM_CONDITIONAL(USE_IPC_WIN32, false) | |
83 | ;; | |
4b26fae9 | 84 | esac |
85 | ||
a26bdc75 | 86 | if test -z "$CACHE_HTTP_PORT"; then |
87 | CACHE_HTTP_PORT="3128" | |
88 | fi | |
89 | if test -z "$CACHE_ICP_PORT"; then | |
90 | CACHE_ICP_PORT="3130" | |
91 | fi | |
a26bdc75 | 92 | |
f4aaf39c | 93 | dnl Substitutions |
6a9f6389 | 94 | AC_DEFINE_UNQUOTED(CACHE_HTTP_PORT, $CACHE_HTTP_PORT, |
95 | [What default TCP port to use for HTTP listening?]) | |
58c1507a | 96 | AC_SUBST(CACHE_HTTP_PORT) |
6a9f6389 | 97 | AC_DEFINE_UNQUOTED(CACHE_ICP_PORT, $CACHE_ICP_PORT, |
98 | [What default UDP port to use for ICP listening?]) | |
f5e5c4cf | 99 | AC_SUBST(CACHE_ICP_PORT) |
090089c4 | 100 | |
6a9f6389 | 101 | AC_DEFINE_UNQUOTED(CONFIG_HOST_TYPE, "$host",[Host type from configure]) |
30a4f2a8 | 102 | |
6a9f6389 | 103 | AC_DEFINE_UNQUOTED(SQUID_CONFIGURE_OPTIONS, "$ac_configure_args", [configure command line used to configure Squid]) |
090089c4 | 104 | |
5483d916 | 105 | CACHE_EFFECTIVE_USER="nobody" |
106 | AC_ARG_WITH(default-user, | |
107 | [ --with-default-user=USER System user account for squid permissions. | |
108 | default: nobody], | |
109 | [ CACHE_EFFECTIVE_USER="$withval" ] | |
110 | ) | |
111 | AC_SUBST(CACHE_EFFECTIVE_USER) | |
112 | ||
6ad85e8a | 113 | dnl Gerben Wierda <Gerben_Wierda@RnA.nl> |
114 | case "$host" in | |
115 | mab-next-nextstep3) | |
116 | CC="$CC -arch m68k -arch i486 -arch hppa -arch sparc" | |
117 | ;; | |
118 | esac | |
119 | ||
4c43504f | 120 | if test "$GCC" = "yes"; then |
121 | GCCVER=`$CC -v 2>&1 | awk '$2 == "version" {print $3}'` | |
122 | GCCVER2=`echo $GCCVER | awk '{print $1 * 100}'` | |
123 | case "$host" in | |
124 | i386-*-freebsd*) | |
125 | if test $GCCVER2 -lt 300 ; then | |
126 | echo "ERROR: GCC $GCCVER causes a coredump on $host" | |
127 | echo "ERROR: Try a more recent GCC version" | |
dd81cb63 | 128 | sleep 5 |
4c43504f | 129 | fi |
130 | ;; | |
131 | esac | |
132 | unset GCCVER | |
133 | unset GCCVER2 | |
134 | fi | |
135 | ||
30a4f2a8 | 136 | dnl Set Default CFLAGS |
137 | if test -z "$PRESET_CFLAGS"; then | |
138 | if test "$GCC" = "yes"; then | |
139 | case "$host" in | |
97b12a5b | 140 | *-sun-sunos*) |
30a4f2a8 | 141 | # sunos has too many warnings for this to be useful |
142 | # motorola too | |
143 | ;; | |
97b12a5b | 144 | *m88k*) |
145 | # Motorola cc/ld does not like -02 but is ok on -O | |
146 | CFLAGS=`echo $CFLAGS | sed -e 's/-O[0-9]/-O/'` | |
147 | ;; | |
30a4f2a8 | 148 | *) |
63e02610 | 149 | CFLAGS="-Wall $CFLAGS" |
30a4f2a8 | 150 | ;; |
151 | esac | |
81a820c6 | 152 | else |
153 | case "$host" in | |
c415c128 | 154 | *mips-sgi-irix6.*) |
81a820c6 | 155 | # suggested by Rafael Seidl <rafaels@cthulhu.engr.sgi.com> |
63e02610 | 156 | CFLAGS="-O3 -OPT:Olimit=0:space=OFF \ |
776b0191 | 157 | -woff 1009,1014,1110,1116,1183,1185,1188,1204,1230,1233,1355 \ |
81a820c6 | 158 | -Wl,-woff,85,-woff,84,-woff,134 \ |
63e02610 | 159 | -nostdinc -I/usr/include -D_BSD_SIGNALS $CFLAGS" |
776b0191 | 160 | CXXFLAGS="-O3 -OPT:Olimit=0:space=OFF \ |
161 | -woff 1009,1014,1110,1116,1183,1185,1188,1204,1230,1233,1355 \ | |
162 | -Wl,-woff,85,-woff,84,-woff,134 \ | |
163 | -nostdinc -I/usr/include -D_BSD_SIGNALS $CXXFLAGS" | |
81a820c6 | 164 | ;; |
e8f5fb18 | 165 | alpha-dec-osf4.*) |
553c24ae | 166 | # Mogul says DEC compilers take both -g and -O2 |
b6a2f15e | 167 | CFLAGS=`echo $CFLAGS | sed -e 's/-g/-g3/'` |
63e02610 | 168 | CFLAGS="-O2 $CFLAGS" |
553c24ae | 169 | ;; |
81a820c6 | 170 | *) |
171 | ;; | |
172 | esac | |
30a4f2a8 | 173 | fi |
30a4f2a8 | 174 | fi |
175 | ||
d2e3605e | 176 | dnl set squid required flags |
177 | if test "$GCC" = "yes"; then | |
9f68fb10 | 178 | dnl Guido Serassio (serassio@squid-cache.org) 20070811 |
179 | dnl Using the latest MinGW (gcc 3.4.5 + mingw-runtime 3.13) cannot build with | |
180 | dnl -Wmissing-prototypes -Wmissing-declarations | |
181 | dnl TODO: check if the problem will be present in any other newer MinGW release. | |
182 | case "$host_os" in | |
183 | mingw|mingw32) | |
184 | SQUID_CFLAGS="-Werror -Wall -Wpointer-arith -Wwrite-strings -Wcomments" | |
185 | ;; | |
186 | *) | |
187 | SQUID_CFLAGS="-Werror -Wall -Wpointer-arith -Wwrite-strings -Wmissing-prototypes -Wmissing-declarations -Wcomments" | |
188 | ;; | |
189 | esac | |
190 | SQUID_CXXFLAGS="-Werror -Wall -Wpointer-arith -Wwrite-strings -Wcomments" | |
d2e3605e | 191 | else |
9f68fb10 | 192 | SQUID_CFLAGS= |
193 | SQUID_CXXFLAGS= | |
d2e3605e | 194 | fi |
195 | AC_SUBST(SQUID_CFLAGS) | |
196 | AC_SUBST(SQUID_CXXFLAGS) | |
197 | ||
d7c59e37 | 198 | AC_TEST_CHECKFORHUGEOBJECTS |
199 | SQUID_CXXFLAGS="$SQUID_CXXFLAGS $HUGE_OBJECT_FLAG" | |
200 | ||
30a4f2a8 | 201 | dnl Set LDFLAGS |
202 | if test -z "$PRESET_LDFLAGS"; then | |
203 | if test "$GCC" = "yes"; then | |
204 | case "$host" in | |
63e02610 | 205 | *mips-sgi-irix6.*) |
206 | # Silence Linker warnings 84, 85 and 134 | |
207 | LDFLAGS="-Wl,-woff,85 -Wl,-woff,84 -Wl,-woff,134 $LDFLAGS" | |
208 | ;; | |
30a4f2a8 | 209 | *) |
210 | # nothing | |
211 | ;; | |
212 | esac | |
81a820c6 | 213 | else |
214 | case "$host" in | |
63e02610 | 215 | *) |
216 | # nothing | |
81a820c6 | 217 | ;; |
218 | esac | |
30a4f2a8 | 219 | fi |
220 | fi | |
2060fa9a | 221 | |
e5f4e1b0 | 222 | AC_ARG_ENABLE(gnuregex, |
2c5d82f9 | 223 | [ --enable-gnuregex Compile GNUregex. Unless you have reason to use this |
2df6213e | 224 | option, you should not enable it. This library file |
225 | is usually only required on Windows and very old | |
226 | Unix boxes which do not have their own regex library | |
227 | built in.], | |
e5f4e1b0 | 228 | [USE_GNUREGEX=$enableval]) |
229 | ||
6c0c04db | 230 | SquidInline="yes" |
83079644 | 231 | |
232 | AC_ARG_ENABLE(optimizations, | |
233 | [ --disable-optimizations Don't compile Squid with compiler optimizations enabled. | |
2df6213e | 234 | Optimization is good for production builds, but not |
235 | good for debugging. During development, use | |
236 | --disable-optimizations to reduce compilation times | |
237 | and allow easier debugging. This option implicitly | |
238 | also enabled --disable-inline], | |
83079644 | 239 | [ if test "$enableval" = "no" ; then |
240 | echo "Disabling compiler optimizations (-O flag)" | |
241 | CFLAGS="`echo $CFLAGS | sed -e 's/-O[[0-9]]*//'`" | |
242 | CXXFLAGS="`echo $CXXFLAGS | sed -e 's/-O[[0-9]]*//'`" | |
243 | SquidInline="no" | |
244 | fi | |
245 | ]) | |
246 | ||
6c0c04db | 247 | AC_ARG_ENABLE(inline, |
248 | [ --disable-inline Don't compile trivial methods as inline. Squid | |
2df6213e | 249 | is coded with much of the code able to be inlined. |
250 | Inlining is good for production builds, but not | |
251 | good for development. During development, use | |
252 | --disable-inline to reduce compilation times and | |
253 | allow incremental builds to be quick. For | |
254 | production builds, or load tests, use | |
255 | --enable-inline to have squid make all trivial | |
256 | methods inlinable by the compiler.], | |
6c0c04db | 257 | [ if test "$enableval" = "no" ; then |
258 | SquidInline="no" | |
259 | fi | |
260 | ]) | |
261 | ||
262 | if test "$SquidInline" = "yes" ; then | |
263 | AC_DEFINE(_SQUID_INLINE_, inline, [Keyword used by squid for inlining methods]) | |
264 | AC_DEFINE(_USE_INLINE_,, [Include inline methods into header file]) | |
265 | else | |
83079644 | 266 | echo "Inlining optimization disabled" |
6c0c04db | 267 | AC_DEFINE(_SQUID_INLINE_,, [Keyword used by squid for inlining methods]) |
268 | fi | |
269 | ||
fa80a8ef | 270 | AC_ARG_ENABLE(debug-cbdata, |
271 | [ --enable-debug-cbdata Provide some debug information in cbdata], | |
272 | [ if test "$enableval" = "yes" ; then | |
273 | echo "cbdata debugging enabled" | |
6a9f6389 | 274 | AC_DEFINE(CBDATA_DEBUG,1,[Enable for cbdata debug information]) |
fa80a8ef | 275 | fi |
276 | ]) | |
277 | ||
0961c811 | 278 | dnl This is a developer only option.. developers know how to set defines |
279 | dnl | |
280 | dnl AC_ARG_ENABLE(xmalloc-debug, | |
281 | dnl [ --enable-xmalloc-debug Do some simple malloc debugging], | |
282 | dnl [ if test "$enableval" = "yes" ; then | |
283 | dnl echo "Malloc debugging enabled" | |
6a9f6389 | 284 | dnl AC_DEFINE(XMALLOC_DEBUG,1,[Define to do simple malloc debugging]) |
0961c811 | 285 | dnl fi |
286 | dnl ]) | |
287 | ||
288 | dnl This is a developer only option.. developers know how to set defines | |
289 | dnl | |
290 | dnl AC_ARG_ENABLE(xmalloc-debug-trace, | |
291 | dnl [ --enable-xmalloc-debug-trace | |
292 | dnl Detailed trace of memory allocations], | |
293 | dnl [ if test "$enableval" = "yes" ; then | |
294 | dnl echo "Malloc debug trace enabled" | |
6a9f6389 | 295 | dnl AC_DEFINE(XMALLOC_TRACE,1,[Define to have a detailed trace of memory allocations]) |
296 | dnl AC_DEFINE(XMALLOC_DEBUG,1) | |
0961c811 | 297 | dnl fi |
298 | dnl ]) | |
e5f4e1b0 | 299 | |
d9180414 | 300 | AC_ARG_ENABLE(xmalloc-statistics, |
e5f4e1b0 | 301 | [ --enable-xmalloc-statistics |
302 | Show malloc statistics in status page], | |
303 | [ if test "$enableval" = "yes" ; then | |
304 | echo "Malloc statistics enabled" | |
6a9f6389 | 305 | AC_DEFINE(XMALLOC_STATISTICS,1,[Define to have malloc statistics]) |
e5f4e1b0 | 306 | fi |
307 | ]) | |
308 | ||
14b32873 | 309 | use_carp=1 |
323fe0d4 | 310 | AC_ARG_ENABLE(carp, |
f5e5c4cf | 311 | [ --disable-carp Disable CARP support], |
f7c8dc02 | 312 | [ if test "$enableval" = "no" ; then |
313 | echo "CARP disabled" | |
14b32873 | 314 | use_carp=0 |
323fe0d4 | 315 | fi |
f7c8dc02 | 316 | ]) |
14b32873 | 317 | if test $use_carp = 1; then |
318 | AC_DEFINE(USE_CARP, 1, [Cache Array Routing Protocol]) | |
14b32873 | 319 | fi |
323fe0d4 | 320 | |
cd748f27 | 321 | AC_ARG_ENABLE(async-io, |
9bc73deb | 322 | [ --enable-async-io[=N_THREADS] |
cd748f27 | 323 | Shorthand for |
f85c88f3 | 324 | --with-aufs-threads=N_THREADS |
cd748f27 | 325 | --with-pthreads |
326 | --enable-storeio=ufs,aufs], | |
327 | [ case $enableval in | |
9bc73deb | 328 | yes) |
69144041 | 329 | with_pthreads="yes" |
cd748f27 | 330 | STORE_MODULES="ufs aufs" |
9bc73deb | 331 | ;; |
332 | no) | |
9bc73deb | 333 | ;; |
334 | *) | |
f85c88f3 | 335 | aufs_io_threads=$enableval |
69144041 | 336 | with_pthreads="yes" |
cd748f27 | 337 | STORE_MODULES="ufs aufs" |
9bc73deb | 338 | ;; |
339 | esac | |
340 | ]) | |
341 | ||
f85c88f3 | 342 | AC_ARG_WITH(aufs-threads, |
343 | [ --with-aufs-threads=N_THREADS | |
cd748f27 | 344 | Tune the number of worker threads for the aufs object |
345 | store.], | |
a3310b77 | 346 | [ case $withval in |
347 | [[0-9]]*) | |
348 | aufs_io_threads=$withval | |
349 | ;; | |
350 | *) | |
351 | echo "ERROR: Invalid --with-aufs-threads argument" | |
352 | exit 1 | |
353 | ;; | |
354 | esac | |
355 | ]) | |
f85c88f3 | 356 | if test "$aufs_io_threads"; then |
357 | echo "With $aufs_io_threads aufs threads" | |
6a9f6389 | 358 | AC_DEFINE_UNQUOTED(AUFS_IO_THREADS,$aufs_io_threads, |
359 | [Defines how many threads aufs uses for I/O]) | |
cd748f27 | 360 | fi |
361 | ||
362 | AC_ARG_WITH(pthreads, | |
8154dd82 | 363 | [ --with-pthreads Use POSIX Threads]) |
364 | if test "$with_pthreads" = "yes"; then | |
cd748f27 | 365 | echo "With pthreads" |
9bc73deb | 366 | fi |
e5f4e1b0 | 367 | |
f85c88f3 | 368 | AC_ARG_WITH(aio, |
8154dd82 | 369 | [ --with-aio Use POSIX AIO]) |
370 | if test "$with_aio" = "yes"; then | |
f85c88f3 | 371 | echo "With aio" |
f85c88f3 | 372 | fi |
8154dd82 | 373 | |
374 | AC_ARG_WITH(dl, | |
375 | [ --with-dl Use dynamic linking]) | |
376 | if test "$with_dl" = "yes"; then | |
377 | echo "With dl" | |
378 | fi | |
f85c88f3 | 379 | |
cd748f27 | 380 | AC_ARG_ENABLE(storeio, |
381 | [ --enable-storeio=\"list of modules\" | |
382 | Build support for the list of store I/O modules. | |
383 | The default is only to build the "ufs" module. | |
384 | See src/fs for a list of available modules, or | |
385 | Programmers Guide section <not yet written> | |
386 | for details on how to build your custom store module], | |
387 | [ case $enableval in | |
388 | yes) | |
1c690e30 | 389 | for dir in $srcdir/src/fs/*; do |
390 | module="`basename $dir`" | |
391 | if test -d "$dir" && test "$module" != CVS; then | |
392 | STORE_MODULES="$STORE_MODULES $module" | |
8154dd82 | 393 | fi |
cd748f27 | 394 | done |
395 | ;; | |
396 | no) | |
397 | ;; | |
1c690e30 | 398 | *) |
399 | STORE_MODULES="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`" | |
cd748f27 | 400 | ;; |
401 | esac | |
402 | ], | |
403 | [ if test -z "$STORE_MODULES"; then | |
404 | STORE_MODULES="ufs" | |
405 | fi | |
406 | ]) | |
1c690e30 | 407 | if test -n "$STORE_MODULES"; then |
408 | for module in $STORE_MODULES; do | |
409 | if test -d $srcdir/src/fs/$module; then | |
410 | : | |
411 | else | |
412 | echo "ERROR: storeio $module does not exists" | |
413 | exit 1 | |
414 | fi | |
415 | done | |
416 | echo "Store modules built: $STORE_MODULES" | |
59b2d47f | 417 | STORE_LINKOBJS= |
418 | for module in $STORE_MODULES; do | |
419 | STORE_LINKOBJS="$STORE_LINKOBJS fs/${module}/StoreFS${module}.o" | |
420 | done | |
1c690e30 | 421 | fi |
a2794549 | 422 | dnl remove all but diskd - its the only module that needs to recurse |
423 | dnl into the sub directory | |
d3b3ab85 | 424 | UFS_FOUND= |
1c690e30 | 425 | NEED_UFS= |
b9ae18aa | 426 | NEED_BLOCKING= |
427 | NEED_DISKDAEMON= | |
428 | NEED_DISKTHREADS= | |
429 | NEED_AIO= | |
082a5e7a | 430 | STORE_TESTS= |
a2794549 | 431 | for fs in $STORE_MODULES none; do |
8154dd82 | 432 | case "$fs" in |
433 | diskd) | |
1c690e30 | 434 | NEED_UFS="true" |
b9ae18aa | 435 | NEED_BLOCKING="true" |
436 | NEED_DISKDAEMON="true" | |
8154dd82 | 437 | ;; |
438 | aufs) | |
1c690e30 | 439 | NEED_UFS="true" |
b9ae18aa | 440 | NEED_BLOCKING="true" |
441 | NEED_DISKTHREADS="true" | |
8154dd82 | 442 | ;; |
443 | coss) | |
082a5e7a | 444 | NEED_AIO="true" |
3256ae73 | 445 | dnl |
446 | dnl Automake om MinGW needs explicit exe extension | |
447 | dnl for STORE_TESTS substition | |
448 | dnl | |
082a5e7a | 449 | STORE_TESTS="$STORE_TESTS tests/testCoss$EXEEXT" |
450 | ;; | |
d3b3ab85 | 451 | ufs) |
082a5e7a | 452 | UFS_FOUND="true" |
453 | STORE_TESTS="$STORE_TESTS tests/testUfs$EXEEXT" | |
8154dd82 | 454 | esac |
a2794549 | 455 | done |
b9ae18aa | 456 | STORE_OBJS= |
457 | STORE_LIBS= | |
458 | dnl We have 'fake' modules - aufs and diskd - legacy. | |
459 | for fs in $STORE_MODULES; do | |
460 | case "$fs" in | |
461 | diskd);; | |
462 | aufs);; | |
463 | *) | |
464 | STORE_OBJS="$STORE_OBJS fs/lib${fs}.a" | |
465 | STORE_LIBS="$STORE_LIBS lib${fs}.a" | |
466 | ;; | |
467 | esac | |
468 | done | |
d3b3ab85 | 469 | |
1c690e30 | 470 | if test -z "$UFS_FOUND" && test -n "$NEED_UFS"; then |
3256ae73 | 471 | echo "adding UFS, as it contains core logic for diskd and aufs" |
472 | STORE_OBJS="$STORE_OBJS fs/libufs.a" | |
473 | STORE_LIBS="$STORE_LIBS libufs.a" | |
474 | STORE_MODULES="$STORE_MODULES ufs" | |
475 | STORE_LINKOBJS="$STORE_LINKOBJS fs/ufs/StoreFSufs.o" | |
476 | dnl | |
477 | dnl Automake om MinGW needs explicit exe extension | |
478 | dnl for STORE_TESTS substition | |
479 | dnl | |
480 | STORE_TESTS="$STORE_TESTS tests/testUfs$EXEEXT" | |
d3b3ab85 | 481 | fi |
482 | ||
1c690e30 | 483 | AC_SUBST(STORE_OBJS) |
484 | AC_SUBST(STORE_LIBS) | |
59b2d47f | 485 | AC_SUBST(STORE_LINKOBJS) |
082a5e7a | 486 | AC_SUBST(STORE_TESTS) |
a2794549 | 487 | |
b9ae18aa | 488 | AC_ARG_ENABLE(disk-io, |
489 | [ --enable-disk-io=\"list of modules\" | |
490 | Build support for the list of disk I/O modules. | |
491 | The default is only to build the "Blocking" module. | |
492 | See src/DiskIO for a list of available modules, or | |
493 | Programmers Guide section <not yet written> | |
494 | for details on how to build your custom disk module], | |
495 | [ case $enableval in | |
496 | yes) | |
497 | for dir in $srcdir/src/DiskIO/*; do | |
498 | module="`basename $dir`" | |
499 | if test -d "$dir" && test "$module" != CVS; then | |
500 | DISK_MODULES="$DISK_MODULES $module" | |
501 | fi | |
502 | done | |
503 | ;; | |
504 | no) | |
505 | ;; | |
506 | *) | |
507 | DISK_MODULES="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`" | |
508 | ;; | |
509 | esac | |
510 | ], | |
511 | [ if test -z "$DISK_MODULES"; then | |
512 | DISK_MODULES="Blocking" | |
513 | fi | |
514 | ]) | |
515 | if test -n "$DISK_MODULES"; then | |
516 | for module in $DISK_MODULES; do | |
517 | if test -d $srcdir/src/DiskIO/$module; then | |
518 | : | |
519 | else | |
520 | echo "ERROR: disk-io $module does not exists" | |
521 | exit 1 | |
522 | fi | |
523 | done | |
524 | DISK_LIBS="lib`echo $DISK_MODULES|sed -e 's% %.a lib%g'`.a" | |
525 | DISK_LINKOBJS= | |
526 | for module in $DISK_MODULES; do | |
527 | DISK_LINKOBJS="$DISK_LINKOBJS DiskIO/${module}/${module}DiskIOModule.o" | |
528 | done | |
529 | fi | |
530 | for fs in $DISK_MODULES none; do | |
531 | case "$fs" in | |
532 | DiskDaemon) | |
533 | DISK_PROGRAMS="$DISK_PROGRAMS DiskIO/DiskDaemon/diskd" | |
534 | FOUND_DISKDAEMON="true" | |
535 | ;; | |
536 | DiskThreads) | |
537 | FOUND_DISKTHREADS="true" | |
538 | ;; | |
539 | AIO) | |
540 | FOUND_AIO="true" | |
541 | ;; | |
542 | Blocking) | |
543 | FOUND_BLOCKING="true" | |
544 | esac | |
545 | done | |
546 | ||
547 | if test -z "$FOUND_BLOCKING" && test -n "$NEED_BLOCKING"; then | |
abb2a3d9 | 548 | echo "adding Blocking, as it is used by an active, legacy Store Module" |
549 | DISK_LIBS="$DISK_LIBS libBlocking.a" | |
550 | DISK_MODULES="$DISK_MODULES Blocking" | |
551 | DISK_LINKOBJS="$DISK_LINKOBJS DiskIO/Blocking/BlockingDiskIOModule.o" | |
b9ae18aa | 552 | fi |
553 | ||
554 | if test -z "$FOUND_DISKDAEMON" && test -n "$NEED_DISKDAEMON"; then | |
abb2a3d9 | 555 | echo "adding DiskDaemon, as it is used by an active, legacy Store Module" |
556 | DISK_LIBS="$DISK_LIBS libDiskDaemon.a" | |
557 | DISK_MODULES="$DISK_MODULES DiskDaemon" | |
558 | DISK_PROGRAMS="$DISK_PROGRAMS DiskIO/DiskDaemon/diskd" | |
559 | DISK_LINKOBJS="$DISK_LINKOBJS DiskIO/DiskDaemon/DiskDaemonDiskIOModule.o" | |
b9ae18aa | 560 | fi |
561 | ||
562 | if test -z "$FOUND_DISKTHREADS" && test -n "$NEED_DISKTHREADS"; then | |
abb2a3d9 | 563 | echo "adding DiskThreads, as it is used by an active, legacy Store Module" |
564 | DISK_LIBS="$DISK_LIBS libDiskThreads.a" | |
565 | DISK_MODULES="$DISK_MODULES DiskThreads" | |
566 | DISK_LINKOBJS="$DISK_LINKOBJS DiskIO/DiskThreads/DiskThreadsDiskIOModule.o" | |
b9ae18aa | 567 | fi |
595c7973 | 568 | |
b9ae18aa | 569 | if test -z "$FOUND_AIO" && test -n "$NEED_AIO"; then |
abb2a3d9 | 570 | echo "adding AIO, as it is used by an active, legacy Store Module" |
571 | DISK_LIBS="$DISK_LIBS libAIO.a" | |
572 | DISK_MODULES="$DISK_MODULES AIO" | |
573 | DISK_LINKOBJS="$DISK_LINKOBJS DiskIO/AIO/AIODiskIOModule.o" | |
b9ae18aa | 574 | fi |
575 | echo "IO Modules built: $DISK_MODULES" | |
00dae584 | 576 | USE_AIOPS_WIN32=0 |
577 | USE_AIO_WIN32=0 | |
b9ae18aa | 578 | dnl we know what is being built. now add dependencies. |
579 | for fs in $DISK_MODULES none; do | |
580 | case "$fs" in | |
581 | DiskThreads) | |
582 | if test -z "$with_pthreads"; then | |
595c7973 | 583 | case "$host_os" in |
61163411 | 584 | mingw|mingw32) |
00dae584 | 585 | USE_AIOPS_WIN32=1 |
595c7973 | 586 | echo "DiskThreads IO Module used, Windows threads support automatically enabled" |
587 | ;; | |
588 | *) | |
595c7973 | 589 | echo "DiskThreads IO Module used, pthreads support automatically enabled" |
590 | with_pthreads=yes | |
591 | ;; | |
592 | esac | |
b9ae18aa | 593 | fi |
594 | ;; | |
595 | AIO) | |
596 | if test -z "$with_aio"; then | |
abb2a3d9 | 597 | case "$host_os" in |
61163411 | 598 | mingw|mingw32) |
00dae584 | 599 | USE_AIO_WIN32=1 |
abb2a3d9 | 600 | echo "Aio IO Module used, Windows overlapped I/O support automatically enabled" |
601 | ;; | |
602 | *) | |
abb2a3d9 | 603 | echo "Aio IO Module used, aio support automatically enabled" |
604 | with_aio=yes | |
605 | ;; | |
606 | esac | |
b9ae18aa | 607 | fi |
608 | ;; | |
609 | esac | |
610 | done | |
611 | ||
612 | AC_SUBST(DISK_LIBS) | |
613 | AC_SUBST(DISK_PROGRAMS) | |
614 | AC_SUBST(DISK_LINKOBJS) | |
00dae584 | 615 | AM_CONDITIONAL([USE_AIOPS_WIN32], [test "$USE_AIOPS_WIN32" = 1]) |
616 | AM_CONDITIONAL([USE_AIO_WIN32], [test "$USE_AIO_WIN32" = 1]) | |
b9ae18aa | 617 | |
d9180414 | 618 | AC_ARG_ENABLE(removal-policies, |
6a566b9c | 619 | [ --enable-removal-policies=\"list of policies\" |
620 | Build support for the list of removal policies. | |
621 | The default is only to build the "lru" module. | |
622 | See src/repl for a list of available modules, or | |
623 | Programmers Guide section 9.9 for details on how | |
624 | to build your custom policy], | |
625 | [ case $enableval in | |
626 | yes) | |
1c690e30 | 627 | for dir in $srcdir/src/repl/*; do |
628 | module="`basename $dir`" | |
629 | if test -d "$dir" && test "$module" != CVS; then | |
630 | REPL_POLICIES="$REPL_POLICIES $module" | |
6a566b9c | 631 | fi |
632 | done | |
633 | ;; | |
634 | no) | |
635 | ;; | |
1c690e30 | 636 | *) |
637 | REPL_POLICIES="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`" | |
6a566b9c | 638 | ;; |
639 | esac | |
640 | ], | |
641 | [ if test -z "$REPL_POLICIES"; then | |
642 | REPL_POLICIES="lru" | |
643 | fi | |
644 | ]) | |
1c690e30 | 645 | if test -n "$REPL_POLICIES"; then |
646 | for module in $REPL_POLICIES; do | |
647 | if test -d $srcdir/src/repl/$module; then | |
648 | : | |
649 | else | |
650 | echo "ERROR: Removal policy $module does not exists" | |
651 | exit 1 | |
652 | fi | |
653 | done | |
654 | echo "Removal policies built: $REPL_POLICIES" | |
655 | REPL_OBJS="repl/lib`echo $REPL_POLICIES|sed -e 's% %.a repl/lib%g'`.a" | |
656 | REPL_LIBS="`echo $REPL_OBJS|sed -e 's%repl/%%g'`" | |
657 | fi | |
6a566b9c | 658 | AC_SUBST(REPL_POLICIES) |
6a566b9c | 659 | AC_SUBST(REPL_OBJS) |
f71946fc | 660 | AC_SUBST(REPL_LIBS) |
6a566b9c | 661 | |
d1da2d1f | 662 | AM_CONDITIONAL(ENABLE_PINGER, false) |
e5f4e1b0 | 663 | AC_ARG_ENABLE(icmp, |
664 | [ --enable-icmp Enable ICMP pinging], | |
665 | [ if test "$enableval" = "yes" ; then | |
666 | echo "ICMP enabled" | |
6a9f6389 | 667 | AC_DEFINE(USE_ICMP,1, |
cc192b50 | 668 | [ Defined this to use Squid's ICMP features (highly recommended!) |
669 | When USE_ICMP is defined, Squid will send ICMP pings to origin server sites.]) | |
d1da2d1f | 670 | AM_CONDITIONAL(ENABLE_PINGER, true) |
e5f4e1b0 | 671 | fi |
672 | ]) | |
673 | ||
a2794549 | 674 | AM_CONDITIONAL(USE_DELAY_POOLS, false) |
d9180414 | 675 | AC_ARG_ENABLE(delay-pools, |
76d83c52 | 676 | [ --enable-delay-pools Enable delay pools to limit bandwidth usage], |
e5f4e1b0 | 677 | [ if test "$enableval" = "yes" ; then |
95e36d02 | 678 | echo "Delay pools enabled" |
6a9f6389 | 679 | AC_DEFINE([DELAY_POOLS],1,[Traffic management via "delay pools".]) |
680 | AM_CONDITIONAL(USE_DELAY_POOLS, true,) | |
e5f4e1b0 | 681 | fi |
682 | ]) | |
683 | ||
43ae1d95 | 684 | AM_CONDITIONAL(USE_ESI, false) |
685 | AC_ARG_ENABLE(esi, | |
686 | AC_HELP_STRING([--enable-esi],[Enable ESI for accelerators. Requires libexpat. Enabling ESI will cause squid to follow the Edge Acceleration Specification (www.esi.org). This causes squid to IGNORE client Cache-Control headers. DO NOT use this in a squid configured as a web proxy, ONLY use it in a squid configured for webserver acceleration.]), | |
328c40de | 687 | use_esi=$enableval, use_esi=no) |
688 | if test "$use_esi" = "yes" ; then | |
f41735ea | 689 | AC_DEFINE(USE_SQUID_ESI,1,[Compile the ESI processor and Surrogate header support]) |
43ae1d95 | 690 | AM_CONDITIONAL(USE_ESI, true) |
964b44c3 | 691 | XTRA_LIBS="$XTRA_LIBS -lexpat -lxml2" |
a787b56a | 692 | else |
f41735ea | 693 | AC_DEFINE(USE_SQUID_ESI,0,[Compile the ESI processor and Surrogate header support]) |
43ae1d95 | 694 | fi |
695 | ||
51952383 | 696 | AM_CONDITIONAL(USE_ICAP_CLIENT, false) |
697 | AC_ARG_ENABLE(icap-client, | |
698 | AC_HELP_STRING([--enable-icap-client],[Enable the ICAP client.]), | |
328c40de | 699 | use_icap_client=$enableval, use_icap_client=no) |
700 | if test "$use_icap_client" = "yes" ; then | |
51952383 | 701 | AC_DEFINE(ICAP_CLIENT,1,[Enable ICAP client features in Squid]) |
702 | AM_CONDITIONAL(USE_ICAP_CLIENT, true) | |
c21ad0f5 | 703 | ICAP_LIBS="ICAP/libicap.a" |
51952383 | 704 | else |
705 | AC_DEFINE(ICAP_CLIENT,0,[Enable ICAP client features in Squid]) | |
c21ad0f5 | 706 | ICAP_LIBS="" |
51952383 | 707 | fi |
c21ad0f5 | 708 | AC_SUBST(ICAP_LIBS) |
51952383 | 709 | |
0961c811 | 710 | dnl This is a developer only option. Developers know how to set defines |
711 | dnl | |
712 | dnl AC_ARG_ENABLE(mem-gen-trace, | |
713 | dnl [ --enable-mem-gen-trace Do trace of memory stuff], | |
714 | dnl [ if test "$enableval" = "yes" ; then | |
715 | dnl echo "Memory trace (to file) enabled" | |
6a9f6389 | 716 | dnl AC_DEFINE(MEM_GEN_TRACE,1,[Define for log file trace of mem alloc/free]) |
0961c811 | 717 | dnl fi |
718 | dnl ]) | |
36a97e19 | 719 | |
d9180414 | 720 | AC_ARG_ENABLE(useragent-log, |
e5f4e1b0 | 721 | [ --enable-useragent-log Enable logging of User-Agent header], |
722 | [ if test "$enableval" = "yes" ; then | |
723 | echo "User-Agent logging enabled" | |
6a9f6389 | 724 | AC_DEFINE(USE_USERAGENT_LOG,1,[If you want to log User-Agent request header values, define this. |
725 | By default, they are written to useragent.log in the Squid log | |
726 | directory.]) | |
e5f4e1b0 | 727 | fi |
728 | ]) | |
729 | ||
dfca7e1a | 730 | AC_ARG_ENABLE(referer-log, |
0961c811 | 731 | [ --enable-referer-log Enable logging of Referer header], |
dfca7e1a | 732 | [ if test "$enableval" = "yes" ; then |
733 | echo "Referer logging enabled" | |
6a9f6389 | 734 | AC_DEFINE(USE_REFERER_LOG,1,[If you want to log Referer request header values, define this. |
735 | By default, they are written to referer.log in the Squid log | |
736 | directory.]) | |
dfca7e1a | 737 | fi |
738 | ]) | |
739 | ||
0b0cfcf2 | 740 | USE_WCCP=1 |
320e9f36 | 741 | AC_ARG_ENABLE(wccp, |
0961c811 | 742 | [ --disable-wccp Disable Web Cache Coordination Protocol], |
eb824054 | 743 | [ if test "$enableval" = "no" ; then |
744 | echo "Web Cache Coordination Protocol disabled" | |
0b0cfcf2 | 745 | USE_WCCP=0 |
320e9f36 | 746 | fi |
747 | ]) | |
0b0cfcf2 | 748 | if test $USE_WCCP = 1; then |
749 | AC_DEFINE(USE_WCCP, 1, [Define to enable WCCP]) | |
750 | fi | |
751 | ||
752 | USE_WCCPv2=1 | |
753 | AC_ARG_ENABLE(wccpv2, | |
754 | [ --disable-wccpv2 Disable Web Cache Coordination V2 Protocol], | |
755 | [ if test "$enableval" = "no" ; then | |
756 | echo "Web Cache Coordination V2 Protocol disabled" | |
757 | USE_WCCPv2=0 | |
758 | fi | |
759 | ]) | |
760 | if test $USE_WCCPv2 = 1; then | |
761 | AC_DEFINE(USE_WCCPv2, 1, [Define to enable WCCP V2]) | |
14b32873 | 762 | fi |
320e9f36 | 763 | |
d9180414 | 764 | AC_ARG_ENABLE(kill-parent-hack, |
9fc0b4b8 | 765 | [ --enable-kill-parent-hack |
766 | Kill parent on shutdown], | |
e5f4e1b0 | 767 | [ if test "$enableval" = "yes" ; then |
768 | echo "Kill parent on shutdown" | |
6a9f6389 | 769 | AC_DEFINE(KILL_PARENT_OPT,1,[A dangerous feature which causes Squid to kill its parent process |
770 | (presumably the RunCache script) upon receipt of SIGTERM or SIGINT. | |
771 | Use with caution.]) | |
e5f4e1b0 | 772 | fi |
773 | ]) | |
774 | ||
87630341 | 775 | USE_SNMP=true |
e5f4e1b0 | 776 | AC_ARG_ENABLE(snmp, |
87630341 | 777 | [ --disable-snmp Disable SNMP monitoring support], |
778 | [ if test "$enableval" = "no" ; then | |
779 | echo "SNMP monitoring disabled" | |
780 | USE_SNMP= | |
781 | fi | |
782 | ]) | |
10faea39 | 783 | if test x"$USE_SNMP" = xtrue; then |
6a9f6389 | 784 | AC_DEFINE(SQUID_SNMP,1,[Define to enable SNMP monitoring of Squid]) |
63705952 | 785 | SNMPLIB='../snmplib/libsnmp.a' |
e5f4e1b0 | 786 | makesnmplib=snmplib |
87630341 | 787 | fi |
cb50b537 | 788 | AM_CONDITIONAL(USE_SNMP, [test x$USE_SNMP = xtrue]) |
e5f4e1b0 | 789 | AC_SUBST(SNMPLIB) |
e5f4e1b0 | 790 | AC_SUBST(makesnmplib) |
791 | ||
d9180414 | 792 | AC_ARG_ENABLE(cachemgr-hostname, |
e5f4e1b0 | 793 | [ --enable-cachemgr-hostname[=hostname] |
794 | Make cachemgr.cgi default to this host], | |
795 | [ case $enableval in | |
796 | yes) | |
6a9f6389 | 797 | AC_DEFINE(CACHEMGR_HOSTNAME,[getfullhostname()], |
798 | [If you are upset that the cachemgr.cgi form comes up with the hostname field blank, then define this to getfullhostname()]) | |
e5f4e1b0 | 799 | echo "Cachemgr default hostname == host where cachemgr runs" |
800 | ;; | |
801 | no) | |
802 | : # Nothing to do.. | |
803 | ;; | |
804 | *) | |
805 | AC_DEFINE_UNQUOTED(CACHEMGR_HOSTNAME,"${enableval}") | |
806 | echo "Cachemgr default hostname set to ${enableval}" | |
807 | ;; | |
808 | esac | |
809 | ]) | |
810 | ||
b0dd28ba | 811 | AM_CONDITIONAL(ENABLE_ARP_ACL, false) |
d9180414 | 812 | AC_ARG_ENABLE(arp-acl, |
e5f4e1b0 | 813 | [ --enable-arp-acl Enable use of ARP ACL lists (ether address)], |
814 | [ if test "$enableval" = "yes" ; then | |
815 | echo "ARP ACL lists enabled (ether address)" | |
933cc58d | 816 | case "$host" in |
ef614b1c | 817 | *-linux-*) |
818 | ;; | |
9d8d033e | 819 | *-solaris*) |
a931a29b | 820 | ;; |
9a2f1170 | 821 | *-freebsd*) |
822 | ;; | |
f71a524f | 823 | *-openbsd*) |
824 | ;; | |
074bf084 | 825 | *-netbsd*) |
826 | ;; | |
5700029a | 827 | *-cygwin*) |
828 | LIBS="$LIBS -liphlpapi" | |
829 | ;; | |
830 | *-mingw*) | |
831 | LIBS="$LIBS -liphlpapi" | |
832 | ;; | |
933cc58d | 833 | *) |
ef614b1c | 834 | echo "WARNING: ARP ACL support probably won't work on $host." |
933cc58d | 835 | sleep 10 |
836 | ;; | |
837 | esac | |
6a9f6389 | 838 | AC_DEFINE(USE_ARP_ACL,1,[Define this to include code which lets you specify access control elements based on ethernet hardware addresses. This code uses functions found in 4.4 BSD derviations (e.g. FreeBSD, ?).]) |
b0dd28ba | 839 | AM_CONDITIONAL(ENABLE_ARP_ACL, true) |
e5f4e1b0 | 840 | fi |
841 | ]) | |
842 | ||
87630341 | 843 | USE_HTCP=true |
a2794549 | 844 | AM_CONDITIONAL(ENABLE_HTCP, false) |
74075210 | 845 | AC_ARG_ENABLE(htcp, |
87630341 | 846 | [ --disable-htcp Disable HTCP protocol support], |
847 | [ if test "$enableval" = "no" ; then | |
848 | echo "HTCP support disabled" | |
b4b8b6da | 849 | fi |
74075210 | 850 | ]) |
87630341 | 851 | if test x$USE_HTCP = xtrue; then |
852 | AC_DEFINE(USE_HTCP,1, [Define this to include code for the Hypertext Cache Protocol (HTCP)]) | |
853 | fi | |
854 | AM_CONDITIONAL(ENABLE_HTCP, [test x$USE_HTCP = xtrue]) | |
a2794549 | 855 | |
3d4022fa | 856 | dnl SSL is not enabled by default. |
a2794549 | 857 | AM_CONDITIONAL(ENABLE_SSL, false) |
74075210 | 858 | |
3d4022fa | 859 | dnl Default is to use OpenSSL when available |
1f7c9178 | 860 | AC_ARG_ENABLE(ssl, |
861 | [ --enable-ssl Enable ssl gatewaying support using OpenSSL], | |
862 | [ if test "$enableval" != "no"; then | |
3dff197f | 863 | echo "SSL gatewaying using OpenSSL enabled" |
6a9f6389 | 864 | AC_DEFINE(USE_SSL,1,[Define this to include code for SSL encryption.]) |
a2794549 | 865 | AM_CONDITIONAL(ENABLE_SSL, true) |
4b26fae9 | 866 | case "$host_os" in |
867 | mingw|mingw32) | |
868 | dnl Native Windows port of OpenSSL needs -lgdi32 | |
ee86c79b | 869 | SSLLIB='-lssleay32 -leay32 -lgdi32' |
4b26fae9 | 870 | ;; |
871 | *) | |
872 | SSLLIB='-lssl -lcrypto' | |
873 | ;; | |
874 | esac | |
1f7c9178 | 875 | USE_OPENSSL=1 |
876 | fi | |
877 | ]) | |
878 | ||
3d4022fa | 879 | dnl User may specify OpenSSL is needed from a non-standard location |
1f7c9178 | 880 | AC_ARG_WITH(openssl, |
881 | [ --with-openssl[=prefix] | |
882 | Compile with the OpenSSL libraries. The path to | |
883 | the OpenSSL development libraries and headers | |
884 | installation can be specified if outside of the | |
885 | system standard directories], | |
886 | [ | |
46ce628c | 887 | case "$with_openssl" in |
1f7c9178 | 888 | yes) |
889 | USE_OPENSSL=1 | |
890 | ;; | |
891 | no) | |
892 | USE_OPENSSL= | |
893 | ;; | |
894 | *) | |
46ce628c | 895 | SSLLIBDIR="$with_openssl/lib" |
bcce53ce | 896 | CPPFLAGS="-I$with_openssl/include $CPPFLAGS" |
1f7c9178 | 897 | USE_OPENSSL=1 |
898 | esac | |
899 | ]) | |
1f7c9178 | 900 | if test -n "$USE_OPENSSL"; then |
3dff197f | 901 | echo "Using OpenSSL MD5 implementation" |
6a9f6389 | 902 | AC_DEFINE(USE_OPENSSL,1,[Define this to make use of the OpenSSL libraries for MD5 calculation rather than Squid's own MD5 implementation or if building with SSL encryption (USE_SSL)]) |
1f7c9178 | 903 | if test -z "$SSLLIB"; then |
904 | SSLLIB="-lcrypto" # for MD5 routines | |
905 | fi | |
f11555e0 | 906 | dnl This is a workaround for RedHat 9 brain damage.. |
907 | if test -d /usr/kerberos/include && test -z "$SSLLIBDIR" && test -f /usr/include/openssl/kssl.h; then | |
908 | echo "OpenSSL depends on Kerberos" | |
909 | SSLLIBDIR="/usr/kerberos/lib" | |
910 | CPPFLAGS="$CPPFLAGS -I/usr/kerberos/include" | |
911 | fi | |
1f7c9178 | 912 | fi |
913 | if test -n "$SSLLIBDIR"; then | |
914 | SSLLIB="-L$SSLLIBDIR $SSLLIB" | |
915 | fi | |
1f7c9178 | 916 | AC_SUBST(SSLLIB) |
917 | ||
3d4022fa | 918 | |
02749868 | 919 | AC_ARG_ENABLE(forw-via-db, |
920 | [ --enable-forw-via-db Enable Forw/Via database], | |
921 | [ if test "$enableval" = "yes" ; then | |
922 | echo "FORW-VIA enabled" | |
6a9f6389 | 923 | AC_DEFINE(FORW_VIA_DB,1,[Enable Forw/Via database]) |
02749868 | 924 | fi |
925 | ]) | |
926 | ||
6cfa8966 | 927 | AC_ARG_ENABLE(cache-digests, |
22df58ea | 928 | [ --enable-cache-digests Use Cache Digests |
2b6662ba | 929 | see http://www.squid-cache.org/FAQ/FAQ-16.html], |
484f2ebc | 930 | [ if test "$enableval" = "yes" ; then |
6cfa8966 | 931 | echo "USE_CACHE_DIGESTS enabled" |
6a9f6389 | 932 | AC_DEFINE(USE_CACHE_DIGESTS,1,[Use Cache Digests for locating objects in neighbor caches. This code is still semi-experimental.]) |
484f2ebc | 933 | fi |
934 | ]) | |
935 | ||
8c3926c5 | 936 | dnl Select Default Error language |
937 | AC_ARG_ENABLE(default-err-language, | |
938 | [ --enable-default-err-language=lang | |
0961c811 | 939 | Select default language for Error pages (see |
940 | errors directory) ], | |
933cc58d | 941 | [ |
cf9d704a | 942 | if test -d $srcdir/errors/$enableval; then |
8c3926c5 | 943 | ERR_DEFAULT_LANGUAGE=$enableval |
933cc58d | 944 | else |
0961c811 | 945 | echo "ERROR! Unknown language $enableval, see errors/ directory" |
933cc58d | 946 | exit 1 |
947 | fi | |
8c3926c5 | 948 | ],[ERR_DEFAULT_LANGUAGE="English"]) |
949 | AC_SUBST(ERR_DEFAULT_LANGUAGE) | |
950 | ||
951 | dnl Select languages to be installed | |
952 | AC_ARG_ENABLE(err-languages, | |
953 | [ --enable-err-languages=\"lang1 lang2..\" | |
0961c811 | 954 | Select languages to be installed. (All will be |
955 | installed by default) ], | |
8c3926c5 | 956 | [ |
957 | for l in $enableval; do | |
958 | if test -d $srcdir/errors/$l; then :; else | |
959 | echo "ERROR! Unknown language $$l, see errors/" | |
960 | exit 1 | |
961 | fi | |
962 | done | |
963 | ERR_LANGUAGES=$enableval | |
964 | ],[ | |
965 | ERR_LANGUAGES= | |
966 | for l in $srcdir/errors/*; do | |
cbbe101f | 967 | if test -f $l/ERR_ACCESS_DENIED; then |
8c3926c5 | 968 | ERR_LANGUAGES="$ERR_LANGUAGES `basename $l`" |
969 | fi | |
970 | done | |
971 | ]) | |
972 | AC_SUBST(ERR_LANGUAGES) | |
933cc58d | 973 | |
cd748f27 | 974 | dnl Size of COSS memory buffer |
975 | AC_ARG_WITH(coss-membuf-size, | |
976 | [ --with-coss-membuf-size COSS membuf size (default 1048576 bytes) ], | |
977 | [ if test "$with_coss_membuf_size"; then | |
978 | echo "Setting COSS membuf size to $with_coss_membuf_size bytes" | |
6a9f6389 | 979 | AC_DEFINE_UNQUOTED(COSS_MEMBUF_SZ, $with_coss_membuf_size,[Define if you want to set the COSS membuf size]) |
cd748f27 | 980 | fi |
981 | ]) | |
982 | ||
1b3db6d9 | 983 | dnl check for netio plugin stuff |
6564c397 | 984 | |
9bb83c8b | 985 | dnl Enable poll() |
6564c397 | 986 | disable_poll= |
9bb83c8b | 987 | AC_ARG_ENABLE(poll, |
6564c397 | 988 | [ --disable-poll Disable poll() support. ], |
1b3db6d9 | 989 | |
990 | [ | |
c68e9c6b | 991 | case "$enableval" in |
992 | yes) | |
9bb83c8b | 993 | echo "Forcing poll() to be enabled" |
d474c7a6 | 994 | SELECT_TYPE="poll" |
c68e9c6b | 995 | ;; |
996 | no) | |
997 | echo "Forcing poll() to be disabled" | |
6564c397 | 998 | disable_poll=true |
c68e9c6b | 999 | ;; |
1000 | esac | |
9bb83c8b | 1001 | ]) |
1002 | ||
1b3db6d9 | 1003 | dnl Enable select() |
6564c397 | 1004 | disable_select= |
1b3db6d9 | 1005 | AC_ARG_ENABLE(select, |
6564c397 | 1006 | [ --disable-select Disable select() support. ], |
1b3db6d9 | 1007 | |
1008 | [ | |
1009 | case "$enableval" in | |
1010 | yes) | |
1011 | echo "Forcing select() to be enabled" | |
d474c7a6 | 1012 | SELECT_TYPE="select" |
1b3db6d9 | 1013 | ;; |
1014 | no) | |
1015 | echo "Forcing select() to be disabled" | |
6564c397 | 1016 | disable_select=true |
1b3db6d9 | 1017 | ;; |
1018 | esac | |
1019 | ]) | |
1020 | ||
1021 | dnl Enable kqueue() | |
6564c397 | 1022 | dnl kqueue support is still experiemntal and unstable. Not enabled by default. |
1023 | disable_kqueue=true | |
1b3db6d9 | 1024 | AC_ARG_ENABLE(kqueue, |
6564c397 | 1025 | [ --enable-kqueue Enable kqueue() support (experimental).], |
1b3db6d9 | 1026 | |
1027 | [ | |
1028 | case "$enableval" in | |
1029 | yes) | |
1030 | echo "Forcing kqueue() to be enabled" | |
d474c7a6 | 1031 | SELECT_TYPE="kqueue" |
1b3db6d9 | 1032 | ;; |
1033 | no) | |
1034 | echo "Forcing kqueue() to be disabled" | |
6564c397 | 1035 | disable_kqueue=true |
1b3db6d9 | 1036 | ;; |
1037 | esac | |
1038 | ]) | |
1039 | ||
a46d2c0e | 1040 | dnl Enable epoll() |
6564c397 | 1041 | disable_epoll= |
a46d2c0e | 1042 | AC_ARG_ENABLE(epoll, |
328c40de | 1043 | [ --disable-epoll Disable Linux epoll() support.], |
a46d2c0e | 1044 | |
1045 | [ | |
1046 | case "$enableval" in | |
1047 | yes) | |
1048 | echo "Forcing epoll() to be enabled" | |
d474c7a6 | 1049 | SELECT_TYPE="epoll" |
a46d2c0e | 1050 | ;; |
1051 | no) | |
1052 | echo "Forcing epoll() to be disabled" | |
6564c397 | 1053 | disable_epoll=true |
a46d2c0e | 1054 | ;; |
1055 | esac | |
1056 | ]) | |
1057 | ||
1058 | ||
72fd085a | 1059 | dnl Disable HTTP violations |
14b32873 | 1060 | http_violations=1 |
72fd085a | 1061 | AC_ARG_ENABLE(http-violations, |
1062 | [ --disable-http-violations | |
1063 | This allows you to remove code which is known to | |
c68e9c6b | 1064 | violate the HTTP protocol specification.], |
72fd085a | 1065 | [ if test "$enableval" = "no" ; then |
1066 | echo "Disabling HTTP Violations" | |
14b32873 | 1067 | http_violations=0 |
72fd085a | 1068 | fi |
1069 | ]) | |
14b32873 | 1070 | if test $http_violations = 1; then |
1071 | AC_DEFINE(HTTP_VIOLATIONS, 1,[By default (for now anyway) Squid includes options which allows the cache administrator to violate the HTTP protocol specification in terms of cache behaviour. Setting this to '0' will disable such code.]) | |
1072 | else | |
1073 | AC_DEFINE(HTTP_VIOLATIONS, 0) | |
1074 | fi | |
72fd085a | 1075 | |
68075fad | 1076 | dnl Enable IPFW Transparent Proxy |
1077 | AC_ARG_ENABLE(ipfw-transparent, | |
1078 | [ --enable-ipfw-transparent | |
1079 | Enable Transparent Proxy support for systems | |
1080 | using FreeBSD IPFW style redirection.], | |
1081 | [ if test "$enableval" = "yes" ; then | |
1082 | echo "IPFW Transparent Proxy enabled" | |
1083 | AC_DEFINE(IPFW_TRANSPARENT,1,[Enable support for Transparent Proxy on systems using FreeBSD IPFW address redirection.]) | |
1084 | IPFW_TRANSPARENT="yes" | |
1085 | fi | |
1086 | ]) | |
1087 | ||
5cafc1d6 | 1088 | dnl Enable IP-Filter Transparent Proxy |
1089 | AC_ARG_ENABLE(ipf-transparent, | |
1090 | [ --enable-ipf-transparent | |
1091 | Enable Transparent Proxy support for systems | |
c68e9c6b | 1092 | using IP-Filter network address redirection.], |
5cafc1d6 | 1093 | [ if test "$enableval" = "yes" ; then |
1094 | echo "IP-Filter Transparent Proxy enabled" | |
6a9f6389 | 1095 | AC_DEFINE(IPF_TRANSPARENT,1,[Enable support for Transparent Proxy on systems using IP-Filter address redirection. This provides "masquerading" support for non Linux system.]) |
5cafc1d6 | 1096 | IPF_TRANSPARENT="yes" |
1097 | fi | |
1098 | ]) | |
1099 | ||
2b0dd4ac | 1100 | dnl Enable PF Transparent Proxy |
1101 | AC_ARG_ENABLE(pf-transparent, | |
1102 | [ --enable-pf-transparent | |
1103 | Enable Transparent Proxy support for systems | |
1104 | using PF network address redirection.], | |
1105 | [ if test "$enableval" = "yes" ; then | |
1106 | echo "PF Transparent Proxy enabled" | |
6a9f6389 | 1107 | AC_DEFINE(PF_TRANSPARENT,1,[Enable support for Transparent Proxy on systems using PF address redirection. This provides "masquerading" support for OpenBSD.]) |
2b0dd4ac | 1108 | PF_TRANSPARENT="yes" |
1109 | fi | |
1110 | ]) | |
1111 | ||
d6d62546 | 1112 | dnl Enable Linux Netfilter Transparent Proxy |
d852fbad | 1113 | AC_ARG_ENABLE(linux-netfilter, |
1114 | [ --enable-linux-netfilter | |
d6d62546 | 1115 | Enable Transparent Proxy support for Linux (Netfilter) systems.], |
d852fbad | 1116 | [ if test "$enableval" = "yes" ; then |
d6d62546 | 1117 | echo "Linux (Netfilter) Transparent Proxy enabled" |
1118 | AC_DEFINE(LINUX_NETFILTER,1,[Enable support for Transparent Proxy on Linux (Netfilter) systems]) | |
d852fbad | 1119 | LINUX_NETFILTER="yes" |
1120 | fi | |
1121 | ]) | |
1122 | ||
bb7b5fd0 | 1123 | dnl Enable Large file support |
2df6213e | 1124 | buildmodel="" |
1125 | needlargefiles= | |
1126 | ||
1127 | AC_ARG_WITH(large-files, | |
3a125142 | 1128 | [ --with-large-files Enable support for large files (logs etc).], |
2df6213e | 1129 | [ if test "$withval" = yes; then |
1130 | needlargefiles=1 | |
bb7b5fd0 | 1131 | fi |
1132 | ]) | |
1133 | ||
2df6213e | 1134 | dnl UNIX Build environment |
1135 | AC_ARG_WITH(build-environment, | |
1136 | [ --with-build-environment=model | |
1137 | The build environment to use. Normally one of | |
1138 | POSIX_V6_ILP32_OFF32 32 bits | |
1139 | POSIX_V6_ILP32_OFFBIG 32 bits with large file support | |
1140 | POSIX_V6_LP64_OFF64 64 bits | |
1141 | POSIX_V6_LPBIG_OFFBIG large pointers and files | |
1142 | XBS5_ILP32_OFF32 32 bits (legacy) | |
1143 | XBS5_ILP32_OFFBIG 32 bits with large file support (legacy) | |
1144 | XBS5_LP64_OFF64 64 bits (legacy) | |
1145 | XBS5_LPBIG_OFFBIG large pointers and files (legacy) | |
1146 | default The default for your OS], | |
1147 | [ case "$withval" in | |
1148 | yes|no) | |
1149 | echo "--with-build-environment expects a build environment string as used by getconf" | |
1150 | exit 1 | |
1151 | ;; | |
1152 | *) | |
1153 | buildmodel="$withval" | |
1154 | ;; | |
1155 | esac | |
1156 | ]) | |
1157 | ||
1158 | if test $needlargefiles && test -z "$buildmodel"; then | |
1159 | for model in POSIX_V6_ILP32_OFFBIG XBS5_ILP32_OFFBIG POSIX_V6_LP64_OFF64 XBS5_LP64_OFF64 POSIX_V6_LPBIG_OFFBIG XBS5_LPBIG_OFFBIG; do | |
1160 | if test "`getconf _$model 2>/dev/null || true`" = 1 || test "`getconf $model 2>/dev/null || true`" ; then | |
1161 | buildmodel=$model | |
1162 | break | |
1163 | fi | |
1164 | done | |
1165 | if test -z "$buildmodel"; then | |
1166 | echo "WARNING: No suitable build environment found for large files. Trying to use _FILE_OFFSET_BITS=64" | |
1167 | sleep 1 | |
1168 | CFLAGS="-D_FILE_OFFSET_BITS=64 $CFLAGS" | |
cca81db1 | 1169 | CXXFLAGS="-D_FILE_OFFSET_BITS=64 $CXXFLAGS" |
2df6213e | 1170 | fi |
1171 | fi | |
1172 | if test -n "$buildmodel" && test "$buildmodel" != "default"; then | |
1173 | echo "Using $buildmodel build environment" | |
1174 | if test "`getconf _$buildmodel 2>/dev/null || true`" = 1 || test "`getconf $buildmodel 2>/dev/null || true`" ; then | |
1175 | : # All fine | |
1176 | else | |
1177 | echo "ERROR: Build environment $buildmodel not known to getconf." | |
1178 | exit 1 | |
1179 | fi | |
1180 | CFLAGS="`getconf ${buildmodel}_CFLAGS` $CFLAGS" | |
cca81db1 | 1181 | CXXFLAGS="`getconf ${buildmodel}_CFLAGS` $CXXFLAGS" |
2df6213e | 1182 | LIBS="`getconf ${buildmodel}_LIBS` $LIBS" |
1183 | LDFLAGS="`getconf ${buildmodel}_LDFLAGS` $LDFLAGS" | |
63e02610 | 1184 | case "$host" in |
2df6213e | 1185 | dnl |
1186 | dnl On Solaris getconf returns for CFLAGS -Xa and -Usun options, but: | |
1187 | dnl -Xa is supported only by Sun cc, so we need to remove it when using gcc | |
1188 | dnl The 'sun' define is needed by ipfilter includes, so we must remove -Usun | |
2df6213e | 1189 | *-solaris*) |
1190 | if test "$GCC" = "yes"; then | |
1191 | echo "Removing -Xa for gcc on $host" | |
1192 | CFLAGS="`echo $CFLAGS | sed -e 's/-Xa//'`" | |
cca81db1 | 1193 | CXXFLAGS="`echo $CXXFLAGS | sed -e 's/-Xa//'`" |
2df6213e | 1194 | fi |
2ddacc29 | 1195 | echo "Removing -Usun on $host" |
2df6213e | 1196 | CFLAGS="`echo $CFLAGS | sed -e 's/-Usun//'`" |
cca81db1 | 1197 | CXXFLAGS="`echo $CXXFLAGS | sed -e 's/-Usun//'`" |
2df6213e | 1198 | ;; |
63e02610 | 1199 | dnl |
1200 | dnl On Irix 6.x getconf returns options valid only for the SGI MipsPRO compiler, | |
1201 | dnl so we must adjust something to avoid gcc errors. | |
1202 | dnl On Irix 6.x 32/64 bit we must replace "-n32" with "-mabi=n32" in CFLAGS and | |
1203 | dnl remove "-n32" from LDFLAGS | |
1204 | dnl On Irix 6.x 64 bit we must replace "-64" with "-mabi=64" in CFLAGS and remove | |
1205 | dnl "-64" from LDFLAGS | |
1206 | *-sgi-irix6.*) | |
1207 | if test "$GCC" = "yes"; then | |
1208 | CFLAGS="`echo $CFLAGS | sed -e 's/-n32/-mabi=n32/'`" | |
ff37fe61 | 1209 | CXXFLAGS="`echo $CXXFLAGS | sed -e 's/-n32/-mabi=n32/'`" |
63e02610 | 1210 | LDFLAGS="`echo $LDFLAGS | sed -e 's/-n32//'`" |
1211 | CFLAGS="`echo $CFLAGS | sed -e 's/-64/-mabi=64/'`" | |
ff37fe61 | 1212 | CXXFLAGS="`echo $CXXFLAGS | sed -e 's/-64/-mabi=64/'`" |
63e02610 | 1213 | LDFLAGS="`echo $LDFLAGS | sed -e 's/-64//'`" |
1214 | fi | |
1215 | ;; | |
2df6213e | 1216 | *) |
1217 | ;; | |
1218 | esac | |
1219 | fi | |
1220 | ||
fc68f6b1 | 1221 | dnl Enable Linux transparent proxy support |
1222 | AC_ARG_ENABLE(linux-tproxy, | |
1223 | [ --enable-linux-tproxy | |
1224 | Enable real Transparent Proxy support for Netfilter TPROXY.], | |
1225 | [ if test "$enableval" = "yes" ; then | |
1226 | echo "Linux Netfilter/TPROXY enabled" | |
1227 | AC_DEFINE(LINUX_TPROXY, 1, [Enable real Transparent Proxy support for Netfilter TPROXY.]) | |
1228 | LINUX_TPROXY="yes" | |
1229 | if test -z "$LINUX_NETFILTER"; then | |
1230 | echo "Linux-Netfilter Transparent Proxy automatically enabled" | |
1231 | LINUX_NETFILTER="yes" | |
1232 | fi | |
1233 | fi | |
1234 | ]) | |
1235 | ||
a2794549 | 1236 | AM_CONDITIONAL(MAKE_LEAKFINDER, false) |
5d620373 | 1237 | dnl Enable Leak Finding Functions |
1238 | AC_ARG_ENABLE(leakfinder, | |
1239 | [ --enable-leakfinder | |
1240 | Enable Leak Finding code. Enabling this alone | |
1241 | does nothing; you also have to modify the source | |
1242 | code to use the leak finding functions. Probably | |
1243 | Useful for hackers only.], | |
1244 | [ if test "$enableval" = "yes" ; then | |
1245 | echo "Leak-Finding enabled" | |
6a9f6389 | 1246 | AC_DEFINE(USE_LEAKFINDER,1,[Enable code for assisting in finding memory leaks. Hacker stuff only.]) |
5d620373 | 1247 | USE_LEAKFINDER="yes" |
a2794549 | 1248 | AM_CONDITIONAL(MAKE_LEAKFINDER, true) |
5d620373 | 1249 | fi |
1250 | ]) | |
5d620373 | 1251 | |
14b32873 | 1252 | use_ident=1 |
3898f57f | 1253 | AC_ARG_ENABLE(ident-lookups, |
1254 | [ --disable-ident-lookups | |
1255 | This allows you to remove code that performs | |
1256 | Ident (RFC 931) lookups.], | |
1257 | [ if test "$enableval" = "no" ; then | |
1258 | echo "Disabling Ident Lookups" | |
14b32873 | 1259 | use_ident=0 |
3898f57f | 1260 | fi |
1261 | ]) | |
14b32873 | 1262 | if test $use_ident = 1; then |
1263 | AC_DEFINE(USE_IDENT, 1,[Compile in support for Ident (RFC 931) lookups? Enabled by default.]) | |
8000a965 | 1264 | AM_CONDITIONAL(ENABLE_IDENT, true) |
14b32873 | 1265 | else |
1266 | AC_DEFINE(USE_IDENT, 0) | |
8000a965 | 1267 | AM_CONDITIONAL(ENABLE_IDENT, false) |
14b32873 | 1268 | fi |
3898f57f | 1269 | |
a2794549 | 1270 | AM_CONDITIONAL(USE_DNSSERVER, false) |
3c573763 | 1271 | use_dnsserver= |
eb824054 | 1272 | AC_ARG_ENABLE(internal-dns, |
7e3ce7b9 | 1273 | [ --disable-internal-dns This prevents Squid from directly sending and |
eb824054 | 1274 | receiving DNS messages, and instead enables the |
1275 | old external 'dnsserver' processes.], | |
1276 | [ if test "$enableval" = "no" ; then | |
1277 | echo "Disabling Internal DNS queries" | |
3c573763 | 1278 | use_dnsserver="yes" |
eb824054 | 1279 | fi |
1280 | ]) | |
3c573763 | 1281 | if test "$use_dnsserver" = "yes"; then |
6a9f6389 | 1282 | AC_DEFINE(USE_DNSSERVERS,1,[Use dnsserver processes instead of the internal DNS protocol support]) |
a2794549 | 1283 | AM_CONDITIONAL(USE_DNSSERVER, true) |
3c573763 | 1284 | fi |
eb824054 | 1285 | |
9d798391 | 1286 | dnl Select Default hosts file location |
1287 | AC_ARG_ENABLE(default-hostsfile, | |
1288 | [ --enable-default-hostsfile=path | |
1289 | Select default location for hosts file. | |
1290 | See hosts_file directive in squid.conf for details], | |
1291 | [ | |
1292 | if test "$enableval" != "none" ; then | |
1293 | if test -f $enableval; then | |
1294 | OPT_DEFAULT_HOSTS=$enableval | |
1295 | else | |
1296 | echo "Warning Unable to find $enableval" | |
1297 | sleep 5 | |
1298 | fi | |
1299 | else | |
1300 | OPT_DEFAULT_HOSTS="none" | |
1301 | fi | |
1302 | echo "Default hosts file set to: $enableval" | |
1303 | ],[OPT_DEFAULT_HOSTS="/etc/hosts"]) | |
1304 | AC_SUBST(OPT_DEFAULT_HOSTS) | |
1305 | ||
94439e4e | 1306 | dnl Select auth schemes modules to build |
1307 | AC_ARG_ENABLE(auth, | |
1308 | [ --enable-auth=\"list of auth scheme modules\" | |
1309 | Build support for the list of authentication schemes. | |
1310 | The default is to build support for the Basic scheme. | |
1311 | See src/auth for a list of available modules, or | |
1312 | Programmers Guide section authentication schemes | |
1313 | for details on how to build your custom auth scheme | |
1314 | module], | |
1315 | [ case $enableval in | |
1316 | yes) | |
1c42c4a1 | 1317 | for dir in $srcdir/src/auth/*; do |
1318 | module="`basename $dir`" | |
1c690e30 | 1319 | if test -d "$dir" && test "$module" != CVS; then |
1c42c4a1 | 1320 | AUTH_MODULES="$AUTH_MODULES $module" |
94439e4e | 1321 | fi |
1322 | done | |
1323 | ;; | |
1324 | no) | |
1325 | ;; | |
1c690e30 | 1326 | *) |
1327 | AUTH_MODULES="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`" | |
1328 | ;; | |
94439e4e | 1329 | esac |
1330 | ], | |
1331 | [ if test -z "$AUTH_MODULES"; then | |
6bf4f823 | 1332 | AUTH_MODULES="ntlm basic digest negotiate" |
94439e4e | 1333 | fi |
1334 | ]) | |
1c690e30 | 1335 | if test -n "$AUTH_MODULES"; then |
1336 | for module in $AUTH_MODULES; do | |
1337 | if test -d $srcdir/src/auth/$module; then | |
1338 | : | |
1339 | else | |
1340 | echo "ERROR: Auth scheme $module does not exists" | |
1341 | exit 1 | |
1342 | fi | |
7f18d2bd | 1343 | eval AUTH_MODULE_${module}=yes |
1c690e30 | 1344 | done |
1345 | echo "Auth scheme modules built: $AUTH_MODULES" | |
1346 | AUTH_OBJS="auth/lib`echo $AUTH_MODULES|sed -e 's% %.a auth/lib%g'`.a" | |
1347 | AUTH_LIBS="`echo $AUTH_OBJS|sed -e 's%auth/%%g'`" | |
d0571da6 | 1348 | else |
1349 | echo "Auth scheme modules built: None" | |
1c690e30 | 1350 | fi |
f5691f9c | 1351 | AUTH_LINKOBJS= |
1352 | for module in $AUTH_MODULES; do | |
1353 | AUTH_LINKOBJS="$AUTH_LINKOBJS auth/${module}/${module}Scheme.o" | |
1354 | done | |
94439e4e | 1355 | AC_SUBST(AUTH_MODULES) |
94439e4e | 1356 | AC_SUBST(AUTH_LIBS) |
f5691f9c | 1357 | AC_SUBST(AUTH_LINKOBJS) |
1358 | AC_SUBST(AUTH_OBJS) | |
94439e4e | 1359 | |
1360 | dnl Select basic auth scheme helpers to build | |
7f18d2bd | 1361 | if test -n "$AUTH_MODULE_basic"; then |
1362 | BASIC_AUTH_HELPERS="all" | |
1363 | fi | |
94439e4e | 1364 | AC_ARG_ENABLE(basic-auth-helpers, |
1365 | [ --enable-basic-auth-helpers=\"list of helpers\" | |
1366 | This option selects which basic scheme proxy_auth | |
1367 | helpers to build and install as part of the normal | |
1368 | build process. For a list of available | |
0c510f3c | 1369 | helpers see the helpers/basic_auth directory.], |
94439e4e | 1370 | [ case "$enableval" in |
7f18d2bd | 1371 | yes) |
1372 | BASIC_AUTH_HELPERS="all" | |
1c690e30 | 1373 | ;; |
94439e4e | 1374 | no) |
7f18d2bd | 1375 | BASIC_AUTH_HELPERS="" |
1c690e30 | 1376 | ;; |
94439e4e | 1377 | *) |
7f18d2bd | 1378 | if test -z "$AUTH_MODULE_basic"; then |
1379 | echo "WARNING: Basic auth helpers selected without the basic scheme enabled" | |
1380 | sleep 15 | |
1381 | fi | |
1c690e30 | 1382 | BASIC_AUTH_HELPERS="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`" |
1383 | ;; | |
94439e4e | 1384 | esac |
1385 | ]) | |
7f18d2bd | 1386 | if test "$BASIC_AUTH_HELPERS" = "all" ; then |
1387 | BASIC_AUTH_HELPERS="" | |
1388 | for dir in $srcdir/helpers/basic_auth/*; do | |
1389 | helper="`basename $dir`" | |
1390 | if test -f $dir/config.test && sh $dir/config.test "$@"; then | |
1391 | BASIC_AUTH_HELPERS="$BASIC_AUTH_HELPERS $helper" | |
1392 | fi | |
1393 | done | |
1394 | fi | |
fc83a946 | 1395 | if test -n "$BASIC_AUTH_HELPERS"; then |
20d8bfe4 | 1396 | for helper in $BASIC_AUTH_HELPERS; do |
1c690e30 | 1397 | if test -d $srcdir/helpers/basic_auth/$helper; then |
2adff954 | 1398 | case $helper in |
1399 | SASL) | |
1400 | require_sasl=yes | |
1401 | ;; | |
1402 | esac | |
20d8bfe4 | 1403 | else |
1c690e30 | 1404 | echo "ERROR: Basic auth helper $helper does not exists" |
1405 | exit 1 | |
20d8bfe4 | 1406 | fi |
1407 | done | |
fc83a946 | 1408 | echo "Basic auth helpers built: $BASIC_AUTH_HELPERS" |
94439e4e | 1409 | fi |
fc83a946 | 1410 | AC_SUBST(BASIC_AUTH_HELPERS) |
94439e4e | 1411 | |
1412 | dnl Select ntlm auth helpers to build | |
7f18d2bd | 1413 | if test -n "$AUTH_MODULE_ntlm"; then |
1414 | NTLM_AUTH_HELPERS="all" | |
1415 | fi | |
94439e4e | 1416 | AC_ARG_ENABLE(ntlm-auth-helpers, |
1417 | [ --enable-ntlm-auth-helpers=\"list of helpers\" | |
1418 | This option selects which proxy_auth ntlm helpers | |
1419 | to build and install as part of the normal build | |
0c510f3c | 1420 | process. For a list of available helpers see |
1421 | the helpers/ntlm_auth directory.], | |
380f0a87 | 1422 | [ case "$enableval" in |
1423 | yes) | |
7f18d2bd | 1424 | NTLM_AUTH_HELPERS="all" |
1c690e30 | 1425 | ;; |
380f0a87 | 1426 | no) |
7f18d2bd | 1427 | NTLM_AUTH_HELPERS="" |
1c690e30 | 1428 | ;; |
380f0a87 | 1429 | *) |
1c690e30 | 1430 | NTLM_AUTH_HELPERS="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`" |
1431 | ;; | |
380f0a87 | 1432 | esac |
1433 | ]) | |
7f18d2bd | 1434 | if test "$NTLM_AUTH_HELPERS" = "all" ; then |
1435 | NTLM_AUTH_HELPERS="" | |
1436 | for dir in $srcdir/helpers/ntlm_auth/*; do | |
1437 | helper="`basename $dir`" | |
1438 | if test -f $dir/config.test && sh $dir/config.test "$@"; then | |
1439 | NTLM_AUTH_HELPERS="$NTLM_AUTH_HELPERS $helper" | |
1440 | fi | |
1441 | done | |
1442 | fi | |
94439e4e | 1443 | if test -n "$NTLM_AUTH_HELPERS"; then |
20d8bfe4 | 1444 | for helper in $NTLM_AUTH_HELPERS; do |
1c690e30 | 1445 | if test -d $srcdir/helpers/ntlm_auth/$helper; then |
1446 | : | |
20d8bfe4 | 1447 | else |
1c690e30 | 1448 | echo "ERROR: NTLM Auth helper $helper does not exists" |
1449 | exit 1 | |
20d8bfe4 | 1450 | fi |
1451 | done | |
94439e4e | 1452 | echo "NTLM auth helpers built: $NTLM_AUTH_HELPERS" |
380f0a87 | 1453 | fi |
94439e4e | 1454 | AC_SUBST(NTLM_AUTH_HELPERS) |
1455 | ||
6e785d85 | 1456 | dnl Select negotiate auth helpers to build |
7f18d2bd | 1457 | if test -n "$AUTH_MODULE_negotiate"; then |
1458 | NEGOTIATE_AUTH_HELPERS="all" | |
1459 | fi | |
6e785d85 | 1460 | AC_ARG_ENABLE(negotiate-auth-helpers, |
1461 | [ --enable-negotiate-auth-helpers=\"list of helpers\" | |
1462 | This option selects which proxy_auth negotiate helpers | |
1463 | to build and install as part of the normal build | |
1464 | process. For a list of available helpers see | |
1465 | the helpers/negotiate_auth directory.], | |
1466 | [ case "$enableval" in | |
1467 | yes) | |
7f18d2bd | 1468 | NEGOTIATE_AUTH_HELPERS="all" |
6e785d85 | 1469 | ;; |
1470 | no) | |
7f18d2bd | 1471 | NEGOTIATE_AUTH_HELPERS="" |
6e785d85 | 1472 | ;; |
1473 | *) | |
1474 | NEGOTIATE_AUTH_HELPERS="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`" | |
1475 | ;; | |
1476 | esac | |
1477 | ]) | |
7f18d2bd | 1478 | if test "$NEGOTIATE_AUTH_HELPERS" = "all" ; then |
1479 | NEGOTIATE_AUTH_HELPERS="" | |
1480 | for dir in $srcdir/helpers/negotiate_auth/*; do | |
1481 | helper="`basename $dir`" | |
1482 | if test -f $dir/config.test && sh $dir/config.test "$@"; then | |
1483 | NEGOTIATE_AUTH_HELPERS="$NEGOTIATE_AUTH_HELPERS $helper" | |
1484 | fi | |
1485 | done | |
1486 | fi | |
6e785d85 | 1487 | if test -n "$NEGOTIATE_AUTH_HELPERS"; then |
1488 | for helper in $NEGOTIATE_AUTH_HELPERS; do | |
1489 | if test -d $srcdir/helpers/negotiate_auth/$helper; then | |
1490 | : | |
1491 | else | |
1492 | echo "ERROR: Negotiate Auth helper $helper does not exists" | |
1493 | exit 1 | |
1494 | fi | |
1495 | done | |
1496 | echo "Negotiate auth helpers built: $NEGOTIATE_AUTH_HELPERS" | |
1497 | fi | |
1498 | AC_SUBST(NEGOTIATE_AUTH_HELPERS) | |
1499 | ||
2d70df72 | 1500 | dnl Select digest auth scheme helpers to build |
7f18d2bd | 1501 | if test -n "$AUTH_MODULE_digest"; then |
1502 | DIGEST_AUTH_HELPERS=all | |
1503 | fi | |
2d70df72 | 1504 | AC_ARG_ENABLE(digest-auth-helpers, |
1505 | [ --enable-digest-auth-helpers=\"list of helpers\" | |
1506 | This option selects which digest scheme authentication | |
1507 | helpers to build and install as part of the normal build | |
0c510f3c | 1508 | process. For a list of available helpers see the |
1509 | helpers/digest_auth directory.], | |
2d70df72 | 1510 | [ case "$enableval" in |
1511 | yes) | |
7f18d2bd | 1512 | DIGEST_AUTH_HELPERS="all" |
1c690e30 | 1513 | ;; |
2d70df72 | 1514 | no) |
7f18d2bd | 1515 | DIGEST_AUTH_HELPERS="" |
1c690e30 | 1516 | ;; |
2d70df72 | 1517 | *) |
1c690e30 | 1518 | DIGEST_AUTH_HELPERS="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`" |
1519 | ;; | |
2d70df72 | 1520 | esac |
1521 | ]) | |
7f18d2bd | 1522 | if test "$DIGEST_AUTH_HELPERS" = "all" ; then |
1523 | DIGEST_AUTH_HELPERS="" | |
1524 | for dir in $srcdir/helpers/digest_auth/*; do | |
1525 | helper="`basename $dir`" | |
1526 | if test -f $dir/config.test && sh $dir/config.test "$@"; then | |
1527 | DIGEST_AUTH_HELPERS="$DIGEST_AUTH_HELPERS $helper" | |
1528 | fi | |
1529 | done | |
1530 | fi | |
2d70df72 | 1531 | if test -n "$DIGEST_AUTH_HELPERS"; then |
1daefc1a | 1532 | for helper in $DIGEST_AUTH_HELPERS; do |
1533 | if test -f $srcdir/helpers/digest_auth/$helper/Makefile.in; then | |
1534 | : | |
1535 | else | |
1536 | echo "ERROR: digest auth helper $helper does not exists" | |
1537 | exit 1 | |
1538 | fi | |
1539 | done | |
2d70df72 | 1540 | echo "Digest auth helpers built: $DIGEST_AUTH_HELPERS" |
1541 | fi | |
1542 | AC_SUBST(DIGEST_AUTH_HELPERS) | |
380f0a87 | 1543 | |
6437ac71 | 1544 | dnl Enable "NTLM fail open" |
1545 | AC_ARG_ENABLE(ntlm-fail-open, | |
1546 | [ --enable-ntlm-fail-open Enable NTLM fail open, where a helper that fails one of the | |
0961c811 | 1547 | Authentication steps can allow squid to still authenticate |
1548 | the user.], | |
6437ac71 | 1549 | [ if test "$enableval" = "yes" ; then |
6a9f6389 | 1550 | AC_DEFINE(NTLM_FAIL_OPEN,1,[Define if NTLM is allowed to fail gracefully when a helper has problems. WARNING: This has security implications. DO NOT enable unless you KNOW you need it.]) |
6437ac71 | 1551 | fi |
1552 | ]) | |
1553 | ||
c6588c68 | 1554 | dnl Select external_acl helpers to build |
7f18d2bd | 1555 | EXTERNAL_ACL_HELPERS=all |
c6588c68 | 1556 | AC_ARG_ENABLE(external-acl-helpers, |
1557 | [ --enable-external-acl-helpers=\"list of helpers\" | |
1558 | This option selects which external_acl helpers to | |
1559 | build and install as part of the normal build | |
1560 | process. For a list of available helpers see the | |
1561 | helpers/external_acl directory.], | |
1562 | [ case "$enableval" in | |
1563 | yes) | |
7f18d2bd | 1564 | EXTERNAL_ACL_HELPERS=all |
1c690e30 | 1565 | ;; |
c6588c68 | 1566 | no) |
7f18d2bd | 1567 | EXTERNAL_ACL_HELPERS="" |
1c690e30 | 1568 | ;; |
c6588c68 | 1569 | *) |
1c690e30 | 1570 | EXTERNAL_ACL_HELPERS="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`" |
1571 | ;; | |
c6588c68 | 1572 | esac |
1573 | ]) | |
7f18d2bd | 1574 | if test "$EXTERNAL_ACL_HELPERS" = "all" ; then |
39ee7289 | 1575 | EXTERNAL_ACL_HELPERS="" |
7f18d2bd | 1576 | for dir in $srcdir/helpers/external_acl/*; do |
1577 | helper="`basename $dir`" | |
1578 | if test -f $dir/config.test && sh $dir/config.test "$@"; then | |
1579 | EXTERNAL_ACL_HELPERS="$EXTERNAL_ACL_HELPERS $helper" | |
1580 | fi | |
1581 | done | |
1582 | fi | |
c6588c68 | 1583 | if test -n "$EXTERNAL_ACL_HELPERS"; then |
20d8bfe4 | 1584 | for helper in $EXTERNAL_ACL_HELPERS; do |
1585 | if test -f $srcdir/helpers/external_acl/$helper/Makefile.in; then | |
1586 | : | |
1587 | else | |
1daefc1a | 1588 | echo "ERROR: external acl helper $helper does not exists" |
20d8bfe4 | 1589 | exit 1 |
1590 | fi | |
1591 | done | |
c6588c68 | 1592 | echo "External acl helpers built: $EXTERNAL_ACL_HELPERS" |
1593 | fi | |
1594 | AC_SUBST(EXTERNAL_ACL_HELPERS) | |
1595 | ||
3a125142 | 1596 | AC_ARG_WITH(valgrind-debug, |
1597 | [ --with-valgrind-debug Include debug instrumentation for use with valgrind], | |
b4bab919 | 1598 | [ case $withval in |
1599 | yes) | |
1600 | valgrind=1 | |
1601 | ;; | |
1602 | no) | |
1603 | valgrind= | |
1604 | ;; | |
1605 | *) | |
1606 | CPPFLAGS="$CPPFLAGS -I${enableval}/include" | |
1607 | valgrind=1 | |
1608 | ;; | |
1609 | esac | |
1610 | if test $valgrind; then | |
1611 | AC_DEFINE(WITH_VALGRIND, 1, [Valgrind memory debugger support]) | |
1612 | echo "Valgrind debug support enabled" | |
1613 | fi | |
1614 | ]) | |
1615 | ||
d96ceb8e | 1616 | dnl Disable "memPools" code |
1617 | AC_ARG_ENABLE(mempools, | |
b001e822 | 1618 | [ --disable-mempools Disable memPools. Note that this option now simply sets the |
2df6213e | 1619 | default behaviour. Specific classes can override this at runtime, and |
1620 | only lib/MemPool.c needs to be altered to change the squid-wide | |
1621 | default for all classes.], | |
d96ceb8e | 1622 | [ if test "$enableval" = "no" ; then |
1623 | echo "memPools disabled" | |
6a9f6389 | 1624 | AC_DEFINE(DISABLE_POOLS, 1, [Define if you have problems with memPools and want to disable Pools]) |
3e0dc9a8 | 1625 | else |
1626 | AC_DEFINE(DISABLE_POOLS, 0, [Define if you have problems with memPools and want to disable Pools.]) | |
d96ceb8e | 1627 | fi |
3e0dc9a8 | 1628 | ], |
1629 | [ AC_DEFINE(DISABLE_POOLS, 0, [Define if you have problems with memPools and want to disable Pools.]) | |
d96ceb8e | 1630 | ]) |
1631 | ||
0e657244 | 1632 | dnl Enable WIN32 Service compile mode |
1633 | AC_ARG_ENABLE(win32-service, | |
1634 | [ --enable-win32-service Compile Squid as a WIN32 Service | |
1635 | Works only on Windows NT and Windows 2000 Platforms.], | |
1636 | [ if test "$enableval" = "yes" ; then | |
1637 | echo "Enabling WIN32 run service mode" | |
1638 | AC_DEFINE(USE_WIN32_SERVICE,1,[Define Windows NT & Windows 2000 run service mode]) | |
1639 | fi | |
1640 | ]) | |
1641 | ||
b1485ff8 | 1642 | |
2adff954 | 1643 | dnl Check for Cyrus SASL |
1644 | if test "$require_sasl" = "yes"; then | |
1645 | AC_CHECK_HEADERS(sasl/sasl.h sasl.h) | |
1646 | if test "$ac_cv_header_sasl_sasl_h" = "yes"; then | |
1647 | echo "using SASL2" | |
1648 | LIBSASL="-lsasl2" | |
1649 | else | |
1650 | if test "$ac_cv_header_sasl_h" = "yes"; then | |
1651 | echo "using SASL" | |
1652 | LIBSASL="-lsasl" | |
1653 | else | |
1654 | echo "ERROR: Neither SASL nor SASL2 found" | |
1655 | exit 1 | |
1656 | fi | |
1657 | fi | |
1658 | AC_SUBST(LIBSASL) | |
1659 | fi | |
1660 | ||
3c573763 | 1661 | dnl Disable "unlinkd" code |
fe0810ac | 1662 | AC_ARG_ENABLE(unlinkd, |
1663 | [ --disable-unlinkd Do not use unlinkd], | |
1664 | [ if test "$enableval" = "no" ; then | |
3c573763 | 1665 | use_unlinkd=no |
fe0810ac | 1666 | else |
3c573763 | 1667 | use_unlinkd=yes |
fe0810ac | 1668 | fi |
1669 | ],[ | |
1670 | # Here we should probably use some magic depending on the selected | |
1671 | # storage models | |
3c573763 | 1672 | use_unlinkd=yes |
fe0810ac | 1673 | ]) |
3c573763 | 1674 | if test "$use_unlinkd" = "yes"; then |
fe0810ac | 1675 | echo "unlinkd enabled" |
6a9f6389 | 1676 | AC_DEFINE(USE_UNLINKD,1,[Define this if unlinkd is required (strongly recommended for ufs storage type)]) |
a2794549 | 1677 | AM_CONDITIONAL(ENABLE_UNLINKD, true) |
fe0810ac | 1678 | else |
1679 | echo "unlinkd disabled" | |
a2794549 | 1680 | AM_CONDITIONAL(ENABLE_UNLINKD, false) |
fe0810ac | 1681 | fi |
fe0810ac | 1682 | |
ce3d30fb | 1683 | dnl Enable backtraces on fatal errors |
1684 | AC_ARG_ENABLE(stacktraces, | |
1685 | [ --enable-stacktraces Enable automatic call backtrace on fatal errors], | |
1686 | [ if test "$enableval" = "yes" ; then | |
1687 | echo "Enabling automatic stack backtraces on fatal errors" | |
6a9f6389 | 1688 | AC_DEFINE(PRINT_STACK_TRACE, 1,[Print stacktraces on fatal errors]) |
ce3d30fb | 1689 | fi |
1690 | ]) | |
1691 | ||
88bfe092 | 1692 | AM_CONDITIONAL(ENABLE_XPROF_STATS, false) |
1693 | dnl Enable USE_XPROF_STATS | |
1694 | AC_ARG_ENABLE(cpu-profiling, | |
1695 | [ --enable-cpu-profiling | |
1696 | This option allows you to see which internal functions | |
1697 | in Squid are consuming how much CPU. Compiles in probes | |
1698 | that measure time spent in probed functions. Needs | |
1699 | source modifications to add new probes. This is meant | |
1700 | for developers to assist in performance optimisations | |
1701 | of Squid internal functions. | |
1702 | If you are not developer and not interested in the stats | |
1703 | you shouldn't enable this, as overhead added, although | |
1704 | small, is still overhead. See lib/Profiler.c for more. | |
1705 | ], | |
1706 | [ if test "$enableval" = "yes" ; then | |
1707 | echo "Enabling cpu-profiling" | |
6a9f6389 | 1708 | AC_DEFINE(USE_XPROF_STATS, 1,[Define to enable CPU profiling within Squid]) |
88bfe092 | 1709 | AM_CONDITIONAL(ENABLE_XPROF_STATS, true) |
1710 | fi | |
1711 | ]) | |
1712 | ||
f66a9ef4 | 1713 | dnl Enable X-Accelerator-Vary for Vary support within an accelerator setup |
1714 | AC_ARG_ENABLE(x_accelerator_vary, | |
0961c811 | 1715 | [ --enable-x-accelerator-vary |
1716 | Enable support for the X-Accelerator-Vary | |
1717 | HTTP header. Can be used to indicate | |
1718 | variance within an accelerator setup. | |
1719 | Typically used together with other code | |
1720 | that adds custom HTTP headers to the requests.], | |
f66a9ef4 | 1721 | [ if test "$enableval" = "yes" ; then |
1722 | echo "Enabling support for X-Accelerator-Vary" | |
6a9f6389 | 1723 | AC_DEFINE(X_ACCELERATOR_VARY, 1, [Enable support for the X-Accelerator-Vary HTTP header]) |
f66a9ef4 | 1724 | fi |
1725 | ]) | |
1726 | ||
cc192b50 | 1727 | dnl Enable IPv6 support |
1728 | AC_MSG_CHECKING([whether to enable IPv6]) | |
1729 | AC_ARG_ENABLE(ipv6, | |
1730 | [ --enable-ipv6 Enable ipv6 support], | |
1731 | [ AC_MSG_RESULT(yes) | |
1732 | AC_CACHE_CHECK([if PF_INET6 is available], $enableval, | |
1733 | AC_TRY_RUN( | |
1734 | [ /* PF_INET6 available check */ | |
1735 | # include <sys/types.h> | |
1736 | # include <sys/socket.h> | |
1737 | void main() { | |
1738 | if (socket(PF_INET6, SOCK_STREAM, 0) < 0) | |
1739 | exit(1); | |
1740 | else | |
1741 | exit(0); | |
1742 | } | |
1743 | ], | |
1744 | [ AC_DEFINE(USE_IPV6,1,[Enable support for IPv6 ]) | |
1745 | AC_MSG_RESULT(yes) | |
1746 | ], | |
1747 | [ AC_DEFINE(USE_IPV6,0,[0 == Disable support for IPv6]) | |
1748 | AC_DEFINE(IPV6_SPECIAL_SPLITSTACK,0,[0 == Disable support for Split-Stack IPv6 Implementations]) | |
1749 | AC_DEFINE(IPV6_SPECIAL_LOCALHOST,0,[0 == Keep IPv4 and IPv6 Localhosts seperate.]) | |
1750 | AC_DEFINE(IPV6_SPECIAL_V4MAPPING,0,[0 == Leave all v4-mapping to OS Implementation]) | |
1751 | AC_MSG_RESULT(no) | |
1752 | ]) | |
1753 | ) | |
1754 | ], | |
1755 | [ AC_DEFINE(USE_IPV6,0,[Disable support for IPv6]) | |
1756 | AC_DEFINE(IPV6_SPECIAL_SPLITSTACK,0,[ 0 == Disable support for Split-Stack IPv6 Implementations]) | |
1757 | AC_DEFINE(IPV6_SPECIAL_LOCALHOST,0,[ 0 == Keep IPv4 and IPv6 Localhosts seperate.]) | |
1758 | AC_DEFINE(IPV6_SPECIAL_V4MAPPING,0,[ 0 == Leave v4-mapping to OS Implementation]) | |
1759 | AC_MSG_RESULT(no) | |
1760 | ]) | |
1761 | if test $ac_cv_enable_ipv6 ; then | |
1762 | dnl Check for Windows XP option | |
1763 | AC_MSG_CHECKING([for IPv6 split-stack requirement]) | |
1764 | AC_ARG_WITH(ipv6-split-stack, | |
1765 | [ --with-ipv6-split-stack Require IPv6 split-stack support (Requires IPv6 Support)], | |
1766 | [AC_DEFINE(IPV6_SPECIAL_SPLITSTACK, 1, [ 1 == Enable support for IPv6 on split-stack implementations]) AC_MSG_RESULT(yes)], | |
1767 | [AC_DEFINE(IPV6_SPECIAL_SPLITSTACK, 0, [ 0 == Disable support for split-stack IPv6 implementations]) AC_MSG_RESULT(no)] | |
1768 | ) | |
1769 | ||
1770 | dnl Check for IPv6 Windows Vista option | |
1771 | AC_MSG_CHECKING([for IPv6 v4-mapping requirement]) | |
1772 | AC_ARG_WITH(ipv4-mapped, | |
1773 | [ --with-ipv4-mapped Hybrid-Stack OS require Squid to do any v4-mapping (Requires IPv6 Support)], | |
1774 | [AC_DEFINE(IPV6_SPECIAL_V4MAPPING, 1, [ 1 == Perform v4-mapping internally]) AC_MSG_RESULT(yes)], | |
1775 | [AC_DEFINE(IPV6_SPECIAL_V4MAPPING, 0, [ 0 == Leave all v4-mapping to the OS]) AC_MSG_RESULT(no)] | |
1776 | ) | |
1777 | ||
1778 | dnl Check for IPv6-pure option | |
1779 | AC_MSG_CHECKING([for IPv6-Localhost requirement]) | |
1780 | AC_ARG_WITH(localhost-ipv6, | |
1781 | [ --with-localhost-ipv6 Prefer IPv6 localhost address over IPv4 (Requires IPv6 Support). | |
1782 | Treats 127.0.0.1 and ::1 as identical and converts all inputs of to ::1 | |
1783 | This depends on Dual-Stack support in the OS and all applications | |
1784 | squid contacts via localhost being IPv6 enabled. | |
1785 | Default: OFF. Treats these two IP as different, squid.conf must | |
1786 | define both 127.0.0.1 and ::1 for the localhost ACL, etc. ], | |
1787 | [AC_DEFINE(IPV6_SPECIAL_LOCALHOST, 1, [ 1 == Convert IPv4-localhost requests to IPv6.]) AC_MSG_RESULT(yes)], | |
1788 | [AC_DEFINE(IPV6_SPECIAL_LOCALHOST, 0, [ 0 == Keep IPv4 and IPv6 Localhosts seperate.]) AC_MSG_RESULT(no)] | |
1789 | ) | |
1790 | # end IPv6-only options | |
1791 | fi | |
1792 | ||
bae9832d | 1793 | dnl Optional CNAME-Recursion by Internal DNS engine |
1794 | AC_MSG_CHECKING([whether DNS CNAME recursion wanted]) | |
1795 | AC_ARG_WITH(dns-cname, | |
1796 | [ --with-dns-cname Enable CNAME-Recursion in Internal DNS stub.], | |
1797 | [AC_DEFINE(DNS_CNAME, 1, [ 1 == Enable expermental CNAME recursion inside Squid DNS resolver stub]) AC_MSG_RESULT(yes)], | |
1798 | [AC_DEFINE(DNS_CNAME, 0, [ 0 == Disable expermental CNAME recursion inside Squid DNS resolver stub]) AC_MSG_RESULT(no)] | |
1799 | ) | |
1800 | ||
8c37ea44 AJ |
1801 | dnl Check whether this OS defines ss_len as a member of sockaddr_storage |
1802 | AC_CACHE_CHECK([for ss_len field in struct sockaddr_storage], | |
1803 | ac_cv_have_ss_len_in_struct_ss, [ | |
1804 | AC_TRY_COMPILE([ | |
1805 | #include <sys/types.h> | |
1806 | #include <sys/socket.h> | |
1807 | ], | |
1808 | [ struct sockaddr_storage s; s.ss_len = 1; ], | |
1809 | [ ac_cv_have_ss_len_in_struct_ss="yes" ], | |
1810 | [ ac_cv_have_ss_len_in_struct_ss="no" ] | |
1811 | ) | |
1812 | ]) | |
1813 | if test "x$ac_cv_have_ss_len_in_struct_ss" = "xyes" ; then | |
1814 | AC_DEFINE(HAVE_SS_LEN_IN_SS, 1, [Does struct sockaddr_storage have ss_len? 1: Yes, 0: No]) | |
1815 | else | |
1816 | AC_DEFINE(HAVE_SS_LEN_IN_SS, 0, [Does struct sockaddr_storage have ss_len? 1: Yes, 0: No]) | |
1817 | fi | |
1818 | ||
1819 | dnl Check whether this OS defines sin_len as a member of sockaddr_in as a backup to ss_len | |
1820 | AC_CACHE_CHECK([for sin_len field in struct sockaddr_in], | |
1821 | ac_cv_have_sin_len_in_struct_sai, [ | |
1822 | AC_TRY_COMPILE([ | |
1823 | #include <sys/types.h> | |
1824 | #include <sys/socket.h> | |
1825 | ], | |
1826 | [ struct sockaddr_in s; s.sin_len = 1; ], | |
1827 | [ ac_cv_have_sin_len_in_struct_sai="yes" ], | |
1828 | [ ac_cv_have_sin_len_in_struct_sai="no" ] | |
1829 | ) | |
1830 | ]) | |
1831 | if test "x$ac_cv_have_sin_len_in_struct_sai" = "xyes" ; then | |
1832 | AC_DEFINE(HAVE_SIN_LEN_IN_SAI, 1, [Does struct sockaddr_in have sin_len? 1: Yes, 0: No]) | |
1833 | else | |
1834 | AC_DEFINE(HAVE_SIN_LEN_IN_SAI, 0, [Does struct sockaddr_in have sin_len? 1: Yes, 0: No]) | |
1835 | fi | |
1836 | ||
1837 | dnl Check whether this OS defines sin6_len as a member of sockaddr_in6 as a backup to ss_len | |
1838 | AC_CACHE_CHECK([for sin6_len field in struct sockaddr_in6], | |
1839 | ac_cv_have_sin6_len_in_struct_sai, [ | |
1840 | AC_TRY_COMPILE([ | |
1841 | #include <sys/types.h> | |
1842 | #include <sys/socket.h> | |
1843 | ], | |
1844 | [ struct sockaddr_in6 s; s.sin6_len = 1; ], | |
1845 | [ ac_cv_have_sin6_len_in_struct_sai="yes" ], | |
1846 | [ ac_cv_have_sin6_len_in_struct_sai="no" ] | |
1847 | ) | |
1848 | ]) | |
1849 | if test "x$ac_cv_have_sin6_len_in_struct_sai" = "xyes" ; then | |
1850 | AC_DEFINE(HAVE_SIN6_LEN_IN_SAI, 1, [Does struct sockaddr_in6 have sin6_len? 1: Yes, 0: No]) | |
1851 | else | |
1852 | AC_DEFINE(HAVE_SIN6_LEN_IN_SAI, 0, [Does struct sockaddr_in6 have sin6_len? 1: Yes, 0: No]) | |
1853 | fi | |
1854 | ||
bae9832d | 1855 | |
f49be7d1 | 1856 | AC_ARG_WITH(filedescriptors, |
f5e5c4cf | 1857 | [ --with-filedescriptors=NUMBER |
1858 | Force squid to support NUMBER filedescriptors], | |
f49be7d1 | 1859 | [ squid_filedescriptors_num=$withval ]) |
1860 | ||
8b5e106b | 1861 | AC_PATH_PROG(CPPUNITCONFIG, cppunit-config, false) |
1862 | if $CPPUNITCONFIG --help >/dev/null; then | |
f5691f9c | 1863 | echo "using system installed cppunit" |
8b5e106b | 1864 | SQUID_CPPUNIT_LIBS="`$CPPUNITCONFIG --libs`" |
1865 | SQUID_CPPUNIT_LA='' | |
1866 | SQUID_CPPUNIT_INC="`$CPPUNITCONFIG --cflags`" | |
1867 | else | |
63d03edb | 1868 | echo "cppunit does not apear to be installed. squid does not require this, but code testing with 'make check' will fail." |
1869 | SQUID_CPPUNIT_LA='' | |
1870 | SQUID_CPPUNIT_LIBS='' | |
1871 | SQUID_CPPUNIT_INC='' | |
f5691f9c | 1872 | fi |
8b5e106b | 1873 | |
f5691f9c | 1874 | AC_ARG_WITH(cppunit-basedir, |
1875 | [ --with-cppunit-basedir=/path/to/cppunit-base | |
1876 | Path where the cppunit headers are libraries are found | |
63d03edb | 1877 | for unit testing. |
f5691f9c | 1878 | ], |
1879 | [ if test -f $withval/include/cppunit/TestCase.h; then | |
1880 | echo "Using cppunit includes from $withval" | |
1881 | SQUID_CPPUNIT_INC="-I${withval}/include" | |
1882 | else | |
1883 | echo "ERROR: Cannot find cppunit at $withval" | |
1884 | exit 1 | |
1885 | fi | |
1886 | if test -f $withval/lib/libcppunit.la; then | |
1887 | echo "Using cppunit lib from $withval" | |
549b1e60 | 1888 | SQUID_CPPUNIT_LA="${withval}/lib/libcppunit.la" |
8b5e106b | 1889 | SQUID_CPPUNIT_LIBS='$(SQUID_CPPUNIT_LA)' |
f5691f9c | 1890 | else |
1891 | echo "ERROR: Cannot find cppunit at $withval" | |
1892 | exit 1 | |
1893 | fi | |
f5691f9c | 1894 | ]) |
8b5e106b | 1895 | AC_SUBST(SQUID_CPPUNIT_LIBS) |
f5691f9c | 1896 | AC_SUBST(SQUID_CPPUNIT_LA) |
1897 | AC_SUBST(SQUID_CPPUNIT_INC) | |
f5691f9c | 1898 | |
fd9aaa3e | 1899 | # Force some compilers to use ANSI features |
1900 | # | |
1901 | case "$host" in | |
1902 | alpha-dec-osf*) | |
1903 | if test "$ac_cv_prog_CC" = "cc" ; then | |
1904 | echo "adding '-std1' to cc args for $host" | |
1905 | CC="cc -std1"; | |
1906 | ac_cv_prog_CC="$CC" | |
1907 | fi | |
1908 | ;; | |
c68e9c6b | 1909 | *-hp-hpux*) |
1910 | if test "$ac_cv_prog_CC" = "cc" ; then | |
1911 | echo "adding '-Ae' to cc args for $host" | |
1912 | CC="cc -Ae"; | |
1913 | ac_cv_prog_CC="$CC" | |
1914 | fi | |
1915 | ;; | |
fd9aaa3e | 1916 | esac |
1917 | ||
090089c4 | 1918 | dnl Check for programs |
1919 | AC_PROG_CPP | |
1920 | AC_PROG_INSTALL | |
090089c4 | 1921 | AC_PROG_LN_S |
81280a96 | 1922 | AC_PATH_PROG(SH, sh, /bin/sh) |
d9f67e6f | 1923 | AC_PATH_PROG(FALSE, false, /usr/bin/false) |
1924 | AC_PATH_PROG(TRUE, true, /usr/bin/true) | |
1925 | AC_PATH_PROG(RM, rm, $FALSE) | |
1926 | AC_PATH_PROG(MV, mv, $FALSE) | |
1927 | AC_PATH_PROG(MKDIR, mkdir, $FALSE) | |
090089c4 | 1928 | AC_PATH_PROG(LN, ln, cp) |
4e9d8e26 | 1929 | AC_PATH_PROG(PERL, perl, none) |
a2794549 | 1930 | dnl automake handles this AC_PATH_PROG(MAKEDEPEND, makedepend, $TRUE) |
6ad85e8a | 1931 | AC_PATH_PROG(AR, ar, $FALSE) |
1932 | ||
4e9d8e26 | 1933 | if test "$ac_cv_path_PERL" = "none"; then |
1934 | echo "Perl is required to compile Squid" | |
1935 | echo "Please install Perl and then re-run configure" | |
1936 | exit 1 | |
1937 | fi | |
1938 | ||
6ad85e8a | 1939 | case "$host" in |
1940 | *-hp-hpux*) | |
1941 | echo "Disabling 'ranlib' for HP-UX..." | |
1942 | RANLIB=":" | |
1943 | ;; | |
1944 | esac | |
1945 | ||
1946 | dnl set $(AR) | |
1947 | AR_R="$AR r" | |
1948 | case "$host" in | |
1949 | *-next-nextstep3) | |
1950 | AR="libtool -o" | |
1951 | ;; | |
1952 | esac | |
1953 | AC_SUBST(AR_R) | |
090089c4 | 1954 | |
1955 | dnl Check for headers | |
1956 | AC_HEADER_DIRENT | |
1957 | AC_HEADER_STDC | |
db40ae20 | 1958 | |
1959 | AC_CHECK_HEADERS( \ | |
db40ae20 | 1960 | arpa/inet.h \ |
30a4f2a8 | 1961 | arpa/nameser.h \ |
9441aa34 | 1962 | assert.h \ |
db40ae20 | 1963 | bstring.h \ |
db40ae20 | 1964 | crypt.h \ |
30a4f2a8 | 1965 | ctype.h \ |
1966 | errno.h \ | |
ce3d30fb | 1967 | execinfo.h \ |
db40ae20 | 1968 | fcntl.h \ |
42ad37af | 1969 | fnmatch.h \ |
9c1d8929 | 1970 | getopt.h \ |
52303a3d | 1971 | glob.h \ |
88738790 | 1972 | gnumalloc.h \ |
30a4f2a8 | 1973 | grp.h \ |
5cafc1d6 | 1974 | ip_compat.h \ |
42b51993 | 1975 | ip_fil_compat.h \ |
5cafc1d6 | 1976 | ip_fil.h \ |
1977 | ip_nat.h \ | |
dbc5782a | 1978 | ipl.h \ |
30a4f2a8 | 1979 | libc.h \ |
6ad85e8a | 1980 | limits.h \ |
30a4f2a8 | 1981 | malloc.h \ |
e0bddc45 | 1982 | math.h \ |
db40ae20 | 1983 | memory.h \ |
b075cbb1 | 1984 | mount.h \ |
e9e7c285 | 1985 | net/if.h \ |
2b0dd4ac | 1986 | net/pfvar.h \ |
30a4f2a8 | 1987 | netdb.h \ |
db40ae20 | 1988 | netinet/in.h \ |
cc192b50 | 1989 | netinet/icmp6.h \ |
1990 | netinet/in_systm.h \ | |
1991 | netinet/ip.h \ | |
1992 | netinet/ip6.h \ | |
1993 | netinet/ip_icmp.h \ | |
42b51993 | 1994 | netinet/ip_fil_compat.h \ |
1f7c9178 | 1995 | openssl/err.h \ |
1996 | openssl/md5.h \ | |
1997 | openssl/ssl.h \ | |
cc192b50 | 1998 | netinet/tcp.h \ |
a7ad6e4e | 1999 | openssl/engine.h \ |
4da086c4 | 2000 | paths.h \ |
dcfe6390 | 2001 | poll.h \ |
30a4f2a8 | 2002 | pwd.h \ |
b5e4d7d4 | 2003 | shadow.h \ |
30a4f2a8 | 2004 | regex.h \ |
c68e9c6b | 2005 | sched.h \ |
30a4f2a8 | 2006 | signal.h \ |
2007 | stdarg.h \ | |
2008 | stddef.h \ | |
2009 | stdio.h \ | |
db40ae20 | 2010 | stdlib.h \ |
2011 | string.h \ | |
2012 | strings.h \ | |
0a4e8536 | 2013 | sys/bitypes.h \ |
f9576890 | 2014 | sys/bswap.h \ |
2015 | sys/endian.h \ | |
db40ae20 | 2016 | sys/file.h \ |
5cafc1d6 | 2017 | sys/ioctl.h \ |
30a4f2a8 | 2018 | sys/param.h \ |
62ae0622 | 2019 | sys/prctl.h \ |
3d4022fa | 2020 | sys/md5.h \ |
77e4c0c9 | 2021 | sys/msg.h \ |
30a4f2a8 | 2022 | sys/resource.h \ |
db40ae20 | 2023 | sys/select.h\ |
30a4f2a8 | 2024 | sys/socket.h \ |
2025 | sys/stat.h \ | |
b075cbb1 | 2026 | sys/statvfs.h \ |
3c641669 | 2027 | syscall.h \ |
30a4f2a8 | 2028 | sys/syscall.h \ |
db40ae20 | 2029 | sys/time.h \ |
2030 | sys/types.h \ | |
30a4f2a8 | 2031 | sys/un.h \ |
b075cbb1 | 2032 | sys/vfs.h \ |
30a4f2a8 | 2033 | sys/wait.h \ |
db40ae20 | 2034 | syslog.h \ |
30a4f2a8 | 2035 | time.h \ |
2036 | unistd.h \ | |
3c641669 | 2037 | utime.h \ |
30a4f2a8 | 2038 | varargs.h \ |
77d6bd88 | 2039 | byteswap.h \ |
2040 | glib.h \ | |
60d096f4 | 2041 | stdint.h \ |
2042 | inttypes.h \ | |
3c641669 | 2043 | grp.h \ |
2044 | nss_common.h \ | |
94331f58 | 2045 | nss.h \ |
2046 | db.h \ | |
329ce686 | 2047 | db_185.h \ |
2048 | sys/capability.h | |
db40ae20 | 2049 | ) |
2050 | ||
fc68f6b1 | 2051 | AC_CHECK_HEADERS( |
2052 | linux/netfilter_ipv4.h \ | |
2053 | linux/netfilter_ipv4/ip_tproxy.h \ | |
2054 | ,,, | |
dcd1dc78 | 2055 | SQUID_DEFAULT_INCLUDES |
2056 | #if HAVE_LIMITS_H | |
2057 | #include <limits.h> | |
2058 | #endif | |
2059 | ) | |
2060 | ||
5a3237b0 | 2061 | AC_CHECK_HEADERS(net/if.h \ |
2062 | netinet/if_ether.h\ | |
2063 | netinet/ip_compat.h\ | |
2064 | netinet/ip_fil.h\ | |
77e4c0c9 | 2065 | netinet/ip_nat.h\ |
dbc5782a | 2066 | netinet/ipl.h \ |
77e4c0c9 | 2067 | sys/mount.h\ |
2068 | resolv.h,,,SQUID_BSDNET_INCLUDES) | |
5a3237b0 | 2069 | |
a1559187 | 2070 | AC_CHECK_HEADERS([libxml/parser.h], [], [ |
2071 | SAVED_CPPFLAGS="$CPPFLAGS" | |
2072 | CPPFLAGS="-I/usr/include/libxml2 $CPPFLAGS" | |
2073 | unset ac_cv_header_libxml_parser_h | |
2074 | AC_CHECK_HEADERS([libxml/parser.h], [], [ | |
2075 | CPPFLAGS="$SAVED_CPPFLAGS" | |
2076 | ]) | |
2077 | ]) | |
2078 | ||
aee0606f | 2079 | AC_C_CONST |
d57288d2 | 2080 | AC_C_BIGENDIAN |
aee0606f | 2081 | |
6a9f6389 | 2082 | AC_STRUCT_TM |
2083 | AC_CHECK_MEMBERS([struct tm.tm_gmtoff],,,[ | |
2084 | #if TM_IN_SYS_TIME | |
2085 | #if HAVE_SYS_TIME_H | |
2086 | #include <sys/time.h> | |
2087 | #endif | |
2088 | #elif HAVE_TIME_H | |
2089 | #include <time.h> | |
2090 | #endif | |
5c51415d | 2091 | ]) |
46c883ed | 2092 | |
6a9f6389 | 2093 | AC_CHECK_TYPE(struct mallinfo,AC_DEFINE(HAVE_STRUCT_MALLINFO,1,[The system provides struct mallinfo]),,[ |
2094 | #if HAVE_SYS_TYPES_H | |
2095 | #include <sys/types.h> | |
2096 | #endif | |
eb824054 | 2097 | #if HAVE_MALLOC_H |
2098 | #include <malloc.h> | |
6a9f6389 | 2099 | #endif]) |
eb824054 | 2100 | |
6a9f6389 | 2101 | AC_CHECK_MEMBERS([struct mallinfo.mxfast],,,[ |
2102 | #if HAVE_SYS_TYPES_H | |
2103 | #include <sys/types.h> | |
2104 | #endif | |
2105 | #if HAVE_MALLOC_H | |
2106 | #include <malloc.h> | |
2107 | #endif]) | |
090089c4 | 2108 | |
08caf8c6 | 2109 | dnl Override rusage() detect on MinGW because is emulated in source code |
2110 | case "$host_os" in | |
2111 | mingw|mingw32) | |
2112 | AC_DEFINE(HAVE_STRUCT_RUSAGE) | |
2113 | ac_cv_func_getrusage='yes' | |
d750d7bf | 2114 | echo "Using own rusage on Windows." |
08caf8c6 | 2115 | ;; |
2116 | *) | |
2117 | AC_CHECK_TYPE(struct rusage,AC_DEFINE(HAVE_STRUCT_RUSAGE,1,[The system provides struct rusage]),,[ | |
8ff51bba | 2118 | #if HAVE_SYS_TIME_H |
2119 | #include <sys/time.h> | |
2120 | #endif | |
b54a6789 | 2121 | #if HAVE_SYS_RESOURCE_H |
2122 | #include <sys/resource.h> | |
6a9f6389 | 2123 | #endif]) |
08caf8c6 | 2124 | ;; |
2125 | esac | |
b54a6789 | 2126 | |
6a9f6389 | 2127 | AC_CHECK_MEMBERS([struct iphdr.ip_hl],,,[ |
2128 | #if HAVE_SYS_TYPES_H | |
2129 | #include <sys/types.h> | |
2130 | #endif | |
a025a745 | 2131 | #include <netinet/in.h> |
2132 | #include <netinet/in_systm.h> | |
6ad85e8a | 2133 | #include <netinet/ip.h> |
b05490a8 | 2134 | #if defined (__linux__) || defined (__CYGWIN__) |
6ad85e8a | 2135 | #define ip_hl ihl |
2136 | #endif | |
2137 | #ifndef __linux__ | |
b05490a8 | 2138 | #ifndef __CYGWIN__ |
6ad85e8a | 2139 | #define iphdr ip |
b05490a8 | 2140 | #endif |
6a9f6389 | 2141 | #endif]) |
a025a745 | 2142 | |
090089c4 | 2143 | dnl Check for typedefs |
77d6bd88 | 2144 | AC_CHECK_SIZEOF(void *) |
090089c4 | 2145 | |
0409a509 | 2146 | dnl 8 bit integers - int8_t |
2147 | dnl if this is defined we trust it to be 8 bits | |
2148 | AC_CHECK_TYPE(int8_t,[ | |
2149 | AC_CHECK_SIZEOF(int8_t,,SQUID_DEFAULT_SIZEOF_INCLUDES) | |
2150 | AC_DEFINE(HAVE_INT8_T,1,[int8_t is defined in system headers]) | |
2151 | ],,SQUID_DEFAULT_INCLUDES) | |
2152 | ||
2153 | dnl fallback #1 | |
2154 | AC_CHECK_TYPE(char,[ | |
2155 | AC_CHECK_SIZEOF(char,,SQUID_DEFAULT_SIZEOF_INCLUDES) | |
2156 | AC_DEFINE(HAVE_CHAR,1,[char is defined in system headers]) | |
2157 | ],,SQUID_DEFAULT_INCLUDES) | |
2158 | ||
2159 | dnl unsigned 8 bit ints - u_int8_t | |
2160 | dnl if this is defined we trust it to be 8 bits | |
2161 | AC_CHECK_TYPE(u_int8_t,[ | |
2162 | AC_CHECK_SIZEOF(u_int8_t,,SQUID_DEFAULT_SIZEOF_INCLUDES) | |
2163 | AC_DEFINE(HAVE_U_INT8_T,1,[u_int8_t is defined in system headers]) | |
2164 | ],,SQUID_DEFAULT_INCLUDES) | |
2165 | ||
2166 | dnl fallback #1 | |
2167 | dnl if this is defined we trust it to be 8 bits | |
2168 | AC_CHECK_TYPE(uint8_t,[ | |
2169 | AC_CHECK_SIZEOF(uint8_t,,SQUID_DEFAULT_SIZEOF_INCLUDES) | |
2170 | AC_DEFINE(HAVE_UINT8_T,1,[uint8_t is defined in system headers]) | |
2171 | ],,SQUID_DEFAULT_INCLUDES) | |
2172 | ||
2173 | dnl 16 bit integers - int16_t | |
6a9f6389 | 2174 | dnl if this is defined we trust it to be 16 bits |
62266438 | 2175 | AC_CHECK_TYPE(int16_t,[ |
2176 | AC_CHECK_SIZEOF(int16_t,,SQUID_DEFAULT_SIZEOF_INCLUDES) | |
2177 | AC_DEFINE(HAVE_INT16_T,1,[int16_t is defined in system headers]) | |
2178 | ],,SQUID_DEFAULT_INCLUDES) | |
6a9f6389 | 2179 | |
2180 | dnl fallback #1 | |
2181 | AC_CHECK_TYPE(short,[ | |
856e69c5 | 2182 | AC_CHECK_SIZEOF(short,,SQUID_DEFAULT_SIZEOF_INCLUDES) |
6a9f6389 | 2183 | AC_DEFINE(HAVE_SHORT,1,[short is defined in system headers]) |
2184 | ],,SQUID_DEFAULT_INCLUDES) | |
2185 | ||
2186 | dnl fallback #2 | |
2187 | AC_CHECK_TYPE(int,[ | |
856e69c5 | 2188 | AC_CHECK_SIZEOF(int,,SQUID_DEFAULT_SIZEOF_INCLUDES) |
6a9f6389 | 2189 | AC_DEFINE(HAVE_INT,1,[int is defined in system headers]) |
2190 | ],,SQUID_DEFAULT_INCLUDES) | |
2191 | ||
2192 | dnl unsigned 16 bit ints - u_int16_t | |
2193 | dnl if this is defined we trust it to be 16 bits | |
62266438 | 2194 | AC_CHECK_TYPE(u_int16_t,[ |
2195 | AC_CHECK_SIZEOF(u_int16_t,,SQUID_DEFAULT_SIZEOF_INCLUDES) | |
2196 | AC_DEFINE(HAVE_U_INT16_T,1,[u_int16_t is defined in system headers]) | |
2197 | ],,SQUID_DEFAULT_INCLUDES) | |
6a9f6389 | 2198 | |
2199 | dnl fallback #1 | |
2200 | dnl if this is defined we trust it to be 16 bits | |
62266438 | 2201 | AC_CHECK_TYPE(uint16_t,[ |
2202 | AC_CHECK_SIZEOF(uint16_t,,SQUID_DEFAULT_SIZEOF_INCLUDES) | |
2203 | AC_DEFINE(HAVE_UINT16_T,1,[uint16_t is defined in system headers]) | |
2204 | ],,SQUID_DEFAULT_INCLUDES) | |
6a9f6389 | 2205 | |
2206 | dnl 32 bit signed int - int32_t | |
2207 | dnl if this is defined we trust it to be 32 bits | |
62266438 | 2208 | AC_CHECK_TYPE(int32_t,[ |
2209 | AC_CHECK_SIZEOF(int32_t,,SQUID_DEFAULT_SIZEOF_INCLUDES) | |
2210 | AC_DEFINE(HAVE_INT32_T,1,[int32_t is defined in system headers]) | |
2211 | ],,SQUID_DEFAULT_INCLUDES) | |
6a9f6389 | 2212 | |
2213 | dnl fallback #1 | |
2214 | AC_CHECK_TYPE(long,[ | |
856e69c5 | 2215 | AC_CHECK_SIZEOF(long,,SQUID_DEFAULT_SIZEOF_INCLUDES) |
6a9f6389 | 2216 | AC_DEFINE(HAVE_LONG,1,[long is defined in system headers]) |
2217 | ],,SQUID_DEFAULT_INCLUDES) | |
2218 | ||
2219 | dnl 32 bit unsigned int - u_int32_t | |
2220 | dnl if this is defined we trust it to be 32 bits | |
62266438 | 2221 | AC_CHECK_TYPE(u_int32_t,[ |
2222 | AC_CHECK_SIZEOF(u_int32_t,,SQUID_DEFAULT_SIZEOF_INCLUDES) | |
2223 | AC_DEFINE(HAVE_U_INT32_T,1,[u_int32_t is defined in system headers]) | |
2224 | ],,SQUID_DEFAULT_INCLUDES) | |
6a9f6389 | 2225 | |
2226 | dnl fallback #1 | |
2227 | dnl if this is defined we trust it to be 32 bits | |
62266438 | 2228 | AC_CHECK_TYPE(uint32_t,[ |
2229 | AC_CHECK_SIZEOF(uint32_t,,SQUID_DEFAULT_SIZEOF_INCLUDES) | |
2230 | AC_DEFINE(HAVE_UINT32_T,1,[uint32_t is defined in system headers]) | |
2231 | ],,SQUID_DEFAULT_INCLUDES) | |
6a9f6389 | 2232 | |
2233 | dnl 64 bit signed - int64_t | |
2234 | dnl if this is defind we trust it to be 64 bits | |
62266438 | 2235 | AC_CHECK_TYPE(int64_t,[ |
2236 | AC_CHECK_SIZEOF(int64_t,,SQUID_DEFAULT_SIZEOF_INCLUDES) | |
2237 | AC_DEFINE(HAVE_INT64_T,1,[int64_t is defined in system headers]) | |
2238 | ],,SQUID_DEFAULT_INCLUDES) | |
6a9f6389 | 2239 | |
2240 | dnl fallback #1 | |
2241 | dnl if this is defind we trust it to be 64 bits | |
62266438 | 2242 | AC_CHECK_TYPE(__int64,[ |
2243 | AC_CHECK_SIZEOF(__int64,,SQUID_DEFAULT_SIZEOF_INCLUDES) | |
2244 | AC_DEFINE(HAVE___INT64,1,[__int64 is defined in system headers]) | |
2245 | ],,SQUID_DEFAULT_INCLUDES) | |
6a9f6389 | 2246 | |
2247 | dnl fallback #2 | |
2248 | AC_CHECK_TYPE(long long,[ | |
856e69c5 | 2249 | AC_CHECK_SIZEOF(long long,,SQUID_DEFAULT_SIZEOF_INCLUDES) |
6a9f6389 | 2250 | AC_DEFINE(HAVE_LONG_LONG,1,[long long is defined in system headers]) |
2251 | ],,SQUID_DEFAULT_INCLUDES) | |
2252 | ||
2253 | dnl 64 bit unsigned - u_int64_t | |
2254 | dnl if this is defind we trust it to be 64 bits | |
62266438 | 2255 | AC_CHECK_TYPE(u_int64_t,[ |
2256 | AC_CHECK_SIZEOF(u_int64_t,,SQUID_DEFAULT_SIZEOF_INCLUDES) | |
2257 | AC_DEFINE(HAVE_U_INT64_T,1,[u_int64_t is defined in system headers]) | |
2258 | ],,SQUID_DEFAULT_INCLUDES) | |
6a9f6389 | 2259 | |
2260 | dnl fallback #1 | |
2261 | dnl if this is defind we trust it to be 64 bits | |
62266438 | 2262 | AC_CHECK_TYPE(uint64_t,[ |
2263 | AC_CHECK_SIZEOF(uint64_t,,SQUID_DEFAULT_SIZEOF_INCLUDES) | |
2264 | AC_DEFINE(HAVE_UINT64_T,1,[uint64_t is defined in system headers]) | |
2265 | ],,SQUID_DEFAULT_INCLUDES) | |
6a9f6389 | 2266 | |
588e71df | 2267 | dnl On Solaris 9 x86, gcc may includes a "fixed" set of old system include files |
2268 | dnl that is incompatible with the updated Solaris header files. | |
2269 | dnl For this reason, we must check if pad128_t and upad128_t are defined. | |
2270 | AC_CHECK_TYPE(pad128_t, | |
2271 | AC_DEFINE(HAVE_PAD128_T,1,[pad128_t is defined in system headers]), | |
2272 | ,SQUID_DEFAULT_INCLUDES) | |
2273 | ||
2274 | AC_CHECK_TYPE(upad128_t, | |
2275 | AC_DEFINE(HAVE_UPAD128_T,1,[upad128_t is defined in system headers]), | |
2276 | ,SQUID_DEFAULT_INCLUDES) | |
2277 | ||
6a9f6389 | 2278 | AC_CHECK_TYPE(pid_t, AC_DEFINE(HAVE_PID_T,1,[pid_t is defined by the system headers]),,SQUID_DEFAULT_INCLUDES) |
856e69c5 | 2279 | AC_CHECK_TYPE(size_t, [AC_CHECK_SIZEOF(size_t,,SQUID_DEFAULT_SIZEOF_INCLUDES) |
6a9f6389 | 2280 | AC_DEFINE(HAVE_SIZE_T,1,[size_t is defined by the system headers])],,SQUID_DEFAULT_INCLUDES) |
2281 | AC_CHECK_TYPE(ssize_t, AC_DEFINE(HAVE_SSIZE_T,1,[ssize_t is defined by the system headers]),,SQUID_DEFAULT_INCLUDES) | |
856e69c5 | 2282 | AC_CHECK_TYPE(off_t,[ AC_CHECK_SIZEOF(off_t,,SQUID_DEFAULT_SIZEOF_INCLUDES) |
6a9f6389 | 2283 | AC_DEFINE(HAVE_OFF_T,1,[off_t is defined by the system headers])],,SQUID_DEFAULT_INCLUDES) |
2284 | AC_CHECK_TYPE(mode_t, AC_DEFINE(HAVE_MODE_T,1,[mode_t is defined by the system headers]),,SQUID_DEFAULT_INCLUDES) | |
2285 | AC_CHECK_TYPE(fd_mask, AC_DEFINE(HAVE_FD_MASK,1,[fd_mask is defined by the system headers]),,SQUID_DEFAULT_INCLUDES) | |
adcceb47 | 2286 | |
77d6bd88 | 2287 | dnl Check for special functions |
2288 | AC_FUNC_ALLOCA | |
2289 | ||
6a9f6389 | 2290 | AC_CHECK_TYPE(socklen_t,AC_DEFINE(HAVE_SOCKLEN_T,1,[socklen_t is defined by the system headers]),,[ |
2291 | #include <sys/types.h> | |
6637e3a5 | 2292 | #include <sys/socket.h> |
2293 | #if STDC_HEADERS | |
2294 | #include <stdlib.h> | |
2295 | #include <stddef.h> | |
6a9f6389 | 2296 | #endif]) |
6637e3a5 | 2297 | |
6a9f6389 | 2298 | AC_CHECK_TYPE(mtyp_t,AC_DEFINE(HAVE_MTYP_T,1,[mtyp_t is defined by the system headers]),,[#include <sys/types.h> |
aea1be68 | 2299 | #include <sys/ipc.h> |
6a9f6389 | 2300 | #include <sys/msg.h>]) |
aea1be68 | 2301 | |
090089c4 | 2302 | dnl Check for needed libraries |
30a4f2a8 | 2303 | AC_CHECK_LIB(nsl, main) |
6716b242 | 2304 | AC_CHECK_LIB(socket, main) |
4b26fae9 | 2305 | case "$host_os" in |
2306 | mingw|mingw32) | |
2307 | AC_MSG_CHECKING(for winsock) | |
2308 | save_LIBS="$LIBS" | |
2309 | for curlib in ws2_32 wsock32; do | |
2310 | LIBS="$LIBS -l$curlib" | |
2311 | AC_TRY_LINK([ | |
2312 | char __attribute__((stdcall)) socket(int,int,int); | |
2313 | char __attribute__((stdcall)) select(int,int,int,int,int); | |
2314 | char __attribute__((stdcall)) closesocket(int); | |
2315 | char __attribute__((stdcall)) gethostname(int,int); | |
2316 | ], | |
2317 | [ | |
2318 | socket(1,2,3); | |
2319 | select(1,2,3,4,5); | |
2320 | closesocket(1); | |
2321 | gethostname(1,2); | |
2322 | ], | |
2323 | have_winsock=yes, have_winsock=no) | |
2324 | ||
2325 | if test $have_winsock = yes; then | |
2326 | ac_cv_func_select='yes' | |
2327 | if test $curlib = ws2_32; then | |
2328 | have_winsock=winsock2 | |
2329 | fi | |
2330 | break | |
2331 | fi | |
2332 | LIBS="$save_LIBS" | |
2333 | done | |
2334 | AC_MSG_RESULT($have_winsock) | |
2335 | ;; | |
2336 | esac | |
94d48591 | 2337 | |
3c641669 | 2338 | dnl Ripped from the Samba sources |
2339 | AC_CACHE_CHECK([for unix domain sockets],squid_cv_unixsocket, [ | |
2340 | AC_TRY_COMPILE([ | |
2341 | #include <sys/types.h> | |
2342 | #include <stdlib.h> | |
2343 | #include <stddef.h> | |
2344 | #include <sys/socket.h> | |
2345 | #include <sys/un.h>], | |
2346 | [ | |
2347 | struct sockaddr_un sunaddr; | |
2348 | sunaddr.sun_family = AF_UNIX; | |
2349 | ], | |
2350 | squid_cv_unixsocket=yes,squid_cv_unixsocket=no)]) | |
2351 | if test x"$squid_cv_unixsocket" = x"yes"; then | |
6a9f6389 | 2352 | AC_DEFINE(HAVE_UNIXSOCKET,1,[Do we have unix sockets? (required for the winbind ntlm helper]) |
3c641669 | 2353 | fi |
2354 | dnl end rip | |
2355 | ||
94d48591 | 2356 | AC_CHECK_LIB(gnumalloc, main) |
2357 | if test "$ac_cv_lib_gnumalloc_main" = "yes"; then | |
2358 | echo "Disabling extended malloc functions when using gnumalloc" | |
2359 | ac_cv_func_mallinfo=no | |
2360 | ac_cv_func_mallocblksize=no | |
2361 | ac_cv_func_mallopt=no | |
2362 | else | |
2363 | case "$host" in | |
2364 | *-sun-solaris*) | |
2365 | echo "skipping libmalloc check for $host" | |
2366 | ;; | |
2367 | i386-*-freebsd*) | |
2368 | echo "skipping libmalloc check for $host" | |
2369 | ;; | |
2370 | *) | |
2371 | ||
2372 | AC_CHECK_LIB(malloc, main) | |
2373 | ;; | |
2374 | esac | |
2375 | fi | |
94d48591 | 2376 | |
6716b242 | 2377 | AC_CHECK_LIB(bsd, main) |
be79ade0 | 2378 | AC_CHECK_LIB(regex, main, [REGEXLIB="-lregex"]) |
04a56fa3 | 2379 | AC_CHECK_LIB(bind, gethostbyname) |
2380 | if test $ac_cv_lib_bind_gethostbyname = "no" ; then | |
2381 | case "$host" in | |
78743365 | 2382 | i386-*-freebsd*) |
2383 | echo "skipping libresolv checks for $host" | |
2384 | ;; | |
2385 | *) | |
78743365 | 2386 | AC_CHECK_LIB(resolv, main) |
2387 | ;; | |
04a56fa3 | 2388 | esac |
2389 | fi | |
08caf8c6 | 2390 | case "$host_os" in |
2391 | mingw|mingw32) | |
2392 | echo "Use MSVCRT for math functions." | |
2393 | ;; | |
2394 | *) | |
2395 | AC_CHECK_LIB(m, main) | |
2396 | ;; | |
2397 | esac | |
090089c4 | 2398 | |
2399 | dnl Check for libcrypt | |
8154dd82 | 2400 | dnl Some of our helpers use crypt(3) which may be in libc, or in |
2401 | dnl libcrypt (eg FreeBSD) | |
c1dc012a | 2402 | AC_CHECK_LIB(crypt, crypt, [CRYPTLIB="-lcrypt"]) |
3d4022fa | 2403 | |
2404 | dnl Solaris10 provides MD5 natively through libmd5 | |
c1dc012a | 2405 | AC_CHECK_LIB(md5, MD5Init, [CRYPTLIB="$CRYPTLIB -lmd5"]) |
3d4022fa | 2406 | |
be79ade0 | 2407 | AC_SUBST(CRYPTLIB) |
77f675ad | 2408 | |
042b1f8a | 2409 | dnl Check for libdl, used by auth_modules/PAM |
8154dd82 | 2410 | if test "$with_dl" = "yes"; then |
2411 | AC_CHECK_LIB(dl, dlopen) | |
2412 | fi | |
042b1f8a | 2413 | |
e5f4e1b0 | 2414 | dnl Check for pthreads |
2415 | dnl We use pthreads when doing ASYNC I/O | |
8154dd82 | 2416 | if test "$with_pthreads" = "yes"; then |
fa035612 | 2417 | SQUID_CFLAGS="$SQUID_CFLAGS -D_REENTRANT" |
2418 | SQUID_CXXFLAGS="$SQUID_CXXFLAGS -D_REENTRANT" | |
e685e3c6 | 2419 | case "$host" in |
2420 | i386-unknown-freebsd*) | |
2421 | if test "$GCC" = "yes" ; then | |
2422 | if test -z "$PRESET_LDFLAGS"; then | |
2423 | LDFLAGS="$LDFLAGS -pthread" | |
2424 | fi | |
2425 | fi | |
2426 | ;; | |
2427 | *-solaris2.*) | |
2428 | if test "$GCC" = "yes" ; then | |
fa035612 | 2429 | SQUID_CFLAGS="$SQUID_CFLAGS -pthreads" |
2430 | SQUID_CXXFLAGS="$SQUID_CXXFLAGS -pthreads" | |
e685e3c6 | 2431 | else |
fa035612 | 2432 | SQUID_CFLAGS="$SQUID_CFLAGS -mt" |
2433 | SQUID_CXXFLAGS="$SQUID_CXXFLAGS -mt" | |
e685e3c6 | 2434 | fi |
2435 | ;; | |
2436 | esac | |
8154dd82 | 2437 | AC_CHECK_LIB(pthread, main) |
2438 | fi | |
71f8abc8 | 2439 | |
f85c88f3 | 2440 | dnl Check for librt |
2441 | dnl We use AIO in the coss store | |
8154dd82 | 2442 | if test "$with_aio" = "yes"; then |
580e2134 | 2443 | dnl On some systems POSIX AIO functions are in libaio |
2444 | AC_CHECK_LIB(rt, aio_read,,AC_CHECK_LIB(aio, aio_read)) | |
8154dd82 | 2445 | fi |
f85c88f3 | 2446 | |
86ec11aa | 2447 | dnl -lintl is needed on SCO version 3.2v4.2 for strftime() |
2448 | dnl Robert Side <rside@aiinc.bc.ca> | |
2449 | dnl Mon, 18 Jan 1999 17:48:00 GMT | |
2450 | case "$host" in | |
2451 | *-pc-sco3.2*) | |
2452 | AC_CHECK_LIB(intl, strftime) | |
2453 | ;; | |
2454 | esac | |
2455 | ||
20e869bf | 2456 | dnl On MinGW OpenLDAP is not available, so LDAP helpers can be linked |
2457 | dnl only with Windows LDAP libraries using -lwldap32 | |
2458 | case "$host_os" in | |
2459 | mingw|mingw32) | |
2460 | LIB_LDAP="-lwldap32" | |
2461 | LIB_LBER="" | |
2462 | ;; | |
2463 | *) | |
2464 | LIB_LDAP="-lldap" | |
2465 | dnl LDAP helpers need to know if -llber is needed or not | |
2466 | AC_CHECK_LIB(lber, main, [LIB_LBER="-llber"]) | |
2467 | ;; | |
2468 | esac | |
2469 | AC_SUBST(LIB_LDAP) | |
2470 | AC_SUBST(LIB_LBER) | |
2471 | ||
b7a1c19e | 2472 | dnl Check for libdb |
2473 | DBLIB= | |
01b4931d | 2474 | dnl 1.85 |
a258dfca | 2475 | AC_CACHE_CHECK(if dbopen needs -ldb,ac_cv_dbopen_libdb, [ |
32d0bbd7 | 2476 | SAVED_LIBS="$LIBS"; LIBS="$LIBS -ldb" |
2477 | AC_TRY_LINK([ | |
a258dfca | 2478 | #if HAVE_SYS_TYPES_H |
2479 | #include <sys/types.h> | |
2480 | #endif | |
2481 | #if HAVE_LIMITS_H | |
2482 | #include <limits.h> | |
2483 | #endif | |
2484 | #if HAVE_DB_185_H | |
2485 | #include <db_185.h> | |
2486 | #elif HAVE_DB_H | |
2487 | #include <db.h> | |
2488 | #endif], | |
2489 | [dbopen((void *)0L, 0, 0, DB_HASH, (void *)0L)], | |
a258dfca | 2490 | ac_cv_dbopen_libdb="yes", |
2491 | ac_cv_dbopen_libdb="no") | |
32d0bbd7 | 2492 | LIBS="$SAVED_LIBS" |
a258dfca | 2493 | ]) |
2b2161bb | 2494 | if test $ac_cv_dbopen_libdb = yes; then |
32d0bbd7 | 2495 | LIB_DB="-ldb" |
2496 | fi | |
01b4931d | 2497 | AC_SUBST(LIB_DB) |
b7a1c19e | 2498 | |
77f675ad | 2499 | dnl System-specific library modifications |
2500 | dnl | |
2501 | case "$host" in | |
88738790 | 2502 | i386-*-solaris2.*) |
7149a49f | 2503 | if test "$GCC" = "yes"; then |
2504 | echo "Removing -O for gcc on $host" | |
80e92d6d | 2505 | CFLAGS="`echo $CFLAGS | sed -e 's/-O[[0-9]]*//'`" |
7149a49f | 2506 | fi |
2507 | ;; | |
77f675ad | 2508 | *-sgi-irix*) |
2509 | echo "Removing -lsocket for IRIX..." | |
6716b242 | 2510 | LIBS=`echo $LIBS | sed -e s/-lsocket//` |
77f675ad | 2511 | echo "Removing -lnsl for IRIX..." |
6716b242 | 2512 | LIBS=`echo $LIBS | sed -e s/-lnsl//` |
c415c128 | 2513 | ac_cv_lib_nsl_main=no |
b44c0fb4 | 2514 | echo "Removing -lbsd for IRIX..." |
2515 | LIBS=`echo $LIBS | sed -e s/-lbsd//` | |
77f675ad | 2516 | ;; |
4ba0bd0e | 2517 | dnl From: c0032033@ws.rz.tu-bs.de (Joerg Schumacher) |
2518 | dnl Date: Thu, 17 Oct 1996 04:09:30 +0200 | |
2519 | dnl Please change your configure script. AIX doesn't need -lbsd. | |
2520 | *-ibm-aix*) | |
2521 | echo "Removing -lbsd for AIX..." | |
2522 | LIBS=`echo $LIBS | sed -e s/-lbsd//` | |
2523 | ;; | |
30a4f2a8 | 2524 | *m88k*) |
fa035612 | 2525 | SQUID_CFLAGS="$SQUID_CFLAGS -D_SQUID_MOTOROLA_" |
2526 | SQUID_CXXFLAGS="$SQUID_CXXFLAGS -D_SQUID_MOTOROLA_" | |
6a9f6389 | 2527 | AC_DEFINE(GETTIMEOFDAY_NO_TZP,1,[If gettimeofday is known to take only one argument]) |
7149a49f | 2528 | ;; |
580ce039 | 2529 | [*-*-solaris2.[0-4]]) |
6a9f6389 | 2530 | AC_DEFINE(GETTIMEOFDAY_NO_TZP,1) |
30a4f2a8 | 2531 | ;; |
711fa75e | 2532 | [*-sony-newsos[56]*]) |
6a9f6389 | 2533 | AC_DEFINE(GETTIMEOFDAY_NO_TZP,1) |
f62c73dc | 2534 | ;; |
77f675ad | 2535 | esac |
090089c4 | 2536 | |
57faa85a | 2537 | # Remove optimization for GCC 2.95.[123] |
d20b1cd0 | 2538 | # gcc -O[2] on *BSD and Linux (x86) causes pointers to magically become NULL |
2539 | if test "$GCC" = "yes"; then | |
2540 | GCCVER=`$CC -v 2>&1 | awk '$2 == "version" {print $3}'` | |
2541 | case "$GCCVER" in | |
57faa85a | 2542 | [2.95.[123]]) |
d20b1cd0 | 2543 | echo "Removing -O for gcc on $host with GCC $GCCVER" |
2544 | CFLAGS="`echo $CFLAGS | sed -e 's/-O[[0-9]]*//'`" | |
2545 | ;; | |
2546 | esac | |
2547 | fi | |
2548 | ||
176d10ee | 2549 | # Recommended by Balint Nagy Endre <bne@CareNet.hu> |
2550 | case "$host" in | |
2551 | *-univel-sysv4.2MP) | |
2552 | if test `uname -v` = "2.03"; then | |
2553 | echo "disabling mallinfo for $host" | |
2554 | ac_cv_func_mallinfo=no | |
2555 | fi | |
2556 | ;; | |
2557 | esac | |
2558 | ||
84cecfd2 | 2559 | dnl This has to be before AC_CHECK_FUNCS |
2560 | # Disable poll() on certain platforms. Override by setting ac_cv_func_poll | |
2561 | # when running configure. | |
2562 | if test -z "$ac_cv_func_poll"; then | |
2563 | case "$host" in | |
2564 | [alpha-dec-osf3.*]) | |
2565 | # John Kay (jkay@nlanr.net) 19970818 | |
2566 | echo "disabling poll for $host..." | |
2567 | ac_cv_func_poll='no' | |
2568 | ;; | |
2569 | [*-hp-hpux*.*]) | |
2570 | # Duane Wessels | |
2571 | echo "disabling poll for $host..." | |
2572 | ac_cv_func_poll='no' | |
2573 | ;; | |
2574 | [*-linux-*]) | |
f5cec332 | 2575 | # Henrik Nordstrom (hno@squid-cache.org) 19980817 |
9bb83c8b | 2576 | # poll is problematic on Linux. We disable it |
2577 | # by default until Linux gets it right. | |
b6a2f15e | 2578 | rev=`uname -r | awk -F. '{printf "%03d%03d",$1,$2}'` |
2579 | if test $rev -lt 002002; then | |
2580 | echo "disabling poll for $host < 2.2..." | |
2581 | ac_cv_func_poll='no' | |
2582 | fi | |
84cecfd2 | 2583 | ;; |
c68e9c6b | 2584 | [powerpc-ibm-aix4.1.*]) |
2585 | # Mike Laster (mlaster@metavillage.com) 19981021 | |
2586 | echo "disabling poll for $host..." | |
2587 | ac_cv_func_poll='no' | |
2588 | ;; | |
86ec11aa | 2589 | [*-pc-sco3.2*]) |
2590 | # Robert Side <rside@aiinc.bc.ca> | |
2591 | # Mon, 18 Jan 1999 17:48:00 GMT | |
2592 | echo "disabling poll for $host..." | |
2593 | ac_cv_func_poll='no' | |
2594 | ;; | |
84cecfd2 | 2595 | esac |
2596 | fi | |
176d10ee | 2597 | |
08caf8c6 | 2598 | dnl Override statfs() detect on MinGW becasue is emulated in source code |
2599 | case "$host_os" in | |
2600 | mingw|mingw32) | |
2601 | ac_cv_func_statfs='yes' | |
2602 | ;; | |
2603 | esac | |
2604 | ||
6716b242 | 2605 | dnl Check for library functions |
2606 | AC_CHECK_FUNCS(\ | |
ce3d30fb | 2607 | backtrace_symbols_fd \ |
3a144521 | 2608 | bcopy \ |
2609 | bswap_16 \ | |
2610 | bswap_32 \ | |
f9576890 | 2611 | bswap16 \ |
2612 | bswap32 \ | |
4ac29a5b | 2613 | fchmod \ |
6716b242 | 2614 | getdtablesize \ |
8505e57b | 2615 | getpagesize \ |
230c091c | 2616 | getpass \ |
3a144521 | 2617 | getrlimit \ |
30a4f2a8 | 2618 | getrusage \ |
9c1d8929 | 2619 | getspnam \ |
379d5751 | 2620 | gettimeofday \ |
52303a3d | 2621 | glob \ |
f9576890 | 2622 | htobe16 \ |
2623 | htole16 \ | |
d474c7a6 | 2624 | kqueue\ |
30a4f2a8 | 2625 | lrand48 \ |
6716b242 | 2626 | mallinfo \ |
0f5efab0 | 2627 | mallocblksize \ |
6716b242 | 2628 | mallopt \ |
2ae6b9b0 | 2629 | memcpy \ |
30a4f2a8 | 2630 | memmove \ |
dac27377 | 2631 | memset \ |
b99a6dec | 2632 | mkstemp \ |
1812b6c7 | 2633 | mktime \ |
88738790 | 2634 | mstats \ |
84cecfd2 | 2635 | poll \ |
62ae0622 | 2636 | prctl \ |
3a144521 | 2637 | pthread_attr_setschedparam \ |
cd748f27 | 2638 | pthread_attr_setscope \ |
2639 | pthread_setschedparam \ | |
42b51993 | 2640 | pthread_sigmask \ |
c68e9c6b | 2641 | putenv \ |
b1e77ec1 | 2642 | random \ |
6716b242 | 2643 | regcomp \ |
2644 | regexec \ | |
2645 | regfree \ | |
30a4f2a8 | 2646 | res_init \ |
af76ec93 | 2647 | __res_init \ |
4915be3b | 2648 | rint \ |
a4ba1105 | 2649 | sbrk \ |
3a144521 | 2650 | select \ |
234967c9 | 2651 | seteuid \ |
c415c128 | 2652 | setgroups \ |
30a4f2a8 | 2653 | setpgrp \ |
6716b242 | 2654 | setrlimit \ |
30a4f2a8 | 2655 | setsid \ |
2656 | sigaction \ | |
11430c03 | 2657 | snprintf \ |
1ccc0d40 | 2658 | socketpair \ |
30a4f2a8 | 2659 | srand48 \ |
b1e77ec1 | 2660 | srandom \ |
0343b99c | 2661 | statfs \ |
1cd53467 | 2662 | strsep \ |
2733d426 | 2663 | strtoll \ |
6716b242 | 2664 | sysconf \ |
2665 | syslog \ | |
234967c9 | 2666 | timegm \ |
28da5e0d | 2667 | vsnprintf \ |
6716b242 | 2668 | ) |
f5e5c4cf | 2669 | dnl ... and some we provide local replacements for |
2670 | AC_REPLACE_FUNCS(\ | |
2671 | drand48 \ | |
cc192b50 | 2672 | inet_ntop \ |
2673 | inet_pton \ | |
f5e5c4cf | 2674 | initgroups \ |
cc192b50 | 2675 | getaddrinfo \ |
2676 | getnameinfo \ | |
f5e5c4cf | 2677 | strerror \ |
2678 | tempnam \ | |
2679 | ) | |
6716b242 | 2680 | |
d06d566f | 2681 | # check for crypt, may require -lcrypt |
2682 | SAVED_LIBS="$LIBS" | |
2683 | LIBS="$LIBS $CRYPTLIB" | |
2684 | AC_CHECK_FUNCS(crypt) | |
2685 | LIBS="$SAVED_LIBS" | |
2686 | ||
d474c7a6 | 2687 | # Check for libepoll |
2688 | EPOLL_LIB= | |
2689 | AC_CHECK_LIB(epoll, epoll_ctl, [EPOLL_LIBS="-lepoll"]) | |
2690 | AC_SUBST(EPOLL_LIBS) | |
2691 | ||
2692 | # Check for epoll_ctl, may need -lepoll | |
2693 | SAVED_LIBS="$LIBS" | |
2694 | LIBS="$LIBS $LIB_EPOLL" | |
2695 | AC_CHECK_FUNCS(epoll_ctl) | |
2696 | LIBS="$SAVED_LIBS" | |
2697 | ||
2698 | dnl Verify that epoll really works | |
2699 | if test $ac_cv_func_epoll_ctl = yes; then | |
2700 | AC_CACHE_CHECK(if epoll works, ac_cv_epoll_works, | |
2701 | AC_TRY_RUN([ | |
2702 | #include <sys/epoll.h> | |
2703 | #include <stdlib.h> | |
2704 | #include <stdio.h> | |
2705 | int main(int argc, char **argv) | |
2706 | { | |
2707 | int fd = epoll_create(256); | |
2708 | if (fd < 0) { | |
2709 | perror("epoll_create:"); | |
2710 | exit(1); | |
2711 | } | |
2712 | exit(0); | |
2713 | } | |
2714 | ], [ac_cv_epoll_works=yes], [ac_cv_epoll_works=no])) | |
328c40de | 2715 | fi |
d474c7a6 | 2716 | |
1b3db6d9 | 2717 | dnl Magic which checks whether we are forcing a type of comm loop we |
2718 | dnl are actually going to (ab)use | |
2719 | ||
2720 | dnl Actually do the define magic now | |
2721 | dnl mostly ripped from squid-commloops, thanks to adrian and benno | |
2722 | ||
d474c7a6 | 2723 | if test -n "$SELECT_TYPE"; then |
2724 | : # Already decided above. Nothing to do here | |
6564c397 | 2725 | elif test -z "$disable_epoll" && test "$ac_cv_epoll_works" = "yes" ; then |
a46d2c0e | 2726 | SELECT_TYPE="epoll" |
6564c397 | 2727 | elif test -z "$disable_kqueue" && test "$ac_cv_func_kqueue" = "yes" ; then |
2728 | SELECT_TYPE="kqueue" | |
2729 | elif test -z "$disable_poll" && test "$ac_cv_func_poll" = "yes" ; then | |
6c9797b9 | 2730 | SELECT_TYPE="poll" |
6564c397 | 2731 | elif test -z "$disable_select" && test "$ac_cv_func_select" = "yes" ; then |
663c0a38 | 2732 | case "$host_os" in |
2733 | mingw|mingw32) | |
2734 | SELECT_TYPE="select_win32" | |
663c0a38 | 2735 | ;; |
2736 | *) | |
2737 | SELECT_TYPE="select" | |
663c0a38 | 2738 | ;; |
2739 | esac | |
1b3db6d9 | 2740 | else |
a46d2c0e | 2741 | echo "Eep! Can't find poll, kqueue, epoll, or select!" |
1b3db6d9 | 2742 | echo "I'll try select and hope for the best." |
2743 | SELECT_TYPE="select" | |
6a9f6389 | 2744 | AC_DEFINE(USE_SELECT,1) |
1b3db6d9 | 2745 | fi |
d474c7a6 | 2746 | |
2747 | echo "Using ${SELECT_TYPE} for the IO loop." | |
2748 | ||
2749 | AM_CONDITIONAL([USE_POLL], [test $SELECT_TYPE = poll]) | |
2750 | AM_CONDITIONAL([USE_EPOLL], [test $SELECT_TYPE = epoll]) | |
2751 | AM_CONDITIONAL([USE_SELECT], [test $SELECT_TYPE = select]) | |
2752 | AM_CONDITIONAL([USE_SELECT_SIMPLE], [test $SELECT_TYPE = select_simple]) | |
2753 | AM_CONDITIONAL([USE_SELECT_WIN32], [test $SELECT_TYPE = select_win32]) | |
2754 | AM_CONDITIONAL([USE_KQUEUE], [test $SELECT_TYPE = kqueue]) | |
2755 | AM_CONDITIONAL([USE_DEVPOLL], [test $SELECT_TYPE = devpoll]) | |
2756 | ||
2757 | case $SELECT_TYPE in | |
2758 | epoll) | |
2759 | AC_DEFINE(USE_EPOLL,1,[Use epoll() for the IO loop]) | |
2760 | ;; | |
2761 | poll) | |
2762 | AC_DEFINE(USE_POLL,1,[Use poll() for the IO loop]) | |
2763 | ;; | |
2764 | kqueue) | |
2765 | AC_DEFINE(USE_KQUEUE,1,[Use kqueue() for the IO loop]) | |
2766 | ;; | |
2767 | select_win32) | |
2768 | AC_DEFINE(USE_SELECT_WIN32,1,[Use Winsock select() for the IO loop]) | |
2769 | ;; | |
2770 | select) | |
2771 | AC_DEFINE(USE_SELECT,1,[Use select() for the IO loop]) | |
2772 | ;; | |
2773 | esac | |
1b3db6d9 | 2774 | |
2775 | ||
d06d566f | 2776 | |
60939927 | 2777 | dnl Yay! Another Linux brokenness. Its not good enough |
2778 | dnl to know that setresuid() exists, because RedHat 5.0 declares | |
2779 | dnl setresuid() but doesn't implement it. | |
2780 | dnl | |
2781 | AC_CACHE_CHECK(if setresuid is implemented, ac_cv_func_setresuid, | |
5c51415d | 2782 | AC_TRY_RUN([ |
60939927 | 2783 | #include <stdlib.h> |
5c51415d | 2784 | int main() { |
2785 | if(setresuid(-1,-1,-1)) { | |
2786 | perror("setresuid:"); | |
2787 | exit(1); | |
60939927 | 2788 | } |
2789 | exit(0); | |
5c51415d | 2790 | } |
2791 | ],ac_cv_func_setresuid="yes",ac_cv_func_setresuid="no") | |
60939927 | 2792 | ) |
5c51415d | 2793 | if test "$ac_cv_func_setresuid" = "yes" ; then |
6a9f6389 | 2794 | AC_DEFINE(HAVE_SETRESUID,1,[Yay! Another Linux brokenness. Its not good enough to know that setresuid() exists, because RedHat 5.0 declare setresuid() but doesn't implement it.]) |
5c51415d | 2795 | fi |
60939927 | 2796 | |
1cd53467 | 2797 | AM_CONDITIONAL(NEED_OWN_STRSEP, false) |
2798 | if test "$ac_cv_func_strsep" = "no" ; then | |
2799 | AM_CONDITIONAL(NEED_OWN_STRSEP, true) | |
2800 | fi | |
2801 | ||
2733d426 | 2802 | AM_CONDITIONAL(NEED_OWN_STRTOLL, false) |
2803 | if test "$ac_cv_func_strtoll" = "no" ; then | |
2804 | AM_CONDITIONAL(NEED_OWN_STRTOLL, true) | |
2805 | fi | |
2806 | ||
eee79a2e | 2807 | dnl |
2808 | dnl Test for va_copy | |
2809 | dnl | |
2810 | AC_CACHE_CHECK(if va_copy is implemented, ac_cv_func_va_copy, | |
2811 | AC_TRY_RUN([ | |
2812 | #include <stdarg.h> | |
2813 | void f (int i, ...) { | |
2814 | va_list args1, args2; | |
2815 | va_start (args1, i); | |
2816 | va_copy (args2, args1); | |
2817 | if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42) | |
2818 | exit (1); | |
2819 | va_end (args1); va_end (args2); | |
2820 | } | |
2821 | int main() { | |
2822 | f (0, 42); | |
2823 | return 0; | |
2824 | } | |
2825 | ],ac_cv_func_va_copy="yes",ac_cv_func_va_copy="no") | |
2826 | ) | |
2827 | if test "$ac_cv_func_va_copy" = "yes" ; then | |
a45f884d | 2828 | AC_DEFINE(HAVE_VA_COPY, 1, [If your system have va_copy]) |
eee79a2e | 2829 | fi |
2830 | ||
2831 | dnl | |
2832 | dnl Some systems support __va_copy | |
2833 | dnl | |
2834 | AC_CACHE_CHECK(if __va_copy is implemented, ac_cv_func___va_copy, | |
2835 | AC_TRY_RUN([ | |
2836 | #include <stdarg.h> | |
2837 | void f (int i, ...) { | |
2838 | va_list args1, args2; | |
2839 | va_start (args1, i); | |
2840 | __va_copy (args2, args1); | |
2841 | if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42) | |
2842 | exit (1); | |
2843 | va_end (args1); va_end (args2); | |
2844 | } | |
2845 | int main() { | |
2846 | f (0, 42); | |
2847 | return 0; | |
2848 | } | |
2849 | ],ac_cv_func___va_copy="yes",ac_cv_func___va_copy="no") | |
2850 | ) | |
2851 | if test "$ac_cv_func___va_copy" = "yes" ; then | |
a45f884d | 2852 | AC_DEFINE(HAVE___VA_COPY, 1, [Some systems have __va_copy instead of va_copy]) |
eee79a2e | 2853 | fi |
c3d0c8b5 | 2854 | |
5cafc1d6 | 2855 | dnl IP-Filter support requires ipf header files. These aren't |
2856 | dnl installed by default, so we need to check for them | |
2857 | if test "$IPF_TRANSPARENT" ; then | |
2858 | AC_MSG_CHECKING(if IP-Filter header files are installed) | |
42b51993 | 2859 | # hold on to your hats... |
2860 | if test "$ac_cv_header_ip_compat_h" = "yes" || | |
2861 | test "$ac_cv_header_ip_fil_compat_h" = "yes" || | |
87d21d8b | 2862 | test "$ac_cv_header_netinet_ip_compat_h" = "yes" || |
2863 | test "$ac_cv_header_netinet_ip_fil_compat_h" = "yes" ; then | |
42b51993 | 2864 | have_ipfilter_compat_header="yes" |
2865 | fi | |
2866 | if test "x$have_ipfilter_compat_header" = "xyes" && | |
eb824054 | 2867 | test "$ac_cv_header_ip_fil_h" = "yes" && |
2868 | test "$ac_cv_header_ip_nat_h" = "yes" ; then | |
2869 | IPF_TRANSPARENT="yes" | |
2870 | AC_DEFINE(IPF_TRANSPARENT, 1) | |
42b51993 | 2871 | elif test "$have_ipfilter_compat_header" = "yes" && |
eb824054 | 2872 | test "$ac_cv_header_netinet_ip_fil_h" = "yes" && |
2873 | test "$ac_cv_header_netinet_ip_nat_h" = "yes" ; then | |
2874 | IPF_TRANSPARENT="yes" | |
2875 | AC_DEFINE(IPF_TRANSPARENT, 1) | |
2876 | else | |
5cafc1d6 | 2877 | IPF_TRANSPARENT="no" |
2878 | AC_DEFINE(IPF_TRANSPARENT, 0) | |
5cafc1d6 | 2879 | fi |
2880 | AC_MSG_RESULT($IPF_TRANSPARENT) | |
2881 | fi | |
2882 | if test "$IPF_TRANSPARENT" = "no" ; then | |
2883 | echo "WARNING: Cannot find necessary IP-Filter header files" | |
2884 | echo " Transparent Proxy support WILL NOT be enabled" | |
2885 | sleep 10 | |
8f6ca20d | 2886 | elif test "$IPF_TRANSPARENT" = "yes" ; then |
2887 | dnl On Solaris Ipfilter includes expect that SOLARIS2 is defined with the | |
2888 | dnl Solaris minor version (8, 9, 10, ...) | |
2889 | case "$host" in | |
2890 | *-solaris*) | |
2891 | solrev=`uname -r | sh -c 'IFS=. read j n x; echo $n'` | |
2892 | CFLAGS="-DSOLARIS2=$solrev $CFLAGS" | |
20b3ae10 | 2893 | CXXFLAGS="-DSOLARIS2=$solrev $CXXFLAGS" |
8f6ca20d | 2894 | ;; |
2895 | *) | |
2896 | ;; | |
2897 | esac | |
5cafc1d6 | 2898 | fi |
2899 | ||
2b0dd4ac | 2900 | dnl PF support requires a header file. |
2901 | if test "$PF_TRANSPARENT" ; then | |
2902 | AC_MSG_CHECKING(if PF header file is installed) | |
2903 | # hold on to your hats... | |
2904 | if test "$ac_cv_header_net_pfvar_h" = "yes"; then | |
2905 | PF_TRANSPARENT="yes" | |
2906 | AC_DEFINE(PF_TRANSPARENT, 1) | |
2907 | else | |
2908 | PF_TRANSPARENT="no" | |
2909 | AC_DEFINE(PF_TRANSPARENT, 0) | |
2910 | fi | |
2911 | AC_MSG_RESULT($PF_TRANSPARENT) | |
2912 | fi | |
2913 | if test "$PF_TRANSPARENT" = "no" ; then | |
2914 | echo "WARNING: Cannot find necessary PF header file" | |
2915 | echo " Transparent Proxy support WILL NOT be enabled" | |
2916 | sleep 10 | |
2917 | fi | |
2918 | ||
d852fbad | 2919 | dnl Linux-Netfilter support requires Linux 2.4 kernel header files. |
2920 | dnl Shamelessly copied from above | |
2921 | if test "$LINUX_NETFILTER" ; then | |
d6d62546 | 2922 | AC_MSG_CHECKING(if Linux (Netfilter) kernel header files are installed) |
d852fbad | 2923 | # hold on to your hats... |
2924 | if test "$ac_cv_header_linux_netfilter_ipv4_h" = "yes"; then | |
2925 | LINUX_NETFILTER="yes" | |
2926 | AC_DEFINE(LINUX_NETFILTER, 1) | |
2927 | else | |
2928 | LINUX_NETFILTER="no" | |
2929 | AC_DEFINE(LINUX_NETFILTER, 0) | |
2930 | fi | |
2931 | AC_MSG_RESULT($LINUX_NETFILTER) | |
2932 | fi | |
2933 | if test "$LINUX_NETFILTER" = "no" ; then | |
d6d62546 | 2934 | echo "WARNING: Cannot find necessary Linux kernel (Netfilter) header files" |
2935 | echo " Linux Transparent Proxy support WILL NOT be enabled" | |
d852fbad | 2936 | sleep 10 |
2937 | fi | |
2938 | ||
fc68f6b1 | 2939 | dnl Linux Netfilter/TPROXY support requires some specific header files |
2940 | dnl Shamelessly copied from shamelessly copied from above | |
2941 | if test "$LINUX_TPROXY" ; then | |
2942 | AC_MSG_CHECKING(if TPROXY header files are installed) | |
2943 | # hold on to your hats... | |
2944 | if test "$ac_cv_header_linux_netfilter_ipv4_ip_tproxy_h" = "yes" && test "$LINUX_NETFILTER" = "yes"; then | |
2945 | LINUX_TPROXY="yes" | |
2946 | AC_DEFINE(LINUX_TPROXY, 1, [Enable real Transparent Proxy support for Netfilter TPROXY.]) | |
2947 | else | |
2948 | LINUX_TPROXY="no" | |
2949 | AC_DEFINE(LINUX_TPROXY, 0, [Enable real Transparent Proxy support for Netfilter TPROXY.]) | |
2950 | fi | |
2951 | AC_MSG_RESULT($LINUX_TPROXY) | |
2952 | fi | |
2953 | if test "$LINUX_TPROXY" = "no" && test "$LINUX_NETFILTER" = "yes"; then | |
2954 | echo "WARNING: Cannot find TPROXY headers, you need to install the" | |
2955 | echo "tproxy package from:" | |
2956 | echo " - lynx http://www.balabit.com/downloads/tproxy/" | |
2957 | sleep 10 | |
2958 | fi | |
2959 | ||
91bc414e | 2960 | if test -z "$USE_GNUREGEX" ; then |
2961 | case "$host" in | |
2962 | *-sun-solaris2.[[0-4]]) | |
2963 | USE_GNUREGEX="yes" | |
2964 | ;; | |
2965 | *-next-nextstep*) | |
2966 | USE_GNUREGEX="yes" | |
2967 | ;; | |
2968 | esac | |
2969 | fi | |
7a081912 | 2970 | AC_MSG_CHECKING(if GNUregex needs to be compiled) |
91bc414e | 2971 | if test -z "$USE_GNUREGEX"; then |
55878dfd | 2972 | if test "$ac_cv_func_regcomp" = "no" || test "$USE_GNUREGEX" = "yes" ; then |
74946a0f | 2973 | USE_GNUREGEX="yes" |
00fa2c12 | 2974 | else |
0cccc031 | 2975 | AC_TRY_COMPILE([#include <sys/types.h> |
2976 | #include <regex.h>],[regex_t t; regcomp(&t,"",0);], | |
91bc414e | 2977 | USE_GNUREGEX="no", |
2978 | USE_GNUREGEX="yes") | |
2979 | fi | |
00fa2c12 | 2980 | fi |
74946a0f | 2981 | AC_MSG_RESULT($USE_GNUREGEX) |
2982 | if test "$USE_GNUREGEX" = "yes"; then | |
26675bf4 | 2983 | REGEXLIB="-lregex" |
7a081912 | 2984 | LIBREGEX="libregex.a" |
6a9f6389 | 2985 | AC_DEFINE(USE_GNUREGEX,1,[Define if we should use GNU regex]) |
7a081912 | 2986 | fi |
26675bf4 | 2987 | AC_SUBST(REGEXLIB) |
00fa2c12 | 2988 | AC_SUBST(LIBREGEX) |
7a081912 | 2989 | |
5c51415d | 2990 | dnl Not cached since people are likely to tune this |
e924600d | 2991 | AC_MSG_CHECKING(Default FD_SETSIZE value) |
2992 | AC_TRY_RUN([ | |
2993 | #if HAVE_STDIO_H | |
2994 | #include <stdio.h> | |
2995 | #endif | |
2996 | #if HAVE_UNISTD_H | |
2997 | #include <unistd.h> | |
2998 | #endif | |
2999 | #if HAVE_SYS_TIME_H | |
3000 | #include <sys/time.h> | |
3001 | #endif | |
3002 | #if HAVE_SYS_SELECT_H | |
3003 | #include <sys/select.h> | |
3004 | #endif | |
3005 | #if HAVE_SYS_TYPES_H | |
3006 | #include <sys/types.h> | |
3007 | #endif | |
3008 | main() { | |
635e6242 | 3009 | FILE *fp = fopen("conftestval", "w"); |
3010 | fprintf (fp, "%d\n", FD_SETSIZE); | |
e924600d | 3011 | exit(0); |
3012 | } | |
3013 | ], | |
3014 | DEFAULT_FD_SETSIZE=`cat conftestval`, | |
3015 | DEFAULT_FD_SETSIZE=256, | |
3016 | DEFAULT_FD_SETSIZE=256) | |
3017 | AC_MSG_RESULT($DEFAULT_FD_SETSIZE) | |
6a9f6389 | 3018 | AC_DEFINE_UNQUOTED(DEFAULT_FD_SETSIZE, $DEFAULT_FD_SETSIZE, [Default FD_SETSIZE value]) |
e924600d | 3019 | |
f49be7d1 | 3020 | |
5c51415d | 3021 | dnl Not cached since people are likely to tune this |
234967c9 | 3022 | AC_MSG_CHECKING(Maximum number of filedescriptors we can open) |
c76d8acc | 3023 | dnl damn! FreeBSD's pthreads breaks dup2(). |
5132a9eb | 3024 | TLDFLAGS="$LDFLAGS" |
f49be7d1 | 3025 | if test -n "$squid_filedescriptors_num" ; then |
3026 | SQUID_MAXFD=$squid_filedescriptors_num | |
3027 | AC_MSG_RESULT($SQUID_MAXFD (user-forced)) | |
3028 | else | |
f49be7d1 | 3029 | case $host in |
3030 | i386-unknown-freebsd*) | |
3031 | if echo "$LDFLAGS" | grep -q pthread; then | |
3032 | LDFLAGS=`echo $LDFLAGS | sed -e "s/-pthread//"` | |
3033 | fi | |
3034 | esac | |
3035 | AC_TRY_RUN([ | |
8cca06da | 3036 | #include <stdio.h> |
234967c9 | 3037 | #include <unistd.h> |
30a4f2a8 | 3038 | #include <sys/time.h> /* needed on FreeBSD */ |
234967c9 | 3039 | #include <sys/param.h> |
3040 | #include <sys/resource.h> | |
3041 | main() { | |
635e6242 | 3042 | FILE *fp; |
234967c9 | 3043 | int i,j; |
42b51993 | 3044 | #if defined(__CYGWIN32__) || defined (__CYGWIN__) |
b05490a8 | 3045 | /* getrlimit and sysconf returns bogous values on cygwin32. |
df087e68 | 3046 | * Number of fds is virtually unlimited in cygwin (sys/param.h) |
b05490a8 | 3047 | * __CYGWIN32__ is deprecated. |
df087e68 | 3048 | */ |
3049 | i = NOFILE; | |
b05490a8 | 3050 | #else |
3051 | #if HAVE_SETRLIMIT | |
234967c9 | 3052 | struct rlimit rl; |
3053 | #if defined(RLIMIT_NOFILE) | |
3054 | if (getrlimit(RLIMIT_NOFILE, &rl) < 0) { | |
3055 | perror("getrlimit: RLIMIT_NOFILE"); | |
3056 | } else { | |
3057 | rl.rlim_cur = rl.rlim_max; /* set it to the max */ | |
3058 | if (setrlimit(RLIMIT_NOFILE, &rl) < 0) { | |
3059 | perror("setrlimit: RLIMIT_NOFILE"); | |
3060 | } | |
3061 | } | |
3062 | #elif defined(RLIMIT_OFILE) | |
3063 | if (getrlimit(RLIMIT_OFILE, &rl) < 0) { | |
3064 | perror("getrlimit: RLIMIT_OFILE"); | |
3065 | } else { | |
3066 | rl.rlim_cur = rl.rlim_max; /* set it to the max */ | |
3067 | if (setrlimit(RLIMIT_OFILE, &rl) < 0) { | |
3068 | perror("setrlimit: RLIMIT_OFILE"); | |
3069 | } | |
3070 | } | |
3071 | #endif /* RLIMIT_NOFILE */ | |
3072 | #endif /* HAVE_SETRLIMIT */ | |
d9399075 | 3073 | /* by starting at 2^14, we will never get higher |
3074 | than 2^15 for SQUID_MAXFD */ | |
3075 | i = j = 1<<14; | |
3076 | while (j) { | |
3077 | j >>= 1; | |
3078 | if (dup2(0, i) < 0) { | |
3079 | i -= j; | |
3080 | } else { | |
3081 | close(i); | |
3082 | i += j; | |
3083 | } | |
3084 | } | |
3085 | i++; | |
b05490a8 | 3086 | #endif /* IF !DEF CYGWIN */ |
635e6242 | 3087 | fp = fopen("conftestval", "w"); |
a4d7e961 | 3088 | fprintf (fp, "%d\n", i & ~0x3F); |
234967c9 | 3089 | exit(0); |
3090 | } | |
f49be7d1 | 3091 | ], |
3092 | SQUID_MAXFD=`cat conftestval`, | |
3093 | SQUID_MAXFD=256, | |
3094 | SQUID_MAXFD=256) | |
4b26fae9 | 3095 | dnl Microsoft MSVCRT.DLL supports 2048 maximum FDs |
3096 | case "$host_os" in | |
3097 | mingw|mingw32) | |
3098 | SQUID_MAXFD="2048" | |
3099 | ;; | |
3100 | esac | |
f49be7d1 | 3101 | AC_MSG_RESULT($SQUID_MAXFD) |
3102 | fi | |
6a9f6389 | 3103 | AC_DEFINE_UNQUOTED(SQUID_MAXFD, $SQUID_MAXFD,[Maximum number of open filedescriptors]) |
b9cc811d | 3104 | if test "$SQUID_MAXFD" -lt 512 ; then |
80ab193b | 3105 | echo "WARNING: $SQUID_MAXFD may not be enough filedescriptors if your" |
3106 | echo " cache will be very busy. Please see the FAQ page" | |
2b6662ba | 3107 | echo " http://www.squid-cache.org/FAQ/FAQ-11.html#filedescriptors" |
e692ff35 | 3108 | echo " on how to increase your filedescriptor limit" |
933cc58d | 3109 | sleep 10 |
80ab193b | 3110 | fi |
c76d8acc | 3111 | LDFLAGS="$TLDFLAGS" |
234967c9 | 3112 | |
d0f9207a | 3113 | if test `expr $SQUID_MAXFD % 64` != 0; then |
a4d7e961 | 3114 | echo "WARNING: $SQUID_MAXFD is not an multiple of 64. This may cause issues" |
3115 | echo " on certain platforms." | |
3116 | sleep 10 | |
3117 | fi | |
3118 | ||
5c51415d | 3119 | dnl Not cached since people are likely to tune this |
30a4f2a8 | 3120 | AC_MSG_CHECKING(Default UDP send buffer size) |
3121 | AC_TRY_RUN([ | |
8cca06da | 3122 | #include <stdlib.h> |
3123 | #include <stdio.h> | |
30a4f2a8 | 3124 | #include <sys/types.h> |
3125 | #include <sys/socket.h> | |
3126 | #include <netinet/in.h> | |
3127 | main () | |
3128 | { | |
635e6242 | 3129 | FILE *fp; |
30a4f2a8 | 3130 | int fd,val=0,len=sizeof(int); |
3131 | if ((fd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) exit(1); | |
3132 | if (getsockopt(fd, SOL_SOCKET, SO_SNDBUF, &val, &len) < 0) exit(1); | |
3133 | if (val<=0) exit(1); | |
635e6242 | 3134 | fp = fopen("conftestval", "w"); |
3135 | fprintf (fp, "%d\n", val); | |
30a4f2a8 | 3136 | exit(0); |
3137 | } | |
3138 | ], | |
6a9f6389 | 3139 | SQUID_DETECT_UDP_SO_SNDBUF=`cat conftestval`, |
3140 | SQUID_DETECT_UDP_SO_SNDBUF=16384, | |
3141 | SQUID_DETECT_UDP_SO_SNDBUF=16384) | |
3142 | AC_MSG_RESULT($SQUID_DETECT_UDP_SO_SNDBUF) | |
3143 | AC_DEFINE_UNQUOTED(SQUID_DETECT_UDP_SO_SNDBUF, $SQUID_DETECT_UDP_SO_SNDBUF,[UDP send buffer size]) | |
30a4f2a8 | 3144 | |
5c51415d | 3145 | dnl Not cached since people are likely to tune this |
30a4f2a8 | 3146 | AC_MSG_CHECKING(Default UDP receive buffer size) |
3147 | AC_TRY_RUN([ | |
8cca06da | 3148 | #include <stdlib.h> |
3149 | #include <stdio.h> | |
30a4f2a8 | 3150 | #include <sys/types.h> |
3151 | #include <sys/socket.h> | |
3152 | #include <netinet/in.h> | |
3153 | main () | |
3154 | { | |
635e6242 | 3155 | FILE *fp; |
30a4f2a8 | 3156 | int fd,val=0,len=sizeof(int); |
3157 | if ((fd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) exit(1); | |
3158 | if (getsockopt(fd, SOL_SOCKET, SO_RCVBUF, &val, &len) < 0) exit(1); | |
3159 | if (val <= 0) exit(1); | |
635e6242 | 3160 | fp = fopen("conftestval", "w"); |
3161 | fprintf (fp, "%d\n", val); | |
30a4f2a8 | 3162 | exit(0); |
3163 | } | |
3164 | ], | |
6a9f6389 | 3165 | SQUID_DETECT_UDP_SO_RCVBUF=`cat conftestval`, |
3166 | SQUID_DETECT_UDP_SO_RCVBUF=16384, | |
3167 | SQUID_DETECT_UDP_SO_RCVBUF=16384) | |
3168 | AC_MSG_RESULT($SQUID_DETECT_UDP_SO_RCVBUF) | |
3169 | AC_DEFINE_UNQUOTED(SQUID_DETECT_UDP_SO_RCVBUF, $SQUID_DETECT_UDP_SO_RCVBUF,[UDP receive buffer size]) | |
30a4f2a8 | 3170 | |
5c51415d | 3171 | dnl Not cached since people are likely to tune this |
30a4f2a8 | 3172 | AC_MSG_CHECKING(Default TCP send buffer size) |
3173 | AC_TRY_RUN([ | |
8cca06da | 3174 | #include <stdlib.h> |
3175 | #include <stdio.h> | |
30a4f2a8 | 3176 | #include <sys/types.h> |
3177 | #include <sys/socket.h> | |
3178 | #include <netinet/in.h> | |
3179 | main () | |
3180 | { | |
635e6242 | 3181 | FILE *fp; |
30a4f2a8 | 3182 | int fd,val=0,len=sizeof(int); |
3183 | if ((fd = socket(AF_INET, SOCK_STREAM, 0)) < 0) exit(1); | |
3184 | if (getsockopt(fd, SOL_SOCKET, SO_SNDBUF, &val, &len) < 0) exit(1); | |
3185 | if (val <= 0) exit(1); | |
635e6242 | 3186 | fp = fopen("conftestval", "w"); |
3187 | fprintf (fp, "%d\n", val); | |
30a4f2a8 | 3188 | exit(0); |
3189 | } | |
3190 | ], | |
3191 | SQUID_TCP_SO_SNDBUF=`cat conftestval`, | |
1c481e00 | 3192 | SQUID_TCP_SO_SNDBUF=16384, |
3193 | SQUID_TCP_SO_SNDBUF=16384) | |
30a4f2a8 | 3194 | AC_MSG_RESULT($SQUID_TCP_SO_SNDBUF) |
2aa6ca58 | 3195 | if test $SQUID_TCP_SO_SNDBUF -gt 32768; then |
3196 | echo "Limiting send buffer size to 32K" | |
3197 | SQUID_TCP_SO_SNDBUF=32768 | |
3198 | fi | |
6a9f6389 | 3199 | AC_DEFINE_UNQUOTED(SQUID_TCP_SO_SNDBUF, $SQUID_TCP_SO_SNDBUF,[TCP send buffer size]) |
30a4f2a8 | 3200 | |
5c51415d | 3201 | dnl Not cached since people are likely to tune this |
30a4f2a8 | 3202 | AC_MSG_CHECKING(Default TCP receive buffer size) |
3203 | AC_TRY_RUN([ | |
8cca06da | 3204 | #include <stdlib.h> |
3205 | #include <stdio.h> | |
30a4f2a8 | 3206 | #include <sys/types.h> |
3207 | #include <sys/socket.h> | |
3208 | #include <netinet/in.h> | |
3209 | main () | |
3210 | { | |
635e6242 | 3211 | FILE *fp; |
30a4f2a8 | 3212 | int fd,val=0,len=sizeof(int); |
3213 | if ((fd = socket(AF_INET, SOCK_STREAM, 0)) < 0) exit(1); | |
3214 | if (getsockopt(fd, SOL_SOCKET, SO_RCVBUF, &val, &len) < 0) exit(1); | |
3215 | if (val <= 0) exit(1); | |
635e6242 | 3216 | fp = fopen("conftestval", "w"); |
3217 | fprintf (fp, "%d\n", val); | |
30a4f2a8 | 3218 | exit(0); |
3219 | } | |
3220 | ], | |
3221 | SQUID_TCP_SO_RCVBUF=`cat conftestval`, | |
1c481e00 | 3222 | SQUID_TCP_SO_RCVBUF=16384, |
3223 | SQUID_TCP_SO_RCVBUF=16384) | |
30a4f2a8 | 3224 | AC_MSG_RESULT($SQUID_TCP_SO_RCVBUF) |
2aa6ca58 | 3225 | if test $SQUID_TCP_SO_RCVBUF -gt 65535; then |
3226 | echo "Limiting receive buffer size to 64K" | |
3227 | SQUID_TCP_SO_RCVBUF=65535 | |
3228 | fi | |
6a9f6389 | 3229 | AC_DEFINE_UNQUOTED(SQUID_TCP_SO_RCVBUF, $SQUID_TCP_SO_RCVBUF,[TCP receive buffer size]) |
5c51415d | 3230 | AC_CACHE_CHECK(if sys_errlist is already defined, ac_cv_needs_sys_errlist, |
9bc73deb | 3231 | AC_TRY_COMPILE([#include <stdio.h>],[char *s = sys_errlist;], |
5c51415d | 3232 | ac_cv_needs_sys_errlist="no", |
3233 | ac_cv_needs_sys_errlist="yes") | |
3234 | ) | |
3235 | if test "$ac_cv_needs_sys_errlist" = "yes" ; then | |
6a9f6389 | 3236 | AC_DEFINE(NEED_SYS_ERRLIST,1,[If we need to declare sys_errlist[] as external]) |
5c51415d | 3237 | fi |
30a4f2a8 | 3238 | |
5c51415d | 3239 | dnl Not cached since people are likely to change this |
6bf65235 | 3240 | AC_MSG_CHECKING(for libresolv _dns_ttl_ hack) |
3241 | AC_TRY_LINK(extern int _dns_ttl_;,return _dns_ttl_;, | |
3242 | [AC_MSG_RESULT(yes) | |
6a9f6389 | 3243 | AC_DEFINE(LIBRESOLV_DNS_TTL_HACK,1,[If libresolv.a has been hacked to export _dns_ttl_])], |
6bf65235 | 3244 | AC_MSG_RESULT(no)) |
3245 | ||
a937d5e3 | 3246 | AC_MSG_CHECKING(if inet_ntoa() actually works) |
3247 | AC_TRY_RUN([ | |
3248 | #include <stdlib.h> | |
3249 | #include <stdio.h> | |
3250 | #include <sys/types.h> | |
3251 | #include <netinet/in.h> | |
3252 | #include <arpa/inet.h> | |
3253 | main () | |
3254 | { | |
635e6242 | 3255 | FILE *fp; |
a937d5e3 | 3256 | struct in_addr in; |
3257 | in.s_addr = inet_addr("1.2.3.4"); | |
635e6242 | 3258 | fp = fopen("conftestval", "w"); |
3259 | fprintf (fp, "%s\n", inet_ntoa(in)); | |
a937d5e3 | 3260 | exit(0); |
3261 | } | |
3262 | ], | |
3263 | INET_NTOA_RESULT=`cat conftestval`, | |
3264 | INET_NTOA_RESULT="broken", | |
3265 | INET_NTOA_RESULT="broken") | |
3266 | if test "$INET_NTOA_RESULT" = "1.2.3.4" ; then | |
3267 | AC_MSG_RESULT("yes") | |
3268 | else | |
3269 | AC_MSG_RESULT("no") | |
4b26fae9 | 3270 | case "$host_os" in |
3271 | mingw|mingw32) | |
3272 | echo "Using Win32 resolver instead." | |
3273 | ;; | |
f5e5c4cf | 3274 | *) |
4b26fae9 | 3275 | echo "Will use our own inet_ntoa()." |
3276 | AC_LIBOBJ(inet_ntoa) | |
3277 | # echo "WARNING: This looks bad, and probably prevents Squid from working." | |
3278 | # echo " If you're on IRIX and using GCC 2.8, you probably need" | |
3279 | # echo " to use the IRIX C compiler instead." | |
3280 | # sleep 10 | |
3281 | ;; | |
3282 | esac | |
a937d5e3 | 3283 | fi |
3284 | ||
b6a2f15e | 3285 | if test "$ac_cv_header_sys_statvfs_h" = "yes" ; then |
c68e9c6b | 3286 | AC_MSG_CHECKING(for working statvfs() interface) |
3287 | AC_TRY_COMPILE([ | |
3288 | #include <stdlib.h> | |
3289 | #include <stdio.h> | |
3290 | #include <sys/types.h> | |
3291 | #include <sys/statvfs.h> | |
3292 | ], | |
3293 | [ | |
3294 | struct statvfs sfs; | |
3295 | sfs.f_blocks = sfs.f_bfree = sfs.f_frsize = | |
3296 | sfs.f_files = sfs.f_ffree = 0; | |
3297 | statvfs("/tmp", &sfs); | |
3298 | ], | |
3299 | ac_cv_func_statvfs=yes, | |
3300 | ac_cv_func_statvfs=no) | |
3301 | AC_MSG_RESULT($ac_cv_func_statvfs) | |
6b8e7481 | 3302 | if test "$ac_cv_func_statvfs" = "yes" ; then |
6a9f6389 | 3303 | AC_DEFINE(HAVE_STATVFS,1,[If your system has statvfs(), and if it actually works!]) |
b6a2f15e | 3304 | fi |
6b8e7481 | 3305 | fi |
c68e9c6b | 3306 | |
cc192b50 | 3307 | dnl Detect what resolver fields we have available to use... |
3308 | AC_CACHE_CHECK(for _res_ext.nsaddr_list, ac_cv_have_res_ext_nsaddr_list, | |
3309 | AC_TRY_COMPILE([ | |
3310 | #if HAVE_SYS_TYPES_H | |
3311 | #include <sys/types.h> | |
3312 | #endif | |
3313 | #if HAVE_NETINET_IN_H | |
3314 | #include <netinet/in.h> | |
3315 | #endif | |
3316 | #if HAVE_ARPA_INET_H | |
3317 | #include <arpa/inet.h> | |
3318 | #endif | |
3319 | #if HAVE_ARPA_NAMESER_H | |
3320 | #include <arpa/nameser.h> | |
3321 | #endif | |
3322 | #if HAVE_RESOLV_H | |
3323 | #include <resolv.h> | |
3324 | #endif | |
3325 | ], | |
3326 | [_res_ext.nsaddr_list[[0]].s_addr;], | |
3327 | ac_cv_have_res_ext_nsaddr_list="yes", | |
3328 | ac_cv_have_res_ext_nsaddr_list="no")) | |
3329 | if test "$ac_cv_have_res_ext_nsaddr_list" = "yes" ; then | |
3330 | AC_DEFINE(_SQUID_RES_NSADDR6_LARRAY,_res_ext.nsaddr_list,[If _res_ext structure has nsaddr_list member]) | |
3331 | AC_DEFINE(_SQUID_RES_NSADDR6_COUNT,ns6count,[Nameserver Counter for IPv6 _res_ext]) | |
3332 | fi | |
3333 | ||
3334 | if test "$_SQUID_RES_NSADDR6_LIST" == ""; then | |
3335 | AC_CACHE_CHECK(for _res._u._ext.nsaddrs, ac_cv_have_res_ext_nsaddrs, | |
3336 | AC_TRY_COMPILE([ | |
3337 | #if HAVE_SYS_TYPES_H | |
3338 | #include <sys/types.h> | |
3339 | #endif | |
3340 | #if HAVE_NETINET_IN_H | |
3341 | #include <netinet/in.h> | |
3342 | #endif | |
3343 | #if HAVE_ARPA_INET_H | |
3344 | #include <arpa/inet.h> | |
3345 | #endif | |
3346 | #if HAVE_ARPA_NAMESER_H | |
3347 | #include <arpa/nameser.h> | |
3348 | #endif | |
3349 | #if HAVE_RESOLV_H | |
3350 | #include <resolv.h> | |
3351 | #endif | |
3352 | ], | |
3353 | [_res._u._ext.nsaddrs[[0]]->sin6_addr;], | |
3354 | ac_cv_have_res_ext_nsaddrs="yes", | |
3355 | ac_cv_have_res_ext_nsaddrs="no")) | |
3356 | if test "$ac_cv_have_res_ext_nsaddrs" = "yes" ; then | |
3357 | AC_DEFINE(_SQUID_RES_NSADDR6_LPTR,_res._u._ext.nsaddrs,[If _res structure has _ext.nsaddrs member]) | |
3358 | AC_DEFINE(_SQUID_RES_NSADDR6_COUNT,_res._u._ext.nscount6,[Nameserver Counter for IPv6 _res]) | |
3359 | fi | |
3360 | fi | |
3361 | ||
c68e9c6b | 3362 | AC_CACHE_CHECK(for _res.nsaddr_list, ac_cv_have_res_nsaddr_list, |
3363 | AC_TRY_COMPILE([ | |
3364 | #if HAVE_SYS_TYPES_H | |
3365 | #include <sys/types.h> | |
3366 | #endif | |
3367 | #if HAVE_NETINET_IN_H | |
3368 | #include <netinet/in.h> | |
3369 | #endif | |
3370 | #if HAVE_ARPA_INET_H | |
3371 | #include <arpa/inet.h> | |
3372 | #endif | |
3373 | #if HAVE_ARPA_NAMESER_H | |
3374 | #include <arpa/nameser.h> | |
3375 | #endif | |
3376 | #if HAVE_RESOLV_H | |
3377 | #include <resolv.h> | |
3378 | #endif | |
3379 | ], | |
3380 | [_res.nsaddr_list[[0]];], | |
3381 | ac_cv_have_res_nsaddr_list="yes", | |
3382 | ac_cv_have_res_nsaddr_list="no")) | |
3383 | if test $ac_cv_have_res_nsaddr_list = "yes" ; then | |
cc192b50 | 3384 | AC_DEFINE(_SQUID_RES_NSADDR_LIST,_res.nsaddr_list,[If _res structure has nsaddr_list member]) |
3385 | AC_DEFINE(_SQUID_RES_NSADDR_COUNT,_res.nscount,[Nameserver counter for IPv4 _res]) | |
c68e9c6b | 3386 | fi |
3387 | ||
cc192b50 | 3388 | if test "$_SQUID_RES_NSADDR_LIST" == ""; then |
c68e9c6b | 3389 | AC_CACHE_CHECK(for _res.ns_list, ac_cv_have_res_ns_list, |
3390 | AC_TRY_COMPILE([ | |
3391 | #if HAVE_SYS_TYPES_H | |
3392 | #include <sys/types.h> | |
3393 | #endif | |
3394 | #if HAVE_NETINET_IN_H | |
3395 | #include <netinet/in.h> | |
3396 | #endif | |
3397 | #if HAVE_ARPA_INET_H | |
3398 | #include <arpa/inet.h> | |
3399 | #endif | |
3400 | #if HAVE_ARPA_NAMESER_H | |
3401 | #include <arpa/nameser.h> | |
3402 | #endif | |
3403 | #if HAVE_RESOLV_H | |
3404 | #include <resolv.h> | |
3405 | #endif | |
3406 | ], | |
3407 | [_res.ns_list[[0]].addr;], | |
3408 | ac_cv_have_res_ns_list="yes", | |
3409 | ac_cv_have_res_ns_list="no")) | |
3410 | if test $ac_cv_have_res_ns_list = "yes" ; then | |
cc192b50 | 3411 | AC_DEFINE(_SQUID_RES_NSADDR_LIST,_res.ns_list,[If _res structure has ns_list member]) |
3412 | AC_DEFINE(_SQUID_RES_NSADDR_COUNT,_res.nscount,[Nameserver counter for IPv4 _res]) | |
c68e9c6b | 3413 | fi |
3414 | fi | |
3415 | ||
090089c4 | 3416 | dnl Need the debugging version of malloc if available |
3417 | XTRA_OBJS='' | |
6509a1a0 | 3418 | if test "$ac_cv_lib_malloc_main" = "yes" ; then |
090089c4 | 3419 | if test -r /usr/lib/debug/malloc.o ; then |
3420 | XTRA_OBJS="$XTRA_OBJS /usr/lib/debug/malloc.o" | |
3421 | fi | |
3422 | if test -r /usr/lib/debug/mallocmap.o ; then | |
3423 | XTRA_OBJS="$XTRA_OBJS /usr/lib/debug/mallocmap.o" | |
3424 | fi | |
3425 | fi | |
2bbd722b | 3426 | |
090089c4 | 3427 | AC_SUBST(XTRA_OBJS) |
3428 | ||
38fea766 | 3429 | if test -z "$XTRA_LIBS"; then |
3430 | XTRA_LIBS="$LIBS" | |
0f5a16f8 | 3431 | dnl minor cleanup |
3432 | XTRA_LIBS=`echo $XTRA_LIBS | sed -e "s/ */ /g"` | |
38fea766 | 3433 | LIBS='' |
3434 | fi | |
090089c4 | 3435 | AC_SUBST(XTRA_LIBS) |
3436 | ||
090089c4 | 3437 | dnl Clean up after OSF/1 core dump bug |
3438 | rm -f core | |
3439 | ||
6a9f6389 | 3440 | AC_CONFIG_FILES([\ |
a2794549 | 3441 | Makefile \ |
3442 | lib/Makefile \ | |
a2794549 | 3443 | scripts/Makefile \ |
3444 | scripts/RunCache \ | |
3445 | scripts/RunAccel \ | |
3446 | src/Makefile \ | |
3447 | src/fs/Makefile \ | |
3448 | src/repl/Makefile \ | |
3449 | src/auth/Makefile \ | |
a2794549 | 3450 | contrib/Makefile \ |
3451 | snmplib/Makefile \ | |
3452 | icons/Makefile \ | |
3453 | errors/Makefile \ | |
1077c1b8 | 3454 | test-suite/Makefile \ |
99db07b3 | 3455 | doc/Makefile \ |
0c510f3c | 3456 | helpers/Makefile \ |
3457 | helpers/basic_auth/Makefile \ | |
3458 | helpers/basic_auth/LDAP/Makefile \ | |
3459 | helpers/basic_auth/MSNT/Makefile \ | |
3460 | helpers/basic_auth/NCSA/Makefile \ | |
3461 | helpers/basic_auth/PAM/Makefile \ | |
3462 | helpers/basic_auth/SMB/Makefile \ | |
6e785d85 | 3463 | helpers/basic_auth/mswin_sspi/Makefile \ |
0c510f3c | 3464 | helpers/basic_auth/YP/Makefile \ |
3465 | helpers/basic_auth/getpwnam/Makefile \ | |
3466 | helpers/basic_auth/multi-domain-NTLM/Makefile \ | |
3467 | helpers/basic_auth/SASL/Makefile \ | |
bcf74be7 | 3468 | helpers/basic_auth/POP3/Makefile \ |
002d9b03 | 3469 | helpers/basic_auth/DB/Makefile \ |
d80aac12 | 3470 | helpers/basic_auth/squid_radius_auth/Makefile \ |
0c510f3c | 3471 | helpers/digest_auth/Makefile \ |
3472 | helpers/digest_auth/password/Makefile \ | |
55013f9c | 3473 | helpers/digest_auth/ldap/Makefile \ |
89f77e43 | 3474 | helpers/digest_auth/eDirectory/Makefile \ |
0c510f3c | 3475 | helpers/ntlm_auth/Makefile \ |
3476 | helpers/ntlm_auth/fakeauth/Makefile \ | |
3477 | helpers/ntlm_auth/no_check/Makefile \ | |
3478 | helpers/ntlm_auth/SMB/Makefile \ | |
3479 | helpers/ntlm_auth/SMB/smbval/Makefile \ | |
6e785d85 | 3480 | helpers/ntlm_auth/mswin_sspi/Makefile \ |
3481 | helpers/negotiate_auth/Makefile \ | |
3482 | helpers/negotiate_auth/mswin_sspi/Makefile \ | |
3e5d7cdf | 3483 | helpers/negotiate_auth/squid_kerb_auth/Makefile \ |
c6588c68 | 3484 | helpers/external_acl/Makefile \ |
3485 | helpers/external_acl/ip_user/Makefile \ | |
3486 | helpers/external_acl/ldap_group/Makefile \ | |
74ab8d10 | 3487 | helpers/external_acl/session/Makefile \ |
c6588c68 | 3488 | helpers/external_acl/unix_group/Makefile \ |
736a9a4d | 3489 | helpers/external_acl/wbinfo_group/Makefile \ |
94ab55b0 | 3490 | helpers/external_acl/mswin_lm_group/Makefile \ |
3491 | tools/Makefile | |
53cbe3e4 | 3492 | ]) |
43ae1d95 | 3493 | |
377792e4 | 3494 | AC_CONFIG_SUBDIRS(lib/libTrie) |
3495 | ||
6a9f6389 | 3496 | AC_OUTPUT |