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