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