]> git.ipfire.org Git - thirdparty/squid.git/blob - configure.in
Merge from trunk
[thirdparty/squid.git] / configure.in
1 dnl Configuration input file for Squid
2 dnl
3 dnl $Id$
4 dnl
5 dnl
6 dnl
7 AC_INIT([Squid Web Proxy],[3.HEAD-BZR],[http://www.squid-cache.org/bugs/],[squid])
8 AC_PREREQ(2.61)
9 AC_CONFIG_HEADERS([include/autoconf.h])
10 AC_CONFIG_AUX_DIR(cfgaux)
11 AC_CONFIG_SRCDIR([src/main.cc])
12 AM_INIT_AUTOMAKE([tar-ustar nostdinc])
13 AC_REVISION($Revision$)dnl
14 AC_PREFIX_DEFAULT(/usr/local/squid)
15 AM_MAINTAINER_MODE
16
17 PRESET_CFLAGS="$CFLAGS"
18 PRESET_LDFLAGS="$LDFLAGS"
19
20 dnl Set default LDFLAGS
21 if test -z "$LDFLAGS"; then
22 LDFLAGS="-g"
23 fi
24
25 dnl Check for GNU cc
26 AC_PROG_CC
27 AM_PROG_CC_C_O
28 AC_PROG_CXX
29 AC_LANG([C++])
30 AC_CANONICAL_HOST
31
32 dnl Make the squid top srcdir available to sub-packages as --with-squid=PATH
33 new_configure_args="$ac_configure_args --with-squid=$ac_abs_confdir"
34 ac_configure_args="$new_configure_args"
35
36
37 use_loadable_modules=1
38 AC_MSG_CHECKING(whether to use loadable modules)
39 AC_ARG_ENABLE(loadable-modules,
40 AS_HELP_STRING([--disable-loadable-modules],[do not support loadable modules]) ,
41 [
42 case "${enableval}" in
43 yes) use_loadable_modules=yes ;;
44 no) use_loadable_modules=no ;;
45 *) AC_MSG_ERROR(bad value ${enableval} for --disable-loadable-modules) ;;
46 esac
47 AC_MSG_RESULT([$use_loadable_modules, explicitly])
48 ],
49 [
50 use_loadable_modules=yes;
51 AC_MSG_RESULT([$use_loadable_modules, implicitly])
52 ]
53 )
54
55 AM_CONDITIONAL(USE_LOADABLE_MODULES, test $use_loadable_modules = yes)
56
57 if test $use_loadable_modules = yes;
58 then
59 AC_DEFINE(USE_LOADABLE_MODULES, 1, [Support Loadable Modules])
60 AC_ENABLE_SHARED
61 else
62 AC_DISABLE_SHARED
63 fi
64
65 AC_LIBTOOL_DLOPEN
66 if test $use_loadable_modules = yes;
67 then
68 AC_LIBLTDL_CONVENIENCE(lib/libLtdl)
69 fi
70 AC_PROG_LIBTOOL
71 AC_LTDL_DLLIB
72
73 # Do we need these unconditionally for "make distcheck" to work?
74 AC_SUBST(INCLTDL)
75 AC_SUBST(LIBLTDL)
76
77 if test $use_loadable_modules = yes;
78 then
79 # Why is this needed? Should not libtool's AC_LIBTOOL_DLOPEN do that?
80 LIBADD_DL=${lt_cv_dlopen_libs}
81 AC_SUBST([LIBADD_DL])
82 fi
83
84 AC_PROG_RANLIB
85
86
87 CRYPTLIB=''
88 REGEXLIB='' # -lregex
89 # LIBREGEX='' # libregex.a
90
91 dnl find out the exe extension for this platform. If it's not empty, use it for CGI's as well.
92 AC_EXEEXT
93 AC_OBJEXT
94
95 if test -z "$EXEEXT"; then
96 CGIEXT=".cgi"
97 else
98 # automake automatically adds .exe when installing binaries
99 CGIEXT=""
100 fi
101 AC_SUBST(CGIEXT)
102
103 dnl this should be expanded to a list of platform sensible support requirements.
104 dnl (adding an option like --enable-cygwin-support doesn't make sense :]) - R Collins 2001
105 case "$host_os" in
106 mingw|mingw32|cygwin|cygwin32)
107 AM_CONDITIONAL(ENABLE_WIN32SPECIFIC, true)
108 ;;
109 *)
110 AM_CONDITIONAL(ENABLE_WIN32SPECIFIC, false)
111 ;;
112 esac
113
114 case "$host_os" in
115 mingw|mingw32)
116 AC_PATH_PROG(WIN32_PSAPI, psapi.dll, none)
117 CFLAGS="$CFLAGS -mthreads"
118 CXXFLAGS="$CXXFLAGS -mthreads"
119 if test "$ac_cv_path_WIN32_PSAPI" = "none"; then
120 AC_MSG_NOTICE([PSAPI.DLL is recommended to run Squid on Windows NT Platform])
121 AC_MSG_NOTICE([Please see PSAPI.DLL section on doc/win32-relnotes.html.])
122 else
123 AC_DEFINE(HAVE_WIN32_PSAPI,1,[Define if you have PSAPI.DLL on Windows systems])
124 LIBS="$LIBS -lpsapi"
125 fi
126 MINGW_LIBS="-lmingwex"
127 AM_CONDITIONAL(USE_IPC_WIN32, true)
128 AC_SUBST(MINGW_LIBS)
129 ;;
130 *)
131 AM_CONDITIONAL(USE_IPC_WIN32, false)
132 ;;
133 esac
134
135 if test -z "$CACHE_HTTP_PORT"; then
136 CACHE_HTTP_PORT="3128"
137 fi
138 if test -z "$CACHE_ICP_PORT"; then
139 CACHE_ICP_PORT="3130"
140 fi
141
142 dnl Substitutions
143 AC_DEFINE_UNQUOTED(CACHE_HTTP_PORT, $CACHE_HTTP_PORT,
144 [What default TCP port to use for HTTP listening?])
145 AC_SUBST(CACHE_HTTP_PORT)
146 AC_DEFINE_UNQUOTED(CACHE_ICP_PORT, $CACHE_ICP_PORT,
147 [What default UDP port to use for ICP listening?])
148 AC_SUBST(CACHE_ICP_PORT)
149
150 AC_DEFINE_UNQUOTED(CONFIG_HOST_TYPE, "$host",[Host type from configure])
151
152 AC_DEFINE_UNQUOTED(SQUID_CONFIGURE_OPTIONS, "$ac_configure_args", [configure command line used to configure Squid])
153
154 CACHE_EFFECTIVE_USER="nobody"
155 AC_ARG_WITH(default-user,
156 AS_HELP_STRING([--with-default-user=USER],[System user account for squid permissions. Default: nobody]),
157 [ CACHE_EFFECTIVE_USER="$withval" ]
158 )
159 AC_SUBST(CACHE_EFFECTIVE_USER)
160
161 DEFAULT_LOG_DIR="$localstatedir/logs"
162 AC_ARG_WITH(logdir,
163 AS_HELP_STRING([--with-logdir=PATH],[Default location for squid logs. default: $DEFAULT_LOG_DIR]),
164 [ case $withval in
165 yes|no)
166 AC_MSG_ERROR( --with-logdir requires a directory PATH. --with-logdir=PATH )
167 ;;
168 *)
169 DEFAULT_LOG_DIR="$withval"
170 ;;
171 esac
172 ]
173 )
174 AC_SUBST(DEFAULT_LOG_DIR)
175
176 DEFAULT_PIDFILE="$localstatedir/squid.pid"
177 AC_ARG_WITH(pidfile,
178 AS_HELP_STRING([--with-pidfile=PATH],[Default location for squid PID file. default: $DEFAULT_PIDFILE]),
179 [ case $withval in
180 yes|no)
181 AC_MSG_ERROR( --with-pidfile requires a file PATH. --with-pidfile=PATH )
182 ;;
183 *)
184 DEFAULT_PIDFILE="$withval"
185 ;;
186 esac
187 ]
188 )
189 AC_SUBST(DEFAULT_PIDFILE)
190
191 dnl Gerben Wierda <Gerben_Wierda@RnA.nl>
192 case "$host" in
193 mab-next-nextstep3)
194 CC="$CC -arch m68k -arch i486 -arch hppa -arch sparc"
195 ;;
196 esac
197
198 if test "$GCC" = "yes"; then
199 GCCVER=`$CC -v 2>&1 | awk '$2 == "version" {print $3}'`
200 GCCVER2=`echo $GCCVER | awk '{print $1 * 100}'`
201 case "$host" in
202 i386-*-freebsd*)
203 if test $GCCVER2 -lt 300 ; then
204 AC_MSG_FAILURE([GCC $GCCVER causes a coredump on $host. Try a more recent GCC version])
205 sleep 5
206 fi
207 ;;
208 esac
209 unset GCCVER
210 unset GCCVER2
211 fi
212
213 dnl Set Default CFLAGS
214 if test -z "$PRESET_CFLAGS"; then
215 if test "$GCC" = "yes"; then
216 case "$host" in
217 *-sun-sunos*)
218 # sunos has too many warnings for this to be useful
219 # motorola too
220 ;;
221 *m88k*)
222 # Motorola cc/ld does not like -02 but is ok on -O
223 CFLAGS=`echo $CFLAGS | sed -e 's/-O[0-9]/-O/'`
224 ;;
225 *)
226 CFLAGS="-Wall $CFLAGS"
227 ;;
228 esac
229 else
230 case "$host" in
231 *mips-sgi-irix6.*)
232 # suggested by Rafael Seidl <rafaels@cthulhu.engr.sgi.com>
233 CFLAGS="-O3 -OPT:Olimit=0:space=OFF \
234 -woff 1009,1014,1110,1116,1183,1185,1188,1204,1230,1233,1355 \
235 -Wl,-woff,85,-woff,84,-woff,134 \
236 -nostdinc -I/usr/include -D_BSD_SIGNALS $CFLAGS"
237 CXXFLAGS="-O3 -OPT:Olimit=0:space=OFF \
238 -woff 1009,1014,1110,1116,1183,1185,1188,1204,1230,1233,1355 \
239 -Wl,-woff,85,-woff,84,-woff,134 \
240 -nostdinc -I/usr/include -D_BSD_SIGNALS $CXXFLAGS"
241 ;;
242 alpha-dec-osf4.*)
243 # Mogul says DEC compilers take both -g and -O2
244 CFLAGS=`echo $CFLAGS | sed -e 's/-g/-g3/'`
245 CFLAGS="-O2 $CFLAGS"
246 ;;
247 *)
248 ;;
249 esac
250 fi
251 fi
252
253 dnl set squid required flags
254 if test "$GCC" = "yes"; then
255 dnl Guido Serassio (serassio@squid-cache.org) 20070811
256 dnl Using the latest MinGW (gcc 3.4.5 + mingw-runtime 3.13) cannot build with
257 dnl -Werror -Wmissing-prototypes -Wmissing-declarations
258 dnl TODO: check if the problem will be present in any other newer MinGW release.
259 case "$host_os" in
260 mingw|mingw32)
261 SQUID_CFLAGS="-Wall -Wpointer-arith -Wwrite-strings -Wcomments"
262 ;;
263 *)
264 SQUID_CFLAGS="-Werror -Wall -Wpointer-arith -Wwrite-strings -Wmissing-prototypes -Wmissing-declarations -Wcomments"
265 ;;
266 esac
267 SQUID_CXXFLAGS="-Werror -Wall -Wpointer-arith -Wwrite-strings -Wcomments"
268 else
269 SQUID_CFLAGS=
270 SQUID_CXXFLAGS=
271 fi
272 AC_SUBST(SQUID_CFLAGS)
273 AC_SUBST(SQUID_CXXFLAGS)
274
275 AC_TEST_CHECKFORHUGEOBJECTS
276 SQUID_CXXFLAGS="$SQUID_CXXFLAGS $HUGE_OBJECT_FLAG"
277
278 dnl Set LDFLAGS
279 if test -z "$PRESET_LDFLAGS"; then
280 if test "$GCC" = "yes"; then
281 case "$host" in
282 *mips-sgi-irix6.*)
283 # Silence Linker warnings 84, 85 and 134
284 LDFLAGS="-Wl,-woff,85 -Wl,-woff,84 -Wl,-woff,134 $LDFLAGS"
285 ;;
286 *)
287 # nothing
288 ;;
289 esac
290 else
291 case "$host" in
292 *)
293 # nothing
294 ;;
295 esac
296 fi
297 fi
298
299 SquidInline="yes"
300
301 AC_ARG_ENABLE(optimizations,
302 AS_HELP_STRING([--disable-optimizations],[Don't compile Squid with compiler optimizations enabled.
303 Optimization is good for production builds, but not
304 good for debugging. During development, use
305 --disable-optimizations to reduce compilation times
306 and allow easier debugging. This option implicitly
307 also enabled --disable-inline]),
308 [ if test "$enableval" = "no" ; then
309 AC_MSG_NOTICE([Disabling compiler optimizations (-O flag)])
310 CFLAGS="`echo $CFLAGS | sed -e 's/-O[[0-9]]*//'`"
311 CXXFLAGS="`echo $CXXFLAGS | sed -e 's/-O[[0-9]]*//'`"
312 SquidInline="no"
313 fi
314 ])
315
316 AC_ARG_ENABLE(inline,
317 AS_HELP_STRING([--disable-inline],[Don't compile trivial methods as inline. Squid
318 is coded with much of the code able to be inlined.
319 Inlining is good for production builds, but not
320 good for development. During development, use
321 --disable-inline to reduce compilation times and
322 allow incremental builds to be quick. For
323 production builds, or load tests, use
324 --enable-inline to have squid make all trivial
325 methods inlinable by the compiler.]),
326 [ if test "$enableval" = "no" ; then
327 SquidInline="no"
328 fi
329 ])
330
331 if test "$SquidInline" = "yes" ; then
332 AC_DEFINE(_SQUID_INLINE_, inline, [Keyword used by squid for inlining methods])
333 AC_DEFINE(_USE_INLINE_,, [Include inline methods into header file])
334 else
335 AC_MSG_NOTICE([Inlining optimization disabled])
336 AC_DEFINE(_SQUID_INLINE_,, [Keyword used by squid for inlining methods])
337 fi
338
339 AC_ARG_ENABLE(debug-cbdata,
340 AS_HELP_STRING([--enable-debug-cbdata],[Provide some debug information in cbdata]),
341 [ if test "$enableval" = "yes" ; then
342 AC_MSG_NOTICE([cbdata debugging enabled])
343 AC_DEFINE(CBDATA_DEBUG,1,[Enable for cbdata debug information])
344 fi
345 ])
346
347 dnl Nasty hack to get autoconf 2.64 on Linux to run.
348 dnl all other uses of RUN_IFELSE are wrapped inside CACHE_CHECK which breaks on 2.64
349 AC_RUN_IFELSE([AC_LANG_SOURCE([[ int main(int argc, char **argv) { return 0; } ]])],[],[],[])
350
351 dnl This is a developer only option.. developers know how to set defines
352 dnl
353 dnl AC_ARG_ENABLE(xmalloc-debug,
354 dnl [ --enable-xmalloc-debug Do some simple malloc debugging],
355 dnl [ if test "$enableval" = "yes" ; then
356 dnl AC_MSG_NOTICE([malloc debugging enabled])
357 dnl AC_DEFINE(XMALLOC_DEBUG,1,[Define to do simple malloc debugging])
358 dnl fi
359 dnl ])
360
361 dnl This is a developer only option.. developers know how to set defines
362 dnl
363 dnl AC_ARG_ENABLE(xmalloc-debug-trace,
364 dnl [ --enable-xmalloc-debug-trace
365 dnl Detailed trace of memory allocations],
366 dnl [ if test "$enableval" = "yes" ; then
367 dnl AC_MSG_NOTICE([malloc debug trace enabled])
368 dnl AC_DEFINE(XMALLOC_TRACE,1,[Define to have a detailed trace of memory allocations])
369 dnl AC_DEFINE(XMALLOC_DEBUG,1)
370 dnl fi
371 dnl ])
372
373 AC_ARG_ENABLE(xmalloc-statistics,
374 AS_HELP_STRING([--enable-xmalloc-statistics],[Show malloc statistics in status page]),
375 [ if test "$enableval" = "yes" ; then
376 AC_MSG_NOTICE([malloc statistics enabled])
377 AC_DEFINE(XMALLOC_STATISTICS,1,[Define to have malloc statistics])
378 fi
379 ])
380
381 AC_ARG_ENABLE(async-io,
382 AS_HELP_STRING([--enable-async-io[=N_THREADS]],[Shorthand for "--with-aufs-threads=N_THREADS --with-pthreads
383 --enable-storeio=ufs,aufs"]),
384 [ case $enableval in
385 yes)
386 with_pthreads="yes"
387 STORE_MODULES="ufs aufs"
388 ;;
389 no)
390 ;;
391 *)
392 aufs_io_threads=$enableval
393 with_pthreads="yes"
394 STORE_MODULES="ufs aufs"
395 ;;
396 esac
397 ])
398
399 AC_ARG_WITH(aufs-threads,
400 AS_HELP_STRING([--with-aufs-threads=N_THREADS],[Tune the number of worker threads for the aufs object store.]),
401 [ case $withval in
402 [[0-9]]*)
403 aufs_io_threads=$withval
404 ;;
405 *)
406 AC_MSG_ERROR(--with-aufs-threads expects a numeric argument)
407 ;;
408 esac
409 ])
410 if test "$aufs_io_threads"; then
411 AC_MSG_NOTICE([With $aufs_io_threads aufs threads])
412 AC_DEFINE_UNQUOTED(AUFS_IO_THREADS,$aufs_io_threads,
413 [Defines how many threads aufs uses for I/O])
414 fi
415
416 AC_ARG_WITH(dl,
417 AS_HELP_STRING([--with-dl],[Use dynamic linking]))
418 if test "$with_dl" = "yes"; then
419 AC_MSG_NOTICE([With dl])
420 fi
421
422 AC_ARG_ENABLE(disk-io,
423 AS_HELP_STRING([--enable-disk-io="list of modules"],[Build support for the list of disk I/O modules.
424 Set without a value or omitted, all available modules will be built.
425 See src/DiskIO for a list of available modules, or
426 Programmers Guide section on DiskIO
427 for details on how to build your custom disk module]),
428 [ case $enableval in
429 yes)
430 for dir in $srcdir/src/DiskIO/*; do
431 module="`basename $dir`"
432 if test -d "$dir" && test "$module" != CVS; then
433 AC_MSG_NOTICE([Autodetected $module DiskIO module])
434 MAYBE_DISK_MODULES="$MAYBE_DISK_MODULES $module"
435 fi
436 done
437 AC_DEFINE(USE_DISKIO,1,[DiskIO modules are expected to be available.])
438 ;;
439 no)
440 AC_DEFINE(USE_DISKIO,0,[DiskIO modules are expected to be available.])
441 ;;
442 *)
443 MAYBE_DISK_MODULES=" `echo $enableval| sed -e 's/,/ /g;s/ */ /g'` "
444 AC_DEFINE(USE_DISKIO,1,[DiskIO modules are expected to be available.])
445 ;;
446 esac
447 ],
448 [ if test -z "$MAYBE_DISK_MODULES"; then
449 AC_MSG_NOTICE([Enabling all available DiskIO modules (default)...])
450 for dir in $srcdir/src/DiskIO/*; do
451 module="`basename $dir`"
452 if test -d "$dir" && test "$module" != CVS; then
453 AC_MSG_NOTICE([Autodetected $module DiskIO module])
454 MAYBE_DISK_MODULES="$MAYBE_DISK_MODULES $module"
455 fi
456 done
457 AC_DEFINE(USE_DISKIO,1,[DiskIO modules are expected to be available.])
458 fi ])
459
460 dnl Some autoconf.h defines we might enable later...
461 AC_DEFINE(USE_DISKIO_AIO, 0, [Whether POSIX AIO support is needed. Automatic])
462 AC_DEFINE(USE_DISKIO_DISKTHREADS, 0, [Whether pthreads support is needed. Automatic])
463 USE_AIOPS_WIN32=0
464 use_aio=
465 use_diskthreads=
466 AIOLIB=
467
468 dnl Setup the module paths etc.
469 FOUND_DISKIO_AIO=
470 FOUND_DISKIO_BLOCKING=
471 FOUND_DISKIO_DISKDAEMON=
472 FOUND_DISKIO_DISKTHREADS=
473 DISK_LIBS=
474 DISK_MODULES=
475 DISK_LINKOBJS=
476 for module in $MAYBE_DISK_MODULES none; do
477 if test "$module" = "none"; then
478 continue
479 fi
480 if ! test -d $srcdir/src/DiskIO/$module; then
481 AC_MSG_ERROR(disk-io $module does not exist)
482 fi
483 case "$module" in
484 DiskDaemon)
485 if test "$FOUND_DISKIO_DISKDAEMON" = "yes" ; then
486 AC_MSG_ERROR([DiskIO DiskDaemon module listed twice.])
487 fi
488 FOUND_DISKIO_DISKDAEMON="yes"
489 AC_MSG_NOTICE([Enabling DiskDaemon DiskIO module])
490 DISK_LIBS="$DISK_LIBS libDiskDaemon.a"
491 DISK_MODULES="$DISK_MODULES DiskDaemon"
492 DISK_PROGRAMS="$DISK_PROGRAMS DiskIO/DiskDaemon/diskd"
493 DISK_LINKOBJS="$DISK_LINKOBJS DiskIO/DiskDaemon/DiskDaemonDiskIOModule.o"
494 ;;
495 DiskThreads)
496 if test "$FOUND_DISKIO_DISKTHREADS" = "yes" ; then
497 AC_MSG_ERROR([DiskIO DiskThreads module listed twice.])
498 fi
499 FOUND_DISKIO_DISKTHREADS="yes"
500 use_diskthreads="yes"
501 LIBPTHREADS=
502 SAVE_SQUID_CFLAGS="$SQUID_CFLAGS"
503 SAVE_SQUID_CXXFLAGS="$SQUID_CXXFLAGS"
504 AC_ARG_WITH(pthreads,AS_HELP_STRING([--without-pthreads],[Disable POSIX Threads]))
505 if test "$with_pthreads" != "no"; then
506 dnl TODO: this needs to be extended to handle more systems and better
507 dnl REF: http://www.openldap.org/lists/openldap-bugs/200006/msg00070.html
508 dnl REF: http://autoconf-archive.cryp.to/acx_pthread.html
509 case "$host" in
510 mingw|mingw32)
511 USE_AIOPS_WIN32=1
512 AC_MSG_NOTICE([Windows threads support automatically enabled])
513 ;;
514 i386-unknown-freebsd*)
515 SQUID_CFLAGS="$SQUID_CFLAGS -D_REENTRANT"
516 SQUID_CXXFLAGS="$SQUID_CXXFLAGS -D_REENTRANT"
517 if test "$GCC" = "yes" ; then
518 if test -z "$PRESET_LDFLAGS"; then
519 LDFLAGS="$LDFLAGS -pthread"
520 fi
521 fi
522 ;;
523 *-solaris2.*)
524 if test "$GCC" = "yes" ; then
525 SQUID_CFLAGS="$SQUID_CFLAGS -D_REENTRANT -pthreads"
526 SQUID_CXXFLAGS="$SQUID_CXXFLAGS -D_REENTRANT -pthreads"
527 AC_CHECK_LIB(pthread, main,[LIBPTHREADS="-lpthread"],
528 [ AC_MSG_NOTICE(pthread library required but cannot be found.)
529 use_diskthreads="no"
530 ])
531 else
532 dnl test for -lpthread first. libc version is a stub apparently on Solaris.
533 SQUID_CFLAGS="$SQUID_CFLAGS -D_REENTRANT -lpthread"
534 SQUID_CXXFLAGS="$SQUID_CXXFLAGS -D_REENTRANT -lpthread"
535 AC_CHECK_LIB(pthread, main,[LIBPTHREADS="-lpthread"],
536 [ SQUID_CFLAGS="$SAVE_SQUID_CFLAGS -D_REENTRANT -lpthread -mt"
537 SQUID_CXXFLAGS="$SAVE_SQUID_CXXFLAGS -D_REENTRANT -lpthread -mt"
538 AC_CHECK_LIB(pthread, main,[LIBPTHREADS="-lpthread"],
539 [ AC_MSG_NOTICE(pthread library required but cannot be found.)
540 use_diskthreads="no"
541 ])
542 ])
543 fi
544 ;;
545 *)
546 SQUID_CFLAGS="$SQUID_CFLAGS -D_REENTRANT"
547 SQUID_CXXFLAGS="$SQUID_CXXFLAGS -D_REENTRANT"
548 AC_CHECK_LIB(pthread, main,[DISK_LIBS="$DISK_LIBS -lpthread"],
549 [ AC_MSG_NOTICE(pthread library required but cannot be found.)
550 use_diskthreads="no"
551 ])
552 ;;
553 esac
554 else
555 AC_MSG_NOTICE([Native pthreads support manually disabled.])
556 use_diskthreads="no"
557 fi
558 if test "$use_diskthreads" = "yes" ; then
559 AC_DEFINE(USE_DISKIO_DISKTHREADS, 1, [Whether pthreads support is needed. Automatic])
560 AC_MSG_NOTICE([Enabling DiskThreads DiskIO module])
561 DISK_LIBS="$DISK_LIBS $LIBPTHREADS libDiskThreads.a"
562 DISK_MODULES="$DISK_MODULES DiskThreads"
563 DISK_LINKOBJS="$DISK_LINKOBJS DiskIO/DiskThreads/DiskThreadsDiskIOModule.o"
564 else
565 AC_DEFINE(USE_DISKIO_DISKTHREADS, 0, [Whether pthreads support is needed. Automatic])
566 AC_MSG_NOTICE([Native pthreads support disabled. DiskThreads module automaticaly disabled.])
567 SQUID_CFLAGS="$SAVE_SQUID_CFLAGS"
568 SQUID_CXXFLAGS="$SAVE_SQUID_CXXFLAGS"
569 fi
570 ;;
571
572 AIO)
573 if test "$FOUND_DISKIO_AIO" = "yes" ; then
574 AC_MSG_ERROR([DiskIO AIO module listed twice.])
575 fi
576 FOUND_DISKIO_AIO="yes"
577 dnl Check for POSIX AIO availability
578 use_aio="yes"
579 AIOLIB=
580 AC_ARG_WITH(aio, AS_HELP_STRING([--without-aio],[Do not use POSIX AIO. Default: auto-detect]))
581 if test "$with_aio" != "no"; then
582 have_aio_header=no
583 AC_CHECK_HEADERS(aio.h,[have_aio_header=yes])
584 dnl On some systems POSIX AIO functions are in librt
585 dnl On some systems POSIX AIO functions are in libaio
586 AC_CHECK_LIB(rt,aio_read,[AIOLIB="-lrt"],AC_CHECK_LIB(aio,aio_read,[AIOLIB="-laio"],[]))
587 dnl Enable AIO if the library and headers are found
588 if test "$AIOLIB" != "" && test "$have_aio_header" = "yes"; then
589 AC_MSG_NOTICE([Native POSIX AIO support detected.])
590 use_aio="yes"
591 else
592 dnl Windows does things differently. We provide wrappers.
593 dnl TODO: Windows really needs its own DiskIO module or its Overlaped IO
594 case "$host_os" in
595 mingw|mingw32)
596 use_aio="yes"
597 AC_MSG_NOTICE([Windows being built. Maybe-enable POSIX AIO.])
598 ;;
599 *)
600 AC_MSG_NOTICE([Native POSIX AIO support not detected. AIO automatically disabled.])
601 use_aio="no"
602 ;;
603 esac
604 fi
605 else
606 AC_MSG_NOTICE([POSIX AIO support manually disabled.])
607 use_aio="no"
608 fi
609 dnl Use the POSIX AIO pieces if we actually need them.
610 if test "$use_aio" = "yes" ; then
611 AC_DEFINE(USE_DISKIO_AIO, 1, [Whether POSIX AIO support is needed. Automatic])
612 DISK_MODULES="$DISK_MODULES AIO"
613 DISK_LIBS="$DISK_LIBS libAIO.a"
614 DISK_LINKOBJS="$DISK_LINKOBJS DiskIO/AIO/AIODiskIOModule.o"
615 case "$host_os" in
616 mingw|mingw32)
617 USE_AIO_WIN32=1
618 AC_MSG_NOTICE([Replacing AIO DiskIO module with: Windows overlapped I/O support])
619 ;;
620 *)
621 AC_MSG_NOTICE([Enabling AIO DiskIO module])
622 ;;
623 esac
624 else
625 AC_MSG_NOTICE([AIO DiskIO Module disabled. Missing POSIX AIO support.])
626 fi
627 ;;
628
629 Blocking)
630 if test "$FOUND_DISKIO_BLOCKING" = "yes" ; then
631 AC_MSG_ERROR([DiskIO Blocking module listed twice.])
632 fi
633 FOUND_DISKIO_BLOCKING="yes"
634 AC_MSG_NOTICE([Enabling Blocking DiskIO module])
635 DISK_LIBS="$DISK_LIBS libBlocking.a"
636 DISK_MODULES="$DISK_MODULES Blocking"
637 DISK_LINKOBJS="$DISK_LINKOBJS DiskIO/Blocking/BlockingDiskIOModule.o"
638 ;;
639
640 *)
641 AC_MSG_NOTICE([Enabling $module DiskIO module])
642 DISK_LIBS="$DISK_LIBS lib${module}.a"
643 DISK_MODULES="$DISK_MODULES ${module}"
644 DISK_LINKOBJS="$DISK_LINKOBJS DiskIO/${module}/${module}DiskIOModule.o"
645 ;;
646 esac
647 done
648 AC_MSG_NOTICE([IO Modules built: $DISK_MODULES])
649 AC_SUBST(DISK_MODULES)
650 AC_SUBST(DISK_LIBS)
651 AC_SUBST(DISK_PROGRAMS)
652 AC_SUBST(DISK_LINKOBJS)
653 AC_SUBST(AIOLIB)
654 AM_CONDITIONAL([USE_AIOPS_WIN32], [test "$USE_AIOPS_WIN32" = 1])
655 AM_CONDITIONAL([USE_AIO_WIN32], [test "$USE_AIO_WIN32" = 1])
656
657
658 dnl Check what Storage formats are wanted.
659 dnl This version will error out with a message saying why if a required DiskIO is missing.
660 AC_ARG_ENABLE(storeio,
661 AS_HELP_STRING([--enable-storeio="list of modules"],[Build support for the list of store I/O modules.
662 The default is only to build the "ufs" module.
663 See src/fs for a list of available modules, or
664 Programmers Guide section <not yet written>
665 for details on how to build your custom store module]),
666 [ case $enableval in
667 yes)
668 for dir in $srcdir/src/fs/*; do
669 module="`basename $dir`"
670 if test -d "$dir" && test "$module" != CVS && test "$module" != coss; then
671 STORE_MODULES="$STORE_MODULES $module"
672 fi
673 done
674 ;;
675 no)
676 ;;
677 *)
678 STORE_MODULES="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`"
679 ;;
680 esac
681 ],
682 [ if test -z "$STORE_MODULES"; then
683 STORE_MODULES="ufs"
684 fi
685 ])
686 if test -n "$STORE_MODULES"; then
687 dnl ensure that all modules a) exist and b) only include once.
688 STORE_MODULES_FULL=$STORE_MODULES
689 STORE_MODULES=
690 for module in $STORE_MODULES_FULL; do
691 have_mod=`echo "$STORE_MODULES" | grep "$module"`
692 if test "$have_mod" != ""; then
693 AC_MSG_NOTICE([Removing duplicate $module from storeio])
694 elif test -d $srcdir/src/fs/$module; then
695 STORE_MODULES="$STORE_MODULES $module"
696 else
697 AC_MSG_ERROR(storeio $module does not exist)
698 fi
699 done
700 for module in $STORE_MODULES_FULL; do
701 case "$module" in
702 coss)
703 echo "WARNING: COSS Support is not stable yet in Squid-3. Please do not use."
704 sleep 10
705 ;;
706 esac
707 done
708 AC_MSG_NOTICE([Store modules built: $STORE_MODULES])
709 fi
710 for fs in $STORE_MODULES none; do
711 case "$fs" in
712 diskd)
713 if ! test "$FOUND_DISKIO_BLOCKING" = "yes" && ! test "$FOUND_DISKIO_DISKDAEMON" = "yes" ; then
714 AC_MSG_ERROR([Storage diskd module requires DiskIO modules: Blocking or DiskDaemon])
715 fi
716 NEED_UFS="true"
717 ;;
718 aufs)
719 if ! test "$FOUND_DISKIO_BLOCKING" = "yes" && ! test "$FOUND_DISKIO_DISKTHREADS" = "yes" ; then
720 AC_MSG_ERROR([Storage diskd module requires DiskIO modules: Blocking or DiskThreads])
721 fi
722 NEED_UFS="true"
723 ;;
724 coss)
725 if ! test "$FOUND_DISKIO_AIO" = "yes"; then
726 AC_MSG_ERROR([COSS requires POSIX AIO which is not available.])
727 fi
728 dnl
729 dnl Automake om MinGW needs explicit exe extension
730 dnl for STORE_TESTS substition
731 dnl
732 STORE_TESTS="$STORE_TESTS tests/testCoss$EXEEXT"
733 ;;
734 ufs)
735 UFS_FOUND="true"
736 STORE_TESTS="$STORE_TESTS tests/testUfs$EXEEXT"
737 esac
738 done
739
740 if test -z "$UFS_FOUND" && test -n "$NEED_UFS"; then
741 AC_MSG_NOTICE([Adding UFS, as it contains core logic for diskd and aufs])
742 STORE_MODULES="$STORE_MODULES ufs"
743 dnl
744 dnl Automake om MinGW needs explicit exe extension
745 dnl for STORE_TESTS substition
746 dnl
747 STORE_TESTS="$STORE_TESTS tests/testUfs$EXEEXT"
748 fi
749
750 AH_TEMPLATE(HAVE_FS_UFS, "Define to 1 if ufs filesystem module is build")
751 AH_TEMPLATE(HAVE_FS_AUFS, "Define to 1 if aufs filesystem module is build")
752 AH_TEMPLATE(HAVE_FS_DISKD, "Define to 1 if diskd filesystem module is build")
753 AH_TEMPLATE(HAVE_FS_COSS, "Define to 1 if coss filesystem module is build")
754
755
756 dnl got final STORE_MODULES, build library lists
757 dnl This list will not be needed when each fs library has its own Makefile
758 STORE_LIBS_TO_BUILD=
759 dnl File system libraries to link executables with.
760 dnl These are the same as STORE_LIBS_TO_BUILD, but with a path
761 STORE_LIBS_TO_ADD=
762 for fs in $STORE_MODULES; do
763 STORE_LIBS_TO_BUILD="$STORE_LIBS_TO_BUILD lib${fs}.la"
764 STORE_LIBS_TO_ADD="$STORE_LIBS_TO_ADD fs/lib${fs}.la"
765 HAVE_FS_TYPE=HAVE_FS_`echo $fs | sed 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
766 AC_DEFINE_UNQUOTED($HAVE_FS_TYPE, 1)
767 done
768
769 AC_SUBST(STORE_LIBS_TO_BUILD)
770 AC_SUBST(STORE_LIBS_TO_ADD)
771 AC_SUBST(STORE_TESTS)
772
773
774 dnl At lest one removal policy is always needed.
775 dnl 'lru' removal policy is currently hard-coded by name for tests
776 dnl so we must set it as default.
777 REPL_POLICIES="lru"
778 AC_ARG_ENABLE(removal-policies,
779 AS_HELP_STRING([--enable-removal-policies="list of policies"],[Build support for the list of removal policies.
780 The default is only to build the "lru" module.
781 See src/repl for a list of available modules, or
782 Programmers Guide section 9.9 for details on how
783 to build your custom policy]),
784 [ case $enableval in
785 yes)
786 for dir in $srcdir/src/repl/*; do
787 module="`basename $dir`"
788 if test -d "$dir" && test "$module" != CVS && test "$module" != "lru"; then
789 REPL_POLICIES="$REPL_POLICIES $module"
790 fi
791 done
792 ;;
793 no)
794 ;;
795 *)
796 REPL_POLICIES="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`"
797 ;;
798 esac
799 ])
800 if test -n "$REPL_POLICIES"; then
801 for module in $REPL_POLICIES; do
802 if test -d $srcdir/src/repl/$module; then
803 :
804 else
805 AC_MSG_ERROR(Removal policy $module does not exist)
806 fi
807 done
808 AC_MSG_NOTICE([Removal policies built: $REPL_POLICIES])
809 REPL_OBJS="repl/lib`echo $REPL_POLICIES|sed -e 's% %.a repl/lib%g'`.a"
810 REPL_LIBS="`echo $REPL_OBJS|sed -e 's%repl/%%g'`"
811 fi
812 AC_SUBST(REPL_POLICIES)
813 AC_SUBST(REPL_OBJS)
814 AC_SUBST(REPL_LIBS)
815
816 AM_CONDITIONAL(ENABLE_PINGER, false)
817 AC_ARG_ENABLE(icmp,
818 AS_HELP_STRING([--enable-icmp],[Enable ICMP pinging and Network Measurement]),
819 [ if test "$enableval" = "yes" ; then
820 AC_MSG_NOTICE([ICMP enabled])
821 AC_DEFINE(USE_ICMP,1,[Define to use Squid's ICMP and Network Measurement features (highly recommended!)])
822 AM_CONDITIONAL(ENABLE_PINGER, true)
823 fi
824 ])
825
826 AM_CONDITIONAL(USE_DELAY_POOLS, false)
827 AC_ARG_ENABLE(delay-pools,
828 AS_HELP_STRING([--enable-delay-pools],[Enable delay pools to limit bandwidth usage]),
829 [ if test "$enableval" = "yes" ; then
830 AC_MSG_NOTICE([Delay pools enabled])
831 AC_DEFINE([DELAY_POOLS],1,[Traffic management via "delay pools".])
832 AM_CONDITIONAL(USE_DELAY_POOLS, true,)
833 fi
834 ])
835
836 dnl disable generic/common adaptation support by default
837 use_adaptation=no
838
839 AM_CONDITIONAL(USE_ESI, false)
840 AC_ARG_ENABLE(esi,
841 AS_HELP_STRING([--enable-esi],[Enable ESI for accelerators. Requires libexpat.
842 Enabling ESI will cause squid to follow the
843 Edge Acceleration Specification (www.esi.org).
844 This causes squid to IGNORE client Cache-Control headers.
845 DO NOT use this in a squid configured as a web proxy,
846 ONLY use it in a squid configured for webserver acceleration.]),
847 use_esi=$enableval, use_esi=no)
848 if test "$use_esi" = "yes" ; then
849 AC_DEFINE(USE_SQUID_ESI,1,[Compile the ESI processor and Surrogate header support])
850 AM_CONDITIONAL(USE_ESI, true)
851
852 dnl Perform configuration consistency checks for ESI
853 dnl ESI support requires libexpat
854 AC_CHECK_LIB([expat], [main],
855 [ESI_LIBS="-lexpat"],
856 [AC_MSG_FAILURE([ESI support requires libexpat library, but no usable library was found])]
857 )
858 AC_CHECK_LIB([xml2], [main],
859 [ESI_LIBS="-lxml2"],
860 [AC_MSG_FAILURE([ESI support requires libxml2 library, but no usable library was found])]
861 )
862 XTRA_LIBS="$XTRA_LIBS -lexpat -lxml2"
863
864 else
865 AC_DEFINE(USE_SQUID_ESI,0,[Compile the ESI processor and Surrogate header support])
866 fi
867
868 AM_CONDITIONAL(USE_ICAP_CLIENT, false)
869 AC_ARG_ENABLE(icap-client,
870 AS_HELP_STRING([--enable-icap-client],[Enable the ICAP client.]),
871 use_icap_client=$enableval, use_icap_client=no)
872 if test "$use_icap_client" = "yes" ; then
873 AC_DEFINE(ICAP_CLIENT,1,[Enable ICAP client features in Squid])
874 AM_CONDITIONAL(USE_ICAP_CLIENT, true)
875 ICAP_LIBS="icap/libicap.la"
876 use_adaptation=yes
877 else
878 AC_DEFINE(ICAP_CLIENT,0,[Enable ICAP client features in Squid])
879 ICAP_LIBS=""
880 fi
881 AC_SUBST(ICAP_LIBS)
882
883 use_ecap=1
884 AC_MSG_CHECKING(whether to support eCAP)
885 AC_ARG_ENABLE(ecap,
886 AS_HELP_STRING([--enable-ecap],[support loadable content adaptation modules]),
887 [
888 case "${enableval}" in
889 yes) use_ecap=yes ;;
890 no) use_ecap=no ;;
891 *) AC_MSG_ERROR(bad value ${enableval} for --enable-ecap) ;;
892 esac
893 AC_MSG_RESULT([$use_ecap, explicitly])
894 ],
895 [
896 use_ecap=no;
897 AC_MSG_RESULT([$use_ecap, implicitly])
898 ]
899 )
900
901 dnl Perform configuration consistency checks for eCAP
902 ECAPLIB=""
903 if test $use_ecap = yes;
904 then
905 dnl eCAP support requires loadable modules, which are enabled by default
906 if test "$use_loadable_modules" != "yes"
907 then
908 AC_MSG_ERROR([eCAP support requires loadable modules. Please do not use --disable-loadable-modules with --enable-ecap.]);
909 fi
910
911 dnl eCAP support requires libecap
912 AC_CHECK_LIB([ecap], [main],
913 [ECAPLIB="-lecap"],
914 [AC_MSG_FAILURE([eCAP support requires libecap library, but no usable library was found])]
915 )
916 fi
917
918 AM_CONDITIONAL(USE_ECAP, test $use_ecap = yes)
919 if test $use_ecap = yes;
920 then
921 AC_DEFINE(USE_ECAP,1,[Enable eCAP support])
922 ECAP_LIBS="ecap/libecap.la $ECAP_LIBS"
923 use_adaptation=yes
924 else
925 AC_DEFINE(USE_ECAP,0,[Disable eCAP support])
926 ECAP_LIBS=""
927 fi
928 dnl convenience library
929 AC_SUBST(ECAP_LIBS)
930 dnl -lecap if needed
931 AC_SUBST(ECAPLIB)
932
933
934 dnl enable adaptation if requested by specific adaptation mechanisms
935 AM_CONDITIONAL(USE_ADAPTATION, test $use_adaptation = yes)
936 if test $use_adaptation = yes
937 then
938 AC_DEFINE(USE_ADAPTATION,1,[common adaptation support])
939 ADAPTATION_LIBS="adaptation/libadaptation.la"
940 else
941 AC_DEFINE(USE_ADAPTATION,0,[common adaptation support])
942 ADAPTATION_LIBS=""
943 fi
944 AC_SUBST(ADAPTATION_LIBS)
945
946
947 dnl This is a developer only option. Developers know how to set defines
948 dnl
949 dnl AC_ARG_ENABLE(mem-gen-trace,
950 dnl [ --enable-mem-gen-trace Do trace of memory stuff],
951 dnl [ if test "$enableval" = "yes" ; then
952 dnl AC_MSG_NOTICE([Memory trace (to file) enabled])
953 dnl AC_DEFINE(MEM_GEN_TRACE,1,[Define for log file trace of mem alloc/free])
954 dnl fi
955 dnl ])
956
957 AC_ARG_ENABLE(useragent-log,
958 AS_HELP_STRING([--enable-useragent-log],[Enable logging of User-Agent header]),
959 [ if test "$enableval" = "yes" ; then
960 AC_MSG_NOTICE([User-Agent logging enabled])
961 AC_DEFINE(USE_USERAGENT_LOG,1,[If you want to log User-Agent request header values, define this.
962 By default, they are written to useragent.log in the Squid log
963 directory.])
964 fi
965 ])
966
967 AC_ARG_ENABLE(referer-log,
968 AS_HELP_STRING([--enable-referer-log],[Enable logging of Referer header]),
969 [ if test "$enableval" = "yes" ; then
970 AC_MSG_NOTICE([Referer logging enabled])
971 AC_DEFINE(USE_REFERER_LOG,1,[If you want to log Referer request header values, define this.
972 By default, they are written to referer.log in the Squid log
973 directory.])
974 fi
975 ])
976
977 USE_WCCP=1
978 AC_ARG_ENABLE(wccp,
979 AS_HELP_STRING([--disable-wccp],[Disable Web Cache Coordination Protocol]),
980 [ if test "$enableval" = "no" ; then
981 AC_MSG_NOTICE([Web Cache Coordination Protocol disabled])
982 USE_WCCP=0
983 fi
984 ])
985 if test $USE_WCCP = 1; then
986 AC_DEFINE(USE_WCCP, 1, [Define to enable WCCP])
987 fi
988
989 USE_WCCPv2=1
990 AC_ARG_ENABLE(wccpv2,
991 AS_HELP_STRING([--disable-wccpv2],[Disable Web Cache Coordination V2 Protocol]),
992 [ if test "$enableval" = "no" ; then
993 AC_MSG_NOTICE(["Web Cache Coordination V2 Protocol disabled])
994 USE_WCCPv2=0
995 fi
996 ])
997 if test $USE_WCCPv2 = 1; then
998 AC_DEFINE(USE_WCCPv2, 1, [Define to enable WCCP V2])
999 fi
1000
1001 AC_ARG_ENABLE(kill-parent-hack,
1002 AS_HELP_STRING([--enable-kill-parent-hack],[Kill parent on shutdown]),
1003 [ if test "$enableval" = "yes" ; then
1004 AC_MSG_NOTICE([Kill parent on shutdown])
1005 AC_DEFINE(KILL_PARENT_OPT,1,[A dangerous feature which causes Squid to kill its parent process
1006 (presumably the RunCache script) upon receipt of SIGTERM or SIGINT.
1007 Use with caution.])
1008 fi
1009 ])
1010
1011 USE_SNMP=true
1012 AC_ARG_ENABLE(snmp,
1013 AS_HELP_STRING([--disable-snmp],[Disable SNMP monitoring support]),
1014 [ if test "$enableval" = "no" ; then
1015 AC_MSG_NOTICE([SNMP monitoring disabled])
1016 USE_SNMP=
1017 fi
1018 ])
1019 if test x"$USE_SNMP" = xtrue; then
1020 AC_DEFINE(SQUID_SNMP,1,[Define to enable SNMP monitoring of Squid])
1021 SNMPLIB='../snmplib/libsnmp.a'
1022 makesnmplib=snmplib
1023 fi
1024 AM_CONDITIONAL(USE_SNMP, [test x$USE_SNMP = xtrue])
1025 AC_SUBST(SNMPLIB)
1026 AC_SUBST(makesnmplib)
1027
1028 AC_ARG_ENABLE(cachemgr-hostname,
1029 AS_HELP_STRING([--enable-cachemgr-hostname=hostname],[Make cachemgr.cgi default to this host.
1030 If unspecified, uses the name of the build-host]),
1031 [ case $enableval in
1032 yes)
1033 AC_DEFINE(CACHEMGR_HOSTNAME,[getfullhostname()],
1034 [If you are upset that the cachemgr.cgi form comes up with the hostname field blank, then define this to getfullhostname()])
1035 AC_MSG_NOTICE([Cachemgr default hostname == host where cachemgr runs])
1036 ;;
1037 no)
1038 : # Nothing to do..
1039 ;;
1040 *)
1041 AC_DEFINE_UNQUOTED(CACHEMGR_HOSTNAME,"${enableval}")
1042 AC_MSG_NOTICE([Cachemgr default hostname set to ${enableval}])
1043 ;;
1044 esac
1045 ])
1046
1047 AM_CONDITIONAL(ENABLE_ARP_ACL, false)
1048 AC_ARG_ENABLE(arp-acl,
1049 AS_HELP_STRING([--enable-arp-acl],[Enable use of ARP ACL lists (ether address)]),
1050 [ if test "$enableval" = "yes" ; then
1051 AC_MSG_NOTICE([ARP ACL lists enabled (ether address)])
1052 case "$host" in
1053 *-linux-*)
1054 ;;
1055 *-solaris*)
1056 ;;
1057 *-freebsd*)
1058 ;;
1059 *-openbsd*)
1060 ;;
1061 *-netbsd*)
1062 ;;
1063 *-cygwin*)
1064 LIBS="$LIBS -liphlpapi"
1065 ;;
1066 *-mingw*)
1067 LIBS="$LIBS -liphlpapi"
1068 ;;
1069 *)
1070 AC_MSG_WARN([ARP ACL support probably won't work on $host.])
1071 sleep 10
1072 ;;
1073 esac
1074 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, ?).])
1075 AM_CONDITIONAL(ENABLE_ARP_ACL, true)
1076 fi
1077 ])
1078
1079 USE_HTCP=true
1080 AM_CONDITIONAL(ENABLE_HTCP, false)
1081 AC_ARG_ENABLE(htcp,
1082 AS_HELP_STRING([--disable-htcp],[Disable HTCP protocol support]),
1083 [ if test "$enableval" = "no" ; then
1084 AC_MSG_NOTICE([HTCP support disabled])
1085 fi
1086 ])
1087 if test x$USE_HTCP = xtrue; then
1088 AC_DEFINE(USE_HTCP,1, [Define this to include code for the Hypertext Cache Protocol (HTCP)])
1089 fi
1090 AM_CONDITIONAL(ENABLE_HTCP, [test x$USE_HTCP = xtrue])
1091
1092 dnl SSL is not enabled by default.
1093 AM_CONDITIONAL(ENABLE_SSL, false)
1094
1095 dnl Default is to use OpenSSL when available
1096 AC_ARG_ENABLE(ssl,
1097 AS_HELP_STRING([--enable-ssl],[Enable ssl gatewaying support using OpenSSL]),
1098 [ if test "$enableval" != "no"; then
1099 AC_MSG_NOTICE([SSL gatewaying using OpenSSL enabled])
1100 AC_DEFINE(USE_SSL,1,[Define this to include code for SSL encryption.])
1101 AM_CONDITIONAL(ENABLE_SSL, true)
1102 case "$host_os" in
1103 mingw|mingw32)
1104 dnl Native Windows port of OpenSSL needs -lgdi32
1105 SSLLIB='-lssleay32 -leay32 -lgdi32'
1106 ;;
1107 *)
1108 SSLLIB='-lssl -lcrypto'
1109 ;;
1110 esac
1111 USE_OPENSSL=1
1112 fi
1113 ])
1114
1115 dnl User may specify OpenSSL is needed from a non-standard location
1116 AC_ARG_WITH(openssl,
1117 AS_HELP_STRING([--with-openssl{=PATH}],[Compile with the OpenSSL libraries. The path to
1118 the OpenSSL development libraries and headers
1119 installation can be specified if outside of the
1120 system standard directories]),
1121 [
1122 case "$with_openssl" in
1123 yes)
1124 USE_OPENSSL=1
1125 ;;
1126 no)
1127 USE_OPENSSL=
1128 ;;
1129 *)
1130 SSLLIBDIR="$with_openssl/lib"
1131 CPPFLAGS="-I$with_openssl/include $CPPFLAGS"
1132 USE_OPENSSL=1
1133 esac
1134 ])
1135 if test -n "$USE_OPENSSL"; then
1136 AC_MSG_NOTICE([Using OpenSSL MD5 implementation])
1137 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)])
1138 if test -z "$SSLLIB"; then
1139 SSLLIB="-lcrypto" # for MD5 routines
1140 fi
1141 dnl This is a workaround for RedHat 9 brain damage..
1142 if test -d /usr/kerberos/include && test -z "$SSLLIBDIR" && test -f /usr/include/openssl/kssl.h; then
1143 AC_MSG_NOTICE([OpenSSL depends on Kerberos])
1144 SSLLIBDIR="/usr/kerberos/lib"
1145 CPPFLAGS="$CPPFLAGS -I/usr/kerberos/include"
1146 fi
1147 fi
1148 if test -n "$SSLLIBDIR"; then
1149 SSLLIB="-L$SSLLIBDIR $SSLLIB"
1150 fi
1151 AC_SUBST(SSLLIB)
1152
1153
1154 AC_ARG_ENABLE(forw-via-db,
1155 AS_HELP_STRING([--enable-forw-via-db],[Enable Forw/Via database]),
1156 [ if test "$enableval" = "yes" ; then
1157 AC_MSG_NOTICE([FORW-VIA enabled])
1158 AC_DEFINE(FORW_VIA_DB,1,[Enable Forw/Via database])
1159 fi
1160 ])
1161
1162 AC_ARG_ENABLE(cache-digests,
1163 AS_HELP_STRING([--enable-cache-digests],[Use Cache Digests.
1164 See http://wiki.squid-cache.org/SquidFaq/CacheDigests]),
1165 [ if test "$enableval" = "yes" ; then
1166 AC_MSG_NOTICE([Cache Disgests enabled])
1167 AC_DEFINE(USE_CACHE_DIGESTS,1,[Use Cache Digests for locating objects in neighbor caches. This code is still semi-experimental.])
1168 fi
1169 ])
1170
1171 dnl Size of COSS memory buffer
1172 AC_ARG_WITH(coss-membuf-size,
1173 AS_HELP_STRING([--with-coss-membuf-size=size],[COSS membuf size (default 1048576 bytes)]),
1174 [ if test -n "$withval" -a "x$withval" != "xno" ; then
1175 AC_MSG_NOTICE([Setting COSS membuf size to $with_coss_membuf_size bytes])
1176 AC_DEFINE_UNQUOTED(COSS_MEMBUF_SZ, $with_coss_membuf_size,[Define if you want to set the COSS membuf size])
1177 fi
1178 ])
1179
1180 dnl check for netio plugin stuff
1181
1182 dnl Enable poll()
1183 disable_poll=
1184 AC_ARG_ENABLE(poll,
1185 AS_HELP_STRING([--disable-poll],[Disable poll(2) support.]),
1186 [
1187 case "$enableval" in
1188 yes)
1189 AC_MSG_WARN([Forcing poll() to be enabled])
1190 SELECT_TYPE="poll"
1191 ;;
1192 no)
1193 AC_MSG_WARN([Forcing poll() to be disabled])
1194 disable_poll=true
1195 ;;
1196 esac
1197 ])
1198
1199 dnl Enable select()
1200 disable_select=
1201 AC_ARG_ENABLE(select,
1202 AS_HELP_STRING([--disable-select],[Disable select(2) support.]),
1203 [
1204 case "$enableval" in
1205 yes)
1206 AC_MSG_WARN([Forcing select() to be enabled])
1207 SELECT_TYPE="select"
1208 ;;
1209 no)
1210 AC_MSG_WARN([Forcing select() to be disabled])
1211 disable_select=true
1212 ;;
1213 esac
1214 ])
1215
1216 dnl Enable kqueue()
1217 dnl kqueue support is still experiemntal and unstable. Not enabled by default.
1218 disable_kqueue=true
1219 AC_ARG_ENABLE(kqueue,
1220 AS_HELP_STRING([--enable-kqueue],[Enable kqueue(2) support (experimental).]),
1221 [
1222 case "$enableval" in
1223 yes)
1224 AC_MSG_WARN([Forcing kqueue() to be enabled])
1225 SELECT_TYPE="kqueue"
1226 AC_CHECK_HEADERS([sys/event.h],[],
1227 [ AC_MSG_ERROR([kqueue support requires sys/event.h header file.]) ])
1228 ;;
1229 no)
1230 AC_MSG_WARN([Forcing kqueue() to be disabled])
1231 disable_kqueue=true
1232 ;;
1233 *)
1234 AC_CHECK_HEADERS([sys/event.h])
1235 ;;
1236 esac
1237 ])
1238
1239 dnl Enable epoll()
1240 disable_epoll=
1241 force_epoll="no"
1242 AC_ARG_ENABLE(epoll,
1243 AS_HELP_STRING([--disable-epoll],[Disable Linux epoll(2) support.]),
1244 [
1245 case "$enableval" in
1246 yes)
1247 AC_MSG_WARN([Forcing epoll() to be enabled])
1248 SELECT_TYPE="epoll"
1249 force_epoll="yes"
1250 ;;
1251 no)
1252 AC_MSG_WARN([Forcing epoll() to be disabled])
1253 disable_epoll=true
1254 ;;
1255 esac
1256 ])
1257 dnl auto-detect and verify epoll header and library present and working
1258 if test -z "$disable_epoll"; then
1259
1260 # Check for libepoll
1261 EPOLL_LIB=
1262 AC_CHECK_LIB(epoll, epoll_ctl, [EPOLL_LIBS="-lepoll"])
1263 AC_SUBST(EPOLL_LIBS)
1264
1265 dnl on some systems it is provided by libc
1266 dnl not to worry, the working test below will catch them
1267 dnl and we don't want to force additional libraries
1268
1269
1270 # Check for epoll_ctl, may need -lepoll
1271 SAVED_LIBS="$LIBS"
1272 LIBS="$LIBS $EPOLL_LIBS"
1273 AC_CHECK_FUNCS(epoll_ctl)
1274 LIBS="$SAVED_LIBS"
1275
1276 dnl epoll requires sys/epoll.h
1277 AC_CHECK_HEADERS([sys/epoll.h])
1278
1279 dnl Verify that epoll really works
1280 if test $ac_cv_func_epoll_ctl = yes; then
1281 AC_CACHE_CHECK(if epoll works, ac_cv_epoll_works,
1282 AC_RUN_IFELSE([AC_LANG_SOURCE([[
1283 #include <sys/epoll.h>
1284 #include <stdlib.h>
1285 #include <stdio.h>
1286 int main(int argc, char **argv)
1287 {
1288 int fd = epoll_create(256);
1289 if (fd < 0) {
1290 perror("epoll_create:");
1291 return 1;
1292 }
1293 return 0;
1294 }
1295 ]])],[ac_cv_epoll_works=yes],[ac_cv_epoll_works=no],[]))
1296 fi
1297
1298 if test "$force_epoll" = "yes" && test "$ac_cv_epoll_works" = "no" ; then
1299 AC_MSG_ERROR([Epoll does not work. Force-enabling it is not going to help.])
1300 fi
1301 fi
1302
1303 dnl Disable HTTP violations
1304 http_violations=1
1305 AC_ARG_ENABLE(http-violations,
1306 AS_HELP_STRING([--disable-http-violations],[This allows you to remove code which is known to
1307 violate the HTTP protocol specification.]),
1308 [ if test "$enableval" = "no" ; then
1309 AC_MSG_NOTICE([Disabling HTTP Violations])
1310 http_violations=0
1311 fi
1312 ])
1313 if test $http_violations = 1; then
1314 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.])
1315 else
1316 AC_DEFINE(HTTP_VIOLATIONS, 0)
1317 fi
1318
1319 dnl Enable IPFW Transparent Proxy
1320 AC_ARG_ENABLE(ipfw-transparent,
1321 AS_HELP_STRING([--enable-ipfw-transparent],[Enable Transparent Proxy support for systems
1322 using FreeBSD IPFW style redirection.]),
1323 [ if test "$enableval" = "yes" ; then
1324 AC_MSG_NOTICE([IPFW Transparent Proxy enabled])
1325 AC_DEFINE(IPFW_TRANSPARENT,1,[Enable support for Transparent Proxy on systems using FreeBSD IPFW address redirection.])
1326 IPFW_TRANSPARENT="yes"
1327 else
1328 AC_DEFINE(IPFW_TRANSPARENT,0,[Enable support for Transparent Proxy on systems using FreeBSD IPFW address redirection.])
1329 fi
1330 ])
1331
1332 dnl Enable IP-Filter Transparent Proxy
1333 AC_ARG_ENABLE(ipf-transparent,
1334 AS_HELP_STRING([--enable-ipf-transparent],[Enable Transparent Proxy support for systems
1335 using IP-Filter network address redirection.]),
1336 [ if test "$enableval" = "yes" ; then
1337 AC_MSG_NOTICE([IP-Filter Transparent Proxy enabled])
1338 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.])
1339 IPF_TRANSPARENT="yes"
1340 else
1341 AC_DEFINE(IPF_TRANSPARENT,0,[Enable support for Transparent Proxy on systems using IP-Filter address redirection. This provides "masquerading" support for non Linux system.])
1342 fi
1343 ])
1344
1345 dnl Enable PF Transparent Proxy
1346 AC_ARG_ENABLE(pf-transparent,
1347 AS_HELP_STRING([--enable-pf-transparent],[Enable Transparent Proxy support for systems
1348 using PF network address redirection.]),
1349 [ if test "$enableval" = "yes" ; then
1350 AC_MSG_NOTICE([PF Transparent Proxy enabled])
1351 AC_DEFINE(PF_TRANSPARENT,1,[Enable support for Transparent Proxy on systems using PF address redirection. This provides "masquerading" support for OpenBSD.])
1352 PF_TRANSPARENT="yes"
1353 else
1354 AC_DEFINE(PF_TRANSPARENT,0,[Enable support for Transparent Proxy on systems using PF address redirection. This provides "masquerading" support for OpenBSD.])
1355 fi
1356 ])
1357
1358 dnl Enable Linux Netfilter Transparent Proxy
1359 AC_ARG_ENABLE(linux-netfilter,
1360 AS_HELP_STRING([--enable-linux-netfilter],[Enable Transparent Proxy support for Linux (Netfilter)]),
1361 [ if test "$enableval" = "yes" ; then
1362 AC_MSG_NOTICE([Linux (Netfilter) Transparent Proxy enabled])
1363 AC_DEFINE(LINUX_NETFILTER,1,[Enable support for Transparent Proxy on Linux (Netfilter) systems])
1364 LINUX_NETFILTER="yes"
1365 else
1366 AC_DEFINE(LINUX_NETFILTER,0,[Enable support for Transparent Proxy on Linux (Netfilter) systems])
1367 fi
1368 ])
1369
1370 dnl Enable Large file support
1371 buildmodel=""
1372 needlargefiles=
1373
1374 AC_ARG_WITH(large-files,
1375 AS_HELP_STRING([--with-large-files],[Enable support for large files (logs etc).]),
1376 [ if test "x$withval" = "xyes"; then
1377 needlargefiles=1
1378 fi
1379 ])
1380
1381 dnl UNIX Build environment
1382 dnl AS_HELP_STRING is not suited here because it doesn't allow to specify newlines
1383 AC_ARG_WITH(build-environment,
1384 [ --with-build-environment=model
1385 The build environment to use. Normally one of
1386 POSIX_V6_ILP32_OFF32 32 bits
1387 POSIX_V6_ILP32_OFFBIG 32 bits with large file support
1388 POSIX_V6_LP64_OFF64 64 bits
1389 POSIX_V6_LPBIG_OFFBIG large pointers and files
1390 XBS5_ILP32_OFF32 32 bits (legacy)
1391 XBS5_ILP32_OFFBIG 32 bits with large file support (legacy)
1392 XBS5_LP64_OFF64 64 bits (legacy)
1393 XBS5_LPBIG_OFFBIG large pointers and files (legacy)
1394 default The default for your OS],
1395 [ case "$withval" in
1396 yes|no)
1397 AC_MSG_FAILURE(["--with-build-environment expects a build environment string as used by getconf])
1398 ;;
1399 *)
1400 buildmodel="$withval"
1401 ;;
1402 esac
1403 ])
1404
1405 if test $needlargefiles && test -z "$buildmodel"; then
1406 for model in POSIX_V6_LPBIG_OFFBIG XBS5_LPBIG_OFFBIG POSIX_V6_LP64_OFF64 XBS5_LP64_OFF64 POSIX_V6_ILP32_OFFBIG XBS5_ILP32_OFFBIG; do
1407 if test "`getconf _$model 2>/dev/null || true`" = 1 || test "`getconf $model 2>/dev/null || true`" ; then
1408 buildmodel=$model
1409 break
1410 fi
1411 done
1412 if test -z "$buildmodel"; then
1413 AC_MSG_WARN(["No suitable build environment found for large files. Trying to use _FILE_OFFSET_BITS=64])
1414 sleep 1
1415 fi
1416 fi
1417 case "$buildmodel" in
1418 default|"")
1419 if test "$needlargefiles"; then
1420 AC_MSG_NOTICE([Enabling -D_FILE_OFFSET_BITS=64])
1421 CFLAGS="-D_FILE_OFFSET_BITS=64 $CFLAGS"
1422 CXXFLAGS="-D_FILE_OFFSET_BITS=64 $CXXFLAGS"
1423 fi
1424 ;;
1425 *)
1426 AC_MSG_NOTICE([Using $buildmodel build environment])
1427 if test "`getconf _$buildmodel 2>/dev/null || true`" = 1 || test "`getconf $buildmodel 2>/dev/null || true`" ; then
1428 : # All fine
1429 else
1430 AC_MSG_ERROR(Build environment $buildmodel not known to getconf.)
1431 fi
1432 CFLAGS="`getconf ${buildmodel}_CFLAGS` $CFLAGS"
1433 CXXFLAGS="`getconf ${buildmodel}_CFLAGS` $CXXFLAGS"
1434 LIBS="`getconf ${buildmodel}_LIBS` $LIBS"
1435 LDFLAGS="`getconf ${buildmodel}_LDFLAGS` $LDFLAGS"
1436 case "$host" in
1437 dnl
1438 dnl On Solaris getconf returns for CFLAGS -xarch=generic64, -Xa and -Usun options, and
1439 dnl for LDFLAGS -xarch=generic64, but:
1440 dnl "-Xa" is supported only by Sun cc, so we need to remove it when using gcc
1441 dnl For gcc "-xarch=generic64" must be replaced with "-m64"
1442 dnl The 'sun' define is needed by ipfilter includes, so we must remove "-Usun"
1443 *-solaris*)
1444 if test "$GCC" = "yes"; then
1445 AC_MSG_NOTICE([Removing -Xa for gcc/g++ on $host])
1446 CFLAGS="`echo $CFLAGS | sed -e 's/-Xa//'`"
1447 CXXFLAGS="`echo $CXXFLAGS | sed -e 's/-Xa//'`"
1448 AC_MSG_NOTICE([Replacing -xarch=generic64 with -m64 for gcc/g++ on $host])
1449 CFLAGS="`echo $CFLAGS | sed -e 's/-xarch=generic64/-m64/'`"
1450 CXXFLAGS="`echo $CXXFLAGS | sed -e 's/-xarch=generic64/-m64/'`"
1451 LDFLAGS="`echo $LDFLAGS | sed -e 's/-xarch=generic64//'`"
1452 fi
1453 AC_MSG_NOTICE([Removing -Usun on $host])
1454 CFLAGS="`echo $CFLAGS | sed -e 's/-Usun//'`"
1455 CXXFLAGS="`echo $CXXFLAGS | sed -e 's/-Usun//'`"
1456 ;;
1457 dnl
1458 dnl On Irix 6.x getconf returns options valid only for the SGI MipsPRO compiler,
1459 dnl so we must adjust something to avoid gcc errors.
1460 dnl On Irix 6.x 32/64 bit we must replace "-n32" with "-mabi=n32" in CFLAGS and
1461 dnl remove "-n32" from LDFLAGS
1462 dnl On Irix 6.x 64 bit we must replace "-64" with "-mabi=64" in CFLAGS and remove
1463 dnl "-64" from LDFLAGS
1464 *-sgi-irix6.*)
1465 if test "$GCC" = "yes"; then
1466 CFLAGS="`echo $CFLAGS | sed -e 's/-n32/-mabi=n32/'`"
1467 CXXFLAGS="`echo $CXXFLAGS | sed -e 's/-n32/-mabi=n32/'`"
1468 LDFLAGS="`echo $LDFLAGS | sed -e 's/-n32//'`"
1469 CFLAGS="`echo $CFLAGS | sed -e 's/-64/-mabi=64/'`"
1470 CXXFLAGS="`echo $CXXFLAGS | sed -e 's/-64/-mabi=64/'`"
1471 LDFLAGS="`echo $LDFLAGS | sed -e 's/-64//'`"
1472 fi
1473 ;;
1474 *)
1475 ;;
1476 esac
1477 ;;
1478 esac
1479
1480 dnl Enable Linux transparent proxy support for obsolete TPROXY
1481 AC_ARG_ENABLE(linux-tproxy,
1482 AS_HELP_STRING([--enable-linux-tproxy],[Enable real Transparent Proxy support for Netfilter TPROXY
1483 (version 2).]),
1484 [ if test "$enableval" = "yes" ; then
1485 AC_MSG_NOTICE(["Linux Netfilter/TPROXY v2 enabled])
1486 AC_DEFINE(LINUX_TPROXY2, 1, [Enable real Transparent Proxy support for Netfilter TPROXY v2.])
1487 LINUX_TPROXY2="yes"
1488 if test -z "$LINUX_NETFILTER"; then
1489 AC_MSG_NOTICE([Linux-Netfilter Transparent Proxy automatically enabled])
1490 LINUX_NETFILTER="yes"
1491 fi
1492 else
1493 AC_DEFINE(LINUX_TPROXY2, 0, [Enable real Transparent Proxy support for Netfilter TPROXY v2.])
1494 fi
1495 ])
1496
1497 AM_CONDITIONAL(MAKE_LEAKFINDER, false)
1498 dnl Enable Leak Finding Functions
1499 AC_ARG_ENABLE(leakfinder,
1500 AS_HELP_STRING([--enable-leakfinder],[Enable Leak Finding code. Enabling this alone
1501 does nothing; you also have to modify the source
1502 code to use the leak finding functions. Probably
1503 Useful for hackers only.]),
1504 [ if test "$enableval" = "yes" ; then
1505 AC_MSG_NOTICE([Leak-Finding enabled])
1506 AC_DEFINE(USE_LEAKFINDER,1,[Enable code for assisting in finding memory leaks. Hacker stuff only.])
1507 USE_LEAKFINDER="yes"
1508 AM_CONDITIONAL(MAKE_LEAKFINDER, true)
1509 fi
1510 ])
1511
1512 follow_xff=1
1513 AC_ARG_ENABLE(follow-x-forwarded-for,
1514 AS_HELP_STRING([--enable-follow-x-forwarded-for],[Enable support for following the X-Forwarded-For
1515 HTTP header to try to find the IP address of the
1516 original or indirect client when a request has
1517 been forwarded through other proxies.]),
1518 [ if test "$enableval" = "yes" ; then
1519 AC_MSG_NOTICE([follow X-Forwarded-For enabled])
1520 follow_xff=1
1521 fi
1522 ])
1523 if test $follow_xff = 1; then
1524 AC_DEFINE(FOLLOW_X_FORWARDED_FOR, 1, [Enable following X-Forwarded-For headers])
1525 else
1526 AC_DEFINE(FOLLOW_X_FORWARDED_FOR, 0)
1527 fi
1528
1529 use_ident=1
1530 AC_ARG_ENABLE(ident-lookups,
1531 AS_HELP_STRING([--disable-ident-lookups],[This allows you to remove code that performs Ident (RFC 931) lookups.]),
1532 [ if test "$enableval" = "no" ; then
1533 AC_MSG_NOTICE([Disabling Ident Lookups])
1534 use_ident=0
1535 fi
1536 ])
1537 if test $use_ident = 1; then
1538 AC_DEFINE(USE_IDENT, 1,[Compile in support for Ident (RFC 931) lookups? Enabled by default.])
1539 else
1540 AC_DEFINE(USE_IDENT, 0)
1541 fi
1542
1543 AM_CONDITIONAL(USE_DNSSERVER, false)
1544 use_dnsserver=
1545 AC_ARG_ENABLE(internal-dns,
1546 AS_HELP_STRING([--disable-internal-dns],[Prevents Squid from directly sending and receiving DNS messages,
1547 and instead enables the old external 'dnsserver' processes.]),
1548 [ if test "$enableval" = "no" ; then
1549 AC_MSG_WARN([Disabling Internal DNS queries])
1550 use_dnsserver="yes"
1551 fi
1552 ])
1553 if test "$use_dnsserver" = "yes"; then
1554 AC_DEFINE(USE_DNSSERVERS,1,[Use dnsserver processes instead of the internal DNS protocol support])
1555 AM_CONDITIONAL(USE_DNSSERVER, true)
1556 fi
1557
1558 dnl Select Default hosts file location
1559 AC_ARG_ENABLE(default-hostsfile,
1560 AS_HELP_STRING([--enable-default-hostsfile=path],[Select default location for hosts file.
1561 See hosts_file directive in squid.conf for details]),
1562 [
1563 if test "$enableval" != "none" ; then
1564 if test -f $enableval; then
1565 OPT_DEFAULT_HOSTS=$enableval
1566 else
1567 AC_MSG_WARN([Unable to find $enableval])
1568 sleep 5
1569 fi
1570 else
1571 OPT_DEFAULT_HOSTS="none"
1572 fi
1573 AC_MSG_NOTICE([Default hosts file set to: $enableval])
1574 ],[OPT_DEFAULT_HOSTS="/etc/hosts"])
1575 AC_SUBST(OPT_DEFAULT_HOSTS)
1576
1577 dnl Select auth schemes modules to build
1578 AC_ARG_ENABLE(auth,
1579 AS_HELP_STRING([--enable-auth="list of auth scheme modules"],[Build support for the list of authentication schemes.
1580 The default is to build support for the Basic scheme.
1581 See src/auth for a list of available modules, or
1582 Programmers Guide section authentication schemes
1583 for details on how to build your custom auth scheme
1584 module]),
1585 [ case $enableval in
1586 yes)
1587 for dir in $srcdir/src/auth/*; do
1588 module="`basename $dir`"
1589 if test -d "$dir" && test "$module" != CVS; then
1590 AUTH_MODULES="$AUTH_MODULES $module"
1591 fi
1592 done
1593 ;;
1594 no)
1595 ;;
1596 *)
1597 AUTH_MODULES="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`"
1598 ;;
1599 esac
1600 ],
1601 [ if test -z "$AUTH_MODULES"; then
1602 AUTH_MODULES="ntlm basic digest negotiate"
1603 fi
1604 ])
1605 if test -n "$AUTH_MODULES"; then
1606 for module in $AUTH_MODULES; do
1607 if test -d $srcdir/src/auth/$module; then
1608 :
1609 else
1610 AC_MSG_ERROR(Auth scheme $module does not exist)
1611 fi
1612 eval AUTH_MODULE_${module}=yes
1613 done
1614 AC_MSG_NOTICE([Auth scheme modules built: $AUTH_MODULES])
1615 else
1616 AC_MSG_WARN([Auth scheme modules built: None])
1617 fi
1618 dnl Authentication libraries to build
1619 dnl This list will not be needed when each auth library has its own Makefile
1620 AUTH_LIBS_TO_BUILD=
1621 for module in $AUTH_MODULES; do
1622 AUTH_LIBS_TO_BUILD="$AUTH_LIBS_TO_BUILD lib${module}.la"
1623 done
1624 AC_SUBST(AUTH_MODULES)
1625 AC_SUBST(AUTH_LIBS_TO_BUILD)
1626
1627 dnl bundled auth modules, in order to have handy defines for the cppunit testsuite
1628 test -n "$AUTH_MODULE_basic" && AC_DEFINE([HAVE_AUTH_MODULE_BASIC],1,[Basic auth module is built])
1629 test -n "$AUTH_MODULE_digest" && AC_DEFINE([HAVE_AUTH_MODULE_DIGEST],1,[Digest auth module is built])
1630 test -n "$AUTH_MODULE_ntlm" && AC_DEFINE([HAVE_AUTH_MODULE_NTLM],1,[NTLM auth module is built])
1631 test -n "$AUTH_MODULE_negotiate" && AC_DEFINE([HAVE_AUTH_MODULE_NEGOTIATE],1,[Negotiate auth module is built])
1632
1633 dnl Select basic auth scheme helpers to build
1634 if test -n "$AUTH_MODULE_basic"; then
1635 BASIC_AUTH_HELPERS="all"
1636 fi
1637 AC_ARG_ENABLE(basic-auth-helpers,
1638 AS_HELP_STRING([--enable-basic-auth-helpers="list of helpers"],[This option selects which basic scheme proxy_auth
1639 helpers to build and install as part of the normal
1640 build process. For a list of available
1641 helpers see the helpers/basic_auth directory.]),
1642 [ case "$enableval" in
1643 yes)
1644 BASIC_AUTH_HELPERS="all"
1645 ;;
1646 no)
1647 BASIC_AUTH_HELPERS=""
1648 ;;
1649 *)
1650 if test -z "$AUTH_MODULE_basic"; then
1651 AC_MSG_WARN([Basic auth helpers selected without the basic scheme enabled])
1652 sleep 15
1653 fi
1654 BASIC_AUTH_HELPERS="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`"
1655 ;;
1656 esac
1657 ])
1658 if test "$BASIC_AUTH_HELPERS" = "all" ; then
1659 BASIC_AUTH_HELPERS=""
1660 for dir in $srcdir/helpers/basic_auth/*; do
1661 helper="`basename $dir`"
1662 if test -f $dir/config.test && sh $dir/config.test "$@"; then
1663 BASIC_AUTH_HELPERS="$BASIC_AUTH_HELPERS $helper"
1664 elif test -d $srcdir/helpers/basic_auth/$helper ; then
1665 AC_MSG_NOTICE([Basic auth helper $helper ... found but cannot be built])
1666 fi
1667 done
1668 fi
1669 if test -n "$BASIC_AUTH_HELPERS"; then
1670 for helper in $BASIC_AUTH_HELPERS; do
1671 if test -d $srcdir/helpers/basic_auth/$helper; then
1672 case $helper in
1673 SASL)
1674 require_sasl=yes
1675 ;;
1676 esac
1677 else
1678 AC_MSG_ERROR(Basic auth helper $helper does not exist)
1679 fi
1680 done
1681 AC_MSG_NOTICE([Basic auth helpers built: $BASIC_AUTH_HELPERS])
1682 fi
1683 AC_SUBST(BASIC_AUTH_HELPERS)
1684
1685 dnl Select ntlm auth helpers to build
1686 if test -n "$AUTH_MODULE_ntlm"; then
1687 NTLM_AUTH_HELPERS="all"
1688 fi
1689 AC_ARG_ENABLE(ntlm-auth-helpers,
1690 AS_HELP_STRING([--enable-ntlm-auth-helpers="list of helpers"],[This option selects which proxy_auth ntlm helpers
1691 to build and install as part of the normal build
1692 process. For a list of available helpers see
1693 the helpers/ntlm_auth directory.]),
1694 [ case "$enableval" in
1695 yes)
1696 NTLM_AUTH_HELPERS="all"
1697 ;;
1698 no)
1699 NTLM_AUTH_HELPERS=""
1700 ;;
1701 *)
1702 NTLM_AUTH_HELPERS="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`"
1703 ;;
1704 esac
1705 ])
1706 if test "$NTLM_AUTH_HELPERS" = "all" ; then
1707 NTLM_AUTH_HELPERS=""
1708 for dir in $srcdir/helpers/ntlm_auth/*; do
1709 helper="`basename $dir`"
1710 if test -f $dir/config.test && sh $dir/config.test "$@"; then
1711 NTLM_AUTH_HELPERS="$NTLM_AUTH_HELPERS $helper"
1712 elif test -d $srcdir/helpers/ntlm_auth/$helper ; then
1713 AC_MSG_NOTICE([NTLM auth helper $helper ... found but cannot be built])
1714 fi
1715 done
1716 fi
1717 if test -n "$NTLM_AUTH_HELPERS"; then
1718 for helper in $NTLM_AUTH_HELPERS; do
1719 if test -d $srcdir/helpers/ntlm_auth/$helper; then
1720 :
1721 else
1722 AC_MSG_ERROR(NTLM Auth helper $helper does not exist)
1723 fi
1724 done
1725 AC_MSG_NOTICE([NTLM auth helpers built: $NTLM_AUTH_HELPERS])
1726 fi
1727 AC_SUBST(NTLM_AUTH_HELPERS)
1728
1729 dnl Select negotiate auth helpers to build
1730 if test -n "$AUTH_MODULE_negotiate"; then
1731 NEGOTIATE_AUTH_HELPERS="all"
1732 fi
1733 AC_ARG_ENABLE(negotiate-auth-helpers,
1734 AS_HELP_STRING([--enable-negotiate-auth-helpers="list of helpers"],[This option selects which proxy_auth negotiate helpers
1735 to build and install as part of the normal build
1736 process. For a list of available helpers see
1737 the helpers/negotiate_auth directory.]),
1738 [ case "$enableval" in
1739 yes)
1740 NEGOTIATE_AUTH_HELPERS="all"
1741 ;;
1742 no)
1743 NEGOTIATE_AUTH_HELPERS=""
1744 ;;
1745 *)
1746 NEGOTIATE_AUTH_HELPERS="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`"
1747 ;;
1748 esac
1749 ])
1750 if test "$NEGOTIATE_AUTH_HELPERS" = "all" ; then
1751 NEGOTIATE_AUTH_HELPERS=""
1752 for dir in $srcdir/helpers/negotiate_auth/*; do
1753 helper="`basename $dir`"
1754 if test -f $dir/config.test && sh $dir/config.test "$@"; then
1755 NEGOTIATE_AUTH_HELPERS="$NEGOTIATE_AUTH_HELPERS $helper"
1756 elif test -d $srcdir/helpers/negotiate_auth/$helper ; then
1757 AC_MSG_NOTICE([Negotiate auth helper $helper ... found but cannot be built])
1758 fi
1759 done
1760 fi
1761 if test -n "$NEGOTIATE_AUTH_HELPERS"; then
1762 for helper in $NEGOTIATE_AUTH_HELPERS; do
1763 if test -d $srcdir/helpers/negotiate_auth/$helper; then
1764 :
1765 else
1766 AC_MSG_ERROR(Negotiate Auth helper $helper does not exist)
1767 fi
1768 done
1769 AC_MSG_NOTICE([Negotiate auth helpers built: $NEGOTIATE_AUTH_HELPERS])
1770 fi
1771 AC_SUBST(NEGOTIATE_AUTH_HELPERS)
1772
1773 dnl Select digest auth scheme helpers to build
1774 if test -n "$AUTH_MODULE_digest"; then
1775 DIGEST_AUTH_HELPERS=all
1776 fi
1777 AC_ARG_ENABLE(digest-auth-helpers,
1778 AS_HELP_STRING([--enable-digest-auth-helpers="list of helpers"],[This option selects which digest scheme authentication
1779 helpers to build and install as part of the normal build
1780 process. For a list of available helpers see the
1781 helpers/digest_auth directory.]),
1782 [ case "$enableval" in
1783 yes)
1784 DIGEST_AUTH_HELPERS="all"
1785 ;;
1786 no)
1787 DIGEST_AUTH_HELPERS=""
1788 ;;
1789 *)
1790 DIGEST_AUTH_HELPERS="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`"
1791 ;;
1792 esac
1793 ])
1794 if test "$DIGEST_AUTH_HELPERS" = "all" ; then
1795 DIGEST_AUTH_HELPERS=""
1796 for dir in $srcdir/helpers/digest_auth/*; do
1797 helper="`basename $dir`"
1798 if test -f $dir/config.test && sh $dir/config.test "$@"; then
1799 DIGEST_AUTH_HELPERS="$DIGEST_AUTH_HELPERS $helper"
1800 elif test -d $srcdir/helpers/digest_auth/$helper ; then
1801 AC_MSG_NOTICE([Digest auth helper $helper ... found but cannot be built])
1802 fi
1803 done
1804 fi
1805 if test -n "$DIGEST_AUTH_HELPERS"; then
1806 for helper in $DIGEST_AUTH_HELPERS; do
1807 if test -f $srcdir/helpers/digest_auth/$helper/Makefile.in; then
1808 :
1809 else
1810 AC_MSG_ERROR(digest auth helper $helper does not exist)
1811 fi
1812 done
1813 AC_MSG_NOTICE([Digest auth helpers built: $DIGEST_AUTH_HELPERS])
1814 fi
1815 AC_SUBST(DIGEST_AUTH_HELPERS)
1816
1817 dnl Check Kerberos
1818 SAVED_CPPFLAGS=$CPPFLAGS
1819 SAVED_LIBS=$LIBS
1820 AC_ARG_WITH(krb5-config,
1821 [ --with-krb5-config=PATH specify path to krb5-config @<:@default=detect@:>@],
1822 [ if test "$withval" = "yes"; then
1823 unset krb5confpath
1824 elif test "$withval" != "no"; then
1825 krb5confpath=$withval
1826 else
1827 krb5confpath=no
1828 fi
1829 ])
1830 if test x"$krb5confpath" != xno; then
1831 if test x"$krb5confpath" != x; then
1832 if ! test -x "$krb5confpath"; then
1833 AC_MSG_WARN([krb5-config '$krb5confpath' not executable, ignoring])
1834 AC_CHECK_PROG(ac_krb5_config, krb5-config, yes, no)
1835 krb5confpath=krb5-config
1836 fi
1837 krb5_config_path=`dirname $krb5confpath`
1838 AC_CHECK_PROG(ac_krb5_config, krb5-config, yes, no, $krb5_config_path)
1839 else
1840 AC_CHECK_PROG(ac_krb5_config,krb5-config,yes,no)
1841 krb5confpath=krb5-config
1842 fi
1843 fi
1844 if test "$ac_krb5_config" = "yes" ; then
1845 ac_heimdal="`$krb5confpath --version 2>/dev/null | grep -i heimdal`"
1846 ac_solaris="`$krb5confpath --version 2>/dev/null | grep -i solaris`"
1847 if test "x$ac_heimdal" != "x" ; then
1848 AC_DEFINE(HAVE_HEIMDAL_KERBEROS,1,[Define to 1 if you have Heimdal Kerberos])
1849 else
1850 AC_DEFINE(HAVE_MIT_KERBEROS,1,[Define to 1 if you have MIT Kerberos])
1851 fi
1852 if test "$ac_solaris" != "" ; then
1853 KRB5INCS="`$krb5confpath --cflags krb5 2>/dev/null`"
1854 KRB5LIBS="`$krb5confpath --libs krb5 2>/dev/null`"
1855 KRB5INCS="-I/usr/include/gssapi $KRB5INCS"
1856 KRB5LIBS="-L/usr/lib -R/usr/lib -lgss -lresolv -lsocket -lnsl $KRB5LIBS"
1857 else
1858 KRB5INCS="`$krb5confpath --cflags krb5 2>/dev/null`"
1859 KRB5LIBS="`$krb5confpath --libs krb5 2>/dev/null`"
1860 KRB5INCS="`$krb5confpath --cflags gssapi 2>/dev/null` $KRB5INCS"
1861 KRB5LIBS="`$krb5confpath --libs gssapi 2>/dev/null` $KRB5LIBS"
1862 fi
1863 CPPFLAGS="$CPPFLAGS $KRB5INCS"
1864 LIBS="$LIBS $KRB5LIBS"
1865 AC_CHECK_HEADERS(gssapi.h gssapi/gssapi.h gssapi/gssapi_krb5.h)
1866 if test "x$ac_heimdal" == "x" ; then
1867 AC_CHECK_HEADERS(gssapi/gssapi_generic.h)
1868 fi
1869 AC_CHECK_HEADERS(krb5.h com_err.h et/com_err.h)
1870 AC_MSG_CHECKING([for max_skew in struct krb5_context])
1871 AC_TRY_COMPILE([
1872 #include <krb5.h>
1873 ],
1874 [ krb5_context kc; kc->max_skew = 1; ],
1875 [ AC_DEFINE(HAVE_MAX_SKEW_IN_KRB5_CONTEXT, 1, [Define to 1 if max_skew in struct krb5_context])
1876 AC_MSG_RESULT(yes) ],
1877 [ AC_MSG_RESULT(no) ]
1878 )
1879
1880 if test "x$ac_heimdal" == "x" ; then
1881 AC_CHECK_HEADERS(profile.h)
1882 fi
1883 AC_CHECK_LIB(com_err,error_message,
1884 AC_DEFINE(HAVE_ERROR_MESSAGE,1,[Define to 1 if you have error_message]),)
1885 AC_CHECK_LIB(krb5,krb5_get_err_text,
1886 AC_DEFINE(HAVE_KRB5_GET_ERR_TEXT,1,[Define to 1 if you have krb5_get_err_text]),)
1887 AC_CHECK_LIB(krb5,krb5_get_error_message,
1888 AC_DEFINE(HAVE_KRB5_GET_ERROR_MESSAGE,1,[Define to 1 if you have krb5_get_error_message]),)
1889 AC_CHECK_LIB(krb5,krb5_kt_free_entry,
1890 AC_DEFINE(HAVE_KRB5_KT_FREE_ENTRY,1,[Define to 1 if you have krb5_kt_free_entry]),)
1891 AC_CHECK_LIB(krb5,krb5_get_init_creds_keytab,
1892 AC_DEFINE(HAVE_GET_INIT_CREDS_KEYTAB,1,[Define to 1 if you have krb5_get_init_creds_keytab]),)
1893 AC_CHECK_LIB(krb5,krb5_get_max_time_skew,
1894 AC_DEFINE(HAVE_KRB5_GET_MAX_TIME_SKEW,1,[Define to 1 if you have krb5_get_max_time_skew]),)
1895 AC_CHECK_LIB(krb5,krb5_get_profile,
1896 AC_DEFINE(HAVE_KRB5_GET_PROFILE,1,[Define to 1 if you have krb5_get_profile]),)
1897 AC_CHECK_LIB(krb5,profile_get_integer,
1898 AC_DEFINE(HAVE_PROFILE_GET_INTEGER,1,[Define to 1 if you have profile_get_integer]),)
1899 AC_CHECK_LIB(krb5,profile_release,
1900 AC_DEFINE(HAVE_PROFILE_RELEASE,1,[Define to 1 if you have profile_release]),)
1901 AC_MSG_CHECKING([for memory cache])
1902 AC_TRY_RUN([
1903 #include<krb5.h>
1904 main()
1905 {
1906 krb5_context context;
1907 krb5_ccache cc;
1908
1909 krb5_init_context(&context);
1910 return krb5_cc_resolve(context, "MEMORY:test_cache", &cc);
1911 }],
1912 [AC_DEFINE(HAVE_KRB5_MEMORY_CACHE,1, [Define to 1 if you have MEMORY: cache support])
1913 AC_MSG_RESULT(yes)],
1914 AC_MSG_RESULT(no))
1915
1916 AC_MSG_CHECKING([for working gssapi])
1917 AC_TRY_RUN([
1918 #ifdef HAVE_GSSAPI_GSSAPI_H
1919 #include <gssapi/gssapi.h>
1920 #elif HAVE_GSSAPI_H
1921 #include <gssapi.h>
1922 #endif
1923
1924 #ifdef HAVE_GSSAPI_GSSAPI_EXT_H
1925 #include <gssapi/gssapi_ext.h>
1926 #endif
1927
1928 #ifdef HAVE_GSSAPI_GSSAPI_KRB5_H
1929 #include <gssapi/gssapi_krb5.h>
1930 #endif
1931
1932 #ifdef HAVE_GSSAPI_GSSAPI_GENERIC_H
1933 #include <gssapi/gssapi_generic.h>
1934 #endif
1935 int
1936 main(void)
1937 {
1938 OM_uint32 val;
1939 gss_OID_set set;
1940
1941 gss_create_empty_oid_set(&val, &set);
1942
1943 return 0;
1944 }
1945 ], [AC_DEFINE(HAVE_GSSAPI, 1, [GSSAPI support])
1946 AC_MSG_RESULT(yes)],
1947 AC_MSG_RESULT(no))
1948 AC_MSG_CHECKING([for spnego support])
1949 AC_TRY_RUN([
1950 #ifdef HAVE_HEIMDAL_KERBEROS
1951 #ifdef HAVE_GSSAPI_GSSAPI_H
1952 #include <gssapi/gssapi.h>
1953 #elif defined(HAVE_GSSAPI_H)
1954 #include <gssapi.h>
1955 #endif
1956 #else
1957 #ifdef HAVE_GSSAPI_GSSAPI_H
1958 #include <gssapi/gssapi.h>
1959 #elif defined(HAVE_GSSAPI_H)
1960 #include <gssapi.h>
1961 #endif
1962 #ifdef HAVE_GSSAPI_GSSAPI_KRB5_H
1963 #include <gssapi/gssapi_krb5.h>
1964 #endif
1965 #ifdef HAVE_GSSAPI_GSSAPI_GENERIC_H
1966 #include <gssapi/gssapi_generic.h>
1967 #endif
1968 #endif
1969 #include <string.h>
1970 int main(int argc, char *argv[]) {
1971 OM_uint32 major_status,minor_status;
1972 gss_OID_set gss_mech_set;
1973 int i;
1974
1975 static gss_OID_desc _gss_mech_spnego = {6, (void *)"\x2b\x06\x01\x05\x05\x02"};
1976 gss_OID gss_mech_spnego = &_gss_mech_spnego;
1977
1978 major_status = gss_indicate_mechs( &minor_status, &gss_mech_set);
1979
1980 for (i=0;i<gss_mech_set->count;i++) {
1981 if (!memcmp(gss_mech_set->elements[i].elements,gss_mech_spnego->elements,gss_mech_set->elements[i].length)) {
1982 return 0;
1983 }
1984 }
1985
1986 return 1;
1987 }],
1988 [ac_cv_have_spnego=yes
1989 AC_DEFINE(HAVE_SPNEGO,1, [Define to 1 if you have SPNEGO support])
1990 AC_MSG_RESULT(yes)],
1991 [ac_cv_have_spnego=no
1992 AC_MSG_RESULT(no)])
1993 AC_MSG_CHECKING([for working krb5])
1994 AC_TRY_RUN([
1995 #ifdef HAVE_KRB5_H
1996 #include <krb5.h>
1997 #endif
1998
1999 int
2000 main(void)
2001 {
2002 krb5_context context;
2003
2004 krb5_init_context(&context);
2005
2006 return 0;
2007 }
2008 ], [AC_DEFINE(HAVE_KRB5, 1, [KRB5 support])
2009 AC_MSG_RESULT(yes)],
2010 AC_MSG_RESULT(no))
2011 LIBS=$SAVED_LIBS
2012 CPPFLAGS=$SAVED_CPPFLAGS
2013 AC_SUBST(KRB5INCS)
2014 AC_SUBST(KRB5LIBS)
2015 fi
2016 AM_CONDITIONAL(HAVE_SPNEGO, test x"$ac_cv_have_spnego" = x"yes" )
2017
2018 dnl Enable "NTLM fail open"
2019 AC_ARG_ENABLE(ntlm-fail-open,
2020 AS_HELP_STRING([--enable-ntlm-fail-open],[Enable NTLM fail open, where a helper that fails one of the
2021 Authentication steps can allow squid to still authenticate
2022 the user.]),
2023 [ if test "$enableval" = "yes" ; then
2024 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.])
2025 fi
2026 ])
2027
2028 dnl Select external_acl helpers to build
2029 EXTERNAL_ACL_HELPERS=all
2030 AC_ARG_ENABLE(external-acl-helpers,
2031 AS_HELP_STRING([--enable-external-acl-helpers="list of helpers"],[This option selects which external_acl helpers to
2032 build and install as part of the normal build
2033 process. For a list of available helpers see the
2034 helpers/external_acl directory.]),
2035 [ case "$enableval" in
2036 yes)
2037 EXTERNAL_ACL_HELPERS=all
2038 ;;
2039 no)
2040 EXTERNAL_ACL_HELPERS=""
2041 ;;
2042 *)
2043 EXTERNAL_ACL_HELPERS="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`"
2044 ;;
2045 esac
2046 ])
2047 if test "$EXTERNAL_ACL_HELPERS" = "all" ; then
2048 EXTERNAL_ACL_HELPERS=""
2049 for dir in $srcdir/helpers/external_acl/*; do
2050 helper="`basename $dir`"
2051 if test -f $dir/config.test && sh $dir/config.test "$@"; then
2052 EXTERNAL_ACL_HELPERS="$EXTERNAL_ACL_HELPERS $helper"
2053 elif test -d $srcdir/helpers/external_acl/$helper ; then
2054 AC_MSG_NOTICE([External ACL helper $helper ... found but cannot be built])
2055 fi
2056 done
2057 fi
2058 if test -n "$EXTERNAL_ACL_HELPERS"; then
2059 for helper in $EXTERNAL_ACL_HELPERS; do
2060 if test -f $srcdir/helpers/external_acl/$helper/Makefile.in; then
2061 :
2062 else
2063 AC_MSG_ERROR(external acl helper $helper does not exist)
2064 fi
2065 done
2066 AC_MSG_NOTICE([External acl helpers built: $EXTERNAL_ACL_HELPERS])
2067 fi
2068 AC_SUBST(EXTERNAL_ACL_HELPERS)
2069
2070 dnl Select url_rewrite helpers to build
2071 URL_REWRITE_HELPERS=all
2072 AC_ARG_ENABLE(url-rewrite-helpers,
2073 AC_HELP_STRING([--enable-url-rewrite-helpers="list of helpers"],
2074 [This option selects which url_rewrite helpers to
2075 build and install as part of the normal build
2076 process. For a list of available helpers see the
2077 helpers/url_rewrite directory.]),
2078 [ case "$enableval" in
2079 yes)
2080 URL_REWRITE_HELPERS=all
2081 ;;
2082 no)
2083 URL_REWRITE_HELPERS=""
2084 ;;
2085 *)
2086 URL_REWRITE_HELPERS="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`"
2087 ;;
2088 esac
2089 ])
2090 if test "$URL_REWRITE_HELPERS" = "all" ; then
2091 URL_REWRITE_HELPERS=""
2092 for dir in $srcdir/helpers/url_rewrite/*; do
2093 helper="`basename $dir`"
2094 if test -f $dir/config.test && sh $dir/config.test "$@"; then
2095 URL_REWRITE_HELPERS="$URL_REWRITE_HELPERS $helper"
2096 elif test -d $srcdir/helpers/url_rewrite/$helper ; then
2097 AC_MSG_NOTICE([URL re-write helper $helper ... found but cannot be built])
2098 fi
2099 done
2100 fi
2101 if test -n "$URL_REWRITE_HELPERS"; then
2102 for helper in $URL_REWRITE_HELPERS; do
2103 if test -f $srcdir/helpers/url_rewrite/$helper/Makefile.in; then
2104 :
2105 else
2106 AC_MSG_ERROR(url_rewrite helper $helper does not exist)
2107 fi
2108 done
2109 AC_MSG_NOTICE([url_rewrite helpers built: $URL_REWRITE_HELPERS])
2110 fi
2111 AC_SUBST(URL_REWRITE_HELPERS)
2112
2113
2114 AC_ARG_WITH(valgrind-debug,
2115 AS_HELP_STRING([--with-valgrind-debug],[Include debug instrumentation for use with valgrind]),
2116 [ case $withval in
2117 yes)
2118 valgrind=1
2119 ;;
2120 no)
2121 valgrind=
2122 ;;
2123 *)
2124 CPPFLAGS="$CPPFLAGS -I${enableval}/include"
2125 valgrind=1
2126 ;;
2127 esac
2128 if test $valgrind; then
2129 AC_CHECK_HEADERS(valgrind/memcheck.h,
2130 [ AC_DEFINE(WITH_VALGRIND, 1, [Valgrind memory debugger support])
2131 AC_MSG_NOTICE([Valgrind debug support enabled]) ],
2132 [ AC_MSG_WARN([Valgrind header not found. Valgrind support disabled.]) ]
2133 )
2134 fi
2135 ])
2136
2137 dnl Disable "memPools" code
2138 AC_ARG_ENABLE(mempools,
2139 AS_HELP_STRING([--disable-mempools],[Disable memPools. Note that this option now simply sets the
2140 default behaviour. Specific classes can override this at runtime, and
2141 only lib/MemPool.c needs to be altered to change the squid-wide
2142 default for all classes.]),
2143 [ if test "$enableval" = "no" ; then
2144 AC_MSG_NOTICE([memPools disabled])
2145 AC_DEFINE(DISABLE_POOLS, 1, [Define if you have problems with memPools and want to disable Pools])
2146 else
2147 AC_DEFINE(DISABLE_POOLS, 0, [Define if you have problems with memPools and want to disable Pools.])
2148 fi
2149 ],
2150 [ AC_DEFINE(DISABLE_POOLS, 0, [Define if you have problems with memPools and want to disable Pools.])
2151 ])
2152
2153 dnl Enable WIN32 Service compile mode
2154 AC_ARG_ENABLE(win32-service,
2155 AS_HELP_STRING([--enable-win32-service],[Compile Squid as a WIN32 Service.
2156 Works only on MS-Windows platforms (NT and up).]),
2157 [ if test "$enableval" = "yes" ; then
2158 AC_MSG_NOTICE([Enabling WIN32 run service mode])
2159 AC_DEFINE(USE_WIN32_SERVICE,1,[Define Windows NT & Windows 2000 run service mode])
2160 fi
2161 ])
2162
2163
2164 dnl Check for Cyrus SASL
2165 if test "$require_sasl" = "yes"; then
2166 AC_CHECK_HEADERS(sasl/sasl.h sasl.h)
2167 if test "$ac_cv_header_sasl_sasl_h" = "yes"; then
2168 AC_MSG_NOTICE([using SASL2])
2169 LIBSASL="-lsasl2"
2170 else
2171 if test "$ac_cv_header_sasl_h" = "yes"; then
2172 AC_MSG_NOTICE([using SASL])
2173 LIBSASL="-lsasl"
2174 else
2175 AC_MSG_ERROR(Neither SASL nor SASL2 found)
2176 fi
2177 fi
2178 AC_SUBST(LIBSASL)
2179 fi
2180
2181 dnl Disable "unlinkd" code
2182 AC_ARG_ENABLE(unlinkd,
2183 AS_HELP_STRING([--disable-unlinkd],[Do not use unlinkd]),
2184 [ if test "$enableval" = "no" ; then
2185 use_unlinkd=no
2186 else
2187 use_unlinkd=yes
2188 fi
2189 ],[
2190 # Here we should probably use some magic depending on the selected
2191 # storage models
2192 use_unlinkd=yes
2193 ])
2194 if test "$use_unlinkd" = "yes"; then
2195 AC_MSG_NOTICE([unlinkd enabled])
2196 AC_DEFINE(USE_UNLINKD,1,[Define this if unlinkd is required (strongly recommended for ufs storage type)])
2197 AM_CONDITIONAL(ENABLE_UNLINKD, true)
2198 else
2199 AC_MSG_NOTICE([unlinkd disabled])
2200 AM_CONDITIONAL(ENABLE_UNLINKD, false)
2201 fi
2202
2203 dnl Enable backtraces on fatal errors
2204 AC_ARG_ENABLE(stacktraces,
2205 AS_HELP_STRING([--enable-stacktraces],[Enable automatic call backtrace on fatal errors]),
2206 [ if test "$enableval" = "yes" ; then
2207 AC_MSG_NOTICE([Enabling automatic stack backtraces on fatal errors])
2208 AC_DEFINE(PRINT_STACK_TRACE, 1,[Print stacktraces on fatal errors])
2209 fi
2210 ])
2211
2212 AM_CONDITIONAL(ENABLE_XPROF_STATS, false)
2213 dnl Enable USE_XPROF_STATS
2214 AC_ARG_ENABLE(cpu-profiling,
2215 AS_HELP_STRING([--enable-cpu-profiling],[Enable instrumentation to try and understand how CPU power
2216 is spent by squid, by enabling specific probes in selected
2217 functions. New probes can only be added by modifying the source code.
2218 It is meant to help developers in optimizing performance
2219 of Squid internal functions.
2220 If you are not developer you shouldn't enable this,
2221 as it slows squid down somewhat. See lib/Profiler.c for more details.]),
2222 [ if test "$enableval" = "yes" ; then
2223 AC_MSG_NOTICE([Enabling cpu-profiling])
2224 AC_DEFINE(USE_XPROF_STATS, 1,[Define to enable CPU profiling within Squid])
2225 AM_CONDITIONAL(ENABLE_XPROF_STATS, true)
2226 fi
2227 ])
2228
2229 dnl Enable X-Accelerator-Vary for Vary support within an accelerator setup
2230 AC_ARG_ENABLE(x-accelerator-vary,
2231 AS_HELP_STRING([--enable-x-accelerator-vary],[Enable support for the X-Accelerator-Vary
2232 HTTP header. Can be used to indicate
2233 variance within an accelerator setup.
2234 Typically used together with other code
2235 that adds custom HTTP headers to the requests.]),
2236 [ if test "$enableval" = "yes" ; then
2237 AC_MSG_NOTICE([Enabling support for X-Accelerator-Vary])
2238 AC_DEFINE(X_ACCELERATOR_VARY, 1, [Enable support for the X-Accelerator-Vary HTTP header])
2239 fi
2240 ])
2241
2242 AC_ARG_ENABLE(zph-qos,
2243 AS_HELP_STRING([--enable-zph-qos],[Enable ZPH QOS support]),
2244 [ if test "$enableval" = "yes" ; then
2245 AC_MSG_NOTICE([ZPH QOS enabled])
2246 AC_DEFINE(USE_ZPH_QOS,1,
2247 [ Define this to use Squid's ZPH (Zero Penalty Hit) QOS features.
2248 When enabled, Squid will alter TOS field of HIT responses for better QOS on intermediate routing/shaping devices.])
2249 fi
2250 ])
2251
2252 dnl --with-maxfd present for compatibility with Squid-2.
2253 dnl undocumented in ./configure --help to encourage using the Squid-3 directive.
2254 AC_ARG_WITH(maxfd,,
2255 [
2256 case ${withval} in
2257 [[0-9]]*)
2258 squid_filedescriptors_num=$withval
2259 ;;
2260 *)
2261 AC_MSG_ERROR(--with-maxfd expects a numeric argument)
2262 ;;
2263 esac
2264 ])
2265 AC_ARG_WITH(filedescriptors,
2266 AS_HELP_STRING([--with-filedescriptors=NUMBER],[Force squid to support NUMBER filedescriptors]),
2267 [
2268 case ${withval} in
2269 [[0-9]]*)
2270 squid_filedescriptors_num=$withval
2271 ;;
2272 *)
2273 AC_MSG_ERROR(--with-filedescriptors expects a numeric argument)
2274 ;;
2275 esac
2276 ])
2277
2278 AC_PATH_PROG(CPPUNITCONFIG, cppunit-config, false)
2279 if $CPPUNITCONFIG --help >/dev/null; then
2280 AC_MSG_NOTICE([using system installed cppunit])
2281 SQUID_CPPUNIT_LIBS="`$CPPUNITCONFIG --libs`"
2282 SQUID_CPPUNIT_LA=''
2283 SQUID_CPPUNIT_INC="`$CPPUNITCONFIG --cflags`"
2284 else
2285 AC_MSG_WARN([cppunit does not appear to be installed. squid does not require this, but code testing with 'make check' will fail.])
2286 SQUID_CPPUNIT_LA=''
2287 SQUID_CPPUNIT_LIBS=''
2288 SQUID_CPPUNIT_INC=''
2289 fi
2290
2291 AC_ARG_WITH(cppunit-basedir,
2292 AS_HELP_STRING([--with-cppunit-basedir=PATH],[Path where the cppunit headers are libraries are found
2293 for unit testing.]),
2294 [ if test -f $withval/include/cppunit/TestCase.h; then
2295 AC_MSG_NOTICE([Using cppunit includes from $withval])
2296 SQUID_CPPUNIT_INC="-I${withval}/include"
2297 else
2298 AC_MSG_ERROR(Cannot find cppunit at $withval)
2299 fi
2300 if test -f $withval/lib/libcppunit.la; then
2301 AC_MSG_NOTICE([Using cppunit lib from $withval])
2302 SQUID_CPPUNIT_LA="${withval}/lib/libcppunit.la"
2303 SQUID_CPPUNIT_LIBS='$(SQUID_CPPUNIT_LA)'
2304 else
2305 AC_MSG_ERROR(Cannot find cppunit at $withval)
2306 fi
2307 ])
2308 AC_SUBST(SQUID_CPPUNIT_LIBS)
2309 AC_SUBST(SQUID_CPPUNIT_LA)
2310 AC_SUBST(SQUID_CPPUNIT_INC)
2311
2312 # Force some compilers to use ANSI features
2313 #
2314 case "$host" in
2315 alpha-dec-osf*)
2316 if test "$ac_cv_prog_CC" = "cc" ; then
2317 AC_MSG_NOTICE([adding '-std1' to cc args for $host])
2318 CC="cc -std1";
2319 ac_cv_prog_CC="$CC"
2320 fi
2321 ;;
2322 *-hp-hpux*)
2323 if test "$ac_cv_prog_CC" = "cc" ; then
2324 AC_MSG_NOTICE([adding '-Ae' to cc args for $host])
2325 CC="cc -Ae";
2326 ac_cv_prog_CC="$CC"
2327 fi
2328 ;;
2329 esac
2330
2331 dnl Check for programs
2332 AC_PROG_CPP
2333 AC_PROG_INSTALL
2334 AC_PROG_LN_S
2335 AC_PATH_PROG(SH, sh, /bin/sh)
2336 AC_PATH_PROG(FALSE, false, /usr/bin/false)
2337 AC_PATH_PROG(TRUE, true, /usr/bin/true)
2338 AC_PATH_PROG(MV, mv, $FALSE)
2339 AC_PATH_PROG(MKDIR, mkdir, $FALSE)
2340 AC_PATH_PROG(LN, ln, cp)
2341
2342 AC_PATH_PROG(RM, rm, $FALSE)
2343 dnl Libtool 2.2.6 requires: rm -f
2344 RM="$RM -f"
2345
2346 dnl automake handles this AC_PATH_PROG(MAKEDEPEND, makedepend, $TRUE)
2347 AC_PROG_EGREP
2348
2349 AC_PATH_PROG(PERL, perl, none)
2350 if test "$ac_cv_path_PERL" = "none"; then
2351 AC_MSG_FAILURE([Perl is required to compile Squid. Please install Perl and then re-run configure ])
2352 fi
2353
2354 case "$host" in
2355 *-hp-hpux*)
2356 AC_MSG_NOTICE([Disabling 'ranlib' for HP-UX...])
2357 RANLIB=":"
2358 ;;
2359 esac
2360
2361 dnl set $(AR)
2362 AC_PATH_PROG(AR, ar, $FALSE)
2363 AR_R="$AR r"
2364 case "$host" in
2365 *-next-nextstep3)
2366 AR="libtool -o"
2367 ;;
2368 esac
2369 AC_SUBST(AR_R)
2370
2371 dnl Check for headers
2372 AC_HEADER_DIRENT
2373 AC_HEADER_STDC
2374
2375 AC_CHECK_HEADERS( \
2376 arpa/inet.h \
2377 arpa/nameser.h \
2378 assert.h \
2379 bstring.h \
2380 cassert \
2381 crypt.h \
2382 cstring \
2383 ctype.h \
2384 errno.h \
2385 execinfo.h \
2386 fcntl.h \
2387 fnmatch.h \
2388 getopt.h \
2389 glob.h \
2390 gnumalloc.h \
2391 grp.h \
2392 iosfwd \
2393 iomanip \
2394 iostream \
2395 ip_compat.h \
2396 ip_fil_compat.h \
2397 ip_fil.h \
2398 ip_nat.h \
2399 ipl.h \
2400 libc.h \
2401 limits.h \
2402 linux/types.h \
2403 machine/byte_swap.h \
2404 malloc.h \
2405 math.h \
2406 memory.h \
2407 mount.h \
2408 netdb.h \
2409 netinet/in.h \
2410 netinet/in_systm.h \
2411 netinet/ip_fil_compat.h \
2412 openssl/err.h \
2413 openssl/md5.h \
2414 openssl/ssl.h \
2415 netinet/tcp.h \
2416 openssl/engine.h \
2417 ostream \
2418 paths.h \
2419 poll.h \
2420 pwd.h \
2421 shadow.h \
2422 regex.h \
2423 sched.h \
2424 signal.h \
2425 sstream \
2426 stdarg.h \
2427 stddef.h \
2428 stdexcept \
2429 stdio.h \
2430 stdlib.h \
2431 string \
2432 string.h \
2433 strings.h \
2434 sys/bitypes.h \
2435 sys/bswap.h \
2436 sys/endian.h \
2437 sys/file.h \
2438 sys/ioctl.h \
2439 sys/param.h \
2440 sys/prctl.h \
2441 sys/md5.h \
2442 sys/msg.h \
2443 sys/resource.h \
2444 sys/select.h\
2445 sys/socket.h \
2446 sys/stat.h \
2447 sys/statvfs.h \
2448 syscall.h \
2449 sys/syscall.h \
2450 sys/time.h \
2451 sys/types.h \
2452 sys/un.h \
2453 sys/vfs.h \
2454 sys/wait.h \
2455 syslog.h \
2456 time.h \
2457 unistd.h \
2458 utime.h \
2459 varargs.h \
2460 byteswap.h \
2461 glib.h \
2462 stdint.h \
2463 inttypes.h \
2464 grp.h \
2465 db.h \
2466 db_185.h
2467 )
2468
2469 AC_CHECK_HEADERS(
2470 linux/netfilter_ipv4.h \
2471 linux/netfilter_ipv4/ip_tproxy.h \
2472 ,,,
2473 SQUID_DEFAULT_INCLUDES
2474 #if HAVE_LIMITS_H
2475 #include <limits.h>
2476 #endif
2477 /* Netfilter ip(6)tables v1.4.0 has broken headers */
2478 #if HAVE_NETINET_IN_H
2479 #include <netinet/in.h>
2480 #endif
2481 )
2482
2483 dnl *BSD dont include the depenencies for all their net/ and netinet/ files
2484 dnl We must include a few basic type headers for them to work.
2485 AC_CHECK_HEADERS( \
2486 net/if.h \
2487 netinet/if_ether.h\
2488 netinet/icmp6.h \
2489 netinet/in.h \
2490 netinet/ip.h \
2491 netinet/ip6.h \
2492 netinet/ip_compat.h\
2493 netinet/ip_fil_compat.h\
2494 netinet/ip_fil.h\
2495 netinet/ip_icmp.h \
2496 netinet/ipl.h \
2497 netinet/ip_nat.h\
2498 net/pf/pfvar.h \
2499 net/pfvar.h \
2500 sys/mount.h\
2501 resolv.h \
2502 ,,,
2503 SQUID_BSDNET_INCLUDES)
2504
2505 AC_CHECK_HEADERS([libxml/parser.h], [], [
2506 SAVED_CPPFLAGS="$CPPFLAGS"
2507 CPPFLAGS="-I/usr/include/libxml2 $CPPFLAGS"
2508 unset ac_cv_header_libxml_parser_h
2509 AC_CHECK_HEADERS([libxml/parser.h], [ac_cv_libxml2_include=yes], [])
2510 CPPFLAGS="$SAVED_CPPFLAGS"
2511 ])
2512 if test "x$ac_cv_libxml2_include" = "xyes"; then
2513 SQUID_CXXFLAGS="-I/usr/include/libxml2 $SQUID_CXXFLAGS"
2514 fi
2515
2516 AC_C_CONST
2517 AC_C_BIGENDIAN
2518
2519 AC_STRUCT_TM
2520 AC_CHECK_MEMBERS([struct tm.tm_gmtoff],,,[
2521 #if TM_IN_SYS_TIME
2522 #if HAVE_SYS_TIME_H
2523 #include <sys/time.h>
2524 #endif
2525 #elif HAVE_TIME_H
2526 #include <time.h>
2527 #endif
2528 ])
2529
2530 AC_CHECK_TYPE(struct mallinfo,AC_DEFINE(HAVE_STRUCT_MALLINFO,1,[The system provides struct mallinfo]),,[
2531 #if HAVE_SYS_TYPES_H
2532 #include <sys/types.h>
2533 #endif
2534 #if HAVE_MALLOC_H
2535 #include <malloc.h>
2536 #endif])
2537
2538 AC_CHECK_MEMBERS([struct mallinfo.mxfast],,,[
2539 #if HAVE_SYS_TYPES_H
2540 #include <sys/types.h>
2541 #endif
2542 #if HAVE_MALLOC_H
2543 #include <malloc.h>
2544 #endif])
2545
2546 dnl Override rusage() detect on MinGW because is emulated in source code
2547 case "$host_os" in
2548 mingw|mingw32)
2549 AC_DEFINE(HAVE_STRUCT_RUSAGE)
2550 ac_cv_func_getrusage='yes'
2551 AC_MSG_NOTICE([Using own rusage on Windows.])
2552 ;;
2553 *)
2554 AC_CHECK_TYPE(struct rusage,AC_DEFINE(HAVE_STRUCT_RUSAGE,1,[The system provides struct rusage]),,[
2555 #if HAVE_SYS_TIME_H
2556 #include <sys/time.h>
2557 #endif
2558 #if HAVE_SYS_RESOURCE_H
2559 #include <sys/resource.h>
2560 #endif])
2561 ;;
2562 esac
2563
2564 AC_CHECK_MEMBERS([struct iphdr.ip_hl],,,[
2565 #if HAVE_SYS_TYPES_H
2566 #include <sys/types.h>
2567 #endif
2568 #include <netinet/in.h>
2569 #include <netinet/in_systm.h>
2570 #include <netinet/ip.h>
2571 #if defined (__linux__) || defined (__CYGWIN__)
2572 #define ip_hl ihl
2573 #endif
2574 #ifndef __linux__
2575 #ifndef __CYGWIN__
2576 #define iphdr ip
2577 #endif
2578 #endif])
2579
2580 dnl Check for typedefs
2581 AC_CHECK_SIZEOF(void *)
2582
2583 dnl 8 bit integers - int8_t
2584 dnl if this is defined we trust it to be 8 bits
2585 AC_CHECK_TYPE(int8_t,[
2586 AC_CHECK_SIZEOF(int8_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2587 AC_DEFINE(HAVE_INT8_T,1,[int8_t is defined in system headers])
2588 ],,SQUID_DEFAULT_INCLUDES)
2589
2590 dnl fallback #1
2591 AC_CHECK_TYPE(char,[
2592 AC_CHECK_SIZEOF(char,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2593 AC_DEFINE(HAVE_CHAR,1,[char is defined in system headers])
2594 ],,SQUID_DEFAULT_INCLUDES)
2595
2596 dnl unsigned 8 bit ints - u_int8_t
2597 dnl if this is defined we trust it to be 8 bits
2598 AC_CHECK_TYPE(u_int8_t,[
2599 AC_CHECK_SIZEOF(u_int8_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2600 AC_DEFINE(HAVE_U_INT8_T,1,[u_int8_t is defined in system headers])
2601 ],,SQUID_DEFAULT_INCLUDES)
2602
2603 dnl fallback #1
2604 dnl if this is defined we trust it to be 8 bits
2605 AC_CHECK_TYPE(uint8_t,[
2606 AC_CHECK_SIZEOF(uint8_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2607 AC_DEFINE(HAVE_UINT8_T,1,[uint8_t is defined in system headers])
2608 ],,SQUID_DEFAULT_INCLUDES)
2609
2610 dnl 16 bit integers - int16_t
2611 dnl if this is defined we trust it to be 16 bits
2612 AC_CHECK_TYPE(int16_t,[
2613 AC_CHECK_SIZEOF(int16_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2614 AC_DEFINE(HAVE_INT16_T,1,[int16_t is defined in system headers])
2615 ],,SQUID_DEFAULT_INCLUDES)
2616
2617 dnl fallback #1
2618 AC_CHECK_TYPE(short,[
2619 AC_CHECK_SIZEOF(short,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2620 AC_DEFINE(HAVE_SHORT,1,[short is defined in system headers])
2621 ],,SQUID_DEFAULT_INCLUDES)
2622
2623 dnl fallback #2
2624 AC_CHECK_TYPE(int,[
2625 AC_CHECK_SIZEOF(int,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2626 AC_DEFINE(HAVE_INT,1,[int is defined in system headers])
2627 ],,SQUID_DEFAULT_INCLUDES)
2628
2629 dnl unsigned 16 bit ints - u_int16_t
2630 dnl if this is defined we trust it to be 16 bits
2631 AC_CHECK_TYPE(u_int16_t,[
2632 AC_CHECK_SIZEOF(u_int16_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2633 AC_DEFINE(HAVE_U_INT16_T,1,[u_int16_t is defined in system headers])
2634 ],,SQUID_DEFAULT_INCLUDES)
2635
2636 dnl fallback #1
2637 dnl if this is defined we trust it to be 16 bits
2638 AC_CHECK_TYPE(uint16_t,[
2639 AC_CHECK_SIZEOF(uint16_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2640 AC_DEFINE(HAVE_UINT16_T,1,[uint16_t is defined in system headers])
2641 ],,SQUID_DEFAULT_INCLUDES)
2642
2643 dnl 32 bit signed int - int32_t
2644 dnl if this is defined we trust it to be 32 bits
2645 AC_CHECK_TYPE(int32_t,[
2646 AC_CHECK_SIZEOF(int32_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2647 AC_DEFINE(HAVE_INT32_T,1,[int32_t is defined in system headers])
2648 ],,SQUID_DEFAULT_INCLUDES)
2649
2650 dnl fallback #1
2651 AC_CHECK_TYPE(long,[
2652 AC_CHECK_SIZEOF(long,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2653 AC_DEFINE(HAVE_LONG,1,[long is defined in system headers])
2654 ],,SQUID_DEFAULT_INCLUDES)
2655
2656 dnl 32 bit unsigned int - u_int32_t
2657 dnl if this is defined we trust it to be 32 bits
2658 AC_CHECK_TYPE(u_int32_t,[
2659 AC_CHECK_SIZEOF(u_int32_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2660 AC_DEFINE(HAVE_U_INT32_T,1,[u_int32_t is defined in system headers])
2661 ],,SQUID_DEFAULT_INCLUDES)
2662
2663 dnl fallback #1
2664 dnl if this is defined we trust it to be 32 bits
2665 AC_CHECK_TYPE(uint32_t,[
2666 AC_CHECK_SIZEOF(uint32_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2667 AC_DEFINE(HAVE_UINT32_T,1,[uint32_t is defined in system headers])
2668 ],,SQUID_DEFAULT_INCLUDES)
2669
2670 dnl 64 bit signed - int64_t
2671 dnl if this is defind we trust it to be 64 bits
2672 AC_CHECK_TYPE(int64_t,[
2673 AC_CHECK_SIZEOF(int64_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2674 AC_DEFINE(HAVE_INT64_T,1,[int64_t is defined in system headers])
2675 ],,SQUID_DEFAULT_INCLUDES)
2676
2677 dnl fallback #1
2678 dnl if this is defind we trust it to be 64 bits
2679 AC_CHECK_TYPE(__int64,[
2680 AC_CHECK_SIZEOF(__int64,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2681 AC_DEFINE(HAVE___INT64,1,[__int64 is defined in system headers])
2682 ],,SQUID_DEFAULT_INCLUDES)
2683
2684 dnl fallback #2
2685 AC_CHECK_TYPE(long long,[
2686 AC_CHECK_SIZEOF(long long,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2687 AC_DEFINE(HAVE_LONG_LONG,1,[long long is defined in system headers])
2688 ],,SQUID_DEFAULT_INCLUDES)
2689
2690 dnl 64 bit unsigned - u_int64_t
2691 dnl if this is defind we trust it to be 64 bits
2692 AC_CHECK_TYPE(u_int64_t,[
2693 AC_CHECK_SIZEOF(u_int64_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2694 AC_DEFINE(HAVE_U_INT64_T,1,[u_int64_t is defined in system headers])
2695 ],,SQUID_DEFAULT_INCLUDES)
2696
2697 dnl fallback #1
2698 dnl if this is defind we trust it to be 64 bits
2699 AC_CHECK_TYPE(uint64_t,[
2700 AC_CHECK_SIZEOF(uint64_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2701 AC_DEFINE(HAVE_UINT64_T,1,[uint64_t is defined in system headers])
2702 ],,SQUID_DEFAULT_INCLUDES)
2703
2704 dnl On Solaris 9 x86, gcc may includes a "fixed" set of old system include files
2705 dnl that is incompatible with the updated Solaris header files.
2706 dnl For this reason, we must check if pad128_t and upad128_t are defined.
2707 AC_CHECK_TYPE(pad128_t,
2708 AC_DEFINE(HAVE_PAD128_T,1,[pad128_t is defined in system headers]),
2709 ,SQUID_DEFAULT_INCLUDES)
2710
2711 AC_CHECK_TYPE(upad128_t,
2712 AC_DEFINE(HAVE_UPAD128_T,1,[upad128_t is defined in system headers]),
2713 ,SQUID_DEFAULT_INCLUDES)
2714
2715 AC_CHECK_TYPE(pid_t, AC_DEFINE(HAVE_PID_T,1,[pid_t is defined by the system headers]),,SQUID_DEFAULT_INCLUDES)
2716 AC_CHECK_TYPE(size_t, [AC_CHECK_SIZEOF(size_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2717 AC_DEFINE(HAVE_SIZE_T,1,[size_t is defined by the system headers])],,SQUID_DEFAULT_INCLUDES)
2718 AC_CHECK_TYPE(ssize_t, AC_DEFINE(HAVE_SSIZE_T,1,[ssize_t is defined by the system headers]),,SQUID_DEFAULT_INCLUDES)
2719 AC_CHECK_TYPE(off_t,[ AC_CHECK_SIZEOF(off_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2720 AC_DEFINE(HAVE_OFF_T,1,[off_t is defined by the system headers])],,SQUID_DEFAULT_INCLUDES)
2721 AC_CHECK_TYPE(mode_t, AC_DEFINE(HAVE_MODE_T,1,[mode_t is defined by the system headers]),,SQUID_DEFAULT_INCLUDES)
2722 AC_CHECK_TYPE(fd_mask, AC_DEFINE(HAVE_FD_MASK,1,[fd_mask is defined by the system headers]),,SQUID_DEFAULT_INCLUDES)
2723
2724 dnl Check for special functions
2725 AC_FUNC_ALLOCA
2726
2727 AC_CHECK_TYPE(socklen_t,AC_DEFINE(HAVE_SOCKLEN_T,1,[socklen_t is defined by the system headers]),,[
2728 #include <sys/types.h>
2729 #include <sys/socket.h>
2730 #if STDC_HEADERS
2731 #include <stdlib.h>
2732 #include <stddef.h>
2733 #endif])
2734
2735 dnl Check for libcap header (assume its not broken unless
2736 use_caps=yes
2737 AC_ARG_ENABLE(caps, AS_HELP_STRING([--disable-caps],[disable usage of Linux capabilities library to control privileges]),
2738 [ if test "x$enableval" = "xyes" ; then
2739 AC_MSG_RESULT(forced yes)
2740 else
2741 AC_MSG_RESULT(no)
2742 use_caps=no
2743 fi
2744 ],[AC_MSG_RESULT(yes)])
2745 if test "x$use_caps" = "xyes"; then
2746 dnl Check for libcap1 breakage or libcap2 fixed (assume broken unless found working)
2747 libcap_broken=1
2748 AC_CHECK_HEADERS(sys/capability.h)
2749 AC_CACHE_CHECK([for operational libcap2], $libcap_broken,
2750 AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <sys/capability.h>]], [[
2751 capget(NULL, NULL);
2752 capset(NULL, NULL);
2753 ]])],[libcap_broken=0],[])
2754 )
2755 AC_DEFINE_UNQUOTED([LIBCAP_BROKEN],$libcap_broken,[if libcap2 is available and not clashing with libc])
2756 fi
2757
2758 AC_CHECK_TYPE(mtyp_t,AC_DEFINE(HAVE_MTYP_T,1,[mtyp_t is defined by the system headers]),,[#include <sys/types.h>
2759 #include <sys/ipc.h>
2760 #include <sys/msg.h>])
2761
2762 dnl Check for needed libraries
2763 AC_CHECK_LIB(nsl, main)
2764 AC_CHECK_LIB(socket, main)
2765 dnl Check for Winsock only on MinGW, on Cygwin we must use emulated BSD socket API
2766 case "$host_os" in
2767 mingw|mingw32)
2768 AC_MSG_CHECKING(for winsock)
2769 save_LIBS="$LIBS"
2770 for curlib in ws2_32 wsock32; do
2771 LIBS="$LIBS -l$curlib"
2772 AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <winsock.h>]], [[
2773 socket(0,0,0);
2774 select(0,NULL,NULL,NULL,NULL);
2775 closesocket(0);
2776 gethostname(NULL,0);
2777 ]])],[have_winsock=yes],[have_winsock=no])
2778
2779 if test $have_winsock = yes; then
2780 ac_cv_func_select='yes'
2781 if test $curlib = ws2_32; then
2782 have_winsock=winsock2
2783 fi
2784 break
2785 fi
2786 LIBS="$save_LIBS"
2787 done
2788 AC_MSG_RESULT($have_winsock)
2789 if test $have_winsock = winsock2; then
2790 AC_CHECK_HEADERS(winsock2.h)
2791 else
2792 AC_CHECK_HEADERS(winsock.h)
2793 fi
2794 ;;
2795 esac
2796
2797 dnl Ripped from the Samba sources
2798 AC_CACHE_CHECK([for unix domain sockets],squid_cv_unixsocket, [
2799 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
2800 #include <sys/types.h>
2801 #include <stdlib.h>
2802 #include <stddef.h>
2803 #include <sys/socket.h>
2804 #include <sys/un.h>]], [[
2805 struct sockaddr_un sunaddr;
2806 sunaddr.sun_family = AF_UNIX;
2807 ]])],[squid_cv_unixsocket=yes],[squid_cv_unixsocket=no])])
2808 if test x"$squid_cv_unixsocket" = x"yes"; then
2809 AC_DEFINE(HAVE_UNIXSOCKET,1,[Do we have unix sockets? (required for the winbind ntlm helper])
2810 fi
2811 dnl end rip
2812
2813 AC_CHECK_LIB(gnumalloc, main)
2814 if test "$ac_cv_lib_gnumalloc_main" = "yes"; then
2815 AC_MSG_NOTICE([Disabling extended malloc functions when using gnumalloc])
2816 ac_cv_func_mallinfo=no
2817 ac_cv_func_mallocblksize=no
2818 ac_cv_func_mallopt=no
2819 else
2820 case "$host" in
2821 *-sun-solaris*)
2822 AC_MSG_NOTICE([skipping libmalloc check for $host])
2823 ;;
2824 i386-*-freebsd*)
2825 AC_MSG_NOTICE([skipping libmalloc check for $host])
2826 ;;
2827 *)
2828
2829 AC_CHECK_LIB(malloc, main)
2830 ;;
2831 esac
2832 fi
2833
2834 AC_CHECK_LIB(bsd, main)
2835 AC_CHECK_LIB(regex, main, [REGEXLIB="-lregex"])
2836 AC_CHECK_LIB(bind, gethostbyname)
2837 if test $ac_cv_lib_bind_gethostbyname = "no" ; then
2838 case "$host" in
2839 i386-*-freebsd*)
2840 AC_MSG_NOTICE([skipping libresolv checks for $host])
2841 ;;
2842 *)
2843 AC_CHECK_LIB(resolv, main)
2844 ;;
2845 esac
2846 fi
2847 case "$host_os" in
2848 mingw|mingw32)
2849 AC_MSG_NOTICE([Use MSVCRT for math functions.])
2850 ;;
2851 *)
2852 AC_CHECK_LIB(m, main)
2853 ;;
2854 esac
2855
2856 dnl Enable IPv6 support
2857 AC_MSG_CHECKING([whether to enable IPv6])
2858 use_ipng=yes
2859 AC_ARG_ENABLE(ipv6,
2860 AS_HELP_STRING([--disable-ipv6],[Disable IPv6 support]),
2861 [ if test "x$enableval" = "xyes" ; then
2862 AC_MSG_RESULT(yes)
2863 else
2864 AC_MSG_RESULT(no)
2865 use_ipng=no
2866 fi
2867 ],[AC_MSG_RESULT(yes)])
2868
2869 if test "$use_ipng" = "yes"; then
2870 SAVED_LIBS="$LIBS"
2871 dnl Solaris 10/11 requires -lsocket
2872 case "$host" in
2873 *-solaris*)
2874 LIBS="$LIBS -lsocket"
2875 ;;
2876 *)
2877 ;;
2878 esac
2879 AC_CACHE_CHECK([if PF_INET6 is available], $use_ipng,
2880 AC_RUN_IFELSE([AC_LANG_SOURCE([[ /* PF_INET6 available check */
2881 # include <sys/types.h>
2882 # include <sys/socket.h>
2883 int main(int argc, char **argv) {
2884 if (socket(PF_INET6, SOCK_STREAM, 0) < 0)
2885 return 1;
2886 else
2887 return 0;
2888 }
2889 ]])],[ AC_MSG_RESULT(yes)
2890 use_ipng=yes
2891 SAVED_LIBS="$LIBS" ],[ AC_MSG_RESULT(no)
2892 use_ipng=no ],[])
2893 )
2894 LIBS="$SAVED_LIBS"
2895 fi
2896
2897 if test "$use_ipng" = "yes"; then
2898 AC_DEFINE(USE_IPV6,1,[Enable support for IPv6 ])
2899 use_v4mapped=yes
2900
2901 dnl Check for forced split-stack mode
2902 AC_MSG_CHECKING([for IPv6 split-stack requirement])
2903 AC_ARG_WITH(ipv6-split-stack,
2904 AS_HELP_STRING([--with-ipv6-split-stack],[Force-Enable experimental split-stack support for Windows XP and *BSD. Requires IPv6.]),
2905 [ use_v4mapped="no"
2906 AC_MSG_RESULT(yes)],
2907 [ AC_MSG_RESULT(no) ])
2908
2909 dnl Check for IPv6 v4-mapping availability
2910 dnl Useful for other OS with hybrid-stack defaults turned OFF
2911 dnl But only usable if it actually works...
2912 if test "$use_v4mapped" = "yes" ; then
2913 AC_MSG_CHECKING([for IPv6 v4-mapping ability])
2914 AC_RUN_IFELSE([AC_LANG_SOURCE([[ /* IPPROTO_V4MAPPED is usable check */
2915 # include <sys/types.h>
2916 # include <sys/socket.h>
2917 # include <netinet/in.h>
2918 #if HAVE_NETINET_IN6_H
2919 # include <netinet/in6.h>
2920 #endif
2921 int main(int argc, char **argv) {
2922 int s = socket(PF_INET6, SOCK_STREAM, 0);
2923 int tos = 0;
2924 if (setsockopt(s, IPPROTO_IPV6, IPV6_V6ONLY, (char *) &tos, sizeof(int)) < 0)
2925 return 1;
2926 else
2927 return 0;
2928 }
2929 ]])],[ AC_MSG_RESULT(yes)
2930 use_v4mapped=yes
2931 AC_DEFINE(IPV6_SPECIAL_V4MAPPED, 1, [Enable v4-mapping through v6 sockets])
2932 ],[ AC_MSG_RESULT(no)
2933 AC_DEFINE(IPV6_SPECIAL_V4MAPPED, 0, [Enable v4-mapping through v6 sockets])
2934 use_v4mapped=no
2935 ],[])
2936 fi
2937
2938 dnl if we can't defer v4-mapping to the OS we are forced to split-stack the FD table.
2939 AC_MSG_CHECKING([for IPv6 stack type/mode])
2940 if test "$use_v4mapped" = "yes"; then
2941 AC_DEFINE(IPV6_SPECIAL_V4MAPPED, 1, [Enable v4-mapping through v6 sockets. Requires IPv6 hybrid-stack.])
2942 AC_DEFINE(IPV6_SPECIAL_SPLITSTACK, 0, [Enable support for IPv6 on split-stack implementations])
2943 AC_MSG_RESULT(mapping hybrid)
2944 else
2945 AC_DEFINE(IPV6_SPECIAL_V4MAPPED, 0, [Enable v4-mapping through v6 sockets. Requires IPv6 hybrid-stack.])
2946 AC_DEFINE(IPV6_SPECIAL_SPLITSTACK, 1, [Enable support for IPv6 on split-stack implementations])
2947 AC_MSG_RESULT(split-stack or BSD non-mapping dual-stack)
2948 fi
2949
2950 dnl Check whether this OS defines sin6_len as a member of sockaddr_in6 as a backup to ss_len
2951 AC_CACHE_CHECK([for sin6_len field in struct sockaddr_in6],
2952 ac_cv_have_sin6_len_in_struct_sai, [
2953 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
2954 #include <sys/types.h>
2955 #include <sys/socket.h>
2956 #include <netinet/in.h>
2957 ]], [[ struct sockaddr_in6 s; s.sin6_len = 1; ]])],[ ac_cv_have_sin6_len_in_struct_sai="yes" ],[ ac_cv_have_sin6_len_in_struct_sai="no"
2958 ])
2959 ])
2960 if test "x$ac_cv_have_sin6_len_in_struct_sai" = "xyes" ; then
2961 AC_DEFINE(HAVE_SIN6_LEN_IN_SAI, 1, [Does struct sockaddr_in6 have sin6_len? 1: Yes, 0: No])
2962 else
2963 AC_DEFINE(HAVE_SIN6_LEN_IN_SAI, 0, [Does struct sockaddr_in6 have sin6_len? 1: Yes, 0: No])
2964 fi
2965
2966 else
2967 # NP: semi-silent failure as IPv4-only mode is perfectly usable on this system.
2968 AC_MSG_WARN([IPv6 is not available on this system.])
2969 AC_DEFINE(USE_IPV6,0,[Enable support for IPv6])
2970 AC_DEFINE(IPV6_SPECIAL_SPLITSTACK,0,[Enable support for IPv6 on split-stack implementations])
2971 AC_DEFINE(IPV6_SPECIAL_V4MAPPED,0,[Enable v4-mapping through v6 sockets])
2972 fi
2973
2974 dnl Check whether this OS defines ss_len as a member of sockaddr_storage
2975 AC_CACHE_CHECK([for ss_len field in struct sockaddr_storage],
2976 ac_cv_have_ss_len_in_struct_ss, [
2977 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
2978 #include <sys/types.h>
2979 #include <sys/socket.h>
2980 #include <netinet/in.h>
2981 ]], [[ struct sockaddr_storage s; s.ss_len = 1; ]])],[ ac_cv_have_ss_len_in_struct_ss="yes" ],[ ac_cv_have_ss_len_in_struct_ss="no"
2982 ])
2983 ])
2984 if test "x$ac_cv_have_ss_len_in_struct_ss" = "xyes" ; then
2985 AC_DEFINE(HAVE_SS_LEN_IN_SS, 1, [Does struct sockaddr_storage have ss_len? 1: Yes, 0: No])
2986 else
2987 AC_DEFINE(HAVE_SS_LEN_IN_SS, 0, [Does struct sockaddr_storage have ss_len? 1: Yes, 0: No])
2988 fi
2989
2990 dnl Check whether this OS defines sin_len as a member of sockaddr_in as a backup to ss_len
2991 AC_CACHE_CHECK([for sin_len field in struct sockaddr_in],
2992 ac_cv_have_sin_len_in_struct_sai, [
2993 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
2994 #include <sys/types.h>
2995 #include <sys/socket.h>
2996 #include <netinet/in.h>
2997 ]], [[ struct sockaddr_in s; s.sin_len = 1; ]])],[ ac_cv_have_sin_len_in_struct_sai="yes" ],[ ac_cv_have_sin_len_in_struct_sai="no"
2998 ])
2999 ])
3000 if test "x$ac_cv_have_sin_len_in_struct_sai" = "xyes" ; then
3001 AC_DEFINE(HAVE_SIN_LEN_IN_SAI, 1, [Does struct sockaddr_in have sin_len? 1: Yes, 0: No])
3002 else
3003 AC_DEFINE(HAVE_SIN_LEN_IN_SAI, 0, [Does struct sockaddr_in have sin_len? 1: Yes, 0: No])
3004 fi
3005
3006 dnl Check for libcrypt
3007 dnl Some of our helpers use crypt(3) which may be in libc, or in
3008 dnl libcrypt (eg FreeBSD)
3009 AC_CHECK_LIB(crypt, crypt, [CRYPTLIB="-lcrypt"])
3010 dnl Solaris10 provides MD5 natively through libmd5
3011 AC_CHECK_LIB(md5, MD5Init, [CRYPTLIB="$CRYPTLIB -lmd5"])
3012 AC_SUBST(CRYPTLIB)
3013
3014 dnl Check for libdl, used by auth_modules/PAM
3015 if test "$with_dl" = "yes"; then
3016 AC_CHECK_LIB(dl, dlopen)
3017 fi
3018
3019 dnl -lintl is needed on SCO version 3.2v4.2 for strftime()
3020 dnl Robert Side <rside@aiinc.bc.ca>
3021 dnl Mon, 18 Jan 1999 17:48:00 GMT
3022 case "$host" in
3023 *-pc-sco3.2*)
3024 AC_CHECK_LIB(intl, strftime)
3025 ;;
3026 esac
3027
3028 dnl On MinGW OpenLDAP is not available, so LDAP helpers can be linked
3029 dnl only with Windows LDAP libraries using -lwldap32
3030 case "$host_os" in
3031 mingw|mingw32)
3032 LIB_LDAP="-lwldap32"
3033 LIB_LBER=""
3034 ;;
3035 *)
3036 LIB_LDAP="-lldap"
3037 dnl LDAP helpers need to know if -llber is needed or not
3038 AC_CHECK_LIB(lber, main, [LIB_LBER="-llber"])
3039 ;;
3040 esac
3041 AC_SUBST(LIB_LDAP)
3042 AC_SUBST(LIB_LBER)
3043
3044 dnl Check for libdb
3045 DBLIB=
3046 dnl 1.85
3047 AC_CACHE_CHECK(if dbopen needs -ldb,ac_cv_dbopen_libdb, [
3048 SAVED_LIBS="$LIBS"; LIBS="$LIBS -ldb"
3049 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
3050 #if HAVE_SYS_TYPES_H
3051 #include <sys/types.h>
3052 #endif
3053 #if HAVE_LIMITS_H
3054 #include <limits.h>
3055 #endif
3056 #if HAVE_DB_185_H
3057 #include <db_185.h>
3058 #elif HAVE_DB_H
3059 #include <db.h>
3060 #endif]], [[dbopen("", 0, 0, DB_HASH, (void *)0L)]])],[ac_cv_dbopen_libdb="yes"],[ac_cv_dbopen_libdb="no"])
3061 LIBS="$SAVED_LIBS"
3062 ])
3063 if test $ac_cv_dbopen_libdb = yes; then
3064 LIB_DB="-ldb"
3065 fi
3066 AC_SUBST(LIB_DB)
3067
3068 dnl System-specific library modifications
3069 dnl
3070 case "$host" in
3071 i386-*-solaris2.*)
3072 if test "$GCC" = "yes"; then
3073 AC_MSG_NOTICE([Removing -O for gcc on $host])
3074 CFLAGS="`echo $CFLAGS | sed -e 's/-O[[0-9]]*//'`"
3075 fi
3076 ;;
3077 *-sgi-irix*)
3078 AC_MSG_NOTICE([Removing -lsocket for IRIX...])
3079 LIBS=`echo $LIBS | sed -e s/-lsocket//`
3080 AC_MSG_NOTICE([Removing -lnsl for IRIX...])
3081 LIBS=`echo $LIBS | sed -e s/-lnsl//`
3082 ac_cv_lib_nsl_main=no
3083 AC_MSG_NOTICE([Removing -lbsd for IRIX...])
3084 LIBS=`echo $LIBS | sed -e s/-lbsd//`
3085 ;;
3086 dnl From: c0032033@ws.rz.tu-bs.de (Joerg Schumacher)
3087 dnl Date: Thu, 17 Oct 1996 04:09:30 +0200
3088 dnl Please change your configure script. AIX doesn't need -lbsd.
3089 *-ibm-aix*)
3090 AC_MSG_NOTICE([Removing -lbsd for AIX...])
3091 LIBS=`echo $LIBS | sed -e s/-lbsd//`
3092 ;;
3093 *m88k*)
3094 SQUID_CFLAGS="$SQUID_CFLAGS -D_SQUID_MOTOROLA_"
3095 SQUID_CXXFLAGS="$SQUID_CXXFLAGS -D_SQUID_MOTOROLA_"
3096 AC_DEFINE(GETTIMEOFDAY_NO_TZP,1,[If gettimeofday is known to take only one argument])
3097 ;;
3098 [*-*-solaris2.[0-4]])
3099 AC_DEFINE(GETTIMEOFDAY_NO_TZP,1)
3100 ;;
3101 [*-sony-newsos[56]*])
3102 AC_DEFINE(GETTIMEOFDAY_NO_TZP,1)
3103 ;;
3104 esac
3105
3106 # Remove optimization for GCC 2.95.[123]
3107 # gcc -O[2] on *BSD and Linux (x86) causes pointers to magically become NULL
3108 if test "$GCC" = "yes"; then
3109 GCCVER=`$CC -v 2>&1 | awk '$2 == "version" {print $3}'`
3110 case "$GCCVER" in
3111 [2.95.[123]])
3112 AC_MSG_NOTICE([Removing -O for gcc on $host with GCC $GCCVER])
3113 CFLAGS="`echo $CFLAGS | sed -e 's/-O[[0-9]]*//'`"
3114 ;;
3115 esac
3116 fi
3117
3118 # Recommended by Balint Nagy Endre <bne@CareNet.hu>
3119 case "$host" in
3120 *-univel-sysv4.2MP)
3121 if test `uname -v` = "2.03"; then
3122 AC_MSG_NOTICE([disabling mallinfo for $host])
3123 ac_cv_func_mallinfo=no
3124 fi
3125 ;;
3126 esac
3127
3128 dnl This has to be before AC_CHECK_FUNCS
3129 # Disable poll() on certain platforms. Override by setting ac_cv_func_poll
3130 # when running configure.
3131 if test -z "$ac_cv_func_poll"; then
3132 case "$host" in
3133 [alpha-dec-osf3.*])
3134 # John Kay (jkay@nlanr.net) 19970818
3135 AC_MSG_NOTICE([disabling poll for $host...])
3136 ac_cv_func_poll='no'
3137 ;;
3138 [*-hp-hpux*.*])
3139 # Duane Wessels
3140 AC_MSG_NOTICE([disabling poll for $host...])
3141 ac_cv_func_poll='no'
3142 ;;
3143 [*-linux-*])
3144 # Henrik Nordstrom (hno@squid-cache.org) 19980817
3145 # poll is problematic on Linux. We disable it
3146 # by default until Linux gets it right.
3147 rev=`uname -r | awk -F. '{printf "%03d%03d",$1,$2}'`
3148 if test $rev -lt 002002; then
3149 AC_MSG_NOTICE([disabling poll for $host < 2.2...])
3150 ac_cv_func_poll='no'
3151 fi
3152 ;;
3153 [powerpc-ibm-aix4.1.*])
3154 # Mike Laster (mlaster@metavillage.com) 19981021
3155 AC_MSG_NOTICE([disabling poll for $host...])
3156 ac_cv_func_poll='no'
3157 ;;
3158 [*-pc-sco3.2*])
3159 # Robert Side <rside@aiinc.bc.ca>
3160 # Mon, 18 Jan 1999 17:48:00 GMT
3161 AC_MSG_NOTICE([disabling poll for $host...])
3162 ac_cv_func_poll='no'
3163 ;;
3164 esac
3165 fi
3166
3167 dnl Override statfs() detect on MinGW becasue is emulated in source code
3168 case "$host_os" in
3169 mingw|mingw32)
3170 ac_cv_func_statfs='yes'
3171 ;;
3172 esac
3173
3174 dnl Check for library functions
3175 AC_CHECK_FUNCS(\
3176 backtrace_symbols_fd \
3177 bcopy \
3178 bswap_16 \
3179 bswap_32 \
3180 bswap16 \
3181 bswap32 \
3182 fchmod \
3183 getdtablesize \
3184 getpagesize \
3185 getpass \
3186 getrlimit \
3187 getrusage \
3188 getspnam \
3189 gettimeofday \
3190 glob \
3191 htobe16 \
3192 htole16 \
3193 kqueue\
3194 lrand48 \
3195 mallinfo \
3196 mallocblksize \
3197 mallopt \
3198 memcpy \
3199 memmove \
3200 memset \
3201 mkstemp \
3202 mktime \
3203 mstats \
3204 poll \
3205 prctl \
3206 pthread_attr_setschedparam \
3207 pthread_attr_setscope \
3208 pthread_setschedparam \
3209 pthread_sigmask \
3210 putenv \
3211 random \
3212 regcomp \
3213 regexec \
3214 regfree \
3215 res_init \
3216 __res_init \
3217 rint \
3218 sbrk \
3219 select \
3220 seteuid \
3221 setgroups \
3222 setpgrp \
3223 setrlimit \
3224 setsid \
3225 sigaction \
3226 snprintf \
3227 socketpair \
3228 srand48 \
3229 srandom \
3230 statfs \
3231 sysconf \
3232 syslog \
3233 timegm \
3234 vsnprintf \
3235 )
3236 dnl ... and some we provide local replacements for
3237 AC_REPLACE_FUNCS(\
3238 drand48 \
3239 inet_ntop \
3240 inet_pton \
3241 initgroups \
3242 getaddrinfo \
3243 getnameinfo \
3244 strerror \
3245 strsep \
3246 strtoll \
3247 tempnam \
3248 )
3249
3250 # check for crypt, may require -lcrypt
3251 SAVED_LIBS="$LIBS"
3252 LIBS="$LIBS $CRYPTLIB"
3253 AC_CHECK_FUNCS(crypt)
3254 LIBS="$SAVED_LIBS"
3255
3256 dnl Magic which checks whether we are forcing a type of comm loop we
3257 dnl are actually going to (ab)use
3258
3259 dnl Actually do the define magic now
3260 dnl mostly ripped from squid-commloops, thanks to adrian and benno
3261
3262 if test -n "$SELECT_TYPE"; then
3263 : # Already decided above. Nothing to do here
3264 elif test -z "$disable_epoll" && test "$ac_cv_epoll_works" = "yes" ; then
3265 SELECT_TYPE="epoll"
3266 elif test -z "$disable_kqueue" && test "$ac_cv_func_kqueue" = "yes" ; then
3267 SELECT_TYPE="kqueue"
3268 elif test -z "$disable_poll" && test "$ac_cv_func_poll" = "yes" ; then
3269 SELECT_TYPE="poll"
3270 elif test -z "$disable_select" && test "$ac_cv_func_select" = "yes" ; then
3271 case "$host_os" in
3272 mingw|mingw32)
3273 SELECT_TYPE="select_win32"
3274 ;;
3275 *)
3276 SELECT_TYPE="select"
3277 ;;
3278 esac
3279 else
3280 AC_MSG_WARN([Eep! Can't find poll, kqueue, epoll, or select!])
3281 AC_MSG_WARN([I'll try select and hope for the best.])
3282 SELECT_TYPE="select"
3283 AC_DEFINE(USE_SELECT,1)
3284 fi
3285
3286 AC_MSG_NOTICE([Using ${SELECT_TYPE} for the IO loop.])
3287
3288 AM_CONDITIONAL([USE_POLL], [test $SELECT_TYPE = poll])
3289 AM_CONDITIONAL([USE_EPOLL], [test $SELECT_TYPE = epoll])
3290 AM_CONDITIONAL([USE_SELECT], [test $SELECT_TYPE = select])
3291 AM_CONDITIONAL([USE_SELECT_SIMPLE], [test $SELECT_TYPE = select_simple])
3292 AM_CONDITIONAL([USE_SELECT_WIN32], [test $SELECT_TYPE = select_win32])
3293 AM_CONDITIONAL([USE_KQUEUE], [test $SELECT_TYPE = kqueue])
3294 AM_CONDITIONAL([USE_DEVPOLL], [test $SELECT_TYPE = devpoll])
3295
3296 case $SELECT_TYPE in
3297 epoll)
3298 AC_DEFINE(USE_EPOLL,1,[Use epoll() for the IO loop])
3299 ;;
3300 poll)
3301 AC_DEFINE(USE_POLL,1,[Use poll() for the IO loop])
3302 ;;
3303 kqueue)
3304 AC_DEFINE(USE_KQUEUE,1,[Use kqueue() for the IO loop])
3305 ;;
3306 select_win32)
3307 AC_DEFINE(USE_SELECT_WIN32,1,[Use Winsock select() for the IO loop])
3308 ;;
3309 select)
3310 AC_DEFINE(USE_SELECT,1,[Use select() for the IO loop])
3311 ;;
3312 esac
3313
3314
3315
3316 dnl Yay! Another Linux brokenness. Its not good enough
3317 dnl to know that setresuid() exists, because RedHat 5.0 declares
3318 dnl setresuid() but doesn't implement it.
3319 dnl
3320 AC_CACHE_CHECK(if setresuid is implemented, ac_cv_func_setresuid,
3321 AC_RUN_IFELSE([AC_LANG_SOURCE([[
3322 #include <stdlib.h>
3323 int main(int argc, char **argv) {
3324 if(setresuid(-1,-1,-1)) {
3325 perror("setresuid:");
3326 return 1;
3327 }
3328 return 0;
3329 }
3330 ]])],[ac_cv_func_setresuid="yes"],[ac_cv_func_setresuid="no"],[])
3331 )
3332 if test "$ac_cv_func_setresuid" = "yes" ; then
3333 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.])
3334 fi
3335
3336 dnl Yay! This one is a MacOSX brokenness. Its not good enough
3337 dnl to know that strnstr() exists, because MacOSX 10.4 have a bad
3338 dnl copy that crashes with a buffer over-run!
3339 dnl
3340 AC_CACHE_CHECK(if strnstr is well implemented, ac_cv_func_strnstr,
3341 AC_RUN_IFELSE([AC_LANG_SOURCE([[
3342 #include <stdlib.h>
3343 #include <stdio.h>
3344 #include <string.h>
3345 // we expect this to succeed, or crash on over-run.
3346 // if it passes otherwise we may need a better check.
3347 int main(int argc, char **argv)
3348 {
3349 int size = 20;
3350 char *str = malloc(size);
3351 memset(str, 'x', size);
3352 strnstr(str, "fubar", size);
3353 return 0;
3354 }
3355 ]])],[ac_cv_func_strnstr="yes"],[ac_cv_func_strnstr="no"],[])
3356 )
3357 if test "$ac_cv_func_strnstr" = "yes" ; then
3358 AC_DEFINE(HAVE_STRNSTR,1,[Yay! We have a working strnstr!])
3359 else
3360 AC_DEFINE(HAVE_STRNSTR,0,[Yay! A MacOS X brokenness. Its not good enough to know that strnstr() exists, because MacOSX 10.4 and earlier may have a buffer overrun.])
3361 fi
3362
3363 dnl
3364 dnl Test for va_copy
3365 dnl
3366 AC_CACHE_CHECK(if va_copy is implemented, ac_cv_func_va_copy,
3367 AC_RUN_IFELSE([AC_LANG_SOURCE([[
3368 #include <stdarg.h>
3369 #include <stdlib.h>
3370 int f (int i, ...) {
3371 va_list args1, args2;
3372 va_start (args1, i);
3373 va_copy (args2, args1);
3374 if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42)
3375 return 1;
3376 va_end (args1); va_end (args2);
3377 return 0;
3378 }
3379 int main(int argc, char **argv) { return f (0, 42); }
3380 ]])],[ac_cv_func_va_copy="yes"],[ac_cv_func_va_copy="no"],[])
3381 )
3382 if test "$ac_cv_func_va_copy" = "yes" ; then
3383 AC_DEFINE(HAVE_VA_COPY, 1, [If your system have va_copy])
3384 fi
3385
3386 dnl
3387 dnl Some systems support __va_copy
3388 dnl
3389 AC_CACHE_CHECK(if __va_copy is implemented, ac_cv_func___va_copy,
3390 AC_RUN_IFELSE([AC_LANG_SOURCE([[
3391 #include <stdarg.h>
3392 #include <stdlib.h>
3393 int f (int i, ...) {
3394 va_list args1, args2;
3395 va_start (args1, i);
3396 __va_copy (args2, args1);
3397 if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42)
3398 return 1;
3399 va_end (args1); va_end (args2);
3400 return 0;
3401 }
3402 int main(int argc, char **argv) { return f (0, 42); }
3403 ]])],[ac_cv_func___va_copy="yes"],[ac_cv_func___va_copy="no"],[])
3404 )
3405 if test "$ac_cv_func___va_copy" = "yes" ; then
3406 AC_DEFINE(HAVE___VA_COPY, 1, [Some systems have __va_copy instead of va_copy])
3407 fi
3408
3409 dnl IP-Filter support requires ipf header files. These aren't
3410 dnl installed by default, so we need to check for them
3411 if test "$IPF_TRANSPARENT" ; then
3412 AC_MSG_CHECKING(if IP-Filter header files are installed)
3413 # hold on to your hats...
3414 if test "$ac_cv_header_ip_compat_h" = "yes" ||
3415 test "$ac_cv_header_ip_fil_compat_h" = "yes" ||
3416 test "$ac_cv_header_netinet_ip_compat_h" = "yes" ||
3417 test "$ac_cv_header_netinet_ip_fil_compat_h" = "yes" ; then
3418 have_ipfilter_compat_header="yes"
3419 fi
3420 if test "x$have_ipfilter_compat_header" = "xyes" &&
3421 test "$ac_cv_header_ip_fil_h" = "yes" &&
3422 test "$ac_cv_header_ip_nat_h" = "yes" ; then
3423 IPF_TRANSPARENT="yes"
3424 AC_DEFINE(IPF_TRANSPARENT, 1)
3425 elif test "$have_ipfilter_compat_header" = "yes" &&
3426 test "$ac_cv_header_netinet_ip_fil_h" = "yes" &&
3427 test "$ac_cv_header_netinet_ip_nat_h" = "yes" ; then
3428 IPF_TRANSPARENT="yes"
3429 AC_DEFINE(IPF_TRANSPARENT, 1)
3430 else
3431 IPF_TRANSPARENT="no"
3432 AC_DEFINE(IPF_TRANSPARENT, 0)
3433 fi
3434 AC_MSG_RESULT($IPF_TRANSPARENT)
3435 fi
3436 if test "$IPF_TRANSPARENT" = "no" ; then
3437 AC_MSG_WARN([Cannot find necessary IP-Filter header files])
3438 AC_MSG_WARN([Transparent Proxy support WILL NOT be enabled])
3439 sleep 10
3440 elif test "$IPF_TRANSPARENT" = "yes" ; then
3441 dnl On Solaris Ipfilter includes expect that SOLARIS2 is defined with the
3442 dnl Solaris minor version (8, 9, 10, ...)
3443 case "$host" in
3444 *-solaris*)
3445 solrev=`uname -r | sh -c 'IFS=. read j n x; echo $n'`
3446 CFLAGS="-DSOLARIS2=$solrev $CFLAGS"
3447 CXXFLAGS="-DSOLARIS2=$solrev $CXXFLAGS"
3448 ;;
3449 *)
3450 ;;
3451 esac
3452 fi
3453
3454 dnl PF support requires a header file.
3455 if test "$PF_TRANSPARENT" ; then
3456 AC_MSG_CHECKING(if PF header file is installed)
3457 # hold on to your hats...
3458 if test "$ac_cv_header_net_pfvar_h" = "yes" || test "$ac_cv_header_net_pf_pfvar_h" = "yes"; then
3459 PF_TRANSPARENT="yes"
3460 AC_DEFINE(PF_TRANSPARENT, 1)
3461 else
3462 PF_TRANSPARENT="no"
3463 AC_DEFINE(PF_TRANSPARENT, 0)
3464 fi
3465 AC_MSG_RESULT($PF_TRANSPARENT)
3466 fi
3467 if test "$PF_TRANSPARENT" = "no" ; then
3468 AC_MSG_WARN([Cannot find necessary PF header file])
3469 AC_MSG_WARN([Transparent Proxy support WILL NOT be enabled])
3470 sleep 10
3471 fi
3472
3473 dnl Linux-Netfilter support requires Linux 2.4 kernel header files.
3474 dnl Shamelessly copied from above
3475 if test "$LINUX_NETFILTER" ; then
3476 AC_MSG_CHECKING(if Linux (Netfilter) kernel header files are installed)
3477 # hold on to your hats...
3478 if test "$ac_cv_header_linux_netfilter_ipv4_h" = "yes"; then
3479 LINUX_NETFILTER="yes"
3480 AC_DEFINE(LINUX_NETFILTER, 1)
3481 else
3482 LINUX_NETFILTER="no"
3483 AC_DEFINE(LINUX_NETFILTER, 0)
3484 fi
3485 AC_MSG_RESULT($LINUX_NETFILTER)
3486 fi
3487 if test "$LINUX_NETFILTER" = "no" ; then
3488 AC_MSG_WARN([Cannot find necessary Linux kernel (Netfilter) header files])
3489 AC_MSG_WARN([Linux Transparent and Intercepting Proxy support WILL NOT be enabled])
3490 sleep 10
3491 fi
3492 dnl Netfilter TPROXY depends on libcap but the NAT parts can still work.
3493 if test "$LINUX_NETFILTER" = "yes" && test "$use_caps" != "yes" ; then
3494 AC_MSG_WARN([Missing needed capabilities (libcap or libcap2) for TPROXY])
3495 AC_MSG_WARN([Linux Transparent Proxy support WILL NOT be enabled])
3496 AC_MSG_WARN([Reduced support to Interception Proxy])
3497 sleep 10
3498 fi
3499
3500 dnl Linux Netfilter/TPROXYv2 support requires some specific header files
3501 dnl Shamelessly copied from above
3502 if test "$LINUX_TPROXY2"; then
3503 if test "$use_caps" = "yes"; then
3504 AC_MSG_CHECKING(if TPROXYv2 header files are installed)
3505 # hold on to your hats...
3506 if test "$ac_cv_header_linux_netfilter_ipv4_ip_tproxy_h" = "yes" && test "$LINUX_NETFILTER" = "yes"; then
3507 LINUX_TPROXY2="yes"
3508 AC_DEFINE(LINUX_TPROXY2, 1, [Enable real Transparent Proxy support for Netfilter TPROXY v2.])
3509 else
3510 LINUX_TPROXY2="no"
3511 AC_DEFINE(LINUX_TPROXY2, 0, [Enable real Transparent Proxy support for Netfilter TPROXY v2.])
3512 fi
3513 AC_MSG_RESULT($LINUX_TPROXY2)
3514 if test "$LINUX_TPROXY2" = "no" && test "$LINUX_NETFILTER" = "yes"; then
3515 AC_MSG_WARN([Cannot find TPROXY v2 headers, you need to patch the kernel with ])
3516 AC_MSG_WARN([tproxy package from:])
3517 AC_MSG_WARN([ - lynx http://www.balabit.com/downloads/files/tproxy/])
3518 AC_MSG_WARN([Or select the '--enable-linux-netfilter' option instead for Netfilter support.])
3519 sleep 10
3520 fi
3521 else
3522 AC_MSG_WARN([Missing needed capabilities (libcap or libcap2) for TPROXY v2])
3523 AC_MSG_WARN([Linux Transparent Proxy support WILL NOT be enabled])
3524 sleep 10
3525 fi
3526 fi
3527
3528 AC_ARG_ENABLE(gnuregex,
3529 AS_HELP_STRING([--enable-gnuregex],[Compile GNUregex. Unless you have reason to use
3530 this option, you should not enable it.
3531 This library file is usually only required on Windows and
3532 very old Unix boxes which do not have their own regex
3533 library built in.]),
3534 [USE_GNUREGEX=$enableval])
3535 if test -z "$USE_GNUREGEX" ; then
3536 case "$host" in
3537 *-sun-solaris2.[[0-4]])
3538 USE_GNUREGEX="yes"
3539 ;;
3540 *-next-nextstep*)
3541 USE_GNUREGEX="yes"
3542 ;;
3543 esac
3544 fi
3545 AC_MSG_CHECKING(if GNUregex needs to be compiled)
3546 if test -z "$USE_GNUREGEX"; then
3547 if test "$ac_cv_func_regcomp" = "no" || test "$USE_GNUREGEX" = "yes" ; then
3548 USE_GNUREGEX="yes"
3549 else
3550 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
3551 #include <regex.h>]], [[regex_t t; regcomp(&t,"",0);]])],[USE_GNUREGEX="no"],[USE_GNUREGEX="yes"])
3552 fi
3553 fi
3554 AC_MSG_RESULT($USE_GNUREGEX)
3555 if test "$USE_GNUREGEX" = "yes"; then
3556 # override system regex with ours. Not good. But what was asked for.
3557 REGEXLIB=""
3558 AC_DEFINE(USE_GNUREGEX,1,[Define if we should use GNU regex])
3559 fi
3560 AC_SUBST(REGEXLIB)
3561 #AC_SUBST(LIBREGEX)
3562
3563 dnl Not cached since people are likely to tune this
3564 AC_MSG_CHECKING(Default FD_SETSIZE value)
3565 AC_RUN_IFELSE([AC_LANG_SOURCE([[
3566 #if HAVE_STDIO_H
3567 #include <stdio.h>
3568 #endif
3569 #if HAVE_UNISTD_H
3570 #include <unistd.h>
3571 #endif
3572 #if HAVE_STDLIB_H
3573 #include <stdlib.h>
3574 #endif
3575 #if HAVE_SYS_TIME_H
3576 #include <sys/time.h>
3577 #endif
3578 #if HAVE_SYS_SELECT_H
3579 #include <sys/select.h>
3580 #endif
3581 #if HAVE_SYS_TYPES_H
3582 #include <sys/types.h>
3583 #endif
3584 #if HAVE_WINSOCK_H
3585 #include <winsock.h>
3586 #endif
3587 #if HAVE_WINSOCK2_H
3588 #include <winsock2.h>
3589 #endif
3590 int main(int argc, char **argv) {
3591 FILE *fp = fopen("conftestval", "w");
3592 fprintf (fp, "%d\n", FD_SETSIZE);
3593 return 0;
3594 }
3595 ]])],[DEFAULT_FD_SETSIZE=`cat conftestval`],[DEFAULT_FD_SETSIZE=256],[DEFAULT_FD_SETSIZE=256])
3596 AC_MSG_RESULT($DEFAULT_FD_SETSIZE)
3597 AC_DEFINE_UNQUOTED(DEFAULT_FD_SETSIZE, $DEFAULT_FD_SETSIZE, [Default FD_SETSIZE value])
3598
3599
3600 dnl Not cached since people are likely to tune this
3601 AC_MSG_CHECKING(Maximum number of filedescriptors we can open)
3602 dnl damn! FreeBSD's pthreads breaks dup2().
3603 TLDFLAGS="$LDFLAGS"
3604 if test -n "$squid_filedescriptors_num" ; then
3605 SQUID_MAXFD=$squid_filedescriptors_num
3606 AC_MSG_RESULT($SQUID_MAXFD (user-forced))
3607 else
3608 case $host in
3609 i386-unknown-freebsd*)
3610 if echo "$LDFLAGS" | grep -q pthread; then
3611 LDFLAGS=`echo $LDFLAGS | sed -e "s/-pthread//"`
3612 fi
3613 esac
3614 AC_RUN_IFELSE([AC_LANG_SOURCE([[
3615 #include <stdio.h>
3616 #include <unistd.h>
3617 #include <stdlib.h>
3618 #include <sys/time.h> /* needed on FreeBSD */
3619 #include <sys/param.h>
3620 #include <sys/resource.h>
3621 int main(int argc, char **argv) {
3622 FILE *fp;
3623 int i,j;
3624 #if defined(__CYGWIN32__) || defined (__CYGWIN__)
3625 /* getrlimit and sysconf returns bogous values on cygwin32.
3626 * Number of fds is virtually unlimited in cygwin (sys/param.h)
3627 * __CYGWIN32__ is deprecated.
3628 */
3629 i = NOFILE;
3630 #else
3631 #if HAVE_SETRLIMIT
3632 struct rlimit rl;
3633 #if defined(RLIMIT_NOFILE)
3634 if (getrlimit(RLIMIT_NOFILE, &rl) < 0) {
3635 perror("getrlimit: RLIMIT_NOFILE");
3636 } else {
3637 #if defined(__APPLE__)
3638 /* asking for more than OPEN_MAX fails on Leopard */
3639 rl.rlim_cur = (OPEN_MAX < rl.rlim_max ? OPEN_MAX : rl.rlim_max);
3640 #else
3641 rl.rlim_cur = rl.rlim_max; /* set it to the max */
3642 #endif
3643 if (setrlimit(RLIMIT_NOFILE, &rl) < 0) {
3644 perror("setrlimit: RLIMIT_NOFILE");
3645 }
3646 }
3647 #elif defined(RLIMIT_OFILE)
3648 if (getrlimit(RLIMIT_OFILE, &rl) < 0) {
3649 perror("getrlimit: RLIMIT_OFILE");
3650 } else {
3651 rl.rlim_cur = rl.rlim_max; /* set it to the max */
3652 if (setrlimit(RLIMIT_OFILE, &rl) < 0) {
3653 perror("setrlimit: RLIMIT_OFILE");
3654 }
3655 }
3656 #endif /* RLIMIT_NOFILE */
3657 #endif /* HAVE_SETRLIMIT */
3658 /* by starting at 2^14, we will never get higher
3659 than 2^15 for SQUID_MAXFD */
3660 i = j = 1<<14;
3661 while (j) {
3662 j >>= 1;
3663 if (dup2(0, i) < 0) {
3664 i -= j;
3665 } else {
3666 close(i);
3667 i += j;
3668 }
3669 }
3670 i++;
3671 #endif /* IF !DEF CYGWIN */
3672 fp = fopen("conftestval", "w");
3673 fprintf (fp, "%d\n", i & ~0x3F);
3674 return 0;
3675 }
3676 ]])],[SQUID_MAXFD=`cat conftestval`],[SQUID_MAXFD=256],[SQUID_MAXFD=256])
3677 dnl Microsoft MSVCRT.DLL supports 2048 maximum FDs
3678 case "$host_os" in
3679 mingw|mingw32)
3680 SQUID_MAXFD="2048"
3681 ;;
3682 esac
3683 AC_MSG_RESULT($SQUID_MAXFD)
3684 fi
3685 AC_DEFINE_UNQUOTED(SQUID_MAXFD, $SQUID_MAXFD,[Maximum number of open filedescriptors])
3686 if test "$SQUID_MAXFD" -lt 512 ; then
3687 AC_MSG_WARN([$SQUID_MAXFD may not be enough filedescriptors if your])
3688 AC_MSG_WARN([cache will be very busy. Please see the FAQ page])
3689 AC_MSG_WARN([http://wiki.squid-cache.org/SquidFaq/TroubleShooting])
3690 AC_MSG_WARN([on how to increase your filedescriptor limit])
3691 sleep 10
3692 fi
3693 LDFLAGS="$TLDFLAGS"
3694
3695 if test `expr $SQUID_MAXFD % 64` != 0; then
3696 AC_MSG_WARN([$SQUID_MAXFD is not an multiple of 64. This may cause issues on certain platforms.])
3697 sleep 10
3698 fi
3699
3700 dnl Not cached since people are likely to tune this
3701 AC_MSG_CHECKING(Default UDP send buffer size)
3702 AC_RUN_IFELSE([AC_LANG_SOURCE([[
3703 #include <stdlib.h>
3704 #include <stdio.h>
3705 #include <sys/types.h>
3706 #if HAVE_SYS_SOCKET_H
3707 #include <sys/socket.h>
3708 #endif
3709 #if HAVE_NETINET_IN_H
3710 #include <netinet/in.h>
3711 #endif
3712 #if HAVE_WINSOCK_H
3713 #include <winsock.h>
3714 #endif
3715 #if HAVE_WINSOCK2_H
3716 #include <winsock2.h>
3717 #endif
3718 int main(int argc, char **argv)
3719 {
3720 FILE *fp;
3721 int fd,val=0;
3722 #if (defined(WIN32) || defined(__WIN32__) || defined(__WIN32)) && !(defined(__CYGWIN32__) || defined(__CYGWIN__))
3723 int len=sizeof(int);
3724 WSADATA wsaData;
3725 WSAStartup(2, &wsaData);
3726 #else
3727 socklen_t len=sizeof(socklen_t);
3728 #endif
3729 if ((fd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) return 1;
3730 #if (defined(WIN32) || defined(__WIN32__) || defined(__WIN32)) && !(defined(__CYGWIN32__) || defined(__CYGWIN__))
3731 if (getsockopt(fd, SOL_SOCKET, SO_SNDBUF, (char *)&val, &len) < 0) return 1;
3732 WSACleanup();
3733 #else
3734 if (getsockopt(fd, SOL_SOCKET, SO_SNDBUF, &val, &len) < 0) return 1;
3735 #endif
3736 if (val<=0) return 1;
3737 fp = fopen("conftestval", "w");
3738 fprintf (fp, "%d\n", val);
3739 return 0;
3740 }
3741 ]])],[SQUID_DETECT_UDP_SO_SNDBUF=`cat conftestval`],[SQUID_DETECT_UDP_SO_SNDBUF=16384],[SQUID_DETECT_UDP_SO_SNDBUF=16384])
3742 AC_MSG_RESULT($SQUID_DETECT_UDP_SO_SNDBUF)
3743 AC_DEFINE_UNQUOTED(SQUID_DETECT_UDP_SO_SNDBUF, $SQUID_DETECT_UDP_SO_SNDBUF,[UDP send buffer size])
3744
3745 dnl Not cached since people are likely to tune this
3746 AC_MSG_CHECKING(Default UDP receive buffer size)
3747 AC_RUN_IFELSE([AC_LANG_SOURCE([[
3748 #include <stdlib.h>
3749 #include <stdio.h>
3750 #include <sys/types.h>
3751 #if HAVE_SYS_SOCKET_H
3752 #include <sys/socket.h>
3753 #endif
3754 #if HAVE_NETINET_IN_H
3755 #include <netinet/in.h>
3756 #endif
3757 #if HAVE_WINSOCK_H
3758 #include <winsock.h>
3759 #endif
3760 #if HAVE_WINSOCK2_H
3761 #include <winsock2.h>
3762 #endif
3763 int main(int argc, char **argv)
3764 {
3765 FILE *fp;
3766 int fd,val=0;
3767 #if (defined(WIN32) || defined(__WIN32__) || defined(__WIN32)) && !(defined(__CYGWIN32__) || defined(__CYGWIN__))
3768 int len=sizeof(int);
3769 WSADATA wsaData;
3770 WSAStartup(2, &wsaData);
3771 #else
3772 socklen_t len=sizeof(socklen_t);
3773 #endif
3774 if ((fd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) return 1;
3775 #if (defined(WIN32) || defined(__WIN32__) || defined(__WIN32)) && !(defined(__CYGWIN32__) || defined(__CYGWIN__))
3776 if (getsockopt(fd, SOL_SOCKET, SO_RCVBUF, (char *)&val, &len) < 0) return 1;
3777 WSACleanup();
3778 #else
3779 if (getsockopt(fd, SOL_SOCKET, SO_RCVBUF, &val, &len) < 0) return 1;
3780 #endif
3781 if (val <= 0) return 1;
3782 fp = fopen("conftestval", "w");
3783 fprintf (fp, "%d\n", val);
3784 return 0;
3785 }
3786 ]])],[SQUID_DETECT_UDP_SO_RCVBUF=`cat conftestval`],[SQUID_DETECT_UDP_SO_RCVBUF=16384],[SQUID_DETECT_UDP_SO_RCVBUF=16384])
3787 AC_MSG_RESULT($SQUID_DETECT_UDP_SO_RCVBUF)
3788 AC_DEFINE_UNQUOTED(SQUID_DETECT_UDP_SO_RCVBUF, $SQUID_DETECT_UDP_SO_RCVBUF,[UDP receive buffer size])
3789
3790 dnl Not cached since people are likely to tune this
3791 AC_MSG_CHECKING(Default TCP send buffer size)
3792 AC_RUN_IFELSE([AC_LANG_SOURCE([[
3793 #include <stdlib.h>
3794 #include <stdio.h>
3795 #include <sys/types.h>
3796 #if HAVE_SYS_SOCKET_H
3797 #include <sys/socket.h>
3798 #endif
3799 #if HAVE_NETINET_IN_H
3800 #include <netinet/in.h>
3801 #endif
3802 #if HAVE_WINSOCK_H
3803 #include <winsock.h>
3804 #endif
3805 #if HAVE_WINSOCK2_H
3806 #include <winsock2.h>
3807 #endif
3808 int main(int argc, char **argv)
3809 {
3810 FILE *fp;
3811 int fd,val=0;
3812 #if (defined(WIN32) || defined(__WIN32__) || defined(__WIN32)) && !(defined(__CYGWIN32__) || defined(__CYGWIN__))
3813 int len=sizeof(int);
3814 WSADATA wsaData;
3815 WSAStartup(2, &wsaData);
3816 #else
3817 socklen_t len=sizeof(socklen_t);
3818 #endif
3819 if ((fd = socket(AF_INET, SOCK_STREAM, 0)) < 0) return 1;
3820 #if (defined(WIN32) || defined(__WIN32__) || defined(__WIN32)) && !(defined(__CYGWIN32__) || defined(__CYGWIN__))
3821 if (getsockopt(fd, SOL_SOCKET, SO_SNDBUF, (char *)&val, &len) < 0) return 1;
3822 WSACleanup();
3823 #else
3824 if (getsockopt(fd, SOL_SOCKET, SO_SNDBUF, &val, &len) < 0) return 1;
3825 #endif
3826 if (val <= 0) return 1;
3827 fp = fopen("conftestval", "w");
3828 fprintf (fp, "%d\n", val);
3829 return 0;
3830 }
3831 ]])],[SQUID_TCP_SO_SNDBUF=`cat conftestval`],[SQUID_TCP_SO_SNDBUF=16384],[SQUID_TCP_SO_SNDBUF=16384])
3832 AC_MSG_RESULT($SQUID_TCP_SO_SNDBUF)
3833 if test $SQUID_TCP_SO_SNDBUF -gt 32768; then
3834 AC_MSG_NOTICE([Limiting send buffer size to 32K])
3835 SQUID_TCP_SO_SNDBUF=32768
3836 fi
3837 AC_DEFINE_UNQUOTED(SQUID_TCP_SO_SNDBUF, $SQUID_TCP_SO_SNDBUF,[TCP send buffer size])
3838
3839 dnl Not cached since people are likely to tune this
3840 AC_MSG_CHECKING(Default TCP receive buffer size)
3841 AC_RUN_IFELSE([AC_LANG_SOURCE([[
3842 #include <stdlib.h>
3843 #include <stdio.h>
3844 #include <sys/types.h>
3845 #if HAVE_SYS_SOCKET_H
3846 #include <sys/socket.h>
3847 #endif
3848 #if HAVE_NETINET_IN_H
3849 #include <netinet/in.h>
3850 #endif
3851 #if HAVE_WINSOCK_H
3852 #include <winsock.h>
3853 #endif
3854 #if HAVE_WINSOCK2_H
3855 #include <winsock2.h>
3856 #endif
3857 int main(int argc, char **argv)
3858 {
3859 FILE *fp;
3860 int fd,val=0;
3861 #if (defined(WIN32) || defined(__WIN32__) || defined(__WIN32)) && !(defined(__CYGWIN32__) || defined(__CYGWIN__))
3862 int len=sizeof(int);
3863 WSADATA wsaData;
3864 WSAStartup(2, &wsaData);
3865 #else
3866 socklen_t len=sizeof(socklen_t);
3867 #endif
3868 if ((fd = socket(AF_INET, SOCK_STREAM, 0)) < 0) return 1;
3869 #if (defined(WIN32) || defined(__WIN32__) || defined(__WIN32)) && !(defined(__CYGWIN32__) || defined(__CYGWIN__))
3870 if (getsockopt(fd, SOL_SOCKET, SO_RCVBUF, (char *)&val, &len) < 0) return 1;
3871 WSACleanup();
3872 #else
3873 if (getsockopt(fd, SOL_SOCKET, SO_RCVBUF, &val, &len) < 0) return 1;
3874 #endif
3875 if (val <= 0) return 1;
3876 fp = fopen("conftestval", "w");
3877 fprintf (fp, "%d\n", val);
3878 return 0;
3879 }
3880 ]])],[SQUID_TCP_SO_RCVBUF=`cat conftestval`],[SQUID_TCP_SO_RCVBUF=16384],[SQUID_TCP_SO_RCVBUF=16384])
3881 AC_MSG_RESULT($SQUID_TCP_SO_RCVBUF)
3882 if test $SQUID_TCP_SO_RCVBUF -gt 65535; then
3883 AC_MSG_NOTICE([Limiting receive buffer size to 64K])
3884 SQUID_TCP_SO_RCVBUF=65535
3885 fi
3886 AC_DEFINE_UNQUOTED(SQUID_TCP_SO_RCVBUF, $SQUID_TCP_SO_RCVBUF,[TCP receive buffer size])
3887 AC_CACHE_CHECK(if sys_errlist is already defined, ac_cv_needs_sys_errlist,
3888 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <stdio.h>]], [[char *s = sys_errlist;]])],[ac_cv_needs_sys_errlist="no"],[ac_cv_needs_sys_errlist="yes"])
3889 )
3890 if test "$ac_cv_needs_sys_errlist" = "yes" ; then
3891 AC_DEFINE(NEED_SYS_ERRLIST,1,[If we need to declare sys_errlist[] as external])
3892 fi
3893
3894 dnl Not cached since people are likely to change this
3895 AC_MSG_CHECKING(for libresolv _dns_ttl_ hack)
3896 AC_LINK_IFELSE([AC_LANG_PROGRAM([[extern int _dns_ttl_;]], [[return _dns_ttl_;]])],[AC_MSG_RESULT(yes)
3897 AC_DEFINE(LIBRESOLV_DNS_TTL_HACK,1,[If libresolv.a has been hacked to export _dns_ttl_])],[AC_MSG_RESULT(no)])
3898
3899 if test "$ac_cv_header_sys_statvfs_h" = "yes" ; then
3900 AC_MSG_CHECKING(for working statvfs() interface)
3901 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
3902 #include <stdlib.h>
3903 #include <stdio.h>
3904 #include <sys/types.h>
3905 #include <sys/statvfs.h>
3906 ]], [[
3907 struct statvfs sfs;
3908 sfs.f_blocks = sfs.f_bfree = sfs.f_frsize =
3909 sfs.f_files = sfs.f_ffree = 0;
3910 statvfs("/tmp", &sfs);
3911 ]])],[ac_cv_func_statvfs=yes],[ac_cv_func_statvfs=no])
3912 AC_MSG_RESULT($ac_cv_func_statvfs)
3913 if test "$ac_cv_func_statvfs" = "yes" ; then
3914 AC_DEFINE(HAVE_STATVFS,1,[If your system has statvfs(), and if it actually works!])
3915 fi
3916 fi
3917
3918 dnl Detect what resolver fields we have available to use...
3919 AC_CACHE_CHECK(for _res_ext.nsaddr_list, ac_cv_have_res_ext_nsaddr_list,
3920 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
3921 #if HAVE_SYS_TYPES_H
3922 #include <sys/types.h>
3923 #endif
3924 #if HAVE_NETINET_IN_H
3925 #include <netinet/in.h>
3926 #endif
3927 #if HAVE_ARPA_INET_H
3928 #include <arpa/inet.h>
3929 #endif
3930 #if HAVE_ARPA_NAMESER_H
3931 #include <arpa/nameser.h>
3932 #endif
3933 #if HAVE_RESOLV_H
3934 #include <resolv.h>
3935 #endif
3936 ]], [[_res_ext.nsaddr_list[[0]].s_addr;]])],[ac_cv_have_res_ext_nsaddr_list="yes"],[ac_cv_have_res_ext_nsaddr_list="no"]))
3937 if test "$ac_cv_have_res_ext_nsaddr_list" = "yes" ; then
3938 AC_DEFINE(_SQUID_RES_NSADDR6_LARRAY,_res_ext.nsaddr_list,[If _res_ext structure has nsaddr_list member])
3939 AC_DEFINE(_SQUID_RES_NSADDR6_COUNT,ns6count,[Nameserver Counter for IPv6 _res_ext])
3940 fi
3941
3942 if test "$_SQUID_RES_NSADDR6_LIST" = ""; then
3943 AC_CACHE_CHECK(for _res._u._ext.nsaddrs, ac_cv_have_res_ext_nsaddrs,
3944 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
3945 #if HAVE_SYS_TYPES_H
3946 #include <sys/types.h>
3947 #endif
3948 #if HAVE_NETINET_IN_H
3949 #include <netinet/in.h>
3950 #endif
3951 #if HAVE_ARPA_INET_H
3952 #include <arpa/inet.h>
3953 #endif
3954 #if HAVE_ARPA_NAMESER_H
3955 #include <arpa/nameser.h>
3956 #endif
3957 #if HAVE_RESOLV_H
3958 #include <resolv.h>
3959 #endif
3960 ]], [[_res._u._ext.nsaddrs[[0]]->sin6_addr;]])],[ac_cv_have_res_ext_nsaddrs="yes"],[ac_cv_have_res_ext_nsaddrs="no"]))
3961 if test "$ac_cv_have_res_ext_nsaddrs" = "yes" ; then
3962 AC_DEFINE(_SQUID_RES_NSADDR6_LPTR,_res._u._ext.nsaddrs,[If _res structure has _ext.nsaddrs member])
3963 AC_DEFINE(_SQUID_RES_NSADDR6_COUNT,_res._u._ext.nscount6,[Nameserver Counter for IPv6 _res])
3964 fi
3965 fi
3966
3967 AC_CACHE_CHECK(for _res.nsaddr_list, ac_cv_have_res_nsaddr_list,
3968 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
3969 #if HAVE_SYS_TYPES_H
3970 #include <sys/types.h>
3971 #endif
3972 #if HAVE_NETINET_IN_H
3973 #include <netinet/in.h>
3974 #endif
3975 #if HAVE_ARPA_INET_H
3976 #include <arpa/inet.h>
3977 #endif
3978 #if HAVE_ARPA_NAMESER_H
3979 #include <arpa/nameser.h>
3980 #endif
3981 #if HAVE_RESOLV_H
3982 #include <resolv.h>
3983 #endif
3984 ]], [[_res.nsaddr_list[[0]];]])],[ac_cv_have_res_nsaddr_list="yes"],[ac_cv_have_res_nsaddr_list="no"]))
3985 if test $ac_cv_have_res_nsaddr_list = "yes" ; then
3986 AC_DEFINE(_SQUID_RES_NSADDR_LIST,_res.nsaddr_list,[If _res structure has nsaddr_list member])
3987 AC_DEFINE(_SQUID_RES_NSADDR_COUNT,_res.nscount,[Nameserver counter for IPv4 _res])
3988 fi
3989
3990 if test "$_SQUID_RES_NSADDR_LIST" = ""; then
3991 AC_CACHE_CHECK(for _res.ns_list, ac_cv_have_res_ns_list,
3992 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
3993 #if HAVE_SYS_TYPES_H
3994 #include <sys/types.h>
3995 #endif
3996 #if HAVE_NETINET_IN_H
3997 #include <netinet/in.h>
3998 #endif
3999 #if HAVE_ARPA_INET_H
4000 #include <arpa/inet.h>
4001 #endif
4002 #if HAVE_ARPA_NAMESER_H
4003 #include <arpa/nameser.h>
4004 #endif
4005 #if HAVE_RESOLV_H
4006 #include <resolv.h>
4007 #endif
4008 ]], [[_res.ns_list[[0]].addr;]])],[ac_cv_have_res_ns_list="yes"],[ac_cv_have_res_ns_list="no"]))
4009 if test $ac_cv_have_res_ns_list = "yes" ; then
4010 AC_DEFINE(_SQUID_RES_NSADDR_LIST,_res.ns_list,[If _res structure has ns_list member])
4011 AC_DEFINE(_SQUID_RES_NSADDR_COUNT,_res.nscount,[Nameserver counter for IPv4 _res])
4012 fi
4013 fi
4014
4015 dnl Squid will usually attempt to translate when packaging or building from VCS
4016 use_translation="yes"
4017 AC_ARG_ENABLE(translation,
4018 AS_HELP_STRING([--disable-translation],[Prevent Squid generating localized error page templates and manuals.
4019 Which is usually tried, but may not be needed.]),
4020 [ if test "$enableval" = "no" ; then
4021 use_translation=no
4022 fi
4023 ])
4024 dnl Squid now has .po translation capability, given the right toolkit
4025 if test "$use_translation" = "yes" ; then
4026 AX_WITH_PROG([PO2HTML],[po2html])
4027 else
4028 PO2HTML="off"
4029 fi
4030 AC_SUBST(PO2HTML)
4031
4032 dnl Squid now has limited locale handling ...
4033 dnl on error pages
4034 use_errlocale=yes
4035 AC_ARG_ENABLE(auto-locale,
4036 AS_HELP_STRING([--disable-auto-locale],[This prevents Squid providing localized error pages based on the
4037 clients request headers.
4038 When disabled Squid requires explicit language configuration.]),
4039 [ if test "$enableval" = "no" ; then
4040 use_errlocale=no
4041 fi
4042 ])
4043 if test "$use_errlocale" = "yes" ; then
4044 AC_MSG_NOTICE([Enabling Multi-Language Support])
4045 AC_DEFINE(USE_ERR_LOCALES,1,[Use multi-language support on error pages])
4046 else
4047 AC_MSG_WARN([Disabling Multi-Language Support])
4048 AC_DEFINE(USE_ERR_LOCALES,0,[Use multi-language support on error pages])
4049 fi
4050
4051 dnl Need the debugging version of malloc if available
4052 XTRA_OBJS=''
4053 if test "$ac_cv_lib_malloc_main" = "yes" ; then
4054 if test -r /usr/lib/debug/malloc.o ; then
4055 XTRA_OBJS="$XTRA_OBJS /usr/lib/debug/malloc.o"
4056 fi
4057 if test -r /usr/lib/debug/mallocmap.o ; then
4058 XTRA_OBJS="$XTRA_OBJS /usr/lib/debug/mallocmap.o"
4059 fi
4060 fi
4061 AC_SUBST(XTRA_OBJS)
4062
4063 if test -z "$XTRA_LIBS"; then
4064 XTRA_LIBS="$LIBS"
4065 dnl minor cleanup
4066 XTRA_LIBS=`echo $XTRA_LIBS | sed -e "s/ */ /g"`
4067 LIBS=''
4068 fi
4069 AC_SUBST(XTRA_LIBS)
4070
4071 dnl Clean up after OSF/1 core dump bug
4072 rm -f core
4073
4074 AC_CONFIG_FILES([\
4075 Makefile \
4076 compat/Makefile \
4077 lib/Makefile \
4078 scripts/Makefile \
4079 scripts/RunCache \
4080 scripts/RunAccel \
4081 src/Makefile \
4082 src/base/Makefile \
4083 src/acl/Makefile \
4084 src/fs/Makefile \
4085 src/repl/Makefile \
4086 src/auth/Makefile \
4087 src/adaptation/Makefile \
4088 src/adaptation/icap/Makefile \
4089 src/adaptation/ecap/Makefile \
4090 src/esi/Makefile \
4091 src/icmp/Makefile \
4092 src/ident/Makefile \
4093 src/ip/Makefile \
4094 contrib/Makefile \
4095 snmplib/Makefile \
4096 icons/Makefile \
4097 errors/Makefile \
4098 test-suite/Makefile \
4099 doc/Makefile \
4100 doc/manuals/Makefile \
4101 helpers/Makefile \
4102 helpers/basic_auth/Makefile \
4103 helpers/basic_auth/LDAP/Makefile \
4104 helpers/basic_auth/MSNT/Makefile \
4105 helpers/basic_auth/NCSA/Makefile \
4106 helpers/basic_auth/PAM/Makefile \
4107 helpers/basic_auth/SMB/Makefile \
4108 helpers/basic_auth/mswin_sspi/Makefile \
4109 helpers/basic_auth/YP/Makefile \
4110 helpers/basic_auth/getpwnam/Makefile \
4111 helpers/basic_auth/multi-domain-NTLM/Makefile \
4112 helpers/basic_auth/SASL/Makefile \
4113 helpers/basic_auth/POP3/Makefile \
4114 helpers/basic_auth/DB/Makefile \
4115 helpers/basic_auth/squid_radius_auth/Makefile \
4116 helpers/digest_auth/Makefile \
4117 helpers/digest_auth/password/Makefile \
4118 helpers/digest_auth/ldap/Makefile \
4119 helpers/digest_auth/eDirectory/Makefile \
4120 helpers/ntlm_auth/Makefile \
4121 helpers/ntlm_auth/fakeauth/Makefile \
4122 helpers/ntlm_auth/no_check/Makefile \
4123 helpers/ntlm_auth/smb_lm/Makefile \
4124 helpers/ntlm_auth/smb_lm/smbval/Makefile \
4125 helpers/ntlm_auth/mswin_sspi/Makefile \
4126 helpers/negotiate_auth/Makefile \
4127 helpers/negotiate_auth/kerberos/Makefile \
4128 helpers/negotiate_auth/mswin_sspi/Makefile \
4129 helpers/external_acl/Makefile \
4130 helpers/external_acl/ip_user/Makefile \
4131 helpers/external_acl/ldap_group/Makefile \
4132 helpers/external_acl/session/Makefile \
4133 helpers/external_acl/unix_group/Makefile \
4134 helpers/external_acl/wbinfo_group/Makefile \
4135 helpers/external_acl/mswin_ad_group/Makefile \
4136 helpers/external_acl/mswin_lm_group/Makefile \
4137 helpers/url_rewrite/Makefile \
4138 helpers/url_rewrite/fake/Makefile \
4139 tools/Makefile
4140 ])
4141
4142 AC_CONFIG_SUBDIRS(lib/libTrie)
4143
4144 # must configure libltdl subdir unconditionally for "make distcheck" to work
4145 AC_CONFIG_SUBDIRS(lib/libLtdl)
4146
4147 AC_OUTPUT