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