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