forked from squid-cache/squid
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.ac
3879 lines (3558 loc) · 132 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-2019 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],[5.0.0-VCS],[http://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/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_11.m4])
m4_include([acinclude/ax_cxx_0x_types.m4])
PRESET_CFLAGS="$CFLAGS"
PRESET_CXXFLAGS="$CXXFLAGS"
PRESET_LDFLAGS="$LDFLAGS"
dnl Set default LDFLAGS
if test "x$LDFLAGS" = "x" ; then
LDFLAGS="-g"
fi
# Check for GNU cc
AC_PROG_CC
AM_PROG_CC_C_O
AC_PROG_CXX
AC_LANG([C++])
AC_CANONICAL_HOST
# 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],
[Unrecognized argument to --disable-arch-native: $enableval])
])
AC_MSG_NOTICE([CPU arch native optimization enabled: ${enable_arch_native:=auto}])
if test "x${enable_arch_native}" != "xno"; then
SQUID_CC_CHECK_ARGUMENT([squid_cv_check_marchnative],[-march=native])
fi
# might be cross-compiling.
# NP: BUILDCXXFLAGS defined at the end of configure after CXXFLAGS fully known.
AC_ARG_VAR([BUILDCXX],[path to compiler for building compile-time tools. e.g. cf_gen])
if test "x$HOSTCXX" != "x" -a "x$BUILDCXX" = "x"; then
AC_MSG_WARN([Cross-compiling with HOSTCXX is deprecated. Uses BUILDCXX instead.])
BUILDCXX="$HOSTCXX"
fi
if test "x$BUILDCXX" = "x"; then
BUILDCXX="$CXX"
if test "x$squid_cv_check_marchnative" = "xyes"; then
CXXFLAGS="$CXXFLAGS -march=native"
fi
fi
AC_SUBST(BUILDCXX)
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-"`
if test -n "$squid_host_os_version"; then
squid_host_os="`echo $simple_host_os| sed s/$squid_host_os_version//g`"
else
squid_host_os="$simple_host_os"
fi
AC_MSG_RESULT($squid_host_os (version $squid_host_os_version))
# on windows squid_host_os is either mingw or cygwin, version is 32
# this needs to be before any test is run, to have more standard
# functions available on some Unix sysems (e.g. Solaris)
if test "x$squid_host_os" = "solaris" -a "x$GCC" != "x" ; then
AC_USE_SYSTEM_EXTENSIONS
fi
# If the user did not specify a C++ version.
user_cxx=`echo "$PRESET_CXXFLAGS" | grep -o -E "\-std="`
if test "x$user_cxx" = "x"; then
# Check for C++11 compiler support
AX_CXX_COMPILE_STDCXX_11([noext],[mandatory])
fi
# 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
AC_PATH_PROG(PERL, perl, none)
if test "x$ac_cv_path_PERL" = "xnone"; then
AC_MSG_FAILURE([Perl is required to compile Squid. Please install Perl and then re-run configure ])
fi
AC_PATH_PROG(POD2MAN, pod2man, $FALSE)
AM_CONDITIONAL(ENABLE_POD2MAN_DOC, test "x${ac_cv_path_POD2MAN}" != "x$FALSE")
dnl set $(AR) if not provided by the build environment
if test "x$AR" = "x"; then
AC_PATH_PROG(AR, ar, $FALSE)
fi
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")
# pre-define DEFAULT_PREFIX, some modules need it.
if test "${prefix}" = "NONE" ; then
squid_prefix=$ac_default_prefix
else
squid_prefix=$prefix
fi
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],
[Unrecognized argument to --disable-strict-error-checking: $enableval])
])
AC_MSG_NOTICE([strict error checking enabled: ${enable_strict_error_checking:=yes}])
AC_MSG_CHECKING(whether to use loadable modules)
AC_ARG_ENABLE(loadable-modules,
AS_HELP_STRING([--disable-loadable-modules],[do not support loadable modules]) , [
SQUID_YESNO([$enableval],
[Unrecognized argument to --disable-loadable-modules: $enableval])
])
AM_CONDITIONAL(ENABLE_LOADABLE_MODULES, test "x${enable_loadable_modules:=yes}" = "xyes")
AC_MSG_RESULT([$enable_loadable_modules])
if test "x$enable_loadable_modules" = "xyes";
then
AC_DEFINE(USE_LOADABLE_MODULES, 1, [Support Loadable Modules])
AC_ENABLE_SHARED
else
AC_DISABLE_SHARED
fi
# LT_INIT requires libtool v2, might as well state it loud
LT_PREREQ([2.2])
LT_INIT([dlopen],[disable-shared])
if ! test "${ac_top_build_prefix}" = "";
then
# 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)
fi
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)
if test "x$enable_loadable_modules" = "xyes";
then
# Why is this needed? Should not LT_INIT (or LT_LIB_DLLOAD) from libtool do that?
LIBADD_DL=${lt_cv_dlopen_libs}
AC_SUBST([LIBADD_DL])
fi
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
if test "x$EXEEXT" = "x" ; then
CGIEXT=".cgi"
else
# automake automatically adds .exe when installing binaries
CGIEXT=""
fi
AC_SUBST(CGIEXT)
AM_CONDITIONAL(ENABLE_WIN32SPECIFIC,[test "x$squid_host_os" = "xmingw"])
AM_CONDITIONAL(ENABLE_WIN32_IPC,[test "x$squid_host_os" = "xmingw"])
case "$squid_host_os" in
mingw)
AC_PATH_PROG(WIN32_PSAPI, psapi.dll, none)
CFLAGS="$CFLAGS -mthreads"
CXXFLAGS="$CXXFLAGS -mthreads -static-libgcc -static-libstdc++"
if test "x$ac_cv_path_WIN32_PSAPI" = "xnone"; then
AC_MSG_NOTICE([PSAPI.DLL is recommended to run Squid on Windows NT Platform])
AC_MSG_NOTICE([Please see PSAPI.DLL section on doc/win32-relnotes.html.])
else
AC_DEFINE(HAVE_WIN32_PSAPI,1,[Define if you have PSAPI.DLL on Windows systems])
LIBS="$LIBS -lpsapi"
fi
MINGW_LIBS="-lmingwex"
AC_SUBST(MINGW_LIBS)
;;
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"
;;
*)
;;
esac
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]), [
case $withval in
yes|no)
AC_MSG_ERROR( --with-logdir requires a directory PATH. --with-logdir=PATH )
;;
*)
DEFAULT_LOG_DIR="$withval"
;;
esac
]
)
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]), [
case $withval in
yes|no)
AC_MSG_ERROR( --with-pidfile requires a file PATH. --with-pidfile=PATH )
;;
*)
DEFAULT_PID_FILE="$withval"
;;
esac
])
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]), [
case $withval in
yes|no)
AC_MSG_ERROR( --with-swapdir requires a directory PATH. --with-swapdir=PATH )
;;
*)
DEFAULT_SWAP_DIR="$withval"
;;
esac
])
AC_SUBST(DEFAULT_SWAP_DIR)
dnl Set Default CFLAGS
if test "x$PRESET_CFLAGS" = "x"; then
if test "$squid_cv_compiler" = "gcc"; then
case "$host" in
*-sun-sunos*)
# sunos has too many warnings for this to be useful
# motorola too
;;
*m88k*)
# Motorola cc/ld does not like -02 but is ok on -O
CFLAGS=`echo $CFLAGS | sed -e 's/-O[0-9]/-O/'`
;;
*)
CFLAGS="$squid_cv_cc_option_wall $CFLAGS"
;;
esac
else
case "$host" in
*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"
;;
*)
;;
esac
fi
fi
dnl set squid required flags
if test "$squid_cv_compiler" = "gcc"; then
case "$squid_host_os" in
mingw)
dnl Guido Serassio ([email protected]) 20070811
dnl Using the latest MinGW (gcc 3.4.5 + mingw-runtime 3.13) cannot build with
dnl -Werror -Wmissing-prototypes -Wmissing-declarations
dnl TODO: check if the problem will be present in any other newer MinGW release.
SQUID_CFLAGS="$squid_cv_cc_option_wall -Wpointer-arith -Wwrite-strings -Wcomments -Wshadow"
;;
*)
SQUID_CFLAGS="$squid_cv_cc_option_wall -Wpointer-arith -Wwrite-strings -Wmissing-prototypes -Wmissing-declarations -Wcomments -Wshadow"
;;
esac
SQUID_CXXFLAGS="$squid_cv_cc_option_wall -Wpointer-arith -Wwrite-strings -Wcomments -Wshadow -Woverloaded-virtual"
else
SQUID_CFLAGS=
SQUID_CXXFLAGS=
fi
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);]])
if test "x$enable_strict_error_checking" != "xno"; then
SQUID_CFLAGS="$SQUID_CFLAGS $squid_cv_cc_option_werror"
SQUID_CXXFLAGS="$SQUID_CXXFLAGS $squid_cv_cxx_option_werror"
fi
if test "x$ac_cv_require_wno_deprecated_register" = "xyes"; then
SQUID_CXXFLAGS="$SQUID_CXXFLAGS -Wno-deprecated-register"
fi
# 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.]), [
if test "x$enableval" = "xno" ; then
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]]*//'`"
fi
])
AC_ARG_ENABLE(debug-cbdata,
AS_HELP_STRING([--enable-debug-cbdata],
[Provide some debug information in cbdata]), [
SQUID_YESNO([$enableval],
[unrecognized argument to --enable-debug-cbdata: $enableval])
])
SQUID_DEFINE_BOOL(USE_CBDATA_DEBUG,${enable_debug_cbdata:=no},
[Enable support for cbdata debug information])
AC_MSG_NOTICE([cbdata debugging enabled: $enable_debug_cbdata])
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],
[unrecognized argument to --enable-xmalloc-statistics: $enableval])
])
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.]), [
case $withval in
[[0-9]]*)
squid_opt_aufs_threads=$withval
;;
*)
AC_MSG_ERROR(--with-aufs-threads expects a numeric argument)
;;
esac
])
if test "x$squid_opt_aufs_threads" != "x"; then
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])
fi
AC_ARG_WITH(dl, AS_HELP_STRING([--with-dl],[Use dynamic linking]))
if test "x$with_dl" = "xyes"; then
AC_MSG_NOTICE([With dl])
fi
## check for atomics library before anything that might need it
# AC_SEARCH_LIBS pollutes LIBS
SQUID_STATE_SAVE(LIBATOMIC)
AC_SEARCH_LIBS([__atomic_load_8],[atomic],[
test "$ac_res" = "none required" || ATOMICLIB=$ac_res],[])
SQUID_STATE_ROLLBACK(LIBATOMIC)
AC_SUBST(ATOMICLIB)
AC_SEARCH_LIBS([shm_open], [rt])
if test "x$ac_cv_search_shm_open" != "xno" ; then
AC_DEFINE(HAVE_SHM,1,[Support shared memory features])
fi
AC_MSG_CHECKING([for DiskIO modules to be enabled])
squid_disk_module_candidates=""
squid_opt_enable_diskio="auto" #values: no, yes, "auto"(=yes+detect modules)
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]), [
case $enableval in
yes)
${TRUE}
#do nothing, "auto" is ok
;;
no)
squid_opt_enable_diskio="no"
;;
*)
squid_opt_enable_diskio="yes"
squid_disk_module_candidates=" `echo $enableval| sed -e 's/,/ /g;s/ */ /g'` "
SQUID_CLEANUP_MODULES_LIST([squid_disk_module_candidates])
;;
esac
])
# if requested to autodetect, find out what we have
if test "x$squid_opt_enable_diskio" = "xauto"; then
squid_opt_enable_diskio="yes"
SQUID_LOOK_FOR_MODULES([$srcdir/src/DiskIO],[squid_disk_module_candidates])
if test "x$ac_cv_search_shm_open" = "xno" ; then
# disable IpcIo
squid_disk_module_candidates=`echo $squid_disk_module_candidates|sed 's/IpcIo//'`
fi
fi
AC_MSG_RESULT([${squid_disk_module_candidates:-none}])
SQUID_CHECK_EXISTING_MODULES([$srcdir/src/DiskIO],[squid_disk_module_candidates])
SQUID_DEFINE_BOOL(USE_DISKIO,$squid_opt_enable_diskio,
[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
if test "x$module" = "xnone"; then
continue
fi
if ! test -d "$srcdir/src/DiskIO/$module"; then
AC_MSG_ERROR(disk-io $module does not exist)
fi
case "$module" in
AIO)
dnl Check for POSIX AIO availability
squid_opt_use_aio="yes"
AIOLIB=
if test "x$with_aio" != "xno"; then
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
if test "x$AIOLIB" != "x" && test "x$have_aio_header" = "xyes"; then
AC_MSG_NOTICE([Native POSIX AIO support detected.])
squid_opt_use_aio="yes"
else
dnl Windows does things differently. We provide wrappers.
dnl TODO: Windows really needs its own DiskIO module or its Overlaped IO
case "$squid_host_os" in
mingw)
squid_opt_use_aio="yes"
AC_MSG_NOTICE([Windows being built. Maybe-enable POSIX AIO.])
;;
*)
AC_MSG_NOTICE([Native POSIX AIO support not detected. AIO automatically disabled.])
squid_opt_use_aio="no"
;;
esac
fi
else
AC_MSG_NOTICE([POSIX AIO support manually disabled.])
squid_opt_use_aio="no"
fi
dnl Use the POSIX AIO pieces if we actually need them.
if test "x$squid_opt_use_aio" = "xyes" ; then
DISK_MODULES="$DISK_MODULES AIO"
AC_DEFINE([HAVE_DISKIO_MODULE_AIO],1,[POSIX AIO Disk I/O module is built])
case "$squid_host_os" in
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])
;;
esac
else
AC_MSG_NOTICE([AIO DiskIO Module disabled. Missing POSIX AIO support.])
squid_disk_module_candidates_AIO=no
fi
;;
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)
case "$squid_host_os" in
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])
;;
esac
;;
DiskThreads)
squid_opt_use_diskthreads="yes"
LIBPTHREADS=
SQUID_STATE_SAVE([diskthreads_state],[SQUID_CFLAGS SQUID_CXXFLAGS])
if test "x$with_pthreads" != "xno"; then
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
case "$squid_host_os" in
mingw)
ENABLE_WIN32_AIOPS=1
AC_MSG_NOTICE([Windows threads support automatically enabled])
;;
freebsd)
if test `echo "$squid_host_os_version" | tr -d .` -lt 70 ; then
AC_MSG_NOTICE(pthread library requires FreeBSD 7 or later)
squid_opt_use_diskthreads="no"
else
SQUID_CFLAGS="$SQUID_CFLAGS -D_REENTRANT"
SQUID_CXXFLAGS="$SQUID_CXXFLAGS -D_REENTRANT"
if test "x$GCC" = "xyes" -a "x$PRESET_LDFLAGS" = "x" ; then
LDFLAGS="$LDFLAGS -pthread"
fi
fi
;;
openbsd)
if test `echo "$squid_host_os_version" | tr -d .` -lt 52 ; then
AC_MSG_NOTICE(pthread library requires OpenBSD 5.2 or later)
squid_opt_use_diskthreads="no"
else
SQUID_CFLAGS="$SQUID_CFLAGS -D_REENTRANT"
SQUID_CXXFLAGS="$SQUID_CXXFLAGS -D_REENTRANT"
LDFLAGS="$LDFLAGS -lpthread"
fi
;;
solaris)
if test "x$GCC" = "xyes" ; then
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"
])
else
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"
])
fi
;;
*)
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"
])
;;
esac
else
AC_MSG_NOTICE([Native pthreads support manually disabled.])
squid_opt_use_diskthreads="no"
fi
if test "x$squid_opt_use_diskthreads" = "xyes" ; then
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])
else
AC_MSG_NOTICE([Native pthreads support disabled. DiskThreads module automaticaly disabled.])
SQUID_STATE_ROLLBACK([diskthreads_state])
squid_disk_module_candidates_DiskThreads=no
fi
;;
IpcIo)
if test "x$ac_cv_search_shm_open" = "xno" ; then
AC_MSG_NOTICE([DiskIO IpcIo module requires shared memory support])
squid_disk_module_candidates_IpcIo=no
else
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])
fi
;;
Mmapped)
dnl TODO: use availability of sys/mman.h and/or mmap to define
dnl OR support windows mmap functions
if test "x$squid_host_os" = "xmingw" ; then
AC_MSG_NOTICE([Mmapped DiskIO is not available on Mingw])
squid_disk_module_candidates_Mmapped=no
else
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])
fi
;;
*)
AC_MSG_NOTICE([Enabling $module DiskIO module])
DISK_LIBS="$DISK_LIBS lib${module}.la"
DISK_MODULES="$DISK_MODULES ${module}"
;;
esac
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.
squid_opt_enable_storeio=auto
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]), [
case $enableval in
yes)
squid_opt_enable_storeio=auto
;;
no)
squid_opt_enable_storeio=no
;;
*)
squid_opt_enable_storeio=yes
squid_storeio_module_candidates="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`"
# 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="$squid_storeio_module_candidates ufs"
;;
esac
])
if test "x$squid_opt_enable_storeio" = "xauto"; then
squid_opt_enable_storeio=yes
AC_MSG_CHECKING([for available StoreIO modules])
SQUID_LOOK_FOR_MODULES([$srcdir/src/fs],[squid_storeio_module_candidates])
AC_MSG_RESULT([$squid_storeio_module_candidates])
fi
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])
for fs in $squid_storeio_module_candidates none; do
case "$fs" in
diskd)
if test "x$squid_disk_module_candidates_Blocking" != "xyes" -a \
"$squid_disk_module_candidates_DiskDaemon" != "yes" ; then
AC_MSG_ERROR([Storage diskd module requires DiskIO module: Blocking or DiskDaemon])
fi
;;
aufs)
if test "x$squid_disk_module_candidates_Blocking" != "xyes" -a \
"$squid_disk_module_candidates_DiskThreads" != "yes" ; then
AC_MSG_ERROR([Storage module aufs requires DiskIO module: Blocking or DiskThreads])
fi
;;
rock)
if test "x$squid_disk_module_candidates_IpcIo" != "xyes" -a \
"x$squid_disk_module_candidates_Blocking" != "xyes"; then
AC_MSG_ERROR([Storage module Rock requires DiskIO module: Blocking or IpcIo])
fi
squid_do_build_rock=true
;;
ufs)
if test "x$squid_disk_module_candidates_Blocking" != "xyes"; then
AC_MSG_ERROR([Storage module ufs requires DiskIO module: Blocking])
fi
squid_do_build_ufs=true
;;
esac
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]), [
case $enableval in
yes)
SQUID_LOOK_FOR_MODULES([$srcdir/src/repl],[REPL_POLICIES])
;;
no)
;;
*)
REPL_POLICIES="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`"
;;
esac
])
if test "x$REPL_POLICIES" != "x" ; then
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'`"
fi
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]),
[ if test "x$enableval" = "xyes" ; then
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)
fi
])
AM_CONDITIONAL(ENABLE_DELAY_POOLS, false)
AC_ARG_ENABLE(delay-pools,
AS_HELP_STRING([--enable-delay-pools],[Enable delay pools to limit bandwidth usage]),
[ if test "x$enableval" = "xyes" ; then
AC_MSG_NOTICE([Delay pools enabled])
AC_DEFINE([USE_DELAY_POOLS],1,[Traffic management via "delay pools".])
AM_CONDITIONAL(ENABLE_DELAY_POOLS, true)
fi
])
dnl disable generic/common adaptation support by default
squid_opt_use_adaptation=no
squid_opt_use_esi=auto
AH_TEMPLATE([USE_SQUID_ESI],[Define to enable the ESI processor])
AC_ARG_ENABLE(esi,
AS_HELP_STRING([--disable-esi],
[Disable ESI for accelerators. ESI requires expat or libxml2.
Enabling ESI will cause squid reverse proxies to be capable
of the Edge Acceleration Specification (www.esi.org).]),
[squid_opt_use_esi=$enableval],[])
HAVE_LIBEXPAT=0
EXPATLIB=
HAVE_LIBXML2=0
XMLLIB=
# ESI support libraries: expat
AC_ARG_WITH(expat, AS_HELP_STRING([--without-expat],[Do not use expat for ESI. Default: auto-detect]))
if test "x$squid_opt_use_esi" != "xno" -a "x$with_expat" != "xno" ; then
AC_CHECK_LIB([expat], [main], [EXPATLIB="-lexpat"; HAVE_LIBEXPAT=1])
AC_CHECK_HEADERS([expat.h])
AC_DEFINE_UNQUOTED(HAVE_LIBEXPAT, $HAVE_LIBEXPAT, [Define to 1 if you have the expat library])
AS_IF(test "x$HAVE_LIBEXPAT" = "x1",[
squid_opt_use_esi=yes
],[
AS_IF(test "x$with_expat" = "xyes",[
AC_MSG_ERROR([Required library expat not found.])
],[
AC_MSG_NOTICE([Library expat not found.])
])
])
fi
AC_ARG_WITH(libxml2, AS_HELP_STRING([--without-libxml2],[Do not use libxml2 for ESI. Default: auto-detect]))
if test "x$squid_opt_use_esi" != "xno" -a "x$with_libxml2" != "xno" ; then
SQUID_STATE_SAVE([squid_libxml2_save])
PKG_CHECK_MODULES([LIBXML2],[libxml-2.0],[],[
AC_CHECK_LIB([xml2], [main], [LIBXML2_LIBS="$LIBXML2_LIBS -lxml2"])
dnl Find the main header and include path...
AC_CACHE_CHECK([location of libxml2 include files], [ac_cv_libxml2_include], [
AC_CHECK_HEADERS([libxml/parser.h], [], [
AC_MSG_NOTICE([Testing in /usr/include/libxml2])
SAVED_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="-I/usr/include/libxml2 $CPPFLAGS"
unset ac_cv_header_libxml_parser_h
AC_CHECK_HEADERS([libxml/parser.h], [LIBXML2_CFLAGS="$LIBXML2_CFLAGS -I/usr/include/libxml2"], [
AC_MSG_NOTICE([Testing in /usr/local/include/libxml2])
CPPFLAGS="-I/usr/local/include/libxml2 $SAVED_CPPFLAGS"
unset ac_cv_header_libxml_parser_h
AC_CHECK_HEADERS([libxml/parser.h], [LIBXML2_CFLAGS="$LIBXML2_CFLAGS -I/usr/local/include/libxml2"], [
AC_MSG_NOTICE([Failed to find libxml2 header file libxml/parser.h])
])
])
CPPFLAGS="$SAVED_CPPFLAGS"
])
])
])
CPPFLAGS="$CPPFLAGS $LIBXML2_CFLAGS"
dnl Now that we know where to look find the headers...
AC_CHECK_HEADERS(libxml/parser.h libxml/HTMLparser.h libxml/HTMLtree.h)
SQUID_STATE_ROLLBACK([squid_libxml2_save])
if test "x$LIBXML2_LIBS" != "x"; then
HAVE_LIBXML2=1
squid_opt_use_esi=yes
SQUID_CXXFLAGS="$SQUID_CXXFLAGS $LIBXML2_CFLAGS"
CPPFLAGS="$CPPFLAGS $LIBXML2_CFLAGS"
XMLLIB="$LIBXML2_LIBS"
AC_DEFINE_UNQUOTED(HAVE_LIBXML2, $HAVE_LIBXML2, [Define to 1 if you have the libxml2 library])
elif test "x$with_libxml2" = "xyes"; then
AC_MSG_ERROR([Required library libxml2 not found])
else
AC_MSG_NOTICE([Library libxml2 not found.])
fi
fi
AS_IF([test "x$squid_opt_use_esi" = "xyes"],[
AS_IF(test "x$HAVE_LIBXML2" = "x0" -a "x$HAVE_LIBEXPAT" = "x0",[
AC_MSG_ERROR([ESI processor requires libxml2 or libexpat])
])
AC_MSG_NOTICE([Enabling ESI processor: $EXPATLIB $XMLLIB])
AC_DEFINE(USE_SQUID_ESI,1,[Compile the ESI processor])
],[
AS_IF(test "x$squid_opt_use_esi" = "xno",[
AC_MSG_NOTICE([Disabling ESI processor.])
],[
AC_MSG_NOTICE([Disabling ESI processor. libxml2 and libexpat not found.])
])
])
AM_CONDITIONAL(ENABLE_ESI, test "x$squid_opt_use_esi" = "xyes")
AM_CONDITIONAL(ENABLE_LIBEXPAT, test "x$HAVE_LIBEXPAT" = "x1")
AC_SUBST(EXPATLIB)
AM_CONDITIONAL(ENABLE_LIBXML2, test "x$HAVE_LIBXML2" = "x1")
AC_SUBST(XMLLIB)
# icap argument handling
AC_ARG_ENABLE(icap-client,
AS_HELP_STRING([--disable-icap-client],[Disable the ICAP client.]),[
SQUID_YESNO([$enableval],[Unrecognized argument to --disable-icap-client: $enableval])
])
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")
squid_opt_use_ecap=1
AC_MSG_CHECKING(whether to support eCAP)
AC_ARG_ENABLE(ecap,
AS_HELP_STRING([--enable-ecap],[support loadable content adaptation modules]), [
case "${enableval}" in
yes|no) squid_opt_use_ecap=$enableval ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-ecap) ;;
esac
AC_MSG_RESULT([$squid_opt_use_ecap, explicitly])
], [
squid_opt_use_ecap=no;
AC_MSG_RESULT([$squid_opt_use_ecap, implicitly])
]
)
dnl Perform configuration consistency checks for eCAP
if test "x$squid_opt_use_ecap" != "xno";
then
dnl eCAP support requires loadable modules, which are enabled by default
if test "x$enable_loadable_modules" != "xyes"
then
AC_MSG_ERROR([eCAP support requires loadable modules. Please do not use --disable-loadable-modules with --enable-ecap.])
fi
if test -n "$PKG_CONFIG"; then
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.