]>
Commit | Line | Data |
---|---|---|
b8ae064d | 1 | ## Copyright (C) 1996-2023 The Squid Software Foundation and contributors |
5d2e6f19 AJ |
2 | ## |
3 | ## Squid software is distributed under GPLv2+ license and includes | |
4 | ## contributions from numerous individuals and organizations. | |
5 | ## Please see the COPYING and CONTRIBUTORS files for details. | |
6 | ## | |
7 | ||
8de6aae8 | 8 | AC_INIT([Squid Web Proxy],[6.8-VCS],[https://bugs.squid-cache.org/],[squid]) |
d966027f | 9 | AC_PREREQ(2.61) |
62979ab1 | 10 | AC_CONFIG_HEADERS([include/autoconf.h]) |
71b12d7c | 11 | AC_CONFIG_AUX_DIR(cfgaux) |
8d9ce05e | 12 | AC_CONFIG_SRCDIR([src/main.cc]) |
3dc6f003 | 13 | AM_INIT_AUTOMAKE([tar-ustar nostdinc subdir-objects dist-xz]) |
c2720d44 | 14 | AC_REVISION($Revision$)dnl |
a2794549 | 15 | AC_PREFIX_DEFAULT(/usr/local/squid) |
246d7ffc | 16 | AM_MAINTAINER_MODE |
a2794549 | 17 | |
5d2e6f19 | 18 | m4_include([acinclude/ax_with_prog.m4]) |
4ecf021b | 19 | m4_include([acinclude/init.m4]) |
fa522425 | 20 | m4_include([acinclude/squid-util.m4]) |
6a56798f | 21 | m4_include([acinclude/compiler-flags.m4]) |
0abb39dd | 22 | m4_include([acinclude/os-deps.m4]) |
c8093f05 | 23 | m4_include([acinclude/krb5.m4]) |
0d57ed2e | 24 | m4_include([acinclude/ldap.m4]) |
b12b66cd | 25 | m4_include([acinclude/nettle.m4]) |
3c586e38 | 26 | m4_include([acinclude/pam.m4]) |
2b448046 | 27 | m4_include([acinclude/pkg.m4]) |
acd207af | 28 | m4_include([acinclude/tdb.m4]) |
91983da0 | 29 | m4_include([acinclude/lib-checks.m4]) |
09835feb | 30 | m4_include([acinclude/ax_cxx_compile_stdcxx.m4]) |
6a56798f | 31 | |
63e02610 | 32 | PRESET_CFLAGS="$CFLAGS" |
a203dec7 | 33 | PRESET_CXXFLAGS="$CXXFLAGS" |
63e02610 | 34 | PRESET_LDFLAGS="$LDFLAGS" |
35 | ||
a2794549 | 36 | dnl Set default LDFLAGS |
a1c22363 | 37 | AS_IF([test "x$LDFLAGS" = "x"],[LDFLAGS="-g"]) |
a2794549 | 38 | |
0c4134e1 AJ |
39 | # check for host OS detail |
40 | AC_CANONICAL_HOST | |
41 | AC_MSG_CHECKING([simplified host os]) | |
42 | simple_host_os=`echo $host_os|sed 's/[0-9].*//g;s/-.*//g'` | |
43 | squid_host_os_version=`echo $host_os|tr -d "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-"` | |
44 | AS_IF([test -n "$squid_host_os_version"],[ | |
45 | squid_host_os="`echo $simple_host_os| sed s/$squid_host_os_version//g`" | |
46 | ],[ | |
47 | squid_host_os="$simple_host_os" | |
48 | ]) | |
49 | AC_MSG_RESULT($squid_host_os (version $squid_host_os_version)) | |
50 | # on windows squid_host_os is either mingw or cygwin, version is 32 | |
51 | ||
a2794549 | 52 | AC_PROG_CC |
e6c4cdd6 | 53 | AM_PROG_CC_C_O |
29b8d8d6 | 54 | AC_PROG_CXX |
0c4134e1 AJ |
55 | |
56 | # AC_USE_SYSTEM_EXTENSIONS should be called before any macros that run the C compiler. | |
5139f0f6 | 57 | AC_USE_SYSTEM_EXTENSIONS |
0c4134e1 | 58 | |
62979ab1 | 59 | AC_LANG([C++]) |
3e7b6055 | 60 | |
c8640c9a AJ |
61 | # Clang 3.2 on some CPUs requires -march-native to detect correctly. |
62 | # GCC 4.3+ can also produce faster executables when its used. | |
63 | # But building inside a virtual machine environment has been found to | |
64 | # cause random Illegal Instruction errors due to mis-detection of CPU. | |
65 | AC_ARG_ENABLE(arch-native, | |
66 | AS_HELP_STRING([--disable-arch-native],[Some compilers offer CPU-specific | |
67 | optimizations with the -march=native parameter. | |
68 | This flag disables the optimization. The default is to | |
69 | auto-detect compiler support and use where available.]), [ | |
ec308e40 | 70 | SQUID_YESNO([$enableval],[--enable-arch-native]) |
c8640c9a | 71 | ]) |
d8a4ba7c | 72 | AC_MSG_NOTICE([CPU arch native optimization enabled: ${enable_arch_native:=auto}]) |
a1c22363 | 73 | AS_IF([test "x${enable_arch_native}" != "xno"],[ |
c8640c9a | 74 | SQUID_CC_CHECK_ARGUMENT([squid_cv_check_marchnative],[-march=native]) |
a1c22363 | 75 | ]) |
e9d3951b | 76 | |
09835feb AR |
77 | # If the user did not specify a C++ version. |
78 | user_cxx=`echo "$PRESET_CXXFLAGS" | grep -o -E "(-)std="` | |
79 | AS_IF([test "x$user_cxx" = "x"],[ | |
80 | # Check for C++17 compiler support | |
81 | # May change CXX. | |
82 | AX_CXX_COMPILE_STDCXX([17],[noext],[mandatory]) | |
83 | ]) | |
84 | ||
85 | # Prerequisite: CXX has been finalized. | |
86 | # BUILDCXXFLAGS are defined later, after CXXFLAGS have been finalized. | |
b2f0a375 | 87 | AC_ARG_VAR([BUILDCXX],[path to compiler for building compile-time tools. e.g. cf_gen]) |
a1c22363 AJ |
88 | AS_IF([test "x$HOSTCXX" != "x" -a "x$BUILDCXX" = "x"],[ |
89 | AC_MSG_WARN([Cross-compiling with HOSTCXX is deprecated. Use BUILDCXX instead.]) | |
b2f0a375 | 90 | BUILDCXX="$HOSTCXX" |
a1c22363 AJ |
91 | ]) |
92 | AS_IF([test "x$BUILDCXX" = "x"],[ | |
b2f0a375 | 93 | BUILDCXX="$CXX" |
a1c22363 | 94 | AS_IF([test "x$squid_cv_check_marchnative" = "xyes"],[ |
e9d3951b | 95 | CXXFLAGS="$CXXFLAGS -march=native" |
a1c22363 AJ |
96 | ]) |
97 | ]) | |
b2f0a375 | 98 | AC_SUBST(BUILDCXX) |
de051d9d | 99 | |
aff48cc8 | 100 | # test for programs |
aff48cc8 FC |
101 | AC_PROG_RANLIB |
102 | AC_PROG_CPP | |
103 | AC_PROG_INSTALL | |
104 | AC_PROG_LN_S | |
105 | AC_PROG_EGREP | |
106 | ||
107 | AC_PATH_PROG(SH, sh, /bin/sh) | |
108 | AC_PATH_PROG(FALSE, false, /usr/bin/false) | |
109 | AC_PATH_PROG(TRUE, true, /usr/bin/true) | |
110 | AC_PATH_PROG(MV, mv, $FALSE) | |
111 | AC_PATH_PROG(MKDIR, mkdir, $FALSE) | |
112 | AC_PATH_PROG(LN, ln, cp) | |
113 | AC_PATH_PROG(CHMOD, chmod, $FALSE) | |
6d1c1ab1 | 114 | AC_PATH_PROG(TR, tr, $FALSE) |
aff48cc8 FC |
115 | AC_PATH_PROG(RM, rm, $FALSE) |
116 | dnl Libtool 2.2.6 requires: rm -f | |
117 | RM="$RM -f" | |
118 | ||
d93bf055 AJ |
119 | PKG_PROG_PKG_CONFIG |
120 | ||
aff48cc8 | 121 | AC_PATH_PROG(PERL, perl, none) |
a1c22363 | 122 | AS_IF([test "x$ac_cv_path_PERL" = "xnone"],[ |
aff48cc8 | 123 | AC_MSG_FAILURE([Perl is required to compile Squid. Please install Perl and then re-run configure ]) |
a1c22363 | 124 | ]) |
07f370ee | 125 | AC_PATH_PROG(POD2MAN, pod2man, $FALSE) |
33d1abfe | 126 | AM_CONDITIONAL(ENABLE_POD2MAN_DOC, test "x${ac_cv_path_POD2MAN}" != "x$FALSE") |
aff48cc8 | 127 | |
a1c22363 | 128 | AC_PATH_PROG(AR, ar, $FALSE) |
aff48cc8 | 129 | AR_R="$AR r" |
aff48cc8 FC |
130 | AC_SUBST(AR_R) |
131 | ||
86b8d400 AJ |
132 | AC_PATH_PROG(LINUXDOC, linuxdoc, $FALSE) |
133 | AM_CONDITIONAL(ENABLE_RELEASE_DOCS, test "x${ac_cv_path_LINUXDOC}" != "x$FALSE") | |
134 | ||
552d1774 AJ |
135 | SQUID_RELEASE=`echo $VERSION | cut -d. -f1` |
136 | AC_SUBST(SQUID_RELEASE) | |
137 | ||
cda5e747 | 138 | # pre-define DEFAULT_PREFIX, some modules need it. |
a1c22363 | 139 | AS_IF([test "${prefix}" = "NONE"],[squid_prefix=$ac_default_prefix],[squid_prefix=$prefix]) |
cda5e747 AJ |
140 | AC_DEFINE_UNQUOTED(DEFAULT_PREFIX,[$squid_prefix],[The install prefix]) |
141 | ||
0b45d157 FC |
142 | AC_ARG_ENABLE(strict-error-checking, |
143 | AS_HELP_STRING([--disable-strict-error-checking],[By default squid is compiled | |
2d65bb9a | 144 | with all possible static compiler error-checks enabled. |
cdb352bb | 145 | This flag disables the behavior]), [ |
ec308e40 | 146 | SQUID_YESNO([$enableval],[--enable-strict-error-checking]) |
0b45d157 | 147 | ]) |
cdb352bb | 148 | AC_MSG_NOTICE([strict error checking enabled: ${enable_strict_error_checking:=yes}]) |
d1f95b42 | 149 | |
4313559d | 150 | # LT_INIT requires libtool v2, might as well state it loud |
2663a9c8 | 151 | LT_PREREQ([2.2]) |
5a2409b7 | 152 | LT_INIT([dlopen]) |
a1c22363 AJ |
153 | AS_IF([test "x$ac_top_build_prefix" != "x"],[ |
154 | # LTDL v3-v7 macros assume the autoconf 2.62 variable top_build_prefix is defined | |
155 | # But from autoconf 2.64 its called ac_top_build_prefix and not automatically added to the Makefile | |
156 | # This fixes Linux LTDLv3-v7, and BSD LTDL v2.2 | |
157 | top_build_prefix=${ac_top_build_prefix} | |
158 | AC_SUBST(top_build_prefix) | |
159 | ]) | |
bd9303f5 | 160 | LTDL_INIT |
081863f3 | 161 | |
d9a41469 | 162 | dnl LibTool environment is now prepared for setup. Check that it is usable and initialize. |
081863f3 | 163 | LT_LIB_DLLOAD |
3e7b6055 AR |
164 | |
165 | # Do we need these unconditionally for "make distcheck" to work? | |
166 | AC_SUBST(INCLTDL) | |
167 | AC_SUBST(LIBLTDL) | |
168 | ||
5a2409b7 AJ |
169 | AC_MSG_CHECKING(whether to use loadable modules) |
170 | AS_IF([test "x${enable_shared:=yes}" = "xyes"],[AC_DEFINE(USE_LOADABLE_MODULES,1,[Support Loadable Modules])]) | |
171 | AM_CONDITIONAL(ENABLE_LOADABLE_MODULES, test "x${enable_shared:=yes}" = "xyes") | |
172 | AC_MSG_RESULT([$enable_shared]) | |
173 | ||
07f370ee | 174 | SQUID_CC_GUESS_VARIANT |
fa6307ae | 175 | SQUID_CC_GUESS_OPTIONS |
f9d138eb | 176 | |
be0c7ff0 FC |
177 | dnl find out the exe extension for this platform. |
178 | dnl If it is not empty, use it for CGI as well. | |
a2794549 | 179 | AC_EXEEXT |
180 | AC_OBJEXT | |
a1c22363 | 181 | AS_IF([test "x$EXEEXT" = "x"],[CGIEXT=".cgi"],[CGIEXT=""]) |
7aeb8001 | 182 | AC_SUBST(CGIEXT) |
a2794549 | 183 | |
a396d1f8 | 184 | AM_CONDITIONAL(ENABLE_WIN32SPECIFIC,[test "x$squid_host_os" = "xmingw"]) |
daf2ddfa | 185 | AM_CONDITIONAL(ENABLE_WIN32_IPC,[test "x$squid_host_os" = "xmingw"]) |
fcabe077 | 186 | |
a1c22363 AJ |
187 | AS_CASE(["$squid_host_os"], |
188 | [mingw],[ | |
189 | AC_PATH_PROG(WIN32_PSAPI, psapi.dll, none) | |
190 | CFLAGS="$CFLAGS -mthreads" | |
191 | CXXFLAGS="$CXXFLAGS -mthreads -static-libgcc -static-libstdc++" | |
192 | AS_IF([test "x$ac_cv_path_WIN32_PSAPI" = "xnone"],[ | |
193 | AC_MSG_NOTICE([PSAPI.DLL is recommended to run Squid on Windows NT Platform]) | |
194 | AC_MSG_NOTICE([Please see PSAPI.DLL section on doc/win32-relnotes.html.]) | |
195 | ],[ | |
196 | AC_DEFINE(HAVE_WIN32_PSAPI,1,[Define if you have PSAPI.DLL on Windows systems]) | |
197 | LIBS="$LIBS -lpsapi" | |
198 | ]) | |
199 | MINGW_LIBS="-lmingwex" | |
200 | AC_SUBST(MINGW_LIBS) | |
201 | ], | |
202 | ||
203 | [freebsd],[ | |
b5467222 CT |
204 | # FreeBSD places local libraries and packages in /usr/local |
205 | CFLAGS="$CFLAGS -I/usr/local/include" | |
206 | CXXFLAGS="$CXXFLAGS -I/usr/local/include" | |
207 | LDFLAGS="$LDFLAGS -L/usr/local/lib -Wl,-R/usr/local/lib" | |
a1c22363 AJ |
208 | ] |
209 | ) | |
4b26fae9 | 210 | |
f4aaf39c | 211 | dnl Substitutions |
6a9f6389 | 212 | AC_DEFINE_UNQUOTED(CONFIG_HOST_TYPE, "$host",[Host type from configure]) |
30a4f2a8 | 213 | |
9603207d | 214 | AC_DEFINE_UNQUOTED(SQUID_CONFIGURE_OPTIONS, "$ac_configure_args", |
8075a4da | 215 | [configure command line used to configure Squid]) |
090089c4 | 216 | |
5483d916 | 217 | CACHE_EFFECTIVE_USER="nobody" |
218 | AC_ARG_WITH(default-user, | |
62979ab1 | 219 | AS_HELP_STRING([--with-default-user=USER],[System user account for squid permissions. Default: nobody]), |
5483d916 | 220 | [ CACHE_EFFECTIVE_USER="$withval" ] |
221 | ) | |
222 | AC_SUBST(CACHE_EFFECTIVE_USER) | |
223 | ||
c8d2dc9b AJ |
224 | DEFAULT_LOG_DIR="$localstatedir/logs" |
225 | AC_ARG_WITH(logdir, | |
73862432 | 226 | AS_HELP_STRING([--with-logdir=PATH], |
a1c22363 AJ |
227 | [Default location for squid logs. default: PREFIX/var/logs]),[ |
228 | AS_CASE([$withval], | |
229 | [yes|no],[AC_MSG_ERROR([--with-logdir requires a directory PATH. --with-logdir=PATH])], | |
230 | [DEFAULT_LOG_DIR="$withval"] | |
231 | ) | |
232 | ]) | |
c8d2dc9b AJ |
233 | AC_SUBST(DEFAULT_LOG_DIR) |
234 | ||
2f36643c | 235 | DEFAULT_PID_FILE="$localstatedir/run/@SERVICE_NAME@.pid" |
a7f6af35 | 236 | AC_ARG_WITH(pidfile, |
e0eb5853 | 237 | AS_HELP_STRING([--with-pidfile=PATH], |
a1c22363 AJ |
238 | [Default location for squid pid file. Default: PREFIX/var/run/squid.pid]),[ |
239 | AS_CASE([$withval], | |
240 | [yes|no],[AC_MSG_ERROR([--with-pidfile requires a file PATH. --with-pidfile=PATH])], | |
241 | [DEFAULT_PID_FILE="$withval"] | |
242 | ) | |
e0eb5853 | 243 | ]) |
32f07882 | 244 | AC_SUBST(DEFAULT_PID_FILE) |
a7f6af35 | 245 | |
bf52b026 AJ |
246 | DEFAULT_SWAP_DIR="$localstatedir/cache/squid" |
247 | AC_ARG_WITH(swapdir, | |
248 | AS_HELP_STRING([--with-swapdir=PATH], | |
a1c22363 AJ |
249 | [Default location for squid cache directories. Default: PREFIX/var/cache/squid]),[ |
250 | AS_CASE([$withval], | |
251 | [yes|no],[AC_MSG_ERROR([--with-swapdir requires a directory PATH. --with-swapdir=PATH])], | |
252 | [DEFAULT_SWAP_DIR="$withval"] | |
253 | ) | |
bf52b026 AJ |
254 | ]) |
255 | AC_SUBST(DEFAULT_SWAP_DIR) | |
256 | ||
30a4f2a8 | 257 | dnl Set Default CFLAGS |
a1c22363 AJ |
258 | AS_IF([test "x$PRESET_CFLAGS" = "x"],[ |
259 | AS_IF([test "$squid_cv_compiler" = "gcc"],[ | |
260 | # TODO check if these exceptions are still necessary | |
261 | AS_CASE(["$host"], | |
262 | [*-sun-sunos*],[ | |
263 | # sunos has too many warnings for -Wall to be useful | |
264 | ], | |
265 | [CFLAGS="$squid_cv_cc_option_wall $CFLAGS"] | |
266 | ) | |
267 | ],[ | |
268 | AS_CASE(["$host"], | |
269 | [*mips-sgi-irix6.*],[ | |
fcabe077 FC |
270 | # suggested by Rafael Seidl <rafaels@cthulhu.engr.sgi.com> |
271 | CFLAGS="$squid_cv_cc_option_optimize -OPT:Olimit=0:space=OFF \ | |
272 | -woff 1009,1014,1110,1116,1183,1185,1188,1204,1230,1233,1355 \ | |
273 | -Wl,-woff,85,-woff,84,-woff,134 \ | |
274 | -nostdinc -I/usr/include -D_BSD_SIGNALS $CFLAGS" | |
275 | CXXFLAGS="$squid_cv_cc_option_optimize -OPT:Olimit=0:space=OFF \ | |
276 | -woff 1009,1014,1110,1116,1183,1185,1188,1204,1230,1233,1355 \ | |
277 | -Wl,-woff,85,-woff,84,-woff,134 \ | |
278 | -nostdinc -I/usr/include -D_BSD_SIGNALS $CXXFLAGS" | |
a1c22363 AJ |
279 | ]) |
280 | ]) | |
281 | ]) | |
30a4f2a8 | 282 | |
0ba77a3c AR |
283 | AC_MSG_CHECKING([compiler name-version]) |
284 | squid_cv_cc_name=`$CC --version | head -1 | cut -f1 -d" "` | |
285 | AS_CASE([$squid_cv_cc_name], | |
286 | [gcc|clang],[squid_cv_cc_majversion=`$CC -dumpversion | cut -f1 -d.`], | |
287 | [squid_cv_cc_majversion="unknown"] | |
288 | ) | |
289 | squid_cv_cc_simplified="$squid_cv_cc_name-$squid_cv_cc_majversion" | |
290 | AC_MSG_RESULT($squid_cv_cc_simplified) | |
291 | ||
292 | # warning flags | |
293 | ||
294 | # -Wall | |
295 | SQUID_CC_ADD_CXXFLAG_WARNING_IF_SUPPORTED([$squid_cv_cc_option_wall]) | |
296 | ||
297 | # -Wextra | |
298 | AS_IF([test "$squid_cv_cc_simplified" = "gcc-4"],[ | |
299 | AC_MSG_NOTICE([skipping -Wextra on $squid_cv_cc_simplified]) | |
300 | ],[ | |
301 | SQUID_CC_ADD_CXXFLAG_WARNING_IF_SUPPORTED([-Wextra]) | |
302 | ||
303 | # Now disable or configure certain warnings enabled by -Wextra | |
304 | ||
305 | # -Wunused-private-field causes a huge number of false positives | |
306 | # in unit tests. Disable that | |
307 | SQUID_CC_ADD_CXXFLAG_WARNING_IF_SUPPORTED([-Wno-unused-private-field]) | |
308 | ||
09835feb AR |
309 | # ...=5: Do not trust comments about fallthrough cases (GCC). |
310 | SQUID_CC_ADD_CXXFLAG_WARNING_IF_SUPPORTED([-Wimplicit-fallthrough=5]) | |
311 | AS_IF([test "x$squid_cv_cc_arg_wimplicit_fallthrough_5" != "xyes"], [ | |
0ba77a3c AR |
312 | SQUID_CC_ADD_CXXFLAG_WARNING_IF_SUPPORTED([-Wno-implicit-fallthrough]) |
313 | ]) | |
314 | ]) | |
315 | ||
8b082ed9 | 316 | # useful warnings that may not be included in -Wall -Wextra |
0ba77a3c AR |
317 | SQUID_CC_ADD_CXXFLAG_WARNING_IF_SUPPORTED([-Wpointer-arith]) |
318 | SQUID_CC_ADD_CXXFLAG_WARNING_IF_SUPPORTED([-Wwrite-strings]) | |
319 | SQUID_CC_ADD_CXXFLAG_WARNING_IF_SUPPORTED([-Wcomments]) | |
320 | SQUID_CC_ADD_CXXFLAG_WARNING_IF_SUPPORTED([-Wshadow]) | |
321 | SQUID_CC_ADD_CXXFLAG_WARNING_IF_SUPPORTED([-Wmissing-declarations]) | |
322 | SQUID_CC_ADD_CXXFLAG_WARNING_IF_SUPPORTED([-Woverloaded-virtual]) | |
07f370ee | 323 | |
05c9db69 | 324 | dnl CentOS (and RHEL) still define ntohs() using deprecated C++ features |
629cb141 | 325 | SQUID_CC_REQUIRE_ARGUMENT([ac_cv_require_wno_deprecated_register],[-Werror -Wno-deprecated-register],[[#include <arpa/inet.h>]],[[int fox=ntohs(1);]]) |
05c9db69 | 326 | |
a1c22363 | 327 | AS_IF([test "x$enable_strict_error_checking" != "xno"],[ |
fcabe077 | 328 | SQUID_CFLAGS="$SQUID_CFLAGS $squid_cv_cc_option_werror" |
59a09b98 | 329 | SQUID_CXXFLAGS="$SQUID_CXXFLAGS $squid_cv_cxx_option_werror" |
a1c22363 | 330 | ]) |
07f370ee | 331 | |
a1c22363 | 332 | AS_IF([test "x$ac_cv_require_wno_deprecated_register" = "xyes"],[ |
0568bff2 | 333 | SQUID_CXXFLAGS="$SQUID_CXXFLAGS -Wno-deprecated-register" |
a1c22363 | 334 | ]) |
0568bff2 | 335 | |
e0eb5853 FC |
336 | # squid_cv_cc_arg_pipe is set by SQUID_CC_GUESS_OPTIONS |
337 | SQUID_CXXFLAGS="$SQUID_CXXFLAGS $squid_cv_cc_arg_pipe" | |
338 | SQUID_CFLAGS="$SQUID_CFLAGS $squid_cv_cc_arg_pipe" | |
2060fa9a | 339 | |
4fe75473 FC |
340 | # possibly include some build info tag into squid -v |
341 | SQUID_EMBED_BUILD_INFO | |
342 | ||
83079644 | 343 | AC_ARG_ENABLE(optimizations, |
ffa3bad9 | 344 | AS_HELP_STRING([--disable-optimizations], |
be0c7ff0 | 345 | [Do not compile Squid with compiler optimizations enabled. |
a2f6a96c FC |
346 | Optimization is good for production builds, but not |
347 | good for debugging. During development, use | |
348 | --disable-optimizations to reduce compilation times | |
10185a38 | 349 | and allow easier debugging.]), [ |
a1c22363 AJ |
350 | AS_IF([test "x$enableval" = "xno"],[ |
351 | AC_MSG_NOTICE([Disabling compiler optimizations (-O flag)]) | |
352 | CFLAGS="`echo $CFLAGS | sed -e 's/-O[[0-9g]]*//'`" | |
353 | CXXFLAGS="`echo $CXXFLAGS | sed -e 's/-O[[0-9g]]*//'`" | |
354 | ]) | |
83079644 | 355 | ]) |
356 | ||
c9267250 AJ |
357 | dnl Nasty hack to get autoconf 2.64 on Linux to run. |
358 | dnl all other uses of RUN_IFELSE are wrapped inside CACHE_CHECK which breaks on 2.64 | |
aff0e8fe | 359 | AC_RUN_IFELSE([AC_LANG_SOURCE([[ int main(int argc, char **argv) { return 0; } ]])],[],[],[:]) |
c9267250 | 360 | |
0d00c98b | 361 | AH_TEMPLATE(XMALLOC_STATISTICS,[Define to have malloc statistics]) |
d9180414 | 362 | AC_ARG_ENABLE(xmalloc-statistics, |
8075a4da FC |
363 | AS_HELP_STRING([--enable-xmalloc-statistics], |
364 | [Show malloc statistics in status page]), [ | |
ec308e40 | 365 | SQUID_YESNO([$enableval],[--enable-xmalloc-statistics]) |
e5f4e1b0 | 366 | ]) |
4d1d2477 FC |
367 | SQUID_DEFINE_BOOL(XMALLOC_STATISTICS,${enable_xmalloc_statistics:=no}, |
368 | [Show malloc statistics in status page]) | |
369 | AC_MSG_NOTICE([xmalloc stats display: $enable_xmalloc_statistics]) | |
e5f4e1b0 | 370 | |
8075a4da | 371 | squid_opt_aufs_threads="" |
f85c88f3 | 372 | AC_ARG_WITH(aufs-threads, |
8075a4da | 373 | AS_HELP_STRING([--with-aufs-threads=N_THREADS], |
a1c22363 AJ |
374 | [Tune the number of worker threads for the aufs object store.]), [ |
375 | AS_CASE([$withval], | |
c881e2b1 | 376 | [@<:@0-9@:>@*],[squid_opt_aufs_threads=$withval], |
8b0d8e31 | 377 | AC_MSG_ERROR(--with-aufs-threads expects a numeric argument) |
a1c22363 AJ |
378 | ) |
379 | ]) | |
380 | AS_IF([test "x$squid_opt_aufs_threads" != "x"],[ | |
381 | AC_MSG_NOTICE([With $squid_opt_aufs_threads aufs threads]) | |
382 | AC_DEFINE_UNQUOTED(AUFS_IO_THREADS,$squid_opt_aufs_threads, | |
383 | [Defines how many threads aufs uses for I/O]) | |
a3310b77 | 384 | ]) |
cd748f27 | 385 | |
24531401 AJ |
386 | ## TODO check if this is necessary, LT_INIT does these checks |
387 | SQUID_AUTO_LIB(dl,[dynamic linking],[LIBDL]) | |
a1c22363 | 388 | AS_IF([test "x$with_dl" != "xno"],[ |
24531401 AJ |
389 | CXXFLAGS="$LIBDL_CFLAGS $CXXFLAGS" |
390 | LDFLAGS="$LIBDL_PATH $LDFLAGS" | |
391 | AC_CHECK_LIB(dl, dlopen) | |
a1c22363 | 392 | ]) |
f85c88f3 | 393 | |
8636e7c1 EB |
394 | AC_DEFUN([LIBATOMIC_CHECKER],[ |
395 | AC_MSG_CHECKING(whether linking $1 -latomic works) | |
396 | AC_LINK_IFELSE([ | |
397 | AC_LANG_SOURCE([[ | |
398 | #include <atomic> | |
399 | #include <cstdint> | |
400 | int | |
b98c6823 HS |
401 | main(int argc, char **) { |
402 | return ( | |
403 | std::atomic<uint8_t>(uint8_t(argc)).exchange(0) && | |
404 | std::atomic<uint64_t>{}.is_lock_free() | |
405 | ) ? 0 : 1; | |
8636e7c1 EB |
406 | } |
407 | ]])],[ | |
408 | AC_MSG_RESULT(yes) | |
409 | libatomic_checker_result="yes"],[ | |
410 | AC_MSG_RESULT(no) | |
411 | libatomic_checker_result="no" | |
412 | ])]) | |
413 | ||
4b0f8912 | 414 | ## check for atomics library before anything that might need it |
16530552 | 415 | SQUID_STATE_SAVE(LIBATOMIC) |
8636e7c1 EB |
416 | LIBATOMIC_CHECKER(without) |
417 | AS_IF([test "x$libatomic_checker_result" = "xno"],[ | |
418 | LIBS="$LIBS -latomic" | |
419 | LIBATOMIC_CHECKER(with) | |
420 | AS_IF([test "x$libatomic_checker_result" = "xyes"],[ | |
421 | ATOMICLIB="-latomic"],[ | |
422 | AC_MSG_ERROR([Required library libatomic not found.]) | |
423 | ])]) | |
16530552 | 424 | SQUID_STATE_ROLLBACK(LIBATOMIC) |
4b0f8912 AJ |
425 | AC_SUBST(ATOMICLIB) |
426 | ||
c975f532 | 427 | AC_SEARCH_LIBS([shm_open], [rt]) |
a1c22363 | 428 | AS_IF([test "x$ac_cv_search_shm_open" != "xno"],[ |
c975f532 | 429 | AC_DEFINE(HAVE_SHM,1,[Support shared memory features]) |
a1c22363 | 430 | ]) |
c975f532 | 431 | |
a1c22363 | 432 | squid_disk_module_candidates= |
2513178d | 433 | AC_ARG_ENABLE(disk-io, |
50fbcbd6 FC |
434 | AS_HELP_STRING([--enable-disk-io="list of modules"], |
435 | [Build support for the list of disk I/O modules. | |
436 | Set without a value or omitted, all available modules will be built. | |
437 | See src/DiskIO for a list of available modules, or | |
438 | Programmers Guide section on DiskIO | |
a1c22363 AJ |
439 | for details on how to build your custom disk module]), |
440 | AS_CASE(["$enableval"], | |
441 | [yes],[], | |
442 | [no|none],[enable_disk_io="no"], | |
443 | [ | |
444 | enable_disk_io="yes" | |
445 | squid_disk_module_candidates="$enableval" | |
446 | ]) | |
447 | ) | |
448 | AS_IF([test "x${enable_disk_io:=yes}" = "xyes"],[ | |
449 | SQUID_LOOK_FOR_MODULES([$srcdir/src/DiskIO],[squid_disk_module_candidates]) | |
450 | AS_IF([test "x$ac_cv_search_shm_open" = "xno"],[ | |
451 | squid_disk_module_candidates=`echo "$squid_disk_module_candidates" | sed 's/IpcIo//g'` | |
452 | ]) | |
453 | ]) | |
454 | SQUID_CLEANUP_MODULES_LIST([squid_disk_module_candidates]) | |
dc299f29 | 455 | SQUID_CHECK_EXISTING_MODULES([$srcdir/src/DiskIO],[squid_disk_module_candidates]) |
a1c22363 AJ |
456 | AC_MSG_NOTICE([DiskIO modules built: ${squid_disk_module_candidates:-none}]) |
457 | SQUID_DEFINE_BOOL(USE_DISKIO,$enable_disk_io,[DiskIO modules are expected to be available.]) | |
40503c27 | 458 | |
2513178d | 459 | dnl Some autoconf.h defines we might enable later... |
0b163dbb FC |
460 | AC_ARG_WITH(pthreads,AS_HELP_STRING([--without-pthreads],[Disable POSIX Threads])) |
461 | AC_ARG_WITH(aio, AS_HELP_STRING([--without-aio],[Do not use POSIX AIO. Default: auto-detect])) | |
daf2ddfa | 462 | ENABLE_WIN32_AIOPS=0 |
ffa3bad9 FC |
463 | squid_opt_use_aio= |
464 | squid_opt_use_diskthreads= | |
46577dd1 | 465 | AIOLIB= |
2513178d AJ |
466 | |
467 | dnl Setup the module paths etc. | |
2513178d AJ |
468 | DISK_LIBS= |
469 | DISK_MODULES= | |
d9691f09 AJ |
470 | AH_TEMPLATE(HAVE_DISKIO_MODULE_AIO, [Whether POSIX AIO Disk I/O module is built]) |
471 | AH_TEMPLATE(HAVE_DISKIO_MODULE_BLOCKING, [Whether Blocking Disk I/O module is built]) | |
472 | AH_TEMPLATE(HAVE_DISKIO_MODULE_DISKDAEMON, [Whether DiskDaemon Disk I/O module is built]) | |
23ee12fb | 473 | AH_TEMPLATE(HAVE_DISKIO_MODULE_DISKTHREADS, [Whether DiskThreads Disk I/O module is built]) |
d9691f09 AJ |
474 | AH_TEMPLATE(HAVE_DISKIO_MODULE_IPCIO, [Whether IpcIo Disk I/O module is built]) |
475 | AH_TEMPLATE(HAVE_DISKIO_MODULE_MMAPPED, [Whether Mmapped Disk I/O module is built]) | |
50fbcbd6 | 476 | for module in $squid_disk_module_candidates none; do |
d235bc84 | 477 | # maybe not needed |
a1c22363 AJ |
478 | AS_IF([test "x$module" = "xnone"],[continue]) |
479 | AS_IF([! test -d "$srcdir/src/DiskIO/$module"],[AC_MSG_ERROR([disk-io $module does not exist])]) | |
480 | AS_CASE(["$module"], | |
481 | [AIO],[ | |
d9691f09 AJ |
482 | dnl Check for POSIX AIO availability |
483 | squid_opt_use_aio="yes" | |
484 | AIOLIB= | |
a1c22363 | 485 | AS_IF([test "x$with_aio" != "xno"],[ |
d9691f09 AJ |
486 | have_aio_header=no |
487 | AC_CHECK_HEADERS(aio.h,[have_aio_header=yes]) | |
488 | dnl On some systems POSIX AIO functions are in librt | |
489 | dnl On some systems POSIX AIO functions are in libaio | |
490 | AC_CHECK_LIB(rt,aio_read,[AIOLIB="-lrt"],AC_CHECK_LIB(aio,aio_read,[AIOLIB="-laio"],[])) | |
491 | dnl Enable AIO if the library and headers are found | |
a1c22363 | 492 | AS_IF([test "x$AIOLIB" != "x" -a "x$have_aio_header" = "xyes"],[ |
d9691f09 AJ |
493 | AC_MSG_NOTICE([Native POSIX AIO support detected.]) |
494 | squid_opt_use_aio="yes" | |
a1c22363 | 495 | ],[ |
d9691f09 AJ |
496 | dnl Windows does things differently. We provide wrappers. |
497 | dnl TODO: Windows really needs its own DiskIO module or its Overlaped IO | |
a1c22363 AJ |
498 | AS_IF([test "$squid_host_os" = "mingw"],[ |
499 | squid_opt_use_aio="yes" | |
500 | AC_MSG_NOTICE([Windows being built. Maybe-enable POSIX AIO.]) | |
501 | ],[ | |
502 | squid_opt_use_aio="no" | |
503 | AC_MSG_NOTICE([Native POSIX AIO support not detected. AIO automatically disabled.]) | |
504 | ]) | |
505 | ]) | |
506 | ],[ | |
d9691f09 AJ |
507 | AC_MSG_NOTICE([POSIX AIO support manually disabled.]) |
508 | squid_opt_use_aio="no" | |
a1c22363 | 509 | ]) |
d9691f09 | 510 | dnl Use the POSIX AIO pieces if we actually need them. |
a1c22363 | 511 | AS_IF([test "x$squid_opt_use_aio" = "xyes"],[ |
d9691f09 | 512 | DISK_MODULES="$DISK_MODULES AIO" |
d9691f09 | 513 | AC_DEFINE([HAVE_DISKIO_MODULE_AIO],1,[POSIX AIO Disk I/O module is built]) |
a1c22363 AJ |
514 | AS_IF([test "$squid_host_os" = "mingw"],[ |
515 | ENABLE_WIN32_AIO=1 | |
516 | AC_MSG_NOTICE([Replacing AIO DiskIO module with: Windows overlapped I/O support]) | |
517 | ],[ | |
518 | AC_MSG_NOTICE([Enabling AIO DiskIO module]) | |
519 | ]) | |
520 | ],[ | |
d9691f09 | 521 | AC_MSG_NOTICE([AIO DiskIO Module disabled. Missing POSIX AIO support.]) |
fedd516f | 522 | squid_disk_module_candidates_AIO=no |
a1c22363 AJ |
523 | ]) |
524 | ], | |
d9691f09 | 525 | |
a1c22363 | 526 | [Blocking],[ |
d9691f09 AJ |
527 | AC_MSG_NOTICE([Enabling Blocking DiskIO module]) |
528 | DISK_MODULES="$DISK_MODULES Blocking" | |
d9691f09 | 529 | AC_DEFINE([HAVE_DISKIO_MODULE_BLOCKING],1,[Blocking Disk I/O module is built]) |
a1c22363 AJ |
530 | ], |
531 | ||
532 | [DiskDaemon],[ | |
533 | AS_IF([test "$squid_host_os" = "mingw"],[ | |
534 | AC_MSG_NOTICE([DiskDaemon not supported on MinGW]) | |
535 | squid_disk_module_candidates_DiskDaemon=no | |
536 | ],[ | |
537 | AC_MSG_NOTICE([Enabling DiskDaemon DiskIO module]) | |
538 | DISK_MODULES="$DISK_MODULES DiskDaemon" | |
539 | AC_DEFINE([HAVE_DISKIO_MODULE_DISKDAEMON],1,[DiskDaemon Disk I/O module is built]) | |
540 | ]) | |
541 | ], | |
542 | ||
543 | [DiskThreads],[ | |
507ca601 FC |
544 | squid_opt_use_diskthreads="yes" |
545 | LIBPTHREADS= | |
546 | SQUID_STATE_SAVE([diskthreads_state],[SQUID_CFLAGS SQUID_CXXFLAGS]) | |
a1c22363 AJ |
547 | AS_IF([test "x$with_pthreads" != "xno"],[ |
548 | dnl TODO: this needs to be extended to handle more systems and better | |
549 | dnl REF: http://www.openldap.org/lists/openldap-bugs/200006/msg00070.html | |
550 | dnl REF: http://autoconf-archive.cryp.to/acx_pthread.html | |
551 | AS_CASE(["$squid_host_os"], | |
552 | [mingw],[ | |
daf2ddfa | 553 | ENABLE_WIN32_AIOPS=1 |
507ca601 | 554 | AC_MSG_NOTICE([Windows threads support automatically enabled]) |
a1c22363 AJ |
555 | ], |
556 | ||
557 | [freebsd],[ | |
558 | AS_IF([test `echo "$squid_host_os_version" | tr -d .` -lt 70],[ | |
559 | AC_MSG_NOTICE(pthread library requires FreeBSD 7 or later) | |
560 | squid_opt_use_diskthreads="no" | |
561 | ],[ | |
a0f82085 AJ |
562 | SQUID_CFLAGS="$SQUID_CFLAGS -D_REENTRANT" |
563 | SQUID_CXXFLAGS="$SQUID_CXXFLAGS -D_REENTRANT" | |
a1c22363 AJ |
564 | AS_IF([test "x$GCC" = "xyes" -a "x$PRESET_LDFLAGS" = "x"],[LDFLAGS="$LDFLAGS -pthread"]) |
565 | ]) | |
566 | ], | |
567 | ||
568 | [openbsd],[ | |
569 | AS_IF([test `echo "$squid_host_os_version" | tr -d .` -lt 52],[ | |
570 | AC_MSG_NOTICE(pthread library requires OpenBSD 5.2 or later) | |
571 | squid_opt_use_diskthreads="no" | |
572 | ],[ | |
ec264296 SH |
573 | SQUID_CFLAGS="$SQUID_CFLAGS -D_REENTRANT" |
574 | SQUID_CXXFLAGS="$SQUID_CXXFLAGS -D_REENTRANT" | |
575 | LDFLAGS="$LDFLAGS -lpthread" | |
a1c22363 AJ |
576 | ]) |
577 | ], | |
578 | ||
579 | [solaris],[ | |
580 | AS_IF([test "x$GCC" = "xyes"],[ | |
507ca601 FC |
581 | SQUID_CFLAGS="$SQUID_CFLAGS -D_REENTRANT -pthreads" |
582 | SQUID_CXXFLAGS="$SQUID_CXXFLAGS -D_REENTRANT -pthreads" | |
583 | AC_CHECK_LIB(pthread, pthread_create ,[LIBPTHREADS="-lpthread"], [ | |
584 | AC_MSG_NOTICE(pthread library required but cannot be found.) | |
585 | squid_opt_use_diskthreads="no" | |
586 | ]) | |
a1c22363 | 587 | ],[ |
507ca601 FC |
588 | dnl test for -lpthread first. libc version is a stub apparently on Solaris. |
589 | SQUID_CFLAGS="$SQUID_CFLAGS -D_REENTRANT -lpthread" | |
590 | SQUID_CXXFLAGS="$SQUID_CXXFLAGS -D_REENTRANT -lpthread" | |
591 | AC_SEARCH_LIBS([pthread_create],[pthread thread],[ | |
9603207d | 592 | LIBPTHREADS="" #in LIBS |
507ca601 FC |
593 | ],[ |
594 | AC_MSG_NOTICE(pthread library required but cannot be found.) | |
595 | squid_opt_use_diskthreads="no" | |
596 | ]) | |
a1c22363 AJ |
597 | ]) |
598 | ], | |
599 | ||
600 | [ | |
507ca601 FC |
601 | SQUID_CFLAGS="$SQUID_CFLAGS -D_REENTRANT" |
602 | SQUID_CXXFLAGS="$SQUID_CXXFLAGS -D_REENTRANT" | |
603 | AC_CHECK_LIB(pthread, pthread_create ,[LIBPTHREADS="-lpthread"], [ | |
40503c27 FC |
604 | AC_MSG_NOTICE(pthread library required but cannot be found.) |
605 | squid_opt_use_diskthreads="no" | |
606 | ]) | |
a1c22363 AJ |
607 | ] |
608 | ) | |
609 | ],[ | |
610 | AC_MSG_NOTICE([Native pthreads support manually disabled.]) | |
611 | squid_opt_use_diskthreads="no" | |
612 | ]) | |
613 | AS_IF([test "x$squid_opt_use_diskthreads" = "xyes"],[ | |
614 | AC_MSG_NOTICE([Enabling DiskThreads DiskIO module]) | |
615 | DISK_MODULES="$DISK_MODULES DiskThreads" | |
616 | AC_DEFINE([HAVE_DISKIO_MODULE_DISKTHREADS],1,[DiskThreads Disk I/O module is built]) | |
617 | ],[ | |
618 | AC_MSG_NOTICE([Native pthreads support disabled. DiskThreads module automaticaly disabled.]) | |
619 | SQUID_STATE_ROLLBACK([diskthreads_state]) | |
620 | squid_disk_module_candidates_DiskThreads=no | |
621 | ]) | |
622 | ], | |
623 | ||
624 | [IpcIo],[ | |
625 | AS_IF([test "x$ac_cv_search_shm_open" = "xno"],[ | |
fedd516f AJ |
626 | AC_MSG_NOTICE([DiskIO IpcIo module requires shared memory support]) |
627 | squid_disk_module_candidates_IpcIo=no | |
a1c22363 | 628 | ],[ |
23ee12fb | 629 | AC_MSG_NOTICE([Enabling IpcIo DiskIO module]) |
fedd516f | 630 | DISK_MODULES="$DISK_MODULES IpcIo" |
fedd516f | 631 | AC_DEFINE([HAVE_DISKIO_MODULE_IPCIO],1,[IpcIo Disk I/O module is built]) |
a1c22363 AJ |
632 | ]) |
633 | ], | |
2513178d | 634 | |
a1c22363 | 635 | [Mmapped],[ |
e2cbb70e FC |
636 | dnl TODO: use availability of sys/mman.h and/or mmap to define |
637 | dnl OR support windows mmap functions | |
a1c22363 | 638 | AS_IF([test "x$squid_host_os" = "xmingw"],[ |
e2cbb70e | 639 | AC_MSG_NOTICE([Mmapped DiskIO is not available on Mingw]) |
fedd516f | 640 | squid_disk_module_candidates_Mmapped=no |
a1c22363 | 641 | ],[ |
e2cbb70e | 642 | AC_MSG_NOTICE([Enabling Mmapped DiskIO module]) |
e2cbb70e | 643 | DISK_MODULES="$DISK_MODULES Mmapped" |
d9691f09 | 644 | AC_DEFINE([HAVE_DISKIO_MODULE_MMAPPED],1,[Mmapped Disk I/O module is built]) |
a1c22363 AJ |
645 | ]) |
646 | ], | |
e2851fe7 | 647 | |
a1c22363 | 648 | [ |
507ca601 | 649 | AC_MSG_NOTICE([Enabling $module DiskIO module]) |
d9691f09 | 650 | DISK_LIBS="$DISK_LIBS lib${module}.la" |
507ca601 | 651 | DISK_MODULES="$DISK_MODULES ${module}" |
a1c22363 | 652 | ]) |
2513178d AJ |
653 | done |
654 | AC_MSG_NOTICE([IO Modules built: $DISK_MODULES]) | |
655 | AC_SUBST(DISK_MODULES) | |
656 | AC_SUBST(DISK_LIBS) | |
8aafbbc1 | 657 | AM_CONDITIONAL(ENABLE_DISKIO_AIO, test "x$squid_disk_module_candidates_AIO" = "xyes") |
d9691f09 | 658 | AC_SUBST(AIOLIB) |
8aafbbc1 AJ |
659 | AM_CONDITIONAL(ENABLE_WIN32_AIO, test "x$squid_disk_module_candidates_AIO" = "xyes" -a "x$ENABLE_WIN32_AIO" = "x1") |
660 | AM_CONDITIONAL(ENABLE_DISKIO_BLOCKING, test "x$squid_disk_module_candidates_Blocking" = "xyes") | |
661 | AM_CONDITIONAL(ENABLE_DISKIO_DISKDAEMON, test "x$squid_disk_module_candidates_DiskDaemon" = "xyes") | |
662 | AM_CONDITIONAL(ENABLE_DISKIO_DISKTHREADS, test "x$squid_disk_module_candidates_DiskThreads" = "xyes") | |
d9691f09 | 663 | AC_SUBST(LIBPTHREADS) |
8aafbbc1 AJ |
664 | AM_CONDITIONAL(ENABLE_WIN32_AIOPS, test "x$squid_disk_module_candidates_DiskThreads" = "xyes" -a "x$ENABLE_WIN32_AIOPS" = "x1") |
665 | AM_CONDITIONAL(ENABLE_DISKIO_IPCIO, test "x$squid_disk_module_candidates_IpcIo" = "xyes") | |
666 | AM_CONDITIONAL(ENABLE_DISKIO_MMAPPED, test "x$squid_disk_module_candidates_Mmapped" = "xyes") | |
2513178d AJ |
667 | |
668 | dnl Check what Storage formats are wanted. | |
669 | dnl This version will error out with a message saying why if a required DiskIO is missing. | |
d235bc84 FC |
670 | AC_ARG_ENABLE([storeio], |
671 | AS_HELP_STRING([--enable-storeio="list of modules"], | |
672 | [Build support for the list of store I/O modules. | |
18cc92fb FC |
673 | The default is only to build the "ufs" module. |
674 | See src/fs for a list of available modules, or | |
675 | Programmers Guide section <not yet written> | |
507ca601 | 676 | for details on how to build your custom store module]), [ |
a1c22363 AJ |
677 | AS_CASE(["$enableval"], |
678 | [yes],[], | |
679 | [no|none],[enable_storeio="no"], | |
680 | [ | |
681 | enable_storeio="yes" | |
682 | # ufs is really always needed as it has low-level routines | |
683 | # if it is a dupe it will be cleaned-up later | |
684 | squid_storeio_module_candidates="$enableval ufs" | |
685 | ]) | |
686 | ]) | |
687 | AS_IF([test "x${enable_storeio:=yes}" = "xyes"],[ | |
d235bc84 | 688 | SQUID_LOOK_FOR_MODULES([$srcdir/src/fs],[squid_storeio_module_candidates]) |
a1c22363 | 689 | ]) |
dc299f29 FC |
690 | SQUID_CLEANUP_MODULES_LIST([squid_storeio_module_candidates]) |
691 | SQUID_CHECK_EXISTING_MODULES([$srcdir/src/fs],[squid_storeio_module_candidates]) | |
a1c22363 | 692 | AC_MSG_NOTICE([Store modules built: ${squid_storeio_module_candidates:-none}]) |
dc299f29 | 693 | |
a1c22363 AJ |
694 | for fs in ${squid_storeio_module_candidates:-none}; do |
695 | AS_CASE([$fs], | |
696 | [diskd],[ | |
697 | AS_IF([test "x$squid_disk_module_candidates_Blocking" != "xyes" -a \ | |
698 | "x$squid_disk_module_candidates_DiskDaemon" != "xyes"],[ | |
507ca601 | 699 | AC_MSG_ERROR([Storage diskd module requires DiskIO module: Blocking or DiskDaemon]) |
a1c22363 AJ |
700 | ]) |
701 | ], | |
702 | [aufs],[ | |
703 | AS_IF([test "x$squid_disk_module_candidates_Blocking" != "xyes" -a \ | |
704 | "x$squid_disk_module_candidates_DiskThreads" != "xyes"],[ | |
507ca601 | 705 | AC_MSG_ERROR([Storage module aufs requires DiskIO module: Blocking or DiskThreads]) |
a1c22363 AJ |
706 | ]) |
707 | ], | |
708 | [rock],[ | |
709 | AS_IF([test "x$squid_disk_module_candidates_IpcIo" != "xyes" -a \ | |
710 | "x$squid_disk_module_candidates_Blocking" != "xyes"],[ | |
b5b88fb5 | 711 | AC_MSG_ERROR([Storage module Rock requires DiskIO module: Blocking or IpcIo]) |
a1c22363 | 712 | ]) |
b5b88fb5 | 713 | squid_do_build_rock=true |
a1c22363 AJ |
714 | ], |
715 | [ufs],[ | |
716 | AS_IF([test "x$squid_disk_module_candidates_Blocking" != "xyes"],[ | |
b5b88fb5 | 717 | AC_MSG_ERROR([Storage module ufs requires DiskIO module: Blocking]) |
a1c22363 | 718 | ]) |
b5b88fb5 | 719 | squid_do_build_ufs=true |
a1c22363 AJ |
720 | ] |
721 | ) | |
a2794549 | 722 | done |
23ee12fb | 723 | |
8aafbbc1 AJ |
724 | AM_CONDITIONAL(ENABLE_FS_UFS, test "x$squid_do_build_ufs" = "xtrue") |
725 | AM_CONDITIONAL(ENABLE_FS_ROCK, test "x$squid_do_build_rock" = "xtrue") | |
9d6186b1 FC |
726 | dnl hack: need to define those even if not used in the build system to |
727 | dnl make sure that global FS objects are linked to the squid binary. | |
7b5b7ba8 CT |
728 | AH_TEMPLATE(HAVE_FS_UFS, "Define to 1 if ufs filesystem module is build") |
729 | AH_TEMPLATE(HAVE_FS_AUFS, "Define to 1 if aufs filesystem module is build") | |
730 | AH_TEMPLATE(HAVE_FS_DISKD, "Define to 1 if diskd filesystem module is build") | |
e2851fe7 | 731 | AH_TEMPLATE(HAVE_FS_ROCK, "Define to 1 if rock filesystem module is build") |
7b5b7ba8 CT |
732 | |
733 | ||
dc299f29 | 734 | dnl got final squid_storeio_module_candidates, build library lists |
b66455ff AR |
735 | dnl This list will not be needed when each fs library has its own Makefile |
736 | STORE_LIBS_TO_BUILD= | |
737 | dnl File system libraries to link executables with. | |
738 | dnl These are the same as STORE_LIBS_TO_BUILD, but with a path | |
739 | STORE_LIBS_TO_ADD= | |
dc299f29 | 740 | for fs in $squid_storeio_module_candidates; do |
7b5b7ba8 CT |
741 | STORE_LIBS_TO_BUILD="$STORE_LIBS_TO_BUILD lib${fs}.la" |
742 | STORE_LIBS_TO_ADD="$STORE_LIBS_TO_ADD fs/lib${fs}.la" | |
6d1c1ab1 FC |
743 | SQUID_TOUPPER_VAR_CONTENTS([fs]) |
744 | AC_DEFINE_UNQUOTED(HAVE_FS_${fs}, 1) | |
b66455ff AR |
745 | done |
746 | ||
747 | AC_SUBST(STORE_LIBS_TO_BUILD) | |
748 | AC_SUBST(STORE_LIBS_TO_ADD) | |
082a5e7a | 749 | AC_SUBST(STORE_TESTS) |
a2794549 | 750 | |
24a04df9 AJ |
751 | |
752 | dnl At lest one removal policy is always needed. | |
753 | dnl 'lru' removal policy is currently hard-coded by name for tests | |
754 | dnl so we must set it as default. | |
755 | REPL_POLICIES="lru" | |
d9180414 | 756 | AC_ARG_ENABLE(removal-policies, |
56ffc413 FC |
757 | AS_HELP_STRING([--enable-removal-policies="list of policies"], |
758 | [Build support for the list of removal policies. | |
18cc92fb FC |
759 | The default is only to build the "lru" module. |
760 | See src/repl for a list of available modules, or | |
761 | Programmers Guide section 9.9 for details on how | |
507ca601 | 762 | to build your custom policy]), [ |
a1c22363 AJ |
763 | AS_CASE(["$enableval"], |
764 | [yes],[ SQUID_LOOK_FOR_MODULES([$srcdir/src/repl],[REPL_POLICIES]) ], | |
765 | [no],[], | |
766 | [ REPL_POLICIES="$enableval" ] | |
767 | ) | |
768 | ]) | |
769 | SQUID_CLEANUP_MODULES_LIST([REPL_POLICIES]) | |
770 | SQUID_CHECK_EXISTING_MODULES([$srcdir/src/repl],[REPL_POLICIES]) | |
771 | AC_MSG_NOTICE([Removal policies to build: $REPL_POLICIES]) | |
772 | REPL_OBJS="repl/lib`echo \"$REPL_POLICIES\" | sed -e 's% %.a repl/lib%g'`.a" | |
773 | REPL_LIBS=`echo "$REPL_OBJS" | sed -e 's%repl/%%g'` | |
6a566b9c | 774 | AC_SUBST(REPL_POLICIES) |
6a566b9c | 775 | AC_SUBST(REPL_OBJS) |
f71946fc | 776 | AC_SUBST(REPL_LIBS) |
6a566b9c | 777 | |
d1da2d1f | 778 | AM_CONDITIONAL(ENABLE_PINGER, false) |
e5f4e1b0 | 779 | AC_ARG_ENABLE(icmp, |
a1c22363 AJ |
780 | AS_HELP_STRING([--enable-icmp],[Enable ICMP pinging and Network Measurement]),[ |
781 | AS_IF([test "x$enableval" = "xyes"],[ | |
eed82608 | 782 | AC_MSG_NOTICE([ICMP enabled]) |
be0c7ff0 | 783 | AC_DEFINE(USE_ICMP,1,[Define to use Squid ICMP and Network Measurement features (highly recommended!)]) |
d1da2d1f | 784 | AM_CONDITIONAL(ENABLE_PINGER, true) |
a1c22363 | 785 | ]) |
e5f4e1b0 | 786 | ]) |
787 | ||
9a0a18de | 788 | AM_CONDITIONAL(ENABLE_DELAY_POOLS, false) |
d9180414 | 789 | AC_ARG_ENABLE(delay-pools, |
a1c22363 AJ |
790 | AS_HELP_STRING([--enable-delay-pools],[Enable delay pools to limit bandwidth usage]),[ |
791 | AS_IF([test "x$enableval" = "xyes"],[ | |
eed82608 | 792 | AC_MSG_NOTICE([Delay pools enabled]) |
9a0a18de | 793 | AC_DEFINE([USE_DELAY_POOLS],1,[Traffic management via "delay pools".]) |
ffe4ffd8 | 794 | AM_CONDITIONAL(ENABLE_DELAY_POOLS, true) |
a1c22363 | 795 | ]) |
e5f4e1b0 | 796 | ]) |
797 | ||
5fa840c3 | 798 | dnl disable generic/common adaptation support by default |
5069fb38 | 799 | squid_opt_use_adaptation=no |
5fa840c3 | 800 | |
799b66d1 AJ |
801 | squid_opt_use_esi=auto |
802 | AH_TEMPLATE([USE_SQUID_ESI],[Define to enable the ESI processor]) | |
43ae1d95 | 803 | AC_ARG_ENABLE(esi, |
799b66d1 | 804 | AS_HELP_STRING([--disable-esi], |
5cf2197f | 805 | [Disable ESI for accelerators. ESI requires expat or xml2 library. |
7eb77a5f | 806 | Enabling ESI will cause squid reverse proxies to be capable |
5069fb38 | 807 | of the Edge Acceleration Specification (www.esi.org).]), |
799b66d1 | 808 | [squid_opt_use_esi=$enableval],[]) |
88bfe098 | 809 | |
7eb77a5f | 810 | # ESI support libraries: expat |
407c0702 | 811 | AH_TEMPLATE(HAVE_LIBEXPAT,[Define to 1 if you have the expat library]) |
5cf2197f | 812 | SQUID_AUTO_LIB(expat,[ESI expat library],[LIBEXPAT]) |
a1c22363 | 813 | AS_IF([test "x$squid_opt_use_esi" != "xno" -a "x$with_expat" != "xno"],[ |
407c0702 AJ |
814 | SQUID_STATE_SAVE(squid_expat_state) |
815 | PKG_CHECK_MODULES([LIBEXPAT],[expat],[],[ | |
816 | AC_CHECK_LIB([expat],[main],[LIBEXPAT_LIBS="-lexpat"]) | |
799b66d1 | 817 | ]) |
407c0702 AJ |
818 | CPPFLAGS="$LIBEXPAT_CFLAGS $CPPFLAGS" |
819 | AC_CHECK_HEADERS(expat.h) | |
820 | SQUID_STATE_ROLLBACK(squid_expat_state) | |
821 | AS_IF([test "x$LIBEXPAT_LIBS" != "x"],[ | |
822 | squid_opt_use_esi=yes | |
823 | LIBEXPAT_LIBS="$LIBEXPAT_PATH $LIBEXPAT_LIBS" | |
824 | AC_DEFINE(HAVE_LIBEXPAT,1,[Define to 1 if you have the expat library]) | |
825 | ], | |
826 | [test "x$with_expat" = "xyes"],[AC_MSG_ERROR([Required library expat not found.])], | |
827 | [AC_MSG_NOTICE([Library expat not found.])] | |
828 | ) | |
a1c22363 | 829 | ]) |
407c0702 AJ |
830 | AM_CONDITIONAL(ENABLE_LIBEXPAT,[test "x$LIBEXPAT_LIBS" != "x"]) |
831 | AC_SUBST(LIBEXPAT_LIBS) | |
ad32c661 | 832 | |
866a092d AJ |
833 | # ESI support libraries: xml2 |
834 | AH_TEMPLATE(HAVE_LIBXML2,[Define to 1 if you have the xml2 library]) | |
5cf2197f AJ |
835 | SQUID_AUTO_LIB(xml2,[ESI xml2 library],[LIBXML2]) |
836 | AS_IF([test "x$squid_opt_use_esi" != "xno" -a "x$with_xml2" != "xno"],[ | |
8fa07024 FF |
837 | SQUID_STATE_SAVE([squid_libxml2_save]) |
838 | PKG_CHECK_MODULES([LIBXML2],[libxml-2.0],[],[ | |
866a092d | 839 | AC_CHECK_LIB([xml2],[main],[LIBXML2_LIBS="$LIBXML2_PATH -lxml2"]) |
0dc1a86a | 840 | ]) |
37be0e75 | 841 | CPPFLAGS="$LIBXML2_CFLAGS $CPPFLAGS" |
0dc1a86a | 842 | AC_CHECK_HEADERS(libxml/parser.h libxml/HTMLparser.h libxml/HTMLtree.h) |
8fa07024 FF |
843 | SQUID_STATE_ROLLBACK([squid_libxml2_save]) |
844 | ||
a1c22363 | 845 | AS_IF([test "x$LIBXML2_LIBS" != "x"],[ |
799b66d1 | 846 | squid_opt_use_esi=yes |
37be0e75 | 847 | CPPFLAGS="$LIBXML2_CFLAGS $CPPFLAGS" |
866a092d AJ |
848 | LIBXML2_LIBS="$LIBXML2_PATH $LIBXML2_LIBS" |
849 | AC_DEFINE(HAVE_LIBXML2,1,[Define to 1 if you have the xml2 library]) | |
5cf2197f AJ |
850 | ],[test "x$with_xml2" = "xyes"],[ |
851 | AC_MSG_ERROR([Required library xml2 not found]) | |
a1c22363 | 852 | ],[ |
5cf2197f | 853 | AC_MSG_NOTICE([Library xml2 not found.]) |
a1c22363 AJ |
854 | ]) |
855 | ]) | |
866a092d AJ |
856 | AM_CONDITIONAL(ENABLE_LIBXML2,[test "x$LIBXML2_LIBS" != "x"]) |
857 | AC_SUBST(LIBXML2_LIBS) | |
7eb77a5f | 858 | |
799b66d1 | 859 | AS_IF([test "x$squid_opt_use_esi" = "xyes"],[ |
407c0702 | 860 | AS_IF([test "x$LIBXML2_LIBS" = "x" -a "x$LIBEXPAT_LIBS" = "x"],[ |
799b66d1 AJ |
861 | AC_MSG_ERROR([ESI processor requires libxml2 or libexpat]) |
862 | ]) | |
407c0702 | 863 | AC_MSG_NOTICE([Enabling ESI processor: $LIBEXPAT_LIBS $LIBXML2_LIBS]) |
799b66d1 AJ |
864 | AC_DEFINE(USE_SQUID_ESI,1,[Compile the ESI processor]) |
865 | ],[ | |
866 | AS_IF(test "x$squid_opt_use_esi" = "xno",[ | |
867 | AC_MSG_NOTICE([Disabling ESI processor.]) | |
868 | ],[ | |
869 | AC_MSG_NOTICE([Disabling ESI processor. libxml2 and libexpat not found.]) | |
870 | ]) | |
871 | ]) | |
8aafbbc1 | 872 | AM_CONDITIONAL(ENABLE_ESI, test "x$squid_opt_use_esi" = "xyes") |
43ae1d95 | 873 | |
51952383 | 874 | AC_ARG_ENABLE(icap-client, |
4f07726a | 875 | AS_HELP_STRING([--disable-icap-client],[Disable the ICAP client.]),[ |
ec308e40 | 876 | SQUID_YESNO([$enableval],[--enable-icap-client]) |
4f07726a AJ |
877 | ]) |
878 | SQUID_DEFINE_BOOL(ICAP_CLIENT,${enable_icap_client:=yes}, [Enable ICAP client features in Squid]) | |
ebf76e07 | 879 | AS_IF(test "x$enable_icap_client" != "xno", squid_opt_use_adaptation="yes") |
8aafbbc1 | 880 | AM_CONDITIONAL(ENABLE_ICAP_CLIENT, test "x$enable_icap_client" != "xno") |
51952383 | 881 | |
3e7b6055 | 882 | AC_ARG_ENABLE(ecap, |
a1c22363 | 883 | AS_HELP_STRING([--enable-ecap],[support loadable content adaptation modules]),[ |
ec308e40 | 884 | SQUID_YESNO([$enableval],[--enable-ecap])],[ |
a1c22363 AJ |
885 | enable_ecap="no" |
886 | ]) | |
3e7b6055 | 887 | dnl Perform configuration consistency checks for eCAP |
a1c22363 AJ |
888 | AS_IF([test "x$enable_ecap" != "xno"],[ |
889 | AS_IF([test "x$enable_shared" != "xyes"],[ | |
5a2409b7 | 890 | AC_MSG_ERROR([eCAP support requires loadable modules. Please do not use --disable-shared with --enable-ecap.]) |
a1c22363 | 891 | ]) |
4cfba571 | 892 | |
a1c22363 | 893 | AS_IF([test -n "$PKG_CONFIG"],[ |
6666da11 | 894 | dnl eCAP support requires libecap. |
0a720258 | 895 | dnl This Squid supports libecap v1.0.x. |
3e115aaf AR |
896 | dnl Use EXT_ prefix to distinguish external libecap (that we check for |
897 | dnl here) from our own convenience ecap library in Makefiles. | |
0a720258 | 898 | PKG_CHECK_MODULES([EXT_LIBECAP],[libecap >= 1.0 libecap < 1.1]) |
a1c22363 | 899 | ],[ |
cbc14831 | 900 | AC_MSG_NOTICE([eCAP support requires pkg-config to verify the correct library version. Trouble may follow.]) |
a1c22363 | 901 | ]) |
3e7b6055 | 902 | |
ebf76e07 AJ |
903 | SQUID_STATE_SAVE(squid_ecap_state) |
904 | AC_MSG_CHECKING([whether -lecap will link]) | |
a023fd8e AJ |
905 | CXXFLAGS="$CXXFLAGS $EXT_LIBECAP_CFLAGS" |
906 | LIBS="$LIBS $EXT_LIBECAP_LIBS" | |
ebf76e07 AJ |
907 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <libecap/common/names.h>]],[[ |
908 | const libecap::Name test("test", libecap::Name::NextId()); | |
909 | ]])],[ | |
910 | AC_MSG_RESULT(yes) | |
5069fb38 | 911 | squid_opt_use_adaptation=yes |
ebf76e07 AJ |
912 | ],[ |
913 | AC_MSG_RESULT(no) | |
a1c22363 AJ |
914 | AS_IF([test "x$enable_ecap" = "xyes"],[ |
915 | AC_MSG_ERROR([eCAP library will not link. | |
ebf76e07 | 916 | You may need to rebuild libecap using the same version of GCC as Squid. |
a1c22363 AJ |
917 | There have been breaking ABI changes in the libstdc++ STL with GCC 5.]) |
918 | ],[ | |
919 | AC_MSG_NOTICE([eCAP library will not link. | |
ebf76e07 AJ |
920 | You may need to rebuild libecap using the same version of GCC as Squid. |
921 | There have been breaking ABI changes in the libstdc++ STL with GCC 5.]) | |
a1c22363 | 922 | enable_ecap="no" |
ebf76e07 AJ |
923 | ]) |
924 | ]) | |
925 | SQUID_STATE_ROLLBACK(squid_ecap_state) | |
a1c22363 AJ |
926 | ]) |
927 | SQUID_DEFINE_BOOL(USE_ECAP,${enable_ecap:=no},[Whether to use eCAP support]) | |
928 | AM_CONDITIONAL(ENABLE_ECAP, test "x$enable_ecap" = "xyes") | |
3e7b6055 | 929 | |
5fa840c3 | 930 | dnl enable adaptation if requested by specific adaptation mechanisms |
8aafbbc1 | 931 | ADAPTATION_LIBS="" |
a1c22363 | 932 | AS_IF([test "x$squid_opt_use_adaptation" = "xyes"],[ADAPTATION_LIBS="adaptation/libadaptation.la"]) |
8aafbbc1 AJ |
933 | SQUID_DEFINE_BOOL(USE_ADAPTATION,${squid_opt_use_adaptation:=no}, [common adaptation support]) |
934 | AM_CONDITIONAL(ENABLE_ADAPTATION, test "x$squid_opt_use_adaptation" = "xyes") | |
5fa840c3 | 935 | AC_SUBST(ADAPTATION_LIBS) |
3e7b6055 | 936 | |
a1c22363 | 937 | AS_IF([test "x$squid_host_os" = "xmingw"],[enable_wccp=no]) |
5069fb38 | 938 | AC_ARG_ENABLE(wccp, |
ec308e40 AJ |
939 | AS_HELP_STRING([--disable-wccp],[Disable Web Cache Coordination Protocol]),[ |
940 | SQUID_YESNO([$enableval],[--enable-wccp]) | |
5069fb38 | 941 | ]) |
0067eb06 | 942 | SQUID_DEFINE_BOOL(USE_WCCP, ${enable_wccp:=yes}, [Define to enable WCCP]) |
1a6b111a | 943 | AC_MSG_NOTICE([Web Cache Coordination Protocol enabled: $enable_wccp]) |
0b0cfcf2 | 944 | |
a1c22363 | 945 | AS_IF([test "x$squid_host_os" = "xmingw"],[enable_wccpv2=no]) |
0b0cfcf2 | 946 | AC_ARG_ENABLE(wccpv2, |
1a6b111a | 947 | AS_HELP_STRING([--disable-wccpv2], |
9603207d | 948 | [Disable Web Cache Coordination V2 Protocol]), [ |
ec308e40 | 949 | SQUID_YESNO([$enableval],[--enable-wccpv2]) |
0b0cfcf2 | 950 | ]) |
0067eb06 | 951 | SQUID_DEFINE_BOOL(USE_WCCPv2,${enable_wccpv2:=yes}, |
1a6b111a FC |
952 | [Define to enable WCCP V2]) |
953 | AC_MSG_NOTICE([Web Cache Coordination V2 Protocol enabled: $enable_wccpv2]) | |
320e9f36 | 954 | |
e5f4e1b0 | 955 | AC_ARG_ENABLE(snmp, |
1d87b6b3 | 956 | AS_HELP_STRING([--disable-snmp],[Disable SNMP monitoring support]), [ |
ec308e40 | 957 | SQUID_YESNO([$enableval],[--enable-snmp]) |
87630341 | 958 | ]) |
0067eb06 | 959 | SQUID_DEFINE_BOOL(SQUID_SNMP,${enable_snmp:=yes}, |
1a6b111a | 960 | [Define to enable SNMP monitoring of Squid]) |
f738d783 | 961 | AM_CONDITIONAL(ENABLE_SNMP, [test "x$enable_snmp" = "xyes"]) |
a1c22363 | 962 | AS_IF([test "x$enable_snmp" = "xyes"],[SNMPLIB="../lib/snmplib/libsnmplib.la"]) |
1a6b111a | 963 | AC_MSG_NOTICE([SNMP support enabled: $enable_snmp]) |
e5f4e1b0 | 964 | AC_SUBST(SNMPLIB) |
e5f4e1b0 | 965 | |
d9180414 | 966 | AC_ARG_ENABLE(cachemgr-hostname, |
5069fb38 FC |
967 | AS_HELP_STRING([--enable-cachemgr-hostname=hostname], |
968 | [Make cachemgr.cgi default to this host. | |
1d87b6b3 | 969 | If unspecified, uses the name of the build-host]), [ |
a1c22363 AJ |
970 | AS_CASE([$enableval], |
971 | [yes],[ | |
972 | AC_DEFINE(CACHEMGR_HOSTNAME,[getfullhostname()], | |
973 | [If you are upset that the cachemgr.cgi form comes up with the hostname field blank, then define this to getfullhostname()]) | |
974 | AC_MSG_NOTICE([Cachemgr default hostname == host where cachemgr runs]) | |
975 | ], | |
976 | [no],[:], | |
977 | [ | |
978 | AC_DEFINE_UNQUOTED(CACHEMGR_HOSTNAME,"${enableval}") | |
979 | AC_MSG_NOTICE([Cachemgr default hostname set to ${enableval}]) | |
980 | ]) | |
e5f4e1b0 | 981 | ]) |
982 | ||
ee0927b6 | 983 | AC_ARG_ENABLE(eui, |
1a6b111a | 984 | AS_HELP_STRING([--disable-eui], |
c8da66ba | 985 | [Disable use of ARP / MAC/ EUI (ether address)]), [ |
ec308e40 | 986 | SQUID_YESNO([$enableval],[--enable-eui]) |
1a6b111a | 987 | ]) |
a1c22363 | 988 | AS_IF([test "x${enable_eui:=yes}" = "xyes"],[ |
195ec847 AJ |
989 | SQUID_STATE_SAVE(LIBEUI) |
990 | # GLIBC 2.30 deprecates sysctl.h. Test with the same flags that (may) break includes later. | |
991 | CFLAGS=$SQUID_CFLAGS | |
992 | CXXFLAGS=$SQUID_CXXFLAGS | |
a1c22363 AJ |
993 | AS_CASE(["$squid_host_os"], |
994 | [linux|solaris|freebsd|openbsd|netbsd|cygwin],[:], | |
995 | [mingw],[EUILIB="-liphlpapi"], | |
996 | [AC_MSG_WARN([EUI support probably will not work on host $host.])] | |
997 | ) | |
b966288b | 998 | # iphlpapi.h check delayed after winsock2.h |
507ca601 | 999 | AC_CHECK_HEADERS( \ |
32341684 | 1000 | windows.h \ |
507ca601 | 1001 | sys/sockio.h \ |
32341684 AJ |
1002 | sys/param.h, |
1003 | [], [], [[ | |
1004 | #if HAVE_WINDOWS_H | |
1005 | include <windows.h> | |
54d47324 | 1006 | #endif |
32341684 | 1007 | ]] |
507ca601 | 1008 | ) |
29759678 FC |
1009 | AC_CHECK_HEADERS( \ |
1010 | net/if_arp.h \ | |
9603207d | 1011 | net/route.h, |
29759678 FC |
1012 | [], [], [[ |
1013 | #include <sys/types.h> | |
1014 | #include <sys/socket.h> | |
1015 | ]]) | |
1016 | ||
43c1320a AJ |
1017 | # OpenBSD, FreeBSD and NetBSD requires sys/param.h to be included before sysctl.h and net/if_dl.h |
1018 | AC_CHECK_HEADERS( \ | |
1019 | net/if_dl.h \ | |
1020 | sys/sysctl.h, | |
1021 | [], [], [[ | |
54d47324 | 1022 | #if HAVE_SYS_PARAM_H |
29759678 FC |
1023 | #include <sys/param.h> |
1024 | #endif | |
1025 | ]]) | |
195ec847 | 1026 | SQUID_STATE_ROLLBACK(LIBEUI) |
a1c22363 | 1027 | ]) |
2ef664d8 | 1028 | AC_SUBST(EUILIB) |
1a6b111a | 1029 | AC_MSG_NOTICE([EUI (MAC address) controls enabled: $enable_eui]) |
0067eb06 | 1030 | SQUID_DEFINE_BOOL(USE_SQUID_EUI,$enable_eui, |
1a6b111a | 1031 | [Define this to include code which lets you use ethernet addresses. This code uses API initially defined in 4.4-BSD.]) |
8aafbbc1 | 1032 | AM_CONDITIONAL(ENABLE_EUI, [test "x$enable_eui" = "xyes" ]) |
1a6b111a | 1033 | |
e5f4e1b0 | 1034 | |
74075210 | 1035 | AC_ARG_ENABLE(htcp, |
47d80734 | 1036 | AS_HELP_STRING([--disable-htcp],[Disable HTCP protocol support]), [ |
ec308e40 | 1037 | SQUID_YESNO([$enableval],[--enable-htcp]) |
74075210 | 1038 | ]) |
0f658b5b | 1039 | SQUID_DEFINE_BOOL(USE_HTCP,${enable_htcp:=yes}, |
47d80734 | 1040 | [Define this to include code for the Hypertext Cache Protocol (HTCP)]) |
fcabe077 | 1041 | AM_CONDITIONAL(ENABLE_HTCP, [test "x$enable_htcp" = "xyes"]) |
1a6b111a FC |
1042 | AC_MSG_NOTICE([HTCP support enabled: $enable_htcp]) |
1043 | ||
09cd7204 | 1044 | # Cryptograhic libraries |
24531401 | 1045 | SQUID_AUTO_LIB(nettle,[Nettle crypto],[LIBNETTLE]) |
a1c22363 | 1046 | AS_IF(test "x$with_nettle" != "xno"],[ |
b12b66cd AJ |
1047 | SQUID_STATE_SAVE(squid_nettle_state) |
1048 | PKG_CHECK_MODULES([LIBNETTLE],[nettle >= 3.4],[],[ | |
1049 | CPPFLAGS="$LIBNETTLE_CFLAGS $CPPFLAGS" | |
1050 | AC_CHECK_LIB(nettle,[nettle_md5_init],[LIBNETTLE_LIBS="-lnettle"]) | |
1051 | ]) | |
1052 | AC_CHECK_HEADERS(nettle/base64.h nettle/md5.h) | |
1053 | SQUID_CHECK_NETTLE_BASE64 | |
1054 | SQUID_STATE_ROLLBACK(squid_nettle_state) | |
1055 | AS_IF([test "x$LIBNETTLE_LIBS" != "x"],[ | |
1056 | CXXFLAGS="$LIBNETTLE_CFLAGS $CXXFLAGS" | |
1057 | LIBNETTLE_LIBS="$LIBNETTLE_PATH $LIBNETTLE_LIBS" | |
1058 | ],[test "x$with_nettle" = "xyes"],[ | |
1059 | AC_MSG_ERROR([Required library nettle not found]) | |
1060 | ],[ | |
1061 | AC_MSG_NOTICE([Library nettle not found.]) | |
a1c22363 AJ |
1062 | ]) |
1063 | ]) | |
09cd7204 | 1064 | AC_MSG_NOTICE([Using Nettle cryptographic library: ${with_nettle:=yes}]) |
b12b66cd | 1065 | AC_SUBST(LIBNETTLE_LIBS) |
a9dfcab8 | 1066 | |
e59a64d7 AJ |
1067 | dnl Check for libcrypt |
1068 | CRYPTLIB= | |
1069 | dnl Some of our helpers use crypt(3) which may be in libc, or in | |
1070 | dnl libcrypt (eg FreeBSD) | |
1071 | AC_CHECK_LIB(crypt, crypt, [CRYPTLIB="-lcrypt"]) | |
1072 | dnl Solaris10 provides MD5 natively through libmd5 | |
1073 | AC_CHECK_LIB(md5, MD5Init, [CRYPTLIB="$CRYPTLIB -lmd5"]) | |
1074 | AC_SUBST(CRYPTLIB) | |
1075 | ||
b4f805f6 AJ |
1076 | SSLLIB="" |
1077 | ||
24531401 | 1078 | SQUID_AUTO_LIB(gnutls,[GnuTLS crypto],[LIBGNUTLS]) |
b4f805f6 | 1079 | AH_TEMPLATE(USE_GNUTLS,[GnuTLS support is available]) |
a1c22363 | 1080 | AS_IF([test "x$with_gnutls" != "xno"],[ |
7c760558 | 1081 | SQUID_STATE_SAVE(squid_gnutls_state) |
b4f805f6 AJ |
1082 | |
1083 | # User may have provided a custom location for GnuTLS. Otherwise... | |
24531401 | 1084 | CPPFLAGS="$LIBGNUTLS_CFLAGS $CPPFLAGS" |
b4f805f6 AJ |
1085 | LIBS="$LIBS $LIBGNUTLS_PATH" |
1086 | ||
1087 | # auto-detect using pkg-config | |
516ec633 | 1088 | PKG_CHECK_MODULES([LIBGNUTLS],[gnutls >= 3.4.0],[ |
7c760558 FC |
1089 | CPPFLAGS="$CPPFLAGS $LIBGNUTLS_CFLAGS" |
1090 | ],[ | |
b4f805f6 | 1091 | ## find the package without pkg-config |
c113986e | 1092 | ## check that the library is actually new enough. |
516ec633 AJ |
1093 | ## by testing for a 3.4.0+ function which we use |
1094 | AC_CHECK_LIB(gnutls,gnutls_pcert_export_x509,[LIBGNUTLS_LIBS="-lgnutls"]) | |
b4f805f6 | 1095 | ]) |
71d109d4 FC |
1096 | # if any of the required headers is not found, signal we can't support gnutls |
1097 | AC_CHECK_HEADERS([gnutls/gnutls.h gnutls/x509.h gnutls/abstract.h], [], [LIBGNUTLS_LIBS=""]) | |
b4f805f6 AJ |
1098 | |
1099 | SQUID_STATE_ROLLBACK(squid_gnutls_state) #de-pollute LIBS | |
1100 | ||
a1c22363 | 1101 | AS_IF([test "x$with_gnutls" = "xyes" -a "x$LIBGNUTLS_LIBS" = "x"],[ |
b4f805f6 | 1102 | AC_MSG_ERROR([Required GnuTLS library not found]) |
a1c22363 AJ |
1103 | ]) |
1104 | AS_IF([test "x$LIBGNUTLS_LIBS" != "x"],[ | |
b4f805f6 AJ |
1105 | CXXFLAGS="$LIBGNUTLS_CFLAGS $CXXFLAGS" |
1106 | SSLLIB="$LIBGNUTLS_PATH $LIBGNUTLS_LIBS $SSLLIB" | |
1107 | AC_DEFINE(USE_GNUTLS,1,[GnuTLS support is available]) | |
a1c22363 | 1108 | ],[ |
b4f805f6 | 1109 | with_gnutls=no |
a1c22363 AJ |
1110 | ]) |
1111 | ]) | |
b4f805f6 AJ |
1112 | AC_MSG_NOTICE([GnuTLS library support: ${with_gnutls:=auto} ${LIBGNUTLS_PATH} ${LIBGNUTLS_LIBS}]) |
1113 | ||
3d4022fa | 1114 | dnl User may specify OpenSSL is needed from a non-standard location |
24531401 | 1115 | SQUID_OPTIONAL_LIB(openssl,[OpenSSL],[LIBOPENSSL]) |
cb4f4424 | 1116 | AH_TEMPLATE(USE_OPENSSL,[OpenSSL support is available]) |
c41db002 | 1117 | ## OpenSSL is default disable due to licensing issues on some OS |
a1c22363 | 1118 | AS_IF([test "x$with_openssl" = "xyes"],[ |
24531401 | 1119 | CPPFLAGS="$LIBOPENSSL_CFLAGS $CPPFLAGS" |
c41db002 | 1120 | AC_CHECK_HEADERS( \ |
24b30fdc | 1121 | openssl/asn1.h \ |
8693472e | 1122 | openssl/bio.h \ |
24b30fdc | 1123 | openssl/bn.h \ |
eacc1666 | 1124 | openssl/crypto.h \ |
742236c7 | 1125 | openssl/decoder.h \ |
24b30fdc | 1126 | openssl/dh.h \ |
c41db002 | 1127 | openssl/err.h \ |
24b30fdc EQ |
1128 | openssl/evp.h \ |
1129 | openssl/lhash.h \ | |
c41db002 AJ |
1130 | openssl/md5.h \ |
1131 | openssl/opensslv.h \ | |
24b30fdc | 1132 | openssl/rsa.h \ |
c41db002 | 1133 | openssl/ssl.h \ |
24b30fdc | 1134 | openssl/x509.h \ |
c41db002 AJ |
1135 | openssl/x509v3.h \ |
1136 | openssl/engine.h \ | |
1137 | openssl/txt_db.h \ | |
1138 | ) | |
1139 | ||
e0b98074 | 1140 | # User may have provided a custom location for OpenSSL. Otherwise... |
84c3fc14 AJ |
1141 | SQUID_STATE_SAVE(squid_openssl_state) |
1142 | LIBS="$LIBS $LIBOPENSSL_PATH" | |
1143 | ||
1144 | # auto-detect using pkg-config | |
1145 | PKG_CHECK_MODULES([LIBOPENSSL],[openssl],,[ | |
1146 | ## For some OS pkg-config is broken or unavailable. | |
1147 | ## Detect libraries the hard way. | |
1148 | ||
1149 | # Windows MinGW has some special libraries ... | |
a1c22363 | 1150 | AS_IF([test "x$squid_host_os" = "xmingw"],[ |
84c3fc14 AJ |
1151 | LIBOPENSSL_LIBS='-lssleay32 -leay32 -lgdi32 $LIBOPENSSL_LIBS' |
1152 | AC_MSG_NOTICE([Windows OpenSSL library support: yes -lssleay32 -leay32 -lgdi32]) | |
a1c22363 | 1153 | ]) |
e0b98074 | 1154 | |
84c3fc14 AJ |
1155 | AC_CHECK_LIB(crypto,[CRYPTO_new_ex_data],[LIBOPENSSL_LIBS="-lcrypto $LIBOPENSSL_LIBS"],[ |
1156 | AC_MSG_ERROR([library 'crypto' is required for OpenSSL]) | |
37a20074 | 1157 | ],$LIBOPENSSL_LIBS) |
403c4682 | 1158 | AC_CHECK_LIB(ssl,[SSL_CTX_new],[LIBOPENSSL_LIBS="-lssl $LIBOPENSSL_LIBS"],[ |
84c3fc14 | 1159 | AC_MSG_ERROR([library 'ssl' is required for OpenSSL]) |
37a20074 | 1160 | ],$LIBOPENSSL_LIBS) |
84c3fc14 | 1161 | ]) |
e0b98074 | 1162 | |
84c3fc14 | 1163 | # This is a workaround for RedHat 9 brain damage.. |
a1c22363 | 1164 | AS_IF([test -d /usr/kerberos/include -a -f /usr/include/openssl/kssl.h],[ |
84c3fc14 AJ |
1165 | AC_MSG_NOTICE([OpenSSL depends on Kerberos]) |
1166 | LIBOPENSSL_LIBS="-L/usr/kerberos/lib $LIBOPENSSL_LIBS" | |
1167 | CPPFLAGS="$CPPFLAGS -I/usr/kerberos/include" | |
a1c22363 | 1168 | ]) |
84c3fc14 | 1169 | SQUID_STATE_ROLLBACK(squid_openssl_state) #de-pollute LIBS |
1f7c9178 | 1170 | |
a1c22363 | 1171 | AS_IF([test "x$LIBOPENSSL_LIBS" != "x"],[ |
c41db002 | 1172 | CXXFLAGS="$LIBOPENSSL_CFLAGS $CXXFLAGS" |
84c3fc14 | 1173 | SSLLIB="$LIBOPENSSL_PATH $LIBOPENSSL_LIBS $SSLLIB" |
cb4f4424 | 1174 | AC_DEFINE(USE_OPENSSL,1,[OpenSSL support is available]) |
c41db002 | 1175 | |
b8649ee4 | 1176 | # check for API functions |
17e98f24 AJ |
1177 | SQUID_CHECK_LIBCRYPTO_API |
1178 | SQUID_CHECK_LIBSSL_API | |
8d56fe55 | 1179 | SQUID_CHECK_OPENSSL_TLS_METHODS |
b8649ee4 CT |
1180 | SQUID_STATE_SAVE(check_SSL_CTX_get0_certificate) |
1181 | LIBS="$LIBS $SSLLIB" | |
1182 | AC_CHECK_LIB(ssl, SSL_CTX_get0_certificate, [ | |
1183 | AC_DEFINE(HAVE_SSL_CTX_GET0_CERTIFICATE, 1, [SSL_CTX_get0_certificate is available]) | |
1184 | ], [ | |
1185 | missing_SSL_CTX_get0_certificate=yes | |
1186 | ]) | |
1187 | SQUID_STATE_ROLLBACK(check_SSL_CTX_get0_certificate) | |
1188 | ||
c41db002 | 1189 | # check for other specific broken implementations |
a1c22363 | 1190 | AS_IF([test "x$missing_SSL_CTX_get0_certificate" = "xyes"],SQUID_CHECK_OPENSSL_GETCERTIFICATE_WORKS) |
c41db002 | 1191 | SQUID_CHECK_OPENSSL_CONST_SSL_METHOD |
7d841344 AJ |
1192 | SQUID_CHECK_OPENSSL_CONST_CRYPTO_EX_DATA |
1193 | SQUID_CHECK_OPENSSL_CONST_SSL_SESSION_CB_ARG | |
70cfe22f | 1194 | SQUID_CHECK_OPENSSL_CONST_X509_GET0_SIGNATURE_ARGS |
c41db002 | 1195 | SQUID_CHECK_OPENSSL_TXTDB |
a1c22363 AJ |
1196 | ]) |
1197 | AS_IF([test "x$SSLLIB" = "x"],[AC_MSG_ERROR([Required OpenSSL library not found])]) | |
1198 | ]) | |
84c3fc14 | 1199 | AC_MSG_NOTICE([OpenSSL library support: ${with_openssl:=no} ${LIBOPENSSL_PATH} ${LIBOPENSSL_LIBS}]) |
c41db002 | 1200 | AM_CONDITIONAL(ENABLE_SSL,[ test "x$with_openssl" = "xyes" ]) |
1f7c9178 | 1201 | AC_SUBST(SSLLIB) |
1202 | ||
1a22a39e | 1203 | dnl User may specify MIT Kerberos is needed from a non-standard location |
24531401 | 1204 | SQUID_AUTO_LIB(mit-krb5,[MIT Kerberos],[LIB_KRB5]) |
75f3c557 | 1205 | AH_TEMPLATE(USE_APPLE_KRB5,[Apple Kerberos support is available]) |
1a22a39e MM |
1206 | AH_TEMPLATE(USE_MIT_KRB5,[MIT Kerberos support is available]) |
1207 | AH_TEMPLATE(USE_SOLARIS_KRB5,[Solaris Kerberos support is available]) | |
1208 | ||
75c5f82b | 1209 | ## find out if pkg-config or krb5-config will work |
a1c22363 | 1210 | AS_IF([test "x$with_mit_krb5" != "xno"],[ |
24531401 AJ |
1211 | CXXFLAGS="$LIB_KRB5_CFLAGS $CXXFLAGS" |
1212 | krb5confpath="$with_mit_krb5/bin" | |
1a22a39e | 1213 | # find installed libs via pkg-config or krb5-config |
75c5f82b | 1214 | squid_pc_krb5_name= |
7c664dbc AJ |
1215 | PKG_CHECK_EXISTS(mit-krb5-gssapi mit-krb5, [squid_pc_krb5_name="mit-krb5-gssapi mit-krb5"],[ |
1216 | PKG_CHECK_EXISTS(gssapi-krb5 krb5, [squid_pc_krb5_name="gssapi-krb5 krb5"]) | |
1217 | ]) | |
a1c22363 | 1218 | AS_IF([test "x$squid_pc_krb5_name" = "x" -a "$cross_compiling" = "no"],[ |
77f4953d | 1219 | # Look for krb5-config (unless cross-compiling) |
c4b12583 | 1220 | AC_PATH_PROG(krb5_config,krb5-config,no,$krb5confpath) |
a1c22363 | 1221 | AS_IF([test "x$ac_cv_path_krb5_config" != "xno"],[ |
1a22a39e MM |
1222 | krb5confpath="`dirname $ac_cv_path_krb5_config`" |
1223 | ac_heimdal="`$ac_cv_path_krb5_config --version 2>/dev/null | grep -c -i heimdal`" | |
1224 | ac_solaris="`$ac_cv_path_krb5_config --version 2>/dev/null | grep -c -i solaris`" | |
75f3c557 | 1225 | ac_apple="`$ac_cv_path_krb5_config --vendor 2>/dev/null | grep -c -i apple`" |
a1c22363 AJ |
1226 | AS_IF([test $ac_solaris -gt 0],[with_solaris_krb5=yes], |
1227 | [test $ac_apple -gt 0],[with_apple_krb5=yes], | |
1228 | [test $ac_heimdal -gt 0],[with_mit_krb5=no] | |
1229 | ) | |
1230 | ],[ | |
1231 | AS_IF([test "x$with_mit_krb5" = "xyes"],[ | |
75c5f82b | 1232 | AC_MSG_ERROR([Could not find krb5-config in path]) |
a1c22363 | 1233 | ],[ |
75c5f82b | 1234 | with_mit_krb5=no |
a1c22363 AJ |
1235 | ]) |
1236 | ]) | |
1237 | ]) | |
1238 | ]) | |
1a22a39e | 1239 | |
ed3a42d0 | 1240 | # detect MIT Kerberos dependencies (except on Solaris) |
a1c22363 | 1241 | AS_IF([test "x$with_mit_krb5" != "xno" -a "x$with_solaris_krb5" != "xyes"],[ |
1a22a39e MM |
1242 | SQUID_STATE_SAVE([squid_krb5_save]) |
1243 | LIBS="$LIBS $LIB_KRB5_PATH" | |
1244 | ||
1245 | # auto-detect using pkg-config | |
75c5f82b | 1246 | PKG_CHECK_MODULES([LIB_KRB5], $squid_pc_krb5_name,,[ |
77f4953d | 1247 | # look for krb5-config (unless cross-compiling) |
a1c22363 AJ |
1248 | AS_IF([test "$cross_compiling" = "no"],[ |
1249 | AS_IF([test "x$krb5confpath" = "x"],[ | |
77f4953d | 1250 | AC_PATH_PROG(krb5_config,krb5-config,no) |
a1c22363 AJ |
1251 | AS_IF([test "x$ac_cv_path_krb5_config" != "xno"],[ac_krb5_config="$ac_cv_path_krb5_config"]) |
1252 | ],[ | |
77f4953d | 1253 | ac_krb5_config="$krb5confpath/krb5-config" |
a1c22363 AJ |
1254 | ]) |
1255 | ]) | |
1256 | AS_IF([test "x$ac_krb5_config" != "x" -a -x "$ac_krb5_config"],[ | |
1a22a39e MM |
1257 | # Get libs, etc |
1258 | AC_MSG_NOTICE([Use krb5-config to get CXXFLAGS and LIBS]) | |
1259 | LIB_KRB5_CFLAGS="`$ac_krb5_config --cflags krb5 2>/dev/null`" | |
1260 | LIB_KRB5_LIBS="`$ac_krb5_config --libs krb5 2>/dev/null`" | |
1261 | LIB_KRB5_CFLAGS="`$ac_krb5_config --cflags gssapi 2>/dev/null` $LIB_KRB5_CFLAGS" | |
1262 | LIB_KRB5_LIBS="`$ac_krb5_config --libs gssapi 2>/dev/null` $LIB_KRB5_LIBS" | |
a1c22363 | 1263 | ],[ |
1a22a39e MM |
1264 | ## For some OS pkg-config is broken or unavailable. |
1265 | ## Detect libraries the hard way. | |
1266 | ||
b2bdde72 | 1267 | SQUID_STATE_SAVE([squid_mit_save]) |
ff78f3c3 | 1268 | missing_required= |
1a22a39e MM |
1269 | AC_MSG_NOTICE([Try to find Kerberos libraries in given path]) |
1270 | AC_CHECK_LIB(com_err, [main], [LIB_KRB5_LIBS="-lcom_err $LIB_KRB5_LIBS"],[ | |
ff78f3c3 AJ |
1271 | AC_MSG_WARN([library 'com_err' is required for MIT Kerberos]) |
1272 | missing_required=yes | |
1a22a39e | 1273 | ]) |
b2bdde72 | 1274 | LIBS=$LIB_KRB5_LIBS |
1a22a39e | 1275 | AC_CHECK_LIB(k5crypto, [main], [LIB_KRB5_LIBS="-lk5crypto $LIB_KRB5_LIBS"],[ |
ff78f3c3 AJ |
1276 | AC_MSG_WARN([library 'k5crypto' is required for MIT Kerberos]) |
1277 | missing_required=yes | |
1a22a39e | 1278 | ]) |
b2bdde72 | 1279 | LIBS=$LIB_KRB5_LIBS |
1a22a39e | 1280 | AC_CHECK_LIB(krb5, [main], [LIB_KRB5_LIBS="-lkrb5 $LIB_KRB5_LIBS"],[ |
ff78f3c3 AJ |
1281 | AC_MSG_WARN([library 'krb5' is required for MIT Kerberos]) |
1282 | missing_required=yes | |
1a22a39e | 1283 | ]) |
b2bdde72 | 1284 | LIBS=$LIB_KRB5_LIBS |
1a22a39e | 1285 | AC_CHECK_LIB(gssapi_krb5, [main], [LIB_KRB5_LIBS="-lgssapi_krb5 $LIB_KRB5_LIBS"],[ |
ff78f3c3 AJ |
1286 | AC_MSG_WARN([library 'gssapi_krb5' is required for MIT Kerberos]) |
1287 | missing_required=yes | |
1a22a39e | 1288 | ]) |
b2bdde72 | 1289 | SQUID_STATE_ROLLBACK([squid_mit_save]) |
a1c22363 AJ |
1290 | AS_IF([test "x$missing_required" = "xyes"],[LIB_KRB5_LIBS=""]) |
1291 | ]) | |
1a22a39e MM |
1292 | ]) |
1293 | ||
a1c22363 AJ |
1294 | AS_IF([test "x$LIB_KRB5_LIBS" != "x"],[ |
1295 | AS_IF([test "x$with_apple_krb5" = "xyes"],[ | |
75f3c557 | 1296 | AC_DEFINE(USE_APPLE_KRB5,1,[Apple Kerberos support is available]) |
9603207d | 1297 | KRB5_FLAVOUR="Apple" |
a1c22363 | 1298 | ],[ |
75f3c557 | 1299 | AC_DEFINE(USE_MIT_KRB5,1,[MIT Kerberos support is available]) |
9603207d | 1300 | KRB5_FLAVOUR="MIT" |
a1c22363 | 1301 | ]) |
1a22a39e MM |
1302 | KRB5LIBS="$LIB_KRB5_PATH $LIB_KRB5_LIBS $KRB5LIBS" |
1303 | KRB5INCS="$LIB_KRB5_CFLAGS" | |
9603207d | 1304 | |
1a22a39e MM |
1305 | # check for other specific broken implementations |
1306 | CXXFLAGS="$CXXFLAGS $KRB5INCS" | |
1307 | LIBS="$LIBS $KRB5LIBS" | |
1308 | ||
1309 | AC_MSG_NOTICE([Try to find Kerberos headers in given path]) | |
1310 | AC_CHECK_HEADERS(gssapi.h gssapi/gssapi.h gssapi/gssapi_krb5.h) | |
1311 | AC_CHECK_HEADERS(gssapi/gssapi_generic.h) | |
1312 | AC_CHECK_HEADERS(krb5.h com_err.h et/com_err.h) | |
1313 | AC_CHECK_HEADERS(profile.h) | |
1314 | ||
1a22a39e | 1315 | SQUID_CHECK_KRB5_FUNCS |
a1c22363 AJ |
1316 | ]) |
1317 | AS_IF([test "x$with_mit_krb5" = "xyes" -a "x$KRB5LIBS" = "x"],[ | |
1a22a39e | 1318 | AC_MSG_ERROR([Required Kerberos library not found]) |
a1c22363 | 1319 | ],[test "x$KRB5LIBS" = "x"],[ |
75c5f82b AJ |
1320 | with_mit_krb5=no |
1321 | with_apple_krb5=no | |
a1c22363 | 1322 | ]) |
1a22a39e | 1323 | SQUID_STATE_ROLLBACK([squid_krb5_save]) |
a1c22363 | 1324 | ]) |
1a22a39e | 1325 | |
75c5f82b | 1326 | # detect Solaris Kerberos dependencies |
a1c22363 | 1327 | AS_IF([test "x$with_solaris_krb5" = "xyes" -a "x$KRB5LIBS" = "x"],[ |
1a22a39e MM |
1328 | SQUID_STATE_SAVE([squid_krb5_save]) |
1329 | LIBS="$LIBS $LIB_KRB5_PATH" | |
1330 | ||
1331 | # no pkg-config for solaris native Kerberos | |
77f4953d | 1332 | # look for krb5-config (unless cross-compiling) |
a1c22363 AJ |
1333 | AS_IF([test "$cross_compiling" = "no"],[ |
1334 | AS_IF([test "x$krb5confpath" = "x"],[ | |
77f4953d | 1335 | AC_PATH_PROG(krb5_config,krb5-config,no) |
a1c22363 AJ |
1336 | AS_IF([test "x$ac_cv_path_krb5_config" != "xno"],[ac_krb5_config="$ac_cv_path_krb5_config"]) |
1337 | ],[ | |
77f4953d | 1338 | ac_krb5_config="$krb5confpath/krb5-config" |
a1c22363 AJ |
1339 | ]) |
1340 | ]) | |
1341 | AS_IF([test "x$ac_krb5_config" != "x" -a -x "$ac_krb5_config"],[ | |
1a22a39e MM |
1342 | # Get libs, etc |
1343 | AC_MSG_NOTICE([Use krb5-config to get CXXFLAGS and LIBS]) | |
1344 | LIB_KRB5_CFLAGS="`$ac_krb5_config --cflags krb5 2>/dev/null`" | |
1345 | LIB_KRB5_LIBS="`$ac_krb5_config --libs krb5 2>/dev/null`" | |
b2da83da AJ |
1346 | # Solaris 10 Update 11 patches the krb5-config tool to produce stderr messages on stdout. |
1347 | SOLARIS_BROKEN_KRB5CONFIG_GSSAPI="`$ac_krb5_config --libs gssapi 2>/dev/null | grep "krb5-config"`" | |
a1c22363 | 1348 | AS_IF([test "x$SOLARIS_BROKEN_KRB5CONFIG_GSSAPI" = "x"],[ |
b2da83da AJ |
1349 | LIB_KRB5_CFLAGS="`$ac_krb5_config --cflags gssapi 2>/dev/null` $LIB_KRB5_CFLAGS" |
1350 | LIB_KRB5_LIBS="`$ac_krb5_config --libs gssapi 2>/dev/null` $LIB_KRB5_LIBS" | |
a1c22363 AJ |
1351 | ]) |
1352 | ],[ | |
1a22a39e MM |
1353 | ## For some OS pkg-config is broken or unavailable. |
1354 | ## Detect libraries the hard way. | |
1355 | ||
1356 | CXXFLAGS="-I/usr/include/kerberosv5 $CXXFLAGS" | |
1357 | ||
b2bdde72 | 1358 | SQUID_STATE_SAVE([squid_solaris_save]) |
ff78f3c3 | 1359 | missing_required= |
1a22a39e MM |
1360 | AC_MSG_NOTICE([Try to find Kerberos libraries in given path]) |
1361 | AC_CHECK_LIB(krb5, [main], [LIB_KRB5_LIBS="-lkrb5 $LIB_KRB5_LIBS"],[ | |
ff78f3c3 AJ |
1362 | AC_MSG_WARN([library 'krb5' is required for Solaris Kerberos]) |
1363 | missing_required=yes | |
1a22a39e | 1364 | ]) |
b2bdde72 | 1365 | LIBS=$LIB_KRB5_LIBS |
1a22a39e | 1366 | AC_CHECK_LIB(gss, [main], [LIB_KRB5_LIBS="-lgss $LIB_KRB5_LIBS"],[ |
ff78f3c3 AJ |
1367 | AC_MSG_WARN([library 'gss' is required for Solaris Kerberos]) |
1368 | missing_required=yes | |
1a22a39e | 1369 | ]) |
b2bdde72 | 1370 | SQUID_STATE_ROLLBACK([squid_solaris_save]) |
a1c22363 AJ |
1371 | AS_IF([test "x$missing_required" = "xyes"],[LIB_KRB5_LIBS=""]) |
1372 | ]) | |
1a22a39e | 1373 | |
a1c22363 | 1374 | AS_IF([test "x$LIB_KRB5_LIBS" != "x"],[ |
1a22a39e MM |
1375 | KRB5LIBS="$LIB_KRB5_PATH $LIB_KRB5_LIBS $KRB5LIBS" |
1376 | KRB5INCS="$LIB_KRB5_CFLAGS" | |
1377 | AC_DEFINE(USE_SOLARIS_KRB5,1,[Solaris Kerberos support is available]) | |
9603207d | 1378 | KRB5_FLAVOUR="Solaris" |
1379 | ||
1a22a39e MM |
1380 | # check for other specific broken implementations |
1381 | CXXFLAGS="$CXXFLAGS $KRB5INCS" | |
1382 | LIBS="$LIBS $KRB5LIBS" | |
1383 | ||
1384 | AC_MSG_NOTICE([Try to find Kerberos headers in given path]) | |
1385 | AC_CHECK_HEADERS(gssapi/gssapi.h gssapi/gssapi_ext.h) | |
1386 | AC_CHECK_HEADERS(krb5.h com_err.h) | |
1387 | ||
1388 | SQUID_CHECK_KRB5_SOLARIS_BROKEN_KRB5_H | |
a1c22363 | 1389 | AS_IF([test "x$squid_cv_broken_krb5_h" = "xyes"],[ |
1a22a39e MM |
1390 | AC_DEFINE(HAVE_BROKEN_SOLARIS_KRB5_H, 1, [Define to 1 if Solaris krb5.h is broken for C++]) |
1391 | AC_MSG_WARN([You have a broken Solaris <krb5.h> system include.]) | |
1392 | AC_MSG_WARN([Please see http://bugs.opensolaris.org/bugdatabase/view_bug.do?bug_id=6837512]) | |
1393 | AC_MSG_WARN([If you need Kerberos support you will have to patch]) | |
1394 | AC_MSG_WARN([your system. See contrib/solaris/solaris-krb5-include.patch]) | |
a1c22363 | 1395 | ]) |
1a22a39e | 1396 | SQUID_CHECK_KRB5_FUNCS |
a1c22363 AJ |
1397 | ]) |
1398 | AS_IF([test "x$with_mit_krb5" = "xyes" -a "x$KRB5LIBS" = "x"],[ | |
75c5f82b | 1399 | # Error only if Solaris flavour was detected while looking for required MIT Kerberos |
1a22a39e | 1400 | AC_MSG_ERROR([Required Kerberos library not found]) |
a1c22363 | 1401 | ],[test "x$KRB5LIBS" = "x"],[ |
75c5f82b AJ |
1402 | with_solaris_krb5=no |
1403 | with_mit_krb5=no | |
a1c22363 | 1404 | ]) |
1a22a39e | 1405 | SQUID_STATE_ROLLBACK([squid_krb5_save]) |
a1c22363 | 1406 | ]) |
1a22a39e | 1407 | |
75c5f82b | 1408 | dnl User may specify Heimdal Kerberos is needed from a non-standard location |
24531401 | 1409 | SQUID_AUTO_LIB(heimdal-krb5,[Heimdal Kerberos],[LIB_KRB5]) |
75c5f82b | 1410 | AH_TEMPLATE(USE_HEIMDAL_KRB5,[Heimdal Kerberos support is available]) |
a1c22363 | 1411 | AS_IF([test "x$with_heimdal_krb5" != "xno" -a "x$KRB5LIBS" = "x"],[ |
24531401 AJ |
1412 | CXXFLAGS="$LIB_KRB5_CFLAGS $CXXFLAGS" |
1413 | krb5confpath="$with_heimdal_krb5/bin" | |
75c5f82b AJ |
1414 | # find installed libs via pkg-config or krb5-config |
1415 | PKG_CHECK_EXISTS(heimdal-krb5, [squid_pc_krb5_name="heimdal-krb5"]) | |
a1c22363 | 1416 | AS_IF([test "x$squid_pc_krb5_name" = "x"],[ |
75c5f82b | 1417 | PKG_CHECK_EXISTS(heimdal-gssapi, [squid_pc_krb5_name="heimdal-gssapi"]) |
a1c22363 AJ |
1418 | ]) |
1419 | AS_IF([test "x$squid_pc_krb5_name" = "x" -a "$cross_compiling" = "no"],[ | |
75c5f82b | 1420 | # Look for krb5-config (unless cross-compiling) |
c4b12583 | 1421 | AC_PATH_PROG(krb5_config,krb5-config,no,$krb5confpath) |
a1c22363 | 1422 | AS_IF([test "x$ac_cv_path_krb5_config" != "xno"],[ |
75c5f82b AJ |
1423 | krb5confpath="`dirname $ac_cv_path_krb5_config`" |
1424 | ac_heimdal="`$ac_cv_path_krb5_config --version 2>/dev/null | grep -c -i heimdal`" | |
a1c22363 | 1425 | AS_IF([test "x$with_heimdal_krb5" = "xyes" -a $ac_heimdal = 0],[ |
75c5f82b | 1426 | AC_MSG_ERROR([Could not find pkg-config or krb5-config for Heimdal Kerberos]) |
a1c22363 AJ |
1427 | ]) |
1428 | ],[ | |
1429 | AS_IF([test "x$with_heimdal_krb5" = "xyes"],[ | |
75c5f82b | 1430 | AC_MSG_ERROR([Could not find krb5-config in path]) |
a1c22363 | 1431 | ],[ |
75c5f82b AJ |
1432 | AC_MSG_WARN([Could not find krb5-config in path]) |
1433 | with_heimdal_krb5=no | |
a1c22363 AJ |
1434 | ]) |
1435 | ]) | |
1436 | ]) | |
1437 | ]) | |
1438 | AS_IF([test "x$with_heimdal_krb5" != "xno" -a "x$KRB5LIBS" = "x"],[ | |
1a22a39e MM |
1439 | SQUID_STATE_SAVE([squid_krb5_save]) |
1440 | LIBS="$LIBS $LIB_KRB5_PATH" | |
1441 | ||
1442 | # auto-detect using pkg-config | |
75c5f82b | 1443 | PKG_CHECK_MODULES([LIB_KRB5], $squid_pc_krb5_name,,[ |
77f4953d | 1444 | # look for krb5-config (unless cross-compiling) |
a1c22363 AJ |
1445 | AS_IF([test "$cross_compiling" = "no"],[ |
1446 | AS_IF([test "x$krb5confpath" = "x"],[ | |
77f4953d | 1447 | AC_PATH_PROG(krb5_config,krb5-config,no) |
a1c22363 AJ |
1448 | AS_IF([test "x$ac_cv_path_krb5_config" != "xno"],[ac_krb5_config="$ac_cv_path_krb5_config"]) |
1449 | ],[ | |
77f4953d | 1450 | ac_krb5_config="$krb5confpath/krb5-config" |
a1c22363 AJ |
1451 | ]) |
1452 | ]) | |
1453 | AS_IF([test "x$ac_krb5_config" != "x" -a -x "$ac_krb5_config"],[ | |
1a22a39e MM |
1454 | # Get libs, etc |
1455 | AC_MSG_NOTICE([Use krb5-config to get CXXFLAGS and LIBS]) | |
1456 | LIB_KRB5_CFLAGS="`$ac_krb5_config --cflags krb5 2>/dev/null`" | |
1457 | LIB_KRB5_LIBS="`$ac_krb5_config --libs krb5 2>/dev/null`" | |
1458 | LIB_KRB5_CFLAGS="`$ac_krb5_config --cflags gssapi 2>/dev/null` $LIB_KRB5_CFLAGS" | |
1459 | LIB_KRB5_LIBS="`$ac_krb5_config --libs gssapi 2>/dev/null` $LIB_KRB5_LIBS" | |
a1c22363 | 1460 | ],[ |
1a22a39e MM |
1461 | ## For some OS pkg-config is broken or unavailable. |
1462 | ## Detect libraries the hard way. | |
b2bdde72 | 1463 | SQUID_STATE_SAVE([squid_heimdal_save]) |
87a4a80f | 1464 | missing_required= |
1a22a39e MM |
1465 | AC_MSG_NOTICE([Try to find Kerberos libraries in given path]) |
1466 | AC_CHECK_LIB(resolv, [main], [LIB_KRB5_LIBS="-lresolv $LIB_KRB5_LIBS"],[ | |
87a4a80f AJ |
1467 | AC_MSG_WARN([library 'resolv' is required for Heimdal Kerberos]) |
1468 | missing_required=yes | |
1a22a39e | 1469 | ]) |
b2bdde72 | 1470 | LIBS=$LIB_KRB5_LIBS |
1a22a39e | 1471 | AC_CHECK_LIB(crypt, [main], [LIB_KRB5_LIBS="-lcrypt $LIB_KRB5_LIBS"],[ |
87a4a80f AJ |
1472 | AC_MSG_WARN([library 'crypt' is required for Heimdal Kerberos]) |
1473 | missing_required=yes | |
1a22a39e | 1474 | ]) |
b2bdde72 | 1475 | LIBS=$LIB_KRB5_LIBS |
1a22a39e | 1476 | AC_CHECK_LIB(roken, [main], [LIB_KRB5_LIBS="-lroken $LIB_KRB5_LIBS"],[ |
87a4a80f AJ |
1477 | AC_MSG_WARN([library 'roken' is required for Heimdal Kerberos]) |
1478 | missing_required=yes | |
1a22a39e | 1479 | ]) |
b2bdde72 | 1480 | LIBS=$LIB_KRB5_LIBS |
1a22a39e MM |
1481 | AC_CHECK_LIB(heimbase, [main], [LIB_KRB5_LIBS="-lheimbase $LIB_KRB5_LIBS"],[ |
1482 | AC_MSG_WARN([library 'heimbase' may be required for Heimdal Kerberos]) | |
1483 | ]) | |
b2bdde72 | 1484 | LIBS=$LIB_KRB5_LIBS |
1a22a39e MM |
1485 | AC_CHECK_LIB(wind, [main], [LIB_KRB5_LIBS="-lwind $LIB_KRB5_LIBS"],[ |
1486 | AC_MSG_WARN([library 'wind' may be required for Heimdal Kerberos]) | |
1487 | ]) | |
b2bdde72 | 1488 | LIBS=$LIB_KRB5_LIBS |
1a22a39e | 1489 | AC_CHECK_LIB(crypto, [main], [LIB_KRB5_LIBS="-lcrypto $LIB_KRB5_LIBS"],[ |
87a4a80f AJ |
1490 | AC_MSG_WARN([library 'crypto' is required for Heimdal Kerberos]) |
1491 | missing_required=yes | |
1a22a39e | 1492 | ]) |
b2bdde72 | 1493 | LIBS=$LIB_KRB5_LIBS |
1a22a39e | 1494 | AC_CHECK_LIB(com_err, [main], [LIB_KRB5_LIBS="-lcom_err $LIB_KRB5_LIBS"],[ |
87a4a80f AJ |
1495 | AC_MSG_WARN([library 'com_err' is required for Heimdal Kerberos]) |
1496 | missing_required=yes | |
1a22a39e | 1497 | ]) |
b2bdde72 | 1498 | LIBS=$LIB_KRB5_LIBS |
1a22a39e MM |
1499 | AC_CHECK_LIB(hx509, [main], [LIB_KRB5_LIBS="-lhx509 $LIB_KRB5_LIBS"],[ |
1500 | AC_MSG_WARN([library 'hx509' may be required for Heimdal Kerberos]) | |
1501 | ]) | |
b2bdde72 | 1502 | LIBS=$LIB_KRB5_LIBS |
1a22a39e | 1503 | AC_CHECK_LIB(asn1, [main], [LIB_KRB5_LIBS="-lasn1 $LIB_KRB5_LIBS"],[ |
87a4a80f AJ |
1504 | AC_MSG_WARN([library 'asn1' is required for Heimdal Kerberos]) |
1505 | missing_required=yes | |
1a22a39e | 1506 | ]) |
b2bdde72 | 1507 | LIBS=$LIB_KRB5_LIBS |
1a22a39e | 1508 | AC_CHECK_LIB(krb5, [main], [LIB_KRB5_LIBS="-lkrb5 $LIB_KRB5_LIBS"],[ |
87a4a80f AJ |
1509 | AC_MSG_WARN([library 'krb5' is required for Heimdal Kerberos]) |
1510 | missing_required=yes | |
1a22a39e | 1511 | ]) |
b2bdde72 | 1512 | LIBS=$LIB_KRB5_LIBS |
1a22a39e MM |
1513 | AC_CHECK_LIB(heimntlm, [main], [LIB_KRB5_LIBS="-lheimntlm $LIB_KRB5_LIBS"],[ |
1514 | AC_MSG_WARN([library 'heimntlm' may be required for Heimdal Kerberos]) | |
1515 | ]) | |
b2bdde72 | 1516 | LIBS=$LIB_KRB5_LIBS |
1a22a39e | 1517 | AC_CHECK_LIB(gssapi, [main], [LIB_KRB5_LIBS="-lgssapi $LIB_KRB5_LIBS"],[ |
87a4a80f AJ |
1518 | AC_MSG_WARN([library 'gssapi' is required for Heimdal Kerberos]) |
1519 | missing_required=yes | |
1a22a39e | 1520 | ]) |
b2bdde72 | 1521 | SQUID_STATE_ROLLBACK([squid_heimdal_save]) |
a1c22363 AJ |
1522 | AS_IF([test "x$missing_required" = "xyes"],[LIB_KRB5_LIBS=""]) |
1523 | ]) | |
1a22a39e | 1524 | ]) |
a1c22363 | 1525 | AS_IF([test "x$LIB_KRB5_LIBS" != "x"],[ |
1a22a39e MM |
1526 | KRB5LIBS="$LIB_KRB5_PATH $LIB_KRB5_LIBS $KRB5LIBS" |
1527 | KRB5INCS="$LIB_KRB5_CFLAGS" | |
1528 | AC_DEFINE(USE_HEIMDAL_KRB5,1,[Heimdal Kerberos support is available]) | |
9603207d | 1529 | KRB5_FLAVOUR="Heimdal" |
1530 | ||
1a22a39e MM |
1531 | # check for other specific broken implementations |
1532 | CXXFLAGS="$CXXFLAGS $KRB5INCS" | |
1533 | LIBS="$LIBS $KRB5LIBS" | |
1534 | ||
1535 | AC_MSG_NOTICE([Try to find Kerberos headers in given path]) | |
1536 | AC_CHECK_HEADERS(gssapi.h gssapi/gssapi.h gssapi/gssapi_krb5.h) | |
1537 | AC_CHECK_HEADERS(krb5.h com_err.h et/com_err.h) | |
1538 | ||
1539 | SQUID_CHECK_KRB5_HEIMDAL_BROKEN_KRB5_H | |
a1c22363 | 1540 | AS_IF([test "x$squid_cv_broken_heimdal_krb5_h" = "xyes"],[ |
1a22a39e | 1541 | AC_DEFINE(HAVE_BROKEN_HEIMDAL_KRB5_H, 1, [Define to 1 if Heimdal krb5.h is broken for C++]) |
a1c22363 | 1542 | ]) |
1a22a39e | 1543 | SQUID_CHECK_KRB5_FUNCS |
a1c22363 AJ |
1544 | ]) |
1545 | AS_IF([test "x$KRB5LIBS" = "x"],[ | |
1546 | AS_IF([test "x$with_heimdal_krb5" = "xyes"],[ | |
75c5f82b | 1547 | AC_MSG_ERROR([Required Heimdal Kerberos library not found]) |
a1c22363 | 1548 | ],[ |
75c5f82b | 1549 | AC_MSG_WARN([Heimdal Kerberos library not found]) |
a1c22363 AJ |
1550 | ]) |
1551 | ]) | |
1a22a39e | 1552 | SQUID_STATE_ROLLBACK([squid_krb5_save]) |
a1c22363 | 1553 | ]) |
1a22a39e | 1554 | |
75c5f82b | 1555 | dnl User may specify GNU gss is needed from a non-standard location |
24531401 | 1556 | SQUID_AUTO_LIB(gnugss,[GNU gss],[LIB_KRB5]) |
75c5f82b | 1557 | AH_TEMPLATE(USE_GNUGSS,[GNU gss support is available]) |
a1c22363 | 1558 | AS_IF([test "x$with_gnugss" != "xno" -a "x$KRB5LIBS" = "x"],[ |
24531401 AJ |
1559 | CXXFLAGS="$LIB_KRB5_CFLAGS $CXXFLAGS" |
1560 | krb5confpath= | |
1a22a39e MM |
1561 | SQUID_STATE_SAVE([squid_krb5_save]) |
1562 | LIBS="$LIBS $LIB_KRB5_PATH" | |
1563 | ||
1564 | # auto-detect using pkg-config | |
1565 | PKG_CHECK_MODULES([LIB_KRB5],[gss],,[ | |
1566 | ## For some OS pkg-config is broken or unavailable. | |
1567 | ## Detect libraries the hard way. | |
1568 | ||
1569 | AC_MSG_NOTICE([Try to find Kerberos libraries in given path]) | |
1570 | AC_CHECK_LIB(gss, [main], [LIB_KRB5_LIBS="-lgss $LIB_KRB5_LIBS"],[ | |
75c5f82b | 1571 | AC_MSG_WARN([library 'com_err' is required for GNU Kerberos]) |
1a22a39e | 1572 | ]) |
1a22a39e MM |
1573 | ]) |
1574 | ||
a1c22363 | 1575 | AS_IF([test "x$LIB_KRB5_LIBS" != "x"],[ |
1a22a39e MM |
1576 | KRB5LIBS="$LIB_KRB5_PATH $LIB_KRB5_LIBS $KRB5LIBS" |
1577 | KRB5INCS="$LIB_KRB5_CFLAGS" | |
1578 | AC_DEFINE(USE_GNUGSS,1,[GNU Kerberos support is available]) | |
9603207d | 1579 | KRB5_FLAVOUR="GNU GSS" |
1a22a39e MM |
1580 | |
1581 | # check for other specific broken implementations | |
1582 | CXXFLAGS="$CXXFLAGS $KRB5INCS" | |
1583 | LIBS="$LIBS $KRB5LIBS" | |
1584 | ||
1585 | AC_MSG_NOTICE([Try to find Kerbeors headers in given path]) | |
1586 | AC_CHECK_HEADERS(gss.h) | |
1587 | ||
1588 | SQUID_CHECK_WORKING_GSSAPI | |
1589 | SQUID_DEFINE_BOOL(HAVE_GSSAPI,$squid_cv_working_gssapi,[GSSAPI support]) | |
1590 | ||
1591 | SQUID_CHECK_SPNEGO_SUPPORT | |
1592 | SQUID_DEFINE_BOOL(HAVE_SPNEGO,$squid_cv_have_spnego,[SPNEGO support]) | |
1593 | ||
1594 | SQUID_CHECK_WORKING_KRB5 | |
1595 | SQUID_DEFINE_BOOL(HAVE_KRB5,$squid_cv_working_krb5,[KRB5 support]) | |
a1c22363 AJ |
1596 | ]) |
1597 | AS_IF([test "x$KRB5LIBS" = "x"],[ | |
1598 | AS_IF([test "x$with_gnugss" = "xyes"],[ | |
75c5f82b | 1599 | AC_MSG_ERROR([Required GNU GSS Kerberos library not found]) |
a1c22363 | 1600 | ],[ |
75c5f82b | 1601 | AC_MSG_WARN([GNU GSS Kerberos library not found]) |
a1c22363 AJ |
1602 | ]) |
1603 | ]) | |
1a22a39e | 1604 | SQUID_STATE_ROLLBACK([squid_krb5_save]) |
a1c22363 | 1605 | ]) |
75c5f82b | 1606 | |
a1c22363 | 1607 | AS_IF([test "x$KRB5LIBS" != "x"],[with_krb5=yes]) |
1a22a39e MM |
1608 | AC_MSG_NOTICE([$KRB5_FLAVOUR Kerberos library support: ${with_krb5:=no} ${LIB_KRB5_PATH} ${LIB_KRB5_LIBS}]) |
1609 | AC_SUBST(KRB5INCS) | |
1610 | AC_SUBST(KRB5LIBS) | |
1a22a39e | 1611 | |
0d57ed2e AJ |
1612 | SQUID_AUTO_LIB(ldap,[LDAP],[LIBLDAP]) |
1613 | AS_IF([test "x$with_ldap" != "xno"],[ | |
1614 | dnl On MinGW OpenLDAP is not available, so LDAP helpers can be linked | |
1615 | dnl only with Windows LDAP libraries using -lwldap32 | |
1616 | AS_IF([test "$squid_host_os" = "mingw"],[ | |
1617 | LIBLDAP_LIBS="-lwldap32" | |
a1c22363 | 1618 | ],[ |
0d57ed2e AJ |
1619 | SQUID_STATE_SAVE(squid_ldap_state) |
1620 | LIBS="$LIBLDAP_PATH $LIBPTHREADS $LIBS" | |
1621 | PKG_CHECK_MODULES([LIBLDAP],[ldap],[],[ | |
1622 | AC_CHECK_LIB(lber, ber_init, [LIBLBER="-llber"]) | |
1623 | AC_CHECK_LIB(ldap, ldap_init, [LIBLDAP_LIBS="-lldap $LIBLBER"]) | |
1624 | dnl if no ldap lib found check for mozilla version | |
1625 | AS_IF([test "x$ac_cv_lib_ldap_ldap_init" != "xyes"],[ | |
1626 | SQUID_STATE_SAVE(squid_ldap_mozilla) | |
1627 | LIBS="$LIBLDAP_PATH $LIBPTHREADS" | |
1628 | AC_CHECK_LIB(ldap60, ldap_init, [LIBLDAP_LIBS="-lldap60 $LIBLBER"]) | |
1629 | LIBS="$LIBLDAP_PATH $LIBLDAP_LIBS $LIBPTHREADS" | |
1630 | AC_CHECK_LIB(prldap60, prldap_init, [LIBLDAP_LIBS="-lprldap60 $LIBLDAP_LIBS"]) | |
1631 | LIBS="$LIBLDAP_PATH $LIBLDAP_LIBS $LIBPTHREADS" | |
1632 | AC_CHECK_LIB(ssldap60, ldapssl_init, [LIBLDAP_LIBS="-lssldap60 $LIBLDAP_LIBS"]) | |
1633 | SQUID_STATE_ROLLBACK(squid_ldap_mozilla) | |
1634 | ]) | |
1635 | ]) | |
1636 | AC_CHECK_HEADERS(ldap.h lber.h) | |
1637 | AC_CHECK_HEADERS(mozldap/ldap.h) | |
1638 | SQUID_CHECK_LDAP_API | |
a1c22363 AJ |
1639 | ]) |
1640 | ||
0d57ed2e AJ |
1641 | AS_IF([test "x$LIBLDAP_LIBS" != "x"],[ |
1642 | CPPFLAGS="$LIBLDAP_CFLAGS $CPPFLAGS" | |
1643 | LIBLDAP_LIBS="$LIBLDAP_PATH $LIBLDAP_LIBS" | |
1644 | ],[test "x$with_ldap" = "xyes"],[ | |
1645 | AC_MSG_ERROR([Required library ldap not found]) | |
a1c22363 | 1646 | ],[ |
0d57ed2e | 1647 | AC_MSG_NOTICE([Library ldap not found.]) |
a1c22363 | 1648 | ]) |
a1c22363 | 1649 | ]) |
0d57ed2e | 1650 | AC_SUBST(LIBLDAP_LIBS) |
1a22a39e | 1651 | |
6c025870 | 1652 | SQUID_AUTO_LIB(systemd,[systemd API for start-up notification],[LIBSYSTEMD]) |
6fa8c664 | 1653 | AH_TEMPLATE(USE_SYSTEMD,[systemd support is available]) |
6c025870 | 1654 | AS_IF([test "x$with_systemd" != "xno"],[ |
6fa8c664 | 1655 | SQUID_STATE_SAVE(squid_systemd_state) |
6c025870 AJ |
1656 | LIBS="$LIBS $LIBSYSTEMD_PATH" |
1657 | PKG_CHECK_MODULES(LIBSYSTEMD,[libsystemd],,[ | |
6fa8c664 | 1658 | # systemd < 209 |
6c025870 | 1659 | PKG_CHECK_MODULES(LIBSYSTEMD,[libsystemd-daemon],,[:]) |
6fa8c664 | 1660 | ]) |
6fa8c664 | 1661 | AC_CHECK_HEADERS(systemd/sd-daemon.h) |
6c025870 | 1662 | SQUID_STATE_ROLLBACK(squid_systemd_state) |
6fa8c664 | 1663 | |
6c025870 AJ |
1664 | AS_IF([test "x$LIBSYSTEMD_LIBS" != "x"],[ |
1665 | CXXFLAGS="$LIBSYSTEMD_CFLAGS $CXXFLAGS" | |
1666 | LIBSYSTEMD_LIBS="$LIBSYSTEMD_PATH $LIBSYSTEMD_LIBS" | |
6fa8c664 | 1667 | AC_DEFINE(USE_SYSTEMD,1,[systemd support is available]) |
6c025870 AJ |
1668 | ],[test "x$with_systemd" = "xyes"],[ |
1669 | AC_MSG_ERROR([Required systemd library not found]) | |
a1c22363 | 1670 | ],[ |
6c025870 | 1671 | AC_MSG_NOTICE([Library for systemd support not found]) |
a1c22363 AJ |
1672 | ]) |
1673 | ]) | |
6c025870 | 1674 | AC_MSG_NOTICE([systemd library support: $with_systemd $LIBSYSTEMD_LIBS]) |
6fa8c664 | 1675 | |
02749868 | 1676 | AC_ARG_ENABLE(forw-via-db, |
47d80734 | 1677 | AS_HELP_STRING([--enable-forw-via-db],[Enable Forw/Via database]), [ |
ec308e40 | 1678 | SQUID_YESNO([$enableval],[--enable-forw-via-db]) |
02749868 | 1679 | ]) |
21f6708d | 1680 | SQUID_DEFINE_BOOL(USE_FORW_VIA_DB,${enable_forw_via_db:=no}, |
9676633b FC |
1681 | [Enable Forw/Via database]) |
1682 | AC_MSG_NOTICE([Forw/Via database enabled: $enable_forw_via_db]) | |
02749868 | 1683 | |
6cfa8966 | 1684 | AC_ARG_ENABLE(cache-digests, |
47d80734 | 1685 | AS_HELP_STRING([--enable-cache-digests], |
ff91adcc | 1686 | [Use Cache Digests. See https://wiki.squid-cache.org/SquidFaq/CacheDigests]),[ |
ec308e40 | 1687 | SQUID_YESNO([$enableval],[--enable-cache-digests]) |
484f2ebc | 1688 | ]) |
0067eb06 | 1689 | SQUID_DEFINE_BOOL(USE_CACHE_DIGESTS,${enable_cache_digests:=no}, |
47d80734 | 1690 | [Use Cache Digests for locating objects in neighbor caches.]) |
9676633b | 1691 | AC_MSG_NOTICE([Cache Digests enabled: $enable_cache_digests]) |
47d80734 | 1692 | |
484f2ebc | 1693 | |
9676633b FC |
1694 | ################################ |
1695 | # check for netio plugin stuff # | |
1696 | ################################ | |
1697 | dnl order of these options handling is relevant in case the user | |
1698 | dnl supplies more than one --enable option. Options handled later | |
1699 | dnl override those handled earlier for io loop method manual override | |
1700 | AC_ARG_ENABLE(select, | |
a1c22363 | 1701 | AS_HELP_STRING([--disable-select],[Disable select(2) support.]),[ |
ec308e40 | 1702 | SQUID_YESNO([$enableval],[--enable-select]) |
a1c22363 | 1703 | AS_IF([test "x$enableval" = "xyes"],[ |
39145d19 | 1704 | squid_opt_io_loop_engine="select" |
a1c22363 AJ |
1705 | AS_IF([test "x$squid_host_os" = "xmingw"],[squid_opt_io_loop_engine="select_win32"]) |
1706 | ]) | |
9676633b FC |
1707 | ]) |
1708 | AC_MSG_NOTICE([enabling select syscall for net I/O: ${enable_select:=auto}]) | |
cd748f27 | 1709 | |
9bb83c8b | 1710 | AC_ARG_ENABLE(poll, |
a1c22363 | 1711 | AS_HELP_STRING([--disable-poll],[Disable poll(2) support.]),[ |
ec308e40 | 1712 | SQUID_YESNO([$enableval],[--enable-poll]) |
8ff06f2a | 1713 | AS_IF([test "x$enableval" = "xyes"],[squid_opt_io_loop_engine="poll"]) |
9bb83c8b | 1714 | ]) |
9676633b | 1715 | AC_MSG_NOTICE([enabling poll syscall for net I/O: ${enable_poll:=auto}]) |
9bb83c8b | 1716 | |
1b3db6d9 | 1717 | AC_ARG_ENABLE(kqueue, |
26d50fd2 AJ |
1718 | AS_HELP_STRING([--disable-kqueue], |
1719 | [Disable kqueue(2) support.]), [ | |
ec308e40 | 1720 | SQUID_YESNO([$enableval],[--enable-kqueue]) |
1b3db6d9 | 1721 | ]) |
a1c22363 | 1722 | AS_IF([test "x${enable_kqueue:=auto}" != "xno"],[ |
26d50fd2 | 1723 | AC_CHECK_HEADERS([sys/event.h],[],[ |
a1c22363 | 1724 | AS_IF([test "x${enable_kqueue}" = "xyes"],[ |
26d50fd2 | 1725 | AC_MSG_ERROR([kqueue support requires sys/event.h header file.]) |
a1c22363 | 1726 | ]) |
26d50fd2 AJ |
1727 | ]) |
1728 | AC_CHECK_FUNCS(kqueue,[],[ | |
a1c22363 | 1729 | AS_IF([test "x${enable_kqueue}" = "xyes"],[ |
26d50fd2 | 1730 | AC_MSG_ERROR([kqueue support missing in libc library.]) |
a1c22363 | 1731 | ]) |
26d50fd2 | 1732 | ]) |
a1c22363 | 1733 | AS_IF([test "x$ac_cv_func_kqueue" = "xyes" -a "x$ac_cv_header_sys_event_h" = "xyes"],[ |
26d50fd2 | 1734 | squid_opt_io_loop_engine="kqueue" |
a1c22363 | 1735 | ],[ |
26d50fd2 | 1736 | enable_kqueue="no" |
a1c22363 AJ |
1737 | ]) |
1738 | ]) | |
26d50fd2 | 1739 | AC_MSG_NOTICE([enabling kqueue for net I/O: ${enable_kqueue:=auto}]) |
1b3db6d9 | 1740 | |
a46d2c0e | 1741 | dnl Enable epoll() |
a46d2c0e | 1742 | AC_ARG_ENABLE(epoll, |
62979ab1 | 1743 | AS_HELP_STRING([--disable-epoll],[Disable Linux epoll(2) support.]), |
a46d2c0e | 1744 | [ |
ec308e40 | 1745 | SQUID_YESNO([$enableval],[--enable-epoll]) |
a1c22363 | 1746 | AS_IF([test "x$enableval" = "xyes"],[squid_opt_io_loop_engine="epoll"]) |
a46d2c0e | 1747 | ]) |
9676633b | 1748 | AC_MSG_NOTICE([enabling epoll syscall for net I/O: ${enable_epoll:=auto}]) |
2ca8b332 | 1749 | |
9676633b FC |
1750 | # auto-detect and verify epoll header and library present and working |
1751 | # logic mapping and loop method selection are performed later | |
a1c22363 | 1752 | AS_IF([test "x$enable_epoll" != "xno"],[ |
9676633b | 1753 | # check if libs are needed to support epoll |
af1e01a8 | 1754 | SQUID_STATE_SAVE(squid_epoll_state) |
9676633b | 1755 | AC_SEARCH_LIBS(epoll_ctl,[epoll]) |
a1c22363 AJ |
1756 | AS_IF([test "x$ac_cv_search_epoll_ctl" = "xno"],[enable_epoll=no], |
1757 | [test "x$ac_cv_search_epoll_ctl" = "xnone required"],[EPOLL_LIBS=""], | |
1758 | [EPOLL_LIBS=$ac_cv_search_epoll_ctl] | |
1759 | ) | |
9676633b FC |
1760 | AC_SUBST(EPOLL_LIBS) |
1761 | SQUID_STATE_ROLLBACK(squid_epoll_state) #de-pollute LIBS | |
a46d2c0e | 1762 | |
9676633b | 1763 | # epoll requires sys/epoll.h |
98d13964 | 1764 | AC_CHECK_HEADERS([sys/epoll.h]) |
ad32c661 AJ |
1765 | |
1766 | dnl Verify that epoll really works | |
a1c22363 | 1767 | AS_IF([test "x$ac_cv_search_epoll_ctl" != "xno"], SQUID_CHECK_EPOLL) |
2ca8b332 | 1768 | |
a1c22363 | 1769 | AS_IF([test "x$enable_epoll" = "xyes" -a "x$squid_cv_epoll_works" = "xno"],[ |
2ca8b332 | 1770 | AC_MSG_ERROR([Epoll does not work. Force-enabling it is not going to help.]) |
a1c22363 AJ |
1771 | ]) |
1772 | ]) | |
a46d2c0e | 1773 | |
a1ad2f9b AJ |
1774 | dnl Enable /dev/poll |
1775 | AC_ARG_ENABLE(devpoll, | |
a1c22363 | 1776 | AS_HELP_STRING([--disable-devpoll],[Disable Solaris /dev/poll support.]),[ |
ec308e40 | 1777 | SQUID_YESNO([$enableval],[--enable-devpoll]) |
a1c22363 | 1778 | AS_IF([test "x$enableval" = "xyes"],[squid_opt_io_loop_engine="devpoll"]) |
a1ad2f9b AJ |
1779 | ]) |
1780 | AC_MSG_NOTICE([enabling /dev/poll for net I/O: ${enable_devpoll:=auto}]) | |
1781 | ||
1782 | ## auto-detect and verify devpoll header and library present and working | |
a1c22363 | 1783 | AS_IF([test "x$enable_devpoll" != "xno"],[ |
a1ad2f9b AJ |
1784 | # /dev/poll requires ioctl() and write() |
1785 | AC_CHECK_FUNCS(ioctl) | |
1786 | AC_CHECK_FUNCS(write) | |
1787 | ||
1788 | # /dev/poll requires sys/devpoll.h | |
1789 | AC_CHECK_HEADERS([sys/devpoll.h],,[ | |
a1c22363 AJ |
1790 | AS_IF([test "x$enable_devpoll" = "xyes"],[ |
1791 | AC_MSG_ERROR([--enable-devpoll specified but /dev/poll headers not found]) | |
1792 | ]) | |
1793 | enable_devpoll=no | |
1794 | ]) | |
a1ad2f9b AJ |
1795 | |
1796 | # Verify that /dev/poll really works | |
a1c22363 | 1797 | AS_IF([test "x$enable_devpoll" != "xno"], SQUID_CHECK_DEVPOLL) |
a1ad2f9b | 1798 | |
a1c22363 | 1799 | AS_IF([test "x$enable_devpoll" = "xyes" -a "x$squid_cv_devpoll_works" = "xno"],[ |
a1ad2f9b | 1800 | AC_MSG_ERROR([/dev/poll does not work. Force-enabling it is not going to help.]) |
a1c22363 AJ |
1801 | ]) |
1802 | ]) | |
9676633b | 1803 | |
72fd085a | 1804 | AC_ARG_ENABLE(http-violations, |
af1e01a8 FC |
1805 | AS_HELP_STRING([--disable-http-violations], |
1806 | [This allows you to remove code which is known to | |
47d80734 | 1807 | violate the HTTP protocol specification.]), [ |
ec308e40 | 1808 | SQUID_YESNO([$enableval],[--enable-http-violations]) |
72fd085a | 1809 | ]) |
626096be | 1810 | SQUID_DEFINE_BOOL(USE_HTTP_VIOLATIONS, ${enable_http_violations:=yes}, |
47d80734 | 1811 | [Define to enable code which volates the HTTP standard specification]) |
9676633b | 1812 | AC_MSG_NOTICE([HTTP violations support enabled: $enable_http_violations]) |
72fd085a | 1813 | |
47d80734 | 1814 | # IPFW Transparent Proxy |
68075fad | 1815 | AC_ARG_ENABLE(ipfw-transparent, |
1d26e252 FC |
1816 | AS_HELP_STRING([--enable-ipfw-transparent], |
1817 | [Enable Transparent Proxy support for systems | |
47d80734 | 1818 | using FreeBSD IPFW-style firewalling.]), [ |
ec308e40 | 1819 | SQUID_YESNO([$enableval],[--enable-ipfw-transparent]) |
68075fad | 1820 | ]) |
0067eb06 | 1821 | SQUID_DEFINE_BOOL(IPFW_TRANSPARENT,${enable_ipfw_transparent:=no}, |
2277004e | 1822 | [Enable support for Transparent Proxy on systems using FreeBSD IPFW-style firewalling.]) |
1d26e252 | 1823 | AC_MSG_NOTICE([FreeBSD IPFW-based transparent proxying enabled: $enable_ipfw_transparent]) |
68075fad | 1824 | |
47d80734 | 1825 | # IP-Filter Transparent Proxy |
5cafc1d6 | 1826 | AC_ARG_ENABLE(ipf-transparent, |
2277004e | 1827 | AS_HELP_STRING([--enable-ipf-transparent], |
1d26e252 | 1828 | [Enable Transparent Proxy support using IPFilter-style firewalling]), [ |
ec308e40 | 1829 | SQUID_YESNO([$enableval],[--enable-ipf-transparent]) |
5cafc1d6 | 1830 | ]) |
be0c7ff0 | 1831 | #will be AC_DEFINEd later, after checking for appropriate infrastructure |
4bd144d2 FC |
1832 | #IPF currently broken. Default-disabled for now. |
1833 | AC_MSG_NOTICE([IPF-based transparent proxying requested: ${enable_ipf_transparent:=no}]) | |
5cafc1d6 | 1834 | |
2b0dd4ac | 1835 | dnl Enable PF Transparent Proxy |
1836 | AC_ARG_ENABLE(pf-transparent, | |
2277004e | 1837 | AS_HELP_STRING([--enable-pf-transparent], |
47d80734 | 1838 | [Enable Transparent Proxy support for systems using PF network address redirection.]), [ |
ec308e40 | 1839 | SQUID_YESNO([$enableval],[--enable-pf-transparent]) |
2b0dd4ac | 1840 | ]) |
be0c7ff0 | 1841 | #will be AC_DEFINEd later, after checking for appropriate infrastructure |
b2192042 AJ |
1842 | AC_MSG_NOTICE([PF-based transparent proxying requested: ${enable_pf_transparent:=no}]) |
1843 | ||
1844 | dnl Enable /dev/pf support for older PF Transparent Proxy systems (OpenBSD 4.x and older) | |
1845 | AC_ARG_WITH(nat-devpf, | |
1846 | AS_HELP_STRING([--with-nat-devpf], | |
1847 | [Enable /dev/pf support for NAT on older OpenBSD and FreeBSD kernels.]), [ | |
ec308e40 | 1848 | SQUID_YESNO([$withval],[--with-nat-devpf]) |
b2192042 AJ |
1849 | ]) |
1850 | #will be AC_DEFINEd later, after checking for appropriate infrastructure | |
1851 | AC_MSG_NOTICE([NAT lookups via /dev/pf: ${with_nat_devpf:=no}]) | |
2b0dd4ac | 1852 | |
4bd144d2 | 1853 | # Linux Netfilter Transparent Proxy |
d852fbad | 1854 | AC_ARG_ENABLE(linux-netfilter, |
20ad76ab | 1855 | AS_HELP_STRING([--enable-linux-netfilter], |
96f08e2d | 1856 | [Enable Transparent Proxy support for Linux (Netfilter)]), [ |
ec308e40 | 1857 | SQUID_YESNO([$enableval],[--enable-linux-netfilter]) |
d852fbad | 1858 | ]) |
4bd144d2 | 1859 | AC_MSG_NOTICE([Linux Netfilter support requested: ${enable_linux_netfilter:=auto}]) |
be0c7ff0 | 1860 | #will be AC_DEFINEd later, after checking for appropriate infrastructure |
d852fbad | 1861 | |
425de4c8 AJ |
1862 | |
1863 | dnl Look for libnetfilter_conntrack options (needed for QOS netfilter marking) | |
24531401 | 1864 | SQUID_AUTO_LIB(netfilter-conntrack,[Netfilter conntrack],[LIBNETFILTER_CONNTRACK]) |
f4f6c2e0 | 1865 | AC_MSG_NOTICE([Linux Netfilter Conntrack support requested: ${with_netfilter_conntrack:=auto}]) |
a1c22363 AJ |
1866 | AS_IF([test "x$with_netfilter_conntrack" != "xno"],[ |
1867 | LDFLAGS="$LIBNETFILTER_CONNTRACK_PATH $LDFLAGS" | |
1868 | CPPFLAGS="$LIBNETFILTER_CONNTRACK_CFLAGS $CPPFLAGS" | |
1869 | AC_SEARCH_LIBS([nfct_query], [netfilter_conntrack],,[ | |
1870 | AS_IF([test "x$with_netfilter_conntrack" = "xyes"],[ | |
1871 | AC_MSG_ERROR([--with-netfilter-conntrack specified but libnetfilter-conntrack library not found]) | |
1872 | ]) | |
1873 | with_netfilter_conntrack=no | |
1874 | ]) | |
1875 | AC_CHECK_HEADERS([ \ | |
1876 | libnetfilter_conntrack/libnetfilter_conntrack.h \ | |
1877 | libnetfilter_conntrack/libnetfilter_conntrack_tcp.h | |
1878 | ],,[ | |
1879 | AS_IF([test "x$with_netfilter_conntrack" = "xyes"],[ | |
1880 | AC_MSG_ERROR([--with-netfilter-conntrack specified but libnetfilter-conntrack headers not found]) | |
1881 | ]) | |
1882 | with_netfilter_conntrack=no | |
1883 | ]) | |
1884 | AS_IF([test "x$with_netfilter_conntrack" != "xno"],[with_netfilter_conntrack=yes]) | |
1885 | ]) | |
425de4c8 | 1886 | |
bb7b5fd0 | 1887 | dnl Enable Large file support |
2df6213e | 1888 | buildmodel="" |
2df6213e | 1889 | |
1890 | AC_ARG_WITH(large-files, | |
507ca601 | 1891 | AS_HELP_STRING([--with-large-files],[Enable support for large files (logs etc).]), [ |
ec308e40 | 1892 | SQUID_YESNO([$withval],[--with-large-files]) |
a1c22363 | 1893 | squid_opt_enable_large_files=$withval |
bb7b5fd0 | 1894 | ]) |
1895 | ||
2df6213e | 1896 | dnl UNIX Build environment |
be0c7ff0 | 1897 | dnl AS_HELP_STRING is not suited here because it cannot to specify newlines |
2df6213e | 1898 | AC_ARG_WITH(build-environment, |
507ca601 | 1899 | AS_HELP_STRING([--with-build-environment=model], |
9603207d | 1900 | [The build environment to use. Normally one of |
507ca601 FC |
1901 | POSIX_V6_ILP32_OFF32 (32 bits), |
1902 | POSIX_V6_ILP32_OFFBIG (32 bits with large file support), | |
1903 | POSIX_V6_LP64_OFF64 (64 bits), | |
1904 | POSIX_V6_LPBIG_OFFBIG (large pointers and files), | |
1905 | XBS5_ILP32_OFF32 i(legacy, 32 bits), | |
1906 | XBS5_ILP32_OFFBIG (legacy, 32 bits with large file support), | |
1907 | XBS5_LP64_OFF64 (legacy, 64 bits), | |
1908 | XBS5_LPBIG_OFFBIG (legacy, large pointers and files) | |
1909 | or default (The default for your OS)]), [ | |
a1c22363 AJ |
1910 | AS_CASE(["$withval"], |
1911 | [yes|no],[AC_MSG_FAILURE([--with-build-environment expects a build environment string as used by getconf])], | |
1912 | [buildmodel="$withval"] | |
1913 | ) | |
2df6213e | 1914 | ]) |
1915 | ||
228332d3 FC |
1916 | #hack. Let's early-detect sizeof(long) |
1917 | AC_CHECK_SIZEOF(long) | |
1918 | ||
a1c22363 | 1919 | AS_IF([test "x$squid_opt_enable_large_files" = "xyes" -a "x$buildmodel" = "x"],[ |
2277004e | 1920 | for model in POSIX_V6_LPBIG_OFFBIG XBS5_LPBIG_OFFBIG POSIX_V6_LP64_OFF64 XBS5_LP64_OFF64 POSIX_V6_ILP32_OFFBIG XBS5_ILP32_OFFBIG; do |
a1c22363 | 1921 | AS_IF([test "`getconf _$model 2>/dev/null || true`" = 1 -o "`getconf $model 2>/dev/null || true`"],[ |
2277004e FC |
1922 | buildmodel=$model |
1923 | break | |
a1c22363 | 1924 | ]) |
2277004e | 1925 | done |
a1c22363 | 1926 | AS_IF([test "x$buildmodel" = "x"],[ |
2277004e | 1927 | AC_MSG_WARN([No suitable build environment found for large files. Trying to use _FILE_OFFSET_BITS=64]) |
a1c22363 AJ |
1928 | ]) |
1929 | ]) | |
1930 | AS_IF([test "x$buildmodel" = "xdefault" -o "x$buildmodel" = "x"],[ | |
228332d3 | 1931 | # define _FILE_OFFSET_BITS if requested and needed |
a1c22363 | 1932 | AS_IF([test "x$squid_opt_enable_large_files" = "xyes" -a $ac_cv_sizeof_long -le 4],[ |
507ca601 FC |
1933 | AC_MSG_NOTICE([Enabling -D_FILE_OFFSET_BITS=64]) |
1934 | CFLAGS="-D_FILE_OFFSET_BITS=64 $CFLAGS" | |
1935 | CXXFLAGS="-D_FILE_OFFSET_BITS=64 $CXXFLAGS" | |
a1c22363 AJ |
1936 | ]) |
1937 | ],[ | |
507ca601 | 1938 | AC_MSG_NOTICE([Using $buildmodel build environment]) |
a1c22363 AJ |
1939 | AS_IF([ ! test "`getconf _$buildmodel 2>/dev/null || true`" = 1 -o "`getconf $buildmodel 2>/dev/null || true`"],[ |
1940 | AC_MSG_ERROR([Build environment $buildmodel not known to getconf.]) | |
1941 | ]) | |
507ca601 FC |
1942 | CFLAGS="`getconf ${buildmodel}_CFLAGS` $CFLAGS" |
1943 | CXXFLAGS="`getconf ${buildmodel}_CFLAGS` $CXXFLAGS" | |
1944 | LIBS="`getconf ${buildmodel}_LIBS` $LIBS" | |
1945 | LDFLAGS="`getconf ${buildmodel}_LDFLAGS` $LDFLAGS" | |
2277004e | 1946 | |
a1c22363 | 1947 | AS_IF([test "x$squid_host_os" = "xsolaris"],[ |
2277004e FC |
1948 | # On Solaris getconf returns for CFLAGS -xarch=generic64, -Xa and -Usun options, and |
1949 | # for LDFLAGS -xarch=generic64, but: | |
1950 | # "-Xa" is supported only by Sun cc, so we need to remove it when using gcc | |
1951 | # For gcc "-xarch=generic64" must be replaced with "-m64" | |
1952 | # The 'sun' define is needed by ipfilter includes, so we must remove "-Usun" | |
a1c22363 | 1953 | AS_IF([test "x$GCC" = "xyes"],[ |
2277004e FC |
1954 | AC_MSG_NOTICE([Removing -Xa for gcc/g++ on $host]) |
1955 | CFLAGS="`echo $CFLAGS | sed -e 's/-Xa//'`" | |
1956 | CXXFLAGS="`echo $CXXFLAGS | sed -e 's/-Xa//'`" | |
1957 | AC_MSG_NOTICE([Replacing -xarch=generic64 with -m64 for gcc/g++ on $host]) | |
1958 | CFLAGS="`echo $CFLAGS | sed -e 's/-xarch=generic64/-m64/'`" | |
1959 | CXXFLAGS="`echo $CXXFLAGS | sed -e 's/-xarch=generic64/-m64/'`" | |
1960 | LDFLAGS="`echo $LDFLAGS | sed -e 's/-xarch=generic64//'`" | |
a1c22363 | 1961 | ]) |
2277004e FC |
1962 | AC_MSG_NOTICE([Removing -Usun on $host]) |
1963 | CFLAGS="`echo $CFLAGS | sed -e 's/-Usun//'`" | |
1964 | CXXFLAGS="`echo $CXXFLAGS | sed -e 's/-Usun//'`" | |
a1c22363 AJ |
1965 | ]) |
1966 | ]) | |
2df6213e | 1967 | |
3d674977 | 1968 | AC_ARG_ENABLE(follow-x-forwarded-for, |
6c83720b AR |
1969 | AS_HELP_STRING([--disable-follow-x-forwarded-for], |
1970 | [Do not follow the X-Forwarded-For | |
19b4777c FC |
1971 | HTTP header to try to find the IP address of the |
1972 | original or indirect client when a request has | |
8075a4da | 1973 | been forwarded through other proxies.]), [ |
ec308e40 | 1974 | SQUID_YESNO([$enableval],[--enable-follow-x-forwarded-for]) |
8075a4da | 1975 | ]) |
6ec005b5 | 1976 | AC_MSG_NOTICE([Support for X-Forwarded-For enabled: ${enable_follow_x_forwarded_for:=yes}]) |
3a5af257 | 1977 | SQUID_DEFINE_BOOL(FOLLOW_X_FORWARDED_FOR,$enable_follow_x_forwarded_for, |
47d80734 | 1978 | [Enable following X-Forwarded-For headers]) |
3d674977 | 1979 | |
3898f57f | 1980 | AC_ARG_ENABLE(ident-lookups, |
8075a4da | 1981 | AS_HELP_STRING([--disable-ident-lookups], |
47d80734 | 1982 | [Remove code that supports performing Ident (RFC 931) lookups.]), [ |
ec308e40 | 1983 | SQUID_YESNO([$enableval],[--enable-ident-lookups]) |
8075a4da | 1984 | ]) |
6c5dc16a FC |
1985 | AC_MSG_NOTICE([Support for Ident lookups enabled: ${enable_ident_lookups:=yes}]) |
1986 | SQUID_DEFINE_BOOL(USE_IDENT,$enable_ident_lookups,[Support for Ident (RFC 931) lookups]) | |
3898f57f | 1987 | |
9d798391 | 1988 | dnl Select Default hosts file location |
1989 | AC_ARG_ENABLE(default-hostsfile, | |
8ea232f5 FC |
1990 | AS_HELP_STRING([--enable-default-hostsfile=path], |
1991 | [Select default location for hosts file. | |
75eaac6c | 1992 | See hosts_file directive in squid.conf for details]), [ |
a1c22363 AJ |
1993 | # TODO: handle the "yes" case cleanly |
1994 | AS_CASE(["$enableval"], | |
1995 | [no|none],[squid_opt_default_hosts="none"], | |
1996 | [ | |
1997 | squid_opt_default_hosts=$enableval | |
1998 | AS_IF([ ! test -f "$enableval"],[ | |
1999 | AC_MSG_WARN([Unable to find file $enableval. I hope you know what you are doing.]) | |
2000 | ]) | |
2001 | ]) | |
75eaac6c FC |
2002 | ]) |
2003 | AC_MSG_NOTICE([Default hosts file set to: ${squid_opt_default_hosts:=/etc/hosts}]) | |
2004 | DEFAULT_HOSTS=$squid_opt_default_hosts | |
2005 | AC_SUBST(DEFAULT_HOSTS) | |
9d798391 | 2006 | |
47d80734 | 2007 | # Select auth schemes modules to build |
94439e4e | 2008 | AC_ARG_ENABLE(auth, |
6c83720b AR |
2009 | AS_HELP_STRING([--disable-auth], |
2010 | [Do not support authentication. When supported, the list of schemes | |
26ffc057 | 2011 | and helpers to be enabled is defined elsewhere]), [ |
ec308e40 | 2012 | SQUID_YESNO([$enableval],[--enable-auth]) |
94439e4e | 2013 | ]) |
26ffc057 | 2014 | AC_MSG_NOTICE([Authentication support enabled: ${enable_auth:=yes}]) |
2f1431ea AJ |
2015 | SQUID_DEFINE_BOOL(USE_AUTH,$enable_auth,[Enable support for authentication]) |
2016 | AM_CONDITIONAL(ENABLE_AUTH, test "x$enable_auth" != "xno") | |
26ffc057 | 2017 | AUTH_MODULES="" |
dcbfe1a3 | 2018 | require_smblib="no" |
26ffc057 FC |
2019 | |
2020 | AC_ARG_ENABLE(auth-basic, | |
2021 | AS_HELP_STRING([--enable-auth-basic="list of helpers"], | |
2022 | [Enable the basic authentication scheme, and build the specified helpers. | |
2023 | Not providing an explicit list of helpers will attempt build of | |
2024 | all possible helpers. Default is to do so. | |
2025 | To disable the basic authentication scheme, use --disable-auth-basic. | |
d9655720 | 2026 | To enable but build no helpers, specify "none". |
03901cf8 | 2027 | To see available helpers, see the src/auth/basic/ directory. ]),[ |
26ffc057 FC |
2028 | #nothing to do really |
2029 | ]) | |
03901cf8 | 2030 | m4_include([src/auth/basic/helpers.m4]) |
94439e4e | 2031 | |
12daeef6 AJ |
2032 | AC_ARG_ENABLE(auth-digest, |
2033 | AS_HELP_STRING([--enable-auth-digest="list of helpers"], | |
2034 | [Enable the Digest authentication scheme, and build the specified helpers. | |
26ffc057 FC |
2035 | Not providing an explicit list of helpers will attempt build of |
2036 | all possible helpers. Default is to do so. | |
12daeef6 | 2037 | To disable the Digest authentication scheme, use --disable-auth-digest. |
26ffc057 | 2038 | To enable but build no helpers, specify "none". |
d4d7f6dd | 2039 | To see available helpers, see the src/auth/digest/ directory. ]),[ |
12daeef6 | 2040 | #nothing to do, really |
380f0a87 | 2041 | ]) |
d4d7f6dd | 2042 | m4_include([src/auth/digest/helpers.m4]) |
94439e4e | 2043 | |
26ffc057 FC |
2044 | AC_ARG_ENABLE(auth-negotiate, |
2045 | AS_HELP_STRING([--enable-auth-negotiate="list of helpers"], | |
16c02b14 | 2046 | [Enable the Negotiate authentication scheme, and build the specified |
26ffc057 FC |
2047 | helpers. |
2048 | Not providing an explicit list of helpers will attempt build of | |
2049 | all possible helpers. Default is to do so. | |
16c02b14 | 2050 | To disable the Negotiate authentication scheme, |
26ffc057 FC |
2051 | use --disable-auth-negotiate. |
2052 | To enable but build no helpers, specify "none". | |
16c02b14 | 2053 | To see available helpers, see the src/auth/negotiate/ directory. ]),[ |
26ffc057 | 2054 | #nothing to do, really |
6e785d85 | 2055 | ]) |
16c02b14 | 2056 | m4_include([src/auth/negotiate/helpers.m4]) |
6e785d85 | 2057 | |
12daeef6 AJ |
2058 | AC_ARG_ENABLE(auth-ntlm, |
2059 | AS_HELP_STRING([--enable-auth-ntlm="list of helpers"], | |
2060 | [Enable the NTLM authentication scheme, and build the specified helpers. | |
26ffc057 FC |
2061 | Not providing an explicit list of helpers will attempt build of |
2062 | all possible helpers. Default is to do so. | |
12daeef6 | 2063 | To disable the NTLM authentication scheme, use --disable-auth-ntlm. |
1a22a39e | 2064 | To enable but build no helpers, specify "none". |
b817c20f | 2065 | To see available helpers, see the src/auth/ntlm/ directory. ]),[ |
1a22a39e | 2066 | ]) |
b817c20f | 2067 | m4_include([src/auth/ntlm/helpers.m4]) |
c8093f05 | 2068 | |
1a22a39e MM |
2069 | dnl Authentication libraries to build |
2070 | dnl This list will not be needed when each auth library has its own Makefile | |
2071 | dnl this is to be placed AFTER each auth module's handler | |
2072 | AUTH_LIBS_TO_BUILD= | |
2073 | for module in $AUTH_MODULES; do | |
2074 | AUTH_LIBS_TO_BUILD="$AUTH_LIBS_TO_BUILD ${module}/lib${module}.la" | |
2075 | done | |
2076 | AC_SUBST(AUTH_MODULES) | |
2077 | AC_SUBST(AUTH_LIBS_TO_BUILD) | |
dcbfe1a3 | 2078 | AM_CONDITIONAL(ENABLE_SMBLIB, test "x$require_smblib" = "xyes") |
3d62cc61 | 2079 | |
1a22a39e MM |
2080 | dnl Select logging daemon helpers to build |
2081 | AC_ARG_ENABLE(log-daemon-helpers, | |
2082 | AS_HELP_STRING([--enable-log-daemon-helpers="list of helpers"], | |
4d5dd85a | 2083 | [This option selects which logging daemon helpers to |
1a22a39e | 2084 | build and install as part of the normal build process |
4d5dd85a | 2085 | For a list of available helpers see the src/log/ |
1a22a39e MM |
2086 | directory.]),[ |
2087 | #nothing to do, really | |
2088 | ]) | |
4d5dd85a | 2089 | m4_include([src/log/helpers.m4]) |
9ca29d23 | 2090 | |
c6588c68 | 2091 | AC_ARG_ENABLE(external-acl-helpers, |
f2d9a578 | 2092 | AS_HELP_STRING([--enable-external-acl-helpers="list of helpers"], |
e046643f | 2093 | [Enable external_acl helpers support and the helpers themselves. |
d9655720 | 2094 | Default is to build all buildable helpers and enable support. |
8ea232f5 | 2095 | To disable support, use --disable-external-acl-helpers. |
d9655720 | 2096 | To build no helpers, specify "none". |
e046643f | 2097 | To see available helpers, see the src/acl/external/ |
8ea232f5 | 2098 | directory]), [ |
d9655720 | 2099 | #nothing to do, really |
c6588c68 | 2100 | ]) |
e046643f | 2101 | m4_include([src/acl/external/helpers.m4]) |
d9655720 | 2102 | |
fdbb3b19 | 2103 | dnl Select url_rewrite helpers to build |
fdbb3b19 | 2104 | AC_ARG_ENABLE(url-rewrite-helpers, |
081863f3 | 2105 | AS_HELP_STRING([--enable-url-rewrite-helpers="list of helpers"], |
fdbb3b19 AJ |
2106 | [This option selects which url_rewrite helpers to |
2107 | build and install as part of the normal build | |
8ea232f5 FC |
2108 | process. The default is to attempt the build of all possible |
2109 | helpers. Use --disable-url-rewrite-helpers to build none. | |
2110 | For a list of available helpers see the | |
d6d6203a | 2111 | src/http/url_rewriters/ directory.]),[ |
fdbb3b19 | 2112 | ]) |
d6d6203a | 2113 | m4_include([src/http/url_rewriters/helpers.m4]) |
fdbb3b19 | 2114 | |
a27cfbe0 | 2115 | dnl Select security helpers to build |
8732ea9d AJ |
2116 | AC_ARG_ENABLE(security-cert-validators, |
2117 | AS_HELP_STRING([--enable-security-cert-validators="list of helpers"], | |
bbf79f12 AJ |
2118 | [This option selects which security certificate validator |
2119 | helpers to build and install as part of the normal build | |
a27cfbe0 | 2120 | process. The default is to attempt the build of all possible |
8732ea9d | 2121 | helpers. Use --disable-security-cert-validators to |
bbf79f12 AJ |
2122 | build none. For a list of available helpers see the |
2123 | src/security/cert_validators/ directory.]),[ | |
a27cfbe0 | 2124 | ]) |
4d5dd85a | 2125 | m4_include([src/security/cert_validators/helpers.m4]) |
a27cfbe0 | 2126 | |
cb0b3d63 AJ |
2127 | AC_ARG_ENABLE(security-cert-generators, |
2128 | AS_HELP_STRING([--enable-security-cert-generators="list of helpers"], | |
2129 | [This option selects which security certificate validator | |
2130 | helpers to build and install as part of the normal build | |
2131 | process. The default is to attempt the build of all possible | |
2132 | helpers. Use --disable-security-cert-genrators to | |
2133 | build none. For a list of available helpers see the | |
2134 | src/security/cert_generators/ directory.]),[ | |
2135 | ]) | |
2136 | m4_include([src/security/cert_generators/helpers.m4]) | |
2137 | ||
0d5ee502 AM |
2138 | dnl Select storeid_rewrite helpers to build |
2139 | AC_ARG_ENABLE(storeid-rewrite-helpers, | |
2140 | AS_HELP_STRING([--enable-storeid-rewrite-helpers="list of helpers"], | |
2141 | [This option selects which Store-ID rewrite helpers to | |
2142 | build and install as part of the normal build | |
2143 | process. The default is to attempt the build of all possible | |
2144 | helpers. Use --disable-storeid-rewrite-helpers to build none. | |
2145 | For a list of available helpers see the | |
0c1f8b9b | 2146 | src/store/id_rewriters/ directory.]),[ |
0d5ee502 | 2147 | ]) |
0c1f8b9b | 2148 | m4_include([src/store/id_rewriters/helpers.m4]) |
0d5ee502 | 2149 | |
3a125142 | 2150 | AC_ARG_WITH(valgrind-debug, |
0f705e3b FC |
2151 | AS_HELP_STRING([--with-valgrind-debug], |
2152 | [Include debug instrumentation for use with valgrind]), | |
4e26f472 | 2153 | [ |
ec308e40 | 2154 | SQUID_YESNO([$withval],[--with-valgrind-debug]) |
a1c22363 | 2155 | AS_IF([test "x$withval" != "xno"],[ |
4e26f472 FC |
2156 | AC_CHECK_HEADERS(valgrind/memcheck.h,[],[ |
2157 | AC_MSG_ERROR([Valgrind support requested, needed headers not found.]) | |
2158 | ]) | |
a1c22363 | 2159 | ]) |
b4bab919 | 2160 | ]) |
4e26f472 FC |
2161 | SQUID_DEFINE_BOOL(WITH_VALGRIND,${with_valgrind_debug:=no}, |
2162 | [Valgrind memory debugger support]) | |
2163 | AC_MSG_NOTICE([Valgrind debug support enabled: $with_valgrind_debug]) | |
b4bab919 | 2164 | |
0e657244 | 2165 | dnl Enable WIN32 Service compile mode |
2166 | AC_ARG_ENABLE(win32-service, | |
054a4caa | 2167 | AS_HELP_STRING([--enable-win32-service], |
0f705e3b | 2168 | [Compile Squid as a WIN32 Service. |
b284c470 | 2169 | Works only on MS-Windows platforms]), [ |
ec308e40 | 2170 | SQUID_YESNO([$enableval],[--enable-win32-service]) |
0e657244 | 2171 | ]) |
b284c470 FC |
2172 | SQUID_DEFINE_BOOL(USE_WIN32_SERVICE,${enable_win32_service:=no}, |
2173 | [Enable code supporting MS Windows service mode]) | |
2174 | AC_MSG_NOTICE([MS Windows service mode enabled: $enable_win32_service]) | |
0e657244 | 2175 | |
b1485ff8 | 2176 | |
29f22442 | 2177 | # Disable "unlinkd" code |
fe0810ac | 2178 | AC_ARG_ENABLE(unlinkd, |
0a081cb0 | 2179 | AS_HELP_STRING([--disable-unlinkd],[Do not use unlinkd]), [ |
ec308e40 | 2180 | SQUID_YESNO([$enableval],[--enable-unlinkd]) |
fe0810ac | 2181 | ]) |
0f658b5b | 2182 | SQUID_DEFINE_BOOL(USE_UNLINKD,${enable_unlinkd:=yes}, |
0f705e3b | 2183 | [Enable useage of unlinkd]) |
fcabe077 | 2184 | AM_CONDITIONAL(ENABLE_UNLINKD,test "x$enable_unlinkd" = "xyes") |
fbc04c0a | 2185 | AC_MSG_NOTICE([unlinkd enabled: $enable_unlinkd]) |
fe0810ac | 2186 | |
0f705e3b | 2187 | # Enable backtraces on fatal errors |
ce3d30fb | 2188 | AC_ARG_ENABLE(stacktraces, |
0f705e3b FC |
2189 | AS_HELP_STRING([--enable-stacktraces], |
2190 | [Enable automatic call backtrace on fatal errors]), [ | |
ec308e40 | 2191 | SQUID_YESNO([$enableval],[--enable-stacktraces]) |
ce3d30fb | 2192 | ]) |
0f658b5b | 2193 | SQUID_DEFINE_BOOL(PRINT_STACK_TRACE,${enable_stacktraces:=no}, |
0f705e3b | 2194 | [Print stack traces on fatal errors]) |
78614cd4 | 2195 | AC_MSG_NOTICE([Automatically print stack trace on fatal errors: $enable_stacktraces]) |
0a081cb0 | 2196 | |
904676a2 | 2197 | # Enable X-Accelerator-Vary for Vary support within an accelerator setup |
2092c67d | 2198 | AC_ARG_ENABLE(x-accelerator-vary, |
904676a2 FC |
2199 | AS_HELP_STRING([--enable-x-accelerator-vary], |
2200 | [Enable support for the X-Accelerator-Vary | |
e702812e FC |
2201 | HTTP header. Can be used to indicate |
2202 | variance within an accelerator setup. | |
2203 | Typically used together with other code | |
904676a2 | 2204 | that adds custom HTTP headers to the requests.]), [ |
ec308e40 | 2205 | SQUID_YESNO([$enableval],[--enable-x-accelerator-vary]) |
f66a9ef4 | 2206 | ]) |
0f658b5b | 2207 | SQUID_DEFINE_BOOL(X_ACCELERATOR_VARY,${enable_x_accelerator_vary:=no}, |
904676a2 | 2208 | [Enable support for the X-Accelerator-Vary HTTP header]) |
78614cd4 | 2209 | AC_MSG_NOTICE([X-Accelerator-Vary support enabled: $enable_x_accelerator_vary]) |
f66a9ef4 | 2210 | |
24531401 | 2211 | SQUID_AUTO_LIB(cppunit,[cppunit test framework],[LIBCPPUNIT]) |
d93bf055 | 2212 | AS_IF([test "x$with_cppunit" != "xno"],[ |
24531401 | 2213 | LIBCPPUNIT_LIBS="$LIBCPPUNIT_PATH -lcppunit" |
d93bf055 | 2214 | PKG_CHECK_MODULES([LIBCPPUNIT],[cppunit],[ |
f30eb8f7 | 2215 | squid_cv_cppunit_version="`pkg-config --modversion cppunit`" |
d93bf055 AJ |
2216 | AC_MSG_NOTICE([using system installed cppunit version $squid_cv_cppunit_version]) |
2217 | AS_UNSET(squid_cv_cppunit_version) | |
2218 | ||
2219 | SQUID_STATE_SAVE(squid_cppunit_state) | |
e77b66af FC |
2220 | CXXFLAGS="${CXXFLAGS} ${LIBCPPUNIT_CFLAGS}" |
2221 | LIBS="${LIBS} ${LIBCPPUNIT_LIBS}" | |
d93bf055 AJ |
2222 | AC_CHECK_HEADERS(cppunit/extensions/HelperMacros.h) |
2223 | SQUID_STATE_ROLLBACK(squid_cppunit_state) | |
2224 | ],[ | |
2225 | AC_MSG_WARN([cppunit does not appear to be installed. Squid does not require this, but code testing with 'make check' will fail.]) | |
2226 | ]) | |
f5691f9c | 2227 | ]) |
f5691f9c | 2228 | |
090089c4 | 2229 | dnl Check for headers |
db40ae20 | 2230 | AC_CHECK_HEADERS( \ |
3680cc44 FC |
2231 | arpa/inet.h \ |
2232 | arpa/nameser.h \ | |
2233 | assert.h \ | |
2234 | bstring.h \ | |
3680cc44 | 2235 | crypt.h \ |
3680cc44 | 2236 | ctype.h \ |
ee4d4e85 | 2237 | direct.h \ |
a1c22363 | 2238 | dirent.h \ |
3680cc44 FC |
2239 | errno.h \ |
2240 | execinfo.h \ | |
2241 | fcntl.h \ | |
2242 | fnmatch.h \ | |
2243 | getopt.h \ | |
2244 | glob.h \ | |
2245 | gnumalloc.h \ | |
2246 | grp.h \ | |
3680cc44 | 2247 | ipl.h \ |
3680cc44 FC |
2248 | libc.h \ |
2249 | limits.h \ | |
2250 | linux/posix_types.h \ | |
2251 | linux/types.h \ | |
3680cc44 | 2252 | malloc.h \ |
3680cc44 FC |
2253 | math.h \ |
2254 | memory.h \ | |
2255 | mount.h \ | |
2256 | netdb.h \ | |
2257 | netinet/in.h \ | |
2258 | netinet/in_systm.h \ | |
3680cc44 | 2259 | netinet/tcp.h \ |
3680cc44 FC |
2260 | paths.h \ |
2261 | poll.h \ | |
321223fe | 2262 | priv.h \ |
3680cc44 | 2263 | pwd.h \ |
c2afddd8 | 2264 | regex.h \ |
3680cc44 | 2265 | sched.h \ |
2ccf2eb2 | 2266 | siginfo.h \ |
3680cc44 | 2267 | signal.h \ |
3680cc44 FC |
2268 | stdarg.h \ |
2269 | stddef.h \ | |
3680cc44 FC |
2270 | stdio.h \ |
2271 | stdlib.h \ | |
3680cc44 FC |
2272 | string.h \ |
2273 | strings.h \ | |
2274 | sys/bitypes.h \ | |
3680cc44 FC |
2275 | sys/file.h \ |
2276 | sys/ioctl.h \ | |
d440d5a4 | 2277 | sys/ipc.cc \ |
3680cc44 FC |
2278 | sys/param.h \ |
2279 | sys/prctl.h \ | |
321223fe | 2280 | sys/procctl.h \ |
3680cc44 | 2281 | sys/md5.h \ |
c975f532 | 2282 | sys/mman.h \ |
3680cc44 FC |
2283 | sys/msg.h \ |
2284 | sys/resource.h \ | |
2ccf2eb2 | 2285 | sys/select.h \ |
d440d5a4 | 2286 | sys/shm.h \ |
3680cc44 FC |
2287 | sys/socket.h \ |
2288 | sys/stat.h \ | |
3680cc44 FC |
2289 | syscall.h \ |
2290 | sys/syscall.h \ | |
2291 | sys/time.h \ | |
2292 | sys/types.h \ | |
2293 | sys/uio.h \ | |
2294 | sys/un.h \ | |
2295 | sys/vfs.h \ | |
2296 | sys/wait.h \ | |
2297 | syslog.h \ | |
2298 | time.h \ | |
2299 | unistd.h \ | |
2300 | utime.h \ | |
2301 | varargs.h \ | |
2302 | byteswap.h \ | |
2303 | glib.h \ | |
2304 | stdint.h \ | |
2305 | inttypes.h \ | |
cdb86165 | 2306 | wchar.h |
db40ae20 | 2307 | ) |
3c586e38 | 2308 | |
ee80a919 AR |
2309 | AC_CHECK_HEADERS( \ |
2310 | linux/netfilter_ipv4.h \ | |
2311 | linux/netfilter_ipv6/ip6_tables.h \ | |
fc68f6b1 | 2312 | ,,, |
dcd1dc78 | 2313 | SQUID_DEFAULT_INCLUDES |
2314 | #if HAVE_LIMITS_H | |
2315 | #include <limits.h> | |
2316 | #endif | |
a74968c2 AJ |
2317 | /* Netfilter ip(6)tables v1.4.0 has broken headers */ |
2318 | #if HAVE_NETINET_IN_H | |
2319 | #include <netinet/in.h> | |
2320 | #endif | |
dcd1dc78 | 2321 | ) |
2322 | ||
61beade2 | 2323 | dnl *BSD do not include the dependencies for all their net/ and netinet/ files |
c92b4732 | 2324 | dnl We must include a few basic type headers for them to work. |
d1e5191e | 2325 | AC_CHECK_HEADERS( \ |
0c0d381b FC |
2326 | net/if.h \ |
2327 | netinet/if_ether.h\ | |
2328 | netinet/icmp6.h \ | |
2329 | netinet/in.h \ | |
2330 | netinet/ip.h \ | |
2331 | netinet/ip6.h \ | |
0c0d381b FC |
2332 | netinet/ip_icmp.h \ |
2333 | netinet/ipl.h \ | |
0c0d381b FC |
2334 | net/pf/pfvar.h \ |
2335 | net/pfvar.h \ | |
2336 | sys/mount.h\ | |
2337 | resolv.h \ | |
d1e5191e AJ |
2338 | ,,, |
2339 | SQUID_BSDNET_INCLUDES) | |
5a3237b0 | 2340 | |
aee0606f | 2341 | AC_C_CONST |
d57288d2 | 2342 | AC_C_BIGENDIAN |
aee0606f | 2343 | |
6a9f6389 | 2344 | AC_CHECK_MEMBERS([struct tm.tm_gmtoff],,,[ |
a1c22363 | 2345 | #if HAVE_TIME_H |
6a9f6389 | 2346 | #include <time.h> |
2347 | #endif | |
5c51415d | 2348 | ]) |
46c883ed | 2349 | |
08caf8c6 | 2350 | dnl Override rusage() detect on MinGW because is emulated in source code |
a1c22363 AJ |
2351 | AS_IF([test "$squid_host_os" = "mingw"],[ |
2352 | AC_DEFINE(HAVE_STRUCT_RUSAGE) | |
2353 | ac_cv_func_getrusage="yes" | |
2354 | AC_MSG_NOTICE([Using own rusage on Windows.]) | |
2355 | ],[ | |
2356 | AC_CHECK_TYPE(struct rusage,AC_DEFINE(HAVE_STRUCT_RUSAGE,1,[The system provides struct rusage]),,[ | |
8ff51bba | 2357 | #if HAVE_SYS_TIME_H |
2358 | #include <sys/time.h> | |
2359 | #endif | |
b54a6789 | 2360 | #if HAVE_SYS_RESOURCE_H |
2361 | #include <sys/resource.h> | |
a1c22363 AJ |
2362 | #endif |
2363 | ]) | |
2364 | ]) | |
b54a6789 | 2365 | |
6a9f6389 | 2366 | AC_CHECK_MEMBERS([struct iphdr.ip_hl],,,[ |
2367 | #if HAVE_SYS_TYPES_H | |
2368 | #include <sys/types.h> | |
2369 | #endif | |
a025a745 | 2370 | #include <netinet/in.h> |
2371 | #include <netinet/in_systm.h> | |
6ad85e8a | 2372 | #include <netinet/ip.h> |
b05490a8 | 2373 | #if defined (__linux__) || defined (__CYGWIN__) |
6ad85e8a | 2374 | #define ip_hl ihl |
2375 | #endif | |
2376 | #ifndef __linux__ | |
b05490a8 | 2377 | #ifndef __CYGWIN__ |
6ad85e8a | 2378 | #define iphdr ip |
b05490a8 | 2379 | #endif |
6a9f6389 | 2380 | #endif]) |
a025a745 | 2381 | |
090089c4 | 2382 | dnl Check for typedefs |
77d6bd88 | 2383 | AC_CHECK_SIZEOF(void *) |
090089c4 | 2384 | |
41aa7d00 FC |
2385 | # check for a bunch of types |
2386 | AC_TYPE_INT8_T | |
2387 | AC_TYPE_UINT8_T | |
2388 | AC_TYPE_INT16_T | |
2389 | AC_TYPE_UINT16_T | |
2390 | AC_TYPE_INT32_T | |
2391 | AC_TYPE_UINT32_T | |
2392 | AC_TYPE_INT64_T | |
2393 | AC_TYPE_UINT64_T | |
2394 | AC_TYPE_PID_T | |
2395 | AC_TYPE_SIZE_T | |
2396 | AC_TYPE_SSIZE_T | |
2397 | AC_TYPE_OFF_T | |
2398 | AC_TYPE_UID_T | |
59a09b98 | 2399 | AC_CHECK_TYPE([bool]) |
41aa7d00 FC |
2400 | #need the defines for PRId64 |
2401 | AC_CHECK_SIZEOF(int64_t) | |
2402 | AC_CHECK_SIZEOF(long) | |
fe1e5c91 AJ |
2403 | #need the defines for PRIuSIZE |
2404 | AC_CHECK_SIZEOF(size_t) | |
50f9c873 AR |
2405 | #need the define for overflow checks |
2406 | AC_CHECK_SIZEOF(off_t) | |
46e172d9 | 2407 | AC_CHECK_SIZEOF(size_t) |
6a9f6389 | 2408 | |
588e71df | 2409 | dnl On Solaris 9 x86, gcc may includes a "fixed" set of old system include files |
2410 | dnl that is incompatible with the updated Solaris header files. | |
2411 | dnl For this reason, we must check if pad128_t and upad128_t are defined. | |
2412 | AC_CHECK_TYPE(pad128_t, | |
2413 | AC_DEFINE(HAVE_PAD128_T,1,[pad128_t is defined in system headers]), | |
2414 | ,SQUID_DEFAULT_INCLUDES) | |
2415 | ||
2416 | AC_CHECK_TYPE(upad128_t, | |
2417 | AC_DEFINE(HAVE_UPAD128_T,1,[upad128_t is defined in system headers]), | |
2418 | ,SQUID_DEFAULT_INCLUDES) | |
2419 | ||
6a9f6389 | 2420 | AC_CHECK_TYPE(mode_t, AC_DEFINE(HAVE_MODE_T,1,[mode_t is defined by the system headers]),,SQUID_DEFAULT_INCLUDES) |
2421 | AC_CHECK_TYPE(fd_mask, AC_DEFINE(HAVE_FD_MASK,1,[fd_mask is defined by the system headers]),,SQUID_DEFAULT_INCLUDES) | |
adcceb47 | 2422 | |
6a9f6389 | 2423 | AC_CHECK_TYPE(socklen_t,AC_DEFINE(HAVE_SOCKLEN_T,1,[socklen_t is defined by the system headers]),,[ |
2424 | #include <sys/types.h> | |
6637e3a5 | 2425 | #include <sys/socket.h> |
6637e3a5 | 2426 | #include <stdlib.h> |
2427 | #include <stddef.h> | |
a1c22363 | 2428 | ]) |
6637e3a5 | 2429 | |
cdb352bb FC |
2430 | AC_CHECK_TYPE(mtyp_t,AC_DEFINE(HAVE_MTYP_T,1, |
2431 | [mtyp_t is defined by the system headers]),,[#include <sys/types.h> | |
2432 | #include <sys/ipc.h> | |
2433 | #include <sys/msg.h>]) | |
2434 | ||
f367e6af AJ |
2435 | AC_CHECK_TYPE(cpu_set_t, |
2436 | AC_DEFINE(HAVE_CPU_SET_T,1,[cpu_set_t is defined by the system headers]),,[ | |
2437 | #if HAVE_SCHED_H | |
2438 | #include <sched.h> | |
2439 | #endif | |
2440 | ]) | |
2441 | ||
fe1e5c91 AJ |
2442 | # check for compiler support of %zu printf macro |
2443 | AH_TEMPLATE(PRIuSIZE,[Compiler supports %zu printf macro]) | |
2444 | AC_MSG_CHECKING([for compiler %zu support]) | |
2445 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ | |
2446 | #include <stdio.h> | |
2447 | ]],[[size_t n=1;printf("%zu",n);]])],[ | |
2448 | AC_DEFINE(PRIuSIZE,"zu") | |
2449 | AC_MSG_RESULT(yes) | |
2450 | ],[AC_MSG_RESULT(no)],[AC_MSG_RESULT(no)]) | |
2451 | ||
2452 | ||
cdb352bb FC |
2453 | dnl Check for special functions |
2454 | AC_FUNC_ALLOCA | |
2455 | ||
59eac907 AJ |
2456 | SQUID_AUTO_LIB(cap,[Linux capabilities],[LIBCAP]) |
2457 | AS_IF([test "x$with_cap" != "xno"],[ | |
2458 | SQUID_STATE_SAVE(squid_libcap_state) | |
24531401 AJ |
2459 | CXXFLAGS="$LIBCAP_CFLAGS $CXXFLAGS" |
2460 | LDFLAGS="$LIBCAP_PATH $LDFLAGS" | |
59eac907 AJ |
2461 | PKG_CHECK_MODULES([LIBCAP],[libcap >= 2.09],[],[ |
2462 | # cap_clear_flag is the most recent libcap function we require | |
2463 | AC_CHECK_LIB([cap],[cap_clear_flag],[LIBCAP_LIBS="$LIBCAP_LIBS -lcap"]) | |
2464 | ]) | |
45c41a07 | 2465 | SQUID_CHECK_FUNCTIONAL_LIBCAP2 |
59eac907 AJ |
2466 | AC_MSG_NOTICE([libcap headers are ok: $squid_cv_sys_capability_works]) |
2467 | AS_IF([test "x$squid_cv_sys_capability_works" = "xno"],[LIBCAP_LIBS=""]) | |
2468 | SQUID_STATE_ROLLBACK(squid_libcap_state) | |
2469 | ||
2470 | AS_IF([test "x$LIBCAP_LIBS" != "x"],[ | |
2471 | with_cap=yes | |
2472 | CPPFLAGS="$LIBCAP_CFLAGS $CPPFLAGS" | |
2473 | LIBCAP_LIBS="$LIBCAP_PATH $LIBCAP_LIBS" | |
2474 | AC_DEFINE(USE_LIBCAP,1,[Linux capabilities library support]) | |
2475 | ],[test "x$with_cap" = "xyes"],[ | |
2476 | AC_MSG_ERROR([Required library libcap not found]) | |
a1c22363 | 2477 | ],[ |
59eac907 AJ |
2478 | AC_MSG_NOTICE([Library libcap not found]) |
2479 | with_cap=no | |
a1c22363 AJ |
2480 | ]) |
2481 | ]) | |
59eac907 | 2482 | AC_MSG_NOTICE([Linux capabilities support enabled: ${with_cap} ${LIBCAP_LIBS}]) |
b64b6030 | 2483 | |
090089c4 | 2484 | dnl Check for needed libraries |
54c95954 | 2485 | AC_SEARCH_LIBS([gethostbyname],[nsl resolv bind]) |
819656da AJ |
2486 | AC_SEARCH_LIBS([res_init],[resolv]) |
2487 | AC_SEARCH_LIBS([__res_search],[resolv]) | |
54c95954 FC |
2488 | AC_SEARCH_LIBS([bind],[socket]) |
2489 | AC_SEARCH_LIBS([opcom_stack_trace],[opcom_stack]) | |
85cd85f3 | 2490 | AC_SEARCH_LIBS([yp_match], [nsl nss_nis nss_nisplus]) |
bfe8dedf | 2491 | dnl Check for Winsock only on MinGW, on Cygwin we must use emulated BSD socket API |
a1c22363 | 2492 | AS_IF([test "x$squid_host_os" = "xmingw"],[ |
0c0d381b | 2493 | SQUID_CHECK_WINSOCK_LIB |
32341684 AJ |
2494 | AC_CHECK_HEADERS( \ |
2495 | windows.h \ | |
2496 | ws2tcpip.h \ | |
b966288b | 2497 | iphlpapi.h ,,,[ |
2ff9dfaa AJ |
2498 | #if HAVE_WINSOCK2_H |
2499 | #include <winsock2.h> | |
2500 | #endif | |
32341684 AJ |
2501 | #if HAVE_WINDOWS_H |
2502 | #include <windows.h> | |
2503 | #endif | |
2ff9dfaa AJ |
2504 | #if HAVE_WS2TCPIP_H |
2505 | #include <ws2tcpip.h> | |
2506 | #endif | |
a1c22363 | 2507 | ]) |
2ff9dfaa | 2508 | ]) |
94d48591 | 2509 | |
46f50de9 FC |
2510 | # check that we have unix sockets |
2511 | SQUID_CHECK_UNIX_SOCKET | |
2512 | SQUID_DEFINE_BOOL(HAVE_UNIXSOCKET,$squid_cv_unixsocket,[System supports unix sockets]) | |
2513 | ||
2514 | AC_CHECK_LIB(gnumalloc, malloc) | |
a1c22363 | 2515 | AS_IF([test "x$ac_cv_lib_gnumalloc_malloc" = "xyes"],[ |
ef7ece58 | 2516 | AC_MSG_NOTICE([Disabling extended malloc functions when using bundled gnumalloc]) |
46f50de9 FC |
2517 | ac_cv_func_mallocblksize=no |
2518 | ac_cv_func_mallopt=no | |
a1c22363 AJ |
2519 | ],[ |
2520 | AS_CASE(["$squid_host_os"], | |
2521 | [solaris],[AC_MSG_NOTICE([skipping libmalloc check for $host])], | |
2522 | [freebsd],[AC_MSG_NOTICE([skipping libmalloc check for $host])], | |
2523 | [AC_CHECK_LIB(malloc, main)] | |
2524 | ) | |
2525 | ]) | |
2526 | ||
2527 | AS_IF([test "$squid_host_os" = "mingw"],[ | |
2528 | AC_MSG_NOTICE([Use MSVCRT for math functions.]) | |
2529 | ],[ | |
2530 | dnl log() are only used in old C code for now. | |
2531 | AC_LANG_PUSH([C]) | |
2532 | AC_SEARCH_LIBS([log],[m]) | |
2533 | AC_LANG_POP([C]) | |
2534 | ]) | |
090089c4 | 2535 | |
f467f578 FC |
2536 | dnl --with-maxfd present for compatibility with Squid-2. |
2537 | dnl undocumented in ./configure --help to encourage using the Squid-3 directive | |
a1c22363 AJ |
2538 | AC_ARG_WITH(maxfd,,[ |
2539 | AS_CASE([$withval], | |
c881e2b1 | 2540 | [@<:@0-9@:>@*],[ |
f467f578 | 2541 | squid_filedescriptors_num=$withval |
acea95af | 2542 | AC_MSG_NOTICE([forcing default of $squid_filedescriptors_num filedescriptors (user-forced)]) |
a1c22363 AJ |
2543 | ], |
2544 | [AC_MSG_ERROR(--with-maxfd expects a numeric argument)] | |
2545 | ) | |
055421ee | 2546 | ]) |
001ad4cc | 2547 | |
f467f578 FC |
2548 | AC_ARG_WITH(filedescriptors, |
2549 | AS_HELP_STRING([--with-filedescriptors=NUMBER], | |
c881e2b1 | 2550 | [Force squid to support NUMBER filedescriptors]),[ |
a1c22363 | 2551 | AS_CASE([$withval], |
c881e2b1 | 2552 | [@<:@0-9@:>@*],[ |
f467f578 | 2553 | squid_filedescriptors_num=$withval |
a1c22363 AJ |
2554 | AC_MSG_NOTICE([forcing default of $squid_filedescriptors_num filedescriptors (user-forced)])], |
2555 | [AC_MSG_ERROR([--with-filedescriptors expects a numeric argument])] | |
2556 | ) | |
c881e2b1 | 2557 | ]) |
f467f578 FC |
2558 | |
2559 | SQUID_CHECK_DEFAULT_FD_SETSIZE | |
acea95af | 2560 | SQUID_CHECK_MAXFD |
001ad4cc | 2561 | |
f467f578 | 2562 | |
001ad4cc AJ |
2563 | dnl Enable IPv6 support |
2564 | AC_MSG_CHECKING([whether to enable IPv6]) | |
001ad4cc | 2565 | AC_ARG_ENABLE(ipv6, |
af494bc8 | 2566 | AS_HELP_STRING([--disable-ipv6],[Disable IPv6 support. The default is to probe system capabilities on startup.]), [ |
ec308e40 | 2567 | SQUID_YESNO([$enableval],[--enable-ipv6]) |
001ad4cc | 2568 | ]) |
7d927f1f AJ |
2569 | AC_MSG_RESULT(${enable_ipv6:=yes}) |
2570 | SQUID_DEFINE_BOOL(USE_IPV6,$enable_ipv6,[Enable support for IPv6 ]) | |
001ad4cc | 2571 | |
a1c22363 | 2572 | AS_IF([test "x$enable_ipv6" = "xyes"],[SQUID_CHECK_SIN6_LEN_IN_SAI]) |
7d553ad9 AJ |
2573 | SQUID_CHECK_SS_LEN_IN_SOCKADDR_STORAGE |
2574 | SQUID_CHECK_SIN_LEN_IN_SOCKADDR_IN | |
001ad4cc | 2575 | |
77f675ad | 2576 | dnl System-specific library modifications |
a1c22363 AJ |
2577 | AH_TEMPLATE(GETTIMEOFDAY_NO_TZP,[Whether gettimeofday takes only one argument]) |
2578 | AS_CASE(["$host"], | |
2579 | [*-pc-sco3.2*],[ | |
2580 | # -lintl is needed on SCO version 3.2v4.2 for strftime() | |
2581 | # Robert Side <rside@aiinc.bc.ca> | |
2582 | # Mon, 18 Jan 1999 17:48:00 GMT | |
2583 | AC_CHECK_LIB(intl, strftime) | |
2584 | ], | |
2585 | ||
2586 | [i386-*-solaris2.*],[ | |
2587 | AS_IF([test "x$GCC" = "xyes"],[ | |
fcabe077 | 2588 | AC_MSG_NOTICE([Removing -O for gcc on $host]) |
d0441961 | 2589 | CFLAGS="`echo $CFLAGS | sed -e 's/-O[[0-9g]]*//'`" |
a1c22363 AJ |
2590 | ]) |
2591 | ], | |
141eb4a6 | 2592 | |
a1c22363 | 2593 | [*-sgi-irix*],[ |
fcabe077 FC |
2594 | AC_MSG_NOTICE([Removing -lsocket for IRIX...]) |
2595 | LIBS=`echo $LIBS | sed -e s/-lsocket//` | |
2596 | AC_MSG_NOTICE([Removing -lnsl for IRIX...]) | |
2597 | LIBS=`echo $LIBS | sed -e s/-lnsl//` | |
2598 | ac_cv_lib_nsl_main=no | |
a1c22363 AJ |
2599 | ], |
2600 | ||
2601 | [*-ibm-aix*],[ | |
3e1ce596 KB |
2602 | SQUID_CC_REQUIRE_ARGUMENT([ac_cv_require_rtti],[-rtti],[[ |
2603 | #include <assert.h> | |
2604 | #ifndef NULL | |
2605 | #define NULL 0 | |
2606 | #endif | |
2607 | class Foo{ | |
2608 | public:virtual ~Foo(){} | |
2609 | }; | |
2610 | class Bar:public Foo{ | |
2611 | public:Bar():Foo(){} | |
2612 | }; | |
2613 | ]],[[ | |
2614 | Foo * myFoo=new Bar(); | |
2615 | Bar * myBar=dynamic_cast<Bar *>(myFoo); | |
2616 | assert(myBar != NULL); | |
2617 | ]]) | |
a1c22363 | 2618 | AS_IF([test "$ac_cv_require_rtti" = "yes"],[ |
3e1ce596 KB |
2619 | SQUID_CFLAGS="-rtti $SQUID_CFLAGS" |
2620 | SQUID_CXXFLAGS="-rtti $SQUID_CXXFLAGS" | |
a1c22363 | 2621 | ]) |
3e1ce596 KB |
2622 | |
2623 | AC_LANG_PUSH([C]) | |
2624 | SQUID_CC_REQUIRE_ARGUMENT([ac_cv_require_qcpluscmt],[-qcpluscmt],[[]],[[//c++ cmt]]) | |
fcabe077 | 2625 | AC_LANG_POP([C]) |
a1c22363 | 2626 | AS_IF([test "$ac_cv_require_qcpluscmt" = "yes"],[ |
3e1ce596 | 2627 | SQUID_CFLAGS="-qcpluscmt $SQUID_CFLAGS" |
a1c22363 AJ |
2628 | ]) |
2629 | ], | |
2630 | ||
2631 | [*-*-solaris2.[[0-4]]],[AC_DEFINE(GETTIMEOFDAY_NO_TZP,1)], | |
3e1ce596 | 2632 | |
a1c22363 AJ |
2633 | [*-sony-newsos[[56]]*],[AC_DEFINE(GETTIMEOFDAY_NO_TZP,1)] |
2634 | ) | |
090089c4 | 2635 | |
84cecfd2 | 2636 | dnl This has to be before AC_CHECK_FUNCS |
2637 | # Disable poll() on certain platforms. Override by setting ac_cv_func_poll | |
2638 | # when running configure. | |
a1c22363 AJ |
2639 | AS_IF([test "x$ac_cv_func_poll" = "x"],[ |
2640 | AS_CASE(["$host"], | |
2641 | [*-hp-hpux*.*],[ | |
fcabe077 FC |
2642 | # Duane Wessels |
2643 | AC_MSG_NOTICE([disabling poll for $host...]) | |
2644 | ac_cv_func_poll='no' | |
a1c22363 AJ |
2645 | ], |
2646 | ||
2647 | [*-linux-*],[ | |
fcabe077 FC |
2648 | # Henrik Nordstrom (hno@squid-cache.org) 19980817 |
2649 | # poll is problematic on Linux. We disable it | |
2650 | # by default until Linux gets it right. | |
2651 | rev=`uname -r | awk -F. '{printf "%03d%03d",$1,$2}'` | |
a1c22363 | 2652 | AS_IF([test $rev -lt 002002],[ |
fcabe077 FC |
2653 | AC_MSG_NOTICE([disabling poll for $host < 2.2...]) |
2654 | ac_cv_func_poll='no' | |
a1c22363 AJ |
2655 | ]) |
2656 | ], | |
2657 | ||
2658 | [powerpc-ibm-aix4.1.*],[ | |
fcabe077 FC |
2659 | # Mike Laster (mlaster@metavillage.com) 19981021 |
2660 | AC_MSG_NOTICE([disabling poll for $host...]) | |
2661 | ac_cv_func_poll='no' | |
a1c22363 AJ |
2662 | ] |
2663 | ) | |
2664 | ]) | |
176d10ee | 2665 | |
6716b242 | 2666 | dnl Check for library functions |
2667 | AC_CHECK_FUNCS(\ | |
ce3d30fb | 2668 | backtrace_symbols_fd \ |
3a144521 | 2669 | bcopy \ |
4de1e2da | 2670 | eui64_aton \ |
4ac29a5b | 2671 | fchmod \ |
6716b242 | 2672 | getdtablesize \ |
8505e57b | 2673 | getpagesize \ |
230c091c | 2674 | getpass \ |
30a4f2a8 | 2675 | getrusage \ |
9c1d8929 | 2676 | getspnam \ |
379d5751 | 2677 | gettimeofday \ |
52303a3d | 2678 | glob \ |
0f5efab0 | 2679 | mallocblksize \ |
6716b242 | 2680 | mallopt \ |
2ae6b9b0 | 2681 | memcpy \ |
30a4f2a8 | 2682 | memmove \ |
ee4d4e85 | 2683 | memrchr \ |
dac27377 | 2684 | memset \ |
b99a6dec | 2685 | mkstemp \ |
1812b6c7 | 2686 | mktime \ |
88738790 | 2687 | mstats \ |
84cecfd2 | 2688 | poll \ |
62ae0622 | 2689 | prctl \ |
321223fe | 2690 | procctl \ |
3a144521 | 2691 | pthread_attr_setschedparam \ |
cd748f27 | 2692 | pthread_attr_setscope \ |
2693 | pthread_setschedparam \ | |
42b51993 | 2694 | pthread_sigmask \ |
c68e9c6b | 2695 | putenv \ |
c2afddd8 AJ |
2696 | regcomp \ |
2697 | regexec \ | |
2698 | regfree \ | |
819656da AJ |
2699 | res_init \ |
2700 | __res_init \ | |
4915be3b | 2701 | rint \ |
96c2bb61 AR |
2702 | sched_getaffinity \ |
2703 | sched_setaffinity \ | |
3a144521 | 2704 | select \ |
234967c9 | 2705 | seteuid \ |
c415c128 | 2706 | setgroups \ |
321223fe | 2707 | setpflags \ |
30a4f2a8 | 2708 | setpgrp \ |
30a4f2a8 | 2709 | setsid \ |
2710 | sigaction \ | |
11430c03 | 2711 | snprintf \ |
1ccc0d40 | 2712 | socketpair \ |
6716b242 | 2713 | sysconf \ |
2714 | syslog \ | |
234967c9 | 2715 | timegm \ |
28da5e0d | 2716 | vsnprintf \ |
6716b242 | 2717 | ) |
f5e5c4cf | 2718 | dnl ... and some we provide local replacements for |
2719 | AC_REPLACE_FUNCS(\ | |
f5e5c4cf | 2720 | initgroups \ |
2ccf2eb2 | 2721 | psignal \ |
f5e5c4cf | 2722 | strerror \ |
585cddda | 2723 | strtoll \ |
f5e5c4cf | 2724 | tempnam \ |
2725 | ) | |
6716b242 | 2726 | |
dfb96b6b | 2727 | AC_CHECK_DECLS([getaddrinfo,getnameinfo,inet_ntop,inet_pton,InetNtopA,InetPtonA],,,[ |
55d7d5e9 AJ |
2728 | /* |
2729 | * BSD requires sys/types.h, sys/socket.h, netinet/in.h, netdb.h, arpa/inet.h | |
2730 | * Linux requires sys/types.h, sys/socket.h, arpa/inet.h | |
2731 | * Windows requires sys/socket.h, winsock2.h, ws2tcpip.h | |
2732 | */ | |
2733 | #if HAVE_SYS_TYPES_H | |
2734 | #include <sys/types.h> | |
2735 | #endif | |
2736 | #if HAVE_NETINET_IN_H | |
2737 | #include <netinet/in.h> | |
2738 | #endif | |
2739 | #if HAVE_SYS_SOCKET_H | |
2740 | #include <sys/socket.h> | |
2741 | #endif | |
2742 | #if HAVE_NETDB_H | |
2743 | #include <netdb.h> | |
2744 | #endif | |
2745 | #if HAVE_ARPA_INET_H | |
2746 | #include <arpa/inet.h> | |
2747 | #endif | |
2748 | #if HAVE_WINSOCK2_H | |
2749 | #include <winsock2.h> | |
2750 | #endif | |
2751 | #if HAVE_WS2TCPIP_H | |
2752 | #include <ws2tcpip.h> | |
2753 | #endif | |
2754 | ]) | |
2755 | ||
9676633b FC |
2756 | # Magic which checks whether we are forcing a type of comm loop we |
2757 | # are actually going to (ab)use. | |
2758 | # Mostly ripped from squid-commloops, thanks to adrian and benno | |
1b3db6d9 | 2759 | |
a1c22363 AJ |
2760 | AS_IF([test "x$squid_opt_io_loop_engine" != "x"], |
2761 | AC_MSG_NOTICE([choosing user-specified net I/O API $squid_opt_io_loop_engine]), | |
2762 | [test "x$enable_epoll" != "xno" -a "x$squid_cv_epoll_works" = "xyes"], | |
2763 | squid_opt_io_loop_engine="epoll", | |
2764 | [test "x$enable_kqueue" != "xno"], | |
2765 | squid_opt_io_loop_engine="kqueue", | |
2766 | [test "x$enable_devpoll" != "xno"], | |
2767 | squid_opt_io_loop_engine="devpoll", | |
2768 | [test "x$enable_poll" != "xno" -a "x$ac_cv_func_poll" = "xyes"], | |
2769 | squid_opt_io_loop_engine="poll", | |
2770 | [test "x$enable_select" != "xno" -a "x$ac_cv_func_select" = "xyes"], | |
2771 | squid_opt_io_loop_engine="select", | |
2772 | [test "x$enable_select" != "xno" -a "x$squid_host_os" = "xmingw"], | |
2773 | squid_opt_io_loop_engine="select_win32", | |
2774 | [ | |
2775 | AC_MSG_WARN([Eep! Cannot find epoll, kqueue, /dev/poll, poll or select!]) | |
2776 | AC_MSG_WARN([Will try select and hope for the best.]) | |
2777 | squid_opt_io_loop_engine="select" | |
2778 | ] | |
2779 | ) | |
d474c7a6 | 2780 | |
8075a4da | 2781 | AC_MSG_NOTICE([Using ${squid_opt_io_loop_engine} for the IO loop.]) |
d474c7a6 | 2782 | |
8aafbbc1 AJ |
2783 | AM_CONDITIONAL(ENABLE_POLL, test "x$squid_opt_io_loop_engine" = "xpoll") |
2784 | AM_CONDITIONAL(ENABLE_EPOLL, test "x$squid_opt_io_loop_engine" = "xepoll") | |
2785 | AM_CONDITIONAL(ENABLE_SELECT, test "x$squid_opt_io_loop_engine" = "xselect") | |
2786 | AM_CONDITIONAL(ENABLE_SELECT_WIN32, test "x$squid_opt_io_loop_engine" = "xselect_win32") | |
2787 | AM_CONDITIONAL(ENABLE_KQUEUE, test "x$squid_opt_io_loop_engine" = "xkqueue") | |
2788 | AM_CONDITIONAL(ENABLE_DEVPOLL, test "x$squid_opt_io_loop_engine" = "xdevpoll") | |
d474c7a6 | 2789 | |
a1c22363 AJ |
2790 | AS_CASE([$squid_opt_io_loop_engine], |
2791 | [epoll],[AC_DEFINE(USE_EPOLL,1,[Use epoll() for the IO loop])], | |
2792 | [devpoll],[AC_DEFINE(USE_DEVPOLL,1,[Use /dev/poll for the IO loop])], | |
2793 | [poll],[AC_DEFINE(USE_POLL,1,[Use poll() for the IO loop])], | |
2794 | [kqueue],[AC_DEFINE(USE_KQUEUE,1,[Use kqueue() for the IO loop])], | |
2795 | [select_win32],[AC_DEFINE(USE_SELECT_WIN32,1,[Use Winsock select() for the IO loop])], | |
2796 | [select],[AC_DEFINE(USE_SELECT,1,[Use select() for the IO loop])], | |
2797 | ) | |
1b3db6d9 | 2798 | |
a1c22363 | 2799 | AS_IF([test "x$ac_cv_func_sched_getaffinity" = "xyes" -a "x$ac_cv_func_sched_setaffinity" = "xyes"],[ |
96c2bb61 | 2800 | AC_DEFINE(HAVE_CPU_AFFINITY,1,[Support setting CPU affinity for workers]) |
a1c22363 | 2801 | ]) |
96c2bb61 | 2802 | |
91983da0 | 2803 | SQUID_CHECK_SETRESUID_WORKS |
a1c22363 | 2804 | AS_IF([test "x$squid_cv_resuid_works" = "xyes"],[ |
be0c7ff0 | 2805 | AC_DEFINE(HAVE_SETRESUID,1,[Yay! Another Linux brokenness. Knowing that setresuid() exists is not enough, because RedHat 5.0 declares setresuid() but does not implement it.]) |
a1c22363 | 2806 | ]) |
60939927 | 2807 | |
2ff9dfaa | 2808 | AC_CHECK_HEADERS(mswsock.h) |
14c0d3ab DK |
2809 | AC_MSG_CHECKING([for constant CMSG_SPACE]) |
2810 | AC_COMPILE_IFELSE([AC_LANG_SOURCE([[ | |
2811 | #if HAVE_SYS_SOCKET_H | |
2812 | #include <sys/socket.h> | |
2813 | #endif | |
2ff9dfaa AJ |
2814 | #if HAVE_MSWSOCK_H |
2815 | #include <mswsock.h> | |
2816 | #endif | |
14c0d3ab DK |
2817 | |
2818 | int a[CMSG_SPACE(int)]; | |
2819 | ]])], [ | |
2820 | AC_MSG_RESULT(yes) | |
2821 | AC_DEFINE(HAVE_CONSTANT_CMSG_SPACE, 1, [Define to 1 if CMSG_SPACE is constant]) | |
2822 | ], [ | |
2823 | AC_MSG_RESULT(no) | |
2824 | ]) | |
2825 | ||
ecd8516d | 2826 | AC_CHECK_TYPE(struct cmsghdr,AC_DEFINE(HAVE_CMSGHDR,1,[The system provides struct cmsghdr]),,[ |
c72f8c2e AJ |
2827 | #if HAVE_SYS_SOCKET_H |
2828 | #include <sys/socket.h> | |
2829 | #endif | |
2ff9dfaa AJ |
2830 | #if HAVE_MSWSOCK_H |
2831 | #include <mswsock.h> | |
2832 | #endif | |
c72f8c2e AJ |
2833 | #if HAVE_WINSOCK2_H |
2834 | #include <winsock2.h> | |
2835 | #endif | |
2836 | ]) | |
2837 | ||
ecd8516d | 2838 | AC_CHECK_TYPE(struct iovec,AC_DEFINE(HAVE_IOVEC,1,[The system provides struct iovec]),,[ |
c72f8c2e AJ |
2839 | #if HAVE_SYS_SOCKET_H |
2840 | #include <sys/socket.h> | |
2841 | #endif | |
2842 | #if HAVE_WINSOCK2_H | |
2843 | #include <winsock2.h> | |
2844 | #endif | |
9ac84dcf FC |
2845 | #if HAVE_SYS_UIO_H |
2846 | #include <sys/uio.h> | |
2847 | #endif | |
c72f8c2e AJ |
2848 | ]) |
2849 | ||
ecd8516d | 2850 | AC_CHECK_TYPE(struct msghdr,AC_DEFINE(HAVE_MSGHDR,1,[The system provides struct msghdr]),,[ |
c72f8c2e AJ |
2851 | #if HAVE_SYS_SOCKET_H |
2852 | #include <sys/socket.h> | |
2853 | #endif | |
2ff9dfaa AJ |
2854 | #if HAVE_MSWSOCK_H |
2855 | #include <mswsock.h> | |
2856 | #endif | |
c72f8c2e AJ |
2857 | #if HAVE_WINSOCK2_H |
2858 | #include <winsock2.h> | |
2859 | #endif | |
2860 | ]) | |
2861 | ||
ecd8516d | 2862 | AC_CHECK_TYPE(struct sockaddr_un,AC_DEFINE(HAVE_SOCKADDR_UN,1,[The system provides sockaddr_un]),,[ |
c72f8c2e AJ |
2863 | #if HAVE_SYS_UN_H |
2864 | #include <sys/un.h> | |
2865 | #endif | |
2866 | #if HAVE_SYS_SOCKET_H | |
2867 | #include <sys/socket.h> | |
2868 | #endif | |
2869 | #if HAVE_WINSOCK2_H | |
2870 | #include <winsock2.h> | |
2871 | #endif | |
2872 | ]) | |
2873 | ||
0abb39dd | 2874 | SQUID_CHECK_FUNC_STRNSTR |
cee08cbc | 2875 | |
5cafc1d6 | 2876 | dnl IP-Filter support requires ipf header files. These aren't |
2877 | dnl installed by default, so we need to check for them | |
a1c22363 AJ |
2878 | AS_IF([test "x$enable_ipf_transparent" != "xno"],[ |
2879 | SQUID_CHECK_BROKEN_SOLARIS_IPFILTER | |
2880 | AC_MSG_CHECKING(for availability of IP-Filter header files) | |
2881 | # hold on to your hats... | |
2882 | AS_IF( | |
2883 | [test "x$ac_cv_header_ip_compat_h" = "xyes" -o \ | |
2884 | "x$ac_cv_header_ip_fil_compat_h" = "xyes" -o \ | |
2885 | "x$ac_cv_header_netinet_ip_compat_h" = "xyes" -o \ | |
2886 | "x$ac_cv_header_netinet_ip_fil_compat_h" = "xyes"], | |
2887 | [have_ipfilter_compat_header="yes"]) | |
2888 | ||
2889 | AS_IF( | |
2890 | [test "x$have_ipfilter_compat_header" = "xyes" -a \ | |
2891 | "x$ac_cv_header_ip_fil_h" = "xyes" -a \ | |
2892 | "x$ac_cv_header_ip_nat_h" = "xyes"],[enable_ipf_transparent="yes"], | |
2893 | ||
2894 | [test "x$have_ipfilter_compat_header" = "xyes" -a \ | |
2895 | "x$ac_cv_header_netinet_ip_fil_h" = "xyes" -a \ | |
2896 | "x$ac_cv_header_netinet_ip_nat_h" = "xyes"],[enable_ipf_transparent="yes"], | |
2897 | [enable_ipf_transparent="no"]) | |
2898 | ||
2899 | AC_MSG_RESULT($IPF_TRANSPARENT) | |
d25bbe26 AJ |
2900 | |
2901 | ## On Solaris Ipfilter includes expect that SOLARIS2 is defined with the | |
2902 | ## Solaris minor version (8, 9, 10, ...) | |
a1c22363 | 2903 | AS_IF([test "x$enable_ipf_transparent" = "xyes" -a "x$squid_host_os" = "xsolaris"],[ |
d25bbe26 AJ |
2904 | solrev=`uname -r | sh -c 'IFS=. read j n x; echo $n'` |
2905 | CFLAGS="-DSOLARIS2=$solrev $CFLAGS" | |
2906 | CXXFLAGS="-DSOLARIS2=$solrev $CXXFLAGS" | |
a1c22363 AJ |
2907 | ]) |
2908 | ]) | |
1d26e252 | 2909 | AC_MSG_NOTICE([IPF-based transparent proxying enabled: $enable_ipf_transparent]) |
0f658b5b | 2910 | SQUID_DEFINE_BOOL(IPF_TRANSPARENT,$enable_ipf_transparent, |
1d26e252 FC |
2911 | [Enable support for IPF-style transparent proxying]) |
2912 | ||
b2192042 | 2913 | dnl PF /dev/pf support requires a header file. |
a1c22363 AJ |
2914 | AS_IF([test "x$with_nat_devpf" != "xno"],[ |
2915 | AS_IF([test "x$ac_cv_header_net_pfvar_h" = "xyes" -o \ | |
2916 | "x$ac_cv_header_net_pf_pfvar_h" = "xyes"],[ | |
2917 | AS_IF([test "x$with_nat_devpf" = "xauto"],[with_nat_devpf="no"]) | |
2918 | ],[ | |
2919 | AS_IF([test "x$with_nat_devpf" = "xyes"],[ | |
b2192042 | 2920 | AC_MSG_ERROR([PF /dev/pf based NAT requested but needed header not found]) |
a1c22363 | 2921 | ]) |
b2192042 | 2922 | with_nat_devpf="no" |
a1c22363 AJ |
2923 | ]) |
2924 | ]) | |
b2192042 | 2925 | SQUID_DEFINE_BOOL(PF_TRANSPARENT,${enable_pf_transparent:=no}, |
38ff0a40 | 2926 | [Enable support for PF-style transparent proxying]) |
b2192042 AJ |
2927 | SQUID_DEFINE_BOOL(USE_NAT_DEVPF,${with_nat_devpf:=no}, |
2928 | [Enable support for /dev/pf NAT lookups]) | |
2b0dd4ac | 2929 | |
a1c22363 AJ |
2930 | AS_IF([test "x$enable_linux_netfilter" != "xno"],[ |
2931 | AS_IF([test "x$ac_cv_header_linux_netfilter_ipv4_h" = "xyes"],[ | |
2932 | AS_IF([test "x$enable_linux_netfilter" = "xauto"],[enable_linux_netfilter=yes]) | |
2933 | ],[ | |
2934 | AS_IF([test "x$enable_linux_netfilter" = "xauto"],[ | |
4bd144d2 | 2935 | enable_linux_netfilter=no |
a1c22363 | 2936 | ],[ |
4bd144d2 | 2937 | AC_MSG_ERROR([Linux Netfilter support requested but needed headers not found]) |
a1c22363 AJ |
2938 | ]) |
2939 | ]) | |
2940 | ]) | |
0f658b5b | 2941 | SQUID_DEFINE_BOOL(LINUX_NETFILTER,$enable_linux_netfilter, |
969d4051 | 2942 | [Enable support for Transparent Proxy on Linux via Netfilter]) |
20ad76ab | 2943 | |
b50f1b2b | 2944 | dnl Netfilter TPROXY depends on libcap but the NAT parts can still work. |
4bd144d2 | 2945 | AC_MSG_NOTICE([Support for Netfilter-based interception proxy requested: $enable_linux_netfilter]) |
59eac907 | 2946 | AS_IF([test "x$enable_linux_netfilter" = "xyes" -a "x$with_cap" != "xyes"],[ |
a1c22363 AJ |
2947 | AC_MSG_WARN([Missing needed capabilities (libcap 2.09+) for TPROXY]) |
2948 | AC_MSG_WARN([Linux Transparent Proxy (version 4+) support WILL NOT be enabled]) | |
2949 | AC_MSG_WARN([Reduced support to NAT Interception Proxy]) | |
2950 | # AC_DEFINEd later | |
2951 | ]) | |
59eac907 | 2952 | AS_IF([test "x$with_netfilter_conntrack" = "xyes" -a "x$with_cap" != "xyes"],[ |
a1c22363 AJ |
2953 | AC_MSG_WARN([Missing needed capabilities (libcap 2.09+) for netfilter mark support]) |
2954 | AC_MSG_WARN([Linux netfilter marking support WILL NOT be enabled]) | |
2955 | with_netfilter_conntrack=no | |
2956 | ]) | |
24531401 | 2957 | AC_MSG_NOTICE([Linux Netfilter Conntrack support enabled: ${with_netfilter_conntrack}]) |
11e8cfe3 AB |
2958 | |
2959 | ||
2960 | AC_ARG_ENABLE(zph-qos, | |
6c83720b | 2961 | AS_HELP_STRING([--disable-zph-qos],[Disable ZPH QOS support]), [ |
ec308e40 | 2962 | SQUID_YESNO([$enableval],[--enable-zph-qos]) |
11e8cfe3 AB |
2963 | ]) |
2964 | SQUID_DEFINE_BOOL(USE_QOS_TOS,${enable_zph_qos:=yes}, | |
2965 | [Enable Zero Penalty Hit QOS. When set, Squid will alter the | |
2966 | TOS field of HIT responses to help policing network traffic]) | |
2967 | AC_MSG_NOTICE([ZPH QOS enabled: $enable_zph_qos]) | |
037a8ffb | 2968 | AS_IF([test "x$enable_zph_qos" = "xyes"],[ |
a1c22363 AJ |
2969 | AC_MSG_NOTICE([QOS netfilter mark preservation enabled: $with_netfilter_conntrack]) |
2970 | SQUID_DEFINE_BOOL(USE_LIBNETFILTERCONNTRACK,${with_netfilter_conntrack:=no}, | |
2971 | [Enable support for QOS netfilter mark preservation]) | |
2972 | ]) | |
c2afddd8 AJ |
2973 | |
2974 | AC_CHECK_LIB(regex, regexec, [REGEXLIB="-lregex"],[REGEXLIB='']) | |
c2afddd8 AJ |
2975 | AC_SUBST(REGEXLIB) |
2976 | ||
8e0acaf5 FC |
2977 | SQUID_DETECT_UDP_SND_BUFSIZE |
2978 | SQUID_DETECT_UDP_RECV_BUFSIZE | |
2979 | SQUID_DETECT_TCP_SND_BUFSIZE | |
2980 | SQUID_DETECT_TCP_RECV_BUFSIZE | |
6bf65235 | 2981 | |
5c3c56fa FC |
2982 | SQUID_CHECK_NEED_SYS_ERRLIST |
2983 | SQUID_CHECK_MAXPATHLEN | |
cc192b50 | 2984 | |
819656da AJ |
2985 | SQUID_CHECK_LIBRESOLV_DNS_TTL_HACK |
2986 | SQUID_CHECK_RESOLVER_FIELDS | |
2987 | ||
615540cd | 2988 | AC_CHECK_HEADERS(sys/statvfs.h) |
a1c22363 AJ |
2989 | AS_IF([test "x$ac_cv_header_sys_statvfs_h" = "xyes"],[SQUID_CHECK_WORKING_STATVFS]) |
2990 | AS_IF([test "x$ac_cv_func_statvfs" != "xyes"],[ | |
615540cd AJ |
2991 | AC_CHECK_HEADERS(sys/param.h sys/mount.h sys/vfs.h sys/statfs.h) |
2992 | AC_CHECK_FUNCS(statfs) | |
2993 | SQUID_CHECK_F_FRSIZE_IN_STATFS | |
a1c22363 | 2994 | ]) |
c68e9c6b | 2995 | |
4eb85b7a | 2996 | dnl Squid will not usually attempt to translate templates when building |
461b8219 | 2997 | AC_ARG_ENABLE(translation, |
4eb85b7a | 2998 | AS_HELP_STRING([--enable-translation],[Generate the localized error page templates and manuals. |
9603207d | 2999 | Which can also be downloaded from http://www.squid-cache.org/Versions/langpack/.]), [ |
ec308e40 | 3000 | SQUID_YESNO([$enableval],[--enable-translation]) |
461b8219 | 3001 | ]) |
a1c22363 | 3002 | AS_IF([test "x${enable_translation:=no}" = "xyes"],[ |
461b8219 | 3003 | AX_WITH_PROG([PO2HTML],[po2html]) |
02259ff8 | 3004 | AX_WITH_PROG([PO2TEXT],[po2txt]) |
a1c22363 | 3005 | ],[ |
461b8219 | 3006 | PO2HTML="off" |
02259ff8 | 3007 | PO2TEXT="off" |
a1c22363 | 3008 | ]) |
461b8219 | 3009 | AC_SUBST(PO2HTML) |
02259ff8 | 3010 | AC_SUBST(PO2TEXT) |
d146da3b | 3011 | AM_CONDITIONAL(ENABLE_TRANSLATION, test "x${enable_translation:=no}" = "xyes") |
ee1a8ac2 | 3012 | |
43000484 AJ |
3013 | dnl Squid now has limited locale handling ... |
3014 | dnl on error pages | |
3015 | AC_ARG_ENABLE(auto-locale, | |
62979ab1 | 3016 | AS_HELP_STRING([--disable-auto-locale],[This prevents Squid providing localized error pages based on the |
21d5413e | 3017 | clients request headers. |
fb46b778 | 3018 | When disabled Squid requires explicit language configuration.]), [ |
ec308e40 | 3019 | SQUID_YESNO([$enableval],[--enable-auto-locale]) |
8db7a54b | 3020 | ]) |
fb46b778 FC |
3021 | AC_MSG_NOTICE([Multi-Language support enabled: ${enable_auto_locale:=yes}]) |
3022 | SQUID_DEFINE_BOOL(USE_ERR_LOCALES,$enable_auto_locale, | |
3023 | [Use multi-language support on error pages]) | |
3024 | ||
43000484 | 3025 | |
090089c4 | 3026 | dnl Need the debugging version of malloc if available |
3027 | XTRA_OBJS='' | |
a1c22363 AJ |
3028 | AS_IF([test "x$ac_cv_lib_malloc_main" = "xyes"],[ |
3029 | AS_IF([test -r /usr/lib/debug/malloc.o],[XTRA_OBJS="$XTRA_OBJS /usr/lib/debug/malloc.o"]) | |
3030 | AS_IF([test -r /usr/lib/debug/mallocmap.o],[XTRA_OBJS="$XTRA_OBJS /usr/lib/debug/mallocmap.o"]); | |
3031 | ]) | |
090089c4 | 3032 | AC_SUBST(XTRA_OBJS) |
3033 | ||
a1c22363 AJ |
3034 | AS_IF([test "x$XTRA_LIBS" = "x"],[ |
3035 | XTRA_LIBS="$LIBS" | |
3036 | dnl minor cleanup | |
3037 | XTRA_LIBS=`echo $XTRA_LIBS | sed -e "s/ */ /g"` | |
3038 | LIBS='' | |
3039 | ]) | |
090089c4 | 3040 | AC_SUBST(XTRA_LIBS) |
3041 | ||
daed6927 FC |
3042 | AC_SUBST(SQUID_CFLAGS) |
3043 | AC_SUBST(SQUID_CXXFLAGS) | |
3044 | ||
09835feb | 3045 | # Prerequisite: CXXFLAGS have been finalized. |
b2f0a375 | 3046 | AC_ARG_VAR([BUILDCXXFLAGS],[C++ compiler flags for building compile-time tools. e.g. cf_gen]) |
a1c22363 | 3047 | AS_IF([test "x$BUILDCXXFLAGS" = "x"],[ |
b2f0a375 AJ |
3048 | # if we are NOT cross-compiling, use the default build flags for cf_gen and friends |
3049 | # otherwise rely on the user-provided value | |
a1c22363 | 3050 | AS_IF([test "x$squid_cv_check_marchnative" = "xyes"],[ |
b2f0a375 | 3051 | # always valid for the Build compiler. |
b3080eec | 3052 | BUILDCXXFLAGS="-march=native" |
a1c22363 | 3053 | ]) |
b2f0a375 | 3054 | BUILDCXXFLAGS="$BUILDCXXFLAGS $CXXFLAGS" |
a1c22363 | 3055 | ]) |
b2f0a375 AJ |
3056 | AC_SUBST(BUILDCXXFLAGS) |
3057 | ||
90b412dd AJ |
3058 | AC_MSG_NOTICE([BUILD LIBRARIES: $LIBS]) |
3059 | AC_MSG_NOTICE([BUILD EXTRA LIBRARIES: $XTRA_LIBS]) | |
3060 | AC_MSG_NOTICE([BUILD OBJECTS: $OBJS]) | |
3061 | AC_MSG_NOTICE([BUILD EXTRA OBJECTS: $XTRA_OBJS]) | |
3062 | AC_MSG_NOTICE([BUILD C FLAGS: $CFLAGS]) | |
3063 | AC_MSG_NOTICE([BUILD EXTRA C FLAGS: $SQUID_CFLAGS]) | |
3064 | AC_MSG_NOTICE([BUILD C++ FLAGS: $CXXFLAGS]) | |
3065 | AC_MSG_NOTICE([BUILD EXTRA C++ FLAGS: $SQUID_CXXFLAGS]) | |
b2f0a375 | 3066 | AC_MSG_NOTICE([BUILD Tools C++ FLAGS: $BUILDCXXFLAGS]) |
daed6927 | 3067 | |
090089c4 | 3068 | dnl Clean up after OSF/1 core dump bug |
9603207d | 3069 | rm -f core |
090089c4 | 3070 | |
7a03447c AJ |
3071 | AC_CONFIG_FILES([ |
3072 | Makefile | |
3073 | compat/Makefile | |
7a03447c | 3074 | contrib/Makefile |
7a03447c AJ |
3075 | doc/Makefile |
3076 | doc/manuals/Makefile | |
86b8d400 | 3077 | doc/release-notes/Makefile |
6b99776c | 3078 | errors/Makefile |
6b99776c AJ |
3079 | icons/Makefile |
3080 | lib/Makefile | |
3081 | lib/libTrie/Makefile | |
3082 | lib/libTrie/test/Makefile | |
3083 | lib/ntlmauth/Makefile | |
6b99776c AJ |
3084 | lib/rfcnb/Makefile |
3085 | lib/smblib/Makefile | |
3086 | lib/snmplib/Makefile | |
3087 | scripts/Makefile | |
3088 | src/Makefile | |
3089 | src/acl/Makefile | |
e046643f AJ |
3090 | src/acl/external/Makefile |
3091 | src/acl/external/AD_group/Makefile | |
3092 | src/acl/external/delayer/Makefile | |
3093 | src/acl/external/eDirectory_userip/Makefile | |
3094 | src/acl/external/file_userip/Makefile | |
3095 | src/acl/external/kerberos_ldap_group/Makefile | |
4a544c9d | 3096 | src/acl/external/kerberos_sid_group/Makefile |
e046643f AJ |
3097 | src/acl/external/LDAP_group/Makefile |
3098 | src/acl/external/LM_group/Makefile | |
3099 | src/acl/external/session/Makefile | |
3100 | src/acl/external/SQL_session/Makefile | |
3101 | src/acl/external/unix_group/Makefile | |
3102 | src/acl/external/wbinfo_group/Makefile | |
3103 | src/acl/external/time_quota/Makefile | |
6b99776c AJ |
3104 | src/adaptation/Makefile |
3105 | src/adaptation/icap/Makefile | |
3106 | src/adaptation/ecap/Makefile | |
3107 | src/anyp/Makefile | |
3108 | src/auth/Makefile | |
3109 | src/auth/basic/Makefile | |
03901cf8 AJ |
3110 | src/auth/basic/DB/Makefile |
3111 | src/auth/basic/fake/Makefile | |
3112 | src/auth/basic/getpwnam/Makefile | |
3113 | src/auth/basic/LDAP/Makefile | |
3114 | src/auth/basic/NCSA/Makefile | |
3115 | src/auth/basic/NIS/Makefile | |
3116 | src/auth/basic/PAM/Makefile | |
3117 | src/auth/basic/POP3/Makefile | |
3118 | src/auth/basic/RADIUS/Makefile | |
3119 | src/auth/basic/SASL/Makefile | |
3120 | src/auth/basic/SMB/Makefile | |
3121 | src/auth/basic/SMB_LM/Makefile | |
3122 | src/auth/basic/SSPI/Makefile | |
6b99776c | 3123 | src/auth/digest/Makefile |
d4d7f6dd AJ |
3124 | src/auth/digest/eDirectory/Makefile |
3125 | src/auth/digest/file/Makefile | |
3126 | src/auth/digest/LDAP/Makefile | |
6b99776c | 3127 | src/auth/negotiate/Makefile |
16c02b14 AJ |
3128 | src/auth/negotiate/kerberos/Makefile |
3129 | src/auth/negotiate/SSPI/Makefile | |
3130 | src/auth/negotiate/wrapper/Makefile | |
6b99776c | 3131 | src/auth/ntlm/Makefile |
b817c20f AJ |
3132 | src/auth/ntlm/fake/Makefile |
3133 | src/auth/ntlm/SMB_LM/Makefile | |
3134 | src/auth/ntlm/SSPI/Makefile | |
6b99776c AJ |
3135 | src/base/Makefile |
3136 | src/clients/Makefile | |
3137 | src/comm/Makefile | |
675b8408 | 3138 | src/debug/Makefile |
4a3b98d7 | 3139 | src/dns/Makefile |
13d8c08c | 3140 | src/DiskIO/Makefile |
d9691f09 AJ |
3141 | src/DiskIO/AIO/Makefile |
3142 | src/DiskIO/Blocking/Makefile | |
3143 | src/DiskIO/DiskDaemon/Makefile | |
3144 | src/DiskIO/DiskThreads/Makefile | |
3145 | src/DiskIO/IpcIo/Makefile | |
3146 | src/DiskIO/Mmapped/Makefile | |
83b053a0 | 3147 | src/error/Makefile |
6b99776c AJ |
3148 | src/esi/Makefile |
3149 | src/eui/Makefile | |
3150 | src/format/Makefile | |
3151 | src/fs/Makefile | |
3152 | src/ftp/Makefile | |
3153 | src/helper/Makefile | |
3154 | src/http/Makefile | |
3155 | src/http/one/Makefile | |
d6d6203a AJ |
3156 | src/http/url_rewriters/Makefile |
3157 | src/http/url_rewriters/fake/Makefile | |
3158 | src/http/url_rewriters/LFS/Makefile | |
6b99776c AJ |
3159 | src/icmp/Makefile |
3160 | src/ident/Makefile | |
3161 | src/ip/Makefile | |
3162 | src/ipc/Makefile | |
3163 | src/log/Makefile | |
4d5dd85a AJ |
3164 | src/log/DB/Makefile |
3165 | src/log/file/Makefile | |
6b99776c AJ |
3166 | src/mem/Makefile |
3167 | src/mgr/Makefile | |
3168 | src/parser/Makefile | |
36c774f7 | 3169 | src/proxyp/Makefile |
6b99776c | 3170 | src/repl/Makefile |
65e41a45 | 3171 | src/sbuf/Makefile |
7dcca85b | 3172 | src/security/Makefile |
cb0b3d63 AJ |
3173 | src/security/cert_generators/Makefile |
3174 | src/security/cert_generators/file/Makefile | |
bbf79f12 AJ |
3175 | src/security/cert_validators/Makefile |
3176 | src/security/cert_validators/fake/Makefile | |
6b99776c AJ |
3177 | src/servers/Makefile |
3178 | src/snmp/Makefile | |
3179 | src/ssl/Makefile | |
2745fea5 | 3180 | src/store/Makefile |
0c1f8b9b AJ |
3181 | src/store/id_rewriters/Makefile |
3182 | src/store/id_rewriters/file/Makefile | |
98cacedb | 3183 | src/time/Makefile |
6b99776c | 3184 | test-suite/Makefile |
94ab55b0 | 3185 | tools/Makefile |
3d276e1d | 3186 | tools/apparmor/Makefile |
33d1abfe | 3187 | tools/helper-mux/Makefile |
2ccf2eb2 | 3188 | tools/purge/Makefile |
a35a0ac7 | 3189 | tools/squidclient/Makefile |
422cb5da | 3190 | tools/systemd/Makefile |
a35a0ac7 | 3191 | tools/sysvinit/Makefile |
53cbe3e4 | 3192 | ]) |
43ae1d95 | 3193 | |
3e7b6055 | 3194 | # must configure libltdl subdir unconditionally for "make distcheck" to work |
081863f3 | 3195 | #AC_CONFIG_SUBDIRS(libltdl) |
3e7b6055 | 3196 | |
6a9f6389 | 3197 | AC_OUTPUT |