configure.in revision fb827ed6df9a473770fb69a75a455b4ad0d14f52
c3c6770e537ea916265c78d0294ad108233e17c1Michael Sawyer# Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC")
c3c6770e537ea916265c78d0294ad108233e17c1Michael Sawyer# Copyright (C) 2001 Internet Software Consortium.
bf8267aa453e5d2a735ed732a043b77a0b355b20Mark Andrews# Permission to use, copy, modify, and distribute this software for any
bf8267aa453e5d2a735ed732a043b77a0b355b20Mark Andrews# purpose with or without fee is hereby granted, provided that the above
bf8267aa453e5d2a735ed732a043b77a0b355b20Mark Andrews# copyright notice and this permission notice appear in all copies.
bf8267aa453e5d2a735ed732a043b77a0b355b20Mark Andrews# THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
bf8267aa453e5d2a735ed732a043b77a0b355b20Mark Andrews# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
bf8267aa453e5d2a735ed732a043b77a0b355b20Mark Andrews# AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
bf8267aa453e5d2a735ed732a043b77a0b355b20Mark Andrews# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
bf8267aa453e5d2a735ed732a043b77a0b355b20Mark Andrews# LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
bf8267aa453e5d2a735ed732a043b77a0b355b20Mark Andrews# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
bf8267aa453e5d2a735ed732a043b77a0b355b20Mark Andrews# PERFORMANCE OF THIS SOFTWARE.
bf8267aa453e5d2a735ed732a043b77a0b355b20Mark AndrewsAC_REVISION($Revision: 1.107 $)
c3c6770e537ea916265c78d0294ad108233e17c1Michael SawyerAC_PREREQ(2.13)
c3c6770e537ea916265c78d0294ad108233e17c1Michael SawyerAC_CONFIG_HEADER(config.h)
c3c6770e537ea916265c78d0294ad108233e17c1Michael SawyerAC_CANONICAL_HOST
c3c6770e537ea916265c78d0294ad108233e17c1Michael SawyerAC_PROG_MAKE_SET
30a60d2aff0ec1810262a8b8efc532e28b32bd57Evan HuntAC_PROG_RANLIB
30a60d2aff0ec1810262a8b8efc532e28b32bd57Evan HuntAC_PROG_INSTALL
30a60d2aff0ec1810262a8b8efc532e28b32bd57Evan HuntAC_SUBST(STD_CINCLUDES)
30a60d2aff0ec1810262a8b8efc532e28b32bd57Evan HuntAC_SUBST(STD_CDEFINES)
30a60d2aff0ec1810262a8b8efc532e28b32bd57Evan HuntAC_SUBST(STD_CWARNINGS)
30a60d2aff0ec1810262a8b8efc532e28b32bd57Evan HuntAC_SUBST(CCOPT)
30a60d2aff0ec1810262a8b8efc532e28b32bd57Evan HuntAC_PATH_PROG(AR, ar)
30a60d2aff0ec1810262a8b8efc532e28b32bd57Evan HuntARFLAGS="cruv"
30a60d2aff0ec1810262a8b8efc532e28b32bd57Evan HuntAC_SUBST(ARFLAGS)
30a60d2aff0ec1810262a8b8efc532e28b32bd57Evan Hunt# The POSIX ln(1) program. Non-POSIX systems may substitute
30a60d2aff0ec1810262a8b8efc532e28b32bd57Evan Hunt# "copy" or something.
222d38735f97f771054e223b03f84c5858252332Evan Huntcase "$AR" in
c3c6770e537ea916265c78d0294ad108233e17c1Michael Sawyer AC_MSG_ERROR([
222d38735f97f771054e223b03f84c5858252332Evan Huntar program not found. Please fix your PATH to include the directory in
222d38735f97f771054e223b03f84c5858252332Evan Huntwhich ar resides, or set AR in the environment with the full path to ar.
c634c94d673f1bab17e7f65d332f989b683e712cDavid LawrenceAC_PATH_PROGS(ETAGS, etags emacs-etags)
222d38735f97f771054e223b03f84c5858252332Evan Hunt# Some systems, e.g. RH7, have the Exuberant Ctags etags instead of
c3c6770e537ea916265c78d0294ad108233e17c1Michael Sawyer# GNU emacs etags, and it requires the -L flag.
c634c94d673f1bab17e7f65d332f989b683e712cDavid Lawrenceif test "X$ETAGS" != "X"; then
fdebae839745f79a7550aeb49d15a930523ec483David Lawrence AC_MSG_CHECKING(for Exuberant Ctags etags)
222d38735f97f771054e223b03f84c5858252332Evan Hunt if $ETAGS --version 2>&1 | grep 'Exuberant Ctags' >/dev/null 2>&1; then
28002bd7cb4baa0eab9f47e1e51069c5ea7ea5d4Andreas Gustafsson AC_MSG_RESULT(yes)
28002bd7cb4baa0eab9f47e1e51069c5ea7ea5d4Andreas Gustafsson ETAGS="$ETAGS -L"
1d32b1df372d6be6bac6450739b9e5ea23819995Evan Hunt AC_MSG_RESULT(no)
222d38735f97f771054e223b03f84c5858252332Evan HuntAC_SUBST(ETAGS)
b5b934a0bb46aded1552a17473652b5a7f4a3274Evan Hunt# Perl is optional; it is used only by some of the system test scripts.
222d38735f97f771054e223b03f84c5858252332Evan HuntAC_PATH_PROGS(PERL, perl5 perl)
c634c94d673f1bab17e7f65d332f989b683e712cDavid LawrenceAC_SUBST(PERL)
222d38735f97f771054e223b03f84c5858252332Evan Hunt# isc/list.h and others clash with the rest of BIND 9
222d38735f97f771054e223b03f84c5858252332Evan Huntcase "$includedir" in
c634c94d673f1bab17e7f65d332f989b683e712cDavid Lawrence '${prefix}/include')
c3c6770e537ea916265c78d0294ad108233e17c1Michael Sawyer includedir='${prefix}/bind/include'
c3c6770e537ea916265c78d0294ad108233e17c1Michael Sawyercase "$libdir" in
222d38735f97f771054e223b03f84c5858252332Evan Hunt '${prefix}/lib')
c634c94d673f1bab17e7f65d332f989b683e712cDavid Lawrence libdir='${prefix}/bind/lib'
222d38735f97f771054e223b03f84c5858252332Evan Hunt# Make sure INSTALL uses an absolute path, else it will be wrong in all
9069215eac23e32f4ef1c8e44ad7ff2865cfcdacEvan Hunt# Makefiles, since they use make/rules.in and INSTALL will be adjusted by
222d38735f97f771054e223b03f84c5858252332Evan Hunt# configure based on the location of the file where it is substituted.
222d38735f97f771054e223b03f84c5858252332Evan Hunt# Since in BIND9 INSTALL is only substituted into make/rules.in, an immediate
222d38735f97f771054e223b03f84c5858252332Evan Hunt# subdirectory of install-sh, This relative path will be wrong for all
9069215eac23e32f4ef1c8e44ad7ff2865cfcdacEvan Hunt# directories more than one level down from install-sh.
9069215eac23e32f4ef1c8e44ad7ff2865cfcdacEvan Huntcase "$INSTALL" in
9069215eac23e32f4ef1c8e44ad7ff2865cfcdacEvan Hunt # Not all systems have dirname.
222d38735f97f771054e223b03f84c5858252332Evan Hunt changequote({, })
9069215eac23e32f4ef1c8e44ad7ff2865cfcdacEvan Hunt ac_dir="`echo $INSTALL | sed 's%/[^/]*$%%'`"
9069215eac23e32f4ef1c8e44ad7ff2865cfcdacEvan Hunt changequote([, ])
9069215eac23e32f4ef1c8e44ad7ff2865cfcdacEvan Hunt ac_prog="`echo $INSTALL | sed 's%.*/%%'`"
222d38735f97f771054e223b03f84c5858252332Evan Hunt test "$ac_dir" = "$ac_prog" && ac_dir=.
9069215eac23e32f4ef1c8e44ad7ff2865cfcdacEvan Hunt test -d "$ac_dir" && ac_dir="`(cd \"$ac_dir\" && pwd)`"
222d38735f97f771054e223b03f84c5858252332Evan Hunt INSTALL="$ac_dir/$ac_prog"
9069215eac23e32f4ef1c8e44ad7ff2865cfcdacEvan Hunt# On these hosts, we really want to use cc, not gcc, even if it is
222d38735f97f771054e223b03f84c5858252332Evan Hunt# found. The gcc that these systems have will not correctly handle
222d38735f97f771054e223b03f84c5858252332Evan Hunt# However, if the user sets $CC to be something, let that override
b5b934a0bb46aded1552a17473652b5a7f4a3274Evan Hunt# our change.
222d38735f97f771054e223b03f84c5858252332Evan Huntif test "X$CC" = "X" ; then
b5b934a0bb46aded1552a17473652b5a7f4a3274Evan Hunt case "$host" in
222d38735f97f771054e223b03f84c5858252332Evan Hunt # Use Sun's cc if it is available, but watch
b5b934a0bb46aded1552a17473652b5a7f4a3274Evan Hunt # out for /usr/ucb/cc; it will never be the right
b5b934a0bb46aded1552a17473652b5a7f4a3274Evan Hunt # compiler to use.
b5b934a0bb46aded1552a17473652b5a7f4a3274Evan Hunt # If setting CC here fails, the AC_PROG_CC done
b5b934a0bb46aded1552a17473652b5a7f4a3274Evan Hunt # below might still find gcc.
222d38735f97f771054e223b03f84c5858252332Evan Hunt IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
b5b934a0bb46aded1552a17473652b5a7f4a3274Evan Hunt for ac_dir in $PATH; do
222d38735f97f771054e223b03f84c5858252332Evan Hunt test -z "$ac_dir" && ac_dir=.
b5b934a0bb46aded1552a17473652b5a7f4a3274Evan Hunt case "$ac_dir" in
222d38735f97f771054e223b03f84c5858252332Evan Hunt if test -f "$ac_dir/cc"; then
222d38735f97f771054e223b03f84c5858252332Evan Hunt IFS="$ac_save_ifs"
b5b934a0bb46aded1552a17473652b5a7f4a3274Evan Hunt mips-sgi-irix*)
b5b934a0bb46aded1552a17473652b5a7f4a3274Evan HuntAC_HEADER_STDC
d58e33bfabfee19a035031dac633d36659738d56Evan HuntAC_CHECK_HEADERS(fcntl.h db.h paths.h sys/time.h unistd.h sys/sockio.h sys/select.h sys/timers.h)
6de9744cf9c64be2145f663e4051196a4eaa9d45Evan HuntAC_TYPE_SIZE_T
6de9744cf9c64be2145f663e4051196a4eaa9d45Evan HuntAC_CHECK_TYPE(uintptr_t,unsigned long)
6de9744cf9c64be2145f663e4051196a4eaa9d45Evan HuntAC_HEADER_TIME
6de9744cf9c64be2145f663e4051196a4eaa9d45Evan Hunt# check if we need to #include sys/select.h explicitly
6de9744cf9c64be2145f663e4051196a4eaa9d45Evan Huntcase $ac_cv_header_unistd_h in
222d38735f97f771054e223b03f84c5858252332Evan HuntAC_MSG_CHECKING(if unistd.h defines fd_set)
222d38735f97f771054e223b03f84c5858252332Evan HuntAC_TRY_COMPILE([
6de9744cf9c64be2145f663e4051196a4eaa9d45Evan Hunt[fd_set read_set; return (0);],
6de9744cf9c64be2145f663e4051196a4eaa9d45Evan Hunt [AC_MSG_RESULT(yes)
2a6d60615cf07b164533dbb6bb1dce84ed2d037dEvan Hunt ISC_PLATFORM_NEEDSYSSELECTH="#undef ISC_PLATFORM_NEEDSYSSELECTH"
6de9744cf9c64be2145f663e4051196a4eaa9d45Evan Hunt [AC_MSG_RESULT(no)
6de9744cf9c64be2145f663e4051196a4eaa9d45Evan Hunt case ac_cv_header_sys_select_h in
6de9744cf9c64be2145f663e4051196a4eaa9d45Evan Hunt ISC_PLATFORM_NEEDSYSSELECTH="#define ISC_PLATFORM_NEEDSYSSELECTH 1"
222d38735f97f771054e223b03f84c5858252332Evan Hunt AC_MSG_ERROR([need either working unistd.h or sys/select.h])
6de9744cf9c64be2145f663e4051196a4eaa9d45Evan Hunt case ac_cv_header_sys_select_h in
6de9744cf9c64be2145f663e4051196a4eaa9d45Evan Hunt ISC_PLATFORM_NEEDSYSSELECTH="#define ISC_PLATFORM_NEEDSYSSELECTH 1"
6de9744cf9c64be2145f663e4051196a4eaa9d45Evan Hunt AC_MSG_ERROR([need either unistd.h or sys/select.h])
6de9744cf9c64be2145f663e4051196a4eaa9d45Evan HuntAC_SUBST(ISC_PLATFORM_NEEDSYSSELECTH)
cba23be7ba724b527f6a60c14caaeca9502fbc79Evan Hunt# Find the machine's endian flavor.
cba23be7ba724b527f6a60c14caaeca9502fbc79Evan HuntAC_C_BIGENDIAN
cba23be7ba724b527f6a60c14caaeca9502fbc79Evan HuntAC_ARG_WITH(irs-gr,[ --with-irs-gr Build ....],
cba23be7ba724b527f6a60c14caaeca9502fbc79Evan Huntwant_irs_gr="$withval", want_irs_gr="no")
222d38735f97f771054e223b03f84c5858252332Evan Huntcase "$want_irs_gr" in
cba23be7ba724b527f6a60c14caaeca9502fbc79Evan Huntyes) WANT_IRS_GR="#define WANT_IRS_GR 1"
ffff5d67926821d3db8df63bdd84a9cb1ce56739Evan Hunt WANT_IRS_GR_OBJS="\${WANT_IRS_GR_OBJS}"
ffff5d67926821d3db8df63bdd84a9cb1ce56739Evan Hunt*) WANT_IRS_GR="#undef WANT_IRS_GR" WANT_IRS_GR_OBJS="";;
ffff5d67926821d3db8df63bdd84a9cb1ce56739Evan HuntAC_SUBST(WANT_IRS_GR)
ffff5d67926821d3db8df63bdd84a9cb1ce56739Evan HuntAC_SUBST(WANT_IRS_GR_OBJS)
ffff5d67926821d3db8df63bdd84a9cb1ce56739Evan HuntAC_ARG_WITH(irs-pw,[ --with-irs-pw Build ....],
ffff5d67926821d3db8df63bdd84a9cb1ce56739Evan Huntwant_irs_pw="$withval", want_irs_pw="no")
ffff5d67926821d3db8df63bdd84a9cb1ce56739Evan Huntcase "$want_irs_pw" in
ffff5d67926821d3db8df63bdd84a9cb1ce56739Evan Huntyes) WANT_IRS_PW="#define WANT_IRS_PW 1"
a69070d8fab55dbc63ba9f96c9d3e34f0ea9119aMark Andrews WANT_IRS_PW_OBJS="\${WANT_IRS_PW_OBJS}";;
a69070d8fab55dbc63ba9f96c9d3e34f0ea9119aMark Andrews*) WANT_IRS_PW="#undef WANT_IRS_PW" WANT_IRS_PW_OBJS="";;
a69070d8fab55dbc63ba9f96c9d3e34f0ea9119aMark AndrewsAC_SUBST(WANT_IRS_PW)
a69070d8fab55dbc63ba9f96c9d3e34f0ea9119aMark AndrewsAC_SUBST(WANT_IRS_PW_OBJS)
a69070d8fab55dbc63ba9f96c9d3e34f0ea9119aMark AndrewsAC_ARG_WITH(irs-nis,[ --with-irs-nis Build ....],
a69070d8fab55dbc63ba9f96c9d3e34f0ea9119aMark Andrewswant_irs_nis="$withval", want_irs_nis="no")
a69070d8fab55dbc63ba9f96c9d3e34f0ea9119aMark Andrewscase "$want_irs_nis" in
a69070d8fab55dbc63ba9f96c9d3e34f0ea9119aMark Andrews WANT_IRS_NIS="#define WANT_IRS_NIS 1"
a69070d8fab55dbc63ba9f96c9d3e34f0ea9119aMark Andrews WANT_IRS_NIS_OBJS="\${WANT_IRS_NIS_OBJS}"
a69070d8fab55dbc63ba9f96c9d3e34f0ea9119aMark Andrews case "$want_irs_gr" in
a69070d8fab55dbc63ba9f96c9d3e34f0ea9119aMark Andrews WANT_IRS_NISGR_OBJS="\${WANT_IRS_NISGR_OBJS}";;
222d38735f97f771054e223b03f84c5858252332Evan Hunt WANT_IRS_NISGR_OBJS="";;
c5272fb3303425f794dab68f734f6a2a45dce01eMichael Sawyer case "$want_irs_pw" in
c5272fb3303425f794dab68f734f6a2a45dce01eMichael Sawyer WANT_IRS_NISPW_OBJS="\${WANT_IRS_NISPW_OBJS}";;
c5272fb3303425f794dab68f734f6a2a45dce01eMichael Sawyer WANT_IRS_NISPW_OBJS="";;
222d38735f97f771054e223b03f84c5858252332Evan Hunt WANT_IRS_NIS="#undef WANT_IRS_NIS"
6b9c29ec578de7fda057bd3b893ccda176378b1bMichael Sawyer WANT_IRS_NIS_OBJS=""
6b9c29ec578de7fda057bd3b893ccda176378b1bMichael Sawyer WANT_IRS_NISGR_OBJS=""
222d38735f97f771054e223b03f84c5858252332Evan Hunt WANT_IRS_NISPW_OBJS="";;
6b9c29ec578de7fda057bd3b893ccda176378b1bMichael SawyerAC_SUBST(WANT_IRS_NIS)
6b9c29ec578de7fda057bd3b893ccda176378b1bMichael SawyerAC_SUBST(WANT_IRS_NIS_OBJS)
6b9c29ec578de7fda057bd3b893ccda176378b1bMichael SawyerAC_SUBST(WANT_IRS_NISGR_OBJS)
222d38735f97f771054e223b03f84c5858252332Evan HuntAC_SUBST(WANT_IRS_NISPW_OBJS)
6b9c29ec578de7fda057bd3b893ccda176378b1bMichael Sawyer#ifdef HAVE_DB_H
222d38735f97f771054e223b03f84c5858252332Evan Huntint have_db_h = 1;
222d38735f97f771054e223b03f84c5858252332Evan Huntint have_db_h = 0;
6b9c29ec578de7fda057bd3b893ccda176378b1bMichael Sawyermain() { return(!have_db_h); }
1b003261c2dd3e32778337c7a2788e4829066bd9Andreas GustafssonWANT_IRS_DBPW_OBJS="\${WANT_IRS_DBPW_OBJS}"
1b003261c2dd3e32778337c7a2788e4829066bd9Andreas GustafssonWANT_IRS_DBPW_OBJS=""
3ad7f12f7439471a0922ed3952221e93aef9db69Andreas GustafssonWANT_IRS_DBPW_OBJS=""
6301757d64037b5a3684d7a765726f06f26712e5Mark AndrewsAC_SUBST(WANT_IRS_DBPW_OBJS)
3ad7f12f7439471a0922ed3952221e93aef9db69Andreas Gustafsson# was --with-randomdev specified?
3ad7f12f7439471a0922ed3952221e93aef9db69Andreas GustafssonAC_MSG_CHECKING(for random device)
3ad7f12f7439471a0922ed3952221e93aef9db69Andreas GustafssonAC_ARG_WITH(randomdev,
0759eb6a0dab024873df528b0ffad804ea31615dMichael Sawyer[ --with-randomdev=PATH Specify path for random device],
dc9c461b27df798ba7c3d9ba1446840c5f85553bMichael Sawyer use_randomdev="$withval", use_randomdev="unspec")
dc9c461b27df798ba7c3d9ba1446840c5f85553bMichael Sawyercase "$use_randomdev" in
222d38735f97f771054e223b03f84c5858252332Evan Hunt case "$host" in
5337a9e53c7df1ef40d70528f2360c5e4cb9a7d1Andreas Gustafsson AC_MSG_RESULT($devrandom)
5337a9e53c7df1ef40d70528f2360c5e4cb9a7d1Andreas Gustafsson AC_CHECK_FILE($devrandom,
222d38735f97f771054e223b03f84c5858252332Evan Hunt AC_DEFINE_UNQUOTED(PATH_RANDOMDEV,
5337a9e53c7df1ef40d70528f2360c5e4cb9a7d1Andreas Gustafsson "$devrandom"),)
5337a9e53c7df1ef40d70528f2360c5e4cb9a7d1Andreas Gustafsson AC_MSG_ERROR([--with-randomdev must specify a path])
5337a9e53c7df1ef40d70528f2360c5e4cb9a7d1Andreas Gustafsson AC_DEFINE_UNQUOTED(PATH_RANDOMDEV, "$use_randomdev")
5337a9e53c7df1ef40d70528f2360c5e4cb9a7d1Andreas Gustafsson AC_MSG_RESULT(using "$use_randomdev")
5337a9e53c7df1ef40d70528f2360c5e4cb9a7d1Andreas Gustafssonsinclude(../../config.threads.in)dnl
5337a9e53c7df1ef40d70528f2360c5e4cb9a7d1Andreas Gustafssonif $use_threads
5337a9e53c7df1ef40d70528f2360c5e4cb9a7d1Andreas Gustafsson # We'd like to use sigwait() too
5337a9e53c7df1ef40d70528f2360c5e4cb9a7d1Andreas Gustafsson AC_CHECK_LIB(c, sigwait,
222d38735f97f771054e223b03f84c5858252332Evan Hunt AC_DEFINE(HAVE_SIGWAIT),
5337a9e53c7df1ef40d70528f2360c5e4cb9a7d1Andreas Gustafsson AC_CHECK_LIB(pthread, sigwait,
5337a9e53c7df1ef40d70528f2360c5e4cb9a7d1Andreas Gustafsson AC_DEFINE(HAVE_SIGWAIT),
5337a9e53c7df1ef40d70528f2360c5e4cb9a7d1Andreas Gustafsson AC_CHECK_LIB(pthread, _Psigwait,
1d32b1df372d6be6bac6450739b9e5ea23819995Evan Hunt AC_DEFINE(HAVE_SIGWAIT),))
222d38735f97f771054e223b03f84c5858252332Evan Hunt AC_CHECK_FUNC(pthread_attr_getstacksize,
5337a9e53c7df1ef40d70528f2360c5e4cb9a7d1Andreas Gustafsson AC_DEFINE(HAVE_PTHREAD_ATTR_GETSTACKSIZE),)
5337a9e53c7df1ef40d70528f2360c5e4cb9a7d1Andreas Gustafsson # Additional OS-specific issues related to pthreads and sigwait.
5337a9e53c7df1ef40d70528f2360c5e4cb9a7d1Andreas Gustafsson case "$host" in
5337a9e53c7df1ef40d70528f2360c5e4cb9a7d1Andreas Gustafsson # One more place to look for sigwait.
5337a9e53c7df1ef40d70528f2360c5e4cb9a7d1Andreas Gustafsson AC_CHECK_LIB(c_r, sigwait, AC_DEFINE(HAVE_SIGWAIT),)
5337a9e53c7df1ef40d70528f2360c5e4cb9a7d1Andreas Gustafsson # BSDI 3.0 through 4.0.1 needs pthread_init() to be
5337a9e53c7df1ef40d70528f2360c5e4cb9a7d1Andreas Gustafsson # called before certain pthreads calls. This is deprecated
8aee18709f238406719768b8a6b843a15c5075f8Mark Andrews *-bsdi3.*|*-bsdi4.0*)
8aee18709f238406719768b8a6b843a15c5075f8Mark Andrews AC_DEFINE(NEED_PTHREAD_INIT)
8aee18709f238406719768b8a6b843a15c5075f8Mark Andrews # LinuxThreads requires some changes to the way we
8aee18709f238406719768b8a6b843a15c5075f8Mark Andrews # deal with signals.
8aee18709f238406719768b8a6b843a15c5075f8Mark Andrews AC_DEFINE(HAVE_LINUXTHREADS)
8aee18709f238406719768b8a6b843a15c5075f8Mark Andrews # Ensure the right sigwait() semantics on Solaris and make
8aee18709f238406719768b8a6b843a15c5075f8Mark Andrews # sure we call pthread_setconcurrency.
8aee18709f238406719768b8a6b843a15c5075f8Mark Andrews AC_DEFINE(_POSIX_PTHREAD_SEMANTICS)
8aee18709f238406719768b8a6b843a15c5075f8Mark Andrews AC_CHECK_FUNC(pthread_setconcurrency,
222d38735f97f771054e223b03f84c5858252332Evan Hunt AC_DEFINE(CALL_PTHREAD_SETCONCURRENCY))
8aee18709f238406719768b8a6b843a15c5075f8Mark Andrews AC_DEFINE(POSIX_GETPWUID_R)
8aee18709f238406719768b8a6b843a15c5075f8Mark Andrews AC_DEFINE(POSIX_GETPWNAM_R)
8aee18709f238406719768b8a6b843a15c5075f8Mark Andrews AC_DEFINE(POSIX_GETGRGID_R)
222d38735f97f771054e223b03f84c5858252332Evan Hunt AC_DEFINE(POSIX_GETGRNAM_R)
8aee18709f238406719768b8a6b843a15c5075f8Mark Andrews AC_DEFINE(_PTHREADS_DRAFT4)
8aee18709f238406719768b8a6b843a15c5075f8Mark Andrews # UnixWare does things its own way.
8aee18709f238406719768b8a6b843a15c5075f8Mark Andrews *-UnixWare*)
8aee18709f238406719768b8a6b843a15c5075f8Mark Andrews AC_DEFINE(HAVE_UNIXWARE_SIGWAIT)
222d38735f97f771054e223b03f84c5858252332Evan Hunt # Look for sysconf to allow detection of the number of processors.
8aee18709f238406719768b8a6b843a15c5075f8Mark Andrews AC_CHECK_FUNC(sysconf, AC_DEFINE(HAVE_SYSCONF),)
222d38735f97f771054e223b03f84c5858252332Evan Hunt if test "X$GCC" = "Xyes"; then
8aee18709f238406719768b8a6b843a15c5075f8Mark Andrews case "$host" in
8aee18709f238406719768b8a6b843a15c5075f8Mark Andrews CC="$CC -pthread"
8aee18709f238406719768b8a6b843a15c5075f8Mark Andrews CCOPT="$CCOPT -pthread"
8aee18709f238406719768b8a6b843a15c5075f8Mark Andrews STD_CDEFINES="$STD_CDEFINES -D_THREAD_SAFE"
8aee18709f238406719768b8a6b843a15c5075f8Mark Andrews CC="$CC -pthread"
8aee18709f238406719768b8a6b843a15c5075f8Mark Andrews CCOPT="$CCOPT -pthread"
8aee18709f238406719768b8a6b843a15c5075f8Mark Andrews LIBS="$LIBS -lthread"
8aee18709f238406719768b8a6b843a15c5075f8Mark Andrews STD_CDEFINES="$STD_CDEFINES -D_THREAD_SAFE"
8aee18709f238406719768b8a6b843a15c5075f8Mark Andrews case $host in
8aee18709f238406719768b8a6b843a15c5075f8Mark Andrews CC="$CC -pthread"
8aee18709f238406719768b8a6b843a15c5075f8Mark Andrews CCOPT="$CCOPT -pthread"
8aee18709f238406719768b8a6b843a15c5075f8Mark Andrews CC="$CC -mt"
8aee18709f238406719768b8a6b843a15c5075f8Mark Andrews CCOPT="$CCOPT -mt"
8aee18709f238406719768b8a6b843a15c5075f8Mark Andrews STD_CDEFINES="$STD_CDEFINES -D_THREAD_SAFE"
8aee18709f238406719768b8a6b843a15c5075f8Mark Andrews *-UnixWare*)
8aee18709f238406719768b8a6b843a15c5075f8Mark Andrews CC="$CC -Kthread"
8aee18709f238406719768b8a6b843a15c5075f8Mark Andrews CCOPT="$CCOPT -Kthread"
8aee18709f238406719768b8a6b843a15c5075f8Mark Andrews ALWAYS_DEFINES="-D_REENTRANT"
8aee18709f238406719768b8a6b843a15c5075f8Mark Andrews DO_PTHREADS="#define DO_PTHREADS 1"
8aee18709f238406719768b8a6b843a15c5075f8Mark Andrews WANT_IRS_THREADSGR_OBJS="\${WANT_IRS_THREADSGR_OBJS}"
8aee18709f238406719768b8a6b843a15c5075f8Mark Andrews WANT_IRS_THREADSPW_OBJS="\${WANT_IRS_THREADSPW_OBJS}"
8aee18709f238406719768b8a6b843a15c5075f8Mark Andrews WANT_IRS_THREADS_OBJS="\${WANT_IRS_THREADS_OBJS}"
8aee18709f238406719768b8a6b843a15c5075f8Mark Andrews WANT_THREADS_OBJS="\${WANT_THREADS_OBJS}"
8aee18709f238406719768b8a6b843a15c5075f8Mark Andrews thread_dir=pthreads
e2f470bebb3a0c107bc4ac86c6920c21e50e83e0Brian Wellington ALWAYS_DEFINES=""
222d38735f97f771054e223b03f84c5858252332Evan Hunt DO_PTHREADS="#undef DO_PTHREADS"
e2f470bebb3a0c107bc4ac86c6920c21e50e83e0Brian Wellington WANT_IRS_THREADSGR_OBJS=""
e2f470bebb3a0c107bc4ac86c6920c21e50e83e0Brian Wellington WANT_IRS_THREADSPW_OBJS=""
e2f470bebb3a0c107bc4ac86c6920c21e50e83e0Brian Wellington WANT_IRS_THREADS_OBJS=""
e2f470bebb3a0c107bc4ac86c6920c21e50e83e0Brian Wellington WANT_THREADS_OBJS=""
e2f470bebb3a0c107bc4ac86c6920c21e50e83e0Brian Wellington thread_dir=nothreads
f0a1134d331b2aa871306c73d2787960918eaab1Andreas GustafssonAC_SUBST(ALWAYS_DEFINES)
e2f470bebb3a0c107bc4ac86c6920c21e50e83e0Brian WellingtonAC_SUBST(DO_PTHREADS)
6301757d64037b5a3684d7a765726f06f26712e5Mark AndrewsAC_SUBST(WANT_IRS_THREADSGR_OBJS)
e2f470bebb3a0c107bc4ac86c6920c21e50e83e0Brian WellingtonAC_SUBST(WANT_IRS_THREADSPW_OBJS)
e2f470bebb3a0c107bc4ac86c6920c21e50e83e0Brian WellingtonAC_SUBST(WANT_IRS_THREADS_OBJS)
222d38735f97f771054e223b03f84c5858252332Evan HuntAC_SUBST(WANT_THREADS_OBJS)
e2f470bebb3a0c107bc4ac86c6920c21e50e83e0Brian WellingtonAC_CHECK_FUNC(strlcat, AC_DEFINE(HAVE_STRLCAT))
82f0630bae09598209cc37c1db00ff4356efee27Mark AndrewsAC_CHECK_FUNC(if_nametoindex,
82f0630bae09598209cc37c1db00ff4356efee27Mark Andrews [USE_IFNAMELINKID="#define USE_IFNAMELINKID 1"],
82f0630bae09598209cc37c1db00ff4356efee27Mark Andrews [USE_IFNAMELINKID="#undef USE_IFNAMELINKID"])
82f0630bae09598209cc37c1db00ff4356efee27Mark AndrewsAC_SUBST(USE_IFNAMELINKID)
82f0630bae09598209cc37c1db00ff4356efee27Mark AndrewsISC_THREAD_DIR=$thread_dir
82f0630bae09598209cc37c1db00ff4356efee27Mark AndrewsAC_SUBST(ISC_THREAD_DIR)
16cc4a1f56d0f9a300419da7e75e3b72169e608aMark AndrewsAC_CHECK_FUNC(daemon,
16cc4a1f56d0f9a300419da7e75e3b72169e608aMark Andrews[DAEMON_OBJS="" NEED_DAEMON="#undef NEED_DAEMON"]
16cc4a1f56d0f9a300419da7e75e3b72169e608aMark Andrews[DAEMON_OBJS="\${DAEMON_OBJS}" NEED_DAEMON="#define NEED_DAEMON 1"]
16cc4a1f56d0f9a300419da7e75e3b72169e608aMark AndrewsAC_SUBST(DAEMON_OBJS)
16cc4a1f56d0f9a300419da7e75e3b72169e608aMark AndrewsAC_SUBST(NEED_DAEMON)
16cc4a1f56d0f9a300419da7e75e3b72169e608aMark AndrewsAC_CHECK_FUNC(strsep,
16cc4a1f56d0f9a300419da7e75e3b72169e608aMark Andrews[STRSEP_OBJS="" NEED_STRSEP="#undef NEED_STRSEP"]
16cc4a1f56d0f9a300419da7e75e3b72169e608aMark Andrews[STRSEP_OBJS="\${STRSEP_OBJS}" NEED_STRSEP="#define NEED_STRSEP 1"]
ea5334a36ebf7c833ec493345d86e04953041fdcEvan HuntAC_SUBST(STRSEP_OBJS)
16cc4a1f56d0f9a300419da7e75e3b72169e608aMark AndrewsAC_SUBST(NEED_STRSEP)
16cc4a1f56d0f9a300419da7e75e3b72169e608aMark AndrewsAC_CHECK_FUNC(strerror, [NEED_STRERROR="#undef NEED_STRERROR"],
16cc4a1f56d0f9a300419da7e75e3b72169e608aMark Andrews[NEED_STRERROR="#define NEED_STRERROR 1"])
8aee18709f238406719768b8a6b843a15c5075f8Mark AndrewsAC_SUBST(NEED_STRERROR)
ac21f918f23ce95fd5be807428ee9e2c42319878Evan Hunt# flockfile is usually provided by pthreads, but we may want to use it
ac21f918f23ce95fd5be807428ee9e2c42319878Evan Hunt# even if compiled with --disable-threads.
ac21f918f23ce95fd5be807428ee9e2c42319878Evan HuntAC_CHECK_FUNC(flockfile, AC_DEFINE(HAVE_FLOCKFILE),)
ac21f918f23ce95fd5be807428ee9e2c42319878Evan Hunt# Indicate what the final decision was regarding threads.
ac21f918f23ce95fd5be807428ee9e2c42319878Evan HuntAC_MSG_CHECKING(whether to build with threads)
ac21f918f23ce95fd5be807428ee9e2c42319878Evan Huntif $use_threads; then
f5b7359c5730d39ff6eff24ae87c9c74a04c2e5cMark Andrews AC_MSG_RESULT(yes)
f5b7359c5730d39ff6eff24ae87c9c74a04c2e5cMark Andrews AC_MSG_RESULT(no)
f5b7359c5730d39ff6eff24ae87c9c74a04c2e5cMark Andrews# End of pthreads stuff.
d6f99498d624d5c5c8ee45067df02e6a6b35a1a3Mark Andrews# Additional compiler settings.
f5b7359c5730d39ff6eff24ae87c9c74a04c2e5cMark AndrewsMKDEPCC="$CC"
f5b7359c5730d39ff6eff24ae87c9c74a04c2e5cMark AndrewsMKDEPCFLAGS="-M"
f5b7359c5730d39ff6eff24ae87c9c74a04c2e5cMark AndrewsIRIX_DNSSEC_WARNINGS_HACK=""
f5b7359c5730d39ff6eff24ae87c9c74a04c2e5cMark Andrewsif test "X$GCC" = "Xyes"; then
f5b7359c5730d39ff6eff24ae87c9c74a04c2e5cMark Andrews STD_CWARNINGS="$STD_CWARNINGS -W -Wall -Wmissing-prototypes -Wcast-qual -Wwrite-strings"
f5b7359c5730d39ff6eff24ae87c9c74a04c2e5cMark Andrews case $host in
d1f43359e4349bb9d934b96b7aa22b54ae7cef7cMark Andrews CC="$CC -std"
d1f43359e4349bb9d934b96b7aa22b54ae7cef7cMark Andrews CCOPT="$CCOPT -std"
d1f43359e4349bb9d934b96b7aa22b54ae7cef7cMark Andrews MKDEPCC="$CC"
d1f43359e4349bb9d934b96b7aa22b54ae7cef7cMark Andrews CC="$CC -Ae -z"
d1f43359e4349bb9d934b96b7aa22b54ae7cef7cMark Andrews # The version of the C compiler that constantly warns about
d1f43359e4349bb9d934b96b7aa22b54ae7cef7cMark Andrews # 'const' as well as alignment issues is unfortunately not
d1f43359e4349bb9d934b96b7aa22b54ae7cef7cMark Andrews # able to be discerned via the version of the operating
d1f43359e4349bb9d934b96b7aa22b54ae7cef7cMark Andrews # system, nor does cc have a version flag.
d1f43359e4349bb9d934b96b7aa22b54ae7cef7cMark Andrews case "`$CC +W 123 2>&1`" in
d1f43359e4349bb9d934b96b7aa22b54ae7cef7cMark Andrews *Unknown?option*)
d1f43359e4349bb9d934b96b7aa22b54ae7cef7cMark Andrews STD_CWARNINGS="+w1"
d1f43359e4349bb9d934b96b7aa22b54ae7cef7cMark Andrews # Turn off the pointlessly noisy warnings.
d1f43359e4349bb9d934b96b7aa22b54ae7cef7cMark Andrews STD_CWARNINGS="+w1 +W 474,530"
d1f43359e4349bb9d934b96b7aa22b54ae7cef7cMark Andrews CCOPT="$CCOPT -Ae -z"
d1f43359e4349bb9d934b96b7aa22b54ae7cef7cMark Andrews LIBS="-Wl,+vnocompatwarnings $LIBS"
d1f43359e4349bb9d934b96b7aa22b54ae7cef7cMark AndrewsMKDEPPROG='cc -Ae -E -Wp,-M >/dev/null 2>&1 | awk '"'"'BEGIN {colon=0; rec="";} { for (i = 0 ; i < NF; i++) { if (colon && a[$i]) continue; if ($i == "\\") continue; if (!colon) { rec = $i continue; } if ($i == ":") { rec = rec " :" colon = 1 continue; } if (length(rec $i) > 76) { print rec " \\"; rec = "\t" $i; a[$i] = 1; } else { rec = rec " " $i a[$i] = 1; } } } END {print rec}'"'"' >>$TMP'
de5890da9b87cb4b91aca033db0e25b1fdb68c77Evan Hunt MKDEPPROG='cc -Ae -E -Wp,-M >/dev/null 2>>$TMP'
de5890da9b87cb4b91aca033db0e25b1fdb68c77Evan Hunt *-sgi-irix*)
de5890da9b87cb4b91aca033db0e25b1fdb68c77Evan Hunt STD_CWARNINGS="-fullwarn -woff 1209"
de5890da9b87cb4b91aca033db0e25b1fdb68c77Evan Hunt # Silence more than 250 instances of
de5890da9b87cb4b91aca033db0e25b1fdb68c77Evan Hunt # "prototyped function redeclared without prototype"
de5890da9b87cb4b91aca033db0e25b1fdb68c77Evan Hunt # and 11 instances of
de5890da9b87cb4b91aca033db0e25b1fdb68c77Evan Hunt # "variable ... was set but never used"
de5890da9b87cb4b91aca033db0e25b1fdb68c77Evan Hunt IRIX_DNSSEC_WARNINGS_HACK="-woff 1692,1552"
de5890da9b87cb4b91aca033db0e25b1fdb68c77Evan Hunt MKDEPCFLAGS="-xM"
de5890da9b87cb4b91aca033db0e25b1fdb68c77Evan Hunt *-UnixWare*)
2425d8bb7ccf5dc956ad12d64d97b5a42e022930Evan Hunt# _GNU_SOURCE is needed to access the fd_bits field of struct fd_set, which
2425d8bb7ccf5dc956ad12d64d97b5a42e022930Evan Hunt# is supposed to be opaque.
2425d8bb7ccf5dc956ad12d64d97b5a42e022930Evan Huntcase $host in
2425d8bb7ccf5dc956ad12d64d97b5a42e022930Evan Hunt STD_CDEFINES="$STD_CDEFINES -D_GNU_SOURCE"
c3c6770e537ea916265c78d0294ad108233e17c1Michael SawyerAC_SUBST(MKDEPCC)
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>],
[ --with-kame[=PATH] use Kame IPv6 [default path /usr/local/v6]],
kame_path=/usr/local/v6
if test -f $kame_path/lib/libinet6.a; then
AC_MSG_RESULT($kame_path/lib/libinet6.a)
LIBS="-L$kame_path/lib -linet6 $LIBS"
AC_MSG_ERROR([$kame_path/lib/libinet6.a not found.
# the platform that is otherwise broken without it -- BSD/OS 4.0 through 4.1.
# netinet6/in6.h is needed for.
isc_netinet6in6_hack="#include <netinet6/in6.h>"
# This is similar to the netinet6/in6.h issue.
isc_netinetin6_hack="#include <netinet/in6.h>"
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
[struct sockaddr_in6 xyzzy; xyzzy.sin6_scope_id = 0; return (0);],
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
ISC_IPV6_H="ipv6.h"
ISC_ISCIPV6_O="unix/ipv6.$O"
ISC_IPV6_C="ipv6.c"
#include <sys/types.h>
#include <netinet/in.h>
#include <arpa/inet.h>],
ISC_EXTRA_SRCS="$ISC_EXTRA_SRCS inet_ntop.c"
#include <sys/types.h>
#include <netinet/in.h>
#include <arpa/inet.h>],
ISC_EXTRA_SRCS="$ISC_EXTRA_SRCS inet_pton.c"
#include <sys/types.h>
#include <netinet/in.h>
#include <arpa/inet.h>],
ISC_EXTRA_SRCS="$ISC_EXTRA_SRCS inet_aton.c"
#include <sys/types.h>
#include <sys/socket.h>],
[struct sockaddr sa; sa.sa_len = 0; return (0);],
PORT_DIR=port/unknown
*aix3.2*) PORT_DIR="port/aix32";;
*aix4*) PORT_DIR="port/aix4";;
*aix5*) PORT_DIR="port/aix5";;
*aux3*) PORT_DIR="port/aux3";;
*-bsdi2*) PORT_DIR="port/bsdos2";;
*-bsdi*) PORT_DIR="port/bsdos";;
PORT_DIR="port/cygwin";;
*-darwin*) PORT_DIR="port/darwin";;
*-osf*) PORT_DIR="port/decunix";;
*-freebsd*) PORT_DIR="port/freebsd";;
*-hpux9*) PORT_DIR="port/hpux9";;
*-hpux10*) PORT_DIR="port/hpux10";;
*-hpux11*) PORT_DIR="port/hpux";;
*-irix*) PORT_DIR="port/irix";;
*-linux*) PORT_DIR="port/linux";;
*-lynxos*) PORT_DIR="port/lynxos";;
*-mpe*) PORT_DIR="port/mpe";;
*-netbsd*) PORT_DIR="port/netbsd";;
*-next*) PORT_DIR="port/next";;
*-openbsd*) PORT_DIR="port/openbsd";;
*-qnx*) PORT_DIR="port/qnx";;
*-rhapsody*) PORT_DIR="port/rhapsody";;
PORT_DIR="port/sunos";;
PORT_DIR="port/solaris";;
PORT_DIR="port/solaris";;
PORT_DIR="port/solaris";;
*-ultrix*) PORT_DIR="port/ultrix";;
*-sco-sysv*uw2.0*) PORT_DIR="port/unixware20";;
*-sco-sysv*uw2.1.2*) PORT_DIR="port/unixware212";;
*-sco-sysv*uw7*) PORT_DIR="port/unixware7";;
#include <sys/types.h>
#include <sys/socket.h>],
[struct msghdr msg; msg.msg_flags = 0; return (0);],
#include <sys/types.h>
#include <netinet/in.h>],
#include <netdb.h>],
#include <netdb.h>],
#include <netdb.h>],
#include <netdb.h>],
#include <netdb.h>],
#include <netdb.h>
AC_MSG_CHECKING(for h_errno in netdb.h)
#include <netdb.h>],
#include <sys/param.h>
#include <sys/sysctl.h>
#include <sys/socket.h>
ISC_EXTRA_SRCS="$ISC_EXTRA_SRCS print.c"
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <sys/socket.h>
[#include <unistd.h>
GETGROUPLIST_ARGS="#define GETGROUPLIST_ARGS const char *name, int basegid, int *groups, int *ngroups"
GETGROUPLIST_ARGS="#define GETGROUPLIST_ARGS const char *name, gid_t basegid, gid_t *groups, int *ngroups"
GETGROUPLIST_ARGS="#define GETGROUPLIST_ARGS const char *name, gid_t basegid, gid_t *groups, int *ngroups"
#include <netdb.h>
#include <netdb.h>
#include <netdb.h>
[#include <netdb.h>
#include <netdb.h>
#include <netdb.h>
#include <netdb.h>
#include <netdb.h>
#include <netdb.h>
#include <grp.h>
#include <netdb.h>
#include <netdb.h>
#include <netdb.h>
#include <netdb.h>
#include <netdb.h>
#include <netdb.h>
#include <netdb.h>
#include <netdb.h>
#include <netdb.h>
#include <sys/types.h>
#include <pwd.h>
#include <sys/types.h>
#include <pwd.h>
#include <sys/types.h>
#include <grp.h>
#include <netdb.h>
#include <netdb.h>
#include <netdb.h>
#include <netdb.h>
#include <netdb.h>
#include <netdb.h>
#include <netdb.h>
#include <sys/types.h>
#include <pwd.h>
#include <pwd.h>
#include <pwd.h>
#include <pwd.h>
#include <netdb.h>
#include <netdb.h>
#include <netdb.h>
#include <netdb.h>
#include <unistd.h>
#include <netdb.h>
#include <unistd.h>
#include <netdb.h>
#include <unistd.h>
#include <netdb.h>
#include <unistd.h>
#include <netdb.h>
# Shut up a -Wmissing-prototypes warning from <stdio.h>.
BIND9_INCLUDES=$BIND9_TOP_BUILDDIR/make/includes
BIND9_MAKE_RULES=$BIND9_TOP_BUILDDIR/make/rules
LIBBIND_API=$srcdir/api