1
# Process this file with `autoreconf -i` to create a 'configure' file.
3
# Licensed to the Apache Software Foundation (ASF) under one
4
# or more contributor license agreements. See the NOTICE file
5
# distributed with this work for additional information
6
# regarding copyright ownership. The ASF licenses this file
7
# to you under the Apache License, Version 2.0 (the
8
# "License"); you may not use this file except in compliance
9
# with the License. You may obtain a copy of the License at
11
# http://www.apache.org/licenses/LICENSE-2.0
13
# Unless required by applicable law or agreed to in writing, software
14
# distributed under the License is distributed on an "AS IS" BASIS,
15
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
# See the License for the specific language governing permissions and
17
# limitations under the License.
21
# 2. SITE CONFIGURATION
22
# 3. CHECK FOR PROGRAMS
23
# 4. CHECK FOR LIBRARIES
24
# 5. CHECK FOR HEADERS
26
# 7. autoheader TEMPLATES
28
# -----------------------------------------------------------------------------
31
# These first two version numbers are updated automatically on each release.
32
# Version number is calculated as MAJOR * 1000000 + MINOR * 1000 + MICRO
33
# Version string is in the form of MAJOR.MINOR.MICRO[sufix]
35
m4_define([TS_VERSION_S],[2.1.5-unstable])
36
m4_define([TS_VERSION_N],[2001005])
38
AC_INIT([Apache Traffic Server], TS_VERSION_S(), [dev@trafficserver.apache.org], [trafficserver],[http://trafficserver.apache.org])
40
AC_CONFIG_AUX_DIR([build/aux])
41
AC_CONFIG_SRCDIR([proxy/Main.cc])
42
AC_CONFIG_MACRO_DIR([build])
43
AM_INIT_AUTOMAKE([-Wall -Werror foreign no-installinfo no-installman 1.9.2])
44
AM_CONFIG_HEADER([lib/ts/ink_autoconf.h])
46
# Not sure this is needed, and seems to break with some versions of automake
49
# Libtool versioning uses different conventions on different
50
# platforms. At least on FreeBSD, libtool uses an overly complex
51
# convention that attempts to solve problems that most people just
52
# don't have and which just causes confusion for most end users.
54
TS_VERSION_MAJOR=$((TS_VERSION_N() / 1000000 ))
55
TS_VERSION_MINOR=$(((TS_VERSION_N() / 1000) % 1000 ))
56
TS_VERSION_MICRO=$((TS_VERSION_N() % 1000 ))
57
TS_LIBTOOL_MAJOR=`echo $((${TS_VERSION_MAJOR} + ${TS_VERSION_MINOR}))`
58
TS_LIBTOOL_VERSION=$TS_LIBTOOL_MAJOR:$TS_VERSION_MICRO:$TS_VERSION_MINOR
59
TS_VERSION_STRING=TS_VERSION_S()
60
TS_VERSION_NUMBER=TS_VERSION_N()
63
# Substitute the above version numbers into the various files below.
65
AC_SUBST(TS_LIBTOOL_VERSION)
66
AC_SUBST(TS_VERSION_STRING)
67
AC_SUBST(TS_VERSION_NUMBER)
68
AC_SUBST(TS_VERSION_MAJOR)
69
AC_SUBST(TS_VERSION_MINOR)
70
AC_SUBST(TS_VERSION_MICRO)
72
dnl Hard-coded top of ink_autoconf.h:
74
#ifndef _ink_autoconf_h
75
#define _ink_autoconf_h
78
dnl Hard-coded inclusion at the tail end of ink_autoconf.h:
81
#endif /* _ink_autoconf_h */
85
# Generate ./config.nice for reproducing runs of configure
87
TS_CONFIG_NICE([config.nice])
89
# XXX we can't just use AC_PREFIX_DEFAULT because that isn't subbed in
90
# by configure until it is too late. Is that how it should be or not?
91
# Something seems broken here.
92
AC_PREFIX_DEFAULT([/usr/local/trafficserver])
94
# Get the layout here, so we can pass the required variables to Trafficserver
95
TS_ENABLE_LAYOUT(TrafficServer, [cachedir])
97
# Reparse the configure arguments so we can override the layout.
110
build_person="`id -nu`"
111
build_group="`id -ng`"
112
build_machine="`uname -n`"
113
AC_SUBST([build_machine])
114
AC_SUBST([build_person])
115
AC_SUBST([build_group])
118
[AS_HELP_STRING([--with-user],[specify the system user [default: nobody]])],
127
[AS_HELP_STRING([--with-group],[specify the system group [default: nogroup]])],
129
with_group="$withval"
134
AC_SUBST([pkgsysuser],[$with_user])
135
AC_SUBST([pkgsysgroup],[$with_group])
137
# -----------------------------------------------------------------------------
138
# 2. SITE CONFIGURATION
144
AC_MSG_CHECKING([whether to enable debugging])
145
AC_ARG_ENABLE([debug],
146
[AS_HELP_STRING([--enable-debug],[turn on debugging])],
150
AC_MSG_RESULT([$enable_debug])
157
AC_MSG_CHECKING([whether to enable diags])
158
AC_ARG_ENABLE([diags],
159
[AS_HELP_STRING([--disable-diags],[turn off diags])],
165
AC_MSG_RESULT([$enable_diags])
169
# Build regression tests?
173
AC_MSG_CHECKING([whether to enable regression tests])
174
AC_ARG_ENABLE([tests],
175
[AS_HELP_STRING([--disable-tests],[turn off regression tests])],
181
AC_MSG_RESULT([$enable_tests])
183
AM_CONDITIONAL([BUILD_TESTS], [test "x$enable_tests" = "xyes"])
189
AC_MSG_CHECKING([whether to enable purify])
190
AC_ARG_ENABLE([purify],
191
[AS_HELP_STRING([--enable-purify],[enable support for Purify])],
195
AC_MSG_RESULT([$enable_purify])
202
AC_MSG_CHECKING([whether to use libev even if not required])
203
AC_ARG_ENABLE([libev],
204
[AS_HELP_STRING([--enable-libev],[use libev even if not required])],
208
AC_MSG_RESULT([$enable_libev])
215
AC_MSG_CHECKING([whether to enable micro-TS])
216
AC_ARG_ENABLE([micro],
217
[AS_HELP_STRING([--enable-micro],[enable micro-TS build [default: no]])],
221
AC_SUBST(is_micro_build)
222
AC_MSG_RESULT([$enable_micro])
227
has_standalone_iocore=0
228
AC_MSG_CHECKING([whether to build a standalone iocore])
229
AC_ARG_ENABLE([standalone-iocore],
230
[AS_HELP_STRING([--enable-standalone-iocore],[build just standalone iocore])],
231
[has_standalone_iocore=1],
232
[enable_standalone_iocore=no]
234
AC_MSG_RESULT([$enable_standalone_iocore])
235
AC_SUBST(has_standalone_iocore)
236
AS_IF([test "x$enable_standalone_iocore" = "xyes"],
237
[AC_SUBST([IOCORE_MODULARIZED_DEFS],[""])
238
AC_SUBST([ink_with_modules_def],["-DREC_BUILD_STAND_ALONE"])
239
AC_SUBST([ink_with_modules_local],[""])
240
AC_SUBST([ink_with_modules_process],[""])
241
AC_SUBST([hdr_dirs],"proxy/hdrs")
243
[AC_SUBST([ink_with_modules_def],["-DREC_BUILD_MGMT2"])
244
AC_SUBST([ink_with_modules_local],["-DLOCAL_MANAGER"])
245
AC_SUBST([ink_with_modules_process],["-DPROCESS_MANAGER"])
248
AM_CONDITIONAL([STANDALONE_IOCORE], [test "x$enable_standalone_iocore" = "xyes"])
251
# Remote Coverity Prevent commit
253
AC_MSG_CHECKING([whether to commit cov defects to remote host])
254
AC_ARG_ENABLE([remote-cov-commit],
255
[AS_HELP_STRING([--enable-remote-cov-commit[=HOST]], [commit cov defects to remote host [HOST=localhost]])],
257
[enable_remote_cov_commit=localhost]
259
AC_MSG_RESULT([$enable_remote_cov_commit])
260
AC_SUBST([enable_remote_cov_commit])
266
AC_MSG_CHECKING([whether to enable Web UI])
267
AC_ARG_ENABLE([webui],
268
[AS_HELP_STRING([--enable-webui],[enable Web UI [default: no]])],
272
AC_MSG_RESULT([$enable_webui])
274
AM_CONDITIONAL([BUILD_WEBUI], [test "x$enable_webui" = "xyes"])
280
AC_MSG_CHECKING([whether to enable API and plugin support])
282
[AS_HELP_STRING([--disable-api],[do not enable API and plugin support])],
286
AC_MSG_RESULT([$enable_api])
290
# Detailed Logging (for debugging purposes)
293
AC_MSG_CHECKING([whether to enable detailed logging for debugging purposes])
294
AC_ARG_ENABLE([detailed-log],
295
[AS_HELP_STRING([--enable-detailed-log],[enable detailed logging])],
296
[has_detailed_log=1],
297
[enable_detailed_log=no]
299
AC_MSG_RESULT([$enable_detailed_log])
300
AC_SUBST(has_detailed_log)
301
AM_CONDITIONAL([BUILD_DETAILED_LOG], [test "x$enable_detailed_log" = "xyes"])
307
AC_MSG_CHECKING([whether to enable cli2])
308
AC_ARG_ENABLE([cli2],
309
[AS_HELP_STRING([--disable-cli2],[do not compile cli2])],
313
AC_MSG_RESULT([$enable_cli2])
314
AS_IF([test "x$enable_cli2" = "xyes"],
315
[AC_SUBST([CLI_DIR],[cli2])]
320
# Experimental V2 stats APIs (for plugins)
323
AC_MSG_CHECKING([whether to enable the experimental V2 stats subsystem for plugin APIs])
324
AC_ARG_ENABLE([v2stats],
325
[AS_HELP_STRING([--enable-v2stats],[enable experimental V2 stats API])],
329
AC_MSG_RESULT([$enable_v2stats])
330
AC_SUBST(has_v2stats)
331
AM_CONDITIONAL([BUILD_V2STATS], [test "x$enable_v2stats" = "xyes"])
337
AC_MSG_CHECKING([whether to enable WCCP v2 support])
338
AC_ARG_ENABLE([wccp],
339
[AS_HELP_STRING([--enable-wccp],[enable WCCP v2])],
345
AC_MSG_RESULT([$enable_wccp])
347
AM_CONDITIONAL([BUILD_WCCP], [test "x$enable_wccp" = "xyes"])
350
AC_MSG_CHECKING([whether to enable profiler])
351
AC_ARG_WITH([profiler],
352
[AS_HELP_STRING([--with-profiler],[enable support for profiler [default=no]])],
353
[with_profiler=$withval],
356
AC_MSG_RESULT([$with_profiler])
359
# use eventfd() or pipes
360
# Found that ec2 is using an older kernel causing eventfd errors.
361
# Disable eventfd when using ATS on EC2 Fedora.
363
AC_MSG_CHECKING([whether to enable eventfd()])
364
AC_ARG_ENABLE([eventfd],
365
[AS_HELP_STRING([--disable-eventfd],[turn off eventfd and use pipes])],
367
[enable_eventfd="yes"]
369
AC_MSG_RESULT([$enable_eventfd])
372
# use POSIX capabilities instead of user ID switching.
374
AC_MSG_CHECKING([whether to use POSIX capabilities])
375
AC_ARG_ENABLE([posix-cap],
376
[AS_HELP_STRING([--disable-posix-cap],[Use user id switching instead of POSIX capabilities])],
378
[enable_posix_cap="yes"]
380
AC_MSG_RESULT([$enable_posix_cap])
383
# Disable ccache explicitly (it's enabled by default, if it exists)
385
AC_MSG_CHECKING([whether to explicitly disable ccache])
386
AC_ARG_ENABLE([ccache],
387
[AS_HELP_STRING([--disable-ccache],[Disable ccache from being used])],
389
[enable_ccache="yes"]
391
AC_MSG_RESULT([$enable_ccache])
394
# Use TPROXY for connection transparency.
396
AC_MSG_CHECKING([whether to enable TPROXY based transparency])
397
AC_ARG_ENABLE([tproxy],
398
[AS_HELP_STRING([--enable-tproxy[[=ARG]]],
399
[Use TPROXY to enable connection transparency.
400
'auto' or omitted for local system default,
402
'force' to use built in default,
403
number to use as IP_TRANSPARENT sockopt.
408
[enable_tproxy="auto"]
410
AC_MSG_RESULT([$enable_tproxy])
413
# Configure how many stats to allocate for plugins. Default is 512.
415
AC_ARG_WITH([max-api-stats],
416
[AS_HELP_STRING([--with-max-api-stats],[max number of plugin stats [default=512]])],
417
[max_api_stats=$withval],
420
AC_SUBST(max_api_stats)
423
# Installation directories
424
# For each var the following is evaluated
425
# foo Standard variable eg. ${prefix}/foo
426
# rel_foo Relative to prefix eg. foo
428
TS_SUBST_LAYOUT_PATH([prefix])
429
TS_SUBST_LAYOUT_PATH([exec_prefix])
430
TS_SUBST_LAYOUT_PATH([bindir])
431
TS_SUBST_LAYOUT_PATH([sbindir])
432
TS_SUBST_LAYOUT_PATH([libdir])
433
TS_SUBST_LAYOUT_PATH([libexecdir])
434
TS_SUBST_LAYOUT_PATH([infodir])
435
TS_SUBST_LAYOUT_PATH([mandir])
436
TS_SUBST_LAYOUT_PATH([sysconfdir])
437
TS_SUBST_LAYOUT_PATH([datadir])
438
TS_SUBST_LAYOUT_PATH([installbuilddir])
439
TS_SUBST_LAYOUT_PATH([includedir])
440
TS_SUBST_LAYOUT_PATH([localstatedir])
441
TS_SUBST_LAYOUT_PATH([runtimedir])
442
TS_SUBST_LAYOUT_PATH([logdir])
443
TS_SUBST_LAYOUT_PATH([cachedir])
445
TS_SUBST([pkgbindir])
446
TS_SUBST([pkgsbindir])
447
TS_SUBST([pkglibdir])
448
TS_SUBST([pkglibexecdir])
449
TS_SUBST([pkgsysconfdir])
450
TS_SUBST([pkgdatadir])
451
TS_SUBST([pkglocalstatedir])
452
TS_SUBST([pkgruntimedir])
453
TS_SUBST([pkglogdir])
454
TS_SUBST([pkgcachedir])
457
# -----------------------------------------------------------------------------
458
# 3. CHECK FOR PROGRAMS
460
# Compiler selection:
462
# Implementation note (toc)
463
# 1) Get default compiler settings (case statement.)
464
# 2) Check for over-rides of default compiler.
465
# 3) Set standard CFLAGS, SHARED_CFLAGS, etc.
466
# 4) (in first kludge mode block...) obtain any further CFLAG-type additions.
467
# 5) Test compilers with all flags set.
469
# AC_PROG can sometimes mangle CFLAGS etc.
470
# in particular, on Linux they insert -g -O2, here we preserve any user CFLAGS
475
REAL_CFLAGS="${CFLAGS}"
476
REAL_CXXFLAGS="${CXXFLAGS}"
477
REAL_CCASFLAGS="${CCASFLAGS}"
482
# Check for ccache (unless disabled explicitly)
483
if test "x$enable_ccache" = "xyes"; then
484
AC_CHECK_PROG([CCACHE],[ccache],[ccache],[])
485
if test "x${CCACHE}" = "xccache"; then
491
dnl AC_PROG_SED is only avaliable in recent autoconf versions.
492
dnl Use AC_CHECK_PROG instead if AC_PROG_SED is not present.
495
[AC_CHECK_PROG(SED, sed, sed)])
504
AC_CHECK_PROG(RM, rm, rm)
505
AC_CHECK_PROG(ASCPP, cpp, cpp)
506
AC_CHECK_TOOL(AR, ar, ar)
508
AS_IF([test "x$enable_wccp" = "xyes"],
515
AC_PATH_PROG([DOXYGEN], [doxygen]) # needed for Doxygen
516
AC_PATH_PROG([PERL],[perl],[not found])
517
AS_IF([test "x$PERL" = "xnot found"],
518
[AC_MSG_ERROR([check for perl failed. Have you installed perl?])]
520
AC_ARG_VAR([DOXYGEN], [full path of Doxygen executable])
521
AC_ARG_VAR([PERL], [full path of Perl executable])
523
CFLAGS="${REAL_CFLAGS}"
524
CXXFLAGS="${REAL_CXXFLAGS}"
525
CCASFLAGS="${REAL_CCASFLAGS}"
527
base_cc=`basename $CC`
528
# These are shortcuts used in combination for the compiler options below
531
if test "x${base_cc}" = "xicc"; then
532
# -Wall goes crazy, so turned these specific checks off for now:
534
# 111 is "statement is unrecahable"
535
# 279 is "controlling expression is constant", triggered by our asserts
536
# 383 is "value copied to temporary, reference to temporary used"
537
# 444 is "destructor for base class is not virtual"
538
# 522 is "function "xyz" redeclared "inline" after being called
539
# 873 is "has no corresponding operator delete". ToDo: we should fix.
540
# 981 is "operands are evaluated in unspecified order"
541
# 1418 is "external function definition with no prior declaration"
542
# 1419 is "external declaration in primary source file"
543
# 1572 is "floating-point equality and inequality comparisons are unreliable"
544
# 1720 is "operator new" has no corresponding member operator delete"
545
# 2256 is "non-pointer conversion from "int" to "unsigned char" "
546
# 2259 is "non-pointer conversion from "int" to "unsigned char" "
548
# TODO: We should try to eliminate more of these -wd exclusions.
549
common_opt="-pipe -Wall -wd111 -wd279 -wd383 -wd522 -wd444 -wd873 -wd981 -wd1418 -wd1419 -wd1572 -wd1720 -wd2256 -wd2259"
550
debug_opt="-ggdb3 $common_opt"
551
release_opt="-g $common_opt -O2 -axsse4.2 -fno-strict-aliasing"
552
cxx_opt="-Wno-invalid-offsetof"
554
# This is useful for finding odd conversions
555
# common_opt="-pipe -Wall -Werror -Wconversion -Wno-sign-conversion"
556
common_opt="-pipe -Wall -Werror"
557
debug_opt="-ggdb3 $common_opt"
558
release_opt="-g $common_opt -O3 -feliminate-unused-debug-symbols -fno-strict-aliasing"
559
cxx_opt="-Wno-invalid-offsetof"
563
common_opt="-pipe -Wall -Werror"
564
debug_opt="-ggdb3 $common_opt"
565
release_opt="-g $common_opt -O3 -feliminate-unused-debug-symbols -fno-strict-aliasing"
566
cxx_opt="-Wno-invalid-offsetof"
567
TS_ADDTO(CPPFLAGS, [-I/opt/local/include])
568
TS_ADDTO(LDFLAGS, [-L/opt/local/lib])
571
common_opt="-pipe -Wall -Werror"
572
debug_opt="-ggdb3 $common_opt"
573
release_opt="-g $common_opt -O3 -feliminate-unused-debug-symbols -fno-strict-aliasing"
574
cxx_opt="-Wno-invalid-offsetof"
575
TS_ADDTO(LDFLAGS, [-L/usr/local/lib])
578
if test "x${base_cc}" = "xcc"; then
579
common_opt="-mt -m64 -D__WORDSIZE=64" # FIXME: arch should be detected
580
CCASFLAGS="-Wa,-32" # TODO: add 64bit support to atomic ops
581
debug_opt="-g $common_opt"
582
release_opt="-g $common_opt -xO3"
583
cxx_opt="-library=stlport4"
586
AC_DEFINE([_POSIX_PTHREAD_SEMANTICS],1,
587
[posix thread semantics]
590
common_opt="-pipe -Wall -Werror"
591
debug_opt="-ggdb3 $common_opt"
592
release_opt="-g $common_opt -O3 -feliminate-unused-debug-symbols -fno-strict-aliasing"
593
cxx_opt="-Wno-invalid-offsetof"
595
TS_ADDTO(LDFLAGS, [-L/lib])
596
TS_ADDTO(LDFLAGS, [-L/usr/local/lib])
599
common_opt="-pipe -Wall -Werror"
600
debug_opt="-ggdb3 $common_opt"
601
release_opt="-g $common_opt -O3 -feliminate-unused-debug-symbols -fno-strict-aliasing"
602
cxx_opt="-Wno-invalid-offsetof"
606
cc_oflag_opt=$release_opt
607
cc_oflag_dbg=$debug_opt
608
cxx_oflag_opt="$release_opt $cxx_opt $cxx_rel"
609
cxx_oflag_dbg="$debug_opt $cxx_opt $cxx_dbg"
612
SHARED_LDFLAGS=-shared
613
SHARED_CXXFLAGS=-fPIC
614
SHARED_CXXLINKFLAGS=-shared
616
dnl Checks for pointer size
617
AC_CHECK_SIZEOF(void*, 4)
618
if test "x$ac_cv_sizeof_voidp" == "x"; then
619
AC_ERROR([Cannot determine size of void*])
621
AC_SUBST(ac_cv_sizeof_voidp)
624
# Checks for TCP defer accept
633
AC_SUBST(defer_accept)
637
# Here are all the extra linux-specific C(XX)FLAGS additions and
639
# TODO cpu architecture settings separate from operating system settings
642
# GCC: add a default march if there is not one set
643
if test "x${GCC}" = "xyes"; then
644
if test "${ac_cv_sizeof_voidp}" = "4"; then
646
i?86* | k[5-8]* | pentium* | athlon)
647
cpu_architecture="-march=i586"
650
cpu_architecture="-mv8"
656
# XXX: Any need for 64-bit arch flags?
657
# cpu_architecture="-march=native"
660
cpu_architecture="-march=ultrasparc"
664
# TODO: Add support for other compilers
668
# Overrride detected architecture with the user suplied one
670
AC_ARG_WITH(architecture, [AC_HELP_STRING([--with-architecture=ARCH],[use a specific CPU architecture])],
672
if test "x$withval" != "xyes" && test "x$withval" != "xno"; then
675
# TODO: In case we are cross compiling some of the provided flags
676
# should be added to the LDFLAGS
677
cpu_architecture="$withval"
680
cpu_architecture="-march=$withval"
683
elif test "x$withval" = "x"; then
684
AC_MSG_ERROR([--with-architecture requires an param])
688
if test "x$cpu_architecture" != "x"; then
689
TS_ADDTO(CFLAGS, [$cpu_architecture])
690
TS_ADDTO(CXXFLAGS, [$cpu_architecture])
695
TS_ADDTO(CPPFLAGS, [-D_LARGEFILE64_SOURCE=1])
696
if test "${ac_cv_sizeof_voidp}" = "8"; then
697
TS_ADDTO(CPPFLAGS, [-D_COMPILE64BIT_SOURCE=1])
699
TS_ADDTO(CPPFLAGS, [-D_FILE_OFFSET_BITS=64])
701
TS_ADDTO(CPPFLAGS, [-D_GNU_SOURCE])
702
TS_ADDTO(CPPFLAGS, [-D_REENTRANT])
706
EXTRA_CXX_LDFLAGS="-rdynamic"
713
EXTRA_CXX_LDFLAGS="-rdynamic"
720
EXTRA_CXX_LDFLAGS="-rdynamic"
724
TS_ADDTO(CPPFLAGS, [-D$host_os_def])
727
# _Here_ is where we go ahead and add the _optimizations_ to already
728
# existing CFLAGS/CXXFLAGS if some special values had been set.
730
if test "x${enable_debug}" = "xyes"; then
731
TS_ADDTO(CFLAGS, [${cc_oflag_dbg}])
732
TS_ADDTO(CXXFLAGS, [${cxx_oflag_dbg}])
733
TS_ADDTO(CPPFLAGS, [-DDEBUG -D_DEBUG])
735
TS_ADDTO(CFLAGS, [${cc_oflag_opt}])
736
TS_ADDTO(CXXFLAGS, [${cxx_oflag_opt}])
740
# Note: These are site-specific macro's that do various tests
741
# on the selected compilers. There was some tunning
742
# associated with our not wanting to use GNU for _everything_.
743
# Note: This macro may set certain parameters when run.
747
# -----------------------------------------------------------------------------
748
# 4. CHECK FOR LIBRARIES
750
AC_CHECK_LIB([m],[sin],[AC_SUBST([LIBM],["-lm"])])
751
AC_CHECK_LIB([exc],[exc_capture_context],[AC_SUBST([LIBEXC],["-lexc"])])
752
AC_CHECK_LIB([mld],[MLD_demangle_string],[AC_SUBST([LIBMLD],["-lmld"])])
753
AC_CHECK_LIB([dl],[dlopen],[AC_SUBST([LIBDL],["-ldl"])])
754
AC_CHECK_LIB([socket],[socket],[AC_SUBST([LIBSOCKET],["-lsocket"])])
755
AC_CHECK_LIB([nsl],[gethostbyname],[AC_SUBST([LIBNSL],["-lnsl"])])
756
AC_CHECK_LIB([resolv],[res_init],[AC_SUBST([LIBRESOLV],["-lresolv"])])
757
AC_CHECK_LIB([resolv],[__putlong],[AC_SUBST([LIBRESOLV],["-lresolv"])])
758
AC_CHECK_LIB([pthread],[pthread_exit],[AC_SUBST([LIBTHREAD],["-lpthread"])])
759
AC_CHECK_LIB([rt],[clock_gettime],[AC_SUBST([LIBRT],["-lrt"])])
760
AC_CHECK_LIB([posix4],[clock_gettime],[AC_SUBST([LIBRT],["-lposix4"])])
761
AC_CHECK_LIB([iconv],[iconv_open],[AC_SUBST([LIBICONV],["-liconv"])])
762
AC_CHECK_LIB([iconv],[libiconv_open],[AC_SUBST([LIBICONV],["-liconv"])])
763
# TODO: We have --enable-libev but here we add it unconditionally
764
# making resulting binaries always linked to libev if present.
765
# Use a proper --with-libev and fail on --enable-libev and -lev
766
# is missing. Allow --with-libev=builtin? living in ./srclib/ev ?
768
AC_CHECK_LIB([ev],[ev_sleep],[AC_SUBST([LIBEV],["-lev"])])
771
# Check for SSL presence and usability
773
if test "x${enable_crypto}" != "xyes"; then
774
AC_MSG_ERROR([Need at least one SSL library, --with-openssl is supported])
778
# Check for zlib presence and usability
782
# Check for lzma presence and usability
786
# Tcl macros provided by m4/tcl.m4
788
# this will error out if tclConfig.sh is not found
791
# if tclConfig.sh loads properly, assume libraries are there and working
794
# expect tclConfig.sh to populate TCL_LIB_FLAG and TCL_INCLUDE_SPEC
797
TCL_LIB_FLAG="-ltcl" # OSX fails to populate this variable
802
AC_SUBST([LIBTCL],[$TCL_LIB_FLAG])
806
TS_ADDTO(CPPFLAGS, [-I/usr/local/include])
809
TS_ADDTO(CPPFLAGS, [-I/usr/local/include])
813
if test "x${TCL_INCLUDE_SPEC}" != "x-I/usr/include"; then
814
TS_ADDTO(CPPFLAGS, [$TCL_INCLUDE_SPEC])
818
# Check for XML parser
821
if test "x${enable_xml}" != "xyes"; then
822
AC_MSG_ERROR([Need at least one XML library, --with-expat is supported])
826
# Check for default sqlite3 DB backend
831
if test "x${enable_sqlite3}" != "xyes"; then
833
if test "x${enable_libdb}" != "xyes"; then
834
AC_MSG_ERROR([Need at least one DB backend, --with-sqlite3 and --with-libdb are supported])
839
AC_SUBST(use_sqlite3)
842
TS_FLAG_FUNCS([clock_gettime kqueue epoll_ctl posix_memalign posix_fadvise lrand48_r srand48_r port_create])
843
TS_FLAG_FUNCS([strndup strlcpy strlcat])
845
AC_SUBST(has_clock_gettime)
846
AC_SUBST(has_posix_memalign)
847
AC_SUBST(has_posix_fadvise)
848
AC_SUBST(has_lrand48_r)
849
AC_SUBST(has_srand48_r)
850
AC_SUBST(has_strndup)
851
AC_SUBST(has_strlcpy)
852
AC_SUBST(has_strlcat)
854
# Check for eventfd() and sys/eventfd.h (both must exist ...)
855
TS_FLAG_HEADERS([sys/eventfd.h], [has_eventfd=1], [has_eventfd=0], [])
856
if test "x${has_eventfd}" = "xyes"; then
857
AS_IF([test "x$enable_eventfd" = "xyes"],
858
[TS_FLAG_FUNCS([eventfd])]
861
AC_SUBST(has_eventfd)
864
# Check for pcre library
867
if test "x${enable_pcre}" != "xyes"; then
868
AC_MSG_ERROR([Cannot find pcre library. Configure --with-pcre=DIR])
872
# Check for backtrace() support
873
TS_FLAG_HEADERS([execinfo.h], [has_backtrace=1],[])
874
if test "${has_backtrace}" = "1"; then
875
# FreeBSD requires '/usr/ports/devel/libexecinfo' for gdb style backtrace() support
876
AC_CHECK_LIB([execinfo], [backtrace], [have_backtrace_lib=yes
877
AC_SUBST([LIBEXECINFO],["-lexecinfo"])])
878
if test "x${have_backtrace_lib}" = "xyes"; then
879
AC_MSG_NOTICE([Using backtrace library '-lexecinfo'])
882
AC_MSG_WARN([No backtrace() support found])
885
AC_SUBST(has_backtrace)
891
if test "x$enable_libev" = "xyes"; then
894
elif test "$ac_cv_func_epoll_ctl" = "yes"; then
897
AC_MSG_NOTICE([Using epoll event interface])
898
elif test "$ac_cv_func_kqueue" = "yes"; then
901
AC_MSG_NOTICE([Using kqueue event interface])
902
elif test "$ac_cv_func_port_create" = "yes"; then
905
AC_MSG_NOTICE([Using port event interface])
907
AC_MSG_FAILURE([No suitable polling interface found])
915
if test "x${with_profiler}" = "xyes"; then
916
AC_CHECK_LIB([profiler], [ProfilerStart],
917
[AC_SUBST([LIBPROFILER], ["-lprofiler"])
920
[AC_MSG_FAILURE([check for profiler failed. Have you installed google-perftools-devel?])],
923
AC_SUBST(has_profiler)
926
# For SunPro 5.2 - we need the demangle symbol for
927
# ink_stack_trace.cc in lib/ts. Because this
928
# library is part of the SunPro distribution, we need
929
# check with the C++ compiler since we might be using
930
# SunPro CC for the C++ compiler and gcc for the C compiler
932
AC_CHECK_LIB([demangle],[cplus_demangle],
933
[LIBDEMANGLE="-ldemangle"
937
AC_SUBST([LIBDEMANGLE])
939
AC_SUBST(has_demangle)
942
# It's stupid, but not all platforms have union semun, even those that need it.
943
AC_MSG_CHECKING(for union semun in sys/sem.h)
945
#include <sys/types.h>
950
semctl(0, 0, 0, arg);
955
AC_MSG_RESULT([$msg])
957
AC_SUBST(need_union_semun)
959
# Check for POSIX capabilities library.
960
# If we don't find it, disable checking for header.
962
AS_IF([test "x$enable_posix_cap" = "xyes"],
963
AC_CHECK_LIB([cap],[cap_set_proc],
964
[AC_SUBST([LIBCAP], ["-lcap"])
967
[enable_posix_cap=no]
970
AC_SUBST(use_posix_cap)
971
# -----------------------------------------------------------------------------
972
# 5. CHECK FOR HEADER FILES
974
TS_FLAG_HEADERS([sys/epoll.h \
989
arpa/nameser_compat.h \
1009
AC_SUBST(sys_epollh)
1010
AC_SUBST(sys_eventh)
1011
AC_SUBST(machine_endianh)
1013
AC_SUBST(netinet_inh)
1014
AC_SUBST(netinet_in_systmh)
1015
AC_SUBST(netinet_tcph)
1016
AC_SUBST(sys_ioctlh)
1017
AC_SUBST(sys_byteorderh)
1018
AC_SUBST(sys_sockioh)
1019
AC_SUBST(sys_sysctlh)
1020
AC_SUBST(sys_sysinfoh)
1021
AC_SUBST(sys_systeminfoh)
1022
AC_SUBST(arpa_ineth)
1023
AC_SUBST(arpa_nameserh)
1024
AC_SUBST(arpa_nameser_compath)
1038
AC_SUBST(sys_mounth)
1039
AC_SUBST(sys_paramh)
1040
AC_SUBST(sys_sysmacrosh)
1042
AC_SUBST(net_ppp_defsh)
1044
TS_FLAG_HEADERS([netinet/ip.h], [], [],
1045
[[#ifdef HAVE_SYS_TYPES_H
1046
#include <sys/types.h>
1048
#ifdef HAVE_NETINET_IN_H
1049
#include <netinet/in.h>
1053
TS_FLAG_HEADERS([netinet/ip_icmp.h], [], [],
1054
[[#ifdef HAVE_SYS_TYPES_H
1055
#include <sys/types.h>
1057
#ifdef HAVE_NETINET_IN_H
1058
#include <netinet/in.h>
1060
#ifdef HAVE_NETINET_IP_H
1061
#include <netinet/ip.h>
1063
#ifdef HAVE_NETINET_IN_SYSTM_H
1064
#include <netinet/in_systm.h>
1068
AC_SUBST(netinet_iph)
1069
AC_SUBST(netinet_ip_icmph)
1071
if test "x${with_profiler}" = "xyes"; then
1072
TS_FLAG_HEADERS([google/profiler.h \
1076
if test "x${enable_posix_cap}" = "xyes"; then
1077
AC_CHECK_HEADERS([sys/capability.h],
1079
[AC_MSG_FAILURE([POSIX capabilities header not found. Try --disable-posix-cap])],
1085
# Configure sockopt value for TPROXY. Look at the enable flag.
1086
# Value 'no' means user forced disable, don't check anything else.
1087
# 'auto' means user didn't say, so silently enable/disable
1089
# A numeric value means enable, don't check, use that value.
1090
# Anything else means user forced, fail if value not found
1092
# We can't just include linux/in.h because it's incompatible with
1094
# Verify the file exists (is readable), scan for the value we need,
1095
# if found export the value and enable use of the value.
1099
tproxy_header=/usr/include/linux/in.h
1100
tproxy_usage_enable="
1101
--enable-tproxy Enable the feature and validate."
1102
tproxy_usage_default="
1103
--enable-tproxy=force Enable using default sockopt value, no validation."
1104
tproxy_usage_numeric="
1105
--enable-tproxy=X where X is numeric
1106
Enable, use X for sockopt value, no validation."
1107
tproxy_usage_disable="
1108
--disable-tproxy Disable feature, no validation."
1109
proxy_usage="$tproxy_usage_enable$tproxy_usage_default$tproxy_usage_numeric$tproxy_usage_disable"
1111
AS_IF([test "x$enable_tproxy" != "xno"], [
1112
AS_IF([test "x${enable_posix_cap}" != "xyes"], [
1113
AS_IF([test "x$enable_tproxy" = xauto], [
1116
AC_MSG_FAILURE([TPROXY feature requires POSIX capabilities.])
1119
AC_MSG_CHECKING([for TPROXY sockopt IP_TRANSPARENT])
1120
case "$enable_tproxy" in
1122
ip_transparent=$enable_tproxy
1124
AC_MSG_RESULT([forced to $ip_transparent])
1129
AC_MSG_RESULT([forced to $ip_transparent])
1132
AS_IF([test -r $tproxy_header], [
1133
ip_transparent=`$AWK "/^#define[ \t]+IP_TRANSPARENT[ \t]+[0-9]+/{print \\$3}" $tproxy_header`
1134
AS_IF([test "x$ip_transparent" != "x"], [
1136
AC_MSG_RESULT([set to $ip_transparent])
1139
AS_IF([test "x$enable_tproxy" = xauto], [
1142
AC_MSG_RESULT([failed])
1143
AC_MSG_FAILURE([tproxy feature enabled but the sockopt value was not found in $tproxy_header. Try one of$tproxy_usage_default$tproxy_usage_numeric$tproxy_usage_disable])
1147
AS_IF([test "x$enable_tproxy" = xauto], [
1150
AC_MSG_RESULT([failed])
1151
AC_MSG_FAILURE([tproxy feature enabled but the header file $tproxy_header was not readable. Try one of$tproxy_usage_default$tproxy_usage_numeric$tproxy_usage_disable])
1156
AC_MSG_RESULT([failed])
1157
AC_MSG_FAILURE([Invalid argument to feature tproxy.$tproxy_usage])
1163
AC_SUBST(use_tproxy)
1164
AC_SUBST(ip_transparent)
1166
TS_CHECK_DEFAULT_IFACE
1167
TS_CHECK_GETHOSTBYNAME_R_STYLE
1170
# use modular IOCORE
1172
iocore_include_dirs="-I\$(top_srcdir)/iocore/eventsystem \
1173
-I\$(top_srcdir)/iocore/net \
1174
-I\$(top_srcdir)/iocore/aio \
1175
-I\$(top_srcdir)/iocore/hostdb \
1176
-I\$(top_srcdir)/iocore/cache \
1177
-I\$(top_srcdir)/iocore/cluster \
1178
-I\$(top_srcdir)/iocore/utils \
1179
-I\$(top_srcdir)/iocore/dns"
1181
if test "x$enable_libev" = "xyes"; then
1182
iocore_include_dirs="${iocore_include_dirs} -I\$(top_srcdir)/libev"
1185
# Testing Framework suffix generation hack
1186
TFW_PACKAGE_SUFFIX=$os_type
1188
MGMT_DEFS="$MGMT_DEFS -DMGMT_USE_SYSLOG"
1190
AC_MSG_NOTICE([Build using CC=$CC])
1191
AC_MSG_NOTICE([Build using CXX=$CXX])
1192
AC_MSG_NOTICE([Build using CPP=$CPP])
1193
AC_MSG_NOTICE([Build using CCAS=$CCAS])
1194
AC_MSG_NOTICE([Build using CFLAGS=$CFLAGS])
1195
AC_MSG_NOTICE([Build using SHARED_CFLAGS=$SHARED_CFLAGS])
1196
AC_MSG_NOTICE([Build using CXXFLAGS=$CXXFLAGS])
1197
AC_MSG_NOTICE([Build using SHARED_CXXFLAGS=$SHARED_CXXFLAGS])
1198
AC_MSG_NOTICE([Build using SHARED_CXXLINKFLAGS=$SHARED_LINKCXXFLAGS])
1199
AC_MSG_NOTICE([Build using CPPFLAGS=$CPPFLAGS])
1200
AC_MSG_NOTICE([Build using CCASFLAGS=$CCASFLAGS])
1201
AC_MSG_NOTICE([Build using LDFLAGS=$LDFLAGS])
1202
AC_MSG_NOTICE([Build using SHARED_LDFLAGS=$SHARED_LDFLAGS])
1203
AC_MSG_NOTICE([Build using EXTRA_CC_LDFLAGS=$EXTRA_CC_LDFLAGS])
1204
AC_MSG_NOTICE([Build using EXTRA_CXX_LDFLAGS=$EXTRA_CXX_LDFLAGS])
1205
AC_MSG_NOTICE([Build using MGMT_DEFS=$MGMT_DEFS])
1206
AC_MSG_NOTICE([Build using API_DEFS=$API_DEFS])
1208
AC_SUBST([API_DEFS])
1212
AC_SUBST([CXXFLAGS])
1213
AC_SUBST([EXPAT_LDFLAGS])
1214
AC_SUBST([EXTRA_CC_LDFLAGS])
1215
AC_SUBST([EXTRA_CXX_LDFLAGS])
1216
AC_SUBST([iocore_include_dirs])
1218
AC_SUBST([MGMT_DEFS])
1219
AC_SUBST([SHARED_CFLAGS])
1220
AC_SUBST([SHARED_CXXFLAGS])
1221
AC_SUBST([SHARED_CXXLINKFLAGS])
1222
AC_SUBST([SHARED_LDFLAGS])
1223
AC_SUBST([TFW_PACKAGE_SUFFIX])
1225
# -----------------------------------------------------------------------------
1228
AC_CONFIG_FILES([lib/ts/ink_config.h proxy/api/ts/ts.h])
1229
AC_CONFIG_FILES([tsxs])
1230
AC_CONFIG_FILES([doc/Doxyfile])
1231
AC_CONFIG_FILES([doc/Makefile])
1232
AC_CONFIG_FILES([rc/Makefile])
1233
AC_CONFIG_FILES([rc/trafficserver])
1234
AC_CONFIG_FILES([iocore/aio/Makefile])
1235
AC_CONFIG_FILES([iocore/cache/Makefile])
1236
AC_CONFIG_FILES([iocore/cluster/Makefile])
1237
AC_CONFIG_FILES([iocore/dns/Makefile])
1238
AC_CONFIG_FILES([iocore/eventsystem/Makefile])
1239
AC_CONFIG_FILES([iocore/hostdb/Makefile])
1240
AC_CONFIG_FILES([iocore/Makefile])
1241
AC_CONFIG_FILES([iocore/net/Makefile])
1242
AC_CONFIG_FILES([iocore/utils/Makefile])
1243
AC_CONFIG_FILES([lib/Makefile])
1244
AC_CONFIG_FILES([lib/ts/Makefile])
1245
AC_CONFIG_FILES([lib/records/Makefile])
1246
AC_CONFIG_FILES([lib/tsconfig/Makefile])
1247
AC_CONFIG_FILES([Makefile])
1248
AC_CONFIG_FILES([proxy/config/body_factory/default/Makefile])
1249
AC_CONFIG_FILES([proxy/config/body_factory/Makefile])
1250
AC_CONFIG_FILES([proxy/config/records.config proxy/config/storage.config])
1251
AC_CONFIG_FILES([proxy/config/Makefile])
1252
AC_CONFIG_FILES([proxy/congest/Makefile])
1253
AC_CONFIG_FILES([proxy/hdrs/Makefile])
1254
AC_CONFIG_FILES([proxy/http2/Makefile])
1255
AC_CONFIG_FILES([proxy/http2/remap/Makefile])
1256
AC_CONFIG_FILES([proxy/logging/Makefile])
1257
AC_CONFIG_FILES([proxy/Makefile])
1258
AC_CONFIG_FILES([proxy/mgmt2/api2/Makefile])
1259
AC_CONFIG_FILES([proxy/mgmt2/api2/remote/Makefile])
1260
AC_CONFIG_FILES([proxy/mgmt2/cli2/Makefile])
1261
AC_CONFIG_FILES([proxy/mgmt2/cli/Makefile])
1262
AC_CONFIG_FILES([proxy/mgmt2/cluster/Makefile])
1263
AC_CONFIG_FILES([proxy/mgmt2/cop/Makefile])
1264
AS_IF([test "x$enable_webui" = "xyes"],
1265
[AC_CONFIG_FILES([proxy/mgmt2/html2/Makefile])
1266
AC_CONFIG_FILES([proxy/mgmt2/html2/agent-installer/Makefile])
1267
AC_CONFIG_FILES([proxy/mgmt2/html2/charting/Makefile])
1268
AC_CONFIG_FILES([proxy/mgmt2/html2/configure/Makefile])
1269
AC_CONFIG_FILES([proxy/mgmt2/html2/configure/helper/Makefile])
1270
AC_CONFIG_FILES([proxy/mgmt2/html2/images/Makefile])
1271
AC_CONFIG_FILES([proxy/mgmt2/html2/include/Makefile])
1272
AC_CONFIG_FILES([proxy/mgmt2/html2/monitor/Makefile])
1273
AC_CONFIG_FILES([proxy/mgmt2/html2/mrtg/Makefile])
1274
AC_CONFIG_FILES([proxy/mgmt2/html2/tune/Makefile])
1276
AC_CONFIG_FILES([proxy/mgmt2/Makefile])
1277
AC_CONFIG_FILES([proxy/mgmt2/preparse/Makefile])
1278
AC_CONFIG_FILES([proxy/mgmt2/stats/Makefile])
1279
AC_CONFIG_FILES([proxy/mgmt2/tools/Makefile])
1280
AC_CONFIG_FILES([proxy/mgmt2/utils/Makefile])
1281
AC_CONFIG_FILES([proxy/mgmt2/web2/Makefile])
1282
AC_CONFIG_FILES([proxy/stats/Makefile])
1283
AC_CONFIG_FILES([proxy/wccp/Makefile])
1284
AC_CONFIG_FILES([proxy/api/ts/Makefile])
1285
# production plugins
1286
AC_CONFIG_FILES([plugins/Makefile])
1287
AC_CONFIG_FILES([plugins/conf_remap/Makefile])
1289
AC_CONFIG_FILES([example/Makefile])
1290
AC_CONFIG_FILES([example/add-header/Makefile])
1291
AC_CONFIG_FILES([example/append-transform/Makefile])
1292
AC_CONFIG_FILES([example/basic-auth/Makefile])
1293
AC_CONFIG_FILES([example/blacklist-0/Makefile])
1294
AC_CONFIG_FILES([example/blacklist-1/Makefile])
1295
AC_CONFIG_FILES([example/bnull-transform/Makefile])
1296
AC_CONFIG_FILES([example/cache_scan/Makefile])
1297
AC_CONFIG_FILES([example/file-1/Makefile])
1298
AC_CONFIG_FILES([example/gzip-transform/Makefile])
1299
AC_CONFIG_FILES([example/hello/Makefile])
1300
AC_CONFIG_FILES([example/null-transform/Makefile])
1301
AC_CONFIG_FILES([example/output-header/Makefile])
1302
AC_CONFIG_FILES([example/prefetch/Makefile])
1303
AC_CONFIG_FILES([example/protocol/Makefile])
1304
AC_CONFIG_FILES([example/redirect-1/Makefile])
1305
AC_CONFIG_FILES([example/query_remap/Makefile])
1306
AC_CONFIG_FILES([example/remap/Makefile])
1307
AC_CONFIG_FILES([example/replace-header/Makefile])
1308
AC_CONFIG_FILES([example/response-header-1/Makefile])
1309
AC_CONFIG_FILES([example/server-transform/Makefile])
1310
AC_CONFIG_FILES([example/session-1/Makefile])
1311
AC_CONFIG_FILES([example/thread-1/Makefile])
1312
AC_CONFIG_FILES([example/thread-pool/Makefile])
1313
# example app w/ standalone iocore
1314
AC_CONFIG_FILES([example/app-template/Makefile example/app-template/records.config])
1316
# -----------------------------------------------------------------------------
1317
# 7. autoheader TEMPLATES