-
Notifications
You must be signed in to change notification settings - Fork 528
/
configure.ac
2609 lines (2366 loc) · 90.5 KB
/
configure.ac
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
## Copyright (C) 1996-2023 The Squid Software Foundation and contributors
##
## Squid software is distributed under GPLv2+ license and includes
## contributions from numerous individuals and organizations.
## Please see the COPYING and CONTRIBUTORS files for details.
##
AC_INIT([Squid Web Proxy],[7.0.0-VCS],[https://bugs.squid-cache.org/],[squid])
AC_PREREQ(2.61)
AC_CONFIG_HEADERS([include/autoconf.h])
AC_CONFIG_AUX_DIR(cfgaux)
AC_CONFIG_SRCDIR([src/main.cc])
AM_INIT_AUTOMAKE([tar-ustar nostdinc subdir-objects dist-xz])
AC_REVISION($Revision$)dnl
AC_PREFIX_DEFAULT(/usr/local/squid)
AM_MAINTAINER_MODE
m4_include([acinclude/ax_with_prog.m4])
m4_include([acinclude/init.m4])
m4_include([acinclude/squid-util.m4])
m4_include([acinclude/compiler-flags.m4])
m4_include([acinclude/os-deps.m4])
m4_include([acinclude/krb5.m4])
m4_include([acinclude/ldap.m4])
m4_include([acinclude/pam.m4])
m4_include([acinclude/pkg.m4])
m4_include([acinclude/tdb.m4])
m4_include([acinclude/lib-checks.m4])
m4_include([acinclude/ax_cxx_compile_stdcxx.m4])
m4_include([acinclude/win32-sspi.m4])
PRESET_CFLAGS="$CFLAGS"
PRESET_CXXFLAGS="$CXXFLAGS"
PRESET_LDFLAGS="$LDFLAGS"
dnl Set default LDFLAGS
AS_IF([test "x$LDFLAGS" = "x"],[LDFLAGS="-g"])
# check for host OS detail
AC_CANONICAL_HOST
AC_MSG_CHECKING([simplified host os])
simple_host_os=`echo $host_os|sed 's/[0-9].*//g;s/-.*//g'`
squid_host_os_version=`echo $host_os|tr -d "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-"`
AS_IF([test -n "$squid_host_os_version"],[
squid_host_os="`echo $simple_host_os| sed s/$squid_host_os_version//g`"
],[
squid_host_os="$simple_host_os"
])
AC_MSG_RESULT($squid_host_os (version $squid_host_os_version))
# on windows squid_host_os is either mingw or cygwin, version is 32
AS_IF([test -e /etc/os-release],[
squid_build_os_release_name=`grep '^PRETTY_NAME=' /etc/os-release | sed 's/^[[^"]]*"//;s/".*$//'`
AS_IF([test "x$squid_build_os_release_name" = "x"],[
squid_build_os_release_name=`grep '^NAME=' /etc/os-release | sed 's/^[[^"]]*"//;s/".*$//'`
])
AS_IF([test "x$squid_build_os_release_name" != "x"],[
AC_MSG_NOTICE([Building on $squid_build_os_release_name])
])
])
AC_PROG_CC
AM_PROG_CC_C_O
AC_PROG_CXX
# AC_USE_SYSTEM_EXTENSIONS should be called before any macros that run the C compiler.
AC_USE_SYSTEM_EXTENSIONS
AC_LANG([C++])
# Clang 3.2 on some CPUs requires -march-native to detect correctly.
# GCC 4.3+ can also produce faster executables when its used.
# But building inside a virtual machine environment has been found to
# cause random Illegal Instruction errors due to mis-detection of CPU.
AC_ARG_ENABLE(arch-native,
AS_HELP_STRING([--disable-arch-native],[Some compilers offer CPU-specific
optimizations with the -march=native parameter.
This flag disables the optimization. The default is to
auto-detect compiler support and use where available.]), [
SQUID_YESNO([$enableval],[--enable-arch-native])
])
AC_MSG_NOTICE([CPU arch native optimization enabled: ${enable_arch_native:=auto}])
AS_IF([test "x${enable_arch_native}" != "xno"],[
SQUID_CC_CHECK_ARGUMENT([squid_cv_check_marchnative],[-march=native])
])
# If the user did not specify a C++ version.
user_cxx=`echo "$PRESET_CXXFLAGS" | grep -o -E "(-)std="`
AS_IF([test "x$user_cxx" = "x"],[
# Check for C++17 compiler support
# May change CXX.
AX_CXX_COMPILE_STDCXX([17],[noext],[mandatory])
])
# Prerequisite: CXX has been finalized.
# BUILDCXXFLAGS are defined later, after CXXFLAGS have been finalized.
AC_ARG_VAR([BUILDCXX],[path to compiler for building compile-time tools. e.g. cf_gen])
AS_IF([test "x$HOSTCXX" != "x" -a "x$BUILDCXX" = "x"],[
AC_MSG_WARN([Cross-compiling with HOSTCXX is deprecated. Use BUILDCXX instead.])
BUILDCXX="$HOSTCXX"
])
AS_IF([test "x$BUILDCXX" = "x"],[
BUILDCXX="$CXX"
AS_IF([test "x$squid_cv_check_marchnative" = "xyes"],[
CXXFLAGS="$CXXFLAGS -march=native"
])
])
AC_SUBST(BUILDCXX)
# test for programs
AC_PROG_RANLIB
AC_PROG_CPP
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_EGREP
AC_PATH_PROG(SH, sh, /bin/sh)
AC_PATH_PROG(FALSE, false, /usr/bin/false)
AC_PATH_PROG(TRUE, true, /usr/bin/true)
AC_PATH_PROG(MV, mv, $FALSE)
AC_PATH_PROG(MKDIR, mkdir, $FALSE)
AC_PATH_PROG(LN, ln, cp)
AC_PATH_PROG(CHMOD, chmod, $FALSE)
AC_PATH_PROG(TR, tr, $FALSE)
AC_PATH_PROG(RM, rm, $FALSE)
dnl Libtool 2.2.6 requires: rm -f
RM="$RM -f"
PKG_PROG_PKG_CONFIG
AS_IF([test "x$PKG_CONFIG" = "x"],[
AC_MSG_WARN([pkg-config not found. Many optional features with external dependencies will not be enabled by default, usually without further warnings.])
])
AC_PATH_PROG(PERL, perl, none)
AS_IF([test "x$ac_cv_path_PERL" = "xnone"],[
AC_MSG_FAILURE([Perl is required to compile Squid. Please install Perl and then re-run configure ])
])
AC_PATH_PROG(POD2MAN, pod2man, $FALSE)
AM_CONDITIONAL(ENABLE_POD2MAN_DOC, test "x${ac_cv_path_POD2MAN}" != "x$FALSE")
AC_PATH_PROG(AR, ar, $FALSE)
AR_R="$AR r"
AC_SUBST(AR_R)
AC_PATH_PROG(LINUXDOC, linuxdoc, $FALSE)
AM_CONDITIONAL(ENABLE_RELEASE_DOCS, test "x${ac_cv_path_LINUXDOC}" != "x$FALSE")
SQUID_RELEASE=`echo $VERSION | cut -d. -f1`
AC_SUBST(SQUID_RELEASE)
# pre-define DEFAULT_PREFIX, some modules need it.
AS_IF([test "${prefix}" = "NONE"],[squid_prefix=$ac_default_prefix],[squid_prefix=$prefix])
AC_DEFINE_UNQUOTED(DEFAULT_PREFIX,[$squid_prefix],[The install prefix])
AC_ARG_ENABLE(strict-error-checking,
AS_HELP_STRING([--disable-strict-error-checking],[By default squid is compiled
with all possible static compiler error-checks enabled.
This flag disables the behavior]), [
SQUID_YESNO([$enableval],[--enable-strict-error-checking])
])
AC_MSG_NOTICE([strict error checking enabled: ${enable_strict_error_checking:=yes}])
# LT_INIT requires libtool v2, might as well state it loud
LT_PREREQ([2.2])
LT_INIT([dlopen])
AS_IF([test "x$ac_top_build_prefix" != "x"],[
# LTDL v3-v7 macros assume the autoconf 2.62 variable top_build_prefix is defined
# But from autoconf 2.64 its called ac_top_build_prefix and not automatically added to the Makefile
# This fixes Linux LTDLv3-v7, and BSD LTDL v2.2
top_build_prefix=${ac_top_build_prefix}
AC_SUBST(top_build_prefix)
])
LTDL_INIT
dnl LibTool environment is now prepared for setup. Check that it is usable and initialize.
LT_LIB_DLLOAD
# Do we need these unconditionally for "make distcheck" to work?
AC_SUBST(INCLTDL)
AC_SUBST(LIBLTDL)
AC_MSG_CHECKING(whether to use loadable modules)
AS_IF([test "x${enable_shared:=yes}" = "xyes"],[AC_DEFINE(USE_LOADABLE_MODULES,1,[Support Loadable Modules])])
AM_CONDITIONAL(ENABLE_LOADABLE_MODULES, test "x${enable_shared:=yes}" = "xyes")
AC_MSG_RESULT([$enable_shared])
SQUID_CC_GUESS_VARIANT
SQUID_CC_GUESS_OPTIONS
dnl find out the exe extension for this platform.
dnl If it is not empty, use it for CGI as well.
AC_EXEEXT
AC_OBJEXT
AS_IF([test "x$EXEEXT" = "x"],[CGIEXT=".cgi"],[CGIEXT=""])
AC_SUBST(CGIEXT)
AM_CONDITIONAL(ENABLE_WIN32SPECIFIC,[test "x$squid_host_os" = "xmingw"])
AM_CONDITIONAL(ENABLE_WIN32_IPC,[test "x$squid_host_os" = "xmingw"])
AS_CASE(["$squid_host_os"],
[mingw],[
CFLAGS="$CFLAGS -mthreads"
CXXFLAGS="$CXXFLAGS -mthreads -static-libgcc -static-libstdc++"
dnl Check for Winsock only on MinGW
SQUID_CHECK_WINSOCK_LIB
AC_CHECK_HEADERS([ws2tcpip.h winsock2.h windows.h io.h],,,[
#if HAVE_WS2TCPIP_H
#include <ws2tcpip.h>
#endif
#if HAVE_WINSOCK2_H
#include <winsock2.h>
#endif
#if HAVE_WINDOWS_H
#include <windows.h>
#endif
])
MINGW_LIBS="-lmingwex"
AC_SUBST(MINGW_LIBS)
AC_CHECK_FUNCS([fsync])
],
[freebsd],[
# FreeBSD places local libraries and packages in /usr/local
CFLAGS="$CFLAGS -I/usr/local/include"
CXXFLAGS="$CXXFLAGS -I/usr/local/include"
LDFLAGS="$LDFLAGS -L/usr/local/lib -Wl,-R/usr/local/lib"
]
)
dnl Substitutions
AC_DEFINE_UNQUOTED(CONFIG_HOST_TYPE, "$host",[Host type from configure])
AC_DEFINE_UNQUOTED(SQUID_CONFIGURE_OPTIONS, "$ac_configure_args",
[configure command line used to configure Squid])
CACHE_EFFECTIVE_USER="nobody"
AC_ARG_WITH(default-user,
AS_HELP_STRING([--with-default-user=USER],[System user account for squid permissions. Default: nobody]),
[ CACHE_EFFECTIVE_USER="$withval" ]
)
AC_SUBST(CACHE_EFFECTIVE_USER)
DEFAULT_LOG_DIR="$localstatedir/logs"
AC_ARG_WITH(logdir,
AS_HELP_STRING([--with-logdir=PATH],
[Default location for squid logs. default: PREFIX/var/logs]),[
AS_CASE([$withval],
[yes|no],[AC_MSG_ERROR([--with-logdir requires a directory PATH. --with-logdir=PATH])],
[DEFAULT_LOG_DIR="$withval"]
)
])
AC_SUBST(DEFAULT_LOG_DIR)
DEFAULT_PID_FILE="$localstatedir/run/@[email protected]"
AC_ARG_WITH(pidfile,
AS_HELP_STRING([--with-pidfile=PATH],
[Default location for squid pid file. Default: PREFIX/var/run/squid.pid]),[
AS_CASE([$withval],
[yes|no],[AC_MSG_ERROR([--with-pidfile requires a file PATH. --with-pidfile=PATH])],
[DEFAULT_PID_FILE="$withval"]
)
])
AC_SUBST(DEFAULT_PID_FILE)
DEFAULT_SWAP_DIR="$localstatedir/cache/squid"
AC_ARG_WITH(swapdir,
AS_HELP_STRING([--with-swapdir=PATH],
[Default location for squid cache directories. Default: PREFIX/var/cache/squid]),[
AS_CASE([$withval],
[yes|no],[AC_MSG_ERROR([--with-swapdir requires a directory PATH. --with-swapdir=PATH])],
[DEFAULT_SWAP_DIR="$withval"]
)
])
AC_SUBST(DEFAULT_SWAP_DIR)
dnl Set Default CFLAGS
AS_IF([test "x$PRESET_CFLAGS" = "x"],[
AS_IF([test "$squid_cv_compiler" = "gcc"],[
# TODO check if these exceptions are still necessary
AS_CASE(["$host"],
[*-sun-sunos*],[
# sunos has too many warnings for -Wall to be useful
],
[CFLAGS="$squid_cv_cc_option_wall $CFLAGS"]
)
],[
AS_CASE(["$host"],
[*mips-sgi-irix6.*],[
# suggested by Rafael Seidl <[email protected]>
CFLAGS="$squid_cv_cc_option_optimize -OPT:Olimit=0:space=OFF \
-woff 1009,1014,1110,1116,1183,1185,1188,1204,1230,1233,1355 \
-Wl,-woff,85,-woff,84,-woff,134 \
-nostdinc -I/usr/include -D_BSD_SIGNALS $CFLAGS"
CXXFLAGS="$squid_cv_cc_option_optimize -OPT:Olimit=0:space=OFF \
-woff 1009,1014,1110,1116,1183,1185,1188,1204,1230,1233,1355 \
-Wl,-woff,85,-woff,84,-woff,134 \
-nostdinc -I/usr/include -D_BSD_SIGNALS $CXXFLAGS"
])
])
])
AC_MSG_CHECKING([compiler name-version])
squid_cv_cc_name=`$CC --version | head -1 | cut -f1 -d" "`
AS_CASE([$squid_cv_cc_name],
[gcc|clang],[squid_cv_cc_majversion=`$CC -dumpversion | cut -f1 -d.`],
[squid_cv_cc_majversion="unknown"]
)
squid_cv_cc_simplified="$squid_cv_cc_name-$squid_cv_cc_majversion"
AC_MSG_RESULT($squid_cv_cc_simplified)
# warning flags
# -Wall
SQUID_CC_ADD_CXXFLAG_WARNING_IF_SUPPORTED([$squid_cv_cc_option_wall])
# -Wextra
AS_IF([test "$squid_cv_cc_simplified" = "gcc-4"],[
AC_MSG_NOTICE([skipping -Wextra on $squid_cv_cc_simplified])
],[
SQUID_CC_ADD_CXXFLAG_WARNING_IF_SUPPORTED([-Wextra])
# Now disable or configure certain warnings enabled by -Wextra
# -Wunused-private-field causes a huge number of false positives
# in unit tests. Disable that
SQUID_CC_ADD_CXXFLAG_WARNING_IF_SUPPORTED([-Wno-unused-private-field])
# ...=5: Do not trust comments about fallthrough cases (GCC).
SQUID_CC_ADD_CXXFLAG_WARNING_IF_SUPPORTED([-Wimplicit-fallthrough=5])
AS_IF([test "x$squid_cv_cc_arg_wimplicit_fallthrough_5" != "xyes"], [
SQUID_CC_ADD_CXXFLAG_WARNING_IF_SUPPORTED([-Wno-implicit-fallthrough])
])
])
# useful warnings that may not be included in -Wall -Wextra
SQUID_CC_ADD_CXXFLAG_WARNING_IF_SUPPORTED([-Wpointer-arith])
SQUID_CC_ADD_CXXFLAG_WARNING_IF_SUPPORTED([-Wwrite-strings])
SQUID_CC_ADD_CXXFLAG_WARNING_IF_SUPPORTED([-Wcomments])
SQUID_CC_ADD_CXXFLAG_WARNING_IF_SUPPORTED([-Wshadow])
SQUID_CC_ADD_CXXFLAG_WARNING_IF_SUPPORTED([-Wmissing-declarations])
SQUID_CC_ADD_CXXFLAG_WARNING_IF_SUPPORTED([-Woverloaded-virtual])
dnl CentOS (and RHEL) still define ntohs() using deprecated C++ features
SQUID_CC_REQUIRE_ARGUMENT([ac_cv_require_wno_deprecated_register],[-Werror -Wno-deprecated-register],[[#include <arpa/inet.h>]],[[int fox=ntohs(1);]])
AS_IF([test "x$enable_strict_error_checking" != "xno"],[
SQUID_CFLAGS="$SQUID_CFLAGS $squid_cv_cc_option_werror"
SQUID_CXXFLAGS="$SQUID_CXXFLAGS $squid_cv_cxx_option_werror"
])
AS_IF([test "x$ac_cv_require_wno_deprecated_register" = "xyes"],[
SQUID_CXXFLAGS="$SQUID_CXXFLAGS -Wno-deprecated-register"
])
# squid_cv_cc_arg_pipe is set by SQUID_CC_GUESS_OPTIONS
SQUID_CXXFLAGS="$SQUID_CXXFLAGS $squid_cv_cc_arg_pipe"
SQUID_CFLAGS="$SQUID_CFLAGS $squid_cv_cc_arg_pipe"
# possibly include some build info tag into squid -v
SQUID_EMBED_BUILD_INFO
AC_ARG_ENABLE(optimizations,
AS_HELP_STRING([--disable-optimizations],
[Do not compile Squid with compiler optimizations enabled.
Optimization is good for production builds, but not
good for debugging. During development, use
--disable-optimizations to reduce compilation times
and allow easier debugging.]), [
AS_IF([test "x$enableval" = "xno"],[
AC_MSG_NOTICE([Disabling compiler optimizations (-O flag)])
CFLAGS="`echo $CFLAGS | sed -e 's/-O[[0-9g]]*//'`"
CXXFLAGS="`echo $CXXFLAGS | sed -e 's/-O[[0-9g]]*//'`"
])
])
dnl Nasty hack to get autoconf 2.64 on Linux to run.
dnl all other uses of RUN_IFELSE are wrapped inside CACHE_CHECK which breaks on 2.64
AC_RUN_IFELSE([AC_LANG_SOURCE([[ int main(int argc, char **argv) { return 0; } ]])],[],[],[:])
AH_TEMPLATE(XMALLOC_STATISTICS,[Define to have malloc statistics])
AC_ARG_ENABLE(xmalloc-statistics,
AS_HELP_STRING([--enable-xmalloc-statistics],
[Show malloc statistics in status page]), [
SQUID_YESNO([$enableval],[--enable-xmalloc-statistics])
])
SQUID_DEFINE_BOOL(XMALLOC_STATISTICS,${enable_xmalloc_statistics:=no},
[Show malloc statistics in status page])
AC_MSG_NOTICE([xmalloc stats display: $enable_xmalloc_statistics])
squid_opt_aufs_threads=""
AC_ARG_WITH(aufs-threads,
AS_HELP_STRING([--with-aufs-threads=N_THREADS],
[Tune the number of worker threads for the aufs object store.]), [
AS_CASE([$withval],
[@<:@0-9@:>@*],[squid_opt_aufs_threads=$withval],
AC_MSG_ERROR(--with-aufs-threads expects a numeric argument)
)
])
AS_IF([test "x$squid_opt_aufs_threads" != "x"],[
AC_MSG_NOTICE([With $squid_opt_aufs_threads aufs threads])
AC_DEFINE_UNQUOTED(AUFS_IO_THREADS,$squid_opt_aufs_threads,
[Defines how many threads aufs uses for I/O])
])
AC_DEFUN([LIBATOMIC_CHECKER],[
AC_MSG_CHECKING(whether linking $1 -latomic works)
AC_LINK_IFELSE([
AC_LANG_SOURCE([[
#include <atomic>
#include <cstdint>
int
main(int argc, char **) {
return (
std::atomic<uint8_t>(uint8_t(argc)).exchange(0) &&
std::atomic<uint64_t>{}.is_lock_free()
) ? 0 : 1;
}
]])],[
AC_MSG_RESULT(yes)
libatomic_checker_result="yes"],[
AC_MSG_RESULT(no)
libatomic_checker_result="no"
])])
## check for atomics library before anything that might need it
SQUID_STATE_SAVE(LIBATOMIC)
LIBATOMIC_CHECKER(without)
AS_IF([test "x$libatomic_checker_result" = "xno"],[
LIBS="$LIBS -latomic"
LIBATOMIC_CHECKER(with)
AS_IF([test "x$libatomic_checker_result" = "xyes"],[
ATOMICLIB="-latomic"],[
AC_MSG_ERROR([Required library libatomic not found.])
])])
SQUID_STATE_ROLLBACK(LIBATOMIC)
AC_SUBST(ATOMICLIB)
SQUID_AUTO_LIB(psapi,[Windows PSAPI.dll],[LIBPSAPI])
SQUID_CHECK_LIB_WORKS(psapi,[
CPPFLAGS="$LIBPSAPI_CFLAGS $CPPFLAGS"
LIBS="$LIBPSAPI_PATH $LIBS"
AC_CHECK_LIB([psapi],[K32GetProcessMemoryInfo],[
LIBPSAPI_LIBS="-lpsapi"
AC_CHECK_HEADERS([psapi.h],,,[
#if HAVE_WINDOWS_H
#include <windows.h>
#endif
])
])
])
AC_SEARCH_LIBS([shm_open], [rt])
AS_IF([test "x$ac_cv_search_shm_open" != "xno"],[
AC_DEFINE(HAVE_SHM,1,[Support shared memory features])
])
squid_disk_module_candidates=
AC_ARG_ENABLE(disk-io,
AS_HELP_STRING([--enable-disk-io="list of modules"],
[Build support for the list of disk I/O modules.
Set without a value or omitted, all available modules will be built.
See src/DiskIO for a list of available modules, or
Programmers Guide section on DiskIO
for details on how to build your custom disk module]),
AS_CASE(["$enableval"],
[yes],[],
[no|none],[enable_disk_io="no"],
[
enable_disk_io="yes"
squid_disk_module_candidates="$enableval"
])
)
AS_IF([test "x${enable_disk_io:=yes}" = "xyes"],[
SQUID_LOOK_FOR_MODULES([$srcdir/src/DiskIO],[squid_disk_module_candidates])
AS_IF([test "x$ac_cv_search_shm_open" = "xno"],[
squid_disk_module_candidates=`echo "$squid_disk_module_candidates" | sed 's/IpcIo//g'`
])
])
SQUID_CLEANUP_MODULES_LIST([squid_disk_module_candidates])
SQUID_CHECK_EXISTING_MODULES([$srcdir/src/DiskIO],[squid_disk_module_candidates])
AC_MSG_NOTICE([DiskIO modules built: ${squid_disk_module_candidates:-none}])
SQUID_DEFINE_BOOL(USE_DISKIO,$enable_disk_io,[DiskIO modules are expected to be available.])
dnl Some autoconf.h defines we might enable later...
AC_ARG_WITH(pthreads,AS_HELP_STRING([--without-pthreads],[Disable POSIX Threads]))
AC_ARG_WITH(aio, AS_HELP_STRING([--without-aio],[Do not use POSIX AIO. Default: auto-detect]))
ENABLE_WIN32_AIOPS=0
squid_opt_use_aio=
squid_opt_use_diskthreads=
AIOLIB=
dnl Setup the module paths etc.
DISK_LIBS=
DISK_MODULES=
AH_TEMPLATE(HAVE_DISKIO_MODULE_AIO, [Whether POSIX AIO Disk I/O module is built])
AH_TEMPLATE(HAVE_DISKIO_MODULE_BLOCKING, [Whether Blocking Disk I/O module is built])
AH_TEMPLATE(HAVE_DISKIO_MODULE_DISKDAEMON, [Whether DiskDaemon Disk I/O module is built])
AH_TEMPLATE(HAVE_DISKIO_MODULE_DISKTHREADS, [Whether DiskThreads Disk I/O module is built])
AH_TEMPLATE(HAVE_DISKIO_MODULE_IPCIO, [Whether IpcIo Disk I/O module is built])
AH_TEMPLATE(HAVE_DISKIO_MODULE_MMAPPED, [Whether Mmapped Disk I/O module is built])
for module in $squid_disk_module_candidates none; do
# maybe not needed
AS_IF([test "x$module" = "xnone"],[continue])
AS_IF([! test -d "$srcdir/src/DiskIO/$module"],[AC_MSG_ERROR([disk-io $module does not exist])])
AS_CASE(["$module"],
[AIO],[
dnl Check for POSIX AIO availability
squid_opt_use_aio="yes"
AIOLIB=
AS_IF([test "x$with_aio" != "xno"],[
have_aio_header=no
AC_CHECK_HEADERS(aio.h,[have_aio_header=yes])
dnl On some systems POSIX AIO functions are in librt
dnl On some systems POSIX AIO functions are in libaio
AC_CHECK_LIB(rt,aio_read,[AIOLIB="-lrt"],AC_CHECK_LIB(aio,aio_read,[AIOLIB="-laio"],[]))
dnl Enable AIO if the library and headers are found
AS_IF([test "x$AIOLIB" != "x" -a "x$have_aio_header" = "xyes"],[
AC_MSG_NOTICE([Native POSIX AIO support detected.])
squid_opt_use_aio="yes"
],[
dnl Windows does things differently. We provide wrappers.
dnl TODO: Windows really needs its own DiskIO module or its Overlaped IO
AS_IF([test "$squid_host_os" = "mingw"],[
squid_opt_use_aio="yes"
AC_MSG_NOTICE([Windows being built. Maybe-enable POSIX AIO.])
],[
squid_opt_use_aio="no"
AC_MSG_NOTICE([Native POSIX AIO support not detected. AIO automatically disabled.])
])
])
],[
AC_MSG_NOTICE([POSIX AIO support manually disabled.])
squid_opt_use_aio="no"
])
dnl Use the POSIX AIO pieces if we actually need them.
AS_IF([test "x$squid_opt_use_aio" = "xyes"],[
DISK_MODULES="$DISK_MODULES AIO"
AC_DEFINE([HAVE_DISKIO_MODULE_AIO],1,[POSIX AIO Disk I/O module is built])
AS_IF([test "$squid_host_os" = "mingw"],[
ENABLE_WIN32_AIO=1
AC_MSG_NOTICE([Replacing AIO DiskIO module with: Windows overlapped I/O support])
],[
AC_MSG_NOTICE([Enabling AIO DiskIO module])
])
],[
AC_MSG_NOTICE([AIO DiskIO Module disabled. Missing POSIX AIO support.])
squid_disk_module_candidates_AIO=no
])
],
[Blocking],[
AC_MSG_NOTICE([Enabling Blocking DiskIO module])
DISK_MODULES="$DISK_MODULES Blocking"
AC_DEFINE([HAVE_DISKIO_MODULE_BLOCKING],1,[Blocking Disk I/O module is built])
],
[DiskDaemon],[
AS_IF([test "$squid_host_os" = "mingw"],[
AC_MSG_NOTICE([DiskDaemon not supported on MinGW])
squid_disk_module_candidates_DiskDaemon=no
],[
AC_MSG_NOTICE([Enabling DiskDaemon DiskIO module])
DISK_MODULES="$DISK_MODULES DiskDaemon"
AC_DEFINE([HAVE_DISKIO_MODULE_DISKDAEMON],1,[DiskDaemon Disk I/O module is built])
])
],
[DiskThreads],[
squid_opt_use_diskthreads="yes"
LIBPTHREADS=
SQUID_STATE_SAVE([diskthreads_state],[SQUID_CFLAGS SQUID_CXXFLAGS])
AS_IF([test "x$with_pthreads" != "xno"],[
dnl TODO: this needs to be extended to handle more systems and better
dnl REF: http://www.openldap.org/lists/openldap-bugs/200006/msg00070.html
dnl REF: http://autoconf-archive.cryp.to/acx_pthread.html
AS_CASE(["$squid_host_os"],
[mingw],[
ENABLE_WIN32_AIOPS=1
AC_MSG_NOTICE([Windows threads support automatically enabled])
],
[freebsd],[
AS_IF([test `echo "$squid_host_os_version" | tr -d .` -lt 70],[
AC_MSG_NOTICE(pthread library requires FreeBSD 7 or later)
squid_opt_use_diskthreads="no"
],[
SQUID_CFLAGS="$SQUID_CFLAGS -D_REENTRANT"
SQUID_CXXFLAGS="$SQUID_CXXFLAGS -D_REENTRANT"
AS_IF([test "x$GCC" = "xyes" -a "x$PRESET_LDFLAGS" = "x"],[LDFLAGS="$LDFLAGS -pthread"])
])
],
[openbsd],[
AS_IF([test `echo "$squid_host_os_version" | tr -d .` -lt 52],[
AC_MSG_NOTICE(pthread library requires OpenBSD 5.2 or later)
squid_opt_use_diskthreads="no"
],[
SQUID_CFLAGS="$SQUID_CFLAGS -D_REENTRANT"
SQUID_CXXFLAGS="$SQUID_CXXFLAGS -D_REENTRANT"
LDFLAGS="$LDFLAGS -lpthread"
])
],
[solaris],[
AS_IF([test "x$GCC" = "xyes"],[
SQUID_CFLAGS="$SQUID_CFLAGS -D_REENTRANT -pthreads"
SQUID_CXXFLAGS="$SQUID_CXXFLAGS -D_REENTRANT -pthreads"
AC_CHECK_LIB(pthread, pthread_create ,[LIBPTHREADS="-lpthread"], [
AC_MSG_NOTICE(pthread library required but cannot be found.)
squid_opt_use_diskthreads="no"
])
],[
dnl test for -lpthread first. libc version is a stub apparently on Solaris.
SQUID_CFLAGS="$SQUID_CFLAGS -D_REENTRANT -lpthread"
SQUID_CXXFLAGS="$SQUID_CXXFLAGS -D_REENTRANT -lpthread"
AC_SEARCH_LIBS([pthread_create],[pthread thread],[
LIBPTHREADS="" #in LIBS
],[
AC_MSG_NOTICE(pthread library required but cannot be found.)
squid_opt_use_diskthreads="no"
])
])
],
[
SQUID_CFLAGS="$SQUID_CFLAGS -D_REENTRANT"
SQUID_CXXFLAGS="$SQUID_CXXFLAGS -D_REENTRANT"
AC_CHECK_LIB(pthread, pthread_create ,[LIBPTHREADS="-lpthread"], [
AC_MSG_NOTICE(pthread library required but cannot be found.)
squid_opt_use_diskthreads="no"
])
]
)
],[
AC_MSG_NOTICE([Native pthreads support manually disabled.])
squid_opt_use_diskthreads="no"
])
AS_IF([test "x$squid_opt_use_diskthreads" = "xyes"],[
AC_MSG_NOTICE([Enabling DiskThreads DiskIO module])
DISK_MODULES="$DISK_MODULES DiskThreads"
AC_DEFINE([HAVE_DISKIO_MODULE_DISKTHREADS],1,[DiskThreads Disk I/O module is built])
],[
AC_MSG_NOTICE([Native pthreads support disabled. DiskThreads module automaticaly disabled.])
SQUID_STATE_ROLLBACK([diskthreads_state])
squid_disk_module_candidates_DiskThreads=no
])
],
[IpcIo],[
AS_IF([test "x$ac_cv_search_shm_open" = "xno"],[
AC_MSG_NOTICE([DiskIO IpcIo module requires shared memory support])
squid_disk_module_candidates_IpcIo=no
],[
AC_MSG_NOTICE([Enabling IpcIo DiskIO module])
DISK_MODULES="$DISK_MODULES IpcIo"
AC_DEFINE([HAVE_DISKIO_MODULE_IPCIO],1,[IpcIo Disk I/O module is built])
])
],
[Mmapped],[
dnl TODO: use availability of sys/mman.h and/or mmap to define
dnl OR support windows mmap functions
AS_IF([test "x$squid_host_os" = "xmingw"],[
AC_MSG_NOTICE([Mmapped DiskIO is not available on Mingw])
squid_disk_module_candidates_Mmapped=no
],[
AC_MSG_NOTICE([Enabling Mmapped DiskIO module])
DISK_MODULES="$DISK_MODULES Mmapped"
AC_DEFINE([HAVE_DISKIO_MODULE_MMAPPED],1,[Mmapped Disk I/O module is built])
])
],
[
AC_MSG_NOTICE([Enabling $module DiskIO module])
DISK_LIBS="$DISK_LIBS lib${module}.la"
DISK_MODULES="$DISK_MODULES ${module}"
])
done
AC_MSG_NOTICE([IO Modules built: $DISK_MODULES])
AC_SUBST(DISK_MODULES)
AC_SUBST(DISK_LIBS)
AM_CONDITIONAL(ENABLE_DISKIO_AIO, test "x$squid_disk_module_candidates_AIO" = "xyes")
AC_SUBST(AIOLIB)
AM_CONDITIONAL(ENABLE_WIN32_AIO, test "x$squid_disk_module_candidates_AIO" = "xyes" -a "x$ENABLE_WIN32_AIO" = "x1")
AM_CONDITIONAL(ENABLE_DISKIO_BLOCKING, test "x$squid_disk_module_candidates_Blocking" = "xyes")
AM_CONDITIONAL(ENABLE_DISKIO_DISKDAEMON, test "x$squid_disk_module_candidates_DiskDaemon" = "xyes")
AM_CONDITIONAL(ENABLE_DISKIO_DISKTHREADS, test "x$squid_disk_module_candidates_DiskThreads" = "xyes")
AC_SUBST(LIBPTHREADS)
AM_CONDITIONAL(ENABLE_WIN32_AIOPS, test "x$squid_disk_module_candidates_DiskThreads" = "xyes" -a "x$ENABLE_WIN32_AIOPS" = "x1")
AM_CONDITIONAL(ENABLE_DISKIO_IPCIO, test "x$squid_disk_module_candidates_IpcIo" = "xyes")
AM_CONDITIONAL(ENABLE_DISKIO_MMAPPED, test "x$squid_disk_module_candidates_Mmapped" = "xyes")
dnl Check what Storage formats are wanted.
dnl This version will error out with a message saying why if a required DiskIO is missing.
AC_ARG_ENABLE([storeio],
AS_HELP_STRING([--enable-storeio="list of modules"],
[Build support for the list of store I/O modules.
The default is only to build the "ufs" module.
See src/fs for a list of available modules, or
Programmers Guide section <not yet written>
for details on how to build your custom store module]), [
AS_CASE(["$enableval"],
[yes],[],
[no|none],[enable_storeio="no"],
[
enable_storeio="yes"
# ufs is really always needed as it has low-level routines
# if it is a dupe it will be cleaned-up later
squid_storeio_module_candidates="$enableval ufs"
])
])
AS_IF([test "x${enable_storeio:=yes}" = "xyes"],[
SQUID_LOOK_FOR_MODULES([$srcdir/src/fs],[squid_storeio_module_candidates])
])
SQUID_CLEANUP_MODULES_LIST([squid_storeio_module_candidates])
SQUID_CHECK_EXISTING_MODULES([$srcdir/src/fs],[squid_storeio_module_candidates])
AC_MSG_NOTICE([Store modules built: ${squid_storeio_module_candidates:-none}])
for fs in ${squid_storeio_module_candidates:-none}; do
AS_CASE([$fs],
[diskd],[
AS_IF([test "x$squid_disk_module_candidates_Blocking" != "xyes" -a \
"x$squid_disk_module_candidates_DiskDaemon" != "xyes"],[
AC_MSG_ERROR([Storage diskd module requires DiskIO module: Blocking or DiskDaemon])
])
],
[aufs],[
AS_IF([test "x$squid_disk_module_candidates_Blocking" != "xyes" -a \
"x$squid_disk_module_candidates_DiskThreads" != "xyes"],[
AC_MSG_ERROR([Storage module aufs requires DiskIO module: Blocking or DiskThreads])
])
],
[rock],[
AS_IF([test "x$squid_disk_module_candidates_IpcIo" != "xyes" -a \
"x$squid_disk_module_candidates_Blocking" != "xyes"],[
AC_MSG_ERROR([Storage module Rock requires DiskIO module: Blocking or IpcIo])
])
squid_do_build_rock=true
],
[ufs],[
AS_IF([test "x$squid_disk_module_candidates_Blocking" != "xyes"],[
AC_MSG_ERROR([Storage module ufs requires DiskIO module: Blocking])
])
squid_do_build_ufs=true
]
)
done
AM_CONDITIONAL(ENABLE_FS_UFS, test "x$squid_do_build_ufs" = "xtrue")
AM_CONDITIONAL(ENABLE_FS_ROCK, test "x$squid_do_build_rock" = "xtrue")
dnl hack: need to define those even if not used in the build system to
dnl make sure that global FS objects are linked to the squid binary.
AH_TEMPLATE(HAVE_FS_UFS, "Define to 1 if ufs filesystem module is build")
AH_TEMPLATE(HAVE_FS_AUFS, "Define to 1 if aufs filesystem module is build")
AH_TEMPLATE(HAVE_FS_DISKD, "Define to 1 if diskd filesystem module is build")
AH_TEMPLATE(HAVE_FS_ROCK, "Define to 1 if rock filesystem module is build")
dnl got final squid_storeio_module_candidates, build library lists
dnl This list will not be needed when each fs library has its own Makefile
STORE_LIBS_TO_BUILD=
dnl File system libraries to link executables with.
dnl These are the same as STORE_LIBS_TO_BUILD, but with a path
STORE_LIBS_TO_ADD=
for fs in $squid_storeio_module_candidates; do
STORE_LIBS_TO_BUILD="$STORE_LIBS_TO_BUILD lib${fs}.la"
STORE_LIBS_TO_ADD="$STORE_LIBS_TO_ADD fs/lib${fs}.la"
SQUID_TOUPPER_VAR_CONTENTS([fs])
AC_DEFINE_UNQUOTED(HAVE_FS_${fs}, 1)
done
AC_SUBST(STORE_LIBS_TO_BUILD)
AC_SUBST(STORE_LIBS_TO_ADD)
AC_SUBST(STORE_TESTS)
dnl At lest one removal policy is always needed.
dnl 'lru' removal policy is currently hard-coded by name for tests
dnl so we must set it as default.
REPL_POLICIES="lru"
AC_ARG_ENABLE(removal-policies,
AS_HELP_STRING([--enable-removal-policies="list of policies"],
[Build support for the list of removal policies.
The default is only to build the "lru" module.
See src/repl for a list of available modules, or
Programmers Guide section 9.9 for details on how
to build your custom policy]), [
AS_CASE(["$enableval"],
[yes],[ SQUID_LOOK_FOR_MODULES([$srcdir/src/repl],[REPL_POLICIES]) ],
[no],[],
[ REPL_POLICIES="$enableval" ]
)
])
SQUID_CLEANUP_MODULES_LIST([REPL_POLICIES])
SQUID_CHECK_EXISTING_MODULES([$srcdir/src/repl],[REPL_POLICIES])
AC_MSG_NOTICE([Removal policies to build: $REPL_POLICIES])
REPL_OBJS="repl/lib`echo \"$REPL_POLICIES\" | sed -e 's% %.a repl/lib%g'`.a"
REPL_LIBS=`echo "$REPL_OBJS" | sed -e 's%repl/%%g'`
AC_SUBST(REPL_POLICIES)
AC_SUBST(REPL_OBJS)
AC_SUBST(REPL_LIBS)
AM_CONDITIONAL(ENABLE_PINGER, false)
AC_ARG_ENABLE(icmp,
AS_HELP_STRING([--enable-icmp],[Enable ICMP pinging and Network Measurement]),[
AS_IF([test "x$enableval" = "xyes"],[
AC_MSG_NOTICE([ICMP enabled])
AC_DEFINE(USE_ICMP,1,[Define to use Squid ICMP and Network Measurement features (highly recommended!)])
AM_CONDITIONAL(ENABLE_PINGER, true)
])
])
AM_CONDITIONAL(ENABLE_DELAY_POOLS, false)
AC_ARG_ENABLE(delay-pools,
AS_HELP_STRING([--enable-delay-pools],[Enable delay pools to limit bandwidth usage]),[
AS_IF([test "x$enableval" = "xyes"],[
AC_MSG_NOTICE([Delay pools enabled])
AC_DEFINE([USE_DELAY_POOLS],1,[Traffic management via "delay pools".])
AM_CONDITIONAL(ENABLE_DELAY_POOLS, true)
])
])
dnl disable generic/common adaptation support by default
squid_opt_use_adaptation=no
AC_ARG_ENABLE(icap-client,
AS_HELP_STRING([--disable-icap-client],[Disable the ICAP client.]),[
SQUID_YESNO([$enableval],[--enable-icap-client])
])
SQUID_DEFINE_BOOL(ICAP_CLIENT,${enable_icap_client:=yes}, [Enable ICAP client features in Squid])
AS_IF(test "x$enable_icap_client" != "xno", squid_opt_use_adaptation="yes")
AM_CONDITIONAL(ENABLE_ICAP_CLIENT, test "x$enable_icap_client" != "xno")
AC_ARG_ENABLE(ecap,
AS_HELP_STRING([--enable-ecap],[support loadable content adaptation modules]),[
SQUID_YESNO([$enableval],[--enable-ecap])],[
enable_ecap="no"
])
dnl Perform configuration consistency checks for eCAP
AS_IF([test "x$enable_ecap" != "xno"],[
AS_IF([test "x$enable_shared" != "xyes"],[
AC_MSG_ERROR([eCAP support requires loadable modules. Please do not use --disable-shared with --enable-ecap.])
])
AS_IF([test -n "$PKG_CONFIG"],[
dnl eCAP support requires libecap.
dnl This Squid supports libecap v1.0.x.
dnl Use EXT_ prefix to distinguish external libecap (that we check for
dnl here) from our own convenience ecap library in Makefiles.
PKG_CHECK_MODULES([EXT_LIBECAP],[libecap >= 1.0 libecap < 1.1])
],[
AC_MSG_NOTICE([eCAP support requires pkg-config to verify the correct library version. Trouble may follow.])
])
SQUID_STATE_SAVE(squid_ecap_state)
CPPFLAGS="$EXT_LIBECAP_CFLAGS $CPPFLAGS"
LIBS="$EXT_LIBECAP_LIBS $LIBS"
AC_CHECK_HEADERS([ \
libecap/adapter/service.h \
libecap/adapter/xaction.h \
libecap/common/area.h \
libecap/common/body.h \
libecap/common/delay.h \
libecap/common/forward.h \
libecap/common/header.h \
libecap/common/memory.h \
libecap/common/message.h \
libecap/common/name.h \
libecap/common/named_values.h \
libecap/common/names.h \
libecap/common/options.h \
libecap/common/registry.h \
libecap/common/version.h \
libecap/host/host.h \
libecap/host/xaction.h \
],,,[
/* libecap-1.0.1 headers do not build without autoconf.h magic */
#define HAVE_CONFIG_H
/* libecap/common/delay.h fails to include <string> */
#include <string>
])
AC_MSG_CHECKING([whether -lecap will link])
AC_LINK_IFELSE([AC_LANG_PROGRAM([[
#if HAVE_LIBECAP_COMMON_NAMES_H
#include <libecap/common/names.h>
#endif
]],[[
const libecap::Name test("test", libecap::Name::NextId());
]])
],[
AC_MSG_RESULT(yes)
squid_opt_use_adaptation=yes
],[
AC_MSG_RESULT(no)
AS_IF([test "x$enable_ecap" = "xyes"],[
AC_MSG_ERROR([eCAP library will not link.
You may need to rebuild libecap using the same version of GCC as Squid.
There have been breaking ABI changes in the libstdc++ STL with GCC 5.])
],[
AC_MSG_NOTICE([eCAP library will not link.
You may need to rebuild libecap using the same version of GCC as Squid.
There have been breaking ABI changes in the libstdc++ STL with GCC 5.])
enable_ecap="no"
])
])
SQUID_STATE_ROLLBACK(squid_ecap_state)
])
SQUID_DEFINE_BOOL(USE_ECAP,${enable_ecap:=no},[Whether to use eCAP support])
AM_CONDITIONAL(ENABLE_ECAP, test "x$enable_ecap" = "xyes")
dnl enable adaptation if requested by specific adaptation mechanisms
ADAPTATION_LIBS=""
AS_IF([test "x$squid_opt_use_adaptation" = "xyes"],[ADAPTATION_LIBS="adaptation/libadaptation.la"])
SQUID_DEFINE_BOOL(USE_ADAPTATION,${squid_opt_use_adaptation:=no}, [common adaptation support])
AM_CONDITIONAL(ENABLE_ADAPTATION, test "x$squid_opt_use_adaptation" = "xyes")
AC_SUBST(ADAPTATION_LIBS)
AS_IF([test "x$squid_host_os" = "xmingw"],[enable_wccp=no])
AC_ARG_ENABLE(wccp,
AS_HELP_STRING([--disable-wccp],[Disable Web Cache Coordination Protocol]),[
SQUID_YESNO([$enableval],[--enable-wccp])
])
SQUID_DEFINE_BOOL(USE_WCCP, ${enable_wccp:=yes}, [Define to enable WCCP])
AC_MSG_NOTICE([Web Cache Coordination Protocol enabled: $enable_wccp])
AS_IF([test "x$squid_host_os" = "xmingw"],[enable_wccpv2=no])
AC_ARG_ENABLE(wccpv2,
AS_HELP_STRING([--disable-wccpv2],
[Disable Web Cache Coordination V2 Protocol]), [
SQUID_YESNO([$enableval],[--enable-wccpv2])
])
SQUID_DEFINE_BOOL(USE_WCCPv2,${enable_wccpv2:=yes},
[Define to enable WCCP V2])
AC_MSG_NOTICE([Web Cache Coordination V2 Protocol enabled: $enable_wccpv2])
AC_ARG_ENABLE(snmp,
AS_HELP_STRING([--disable-snmp],[Disable SNMP monitoring support]), [
SQUID_YESNO([$enableval],[--enable-snmp])
])
SQUID_DEFINE_BOOL(SQUID_SNMP,${enable_snmp:=yes},
[Define to enable SNMP monitoring of Squid])
AM_CONDITIONAL(ENABLE_SNMP, [test "x$enable_snmp" = "xyes"])
AS_IF([test "x$enable_snmp" = "xyes"],[SNMPLIB="../lib/snmplib/libsnmplib.la"])
AC_MSG_NOTICE([SNMP support enabled: $enable_snmp])
AC_SUBST(SNMPLIB)
AC_ARG_ENABLE(eui,
AS_HELP_STRING([--disable-eui],
[Disable use of ARP / MAC/ EUI (ether address)]), [
SQUID_YESNO([$enableval],[--enable-eui])
])
AS_IF([test "x${enable_eui:=yes}" = "xyes"],[
SQUID_STATE_SAVE(LIBEUI)
# GLIBC 2.30 deprecates sysctl.h. Test with the same flags that (may) break includes later.
CFLAGS=$SQUID_CFLAGS
CXXFLAGS=$SQUID_CXXFLAGS
AS_CASE(["$squid_host_os"],
[linux|solaris|freebsd|openbsd|netbsd|cygwin],[:],
[mingw],[EUILIB="-liphlpapi"],
[AC_MSG_WARN([EUI support probably will not work on host $host.])]
)
# iphlpapi.h check delayed after winsock2.h
AC_CHECK_HEADERS( \
windows.h \
sys/sockio.h \
sys/param.h,
[], [], [[
#if HAVE_WINDOWS_H
include <windows.h>
#endif
]]
)
AC_CHECK_HEADERS( \
net/if_arp.h \
net/route.h,
[], [], [[
#include <sys/types.h>
#include <sys/socket.h>
]])
# OpenBSD, FreeBSD and NetBSD requires sys/param.h to be included before sysctl.h and net/if_dl.h
AC_CHECK_HEADERS( \
net/if_dl.h \
sys/sysctl.h,
[], [], [[
#if HAVE_SYS_PARAM_H
#include <sys/param.h>
#endif
]])
SQUID_STATE_ROLLBACK(LIBEUI)
])
AC_SUBST(EUILIB)
AC_MSG_NOTICE([EUI (MAC address) controls enabled: $enable_eui])
SQUID_DEFINE_BOOL(USE_SQUID_EUI,$enable_eui,
[Define this to include code which lets you use ethernet addresses. This code uses API initially defined in 4.4-BSD.])
AM_CONDITIONAL(ENABLE_EUI, [test "x$enable_eui" = "xyes" ])
AC_ARG_ENABLE(htcp,