configure.in revision 820ad97db480f58e1e4d0d3eeae73b2fb27b4f91
dnl Copyright (C) 1998, 1999 Internet Software Consortium.
dnl
dnl Permission to use, copy, modify, and distribute this software for any
dnl purpose with or without fee is hereby granted, provided that the above
dnl copyright notice and this permission notice appear in all copies.
dnl
dnl THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
dnl ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
dnl OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
dnl CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
dnl DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
dnl PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
dnl ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
dnl SOFTWARE.
AC_REVISION($Revision: 1.26 $)
AC_PREREQ(2.12)
AC_INIT(lib/dns/name.c)
AC_CONFIG_HEADER(config.h)
AC_CANONICAL_HOST
AC_PROG_MAKE_SET
AC_PROG_RANLIB
AC_PROG_INSTALL
STD_CINCLUDES=""
STD_CDEFINES=""
STD_CWARNINGS=""
AC_SUBST(STD_CINCLUDES)
AC_SUBST(STD_CDEFINES)
AC_SUBST(STD_CWARNINGS)
dnl
dnl On these hosts, we really want to use cc, not gcc, even if it is
dnl found. The gcc that these systems have will not correctly handle
dnl pthreads.
dnl
dnl However, if the user sets $CC to be something, let that override
dnl our change.
dnl
if test "X$CC" = "X" ; then
case "$host" in
*-dec-osf*)
CC="cc"
;;
*-sun-solaris*)
CC="cc"
;;
*-hp-hpux*)
CC="cc"
;;
mips-sgi-irix*)
CC="cc"
;;
esac
fi
dnl
dnl NetBSD has two alternative pthreads implementations. Make the
dnl user choose one by saying --with-mit-pthreads or --with-ptl2
dnl if necessary.
dnl
case "$host" in
*-netbsd*)
CC="gcc"
AC_MSG_CHECKING(which thread library to use)
AC_ARG_WITH(mit-pthreads,
[ --with-mit-pthreads use the mit-pthreads thread library],
use_mit_pthreads="$withval", use_mit_pthreads="no")
AC_ARG_WITH(ptl2,
[ --with-ptl2 use the ptl2 thread library],
use_ptl2="$withval", use_ptl2="no")
dnl If user did not choose a thread library explicitly,
dnl try to choose one automatically. This will work when
dnl exactly one library is installed.
case "$use_mit_pthreads+$use_ptl2" in
no+no)
if test -d /usr/pkg/pthreads
then
use_mit_pthreads="yes"
fi
if test -d /usr/pkg/PTL
then
use_ptl2="yes"
fi
;;
esac
case "$use_mit_pthreads+$use_ptl2" in
yes+no)
AC_MSG_RESULT(mit-pthreads)
pkg="/usr/pkg/pthreads"
lib1="-L$pkg/lib -Wl,-R$pkg/lib"
lib2="-lpthread -lm -lgcc -lpthread"
LIBS="$lib1 $lib2 $LIBS"
STD_CINCLUDES="-I$pkg/include"
;;
no+yes)
AC_MSG_RESULT(PTL2)
pkg="/usr/pkg/PTL"
LIBS="-L/usr/pkg/lib -lPTL $LIBS"
STD_CINCLUDES="-nostdinc -idirafter $pkg/include"
;;
*)
AC_MSG_ERROR([no thread library.
Please choose a thread library using one of
configure --with-mit-pthreads
configure --with-ptl2
])
;;
esac
;;
esac
AC_PROG_CC
AC_HEADER_STDC
AC_CHECK_HEADERS(fcntl.h sys/time.h unistd.h)
AC_C_CONST
AC_C_INLINE
AC_TYPE_SIZE_T
AC_HEADER_TIME
AC_CHECK_LIB(pthread, pthread_create,,
AC_CHECK_LIB(pthread, __pthread_create)
AC_CHECK_LIB(pthread, __pthread_create_system)
)
dnl
dnl We'd like to use sigwait() too
dnl
AC_CHECK_LIB(pthread, sigwait,
AC_DEFINE(HAVE_SIGWAIT),
AC_CHECK_LIB(pthread, _Psigwait,
AC_DEFINE(HAVE_SIGWAIT),)
)
dnl
dnl Make sure we get the right sigwait() semantics...
dnl
case "$host" in
*-sun-solaris*)
AC_DEFINE(_POSIX_PTHREAD_SEMANTICS)
;;
esac
dnl
dnl BSDI 3.1 needs pthread_init() to be called before certain pthreads
dnl calls. LinuxThreads requires some changes to the way we deal with
dnl signals.
dnl
case "$host" in
*-bsdi3.1*)
AC_DEFINE(NEED_PTHREAD_INIT)
;;
*-linux*)
AC_DEFINE(HAVE_LINUXTHREADS)
;;
esac
dnl
dnl -lxnet buys us one big porting headache... standards, gotta love 'em.
dnl
dnl AC_CHECK_LIB(xnet, socket, ,
dnl AC_CHECK_LIB(socket, socket)
dnl AC_CHECK_LIB(nsl, inet_ntoa)
dnl )
dnl
dnl Use this for now, instead:
dnl
case "$host" in
mips-sgi-irix*)
;;
*)
AC_CHECK_LIB(socket, socket)
AC_CHECK_LIB(nsl, inet_ntoa)
;;
esac
AC_CHECK_FUNC(inet_ntop, ,
[ISC_EXTRA_OBJS="$ISC_EXTRA_OBJS inet_ntop.o"
AC_SUBST(ISC_EXTRA_OBJS)
AC_DEFINE(NEED_INET_NTOP)]
)
AC_CHECK_FUNC(inet_pton, ,
[ISC_EXTRA_OBJS="$ISC_EXTRA_OBJS inet_pton.o"
AC_SUBST(ISC_EXTRA_OBJS)
AC_DEFINE(NEED_INET_PTON)]
)
AC_CHECK_FUNC(inet_aton, ,
[ISC_EXTRA_OBJS="$ISC_EXTRA_OBJS inet_aton.o"
AC_SUBST(ISC_EXTRA_OBJS)
AC_DEFINE(NEED_INET_ATON)]
)
if test "X$GCC" = "Xyes"; then
STD_CWARNINGS="$STD_CWARNINGS -W -Wall -Wmissing-prototypes"
case "$host" in
*-sun-solaris*)
LIBS="$LIBS -lthread"
;;
esac
else
case "$host" in
*-dec-osf*)
CC="$CC -pthread"
;;
*-sun-solaris*)
CC="$CC -mt"
;;
*-hp-hpux*)
CC="$CC"
;;
esac
fi
dnl
dnl Networking specifics.
dnl
case "$host" in
*-sun-solaris*)
AC_DEFINE(NEED_AF_INET6)
;;
*-hp-hpux*)
AC_DEFINE(NEED_AF_INET6)
;;
*-dec-osf*)
dnl Turn on 4.4BSD style sa_len support.
dnl (Disabled for now because it is incompatible
dnl with the use of send() and recv()).
dnl AC_DEFINE(_SOCKADDR_LEN)
;;
esac
dnl Look for a 4.4BSD-style sa_len member in struct sockaddr.
dnl Be careful not to be fooled by the IRIX "sa_len2" member.
AC_MSG_CHECKING(for sa_len in struct sockaddr)
AC_EGREP_HEADER([sa_len[^a-z0-9_]], sys/socket.h,
[AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_SA_LEN)],
[AC_MSG_RESULT(no)])
AC_SUBST(BIND9_TOP_BUILDDIR)
BIND9_TOP_BUILDDIR=`pwd`
AC_SUBST_FILE(BIND9_MAKE_RULES)
BIND9_MAKE_RULES=$BIND9_TOP_BUILDDIR/make/rules
AC_SUBST_FILE(BIND9_VERSION)
BIND9_VERSION=$srcdir/version
AC_OUTPUT(
make/rules
Makefile
make/Makefile
lib/Makefile
lib/isc/Makefile
lib/isc/include/Makefile
lib/isc/include/isc/Makefile
lib/isc/unix/Makefile
lib/isc/unix/include/Makefile
lib/isc/unix/include/isc/Makefile
lib/isc/pthreads/Makefile
lib/isc/pthreads/include/Makefile
lib/isc/pthreads/include/isc/Makefile
lib/dns/Makefile
lib/dns/include/Makefile
lib/dns/include/dns/Makefile
lib/tests/Makefile
lib/tests/include/Makefile
lib/tests/include/tests/Makefile
bin/Makefile
bin/named/Makefile
bin/tests/Makefile
bin/tests/names/Makefile
bin/tests/master/Makefile
bin/tests/rbt/Makefile
)