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