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