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