📄 configure.in
字号:
# Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC")# Copyright (C) 2001 Internet Software Consortium.## Permission to use, copy, modify, and distribute this software for any# purpose with or without fee is hereby granted, provided that the above# copyright notice and this permission notice appear in all copies.## THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY# AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM# LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR# PERFORMANCE OF THIS SOFTWARE.AC_REVISION($Revision: 1.83.2.5.2.3 $)AC_INIT(resolv/herror.c)AC_PREREQ(2.13)AC_CONFIG_HEADER(config.h)AC_CANONICAL_HOSTAC_PROG_MAKE_SETAC_PROG_RANLIBAC_PROG_INSTALLAC_SUBST(STD_CINCLUDES)AC_SUBST(STD_CDEFINES)AC_SUBST(STD_CWARNINGS)AC_SUBST(CCOPT)AC_PATH_PROG(AR, ar)ARFLAGS="cruv"AC_SUBST(AR)AC_SUBST(ARFLAGS)# The POSIX ln(1) program. Non-POSIX systems may substitute# "copy" or something.LN=lnAC_SUBST(LN)case "$AR" in "") AC_MSG_ERROR([ar program not found. Please fix your PATH to include the directory inwhich ar resides, or set AR in the environment with the full path to ar.]) ;;esac## Etags.#AC_PATH_PROGS(ETAGS, etags emacs-etags)## Some systems, e.g. RH7, have the Exuberant Ctags etags instead of# GNU emacs etags, and it requires the -L flag.#if test "X$ETAGS" != "X"; then AC_MSG_CHECKING(for Exuberant Ctags etags) if $ETAGS --version 2>&1 | grep 'Exuberant Ctags' >/dev/null 2>&1; then AC_MSG_RESULT(yes) ETAGS="$ETAGS -L" else AC_MSG_RESULT(no) fifiAC_SUBST(ETAGS)## Perl is optional; it is used only by some of the system test scripts.#AC_PATH_PROGS(PERL, perl5 perl)AC_SUBST(PERL)## isc/list.h and others clash with the rest of BIND 9#case "$includedir" in '${prefix}/include') includedir='${prefix}/bind/include' ;;esaccase "$libdir" in '${prefix}/lib') libdir='${prefix}/bind/lib' ;;esac## Make sure INSTALL uses an absolute path, else it will be wrong in all# Makefiles, since they use make/rules.in and INSTALL will be adjusted by# configure based on the location of the file where it is substituted.# Since in BIND9 INSTALL is only substituted into make/rules.in, an immediate# subdirectory of install-sh, This relative path will be wrong for all# directories more than one level down from install-sh.#case "$INSTALL" in /*) ;; *) # # Not all systems have dirname. # changequote({, }) ac_dir="`echo $INSTALL | sed 's%/[^/]*$%%'`" changequote([, ]) ac_prog="`echo $INSTALL | sed 's%.*/%%'`" test "$ac_dir" = "$ac_prog" && ac_dir=. test -d "$ac_dir" && ac_dir="`(cd \"$ac_dir\" && pwd)`" INSTALL="$ac_dir/$ac_prog" ;;esac## On these hosts, we really want to use cc, not gcc, even if it is# found. The gcc that these systems have will not correctly handle# pthreads.## However, if the user sets $CC to be something, let that override# our change.#if test "X$CC" = "X" ; then case "$host" in *-dec-osf*) CC="cc" ;; *-solaris*) # Use Sun's cc if it is available, but watch # out for /usr/ucb/cc; it will never be the right # compiler to use. # # If setting CC here fails, the AC_PROG_CC done # below might still find gcc. IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" for ac_dir in $PATH; do test -z "$ac_dir" && ac_dir=. case "$ac_dir" in /usr/ucb) # exclude ;; *) if test -f "$ac_dir/cc"; then CC="$ac_dir/cc" break fi ;; esac done IFS="$ac_save_ifs" ;; *-hp-hpux*) CC="cc" ;; mips-sgi-irix*) CC="cc" ;; esacfiAC_PROG_CCAC_HEADER_STDCAC_CHECK_HEADERS(fcntl.h db.h paths.h sys/time.h unistd.h sys/sockio.h sys/select.h sys/timers.h)AC_C_CONSTAC_C_INLINEAC_TYPE_SIZE_TAC_HEADER_TIME## check if we need to #include sys/select.h explicitly#case $ac_cv_header_unistd_h inyes)AC_MSG_CHECKING(if unistd.h defines fd_set)AC_TRY_COMPILE([#include <unistd.h>],[fd_set read_set; return (0);], [AC_MSG_RESULT(yes) ISC_PLATFORM_NEEDSYSSELECTH="#undef ISC_PLATFORM_NEEDSYSSELECTH" ], [AC_MSG_RESULT(no) case ac_cv_header_sys_select_h in yes) ISC_PLATFORM_NEEDSYSSELECTH="#define ISC_PLATFORM_NEEDSYSSELECTH 1" ;; no) AC_MSG_ERROR([need either working unistd.h or sys/select.h]) ;; esac ]) ;;no) case ac_cv_header_sys_select_h in yes) ISC_PLATFORM_NEEDSYSSELECTH="#define ISC_PLATFORM_NEEDSYSSELECTH 1" ;; no) AC_MSG_ERROR([need either unistd.h or sys/select.h]) ;; esac ;;esacAC_SUBST(ISC_PLATFORM_NEEDSYSSELECTH)## Find the machine's endian flavor.#AC_C_BIGENDIANAC_ARG_WITH(irs-gr,[ --with-irs-gr Build ....],want_irs_gr="$withval", want_irs_gr="no")case "$want_irs_gr" inyes) WANT_IRS_GR="#define WANT_IRS_GR 1" WANT_IRS_GR_OBJS="\${WANT_IRS_GR_OBJS}" ;;*) WANT_IRS_GR="#undef WANT_IRS_GR" WANT_IRS_GR_OBJS="";;esacAC_SUBST(WANT_IRS_GR)AC_SUBST(WANT_IRS_GR_OBJS)AC_ARG_WITH(irs-pw,[ --with-irs-pw Build ....],want_irs_pw="$withval", want_irs_pw="no")case "$want_irs_pw" inyes) WANT_IRS_PW="#define WANT_IRS_PW 1" WANT_IRS_PW_OBJS="\${WANT_IRS_PW_OBJS}";;*) WANT_IRS_PW="#undef WANT_IRS_PW" WANT_IRS_PW_OBJS="";;esacAC_SUBST(WANT_IRS_PW)AC_SUBST(WANT_IRS_PW_OBJS)AC_ARG_WITH(irs-nis,[ --with-irs-nis Build ....],want_irs_nis="$withval", want_irs_nis="no")case "$want_irs_nis" inyes) WANT_IRS_NIS="#define WANT_IRS_NIS 1" WANT_IRS_NIS_OBJS="\${WANT_IRS_NIS_OBJS}" case "$want_irs_gr" in yes) WANT_IRS_NISGR_OBJS="\${WANT_IRS_NISGR_OBJS}";; *) WANT_IRS_NISGR_OBJS="";; esac case "$want_irs_pw" in yes) WANT_IRS_NISPW_OBJS="\${WANT_IRS_NISPW_OBJS}";; *) WANT_IRS_NISPW_OBJS="";; esac ;;*) WANT_IRS_NIS="#undef WANT_IRS_NIS" WANT_IRS_NIS_OBJS="" WANT_IRS_NISGR_OBJS="" WANT_IRS_NISPW_OBJS="";;esacAC_SUBST(WANT_IRS_NIS)AC_SUBST(WANT_IRS_NIS_OBJS)AC_SUBST(WANT_IRS_NISGR_OBJS)AC_SUBST(WANT_IRS_NISPW_OBJS)AC_TRY_RUN([#ifdef HAVE_DB_Hint have_db_h = 1;#elseint have_db_h = 0;#endifmain() { return(!have_db_h); }],WANT_IRS_DBPW_OBJS="\${WANT_IRS_DBPW_OBJS}",WANT_IRS_DBPW_OBJS="",WANT_IRS_DBPW_OBJS="")AC_SUBST(WANT_IRS_DBPW_OBJS)## was --with-randomdev specified?#AC_MSG_CHECKING(for random device)AC_ARG_WITH(randomdev,[ --with-randomdev=PATH Specify path for random device], use_randomdev="$withval", use_randomdev="unspec")case "$use_randomdev" in unspec) case "$host" in *-openbsd*) devrandom=/dev/srandom ;; *) devrandom=/dev/random ;; esac AC_MSG_RESULT($devrandom) AC_CHECK_FILE($devrandom, AC_DEFINE_UNQUOTED(PATH_RANDOMDEV, "$devrandom"),) ;; yes) AC_MSG_ERROR([--with-randomdev must specify a path]) ;; *) AC_DEFINE_UNQUOTED(PATH_RANDOMDEV, "$use_randomdev") AC_MSG_RESULT(using "$use_randomdev") ;;esac## Begin pthreads checking.## First, decide whether to use multithreading or not.#AC_MSG_CHECKING(whether to look for thread support)AC_ARG_ENABLE(threads, [ --disable-threads disable multithreading])case "$enable_threads" in yes|'') AC_MSG_RESULT(yes) use_threads=true ;; no) AC_MSG_RESULT(no) use_threads=false ;; *) AC_MSG_ERROR([--enable-threads takes yes or no]) ;;esacif $use_threadsthen # # Search for / configure pthreads in a system-dependent fashion. # case "$host" in *-netbsd*) # NetBSD has multiple pthreads implementations. The # recommended one to use is "unproven-pthreads". The # older "mit-pthreads" may also work on some NetBSD # versions. The PTL2 thread library does not # currently work with bind9, but can be chosen with # the --with-ptl2 option for those who wish to # experiment with it. CC="gcc" AC_MSG_CHECKING(which NetBSD thread library to use) AC_ARG_WITH(ptl2,[ --with-ptl2 on NetBSD, use the ptl2 thread library (experimental)], use_ptl2="$withval", use_ptl2="no") : ${LOCALBASE:=/usr/pkg} if test "X$use_ptl2" = "Xyes" then AC_MSG_RESULT(PTL2) AC_MSG_WARN([linking with PTL2 is highly experimental and not expected to work]) CC=ptlgcc else if test ! -d $LOCALBASE/pthreads then AC_MSG_RESULT(none) use_threads=false fi if $use_threads then AC_MSG_RESULT(mit-pthreads/unproven-pthreads) pkg="$LOCALBASE/pthreads" lib1="-L$pkg/lib -Wl,-R$pkg/lib" lib2="-lpthread -lm -lgcc -lpthread" LIBS="$lib1 $lib2 $LIBS" CPPFLAGS="$CPPFLAGS -I$pkg/include" STD_CINCLUDES="$STD_CINCLUDES -I$pkg/include" fi fi ;; *) AC_CHECK_LIB(pthread, pthread_create,, AC_CHECK_LIB(pthread, __pthread_create,, AC_CHECK_LIB(pthread, __pthread_create_system,, AC_CHECK_LIB(c_r, pthread_create,, AC_CHECK_LIB(c, pthread_create,, use_threads=false))))) ;; esacfiif $use_threadsthen # # We'd like to use sigwait() too # AC_CHECK_LIB(c, sigwait, AC_DEFINE(HAVE_SIGWAIT), AC_CHECK_LIB(pthread, sigwait, AC_DEFINE(HAVE_SIGWAIT), AC_CHECK_LIB(pthread, _Psigwait, AC_DEFINE(HAVE_SIGWAIT),)) ) AC_CHECK_FUNC(pthread_attr_getstacksize, AC_DEFINE(HAVE_PTHREAD_ATTR_GETSTACKSIZE),) # # Additional OS-specific issues related to pthreads and sigwait. # case "$host" in # # One more place to look for sigwait. # *-freebsd*) AC_CHECK_LIB(c_r, sigwait, AC_DEFINE(HAVE_SIGWAIT),) ;; # # BSDI 3.0 through 4.0.1 needs pthread_init() to be # called before certain pthreads calls. This is deprecated # in BSD/OS 4.1. # *-bsdi3.*|*-bsdi4.0*) AC_DEFINE(NEED_PTHREAD_INIT) ;; # # LinuxThreads requires some changes to the way we # deal with signals. # *-linux*) AC_DEFINE(HAVE_LINUXTHREADS) ;; # # Ensure the right sigwait() semantics on Solaris and make # sure we call pthread_setconcurrency. # *-solaris*) AC_DEFINE(_POSIX_PTHREAD_SEMANTICS) AC_CHECK_FUNC(pthread_setconcurrency, AC_DEFINE(CALL_PTHREAD_SETCONCURRENCY)) AC_DEFINE(POSIX_GETPWUID_R) AC_DEFINE(POSIX_GETPWNAM_R) AC_DEFINE(POSIX_GETGRGID_R) AC_DEFINE(POSIX_GETGRNAM_R) ;; *hpux11*) AC_DEFINE(_PTHREADS_DRAFT4) ;; # # UnixWare does things its own way. # *-UnixWare*) AC_DEFINE(HAVE_UNIXWARE_SIGWAIT) ;; esac # # Look for sysconf to allow detection of the number of processors. # AC_CHECK_FUNC(sysconf, AC_DEFINE(HAVE_SYSCONF),) if test "X$GCC" = "Xyes"; then case "$host" in *-freebsd*) CC="$CC -pthread" CCOPT="$CCOPT -pthread" STD_CDEFINES="$STD_CDEFINES -D_THREAD_SAFE" ;; *-openbsd*) CC="$CC -pthread" CCOPT="$CCOPT -pthread" ;; *-solaris*) LIBS="$LIBS -lthread" ;; *-ibm-aix*) STD_CDEFINES="$STD_CDEFINES -D_THREAD_SAFE" ;; esac else case $host in *-dec-osf*) CC="$CC -pthread" CCOPT="$CCOPT -pthread" ;; *-solaris*) CC="$CC -mt" CCOPT="$CCOPT -mt" ;; *-ibm-aix*) STD_CDEFINES="$STD_CDEFINES -D_THREAD_SAFE" ;; *-UnixWare*) CC="$CC -Kthread" CCOPT="$CCOPT -Kthread" ;; esac fi ALWAYS_DEFINES="-D_REENTRANT" DO_PTHREADS="#define DO_PTHREADS 1" WANT_IRS_THREADSGR_OBJS="\${WANT_IRS_THREADSGR_OBJS}" WANT_IRS_THREADSPW_OBJS="\${WANT_IRS_THREADSPW_OBJS}" WANT_IRS_THREADS_OBJS="\${WANT_IRS_THREADS_OBJS}" thread_dir=pthreadselse ALWAYS_DEFINES="" DO_PTHREADS="#undef DO_PTHREADS" WANT_IRS_THREADSGR_OBJS="" WANT_IRS_THREADSPW_OBJS="" WANT_IRS_THREADS_OBJS="" thread_dir=nothreadsfiAC_CHECK_FUNC(strlcat, AC_DEFINE(HAVE_STRLCAT))AC_SUBST(ALWAYS_DEFINES)AC_SUBST(DO_PTHREADS)AC_SUBST(WANT_IRS_THREADSGR_OBJS)AC_SUBST(WANT_IRS_THREADSPW_OBJS)AC_SUBST(WANT_IRS_THREADS_OBJS)AC_CHECK_FUNC(if_nametoindex, [USE_IFNAMELINKID="#define USE_IFNAMELINKID 1"], [USE_IFNAMELINKID="#undef USE_IFNAMELINKID"])AC_SUBST(USE_IFNAMELINKID)ISC_THREAD_DIR=$thread_dirAC_SUBST(ISC_THREAD_DIR)AC_CHECK_FUNC(daemon,[DAEMON_OBJS="" NEED_DAEMON="#undef NEED_DAEMON"],[DAEMON_OBJS="\${DAEMON_OBJS}" NEED_DAEMON="#define NEED_DAEMON 1"])AC_SUBST(DAEMON_OBJS)AC_SUBST(NEED_DAEMON)AC_CHECK_FUNC(strsep,[STRSEP_OBJS="" NEED_STRSEP="#undef NEED_STRSEP"],[STRSEP_OBJS="\${STRSEP_OBJS}" NEED_STRSEP="#define NEED_STRSEP 1"])AC_SUBST(STRSEP_OBJS)AC_SUBST(NEED_STRSEP)AC_CHECK_FUNC(strerror, [NEED_STRERROR="#undef NEED_STRERROR"],[NEED_STRERROR="#define NEED_STRERROR 1"])AC_SUBST(NEED_STRERROR)## flockfile is usually provided by pthreads, but we may want to use it# even if compiled with --disable-threads.#AC_CHECK_FUNC(flockfile, AC_DEFINE(HAVE_FLOCKFILE),)# # Indicate what the final decision was regarding threads.#AC_MSG_CHECKING(whether to build with threads)if $use_threads; then AC_MSG_RESULT(yes)else AC_MSG_RESULT(no)fi# # End of pthreads stuff.### Additional compiler settings.#MKDEPCC="$CC"MKDEPCFLAGS="-M"IRIX_DNSSEC_WARNINGS_HACK=""if test "X$GCC" = "Xyes"; then STD_CWARNINGS="$STD_CWARNINGS -W -Wall -Wmissing-prototypes -Wcast-qual -Wwrite-strings"else case $host in *-dec-osf*) CC="$CC -std" CCOPT="$CCOPT -std" MKDEPCC="$CC" ;; *-hp-hpux*) CC="$CC -Ae -z" # The version of the C compiler that constantly warns about # 'const' as well as alignment issues is unfortunately not # able to be discerned via the version of the operating # system, nor does cc have a version flag. case "`$CC +W 123 2>&1`" in *Unknown?option*) STD_CWARNINGS="+w1" ;;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -