configure.in revision 174187
1170222Sdougb# Copyright (C) 2004-2007  Internet Systems Consortium, Inc. ("ISC")
2135446Strhodes# Copyright (C) 1998-2003  Internet Software Consortium.
3135446Strhodes#
4174187Sdougb# Permission to use, copy, modify, and/or distribute this software for any
5135446Strhodes# purpose with or without fee is hereby granted, provided that the above
6135446Strhodes# copyright notice and this permission notice appear in all copies.
7135446Strhodes#
8135446Strhodes# THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
9135446Strhodes# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
10135446Strhodes# AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
11135446Strhodes# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
12135446Strhodes# LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
13135446Strhodes# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
14135446Strhodes# PERFORMANCE OF THIS SOFTWARE.
15135446Strhodes
16135446Strhodesdnl
17135446StrhodesAC_DIVERT_PUSH(1)dnl
18135446Strhodesesyscmd([sed "s/^/# /" COPYRIGHT])dnl
19135446StrhodesAC_DIVERT_POP()dnl
20135446Strhodes
21174187SdougbAC_REVISION($Revision: 1.355.18.71 $)
22135446Strhodes
23135446StrhodesAC_INIT(lib/dns/name.c)
24170222SdougbAC_PREREQ(2.59)
25135446Strhodes
26135446StrhodesAC_CONFIG_HEADER(config.h)
27135446StrhodesAC_CONFIG_SUBDIRS(lib/bind)
28135446Strhodes
29135446StrhodesAC_CANONICAL_HOST
30135446Strhodes
31135446StrhodesAC_PROG_MAKE_SET
32135446StrhodesAC_PROG_RANLIB
33135446StrhodesAC_PROG_INSTALL
34170222SdougbAC_PROG_LN_S
35135446Strhodes
36135446StrhodesAC_SUBST(STD_CINCLUDES)
37135446StrhodesAC_SUBST(STD_CDEFINES)
38135446StrhodesAC_SUBST(STD_CWARNINGS)
39135446StrhodesAC_SUBST(CCOPT)
40135446Strhodes
41170222Sdougb#
42170222Sdougb# Make very sure that these are the first files processed by
43170222Sdougb# config.status, since we use the processed output as the input for
44170222Sdougb# AC_SUBST_FILE() subsitutions in other files.
45170222Sdougb#
46170222SdougbAC_CONFIG_FILES([make/rules make/includes])
47170222Sdougb
48135446StrhodesAC_PATH_PROG(AR, ar)
49135446StrhodesARFLAGS="cruv"
50135446StrhodesAC_SUBST(AR)
51135446StrhodesAC_SUBST(ARFLAGS)
52135446Strhodes
53135446Strhodes# The POSIX ln(1) program.  Non-POSIX systems may substitute
54135446Strhodes# "copy" or something.
55135446StrhodesLN=ln
56135446StrhodesAC_SUBST(LN)
57135446Strhodes
58135446Strhodescase "$AR" in
59135446Strhodes	"")
60135446Strhodes		AC_MSG_ERROR([
61135446Strhodesar program not found.  Please fix your PATH to include the directory in
62135446Strhodeswhich ar resides, or set AR in the environment with the full path to ar.
63135446Strhodes])
64135446Strhodes
65135446Strhodes		;;
66135446Strhodesesac
67135446Strhodes
68135446Strhodes#
69135446Strhodes# Etags.
70135446Strhodes#
71135446StrhodesAC_PATH_PROGS(ETAGS, etags emacs-etags)
72135446Strhodes
73135446Strhodes#
74135446Strhodes# Some systems, e.g. RH7, have the Exuberant Ctags etags instead of
75135446Strhodes# GNU emacs etags, and it requires the -L flag.
76135446Strhodes#
77135446Strhodesif test "X$ETAGS" != "X"; then
78135446Strhodes	AC_MSG_CHECKING(for Exuberant Ctags etags)
79135446Strhodes	if $ETAGS --version 2>&1 | grep 'Exuberant Ctags' >/dev/null 2>&1; then
80135446Strhodes		AC_MSG_RESULT(yes)
81135446Strhodes		ETAGS="$ETAGS -L"
82135446Strhodes	else
83135446Strhodes		AC_MSG_RESULT(no)
84135446Strhodes	fi
85135446Strhodesfi
86135446StrhodesAC_SUBST(ETAGS)
87135446Strhodes
88135446Strhodes#
89135446Strhodes# Perl is optional; it is used only by some of the system test scripts.
90135446Strhodes#
91135446StrhodesAC_PATH_PROGS(PERL, perl5 perl)
92135446StrhodesAC_SUBST(PERL)
93135446Strhodes
94135446Strhodes#
95135446Strhodes# Special processing of paths depending on whether --prefix,
96135446Strhodes# --sysconfdir or --localstatedir arguments were given.  What's
97135446Strhodes# desired is some compatibility with the way previous versions
98135446Strhodes# of BIND built; they defaulted to /usr/local for most parts of
99135446Strhodes# the installation, but named.boot/named.conf was in /etc
100135446Strhodes# and named.pid was in /var/run.
101135446Strhodes#
102135446Strhodes# So ... if none of --prefix, --sysconfdir or --localstatedir are
103135446Strhodes# specified, set things up that way.  If --prefix is given, use
104135446Strhodes# it for sysconfdir and localstatedir the way configure normally
105135446Strhodes# would.  To change the prefix for everything but leave named.conf
106135446Strhodes# in /etc or named.pid in /var/run, then do this the usual configure way:
107135446Strhodes# ./configure --prefix=/somewhere --sysconfdir=/etc
108135446Strhodes# ./configure --prefix=/somewhere --localstatedir=/var
109135446Strhodes#
110135446Strhodes# To put named.conf and named.pid in /usr/local with everything else,
111135446Strhodes# set the prefix explicitly to /usr/local even though that's the default:
112135446Strhodes# ./configure --prefix=/usr/local
113135446Strhodes#
114135446Strhodescase "$prefix" in
115135446Strhodes        NONE)
116135446Strhodes                case "$sysconfdir" in
117135446Strhodes                        '${prefix}/etc')
118135446Strhodes                                sysconfdir=/etc
119135446Strhodes                                ;;
120135446Strhodes                esac
121135446Strhodes                case "$localstatedir" in
122135446Strhodes                        '${prefix}/var')
123135446Strhodes                                localstatedir=/var
124135446Strhodes                                ;;
125135446Strhodes                esac
126135446Strhodes                ;;
127135446Strhodesesac
128135446Strhodes
129135446Strhodes#
130135446Strhodes# Make sure INSTALL uses an absolute path, else it will be wrong in all
131135446Strhodes# Makefiles, since they use make/rules.in and INSTALL will be adjusted by
132135446Strhodes# configure based on the location of the file where it is substituted.
133135446Strhodes# Since in BIND9 INSTALL is only substituted into make/rules.in, an immediate
134135446Strhodes# subdirectory of install-sh, This relative path will be wrong for all
135135446Strhodes# directories more than one level down from install-sh.
136135446Strhodes#
137135446Strhodescase "$INSTALL" in
138135446Strhodes	/*)
139135446Strhodes                ;;
140135446Strhodes        *)
141135446Strhodes                #
142135446Strhodes                # Not all systems have dirname.
143135446Strhodes                #
144135446Strhodes                changequote({, })
145135446Strhodes                ac_dir="`echo $INSTALL | sed 's%/[^/]*$%%'`"
146135446Strhodes                changequote([, ])
147135446Strhodes
148135446Strhodes                ac_prog="`echo $INSTALL | sed 's%.*/%%'`"
149135446Strhodes                test "$ac_dir" = "$ac_prog" && ac_dir=.
150135446Strhodes                test -d "$ac_dir" && ac_dir="`(cd \"$ac_dir\" && pwd)`"
151135446Strhodes                INSTALL="$ac_dir/$ac_prog"
152135446Strhodes                ;;
153135446Strhodesesac
154135446Strhodes
155135446Strhodes#
156135446Strhodes# On these hosts, we really want to use cc, not gcc, even if it is
157135446Strhodes# found.  The gcc that these systems have will not correctly handle
158135446Strhodes# pthreads.
159135446Strhodes#
160135446Strhodes# However, if the user sets $CC to be something, let that override
161135446Strhodes# our change.
162135446Strhodes#
163135446Strhodesif test "X$CC" = "X" ; then
164135446Strhodes	case "$host" in
165135446Strhodes		*-dec-osf*)
166135446Strhodes			CC="cc"
167135446Strhodes			;;
168135446Strhodes		*-solaris*)
169135446Strhodes                        # Use Sun's cc if it is available, but watch
170135446Strhodes                        # out for /usr/ucb/cc; it will never be the right
171135446Strhodes                        # compiler to use.
172135446Strhodes                        #
173135446Strhodes                        # If setting CC here fails, the AC_PROG_CC done
174135446Strhodes                        # below might still find gcc.
175135446Strhodes			IFS="${IFS=	}"; ac_save_ifs="$IFS"; IFS=":"
176135446Strhodes			for ac_dir in $PATH; do
177135446Strhodes				test -z "$ac_dir" && ac_dir=.
178135446Strhodes				case "$ac_dir" in
179135446Strhodes				/usr/ucb)
180135446Strhodes					# exclude
181135446Strhodes					;;
182135446Strhodes				*)
183135446Strhodes					if test -f "$ac_dir/cc"; then
184135446Strhodes						CC="$ac_dir/cc"
185135446Strhodes						break
186135446Strhodes					fi
187135446Strhodes					;;
188135446Strhodes				esac
189135446Strhodes			done
190135446Strhodes			IFS="$ac_save_ifs"
191135446Strhodes			;;
192135446Strhodes		*-hp-hpux*)
193135446Strhodes			CC="cc"
194135446Strhodes			;;
195135446Strhodes		mips-sgi-irix*)
196135446Strhodes			CC="cc"
197135446Strhodes			;;
198135446Strhodes	esac
199135446Strhodesfi
200135446Strhodes
201135446StrhodesAC_PROG_CC
202135446Strhodes
203135446Strhodes#
204135446Strhodes# gcc's optimiser is broken at -02 for ultrasparc
205135446Strhodes#
206135446Strhodesif test "$ac_env_CFLAGS_set" != set -a "X$GCC" = "Xyes"; then
207135446Strhodes	case "$host" in
208135446Strhodes	sparc-*)
209135446Strhodes		CCFLAGS="-g -O1"
210135446Strhodes		;;
211135446Strhodes	esac
212135446Strhodesfi
213135446Strhodes
214135446Strhodes#
215135446Strhodes# OS dependent CC flags
216135446Strhodes#
217135446Strhodescase "$host" in
218135446Strhodes	# OSF 5.0: recv/send are only avaliable with -D_POSIX_PII_SOCKET or
219135446Strhodes	# -D_XOPEN_SOURCE_EXTENDED.
220135446Strhodes	*-dec-osf*)
221135446Strhodes		STD_CDEFINES="$STD_CDEFINES -D_POSIX_PII_SOCKET"
222135446Strhodes		CPPFLAGS="$CPPFLAGS -D_POSIX_PII_SOCKET"
223135446Strhodes		;;
224135446Strhodes	#HP-UX: need -D_XOPEN_SOURCE_EXTENDED and -lxnet for CMSG macros
225135446Strhodes	*-hp-hpux*)
226135446Strhodes		STD_CDEFINES="$STD_CDEFINES -D_XOPEN_SOURCE_EXTENDED"
227135446Strhodes		CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE_EXTENDED"
228135446Strhodes		LIBS="-lxnet $LIBS"
229135446Strhodes		;;
230135446Strhodes	# Solaris: need -D_XPG4_2 and -D__EXTENSIONS__ for CMSG macros
231135446Strhodes	*-solaris*)
232135446Strhodes		STD_CDEFINES="$STD_CDEFINES -D_XPG4_2 -D__EXTENSIONS__"
233135446Strhodes		CPPFLAGS="$CPPFLAGS -D_XPG4_2 -D__EXTENSIONS__"
234135446Strhodes		;;
235135446Strhodesesac
236135446Strhodes
237135446StrhodesAC_HEADER_STDC
238135446Strhodes
239135446StrhodesAC_CHECK_HEADERS(fcntl.h sys/time.h unistd.h sys/sockio.h sys/select.h sys/param.h sys/sysctl.h net/if6.h,,,
240135446Strhodes[$ac_includes_default
241135446Strhodes#ifdef HAVE_SYS_PARAM_H
242135446Strhodes# include <sys/param.h>
243135446Strhodes#endif
244135446Strhodes])
245135446Strhodes
246135446StrhodesAC_C_CONST
247135446StrhodesAC_C_INLINE
248135446StrhodesAC_CHECK_FUNC(sysctlbyname, AC_DEFINE(HAVE_SYSCTLBYNAME))
249135446Strhodes
250135446Strhodes#
251135446Strhodes# UnixWare 7.1.1 with the feature supplement to the UDK compiler
252135446Strhodes# is reported to not support "static inline" (RT #1212).
253135446Strhodes#
254135446StrhodesAC_MSG_CHECKING(for static inline breakage)
255135446StrhodesAC_TRY_COMPILE(, [
256135446Strhodes		foo1();
257135446Strhodes	}
258135446Strhodes
259135446Strhodes	static inline int foo1() {
260135446Strhodes		return 0;
261135446Strhodes	}
262135446Strhodes
263135446Strhodes	static inline int foo2() {
264135446Strhodes		return foo1();
265135446Strhodes	],
266135446Strhodes	[AC_MSG_RESULT(no)],
267135446Strhodes	[AC_MSG_RESULT(yes)
268135446Strhodes         AC_DEFINE(inline, )])
269135446Strhodes
270135446StrhodesAC_TYPE_SIZE_T
271135446StrhodesAC_CHECK_TYPE(ssize_t, int)
272153816SdougbAC_CHECK_TYPE(uintptr_t,unsigned long)
273143731SdougbAC_CHECK_TYPE(socklen_t,
274143731Sdougb[AC_DEFINE(ISC_SOCKADDR_LEN_T, socklen_t)],
275143731Sdougb[
276143731SdougbAC_TRY_COMPILE(
277143731Sdougb[
278143731Sdougb#include <sys/types.h>
279143731Sdougb#include <sys/socket.h>
280143731Sdougbint getsockname(int, struct sockaddr *, size_t *);
281143731Sdougb],[],
282143731Sdougb[AC_DEFINE(ISC_SOCKADDR_LEN_T, size_t)],
283143731Sdougb[AC_DEFINE(ISC_SOCKADDR_LEN_T, int)])
284143731Sdougb],
285143731Sdougb[
286143731Sdougb#include <sys/types.h>
287143731Sdougb#include <sys/socket.h>
288143731Sdougb])
289143731SdougbAC_SUBST(ISC_SOCKADDR_LEN_T)
290135446StrhodesAC_HEADER_TIME
291135446StrhodesAC_MSG_CHECKING(for long long)
292135446StrhodesAC_TRY_COMPILE([],[long long i = 0; return (0);],
293135446Strhodes	[AC_MSG_RESULT(yes)
294135446Strhodes		ISC_PLATFORM_HAVELONGLONG="#define ISC_PLATFORM_HAVELONGLONG 1"],
295135446Strhodes	[AC_MSG_RESULT(no)
296135446Strhodes		ISC_PLATFORM_HAVELONGLONG="#undef ISC_PLATFORM_HAVELONGLONG"])
297135446StrhodesAC_SUBST(ISC_PLATFORM_HAVELONGLONG)
298135446Strhodes
299135446Strhodes#
300135446Strhodes# check if we have lifconf
301135446Strhodes#
302135446StrhodesAC_MSG_CHECKING(for struct lifconf)
303135446StrhodesAC_TRY_COMPILE([
304135446Strhodes#include <sys/types.h>
305135446Strhodes#include <sys/socket.h>
306135446Strhodes#include <net/if.h>
307135446Strhodes],
308135446Strhodes[
309135446Strhodesstruct lifconf lifconf;
310135446Strhodeslifconf.lifc_len = 0;
311135446Strhodes]
312135446Strhodes,
313135446Strhodes	[AC_MSG_RESULT(yes)
314135446Strhodes		ISC_PLATFORM_HAVELIFCONF="#define ISC_PLATFORM_HAVELIFCONF 1"],
315135446Strhodes	[AC_MSG_RESULT(no)
316135446Strhodes		ISC_PLATFORM_HAVELIFCONF="#undef ISC_PLATFORM_HAVELIFCONF"])
317135446StrhodesAC_SUBST(ISC_PLATFORM_HAVELIFCONF)
318135446Strhodes
319135446Strhodes
320135446Strhodes#
321135446Strhodes# check if we need to #include sys/select.h explicitly
322135446Strhodes#
323135446Strhodescase $ac_cv_header_unistd_h in
324135446Strhodesyes)
325135446StrhodesAC_MSG_CHECKING(if unistd.h or sys/types.h defines fd_set)
326135446StrhodesAC_TRY_COMPILE([
327135446Strhodes#include <sys/types.h> /* Ultrix */
328135446Strhodes#include <unistd.h>],
329135446Strhodes[fd_set read_set; return (0);],
330135446Strhodes	[AC_MSG_RESULT(yes)
331135446Strhodes	 ISC_PLATFORM_NEEDSYSSELECTH="#undef ISC_PLATFORM_NEEDSYSSELECTH"
332135446Strhodes	 LWRES_PLATFORM_NEEDSYSSELECTH="#undef LWRES_PLATFORM_NEEDSYSSELECTH"],
333135446Strhodes	[AC_MSG_RESULT(no)
334135446Strhodes	case $ac_cv_header_sys_select_h in
335135446Strhodes	yes)
336135446Strhodes         ISC_PLATFORM_NEEDSYSSELECTH="#define ISC_PLATFORM_NEEDSYSSELECTH 1"
337135446Strhodes	 LWRES_PLATFORM_NEEDSYSSELECTH="#define LWRES_PLATFORM_NEEDSYSSELECTH 1"
338135446Strhodes		;;
339135446Strhodes	no)
340135446Strhodes		AC_MSG_ERROR([need either working unistd.h or sys/select.h])
341135446Strhodes		;;
342135446Strhodes	esac
343135446Strhodes	])
344135446Strhodes	;;
345135446Strhodesno)
346135446Strhodes	case $ac_cv_header_sys_select_h in
347135446Strhodes	yes)
348135446Strhodes             ISC_PLATFORM_NEEDSYSSELECTH="#define ISC_PLATFORM_NEEDSYSSELECTH 1"
349135446Strhodes	     LWRES_PLATFORM_NEEDSYSSELECTH="#define LWRES_PLATFORM_NEEDSYSSELECTH 1"
350135446Strhodes		;;
351135446Strhodes	no)
352135446Strhodes		AC_MSG_ERROR([need either unistd.h or sys/select.h])
353135446Strhodes		;;
354135446Strhodes	esac
355135446Strhodes	;;
356135446Strhodesesac
357135446StrhodesAC_SUBST(ISC_PLATFORM_NEEDSYSSELECTH)
358135446StrhodesAC_SUBST(LWRES_PLATFORM_NEEDSYSSELECTH)
359135446Strhodes
360135446Strhodes#
361135446Strhodes# Find the machine's endian flavor.
362135446Strhodes#
363135446StrhodesAC_C_BIGENDIAN
364135446Strhodes
365170222Sdougb
366135446Strhodes#
367135446Strhodes# was --with-openssl specified?
368135446Strhodes#
369163976SdougbOPENSSL_WARNING=
370135446StrhodesAC_MSG_CHECKING(for OpenSSL library)
371135446StrhodesAC_ARG_WITH(openssl,
372135446Strhodes[  --with-openssl[=PATH]   Build with OpenSSL [yes|no|path].
373135446Strhodes                          (Required for DNSSEC)],
374135446Strhodes    use_openssl="$withval", use_openssl="auto")
375135446Strhodes
376165071Sdougbopenssldirs="/usr /usr/local /usr/local/ssl /usr/pkg /usr/sfw"
377143731Sdougbif test "$use_openssl" = "auto"
378143731Sdougbthen
379143731Sdougb	for d in $openssldirs
380143731Sdougb	do
381143731Sdougb		if test -f $d/include/openssl/opensslv.h
382143731Sdougb		then
383143731Sdougb			use_openssl=$d
384143731Sdougb			break
385143731Sdougb		fi
386143731Sdougb	done
387143731Sdougbfi
388135446Strhodescase "$use_openssl" in
389135446Strhodes	no)
390135446Strhodes		AC_MSG_RESULT(no)
391135446Strhodes		DST_OPENSSL_INC=""
392135446Strhodes		USE_OPENSSL=""
393135446Strhodes		;;
394143731Sdougb	auto)
395143731Sdougb		DST_OPENSSL_INC=""
396143731Sdougb		USE_OPENSSL=""
397143731Sdougb		AC_MSG_RESULT(not found)
398143731Sdougb		;;
399135446Strhodes	*)
400143731Sdougb		if test "$use_openssl" = "yes"
401135446Strhodes		then
402135446Strhodes		    	# User did not specify a path - guess it
403135446Strhodes			for d in $openssldirs
404135446Strhodes			do
405135446Strhodes				if test -f $d/include/openssl/opensslv.h
406135446Strhodes				then
407135446Strhodes				 	use_openssl=$d
408135446Strhodes					break
409135446Strhodes				fi
410135446Strhodes			done
411135446Strhodes			if test "$use_openssl" = "yes"
412135446Strhodes			then
413135446Strhodes			    	AC_MSG_RESULT(not found)
414135446Strhodes				AC_MSG_ERROR(
415135446Strhodes[OpenSSL was not found in any of $openssldirs; use --with-openssl=/path])
416135446Strhodes			fi
417135446Strhodes		fi
418135446Strhodes		USE_OPENSSL='-DOPENSSL'
419135446Strhodes		if test "$use_openssl" = "/usr"
420135446Strhodes		then
421135446Strhodes			DST_OPENSSL_INC=""
422135446Strhodes			DNS_OPENSSL_LIBS="-lcrypto"
423135446Strhodes		else
424135446Strhodes			DST_OPENSSL_INC="-I$use_openssl/include"
425135446Strhodes			case $host in
426135446Strhodes			*-solaris*)
427135446Strhodes				DNS_OPENSSL_LIBS="-L$use_openssl/lib -R$use_openssl/lib -lcrypto"
428135446Strhodes				;;
429165071Sdougb			*-hp-hpux*)
430165071Sdougb				DNS_OPENSSL_LIBS="-L$use_openssl/lib -Wl,+b: -lcrypto"
431165071Sdougb				;;
432174187Sdougb			*-apple-darwin*)
433174187Sdougb				#
434174187Sdougb				# Apple's ld seaches for serially for dynamic
435174187Sdougb				# then static libraries.  This means you can't
436174187Sdougb				# use -L to override dynamic system libraries
437174187Sdougb				# with static ones when linking.  Instead
438174187Sdougb				# we specify a absolute path.
439174187Sdougb				#
440174187Sdougb				if test -f "$use_openssl/lib/libcrypto.dylib"
441174187Sdougb				then
442174187Sdougb					DNS_OPENSSL_LIBS="-L$use_openssl/lib -lcrypto"
443174187Sdougb				else
444174187Sdougb					DNS_OPENSSL_LIBS="$use_openssl/lib/libcrypto.a"
445174187Sdougb				fi
446174187Sdougb				;;
447135446Strhodes			*)
448135446Strhodes				DNS_OPENSSL_LIBS="-L$use_openssl/lib -lcrypto"
449135446Strhodes				;;
450135446Strhodes			esac
451135446Strhodes		fi
452135446Strhodes		AC_MSG_RESULT(using openssl from $use_openssl/lib and $use_openssl/include)
453135446Strhodes
454135446Strhodes		saved_cflags="$CFLAGS"
455135446Strhodes		saved_libs="$LIBS"
456135446Strhodes		CFLAGS="$CFLAGS $DST_OPENSSL_INC"
457135446Strhodes		LIBS="$LIBS $DNS_OPENSSL_LIBS"
458135446Strhodes		AC_MSG_CHECKING(whether linking with OpenSSL works)
459135446Strhodes		AC_TRY_RUN([
460135446Strhodes#include <openssl/err.h>
461135446Strhodesint main() {
462135446Strhodes	ERR_clear_error();
463135446Strhodes	return (0);
464135446Strhodes}
465135446Strhodes],
466135446Strhodes	        [AC_MSG_RESULT(yes)],
467135446Strhodes		[AC_MSG_RESULT(no)
468135446Strhodes		 AC_MSG_ERROR(Could not run test program using OpenSSL from
469135446Strhodes$use_openssl/lib and $use_openssl/include.
470135446StrhodesPlease check the argument to --with-openssl and your
471135446Strhodesshared library configuration (e.g., LD_LIBRARY_PATH).)],
472135446Strhodes		[AC_MSG_RESULT(assuming it does work on target platform)])
473135446Strhodes
474135446Strhodes		AC_MSG_CHECKING(whether linking with OpenSSL requires -ldl)
475135446Strhodes		AC_TRY_LINK([
476135446Strhodes#include <openssl/err.h>],
477135446Strhodes[ DSO_METHOD_dlfcn(); ],
478135446Strhodes		[AC_MSG_RESULT(no)],
479135446Strhodes		[LIBS="$LIBS -ldl"
480135446Strhodes		AC_TRY_LINK([
481135446Strhodes#include <openssl/err.h>
482135446Strhodes],[ DSO_METHOD_dlfcn(); ],
483135446Strhodes		[AC_MSG_RESULT(yes)
484135446Strhodes		DNS_OPENSSL_LIBS="$DNS_OPENSSL_LIBS -ldl"
485135446Strhodes		],
486135446Strhodes		 [AC_MSG_RESULT(unknown)
487135446Strhodes		 AC_MSG_ERROR(OpenSSL has unsupported dynamic loading)],
488135446Strhodes		[AC_MSG_RESULT(assuming it does work on target platform)])
489135446Strhodes		],
490135446Strhodes		[AC_MSG_RESULT(assuming it does work on target platform)]
491135446Strhodes		)
492135446Strhodes		 
493163976SdougbAC_ARG_ENABLE(openssl-version-check,
494163976Sdougb[AC_HELP_STRING([--enable-openssl-version-check],
495165071Sdougb        [Check OpenSSL Version @<:@default=yes@:>@])])
496163976Sdougbcase "$enable_openssl_version_check" in
497163976Sdougbyes|'')
498135446Strhodes		AC_MSG_CHECKING(OpenSSL library version)
499135446Strhodes		AC_TRY_RUN([
500135446Strhodes#include <stdio.h>
501135446Strhodes#include <openssl/opensslv.h>
502135446Strhodesint main() {
503165071Sdougb        if ((OPENSSL_VERSION_NUMBER >= 0x009070cfL &&
504165071Sdougb	     OPENSSL_VERSION_NUMBER < 0x00908000L) ||
505165071Sdougb	     OPENSSL_VERSION_NUMBER >= 0x0090804fL)
506135446Strhodes                return (0);
507135446Strhodes	printf("\n\nFound   OPENSSL_VERSION_NUMBER %#010x\n",
508135446Strhodes		OPENSSL_VERSION_NUMBER);
509163976Sdougb	printf("Require OPENSSL_VERSION_NUMBER 0x009070cf or greater (0.9.7l)\n"
510163976Sdougb	       "Require OPENSSL_VERSION_NUMBER 0x0090804f or greater (0.9.8d)\n\n");
511135446Strhodes        return (1);
512135446Strhodes}
513163976Sdougb		],
514135446Strhodes	        [AC_MSG_RESULT(ok)],
515135446Strhodes		[AC_MSG_RESULT(not compatible)
516163976Sdougb                 OPENSSL_WARNING=yes
517163976Sdougb		],
518135446Strhodes		[AC_MSG_RESULT(assuming target platform has compatible version)])
519163976Sdougb;;
520163976Sdougbno)
521163976Sdougb	AC_MSG_RESULT(Skipped OpenSSL version check)
522163976Sdougb;;
523163976Sdougbesac
524163976Sdougb
525135446Strhodes		AC_MSG_CHECKING(for OpenSSL DSA support)
526135446Strhodes		if test -f $use_openssl/include/openssl/dsa.h
527135446Strhodes		then
528135446Strhodes			AC_DEFINE(HAVE_OPENSSL_DSA)
529135446Strhodes			AC_MSG_RESULT(yes)
530135446Strhodes		else
531135446Strhodes			AC_MSG_RESULT(no)
532135446Strhodes		fi
533135446Strhodes		CFLAGS="$saved_cflags"
534135446Strhodes		LIBS="$saved_libs"
535135446Strhodes		;;
536135446Strhodesesac
537135446Strhodes
538135446Strhodes#
539135446Strhodes# This would include the system openssl path (and linker options to use
540135446Strhodes# it as needed) if it is found.
541135446Strhodes#
542135446Strhodes
543135446StrhodesAC_SUBST(USE_OPENSSL)
544135446StrhodesAC_SUBST(DST_OPENSSL_INC)
545135446StrhodesDNS_CRYPTO_LIBS="$DNS_CRYPTO_LIBS $DNS_OPENSSL_LIBS"
546135446Strhodes
547135446Strhodes#
548135446Strhodes# was --with-gssapi specified?
549135446Strhodes#
550135446Strhodes#AC_MSG_CHECKING(for GSSAPI library)
551135446Strhodes#AC_ARG_WITH(gssapi,
552135446Strhodes#[  --with-gssapi=PATH   Specify path for system-supplied GSSAPI],
553135446Strhodes#    use_gssapi="$withval", use_gssapi="no")
554135446Strhodes#
555135446Strhodes#case "$use_gssapi" in
556135446Strhodes#	no)
557135446Strhodes#		USE_GSSAPI=''
558135446Strhodes#		DST_GSSAPI_INC=''
559135446Strhodes#		DNS_GSSAPI_LIBS=''
560135446Strhodes#		AC_MSG_RESULT(not specified)
561135446Strhodes#		;;
562135446Strhodes#	yes)
563135446Strhodes#		AC_MSG_ERROR([--with-gssapi must specify a path])
564135446Strhodes#		;;
565135446Strhodes#	*)
566135446Strhodes#		USE_GSSAPI='-DGSSAPI'
567135446Strhodes#		DST_GSSAPI_INC="-I$use_gssapi/include"
568135446Strhodes#		DNS_GSSAPI_LIBS="-L$use_gssapi/lib -lgssapi_krb5"
569135446Strhodes#		AC_MSG_RESULT(using gssapi from $use_gssapi/lib and $use_gssapi/include)
570135446Strhodes#		;;
571135446Strhodes#esac
572135446Strhodes
573135446StrhodesUSE_GSSAPI=''
574135446StrhodesDST_GSSAPI_INC=''
575135446StrhodesDNS_GSSAPI_LIBS=''
576135446Strhodes
577135446StrhodesAC_SUBST(USE_GSSAPI)
578135446StrhodesAC_SUBST(DST_GSSAPI_INC)
579135446StrhodesDNS_CRYPTO_LIBS="$DNS_CRYPTO_LIBS $DNS_GSSAPI_LIBS"
580135446Strhodes
581135446Strhodes#
582135446Strhodes# Applications linking with libdns also need to link with these libraries.
583135446Strhodes#
584135446Strhodes
585135446StrhodesAC_SUBST(DNS_CRYPTO_LIBS)
586135446Strhodes
587135446Strhodes#
588135446Strhodes# was --with-randomdev specified?
589135446Strhodes#
590135446StrhodesAC_MSG_CHECKING(for random device)
591135446StrhodesAC_ARG_WITH(randomdev,
592135446Strhodes[  --with-randomdev=PATH Specify path for random device],
593135446Strhodes    use_randomdev="$withval", use_randomdev="unspec")
594135446Strhodes
595135446Strhodescase "$use_randomdev" in
596135446Strhodes	unspec)
597135446Strhodes		case "$host" in
598135446Strhodes			*-openbsd*)
599135446Strhodes				devrandom=/dev/arandom
600135446Strhodes				;;
601135446Strhodes			*)
602135446Strhodes				devrandom=/dev/random
603135446Strhodes				;;
604135446Strhodes		esac
605135446Strhodes		AC_MSG_RESULT($devrandom)
606135446Strhodes		AC_CHECK_FILE($devrandom,
607135446Strhodes			      AC_DEFINE_UNQUOTED(PATH_RANDOMDEV,
608135446Strhodes						 "$devrandom"),)
609135446Strhodes		;;
610135446Strhodes	yes)
611135446Strhodes		AC_MSG_ERROR([--with-randomdev must specify a path])
612135446Strhodes		;;
613135446Strhodes	no)
614135446Strhodes		AC_MSG_RESULT(disabled)
615135446Strhodes		;;
616135446Strhodes	*)
617135446Strhodes		AC_DEFINE_UNQUOTED(PATH_RANDOMDEV, "$use_randomdev")
618135446Strhodes		AC_MSG_RESULT(using "$use_randomdev")
619135446Strhodes		;;
620135446Strhodesesac
621135446Strhodes
622135446Strhodes#
623135446Strhodes# Do we have arc4random() ?
624135446Strhodes#
625135446StrhodesAC_CHECK_FUNC(arc4random, AC_DEFINE(HAVE_ARC4RANDOM))
626135446Strhodes
627153816Sdougbsinclude(config.threads.in)dnl
628135446Strhodes
629135446Strhodesif $use_threads
630135446Strhodesthen
631165071Sdougb	if test "X$GCC" = "Xyes"; then
632165071Sdougb		case "$host" in
633165071Sdougb		*-freebsd*)
634165071Sdougb			CC="$CC -pthread"
635165071Sdougb			CCOPT="$CCOPT -pthread"
636165071Sdougb			STD_CDEFINES="$STD_CDEFINES -D_THREAD_SAFE"
637165071Sdougb			;;
638165071Sdougb		*-openbsd*)
639165071Sdougb			CC="$CC -pthread"
640165071Sdougb			CCOPT="$CCOPT -pthread"
641165071Sdougb			;;
642165071Sdougb		*-solaris*)
643165071Sdougb			LIBS="$LIBS -lthread"
644165071Sdougb			;;
645165071Sdougb		*-ibm-aix*)
646165071Sdougb			STD_CDEFINES="$STD_CDEFINES -D_THREAD_SAFE"
647165071Sdougb			;;
648165071Sdougb		esac
649165071Sdougb	else
650165071Sdougb		case $host in
651165071Sdougb		*-dec-osf*)
652165071Sdougb			CC="$CC -pthread"
653165071Sdougb			CCOPT="$CCOPT -pthread"
654165071Sdougb			;;
655165071Sdougb		*-solaris*)
656165071Sdougb			CC="$CC -mt"
657165071Sdougb			CCOPT="$CCOPT -mt"
658165071Sdougb			;;
659165071Sdougb		*-ibm-aix*)
660165071Sdougb			STD_CDEFINES="$STD_CDEFINES -D_THREAD_SAFE"
661165071Sdougb			;;
662165071Sdougb		*-sco-sysv*uw*|*-*-sysv*UnixWare*)
663165071Sdougb			CC="$CC -Kthread"
664165071Sdougb			CCOPT="$CCOPT -Kthread"
665165071Sdougb			;;
666165071Sdougb		*-*-sysv*OpenUNIX*)
667165071Sdougb			CC="$CC -Kpthread"
668165071Sdougb			CCOPT="$CCOPT -Kpthread"
669165071Sdougb			;;
670165071Sdougb		esac
671165071Sdougb	fi
672165071Sdougb	ALWAYS_DEFINES="-D_REENTRANT"
673165071Sdougb	ISC_PLATFORM_USETHREADS="#define ISC_PLATFORM_USETHREADS 1"
674165071Sdougb	thread_dir=pthreads
675135446Strhodes	#
676135446Strhodes	# We'd like to use sigwait() too
677135446Strhodes	#
678165071Sdougb	AC_CHECK_FUNC(sigwait,
679165071Sdougb		      AC_DEFINE(HAVE_SIGWAIT),
680165071Sdougb		      AC_CHECK_LIB(c, sigwait,
681165071Sdougb		      AC_DEFINE(HAVE_SIGWAIT),
682165071Sdougb		      AC_CHECK_LIB(pthread, sigwait,
683165071Sdougb				   AC_DEFINE(HAVE_SIGWAIT),
684165071Sdougb				   AC_CHECK_LIB(pthread, _Psigwait,
685165071Sdougb					        AC_DEFINE(HAVE_SIGWAIT),))))
686135446Strhodes
687135446Strhodes	AC_CHECK_FUNC(pthread_attr_getstacksize,
688135446Strhodes		      AC_DEFINE(HAVE_PTHREAD_ATTR_GETSTACKSIZE),)
689135446Strhodes
690135446Strhodes	AC_CHECK_FUNC(pthread_attr_setstacksize,
691135446Strhodes		      AC_DEFINE(HAVE_PTHREAD_ATTR_SETSTACKSIZE),)
692135446Strhodes
693135446Strhodes	#
694135446Strhodes	# Additional OS-specific issues related to pthreads and sigwait.
695135446Strhodes	#
696135446Strhodes	case "$host" in
697135446Strhodes		#
698135446Strhodes		# One more place to look for sigwait.
699135446Strhodes		#
700135446Strhodes		*-freebsd*)
701135446Strhodes			AC_CHECK_LIB(c_r, sigwait, AC_DEFINE(HAVE_SIGWAIT),)
702143731Sdougb			case $host in
703153816Sdougb			*-freebsd5.[[012]]|*-freebsd5.[[012]].*);;
704153816Sdougb			*-freebsd5.[[3456789]]|*-freebsd5.[[3456789]].*)
705143731Sdougb				AC_DEFINE(NEED_PTHREAD_SCOPE_SYSTEM)
706143731Sdougb				;;
707153816Sdougb			*-freebsd6.*)
708153816Sdougb				AC_DEFINE(NEED_PTHREAD_SCOPE_SYSTEM)
709153816Sdougb				;;
710143731Sdougb			esac
711135446Strhodes			;;
712135446Strhodes		#
713135446Strhodes		# BSDI 3.0 through 4.0.1 needs pthread_init() to be
714135446Strhodes		# called before certain pthreads calls.	 This is deprecated
715135446Strhodes		# in BSD/OS 4.1.
716135446Strhodes		#
717135446Strhodes		*-bsdi3.*|*-bsdi4.0*)
718135446Strhodes			AC_DEFINE(NEED_PTHREAD_INIT)
719135446Strhodes			;;
720135446Strhodes		#
721135446Strhodes		# LinuxThreads requires some changes to the way we
722135446Strhodes		# deal with signals.
723135446Strhodes		#
724135446Strhodes		*-linux*)
725135446Strhodes			AC_DEFINE(HAVE_LINUXTHREADS)
726135446Strhodes			;;
727135446Strhodes		#
728135446Strhodes		# Ensure the right sigwait() semantics on Solaris and make
729135446Strhodes		# sure we call pthread_setconcurrency.
730135446Strhodes		#
731135446Strhodes		*-solaris*)
732135446Strhodes			AC_DEFINE(_POSIX_PTHREAD_SEMANTICS)
733135446Strhodes			AC_CHECK_FUNC(pthread_setconcurrency,
734135446Strhodes				      AC_DEFINE(CALL_PTHREAD_SETCONCURRENCY))
735135446Strhodes			;;
736135446Strhodes		#
737135446Strhodes		# UnixWare does things its own way.
738135446Strhodes		#
739135446Strhodes		*-sco-sysv*uw*|*-*-sysv*UnixWare*|*-*-sysv*OpenUNIX*)
740135446Strhodes			AC_DEFINE(HAVE_UNIXWARE_SIGWAIT)
741135446Strhodes			;;
742135446Strhodes	esac
743135446Strhodes
744135446Strhodes	#
745135446Strhodes	# Look for sysconf to allow detection of the number of processors.
746135446Strhodes	#
747135446Strhodes	AC_CHECK_FUNC(sysconf, AC_DEFINE(HAVE_SYSCONF),)
748135446Strhodes
749135446Strhodeselse
750135446Strhodes	ISC_PLATFORM_USETHREADS="#undef ISC_PLATFORM_USETHREADS"
751135446Strhodes	thread_dir=nothreads
752135446Strhodes	ALWAYS_DEFINES=""
753135446Strhodesfi
754135446Strhodes
755135446StrhodesAC_SUBST(ALWAYS_DEFINES)
756135446StrhodesAC_SUBST(ISC_PLATFORM_USETHREADS)
757135446StrhodesISC_THREAD_DIR=$thread_dir
758135446StrhodesAC_SUBST(ISC_THREAD_DIR)
759135446Strhodes
760135446Strhodes#
761135446Strhodes# In solaris 10, SMF can manage named service
762135446Strhodes#
763135446StrhodesAC_CHECK_LIB(scf, smf_enable_instance)
764135446Strhodes
765135446Strhodes#
766135446Strhodes# flockfile is usually provided by pthreads, but we may want to use it
767135446Strhodes# even if compiled with --disable-threads.  getc_unlocked might also not
768135446Strhodes# be defined.
769135446Strhodes#
770135446StrhodesAC_CHECK_FUNC(flockfile, AC_DEFINE(HAVE_FLOCKFILE),)
771135446StrhodesAC_CHECK_FUNC(getc_unlocked, AC_DEFINE(HAVE_GETCUNLOCKED),)
772135446Strhodes
773135446Strhodes# 
774135446Strhodes# Indicate what the final decision was regarding threads.
775135446Strhodes#
776135446StrhodesAC_MSG_CHECKING(whether to build with threads)
777135446Strhodesif $use_threads; then
778135446Strhodes	AC_MSG_RESULT(yes)
779135446Strhodeselse
780135446Strhodes	AC_MSG_RESULT(no)
781135446Strhodesfi
782135446Strhodes
783135446Strhodes# 
784135446Strhodes# End of pthreads stuff.
785135446Strhodes#
786135446Strhodes
787135446Strhodes#
788135446Strhodes# Large File
789135446Strhodes#
790135446StrhodesAC_ARG_ENABLE(largefile, [  --enable-largefile	  64-bit file support],
791135446Strhodes	      want_largefile="yes", want_largefile="no")
792135446Strhodescase $want_largefile in
793135446Strhodes	yes)
794135446Strhodes		ALWAYS_DEFINES="$ALWAYS_DEFINES -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
795135446Strhodes		;;
796135446Strhodes	*)
797135446Strhodes		;;
798135446Strhodesesac
799135446Strhodes
800135446Strhodes#
801135446Strhodes# Additional compiler settings.
802135446Strhodes#
803135446StrhodesMKDEPCC="$CC"
804135446StrhodesMKDEPCFLAGS="-M"
805135446StrhodesIRIX_DNSSEC_WARNINGS_HACK=""
806135446Strhodes
807135446Strhodesif test "X$GCC" = "Xyes"; then
808165071Sdougb	AC_MSG_CHECKING(if "$CC" supports -fno-strict-aliasing)
809165071Sdougb	SAVE_CFLAGS=$CFLAGS
810165071Sdougb	CFLAGS=-fno-strict-aliasing
811165071Sdougb	AC_TRY_COMPILE(,, [FNOSTRICTALIASING=yes],[FNOSTRICTALIASING=no])
812165071Sdougb	CFLAGS=$SAVE_CFLAGS
813165071Sdougb	if test "$FNOSTRICTALIASING" = "yes"; then
814165071Sdougb		AC_MSG_RESULT(yes)
815165071Sdougb	STD_CWARNINGS="$STD_CWARNINGS -W -Wall -Wmissing-prototypes -Wcast-qual -Wwrite-strings -Wformat -Wpointer-arith -fno-strict-aliasing"
816165071Sdougb	else
817165071Sdougb		AC_MSG_RESULT(no)
818165071Sdougb	STD_CWARNINGS="$STD_CWARNINGS -W -Wall -Wmissing-prototypes -Wcast-qual -Wwrite-strings -Wformat -Wpointer-arith"
819165071Sdougb	fi
820143731Sdougb	case "$host" in
821143731Sdougb	*-hp-hpux*)
822153816Sdougb		LDFLAGS="-Wl,+vnocompatwarnings $LDFLAGS"
823143731Sdougb		;;
824143731Sdougb	esac
825135446Strhodeselse
826135446Strhodes	case $host in
827135446Strhodes	*-dec-osf*)
828135446Strhodes		CC="$CC -std"
829135446Strhodes		CCOPT="$CCOPT -std"
830135446Strhodes		MKDEPCC="$CC"
831135446Strhodes		;;
832135446Strhodes	*-hp-hpux*)
833135446Strhodes		CC="$CC -Ae -z"
834135446Strhodes		# The version of the C compiler that constantly warns about
835135446Strhodes                # 'const' as well as alignment issues is unfortunately not
836135446Strhodes                # able to be discerned via the version of the operating
837135446Strhodes                # system, nor does cc have a version flag.
838135446Strhodes		case "`$CC +W 123 2>&1`" in
839135446Strhodes		*Unknown?option*)
840135446Strhodes			STD_CWARNINGS="+w1"
841135446Strhodes			;;
842135446Strhodes		*)
843135446Strhodes			# Turn off the pointlessly noisy warnings.
844153816Sdougb			STD_CWARNINGS="+w1 +W 474,530,2193,2236"
845135446Strhodes			;;
846135446Strhodes		esac
847135446Strhodes		CCOPT="$CCOPT -Ae -z"
848153816Sdougb		LDFLAGS="-Wl,+vnocompatwarnings $LDFLAGS"
849135446Strhodes		MKDEPPROG='cc -Ae -E -Wp,-M >/dev/null 2>>$TMP'
850135446Strhodes		;;
851135446Strhodes	*-sgi-irix*)
852135446Strhodes		STD_CWARNINGS="-fullwarn -woff 1209"
853135446Strhodes		#
854135446Strhodes		# Silence more than 250 instances of
855135446Strhodes		#   "prototyped function redeclared without prototype"
856135446Strhodes		# and 11 instances of
857135446Strhodes		#   "variable ... was set but never used"
858135446Strhodes		# from lib/dns/sec/openssl.
859135446Strhodes		#
860135446Strhodes		IRIX_DNSSEC_WARNINGS_HACK="-woff 1692,1552"
861135446Strhodes		;;
862135446Strhodes	*-solaris*)
863135446Strhodes		MKDEPCFLAGS="-xM"
864135446Strhodes		;;
865135446Strhodes	*-sco-sysv*uw*|*-*-sysv*UnixWare*|*-*-sysv*OpenUNIX*)
866135446Strhodes                # UnixWare
867135446Strhodes		CC="$CC -w"
868135446Strhodes		;;
869135446Strhodes	esac
870135446Strhodesfi
871135446Strhodes
872135446StrhodesAC_SUBST(MKDEPCC)
873135446StrhodesAC_SUBST(MKDEPCFLAGS)
874135446StrhodesAC_SUBST(MKDEPPROG)
875135446StrhodesAC_SUBST(IRIX_DNSSEC_WARNINGS_HACK)
876135446Strhodes
877135446Strhodes#
878135446Strhodes# NLS
879135446Strhodes#
880135446StrhodesAC_CHECK_FUNC(catgets, AC_DEFINE(HAVE_CATGETS),)
881135446Strhodes
882135446Strhodes#
883135446Strhodes# -lxnet buys us one big porting headache...  standards, gotta love 'em.
884135446Strhodes#
885135446Strhodes# AC_CHECK_LIB(xnet, socket, ,
886135446Strhodes#    AC_CHECK_LIB(socket, socket)
887135446Strhodes#    AC_CHECK_LIB(nsl, inet_ntoa)
888135446Strhodes# )
889135446Strhodes#
890135446Strhodes# Use this for now, instead:
891135446Strhodes#
892135446Strhodescase "$host" in
893135446Strhodes	mips-sgi-irix*)
894135446Strhodes		;;
895135446Strhodes	*)
896135446Strhodes		AC_CHECK_LIB(socket, socket)
897135446Strhodes		AC_CHECK_LIB(nsl, inet_ntoa)
898135446Strhodes		;;
899135446Strhodesesac
900135446Strhodes
901135446Strhodes#
902135446Strhodes# Purify support
903135446Strhodes#
904135446StrhodesAC_MSG_CHECKING(whether to use purify)
905135446StrhodesAC_ARG_WITH(purify,
906135446Strhodes	[  --with-purify[=PATH]	use Rational purify],
907135446Strhodes	use_purify="$withval", use_purify="no")
908135446Strhodes
909135446Strhodescase "$use_purify" in
910135446Strhodes	no)
911135446Strhodes		;;
912135446Strhodes	yes)
913135446Strhodes		AC_PATH_PROG(purify_path, purify, purify)
914135446Strhodes		;;
915135446Strhodes	*)
916135446Strhodes		purify_path="$use_purify"
917135446Strhodes		;;
918135446Strhodesesac
919135446Strhodes
920135446Strhodescase "$use_purify" in
921135446Strhodes	no)
922135446Strhodes		AC_MSG_RESULT(no)
923135446Strhodes		PURIFY=""
924135446Strhodes		;;
925135446Strhodes	*)
926135446Strhodes		if test -f $purify_path || test $purify_path = purify; then
927135446Strhodes			AC_MSG_RESULT($purify_path)
928135446Strhodes			PURIFYFLAGS="`echo $PURIFYOPTIONS`"
929135446Strhodes			PURIFY="$purify_path $PURIFYFLAGS"
930135446Strhodes		else
931135446Strhodes			AC_MSG_ERROR([$purify_path not found.
932135446Strhodes
933135446StrhodesPlease choose the proper path with the following command:
934135446Strhodes
935135446Strhodes    configure --with-purify=PATH
936135446Strhodes])
937135446Strhodes		fi
938135446Strhodes		;;
939135446Strhodesesac
940135446Strhodes
941135446StrhodesAC_SUBST(PURIFY)
942135446Strhodes
943135446Strhodes#
944135446Strhodes# GNU libtool support
945135446Strhodes#
946135446StrhodesAC_ARG_WITH(libtool,
947135446Strhodes	    [  --with-libtool	use GNU libtool (following indented options supported)],
948135446Strhodes	    use_libtool="$withval", use_libtool="no")
949135446Strhodes
950135446Strhodescase $use_libtool in
951135446Strhodes	yes)
952135446Strhodes		AM_PROG_LIBTOOL
953135446Strhodes		O=lo
954135446Strhodes		A=la
955135446Strhodes		LIBTOOL_MKDEP_SED='s;\.o;\.lo;'
956135446Strhodes		LIBTOOL_MODE_COMPILE='--mode=compile'
957135446Strhodes		LIBTOOL_MODE_INSTALL='--mode=install'
958135446Strhodes		LIBTOOL_MODE_LINK='--mode=link'
959143731Sdougb		case "$host" in
960143731Sdougb		*) LIBTOOL_ALLOW_UNDEFINED= ;;
961143731Sdougb		esac
962143731Sdougb		case "$host" in
963143731Sdougb		*-ibm-aix*) LIBTOOL_IN_MAIN="-Wl,-bI:T_testlist.imp" ;;
964143731Sdougb		*) LIBTOOL_IN_MAIN= ;;
965143731Sdougb		esac;
966135446Strhodes		;;
967135446Strhodes	*)
968135446Strhodes		O=o
969135446Strhodes		A=a
970135446Strhodes		LIBTOOL=
971135446Strhodes		AC_SUBST(LIBTOOL)
972135446Strhodes		LIBTOOL_MKDEP_SED=
973135446Strhodes		LIBTOOL_MODE_COMPILE=
974135446Strhodes		LIBTOOL_MODE_INSTALL=
975135446Strhodes		LIBTOOL_MODE_LINK=
976143731Sdougb		LIBTOOL_ALLOW_UNDEFINED=
977143731Sdougb		LIBTOOL_IN_MAIN=
978135446Strhodes		;;
979135446Strhodesesac
980135446Strhodes
981135446Strhodes#
982135446Strhodes# File name extension for static archive files, for those few places
983135446Strhodes# where they are treated differently from dynamic ones.
984135446Strhodes#
985135446StrhodesSA=a
986135446Strhodes
987135446StrhodesAC_SUBST(O)
988135446StrhodesAC_SUBST(A)
989135446StrhodesAC_SUBST(SA)
990135446StrhodesAC_SUBST(LIBTOOL_MKDEP_SED)
991135446StrhodesAC_SUBST(LIBTOOL_MODE_COMPILE)
992135446StrhodesAC_SUBST(LIBTOOL_MODE_INSTALL)
993135446StrhodesAC_SUBST(LIBTOOL_MODE_LINK)
994143731SdougbAC_SUBST(LIBTOOL_ALLOW_UNDEFINED)
995143731SdougbAC_SUBST(LIBTOOL_IN_MAIN)
996135446Strhodes
997135446Strhodes#
998135446Strhodes# build libbind?
999135446Strhodes#
1000135446StrhodesAC_ARG_ENABLE(libbind,
1001135446Strhodes	[  --enable-libbind		build libbind [default=no]])
1002135446Strhodes
1003135446Strhodescase "$enable_libbind" in
1004135446Strhodes	yes)
1005135446Strhodes		LIBBIND=lib/bind
1006135446Strhodes		AC_SUBST(LIBBIND)
1007135446Strhodes		;;
1008135446Strhodes	no|'')
1009135446Strhodes		;;
1010135446Strhodesesac
1011135446Strhodes
1012170222Sdougb
1013135446Strhodes#
1014135446Strhodes# Here begins a very long section to determine the system's networking
1015135446Strhodes# capabilities.  The order of the tests is signficant.
1016135446Strhodes#
1017135446Strhodes
1018135446Strhodes#
1019135446Strhodes# IPv6
1020135446Strhodes#
1021135446StrhodesAC_ARG_ENABLE(ipv6,
1022135446Strhodes	[  --enable-ipv6		use IPv6 [default=autodetect]])
1023135446Strhodes
1024135446Strhodescase "$enable_ipv6" in
1025135446Strhodes	yes|''|autodetect)
1026135446Strhodes		AC_DEFINE(WANT_IPV6)
1027135446Strhodes		;;
1028135446Strhodes	no)
1029135446Strhodes		;;
1030135446Strhodesesac
1031135446Strhodes
1032135446Strhodes#
1033135446Strhodes# We do the IPv6 compilation checking after libtool so that we can put
1034135446Strhodes# the right suffix on the files.
1035135446Strhodes#
1036135446StrhodesAC_MSG_CHECKING(for IPv6 structures)
1037135446StrhodesAC_TRY_COMPILE([
1038135446Strhodes#include <sys/types.h>
1039135446Strhodes#include <sys/socket.h>
1040135446Strhodes#include <netinet/in.h>],
1041135446Strhodes[struct sockaddr_in6 sin6; return (0);],
1042135446Strhodes	[AC_MSG_RESULT(yes)
1043135446Strhodes	 found_ipv6=yes],
1044135446Strhodes	[AC_MSG_RESULT(no)
1045135446Strhodes	 found_ipv6=no])
1046135446Strhodes
1047135446Strhodes#
1048135446Strhodes# See whether IPv6 support is provided via a Kame add-on.
1049135446Strhodes# This is done before other IPv6 linking tests to LIBS is properly set.
1050135446Strhodes#
1051135446StrhodesAC_MSG_CHECKING(for Kame IPv6 support)
1052135446StrhodesAC_ARG_WITH(kame,
1053135446Strhodes	[  --with-kame[=PATH]	use Kame IPv6 [default path /usr/local/v6]],
1054135446Strhodes	use_kame="$withval", use_kame="no")
1055135446Strhodes
1056135446Strhodescase "$use_kame" in
1057135446Strhodes	no)
1058135446Strhodes		;;
1059135446Strhodes	yes)
1060135446Strhodes		kame_path=/usr/local/v6
1061135446Strhodes		;;
1062135446Strhodes	*)
1063135446Strhodes		kame_path="$use_kame"
1064135446Strhodes		;;
1065135446Strhodesesac
1066135446Strhodes
1067135446Strhodescase "$use_kame" in
1068135446Strhodes	no)
1069135446Strhodes		AC_MSG_RESULT(no)
1070135446Strhodes		;;
1071135446Strhodes	*)
1072135446Strhodes		if test -f $kame_path/lib/libinet6.a; then
1073135446Strhodes			AC_MSG_RESULT($kame_path/lib/libinet6.a)
1074135446Strhodes			LIBS="-L$kame_path/lib -linet6 $LIBS"
1075135446Strhodes		else
1076135446Strhodes			AC_MSG_ERROR([$kame_path/lib/libinet6.a not found.
1077135446Strhodes
1078135446StrhodesPlease choose the proper path with the following command:
1079135446Strhodes
1080135446Strhodes    configure --with-kame=PATH
1081135446Strhodes])
1082135446Strhodes		fi
1083135446Strhodes		;;
1084135446Strhodesesac
1085135446Strhodes
1086135446Strhodes#
1087135446Strhodes# Whether netinet6/in6.h is needed has to be defined in isc/platform.h.
1088135446Strhodes# Including it on Kame-using platforms is very bad, though, because
1089135446Strhodes# Kame uses #error against direct inclusion.   So include it on only
1090135446Strhodes# the platform that is otherwise broken without it -- BSD/OS 4.0 through 4.1.
1091135446Strhodes# This is done before the in6_pktinfo check because that's what
1092135446Strhodes# netinet6/in6.h is needed for.
1093135446Strhodes#
1094135446Strhodeschangequote({, })
1095135446Strhodescase "$host" in
1096135446Strhodes*-bsdi4.[01]*)
1097135446Strhodes	ISC_PLATFORM_NEEDNETINET6IN6H="#define ISC_PLATFORM_NEEDNETINET6IN6H 1"
1098135446Strhodes	LWRES_PLATFORM_NEEDNETINET6IN6H="#define LWRES_PLATFORM_NEEDNETINET6IN6H 1"
1099135446Strhodes	isc_netinet6in6_hack="#include <netinet6/in6.h>"
1100135446Strhodes	;;
1101135446Strhodes*)
1102135446Strhodes	ISC_PLATFORM_NEEDNETINET6IN6H="#undef ISC_PLATFORM_NEEDNETINET6IN6H"
1103135446Strhodes	LWRES_PLATFORM_NEEDNETINET6IN6H="#undef LWRES_PLATFORM_NEEDNETINET6IN6H"
1104135446Strhodes	isc_netinet6in6_hack=""
1105135446Strhodes	;;
1106135446Strhodesesac
1107135446Strhodeschangequote([, ])
1108135446Strhodes
1109135446Strhodes#
1110135446Strhodes# This is similar to the netinet6/in6.h issue.
1111135446Strhodes#
1112135446Strhodescase "$host" in
1113135446Strhodes*-sco-sysv*uw*|*-*-sysv*UnixWare*|*-*-sysv*OpenUNIX*)
1114135446Strhodes        # UnixWare
1115135446Strhodes	ISC_PLATFORM_NEEDNETINETIN6H="#define ISC_PLATFORM_NEEDNETINETIN6H 1"
1116135446Strhodes	LWRES_PLATFORM_NEEDNETINETIN6H="#define LWRES_PLATFORM_NEEDNETINETIN6H 1"
1117135446Strhodes        ISC_PLATFORM_FIXIN6ISADDR="#define ISC_PLATFORM_FIXIN6ISADDR 1"
1118135446Strhodes	isc_netinetin6_hack="#include <netinet/in6.h>"
1119135446Strhodes	;;
1120135446Strhodes*)
1121135446Strhodes	ISC_PLATFORM_NEEDNETINETIN6H="#undef ISC_PLATFORM_NEEDNETINETIN6H"
1122135446Strhodes	LWRES_PLATFORM_NEEDNETINETIN6H="#undef LWRES_PLATFORM_NEEDNETINETIN6H"
1123135446Strhodes        ISC_PLATFORM_FIXIN6ISADDR="#undef ISC_PLATFORM_FIXIN6ISADDR"
1124135446Strhodes	isc_netinetin6_hack=""
1125135446Strhodes	;;
1126135446Strhodesesac
1127135446Strhodes
1128135446Strhodes#
1129135446Strhodes# Now delve deeper into the suitability of the IPv6 support.
1130135446Strhodes#
1131135446Strhodescase "$found_ipv6" in
1132135446Strhodes	yes)
1133135446Strhodes		ISC_PLATFORM_HAVEIPV6="#define ISC_PLATFORM_HAVEIPV6 1"
1134135446Strhodes		LWRES_PLATFORM_HAVEIPV6="#define LWRES_PLATFORM_HAVEIPV6 1"
1135135446Strhodes
1136135446Strhodes		AC_MSG_CHECKING(for in6_addr)
1137135446Strhodes		AC_TRY_COMPILE([
1138135446Strhodes#include <sys/types.h>
1139135446Strhodes#include <sys/socket.h>
1140135446Strhodes#include <netinet/in.h>
1141135446Strhodes$isc_netinetin6_hack
1142135446Strhodes$isc_netinet6in6_hack
1143135446Strhodes],
1144135446Strhodes[struct in6_addr in6; return (0);],
1145135446Strhodes		[AC_MSG_RESULT(yes)
1146135446Strhodes		 ISC_PLATFORM_HAVEINADDR6="#undef ISC_PLATFORM_HAVEINADDR6"
1147135446Strhodes		 LWRES_PLATFORM_HAVEINADDR6="#undef LWRES_PLATFORM_HAVEINADDR6"
1148135446Strhodes		 isc_in_addr6_hack=""],
1149135446Strhodes		[AC_MSG_RESULT(no)
1150135446Strhodes		 ISC_PLATFORM_HAVEINADDR6="#define ISC_PLATFORM_HAVEINADDR6 1"
1151135446Strhodes		 LWRES_PLATFORM_HAVEINADDR6="#define LWRES_PLATFORM_HAVEINADDR6 1"
1152135446Strhodes		 isc_in_addr6_hack="#define in6_addr in_addr6"])
1153135446Strhodes
1154135446Strhodes		AC_MSG_CHECKING(for in6addr_any)
1155135446Strhodes		AC_TRY_LINK([
1156135446Strhodes#include <sys/types.h>
1157135446Strhodes#include <sys/socket.h>
1158135446Strhodes#include <netinet/in.h>
1159135446Strhodes$isc_netinetin6_hack
1160135446Strhodes$isc_netinet6in6_hack
1161135446Strhodes$isc_in_addr6_hack
1162135446Strhodes],
1163135446Strhodes		[struct in6_addr in6; in6 = in6addr_any; return (in6.s6_addr[0]);],
1164135446Strhodes			[AC_MSG_RESULT(yes)
1165135446Strhodes			 ISC_PLATFORM_NEEDIN6ADDRANY="#undef ISC_PLATFORM_NEEDIN6ADDRANY"
1166135446Strhodes			 LWRES_PLATFORM_NEEDIN6ADDRANY="#undef LWRES_PLATFORM_NEEDIN6ADDRANY"],
1167135446Strhodes			[AC_MSG_RESULT(no)
1168135446Strhodes			 ISC_PLATFORM_NEEDIN6ADDRANY="#define ISC_PLATFORM_NEEDIN6ADDRANY 1"
1169135446Strhodes			 LWRES_PLATFORM_NEEDIN6ADDRANY="#define LWRES_PLATFORM_NEEDIN6ADDRANY 1"])
1170135446Strhodes
1171135446Strhodes		AC_MSG_CHECKING(for in6addr_loopback)
1172135446Strhodes		AC_TRY_LINK([
1173135446Strhodes#include <sys/types.h>
1174135446Strhodes#include <sys/socket.h>
1175135446Strhodes#include <netinet/in.h>
1176135446Strhodes$isc_netinetin6_hack
1177135446Strhodes$isc_netinet6in6_hack
1178135446Strhodes$isc_in_addr6_hack
1179135446Strhodes],
1180135446Strhodes		[struct in6_addr in6; in6 = in6addr_loopback; return (in6.s6_addr[0]);],
1181135446Strhodes			[AC_MSG_RESULT(yes)
1182135446Strhodes			 ISC_PLATFORM_NEEDIN6ADDRLOOPBACK="#undef ISC_PLATFORM_NEEDIN6ADDRLOOPBACK"
1183135446Strhodes			 LWRES_PLATFORM_NEEDIN6ADDRLOOPBACK="#undef LWRES_PLATFORM_NEEDIN6ADDRLOOPBACK"],
1184135446Strhodes			[AC_MSG_RESULT(no)
1185135446Strhodes			 ISC_PLATFORM_NEEDIN6ADDRLOOPBACK="#define ISC_PLATFORM_NEEDIN6ADDRLOOPBACK 1"
1186135446Strhodes			 LWRES_PLATFORM_NEEDIN6ADDRLOOPBACK="#define LWRES_PLATFORM_NEEDIN6ADDRLOOPBACK 1"])
1187135446Strhodes
1188135446Strhodes		AC_MSG_CHECKING(for sin6_scope_id in struct sockaddr_in6)
1189135446Strhodes		AC_TRY_COMPILE([
1190135446Strhodes#include <sys/types.h>
1191135446Strhodes#include <sys/socket.h>
1192135446Strhodes#include <netinet/in.h>
1193135446Strhodes$isc_netinetin6_hack
1194135446Strhodes$isc_netinet6in6_hack
1195135446Strhodes],
1196135446Strhodes		[struct sockaddr_in6 xyzzy; xyzzy.sin6_scope_id = 0; return (0);],
1197135446Strhodes			[AC_MSG_RESULT(yes)
1198135446Strhodes			 ISC_PLATFORM_HAVESCOPEID="#define ISC_PLATFORM_HAVESCOPEID 1"
1199135446Strhodes			 result="#define LWRES_HAVE_SIN6_SCOPE_ID 1"],
1200135446Strhodes			[AC_MSG_RESULT(no)
1201135446Strhodes			 ISC_PLATFORM_HAVESCOPEID="#undef ISC_PLATFORM_HAVESCOPEID"
1202135446Strhodes			 result="#undef LWRES_HAVE_SIN6_SCOPE_ID"])
1203135446Strhodes		LWRES_HAVE_SIN6_SCOPE_ID="$result"
1204135446Strhodes
1205135446Strhodes		AC_MSG_CHECKING(for in6_pktinfo)
1206135446Strhodes		AC_TRY_COMPILE([
1207135446Strhodes#include <sys/types.h>
1208135446Strhodes#include <sys/socket.h>
1209135446Strhodes#include <netinet/in.h>
1210135446Strhodes$isc_netinetin6_hack
1211135446Strhodes$isc_netinet6in6_hack
1212135446Strhodes],
1213135446Strhodes		[struct in6_pktinfo xyzzy; return (0);],
1214135446Strhodes			[AC_MSG_RESULT(yes)
1215135446Strhodes			 ISC_PLATFORM_HAVEIN6PKTINFO="#define ISC_PLATFORM_HAVEIN6PKTINFO 1"],
1216135446Strhodes			[AC_MSG_RESULT(no -- disabling runtime ipv6 support)
1217135446Strhodes			 ISC_PLATFORM_HAVEIN6PKTINFO="#undef ISC_PLATFORM_HAVEIN6PKTINFO"])
1218135446Strhodes		;;
1219135446Strhodes	no)
1220135446Strhodes		ISC_PLATFORM_HAVEIPV6="#undef ISC_PLATFORM_HAVEIPV6"
1221135446Strhodes		LWRES_PLATFORM_HAVEIPV6="#undef LWRES_PLATFORM_HAVEIPV6"
1222135446Strhodes		ISC_PLATFORM_NEEDIN6ADDRANY="#undef ISC_PLATFORM_NEEDIN6ADDRANY"
1223135446Strhodes		LWRES_PLATFORM_NEEDIN6ADDRANY="#undef LWRES_PLATFORM_NEEDIN6ADDRANY"
1224135446Strhodes		ISC_PLATFORM_HAVEIN6PKTINFO="#undef ISC_PLATFORM_HAVEIN6PKTINFO"
1225135446Strhodes		LWRES_HAVE_SIN6_SCOPE_ID="#define LWRES_HAVE_SIN6_SCOPE_ID 1"
1226135446Strhodes		ISC_PLATFORM_HAVESCOPEID="#define ISC_PLATFORM_HAVESCOPEID 1"
1227135446Strhodes		ISC_IPV6_H="ipv6.h"
1228135446Strhodes		ISC_IPV6_O="ipv6.$O"
1229135446Strhodes		ISC_ISCIPV6_O="unix/ipv6.$O"
1230135446Strhodes		ISC_IPV6_C="ipv6.c"
1231135446Strhodes		;;
1232135446Strhodesesac
1233135446Strhodes
1234135446StrhodesAC_SUBST(ISC_PLATFORM_HAVEIPV6)
1235135446StrhodesAC_SUBST(LWRES_PLATFORM_HAVEIPV6)
1236135446StrhodesAC_SUBST(ISC_PLATFORM_NEEDNETINETIN6H)
1237135446StrhodesAC_SUBST(LWRES_PLATFORM_NEEDNETINETIN6H)
1238135446StrhodesAC_SUBST(ISC_PLATFORM_NEEDNETINET6IN6H)
1239135446StrhodesAC_SUBST(LWRES_PLATFORM_NEEDNETINET6IN6H)
1240135446StrhodesAC_SUBST(ISC_PLATFORM_HAVEINADDR6)
1241135446StrhodesAC_SUBST(LWRES_PLATFORM_HAVEINADDR6)
1242135446StrhodesAC_SUBST(ISC_PLATFORM_NEEDIN6ADDRANY)
1243135446StrhodesAC_SUBST(LWRES_PLATFORM_NEEDIN6ADDRANY)
1244135446StrhodesAC_SUBST(ISC_PLATFORM_NEEDIN6ADDRLOOPBACK)
1245135446StrhodesAC_SUBST(LWRES_PLATFORM_NEEDIN6ADDRLOOPBACK)
1246135446StrhodesAC_SUBST(ISC_PLATFORM_HAVEIN6PKTINFO)
1247135446StrhodesAC_SUBST(ISC_PLATFORM_FIXIN6ISADDR)
1248135446StrhodesAC_SUBST(ISC_IPV6_H)
1249135446StrhodesAC_SUBST(ISC_IPV6_O)
1250135446StrhodesAC_SUBST(ISC_ISCIPV6_O)
1251135446StrhodesAC_SUBST(ISC_IPV6_C)
1252135446StrhodesAC_SUBST(LWRES_HAVE_SIN6_SCOPE_ID)
1253135446StrhodesAC_SUBST(ISC_PLATFORM_HAVESCOPEID)
1254135446Strhodes
1255135446StrhodesAC_MSG_CHECKING([for struct if_laddrreq])
1256135446StrhodesAC_TRY_LINK([
1257135446Strhodes#include <sys/types.h>
1258135446Strhodes#include <net/if6.h>
1259135446Strhodes],[ struct if_laddrreq a; ],
1260135446Strhodes	[AC_MSG_RESULT(yes)
1261135446Strhodes	ISC_PLATFORM_HAVEIF_LADDRREQ="#define ISC_PLATFORM_HAVEIF_LADDRREQ 1"],
1262135446Strhodes	[AC_MSG_RESULT(no)
1263135446Strhodes	ISC_PLATFORM_HAVEIF_LADDRREQ="#undef ISC_PLATFORM_HAVEIF_LADDRREQ"])
1264135446StrhodesAC_SUBST(ISC_PLATFORM_HAVEIF_LADDRREQ)
1265135446Strhodes
1266135446StrhodesAC_MSG_CHECKING([for struct if_laddrconf])
1267135446StrhodesAC_TRY_LINK([
1268135446Strhodes#include <sys/types.h>
1269135446Strhodes#include <net/if6.h>
1270135446Strhodes],[ struct if_laddrconf a; ],
1271135446Strhodes	[AC_MSG_RESULT(yes)
1272135446Strhodes	ISC_PLATFORM_HAVEIF_LADDRCONF="#define ISC_PLATFORM_HAVEIF_LADDRCONF 1"],
1273135446Strhodes	[AC_MSG_RESULT(no)
1274135446Strhodes	ISC_PLATFORM_HAVEIF_LADDRCONF="#undef ISC_PLATFORM_HAVEIF_LADDRCONF"])
1275135446StrhodesAC_SUBST(ISC_PLATFORM_HAVEIF_LADDRCONF)
1276135446Strhodes
1277135446Strhodes#
1278135446Strhodes# Check for network functions that are often missing.  We do this
1279135446Strhodes# after the libtool checking, so we can put the right suffix on
1280135446Strhodes# the files.  It also needs to come after checking for a Kame add-on,
1281135446Strhodes# which provides some (all?) of the desired functions.
1282135446Strhodes#
1283135446Strhodes
1284135446StrhodesAC_MSG_CHECKING([for inet_ntop with IPv6 support])
1285135446StrhodesAC_TRY_RUN([
1286135446Strhodes#include <sys/types.h>
1287135446Strhodes#include <sys/socket.h>
1288135446Strhodes#include <netinet/in.h>
1289135446Strhodes#include <arpa/inet.h>
1290135446Strhodesmain() {
1291135446Strhodeschar a[16],b[64]; return(inet_ntop(AF_INET6, a, b, sizeof(b)) == (char*)0);}],
1292135446Strhodes        [AC_MSG_RESULT(yes)
1293135446Strhodes        ISC_PLATFORM_NEEDNTOP="#undef ISC_PLATFORM_NEEDNTOP"],
1294135446Strhodes
1295135446Strhodes        [AC_MSG_RESULT(no)
1296135446Strhodes        ISC_EXTRA_OBJS="$ISC_EXTRA_OBJS inet_ntop.$O"
1297135446Strhodes        ISC_EXTRA_SRCS="$ISC_EXTRA_SRCS inet_ntop.c"
1298153816Sdougb        ISC_PLATFORM_NEEDNTOP="#define ISC_PLATFORM_NEEDNTOP 1"],
1299153816Sdougb        [AC_MSG_RESULT(assuming inet_ntop needed)
1300153816Sdougb        ISC_EXTRA_OBJS="$ISC_EXTRA_OBJS inet_ntop.$O"
1301153816Sdougb        ISC_EXTRA_SRCS="$ISC_EXTRA_SRCS inet_ntop.c"
1302135446Strhodes        ISC_PLATFORM_NEEDNTOP="#define ISC_PLATFORM_NEEDNTOP 1"])
1303135446Strhodes
1304135446Strhodes
1305135446Strhodes# On NetBSD 1.4.2 and maybe others, inet_pton() incorrectly accepts
1306135446Strhodes# addresses with less than four octets, like "1.2.3".  Also leading
1307135446Strhodes# zeros should also be rejected.
1308135446Strhodes
1309135446StrhodesAC_MSG_CHECKING([for working inet_pton with IPv6 support])
1310135446StrhodesAC_TRY_RUN([
1311135446Strhodes#include <sys/types.h>
1312135446Strhodes#include <sys/socket.h>
1313135446Strhodes#include <netinet/in.h>
1314135446Strhodes#include <arpa/inet.h>
1315135446Strhodesmain() { char a[16]; return (inet_pton(AF_INET, "1.2.3", a) == 1 ? 1 :
1316135446Strhodes			     inet_pton(AF_INET, "1.2.3.04", a) == 1 ? 1 : 
1317135446Strhodes			     (inet_pton(AF_INET6, "::1.2.3.4", a) != 1)); }],
1318135446Strhodes        [AC_MSG_RESULT(yes)
1319135446Strhodes        ISC_PLATFORM_NEEDPTON="#undef ISC_PLATFORM_NEEDPTON"],
1320135446Strhodes        [AC_MSG_RESULT(no)
1321135446Strhodes        ISC_EXTRA_OBJS="$ISC_EXTRA_OBJS inet_pton.$O"
1322135446Strhodes        ISC_EXTRA_SRCS="$ISC_EXTRA_SRCS inet_pton.c"
1323135446Strhodes        ISC_PLATFORM_NEEDPTON="#define ISC_PLATFORM_NEEDPTON 1"],
1324135446Strhodes	[AC_MSG_RESULT(assuming target platform has working inet_pton)
1325153816Sdougb	ISC_PLATFORM_NEEDPTON="#undef ISC_PLATFORM_NEEDPTON"],
1326153816Sdougb        [AC_MSG_RESULT(assuming inet_pton needed)
1327153816Sdougb        ISC_EXTRA_OBJS="$ISC_EXTRA_OBJS inet_pton.$O"
1328153816Sdougb        ISC_EXTRA_SRCS="$ISC_EXTRA_SRCS inet_pton.c"
1329153816Sdougb        ISC_PLATFORM_NEEDPTON="#define ISC_PLATFORM_NEEDPTON 1"],
1330153816Sdougb        [AC_MSG_RESULT(assuming target platform has working inet_pton)
1331153816Sdougb        ISC_PLATFORM_NEEDPTON="#undef ISC_PLATFORM_NEEDPTON"])
1332135446Strhodes
1333135446StrhodesAC_MSG_CHECKING([for inet_aton])
1334135446StrhodesAC_TRY_LINK([
1335135446Strhodes#include <sys/types.h>
1336135446Strhodes#include <netinet/in.h>
1337135446Strhodes#include <arpa/inet.h>],
1338135446Strhodes        [struct in_addr in; inet_aton(0, &in); return (0);],
1339135446Strhodes        [AC_MSG_RESULT(yes)
1340135446Strhodes        ISC_PLATFORM_NEEDATON="#undef ISC_PLATFORM_NEEDATON"],
1341135446Strhodes
1342135446Strhodes        [AC_MSG_RESULT(no)
1343135446Strhodes        ISC_EXTRA_OBJS="$ISC_EXTRA_OBJS inet_aton.$O"
1344135446Strhodes        ISC_EXTRA_SRCS="$ISC_EXTRA_SRCS inet_aton.c"
1345135446Strhodes        ISC_PLATFORM_NEEDATON="#define ISC_PLATFORM_NEEDATON 1"])
1346135446Strhodes
1347135446StrhodesAC_SUBST(ISC_PLATFORM_NEEDNTOP)
1348135446StrhodesAC_SUBST(ISC_PLATFORM_NEEDPTON)
1349135446StrhodesAC_SUBST(ISC_PLATFORM_NEEDATON)
1350135446Strhodes
1351135446Strhodes#
1352135446Strhodes# Look for a 4.4BSD-style sa_len member in struct sockaddr.
1353135446Strhodes#
1354135446Strhodescase "$host" in
1355135446Strhodes	*-dec-osf*)
1356135446Strhodes		# Turn on 4.4BSD style sa_len support.
1357135446Strhodes		AC_DEFINE(_SOCKADDR_LEN)
1358135446Strhodes		;;
1359135446Strhodesesac
1360135446Strhodes
1361135446StrhodesAC_MSG_CHECKING(for sa_len in struct sockaddr)
1362135446StrhodesAC_TRY_COMPILE([
1363135446Strhodes#include <sys/types.h>
1364135446Strhodes#include <sys/socket.h>],
1365135446Strhodes[struct sockaddr sa; sa.sa_len = 0; return (0);],
1366135446Strhodes	[AC_MSG_RESULT(yes)
1367135446Strhodes	ISC_PLATFORM_HAVESALEN="#define ISC_PLATFORM_HAVESALEN 1"
1368135446Strhodes	LWRES_PLATFORM_HAVESALEN="#define LWRES_PLATFORM_HAVESALEN 1"],
1369135446Strhodes	[AC_MSG_RESULT(no)
1370135446Strhodes	ISC_PLATFORM_HAVESALEN="#undef ISC_PLATFORM_HAVESALEN"
1371135446Strhodes	LWRES_PLATFORM_HAVESALEN="#undef LWRES_PLATFORM_HAVESALEN"])
1372135446StrhodesAC_SUBST(ISC_PLATFORM_HAVESALEN)
1373135446StrhodesAC_SUBST(LWRES_PLATFORM_HAVESALEN)
1374135446Strhodes
1375135446Strhodes#
1376135446Strhodes# Look for a 4.4BSD or 4.3BSD struct msghdr
1377135446Strhodes#
1378135446StrhodesAC_MSG_CHECKING(for struct msghdr flavor)
1379135446StrhodesAC_TRY_COMPILE([
1380135446Strhodes#include <sys/types.h>
1381135446Strhodes#include <sys/socket.h>],
1382135446Strhodes[struct msghdr msg; msg.msg_flags = 0; return (0);],
1383135446Strhodes	[AC_MSG_RESULT(4.4BSD)
1384135446Strhodes	ISC_PLATFORM_MSGHDRFLAVOR="#define ISC_NET_BSD44MSGHDR 1"],
1385135446Strhodes	[AC_MSG_RESULT(4.3BSD)
1386135446Strhodes	ISC_PLATFORM_MSGHDRFLAVOR="#define ISC_NET_BSD43MSGHDR 1"])
1387135446StrhodesAC_SUBST(ISC_PLATFORM_MSGHDRFLAVOR)
1388135446Strhodes
1389135446Strhodes#
1390135446Strhodes# Look for in_port_t.
1391135446Strhodes#
1392135446StrhodesAC_MSG_CHECKING(for type in_port_t)
1393135446StrhodesAC_TRY_COMPILE([
1394135446Strhodes#include <sys/types.h>
1395135446Strhodes#include <netinet/in.h>],
1396135446Strhodes[in_port_t port = 25; return (0);],
1397135446Strhodes	[AC_MSG_RESULT(yes)
1398135446Strhodes	ISC_PLATFORM_NEEDPORTT="#undef ISC_PLATFORM_NEEDPORTT"],
1399135446Strhodes        [AC_MSG_RESULT(no)
1400135446Strhodes	ISC_PLATFORM_NEEDPORTT="#define ISC_PLATFORM_NEEDPORTT 1"])
1401135446StrhodesAC_SUBST(ISC_PLATFORM_NEEDPORTT)
1402135446Strhodes
1403135446Strhodes#
1404135446Strhodes# Check for addrinfo
1405135446Strhodes#
1406135446StrhodesAC_MSG_CHECKING(for struct addrinfo)
1407135446StrhodesAC_TRY_COMPILE([
1408135446Strhodes#include <netdb.h>],
1409135446Strhodes[struct addrinfo a; return (0);],
1410135446Strhodes	[AC_MSG_RESULT(yes)
1411135446Strhodes	ISC_LWRES_NEEDADDRINFO="#undef ISC_LWRES_NEEDADDRINFO"
1412135446Strhodes	AC_DEFINE(HAVE_ADDRINFO)],
1413135446Strhodes	[AC_MSG_RESULT(no)
1414135446Strhodes	ISC_LWRES_NEEDADDRINFO="#define ISC_LWRES_NEEDADDRINFO 1"])
1415135446StrhodesAC_SUBST(ISC_LWRES_NEEDADDRINFO)
1416135446Strhodes
1417135446Strhodes#
1418135446Strhodes# Check for rrsetinfo
1419135446Strhodes#
1420135446StrhodesAC_MSG_CHECKING(for struct rrsetinfo)
1421135446StrhodesAC_TRY_COMPILE([
1422135446Strhodes#include <netdb.h>],
1423135446Strhodes[struct rrsetinfo r; return (0);],
1424135446Strhodes	[AC_MSG_RESULT(yes)
1425135446Strhodes	ISC_LWRES_NEEDRRSETINFO="#undef ISC_LWRES_NEEDRRSETINFO"],
1426135446Strhodes	[AC_MSG_RESULT(no)
1427135446Strhodes	ISC_LWRES_NEEDRRSETINFO="#define ISC_LWRES_NEEDRRSETINFO 1"])
1428135446StrhodesAC_SUBST(ISC_LWRES_NEEDRRSETINFO)
1429135446Strhodes
1430135446StrhodesAC_MSG_CHECKING(for int sethostent)
1431135446StrhodesAC_TRY_COMPILE([
1432135446Strhodes#include <netdb.h>],
1433135446Strhodes[int i = sethostent(0); return(0);],
1434135446Strhodes	[AC_MSG_RESULT(yes)
1435135446Strhodes	ISC_LWRES_SETHOSTENTINT="#define ISC_LWRES_SETHOSTENTINT 1"],
1436135446Strhodes	[AC_MSG_RESULT(no)
1437135446Strhodes	ISC_LWRES_SETHOSTENTINT="#undef ISC_LWRES_SETHOSTENTINT"])
1438135446StrhodesAC_SUBST(ISC_LWRES_SETHOSTENTINT)
1439135446Strhodes
1440135446StrhodesAC_MSG_CHECKING(for int endhostent)
1441135446StrhodesAC_TRY_COMPILE([
1442135446Strhodes#include <netdb.h>],
1443135446Strhodes[int i = endhostent(); return(0);],
1444135446Strhodes	[AC_MSG_RESULT(yes)
1445135446Strhodes	ISC_LWRES_ENDHOSTENTINT="#define ISC_LWRES_ENDHOSTENTINT 1"],
1446135446Strhodes	[AC_MSG_RESULT(no)
1447135446Strhodes	ISC_LWRES_ENDHOSTENTINT="#undef ISC_LWRES_ENDHOSTENTINT"])
1448135446StrhodesAC_SUBST(ISC_LWRES_ENDHOSTENTINT)
1449135446Strhodes
1450135446StrhodesAC_MSG_CHECKING(for getnetbyaddr(in_addr_t, ...))
1451135446StrhodesAC_TRY_COMPILE([
1452135446Strhodes#include <netdb.h>
1453135446Strhodesstruct netent *getnetbyaddr(in_addr_t, int);],
1454135446Strhodes[],
1455135446Strhodes	[AC_MSG_RESULT(yes)
1456135446Strhodes	ISC_LWRES_GETNETBYADDRINADDR="#define ISC_LWRES_GETNETBYADDRINADDR 1"],
1457135446Strhodes	[AC_MSG_RESULT(no)
1458135446Strhodes	ISC_LWRES_GETNETBYADDRINADDR="#undef ISC_LWRES_GETNETBYADDRINADDR"])
1459135446StrhodesAC_SUBST(ISC_LWRES_GETNETBYADDRINADDR)
1460135446Strhodes
1461135446StrhodesAC_MSG_CHECKING(for int setnetent)
1462135446StrhodesAC_TRY_COMPILE([
1463135446Strhodes#include <netdb.h>],
1464135446Strhodes[int i = setnetent(0); return(0);],
1465135446Strhodes	[AC_MSG_RESULT(yes)
1466135446Strhodes	ISC_LWRES_SETNETENTINT="#define ISC_LWRES_SETNETENTINT 1"],
1467135446Strhodes	[AC_MSG_RESULT(no)
1468135446Strhodes	ISC_LWRES_SETNETENTINT="#undef ISC_LWRES_SETNETENTINT"])
1469135446StrhodesAC_SUBST(ISC_LWRES_SETNETENTINT)
1470135446Strhodes
1471135446StrhodesAC_MSG_CHECKING(for int endnetent)
1472135446StrhodesAC_TRY_COMPILE([
1473135446Strhodes#include <netdb.h>],
1474135446Strhodes[int i = endnetent(); return(0);],
1475135446Strhodes	[AC_MSG_RESULT(yes)
1476135446Strhodes	ISC_LWRES_ENDNETENTINT="#define ISC_LWRES_ENDNETENTINT 1"],
1477135446Strhodes	[AC_MSG_RESULT(no)
1478135446Strhodes	ISC_LWRES_ENDNETENTINT="#undef ISC_LWRES_ENDNETENTINT"])
1479135446StrhodesAC_SUBST(ISC_LWRES_ENDNETENTINT)
1480135446Strhodes
1481135446StrhodesAC_MSG_CHECKING(for gethostbyaddr(const void *, size_t, ...))
1482135446StrhodesAC_TRY_COMPILE([
1483135446Strhodes#include <netdb.h>
1484135446Strhodesstruct hostent *gethostbyaddr(const void *, size_t, int);],
1485135446Strhodes[return(0);],
1486135446Strhodes	[AC_MSG_RESULT(yes)
1487135446Strhodes	ISC_LWRES_GETHOSTBYADDRVOID="#define ISC_LWRES_GETHOSTBYADDRVOID 1"],
1488135446Strhodes	[AC_MSG_RESULT(no)
1489135446Strhodes	ISC_LWRES_GETHOSTBYADDRVOID="#undef ISC_LWRES_GETHOSTBYADDRVOID"])
1490135446StrhodesAC_SUBST(ISC_LWRES_GETHOSTBYADDRVOID)
1491135446Strhodes
1492135446StrhodesAC_MSG_CHECKING(for h_errno in netdb.h)
1493135446StrhodesAC_TRY_COMPILE([
1494135446Strhodes#include <netdb.h>],
1495135446Strhodes[h_errno = 1; return(0);],
1496135446Strhodes	[AC_MSG_RESULT(yes)
1497135446Strhodes	ISC_LWRES_NEEDHERRNO="#undef ISC_LWRES_NEEDHERRNO"],
1498135446Strhodes	[AC_MSG_RESULT(no)
1499135446Strhodes	ISC_LWRES_NEEDHERRNO="#define ISC_LWRES_NEEDHERRNO 1"])
1500135446StrhodesAC_SUBST(ISC_LWRES_NEEDHERRNO)
1501135446Strhodes
1502135446StrhodesAC_CHECK_FUNC(getipnodebyname,
1503135446Strhodes        [ISC_LWRES_GETIPNODEPROTO="#undef ISC_LWRES_GETIPNODEPROTO"],
1504135446Strhodes        [ISC_LWRES_GETIPNODEPROTO="#define ISC_LWRES_GETIPNODEPROTO 1"])
1505135446StrhodesAC_CHECK_FUNC(getnameinfo,
1506135446Strhodes        [ISC_LWRES_GETNAMEINFOPROTO="#undef ISC_LWRES_GETNAMEINFOPROTO"],
1507135446Strhodes        [ISC_LWRES_GETNAMEINFOPROTO="#define ISC_LWRES_GETNAMEINFOPROTO 1"])
1508135446StrhodesAC_CHECK_FUNC(getaddrinfo,
1509135446Strhodes        [ISC_LWRES_GETADDRINFOPROTO="#undef ISC_LWRES_GETADDRINFOPROTO"
1510135446Strhodes	AC_DEFINE(HAVE_GETADDRINFO)],
1511135446Strhodes        [ISC_LWRES_GETADDRINFOPROTO="#define ISC_LWRES_GETADDRINFOPROTO 1"])
1512135446StrhodesAC_CHECK_FUNC(gai_strerror, AC_DEFINE(HAVE_GAISTRERROR))
1513135446StrhodesAC_SUBST(ISC_LWRES_GETIPNODEPROTO)
1514135446StrhodesAC_SUBST(ISC_LWRES_GETADDRINFOPROTO)
1515135446StrhodesAC_SUBST(ISC_LWRES_GETNAMEINFOPROTO)
1516135446Strhodes
1517135446StrhodesAC_ARG_ENABLE(getifaddrs,
1518135446Strhodes[  --enable-getifaddrs    Enable the use of getifaddrs() [[yes|no|glibc]].
1519135446Strhodes             glibc: Use getifaddrs() in glibc if you know it supports IPv6.],
1520135446Strhodes    want_getifaddrs="$enableval",  want_getifaddrs="yes")
1521135446Strhodes
1522135446Strhodescase $want_getifaddrs in
1523135446Strhodesyes|glibc)
1524135446Strhodes#
1525135446Strhodes# Do we have getifaddrs() ?
1526135446Strhodes#
1527135446Strhodescase $host in
1528135446Strhodes*-linux*)
1529135446Strhodes	# Some recent versions of glibc support getifaddrs() which does not
1530135446Strhodes	# provide AF_INET6 addresses while the function provided by the USAGI
1531135446Strhodes	# project handles the AF_INET6 case correctly.  We need to avoid
1532135446Strhodes	# using the former but prefer the latter unless overridden by
1533135446Strhodes	# --enable-getifaddrs=glibc.
1534143731Sdougb	if test $want_getifaddrs = glibc
1535135446Strhodes	then
1536135446Strhodes		AC_CHECK_FUNC(getifaddrs, AC_DEFINE(HAVE_GETIFADDRS))
1537135446Strhodes	else
1538135446Strhodes		save_LIBS="$LIBS"
1539135446Strhodes		LIBS="-L/usr/local/v6/lib $LIBS"
1540135446Strhodes		AC_CHECK_LIB(inet6, getifaddrs,
1541135446Strhodes			LIBS="$LIBS -linet6"
1542135446Strhodes			AC_DEFINE(HAVE_GETIFADDRS),
1543135446Strhodes			LIBS=${save_LIBS})
1544135446Strhodes	fi
1545135446Strhodes	;;
1546135446Strhodes*)
1547135446Strhodes	AC_CHECK_FUNC(getifaddrs, AC_DEFINE(HAVE_GETIFADDRS))
1548135446Strhodes	;;
1549135446Strhodesesac
1550135446Strhodes;;
1551135446Strhodesno)
1552135446Strhodes;;
1553135446Strhodesesac
1554135446Strhodes
1555135446Strhodes#
1556135446Strhodes# Look for a sysctl call to get the list of network interfaces.
1557135446Strhodes#
1558135446Strhodescase $ac_cv_header_sys_sysctl_h in
1559135446Strhodesyes)
1560135446StrhodesAC_MSG_CHECKING(for interface list sysctl)
1561135446StrhodesAC_EGREP_CPP(found_rt_iflist, [
1562135446Strhodes#include <sys/param.h>
1563135446Strhodes#include <sys/sysctl.h>
1564135446Strhodes#include <sys/socket.h>
1565135446Strhodes#ifdef NET_RT_IFLIST
1566135446Strhodesfound_rt_iflist
1567135446Strhodes#endif
1568135446Strhodes],
1569135446Strhodes	[AC_MSG_RESULT(yes)
1570135446Strhodes	 AC_DEFINE(HAVE_IFLIST_SYSCTL)],
1571135446Strhodes	[AC_MSG_RESULT(no)])
1572135446Strhodes;;
1573135446Strhodesesac
1574135446Strhodes
1575135446Strhodes#
1576135446Strhodes# Check for some other useful functions that are not ever-present.
1577135446Strhodes#
1578135446Strhodes
1579135446Strhodes# We test for strsep() using AC_TRY_LINK instead of AC_CHECK_FUNC
1580135446Strhodes# because AIX 4.3.3 with patches for bos.adt.include to version 4.3.3.77
1581135446Strhodes# reportedly defines strsep() without declaring it in <string.h> when
1582135446Strhodes# -D_LINUX_SOURCE_COMPAT is not defined [RT #2190], and
1583135446Strhodes# AC_CHECK_FUNC() incorrectly succeeds because it declares
1584135446Strhodes# the function itself.
1585135446StrhodesAC_MSG_CHECKING(for correctly declared strsep())
1586135446StrhodesAC_TRY_LINK([#include <string.h>], [char *sp; char *foo = strsep(&sp, ".");],
1587135446Strhodes	[AC_MSG_RESULT(yes); ISC_PLATFORM_NEEDSTRSEP="#undef ISC_PLATFORM_NEEDSTRSEP"],
1588135446Strhodes	[AC_MSG_RESULT(no); ISC_PLATFORM_NEEDSTRSEP="#define ISC_PLATFORM_NEEDSTRSEP 1"])
1589135446StrhodesAC_SUBST(ISC_PLATFORM_NEEDSTRSEP)
1590135446Strhodes
1591135446StrhodesAC_CHECK_FUNC(memmove,
1592135446Strhodes	[ISC_PLATFORM_NEEDMEMMOVE="#undef ISC_PLATFORM_NEEDMEMMOVE"],
1593135446Strhodes	[ISC_PLATFORM_NEEDMEMMOVE="#define ISC_PLATFORM_NEEDMEMMOVE 1"])
1594135446StrhodesAC_SUBST(ISC_PLATFORM_NEEDMEMMOVE)
1595135446Strhodes
1596135446StrhodesAC_CHECK_FUNC(strtoul,
1597153816Sdougb	[ISC_PLATFORM_NEEDSTRTOUL="#undef ISC_PLATFORM_NEEDSTRTOUL"
1598165071Sdougb	 LWRES_PLATFORM_NEEDSTRTOUL="#undef LWRES_PLATFORM_NEEDSTRTOUL"
1599153816Sdougb	 GENRANDOMLIB=""],
1600153816Sdougb	[ISC_PLATFORM_NEEDSTRTOUL="#define ISC_PLATFORM_NEEDSTRTOUL 1"
1601165071Sdougb	 LWRES_PLATFORM_NEEDSTRTOUL="#define LWRES_PLATFORM_NEEDSTRTOUL 1"
1602165071Sdougb	 GENRANDOMLIB='${ISCLIBS}'])
1603135446StrhodesAC_SUBST(ISC_PLATFORM_NEEDSTRTOUL)
1604153816SdougbAC_SUBST(LWRES_PLATFORM_NEEDSTRTOUL)
1605153816SdougbAC_SUBST(GENRANDOMLIB)
1606135446Strhodes
1607135446StrhodesAC_CHECK_FUNC(strlcpy,
1608135446Strhodes	[ISC_PLATFORM_NEEDSTRLCPY="#undef ISC_PLATFORM_NEEDSTRLCPY"],
1609135446Strhodes	[ISC_PLATFORM_NEEDSTRLCPY="#define ISC_PLATFORM_NEEDSTRLCPY 1"])
1610135446StrhodesAC_SUBST(ISC_PLATFORM_NEEDSTRLCPY)
1611135446Strhodes
1612135446StrhodesAC_CHECK_FUNC(strlcat,
1613135446Strhodes	[ISC_PLATFORM_NEEDSTRLCAT="#undef ISC_PLATFORM_NEEDSTRLCAT"],
1614135446Strhodes	[ISC_PLATFORM_NEEDSTRLCAT="#define ISC_PLATFORM_NEEDSTRLCAT 1"])
1615135446StrhodesAC_SUBST(ISC_PLATFORM_NEEDSTRLCAT)
1616135446Strhodes
1617135446StrhodesISC_PRINT_OBJS=
1618135446StrhodesISC_PRINT_SRCS=
1619135446StrhodesAC_MSG_CHECKING(sprintf)
1620135446StrhodesAC_TRY_COMPILE([
1621135446Strhodes#include <stdio.h>
1622135446Strhodes],
1623135446Strhodes[ char buf[2]; return(*sprintf(buf,"x"));],
1624135446Strhodes[
1625135446StrhodesISC_PRINT_OBJS="print.$O"
1626135446StrhodesISC_PRINT_SRCS="print.c"
1627135446StrhodesISC_PLATFORM_NEEDSPRINTF="#define ISC_PLATFORM_NEEDSPRINTF"
1628135446StrhodesLWRES_PLATFORM_NEEDSPRINTF="#define LWRES_PLATFORM_NEEDSPRINTF"
1629135446Strhodes],
1630135446Strhodes[ISC_PLATFORM_NEEDSPRINTF="#undef ISC_PLATFORM_NEEDSPRINTF"
1631135446Strhodes LWRES_PLATFORM_NEEDSPRINTF="#undef LWRES_PLATFORM_NEEDSPRINTF"]
1632135446Strhodes)
1633135446StrhodesAC_SUBST(ISC_PLATFORM_NEEDSPRINTF)
1634135446StrhodesAC_SUBST(LWRES_PLATFORM_NEEDSPRINTF)
1635135446Strhodes
1636135446StrhodesAC_CHECK_FUNC(vsnprintf,
1637135446Strhodes	[ISC_PLATFORM_NEEDVSNPRINTF="#undef ISC_PLATFORM_NEEDVSNPRINTF"
1638135446Strhodes	 LWRES_PLATFORM_NEEDVSNPRINTF="#undef LWRES_PLATFORM_NEEDVSNPRINTF"],
1639135446Strhodes	[ISC_PRINT_OBJS="print.$O"
1640135446Strhodes	 ISC_PRINT_SRCS="print.c"
1641135446Strhodes	 ISC_PLATFORM_NEEDVSNPRINTF="#define ISC_PLATFORM_NEEDVSNPRINTF 1"
1642135446Strhodes	 LWRES_PLATFORM_NEEDVSNPRINTF="#define LWRES_PLATFORM_NEEDVSNPRINTF 1"])
1643135446StrhodesAC_SUBST(ISC_PLATFORM_NEEDVSNPRINTF)
1644135446StrhodesAC_SUBST(LWRES_PLATFORM_NEEDVSNPRINTF)
1645135446StrhodesISC_EXTRA_OBJS="$ISC_EXTRA_OBJS $ISC_PRINT_OBJS"
1646135446StrhodesISC_EXTRA_SRCS="$ISC_EXTRA_SRCS $ISC_PRINT_SRCS"
1647135446Strhodes
1648135446StrhodesAC_CHECK_FUNC(strerror, AC_DEFINE(HAVE_STRERROR))
1649135446Strhodes
1650135446StrhodesAC_SUBST(ISC_EXTRA_OBJS)
1651135446StrhodesAC_SUBST(ISC_EXTRA_SRCS)
1652135446Strhodes
1653135446Strhodes# Determine the printf format characters to use when printing
1654135446Strhodes# values of type isc_int64_t. This will normally be "ll", but where
1655135446Strhodes# the compiler treats "long long" as a alias for "long" and printf
1656135446Strhodes# doesn't know about "long long" use "l".  Hopefully the sprintf
1657135446Strhodes# will produce a inconsistant result in the later case.  If the compiler
1658135446Strhodes# fails due to seeing "%lld" we fall back to "l".
1659135446Strhodes#
1660153816Sdougb# Digital Unix 4.0 (gcc?) (long long) is 64 bits as is its long. It uses
1661153816Sdougb# %ld even for (long long)/
1662153816Sdougb#
1663135446Strhodes# Win32 uses "%I64d", but that's defined elsewhere since we don't use
1664135446Strhodes# configure on Win32.
1665135446Strhodes#
1666135446StrhodesAC_MSG_CHECKING(printf format modifier for 64-bit integers)
1667135446StrhodesAC_TRY_RUN([
1668135446Strhodes#include <stdio.h>
1669135446Strhodesmain() {
1670135446Strhodes	long long int j = 0;
1671135446Strhodes	char buf[100];
1672135446Strhodes	buf[0] = 0;
1673135446Strhodes	sprintf(buf, "%lld", j);
1674135446Strhodes	exit((sizeof(long long int) != sizeof(long int))? 0 :
1675135446Strhodes	     (strcmp(buf, "0") != 0));
1676135446Strhodes} 
1677135446Strhodes],
1678135446Strhodes	[AC_MSG_RESULT(ll)
1679153816Sdougb	ISC_PLATFORM_QUADFORMAT='#define ISC_PLATFORM_QUADFORMAT "ll"'
1680153816Sdougb	LWRES_PLATFORM_QUADFORMAT='#define LWRES_PLATFORM_QUADFORMAT "ll"'],
1681135446Strhodes	[AC_MSG_RESULT(l)
1682153816Sdougb	ISC_PLATFORM_QUADFORMAT='#define ISC_PLATFORM_QUADFORMAT "l"'
1683153816Sdougb	LWRES_PLATFORM_QUADFORMAT='#define LWRES_PLATFORM_QUADFORMAT "l"'],
1684135446Strhodes	[AC_MSG_RESULT(assuming target platform uses ll)
1685153816Sdougb	ISC_PLATFORM_QUADFORMAT='#define ISC_PLATFORM_QUADFORMAT "ll"'
1686153816Sdougb	LWRES_PLATFORM_QUADFORMAT='#define LWRES_PLATFORM_QUADFORMAT "ll"'])
1687135446StrhodesAC_SUBST(ISC_PLATFORM_QUADFORMAT)
1688153816SdougbAC_SUBST(LWRES_PLATFORM_QUADFORMAT)
1689135446Strhodes
1690135446Strhodes#
1691135446Strhodes# Security Stuff
1692135446Strhodes#
1693135446StrhodesAC_CHECK_FUNC(chroot, AC_DEFINE(HAVE_CHROOT))
1694135446StrhodesAC_ARG_ENABLE(linux-caps,
1695135446Strhodes	[  --disable-linux-caps	disable linux capabilities])
1696135446Strhodescase "$enable_linux_caps" in
1697135446Strhodes	yes|'')
1698135446Strhodes		AC_CHECK_HEADERS(linux/capability.h)
1699135446Strhodes		;;
1700135446Strhodes	no)
1701135446Strhodes		;;
1702135446Strhodesesac
1703135446StrhodesAC_CHECK_HEADERS(sys/prctl.h)
1704135446Strhodes
1705170222SdougbAC_CHECK_HEADERS(sys/un.h,
1706170222SdougbISC_PLATFORM_HAVESYSUNH="#define ISC_PLATFORM_HAVESYSUNH 1"
1707170222Sdougb,
1708170222SdougbISC_PLATFORM_HAVESYSUNH="#undef ISC_PLATFORM_HAVESYSUNH"
1709170222Sdougb)
1710170222SdougbAC_SUBST(ISC_PLATFORM_HAVESYSUNH)
1711170222Sdougb
1712170222Sdougbcase "$host" in
1713170222Sdougb*-solaris*)
1714170222Sdougb	AC_DEFINE(NEED_SECURE_DIRECTORY, 1,
1715170222Sdougb		  [Define if connect does not honour the permission on the UNIX domain socket.])
1716170222Sdougb	;;
1717170222Sdougb*-sunos*)
1718170222Sdougb	AC_DEFINE(NEED_SECURE_DIRECTORY, 1,
1719170222Sdougb		  [Define if connect does not honour the permission on the UNIX domain socket.])
1720170222Sdougb	;;
1721170222Sdougbesac
1722170222Sdougb
1723135446Strhodes#
1724135446Strhodes# Time Zone Stuff
1725135446Strhodes#
1726135446StrhodesAC_CHECK_FUNC(tzset, AC_DEFINE(HAVE_TZSET))
1727135446Strhodes
1728153816SdougbAC_MSG_CHECKING(for optarg decarartion)
1729153816SdougbAC_TRY_COMPILE([
1730153816Sdougb#include <unistd.h>
1731153816Sdougb],
1732153816Sdougb[optarg = 0;],
1733153816Sdougb[AC_MSG_RESULT(yes)],
1734153816Sdougb[AC_MSG_RESULT(no)
1735165071SdougbGEN_NEED_OPTARG="-DNEED_OPTARG=1"
1736153816SdougbAC_DEFINE(NEED_OPTARG, 1, [Defined if extern char *optarg is not declared.])])
1737153816Sdougb
1738135446Strhodes#
1739135446Strhodes# BSD/OS, and perhaps some others, don't define rlim_t.
1740135446Strhodes#
1741135446StrhodesAC_MSG_CHECKING(for type rlim_t)
1742135446StrhodesAC_TRY_COMPILE([
1743135446Strhodes#include <sys/types.h>
1744135446Strhodes#include <sys/time.h>
1745135446Strhodes#include <sys/resource.h>],
1746135446Strhodes[rlim_t rl = 19671212; return (0);],
1747135446Strhodes[AC_MSG_RESULT(yes)
1748135446Strhodes ISC_PLATFORM_RLIMITTYPE="#define ISC_PLATFORM_RLIMITTYPE rlim_t"],
1749135446Strhodes[AC_MSG_RESULT(no)
1750135446Strhodes
1751135446StrhodesAC_MSG_CHECKING(type of rlim_cur)
1752135446StrhodesAC_TRY_RUN([
1753135446Strhodes#include <sys/types.h>
1754135446Strhodes#include <sys/time.h>
1755135446Strhodes#include <sys/resource.h>
1756135446Strhodesmain() { struct rlimit r; exit(!(sizeof(r.rlim_cur) == sizeof(int)));}],
1757135446Strhodes[AC_MSG_RESULT(int)
1758135446StrhodesISC_PLATFORM_RLIMITTYPE="#define ISC_PLATFORM_RLIMITTYPE int"],
1759135446Strhodes[
1760135446StrhodesAC_TRY_RUN([
1761135446Strhodes#include <sys/types.h>
1762135446Strhodes#include <sys/time.h>
1763135446Strhodes#include <sys/resource.h>
1764135446Strhodesmain() { struct rlimit r; exit(!(sizeof(r.rlim_cur) == sizeof(long int)));}],
1765135446Strhodes[AC_MSG_RESULT(long int)
1766135446StrhodesISC_PLATFORM_RLIMITTYPE="#define ISC_PLATFORM_RLIMITTYPE long int"],
1767135446Strhodes[
1768135446StrhodesAC_TRY_RUN([
1769135446Strhodes#include <sys/types.h>
1770135446Strhodes#include <sys/time.h>
1771135446Strhodes#include <sys/resource.h>
1772135446Strhodesmain() { struct rlimit r; exit((!sizeof(r.rlim_cur) == sizeof(long long int)));}],
1773135446Strhodes[AC_MSG_RESULT(long long int)
1774135446StrhodesISC_PLATFORM_RLIMITTYPE="#define ISC_PLATFORM_RLIMITTYPE long long int"],
1775135446Strhodes[AC_MSG_ERROR([unable to determine sizeof rlim_cur])
1776135446Strhodes],[AC_MSG_ERROR(this cannot happen)])
1777135446Strhodes],[AC_MSG_ERROR(this cannot happen)])
1778153816Sdougb],[
1779153816SdougbISC_PLATFORM_RLIMITTYPE="#define ISC_PLATFORM_RLIMITTYPE long long int"
1780153816SdougbAC_MSG_RESULT(cannot determine type of rlim_cur when cross compiling - assuming long long int)])
1781135446Strhodes])
1782135446StrhodesAC_SUBST(ISC_PLATFORM_RLIMITTYPE)
1783135446Strhodes
1784135446Strhodes#
1785135446Strhodes# Compaq TruCluster requires more code for handling cluster IP aliases
1786135446Strhodes#
1787135446Strhodescase "$host" in
1788135446Strhodes	*-dec-osf*)
1789135446Strhodes		AC_CHECK_LIB(clua, clua_getaliasaddress, LIBS="-lclua $LIBS")
1790135446Strhodes		AC_CHECK_FUNC(clua_getaliasaddress,
1791135446Strhodes				AC_DEFINE(HAVE_TRUCLUSTER, 1,
1792135446Strhodes					[Define if running under Compaq TruCluster]))
1793135446Strhodes		;;
1794135446Strhodes	*)
1795135446Strhodes		;;
1796135446Strhodesesac
1797135446Strhodes
1798135446Strhodes#
1799165071Sdougb# Some hosts need msg_namelen to match the size of the socket structure.
1800165071Sdougb# Some hosts don't set msg_namelen appropriately on return from recvmsg().
1801165071Sdougb#
1802165071Sdougbcase $host in
1803165071Sdougb*os2*|*hp-mpeix*)
1804165071Sdougb	AC_DEFINE(BROKEN_RECVMSG, 1,
1805165071Sdougb		  [Define if recvmsg() does not meet all of the BSD socket API specifications.])
1806165071Sdougb	;;
1807165071Sdougbesac
1808165071Sdougb
1809165071Sdougb#
1810135446Strhodes# Microsoft has their own way of handling shared libraries that requires
1811135446Strhodes# additional qualifiers on extern variables.  Unix systems don't need it.
1812135446Strhodes#
1813135446StrhodesAC_SUBST(ISC_PLATFORM_USEDECLSPEC)
1814135446StrhodesISC_PLATFORM_USEDECLSPEC="#undef ISC_PLATFORM_USEDECLSPEC"
1815135446StrhodesAC_SUBST(LWRES_PLATFORM_USEDECLSPEC)
1816135446StrhodesLWRES_PLATFORM_USEDECLSPEC="#undef LWRES_PLATFORM_USEDECLSPEC"
1817135446Strhodes
1818135446Strhodes#
1819135446Strhodes# Random remaining OS-specific issues involving compiler warnings.
1820135446Strhodes# XXXDCL print messages to indicate some compensation is being done?
1821135446Strhodes#
1822135446StrhodesAC_SUBST(ISC_PLATFORM_BRACEPTHREADONCEINIT)
1823135446StrhodesISC_PLATFORM_BRACEPTHREADONCEINIT="#undef ISC_PLATFORM_BRACEPTHREADONCEINIT"
1824135446Strhodes
1825135446Strhodescase "$host" in
1826165071Sdougb	*-aix5.[[123]].*)
1827143731Sdougb		hack_shutup_pthreadonceinit=yes
1828143731Sdougb		;;
1829135446Strhodes	*-bsdi3.1*)
1830135446Strhodes		hack_shutup_sputaux=yes
1831135446Strhodes		;;
1832135446Strhodes	*-bsdi4.0*)
1833135446Strhodes		hack_shutup_sigwait=yes
1834135446Strhodes		hack_shutup_sputaux=yes
1835135446Strhodes		;;
1836135446Strhodes	[*-bsdi4.[12]*])
1837135446Strhodes		hack_shutup_stdargcast=yes
1838135446Strhodes		;;
1839135446Strhodes	[*-solaris2.[89]])
1840135446Strhodes		hack_shutup_pthreadonceinit=yes
1841135446Strhodes		;;
1842165071Sdougb	*-solaris2.10)
1843165071Sdougb		hack_shutup_pthreadonceinit=yes
1844165071Sdougb		;;
1845135446Strhodesesac
1846135446Strhodes
1847135446Strhodescase "$hack_shutup_pthreadonceinit" in
1848135446Strhodes	yes)
1849135446Strhodes		#
1850135446Strhodes		# Shut up PTHREAD_ONCE_INIT unbraced initializer warnings.
1851135446Strhodes		#
1852135446Strhodes		ISC_PLATFORM_BRACEPTHREADONCEINIT="#define ISC_PLATFORM_BRACEPTHREADONCEINIT 1"
1853135446Strhodes		;;
1854135446Strhodesesac
1855135446Strhodes
1856135446Strhodescase "$hack_shutup_sigwait" in
1857135446Strhodes	yes)
1858135446Strhodes		#
1859135446Strhodes		# Shut up a -Wmissing-prototypes warning for sigwait().
1860135446Strhodes		#
1861135446Strhodes		AC_DEFINE(SHUTUP_SIGWAIT)
1862135446Strhodes		;;
1863135446Strhodesesac
1864135446Strhodes
1865135446Strhodescase "$hack_shutup_sputaux" in
1866135446Strhodes	yes)
1867135446Strhodes		#
1868135446Strhodes		# Shut up a -Wmissing-prototypes warning from <stdio.h>.
1869135446Strhodes		#
1870135446Strhodes		AC_DEFINE(SHUTUP_SPUTAUX)
1871135446Strhodes		;;
1872135446Strhodesesac
1873135446Strhodes
1874135446Strhodescase "$hack_shutup_stdargcast" in
1875135446Strhodes	yes)
1876135446Strhodes		#
1877135446Strhodes		# Shut up a -Wcast-qual warning from va_start().
1878135446Strhodes		#
1879135446Strhodes		AC_DEFINE(SHUTUP_STDARG_CAST)
1880135446Strhodes		;;
1881135446Strhodesesac
1882135446Strhodes
1883174187SdougbAC_CHECK_HEADERS(strings.h,
1884174187Sdougb  ISC_PLATFORM_HAVESTRINGSH="#define ISC_PLATFORM_HAVESTRINGSH 1"
1885174187Sdougb,
1886174187Sdougb  ISC_PLATFORM_HAVESTRINGSH="#undef ISC_PLATFORM_HAVESTRINGSH"
1887174187Sdougb)
1888174187SdougbAC_SUBST(ISC_PLATFORM_HAVESTRINGSH)
1889174187Sdougb
1890135446Strhodes#
1891135446Strhodes# Check for if_nametoindex() for IPv6 scoped addresses support
1892135446Strhodes#
1893135446StrhodesAC_CHECK_FUNC(if_nametoindex, ac_cv_have_if_nametoindex=yes,
1894135446Strhodes		ac_cv_have_if_nametoindex=no)
1895135446Strhodescase $ac_cv_have_if_nametoindex in
1896135446Strhodesno)
1897135446Strhodes	case "$host" in
1898135446Strhodes  	*-hp-hpux*)
1899135446Strhodes  		AC_CHECK_LIB(ipv6, if_nametoindex,
1900135446Strhodes				ac_cv_have_if_nametoindex=yes
1901135446Strhodes				LIBS="-lipv6 $LIBS",)
1902135446Strhodes  	;;
1903135446Strhodes	esac
1904135446Strhodesesac
1905135446Strhodescase $ac_cv_have_if_nametoindex in
1906135446Strhodesyes)
1907135446Strhodes	ISC_PLATFORM_HAVEIFNAMETOINDEX="#define ISC_PLATFORM_HAVEIFNAMETOINDEX 1"
1908135446Strhodes	;;
1909135446Strhodes*)
1910135446Strhodes	ISC_PLATFORM_HAVEIFNAMETOINDEX="#undef ISC_PLATFORM_HAVEIFNAMETOINDEX"
1911135446Strhodes	;;
1912135446Strhodesesac
1913135446StrhodesAC_SUBST(ISC_PLATFORM_HAVEIFNAMETOINDEX)
1914135446Strhodes
1915135446Strhodes#
1916170222Sdougb# Machine architecture dependent features
1917170222Sdougb#
1918170222SdougbAC_ARG_ENABLE(atomic,
1919170222Sdougb	[  --enable-atomic	enable machine specific atomic operations
1920170222Sdougb                        [[default=autodetect]]],
1921170222Sdougb			enable_atomic="$enableval",
1922170222Sdougb			enable_atomic="autodetect")
1923170222Sdougbcase "$enable_atomic" in
1924170222Sdougb	yes|''|autodetect)
1925170222Sdougb		use_atomic=yes
1926170222Sdougb		;;
1927170222Sdougb	no)
1928170222Sdougb		use_atomic=no
1929170222Sdougb		arch=noatomic
1930170222Sdougb		;;
1931170222Sdougbesac
1932170222Sdougb
1933170222SdougbISC_PLATFORM_USEOSFASM="#undef ISC_PLATFORM_USEOSFASM"
1934170222Sdougbif test "$use_atomic" = "yes"; then
1935170222Sdougb	AC_MSG_CHECKING([architecture type for atomic operations])
1936170222Sdougb	have_atomic=yes		# set default
1937170222Sdougb	case "$host" in
1938170222Sdougb	[i[3456]86-*])
1939170222Sdougb		# XXX: some old x86 architectures actually do not support
1940170222Sdougb		#      (some of) these operations.  Do we need stricter checks?
1941170222SdougbAC_TRY_RUN([
1942170222Sdougbmain() {
1943170222Sdougb	exit((sizeof(void *) == 8) ? 0 : 1);
1944170222Sdougb}
1945170222Sdougb],
1946170222Sdougb		[arch=x86_64],
1947170222Sdougb		[arch=x86_32],
1948170222Sdougb	        [arch=x86_32])
1949170222Sdougb	;;
1950170222Sdougb	x86_64-*)
1951170222Sdougb		arch=x86_64
1952170222Sdougb	;;
1953170222Sdougb	alpha*-*)
1954170222Sdougb		arch=alpha
1955170222Sdougb	;;
1956170222Sdougb	powerpc-*)
1957170222Sdougb		arch=powerpc
1958170222Sdougb	;;
1959170222Sdougb	mips-*|mipsel-*|mips64-*|mips64el-*)
1960170222Sdougb		arch=mips
1961170222Sdougb	;;
1962170222Sdougb	ia64-*)
1963170222Sdougb		arch=ia64
1964170222Sdougb	;;
1965170222Sdougb	*)
1966170222Sdougb		have_atomic=no
1967170222Sdougb		arch=noatomic
1968170222Sdougb	;;
1969170222Sdougb	esac
1970170222Sdougb	AC_MSG_RESULT($arch)
1971170222Sdougbfi
1972170222Sdougb
1973170222Sdougbif test "$have_atomic" = "yes"; then
1974170222Sdougb	AC_MSG_CHECKING([compiler support for inline assembly code])
1975170222Sdougb
1976170222Sdougb	compiler=generic
1977170222Sdougb	# Check whether the compiler supports the assembly syntax we provide.
1978170222Sdougb	if test "X$GCC" = "Xyes"; then
1979170222Sdougb		# GCC's ASM extension always works
1980170222Sdougb		compiler=gcc
1981170222Sdougb		if test $arch = "x86_64"; then
1982170222Sdougb			# We can share the same code for gcc with x86_32
1983170222Sdougb			arch=x86_32
1984170222Sdougb		fi
1985170222Sdougb		if test $arch = "powerpc"; then
1986170222Sdougb			#
1987170222Sdougb			# The MacOS (and maybe others) uses "r0" for register
1988170222Sdougb			# zero. Under linux/ibm it is "0" for register 0.
1989170222Sdougb			# Probe to see if we have a MacOS style assembler.
1990170222Sdougb			#
1991170222Sdougb			AC_MSG_CHECKING([Checking for MacOS style assembler syntax])
1992170222Sdougb			AC_TRY_COMPILE(, [
1993170222Sdougb			__asm__ volatile ("li r0, 0x0\n"::);
1994170222Sdougb			], [
1995170222Sdougb			AC_MSG_RESULT(yes)
1996170222Sdougb			compiler="mac"
1997170222Sdougb			ISC_PLATFORM_USEMACASM="#define ISC_PLATFORM_USEMACASM 1"
1998170222Sdougb			], [AC_MSG_RESULT(no)])
1999170222Sdougb		fi
2000170222Sdougb	else
2001170222Sdougb		case "$host" in
2002170222Sdougb		alpha*-dec-osf*)
2003170222Sdougb			# Tru64 compiler has its own syntax for inline 
2004170222Sdougb			# assembly.
2005170222Sdougb			AC_TRY_COMPILE(, [
2006170222Sdougb#ifndef __DECC
2007170222Sdougb#error "unexpected compiler"
2008170222Sdougb#endif
2009170222Sdougb				return (0);],
2010170222Sdougb				[compiler=osf],)
2011170222Sdougb		;;
2012170222Sdougb		powerpc-ibm-aix*)
2013170222Sdougb			compiler=aix
2014170222Sdougb		;;
2015170222Sdougb		esac
2016170222Sdougb	fi
2017170222Sdougb	case "$compiler" in
2018170222Sdougb	gcc)
2019170222Sdougb		ISC_PLATFORM_USEGCCASM="#define ISC_PLATFORM_USEGCCASM 1"
2020170222Sdougb		;;
2021170222Sdougb	osf)
2022170222Sdougb		ISC_PLATFORM_USEOSFASM="#define ISC_PLATFORM_USEOSFASM 1"
2023170222Sdougb		;;
2024170222Sdougb	aix)
2025170222Sdougb		;;
2026170222Sdougb	mac)
2027170222Sdougb		;;
2028170222Sdougb	*)
2029170222Sdougb		# See if the generic __asm function works.  If not,
2030170222Sdougb		# we need to disable the atomic operations.
2031170222Sdougb		AC_TRY_LINK(, [
2032170222Sdougb					__asm("nop")
2033170222Sdougb				],
2034170222Sdougb		[compiler="standard"
2035170222Sdougb		ISC_PLATFORM_USESTDASM="#define ISC_PLATFORM_USESTDASM 1"],
2036170222Sdougb		[compiler="not supported (atomic operations disabled)"
2037170222Sdougb		have_atomic=no
2038170222Sdougb		arch=noatomic ]);
2039170222Sdougb		;;
2040170222Sdougb	esac
2041170222Sdougb
2042170222Sdougb	AC_MSG_RESULT($compiler)
2043170222Sdougbfi
2044170222Sdougb
2045170222Sdougbif test "$have_atomic" = "yes"; then
2046170222Sdougb	ISC_PLATFORM_HAVEXADD="#define ISC_PLATFORM_HAVEXADD 1"
2047170222Sdougb	ISC_PLATFORM_HAVECMPXCHG="#define ISC_PLATFORM_HAVECMPXCHG 1"
2048170222Sdougb	ISC_PLATFORM_HAVEATOMICSTORE="#define ISC_PLATFORM_HAVEATOMICSTORE 1"
2049170222Sdougbelse
2050170222Sdougb	ISC_PLATFORM_HAVEXADD="#undef ISC_PLATFORM_HAVEXADD"
2051170222Sdougb	ISC_PLATFORM_HAVECMPXCHG="#undef ISC_PLATFORM_HAVECMPXCHG"
2052170222Sdougb	ISC_PLATFORM_HAVEATOMICSTORE="#undef ISC_PLATFORM_HAVEATOMICSTORE"
2053170222Sdougbfi
2054170222Sdougb
2055170222SdougbAC_SUBST(ISC_PLATFORM_HAVEXADD)
2056170222SdougbAC_SUBST(ISC_PLATFORM_HAVECMPXCHG)
2057170222SdougbAC_SUBST(ISC_PLATFORM_HAVEATOMICSTORE)
2058170222Sdougb
2059170222SdougbAC_SUBST(ISC_PLATFORM_USEGCCASM)
2060170222SdougbAC_SUBST(ISC_PLATFORM_USEOSFASM)
2061170222SdougbAC_SUBST(ISC_PLATFORM_USESTDASM)
2062170222SdougbAC_SUBST(ISC_PLATFORM_USEMACASM)
2063170222Sdougb
2064170222SdougbISC_ARCH_DIR=$arch
2065170222SdougbAC_SUBST(ISC_ARCH_DIR)
2066170222Sdougb
2067170222Sdougb#
2068153816Sdougb#  The following sets up how non-blocking i/o is established.
2069153816Sdougb#  Sunos, cygwin and solaris 2.x (x<5) require special handling.
2070153816Sdougb#
2071153816Sdougbcase "$host" in
2072153816Sdougb*-sunos*) AC_DEFINE(PORT_NONBLOCK, O_NDELAY);;
2073153816Sdougb*-cygwin*) AC_DEFINE(PORT_NONBLOCK, O_NDELAY);;
2074153816Sdougb*-solaris2.[[01234]])
2075153816Sdougb	AC_DEFINE(PORT_NONBLOCK, O_NONBLOCK)
2076153816Sdougb	AC_DEFINE(USE_FIONBIO_IOCTL, 1,
2077153816Sdougb		  [Defined if you need to use ioctl(FIONBIO) instead a fcntl call to make non-blocking.])
2078153816Sdougb	;;
2079153816Sdougb*) AC_DEFINE(PORT_NONBLOCK, O_NONBLOCK,
2080153816Sdougb	     [Sets which flag to pass to open/fcntl to make non-blocking (O_NDELAY/O_NONBLOCK).])
2081153816Sdougb	;;
2082153816Sdougbesac
2083153816Sdougb#
2084165071Sdougb# Solaris 2.5.1 and earlier cannot bind() then connect() a TCP socket.
2085165071Sdougb# This prevents the source address being set.
2086165071Sdougb#
2087165071Sdougbcase "$host" in
2088165071Sdougb*-solaris2.[[012345]]|*-solaris2.5.1)
2089165071Sdougb	AC_DEFINE(BROKEN_TCP_BIND_BEFORE_CONNECT, 1,
2090165071Sdougb		  [Define if you cannot bind() before connect() for TCP sockets.])
2091165071Sdougb	;;
2092165071Sdougbesac
2093165071Sdougb#
2094135446Strhodes# The following sections deal with tools used for formatting
2095135446Strhodes# the documentation.  They are all optional, unless you are
2096135446Strhodes# a developer editing the documentation source.
2097135446Strhodes#
2098135446Strhodes
2099153816Sdougb#
2100153816Sdougb# Look for TeX.
2101153816Sdougb#
2102135446Strhodes
2103153816SdougbAC_PATH_PROGS(LATEX, latex, latex)
2104153816SdougbAC_SUBST(LATEX)
2105153816Sdougb
2106153816SdougbAC_PATH_PROGS(PDFLATEX, pdflatex, pdflatex)
2107153816SdougbAC_SUBST(PDFLATEX)
2108153816Sdougb
2109135446Strhodes#
2110170222Sdougb# Look for w3m
2111170222Sdougb#
2112170222Sdougb
2113170222SdougbAC_PATH_PROGS(W3M, w3m, w3m)
2114170222SdougbAC_SUBST(W3M)
2115170222Sdougb
2116170222Sdougb#
2117153816Sdougb# Look for xsltproc (libxslt)
2118135446Strhodes#
2119135446Strhodes
2120153816SdougbAC_PATH_PROG(XSLTPROC, xsltproc, xsltproc)
2121153816SdougbAC_SUBST(XSLTPROC)
2122135446Strhodes
2123135446Strhodes#
2124153816Sdougb# Look for xmllint (libxml2)
2125135446Strhodes#
2126135446Strhodes
2127153816SdougbAC_PATH_PROG(XMLLINT, xmllint, xmllint)
2128153816SdougbAC_SUBST(XMLLINT)
2129135446Strhodes
2130135446Strhodes#
2131135446Strhodes# Subroutine for searching for an ordinary file (e.g., a stylesheet)
2132135446Strhodes# in a number of directories:
2133135446Strhodes#
2134135446Strhodes#   NOM_PATH_FILE(VARIABLE, FILENAME, DIRECTORIES)
2135135446Strhodes#
2136135446Strhodes# If the file FILENAME is found in one of the DIRECTORIES, the shell
2137135446Strhodes# variable VARIABLE is defined to its absolute pathname.  Otherwise, 
2138135446Strhodes# it is set to FILENAME, with no directory prefix (that's not terribly
2139135446Strhodes# useful, but looks less confusing in substitutions than leaving it
2140135446Strhodes# empty).  The variable VARIABLE will be substituted into output files.
2141135446Strhodes# 
2142135446Strhodes
2143135446StrhodesAC_DEFUN(NOM_PATH_FILE, [
2144135446Strhodes$1=""
2145135446StrhodesAC_MSG_CHECKING(for $2)
2146135446Strhodesfor d in $3
2147135446Strhodesdo
2148135446Strhodes	f=$d/$2
2149135446Strhodes	if test -f $f
2150135446Strhodes	then
2151135446Strhodes		$1=$f
2152135446Strhodes		AC_MSG_RESULT($f)
2153135446Strhodes		break
2154135446Strhodes	fi
2155135446Strhodesdone
2156135446Strhodesif test "X[$]$1" = "X"
2157135446Strhodesthen
2158135446Strhodes	AC_MSG_RESULT("not found");
2159135446Strhodes	$1=$2
2160135446Strhodesfi
2161135446StrhodesAC_SUBST($1)
2162135446Strhodes])
2163135446Strhodes
2164135446Strhodes#
2165153816Sdougb# Look for Docbook-XSL stylesheets.  Location probably varies by
2166153816Sdougb# system.  Guessing where it might be found, based on where SGML stuff
2167153816Sdougb# lives on some systems.  FreeBSD is the only one I'm sure of at the
2168153816Sdougb# moment.
2169135446Strhodes#
2170153816Sdougb
2171153816Sdougbdocbook_xsl_trees="/usr/pkg/share/xsl /usr/local/share/xsl /usr/share/xsl"
2172153816Sdougb
2173135446Strhodes#
2174153816Sdougb# Look for stylesheets we need.
2175153816Sdougb#
2176135446Strhodes
2177153816SdougbNOM_PATH_FILE(XSLT_DOCBOOK_STYLE_HTML, docbook/html/docbook.xsl, $docbook_xsl_trees)
2178153816SdougbNOM_PATH_FILE(XSLT_DOCBOOK_STYLE_XHTML, docbook/xhtml/docbook.xsl, $docbook_xsl_trees)
2179153816SdougbNOM_PATH_FILE(XSLT_DOCBOOK_STYLE_MAN, docbook/manpages/docbook.xsl, $docbook_xsl_trees)
2180153816SdougbNOM_PATH_FILE(XSLT_DOCBOOK_CHUNK_HTML, docbook/html/chunk.xsl, $docbook_xsl_trees)
2181153816SdougbNOM_PATH_FILE(XSLT_DOCBOOK_CHUNK_XHTML, docbook/xhtml/chunk.xsl, $docbook_xsl_trees)
2182170222SdougbNOM_PATH_FILE(XSLT_DOCBOOK_CHUNKTOC_HTML, docbook/html/chunktoc.xsl, $docbook_xsl_trees)
2183170222SdougbNOM_PATH_FILE(XSLT_DOCBOOK_CHUNKTOC_XHTML, docbook/xhtml/chunktoc.xsl, $docbook_xsl_trees)
2184170222SdougbNOM_PATH_FILE(XSLT_DOCBOOK_MAKETOC_HTML, docbook/html/maketoc.xsl, $docbook_xsl_trees)
2185170222SdougbNOM_PATH_FILE(XSLT_DOCBOOK_MAKETOC_XHTML, docbook/xhtml/maketoc.xsl, $docbook_xsl_trees)
2186153816Sdougb
2187135446Strhodes#
2188153816Sdougb# Same dance for db2latex
2189135446Strhodes#
2190153816Sdougb# No idea where this lives except on FreeBSD.
2191135446Strhodes#
2192135446Strhodes
2193153816Sdougbdb2latex_xsl_trees="/usr/local/share"
2194135446Strhodes
2195135446Strhodes#
2196153816Sdougb# Look for stylesheets we need.
2197135446Strhodes#
2198135446Strhodes
2199153816SdougbNOM_PATH_FILE(XSLT_DB2LATEX_STYLE, db2latex/xsl/docbook.xsl, $db2latex_xsl_trees)
2200135446Strhodes
2201135446Strhodes#
2202153816Sdougb# Look for "admonition" image directory.  Can't use NOM_PATH_FILE()
2203153816Sdougb# because it's a directory, so just do the same things, inline.
2204135446Strhodes#
2205135446Strhodes
2206153816SdougbAC_MSG_CHECKING(for db2latex/xsl/figures)
2207153816Sdougbfor d in $db2latex_xsl_trees
2208153816Sdougbdo
2209153816Sdougb	dd=$d/db2latex/xsl/figures
2210153816Sdougb	if test -d $dd
2211153816Sdougb	then
2212153816Sdougb		XSLT_DB2LATEX_ADMONITIONS=$dd
2213153816Sdougb		AC_MSG_RESULT($dd)
2214153816Sdougb		break
2215153816Sdougb	fi
2216153816Sdougbdone
2217153816Sdougbif test "X$XSLT_DB2LATEX_ADMONITIONS" = "X"
2218153816Sdougbthen
2219153816Sdougb	AC_MSG_RESULT(not found)
2220153816Sdougb	XSLT_DB2LATEX_ADMONITIONS=db2latex/xsl/figures
2221153816Sdougbfi
2222153816SdougbAC_SUBST(XSLT_DB2LATEX_ADMONITIONS)
2223135446Strhodes
2224135446Strhodes#
2225170222Sdougb# IDN support
2226170222Sdougb#
2227170222SdougbAC_ARG_WITH(idn,
2228170222Sdougb	[  --with-idn[=MPREFIX]   enable IDN support using idnkit [default PREFIX]],
2229170222Sdougb	use_idn="$withval", use_idn="no")
2230170222Sdougbcase "$use_idn" in
2231170222Sdougbyes)
2232170222Sdougb	if test X$prefix = XNONE ; then
2233170222Sdougb		idn_path=/usr/local
2234170222Sdougb	else
2235170222Sdougb		idn_path=$prefix
2236170222Sdougb	fi
2237170222Sdougb	;;
2238170222Sdougbno)
2239170222Sdougb	;;
2240170222Sdougb*)
2241170222Sdougb	idn_path="$use_idn"
2242170222Sdougb	;;
2243170222Sdougbesac
2244170222Sdougb
2245170222Sdougbiconvinc=
2246170222Sdougbiconvlib=
2247170222SdougbAC_ARG_WITH(libiconv,
2248170222Sdougb	[  --with-libiconv[=IPREFIX]   GNU libiconv are in IPREFIX [default PREFIX]],
2249170222Sdougb	use_libiconv="$withval", use_libiconv="no")
2250170222Sdougbcase "$use_libiconv" in
2251170222Sdougbyes)
2252170222Sdougb	if test X$prefix = XNONE ; then
2253170222Sdougb		iconvlib="-L/usr/local/lib -R/usr/local/lib -liconv"
2254170222Sdougb	else
2255170222Sdougb		iconvlib="-L$prefix/lib -R$prefix/lib -liconv"
2256170222Sdougb	fi
2257170222Sdougb	;;
2258170222Sdougbno)
2259170222Sdougb	iconvlib=
2260170222Sdougb	;;
2261170222Sdougb*)
2262170222Sdougb	iconvlib="-L$use_libiconv/lib -R$use_libiconv/lib -liconv"
2263170222Sdougb	;;
2264170222Sdougbesac
2265170222Sdougb
2266170222SdougbAC_ARG_WITH(iconv,
2267170222Sdougb	[  --with-iconv[=LIBSPEC]   specify iconv library [default -liconv]],
2268170222Sdougb	iconvlib="$withval")
2269170222Sdougbcase "$iconvlib" in
2270170222Sdougbno)
2271170222Sdougb	iconvlib=
2272170222Sdougb	;;
2273170222Sdougbyes)
2274170222Sdougb	iconvlib=-liconv
2275170222Sdougb	;;
2276170222Sdougbesac
2277170222Sdougb
2278170222SdougbAC_ARG_WITH(idnlib,
2279170222Sdougb	[  --with-idnlib=ARG    specify libidnkit],
2280170222Sdougb	idnlib="$withval", idnlib="no")
2281170222Sdougbif test "$idnlib" = yes; then
2282170222Sdougb	AC_MSG_ERROR([You must specify ARG for --with-idnlib.])
2283170222Sdougbfi
2284170222Sdougb
2285170222SdougbIDNLIBS=
2286170222Sdougbif test "$use_idn" != no; then
2287170222Sdougb	AC_DEFINE(WITH_IDN, 1, [define if idnkit support is to be included.])
2288170222Sdougb	STD_CINCLUDES="$STD_CINCLUDES -I$idn_path/include"
2289170222Sdougb	if test "$idnlib" != no; then
2290170222Sdougb		IDNLIBS="$idnlib $iconvlib"
2291170222Sdougb	else
2292170222Sdougb		IDNLIBS="-L$idn_path/lib -lidnkit $iconvlib"
2293170222Sdougb	fi
2294170222Sdougbfi
2295170222SdougbAC_SUBST(IDNLIBS)
2296170222Sdougb
2297170222SdougbAC_CHECK_HEADERS(locale.h)
2298170222SdougbAC_CHECK_FUNCS(setlocale)
2299170222Sdougb
2300170222Sdougb#
2301135446Strhodes# Substitutions
2302135446Strhodes#
2303135446StrhodesAC_SUBST(BIND9_TOP_BUILDDIR)
2304135446StrhodesBIND9_TOP_BUILDDIR=`pwd`
2305135446Strhodes
2306135446StrhodesAC_SUBST(BIND9_ISC_BUILDINCLUDE)
2307135446StrhodesAC_SUBST(BIND9_ISCCC_BUILDINCLUDE)
2308135446StrhodesAC_SUBST(BIND9_ISCCFG_BUILDINCLUDE)
2309135446StrhodesAC_SUBST(BIND9_DNS_BUILDINCLUDE)
2310135446StrhodesAC_SUBST(BIND9_LWRES_BUILDINCLUDE)
2311135446StrhodesAC_SUBST(BIND9_BIND9_BUILDINCLUDE)
2312135446Strhodesif test "X$srcdir" != "X"; then
2313135446Strhodes	BIND9_ISC_BUILDINCLUDE="-I${BIND9_TOP_BUILDDIR}/lib/isc/include"
2314135446Strhodes	BIND9_ISCCC_BUILDINCLUDE="-I${BIND9_TOP_BUILDDIR}/lib/isccc/include"
2315135446Strhodes	BIND9_ISCCFG_BUILDINCLUDE="-I${BIND9_TOP_BUILDDIR}/lib/isccfg/include"
2316135446Strhodes	BIND9_DNS_BUILDINCLUDE="-I${BIND9_TOP_BUILDDIR}/lib/dns/include"
2317135446Strhodes	BIND9_LWRES_BUILDINCLUDE="-I${BIND9_TOP_BUILDDIR}/lib/lwres/include"
2318135446Strhodes	BIND9_BIND9_BUILDINCLUDE="-I${BIND9_TOP_BUILDDIR}/lib/bind9/include"
2319135446Strhodeselse
2320135446Strhodes	BIND9_ISC_BUILDINCLUDE=""
2321135446Strhodes	BIND9_ISCCC_BUILDINCLUDE=""
2322135446Strhodes	BIND9_ISCCFG_BUILDINCLUDE=""
2323135446Strhodes	BIND9_DNS_BUILDINCLUDE=""
2324135446Strhodes	BIND9_LWRES_BUILDINCLUDE=""
2325135446Strhodes	BIND9_BIND9_BUILDINCLUDE=""
2326135446Strhodesfi
2327135446Strhodes
2328135446StrhodesAC_SUBST_FILE(BIND9_MAKE_INCLUDES)
2329135446StrhodesBIND9_MAKE_INCLUDES=$BIND9_TOP_BUILDDIR/make/includes
2330135446Strhodes
2331135446StrhodesAC_SUBST_FILE(BIND9_MAKE_RULES)
2332135446StrhodesBIND9_MAKE_RULES=$BIND9_TOP_BUILDDIR/make/rules
2333135446Strhodes
2334135446Strhodes. $srcdir/version
2335135446StrhodesBIND9_VERSION="VERSION=${MAJORVER}.${MINORVER}.${PATCHVER}${RELEASETYPE}${RELEASEVER}"
2336135446StrhodesAC_SUBST(BIND9_VERSION)
2337135446Strhodes
2338135446StrhodesAC_SUBST_FILE(LIBISC_API)
2339135446StrhodesLIBISC_API=$srcdir/lib/isc/api
2340135446Strhodes
2341135446StrhodesAC_SUBST_FILE(LIBISCCC_API)
2342135446StrhodesLIBISCCC_API=$srcdir/lib/isccc/api
2343135446Strhodes
2344135446StrhodesAC_SUBST_FILE(LIBISCCFG_API)
2345135446StrhodesLIBISCCFG_API=$srcdir/lib/isccfg/api
2346135446Strhodes
2347135446StrhodesAC_SUBST_FILE(LIBDNS_API)
2348135446StrhodesLIBDNS_API=$srcdir/lib/dns/api
2349135446Strhodes
2350135446StrhodesAC_SUBST_FILE(LIBBIND9_API)
2351135446StrhodesLIBBIND9_API=$srcdir/lib/bind9/api
2352135446Strhodes
2353135446StrhodesAC_SUBST_FILE(LIBLWRES_API)
2354135446StrhodesLIBLWRES_API=$srcdir/lib/lwres/api
2355135446Strhodes
2356170222Sdougb#
2357170222Sdougb# Configure any DLZ drivers.
2358170222Sdougb#
2359170222Sdougb# If config.dlz.in selects one or more DLZ drivers, it will set
2360170222Sdougb# USE_DLZ to a non-empty value, which will be our clue to
2361170222Sdougb# enable the DLZ core functions.
2362170222Sdougb#
2363170222Sdougb# This section has to come after the libtool stuff because it needs to
2364170222Sdougb# know how to name the driver object files.
2365170222Sdougb#
2366170222Sdougb
2367170222SdougbUSE_DLZ=""
2368170222SdougbDLZ_DRIVER_INCLUDES=""
2369170222SdougbDLZ_DRIVER_LIBS=""
2370170222SdougbDLZ_DRIVER_SRCS=""
2371170222SdougbDLZ_DRIVER_OBJS=""
2372170222Sdougb
2373170222Sdougbsinclude(contrib/dlz/config.dlz.in)
2374170222Sdougb
2375170222SdougbAC_MSG_CHECKING(for DLZ)
2376170222Sdougb
2377170222Sdougbif test -n "$USE_DLZ"
2378170222Sdougbthen
2379170222Sdougb	AC_MSG_RESULT(yes)
2380170222Sdougb	USE_DLZ="-DDLZ $USE_DLZ"
2381170222Sdougb	DLZ_DRIVER_RULES=contrib/dlz/drivers/rules
2382170222Sdougb	AC_CONFIG_FILES([$DLZ_DRIVER_RULES])
2383170222Sdougbelse
2384170222Sdougb	AC_MSG_RESULT(no)
2385170222Sdougb	DLZ_DRIVER_RULES=/dev/null
2386170222Sdougbfi
2387170222Sdougb
2388170222SdougbAC_SUBST(USE_DLZ)
2389170222SdougbAC_SUBST(DLZ_DRIVER_INCLUDES)
2390170222SdougbAC_SUBST(DLZ_DRIVER_LIBS)
2391170222SdougbAC_SUBST(DLZ_DRIVER_SRCS)
2392170222SdougbAC_SUBST(DLZ_DRIVER_OBJS)
2393170222SdougbAC_SUBST_FILE(DLZ_DRIVER_RULES)
2394170222Sdougb
2395165071Sdougbif test "$cross_compiling" = "yes"; then
2396165071Sdougb	if test -z "$BUILD_CC"; then
2397165071Sdougb		AC_ERROR([BUILD_CC not set])
2398165071Sdougb	fi
2399165071Sdougb	BUILD_CFLAGS="$BUILD_CFLAGS"
2400165071Sdougb	BUILD_CPPFLAGS="$BUILD_CPPFLAGS"
2401165071Sdougb	BUILD_LDFLAGS="$BUILD_LDFLAGS"
2402165071Sdougb	BUILD_LIBS="$BUILD_LIBS"
2403165071Sdougbelse
2404165071Sdougb	BUILD_CC="$CC" 
2405165071Sdougb	BUILD_CFLAGS="$CFLAGS" 
2406165071Sdougb	BUILD_CPPFLAGS="$CPPFLAGS $GEN_NEED_OPTARG"
2407165071Sdougb	BUILD_LDFLAGS="$LDFLAGS"
2408165071Sdougb	BUILD_LIBS="$LIBS"
2409165071Sdougbfi
2410165071Sdougb
2411165071SdougbAC_SUBST(BUILD_CC)
2412165071SdougbAC_SUBST(BUILD_CFLAGS)
2413165071SdougbAC_SUBST(BUILD_CPPFLAGS)
2414165071SdougbAC_SUBST(BUILD_LDFLAGS)
2415165071SdougbAC_SUBST(BUILD_LIBS)
2416165071Sdougb
2417170222Sdougb#
2418170222Sdougb# Commands to run at the end of config.status.
2419170222Sdougb# Don't just put these into configure, it won't work right if somebody
2420170222Sdougb# runs config.status directly (which autoconf allows).
2421170222Sdougb#
2422170222Sdougb
2423170222SdougbAC_CONFIG_COMMANDS(
2424170222Sdougb	[chmod],
2425170222Sdougb	[chmod a+x isc-config.sh])
2426170222Sdougb
2427170222Sdougb#
2428170222Sdougb# Files to configure.  These are listed here because we used to
2429170222Sdougb# specify them as arguments to AC_OUTPUT.  It's (now) ok to move these
2430170222Sdougb# elsewhere if there's a good reason for doing so.
2431170222Sdougb#
2432170222Sdougb
2433170222SdougbAC_CONFIG_FILES([
2434135446Strhodes	Makefile
2435135446Strhodes	make/Makefile
2436135446Strhodes	make/mkdep
2437135446Strhodes	lib/Makefile
2438135446Strhodes	lib/isc/Makefile
2439135446Strhodes	lib/isc/include/Makefile
2440135446Strhodes	lib/isc/include/isc/Makefile
2441135446Strhodes	lib/isc/include/isc/platform.h
2442135446Strhodes	lib/isc/unix/Makefile
2443135446Strhodes	lib/isc/unix/include/Makefile
2444135446Strhodes	lib/isc/unix/include/isc/Makefile
2445135446Strhodes	lib/isc/nls/Makefile
2446135446Strhodes	lib/isc/$thread_dir/Makefile
2447135446Strhodes	lib/isc/$thread_dir/include/Makefile
2448135446Strhodes	lib/isc/$thread_dir/include/isc/Makefile
2449174187Sdougb	lib/isc/$arch/Makefile
2450174187Sdougb	lib/isc/$arch/include/Makefile
2451174187Sdougb	lib/isc/$arch/include/isc/Makefile
2452135446Strhodes	lib/isccc/Makefile
2453135446Strhodes	lib/isccc/include/Makefile
2454135446Strhodes	lib/isccc/include/isccc/Makefile
2455135446Strhodes	lib/isccfg/Makefile
2456135446Strhodes	lib/isccfg/include/Makefile
2457135446Strhodes	lib/isccfg/include/isccfg/Makefile
2458135446Strhodes	lib/dns/Makefile
2459135446Strhodes	lib/dns/include/Makefile
2460135446Strhodes	lib/dns/include/dns/Makefile
2461143731Sdougb	lib/dns/include/dst/Makefile
2462135446Strhodes	lib/bind9/Makefile
2463135446Strhodes	lib/bind9/include/Makefile
2464135446Strhodes	lib/bind9/include/bind9/Makefile
2465135446Strhodes	lib/lwres/Makefile
2466135446Strhodes	lib/lwres/include/Makefile
2467135446Strhodes	lib/lwres/include/lwres/Makefile
2468135446Strhodes	lib/lwres/include/lwres/netdb.h
2469135446Strhodes	lib/lwres/include/lwres/platform.h
2470135446Strhodes	lib/lwres/man/Makefile
2471135446Strhodes	lib/lwres/unix/Makefile
2472135446Strhodes	lib/lwres/unix/include/Makefile
2473135446Strhodes	lib/lwres/unix/include/lwres/Makefile
2474135446Strhodes	lib/tests/Makefile
2475135446Strhodes	lib/tests/include/Makefile
2476135446Strhodes	lib/tests/include/tests/Makefile
2477135446Strhodes	bin/Makefile
2478135446Strhodes	bin/check/Makefile
2479135446Strhodes	bin/named/Makefile
2480135446Strhodes	bin/named/unix/Makefile
2481135446Strhodes	bin/rndc/Makefile
2482135446Strhodes	bin/rndc/unix/Makefile
2483135446Strhodes	bin/dig/Makefile
2484135446Strhodes	bin/nsupdate/Makefile
2485135446Strhodes	bin/tests/Makefile
2486135446Strhodes	bin/tests/names/Makefile
2487135446Strhodes	bin/tests/master/Makefile
2488135446Strhodes	bin/tests/rbt/Makefile
2489135446Strhodes	bin/tests/db/Makefile
2490135446Strhodes	bin/tests/tasks/Makefile
2491135446Strhodes	bin/tests/timers/Makefile
2492135446Strhodes	bin/tests/dst/Makefile
2493135446Strhodes	bin/tests/mem/Makefile
2494135446Strhodes	bin/tests/net/Makefile
2495135446Strhodes	bin/tests/sockaddr/Makefile
2496135446Strhodes	bin/tests/system/Makefile
2497135446Strhodes	bin/tests/system/conf.sh
2498135446Strhodes	bin/tests/system/lwresd/Makefile
2499135446Strhodes	bin/tests/system/tkey/Makefile
2500135446Strhodes	bin/tests/headerdep_test.sh
2501135446Strhodes	bin/dnssec/Makefile
2502135446Strhodes	doc/Makefile
2503135446Strhodes	doc/arm/Makefile
2504135446Strhodes	doc/misc/Makefile
2505170222Sdougb	isc-config.sh
2506153816Sdougb	doc/xsl/Makefile
2507153816Sdougb	doc/xsl/isc-docbook-chunk.xsl
2508153816Sdougb	doc/xsl/isc-docbook-html.xsl
2509153816Sdougb	doc/xsl/isc-docbook-latex.xsl
2510153816Sdougb	doc/xsl/isc-manpage.xsl
2511170222Sdougb])
2512135446Strhodes
2513170222Sdougb#
2514170222Sdougb# Do it
2515170222Sdougb#
2516170222Sdougb
2517170222SdougbAC_OUTPUT
2518170222Sdougb
2519163976Sdougbif test "X$OPENSSL_WARNING" != "X"; then
2520163976Sdougbcat << \EOF
2521163976SdougbWARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
2522163976SdougbWARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
2523163976SdougbWARNING                                                                 WARNING
2524163976SdougbWARNING         Your OpenSSL crypto library may be vulnerable to        WARNING
2525163976SdougbWARNING         one or more of the the following known security         WARNING
2526163976SdougbWARNING         flaws:                                                  WARNING
2527163976SdougbWARNING                                                                 WARNING
2528163976SdougbWARNING         CAN-2002-0659, CAN-2006-4339, CVE-2006-2937 and         WARNING
2529163976SdougbWARNING         CVE-2006-2940.                                          WARNING
2530163976SdougbWARNING                                                                 WARNING
2531163976SdougbWARNING         It is recommended that you upgrade to OpenSSL           WARNING
2532163976SdougbWARNING         version 0.9.8d/0.9.7l (or greater).                     WARNING
2533163976SdougbWARNING                                                                 WARNING
2534163976SdougbWARNING         You can disable this warning by specifying:             WARNING
2535163976SdougbWARNING                                                                 WARNING
2536163976SdougbWARNING               --disable-openssl-version-check          	        WARNING
2537163976SdougbWARNING                                                                 WARNING
2538163976SdougbWARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
2539163976SdougbWARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
2540163976SdougbEOF
2541163976Sdougbfi
2542163976Sdougb
2543135446Strhodes# Tell Emacs to edit this file in shell mode.
2544135446Strhodes# Local Variables:
2545135446Strhodes# mode: sh
2546135446Strhodes# End:
2547