]> git.ipfire.org Git - thirdparty/squid.git/blob - configure.ac
Fix GCC 4.8 eCAP builds after rev.14701
[thirdparty/squid.git] / configure.ac
1 ## Copyright (C) 1996-2016 The Squid Software Foundation and contributors
2 ##
3 ## Squid software is distributed under GPLv2+ license and includes
4 ## contributions from numerous individuals and organizations.
5 ## Please see the COPYING and CONTRIBUTORS files for details.
6 ##
7
8 AC_INIT([Squid Web Proxy],[4.0.11-BZR],[http://bugs.squid-cache.org/],[squid])
9 AC_PREREQ(2.61)
10 AC_CONFIG_HEADERS([include/autoconf.h])
11 AC_CONFIG_AUX_DIR(cfgaux)
12 AC_CONFIG_SRCDIR([src/main.cc])
13 AM_INIT_AUTOMAKE([tar-ustar nostdinc subdir-objects])
14 AC_REVISION($Revision$)dnl
15 AC_PREFIX_DEFAULT(/usr/local/squid)
16 AM_MAINTAINER_MODE
17
18 m4_include([acinclude/ax_with_prog.m4])
19 m4_include([acinclude/init.m4])
20 m4_include([acinclude/squid-util.m4])
21 m4_include([acinclude/compiler-flags.m4])
22 m4_include([acinclude/os-deps.m4])
23 m4_include([acinclude/krb5.m4])
24 m4_include([acinclude/pam.m4])
25 m4_include([acinclude/pkg.m4])
26 m4_include([acinclude/lib-checks.m4])
27 m4_include([acinclude/ax_cxx_compile_stdcxx_11.m4])
28 m4_include([acinclude/ax_cxx_0x_types.m4])
29
30 PRESET_CFLAGS="$CFLAGS"
31 PRESET_CXXFLAGS="$CXXFLAGS"
32 PRESET_LDFLAGS="$LDFLAGS"
33
34 dnl Set default LDFLAGS
35 if test "x$LDFLAGS" = "x" ; then
36 LDFLAGS="-g"
37 fi
38
39 # Check for GNU cc
40 AC_PROG_CC
41 AM_PROG_CC_C_O
42 AC_PROG_CXX
43 AC_LANG([C++])
44 AC_CANONICAL_HOST
45
46 # Clang 3.2 on some CPUs requires -march-native to detect correctly.
47 # GCC 4.3+ can also produce faster executables when its used.
48 # But building inside a virtual machine environment has been found to
49 # cause random Illegal Instruction errors due to mis-detection of CPU.
50 AC_ARG_ENABLE(arch-native,
51 AS_HELP_STRING([--disable-arch-native],[Some compilers offer CPU-specific
52 optimizations with the -march=native parameter.
53 This flag disables the optimization. The default is to
54 auto-detect compiler support and use where available.]), [
55 SQUID_YESNO([$enableval],
56 [Unrecognized argument to --disable-arch-native: $enableval])
57 ])
58 AC_MSG_NOTICE([CPU arch native optimization enabled: ${enable_arch_native:=auto}])
59 if test "x${enable_arch_native}" != "xno"; then
60 SQUID_CC_CHECK_ARGUMENT([squid_cv_check_marchnative],[-march=native])
61 fi
62
63 # might be cross-compiling.
64 # NP: BUILDCXXFLAGS defined at the end of configure after CXXFLAGS fully known.
65 AC_ARG_VAR([BUILDCXX],[path to compiler for building compile-time tools. e.g. cf_gen])
66 if test "x$HOSTCXX" != "x" -a "x$BUILDCXX" = "x"; then
67 AC_MSG_WARN([Cross-compiling with HOSTCXX is deprecated. Uses BUILDCXX instead.])
68 BUILDCXX="$HOSTCXX"
69 fi
70 if test "x$BUILDCXX" = "x"; then
71 BUILDCXX="$CXX"
72 if test "x$squid_cv_check_marchnative" = "xyes"; then
73 CXXFLAGS="$CXXFLAGS -march=native"
74 fi
75 fi
76 AC_SUBST(BUILDCXX)
77
78 AC_MSG_CHECKING([simplified host os])
79 simple_host_os=`echo $host_os|sed 's/[0-9].*//g;s/-.*//g'`
80 squid_host_os_version=`echo $host_os|tr -d "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-"`
81 if test -n "$squid_host_os_version"; then
82 squid_host_os="`echo $simple_host_os| sed s/$squid_host_os_version//g`"
83 else
84 squid_host_os="$simple_host_os"
85 fi
86 AC_MSG_RESULT($squid_host_os (version $squid_host_os_version))
87 # on windows squid_host_os is either mingw or cygwin, version is 32
88
89 # this needs to be before any test is run, to have more standard
90 # functions available on some Unix sysems (e.g. Solaris)
91 if test "x$squid_host_os" = "solaris" -a "x$GCC" != "x" ; then
92 AC_USE_SYSTEM_EXTENSIONS
93 fi
94
95 # If the user did not specify a C++ version.
96 user_cxx=`echo "$PRESET_CXXFLAGS" | grep -o -E "\-std="`
97 if test "x$user_cxx" = "x"; then
98 # Check for C++11 compiler support
99 AX_CXX_COMPILE_STDCXX_11([noext],[mandatory])
100 fi
101
102 # test for programs
103 AC_PROG_RANLIB
104 AC_PROG_CPP
105 AC_PROG_INSTALL
106 AC_PROG_LN_S
107 AC_PROG_EGREP
108
109 AC_PATH_PROG(SH, sh, /bin/sh)
110 AC_PATH_PROG(FALSE, false, /usr/bin/false)
111 AC_PATH_PROG(TRUE, true, /usr/bin/true)
112 AC_PATH_PROG(MV, mv, $FALSE)
113 AC_PATH_PROG(MKDIR, mkdir, $FALSE)
114 AC_PATH_PROG(LN, ln, cp)
115 AC_PATH_PROG(CHMOD, chmod, $FALSE)
116 AC_PATH_PROG(TR, tr, $FALSE)
117 AC_PATH_PROG(RM, rm, $FALSE)
118 AC_PATH_PROG(CPPUNITCONFIG, cppunit-config, false)
119 dnl Libtool 2.2.6 requires: rm -f
120 RM="$RM -f"
121
122 AC_PATH_PROG(PERL, perl, none)
123 if test "x$ac_cv_path_PERL" = "xnone"; then
124 AC_MSG_FAILURE([Perl is required to compile Squid. Please install Perl and then re-run configure ])
125 fi
126 AC_PATH_PROG(POD2MAN, pod2man, $FALSE)
127 AM_CONDITIONAL(ENABLE_POD2MAN_DOC, test "x${ac_cv_path_POD2MAN}" != "x$FALSE")
128
129 dnl set $(AR) if not provided by the build environment
130 if test "x$AR" = "x"; then
131 AC_PATH_PROG(AR, ar, $FALSE)
132 fi
133 AR_R="$AR r"
134 AC_SUBST(AR_R)
135
136 AC_PATH_PROG(LINUXDOC, linuxdoc, $FALSE)
137 AM_CONDITIONAL(ENABLE_RELEASE_DOCS, test "x${ac_cv_path_LINUXDOC}" != "x$FALSE")
138
139 # pre-define DEFAULT_PREFIX, some modules need it.
140 if test "${prefix}" = "NONE" ; then
141 squid_prefix=$ac_default_prefix
142 else
143 squid_prefix=$prefix
144 fi
145 AC_DEFINE_UNQUOTED(DEFAULT_PREFIX,[$squid_prefix],[The install prefix])
146
147 AC_ARG_ENABLE(strict-error-checking,
148 AS_HELP_STRING([--disable-strict-error-checking],[By default squid is compiled
149 with all possible static compiler error-checks enabled.
150 This flag disables the behavior]), [
151 SQUID_YESNO([$enableval],
152 [Unrecognized argument to --disable-strict-error-checking: $enableval])
153 ])
154 AC_MSG_NOTICE([strict error checking enabled: ${enable_strict_error_checking:=yes}])
155
156 AC_MSG_CHECKING(whether to use loadable modules)
157 AC_ARG_ENABLE(loadable-modules,
158 AS_HELP_STRING([--disable-loadable-modules],[do not support loadable modules]) , [
159 SQUID_YESNO([$enableval],
160 [Unrecognized argument to --disable-loadable-modules: $enableval])
161 ])
162 AM_CONDITIONAL(ENABLE_LOADABLE_MODULES, test "x${enable_loadable_modules:=yes}" = "xyes")
163 AC_MSG_RESULT([$enable_loadable_modules])
164
165 if test "x$enable_loadable_modules" = "xyes";
166 then
167 AC_DEFINE(USE_LOADABLE_MODULES, 1, [Support Loadable Modules])
168 AC_ENABLE_SHARED
169 else
170 AC_DISABLE_SHARED
171 fi
172
173 # LT_INIT requires libtool v2, might as well state it loud
174 LT_PREREQ([2.2])
175 LT_INIT([dlopen],[disable-shared])
176 if ! test "${ac_top_build_prefix}" = "";
177 then
178 # LTDL v3-v7 macros assume the autoconf 2.62 variable top_build_prefix is defined
179 # But from autoconf 2.64 its called ac_top_build_prefix and not automatically added to the Makefile
180 # This fixes Linux LTDLv3-v7, and BSD LTDL v2.2
181 top_build_prefix=${ac_top_build_prefix}
182 AC_SUBST(top_build_prefix)
183 fi
184 LTDL_INIT
185
186 dnl LibTool environment is now prepared for setup. Check that it is usable and initialize.
187 LT_LIB_DLLOAD
188
189 # Do we need these unconditionally for "make distcheck" to work?
190 AC_SUBST(INCLTDL)
191 AC_SUBST(LIBLTDL)
192
193 if test "x$enable_loadable_modules" = "xyes";
194 then
195 # Why is this needed? Should not LT_INIT (or LT_LIB_DLLOAD) from libtool do that?
196 LIBADD_DL=${lt_cv_dlopen_libs}
197 AC_SUBST([LIBADD_DL])
198 fi
199
200 SQUID_CC_GUESS_VARIANT
201 SQUID_CC_GUESS_OPTIONS
202
203 dnl find out the exe extension for this platform.
204 dnl If it is not empty, use it for CGI as well.
205 AC_EXEEXT
206 AC_OBJEXT
207
208 if test "x$EXEEXT" = "x" ; then
209 CGIEXT=".cgi"
210 else
211 # automake automatically adds .exe when installing binaries
212 CGIEXT=""
213 fi
214 AC_SUBST(CGIEXT)
215
216 AM_CONDITIONAL(ENABLE_WIN32SPECIFIC,[test "x$squid_host_os" = "xmingw"])
217 AM_CONDITIONAL(ENABLE_WIN32_IPC,[test "x$squid_host_os" = "xmingw"])
218
219 case "$squid_host_os" in
220 mingw)
221 AC_PATH_PROG(WIN32_PSAPI, psapi.dll, none)
222 CFLAGS="$CFLAGS -mthreads"
223 CXXFLAGS="$CXXFLAGS -mthreads -static-libgcc -static-libstdc++"
224 if test "x$ac_cv_path_WIN32_PSAPI" = "xnone"; then
225 AC_MSG_NOTICE([PSAPI.DLL is recommended to run Squid on Windows NT Platform])
226 AC_MSG_NOTICE([Please see PSAPI.DLL section on doc/win32-relnotes.html.])
227 else
228 AC_DEFINE(HAVE_WIN32_PSAPI,1,[Define if you have PSAPI.DLL on Windows systems])
229 LIBS="$LIBS -lpsapi"
230 fi
231 MINGW_LIBS="-lmingwex"
232 AC_SUBST(MINGW_LIBS)
233 ;;
234 freebsd)
235 # FreeBSD places local libraries and packages in /usr/local
236 CFLAGS="$CFLAGS -I/usr/local/include"
237 CXXFLAGS="$CXXFLAGS -I/usr/local/include"
238 LDFLAGS="$LDFLAGS -L/usr/local/lib -Wl,-R/usr/local/lib"
239 ;;
240 *)
241 ;;
242 esac
243
244 dnl Substitutions
245 AC_DEFINE_UNQUOTED(CONFIG_HOST_TYPE, "$host",[Host type from configure])
246
247 AC_DEFINE_UNQUOTED(SQUID_CONFIGURE_OPTIONS, "$ac_configure_args",
248 [configure command line used to configure Squid])
249
250 CACHE_EFFECTIVE_USER="nobody"
251 AC_ARG_WITH(default-user,
252 AS_HELP_STRING([--with-default-user=USER],[System user account for squid permissions. Default: nobody]),
253 [ CACHE_EFFECTIVE_USER="$withval" ]
254 )
255 AC_SUBST(CACHE_EFFECTIVE_USER)
256
257 DEFAULT_LOG_DIR="$localstatedir/logs"
258 AC_ARG_WITH(logdir,
259 AS_HELP_STRING([--with-logdir=PATH],
260 [Default location for squid logs. default: PREFIX/var/logs]), [
261 case $withval in
262 yes|no)
263 AC_MSG_ERROR( --with-logdir requires a directory PATH. --with-logdir=PATH )
264 ;;
265 *)
266 DEFAULT_LOG_DIR="$withval"
267 ;;
268 esac
269 ]
270 )
271 AC_SUBST(DEFAULT_LOG_DIR)
272
273 DEFAULT_PID_FILE="$localstatedir/run/@SERVICE_NAME@.pid"
274 AC_ARG_WITH(pidfile,
275 AS_HELP_STRING([--with-pidfile=PATH],
276 [Default location for squid pid file. Default: PREFIX/var/run/squid.pid]), [
277 case $withval in
278 yes|no)
279 AC_MSG_ERROR( --with-pidfile requires a file PATH. --with-pidfile=PATH )
280 ;;
281 *)
282 DEFAULT_PID_FILE="$withval"
283 ;;
284 esac
285 ])
286 AC_SUBST(DEFAULT_PID_FILE)
287
288 DEFAULT_SWAP_DIR="$localstatedir/cache/squid"
289 AC_ARG_WITH(swapdir,
290 AS_HELP_STRING([--with-swapdir=PATH],
291 [Default location for squid cache directories. Default: PREFIX/var/cache/squid]), [
292 case $withval in
293 yes|no)
294 AC_MSG_ERROR( --with-swapdir requires a directory PATH. --with-swapdir=PATH )
295 ;;
296 *)
297 DEFAULT_SWAP_DIR="$withval"
298 ;;
299 esac
300 ])
301 AC_SUBST(DEFAULT_SWAP_DIR)
302
303 dnl Set Default CFLAGS
304 if test "x$PRESET_CFLAGS" = "x"; then
305 if test "$squid_cv_compiler" = "gcc"; then
306 case "$host" in
307 *-sun-sunos*)
308 # sunos has too many warnings for this to be useful
309 # motorola too
310 ;;
311 *m88k*)
312 # Motorola cc/ld does not like -02 but is ok on -O
313 CFLAGS=`echo $CFLAGS | sed -e 's/-O[0-9]/-O/'`
314 ;;
315 *)
316 CFLAGS="$squid_cv_cc_option_wall $CFLAGS"
317 ;;
318 esac
319 else
320 case "$host" in
321 *mips-sgi-irix6.*)
322 # suggested by Rafael Seidl <rafaels@cthulhu.engr.sgi.com>
323 CFLAGS="$squid_cv_cc_option_optimize -OPT:Olimit=0:space=OFF \
324 -woff 1009,1014,1110,1116,1183,1185,1188,1204,1230,1233,1355 \
325 -Wl,-woff,85,-woff,84,-woff,134 \
326 -nostdinc -I/usr/include -D_BSD_SIGNALS $CFLAGS"
327 CXXFLAGS="$squid_cv_cc_option_optimize -OPT:Olimit=0:space=OFF \
328 -woff 1009,1014,1110,1116,1183,1185,1188,1204,1230,1233,1355 \
329 -Wl,-woff,85,-woff,84,-woff,134 \
330 -nostdinc -I/usr/include -D_BSD_SIGNALS $CXXFLAGS"
331 ;;
332 *)
333 ;;
334 esac
335 fi
336 fi
337
338 dnl set squid required flags
339 if test "$squid_cv_compiler" = "gcc"; then
340 case "$squid_host_os" in
341 mingw)
342 dnl Guido Serassio (serassio@squid-cache.org) 20070811
343 dnl Using the latest MinGW (gcc 3.4.5 + mingw-runtime 3.13) cannot build with
344 dnl -Werror -Wmissing-prototypes -Wmissing-declarations
345 dnl TODO: check if the problem will be present in any other newer MinGW release.
346 SQUID_CFLAGS="$squid_cv_cc_option_wall -Wpointer-arith -Wwrite-strings -Wcomments -Wshadow"
347 ;;
348 *)
349 SQUID_CFLAGS="$squid_cv_cc_option_wall -Wpointer-arith -Wwrite-strings -Wmissing-prototypes -Wmissing-declarations -Wcomments -Wshadow"
350 ;;
351 esac
352 SQUID_CXXFLAGS="$squid_cv_cc_option_wall -Wpointer-arith -Wwrite-strings -Wcomments -Wshadow -Woverloaded-virtual"
353 else
354 SQUID_CFLAGS=
355 SQUID_CXXFLAGS=
356 fi
357
358 dnl CentOS (and RHEL) still define ntohs() using deprecated C++ features
359 SQUID_CC_REQUIRE_ARGUMENT([ac_cv_require_wno_deprecated_register],[-Werror -Wno-deprecated-register],[[#include <arpa/inet.h>]],[[int fox=ntohs(1);]])
360
361 if test "x$enable_strict_error_checking" != "xno"; then
362 SQUID_CFLAGS="$SQUID_CFLAGS $squid_cv_cc_option_werror"
363 SQUID_CXXFLAGS="$SQUID_CXXFLAGS $squid_cv_cxx_option_werror"
364 fi
365
366 if test "x$ac_cv_require_wno_deprecated_register" = "xyes"; then
367 SQUID_CXXFLAGS="$SQUID_CXXFLAGS -Wno-deprecated-register"
368 fi
369
370 # squid_cv_cc_arg_pipe is set by SQUID_CC_GUESS_OPTIONS
371 SQUID_CXXFLAGS="$SQUID_CXXFLAGS $squid_cv_cc_arg_pipe"
372 SQUID_CFLAGS="$SQUID_CFLAGS $squid_cv_cc_arg_pipe"
373
374 # possibly include some build info tag into squid -v
375 SQUID_EMBED_BUILD_INFO
376
377 AC_ARG_ENABLE(optimizations,
378 AS_HELP_STRING([--disable-optimizations],
379 [Do not compile Squid with compiler optimizations enabled.
380 Optimization is good for production builds, but not
381 good for debugging. During development, use
382 --disable-optimizations to reduce compilation times
383 and allow easier debugging. This option implies
384 --disable-inline]), [
385 if test "x$enableval" = "xno" ; then
386 AC_MSG_NOTICE([Disabling compiler optimizations (-O flag)])
387 CFLAGS="`echo $CFLAGS | sed -e 's/-O[[0-9g]]*//'`"
388 CXXFLAGS="`echo $CXXFLAGS | sed -e 's/-O[[0-9g]]*//'`"
389 enable_inline="no"
390 fi
391 ])
392
393 AH_TEMPLATE(_USE_INLINE_,[Include inline methods into header file])
394 AC_ARG_ENABLE(inline,
395 AS_HELP_STRING([--disable-inline],
396 [Do not compile trivial methods as inline. Squid
397 is coded with much of the code able to be inlined.
398 Inlining is good for production builds, but not
399 good for development. During development, use
400 --disable-inline to reduce compilation times and
401 allow incremental builds to be quick. For
402 production builds, or load tests, use
403 --enable-inline to have squid make all trivial
404 methods inlinable by the compiler.]), [
405 SQUID_YESNO([$enableval],
406 [Unrecognized argument to --disable-inline: $enableval])
407 ])
408 AC_MSG_NOTICE([inlining optimizations enabled: ${enable_inline:=yes}])
409 SQUID_DEFINE_BOOL(_USE_INLINE_,$enable_inline,
410 [Include inline methods into header file])
411 # to be used by sub-commands
412 export enable_inline
413
414 AC_ARG_ENABLE(debug-cbdata,
415 AS_HELP_STRING([--enable-debug-cbdata],
416 [Provide some debug information in cbdata]), [
417 SQUID_YESNO([$enableval],
418 [unrecognized argument to --enable-debug-cbdata: $enableval])
419 ])
420 SQUID_DEFINE_BOOL(USE_CBDATA_DEBUG,${enable_debug_cbdata:=no},
421 [Enable support for cbdata debug information])
422 AC_MSG_NOTICE([cbdata debugging enabled: $enable_debug_cbdata])
423
424
425 dnl Nasty hack to get autoconf 2.64 on Linux to run.
426 dnl all other uses of RUN_IFELSE are wrapped inside CACHE_CHECK which breaks on 2.64
427 AC_RUN_IFELSE([AC_LANG_SOURCE([[ int main(int argc, char **argv) { return 0; } ]])],[],[],[:])
428
429 AH_TEMPLATE(XMALLOC_STATISTICS,[Define to have malloc statistics])
430 AC_ARG_ENABLE(xmalloc-statistics,
431 AS_HELP_STRING([--enable-xmalloc-statistics],
432 [Show malloc statistics in status page]), [
433 SQUID_YESNO([$enableval],
434 [unrecognized argument to --enable-xmalloc-statistics: $enableval])
435 ])
436 SQUID_DEFINE_BOOL(XMALLOC_STATISTICS,${enable_xmalloc_statistics:=no},
437 [Show malloc statistics in status page])
438 AC_MSG_NOTICE([xmalloc stats display: $enable_xmalloc_statistics])
439
440 squid_opt_aufs_threads=""
441 AC_ARG_WITH(aufs-threads,
442 AS_HELP_STRING([--with-aufs-threads=N_THREADS],
443 [Tune the number of worker threads for the aufs object store.]), [
444 case $withval in
445 [[0-9]]*)
446 squid_opt_aufs_threads=$withval
447 ;;
448 *)
449 AC_MSG_ERROR(--with-aufs-threads expects a numeric argument)
450 ;;
451 esac
452 ])
453 if test "x$squid_opt_aufs_threads" != "x"; then
454 AC_MSG_NOTICE([With $squid_opt_aufs_threads aufs threads])
455 AC_DEFINE_UNQUOTED(AUFS_IO_THREADS,$squid_opt_aufs_threads,
456 [Defines how many threads aufs uses for I/O])
457 fi
458
459 AC_ARG_WITH(dl, AS_HELP_STRING([--with-dl],[Use dynamic linking]))
460 if test "x$with_dl" = "xyes"; then
461 AC_MSG_NOTICE([With dl])
462 fi
463
464 ## check for atomics library before anything that might need it
465 # AC_SEARCH_LIBS pollutes LIBS
466 SQUID_STATE_SAVE(LIBATOMIC)
467 AC_SEARCH_LIBS([__atomic_load_8],[atomic],[
468 test "$ac_res" = "none required" || ATOMICLIB=$ac_res],[])
469 SQUID_STATE_ROLLBACK(LIBATOMIC)
470 AC_SUBST(ATOMICLIB)
471
472 AC_SEARCH_LIBS([shm_open], [rt])
473 if test "x$ac_cv_search_shm_open" != "xno" ; then
474 AC_DEFINE(HAVE_SHM,1,[Support shared memory features])
475 fi
476
477 AC_MSG_CHECKING([for DiskIO modules to be enabled])
478 squid_disk_module_candidates=""
479 squid_opt_enable_diskio="auto" #values: no, yes, "auto"(=yes+detect modules)
480 AC_ARG_ENABLE(disk-io,
481 AS_HELP_STRING([--enable-disk-io="list of modules"],
482 [Build support for the list of disk I/O modules.
483 Set without a value or omitted, all available modules will be built.
484 See src/DiskIO for a list of available modules, or
485 Programmers Guide section on DiskIO
486 for details on how to build your custom disk module]), [
487 case $enableval in
488 yes)
489 ${TRUE}
490 #do nothing, "auto" is ok
491 ;;
492 no)
493 squid_opt_enable_diskio="no"
494 ;;
495 *)
496 squid_opt_enable_diskio="yes"
497 squid_disk_module_candidates=" `echo $enableval| sed -e 's/,/ /g;s/ */ /g'` "
498 SQUID_CLEANUP_MODULES_LIST([squid_disk_module_candidates])
499 ;;
500 esac
501 ])
502
503 # if requested to autodetect, find out what we have
504 if test "x$squid_opt_enable_diskio" = "xauto"; then
505 squid_opt_enable_diskio="yes"
506 SQUID_LOOK_FOR_MODULES([$srcdir/src/DiskIO],[squid_disk_module_candidates])
507 if test "x$ac_cv_search_shm_open" = "xno" ; then
508 # disable IpcIo
509 squid_disk_module_candidates=`echo $squid_disk_module_candidates|sed 's/IpcIo//'`
510 fi
511 fi
512
513 AC_MSG_RESULT([${squid_disk_module_candidates:-none}])
514 SQUID_CHECK_EXISTING_MODULES([$srcdir/src/DiskIO],[squid_disk_module_candidates])
515 SQUID_DEFINE_BOOL(USE_DISKIO,$squid_opt_enable_diskio,
516 [DiskIO modules are expected to be available.])
517
518
519
520 dnl Some autoconf.h defines we might enable later...
521 AC_ARG_WITH(pthreads,AS_HELP_STRING([--without-pthreads],[Disable POSIX Threads]))
522 AC_ARG_WITH(aio, AS_HELP_STRING([--without-aio],[Do not use POSIX AIO. Default: auto-detect]))
523 ENABLE_WIN32_AIOPS=0
524 squid_opt_use_aio=
525 squid_opt_use_diskthreads=
526 AIOLIB=
527
528 dnl Setup the module paths etc.
529 DISK_LIBS=
530 DISK_MODULES=
531 AH_TEMPLATE(HAVE_DISKIO_MODULE_AIO, [Whether POSIX AIO Disk I/O module is built])
532 AH_TEMPLATE(HAVE_DISKIO_MODULE_BLOCKING, [Whether Blocking Disk I/O module is built])
533 AH_TEMPLATE(HAVE_DISKIO_MODULE_DISKDAEMON, [Whether DiskDaemon Disk I/O module is built])
534 AH_TEMPLATE(HAVE_DISKIO_MODULE_DISKTHREADS, [Whether DiskThreads Disk I/O module is built])
535 AH_TEMPLATE(HAVE_DISKIO_MODULE_IPCIO, [Whether IpcIo Disk I/O module is built])
536 AH_TEMPLATE(HAVE_DISKIO_MODULE_MMAPPED, [Whether Mmapped Disk I/O module is built])
537 for module in $squid_disk_module_candidates none; do
538 # maybe not needed
539 if test "x$module" = "xnone"; then
540 continue
541 fi
542 if ! test -d "$srcdir/src/DiskIO/$module"; then
543 AC_MSG_ERROR(disk-io $module does not exist)
544 fi
545 case "$module" in
546
547 AIO)
548 dnl Check for POSIX AIO availability
549 squid_opt_use_aio="yes"
550 AIOLIB=
551 if test "x$with_aio" != "xno"; then
552 have_aio_header=no
553 AC_CHECK_HEADERS(aio.h,[have_aio_header=yes])
554 dnl On some systems POSIX AIO functions are in librt
555 dnl On some systems POSIX AIO functions are in libaio
556 AC_CHECK_LIB(rt,aio_read,[AIOLIB="-lrt"],AC_CHECK_LIB(aio,aio_read,[AIOLIB="-laio"],[]))
557 dnl Enable AIO if the library and headers are found
558 if test "x$AIOLIB" != "x" && test "x$have_aio_header" = "xyes"; then
559 AC_MSG_NOTICE([Native POSIX AIO support detected.])
560 squid_opt_use_aio="yes"
561 else
562 dnl Windows does things differently. We provide wrappers.
563 dnl TODO: Windows really needs its own DiskIO module or its Overlaped IO
564 case "$squid_host_os" in
565 mingw)
566 squid_opt_use_aio="yes"
567 AC_MSG_NOTICE([Windows being built. Maybe-enable POSIX AIO.])
568 ;;
569 *)
570 AC_MSG_NOTICE([Native POSIX AIO support not detected. AIO automatically disabled.])
571 squid_opt_use_aio="no"
572 ;;
573 esac
574 fi
575 else
576 AC_MSG_NOTICE([POSIX AIO support manually disabled.])
577 squid_opt_use_aio="no"
578 fi
579 dnl Use the POSIX AIO pieces if we actually need them.
580 if test "x$squid_opt_use_aio" = "xyes" ; then
581 DISK_MODULES="$DISK_MODULES AIO"
582 AC_DEFINE([HAVE_DISKIO_MODULE_AIO],1,[POSIX AIO Disk I/O module is built])
583 case "$squid_host_os" in
584 mingw)
585 ENABLE_WIN32_AIO=1
586 AC_MSG_NOTICE([Replacing AIO DiskIO module with: Windows overlapped I/O support])
587 ;;
588 *)
589 AC_MSG_NOTICE([Enabling AIO DiskIO module])
590 ;;
591 esac
592 else
593 AC_MSG_NOTICE([AIO DiskIO Module disabled. Missing POSIX AIO support.])
594 squid_disk_module_candidates_AIO=no
595 fi
596 ;;
597
598 Blocking)
599 AC_MSG_NOTICE([Enabling Blocking DiskIO module])
600 DISK_MODULES="$DISK_MODULES Blocking"
601 AC_DEFINE([HAVE_DISKIO_MODULE_BLOCKING],1,[Blocking Disk I/O module is built])
602 ;;
603
604 DiskDaemon)
605 case "$squid_host_os" in
606 mingw)
607 AC_MSG_NOTICE(["DiskDaemon not supported on MinGW"])
608 squid_disk_module_candidates_DiskDaemon=no
609 ;;
610 *)
611 AC_MSG_NOTICE([Enabling DiskDaemon DiskIO module])
612 DISK_MODULES="$DISK_MODULES DiskDaemon"
613 AC_DEFINE([HAVE_DISKIO_MODULE_DISKDAEMON],1,[DiskDaemon Disk I/O module is built])
614 ;;
615 esac
616 ;;
617
618 DiskThreads)
619 squid_opt_use_diskthreads="yes"
620 LIBPTHREADS=
621 SQUID_STATE_SAVE([diskthreads_state],[SQUID_CFLAGS SQUID_CXXFLAGS])
622 if test "x$with_pthreads" != "xno"; then
623 dnl TODO: this needs to be extended to handle more systems and better
624 dnl REF: http://www.openldap.org/lists/openldap-bugs/200006/msg00070.html
625 dnl REF: http://autoconf-archive.cryp.to/acx_pthread.html
626 case "$squid_host_os" in
627 mingw)
628 ENABLE_WIN32_AIOPS=1
629 AC_MSG_NOTICE([Windows threads support automatically enabled])
630 ;;
631 freebsd)
632 if test `echo "$squid_host_os_version" | tr -d .` -lt 70 ; then
633 AC_MSG_NOTICE(pthread library requires FreeBSD 7 or later)
634 squid_opt_use_diskthreads="no"
635 else
636 SQUID_CFLAGS="$SQUID_CFLAGS -D_REENTRANT"
637 SQUID_CXXFLAGS="$SQUID_CXXFLAGS -D_REENTRANT"
638 if test "x$GCC" = "xyes" -a "x$PRESET_LDFLAGS" = "x" ; then
639 LDFLAGS="$LDFLAGS -pthread"
640 fi
641 fi
642 ;;
643 openbsd)
644 if test `echo "$squid_host_os_version" | tr -d .` -lt 52 ; then
645 AC_MSG_NOTICE(pthread library requires OpenBSD 5.2 or later)
646 squid_opt_use_diskthreads="no"
647 else
648 SQUID_CFLAGS="$SQUID_CFLAGS -D_REENTRANT"
649 SQUID_CXXFLAGS="$SQUID_CXXFLAGS -D_REENTRANT"
650 LDFLAGS="$LDFLAGS -lpthread"
651 fi
652 ;;
653 solaris)
654 if test "x$GCC" = "xyes" ; then
655 SQUID_CFLAGS="$SQUID_CFLAGS -D_REENTRANT -pthreads"
656 SQUID_CXXFLAGS="$SQUID_CXXFLAGS -D_REENTRANT -pthreads"
657 AC_CHECK_LIB(pthread, pthread_create ,[LIBPTHREADS="-lpthread"], [
658 AC_MSG_NOTICE(pthread library required but cannot be found.)
659 squid_opt_use_diskthreads="no"
660 ])
661 else
662 dnl test for -lpthread first. libc version is a stub apparently on Solaris.
663 SQUID_CFLAGS="$SQUID_CFLAGS -D_REENTRANT -lpthread"
664 SQUID_CXXFLAGS="$SQUID_CXXFLAGS -D_REENTRANT -lpthread"
665 AC_SEARCH_LIBS([pthread_create],[pthread thread],[
666 LIBPTHREADS="" #in LIBS
667 ],[
668 AC_MSG_NOTICE(pthread library required but cannot be found.)
669 squid_opt_use_diskthreads="no"
670 ])
671 fi
672 ;;
673 *)
674 SQUID_CFLAGS="$SQUID_CFLAGS -D_REENTRANT"
675 SQUID_CXXFLAGS="$SQUID_CXXFLAGS -D_REENTRANT"
676 AC_CHECK_LIB(pthread, pthread_create ,[LIBPTHREADS="-lpthread"], [
677 AC_MSG_NOTICE(pthread library required but cannot be found.)
678 squid_opt_use_diskthreads="no"
679 ])
680 ;;
681 esac
682 else
683 AC_MSG_NOTICE([Native pthreads support manually disabled.])
684 squid_opt_use_diskthreads="no"
685 fi
686 if test "x$squid_opt_use_diskthreads" = "xyes" ; then
687 AC_MSG_NOTICE([Enabling DiskThreads DiskIO module])
688 DISK_MODULES="$DISK_MODULES DiskThreads"
689 AC_DEFINE([HAVE_DISKIO_MODULE_DISKTHREADS],1,[DiskThreads Disk I/O module is built])
690 else
691 AC_MSG_NOTICE([Native pthreads support disabled. DiskThreads module automaticaly disabled.])
692 SQUID_STATE_ROLLBACK([diskthreads_state])
693 squid_disk_module_candidates_DiskThreads=no
694 fi
695 ;;
696
697 IpcIo)
698 if test "x$ac_cv_search_shm_open" = "xno" ; then
699 AC_MSG_NOTICE([DiskIO IpcIo module requires shared memory support])
700 squid_disk_module_candidates_IpcIo=no
701 else
702 AC_MSG_NOTICE([Enabling IpcIo DiskIO module])
703 DISK_MODULES="$DISK_MODULES IpcIo"
704 AC_DEFINE([HAVE_DISKIO_MODULE_IPCIO],1,[IpcIo Disk I/O module is built])
705 fi
706 ;;
707
708 Mmapped)
709 dnl TODO: use availability of sys/mman.h and/or mmap to define
710 dnl OR support windows mmap functions
711 if test "x$squid_host_os" = "xmingw" ; then
712 AC_MSG_NOTICE([Mmapped DiskIO is not available on Mingw])
713 squid_disk_module_candidates_Mmapped=no
714 else
715 AC_MSG_NOTICE([Enabling Mmapped DiskIO module])
716 DISK_MODULES="$DISK_MODULES Mmapped"
717 AC_DEFINE([HAVE_DISKIO_MODULE_MMAPPED],1,[Mmapped Disk I/O module is built])
718 fi
719 ;;
720
721 *)
722 AC_MSG_NOTICE([Enabling $module DiskIO module])
723 DISK_LIBS="$DISK_LIBS lib${module}.la"
724 DISK_MODULES="$DISK_MODULES ${module}"
725 ;;
726 esac
727 done
728 AC_MSG_NOTICE([IO Modules built: $DISK_MODULES])
729 AC_SUBST(DISK_MODULES)
730 AC_SUBST(DISK_LIBS)
731 AM_CONDITIONAL(ENABLE_DISKIO_AIO, test "x$squid_disk_module_candidates_AIO" = "xyes")
732 AC_SUBST(AIOLIB)
733 AM_CONDITIONAL(ENABLE_WIN32_AIO, test "x$squid_disk_module_candidates_AIO" = "xyes" -a "x$ENABLE_WIN32_AIO" = "x1")
734 AM_CONDITIONAL(ENABLE_DISKIO_BLOCKING, test "x$squid_disk_module_candidates_Blocking" = "xyes")
735 AM_CONDITIONAL(ENABLE_DISKIO_DISKDAEMON, test "x$squid_disk_module_candidates_DiskDaemon" = "xyes")
736 AM_CONDITIONAL(ENABLE_DISKIO_DISKTHREADS, test "x$squid_disk_module_candidates_DiskThreads" = "xyes")
737 AC_SUBST(LIBPTHREADS)
738 AM_CONDITIONAL(ENABLE_WIN32_AIOPS, test "x$squid_disk_module_candidates_DiskThreads" = "xyes" -a "x$ENABLE_WIN32_AIOPS" = "x1")
739 AM_CONDITIONAL(ENABLE_DISKIO_IPCIO, test "x$squid_disk_module_candidates_IpcIo" = "xyes")
740 AM_CONDITIONAL(ENABLE_DISKIO_MMAPPED, test "x$squid_disk_module_candidates_Mmapped" = "xyes")
741
742 dnl Check what Storage formats are wanted.
743 dnl This version will error out with a message saying why if a required DiskIO is missing.
744 squid_opt_enable_storeio=auto
745 AC_ARG_ENABLE([storeio],
746 AS_HELP_STRING([--enable-storeio="list of modules"],
747 [Build support for the list of store I/O modules.
748 The default is only to build the "ufs" module.
749 See src/fs for a list of available modules, or
750 Programmers Guide section <not yet written>
751 for details on how to build your custom store module]), [
752 case $enableval in
753 yes)
754 squid_opt_enable_storeio=auto
755 ;;
756 no)
757 squid_opt_enable_storeio=no
758 ;;
759 *)
760 squid_opt_enable_storeio=yes
761 squid_storeio_module_candidates="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`"
762 # ufs is really always needed as it has low-level routines
763 # if it is a dupe it will be cleaned-up later
764 squid_storeio_module_candidates="$squid_storeio_module_candidates ufs"
765 ;;
766 esac
767 ])
768 if test "x$squid_opt_enable_storeio" = "xauto"; then
769 squid_opt_enable_storeio=yes
770 AC_MSG_CHECKING([for available StoreIO modules])
771 SQUID_LOOK_FOR_MODULES([$srcdir/src/fs],[squid_storeio_module_candidates])
772 AC_MSG_RESULT([$squid_storeio_module_candidates])
773 fi
774
775 SQUID_CLEANUP_MODULES_LIST([squid_storeio_module_candidates])
776 SQUID_CHECK_EXISTING_MODULES([$srcdir/src/fs],[squid_storeio_module_candidates])
777 AC_MSG_NOTICE([Store modules built: $squid_storeio_module_candidates])
778
779 for fs in $squid_storeio_module_candidates none; do
780 case "$fs" in
781 diskd)
782 if test "x$squid_disk_module_candidates_Blocking" != "xyes" -a \
783 "$squid_disk_module_candidates_DiskDaemon" != "yes" ; then
784 AC_MSG_ERROR([Storage diskd module requires DiskIO module: Blocking or DiskDaemon])
785 fi
786 ;;
787 aufs)
788 if test "x$squid_disk_module_candidates_Blocking" != "xyes" -a \
789 "$squid_disk_module_candidates_DiskThreads" != "yes" ; then
790 AC_MSG_ERROR([Storage module aufs requires DiskIO module: Blocking or DiskThreads])
791 fi
792 ;;
793 rock)
794 if test "x$squid_disk_module_candidates_IpcIo" != "xyes" -a \
795 "x$squid_disk_module_candidates_Blocking" != "xyes"; then
796 AC_MSG_ERROR([Storage module Rock requires DiskIO module: Blocking or IpcIo])
797 fi
798 squid_do_build_rock=true
799 ;;
800 ufs)
801 if test "x$squid_disk_module_candidates_Blocking" != "xyes"; then
802 AC_MSG_ERROR([Storage module ufs requires DiskIO module: Blocking])
803 fi
804 squid_do_build_ufs=true
805 ;;
806 esac
807 done
808
809 AM_CONDITIONAL(ENABLE_FS_UFS, test "x$squid_do_build_ufs" = "xtrue")
810 AM_CONDITIONAL(ENABLE_FS_ROCK, test "x$squid_do_build_rock" = "xtrue")
811 dnl hack: need to define those even if not used in the build system to
812 dnl make sure that global FS objects are linked to the squid binary.
813 AH_TEMPLATE(HAVE_FS_UFS, "Define to 1 if ufs filesystem module is build")
814 AH_TEMPLATE(HAVE_FS_AUFS, "Define to 1 if aufs filesystem module is build")
815 AH_TEMPLATE(HAVE_FS_DISKD, "Define to 1 if diskd filesystem module is build")
816 AH_TEMPLATE(HAVE_FS_ROCK, "Define to 1 if rock filesystem module is build")
817
818
819 dnl got final squid_storeio_module_candidates, build library lists
820 dnl This list will not be needed when each fs library has its own Makefile
821 STORE_LIBS_TO_BUILD=
822 dnl File system libraries to link executables with.
823 dnl These are the same as STORE_LIBS_TO_BUILD, but with a path
824 STORE_LIBS_TO_ADD=
825 for fs in $squid_storeio_module_candidates; do
826 STORE_LIBS_TO_BUILD="$STORE_LIBS_TO_BUILD lib${fs}.la"
827 STORE_LIBS_TO_ADD="$STORE_LIBS_TO_ADD fs/lib${fs}.la"
828 SQUID_TOUPPER_VAR_CONTENTS([fs])
829 AC_DEFINE_UNQUOTED(HAVE_FS_${fs}, 1)
830 done
831
832 AC_SUBST(STORE_LIBS_TO_BUILD)
833 AC_SUBST(STORE_LIBS_TO_ADD)
834 AC_SUBST(STORE_TESTS)
835
836
837 dnl At lest one removal policy is always needed.
838 dnl 'lru' removal policy is currently hard-coded by name for tests
839 dnl so we must set it as default.
840 REPL_POLICIES="lru"
841 AC_ARG_ENABLE(removal-policies,
842 AS_HELP_STRING([--enable-removal-policies="list of policies"],
843 [Build support for the list of removal policies.
844 The default is only to build the "lru" module.
845 See src/repl for a list of available modules, or
846 Programmers Guide section 9.9 for details on how
847 to build your custom policy]), [
848 case $enableval in
849 yes)
850 SQUID_LOOK_FOR_MODULES([$srcdir/src/repl],[REPL_POLICIES])
851 ;;
852 no)
853 ;;
854 *)
855 REPL_POLICIES="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`"
856 ;;
857 esac
858 ])
859 if test "x$REPL_POLICIES" != "x" ; then
860 SQUID_CHECK_EXISTING_MODULES([$srcdir/src/repl],[REPL_POLICIES])
861 AC_MSG_NOTICE([Removal policies to build: $REPL_POLICIES])
862 REPL_OBJS="repl/lib`echo $REPL_POLICIES|sed -e 's% %.a repl/lib%g'`.a"
863 REPL_LIBS="`echo $REPL_OBJS|sed -e 's%repl/%%g'`"
864 fi
865 AC_SUBST(REPL_POLICIES)
866 AC_SUBST(REPL_OBJS)
867 AC_SUBST(REPL_LIBS)
868
869 AM_CONDITIONAL(ENABLE_PINGER, false)
870 AC_ARG_ENABLE(icmp,
871 AS_HELP_STRING([--enable-icmp],[Enable ICMP pinging and Network Measurement]),
872 [ if test "x$enableval" = "xyes" ; then
873 AC_MSG_NOTICE([ICMP enabled])
874 AC_DEFINE(USE_ICMP,1,[Define to use Squid ICMP and Network Measurement features (highly recommended!)])
875 AM_CONDITIONAL(ENABLE_PINGER, true)
876 fi
877 ])
878
879 AM_CONDITIONAL(ENABLE_DELAY_POOLS, false)
880 AC_ARG_ENABLE(delay-pools,
881 AS_HELP_STRING([--enable-delay-pools],[Enable delay pools to limit bandwidth usage]),
882 [ if test "x$enableval" = "xyes" ; then
883 AC_MSG_NOTICE([Delay pools enabled])
884 AC_DEFINE([USE_DELAY_POOLS],1,[Traffic management via "delay pools".])
885 AM_CONDITIONAL(ENABLE_DELAY_POOLS, true)
886 fi
887 ])
888
889 dnl disable generic/common adaptation support by default
890 squid_opt_use_adaptation=no
891
892 squid_opt_use_esi=yes
893 AH_TEMPLATE([USE_SQUID_ESI],
894 [Define to enable the ESI processor and Surrogate header support])
895 AC_ARG_ENABLE(esi,
896 AS_HELP_STRING([--enable-esi],
897 [Enable ESI for accelerators. Benefits from expat or libxml2.
898 Enabling ESI will cause squid reverse proxies to be capable
899 of the Edge Acceleration Specification (www.esi.org).]),
900 [squid_opt_use_esi=$enableval], [squid_opt_use_esi=no])
901 HAVE_LIBEXPAT=0
902 EXPATLIB=
903 HAVE_LIBXML2=0
904 XMLLIB=
905 if test "x$squid_opt_use_esi" = "xyes" ; then
906 AC_MSG_NOTICE([Enabling ESI processor and Surrogate header support.])
907 AC_DEFINE(USE_SQUID_ESI,1,
908 [Compile the ESI processor and Surrogate header support])
909 else
910 AC_MSG_NOTICE([Disabling ESI processor])
911 fi
912
913 # ESI support libraries: expat
914 AC_ARG_WITH(expat, AS_HELP_STRING([--without-expat],[Do not use expat for ESI. Default: auto-detect]))
915 if test "x$squid_opt_use_esi" = "xyes" -a "x$with_expat" != "xno" ; then
916 AC_CHECK_LIB([expat], [main], [EXPATLIB="-lexpat"; HAVE_LIBEXPAT=1])
917 AC_CHECK_HEADERS([expat.h])
918 AC_DEFINE_UNQUOTED(HAVE_LIBEXPAT, $HAVE_LIBEXPAT, [Define to 1 if you have the expat library])
919 if test "x$with_expat" = "xyes" -a "x$HAVE_LIBEXPAT" != "x1" ; then
920 AC_MSG_ERROR([Required library expat is not able to be found.])
921 fi
922 fi
923
924 AC_ARG_WITH(libxml2, AS_HELP_STRING([--without-libxml2],[Do not use libxml2 for ESI. Default: auto-detect]))
925 if test "x$squid_opt_use_esi" = "xyes" -a "x$with_libxml2" != "xno" ; then
926 AC_CHECK_LIB([xml2], [main], [XMLLIB="-lxml2"; HAVE_LIBXML2=1])
927 dnl Find the main header and include path...
928 AC_CACHE_CHECK([location of libxml2 include files], [ac_cv_libxml2_include], [
929 AC_CHECK_HEADERS([libxml/parser.h], [], [
930 AC_MSG_NOTICE([Testing in /usr/include/libxml2])
931 SAVED_CPPFLAGS="$CPPFLAGS"
932 CPPFLAGS="-I/usr/include/libxml2 $CPPFLAGS"
933 unset ac_cv_header_libxml_parser_h
934 AC_CHECK_HEADERS([libxml/parser.h], [ac_cv_libxml2_include="-I/usr/include/libxml2"], [
935 AC_MSG_NOTICE([Testing in /usr/local/include/libxml2])
936 CPPFLAGS="-I/usr/local/include/libxml2 $SAVED_CPPFLAGS"
937 unset ac_cv_header_libxml_parser_h
938 AC_CHECK_HEADERS([libxml/parser.h], [ac_cv_libxml2_include="-I/usr/local/include/libxml2"], [
939 AC_MSG_NOTICE([Failed to find libxml2 header file libxml/parser.h])
940 ])
941 ])
942 CPPFLAGS="$SAVED_CPPFLAGS"
943 ])
944 ])
945 if test "x$ac_cv_libxml2_include" != "x"; then
946 SQUID_CXXFLAGS="$ac_cv_libxml2_include $SQUID_CXXFLAGS"
947 CPPFLAGS="$ac_cv_libxml2_include $CPPFLAGS"
948 fi
949 dnl Now that we know where to look find the headers...
950 AC_CHECK_HEADERS(libxml/parser.h libxml/HTMLparser.h libxml/HTMLtree.h)
951 AC_DEFINE_UNQUOTED(HAVE_LIBXML2, $HAVE_LIBXML2, [Define to 1 if you have the libxml2 library])
952 if test "x$with_libxml2" = "xyes" -a "$HAVE_LIBXML2" != "1" ; then
953 AC_MSG_ERROR([Required library libxml2 is not able to be found.])
954 fi
955 fi
956
957 AM_CONDITIONAL(ENABLE_ESI, test "x$squid_opt_use_esi" = "xyes")
958 AM_CONDITIONAL(ENABLE_LIBEXPAT, test "$HAVE_LIBEXPAT" = 1)
959 AC_SUBST(EXPATLIB)
960 AM_CONDITIONAL(ENABLE_LIBXML2, test "$HAVE_LIBXML2" = 1)
961 AC_SUBST(XMLLIB)
962
963 # icap argument handling
964 AC_ARG_ENABLE(icap-client,
965 AS_HELP_STRING([--disable-icap-client],[Disable the ICAP client.]),[
966 SQUID_YESNO([$enableval],[Unrecognized argument to --disable-icap-client: $enableval])
967 ])
968 SQUID_DEFINE_BOOL(ICAP_CLIENT,${enable_icap_client:=yes}, [Enable ICAP client features in Squid])
969 AS_IF(test "x$enable_icap_client" != "xno", squid_opt_use_adaptation="yes")
970 AM_CONDITIONAL(ENABLE_ICAP_CLIENT, test "x$enable_icap_client" != "xno")
971
972 squid_opt_use_ecap=1
973 AC_MSG_CHECKING(whether to support eCAP)
974 AC_ARG_ENABLE(ecap,
975 AS_HELP_STRING([--enable-ecap],[support loadable content adaptation modules]), [
976 case "${enableval}" in
977 yes|no) squid_opt_use_ecap=$enableval ;;
978 *) AC_MSG_ERROR(bad value ${enableval} for --enable-ecap) ;;
979 esac
980 AC_MSG_RESULT([$squid_opt_use_ecap, explicitly])
981 ], [
982 squid_opt_use_ecap=no;
983 AC_MSG_RESULT([$squid_opt_use_ecap, implicitly])
984 ]
985 )
986
987 dnl Necessary if the first PKG_CHECK_MODULES call is conditional
988 PKG_PROG_PKG_CONFIG
989
990 dnl Perform configuration consistency checks for eCAP
991 if test "x$squid_opt_use_ecap" != "xno";
992 then
993 dnl eCAP support requires loadable modules, which are enabled by default
994 if test "x$enable_loadable_modules" != "xyes"
995 then
996 AC_MSG_ERROR([eCAP support requires loadable modules. Please do not use --disable-loadable-modules with --enable-ecap.])
997 fi
998
999 if test -n "$PKG_CONFIG"; then
1000 dnl eCAP support requires libecap.
1001 dnl This Squid supports libecap v1.0.x.
1002 dnl Use EXT_ prefix to distinguish external libecap (that we check for
1003 dnl here) from our own convenience ecap library in Makefiles.
1004 PKG_CHECK_MODULES([EXT_LIBECAP],[libecap >= 1.0 libecap < 1.1])
1005 else
1006 AC_MSG_NOTICE([eCAP support requires pkg-config to verify the correct library version. Trouble may follow.])
1007 fi
1008
1009 SQUID_STATE_SAVE(squid_ecap_state)
1010 AC_MSG_CHECKING([whether -lecap will link])
1011 CXXFLAGS="$CXXFLAGS $EXT_LIBECAP_CFLAGS"
1012 LIBS="$LIBS $EXT_LIBECAP_LIBS"
1013 AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <libecap/common/names.h>]],[[
1014 const libecap::Name test("test", libecap::Name::NextId());
1015 ]])],[
1016 AC_MSG_RESULT(yes)
1017 squid_opt_use_adaptation=yes
1018 ],[
1019 AC_MSG_RESULT(no)
1020 AS_IF(
1021 test "x$squid_opt_use_ecap" = "xyes", AC_MSG_ERROR([eCAP library will not link.
1022 You may need to rebuild libecap using the same version of GCC as Squid.
1023 There have been breaking ABI changes in the libstdc++ STL with GCC 5.]),
1024
1025 [AC_MSG_NOTICE([eCAP library will not link.
1026 You may need to rebuild libecap using the same version of GCC as Squid.
1027 There have been breaking ABI changes in the libstdc++ STL with GCC 5.])
1028 squid_opt_use_ecap="no"
1029 ])
1030 ])
1031 SQUID_STATE_ROLLBACK(squid_ecap_state)
1032 fi
1033 SQUID_DEFINE_BOOL(USE_ECAP,${squid_opt_use_ecap:=no},[Whether to use eCAP support])
1034 AM_CONDITIONAL(ENABLE_ECAP, test "x$squid_opt_use_ecap" = "xyes")
1035
1036 dnl enable adaptation if requested by specific adaptation mechanisms
1037 ADAPTATION_LIBS=""
1038 if test "x$squid_opt_use_adaptation" = "xyes"; then
1039 ADAPTATION_LIBS="adaptation/libadaptation.la"
1040 fi
1041 SQUID_DEFINE_BOOL(USE_ADAPTATION,${squid_opt_use_adaptation:=no}, [common adaptation support])
1042 AM_CONDITIONAL(ENABLE_ADAPTATION, test "x$squid_opt_use_adaptation" = "xyes")
1043 AC_SUBST(ADAPTATION_LIBS)
1044
1045 test "x$squid_host_os" = "xmingw" && enable_wccp=no
1046 AC_ARG_ENABLE(wccp,
1047 AS_HELP_STRING([--disable-wccp],[Disable Web Cache Coordination Protocol]), [
1048 SQUID_YESNO([$enableval],[unrecognized argument to --disable-wccp: $enableval])
1049 ])
1050 SQUID_DEFINE_BOOL(USE_WCCP, ${enable_wccp:=yes}, [Define to enable WCCP])
1051 AC_MSG_NOTICE([Web Cache Coordination Protocol enabled: $enable_wccp])
1052
1053 test "x$squid_host_os" = "xmingw" && enable_wccpv2=no
1054 AC_ARG_ENABLE(wccpv2,
1055 AS_HELP_STRING([--disable-wccpv2],
1056 [Disable Web Cache Coordination V2 Protocol]), [
1057 SQUID_YESNO([$enableval],
1058 [unrecognized argument to --disable-wccpv2: $enableval])
1059 ])
1060 SQUID_DEFINE_BOOL(USE_WCCPv2,${enable_wccpv2:=yes},
1061 [Define to enable WCCP V2])
1062 AC_MSG_NOTICE([Web Cache Coordination V2 Protocol enabled: $enable_wccpv2])
1063
1064 AC_ARG_ENABLE(kill-parent-hack,
1065 AS_HELP_STRING([--enable-kill-parent-hack],[Kill parent on shutdown]), [
1066 SQUID_YESNO([$enableval],
1067 [unrecognized argument to --enable-kill-parent-hack: $enableval])
1068 ])
1069 SQUID_DEFINE_BOOL(KILL_PARENT_OPT,${enable_kill_parent_hack:=no},
1070 [A dangerous feature which causes Squid to kill its parent
1071 process (presumably the RunCache script) upon receipt
1072 of SIGTERM or SIGINT. Deprecated, Use with caution.])
1073 AC_MSG_NOTICE([Kill parent on shutdown hack enabled: $enable_kill_parent_hack])
1074
1075 AC_ARG_ENABLE(snmp,
1076 AS_HELP_STRING([--disable-snmp],[Disable SNMP monitoring support]), [
1077 SQUID_YESNO([$enableval],
1078 [unrecognized argument to --disable-snmp: $enableval])
1079 ])
1080 SQUID_DEFINE_BOOL(SQUID_SNMP,${enable_snmp:=yes},
1081 [Define to enable SNMP monitoring of Squid])
1082 AM_CONDITIONAL(ENABLE_SNMP, [test "x$enable_snmp" = "xyes"])
1083 if test "x$enable_snmp" = "xyes"; then
1084 SNMPLIB='../lib/snmplib/libsnmplib.la'
1085 fi
1086 AC_MSG_NOTICE([SNMP support enabled: $enable_snmp])
1087 AC_SUBST(SNMPLIB)
1088
1089 AC_ARG_ENABLE(cachemgr-hostname,
1090 AS_HELP_STRING([--enable-cachemgr-hostname=hostname],
1091 [Make cachemgr.cgi default to this host.
1092 If unspecified, uses the name of the build-host]), [
1093 case $enableval in
1094 yes)
1095 AC_DEFINE(CACHEMGR_HOSTNAME,[getfullhostname()],
1096 [If you are upset that the cachemgr.cgi form comes up with the hostname field blank, then define this to getfullhostname()])
1097 AC_MSG_NOTICE([Cachemgr default hostname == host where cachemgr runs])
1098 ;;
1099 no)
1100 : # Nothing to do..
1101 ;;
1102 *)
1103 AC_DEFINE_UNQUOTED(CACHEMGR_HOSTNAME,"${enableval}")
1104 AC_MSG_NOTICE([Cachemgr default hostname set to ${enableval}])
1105 ;;
1106 esac
1107 ])
1108
1109 AC_ARG_ENABLE(eui,
1110 AS_HELP_STRING([--disable-eui],
1111 [Disable use of ARP / MAC/ EUI (ether address)]), [
1112 SQUID_YESNO([$enableval],[--disable-eui expects no arguments])
1113 ])
1114 if test "x${enable_eui:=yes}" = "xyes" ; then
1115 case "$squid_host_os" in
1116 linux|solaris|freebsd|openbsd|netbsd|cygwin)
1117 ${TRUE}
1118 ;;
1119 mingw)
1120 EUILIB="-liphlpapi"
1121 ;;
1122 *)
1123 AC_MSG_WARN([EUI support probably will not work on host $host.])
1124 ;;
1125 esac
1126 # iphlpapi.h check delayed after winsock2.h
1127 AC_CHECK_HEADERS( \
1128 windows.h \
1129 sys/sockio.h \
1130 sys/param.h,
1131 [], [], [[
1132 #if HAVE_WINDOWS_H
1133 include <windows.h>
1134 #endif
1135 ]]
1136 )
1137 AC_CHECK_HEADERS( \
1138 net/if_arp.h \
1139 net/route.h,
1140 [], [], [[
1141 #include <sys/types.h>
1142 #include <sys/socket.h>
1143 ]])
1144
1145 # OpenBSD, FreeBSD and NetBSD requires sys/param.h to be included before sysctl.h and net/if_dl.h
1146 AC_CHECK_HEADERS( \
1147 net/if_dl.h \
1148 sys/sysctl.h,
1149 [], [], [[
1150 #if HAVE_SYS_PARAM_H
1151 #include <sys/param.h>
1152 #endif
1153 ]])
1154 fi
1155 AC_SUBST(EUILIB)
1156 AC_MSG_NOTICE([EUI (MAC address) controls enabled: $enable_eui])
1157 SQUID_DEFINE_BOOL(USE_SQUID_EUI,$enable_eui,
1158 [Define this to include code which lets you use ethernet addresses. This code uses API initially defined in 4.4-BSD.])
1159 AM_CONDITIONAL(ENABLE_EUI, [test "x$enable_eui" = "xyes" ])
1160
1161
1162 AC_ARG_ENABLE(htcp,
1163 AS_HELP_STRING([--disable-htcp],[Disable HTCP protocol support]), [
1164 SQUID_YESNO([$enableval],
1165 [unrecognized argument to --disable-htcp: $enableval])
1166 ])
1167 SQUID_DEFINE_BOOL(USE_HTCP,${enable_htcp:=yes},
1168 [Define this to include code for the Hypertext Cache Protocol (HTCP)])
1169 AM_CONDITIONAL(ENABLE_HTCP, [test "x$enable_htcp" = "xyes"])
1170 AC_MSG_NOTICE([HTCP support enabled: $enable_htcp])
1171
1172 # Cryptograhic libraries
1173 AC_ARG_WITH(nettle,
1174 AS_HELP_STRING([--without-nettle],[Compile without the Nettle crypto library.]),[
1175 case "$with_nettle" in
1176 yes|no)
1177 : # Nothing special to do here
1178 ;;
1179 *)
1180 if test ! -d "$withval" ; then
1181 AC_MSG_ERROR([--with-nettle path does not point to a directory])
1182 fi
1183 NETTLELIBDIR="-L$with_nettle/lib"
1184 CPPFLAGS="-I$with_nettle/include $CPPFLAGS"
1185 with_nettle=yes
1186 esac
1187 ])
1188 if test "x$with_nettle" != "xno" ; then
1189 AC_CHECK_LIB(nettle, nettle_md5_init,[
1190 NETTLELIB="$NETTLELIBDIR -lnettle"
1191 AC_CHECK_HEADERS(nettle/md5.h)
1192 ],[with_nettle=no])
1193 if test "x$with_nettle" != "xno" ; then
1194 # Base64 uses the nettle 3.0 API
1195 # which matters on 64-bit systems
1196 AC_CHECK_HEADERS(nettle/base64.h)
1197 AC_MSG_CHECKING([for Nettle 3.0 API compatibility])
1198 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1199 # include <cstddef>
1200 # include <cstdint>
1201 # include <nettle/base64.h>
1202 ]],[[
1203 uint8_t inData[10]; inData[0] = '\0';
1204 size_t srcLen = 0;
1205 struct base64_decode_ctx ctx;
1206 base64_decode_init(&ctx);
1207 uint8_t outData[10];
1208 size_t dstLen = 0;
1209 if (!base64_decode_update(&ctx, &dstLen, outData, srcLen, inData) ||
1210 !base64_decode_final(&ctx)) {
1211 return 1;
1212 }
1213 ]])],[AC_MSG_RESULT(yes)
1214 AC_DEFINE(HAVE_NETTLE30_BASE64,1,[set to 1 if Nettle 3.0 API will link])
1215 ],[AC_MSG_RESULT(no)])
1216 fi
1217 fi
1218 AC_MSG_NOTICE([Using Nettle cryptographic library: ${with_nettle:=yes}])
1219 AC_SUBST(NETTLELIB)
1220
1221 dnl Check for libcrypt
1222 CRYPTLIB=
1223 dnl Some of our helpers use crypt(3) which may be in libc, or in
1224 dnl libcrypt (eg FreeBSD)
1225 AC_CHECK_LIB(crypt, crypt, [CRYPTLIB="-lcrypt"])
1226 dnl Solaris10 provides MD5 natively through libmd5
1227 AC_CHECK_LIB(md5, MD5Init, [CRYPTLIB="$CRYPTLIB -lmd5"])
1228 AC_SUBST(CRYPTLIB)
1229
1230 SSLLIB=""
1231
1232 dnl User may want to disable GnuTLS
1233 AC_ARG_WITH(gnutls,
1234 AS_HELP_STRING([--without-gnutls],
1235 [Do not use GnuTLS for SSL. Default: auto-detect]), [
1236 case "$with_gnutls" in
1237 yes|no)
1238 : # Nothing special to do here
1239 ;;
1240 *)
1241 if test ! -d "$withval" ; then
1242 AC_MSG_ERROR([--with-gnutls path does not point to a directory])
1243 fi
1244 LIBGNUTLS_PATH="-L$with_gnutls/lib"
1245 CPPFLAGS="-I$with_gnutls/include $CPPFLAGS"
1246 esac
1247 ])
1248 AH_TEMPLATE(USE_GNUTLS,[GnuTLS support is available])
1249 if test "x$with_gnutls" != "xno"; then
1250 SQUID_STATE_SAVE(squid_gnutls_state)
1251
1252 # User may have provided a custom location for GnuTLS. Otherwise...
1253 LIBS="$LIBS $LIBGNUTLS_PATH"
1254
1255 # auto-detect using pkg-config
1256 PKG_CHECK_MODULES([LIBGNUTLS],[gnutls >= 3.1.5],[
1257 CPPFLAGS="$CPPFLAGS $LIBGNUTLS_CFLAGS"
1258 ],[
1259 ## find the package without pkg-config
1260 ## check that the library is actually new enough.
1261 ## by testing for a 3.1.5+ function which we use
1262 AC_CHECK_LIB(gnutls,gnutls_certificate_verify_peers3,[LIBGNUTLS_LIBS="-lgnutls"])
1263 ])
1264 AC_CHECK_HEADERS(gnutls/gnutls.h gnutls/x509.h)
1265
1266 SQUID_STATE_ROLLBACK(squid_gnutls_state) #de-pollute LIBS
1267
1268 if test "x$with_gnutls" = "xyes" -a "x$LIBGNUTLS_LIBS" = "x"; then
1269 AC_MSG_ERROR([Required GnuTLS library not found])
1270 fi
1271 if test "x$LIBGNUTLS_LIBS" != "x" ; then
1272 CXXFLAGS="$LIBGNUTLS_CFLAGS $CXXFLAGS"
1273 SSLLIB="$LIBGNUTLS_PATH $LIBGNUTLS_LIBS $SSLLIB"
1274 AC_DEFINE(USE_GNUTLS,1,[GnuTLS support is available])
1275 else
1276 with_gnutls=no
1277 fi
1278 fi
1279 AC_MSG_NOTICE([GnuTLS library support: ${with_gnutls:=auto} ${LIBGNUTLS_PATH} ${LIBGNUTLS_LIBS}])
1280
1281 dnl User may specify OpenSSL is needed from a non-standard location
1282 AC_ARG_WITH(openssl,
1283 AS_HELP_STRING([--with-openssl=PATH],
1284 [Compile with the OpenSSL libraries. The path to
1285 the OpenSSL development libraries and headers
1286 installation can be specified if outside of the
1287 system standard directories]), [
1288 case "$with_openssl" in
1289 yes|no)
1290 : # Nothing special to do here
1291 ;;
1292 *)
1293 if test ! -d "$withval" ; then
1294 AC_MSG_ERROR([--with-openssl path does not point to a directory])
1295 fi
1296 LIBOPENSSL_PATH="-L$with_openssl/lib"
1297 CPPFLAGS="-I$with_openssl/include $CPPFLAGS"
1298 with_openssl=yes
1299 esac
1300 ])
1301 AH_TEMPLATE(USE_OPENSSL,[OpenSSL support is available])
1302 ## OpenSSL is default disable due to licensing issues on some OS
1303 if test "x$with_openssl" = "xyes"; then
1304 AC_CHECK_HEADERS( \
1305 openssl/bio.h \
1306 openssl/crypto.h \
1307 openssl/err.h \
1308 openssl/md5.h \
1309 openssl/opensslv.h \
1310 openssl/ssl.h \
1311 openssl/x509v3.h \
1312 openssl/engine.h \
1313 openssl/txt_db.h \
1314 )
1315
1316 # User may have provided a custom location for OpenSSL. Otherwise...
1317 SQUID_STATE_SAVE(squid_openssl_state)
1318 LIBS="$LIBS $LIBOPENSSL_PATH"
1319
1320 # auto-detect using pkg-config
1321 PKG_CHECK_MODULES([LIBOPENSSL],[openssl],,[
1322 ## For some OS pkg-config is broken or unavailable.
1323 ## Detect libraries the hard way.
1324
1325 # Windows MinGW has some special libraries ...
1326 if test "x$squid_host_os" = "xmingw" ; then
1327 LIBOPENSSL_LIBS='-lssleay32 -leay32 -lgdi32 $LIBOPENSSL_LIBS'
1328 AC_MSG_NOTICE([Windows OpenSSL library support: yes -lssleay32 -leay32 -lgdi32])
1329 fi
1330
1331 AC_CHECK_LIB(crypto,[CRYPTO_new_ex_data],[LIBOPENSSL_LIBS="-lcrypto $LIBOPENSSL_LIBS"],[
1332 AC_MSG_ERROR([library 'crypto' is required for OpenSSL])
1333 ],$LIBOPENSSL_LIBS)
1334 AC_CHECK_LIB(ssl,[SSL_library_init],[LIBOPENSSL_LIBS="-lssl $LIBOPENSSL_LIBS"],[
1335 AC_MSG_ERROR([library 'ssl' is required for OpenSSL])
1336 ],$LIBOPENSSL_LIBS)
1337 ])
1338
1339 # This is a workaround for RedHat 9 brain damage..
1340 if test -d /usr/kerberos/include -a -f /usr/include/openssl/kssl.h; then
1341 AC_MSG_NOTICE([OpenSSL depends on Kerberos])
1342 LIBOPENSSL_LIBS="-L/usr/kerberos/lib $LIBOPENSSL_LIBS"
1343 CPPFLAGS="$CPPFLAGS -I/usr/kerberos/include"
1344 fi
1345 SQUID_STATE_ROLLBACK(squid_openssl_state) #de-pollute LIBS
1346
1347 if test "x$LIBOPENSSL_LIBS" != "x"; then
1348 CXXFLAGS="$LIBOPENSSL_CFLAGS $CXXFLAGS"
1349 SSLLIB="$LIBOPENSSL_PATH $LIBOPENSSL_LIBS $SSLLIB"
1350 AC_DEFINE(USE_OPENSSL,1,[OpenSSL support is available])
1351
1352 # check for other specific broken implementations
1353 SQUID_CHECK_OPENSSL_GETCERTIFICATE_WORKS
1354 SQUID_CHECK_OPENSSL_CONST_SSL_METHOD
1355 SQUID_CHECK_OPENSSL_TXTDB
1356 SQUID_CHECK_OPENSSL_HELLO_OVERWRITE_HACK
1357 fi
1358 if test "x$SSLLIB" = "x"; then
1359 AC_MSG_ERROR([Required OpenSSL library not found])
1360 fi
1361 fi
1362 AC_MSG_NOTICE([OpenSSL library support: ${with_openssl:=no} ${LIBOPENSSL_PATH} ${LIBOPENSSL_LIBS}])
1363 AM_CONDITIONAL(ENABLE_SSL,[ test "x$with_openssl" = "xyes" ])
1364 AC_SUBST(SSLLIB)
1365
1366 dnl User may specify MIT Kerberos is needed from a non-standard location
1367 AC_ARG_WITH(mit-krb5,
1368 AS_HELP_STRING([--without-mit-krb5],
1369 [Compile without MIT Kerberos support.]), [
1370 case "$with_mit_krb5" in
1371 yes|no)
1372 : # Nothing special to do here
1373 ;;
1374 *)
1375 if test ! -d "$withval" ; then
1376 AC_MSG_ERROR([--with-mit-krb5 path does not point to a directory])
1377 fi
1378 if test -d "$with_mit_krb5/lib64" ; then
1379 LIB_KRB5_PATH="-L$with_mit_krb5/lib64 -L$with_mit_krb5/lib"
1380 else
1381 LIB_KRB5_PATH="-L$with_mit_krb5/lib"
1382 fi
1383 CXXFLAGS="-I$with_mit_krb5/include $CXXFLAGS"
1384 krb5confpath="$with_mit_krb5/bin"
1385 with_mit_krb5=yes
1386 esac
1387 ])
1388 AH_TEMPLATE(USE_APPLE_KRB5,[Apple Kerberos support is available])
1389 AH_TEMPLATE(USE_MIT_KRB5,[MIT Kerberos support is available])
1390 AH_TEMPLATE(USE_SOLARIS_KRB5,[Solaris Kerberos support is available])
1391
1392 ## find out if pkg-config or krb5-config will work
1393 if test "x$with_mit_krb5" != "xno"; then
1394 # find installed libs via pkg-config or krb5-config
1395 squid_pc_krb5_name=
1396 PKG_CHECK_EXISTS(mit-krb5-gssapi mit-krb5, [squid_pc_krb5_name="mit-krb5-gssapi mit-krb5"],[
1397 PKG_CHECK_EXISTS(gssapi-krb5 krb5, [squid_pc_krb5_name="gssapi-krb5 krb5"])
1398 ])
1399 if test "x$squid_pc_krb5_name" = "x" -a "$cross_compiling" = "no"; then
1400 # Look for krb5-config (unless cross-compiling)
1401 AC_PATH_PROG(krb5_config,krb5-config,no)
1402 if test "x$ac_cv_path_krb5_config" != "xno" ; then
1403 krb5confpath="`dirname $ac_cv_path_krb5_config`"
1404 ac_heimdal="`$ac_cv_path_krb5_config --version 2>/dev/null | grep -c -i heimdal`"
1405 ac_solaris="`$ac_cv_path_krb5_config --version 2>/dev/null | grep -c -i solaris`"
1406 ac_apple="`$ac_cv_path_krb5_config --vendor 2>/dev/null | grep -c -i apple`"
1407 if test $ac_solaris -gt 0 ; then
1408 with_solaris_krb5=yes
1409 elif test $ac_apple -gt 0 ; then
1410 with_apple_krb5=yes
1411 elif test $ac_heimdal -gt 0; then
1412 with_mit_krb5=no
1413 if test "x$with_mit_krb5" = "xyes"; then
1414 AC_MSG_ERROR([Could not find pkg-config or krb5-config for MIT Kerberos])
1415 fi
1416 fi
1417 else
1418 if test "x$with_mit_krb5" = "xyes"; then
1419 AC_MSG_ERROR([Could not find krb5-config in path])
1420 else
1421 with_mit_krb5=no
1422 fi
1423 fi
1424 fi
1425 fi
1426
1427 # detect MIT Kerberos dependencies (except on Solaris)
1428 if test "x$with_mit_krb5" != "xno" -a "x$with_solaris_krb5" != "xyes"; then
1429 SQUID_STATE_SAVE([squid_krb5_save])
1430 LIBS="$LIBS $LIB_KRB5_PATH"
1431
1432 # auto-detect using pkg-config
1433 PKG_CHECK_MODULES([LIB_KRB5], $squid_pc_krb5_name,,[
1434 # look for krb5-config (unless cross-compiling)
1435 if test "$cross_compiling" = "no"; then
1436 if test "x$krb5confpath" = "x" ; then
1437 AC_PATH_PROG(krb5_config,krb5-config,no)
1438 if test "x$ac_cv_path_krb5_config" != "xno" ; then
1439 ac_krb5_config="$ac_cv_path_krb5_config"
1440 fi
1441 else
1442 ac_krb5_config="$krb5confpath/krb5-config"
1443 fi
1444 fi
1445 if test "x$ac_krb5_config" != "x" && test -x "$ac_krb5_config"; then
1446 # Get libs, etc
1447 AC_MSG_NOTICE([Use krb5-config to get CXXFLAGS and LIBS])
1448 LIB_KRB5_CFLAGS="`$ac_krb5_config --cflags krb5 2>/dev/null`"
1449 LIB_KRB5_LIBS="`$ac_krb5_config --libs krb5 2>/dev/null`"
1450 LIB_KRB5_CFLAGS="`$ac_krb5_config --cflags gssapi 2>/dev/null` $LIB_KRB5_CFLAGS"
1451 LIB_KRB5_LIBS="`$ac_krb5_config --libs gssapi 2>/dev/null` $LIB_KRB5_LIBS"
1452 else
1453 ## For some OS pkg-config is broken or unavailable.
1454 ## Detect libraries the hard way.
1455
1456 SQUID_STATE_SAVE([squid_mit_save])
1457 missing_required=
1458 AC_MSG_NOTICE([Try to find Kerberos libraries in given path])
1459 AC_CHECK_LIB(com_err, [main], [LIB_KRB5_LIBS="-lcom_err $LIB_KRB5_LIBS"],[
1460 AC_MSG_WARN([library 'com_err' is required for MIT Kerberos])
1461 missing_required=yes
1462 ])
1463 LIBS=$LIB_KRB5_LIBS
1464 AC_CHECK_LIB(k5crypto, [main], [LIB_KRB5_LIBS="-lk5crypto $LIB_KRB5_LIBS"],[
1465 AC_MSG_WARN([library 'k5crypto' is required for MIT Kerberos])
1466 missing_required=yes
1467 ])
1468 LIBS=$LIB_KRB5_LIBS
1469 AC_CHECK_LIB(krb5, [main], [LIB_KRB5_LIBS="-lkrb5 $LIB_KRB5_LIBS"],[
1470 AC_MSG_WARN([library 'krb5' is required for MIT Kerberos])
1471 missing_required=yes
1472 ])
1473 LIBS=$LIB_KRB5_LIBS
1474 AC_CHECK_LIB(gssapi_krb5, [main], [LIB_KRB5_LIBS="-lgssapi_krb5 $LIB_KRB5_LIBS"],[
1475 AC_MSG_WARN([library 'gssapi_krb5' is required for MIT Kerberos])
1476 missing_required=yes
1477 ])
1478 SQUID_STATE_ROLLBACK([squid_mit_save])
1479 if test "x$missing_required" = "xyes"; then
1480 LIB_KRB5_LIBS=""
1481 fi
1482 fi
1483 ])
1484
1485 if test "x$LIB_KRB5_LIBS" != "x"; then
1486 if test "x$with_apple_krb5" = "xyes" ; then
1487 AC_DEFINE(USE_APPLE_KRB5,1,[Apple Kerberos support is available])
1488 KRB5_FLAVOUR="Apple"
1489 else
1490 AC_DEFINE(USE_MIT_KRB5,1,[MIT Kerberos support is available])
1491 KRB5_FLAVOUR="MIT"
1492 fi
1493 KRB5LIBS="$LIB_KRB5_PATH $LIB_KRB5_LIBS $KRB5LIBS"
1494 KRB5INCS="$LIB_KRB5_CFLAGS"
1495
1496 # check for other specific broken implementations
1497 CXXFLAGS="$CXXFLAGS $KRB5INCS"
1498 LIBS="$LIBS $KRB5LIBS"
1499
1500 AC_MSG_NOTICE([Try to find Kerberos headers in given path])
1501 AC_CHECK_HEADERS(gssapi.h gssapi/gssapi.h gssapi/gssapi_krb5.h)
1502 AC_CHECK_HEADERS(gssapi/gssapi_generic.h)
1503 AC_CHECK_HEADERS(krb5.h com_err.h et/com_err.h)
1504 AC_CHECK_HEADERS(profile.h)
1505
1506 SQUID_CHECK_KRB5_FUNCS
1507 fi
1508 if test "x$with_mit_krb5" = "xyes" -a "x$KRB5LIBS" = "x"; then
1509 AC_MSG_ERROR([Required Kerberos library not found])
1510 elif test "x$KRB5LIBS" = "x"; then
1511 with_mit_krb5=no
1512 with_apple_krb5=no
1513 fi
1514 SQUID_STATE_ROLLBACK([squid_krb5_save])
1515 fi
1516
1517 # detect Solaris Kerberos dependencies
1518 if test "x$with_solaris_krb5" = "xyes" -a "x$KRB5LIBS" = "x"; then
1519 SQUID_STATE_SAVE([squid_krb5_save])
1520 LIBS="$LIBS $LIB_KRB5_PATH"
1521
1522 # no pkg-config for solaris native Kerberos
1523 # look for krb5-config (unless cross-compiling)
1524 if test "$cross_compiling" = "no"; then
1525 if test "x$krb5confpath" = "x" ; then
1526 AC_PATH_PROG(krb5_config,krb5-config,no)
1527 if test "x$ac_cv_path_krb5_config" != "xno" ; then
1528 ac_krb5_config="$ac_cv_path_krb5_config"
1529 fi
1530 else
1531 ac_krb5_config="$krb5confpath/krb5-config"
1532 fi
1533 fi
1534 if test "x$ac_krb5_config" != "x" && test -x "$ac_krb5_config"; then
1535 # Get libs, etc
1536 AC_MSG_NOTICE([Use krb5-config to get CXXFLAGS and LIBS])
1537 LIB_KRB5_CFLAGS="`$ac_krb5_config --cflags krb5 2>/dev/null`"
1538 LIB_KRB5_LIBS="`$ac_krb5_config --libs krb5 2>/dev/null`"
1539 # Solaris 10 Update 11 patches the krb5-config tool to produce stderr messages on stdout.
1540 SOLARIS_BROKEN_KRB5CONFIG_GSSAPI="`$ac_krb5_config --libs gssapi 2>/dev/null | grep "krb5-config"`"
1541 if test "x$SOLARIS_BROKEN_KRB5CONFIG_GSSAPI" = "x"; then
1542 LIB_KRB5_CFLAGS="`$ac_krb5_config --cflags gssapi 2>/dev/null` $LIB_KRB5_CFLAGS"
1543 LIB_KRB5_LIBS="`$ac_krb5_config --libs gssapi 2>/dev/null` $LIB_KRB5_LIBS"
1544 fi
1545 else
1546 ## For some OS pkg-config is broken or unavailable.
1547 ## Detect libraries the hard way.
1548
1549 CXXFLAGS="-I/usr/include/kerberosv5 $CXXFLAGS"
1550
1551 SQUID_STATE_SAVE([squid_solaris_save])
1552 missing_required=
1553 AC_MSG_NOTICE([Try to find Kerberos libraries in given path])
1554 AC_CHECK_LIB(krb5, [main], [LIB_KRB5_LIBS="-lkrb5 $LIB_KRB5_LIBS"],[
1555 AC_MSG_WARN([library 'krb5' is required for Solaris Kerberos])
1556 missing_required=yes
1557 ])
1558 LIBS=$LIB_KRB5_LIBS
1559 AC_CHECK_LIB(gss, [main], [LIB_KRB5_LIBS="-lgss $LIB_KRB5_LIBS"],[
1560 AC_MSG_WARN([library 'gss' is required for Solaris Kerberos])
1561 missing_required=yes
1562 ])
1563 SQUID_STATE_ROLLBACK([squid_solaris_save])
1564 if test "x$missing_required" = "xyes"; then
1565 LIB_KRB5_LIBS=""
1566 fi
1567 fi
1568
1569 if test "x$LIB_KRB5_LIBS" != "x"; then
1570 KRB5LIBS="$LIB_KRB5_PATH $LIB_KRB5_LIBS $KRB5LIBS"
1571 KRB5INCS="$LIB_KRB5_CFLAGS"
1572 AC_DEFINE(USE_SOLARIS_KRB5,1,[Solaris Kerberos support is available])
1573 KRB5_FLAVOUR="Solaris"
1574
1575 # check for other specific broken implementations
1576 CXXFLAGS="$CXXFLAGS $KRB5INCS"
1577 LIBS="$LIBS $KRB5LIBS"
1578
1579 AC_MSG_NOTICE([Try to find Kerberos headers in given path])
1580 AC_CHECK_HEADERS(gssapi/gssapi.h gssapi/gssapi_ext.h)
1581 AC_CHECK_HEADERS(krb5.h com_err.h)
1582
1583 SQUID_CHECK_KRB5_SOLARIS_BROKEN_KRB5_H
1584 if test "x$squid_cv_broken_krb5_h" = "xyes"; then
1585 AC_DEFINE(HAVE_BROKEN_SOLARIS_KRB5_H, 1, [Define to 1 if Solaris krb5.h is broken for C++])
1586 AC_MSG_WARN([You have a broken Solaris <krb5.h> system include.])
1587 AC_MSG_WARN([Please see http://bugs.opensolaris.org/bugdatabase/view_bug.do?bug_id=6837512])
1588 AC_MSG_WARN([If you need Kerberos support you will have to patch])
1589 AC_MSG_WARN([your system. See contrib/solaris/solaris-krb5-include.patch])
1590 fi
1591 SQUID_CHECK_KRB5_FUNCS
1592 fi
1593 if test "x$with_mit_krb5" = "xyes" -a "x$KRB5LIBS" = "x"; then
1594 # Error only if Solaris flavour was detected while looking for required MIT Kerberos
1595 AC_MSG_ERROR([Required Kerberos library not found])
1596 elif test "x$KRB5LIBS" = "x"; then
1597 with_solaris_krb5=no
1598 with_mit_krb5=no
1599 fi
1600 SQUID_STATE_ROLLBACK([squid_krb5_save])
1601 fi
1602
1603 dnl User may specify Heimdal Kerberos is needed from a non-standard location
1604 AC_ARG_WITH(heimdal-krb5,
1605 AS_HELP_STRING([--without-heimdal-krb5],
1606 [Compile without Heimdal Kerberos support.]), [
1607 case "$with_heimdal_krb5" in
1608 yes|no)
1609 : # Nothing special to do here
1610 ;;
1611 *)
1612 if test ! -d "$withval" ; then
1613 AC_MSG_ERROR([--with-heimdal-krb5 path does not point to a directory])
1614 fi
1615 if test -d "$with_heimdal_krb5/lib64" ; then
1616 LIB_KRB5_PATH="-L$with_heimdal_krb5/lib64 -L$with_heimdal_krb5/lib"
1617 else
1618 LIB_KRB5_PATH="-L$with_heimdal_krb5/lib"
1619 fi
1620 CXXFLAGS="-I$with_heimdal_krb5/include $CXXFLAGS"
1621 krb5confpath="$with_heimdal_krb5/bin"
1622 with_heimdal_krb5=yes
1623 esac
1624 ])
1625 AH_TEMPLATE(USE_HEIMDAL_KRB5,[Heimdal Kerberos support is available])
1626 if test "x$with_heimdal_krb5" != "xno" -a "x$KRB5LIBS" = "x"; then
1627 # find installed libs via pkg-config or krb5-config
1628 PKG_CHECK_EXISTS(heimdal-krb5, [squid_pc_krb5_name="heimdal-krb5"])
1629 if test "x$squid_pc_krb5_name" = "x"; then
1630 PKG_CHECK_EXISTS(heimdal-gssapi, [squid_pc_krb5_name="heimdal-gssapi"])
1631 fi
1632 if test "x$squid_pc_krb5_name" = "x" -a "$cross_compiling" = "no"; then
1633 # Look for krb5-config (unless cross-compiling)
1634 AC_PATH_PROG(krb5_config,krb5-config,no)
1635 if test "x$ac_cv_path_krb5_config" != "xno" ; then
1636 krb5confpath="`dirname $ac_cv_path_krb5_config`"
1637 ac_heimdal="`$ac_cv_path_krb5_config --version 2>/dev/null | grep -c -i heimdal`"
1638 if test "x$with_heimdal_krb5" = "xyes" -a $ac_heimdal = 0; then
1639 AC_MSG_ERROR([Could not find pkg-config or krb5-config for Heimdal Kerberos])
1640 fi
1641 else
1642 if test "x$with_heimdal_krb5" = "xyes"; then
1643 AC_MSG_ERROR([Could not find krb5-config in path])
1644 else
1645 AC_MSG_WARN([Could not find krb5-config in path])
1646 with_heimdal_krb5=no
1647 fi
1648 fi
1649 fi
1650 fi
1651 if test "x$with_heimdal_krb5" != "xno" -a "x$KRB5LIBS" = "x"; then
1652 SQUID_STATE_SAVE([squid_krb5_save])
1653 LIBS="$LIBS $LIB_KRB5_PATH"
1654
1655 # auto-detect using pkg-config
1656 PKG_CHECK_MODULES([LIB_KRB5], $squid_pc_krb5_name,,[
1657 # look for krb5-config (unless cross-compiling)
1658 if test "$cross_compiling" = "no"; then
1659 if test "x$krb5confpath" = "x" ; then
1660 AC_PATH_PROG(krb5_config,krb5-config,no)
1661 if test "x$ac_cv_path_krb5_config" != "xno" ; then
1662 ac_krb5_config="$ac_cv_path_krb5_config"
1663 fi
1664 else
1665 ac_krb5_config="$krb5confpath/krb5-config"
1666 fi
1667 fi
1668 if test "x$ac_krb5_config" != "x" -a -x "$ac_krb5_config"; then
1669 # Get libs, etc
1670 AC_MSG_NOTICE([Use krb5-config to get CXXFLAGS and LIBS])
1671 LIB_KRB5_CFLAGS="`$ac_krb5_config --cflags krb5 2>/dev/null`"
1672 LIB_KRB5_LIBS="`$ac_krb5_config --libs krb5 2>/dev/null`"
1673 LIB_KRB5_CFLAGS="`$ac_krb5_config --cflags gssapi 2>/dev/null` $LIB_KRB5_CFLAGS"
1674 LIB_KRB5_LIBS="`$ac_krb5_config --libs gssapi 2>/dev/null` $LIB_KRB5_LIBS"
1675 else
1676 ## For some OS pkg-config is broken or unavailable.
1677 ## Detect libraries the hard way.
1678 SQUID_STATE_SAVE([squid_heimdal_save])
1679 missing_required=
1680 AC_MSG_NOTICE([Try to find Kerberos libraries in given path])
1681 AC_CHECK_LIB(resolv, [main], [LIB_KRB5_LIBS="-lresolv $LIB_KRB5_LIBS"],[
1682 AC_MSG_WARN([library 'resolv' is required for Heimdal Kerberos])
1683 missing_required=yes
1684 ])
1685 LIBS=$LIB_KRB5_LIBS
1686 AC_CHECK_LIB(crypt, [main], [LIB_KRB5_LIBS="-lcrypt $LIB_KRB5_LIBS"],[
1687 AC_MSG_WARN([library 'crypt' is required for Heimdal Kerberos])
1688 missing_required=yes
1689 ])
1690 LIBS=$LIB_KRB5_LIBS
1691 AC_CHECK_LIB(roken, [main], [LIB_KRB5_LIBS="-lroken $LIB_KRB5_LIBS"],[
1692 AC_MSG_WARN([library 'roken' is required for Heimdal Kerberos])
1693 missing_required=yes
1694 ])
1695 LIBS=$LIB_KRB5_LIBS
1696 AC_CHECK_LIB(heimbase, [main], [LIB_KRB5_LIBS="-lheimbase $LIB_KRB5_LIBS"],[
1697 AC_MSG_WARN([library 'heimbase' may be required for Heimdal Kerberos])
1698 ])
1699 LIBS=$LIB_KRB5_LIBS
1700 AC_CHECK_LIB(wind, [main], [LIB_KRB5_LIBS="-lwind $LIB_KRB5_LIBS"],[
1701 AC_MSG_WARN([library 'wind' may be required for Heimdal Kerberos])
1702 ])
1703 LIBS=$LIB_KRB5_LIBS
1704 AC_CHECK_LIB(crypto, [main], [LIB_KRB5_LIBS="-lcrypto $LIB_KRB5_LIBS"],[
1705 AC_MSG_WARN([library 'crypto' is required for Heimdal Kerberos])
1706 missing_required=yes
1707 ])
1708 LIBS=$LIB_KRB5_LIBS
1709 AC_CHECK_LIB(com_err, [main], [LIB_KRB5_LIBS="-lcom_err $LIB_KRB5_LIBS"],[
1710 AC_MSG_WARN([library 'com_err' is required for Heimdal Kerberos])
1711 missing_required=yes
1712 ])
1713 LIBS=$LIB_KRB5_LIBS
1714 AC_CHECK_LIB(hx509, [main], [LIB_KRB5_LIBS="-lhx509 $LIB_KRB5_LIBS"],[
1715 AC_MSG_WARN([library 'hx509' may be required for Heimdal Kerberos])
1716 ])
1717 LIBS=$LIB_KRB5_LIBS
1718 AC_CHECK_LIB(asn1, [main], [LIB_KRB5_LIBS="-lasn1 $LIB_KRB5_LIBS"],[
1719 AC_MSG_WARN([library 'asn1' is required for Heimdal Kerberos])
1720 missing_required=yes
1721 ])
1722 LIBS=$LIB_KRB5_LIBS
1723 AC_CHECK_LIB(krb5, [main], [LIB_KRB5_LIBS="-lkrb5 $LIB_KRB5_LIBS"],[
1724 AC_MSG_WARN([library 'krb5' is required for Heimdal Kerberos])
1725 missing_required=yes
1726 ])
1727 LIBS=$LIB_KRB5_LIBS
1728 AC_CHECK_LIB(heimntlm, [main], [LIB_KRB5_LIBS="-lheimntlm $LIB_KRB5_LIBS"],[
1729 AC_MSG_WARN([library 'heimntlm' may be required for Heimdal Kerberos])
1730 ])
1731 LIBS=$LIB_KRB5_LIBS
1732 AC_CHECK_LIB(gssapi, [main], [LIB_KRB5_LIBS="-lgssapi $LIB_KRB5_LIBS"],[
1733 AC_MSG_WARN([library 'gssapi' is required for Heimdal Kerberos])
1734 missing_required=yes
1735 ])
1736 SQUID_STATE_ROLLBACK([squid_heimdal_save])
1737 if test "x$missing_required" = "xyes"; then
1738 LIB_KRB5_LIBS=""
1739 fi
1740 fi
1741 ])
1742 if test "x$LIB_KRB5_LIBS" != "x"; then
1743 KRB5LIBS="$LIB_KRB5_PATH $LIB_KRB5_LIBS $KRB5LIBS"
1744 KRB5INCS="$LIB_KRB5_CFLAGS"
1745 AC_DEFINE(USE_HEIMDAL_KRB5,1,[Heimdal Kerberos support is available])
1746 KRB5_FLAVOUR="Heimdal"
1747
1748 # check for other specific broken implementations
1749 CXXFLAGS="$CXXFLAGS $KRB5INCS"
1750 LIBS="$LIBS $KRB5LIBS"
1751
1752 AC_MSG_NOTICE([Try to find Kerberos headers in given path])
1753 AC_CHECK_HEADERS(gssapi.h gssapi/gssapi.h gssapi/gssapi_krb5.h)
1754 AC_CHECK_HEADERS(krb5.h com_err.h et/com_err.h)
1755
1756 SQUID_CHECK_KRB5_HEIMDAL_BROKEN_KRB5_H
1757 if test "x$squid_cv_broken_heimdal_krb5_h" = "xyes"; then
1758 AC_DEFINE(HAVE_BROKEN_HEIMDAL_KRB5_H, 1, [Define to 1 if Heimdal krb5.h is broken for C++])
1759 fi
1760 SQUID_CHECK_KRB5_FUNCS
1761 fi
1762 if test "x$KRB5LIBS" = "x"; then
1763 if test test "x$with_heimdal_krb5" = "xyes"; then
1764 AC_MSG_ERROR([Required Heimdal Kerberos library not found])
1765 else
1766 AC_MSG_WARN([Heimdal Kerberos library not found])
1767 fi
1768 fi
1769 SQUID_STATE_ROLLBACK([squid_krb5_save])
1770 fi
1771
1772 dnl User may specify GNU gss is needed from a non-standard location
1773 AC_ARG_WITH(gnugss,
1774 AS_HELP_STRING([--without-gnugss],
1775 [Compile without the GNU gss libraries.]), [
1776 case "$with_gnugss" in
1777 yes|no)
1778 : # Nothing special to do here
1779 ;;
1780 *)
1781 if test ! -d "$withval" ; then
1782 AC_MSG_ERROR([--with-gnugss path does not point to a directory])
1783 fi
1784 if test ! -d "$with_gnugss/lib64" ; then
1785 LIB_KRB5_PATH="-L$with_gnugss/lib64 -L$with_gnugss/lib"
1786 else
1787 LIB_KRB5_PATH="-L$with_gnugss/lib"
1788 fi
1789 CXXFLAGS="-I$with_gnugss/include $CXXFLAGS"
1790 krb5confpath=
1791 with_gnugss=yes
1792 esac
1793 ])
1794 AH_TEMPLATE(USE_GNUGSS,[GNU gss support is available])
1795 if test "x$with_gnugss" != "xno" -a "x$KRB5LIBS" = "x"; then
1796 SQUID_STATE_SAVE([squid_krb5_save])
1797 LIBS="$LIBS $LIB_KRB5_PATH"
1798
1799 # auto-detect using pkg-config
1800 PKG_CHECK_MODULES([LIB_KRB5],[gss],,[
1801 ## For some OS pkg-config is broken or unavailable.
1802 ## Detect libraries the hard way.
1803
1804 AC_MSG_NOTICE([Try to find Kerberos libraries in given path])
1805 AC_CHECK_LIB(gss, [main], [LIB_KRB5_LIBS="-lgss $LIB_KRB5_LIBS"],[
1806 AC_MSG_WARN([library 'com_err' is required for GNU Kerberos])
1807 ])
1808 ])
1809
1810 if test "x$LIB_KRB5_LIBS" != "x"; then
1811 KRB5LIBS="$LIB_KRB5_PATH $LIB_KRB5_LIBS $KRB5LIBS"
1812 KRB5INCS="$LIB_KRB5_CFLAGS"
1813 AC_DEFINE(USE_GNUGSS,1,[GNU Kerberos support is available])
1814 KRB5_FLAVOUR="GNU GSS"
1815
1816 # check for other specific broken implementations
1817 CXXFLAGS="$CXXFLAGS $KRB5INCS"
1818 LIBS="$LIBS $KRB5LIBS"
1819
1820 AC_MSG_NOTICE([Try to find Kerbeors headers in given path])
1821 AC_CHECK_HEADERS(gss.h)
1822
1823 SQUID_CHECK_WORKING_GSSAPI
1824 SQUID_DEFINE_BOOL(HAVE_GSSAPI,$squid_cv_working_gssapi,[GSSAPI support])
1825
1826 SQUID_CHECK_SPNEGO_SUPPORT
1827 SQUID_DEFINE_BOOL(HAVE_SPNEGO,$squid_cv_have_spnego,[SPNEGO support])
1828
1829 SQUID_CHECK_WORKING_KRB5
1830 SQUID_DEFINE_BOOL(HAVE_KRB5,$squid_cv_working_krb5,[KRB5 support])
1831 fi
1832 if test "x$KRB5LIBS" = "x"; then
1833 if test test "x$with_gnugss" = "xyes"; then
1834 AC_MSG_ERROR([Required GNU GSS Kerberos library not found])
1835 else
1836 AC_MSG_WARN([GNU GSS Kerberos library not found])
1837 fi
1838 fi
1839 SQUID_STATE_ROLLBACK([squid_krb5_save])
1840 fi
1841
1842 if test "x$KRB5LIBS" != "x"; then
1843 with_krb5=yes
1844 fi
1845 AC_MSG_NOTICE([$KRB5_FLAVOUR Kerberos library support: ${with_krb5:=no} ${LIB_KRB5_PATH} ${LIB_KRB5_LIBS}])
1846 AC_SUBST(KRB5INCS)
1847 AC_SUBST(KRB5LIBS)
1848
1849 dnl On MinGW OpenLDAP is not available, so LDAP helpers can be linked
1850 dnl only with Windows LDAP libraries using -lwldap32
1851 case "$squid_host_os" in
1852 mingw)
1853 LDAPLIB="-lwldap32"
1854 LBERLIB=""
1855 ;;
1856 *)
1857 AC_CHECK_LIB(ldap, ldap_init, [LDAPLIB="-lldap"])
1858 dnl LDAP helpers need to know if -llber is needed or not
1859 AC_CHECK_LIB(lber, ber_init, [LBERLIB="-llber"])
1860 dnl if no ldap lib found check for mozilla version
1861 if test "x$ac_cv_lib_ldap_ldap_init" != x""yes; then
1862 oLIBS=$LIBS
1863 LIBS="$LIBPTHREADS"
1864 AC_CHECK_LIB(ldap60, ldap_init, [LDAPLIB="-lldap60"])
1865 LIBS="$LDAPLIB $LIBPTHREADS"
1866 AC_CHECK_LIB(prldap60, prldap_init, [LDAPLIB="-lprldap60 $LDAPLIB"])
1867 LIBS="$LDAPLIB $LIBPTHREADS"
1868 AC_CHECK_LIB(ssldap60, ldapssl_init, [LDAPLIB="-lssldap60 $LDAPLIB"])
1869 LIBS=$oLIBS
1870 fi
1871
1872 AC_CHECK_HEADERS(ldap.h lber.h)
1873 AC_CHECK_HEADERS(mozldap/ldap.h)
1874
1875 dnl
1876 dnl Check for LDAP_OPT_DEBUG_LEVEL
1877 dnl
1878 AC_MSG_CHECKING([for LDAP_OPT_DEBUG_LEVEL])
1879 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1880 # include <ldap.h>
1881 ]],[[
1882 int i=LDAP_OPT_DEBUG_LEVEL
1883 ]])],
1884 [ AC_MSG_RESULT(yes) ],
1885 [ AC_MSG_RESULT(no) ])
1886
1887 dnl
1888 dnl Check for working ldap
1889 dnl
1890 oLIBS=$LIBS
1891 LIBS="$LDAPLIB $LBERLIB $LIBPTHREADS"
1892 AC_MSG_CHECKING([for working ldap])
1893 AC_RUN_IFELSE([AC_LANG_SOURCE([[
1894 # define LDAP_DEPRECATED 1
1895 # if HAVE_LDAP_H
1896 # include <ldap.h>
1897 # elif HAVE_MOZLDAP_LDAP_H
1898 # include <mozldap/ldap.h>
1899 # endif
1900 int
1901 main(void)
1902 {
1903 char host[]="";
1904 int port;
1905
1906 ldap_init((const char *)&host, port);
1907
1908 return 0;
1909 }
1910 ]])],
1911 [ AC_DEFINE(HAVE_LDAP, 1, [LDAP support])
1912 AC_MSG_RESULT(yes) ],
1913 [ AC_MSG_RESULT(no) ],
1914 [ AC_MSG_RESULT(cross-compiler cant tell) ])
1915 LIBS=$oLIBS
1916
1917 dnl
1918 dnl Check for ldap vendor
1919 dnl
1920 AC_MSG_CHECKING([for OpenLDAP])
1921 AC_RUN_IFELSE([AC_LANG_SOURCE([[
1922 # if HAVE_LDAP_H
1923 # include <ldap.h>
1924 # endif
1925 # include <string.h>
1926 int
1927 main(void)
1928 {
1929 return strcmp(LDAP_VENDOR_NAME,"OpenLDAP");
1930 }
1931 ]])],
1932 [ AC_DEFINE(HAVE_OPENLDAP, 1, [OpenLDAP support])
1933 AC_MSG_RESULT(yes) ],
1934 [ AC_MSG_RESULT(no) ],
1935 [ AC_MSG_RESULT(cross-compiler cant tell) ])
1936
1937 AC_MSG_CHECKING([for Sun LDAP SDK])
1938 AC_RUN_IFELSE([AC_LANG_SOURCE([[
1939 # if HAVE_LDAP_H
1940 # include <ldap.h>
1941 # endif
1942 # include <string.h>
1943 int
1944 main(void)
1945 {
1946 return strcmp(LDAP_VENDOR_NAME,"Sun Microsystems Inc.");
1947 }
1948 ]])],
1949 [ AC_DEFINE(HAVE_SUN_LDAP_SDK, 1, [Sun LDAP SDK support])
1950 AC_MSG_RESULT(yes) ],
1951 [ AC_MSG_RESULT(no) ],
1952 [ AC_MSG_RESULT(cross-compiler cant tell) ])
1953
1954 AC_MSG_CHECKING([for Mozilla LDAP SDK])
1955 AC_RUN_IFELSE([AC_LANG_SOURCE([[
1956 # if HAVE_LDAP_H
1957 # include <ldap.h>
1958 # elif HAVE_MOZLDAP_LDAP_H
1959 # include <mozldap/ldap.h>
1960 # endif
1961 # include <string.h>
1962 int
1963 main(void)
1964 {
1965 return strcmp(LDAP_VENDOR_NAME,"mozilla.org");
1966 }
1967 ]])],
1968 [ AC_DEFINE(HAVE_MOZILLA_LDAP_SDK, 1, [Mozilla LDAP SDK support])
1969 AC_MSG_RESULT(yes) ],
1970 [ AC_MSG_RESULT(no)],
1971 [ AC_MSG_RESULT(cross-compiler cant tell) ])
1972
1973 dnl
1974 dnl Check for LDAP_REBINDPROC_CALLBACK
1975 dnl
1976 AC_MSG_CHECKING([for LDAP_REBINDPROC_CALLBACK])
1977 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1978 # if HAVE_LDAP_H
1979 # include <ldap.h>
1980 # elif HAVE_MOZLDAP_LDAP_H
1981 # include <mozldap/ldap.h>
1982 # endif
1983 ]],[[
1984 LDAP_REBINDPROC_CALLBACK ldap_rebind;
1985 ]])],
1986 [ AC_DEFINE(HAVE_LDAP_REBINDPROC_CALLBACK,1,[Define to 1 if you have LDAP_REBINDPROC_CALLBACK])
1987 AC_MSG_RESULT(yes) ],
1988 [ AC_MSG_RESULT(no) ])
1989
1990 dnl
1991 dnl Check for LDAP_REBIND_PROC
1992 dnl
1993 AC_MSG_CHECKING([for LDAP_REBIND_PROC])
1994 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1995 # if HAVE_LDAP_H
1996 # include <ldap.h>
1997 # elif HAVE_MOZLDAP_LDAP_H
1998 # include <mozldap/ldap.h>
1999 # endif
2000 ]],[[
2001 LDAP_REBIND_PROC ldap_rebind;
2002 ]])],
2003 [ AC_DEFINE(HAVE_LDAP_REBIND_PROC,1,[Define to 1 if you have LDAP_REBIND_PROC])
2004 AC_MSG_RESULT(yes) ],
2005 [ AC_MSG_RESULT(no) ])
2006
2007 dnl
2008 dnl Check for LDAP_REBIND_FUNCTION
2009 dnl
2010 AC_MSG_CHECKING([for LDAP_REBIND_FUNCTION])
2011 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
2012 # define LDAP_REFERRALS
2013 # if HAVE_LDAP_H
2014 # include <ldap.h>
2015 # elif HAVE_MOZLDAP_LDAP_H
2016 # include <mozldap/ldap.h>
2017 # endif
2018 ]],[[
2019 LDAP_REBIND_FUNCTION ldap_rebind;
2020 ]])],
2021 [ AC_DEFINE(HAVE_LDAP_REBIND_FUNCTION,1,[Define to 1 if you have LDAP_REBIND_FUNCTION])
2022 AC_MSG_RESULT(yes) ],
2023 [ AC_MSG_RESULT(no) ])
2024
2025 dnl
2026 dnl Check for LDAP_SCOPE_DEFAULT
2027 dnl
2028 AC_MSG_CHECKING([for LDAP_SCOPE_DEFAULT])
2029 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
2030 # if HAVE_LDAP_H
2031 # include <ldap.h>
2032 # elif HAVE_MOZLDAP_LDAP_H
2033 # include <mozldap/ldap.h>
2034 # endif
2035 ]],[[
2036 int i=LDAP_SCOPE_DEFAULT;
2037 ]])],
2038 [ AC_DEFINE(HAVE_LDAP_SCOPE_DEFAULT,1,[Define to 1 if you have LDAP_SCOPE_DEFAULT])
2039 AC_MSG_RESULT(yes) ],
2040 [ AC_MSG_RESULT(no) ])
2041
2042 dnl
2043 dnl Check for ldap_url_desc.lud_scheme
2044 dnl
2045 AC_CHECK_MEMBER(struct ldap_url_desc.lud_scheme,
2046 AC_DEFINE(HAVE_LDAP_URL_LUD_SCHEME,1,
2047 [Define to 1 if you have LDAPURLDesc.lud_scheme]),,[#include <ldap.h>])
2048
2049 dnl
2050 dnl Check for ldapssl_client_init
2051 dnl
2052 AC_CHECK_LIB(ldap,ldapssl_client_init,
2053 AC_DEFINE(HAVE_LDAPSSL_CLIENT_INIT,1,[Define to 1 if you have ldapssl_client_init]),)
2054
2055 dnl
2056 dnl Check for ldap_url_desc2str
2057 dnl
2058 AC_CHECK_LIB(ldap,ldap_url_desc2str,
2059 AC_DEFINE(HAVE_LDAP_URL_DESC2STR,1,[Define to 1 if you have ldap_url_desc2str]),)
2060
2061 dnl
2062 dnl Check for ldap_url_parse
2063 dnl
2064 AC_CHECK_LIB(ldap,ldap_url_parse,
2065 AC_DEFINE(HAVE_LDAP_URL_PARSE,1,[Define to 1 if you have ldap_url_parse]),)
2066
2067 dnl
2068 dnl Check for ldap_start_tls_s
2069 dnl
2070 AC_CHECK_LIB(ldap,ldap_start_tls_s,
2071 AC_DEFINE(HAVE_LDAP_START_TLS_S,1,[Define to 1 if you have ldap_start_tls_s]),)
2072 ;;
2073 esac
2074
2075 AC_SUBST(LDAPLIB)
2076 AC_SUBST(LBERLIB)
2077
2078 AC_ARG_ENABLE(forw-via-db,
2079 AS_HELP_STRING([--enable-forw-via-db],[Enable Forw/Via database]), [
2080 SQUID_YESNO([$enableval],[unrecognized argument to --enable-forw-via-db: $enableval])
2081 ])
2082 SQUID_DEFINE_BOOL(USE_FORW_VIA_DB,${enable_forw_via_db:=no},
2083 [Enable Forw/Via database])
2084 AC_MSG_NOTICE([Forw/Via database enabled: $enable_forw_via_db])
2085
2086 AC_ARG_ENABLE(cache-digests,
2087 AS_HELP_STRING([--enable-cache-digests],
2088 [Use Cache Digests. See http://wiki.squid-cache.org/SquidFaq/CacheDigests]),
2089 [
2090 SQUID_YESNO($enableval,
2091 [unrecognized argument to --enable-cache-digests: $enableval])
2092 ])
2093 SQUID_DEFINE_BOOL(USE_CACHE_DIGESTS,${enable_cache_digests:=no},
2094 [Use Cache Digests for locating objects in neighbor caches.])
2095 AC_MSG_NOTICE([Cache Digests enabled: $enable_cache_digests])
2096
2097
2098 ################################
2099 # check for netio plugin stuff #
2100 ################################
2101 dnl order of these options handling is relevant in case the user
2102 dnl supplies more than one --enable option. Options handled later
2103 dnl override those handled earlier for io loop method manual override
2104 AC_ARG_ENABLE(select,
2105 AS_HELP_STRING([--disable-select],[Disable select(2) support.]),
2106 [
2107 SQUID_YESNO($enableval,[--disable-select takes no extra argument])
2108 if test "x$enableval" = "xyes"; then
2109 if test "x$squid_host_os" = "xmingw"; then
2110 squid_opt_io_loop_engine="select_win32"
2111 else
2112 squid_opt_io_loop_engine="select"
2113 fi
2114 fi
2115 ])
2116 AC_MSG_NOTICE([enabling select syscall for net I/O: ${enable_select:=auto}])
2117
2118 AC_ARG_ENABLE(poll,
2119 AS_HELP_STRING([--disable-poll],[Disable poll(2) support.]),
2120 [
2121 SQUID_YESNO($enableval,[--disable-poll takes no extra argument])
2122 test "x$enableval" = "xyes" && squid_opt_io_loop_engine="poll"
2123 ])
2124 AC_MSG_NOTICE([enabling poll syscall for net I/O: ${enable_poll:=auto}])
2125
2126 AC_ARG_ENABLE(kqueue,
2127 AS_HELP_STRING([--disable-kqueue],
2128 [Disable kqueue(2) support.]), [
2129 SQUID_YESNO($enableval,[--enable-kqueue takes no extra argument])
2130 ])
2131 if test "x${enable_kqueue:=auto}" != "xno" ; then
2132 AC_CHECK_HEADERS([sys/event.h],[],[
2133 if test "x${enable_kqueue}" = "xyes" ; then
2134 AC_MSG_ERROR([kqueue support requires sys/event.h header file.])
2135 fi
2136 ])
2137 AC_CHECK_FUNCS(kqueue,[],[
2138 if test "x${enable_kqueue}" = "xyes" ; then
2139 AC_MSG_ERROR([kqueue support missing in libc library.])
2140 fi
2141 ])
2142 if test "x$ac_cv_func_kqueue" = "xyes" -a "x$ac_cv_header_sys_event_h" = "xyes" ; then
2143 squid_opt_io_loop_engine="kqueue"
2144 else
2145 enable_kqueue="no"
2146 fi
2147 fi
2148 AC_MSG_NOTICE([enabling kqueue for net I/O: ${enable_kqueue:=auto}])
2149
2150 dnl Enable epoll()
2151 AC_ARG_ENABLE(epoll,
2152 AS_HELP_STRING([--disable-epoll],[Disable Linux epoll(2) support.]),
2153 [
2154 SQUID_YESNO($enableval,[--disable-epoll takes no extra argument])
2155 test "x$enableval" = "xyes" && squid_opt_io_loop_engine="epoll"
2156 ])
2157 AC_MSG_NOTICE([enabling epoll syscall for net I/O: ${enable_epoll:=auto}])
2158
2159 # auto-detect and verify epoll header and library present and working
2160 # logic mapping and loop method selection are performed later
2161 if test "x$enable_epoll" != "xno" ; then
2162
2163 # check if libs are needed to support epoll
2164 # note: this code block seems quite generic. Could it be extracted
2165 # into a squid specific configure function?
2166 SQUID_STATE_SAVE(squid_epoll_state)
2167 AC_SEARCH_LIBS(epoll_ctl,[epoll])
2168 if test "x$ac_cv_search_epoll_ctl" = "xno" ; then
2169 enable_epoll=no #disable. Needed code not found
2170 elif test "x$ac_cv_search_epoll_ctl" = "xnone required" ; then
2171 EPOLL_LIBS=""
2172 else
2173 EPOLL_LIBS=$ac_cv_search_epoll_ctl
2174 fi
2175 AC_SUBST(EPOLL_LIBS)
2176 SQUID_STATE_ROLLBACK(squid_epoll_state) #de-pollute LIBS
2177
2178 # epoll requires sys/epoll.h
2179 AC_CHECK_HEADERS([sys/epoll.h])
2180
2181 dnl Verify that epoll really works
2182 if test "x$ac_cv_search_epoll_ctl" != 'xno' ; then
2183 SQUID_CHECK_EPOLL
2184 fi
2185
2186 if test "x$enable_epoll" = "xyes" -a "x$squid_cv_epoll_works" = "xno" ; then
2187 AC_MSG_ERROR([Epoll does not work. Force-enabling it is not going to help.])
2188 fi
2189 fi
2190
2191 dnl Enable /dev/poll
2192 AC_ARG_ENABLE(devpoll,
2193 AS_HELP_STRING([--disable-devpoll],[Disable Solaris /dev/poll support.]),
2194 [
2195 SQUID_YESNO($enableval,[--disable-devpoll takes no extra argument])
2196 test "x$enableval" = "xyes" && squid_opt_io_loop_engine="devpoll"
2197 ])
2198 AC_MSG_NOTICE([enabling /dev/poll for net I/O: ${enable_devpoll:=auto}])
2199
2200 ## auto-detect and verify devpoll header and library present and working
2201 if test "x$enable_devpoll" != "xno"; then
2202
2203 # /dev/poll requires ioctl() and write()
2204 AC_CHECK_FUNCS(ioctl)
2205 AC_CHECK_FUNCS(write)
2206
2207 # /dev/poll requires sys/devpoll.h
2208 AC_CHECK_HEADERS([sys/devpoll.h],,[
2209 if test "x$enable_devpoll" = "xyes"; then
2210 AC_MSG_ERROR([--enable-devpoll specified but /dev/poll headers not found])
2211 fi
2212 enable_devpoll=no])
2213
2214 # Verify that /dev/poll really works
2215 if test "x$enable_devpoll" != 'xno' ; then
2216 SQUID_CHECK_DEVPOLL
2217 fi
2218
2219 if test "x$enable_devpoll" = "xyes" -a "x$squid_cv_devpoll_works" = "xno" ; then
2220 AC_MSG_ERROR([/dev/poll does not work. Force-enabling it is not going to help.])
2221 fi
2222 fi
2223
2224
2225 AC_ARG_ENABLE(http-violations,
2226 AS_HELP_STRING([--disable-http-violations],
2227 [This allows you to remove code which is known to
2228 violate the HTTP protocol specification.]), [
2229 SQUID_YESNO([$enableval],
2230 [unrecognized argument to --disable-http-violations: $enableval])
2231 ])
2232 SQUID_DEFINE_BOOL(USE_HTTP_VIOLATIONS, ${enable_http_violations:=yes},
2233 [Define to enable code which volates the HTTP standard specification])
2234 AC_MSG_NOTICE([HTTP violations support enabled: $enable_http_violations])
2235
2236 # IPFW Transparent Proxy
2237 AC_ARG_ENABLE(ipfw-transparent,
2238 AS_HELP_STRING([--enable-ipfw-transparent],
2239 [Enable Transparent Proxy support for systems
2240 using FreeBSD IPFW-style firewalling.]), [
2241 SQUID_YESNO([$enableval],
2242 [unrecognized argument to --enable-ipfw-transparent: $enableval])
2243 ])
2244 SQUID_DEFINE_BOOL(IPFW_TRANSPARENT,${enable_ipfw_transparent:=no},
2245 [Enable support for Transparent Proxy on systems using FreeBSD IPFW-style firewalling.])
2246 AC_MSG_NOTICE([FreeBSD IPFW-based transparent proxying enabled: $enable_ipfw_transparent])
2247
2248 # IP-Filter Transparent Proxy
2249 AC_ARG_ENABLE(ipf-transparent,
2250 AS_HELP_STRING([--enable-ipf-transparent],
2251 [Enable Transparent Proxy support using IPFilter-style firewalling]), [
2252 SQUID_YESNO([$enableval],
2253 [unrecognized argument to --enable-ipf-transparent: $enableval])
2254 ])
2255 #will be AC_DEFINEd later, after checking for appropriate infrastructure
2256 #IPF currently broken. Default-disabled for now.
2257 AC_MSG_NOTICE([IPF-based transparent proxying requested: ${enable_ipf_transparent:=no}])
2258
2259 dnl Enable PF Transparent Proxy
2260 AC_ARG_ENABLE(pf-transparent,
2261 AS_HELP_STRING([--enable-pf-transparent],
2262 [Enable Transparent Proxy support for systems using PF network address redirection.]), [
2263 SQUID_YESNO([$enableval],
2264 [unrecognized argument to --enable-pf-transparent: $enableval])
2265 ])
2266 #will be AC_DEFINEd later, after checking for appropriate infrastructure
2267 AC_MSG_NOTICE([PF-based transparent proxying requested: ${enable_pf_transparent:=no}])
2268
2269 dnl Enable /dev/pf support for older PF Transparent Proxy systems (OpenBSD 4.x and older)
2270 AC_ARG_WITH(nat-devpf,
2271 AS_HELP_STRING([--with-nat-devpf],
2272 [Enable /dev/pf support for NAT on older OpenBSD and FreeBSD kernels.]), [
2273 SQUID_YESNO([$enableval],
2274 [unrecognized argument to --with-nat-devpf: $enableval])
2275 ])
2276 #will be AC_DEFINEd later, after checking for appropriate infrastructure
2277 AC_MSG_NOTICE([NAT lookups via /dev/pf: ${with_nat_devpf:=no}])
2278
2279 # Linux Netfilter Transparent Proxy
2280 AC_ARG_ENABLE(linux-netfilter,
2281 AS_HELP_STRING([--enable-linux-netfilter],
2282 [Enable Transparent Proxy support for Linux (Netfilter)]), [
2283 SQUID_YESNO([$enableval],
2284 [unrecognized argument to --enable-linux-netfilter: $enableval])
2285 ])
2286 AC_MSG_NOTICE([Linux Netfilter support requested: ${enable_linux_netfilter:=auto}])
2287 #will be AC_DEFINEd later, after checking for appropriate infrastructure
2288
2289
2290 dnl Look for libnetfilter_conntrack options (needed for QOS netfilter marking)
2291 dnl squid_opt_netfilterconntrack is set only when option is explicity specified
2292 AC_ARG_WITH(netfilter-conntrack,
2293 AS_HELP_STRING([--without-netfilter-conntrack],
2294 [Do not use Netfilter conntrack libraries for packet marking.
2295 A path to alternative library location may be specified by
2296 using --with-netfilter-conntrack=PATH. Default: auto-detect.]), [
2297 case "$with_netfilter_conntrack" in
2298 yes|no)
2299 squid_opt_netfilterconntrack=$with_netfilter_conntrack
2300 ;;
2301 *)
2302 if test ! -d "$withval" ; then
2303 AC_MSG_ERROR([--without-netfilter-conntrack path does not point to a directory])
2304 fi
2305 squid_opt_netfilterconntrackpath=$withval
2306 LDFLAGS="-L$squid_opt_netfilterconntrackpath/lib $LDFLAGS"
2307 CPPFLAGS="-I$squid_opt_netfilterconntrackpath/include $CPPFLAGS"
2308 with_netfilter_conntrack=yes
2309 squid_opt_netfilterconntrack=yes
2310 esac
2311 ])
2312 AC_MSG_NOTICE([Linux Netfilter Conntrack support requested: ${with_netfilter_conntrack:=auto}])
2313 if test "x$with_netfilter_conntrack" != "xno"; then
2314 AC_SEARCH_LIBS([nfct_query], [netfilter_conntrack],,[
2315 if test x"$with_netfilter_conntrack" = "xyes"; then
2316 AC_MSG_ERROR([--with-netfilter-conntrack specified but libnetfilter-conntrack library not found])
2317 fi
2318 with_netfilter_conntrack=no])
2319 AC_CHECK_HEADERS([libnetfilter_conntrack/libnetfilter_conntrack.h \
2320 libnetfilter_conntrack/libnetfilter_conntrack_tcp.h],,[
2321 if test x"$with_netfilter_conntrack" = "xyes"; then
2322 AC_MSG_ERROR([--with-netfilter-conntrack specified but libnetfilter-conntrack headers not found])
2323 fi
2324 with_netfilter_conntrack=no])
2325 # If nothing is broken; enable the libraries usage.
2326 if test "x$with_netfilter_conntrack" != "xno"; then
2327 with_netfilter_conntrack=yes
2328 fi
2329 fi
2330
2331
2332 dnl Enable Large file support
2333 buildmodel=""
2334 squid_opt_enable_large_files=no
2335
2336 AC_ARG_WITH(large-files,
2337 AS_HELP_STRING([--with-large-files],[Enable support for large files (logs etc).]), [
2338 if test "x$withval" = "xyes"; then
2339 squid_opt_enable_large_files=yes
2340 fi
2341 ])
2342
2343 dnl UNIX Build environment
2344 dnl AS_HELP_STRING is not suited here because it cannot to specify newlines
2345 AC_ARG_WITH(build-environment,
2346 AS_HELP_STRING([--with-build-environment=model],
2347 [The build environment to use. Normally one of
2348 POSIX_V6_ILP32_OFF32 (32 bits),
2349 POSIX_V6_ILP32_OFFBIG (32 bits with large file support),
2350 POSIX_V6_LP64_OFF64 (64 bits),
2351 POSIX_V6_LPBIG_OFFBIG (large pointers and files),
2352 XBS5_ILP32_OFF32 i(legacy, 32 bits),
2353 XBS5_ILP32_OFFBIG (legacy, 32 bits with large file support),
2354 XBS5_LP64_OFF64 (legacy, 64 bits),
2355 XBS5_LPBIG_OFFBIG (legacy, large pointers and files)
2356 or default (The default for your OS)]), [
2357 case "$withval" in
2358 yes|no)
2359 AC_MSG_FAILURE([--with-build-environment expects a build environment string as used by getconf])
2360 ;;
2361 *)
2362 buildmodel="$withval"
2363 ;;
2364 esac
2365 ])
2366
2367 #hack. Let's early-detect sizeof(long)
2368 AC_CHECK_SIZEOF(long)
2369
2370 if test "x$squid_opt_enable_large_files" = "xyes" -a "x$buildmodel" = "x"; then
2371 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
2372 if test "`getconf _$model 2>/dev/null || true`" = 1 || test "`getconf $model 2>/dev/null || true`" ; then
2373 buildmodel=$model
2374 break
2375 fi
2376 done
2377 if test "x$buildmodel" = "x"; then
2378 AC_MSG_WARN([No suitable build environment found for large files. Trying to use _FILE_OFFSET_BITS=64])
2379 fi
2380 fi
2381 if test "x$buildmodel" = "xdefault" -o "x$buildmodel" = "x"; then
2382 # define _FILE_OFFSET_BITS if requested and needed
2383 if test "x$squid_opt_enable_large_files" = "xyes" -a $ac_cv_sizeof_long -le 4 ; then
2384 AC_MSG_NOTICE([Enabling -D_FILE_OFFSET_BITS=64])
2385 CFLAGS="-D_FILE_OFFSET_BITS=64 $CFLAGS"
2386 CXXFLAGS="-D_FILE_OFFSET_BITS=64 $CXXFLAGS"
2387 fi
2388 else
2389 AC_MSG_NOTICE([Using $buildmodel build environment])
2390 if test "`getconf _$buildmodel 2>/dev/null || true`" = 1 || test "`getconf $buildmodel 2>/dev/null || true`" ; then
2391 : # All fine
2392 else
2393 AC_MSG_ERROR(Build environment $buildmodel not known to getconf.)
2394 fi
2395 CFLAGS="`getconf ${buildmodel}_CFLAGS` $CFLAGS"
2396 CXXFLAGS="`getconf ${buildmodel}_CFLAGS` $CXXFLAGS"
2397 LIBS="`getconf ${buildmodel}_LIBS` $LIBS"
2398 LDFLAGS="`getconf ${buildmodel}_LDFLAGS` $LDFLAGS"
2399 if test "x$squid_host_os" = "xsolaris" ; then
2400
2401 # On Solaris getconf returns for CFLAGS -xarch=generic64, -Xa and -Usun options, and
2402 # for LDFLAGS -xarch=generic64, but:
2403 # "-Xa" is supported only by Sun cc, so we need to remove it when using gcc
2404 # For gcc "-xarch=generic64" must be replaced with "-m64"
2405 # The 'sun' define is needed by ipfilter includes, so we must remove "-Usun"
2406 if test "x$GCC" = "xyes"; then
2407 AC_MSG_NOTICE([Removing -Xa for gcc/g++ on $host])
2408 CFLAGS="`echo $CFLAGS | sed -e 's/-Xa//'`"
2409 CXXFLAGS="`echo $CXXFLAGS | sed -e 's/-Xa//'`"
2410 AC_MSG_NOTICE([Replacing -xarch=generic64 with -m64 for gcc/g++ on $host])
2411 CFLAGS="`echo $CFLAGS | sed -e 's/-xarch=generic64/-m64/'`"
2412 CXXFLAGS="`echo $CXXFLAGS | sed -e 's/-xarch=generic64/-m64/'`"
2413 LDFLAGS="`echo $LDFLAGS | sed -e 's/-xarch=generic64//'`"
2414 fi
2415 AC_MSG_NOTICE([Removing -Usun on $host])
2416 CFLAGS="`echo $CFLAGS | sed -e 's/-Usun//'`"
2417 CXXFLAGS="`echo $CXXFLAGS | sed -e 's/-Usun//'`"
2418 fi
2419 fi
2420
2421 dnl Enable Leak Finding Functions
2422 AC_ARG_ENABLE(leakfinder,
2423 AS_HELP_STRING([--enable-leakfinder],
2424 [Enable Leak Finding code. Enabling this alone does nothing;
2425 you also have to modify the source code to use the leak
2426 finding functions. Probably Useful for hackers only.]), [
2427 SQUID_YESNO([$enableval],
2428 [unrecognized argument to --enable-leakfinder: $enableval])
2429 ])
2430 AC_MSG_NOTICE([Leak Finder enabled: ${enable_leakfinder:=no}])
2431 SQUID_DEFINE_BOOL(USE_LEAKFINDER,$enable_leakfinder,
2432 [Enable code for assisting in finding memory leaks. Not for the faint of heart])
2433 AM_CONDITIONAL(ENABLE_LEAKFINDER, [test "x$enable_leakfinder" = "xyes"])
2434
2435
2436 AC_ARG_ENABLE(follow-x-forwarded-for,
2437 AS_HELP_STRING([--enable-follow-x-forwarded-for],
2438 [Enable support for following the X-Forwarded-For
2439 HTTP header to try to find the IP address of the
2440 original or indirect client when a request has
2441 been forwarded through other proxies.]), [
2442 SQUID_YESNO([$enableval],
2443 [unrecognized argument to --enable-follow-x-forwarded-for: $enableval])
2444 ])
2445 AC_MSG_NOTICE([Support for X-Forwarded-For enabled: ${enable_follow_x_forwarded_for:=yes}])
2446 SQUID_DEFINE_BOOL(FOLLOW_X_FORWARDED_FOR,$enable_follow_x_forwarded_for,
2447 [Enable following X-Forwarded-For headers])
2448
2449 AC_ARG_ENABLE(ident-lookups,
2450 AS_HELP_STRING([--disable-ident-lookups],
2451 [Remove code that supports performing Ident (RFC 931) lookups.]), [
2452 SQUID_YESNO([$enableval],[unrecognized argument to --disable-ident-lookups: $enableval])
2453 ])
2454 AC_MSG_NOTICE([Support for Ident lookups enabled: ${enable_ident_lookups:=yes}])
2455 SQUID_DEFINE_BOOL(USE_IDENT,$enable_ident_lookups,[Support for Ident (RFC 931) lookups])
2456
2457 dnl Select Default hosts file location
2458 AC_ARG_ENABLE(default-hostsfile,
2459 AS_HELP_STRING([--enable-default-hostsfile=path],
2460 [Select default location for hosts file.
2461 See hosts_file directive in squid.conf for details]), [
2462 if test "x$enableval" != "xnone" -a "x$enableval" != "xno" ; then
2463 if test \! -f "$enableval"; then
2464 AC_MSG_WARN([Unable to find file $enableval. I hope you know what you are doing.])
2465 fi
2466 squid_opt_default_hosts=$enableval
2467 else
2468 squid_opt_default_hosts="none"
2469 fi
2470 ])
2471 AC_MSG_NOTICE([Default hosts file set to: ${squid_opt_default_hosts:=/etc/hosts}])
2472 DEFAULT_HOSTS=$squid_opt_default_hosts
2473 AC_SUBST(DEFAULT_HOSTS)
2474
2475 # Select auth schemes modules to build
2476 AC_ARG_ENABLE(auth,
2477 AS_HELP_STRING([--enable-auth],
2478 [Build global support for authentication. The list of schemes
2479 and helpers to be enabled is defined elsewhere]), [
2480 SQUID_YESNO([$enableval],
2481 [unrecognized argument to --enable-auth: $enableval])
2482 ])
2483 AC_MSG_NOTICE([Authentication support enabled: ${enable_auth:=yes}])
2484 SQUID_DEFINE_BOOL(USE_AUTH,$enable_auth,[Enable support for authentication])
2485 AM_CONDITIONAL(ENABLE_AUTH, test "x$enable_auth" != "xno")
2486 AUTH_MODULES=""
2487 require_smblib="no"
2488
2489 AC_ARG_ENABLE(auth-basic,
2490 AS_HELP_STRING([--enable-auth-basic="list of helpers"],
2491 [Enable the basic authentication scheme, and build the specified helpers.
2492 Not providing an explicit list of helpers will attempt build of
2493 all possible helpers. Default is to do so.
2494 To disable the basic authentication scheme, use --disable-auth-basic.
2495 To enable but build no helpers, specify "none".
2496 To see available helpers, see the src/auth/basic/ directory. ]),[
2497 #nothing to do really
2498 ])
2499 m4_include([src/auth/basic/helpers.m4])
2500
2501 AC_ARG_ENABLE(auth-digest,
2502 AS_HELP_STRING([--enable-auth-digest="list of helpers"],
2503 [Enable the Digest authentication scheme, and build the specified helpers.
2504 Not providing an explicit list of helpers will attempt build of
2505 all possible helpers. Default is to do so.
2506 To disable the Digest authentication scheme, use --disable-auth-digest.
2507 To enable but build no helpers, specify "none".
2508 To see available helpers, see the src/auth/digest/ directory. ]),[
2509 #nothing to do, really
2510 ])
2511 m4_include([src/auth/digest/helpers.m4])
2512
2513 AC_ARG_ENABLE(auth-negotiate,
2514 AS_HELP_STRING([--enable-auth-negotiate="list of helpers"],
2515 [Enable the Negotiate authentication scheme, and build the specified
2516 helpers.
2517 Not providing an explicit list of helpers will attempt build of
2518 all possible helpers. Default is to do so.
2519 To disable the Negotiate authentication scheme,
2520 use --disable-auth-negotiate.
2521 To enable but build no helpers, specify "none".
2522 To see available helpers, see the src/auth/negotiate/ directory. ]),[
2523 #nothing to do, really
2524 ])
2525 m4_include([src/auth/negotiate/helpers.m4])
2526
2527 AC_ARG_ENABLE(auth-ntlm,
2528 AS_HELP_STRING([--enable-auth-ntlm="list of helpers"],
2529 [Enable the NTLM authentication scheme, and build the specified helpers.
2530 Not providing an explicit list of helpers will attempt build of
2531 all possible helpers. Default is to do so.
2532 To disable the NTLM authentication scheme, use --disable-auth-ntlm.
2533 To enable but build no helpers, specify "none".
2534 To see available helpers, see the src/auth/ntlm/ directory. ]),[
2535 ])
2536 m4_include([src/auth/ntlm/helpers.m4])
2537
2538 dnl Authentication libraries to build
2539 dnl This list will not be needed when each auth library has its own Makefile
2540 dnl this is to be placed AFTER each auth module's handler
2541 AUTH_LIBS_TO_BUILD=
2542 for module in $AUTH_MODULES; do
2543 AUTH_LIBS_TO_BUILD="$AUTH_LIBS_TO_BUILD ${module}/lib${module}.la"
2544 done
2545 AC_SUBST(AUTH_MODULES)
2546 AC_SUBST(AUTH_LIBS_TO_BUILD)
2547 AM_CONDITIONAL(ENABLE_SMBLIB, test "x$require_smblib" = "xyes")
2548
2549 dnl Select logging daemon helpers to build
2550 AC_ARG_ENABLE(log-daemon-helpers,
2551 AS_HELP_STRING([--enable-log-daemon-helpers="list of helpers"],
2552 [This option selects which logging daemon helpers to
2553 build and install as part of the normal build process
2554 For a list of available helpers see the src/log/
2555 directory.]),[
2556 #nothing to do, really
2557 ])
2558 m4_include([src/log/helpers.m4])
2559
2560 AC_ARG_ENABLE(external-acl-helpers,
2561 AS_HELP_STRING([--enable-external-acl-helpers="list of helpers"],
2562 [Enable external_acl helpers support and the helpers themselves.
2563 Default is to build all buildable helpers and enable support.
2564 To disable support, use --disable-external-acl-helpers.
2565 To build no helpers, specify "none".
2566 To see available helpers, see the src/acl/external/
2567 directory]), [
2568 #nothing to do, really
2569 ])
2570 m4_include([src/acl/external/helpers.m4])
2571
2572 dnl Select url_rewrite helpers to build
2573 AC_ARG_ENABLE(url-rewrite-helpers,
2574 AS_HELP_STRING([--enable-url-rewrite-helpers="list of helpers"],
2575 [This option selects which url_rewrite helpers to
2576 build and install as part of the normal build
2577 process. The default is to attempt the build of all possible
2578 helpers. Use --disable-url-rewrite-helpers to build none.
2579 For a list of available helpers see the
2580 src/http/url_rewriters/ directory.]),[
2581 ])
2582 m4_include([src/http/url_rewriters/helpers.m4])
2583
2584 dnl Select security helpers to build
2585 AC_ARG_ENABLE(security-cert-validators,
2586 AS_HELP_STRING([--enable-security-cert-validators="list of helpers"],
2587 [This option selects which security certificate validator
2588 helpers to build and install as part of the normal build
2589 process. The default is to attempt the build of all possible
2590 helpers. Use --disable-security-cert-validators to
2591 build none. For a list of available helpers see the
2592 src/security/cert_validators/ directory.]),[
2593 ])
2594 m4_include([src/security/cert_validators/helpers.m4])
2595
2596 AC_ARG_ENABLE(security-cert-generators,
2597 AS_HELP_STRING([--enable-security-cert-generators="list of helpers"],
2598 [This option selects which security certificate validator
2599 helpers to build and install as part of the normal build
2600 process. The default is to attempt the build of all possible
2601 helpers. Use --disable-security-cert-genrators to
2602 build none. For a list of available helpers see the
2603 src/security/cert_generators/ directory.]),[
2604 ])
2605 m4_include([src/security/cert_generators/helpers.m4])
2606
2607 dnl Select storeid_rewrite helpers to build
2608 AC_ARG_ENABLE(storeid-rewrite-helpers,
2609 AS_HELP_STRING([--enable-storeid-rewrite-helpers="list of helpers"],
2610 [This option selects which Store-ID rewrite helpers to
2611 build and install as part of the normal build
2612 process. The default is to attempt the build of all possible
2613 helpers. Use --disable-storeid-rewrite-helpers to build none.
2614 For a list of available helpers see the
2615 src/store/id_rewriters/ directory.]),[
2616 ])
2617 m4_include([src/store/id_rewriters/helpers.m4])
2618
2619 AC_ARG_WITH(valgrind-debug,
2620 AS_HELP_STRING([--with-valgrind-debug],
2621 [Include debug instrumentation for use with valgrind]),
2622 [
2623 SQUID_YESNO([$withval],
2624 [unrecognized argument to --with-valgrind-debug: $withval])
2625 if test "x$withval" != "xno" ; then
2626 AC_CHECK_HEADERS(valgrind/memcheck.h,[],[
2627 AC_MSG_ERROR([Valgrind support requested, needed headers not found.])
2628 ])
2629 fi
2630 ])
2631 SQUID_DEFINE_BOOL(WITH_VALGRIND,${with_valgrind_debug:=no},
2632 [Valgrind memory debugger support])
2633 AC_MSG_NOTICE([Valgrind debug support enabled: $with_valgrind_debug])
2634
2635 dnl Disable "memPools" code
2636 #AC_ARG_ENABLE(chunkedmempools,
2637 # AS_HELP_STRING([--enable-chunkedmempools],
2638 # [Enable experimental chunked memPools. Note that this option
2639 # simply sets the default behaviour. Specific classes can override this
2640 # at runtime, and only lib/MemPool.c needs to be altered
2641 # to change the squid-wide default for all classes.]), [
2642 #SQUID_YESNO([$enableval],
2643 # [--enable-chunkedmempools option takes no arguments])
2644 #])
2645 SQUID_DEFINE_BOOL(USE_CHUNKEDMEMPOOLS,${enable_chunkedmempools:=no},
2646 [Enable chunked Memory Pools support (experimental)])
2647 #AC_MSG_NOTICE([Chunked MemPools enabled: $enable_chunkedmempools])
2648
2649 dnl Enable WIN32 Service compile mode
2650 AC_ARG_ENABLE(win32-service,
2651 AS_HELP_STRING([--enable-win32-service],
2652 [Compile Squid as a WIN32 Service.
2653 Works only on MS-Windows platforms]), [
2654 SQUID_YESNO([$enableval],
2655 [unrecognized argument to --enable-win32-service: $enableval])
2656 ])
2657 SQUID_DEFINE_BOOL(USE_WIN32_SERVICE,${enable_win32_service:=no},
2658 [Enable code supporting MS Windows service mode])
2659 AC_MSG_NOTICE([MS Windows service mode enabled: $enable_win32_service])
2660
2661
2662 # Disable "unlinkd" code
2663 AC_ARG_ENABLE(unlinkd,
2664 AS_HELP_STRING([--disable-unlinkd],[Do not use unlinkd]), [
2665 SQUID_YESNO([$enableval],
2666 [unrecognized argument to --disable-unlinkd: $enableval])
2667 ])
2668 SQUID_DEFINE_BOOL(USE_UNLINKD,${enable_unlinkd:=yes},
2669 [Enable useage of unlinkd])
2670 AM_CONDITIONAL(ENABLE_UNLINKD,test "x$enable_unlinkd" = "xyes")
2671 AC_MSG_NOTICE([unlinkd enabled: $enable_unlinkd])
2672
2673 # Enable backtraces on fatal errors
2674 AC_ARG_ENABLE(stacktraces,
2675 AS_HELP_STRING([--enable-stacktraces],
2676 [Enable automatic call backtrace on fatal errors]), [
2677 SQUID_YESNO([$enableval],
2678 [unrecognized argument to --enable-stacktraces: $enableval])
2679 ])
2680 SQUID_DEFINE_BOOL(PRINT_STACK_TRACE,${enable_stacktraces:=no},
2681 [Print stack traces on fatal errors])
2682 AC_MSG_NOTICE([Automatically print stack trace on fatal errors: $enable_stacktraces])
2683
2684
2685 # CPU Profiling options handling
2686 AC_ARG_ENABLE(cpu-profiling,
2687 AS_HELP_STRING([--enable-cpu-profiling],
2688 [Enable instrumentation to try and understand how CPU power
2689 is spent by squid, by enabling specific probes in selected
2690 functions.
2691 New probes can only be added by modifying the source code.
2692 It is meant to help developers in optimizing performance
2693 of Squid internal functions.
2694 If you are not developer you should not enable this,
2695 as it slows squid down somewhat.
2696 See lib/Profiler.c for more details.]), [
2697 SQUID_YESNO([$enableval],
2698 [unrecognized argument to --enable-cpu-profiling: $enableval])
2699 ])
2700 # Default OFF. This is a debug feature. Only check and enable if forced ON.
2701 if test "x$enable_cpu_profiling" = "xyes"; then
2702 SQUID_CHECK_FUNCTIONAL_CPU_PROFILER
2703 if test "x$squid_cv_cpu_profiler_works" = "xno"; then
2704 AC_MSG_ERROR([CPU profiling will not be functional in this build.])
2705 fi
2706 fi
2707 SQUID_DEFINE_BOOL(USE_XPROF_STATS,${enable_cpu_profiling:=no},
2708 [Define to enable CPU profiling within Squid])
2709 AM_CONDITIONAL(ENABLE_XPROF_STATS,
2710 test "x$enable_cpu_profiling" = "xyes")
2711 AC_MSG_NOTICE([CPU profiling enabled: $enable_cpu_profiling])
2712
2713 # Enable X-Accelerator-Vary for Vary support within an accelerator setup
2714 AC_ARG_ENABLE(x-accelerator-vary,
2715 AS_HELP_STRING([--enable-x-accelerator-vary],
2716 [Enable support for the X-Accelerator-Vary
2717 HTTP header. Can be used to indicate
2718 variance within an accelerator setup.
2719 Typically used together with other code
2720 that adds custom HTTP headers to the requests.]), [
2721 SQUID_YESNO([$enableval],
2722 [unrecognized argument to --enable-x-accelerator-vary: $enableval])
2723 ])
2724 SQUID_DEFINE_BOOL(X_ACCELERATOR_VARY,${enable_x_accelerator_vary:=no},
2725 [Enable support for the X-Accelerator-Vary HTTP header])
2726 AC_MSG_NOTICE([X-Accelerator-Vary support enabled: $enable_x_accelerator_vary])
2727
2728
2729 if $CPPUNITCONFIG --help >/dev/null; then
2730 squid_cv_cppunit_version="`$CPPUNITCONFIG --version`"
2731 AC_MSG_NOTICE([using system installed cppunit version $squid_cv_cppunit_version])
2732 unset squid_cv_cppunit_version
2733 SQUID_CPPUNIT_LIBS="`$CPPUNITCONFIG --libs`"
2734 SQUID_CPPUNIT_LA=''
2735 SQUID_CPPUNIT_INC="`$CPPUNITCONFIG --cflags`"
2736 else
2737 AC_MSG_WARN([cppunit does not appear to be installed. squid does not require this, but code testing with 'make check' will fail.])
2738 SQUID_CPPUNIT_LA=''
2739 SQUID_CPPUNIT_LIBS=''
2740 SQUID_CPPUNIT_INC=''
2741 fi
2742
2743 AC_ARG_WITH(cppunit-basedir,
2744 AS_HELP_STRING([--with-cppunit-basedir=PATH],
2745 [Path where the cppunit headers are libraries can be found ]), [
2746 if test -f "$withval/include/cppunit/TestCase.h"; then
2747 AC_MSG_NOTICE([Using cppunit includes from $withval])
2748 SQUID_CPPUNIT_INC="-I${withval}/include"
2749 else
2750 AC_MSG_ERROR(Cannot find cppunit at $withval)
2751 fi
2752 if test -f "$withval/lib/libcppunit.la"; then
2753 AC_MSG_NOTICE([Using cppunit lib from $withval])
2754 SQUID_CPPUNIT_LA="${withval}/lib/libcppunit.la"
2755 SQUID_CPPUNIT_LIBS='$(SQUID_CPPUNIT_LA)'
2756 else
2757 AC_MSG_ERROR(Cannot find cppunit at $withval)
2758 fi
2759 ])
2760 SQUID_STATE_SAVE(squid_cppunit_state)
2761 CXXFLAGS="$CXXFLAGS $SQUID_CPPUNIT_INC"
2762 AC_CHECK_HEADERS(cppunit/extensions/HelperMacros.h)
2763 SQUID_STATE_ROLLBACK(squid_cppunit_state)
2764 AC_SUBST(SQUID_CPPUNIT_LIBS)
2765 AC_SUBST(SQUID_CPPUNIT_LA)
2766 AC_SUBST(SQUID_CPPUNIT_INC)
2767
2768 # Force some compilers to use ANSI features
2769 #
2770 case "$host" in
2771 *-hp-hpux*)
2772 if test "x$ac_cv_prog_CC" = "xcc" ; then
2773 AC_MSG_NOTICE([adding '-Ae' to cc args for $host])
2774 CC="cc -Ae";
2775 ac_cv_prog_CC="$CC"
2776 fi
2777 ;;
2778 esac
2779
2780
2781 dnl automake handles this AC_PATH_PROG(MAKEDEPEND, makedepend, $TRUE)
2782
2783 case "$host" in
2784 *hpux*)
2785 AC_MSG_NOTICE([Disabling ranlib for HP-UX...])
2786 RANLIB=":"
2787 ;;
2788 esac
2789
2790 dnl Check for headers
2791 AC_HEADER_DIRENT
2792 AC_HEADER_STDC
2793
2794 AC_CHECK_HEADERS( \
2795 arpa/inet.h \
2796 arpa/nameser.h \
2797 assert.h \
2798 bstring.h \
2799 crypt.h \
2800 ctype.h \
2801 direct.h \
2802 errno.h \
2803 execinfo.h \
2804 fcntl.h \
2805 fnmatch.h \
2806 getopt.h \
2807 glob.h \
2808 gnumalloc.h \
2809 grp.h \
2810 ipl.h \
2811 lber.h \
2812 ldap.h \
2813 libc.h \
2814 limits.h \
2815 linux/posix_types.h \
2816 linux/types.h \
2817 malloc.h \
2818 math.h \
2819 memory.h \
2820 mount.h \
2821 netdb.h \
2822 netinet/in.h \
2823 netinet/in_systm.h \
2824 netinet/tcp.h \
2825 paths.h \
2826 poll.h \
2827 pwd.h \
2828 regex.h \
2829 sched.h \
2830 siginfo.h \
2831 signal.h \
2832 stdarg.h \
2833 stddef.h \
2834 stdio.h \
2835 stdlib.h \
2836 string.h \
2837 strings.h \
2838 sys/bitypes.h \
2839 sys/file.h \
2840 sys/ioctl.h \
2841 sys/ipc.cc \
2842 sys/param.h \
2843 sys/prctl.h \
2844 sys/md5.h \
2845 sys/mman.h \
2846 sys/msg.h \
2847 sys/resource.h \
2848 sys/select.h \
2849 sys/shm.h \
2850 sys/socket.h \
2851 sys/stat.h \
2852 syscall.h \
2853 sys/syscall.h \
2854 sys/time.h \
2855 sys/types.h \
2856 sys/uio.h \
2857 sys/un.h \
2858 sys/vfs.h \
2859 sys/wait.h \
2860 syslog.h \
2861 time.h \
2862 unistd.h \
2863 utime.h \
2864 varargs.h \
2865 byteswap.h \
2866 glib.h \
2867 stdint.h \
2868 inttypes.h \
2869 db.h \
2870 db_185.h \
2871 wchar.h
2872 )
2873
2874 AC_CHECK_HEADERS( \
2875 linux/netfilter_ipv4.h \
2876 linux/netfilter_ipv6/ip6_tables.h \
2877 ,,,
2878 SQUID_DEFAULT_INCLUDES
2879 #if HAVE_LIMITS_H
2880 #include <limits.h>
2881 #endif
2882 /* Netfilter ip(6)tables v1.4.0 has broken headers */
2883 #if HAVE_NETINET_IN_H
2884 #include <netinet/in.h>
2885 #endif
2886 )
2887
2888 dnl *BSD dont include the dependencies for all their net/ and netinet/ files
2889 dnl We must include a few basic type headers for them to work.
2890 AC_CHECK_HEADERS( \
2891 net/if.h \
2892 netinet/if_ether.h\
2893 netinet/icmp6.h \
2894 netinet/in.h \
2895 netinet/ip.h \
2896 netinet/ip6.h \
2897 netinet/ip_icmp.h \
2898 netinet/ipl.h \
2899 net/pf/pfvar.h \
2900 net/pfvar.h \
2901 sys/mount.h\
2902 resolv.h \
2903 ,,,
2904 SQUID_BSDNET_INCLUDES)
2905
2906 AC_C_CONST
2907 AC_C_BIGENDIAN
2908
2909 AC_STRUCT_TM
2910 AC_CHECK_MEMBERS([struct tm.tm_gmtoff],,,[
2911 #if TM_IN_SYS_TIME
2912 #if HAVE_SYS_TIME_H
2913 #include <sys/time.h>
2914 #endif
2915 #elif HAVE_TIME_H
2916 #include <time.h>
2917 #endif
2918 ])
2919
2920 dnl Override rusage() detect on MinGW because is emulated in source code
2921 case "$squid_host_os" in
2922 mingw)
2923 AC_DEFINE(HAVE_STRUCT_RUSAGE)
2924 ac_cv_func_getrusage='yes'
2925 AC_MSG_NOTICE([Using own rusage on Windows.])
2926 ;;
2927 *)
2928 AC_CHECK_TYPE(struct rusage,AC_DEFINE(HAVE_STRUCT_RUSAGE,1,[The system provides struct rusage]),,[
2929 #if HAVE_SYS_TIME_H
2930 #include <sys/time.h>
2931 #endif
2932 #if HAVE_SYS_RESOURCE_H
2933 #include <sys/resource.h>
2934 #endif])
2935 ;;
2936 esac
2937
2938 AC_CHECK_MEMBERS([struct iphdr.ip_hl],,,[
2939 #if HAVE_SYS_TYPES_H
2940 #include <sys/types.h>
2941 #endif
2942 #include <netinet/in.h>
2943 #include <netinet/in_systm.h>
2944 #include <netinet/ip.h>
2945 #if defined (__linux__) || defined (__CYGWIN__)
2946 #define ip_hl ihl
2947 #endif
2948 #ifndef __linux__
2949 #ifndef __CYGWIN__
2950 #define iphdr ip
2951 #endif
2952 #endif])
2953
2954 dnl Check for typedefs
2955 AC_CHECK_SIZEOF(void *)
2956
2957 # check for a bunch of types
2958 AC_TYPE_INT8_T
2959 AC_TYPE_UINT8_T
2960 AC_TYPE_INT16_T
2961 AC_TYPE_UINT16_T
2962 AC_TYPE_INT32_T
2963 AC_TYPE_UINT32_T
2964 AC_TYPE_INT64_T
2965 AC_TYPE_UINT64_T
2966 AC_TYPE_PID_T
2967 AC_TYPE_SIZE_T
2968 AC_TYPE_SSIZE_T
2969 AC_TYPE_OFF_T
2970 AC_TYPE_UID_T
2971 AC_CHECK_TYPE([bool])
2972 #need the defines for PRId64
2973 AC_CHECK_SIZEOF(int64_t)
2974 AC_CHECK_SIZEOF(long)
2975 #need the defines for PRIuSIZE
2976 AC_CHECK_SIZEOF(size_t)
2977 #need the define for overflow checks
2978 AC_CHECK_SIZEOF(off_t)
2979 AC_CHECK_SIZEOF(size_t)
2980
2981 dnl Some C++11 types we try to use
2982 AX_CXX_TYPE_NULLPTR
2983 AX_CXX_TYPE_UNIQUE_PTR
2984 AX_CXX_TYPE_UNIFORM_DISTRIBUTIONS
2985 SQUID_CXX_STD_UNDERLYING_TYPE
2986
2987 dnl On Solaris 9 x86, gcc may includes a "fixed" set of old system include files
2988 dnl that is incompatible with the updated Solaris header files.
2989 dnl For this reason, we must check if pad128_t and upad128_t are defined.
2990 AC_CHECK_TYPE(pad128_t,
2991 AC_DEFINE(HAVE_PAD128_T,1,[pad128_t is defined in system headers]),
2992 ,SQUID_DEFAULT_INCLUDES)
2993
2994 AC_CHECK_TYPE(upad128_t,
2995 AC_DEFINE(HAVE_UPAD128_T,1,[upad128_t is defined in system headers]),
2996 ,SQUID_DEFAULT_INCLUDES)
2997
2998 AC_CHECK_TYPE(mode_t, AC_DEFINE(HAVE_MODE_T,1,[mode_t is defined by the system headers]),,SQUID_DEFAULT_INCLUDES)
2999 AC_CHECK_TYPE(fd_mask, AC_DEFINE(HAVE_FD_MASK,1,[fd_mask is defined by the system headers]),,SQUID_DEFAULT_INCLUDES)
3000
3001 AC_CHECK_TYPE(socklen_t,AC_DEFINE(HAVE_SOCKLEN_T,1,[socklen_t is defined by the system headers]),,[
3002 #include <sys/types.h>
3003 #include <sys/socket.h>
3004 #if STDC_HEADERS
3005 #include <stdlib.h>
3006 #include <stddef.h>
3007 #endif])
3008
3009 AC_CHECK_TYPE(mtyp_t,AC_DEFINE(HAVE_MTYP_T,1,
3010 [mtyp_t is defined by the system headers]),,[#include <sys/types.h>
3011 #include <sys/ipc.h>
3012 #include <sys/msg.h>])
3013
3014 # check for compiler support of %zu printf macro
3015 AH_TEMPLATE(PRIuSIZE,[Compiler supports %zu printf macro])
3016 AC_MSG_CHECKING([for compiler %zu support])
3017 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
3018 #include <stdio.h>
3019 ]],[[size_t n=1;printf("%zu",n);]])],[
3020 AC_DEFINE(PRIuSIZE,"zu")
3021 AC_MSG_RESULT(yes)
3022 ],[AC_MSG_RESULT(no)],[AC_MSG_RESULT(no)])
3023
3024
3025 dnl Check for special functions
3026 AC_FUNC_ALLOCA
3027
3028
3029 dnl Check for libcap header (assume its not broken unless
3030 AC_ARG_WITH(libcap, AS_HELP_STRING([--without-libcap],
3031 [disable usage of Linux capabilities library to control privileges]), [
3032 SQUID_YESNO([$withval],[unrecognized argument to --without-libcap: $withval])
3033 ],[with_libcap=auto])
3034
3035 if test "x$with_libcap" != "xno"; then
3036 # cap_clear_flag is the most recent libcap function we require
3037 AC_CHECK_HEADERS(sys/capability.h)
3038 AC_CHECK_LIB(cap, cap_clear_flag)
3039 SQUID_CHECK_FUNCTIONAL_LIBCAP2
3040
3041 # if it can't be supported..
3042 if test "x$ac_cv_header_sys_capability_h" = "xno" -o \
3043 "x$ac_cv_lib_cap_cap_clear_flag" = "xno"; then
3044 # and it was forced on: error
3045 if test "x$with_libcap" = "xyes" ; then
3046 AC_MSG_ERROR([libcap forced enabled but not available or not usable, requires libcap-2.09 or later])
3047 else
3048 # with_libcap is "auto"; it can't be supported. Disable.
3049 with_libcap=no
3050 fi
3051 else
3052 # header and lib are ok, we support
3053 with_libcap=yes
3054 fi
3055
3056 fi
3057
3058 SQUID_DEFINE_BOOL(USE_LIBCAP,$with_libcap,
3059 [use libcap to set capabilities required for TPROXY])
3060 AC_MSG_NOTICE([libcap support enabled: $with_libcap])
3061 SQUID_DEFINE_BOOL(LIBCAP_BROKEN,${squid_cv_sys_capability_works:=no},
3062 [libcap2 headers are broken and clashing with glibc])
3063 AC_MSG_NOTICE([libcap2 headers are ok: $squid_cv_sys_capability_works])
3064
3065
3066 dnl Check for needed libraries
3067 AC_SEARCH_LIBS([gethostbyname],[nsl resolv bind])
3068 AC_SEARCH_LIBS([res_init],[resolv])
3069 AC_SEARCH_LIBS([__res_search],[resolv])
3070 AC_SEARCH_LIBS([bind],[socket])
3071 AC_SEARCH_LIBS([opcom_stack_trace],[opcom_stack])
3072 AC_SEARCH_LIBS([strlcpy], [bsd])
3073 AC_SEARCH_LIBS([yp_match], [nsl nss_nis nss_nisplus])
3074 dnl Check for Winsock only on MinGW, on Cygwin we must use emulated BSD socket API
3075 if test "x$squid_host_os" = "xmingw" ; then
3076 SQUID_CHECK_WINSOCK_LIB
3077 AC_CHECK_HEADERS( \
3078 windows.h \
3079 ws2tcpip.h \
3080 iphlpapi.h ,,,[
3081 #if HAVE_WINSOCK2_H
3082 #include <winsock2.h>
3083 #endif
3084 #if HAVE_WINDOWS_H
3085 #include <windows.h>
3086 #endif
3087 #if HAVE_WS2TCPIP_H
3088 #include <ws2tcpip.h>
3089 #endif
3090 ])
3091 fi
3092
3093 # check that we have unix sockets
3094 SQUID_CHECK_UNIX_SOCKET
3095 SQUID_DEFINE_BOOL(HAVE_UNIXSOCKET,$squid_cv_unixsocket,[System supports unix sockets])
3096
3097 AC_CHECK_LIB(gnumalloc, malloc)
3098 if test "x$ac_cv_lib_gnumalloc_malloc" = "xyes"; then
3099 AC_MSG_NOTICE([Disabling extended malloc functions when using bundled gnumalloc])
3100 ac_cv_func_mallocblksize=no
3101 ac_cv_func_mallopt=no
3102 else
3103 case "$squid_host_os" in
3104 solaris)
3105 AC_MSG_NOTICE([skipping libmalloc check for $host])
3106 ;;
3107 freebsd)
3108 AC_MSG_NOTICE([skipping libmalloc check for $host])
3109 ;;
3110 *)
3111 #used later. FIXME
3112 AC_CHECK_LIB(malloc, main)
3113 ;;
3114 esac
3115 fi
3116
3117 case "$squid_host_os" in
3118 mingw)
3119 AC_MSG_NOTICE([Use MSVCRT for math functions.])
3120 ;;
3121 *)
3122 dnl rint() and log() are only used in old C code for now.
3123 AC_LANG_PUSH([C])
3124 AC_SEARCH_LIBS([rint],[m])
3125 AC_SEARCH_LIBS([log],[m])
3126 AC_LANG_POP([C])
3127 ;;
3128 esac
3129
3130 dnl --with-maxfd present for compatibility with Squid-2.
3131 dnl undocumented in ./configure --help to encourage using the Squid-3 directive
3132 AC_ARG_WITH(maxfd,,
3133 [
3134 case ${withval} in
3135 [[0-9]]*)
3136 squid_filedescriptors_num=$withval
3137 AC_MSG_NOTICE([forcing default of $squid_filedescriptors_num filedescriptors (user-forced)])
3138 ;;
3139 *)
3140 AC_MSG_ERROR(--with-maxfd expects a numeric argument)
3141 ;;
3142 esac
3143 ])
3144
3145 AC_ARG_WITH(filedescriptors,
3146 AS_HELP_STRING([--with-filedescriptors=NUMBER],
3147 [Force squid to support NUMBER filedescriptors]),
3148 [
3149 case ${withval} in
3150 [[0-9]]*)
3151 squid_filedescriptors_num=$withval
3152 AC_MSG_NOTICE([forcing default of $squid_filedescriptors_num filedescriptors (user-forced)])
3153 ;;
3154 *)
3155 AC_MSG_ERROR(--with-filedescriptors expects a numeric argument)
3156 ;;
3157 esac
3158 ])
3159
3160 SQUID_CHECK_DEFAULT_FD_SETSIZE
3161 SQUID_CHECK_MAXFD
3162 if test "x$squid_filedescriptors_num" != "x"; then
3163 AC_MSG_NOTICE([Default number of fieldescriptors: $squid_filedescriptors_num])
3164 fi
3165 if test "$squid_filedescriptors_num" -lt 512 ; then
3166 AC_MSG_WARN([$squid_filedescriptors_num may not be enough filedescriptors if your])
3167 AC_MSG_WARN([cache will be very busy. Please see the FAQ page])
3168 AC_MSG_WARN([http://wiki.squid-cache.org/SquidFaq/TroubleShooting])
3169 AC_MSG_WARN([on how to increase your filedescriptor limit])
3170 fi
3171 AC_DEFINE_UNQUOTED(SQUID_MAXFD, $squid_filedescriptors_num,[Maximum number of open filedescriptors])
3172
3173
3174 dnl Enable IPv6 support
3175 AC_MSG_CHECKING([whether to enable IPv6])
3176 AC_ARG_ENABLE(ipv6,
3177 AS_HELP_STRING([--disable-ipv6],[Disable IPv6 support. The default is to probe system capabilities on startup.]), [
3178 SQUID_YESNO([$enableval],[unrecognized argument to --disable-ipv6: $enableval])
3179 ])
3180 AC_MSG_RESULT(${enable_ipv6:=yes})
3181 SQUID_DEFINE_BOOL(USE_IPV6,$enable_ipv6,[Enable support for IPv6 ])
3182
3183 if test "x$enable_ipv6" = "xyes" ; then
3184 SQUID_CHECK_SIN6_LEN_IN_SAI
3185 fi
3186 SQUID_CHECK_SS_LEN_IN_SOCKADDR_STORAGE
3187 SQUID_CHECK_SIN_LEN_IN_SOCKADDR_IN
3188
3189
3190 dnl Check for libdl, used by auth_modules/PAM
3191 if test "x$with_dl" = "xyes"; then
3192 AC_CHECK_LIB(dl, dlopen)
3193 fi
3194
3195 dnl -lintl is needed on SCO version 3.2v4.2 for strftime()
3196 dnl Robert Side <rside@aiinc.bc.ca>
3197 dnl Mon, 18 Jan 1999 17:48:00 GMT
3198 case "$host" in
3199 *-pc-sco3.2*)
3200 AC_CHECK_LIB(intl, strftime)
3201 ;;
3202 esac
3203
3204 dnl Check for libdb
3205 dnl this is not fully functional if db.h is for a differend db version
3206 DBLIB=
3207
3208 dnl check that dbopen is actually defined in the header
3209 dnl FIXME: in case of failure undef db-related includes etc.
3210 AC_CHECK_DECL(dbopen,,,[
3211 #if HAVE_SYS_TYPES_H
3212 #include <sys/types.h>
3213 #endif
3214 #if HAVE_LIMITS_H
3215 #include <limits.h>
3216 #endif
3217 #if HAVE_DB_185_H
3218 #include <db_185.h>
3219 #elif HAVE_DB_H
3220 #include <db.h>
3221 #endif])
3222
3223 dnl 1.85
3224 SQUID_CHECK_DBOPEN_NEEDS_LIBDB
3225 if test "x$ac_cv_dbopen_libdb" = "xyes"; then
3226 LIB_DB="-ldb"
3227 fi
3228 AC_SUBST(LIB_DB)
3229
3230 dnl System-specific library modifications
3231 dnl
3232 case "$host" in
3233 i386-*-solaris2.*)
3234 if test "x$GCC" = "xyes"; then
3235 AC_MSG_NOTICE([Removing -O for gcc on $host])
3236 CFLAGS="`echo $CFLAGS | sed -e 's/-O[[0-9g]]*//'`"
3237 fi
3238 ;;
3239
3240 *-sgi-irix*)
3241 AC_MSG_NOTICE([Removing -lsocket for IRIX...])
3242 LIBS=`echo $LIBS | sed -e s/-lsocket//`
3243 AC_MSG_NOTICE([Removing -lnsl for IRIX...])
3244 LIBS=`echo $LIBS | sed -e s/-lnsl//`
3245 ac_cv_lib_nsl_main=no
3246 AC_MSG_NOTICE([Removing -lbsd for IRIX...])
3247 LIBS=`echo $LIBS | sed -e s/-lbsd//`
3248 ;;
3249 dnl From: c0032033@ws.rz.tu-bs.de (Joerg Schumacher)
3250 dnl Date: Thu, 17 Oct 1996 04:09:30 +0200
3251 dnl Please change your configure script. AIX doesn't need -lbsd.
3252 *-ibm-aix*)
3253 AC_MSG_NOTICE([Removing -lbsd for AIX...])
3254 LIBS=`echo $LIBS | sed -e s/-lbsd//`
3255
3256 SQUID_CC_REQUIRE_ARGUMENT([ac_cv_require_rtti],[-rtti],[[
3257 #include <assert.h>
3258 #ifndef NULL
3259 #define NULL 0
3260 #endif
3261 class Foo{
3262 public:virtual ~Foo(){}
3263 };
3264 class Bar:public Foo{
3265 public:Bar():Foo(){}
3266 };
3267 ]],[[
3268 Foo * myFoo=new Bar();
3269 Bar * myBar=dynamic_cast<Bar *>(myFoo);
3270 assert(myBar != NULL);
3271 ]])
3272 if test "$ac_cv_require_rtti" = "yes"; then
3273 SQUID_CFLAGS="-rtti $SQUID_CFLAGS"
3274 SQUID_CXXFLAGS="-rtti $SQUID_CXXFLAGS"
3275 fi
3276
3277 AC_LANG_PUSH([C])
3278 SQUID_CC_REQUIRE_ARGUMENT([ac_cv_require_qcpluscmt],[-qcpluscmt],[[]],[[//c++ cmt]])
3279 AC_LANG_POP([C])
3280 if test "$ac_cv_require_qcpluscmt" = "yes"; then
3281 SQUID_CFLAGS="-qcpluscmt $SQUID_CFLAGS"
3282 fi
3283 ;;
3284
3285 *m88k*)
3286 SQUID_CFLAGS="$SQUID_CFLAGS -D_SQUID_MOTOROLA_"
3287 SQUID_CXXFLAGS="$SQUID_CXXFLAGS -D_SQUID_MOTOROLA_"
3288 AC_DEFINE(GETTIMEOFDAY_NO_TZP,1,
3289 [If gettimeofday is known to take only one argument])
3290 ;;
3291 [*-*-solaris2.[0-4]])
3292 AC_DEFINE(GETTIMEOFDAY_NO_TZP,1)
3293 ;;
3294 [*-sony-newsos[56]*])
3295 AC_DEFINE(GETTIMEOFDAY_NO_TZP,1)
3296 ;;
3297 esac
3298
3299 dnl This has to be before AC_CHECK_FUNCS
3300 # Disable poll() on certain platforms. Override by setting ac_cv_func_poll
3301 # when running configure.
3302 if test "x$ac_cv_func_poll" = "x" ; then
3303 case "$host" in
3304 [*-hp-hpux*.*])
3305 # Duane Wessels
3306 AC_MSG_NOTICE([disabling poll for $host...])
3307 ac_cv_func_poll='no'
3308 ;;
3309 [*-linux-*])
3310 # Henrik Nordstrom (hno@squid-cache.org) 19980817
3311 # poll is problematic on Linux. We disable it
3312 # by default until Linux gets it right.
3313 rev=`uname -r | awk -F. '{printf "%03d%03d",$1,$2}'`
3314 if test $rev -lt 002002; then
3315 AC_MSG_NOTICE([disabling poll for $host < 2.2...])
3316 ac_cv_func_poll='no'
3317 fi
3318 ;;
3319 [powerpc-ibm-aix4.1.*])
3320 # Mike Laster (mlaster@metavillage.com) 19981021
3321 AC_MSG_NOTICE([disabling poll for $host...])
3322 ac_cv_func_poll='no'
3323 ;;
3324 [*-pc-sco3.2*])
3325 # Robert Side <rside@aiinc.bc.ca>
3326 # Mon, 18 Jan 1999 17:48:00 GMT
3327 AC_MSG_NOTICE([disabling poll for $host...])
3328 ac_cv_func_poll='no'
3329 ;;
3330 esac
3331 fi
3332
3333 dnl Check for library functions
3334 AC_CHECK_FUNCS(\
3335 backtrace_symbols_fd \
3336 bcopy \
3337 eui64_aton \
3338 fchmod \
3339 getdtablesize \
3340 getpagesize \
3341 getpass \
3342 getrlimit \
3343 getrusage \
3344 getspnam \
3345 gettimeofday \
3346 glob \
3347 mallocblksize \
3348 mallopt \
3349 memcpy \
3350 memmove \
3351 memrchr \
3352 memset \
3353 mkstemp \
3354 mktime \
3355 mstats \
3356 poll \
3357 prctl \
3358 pthread_attr_setschedparam \
3359 pthread_attr_setscope \
3360 pthread_setschedparam \
3361 pthread_sigmask \
3362 putenv \
3363 regcomp \
3364 regexec \
3365 regfree \
3366 res_init \
3367 __res_init \
3368 rint \
3369 sched_getaffinity \
3370 sched_setaffinity \
3371 select \
3372 seteuid \
3373 setgroups \
3374 setpgrp \
3375 setsid \
3376 sigaction \
3377 snprintf \
3378 socketpair \
3379 sysconf \
3380 syslog \
3381 timegm \
3382 vsnprintf \
3383 )
3384 dnl ... and some we provide local replacements for
3385 AC_REPLACE_FUNCS(\
3386 initgroups \
3387 psignal \
3388 strerror \
3389 strtoll \
3390 tempnam \
3391 )
3392
3393 AC_CHECK_DECLS([getaddrinfo,getnameinfo,inet_ntop,inet_pton,InetNtopA,InetPtonA],,,[
3394 /*
3395 * BSD requires sys/types.h, sys/socket.h, netinet/in.h, netdb.h, arpa/inet.h
3396 * Linux requires sys/types.h, sys/socket.h, arpa/inet.h
3397 * Windows requires sys/socket.h, winsock2.h, ws2tcpip.h
3398 */
3399 #if HAVE_SYS_TYPES_H
3400 #include <sys/types.h>
3401 #endif
3402 #if HAVE_NETINET_IN_H
3403 #include <netinet/in.h>
3404 #endif
3405 #if HAVE_SYS_SOCKET_H
3406 #include <sys/socket.h>
3407 #endif
3408 #if HAVE_NETDB_H
3409 #include <netdb.h>
3410 #endif
3411 #if HAVE_ARPA_INET_H
3412 #include <arpa/inet.h>
3413 #endif
3414 #if HAVE_WINSOCK2_H
3415 #include <winsock2.h>
3416 #endif
3417 #if HAVE_WS2TCPIP_H
3418 #include <ws2tcpip.h>
3419 #endif
3420 ])
3421
3422 # Magic which checks whether we are forcing a type of comm loop we
3423 # are actually going to (ab)use.
3424 # Mostly ripped from squid-commloops, thanks to adrian and benno
3425
3426 if test "x$squid_opt_io_loop_engine" != "x"; then
3427 AC_MSG_NOTICE([choosing user-specified net I/O API $squid_opt_io_loop_engine])
3428 elif test "x$enable_epoll" != "xno" -a "x$squid_cv_epoll_works" = "xyes" ; then
3429 squid_opt_io_loop_engine="epoll"
3430 elif test "x$enable_kqueue" != "xno" ; then
3431 squid_opt_io_loop_engine="kqueue"
3432 elif test "x$enable_devpoll" != "xno" ; then
3433 squid_opt_io_loop_engine="devpoll"
3434 elif test "x$enable_poll" != "xno" -a "x$ac_cv_func_poll" = "xyes" ; then
3435 squid_opt_io_loop_engine="poll"
3436 elif test "x$enable_select" != "xno" -a "x$ac_cv_func_select" = "xyes"; then
3437 squid_opt_io_loop_engine="select"
3438 elif test "x$enable_select" != "xno" -a "x$squid_host_os" = "xmingw"; then
3439 squid_opt_io_loop_engine="select_win32"
3440 else
3441 AC_MSG_WARN([Eep! Cannot find epoll, kqueue, /dev/poll, poll or select!])
3442 AC_MSG_WARN([Will try select and hope for the best.])
3443 squid_opt_io_loop_engine="select"
3444 fi
3445
3446 AC_MSG_NOTICE([Using ${squid_opt_io_loop_engine} for the IO loop.])
3447
3448 AM_CONDITIONAL(ENABLE_POLL, test "x$squid_opt_io_loop_engine" = "xpoll")
3449 AM_CONDITIONAL(ENABLE_EPOLL, test "x$squid_opt_io_loop_engine" = "xepoll")
3450 AM_CONDITIONAL(ENABLE_SELECT, test "x$squid_opt_io_loop_engine" = "xselect")
3451 AM_CONDITIONAL(ENABLE_SELECT_WIN32, test "x$squid_opt_io_loop_engine" = "xselect_win32")
3452 AM_CONDITIONAL(ENABLE_KQUEUE, test "x$squid_opt_io_loop_engine" = "xkqueue")
3453 AM_CONDITIONAL(ENABLE_DEVPOLL, test "x$squid_opt_io_loop_engine" = "xdevpoll")
3454
3455 case $squid_opt_io_loop_engine in
3456 epoll) AC_DEFINE(USE_EPOLL,1,[Use epoll() for the IO loop]) ;;
3457 devpoll) AC_DEFINE(USE_DEVPOLL,1,[Use /dev/poll for the IO loop]) ;;
3458 poll) AC_DEFINE(USE_POLL,1,[Use poll() for the IO loop]) ;;
3459 kqueue) AC_DEFINE(USE_KQUEUE,1,[Use kqueue() for the IO loop]) ;;
3460 select_win32) AC_DEFINE(USE_SELECT_WIN32,1,[Use Winsock select() for the IO loop]) ;;
3461 select) AC_DEFINE(USE_SELECT,1,[Use select() for the IO loop]) ;;
3462 esac
3463
3464 if test "x$ac_cv_func_sched_getaffinity" = "xyes" -a "x$ac_cv_func_sched_setaffinity" = "xyes" ; then
3465 AC_DEFINE(HAVE_CPU_AFFINITY,1,[Support setting CPU affinity for workers])
3466 fi
3467
3468 SQUID_CHECK_SETRESUID_WORKS
3469 if test "x$squid_cv_resuid_works" = "xyes" ; then
3470 AC_DEFINE(HAVE_SETRESUID,1,[Yay! Another Linux brokenness. Knowing that setresuid() exists is not enough, because RedHat 5.0 declares setresuid() but does not implement it.])
3471 fi
3472
3473 AC_CHECK_HEADERS(mswsock.h)
3474 AC_MSG_CHECKING([for constant CMSG_SPACE])
3475 AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
3476 #if HAVE_SYS_SOCKET_H
3477 #include <sys/socket.h>
3478 #endif
3479 #if HAVE_MSWSOCK_H
3480 #include <mswsock.h>
3481 #endif
3482
3483 int a[CMSG_SPACE(int)];
3484 ]])], [
3485 AC_MSG_RESULT(yes)
3486 AC_DEFINE(HAVE_CONSTANT_CMSG_SPACE, 1, [Define to 1 if CMSG_SPACE is constant])
3487 ], [
3488 AC_MSG_RESULT(no)
3489 ])
3490
3491 AC_CHECK_TYPE(struct cmsghdr,AC_DEFINE(HAVE_CMSGHDR,1,[The system provides struct cmsghdr]),,[
3492 #if HAVE_SYS_SOCKET_H
3493 #include <sys/socket.h>
3494 #endif
3495 #if HAVE_MSWSOCK_H
3496 #include <mswsock.h>
3497 #endif
3498 #if HAVE_WINSOCK2_H
3499 #include <winsock2.h>
3500 #endif
3501 ])
3502
3503 AC_CHECK_TYPE(struct iovec,AC_DEFINE(HAVE_IOVEC,1,[The system provides struct iovec]),,[
3504 #if HAVE_SYS_SOCKET_H
3505 #include <sys/socket.h>
3506 #endif
3507 #if HAVE_WINSOCK2_H
3508 #include <winsock2.h>
3509 #endif
3510 #if HAVE_SYS_UIO_H
3511 #include <sys/uio.h>
3512 #endif
3513 ])
3514
3515 AC_CHECK_TYPE(struct msghdr,AC_DEFINE(HAVE_MSGHDR,1,[The system provides struct msghdr]),,[
3516 #if HAVE_SYS_SOCKET_H
3517 #include <sys/socket.h>
3518 #endif
3519 #if HAVE_MSWSOCK_H
3520 #include <mswsock.h>
3521 #endif
3522 #if HAVE_WINSOCK2_H
3523 #include <winsock2.h>
3524 #endif
3525 ])
3526
3527 AC_CHECK_TYPE(struct sockaddr_un,AC_DEFINE(HAVE_SOCKADDR_UN,1,[The system provides sockaddr_un]),,[
3528 #if HAVE_SYS_UN_H
3529 #include <sys/un.h>
3530 #endif
3531 #if HAVE_SYS_SOCKET_H
3532 #include <sys/socket.h>
3533 #endif
3534 #if HAVE_WINSOCK2_H
3535 #include <winsock2.h>
3536 #endif
3537 ])
3538
3539 SQUID_CHECK_FUNC_STRNSTR
3540 SQUID_CHECK_FUNC_VACOPY
3541 SQUID_CHECK_FUNC___VACOPY
3542
3543 dnl IP-Filter support requires ipf header files. These aren't
3544 dnl installed by default, so we need to check for them
3545 if test "x$enable_ipf_transparent" != "xno" ; then
3546 SQUID_CHECK_BROKEN_SOLARIS_IPFILTER
3547 AC_MSG_CHECKING(for availability of IP-Filter header files)
3548 # hold on to your hats...
3549 if test "x$ac_cv_header_ip_compat_h" = "xyes" -o \
3550 "x$ac_cv_header_ip_fil_compat_h" = "xyes" -o \
3551 "x$ac_cv_header_netinet_ip_compat_h" = "xyes" -o \
3552 "x$ac_cv_header_netinet_ip_fil_compat_h" = "xyes" ; then
3553 have_ipfilter_compat_header="yes"
3554 fi
3555 if test "x$have_ipfilter_compat_header" = "xyes" -a \
3556 "x$ac_cv_header_ip_fil_h" = "xyes" -a \
3557 "x$ac_cv_header_ip_nat_h" = "xyes" ; then
3558 enable_ipf_transparent="yes"
3559 elif test "x$have_ipfilter_compat_header" = "xyes" -a \
3560 "x$ac_cv_header_netinet_ip_fil_h" = "xyes" -a \
3561 "x$ac_cv_header_netinet_ip_nat_h" = "xyes" ; then
3562 enable_ipf_transparent="yes"
3563 else
3564 enable_ipf_transparent="no"
3565 fi
3566 AC_MSG_RESULT($IPF_TRANSPARENT)
3567
3568 ## On Solaris Ipfilter includes expect that SOLARIS2 is defined with the
3569 ## Solaris minor version (8, 9, 10, ...)
3570 if test "x$enable_ipf_transparent" = "xyes" -a "x$squid_host_os" = "xsolaris" ; then
3571 solrev=`uname -r | sh -c 'IFS=. read j n x; echo $n'`
3572 CFLAGS="-DSOLARIS2=$solrev $CFLAGS"
3573 CXXFLAGS="-DSOLARIS2=$solrev $CXXFLAGS"
3574 fi
3575
3576 fi
3577 AC_MSG_NOTICE([IPF-based transparent proxying enabled: $enable_ipf_transparent])
3578 SQUID_DEFINE_BOOL(IPF_TRANSPARENT,$enable_ipf_transparent,
3579 [Enable support for IPF-style transparent proxying])
3580
3581 dnl PF /dev/pf support requires a header file.
3582 if test "x$with_nat_devpf" != "xno" ; then
3583 if test "x$ac_cv_header_net_pfvar_h" = "xyes" -o \
3584 "x$ac_cv_header_net_pf_pfvar_h" = "xyes"; then
3585 if test "x$with_nat_devpf" = "xauto" ; then
3586 with_nat_devpf="no"
3587 fi
3588 else
3589 if test "x$with_nat_devpf" = "xyes" ; then
3590 AC_MSG_ERROR([PF /dev/pf based NAT requested but needed header not found])
3591 fi
3592 with_nat_devpf="no"
3593 fi
3594 fi
3595 SQUID_DEFINE_BOOL(PF_TRANSPARENT,${enable_pf_transparent:=no},
3596 [Enable support for PF-style transparent proxying])
3597 SQUID_DEFINE_BOOL(USE_NAT_DEVPF,${with_nat_devpf:=no},
3598 [Enable support for /dev/pf NAT lookups])
3599
3600 if test "x$enable_linux_netfilter" != "xno" ; then
3601 if test "x$ac_cv_header_linux_netfilter_ipv4_h" = "xyes"; then
3602 if test "x$enable_linux_netfilter" = "xauto" ; then
3603 enable_linux_netfilter=yes
3604 fi
3605 else
3606 if test "x$enable_linux_netfilter" = "xauto" ; then
3607 enable_linux_netfilter=no
3608 else
3609 AC_MSG_ERROR([Linux Netfilter support requested but needed headers not found])
3610 fi
3611 fi
3612 fi
3613 SQUID_DEFINE_BOOL(LINUX_NETFILTER,$enable_linux_netfilter,
3614 [Enable support for Transparent Proxy on Linux via Netfilter])
3615
3616 dnl Netfilter TPROXY depends on libcap but the NAT parts can still work.
3617 AC_MSG_NOTICE([Support for Netfilter-based interception proxy requested: $enable_linux_netfilter])
3618 if test "x$enable_linux_netfilter" = "xyes" -a "x$with_libcap" != "xyes" ; then
3619 AC_MSG_WARN([Missing needed capabilities (libcap 2.09+) for TPROXY])
3620 AC_MSG_WARN([Linux Transparent Proxy (version 4+) support WILL NOT be enabled])
3621 AC_MSG_WARN([Reduced support to NAT Interception Proxy])
3622 # AC_DEFINEd later
3623 fi
3624
3625 if test "x$squid_opt_netfilterconntrack" = "xyes" -a "x$with_libcap" != "xyes" ; then
3626 AC_MSG_ERROR([Linux netfilter conntrack requires libcap support (libcap 2.09+)])
3627 fi
3628 if test "x$with_netfilter_conntrack" = "xyes" -a "x$with_libcap" != "xyes" ; then
3629 AC_MSG_WARN([Missing needed capabilities (libcap 2.09+) for netfilter mark support])
3630 AC_MSG_WARN([Linux netfilter marking support WILL NOT be enabled])
3631 with_netfilter_conntrack=no
3632 fi
3633 AC_MSG_NOTICE([Linux Netfilter Conntrack support enabled: ${with_netfilter_conntrack} ${squid_opt_netfilterconntrackpath}])
3634
3635
3636 AC_ARG_ENABLE(zph-qos,
3637 AS_HELP_STRING([--enable-zph-qos],[Enable ZPH QOS support]), [
3638 SQUID_YESNO([$enableval],
3639 [unrecognized argument to --enable-zph-qos: $enableval])
3640 ])
3641 SQUID_DEFINE_BOOL(USE_QOS_TOS,${enable_zph_qos:=yes},
3642 [Enable Zero Penalty Hit QOS. When set, Squid will alter the
3643 TOS field of HIT responses to help policing network traffic])
3644 AC_MSG_NOTICE([ZPH QOS enabled: $enable_zph_qos])
3645 if test x"$enable_zph_qos" = "xyes" ; then
3646 AC_MSG_NOTICE([QOS netfilter mark preservation enabled: $with_netfilter_conntrack])
3647 SQUID_DEFINE_BOOL(USE_LIBNETFILTERCONNTRACK,${with_netfilter_conntrack:=no},
3648 [Enable support for QOS netfilter mark preservation])
3649 fi
3650
3651
3652 AC_CHECK_LIB(regex, regexec, [REGEXLIB="-lregex"],[REGEXLIB=''])
3653 AC_ARG_ENABLE(gnuregex,
3654 AS_HELP_STRING([--enable-gnuregex],
3655 [Compile GNUregex. Unless you have reason to use
3656 this option, you should not enable it.
3657 This library file is usually only required on Windows and
3658 very old Unix boxes which do not have their own regex
3659 library built in.]), [
3660 SQUID_YESNO([$enableval],[unrecognized argument to --enable-gnuregex: $enableval])
3661 ])
3662 # force-enable on old solaris and nextstep
3663 if test "x${enable_gnuregex:=auto}" = "xauto" ; then
3664 case "$host" in
3665 *-sun-solaris2.[[0-4]])
3666 enable_gnuregex="yes"
3667 ;;
3668 *-next-nextstep*)
3669 enable_gnuregex="yes"
3670 ;;
3671 esac
3672 fi
3673
3674 # try detecting if it is needed
3675 if test "x$enable_gnuregex" = "xauto" ; then
3676 SQUID_CHECK_REGEX_WORKS
3677 if test "x$squid_cv_regex_works" = "xyes" ; then
3678 enable_gnuregex=no
3679 else
3680 enable_gnuregex=yes
3681 fi
3682 fi
3683 AC_MSG_CHECKING(if GNUregex needs to be compiled)
3684 AC_MSG_RESULT($enable_gnuregex)
3685 if test "x$enable_gnuregex" = "xyes"; then
3686 # for some reason (force-enable, test..) gnuregex was found as needed. Override any system lib
3687 REGEXLIB=""
3688 fi
3689 #if no reason was found to enable gnuregex, disable it
3690 if test "x$enable_gnuregex" = "xauto" ; then
3691 enable_gnuregex=no
3692 fi
3693 SQUID_DEFINE_BOOL(USE_GNUREGEX,$enable_gnuregex,[Define if we should use GNU regex])
3694 AC_SUBST(REGEXLIB)
3695
3696 SQUID_DETECT_UDP_SND_BUFSIZE
3697 SQUID_DETECT_UDP_RECV_BUFSIZE
3698 SQUID_DETECT_TCP_SND_BUFSIZE
3699 SQUID_DETECT_TCP_RECV_BUFSIZE
3700
3701 SQUID_CHECK_RECV_ARG_TYPE
3702 SQUID_CHECK_NEED_SYS_ERRLIST
3703 SQUID_CHECK_MAXPATHLEN
3704
3705 SQUID_CHECK_LIBRESOLV_DNS_TTL_HACK
3706 SQUID_CHECK_RESOLVER_FIELDS
3707
3708 AC_CHECK_HEADERS(sys/statvfs.h)
3709 if test "x$ac_cv_header_sys_statvfs_h" = "xyes" ; then
3710 SQUID_CHECK_WORKING_STATVFS
3711 fi
3712 if test "x$ac_cv_func_statvfs" != "xyes" ; then
3713 AC_CHECK_HEADERS(sys/param.h sys/mount.h sys/vfs.h sys/statfs.h)
3714 AC_CHECK_FUNCS(statfs)
3715 SQUID_CHECK_F_FRSIZE_IN_STATFS
3716 fi
3717
3718 dnl Squid will not usually attempt to translate templates when building
3719 AC_ARG_ENABLE(translation,
3720 AS_HELP_STRING([--enable-translation],[Generate the localized error page templates and manuals.
3721 Which can also be downloaded from http://www.squid-cache.org/Versions/langpack/.]), [
3722 SQUID_YESNO([$enableval],
3723 [unrecognized argument to --enable-translation: $enableval])
3724 ])
3725 if test "x${enable_translation:=no}" = "xyes" ; then
3726 AX_WITH_PROG([PO2HTML],[po2html])
3727 AX_WITH_PROG([PO2TEXT],[po2txt])
3728 else
3729 PO2HTML="off"
3730 PO2TEXT="off"
3731 fi
3732 AC_SUBST(PO2HTML)
3733 AC_SUBST(PO2TEXT)
3734
3735 dnl Squid now has limited locale handling ...
3736 dnl on error pages
3737 AC_ARG_ENABLE(auto-locale,
3738 AS_HELP_STRING([--disable-auto-locale],[This prevents Squid providing localized error pages based on the
3739 clients request headers.
3740 When disabled Squid requires explicit language configuration.]), [
3741 SQUID_YESNO([$enableval],
3742 [unrecognized argument to --disable-auto-locale: $enableval])
3743 ])
3744 AC_MSG_NOTICE([Multi-Language support enabled: ${enable_auto_locale:=yes}])
3745 SQUID_DEFINE_BOOL(USE_ERR_LOCALES,$enable_auto_locale,
3746 [Use multi-language support on error pages])
3747
3748
3749 dnl Need the debugging version of malloc if available
3750 XTRA_OBJS=''
3751 if test "x$ac_cv_lib_malloc_main" = "xyes" ; then
3752 if test -r /usr/lib/debug/malloc.o ; then
3753 XTRA_OBJS="$XTRA_OBJS /usr/lib/debug/malloc.o"
3754 fi
3755 if test -r /usr/lib/debug/mallocmap.o ; then
3756 XTRA_OBJS="$XTRA_OBJS /usr/lib/debug/mallocmap.o"
3757 fi
3758 fi
3759 AC_SUBST(XTRA_OBJS)
3760
3761 if test "x$XTRA_LIBS" = "x"; then
3762 XTRA_LIBS="$LIBS"
3763 dnl minor cleanup
3764 XTRA_LIBS=`echo $XTRA_LIBS | sed -e "s/ */ /g"`
3765 LIBS=''
3766 fi
3767 AC_SUBST(XTRA_LIBS)
3768
3769 AC_SUBST(SQUID_CFLAGS)
3770 AC_SUBST(SQUID_CXXFLAGS)
3771
3772 AC_ARG_VAR([BUILDCXXFLAGS],[C++ compiler flags for building compile-time tools. e.g. cf_gen])
3773 if test "x$BUILDCXXFLAGS" = "x"; then
3774 # if we are NOT cross-compiling, use the default build flags for cf_gen and friends
3775 # otherwise rely on the user-provided value
3776 if test "x$squid_cv_check_marchnative" = "xyes"; then
3777 # always valid for the Build compiler.
3778 BUILDCXXFLAGS="-march=native"
3779 fi
3780 BUILDCXXFLAGS="$BUILDCXXFLAGS $CXXFLAGS"
3781 fi
3782 AC_SUBST(BUILDCXXFLAGS)
3783
3784 AC_MSG_NOTICE([BUILD LIBRARIES: $LIBS])
3785 AC_MSG_NOTICE([BUILD EXTRA LIBRARIES: $XTRA_LIBS])
3786 AC_MSG_NOTICE([BUILD OBJECTS: $OBJS])
3787 AC_MSG_NOTICE([BUILD EXTRA OBJECTS: $XTRA_OBJS])
3788 AC_MSG_NOTICE([BUILD C FLAGS: $CFLAGS])
3789 AC_MSG_NOTICE([BUILD EXTRA C FLAGS: $SQUID_CFLAGS])
3790 AC_MSG_NOTICE([BUILD C++ FLAGS: $CXXFLAGS])
3791 AC_MSG_NOTICE([BUILD EXTRA C++ FLAGS: $SQUID_CXXFLAGS])
3792 AC_MSG_NOTICE([BUILD Tools C++ FLAGS: $BUILDCXXFLAGS])
3793
3794 dnl Clean up after OSF/1 core dump bug
3795 rm -f core
3796
3797 AC_CONFIG_FILES([
3798 Makefile
3799 compat/Makefile
3800 contrib/Makefile
3801 doc/Makefile
3802 doc/manuals/Makefile
3803 doc/release-notes/Makefile
3804 errors/Makefile
3805 icons/Makefile
3806 lib/Makefile
3807 lib/libTrie/Makefile
3808 lib/libTrie/test/Makefile
3809 lib/ntlmauth/Makefile
3810 lib/profiler/Makefile
3811 lib/rfcnb/Makefile
3812 lib/smblib/Makefile
3813 lib/snmplib/Makefile
3814 scripts/Makefile
3815 src/Makefile
3816 src/acl/Makefile
3817 src/acl/external/Makefile
3818 src/acl/external/AD_group/Makefile
3819 src/acl/external/delayer/Makefile
3820 src/acl/external/eDirectory_userip/Makefile
3821 src/acl/external/file_userip/Makefile
3822 src/acl/external/kerberos_ldap_group/Makefile
3823 src/acl/external/LDAP_group/Makefile
3824 src/acl/external/LM_group/Makefile
3825 src/acl/external/session/Makefile
3826 src/acl/external/SQL_session/Makefile
3827 src/acl/external/unix_group/Makefile
3828 src/acl/external/wbinfo_group/Makefile
3829 src/acl/external/time_quota/Makefile
3830 src/adaptation/Makefile
3831 src/adaptation/icap/Makefile
3832 src/adaptation/ecap/Makefile
3833 src/anyp/Makefile
3834 src/auth/Makefile
3835 src/auth/basic/Makefile
3836 src/auth/basic/DB/Makefile
3837 src/auth/basic/fake/Makefile
3838 src/auth/basic/getpwnam/Makefile
3839 src/auth/basic/LDAP/Makefile
3840 src/auth/basic/NCSA/Makefile
3841 src/auth/basic/NIS/Makefile
3842 src/auth/basic/PAM/Makefile
3843 src/auth/basic/POP3/Makefile
3844 src/auth/basic/RADIUS/Makefile
3845 src/auth/basic/SASL/Makefile
3846 src/auth/basic/SMB/Makefile
3847 src/auth/basic/SMB_LM/Makefile
3848 src/auth/basic/SSPI/Makefile
3849 src/auth/digest/Makefile
3850 src/auth/digest/eDirectory/Makefile
3851 src/auth/digest/file/Makefile
3852 src/auth/digest/LDAP/Makefile
3853 src/auth/negotiate/Makefile
3854 src/auth/negotiate/kerberos/Makefile
3855 src/auth/negotiate/SSPI/Makefile
3856 src/auth/negotiate/wrapper/Makefile
3857 src/auth/ntlm/Makefile
3858 src/auth/ntlm/fake/Makefile
3859 src/auth/ntlm/SMB_LM/Makefile
3860 src/auth/ntlm/SSPI/Makefile
3861 src/base/Makefile
3862 src/clients/Makefile
3863 src/comm/Makefile
3864 src/dns/Makefile
3865 src/DiskIO/Makefile
3866 src/DiskIO/AIO/Makefile
3867 src/DiskIO/Blocking/Makefile
3868 src/DiskIO/DiskDaemon/Makefile
3869 src/DiskIO/DiskThreads/Makefile
3870 src/DiskIO/IpcIo/Makefile
3871 src/DiskIO/Mmapped/Makefile
3872 src/esi/Makefile
3873 src/eui/Makefile
3874 src/format/Makefile
3875 src/fs/Makefile
3876 src/ftp/Makefile
3877 src/helper/Makefile
3878 src/http/Makefile
3879 src/http/one/Makefile
3880 src/http/url_rewriters/Makefile
3881 src/http/url_rewriters/fake/Makefile
3882 src/http/url_rewriters/LFS/Makefile
3883 src/icmp/Makefile
3884 src/ident/Makefile
3885 src/ip/Makefile
3886 src/ipc/Makefile
3887 src/log/Makefile
3888 src/log/DB/Makefile
3889 src/log/file/Makefile
3890 src/mem/Makefile
3891 src/mgr/Makefile
3892 src/parser/Makefile
3893 src/repl/Makefile
3894 src/sbuf/Makefile
3895 src/security/Makefile
3896 src/security/cert_generators/Makefile
3897 src/security/cert_generators/file/Makefile
3898 src/security/cert_validators/Makefile
3899 src/security/cert_validators/fake/Makefile
3900 src/servers/Makefile
3901 src/snmp/Makefile
3902 src/ssl/Makefile
3903 src/store/Makefile
3904 src/store/id_rewriters/Makefile
3905 src/store/id_rewriters/file/Makefile
3906 test-suite/Makefile
3907 tools/Makefile
3908 tools/helper-mux/Makefile
3909 tools/purge/Makefile
3910 tools/squidclient/Makefile
3911 tools/systemd/Makefile
3912 tools/sysvinit/Makefile
3913 ])
3914
3915 # must configure libltdl subdir unconditionally for "make distcheck" to work
3916 #AC_CONFIG_SUBDIRS(libltdl)
3917
3918 AC_OUTPUT