configure.in revision 153816
1153816Sdougb# Copyright (C) 2004, 2005  Internet Systems Consortium, Inc. ("ISC")
2135446Strhodes# Copyright (C) 1998-2003  Internet Software Consortium.
3135446Strhodes#
4135446Strhodes# Permission to use, copy, modify, and 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
21153816SdougbAC_REVISION($Revision: 1.294.2.23.2.51 $)
22135446Strhodes
23135446StrhodesAC_INIT(lib/dns/name.c)
24135446StrhodesAC_PREREQ(2.13)
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
34135446Strhodes
35135446StrhodesAC_SUBST(STD_CINCLUDES)
36135446StrhodesAC_SUBST(STD_CDEFINES)
37135446StrhodesAC_SUBST(STD_CWARNINGS)
38135446StrhodesAC_SUBST(CCOPT)
39135446Strhodes
40135446StrhodesAC_PATH_PROG(AR, ar)
41135446StrhodesARFLAGS="cruv"
42135446StrhodesAC_SUBST(AR)
43135446StrhodesAC_SUBST(ARFLAGS)
44135446Strhodes
45135446Strhodes# The POSIX ln(1) program.  Non-POSIX systems may substitute
46135446Strhodes# "copy" or something.
47135446StrhodesLN=ln
48135446StrhodesAC_SUBST(LN)
49135446Strhodes
50135446Strhodescase "$AR" in
51135446Strhodes	"")
52135446Strhodes		AC_MSG_ERROR([
53135446Strhodesar program not found.  Please fix your PATH to include the directory in
54135446Strhodeswhich ar resides, or set AR in the environment with the full path to ar.
55135446Strhodes])
56135446Strhodes
57135446Strhodes		;;
58135446Strhodesesac
59135446Strhodes
60135446Strhodes#
61135446Strhodes# Etags.
62135446Strhodes#
63135446StrhodesAC_PATH_PROGS(ETAGS, etags emacs-etags)
64135446Strhodes
65135446Strhodes#
66135446Strhodes# Some systems, e.g. RH7, have the Exuberant Ctags etags instead of
67135446Strhodes# GNU emacs etags, and it requires the -L flag.
68135446Strhodes#
69135446Strhodesif test "X$ETAGS" != "X"; then
70135446Strhodes	AC_MSG_CHECKING(for Exuberant Ctags etags)
71135446Strhodes	if $ETAGS --version 2>&1 | grep 'Exuberant Ctags' >/dev/null 2>&1; then
72135446Strhodes		AC_MSG_RESULT(yes)
73135446Strhodes		ETAGS="$ETAGS -L"
74135446Strhodes	else
75135446Strhodes		AC_MSG_RESULT(no)
76135446Strhodes	fi
77135446Strhodesfi
78135446StrhodesAC_SUBST(ETAGS)
79135446Strhodes
80135446Strhodes#
81135446Strhodes# Perl is optional; it is used only by some of the system test scripts.
82135446Strhodes#
83135446StrhodesAC_PATH_PROGS(PERL, perl5 perl)
84135446StrhodesAC_SUBST(PERL)
85135446Strhodes
86135446Strhodes#
87135446Strhodes# Special processing of paths depending on whether --prefix,
88135446Strhodes# --sysconfdir or --localstatedir arguments were given.  What's
89135446Strhodes# desired is some compatibility with the way previous versions
90135446Strhodes# of BIND built; they defaulted to /usr/local for most parts of
91135446Strhodes# the installation, but named.boot/named.conf was in /etc
92135446Strhodes# and named.pid was in /var/run.
93135446Strhodes#
94135446Strhodes# So ... if none of --prefix, --sysconfdir or --localstatedir are
95135446Strhodes# specified, set things up that way.  If --prefix is given, use
96135446Strhodes# it for sysconfdir and localstatedir the way configure normally
97135446Strhodes# would.  To change the prefix for everything but leave named.conf
98135446Strhodes# in /etc or named.pid in /var/run, then do this the usual configure way:
99135446Strhodes# ./configure --prefix=/somewhere --sysconfdir=/etc
100135446Strhodes# ./configure --prefix=/somewhere --localstatedir=/var
101135446Strhodes#
102135446Strhodes# To put named.conf and named.pid in /usr/local with everything else,
103135446Strhodes# set the prefix explicitly to /usr/local even though that's the default:
104135446Strhodes# ./configure --prefix=/usr/local
105135446Strhodes#
106135446Strhodescase "$prefix" in
107135446Strhodes        NONE)
108135446Strhodes                case "$sysconfdir" in
109135446Strhodes                        '${prefix}/etc')
110135446Strhodes                                sysconfdir=/etc
111135446Strhodes                                ;;
112135446Strhodes                esac
113135446Strhodes                case "$localstatedir" in
114135446Strhodes                        '${prefix}/var')
115135446Strhodes                                localstatedir=/var
116135446Strhodes                                ;;
117135446Strhodes                esac
118135446Strhodes                ;;
119135446Strhodesesac
120135446Strhodes
121135446Strhodes#
122135446Strhodes# Make sure INSTALL uses an absolute path, else it will be wrong in all
123135446Strhodes# Makefiles, since they use make/rules.in and INSTALL will be adjusted by
124135446Strhodes# configure based on the location of the file where it is substituted.
125135446Strhodes# Since in BIND9 INSTALL is only substituted into make/rules.in, an immediate
126135446Strhodes# subdirectory of install-sh, This relative path will be wrong for all
127135446Strhodes# directories more than one level down from install-sh.
128135446Strhodes#
129135446Strhodescase "$INSTALL" in
130135446Strhodes	/*)
131135446Strhodes                ;;
132135446Strhodes        *)
133135446Strhodes                #
134135446Strhodes                # Not all systems have dirname.
135135446Strhodes                #
136135446Strhodes                changequote({, })
137135446Strhodes                ac_dir="`echo $INSTALL | sed 's%/[^/]*$%%'`"
138135446Strhodes                changequote([, ])
139135446Strhodes
140135446Strhodes                ac_prog="`echo $INSTALL | sed 's%.*/%%'`"
141135446Strhodes                test "$ac_dir" = "$ac_prog" && ac_dir=.
142135446Strhodes                test -d "$ac_dir" && ac_dir="`(cd \"$ac_dir\" && pwd)`"
143135446Strhodes                INSTALL="$ac_dir/$ac_prog"
144135446Strhodes                ;;
145135446Strhodesesac
146135446Strhodes
147135446Strhodes#
148135446Strhodes# On these hosts, we really want to use cc, not gcc, even if it is
149135446Strhodes# found.  The gcc that these systems have will not correctly handle
150135446Strhodes# pthreads.
151135446Strhodes#
152135446Strhodes# However, if the user sets $CC to be something, let that override
153135446Strhodes# our change.
154135446Strhodes#
155135446Strhodesif test "X$CC" = "X" ; then
156135446Strhodes	case "$host" in
157135446Strhodes		*-dec-osf*)
158135446Strhodes			CC="cc"
159135446Strhodes			;;
160135446Strhodes		*-solaris*)
161135446Strhodes                        # Use Sun's cc if it is available, but watch
162135446Strhodes                        # out for /usr/ucb/cc; it will never be the right
163135446Strhodes                        # compiler to use.
164135446Strhodes                        #
165135446Strhodes                        # If setting CC here fails, the AC_PROG_CC done
166135446Strhodes                        # below might still find gcc.
167135446Strhodes			IFS="${IFS=	}"; ac_save_ifs="$IFS"; IFS=":"
168135446Strhodes			for ac_dir in $PATH; do
169135446Strhodes				test -z "$ac_dir" && ac_dir=.
170135446Strhodes				case "$ac_dir" in
171135446Strhodes				/usr/ucb)
172135446Strhodes					# exclude
173135446Strhodes					;;
174135446Strhodes				*)
175135446Strhodes					if test -f "$ac_dir/cc"; then
176135446Strhodes						CC="$ac_dir/cc"
177135446Strhodes						break
178135446Strhodes					fi
179135446Strhodes					;;
180135446Strhodes				esac
181135446Strhodes			done
182135446Strhodes			IFS="$ac_save_ifs"
183135446Strhodes			;;
184135446Strhodes		*-hp-hpux*)
185135446Strhodes			CC="cc"
186135446Strhodes			;;
187135446Strhodes		mips-sgi-irix*)
188135446Strhodes			CC="cc"
189135446Strhodes			;;
190135446Strhodes	esac
191135446Strhodesfi
192135446Strhodes
193135446StrhodesAC_PROG_CC
194135446Strhodes
195135446Strhodes#
196135446Strhodes# gcc's optimiser is broken at -02 for ultrasparc
197135446Strhodes#
198135446Strhodesif test "$ac_env_CFLAGS_set" != set -a "X$GCC" = "Xyes"; then
199135446Strhodes	case "$host" in
200135446Strhodes	sparc-*)
201135446Strhodes		CCFLAGS="-g -O1"
202135446Strhodes		;;
203135446Strhodes	esac
204135446Strhodesfi
205135446Strhodes
206135446Strhodes#
207135446Strhodes# OS dependent CC flags
208135446Strhodes#
209135446Strhodescase "$host" in
210135446Strhodes	# OSF 5.0: recv/send are only avaliable with -D_POSIX_PII_SOCKET or
211135446Strhodes	# -D_XOPEN_SOURCE_EXTENDED.
212135446Strhodes	*-dec-osf*)
213135446Strhodes		STD_CDEFINES="$STD_CDEFINES -D_POSIX_PII_SOCKET"
214135446Strhodes		CPPFLAGS="$CPPFLAGS -D_POSIX_PII_SOCKET"
215135446Strhodes		;;
216135446Strhodes	#HP-UX: need -D_XOPEN_SOURCE_EXTENDED and -lxnet for CMSG macros
217135446Strhodes	*-hp-hpux*)
218135446Strhodes		STD_CDEFINES="$STD_CDEFINES -D_XOPEN_SOURCE_EXTENDED"
219135446Strhodes		CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE_EXTENDED"
220135446Strhodes		LIBS="-lxnet $LIBS"
221135446Strhodes		;;
222135446Strhodes	# Solaris: need -D_XPG4_2 and -D__EXTENSIONS__ for CMSG macros
223135446Strhodes	*-solaris*)
224135446Strhodes		STD_CDEFINES="$STD_CDEFINES -D_XPG4_2 -D__EXTENSIONS__"
225135446Strhodes		CPPFLAGS="$CPPFLAGS -D_XPG4_2 -D__EXTENSIONS__"
226135446Strhodes		;;
227135446Strhodesesac
228135446Strhodes
229135446StrhodesAC_HEADER_STDC
230135446Strhodes
231135446StrhodesAC_CHECK_HEADERS(fcntl.h sys/time.h unistd.h sys/sockio.h sys/select.h sys/param.h sys/sysctl.h net/if6.h,,,
232135446Strhodes[$ac_includes_default
233135446Strhodes#ifdef HAVE_SYS_PARAM_H
234135446Strhodes# include <sys/param.h>
235135446Strhodes#endif
236135446Strhodes])
237135446Strhodes
238135446StrhodesAC_C_CONST
239135446StrhodesAC_C_INLINE
240135446StrhodesAC_CHECK_FUNC(sysctlbyname, AC_DEFINE(HAVE_SYSCTLBYNAME))
241135446Strhodes
242135446Strhodes#
243135446Strhodes# UnixWare 7.1.1 with the feature supplement to the UDK compiler
244135446Strhodes# is reported to not support "static inline" (RT #1212).
245135446Strhodes#
246135446StrhodesAC_MSG_CHECKING(for static inline breakage)
247135446StrhodesAC_TRY_COMPILE(, [
248135446Strhodes		foo1();
249135446Strhodes	}
250135446Strhodes
251135446Strhodes	static inline int foo1() {
252135446Strhodes		return 0;
253135446Strhodes	}
254135446Strhodes
255135446Strhodes	static inline int foo2() {
256135446Strhodes		return foo1();
257135446Strhodes	],
258135446Strhodes	[AC_MSG_RESULT(no)],
259135446Strhodes	[AC_MSG_RESULT(yes)
260135446Strhodes         AC_DEFINE(inline, )])
261135446Strhodes
262135446StrhodesAC_TYPE_SIZE_T
263135446StrhodesAC_CHECK_TYPE(ssize_t, int)
264153816SdougbAC_CHECK_TYPE(uintptr_t,unsigned long)
265143731SdougbAC_CHECK_TYPE(socklen_t,
266143731Sdougb[AC_DEFINE(ISC_SOCKADDR_LEN_T, socklen_t)],
267143731Sdougb[
268143731SdougbAC_TRY_COMPILE(
269143731Sdougb[
270143731Sdougb#include <sys/types.h>
271143731Sdougb#include <sys/socket.h>
272143731Sdougbint getsockname(int, struct sockaddr *, size_t *);
273143731Sdougb],[],
274143731Sdougb[AC_DEFINE(ISC_SOCKADDR_LEN_T, size_t)],
275143731Sdougb[AC_DEFINE(ISC_SOCKADDR_LEN_T, int)])
276143731Sdougb],
277143731Sdougb[
278143731Sdougb#include <sys/types.h>
279143731Sdougb#include <sys/socket.h>
280143731Sdougb])
281143731SdougbAC_SUBST(ISC_SOCKADDR_LEN_T)
282135446StrhodesAC_HEADER_TIME
283135446StrhodesAC_MSG_CHECKING(for long long)
284135446StrhodesAC_TRY_COMPILE([],[long long i = 0; return (0);],
285135446Strhodes	[AC_MSG_RESULT(yes)
286135446Strhodes		ISC_PLATFORM_HAVELONGLONG="#define ISC_PLATFORM_HAVELONGLONG 1"],
287135446Strhodes	[AC_MSG_RESULT(no)
288135446Strhodes		ISC_PLATFORM_HAVELONGLONG="#undef ISC_PLATFORM_HAVELONGLONG"])
289135446StrhodesAC_SUBST(ISC_PLATFORM_HAVELONGLONG)
290135446Strhodes
291135446Strhodes#
292135446Strhodes# check if we have lifconf
293135446Strhodes#
294135446StrhodesAC_MSG_CHECKING(for struct lifconf)
295135446StrhodesAC_TRY_COMPILE([
296135446Strhodes#include <sys/types.h>
297135446Strhodes#include <sys/socket.h>
298135446Strhodes#include <net/if.h>
299135446Strhodes],
300135446Strhodes[
301135446Strhodesstruct lifconf lifconf;
302135446Strhodeslifconf.lifc_len = 0;
303135446Strhodes]
304135446Strhodes,
305135446Strhodes	[AC_MSG_RESULT(yes)
306135446Strhodes		ISC_PLATFORM_HAVELIFCONF="#define ISC_PLATFORM_HAVELIFCONF 1"],
307135446Strhodes	[AC_MSG_RESULT(no)
308135446Strhodes		ISC_PLATFORM_HAVELIFCONF="#undef ISC_PLATFORM_HAVELIFCONF"])
309135446StrhodesAC_SUBST(ISC_PLATFORM_HAVELIFCONF)
310135446Strhodes
311135446Strhodes
312135446Strhodes#
313135446Strhodes# check if we need to #include sys/select.h explicitly
314135446Strhodes#
315135446Strhodescase $ac_cv_header_unistd_h in
316135446Strhodesyes)
317135446StrhodesAC_MSG_CHECKING(if unistd.h or sys/types.h defines fd_set)
318135446StrhodesAC_TRY_COMPILE([
319135446Strhodes#include <sys/types.h> /* Ultrix */
320135446Strhodes#include <unistd.h>],
321135446Strhodes[fd_set read_set; return (0);],
322135446Strhodes	[AC_MSG_RESULT(yes)
323135446Strhodes	 ISC_PLATFORM_NEEDSYSSELECTH="#undef ISC_PLATFORM_NEEDSYSSELECTH"
324135446Strhodes	 LWRES_PLATFORM_NEEDSYSSELECTH="#undef LWRES_PLATFORM_NEEDSYSSELECTH"],
325135446Strhodes	[AC_MSG_RESULT(no)
326135446Strhodes	case $ac_cv_header_sys_select_h in
327135446Strhodes	yes)
328135446Strhodes         ISC_PLATFORM_NEEDSYSSELECTH="#define ISC_PLATFORM_NEEDSYSSELECTH 1"
329135446Strhodes	 LWRES_PLATFORM_NEEDSYSSELECTH="#define LWRES_PLATFORM_NEEDSYSSELECTH 1"
330135446Strhodes		;;
331135446Strhodes	no)
332135446Strhodes		AC_MSG_ERROR([need either working unistd.h or sys/select.h])
333135446Strhodes		;;
334135446Strhodes	esac
335135446Strhodes	])
336135446Strhodes	;;
337135446Strhodesno)
338135446Strhodes	case $ac_cv_header_sys_select_h in
339135446Strhodes	yes)
340135446Strhodes             ISC_PLATFORM_NEEDSYSSELECTH="#define ISC_PLATFORM_NEEDSYSSELECTH 1"
341135446Strhodes	     LWRES_PLATFORM_NEEDSYSSELECTH="#define LWRES_PLATFORM_NEEDSYSSELECTH 1"
342135446Strhodes		;;
343135446Strhodes	no)
344135446Strhodes		AC_MSG_ERROR([need either unistd.h or sys/select.h])
345135446Strhodes		;;
346135446Strhodes	esac
347135446Strhodes	;;
348135446Strhodesesac
349135446StrhodesAC_SUBST(ISC_PLATFORM_NEEDSYSSELECTH)
350135446StrhodesAC_SUBST(LWRES_PLATFORM_NEEDSYSSELECTH)
351135446Strhodes
352135446Strhodes#
353135446Strhodes# Find the machine's endian flavor.
354135446Strhodes#
355135446StrhodesAC_C_BIGENDIAN
356135446Strhodes
357135446Strhodes#
358135446Strhodes# was --with-openssl specified?
359135446Strhodes#
360135446StrhodesAC_MSG_CHECKING(for OpenSSL library)
361135446StrhodesAC_ARG_WITH(openssl,
362135446Strhodes[  --with-openssl[=PATH]   Build with OpenSSL [yes|no|path].
363135446Strhodes                          (Required for DNSSEC)],
364135446Strhodes    use_openssl="$withval", use_openssl="auto")
365135446Strhodes
366143731Sdougbopenssldirs="/usr /usr/local /usr/local/ssl /usr/pkg"
367143731Sdougbif test "$use_openssl" = "auto"
368143731Sdougbthen
369143731Sdougb	for d in $openssldirs
370143731Sdougb	do
371143731Sdougb		if test -f $d/include/openssl/opensslv.h
372143731Sdougb		then
373143731Sdougb			use_openssl=$d
374143731Sdougb			break
375143731Sdougb		fi
376143731Sdougb	done
377143731Sdougbfi
378135446Strhodescase "$use_openssl" in
379135446Strhodes	no)
380135446Strhodes		AC_MSG_RESULT(no)
381135446Strhodes		DST_OPENSSL_INC=""
382135446Strhodes		USE_OPENSSL=""
383135446Strhodes		;;
384143731Sdougb	auto)
385143731Sdougb		DST_OPENSSL_INC=""
386143731Sdougb		USE_OPENSSL=""
387143731Sdougb		AC_MSG_RESULT(not found)
388143731Sdougb		;;
389135446Strhodes	*)
390143731Sdougb		if test "$use_openssl" = "yes"
391135446Strhodes		then
392135446Strhodes		    	# User did not specify a path - guess it
393135446Strhodes			for d in $openssldirs
394135446Strhodes			do
395135446Strhodes				if test -f $d/include/openssl/opensslv.h
396135446Strhodes				then
397135446Strhodes				 	use_openssl=$d
398135446Strhodes					break
399135446Strhodes				fi
400135446Strhodes			done
401135446Strhodes			if test "$use_openssl" = "yes"
402135446Strhodes			then
403135446Strhodes			    	AC_MSG_RESULT(not found)
404135446Strhodes				AC_MSG_ERROR(
405135446Strhodes[OpenSSL was not found in any of $openssldirs; use --with-openssl=/path])
406135446Strhodes			fi
407135446Strhodes		fi
408135446Strhodes		USE_OPENSSL='-DOPENSSL'
409135446Strhodes		if test "$use_openssl" = "/usr"
410135446Strhodes		then
411135446Strhodes			DST_OPENSSL_INC=""
412135446Strhodes			DNS_OPENSSL_LIBS="-lcrypto"
413135446Strhodes		else
414135446Strhodes			DST_OPENSSL_INC="-I$use_openssl/include"
415135446Strhodes			case $host in
416135446Strhodes			*-solaris*)
417135446Strhodes				DNS_OPENSSL_LIBS="-L$use_openssl/lib -R$use_openssl/lib -lcrypto"
418135446Strhodes				;;
419135446Strhodes			*)
420135446Strhodes				DNS_OPENSSL_LIBS="-L$use_openssl/lib -lcrypto"
421135446Strhodes				;;
422135446Strhodes			esac
423135446Strhodes		fi
424135446Strhodes		AC_MSG_RESULT(using openssl from $use_openssl/lib and $use_openssl/include)
425135446Strhodes
426135446Strhodes		saved_cflags="$CFLAGS"
427135446Strhodes		saved_libs="$LIBS"
428135446Strhodes		CFLAGS="$CFLAGS $DST_OPENSSL_INC"
429135446Strhodes		LIBS="$LIBS $DNS_OPENSSL_LIBS"
430135446Strhodes		AC_MSG_CHECKING(whether linking with OpenSSL works)
431135446Strhodes		AC_TRY_RUN([
432135446Strhodes#include <openssl/err.h>
433135446Strhodesint main() {
434135446Strhodes	ERR_clear_error();
435135446Strhodes	return (0);
436135446Strhodes}
437135446Strhodes],
438135446Strhodes	        [AC_MSG_RESULT(yes)],
439135446Strhodes		[AC_MSG_RESULT(no)
440135446Strhodes		 AC_MSG_ERROR(Could not run test program using OpenSSL from
441135446Strhodes$use_openssl/lib and $use_openssl/include.
442135446StrhodesPlease check the argument to --with-openssl and your
443135446Strhodesshared library configuration (e.g., LD_LIBRARY_PATH).)],
444135446Strhodes		[AC_MSG_RESULT(assuming it does work on target platform)])
445135446Strhodes
446135446Strhodes		AC_MSG_CHECKING(whether linking with OpenSSL requires -ldl)
447135446Strhodes		AC_TRY_LINK([
448135446Strhodes#include <openssl/err.h>],
449135446Strhodes[ DSO_METHOD_dlfcn(); ],
450135446Strhodes		[AC_MSG_RESULT(no)],
451135446Strhodes		[LIBS="$LIBS -ldl"
452135446Strhodes		AC_TRY_LINK([
453135446Strhodes#include <openssl/err.h>
454135446Strhodes],[ DSO_METHOD_dlfcn(); ],
455135446Strhodes		[AC_MSG_RESULT(yes)
456135446Strhodes		DNS_OPENSSL_LIBS="$DNS_OPENSSL_LIBS -ldl"
457135446Strhodes		],
458135446Strhodes		 [AC_MSG_RESULT(unknown)
459135446Strhodes		 AC_MSG_ERROR(OpenSSL has unsupported dynamic loading)],
460135446Strhodes		[AC_MSG_RESULT(assuming it does work on target platform)])
461135446Strhodes		],
462135446Strhodes		[AC_MSG_RESULT(assuming it does work on target platform)]
463135446Strhodes		)
464135446Strhodes		 
465135446Strhodes#
466135446Strhodes#	OpenSSLDie is new with CERT CS-2002-23.  If we see it we have may
467135446Strhodes#	have a patched library otherwise check that we are greater than
468135446Strhodes#	the fixed versions
469135446Strhodes#
470135446Strhodes		AC_CHECK_FUNC(OpenSSLDie,
471135446Strhodes		AC_MSG_CHECKING(OpenSSL library version)
472135446Strhodes		AC_TRY_RUN([
473135446Strhodes#include <stdio.h>
474135446Strhodes#include <openssl/opensslv.h>
475135446Strhodesint main() {
476135446Strhodes        if (OPENSSL_VERSION_NUMBER >= 0x0090581fL)
477135446Strhodes                return (0);
478135446Strhodes	printf("\n\nFound   OPENSSL_VERSION_NUMBER %#010x\n",
479135446Strhodes		OPENSSL_VERSION_NUMBER);
480135446Strhodes	printf("Require OPENSSL_VERSION_NUMBER 0x0090581f or greater\n\n");
481135446Strhodes        return (1);
482135446Strhodes}
483135446Strhodes],
484135446Strhodes	        [AC_MSG_RESULT(ok)],
485135446Strhodes		[AC_MSG_RESULT(not compatible)
486135446Strhodes		 AC_MSG_ERROR(you need OpenSSL 0.9.5a or newer)],
487135446Strhodes		[AC_MSG_RESULT(assuming target platform has compatible version)])
488135446Strhodes		,
489135446Strhodes	        AC_MSG_RESULT(did not find fixes for CERT CA-2002-23)
490135446Strhodes		AC_MSG_CHECKING(OpenSSL library version)
491135446Strhodes		AC_TRY_RUN([
492135446Strhodes#include <stdio.h>
493135446Strhodes#include <openssl/opensslv.h>
494135446Strhodesint main() {
495135446Strhodes        if ((OPENSSL_VERSION_NUMBER >= 0x0090605fL &&
496135446Strhodes	     OPENSSL_VERSION_NUMBER < 0x009070000L) ||
497135446Strhodes	     OPENSSL_VERSION_NUMBER >= 0x00907003L)
498135446Strhodes                return (0);
499135446Strhodes	printf("\n\nFound   OPENSSL_VERSION_NUMBER %#010x\n",
500135446Strhodes		OPENSSL_VERSION_NUMBER);
501135446Strhodes	printf("Require OPENSSL_VERSION_NUMBER 0x0090605f or greater (0.9.6e)\n"
502135446Strhodes	       "Require OPENSSL_VERSION_NUMBER 0x00907003 or greater (0.9.7-beta2)\n\n");
503135446Strhodes        return (1);
504135446Strhodes}
505135446Strhodes],
506135446Strhodes	        [AC_MSG_RESULT(ok)],
507135446Strhodes		[AC_MSG_RESULT(not compatible)
508135446Strhodes		 AC_MSG_ERROR(you need OpenSSL 0.9.6e/0.9.7-beta2 (or newer): CERT CA-2002-23)],
509135446Strhodes		[AC_MSG_RESULT(assuming target platform has compatible version)]))
510135446Strhodes		AC_MSG_CHECKING(for OpenSSL DSA support)
511135446Strhodes		if test -f $use_openssl/include/openssl/dsa.h
512135446Strhodes		then
513135446Strhodes			AC_DEFINE(HAVE_OPENSSL_DSA)
514135446Strhodes			AC_MSG_RESULT(yes)
515135446Strhodes		else
516135446Strhodes			AC_MSG_RESULT(no)
517135446Strhodes		fi
518135446Strhodes		CFLAGS="$saved_cflags"
519135446Strhodes		LIBS="$saved_libs"
520135446Strhodes		;;
521135446Strhodesesac
522135446Strhodes
523135446Strhodes#
524135446Strhodes# This would include the system openssl path (and linker options to use
525135446Strhodes# it as needed) if it is found.
526135446Strhodes#
527135446Strhodes
528135446StrhodesAC_SUBST(USE_OPENSSL)
529135446StrhodesAC_SUBST(DST_OPENSSL_INC)
530135446StrhodesDNS_CRYPTO_LIBS="$DNS_CRYPTO_LIBS $DNS_OPENSSL_LIBS"
531135446Strhodes
532135446Strhodes#
533135446Strhodes# was --with-gssapi specified?
534135446Strhodes#
535135446Strhodes#AC_MSG_CHECKING(for GSSAPI library)
536135446Strhodes#AC_ARG_WITH(gssapi,
537135446Strhodes#[  --with-gssapi=PATH   Specify path for system-supplied GSSAPI],
538135446Strhodes#    use_gssapi="$withval", use_gssapi="no")
539135446Strhodes#
540135446Strhodes#case "$use_gssapi" in
541135446Strhodes#	no)
542135446Strhodes#		USE_GSSAPI=''
543135446Strhodes#		DST_GSSAPI_INC=''
544135446Strhodes#		DNS_GSSAPI_LIBS=''
545135446Strhodes#		AC_MSG_RESULT(not specified)
546135446Strhodes#		;;
547135446Strhodes#	yes)
548135446Strhodes#		AC_MSG_ERROR([--with-gssapi must specify a path])
549135446Strhodes#		;;
550135446Strhodes#	*)
551135446Strhodes#		USE_GSSAPI='-DGSSAPI'
552135446Strhodes#		DST_GSSAPI_INC="-I$use_gssapi/include"
553135446Strhodes#		DNS_GSSAPI_LIBS="-L$use_gssapi/lib -lgssapi_krb5"
554135446Strhodes#		AC_MSG_RESULT(using gssapi from $use_gssapi/lib and $use_gssapi/include)
555135446Strhodes#		;;
556135446Strhodes#esac
557135446Strhodes
558135446StrhodesUSE_GSSAPI=''
559135446StrhodesDST_GSSAPI_INC=''
560135446StrhodesDNS_GSSAPI_LIBS=''
561135446Strhodes
562135446StrhodesAC_SUBST(USE_GSSAPI)
563135446StrhodesAC_SUBST(DST_GSSAPI_INC)
564135446StrhodesDNS_CRYPTO_LIBS="$DNS_CRYPTO_LIBS $DNS_GSSAPI_LIBS"
565135446Strhodes
566135446Strhodes#
567135446Strhodes# Applications linking with libdns also need to link with these libraries.
568135446Strhodes#
569135446Strhodes
570135446StrhodesAC_SUBST(DNS_CRYPTO_LIBS)
571135446Strhodes
572135446Strhodes#
573135446Strhodes# was --with-randomdev specified?
574135446Strhodes#
575135446StrhodesAC_MSG_CHECKING(for random device)
576135446StrhodesAC_ARG_WITH(randomdev,
577135446Strhodes[  --with-randomdev=PATH Specify path for random device],
578135446Strhodes    use_randomdev="$withval", use_randomdev="unspec")
579135446Strhodes
580135446Strhodescase "$use_randomdev" in
581135446Strhodes	unspec)
582135446Strhodes		case "$host" in
583135446Strhodes			*-openbsd*)
584135446Strhodes				devrandom=/dev/arandom
585135446Strhodes				;;
586135446Strhodes			*)
587135446Strhodes				devrandom=/dev/random
588135446Strhodes				;;
589135446Strhodes		esac
590135446Strhodes		AC_MSG_RESULT($devrandom)
591135446Strhodes		AC_CHECK_FILE($devrandom,
592135446Strhodes			      AC_DEFINE_UNQUOTED(PATH_RANDOMDEV,
593135446Strhodes						 "$devrandom"),)
594135446Strhodes		;;
595135446Strhodes	yes)
596135446Strhodes		AC_MSG_ERROR([--with-randomdev must specify a path])
597135446Strhodes		;;
598135446Strhodes	no)
599135446Strhodes		AC_MSG_RESULT(disabled)
600135446Strhodes		;;
601135446Strhodes	*)
602135446Strhodes		AC_DEFINE_UNQUOTED(PATH_RANDOMDEV, "$use_randomdev")
603135446Strhodes		AC_MSG_RESULT(using "$use_randomdev")
604135446Strhodes		;;
605135446Strhodesesac
606135446Strhodes
607135446Strhodes#
608135446Strhodes# Do we have arc4random() ?
609135446Strhodes#
610135446StrhodesAC_CHECK_FUNC(arc4random, AC_DEFINE(HAVE_ARC4RANDOM))
611135446Strhodes
612153816Sdougbsinclude(config.threads.in)dnl
613135446Strhodes
614135446Strhodesif $use_threads
615135446Strhodesthen
616135446Strhodes	#
617135446Strhodes	# We'd like to use sigwait() too
618135446Strhodes	#
619135446Strhodes	AC_CHECK_LIB(c, sigwait,
620135446Strhodes		     AC_DEFINE(HAVE_SIGWAIT),
621135446Strhodes		     AC_CHECK_LIB(pthread, sigwait,
622135446Strhodes				  AC_DEFINE(HAVE_SIGWAIT),
623135446Strhodes				  AC_CHECK_LIB(pthread, _Psigwait,
624135446Strhodes					       AC_DEFINE(HAVE_SIGWAIT),))
625135446Strhodes	)
626135446Strhodes
627135446Strhodes	AC_CHECK_FUNC(pthread_attr_getstacksize,
628135446Strhodes		      AC_DEFINE(HAVE_PTHREAD_ATTR_GETSTACKSIZE),)
629135446Strhodes
630135446Strhodes	AC_CHECK_FUNC(pthread_attr_setstacksize,
631135446Strhodes		      AC_DEFINE(HAVE_PTHREAD_ATTR_SETSTACKSIZE),)
632135446Strhodes
633135446Strhodes	#
634135446Strhodes	# Additional OS-specific issues related to pthreads and sigwait.
635135446Strhodes	#
636135446Strhodes	case "$host" in
637135446Strhodes		#
638135446Strhodes		# One more place to look for sigwait.
639135446Strhodes		#
640135446Strhodes		*-freebsd*)
641135446Strhodes			AC_CHECK_LIB(c_r, sigwait, AC_DEFINE(HAVE_SIGWAIT),)
642143731Sdougb			case $host in
643153816Sdougb			*-freebsd5.[[012]]|*-freebsd5.[[012]].*);;
644153816Sdougb			*-freebsd5.[[3456789]]|*-freebsd5.[[3456789]].*)
645143731Sdougb				AC_DEFINE(NEED_PTHREAD_SCOPE_SYSTEM)
646143731Sdougb				;;
647153816Sdougb			*-freebsd6.*)
648153816Sdougb				AC_DEFINE(NEED_PTHREAD_SCOPE_SYSTEM)
649153816Sdougb				;;
650143731Sdougb			esac
651135446Strhodes			;;
652135446Strhodes		#
653135446Strhodes		# BSDI 3.0 through 4.0.1 needs pthread_init() to be
654135446Strhodes		# called before certain pthreads calls.	 This is deprecated
655135446Strhodes		# in BSD/OS 4.1.
656135446Strhodes		#
657135446Strhodes		*-bsdi3.*|*-bsdi4.0*)
658135446Strhodes			AC_DEFINE(NEED_PTHREAD_INIT)
659135446Strhodes			;;
660135446Strhodes		#
661135446Strhodes		# LinuxThreads requires some changes to the way we
662135446Strhodes		# deal with signals.
663135446Strhodes		#
664135446Strhodes		*-linux*)
665135446Strhodes			AC_DEFINE(HAVE_LINUXTHREADS)
666135446Strhodes			;;
667135446Strhodes		#
668135446Strhodes		# Ensure the right sigwait() semantics on Solaris and make
669135446Strhodes		# sure we call pthread_setconcurrency.
670135446Strhodes		#
671135446Strhodes		*-solaris*)
672135446Strhodes			AC_DEFINE(_POSIX_PTHREAD_SEMANTICS)
673135446Strhodes			AC_CHECK_FUNC(pthread_setconcurrency,
674135446Strhodes				      AC_DEFINE(CALL_PTHREAD_SETCONCURRENCY))
675135446Strhodes			;;
676135446Strhodes		#
677135446Strhodes		# UnixWare does things its own way.
678135446Strhodes		#
679135446Strhodes		*-sco-sysv*uw*|*-*-sysv*UnixWare*|*-*-sysv*OpenUNIX*)
680135446Strhodes			AC_DEFINE(HAVE_UNIXWARE_SIGWAIT)
681135446Strhodes			;;
682135446Strhodes	esac
683135446Strhodes
684135446Strhodes	#
685135446Strhodes	# Look for sysconf to allow detection of the number of processors.
686135446Strhodes	#
687135446Strhodes	AC_CHECK_FUNC(sysconf, AC_DEFINE(HAVE_SYSCONF),)
688135446Strhodes
689135446Strhodes	if test "X$GCC" = "Xyes"; then
690135446Strhodes		case "$host" in
691135446Strhodes		*-freebsd*)
692135446Strhodes			CC="$CC -pthread"
693135446Strhodes			CCOPT="$CCOPT -pthread"
694135446Strhodes			STD_CDEFINES="$STD_CDEFINES -D_THREAD_SAFE"
695135446Strhodes			;;
696135446Strhodes		*-openbsd*)
697135446Strhodes			CC="$CC -pthread"
698135446Strhodes			CCOPT="$CCOPT -pthread"
699135446Strhodes			;;
700135446Strhodes		*-solaris*)
701135446Strhodes			LIBS="$LIBS -lthread"
702135446Strhodes			;;
703135446Strhodes		*-ibm-aix*)
704135446Strhodes			STD_CDEFINES="$STD_CDEFINES -D_THREAD_SAFE"
705135446Strhodes			;;
706135446Strhodes		esac
707135446Strhodes	else
708135446Strhodes		case $host in
709135446Strhodes		*-dec-osf*)
710135446Strhodes			CC="$CC -pthread"
711135446Strhodes			CCOPT="$CCOPT -pthread"
712135446Strhodes			;;
713135446Strhodes		*-solaris*)
714135446Strhodes			CC="$CC -mt"
715135446Strhodes			CCOPT="$CCOPT -mt"
716135446Strhodes			;;
717135446Strhodes		*-ibm-aix*)
718135446Strhodes			STD_CDEFINES="$STD_CDEFINES -D_THREAD_SAFE"
719135446Strhodes			;;
720135446Strhodes		*-sco-sysv*uw*|*-*-sysv*UnixWare*)
721135446Strhodes			CC="$CC -Kthread"
722135446Strhodes			CCOPT="$CCOPT -Kthread"
723135446Strhodes			;;
724135446Strhodes		*-*-sysv*OpenUNIX*)
725135446Strhodes			CC="$CC -Kpthread"
726135446Strhodes			CCOPT="$CCOPT -Kpthread"
727135446Strhodes			;;
728135446Strhodes		esac
729135446Strhodes	fi
730135446Strhodes	ALWAYS_DEFINES="-D_REENTRANT"
731135446Strhodes	ISC_PLATFORM_USETHREADS="#define ISC_PLATFORM_USETHREADS 1"
732135446Strhodes	thread_dir=pthreads
733135446Strhodeselse
734135446Strhodes	ISC_PLATFORM_USETHREADS="#undef ISC_PLATFORM_USETHREADS"
735135446Strhodes	thread_dir=nothreads
736135446Strhodes	ALWAYS_DEFINES=""
737135446Strhodesfi
738135446Strhodes
739135446StrhodesAC_SUBST(ALWAYS_DEFINES)
740135446StrhodesAC_SUBST(ISC_PLATFORM_USETHREADS)
741135446StrhodesISC_THREAD_DIR=$thread_dir
742135446StrhodesAC_SUBST(ISC_THREAD_DIR)
743135446Strhodes
744135446Strhodes#
745135446Strhodes# In solaris 10, SMF can manage named service
746135446Strhodes#
747135446StrhodesAC_CHECK_LIB(scf, smf_enable_instance)
748135446Strhodes
749135446Strhodes#
750135446Strhodes# flockfile is usually provided by pthreads, but we may want to use it
751135446Strhodes# even if compiled with --disable-threads.  getc_unlocked might also not
752135446Strhodes# be defined.
753135446Strhodes#
754135446StrhodesAC_CHECK_FUNC(flockfile, AC_DEFINE(HAVE_FLOCKFILE),)
755135446StrhodesAC_CHECK_FUNC(getc_unlocked, AC_DEFINE(HAVE_GETCUNLOCKED),)
756135446Strhodes
757135446Strhodes# 
758135446Strhodes# Indicate what the final decision was regarding threads.
759135446Strhodes#
760135446StrhodesAC_MSG_CHECKING(whether to build with threads)
761135446Strhodesif $use_threads; then
762135446Strhodes	AC_MSG_RESULT(yes)
763135446Strhodeselse
764135446Strhodes	AC_MSG_RESULT(no)
765135446Strhodesfi
766135446Strhodes
767135446Strhodes# 
768135446Strhodes# End of pthreads stuff.
769135446Strhodes#
770135446Strhodes
771135446Strhodes#
772135446Strhodes# Large File
773135446Strhodes#
774135446StrhodesAC_ARG_ENABLE(largefile, [  --enable-largefile	  64-bit file support],
775135446Strhodes	      want_largefile="yes", want_largefile="no")
776135446Strhodescase $want_largefile in
777135446Strhodes	yes)
778135446Strhodes		ALWAYS_DEFINES="$ALWAYS_DEFINES -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
779135446Strhodes		;;
780135446Strhodes	*)
781135446Strhodes		;;
782135446Strhodesesac
783135446Strhodes
784135446Strhodes#
785135446Strhodes# Additional compiler settings.
786135446Strhodes#
787135446StrhodesMKDEPCC="$CC"
788135446StrhodesMKDEPCFLAGS="-M"
789135446StrhodesIRIX_DNSSEC_WARNINGS_HACK=""
790135446Strhodes
791135446Strhodesif test "X$GCC" = "Xyes"; then
792135446Strhodes	STD_CWARNINGS="$STD_CWARNINGS -W -Wall -Wmissing-prototypes -Wcast-qual -Wwrite-strings -Wformat"
793143731Sdougb	case "$host" in
794143731Sdougb	*-hp-hpux*)
795153816Sdougb		LDFLAGS="-Wl,+vnocompatwarnings $LDFLAGS"
796143731Sdougb		;;
797143731Sdougb	esac
798135446Strhodeselse
799135446Strhodes	case $host in
800135446Strhodes	*-dec-osf*)
801135446Strhodes		CC="$CC -std"
802135446Strhodes		CCOPT="$CCOPT -std"
803135446Strhodes		MKDEPCC="$CC"
804135446Strhodes		;;
805135446Strhodes	*-hp-hpux*)
806135446Strhodes		CC="$CC -Ae -z"
807135446Strhodes		# The version of the C compiler that constantly warns about
808135446Strhodes                # 'const' as well as alignment issues is unfortunately not
809135446Strhodes                # able to be discerned via the version of the operating
810135446Strhodes                # system, nor does cc have a version flag.
811135446Strhodes		case "`$CC +W 123 2>&1`" in
812135446Strhodes		*Unknown?option*)
813135446Strhodes			STD_CWARNINGS="+w1"
814135446Strhodes			;;
815135446Strhodes		*)
816135446Strhodes			# Turn off the pointlessly noisy warnings.
817153816Sdougb			STD_CWARNINGS="+w1 +W 474,530,2193,2236"
818135446Strhodes			;;
819135446Strhodes		esac
820135446Strhodes		CCOPT="$CCOPT -Ae -z"
821153816Sdougb		LDFLAGS="-Wl,+vnocompatwarnings $LDFLAGS"
822135446Strhodes		MKDEPPROG='cc -Ae -E -Wp,-M >/dev/null 2>>$TMP'
823135446Strhodes		;;
824135446Strhodes	*-sgi-irix*)
825135446Strhodes		STD_CWARNINGS="-fullwarn -woff 1209"
826135446Strhodes		#
827135446Strhodes		# Silence more than 250 instances of
828135446Strhodes		#   "prototyped function redeclared without prototype"
829135446Strhodes		# and 11 instances of
830135446Strhodes		#   "variable ... was set but never used"
831135446Strhodes		# from lib/dns/sec/openssl.
832135446Strhodes		#
833135446Strhodes		IRIX_DNSSEC_WARNINGS_HACK="-woff 1692,1552"
834135446Strhodes		;;
835135446Strhodes	*-solaris*)
836135446Strhodes		MKDEPCFLAGS="-xM"
837135446Strhodes		;;
838135446Strhodes	*-sco-sysv*uw*|*-*-sysv*UnixWare*|*-*-sysv*OpenUNIX*)
839135446Strhodes                # UnixWare
840135446Strhodes		CC="$CC -w"
841135446Strhodes		;;
842135446Strhodes	esac
843135446Strhodesfi
844135446Strhodes
845135446StrhodesAC_SUBST(MKDEPCC)
846135446StrhodesAC_SUBST(MKDEPCFLAGS)
847135446StrhodesAC_SUBST(MKDEPPROG)
848135446StrhodesAC_SUBST(IRIX_DNSSEC_WARNINGS_HACK)
849135446Strhodes
850135446Strhodes#
851135446Strhodes# NLS
852135446Strhodes#
853135446StrhodesAC_CHECK_FUNC(catgets, AC_DEFINE(HAVE_CATGETS),)
854135446Strhodes
855135446Strhodes#
856135446Strhodes# -lxnet buys us one big porting headache...  standards, gotta love 'em.
857135446Strhodes#
858135446Strhodes# AC_CHECK_LIB(xnet, socket, ,
859135446Strhodes#    AC_CHECK_LIB(socket, socket)
860135446Strhodes#    AC_CHECK_LIB(nsl, inet_ntoa)
861135446Strhodes# )
862135446Strhodes#
863135446Strhodes# Use this for now, instead:
864135446Strhodes#
865135446Strhodescase "$host" in
866135446Strhodes	mips-sgi-irix*)
867135446Strhodes		;;
868135446Strhodes	*)
869135446Strhodes		AC_CHECK_LIB(socket, socket)
870135446Strhodes		AC_CHECK_LIB(nsl, inet_ntoa)
871135446Strhodes		;;
872135446Strhodesesac
873135446Strhodes
874135446Strhodes#
875135446Strhodes# Purify support
876135446Strhodes#
877135446StrhodesAC_MSG_CHECKING(whether to use purify)
878135446StrhodesAC_ARG_WITH(purify,
879135446Strhodes	[  --with-purify[=PATH]	use Rational purify],
880135446Strhodes	use_purify="$withval", use_purify="no")
881135446Strhodes
882135446Strhodescase "$use_purify" in
883135446Strhodes	no)
884135446Strhodes		;;
885135446Strhodes	yes)
886135446Strhodes		AC_PATH_PROG(purify_path, purify, purify)
887135446Strhodes		;;
888135446Strhodes	*)
889135446Strhodes		purify_path="$use_purify"
890135446Strhodes		;;
891135446Strhodesesac
892135446Strhodes
893135446Strhodescase "$use_purify" in
894135446Strhodes	no)
895135446Strhodes		AC_MSG_RESULT(no)
896135446Strhodes		PURIFY=""
897135446Strhodes		;;
898135446Strhodes	*)
899135446Strhodes		if test -f $purify_path || test $purify_path = purify; then
900135446Strhodes			AC_MSG_RESULT($purify_path)
901135446Strhodes			PURIFYFLAGS="`echo $PURIFYOPTIONS`"
902135446Strhodes			PURIFY="$purify_path $PURIFYFLAGS"
903135446Strhodes		else
904135446Strhodes			AC_MSG_ERROR([$purify_path not found.
905135446Strhodes
906135446StrhodesPlease choose the proper path with the following command:
907135446Strhodes
908135446Strhodes    configure --with-purify=PATH
909135446Strhodes])
910135446Strhodes		fi
911135446Strhodes		;;
912135446Strhodesesac
913135446Strhodes
914135446StrhodesAC_SUBST(PURIFY)
915135446Strhodes
916135446Strhodes#
917135446Strhodes# GNU libtool support
918135446Strhodes#
919135446StrhodesAC_ARG_WITH(libtool,
920135446Strhodes	    [  --with-libtool	use GNU libtool (following indented options supported)],
921135446Strhodes	    use_libtool="$withval", use_libtool="no")
922135446Strhodes
923135446Strhodescase $use_libtool in
924135446Strhodes	yes)
925135446Strhodes		AM_PROG_LIBTOOL
926135446Strhodes		O=lo
927135446Strhodes		A=la
928135446Strhodes		LIBTOOL_MKDEP_SED='s;\.o;\.lo;'
929135446Strhodes		LIBTOOL_MODE_COMPILE='--mode=compile'
930135446Strhodes		LIBTOOL_MODE_INSTALL='--mode=install'
931135446Strhodes		LIBTOOL_MODE_LINK='--mode=link'
932143731Sdougb		case "$host" in
933143731Sdougb		*) LIBTOOL_ALLOW_UNDEFINED= ;;
934143731Sdougb		esac
935143731Sdougb		case "$host" in
936143731Sdougb		*-ibm-aix*) LIBTOOL_IN_MAIN="-Wl,-bI:T_testlist.imp" ;;
937143731Sdougb		*) LIBTOOL_IN_MAIN= ;;
938143731Sdougb		esac;
939135446Strhodes		;;
940135446Strhodes	*)
941135446Strhodes		O=o
942135446Strhodes		A=a
943135446Strhodes		LIBTOOL=
944135446Strhodes		AC_SUBST(LIBTOOL)
945135446Strhodes		LIBTOOL_MKDEP_SED=
946135446Strhodes		LIBTOOL_MODE_COMPILE=
947135446Strhodes		LIBTOOL_MODE_INSTALL=
948135446Strhodes		LIBTOOL_MODE_LINK=
949143731Sdougb		LIBTOOL_ALLOW_UNDEFINED=
950143731Sdougb		LIBTOOL_IN_MAIN=
951135446Strhodes		;;
952135446Strhodesesac
953135446Strhodes
954135446Strhodes#
955135446Strhodes# File name extension for static archive files, for those few places
956135446Strhodes# where they are treated differently from dynamic ones.
957135446Strhodes#
958135446StrhodesSA=a
959135446Strhodes
960135446StrhodesAC_SUBST(O)
961135446StrhodesAC_SUBST(A)
962135446StrhodesAC_SUBST(SA)
963135446StrhodesAC_SUBST(LIBTOOL_MKDEP_SED)
964135446StrhodesAC_SUBST(LIBTOOL_MODE_COMPILE)
965135446StrhodesAC_SUBST(LIBTOOL_MODE_INSTALL)
966135446StrhodesAC_SUBST(LIBTOOL_MODE_LINK)
967143731SdougbAC_SUBST(LIBTOOL_ALLOW_UNDEFINED)
968143731SdougbAC_SUBST(LIBTOOL_IN_MAIN)
969135446Strhodes
970135446Strhodes#
971135446Strhodes# build libbind?
972135446Strhodes#
973135446StrhodesAC_ARG_ENABLE(libbind,
974135446Strhodes	[  --enable-libbind		build libbind [default=no]])
975135446Strhodes
976135446Strhodescase "$enable_libbind" in
977135446Strhodes	yes)
978135446Strhodes		LIBBIND=lib/bind
979135446Strhodes		AC_SUBST(LIBBIND)
980135446Strhodes		;;
981135446Strhodes	no|'')
982135446Strhodes		;;
983135446Strhodesesac
984135446Strhodes
985135446Strhodes#
986135446Strhodes# Here begins a very long section to determine the system's networking
987135446Strhodes# capabilities.  The order of the tests is signficant.
988135446Strhodes#
989135446Strhodes
990135446Strhodes#
991135446Strhodes# IPv6
992135446Strhodes#
993135446StrhodesAC_ARG_ENABLE(ipv6,
994135446Strhodes	[  --enable-ipv6		use IPv6 [default=autodetect]])
995135446Strhodes
996135446Strhodescase "$enable_ipv6" in
997135446Strhodes	yes|''|autodetect)
998135446Strhodes		AC_DEFINE(WANT_IPV6)
999135446Strhodes		;;
1000135446Strhodes	no)
1001135446Strhodes		;;
1002135446Strhodesesac
1003135446Strhodes
1004135446Strhodes#
1005135446Strhodes# We do the IPv6 compilation checking after libtool so that we can put
1006135446Strhodes# the right suffix on the files.
1007135446Strhodes#
1008135446StrhodesAC_MSG_CHECKING(for IPv6 structures)
1009135446StrhodesAC_TRY_COMPILE([
1010135446Strhodes#include <sys/types.h>
1011135446Strhodes#include <sys/socket.h>
1012135446Strhodes#include <netinet/in.h>],
1013135446Strhodes[struct sockaddr_in6 sin6; return (0);],
1014135446Strhodes	[AC_MSG_RESULT(yes)
1015135446Strhodes	 found_ipv6=yes],
1016135446Strhodes	[AC_MSG_RESULT(no)
1017135446Strhodes	 found_ipv6=no])
1018135446Strhodes
1019135446Strhodes#
1020135446Strhodes# See whether IPv6 support is provided via a Kame add-on.
1021135446Strhodes# This is done before other IPv6 linking tests to LIBS is properly set.
1022135446Strhodes#
1023135446StrhodesAC_MSG_CHECKING(for Kame IPv6 support)
1024135446StrhodesAC_ARG_WITH(kame,
1025135446Strhodes	[  --with-kame[=PATH]	use Kame IPv6 [default path /usr/local/v6]],
1026135446Strhodes	use_kame="$withval", use_kame="no")
1027135446Strhodes
1028135446Strhodescase "$use_kame" in
1029135446Strhodes	no)
1030135446Strhodes		;;
1031135446Strhodes	yes)
1032135446Strhodes		kame_path=/usr/local/v6
1033135446Strhodes		;;
1034135446Strhodes	*)
1035135446Strhodes		kame_path="$use_kame"
1036135446Strhodes		;;
1037135446Strhodesesac
1038135446Strhodes
1039135446Strhodescase "$use_kame" in
1040135446Strhodes	no)
1041135446Strhodes		AC_MSG_RESULT(no)
1042135446Strhodes		;;
1043135446Strhodes	*)
1044135446Strhodes		if test -f $kame_path/lib/libinet6.a; then
1045135446Strhodes			AC_MSG_RESULT($kame_path/lib/libinet6.a)
1046135446Strhodes			LIBS="-L$kame_path/lib -linet6 $LIBS"
1047135446Strhodes		else
1048135446Strhodes			AC_MSG_ERROR([$kame_path/lib/libinet6.a not found.
1049135446Strhodes
1050135446StrhodesPlease choose the proper path with the following command:
1051135446Strhodes
1052135446Strhodes    configure --with-kame=PATH
1053135446Strhodes])
1054135446Strhodes		fi
1055135446Strhodes		;;
1056135446Strhodesesac
1057135446Strhodes
1058135446Strhodes#
1059135446Strhodes# Whether netinet6/in6.h is needed has to be defined in isc/platform.h.
1060135446Strhodes# Including it on Kame-using platforms is very bad, though, because
1061135446Strhodes# Kame uses #error against direct inclusion.   So include it on only
1062135446Strhodes# the platform that is otherwise broken without it -- BSD/OS 4.0 through 4.1.
1063135446Strhodes# This is done before the in6_pktinfo check because that's what
1064135446Strhodes# netinet6/in6.h is needed for.
1065135446Strhodes#
1066135446Strhodeschangequote({, })
1067135446Strhodescase "$host" in
1068135446Strhodes*-bsdi4.[01]*)
1069135446Strhodes	ISC_PLATFORM_NEEDNETINET6IN6H="#define ISC_PLATFORM_NEEDNETINET6IN6H 1"
1070135446Strhodes	LWRES_PLATFORM_NEEDNETINET6IN6H="#define LWRES_PLATFORM_NEEDNETINET6IN6H 1"
1071135446Strhodes	isc_netinet6in6_hack="#include <netinet6/in6.h>"
1072135446Strhodes	;;
1073135446Strhodes*)
1074135446Strhodes	ISC_PLATFORM_NEEDNETINET6IN6H="#undef ISC_PLATFORM_NEEDNETINET6IN6H"
1075135446Strhodes	LWRES_PLATFORM_NEEDNETINET6IN6H="#undef LWRES_PLATFORM_NEEDNETINET6IN6H"
1076135446Strhodes	isc_netinet6in6_hack=""
1077135446Strhodes	;;
1078135446Strhodesesac
1079135446Strhodeschangequote([, ])
1080135446Strhodes
1081135446Strhodes#
1082135446Strhodes# This is similar to the netinet6/in6.h issue.
1083135446Strhodes#
1084135446Strhodescase "$host" in
1085135446Strhodes*-sco-sysv*uw*|*-*-sysv*UnixWare*|*-*-sysv*OpenUNIX*)
1086135446Strhodes        # UnixWare
1087135446Strhodes	ISC_PLATFORM_NEEDNETINETIN6H="#define ISC_PLATFORM_NEEDNETINETIN6H 1"
1088135446Strhodes	LWRES_PLATFORM_NEEDNETINETIN6H="#define LWRES_PLATFORM_NEEDNETINETIN6H 1"
1089135446Strhodes        ISC_PLATFORM_FIXIN6ISADDR="#define ISC_PLATFORM_FIXIN6ISADDR 1"
1090135446Strhodes	isc_netinetin6_hack="#include <netinet/in6.h>"
1091135446Strhodes	;;
1092135446Strhodes*)
1093135446Strhodes	ISC_PLATFORM_NEEDNETINETIN6H="#undef ISC_PLATFORM_NEEDNETINETIN6H"
1094135446Strhodes	LWRES_PLATFORM_NEEDNETINETIN6H="#undef LWRES_PLATFORM_NEEDNETINETIN6H"
1095135446Strhodes        ISC_PLATFORM_FIXIN6ISADDR="#undef ISC_PLATFORM_FIXIN6ISADDR"
1096135446Strhodes	isc_netinetin6_hack=""
1097135446Strhodes	;;
1098135446Strhodesesac
1099135446Strhodes
1100135446Strhodes#
1101135446Strhodes# Now delve deeper into the suitability of the IPv6 support.
1102135446Strhodes#
1103135446Strhodescase "$found_ipv6" in
1104135446Strhodes	yes)
1105135446Strhodes		ISC_PLATFORM_HAVEIPV6="#define ISC_PLATFORM_HAVEIPV6 1"
1106135446Strhodes		LWRES_PLATFORM_HAVEIPV6="#define LWRES_PLATFORM_HAVEIPV6 1"
1107135446Strhodes
1108135446Strhodes		AC_MSG_CHECKING(for in6_addr)
1109135446Strhodes		AC_TRY_COMPILE([
1110135446Strhodes#include <sys/types.h>
1111135446Strhodes#include <sys/socket.h>
1112135446Strhodes#include <netinet/in.h>
1113135446Strhodes$isc_netinetin6_hack
1114135446Strhodes$isc_netinet6in6_hack
1115135446Strhodes],
1116135446Strhodes[struct in6_addr in6; return (0);],
1117135446Strhodes		[AC_MSG_RESULT(yes)
1118135446Strhodes		 ISC_PLATFORM_HAVEINADDR6="#undef ISC_PLATFORM_HAVEINADDR6"
1119135446Strhodes		 LWRES_PLATFORM_HAVEINADDR6="#undef LWRES_PLATFORM_HAVEINADDR6"
1120135446Strhodes		 isc_in_addr6_hack=""],
1121135446Strhodes		[AC_MSG_RESULT(no)
1122135446Strhodes		 ISC_PLATFORM_HAVEINADDR6="#define ISC_PLATFORM_HAVEINADDR6 1"
1123135446Strhodes		 LWRES_PLATFORM_HAVEINADDR6="#define LWRES_PLATFORM_HAVEINADDR6 1"
1124135446Strhodes		 isc_in_addr6_hack="#define in6_addr in_addr6"])
1125135446Strhodes
1126135446Strhodes		AC_MSG_CHECKING(for in6addr_any)
1127135446Strhodes		AC_TRY_LINK([
1128135446Strhodes#include <sys/types.h>
1129135446Strhodes#include <sys/socket.h>
1130135446Strhodes#include <netinet/in.h>
1131135446Strhodes$isc_netinetin6_hack
1132135446Strhodes$isc_netinet6in6_hack
1133135446Strhodes$isc_in_addr6_hack
1134135446Strhodes],
1135135446Strhodes		[struct in6_addr in6; in6 = in6addr_any; return (in6.s6_addr[0]);],
1136135446Strhodes			[AC_MSG_RESULT(yes)
1137135446Strhodes			 ISC_PLATFORM_NEEDIN6ADDRANY="#undef ISC_PLATFORM_NEEDIN6ADDRANY"
1138135446Strhodes			 LWRES_PLATFORM_NEEDIN6ADDRANY="#undef LWRES_PLATFORM_NEEDIN6ADDRANY"],
1139135446Strhodes			[AC_MSG_RESULT(no)
1140135446Strhodes			 ISC_PLATFORM_NEEDIN6ADDRANY="#define ISC_PLATFORM_NEEDIN6ADDRANY 1"
1141135446Strhodes			 LWRES_PLATFORM_NEEDIN6ADDRANY="#define LWRES_PLATFORM_NEEDIN6ADDRANY 1"])
1142135446Strhodes
1143135446Strhodes		AC_MSG_CHECKING(for in6addr_loopback)
1144135446Strhodes		AC_TRY_LINK([
1145135446Strhodes#include <sys/types.h>
1146135446Strhodes#include <sys/socket.h>
1147135446Strhodes#include <netinet/in.h>
1148135446Strhodes$isc_netinetin6_hack
1149135446Strhodes$isc_netinet6in6_hack
1150135446Strhodes$isc_in_addr6_hack
1151135446Strhodes],
1152135446Strhodes		[struct in6_addr in6; in6 = in6addr_loopback; return (in6.s6_addr[0]);],
1153135446Strhodes			[AC_MSG_RESULT(yes)
1154135446Strhodes			 ISC_PLATFORM_NEEDIN6ADDRLOOPBACK="#undef ISC_PLATFORM_NEEDIN6ADDRLOOPBACK"
1155135446Strhodes			 LWRES_PLATFORM_NEEDIN6ADDRLOOPBACK="#undef LWRES_PLATFORM_NEEDIN6ADDRLOOPBACK"],
1156135446Strhodes			[AC_MSG_RESULT(no)
1157135446Strhodes			 ISC_PLATFORM_NEEDIN6ADDRLOOPBACK="#define ISC_PLATFORM_NEEDIN6ADDRLOOPBACK 1"
1158135446Strhodes			 LWRES_PLATFORM_NEEDIN6ADDRLOOPBACK="#define LWRES_PLATFORM_NEEDIN6ADDRLOOPBACK 1"])
1159135446Strhodes
1160135446Strhodes		AC_MSG_CHECKING(for sin6_scope_id in struct sockaddr_in6)
1161135446Strhodes		AC_TRY_COMPILE([
1162135446Strhodes#include <sys/types.h>
1163135446Strhodes#include <sys/socket.h>
1164135446Strhodes#include <netinet/in.h>
1165135446Strhodes$isc_netinetin6_hack
1166135446Strhodes$isc_netinet6in6_hack
1167135446Strhodes],
1168135446Strhodes		[struct sockaddr_in6 xyzzy; xyzzy.sin6_scope_id = 0; return (0);],
1169135446Strhodes			[AC_MSG_RESULT(yes)
1170135446Strhodes			 ISC_PLATFORM_HAVESCOPEID="#define ISC_PLATFORM_HAVESCOPEID 1"
1171135446Strhodes			 result="#define LWRES_HAVE_SIN6_SCOPE_ID 1"],
1172135446Strhodes			[AC_MSG_RESULT(no)
1173135446Strhodes			 ISC_PLATFORM_HAVESCOPEID="#undef ISC_PLATFORM_HAVESCOPEID"
1174135446Strhodes			 result="#undef LWRES_HAVE_SIN6_SCOPE_ID"])
1175135446Strhodes		LWRES_HAVE_SIN6_SCOPE_ID="$result"
1176135446Strhodes
1177135446Strhodes		AC_MSG_CHECKING(for in6_pktinfo)
1178135446Strhodes		AC_TRY_COMPILE([
1179135446Strhodes#include <sys/types.h>
1180135446Strhodes#include <sys/socket.h>
1181135446Strhodes#include <netinet/in.h>
1182135446Strhodes$isc_netinetin6_hack
1183135446Strhodes$isc_netinet6in6_hack
1184135446Strhodes],
1185135446Strhodes		[struct in6_pktinfo xyzzy; return (0);],
1186135446Strhodes			[AC_MSG_RESULT(yes)
1187135446Strhodes			 ISC_PLATFORM_HAVEIN6PKTINFO="#define ISC_PLATFORM_HAVEIN6PKTINFO 1"],
1188135446Strhodes			[AC_MSG_RESULT(no -- disabling runtime ipv6 support)
1189135446Strhodes			 ISC_PLATFORM_HAVEIN6PKTINFO="#undef ISC_PLATFORM_HAVEIN6PKTINFO"])
1190135446Strhodes		;;
1191135446Strhodes	no)
1192135446Strhodes		ISC_PLATFORM_HAVEIPV6="#undef ISC_PLATFORM_HAVEIPV6"
1193135446Strhodes		LWRES_PLATFORM_HAVEIPV6="#undef LWRES_PLATFORM_HAVEIPV6"
1194135446Strhodes		ISC_PLATFORM_NEEDIN6ADDRANY="#undef ISC_PLATFORM_NEEDIN6ADDRANY"
1195135446Strhodes		LWRES_PLATFORM_NEEDIN6ADDRANY="#undef LWRES_PLATFORM_NEEDIN6ADDRANY"
1196135446Strhodes		ISC_PLATFORM_HAVEIN6PKTINFO="#undef ISC_PLATFORM_HAVEIN6PKTINFO"
1197135446Strhodes		LWRES_HAVE_SIN6_SCOPE_ID="#define LWRES_HAVE_SIN6_SCOPE_ID 1"
1198135446Strhodes		ISC_PLATFORM_HAVESCOPEID="#define ISC_PLATFORM_HAVESCOPEID 1"
1199135446Strhodes		ISC_IPV6_H="ipv6.h"
1200135446Strhodes		ISC_IPV6_O="ipv6.$O"
1201135446Strhodes		ISC_ISCIPV6_O="unix/ipv6.$O"
1202135446Strhodes		ISC_IPV6_C="ipv6.c"
1203135446Strhodes		;;
1204135446Strhodesesac
1205135446Strhodes
1206135446StrhodesAC_SUBST(ISC_PLATFORM_HAVEIPV6)
1207135446StrhodesAC_SUBST(LWRES_PLATFORM_HAVEIPV6)
1208135446StrhodesAC_SUBST(ISC_PLATFORM_NEEDNETINETIN6H)
1209135446StrhodesAC_SUBST(LWRES_PLATFORM_NEEDNETINETIN6H)
1210135446StrhodesAC_SUBST(ISC_PLATFORM_NEEDNETINET6IN6H)
1211135446StrhodesAC_SUBST(LWRES_PLATFORM_NEEDNETINET6IN6H)
1212135446StrhodesAC_SUBST(ISC_PLATFORM_HAVEINADDR6)
1213135446StrhodesAC_SUBST(LWRES_PLATFORM_HAVEINADDR6)
1214135446StrhodesAC_SUBST(ISC_PLATFORM_NEEDIN6ADDRANY)
1215135446StrhodesAC_SUBST(LWRES_PLATFORM_NEEDIN6ADDRANY)
1216135446StrhodesAC_SUBST(ISC_PLATFORM_NEEDIN6ADDRLOOPBACK)
1217135446StrhodesAC_SUBST(LWRES_PLATFORM_NEEDIN6ADDRLOOPBACK)
1218135446StrhodesAC_SUBST(ISC_PLATFORM_HAVEIN6PKTINFO)
1219135446StrhodesAC_SUBST(ISC_PLATFORM_FIXIN6ISADDR)
1220135446StrhodesAC_SUBST(ISC_IPV6_H)
1221135446StrhodesAC_SUBST(ISC_IPV6_O)
1222135446StrhodesAC_SUBST(ISC_ISCIPV6_O)
1223135446StrhodesAC_SUBST(ISC_IPV6_C)
1224135446StrhodesAC_SUBST(LWRES_HAVE_SIN6_SCOPE_ID)
1225135446StrhodesAC_SUBST(ISC_PLATFORM_HAVESCOPEID)
1226135446Strhodes
1227135446StrhodesAC_MSG_CHECKING([for struct if_laddrreq])
1228135446StrhodesAC_TRY_LINK([
1229135446Strhodes#include <sys/types.h>
1230135446Strhodes#include <net/if6.h>
1231135446Strhodes],[ struct if_laddrreq a; ],
1232135446Strhodes	[AC_MSG_RESULT(yes)
1233135446Strhodes	ISC_PLATFORM_HAVEIF_LADDRREQ="#define ISC_PLATFORM_HAVEIF_LADDRREQ 1"],
1234135446Strhodes	[AC_MSG_RESULT(no)
1235135446Strhodes	ISC_PLATFORM_HAVEIF_LADDRREQ="#undef ISC_PLATFORM_HAVEIF_LADDRREQ"])
1236135446StrhodesAC_SUBST(ISC_PLATFORM_HAVEIF_LADDRREQ)
1237135446Strhodes
1238135446StrhodesAC_MSG_CHECKING([for struct if_laddrconf])
1239135446StrhodesAC_TRY_LINK([
1240135446Strhodes#include <sys/types.h>
1241135446Strhodes#include <net/if6.h>
1242135446Strhodes],[ struct if_laddrconf a; ],
1243135446Strhodes	[AC_MSG_RESULT(yes)
1244135446Strhodes	ISC_PLATFORM_HAVEIF_LADDRCONF="#define ISC_PLATFORM_HAVEIF_LADDRCONF 1"],
1245135446Strhodes	[AC_MSG_RESULT(no)
1246135446Strhodes	ISC_PLATFORM_HAVEIF_LADDRCONF="#undef ISC_PLATFORM_HAVEIF_LADDRCONF"])
1247135446StrhodesAC_SUBST(ISC_PLATFORM_HAVEIF_LADDRCONF)
1248135446Strhodes
1249135446Strhodes#
1250135446Strhodes# Check for network functions that are often missing.  We do this
1251135446Strhodes# after the libtool checking, so we can put the right suffix on
1252135446Strhodes# the files.  It also needs to come after checking for a Kame add-on,
1253135446Strhodes# which provides some (all?) of the desired functions.
1254135446Strhodes#
1255135446Strhodes
1256135446StrhodesAC_MSG_CHECKING([for inet_ntop with IPv6 support])
1257135446StrhodesAC_TRY_RUN([
1258135446Strhodes#include <sys/types.h>
1259135446Strhodes#include <sys/socket.h>
1260135446Strhodes#include <netinet/in.h>
1261135446Strhodes#include <arpa/inet.h>
1262135446Strhodesmain() {
1263135446Strhodeschar a[16],b[64]; return(inet_ntop(AF_INET6, a, b, sizeof(b)) == (char*)0);}],
1264135446Strhodes        [AC_MSG_RESULT(yes)
1265135446Strhodes        ISC_PLATFORM_NEEDNTOP="#undef ISC_PLATFORM_NEEDNTOP"],
1266135446Strhodes
1267135446Strhodes        [AC_MSG_RESULT(no)
1268135446Strhodes        ISC_EXTRA_OBJS="$ISC_EXTRA_OBJS inet_ntop.$O"
1269135446Strhodes        ISC_EXTRA_SRCS="$ISC_EXTRA_SRCS inet_ntop.c"
1270153816Sdougb        ISC_PLATFORM_NEEDNTOP="#define ISC_PLATFORM_NEEDNTOP 1"],
1271153816Sdougb        [AC_MSG_RESULT(assuming inet_ntop needed)
1272153816Sdougb        ISC_EXTRA_OBJS="$ISC_EXTRA_OBJS inet_ntop.$O"
1273153816Sdougb        ISC_EXTRA_SRCS="$ISC_EXTRA_SRCS inet_ntop.c"
1274135446Strhodes        ISC_PLATFORM_NEEDNTOP="#define ISC_PLATFORM_NEEDNTOP 1"])
1275135446Strhodes
1276135446Strhodes
1277135446Strhodes# On NetBSD 1.4.2 and maybe others, inet_pton() incorrectly accepts
1278135446Strhodes# addresses with less than four octets, like "1.2.3".  Also leading
1279135446Strhodes# zeros should also be rejected.
1280135446Strhodes
1281135446StrhodesAC_MSG_CHECKING([for working inet_pton with IPv6 support])
1282135446StrhodesAC_TRY_RUN([
1283135446Strhodes#include <sys/types.h>
1284135446Strhodes#include <sys/socket.h>
1285135446Strhodes#include <netinet/in.h>
1286135446Strhodes#include <arpa/inet.h>
1287135446Strhodesmain() { char a[16]; return (inet_pton(AF_INET, "1.2.3", a) == 1 ? 1 :
1288135446Strhodes			     inet_pton(AF_INET, "1.2.3.04", a) == 1 ? 1 : 
1289135446Strhodes			     (inet_pton(AF_INET6, "::1.2.3.4", a) != 1)); }],
1290135446Strhodes        [AC_MSG_RESULT(yes)
1291135446Strhodes        ISC_PLATFORM_NEEDPTON="#undef ISC_PLATFORM_NEEDPTON"],
1292135446Strhodes        [AC_MSG_RESULT(no)
1293135446Strhodes        ISC_EXTRA_OBJS="$ISC_EXTRA_OBJS inet_pton.$O"
1294135446Strhodes        ISC_EXTRA_SRCS="$ISC_EXTRA_SRCS inet_pton.c"
1295135446Strhodes        ISC_PLATFORM_NEEDPTON="#define ISC_PLATFORM_NEEDPTON 1"],
1296135446Strhodes	[AC_MSG_RESULT(assuming target platform has working inet_pton)
1297153816Sdougb	ISC_PLATFORM_NEEDPTON="#undef ISC_PLATFORM_NEEDPTON"],
1298153816Sdougb        [AC_MSG_RESULT(assuming inet_pton needed)
1299153816Sdougb        ISC_EXTRA_OBJS="$ISC_EXTRA_OBJS inet_pton.$O"
1300153816Sdougb        ISC_EXTRA_SRCS="$ISC_EXTRA_SRCS inet_pton.c"
1301153816Sdougb        ISC_PLATFORM_NEEDPTON="#define ISC_PLATFORM_NEEDPTON 1"],
1302153816Sdougb        [AC_MSG_RESULT(assuming target platform has working inet_pton)
1303153816Sdougb        ISC_PLATFORM_NEEDPTON="#undef ISC_PLATFORM_NEEDPTON"])
1304135446Strhodes
1305135446StrhodesAC_MSG_CHECKING([for inet_aton])
1306135446StrhodesAC_TRY_LINK([
1307135446Strhodes#include <sys/types.h>
1308135446Strhodes#include <netinet/in.h>
1309135446Strhodes#include <arpa/inet.h>],
1310135446Strhodes        [struct in_addr in; inet_aton(0, &in); return (0);],
1311135446Strhodes        [AC_MSG_RESULT(yes)
1312135446Strhodes        ISC_PLATFORM_NEEDATON="#undef ISC_PLATFORM_NEEDATON"],
1313135446Strhodes
1314135446Strhodes        [AC_MSG_RESULT(no)
1315135446Strhodes        ISC_EXTRA_OBJS="$ISC_EXTRA_OBJS inet_aton.$O"
1316135446Strhodes        ISC_EXTRA_SRCS="$ISC_EXTRA_SRCS inet_aton.c"
1317135446Strhodes        ISC_PLATFORM_NEEDATON="#define ISC_PLATFORM_NEEDATON 1"])
1318135446Strhodes
1319135446StrhodesAC_SUBST(ISC_PLATFORM_NEEDNTOP)
1320135446StrhodesAC_SUBST(ISC_PLATFORM_NEEDPTON)
1321135446StrhodesAC_SUBST(ISC_PLATFORM_NEEDATON)
1322135446Strhodes
1323135446Strhodes#
1324135446Strhodes# Look for a 4.4BSD-style sa_len member in struct sockaddr.
1325135446Strhodes#
1326135446Strhodescase "$host" in
1327135446Strhodes	*-dec-osf*)
1328135446Strhodes		# Turn on 4.4BSD style sa_len support.
1329135446Strhodes		AC_DEFINE(_SOCKADDR_LEN)
1330135446Strhodes		;;
1331135446Strhodesesac
1332135446Strhodes
1333135446StrhodesAC_MSG_CHECKING(for sa_len in struct sockaddr)
1334135446StrhodesAC_TRY_COMPILE([
1335135446Strhodes#include <sys/types.h>
1336135446Strhodes#include <sys/socket.h>],
1337135446Strhodes[struct sockaddr sa; sa.sa_len = 0; return (0);],
1338135446Strhodes	[AC_MSG_RESULT(yes)
1339135446Strhodes	ISC_PLATFORM_HAVESALEN="#define ISC_PLATFORM_HAVESALEN 1"
1340135446Strhodes	LWRES_PLATFORM_HAVESALEN="#define LWRES_PLATFORM_HAVESALEN 1"],
1341135446Strhodes	[AC_MSG_RESULT(no)
1342135446Strhodes	ISC_PLATFORM_HAVESALEN="#undef ISC_PLATFORM_HAVESALEN"
1343135446Strhodes	LWRES_PLATFORM_HAVESALEN="#undef LWRES_PLATFORM_HAVESALEN"])
1344135446StrhodesAC_SUBST(ISC_PLATFORM_HAVESALEN)
1345135446StrhodesAC_SUBST(LWRES_PLATFORM_HAVESALEN)
1346135446Strhodes
1347135446Strhodes#
1348135446Strhodes# Look for a 4.4BSD or 4.3BSD struct msghdr
1349135446Strhodes#
1350135446StrhodesAC_MSG_CHECKING(for struct msghdr flavor)
1351135446StrhodesAC_TRY_COMPILE([
1352135446Strhodes#include <sys/types.h>
1353135446Strhodes#include <sys/socket.h>],
1354135446Strhodes[struct msghdr msg; msg.msg_flags = 0; return (0);],
1355135446Strhodes	[AC_MSG_RESULT(4.4BSD)
1356135446Strhodes	ISC_PLATFORM_MSGHDRFLAVOR="#define ISC_NET_BSD44MSGHDR 1"],
1357135446Strhodes	[AC_MSG_RESULT(4.3BSD)
1358135446Strhodes	ISC_PLATFORM_MSGHDRFLAVOR="#define ISC_NET_BSD43MSGHDR 1"])
1359135446StrhodesAC_SUBST(ISC_PLATFORM_MSGHDRFLAVOR)
1360135446Strhodes
1361135446Strhodes#
1362135446Strhodes# Look for in_port_t.
1363135446Strhodes#
1364135446StrhodesAC_MSG_CHECKING(for type in_port_t)
1365135446StrhodesAC_TRY_COMPILE([
1366135446Strhodes#include <sys/types.h>
1367135446Strhodes#include <netinet/in.h>],
1368135446Strhodes[in_port_t port = 25; return (0);],
1369135446Strhodes	[AC_MSG_RESULT(yes)
1370135446Strhodes	ISC_PLATFORM_NEEDPORTT="#undef ISC_PLATFORM_NEEDPORTT"],
1371135446Strhodes        [AC_MSG_RESULT(no)
1372135446Strhodes	ISC_PLATFORM_NEEDPORTT="#define ISC_PLATFORM_NEEDPORTT 1"])
1373135446StrhodesAC_SUBST(ISC_PLATFORM_NEEDPORTT)
1374135446Strhodes
1375135446Strhodes#
1376135446Strhodes# Check for addrinfo
1377135446Strhodes#
1378135446StrhodesAC_MSG_CHECKING(for struct addrinfo)
1379135446StrhodesAC_TRY_COMPILE([
1380135446Strhodes#include <netdb.h>],
1381135446Strhodes[struct addrinfo a; return (0);],
1382135446Strhodes	[AC_MSG_RESULT(yes)
1383135446Strhodes	ISC_LWRES_NEEDADDRINFO="#undef ISC_LWRES_NEEDADDRINFO"
1384135446Strhodes	AC_DEFINE(HAVE_ADDRINFO)],
1385135446Strhodes	[AC_MSG_RESULT(no)
1386135446Strhodes	ISC_LWRES_NEEDADDRINFO="#define ISC_LWRES_NEEDADDRINFO 1"])
1387135446StrhodesAC_SUBST(ISC_LWRES_NEEDADDRINFO)
1388135446Strhodes
1389135446Strhodes#
1390135446Strhodes# Check for rrsetinfo
1391135446Strhodes#
1392135446StrhodesAC_MSG_CHECKING(for struct rrsetinfo)
1393135446StrhodesAC_TRY_COMPILE([
1394135446Strhodes#include <netdb.h>],
1395135446Strhodes[struct rrsetinfo r; return (0);],
1396135446Strhodes	[AC_MSG_RESULT(yes)
1397135446Strhodes	ISC_LWRES_NEEDRRSETINFO="#undef ISC_LWRES_NEEDRRSETINFO"],
1398135446Strhodes	[AC_MSG_RESULT(no)
1399135446Strhodes	ISC_LWRES_NEEDRRSETINFO="#define ISC_LWRES_NEEDRRSETINFO 1"])
1400135446StrhodesAC_SUBST(ISC_LWRES_NEEDRRSETINFO)
1401135446Strhodes
1402135446StrhodesAC_MSG_CHECKING(for int sethostent)
1403135446StrhodesAC_TRY_COMPILE([
1404135446Strhodes#include <netdb.h>],
1405135446Strhodes[int i = sethostent(0); return(0);],
1406135446Strhodes	[AC_MSG_RESULT(yes)
1407135446Strhodes	ISC_LWRES_SETHOSTENTINT="#define ISC_LWRES_SETHOSTENTINT 1"],
1408135446Strhodes	[AC_MSG_RESULT(no)
1409135446Strhodes	ISC_LWRES_SETHOSTENTINT="#undef ISC_LWRES_SETHOSTENTINT"])
1410135446StrhodesAC_SUBST(ISC_LWRES_SETHOSTENTINT)
1411135446Strhodes
1412135446StrhodesAC_MSG_CHECKING(for int endhostent)
1413135446StrhodesAC_TRY_COMPILE([
1414135446Strhodes#include <netdb.h>],
1415135446Strhodes[int i = endhostent(); return(0);],
1416135446Strhodes	[AC_MSG_RESULT(yes)
1417135446Strhodes	ISC_LWRES_ENDHOSTENTINT="#define ISC_LWRES_ENDHOSTENTINT 1"],
1418135446Strhodes	[AC_MSG_RESULT(no)
1419135446Strhodes	ISC_LWRES_ENDHOSTENTINT="#undef ISC_LWRES_ENDHOSTENTINT"])
1420135446StrhodesAC_SUBST(ISC_LWRES_ENDHOSTENTINT)
1421135446Strhodes
1422135446StrhodesAC_MSG_CHECKING(for getnetbyaddr(in_addr_t, ...))
1423135446StrhodesAC_TRY_COMPILE([
1424135446Strhodes#include <netdb.h>
1425135446Strhodesstruct netent *getnetbyaddr(in_addr_t, int);],
1426135446Strhodes[],
1427135446Strhodes	[AC_MSG_RESULT(yes)
1428135446Strhodes	ISC_LWRES_GETNETBYADDRINADDR="#define ISC_LWRES_GETNETBYADDRINADDR 1"],
1429135446Strhodes	[AC_MSG_RESULT(no)
1430135446Strhodes	ISC_LWRES_GETNETBYADDRINADDR="#undef ISC_LWRES_GETNETBYADDRINADDR"])
1431135446StrhodesAC_SUBST(ISC_LWRES_GETNETBYADDRINADDR)
1432135446Strhodes
1433135446StrhodesAC_MSG_CHECKING(for int setnetent)
1434135446StrhodesAC_TRY_COMPILE([
1435135446Strhodes#include <netdb.h>],
1436135446Strhodes[int i = setnetent(0); return(0);],
1437135446Strhodes	[AC_MSG_RESULT(yes)
1438135446Strhodes	ISC_LWRES_SETNETENTINT="#define ISC_LWRES_SETNETENTINT 1"],
1439135446Strhodes	[AC_MSG_RESULT(no)
1440135446Strhodes	ISC_LWRES_SETNETENTINT="#undef ISC_LWRES_SETNETENTINT"])
1441135446StrhodesAC_SUBST(ISC_LWRES_SETNETENTINT)
1442135446Strhodes
1443135446StrhodesAC_MSG_CHECKING(for int endnetent)
1444135446StrhodesAC_TRY_COMPILE([
1445135446Strhodes#include <netdb.h>],
1446135446Strhodes[int i = endnetent(); return(0);],
1447135446Strhodes	[AC_MSG_RESULT(yes)
1448135446Strhodes	ISC_LWRES_ENDNETENTINT="#define ISC_LWRES_ENDNETENTINT 1"],
1449135446Strhodes	[AC_MSG_RESULT(no)
1450135446Strhodes	ISC_LWRES_ENDNETENTINT="#undef ISC_LWRES_ENDNETENTINT"])
1451135446StrhodesAC_SUBST(ISC_LWRES_ENDNETENTINT)
1452135446Strhodes
1453135446StrhodesAC_MSG_CHECKING(for gethostbyaddr(const void *, size_t, ...))
1454135446StrhodesAC_TRY_COMPILE([
1455135446Strhodes#include <netdb.h>
1456135446Strhodesstruct hostent *gethostbyaddr(const void *, size_t, int);],
1457135446Strhodes[return(0);],
1458135446Strhodes	[AC_MSG_RESULT(yes)
1459135446Strhodes	ISC_LWRES_GETHOSTBYADDRVOID="#define ISC_LWRES_GETHOSTBYADDRVOID 1"],
1460135446Strhodes	[AC_MSG_RESULT(no)
1461135446Strhodes	ISC_LWRES_GETHOSTBYADDRVOID="#undef ISC_LWRES_GETHOSTBYADDRVOID"])
1462135446StrhodesAC_SUBST(ISC_LWRES_GETHOSTBYADDRVOID)
1463135446Strhodes
1464135446StrhodesAC_MSG_CHECKING(for h_errno in netdb.h)
1465135446StrhodesAC_TRY_COMPILE([
1466135446Strhodes#include <netdb.h>],
1467135446Strhodes[h_errno = 1; return(0);],
1468135446Strhodes	[AC_MSG_RESULT(yes)
1469135446Strhodes	ISC_LWRES_NEEDHERRNO="#undef ISC_LWRES_NEEDHERRNO"],
1470135446Strhodes	[AC_MSG_RESULT(no)
1471135446Strhodes	ISC_LWRES_NEEDHERRNO="#define ISC_LWRES_NEEDHERRNO 1"])
1472135446StrhodesAC_SUBST(ISC_LWRES_NEEDHERRNO)
1473135446Strhodes
1474135446StrhodesAC_CHECK_FUNC(getipnodebyname,
1475135446Strhodes        [ISC_LWRES_GETIPNODEPROTO="#undef ISC_LWRES_GETIPNODEPROTO"],
1476135446Strhodes        [ISC_LWRES_GETIPNODEPROTO="#define ISC_LWRES_GETIPNODEPROTO 1"])
1477135446StrhodesAC_CHECK_FUNC(getnameinfo,
1478135446Strhodes        [ISC_LWRES_GETNAMEINFOPROTO="#undef ISC_LWRES_GETNAMEINFOPROTO"],
1479135446Strhodes        [ISC_LWRES_GETNAMEINFOPROTO="#define ISC_LWRES_GETNAMEINFOPROTO 1"])
1480135446StrhodesAC_CHECK_FUNC(getaddrinfo,
1481135446Strhodes        [ISC_LWRES_GETADDRINFOPROTO="#undef ISC_LWRES_GETADDRINFOPROTO"
1482135446Strhodes	AC_DEFINE(HAVE_GETADDRINFO)],
1483135446Strhodes        [ISC_LWRES_GETADDRINFOPROTO="#define ISC_LWRES_GETADDRINFOPROTO 1"])
1484135446StrhodesAC_CHECK_FUNC(gai_strerror, AC_DEFINE(HAVE_GAISTRERROR))
1485135446StrhodesAC_SUBST(ISC_LWRES_GETIPNODEPROTO)
1486135446StrhodesAC_SUBST(ISC_LWRES_GETADDRINFOPROTO)
1487135446StrhodesAC_SUBST(ISC_LWRES_GETNAMEINFOPROTO)
1488135446Strhodes
1489135446StrhodesAC_ARG_ENABLE(getifaddrs,
1490135446Strhodes[  --enable-getifaddrs    Enable the use of getifaddrs() [[yes|no|glibc]].
1491135446Strhodes             glibc: Use getifaddrs() in glibc if you know it supports IPv6.],
1492135446Strhodes    want_getifaddrs="$enableval",  want_getifaddrs="yes")
1493135446Strhodes
1494135446Strhodescase $want_getifaddrs in
1495135446Strhodesyes|glibc)
1496135446Strhodes#
1497135446Strhodes# Do we have getifaddrs() ?
1498135446Strhodes#
1499135446Strhodescase $host in
1500135446Strhodes*-linux*)
1501135446Strhodes	# Some recent versions of glibc support getifaddrs() which does not
1502135446Strhodes	# provide AF_INET6 addresses while the function provided by the USAGI
1503135446Strhodes	# project handles the AF_INET6 case correctly.  We need to avoid
1504135446Strhodes	# using the former but prefer the latter unless overridden by
1505135446Strhodes	# --enable-getifaddrs=glibc.
1506143731Sdougb	if test $want_getifaddrs = glibc
1507135446Strhodes	then
1508135446Strhodes		AC_CHECK_FUNC(getifaddrs, AC_DEFINE(HAVE_GETIFADDRS))
1509135446Strhodes	else
1510135446Strhodes		save_LIBS="$LIBS"
1511135446Strhodes		LIBS="-L/usr/local/v6/lib $LIBS"
1512135446Strhodes		AC_CHECK_LIB(inet6, getifaddrs,
1513135446Strhodes			LIBS="$LIBS -linet6"
1514135446Strhodes			AC_DEFINE(HAVE_GETIFADDRS),
1515135446Strhodes			LIBS=${save_LIBS})
1516135446Strhodes	fi
1517135446Strhodes	;;
1518135446Strhodes*)
1519135446Strhodes	AC_CHECK_FUNC(getifaddrs, AC_DEFINE(HAVE_GETIFADDRS))
1520135446Strhodes	;;
1521135446Strhodesesac
1522135446Strhodes;;
1523135446Strhodesno)
1524135446Strhodes;;
1525135446Strhodesesac
1526135446Strhodes
1527135446Strhodes#
1528135446Strhodes# Look for a sysctl call to get the list of network interfaces.
1529135446Strhodes#
1530135446Strhodescase $ac_cv_header_sys_sysctl_h in
1531135446Strhodesyes)
1532135446StrhodesAC_MSG_CHECKING(for interface list sysctl)
1533135446StrhodesAC_EGREP_CPP(found_rt_iflist, [
1534135446Strhodes#include <sys/param.h>
1535135446Strhodes#include <sys/sysctl.h>
1536135446Strhodes#include <sys/socket.h>
1537135446Strhodes#ifdef NET_RT_IFLIST
1538135446Strhodesfound_rt_iflist
1539135446Strhodes#endif
1540135446Strhodes],
1541135446Strhodes	[AC_MSG_RESULT(yes)
1542135446Strhodes	 AC_DEFINE(HAVE_IFLIST_SYSCTL)],
1543135446Strhodes	[AC_MSG_RESULT(no)])
1544135446Strhodes;;
1545135446Strhodesesac
1546135446Strhodes
1547135446Strhodes#
1548135446Strhodes# Check for some other useful functions that are not ever-present.
1549135446Strhodes#
1550135446Strhodes
1551135446Strhodes# We test for strsep() using AC_TRY_LINK instead of AC_CHECK_FUNC
1552135446Strhodes# because AIX 4.3.3 with patches for bos.adt.include to version 4.3.3.77
1553135446Strhodes# reportedly defines strsep() without declaring it in <string.h> when
1554135446Strhodes# -D_LINUX_SOURCE_COMPAT is not defined [RT #2190], and
1555135446Strhodes# AC_CHECK_FUNC() incorrectly succeeds because it declares
1556135446Strhodes# the function itself.
1557135446StrhodesAC_MSG_CHECKING(for correctly declared strsep())
1558135446StrhodesAC_TRY_LINK([#include <string.h>], [char *sp; char *foo = strsep(&sp, ".");],
1559135446Strhodes	[AC_MSG_RESULT(yes); ISC_PLATFORM_NEEDSTRSEP="#undef ISC_PLATFORM_NEEDSTRSEP"],
1560135446Strhodes	[AC_MSG_RESULT(no); ISC_PLATFORM_NEEDSTRSEP="#define ISC_PLATFORM_NEEDSTRSEP 1"])
1561135446StrhodesAC_SUBST(ISC_PLATFORM_NEEDSTRSEP)
1562135446Strhodes
1563135446StrhodesAC_CHECK_FUNC(memmove,
1564135446Strhodes	[ISC_PLATFORM_NEEDMEMMOVE="#undef ISC_PLATFORM_NEEDMEMMOVE"],
1565135446Strhodes	[ISC_PLATFORM_NEEDMEMMOVE="#define ISC_PLATFORM_NEEDMEMMOVE 1"])
1566135446StrhodesAC_SUBST(ISC_PLATFORM_NEEDMEMMOVE)
1567135446Strhodes
1568135446StrhodesAC_CHECK_FUNC(strtoul,
1569153816Sdougb	[ISC_PLATFORM_NEEDSTRTOUL="#undef ISC_PLATFORM_NEEDSTRTOUL"
1570153816Sdougb	 LWRES_PLATFORM_NEEDSTRTOUL="#undef ISC_PLATFORM_NEEDSTRTOUL"
1571153816Sdougb	 GENRANDOMLIB=""],
1572153816Sdougb	[ISC_PLATFORM_NEEDSTRTOUL="#define ISC_PLATFORM_NEEDSTRTOUL 1"
1573153816Sdougb	 LWRES_PLATFORM_NEEDSTRTOUL="#define ISC_PLATFORM_NEEDSTRTOUL 1"
1574153816Sdougb	 "GENRANDOMLIB=${ISCLIBS}"])
1575135446StrhodesAC_SUBST(ISC_PLATFORM_NEEDSTRTOUL)
1576153816SdougbAC_SUBST(LWRES_PLATFORM_NEEDSTRTOUL)
1577153816SdougbAC_SUBST(GENRANDOMLIB)
1578135446Strhodes
1579135446StrhodesAC_CHECK_FUNC(strlcpy,
1580135446Strhodes	[ISC_PLATFORM_NEEDSTRLCPY="#undef ISC_PLATFORM_NEEDSTRLCPY"],
1581135446Strhodes	[ISC_PLATFORM_NEEDSTRLCPY="#define ISC_PLATFORM_NEEDSTRLCPY 1"])
1582135446StrhodesAC_SUBST(ISC_PLATFORM_NEEDSTRLCPY)
1583135446Strhodes
1584135446StrhodesAC_CHECK_FUNC(strlcat,
1585135446Strhodes	[ISC_PLATFORM_NEEDSTRLCAT="#undef ISC_PLATFORM_NEEDSTRLCAT"],
1586135446Strhodes	[ISC_PLATFORM_NEEDSTRLCAT="#define ISC_PLATFORM_NEEDSTRLCAT 1"])
1587135446StrhodesAC_SUBST(ISC_PLATFORM_NEEDSTRLCAT)
1588135446Strhodes
1589135446StrhodesISC_PRINT_OBJS=
1590135446StrhodesISC_PRINT_SRCS=
1591135446StrhodesAC_MSG_CHECKING(sprintf)
1592135446StrhodesAC_TRY_COMPILE([
1593135446Strhodes#include <stdio.h>
1594135446Strhodes],
1595135446Strhodes[ char buf[2]; return(*sprintf(buf,"x"));],
1596135446Strhodes[
1597135446StrhodesISC_PRINT_OBJS="print.$O"
1598135446StrhodesISC_PRINT_SRCS="print.c"
1599135446StrhodesISC_PLATFORM_NEEDSPRINTF="#define ISC_PLATFORM_NEEDSPRINTF"
1600135446StrhodesLWRES_PLATFORM_NEEDSPRINTF="#define LWRES_PLATFORM_NEEDSPRINTF"
1601135446Strhodes],
1602135446Strhodes[ISC_PLATFORM_NEEDSPRINTF="#undef ISC_PLATFORM_NEEDSPRINTF"
1603135446Strhodes LWRES_PLATFORM_NEEDSPRINTF="#undef LWRES_PLATFORM_NEEDSPRINTF"]
1604135446Strhodes)
1605135446StrhodesAC_SUBST(ISC_PLATFORM_NEEDSPRINTF)
1606135446StrhodesAC_SUBST(LWRES_PLATFORM_NEEDSPRINTF)
1607135446Strhodes
1608135446StrhodesAC_CHECK_FUNC(vsnprintf,
1609135446Strhodes	[ISC_PLATFORM_NEEDVSNPRINTF="#undef ISC_PLATFORM_NEEDVSNPRINTF"
1610135446Strhodes	 LWRES_PLATFORM_NEEDVSNPRINTF="#undef LWRES_PLATFORM_NEEDVSNPRINTF"],
1611135446Strhodes	[ISC_PRINT_OBJS="print.$O"
1612135446Strhodes	 ISC_PRINT_SRCS="print.c"
1613135446Strhodes	 ISC_PLATFORM_NEEDVSNPRINTF="#define ISC_PLATFORM_NEEDVSNPRINTF 1"
1614135446Strhodes	 LWRES_PLATFORM_NEEDVSNPRINTF="#define LWRES_PLATFORM_NEEDVSNPRINTF 1"])
1615135446StrhodesAC_SUBST(ISC_PLATFORM_NEEDVSNPRINTF)
1616135446StrhodesAC_SUBST(LWRES_PLATFORM_NEEDVSNPRINTF)
1617135446StrhodesISC_EXTRA_OBJS="$ISC_EXTRA_OBJS $ISC_PRINT_OBJS"
1618135446StrhodesISC_EXTRA_SRCS="$ISC_EXTRA_SRCS $ISC_PRINT_SRCS"
1619135446Strhodes
1620135446StrhodesAC_CHECK_FUNC(strerror, AC_DEFINE(HAVE_STRERROR))
1621135446Strhodes
1622135446StrhodesAC_SUBST(ISC_EXTRA_OBJS)
1623135446StrhodesAC_SUBST(ISC_EXTRA_SRCS)
1624135446Strhodes
1625135446Strhodes# Determine the printf format characters to use when printing
1626135446Strhodes# values of type isc_int64_t. This will normally be "ll", but where
1627135446Strhodes# the compiler treats "long long" as a alias for "long" and printf
1628135446Strhodes# doesn't know about "long long" use "l".  Hopefully the sprintf
1629135446Strhodes# will produce a inconsistant result in the later case.  If the compiler
1630135446Strhodes# fails due to seeing "%lld" we fall back to "l".
1631135446Strhodes#
1632153816Sdougb# Digital Unix 4.0 (gcc?) (long long) is 64 bits as is its long. It uses
1633153816Sdougb# %ld even for (long long)/
1634153816Sdougb#
1635135446Strhodes# Win32 uses "%I64d", but that's defined elsewhere since we don't use
1636135446Strhodes# configure on Win32.
1637135446Strhodes#
1638135446StrhodesAC_MSG_CHECKING(printf format modifier for 64-bit integers)
1639135446StrhodesAC_TRY_RUN([
1640135446Strhodes#include <stdio.h>
1641135446Strhodesmain() {
1642135446Strhodes	long long int j = 0;
1643135446Strhodes	char buf[100];
1644135446Strhodes	buf[0] = 0;
1645135446Strhodes	sprintf(buf, "%lld", j);
1646135446Strhodes	exit((sizeof(long long int) != sizeof(long int))? 0 :
1647135446Strhodes	     (strcmp(buf, "0") != 0));
1648135446Strhodes} 
1649135446Strhodes],
1650135446Strhodes	[AC_MSG_RESULT(ll)
1651153816Sdougb	ISC_PLATFORM_QUADFORMAT='#define ISC_PLATFORM_QUADFORMAT "ll"'
1652153816Sdougb	LWRES_PLATFORM_QUADFORMAT='#define LWRES_PLATFORM_QUADFORMAT "ll"'],
1653135446Strhodes	[AC_MSG_RESULT(l)
1654153816Sdougb	ISC_PLATFORM_QUADFORMAT='#define ISC_PLATFORM_QUADFORMAT "l"'
1655153816Sdougb	LWRES_PLATFORM_QUADFORMAT='#define LWRES_PLATFORM_QUADFORMAT "l"'],
1656135446Strhodes	[AC_MSG_RESULT(assuming target platform uses ll)
1657153816Sdougb	ISC_PLATFORM_QUADFORMAT='#define ISC_PLATFORM_QUADFORMAT "ll"'
1658153816Sdougb	LWRES_PLATFORM_QUADFORMAT='#define LWRES_PLATFORM_QUADFORMAT "ll"'])
1659135446StrhodesAC_SUBST(ISC_PLATFORM_QUADFORMAT)
1660153816SdougbAC_SUBST(LWRES_PLATFORM_QUADFORMAT)
1661135446Strhodes
1662135446Strhodes#
1663135446Strhodes# Security Stuff
1664135446Strhodes#
1665135446StrhodesAC_CHECK_FUNC(chroot, AC_DEFINE(HAVE_CHROOT))
1666135446StrhodesAC_ARG_ENABLE(linux-caps,
1667135446Strhodes	[  --disable-linux-caps	disable linux capabilities])
1668135446Strhodescase "$enable_linux_caps" in
1669135446Strhodes	yes|'')
1670135446Strhodes		AC_CHECK_HEADERS(linux/capability.h)
1671135446Strhodes		;;
1672135446Strhodes	no)
1673135446Strhodes		;;
1674135446Strhodesesac
1675135446StrhodesAC_CHECK_HEADERS(sys/prctl.h)
1676135446Strhodes
1677135446Strhodes#
1678135446Strhodes# Time Zone Stuff
1679135446Strhodes#
1680135446StrhodesAC_CHECK_FUNC(tzset, AC_DEFINE(HAVE_TZSET))
1681135446Strhodes
1682153816SdougbAC_MSG_CHECKING(for optarg decarartion)
1683153816SdougbAC_TRY_COMPILE([
1684153816Sdougb#include <unistd.h>
1685153816Sdougb],
1686153816Sdougb[optarg = 0;],
1687153816Sdougb[AC_MSG_RESULT(yes)],
1688153816Sdougb[AC_MSG_RESULT(no)
1689153816SdougbAC_DEFINE(NEED_OPTARG, 1, [Defined if extern char *optarg is not declared.])])
1690153816Sdougb
1691135446Strhodes#
1692135446Strhodes# BSD/OS, and perhaps some others, don't define rlim_t.
1693135446Strhodes#
1694135446StrhodesAC_MSG_CHECKING(for type rlim_t)
1695135446StrhodesAC_TRY_COMPILE([
1696135446Strhodes#include <sys/types.h>
1697135446Strhodes#include <sys/time.h>
1698135446Strhodes#include <sys/resource.h>],
1699135446Strhodes[rlim_t rl = 19671212; return (0);],
1700135446Strhodes[AC_MSG_RESULT(yes)
1701135446Strhodes ISC_PLATFORM_RLIMITTYPE="#define ISC_PLATFORM_RLIMITTYPE rlim_t"],
1702135446Strhodes[AC_MSG_RESULT(no)
1703135446Strhodes
1704135446StrhodesAC_MSG_CHECKING(type of rlim_cur)
1705135446StrhodesAC_TRY_RUN([
1706135446Strhodes#include <sys/types.h>
1707135446Strhodes#include <sys/time.h>
1708135446Strhodes#include <sys/resource.h>
1709135446Strhodesmain() { struct rlimit r; exit(!(sizeof(r.rlim_cur) == sizeof(int)));}],
1710135446Strhodes[AC_MSG_RESULT(int)
1711135446StrhodesISC_PLATFORM_RLIMITTYPE="#define ISC_PLATFORM_RLIMITTYPE int"],
1712135446Strhodes[
1713135446StrhodesAC_TRY_RUN([
1714135446Strhodes#include <sys/types.h>
1715135446Strhodes#include <sys/time.h>
1716135446Strhodes#include <sys/resource.h>
1717135446Strhodesmain() { struct rlimit r; exit(!(sizeof(r.rlim_cur) == sizeof(long int)));}],
1718135446Strhodes[AC_MSG_RESULT(long int)
1719135446StrhodesISC_PLATFORM_RLIMITTYPE="#define ISC_PLATFORM_RLIMITTYPE long int"],
1720135446Strhodes[
1721135446StrhodesAC_TRY_RUN([
1722135446Strhodes#include <sys/types.h>
1723135446Strhodes#include <sys/time.h>
1724135446Strhodes#include <sys/resource.h>
1725135446Strhodesmain() { struct rlimit r; exit((!sizeof(r.rlim_cur) == sizeof(long long int)));}],
1726135446Strhodes[AC_MSG_RESULT(long long int)
1727135446StrhodesISC_PLATFORM_RLIMITTYPE="#define ISC_PLATFORM_RLIMITTYPE long long int"],
1728135446Strhodes[AC_MSG_ERROR([unable to determine sizeof rlim_cur])
1729135446Strhodes],[AC_MSG_ERROR(this cannot happen)])
1730135446Strhodes],[AC_MSG_ERROR(this cannot happen)])
1731153816Sdougb],[
1732153816SdougbISC_PLATFORM_RLIMITTYPE="#define ISC_PLATFORM_RLIMITTYPE long long int"
1733153816SdougbAC_MSG_RESULT(cannot determine type of rlim_cur when cross compiling - assuming long long int)])
1734135446Strhodes])
1735135446StrhodesAC_SUBST(ISC_PLATFORM_RLIMITTYPE)
1736135446Strhodes
1737135446Strhodes#
1738135446Strhodes# Compaq TruCluster requires more code for handling cluster IP aliases
1739135446Strhodes#
1740135446Strhodescase "$host" in
1741135446Strhodes	*-dec-osf*)
1742135446Strhodes		AC_CHECK_LIB(clua, clua_getaliasaddress, LIBS="-lclua $LIBS")
1743135446Strhodes		AC_CHECK_FUNC(clua_getaliasaddress,
1744135446Strhodes				AC_DEFINE(HAVE_TRUCLUSTER, 1,
1745135446Strhodes					[Define if running under Compaq TruCluster]))
1746135446Strhodes		;;
1747135446Strhodes	*)
1748135446Strhodes		;;
1749135446Strhodesesac
1750135446Strhodes
1751135446Strhodes#
1752135446Strhodes# Microsoft has their own way of handling shared libraries that requires
1753135446Strhodes# additional qualifiers on extern variables.  Unix systems don't need it.
1754135446Strhodes#
1755135446StrhodesAC_SUBST(ISC_PLATFORM_USEDECLSPEC)
1756135446StrhodesISC_PLATFORM_USEDECLSPEC="#undef ISC_PLATFORM_USEDECLSPEC"
1757135446StrhodesAC_SUBST(LWRES_PLATFORM_USEDECLSPEC)
1758135446StrhodesLWRES_PLATFORM_USEDECLSPEC="#undef LWRES_PLATFORM_USEDECLSPEC"
1759135446Strhodes
1760135446Strhodes#
1761135446Strhodes# Random remaining OS-specific issues involving compiler warnings.
1762135446Strhodes# XXXDCL print messages to indicate some compensation is being done?
1763135446Strhodes#
1764135446StrhodesAC_SUBST(ISC_PLATFORM_BRACEPTHREADONCEINIT)
1765135446StrhodesISC_PLATFORM_BRACEPTHREADONCEINIT="#undef ISC_PLATFORM_BRACEPTHREADONCEINIT"
1766135446Strhodes
1767135446Strhodescase "$host" in
1768143731Sdougb	*-aix5.1.*)
1769143731Sdougb		hack_shutup_pthreadonceinit=yes
1770143731Sdougb		;;
1771135446Strhodes	*-bsdi3.1*)
1772135446Strhodes		hack_shutup_sputaux=yes
1773135446Strhodes		;;
1774135446Strhodes	*-bsdi4.0*)
1775135446Strhodes		hack_shutup_sigwait=yes
1776135446Strhodes		hack_shutup_sputaux=yes
1777135446Strhodes		;;
1778135446Strhodes	[*-bsdi4.[12]*])
1779135446Strhodes		hack_shutup_stdargcast=yes
1780135446Strhodes		;;
1781135446Strhodes	[*-solaris2.[89]])
1782135446Strhodes		hack_shutup_pthreadonceinit=yes
1783135446Strhodes		;;
1784135446Strhodesesac
1785135446Strhodes
1786135446Strhodescase "$hack_shutup_pthreadonceinit" in
1787135446Strhodes	yes)
1788135446Strhodes		#
1789135446Strhodes		# Shut up PTHREAD_ONCE_INIT unbraced initializer warnings.
1790135446Strhodes		#
1791135446Strhodes		ISC_PLATFORM_BRACEPTHREADONCEINIT="#define ISC_PLATFORM_BRACEPTHREADONCEINIT 1"
1792135446Strhodes		;;
1793135446Strhodesesac
1794135446Strhodes
1795135446Strhodescase "$hack_shutup_sigwait" in
1796135446Strhodes	yes)
1797135446Strhodes		#
1798135446Strhodes		# Shut up a -Wmissing-prototypes warning for sigwait().
1799135446Strhodes		#
1800135446Strhodes		AC_DEFINE(SHUTUP_SIGWAIT)
1801135446Strhodes		;;
1802135446Strhodesesac
1803135446Strhodes
1804135446Strhodescase "$hack_shutup_sputaux" in
1805135446Strhodes	yes)
1806135446Strhodes		#
1807135446Strhodes		# Shut up a -Wmissing-prototypes warning from <stdio.h>.
1808135446Strhodes		#
1809135446Strhodes		AC_DEFINE(SHUTUP_SPUTAUX)
1810135446Strhodes		;;
1811135446Strhodesesac
1812135446Strhodes
1813135446Strhodescase "$hack_shutup_stdargcast" in
1814135446Strhodes	yes)
1815135446Strhodes		#
1816135446Strhodes		# Shut up a -Wcast-qual warning from va_start().
1817135446Strhodes		#
1818135446Strhodes		AC_DEFINE(SHUTUP_STDARG_CAST)
1819135446Strhodes		;;
1820135446Strhodesesac
1821135446Strhodes
1822135446Strhodes#
1823135446Strhodes# Check for if_nametoindex() for IPv6 scoped addresses support
1824135446Strhodes#
1825135446StrhodesAC_CHECK_FUNC(if_nametoindex, ac_cv_have_if_nametoindex=yes,
1826135446Strhodes		ac_cv_have_if_nametoindex=no)
1827135446Strhodescase $ac_cv_have_if_nametoindex in
1828135446Strhodesno)
1829135446Strhodes	case "$host" in
1830135446Strhodes  	*-hp-hpux*)
1831135446Strhodes  		AC_CHECK_LIB(ipv6, if_nametoindex,
1832135446Strhodes				ac_cv_have_if_nametoindex=yes
1833135446Strhodes				LIBS="-lipv6 $LIBS",)
1834135446Strhodes  	;;
1835135446Strhodes	esac
1836135446Strhodesesac
1837135446Strhodescase $ac_cv_have_if_nametoindex in
1838135446Strhodesyes)
1839135446Strhodes	ISC_PLATFORM_HAVEIFNAMETOINDEX="#define ISC_PLATFORM_HAVEIFNAMETOINDEX 1"
1840135446Strhodes	;;
1841135446Strhodes*)
1842135446Strhodes	ISC_PLATFORM_HAVEIFNAMETOINDEX="#undef ISC_PLATFORM_HAVEIFNAMETOINDEX"
1843135446Strhodes	;;
1844135446Strhodesesac
1845135446StrhodesAC_SUBST(ISC_PLATFORM_HAVEIFNAMETOINDEX)
1846135446Strhodes
1847135446Strhodes#
1848153816Sdougb#  The following sets up how non-blocking i/o is established.
1849153816Sdougb#  Sunos, cygwin and solaris 2.x (x<5) require special handling.
1850153816Sdougb#
1851153816Sdougbcase "$host" in
1852153816Sdougb*-sunos*) AC_DEFINE(PORT_NONBLOCK, O_NDELAY);;
1853153816Sdougb*-cygwin*) AC_DEFINE(PORT_NONBLOCK, O_NDELAY);;
1854153816Sdougb*-solaris2.[[01234]])
1855153816Sdougb	AC_DEFINE(PORT_NONBLOCK, O_NONBLOCK)
1856153816Sdougb	AC_DEFINE(USE_FIONBIO_IOCTL, 1,
1857153816Sdougb		  [Defined if you need to use ioctl(FIONBIO) instead a fcntl call to make non-blocking.])
1858153816Sdougb	;;
1859153816Sdougb*) AC_DEFINE(PORT_NONBLOCK, O_NONBLOCK,
1860153816Sdougb	     [Sets which flag to pass to open/fcntl to make non-blocking (O_NDELAY/O_NONBLOCK).])
1861153816Sdougb	;;
1862153816Sdougbesac
1863153816Sdougb#
1864135446Strhodes# The following sections deal with tools used for formatting
1865135446Strhodes# the documentation.  They are all optional, unless you are
1866135446Strhodes# a developer editing the documentation source.
1867135446Strhodes#
1868135446Strhodes
1869153816Sdougb#
1870153816Sdougb# Look for TeX.
1871153816Sdougb#
1872135446Strhodes
1873153816SdougbAC_PATH_PROGS(LATEX, latex, latex)
1874153816SdougbAC_SUBST(LATEX)
1875153816Sdougb
1876153816SdougbAC_PATH_PROGS(PDFLATEX, pdflatex, pdflatex)
1877153816SdougbAC_SUBST(PDFLATEX)
1878153816Sdougb
1879135446Strhodes#
1880153816Sdougb# Look for xsltproc (libxslt)
1881135446Strhodes#
1882135446Strhodes
1883153816SdougbAC_PATH_PROG(XSLTPROC, xsltproc, xsltproc)
1884153816SdougbAC_SUBST(XSLTPROC)
1885135446Strhodes
1886135446Strhodes#
1887153816Sdougb# Look for xmllint (libxml2)
1888135446Strhodes#
1889135446Strhodes
1890153816SdougbAC_PATH_PROG(XMLLINT, xmllint, xmllint)
1891153816SdougbAC_SUBST(XMLLINT)
1892135446Strhodes
1893135446Strhodes#
1894135446Strhodes# Subroutine for searching for an ordinary file (e.g., a stylesheet)
1895135446Strhodes# in a number of directories:
1896135446Strhodes#
1897135446Strhodes#   NOM_PATH_FILE(VARIABLE, FILENAME, DIRECTORIES)
1898135446Strhodes#
1899135446Strhodes# If the file FILENAME is found in one of the DIRECTORIES, the shell
1900135446Strhodes# variable VARIABLE is defined to its absolute pathname.  Otherwise, 
1901135446Strhodes# it is set to FILENAME, with no directory prefix (that's not terribly
1902135446Strhodes# useful, but looks less confusing in substitutions than leaving it
1903135446Strhodes# empty).  The variable VARIABLE will be substituted into output files.
1904135446Strhodes# 
1905135446Strhodes
1906135446StrhodesAC_DEFUN(NOM_PATH_FILE, [
1907135446Strhodes$1=""
1908135446StrhodesAC_MSG_CHECKING(for $2)
1909135446Strhodesfor d in $3
1910135446Strhodesdo
1911135446Strhodes	f=$d/$2
1912135446Strhodes	if test -f $f
1913135446Strhodes	then
1914135446Strhodes		$1=$f
1915135446Strhodes		AC_MSG_RESULT($f)
1916135446Strhodes		break
1917135446Strhodes	fi
1918135446Strhodesdone
1919135446Strhodesif test "X[$]$1" = "X"
1920135446Strhodesthen
1921135446Strhodes	AC_MSG_RESULT("not found");
1922135446Strhodes	$1=$2
1923135446Strhodesfi
1924135446StrhodesAC_SUBST($1)
1925135446Strhodes])
1926135446Strhodes
1927135446Strhodes#
1928153816Sdougb# Look for Docbook-XSL stylesheets.  Location probably varies by
1929153816Sdougb# system.  Guessing where it might be found, based on where SGML stuff
1930153816Sdougb# lives on some systems.  FreeBSD is the only one I'm sure of at the
1931153816Sdougb# moment.
1932135446Strhodes#
1933153816Sdougb
1934153816Sdougbdocbook_xsl_trees="/usr/pkg/share/xsl /usr/local/share/xsl /usr/share/xsl"
1935153816Sdougb
1936135446Strhodes#
1937153816Sdougb# Look for stylesheets we need.
1938153816Sdougb#
1939135446Strhodes
1940153816SdougbNOM_PATH_FILE(XSLT_DOCBOOK_STYLE_HTML, docbook/html/docbook.xsl, $docbook_xsl_trees)
1941153816SdougbNOM_PATH_FILE(XSLT_DOCBOOK_STYLE_XHTML, docbook/xhtml/docbook.xsl, $docbook_xsl_trees)
1942153816SdougbNOM_PATH_FILE(XSLT_DOCBOOK_STYLE_MAN, docbook/manpages/docbook.xsl, $docbook_xsl_trees)
1943153816SdougbNOM_PATH_FILE(XSLT_DOCBOOK_CHUNK_HTML, docbook/html/chunk.xsl, $docbook_xsl_trees)
1944153816SdougbNOM_PATH_FILE(XSLT_DOCBOOK_CHUNK_XHTML, docbook/xhtml/chunk.xsl, $docbook_xsl_trees)
1945153816Sdougb
1946135446Strhodes#
1947153816Sdougb# Same dance for db2latex
1948135446Strhodes#
1949153816Sdougb# No idea where this lives except on FreeBSD.
1950135446Strhodes#
1951135446Strhodes
1952153816Sdougbdb2latex_xsl_trees="/usr/local/share"
1953135446Strhodes
1954135446Strhodes#
1955153816Sdougb# Look for stylesheets we need.
1956135446Strhodes#
1957135446Strhodes
1958153816SdougbNOM_PATH_FILE(XSLT_DB2LATEX_STYLE, db2latex/xsl/docbook.xsl, $db2latex_xsl_trees)
1959135446Strhodes
1960135446Strhodes#
1961153816Sdougb# Look for "admonition" image directory.  Can't use NOM_PATH_FILE()
1962153816Sdougb# because it's a directory, so just do the same things, inline.
1963135446Strhodes#
1964135446Strhodes
1965153816SdougbAC_MSG_CHECKING(for db2latex/xsl/figures)
1966153816Sdougbfor d in $db2latex_xsl_trees
1967153816Sdougbdo
1968153816Sdougb	dd=$d/db2latex/xsl/figures
1969153816Sdougb	if test -d $dd
1970153816Sdougb	then
1971153816Sdougb		XSLT_DB2LATEX_ADMONITIONS=$dd
1972153816Sdougb		AC_MSG_RESULT($dd)
1973153816Sdougb		break
1974153816Sdougb	fi
1975153816Sdougbdone
1976153816Sdougbif test "X$XSLT_DB2LATEX_ADMONITIONS" = "X"
1977153816Sdougbthen
1978153816Sdougb	AC_MSG_RESULT(not found)
1979153816Sdougb	XSLT_DB2LATEX_ADMONITIONS=db2latex/xsl/figures
1980153816Sdougbfi
1981153816SdougbAC_SUBST(XSLT_DB2LATEX_ADMONITIONS)
1982135446Strhodes
1983135446Strhodes#
1984135446Strhodes# Substitutions
1985135446Strhodes#
1986135446StrhodesAC_SUBST(BIND9_TOP_BUILDDIR)
1987135446StrhodesBIND9_TOP_BUILDDIR=`pwd`
1988135446Strhodes
1989135446StrhodesAC_SUBST(BIND9_ISC_BUILDINCLUDE)
1990135446StrhodesAC_SUBST(BIND9_ISCCC_BUILDINCLUDE)
1991135446StrhodesAC_SUBST(BIND9_ISCCFG_BUILDINCLUDE)
1992135446StrhodesAC_SUBST(BIND9_DNS_BUILDINCLUDE)
1993135446StrhodesAC_SUBST(BIND9_LWRES_BUILDINCLUDE)
1994135446StrhodesAC_SUBST(BIND9_BIND9_BUILDINCLUDE)
1995135446Strhodesif test "X$srcdir" != "X"; then
1996135446Strhodes	BIND9_ISC_BUILDINCLUDE="-I${BIND9_TOP_BUILDDIR}/lib/isc/include"
1997135446Strhodes	BIND9_ISCCC_BUILDINCLUDE="-I${BIND9_TOP_BUILDDIR}/lib/isccc/include"
1998135446Strhodes	BIND9_ISCCFG_BUILDINCLUDE="-I${BIND9_TOP_BUILDDIR}/lib/isccfg/include"
1999135446Strhodes	BIND9_DNS_BUILDINCLUDE="-I${BIND9_TOP_BUILDDIR}/lib/dns/include"
2000135446Strhodes	BIND9_LWRES_BUILDINCLUDE="-I${BIND9_TOP_BUILDDIR}/lib/lwres/include"
2001135446Strhodes	BIND9_BIND9_BUILDINCLUDE="-I${BIND9_TOP_BUILDDIR}/lib/bind9/include"
2002135446Strhodeselse
2003135446Strhodes	BIND9_ISC_BUILDINCLUDE=""
2004135446Strhodes	BIND9_ISCCC_BUILDINCLUDE=""
2005135446Strhodes	BIND9_ISCCFG_BUILDINCLUDE=""
2006135446Strhodes	BIND9_DNS_BUILDINCLUDE=""
2007135446Strhodes	BIND9_LWRES_BUILDINCLUDE=""
2008135446Strhodes	BIND9_BIND9_BUILDINCLUDE=""
2009135446Strhodesfi
2010135446Strhodes
2011135446StrhodesAC_SUBST_FILE(BIND9_MAKE_INCLUDES)
2012135446StrhodesBIND9_MAKE_INCLUDES=$BIND9_TOP_BUILDDIR/make/includes
2013135446Strhodes
2014135446StrhodesAC_SUBST_FILE(BIND9_MAKE_RULES)
2015135446StrhodesBIND9_MAKE_RULES=$BIND9_TOP_BUILDDIR/make/rules
2016135446Strhodes
2017135446Strhodes. $srcdir/version
2018135446StrhodesBIND9_VERSION="VERSION=${MAJORVER}.${MINORVER}.${PATCHVER}${RELEASETYPE}${RELEASEVER}"
2019135446StrhodesAC_SUBST(BIND9_VERSION)
2020135446Strhodes
2021135446StrhodesAC_SUBST_FILE(LIBISC_API)
2022135446StrhodesLIBISC_API=$srcdir/lib/isc/api
2023135446Strhodes
2024135446StrhodesAC_SUBST_FILE(LIBISCCC_API)
2025135446StrhodesLIBISCCC_API=$srcdir/lib/isccc/api
2026135446Strhodes
2027135446StrhodesAC_SUBST_FILE(LIBISCCFG_API)
2028135446StrhodesLIBISCCFG_API=$srcdir/lib/isccfg/api
2029135446Strhodes
2030135446StrhodesAC_SUBST_FILE(LIBDNS_API)
2031135446StrhodesLIBDNS_API=$srcdir/lib/dns/api
2032135446Strhodes
2033135446StrhodesAC_SUBST_FILE(LIBBIND9_API)
2034135446StrhodesLIBBIND9_API=$srcdir/lib/bind9/api
2035135446Strhodes
2036135446StrhodesAC_SUBST_FILE(LIBLWRES_API)
2037135446StrhodesLIBLWRES_API=$srcdir/lib/lwres/api
2038135446Strhodes
2039135446StrhodesAC_OUTPUT(
2040135446Strhodes	make/rules
2041135446Strhodes	make/includes
2042135446Strhodes	Makefile
2043135446Strhodes	make/Makefile
2044135446Strhodes	make/mkdep
2045135446Strhodes	lib/Makefile
2046135446Strhodes	lib/isc/Makefile
2047135446Strhodes	lib/isc/include/Makefile
2048135446Strhodes	lib/isc/include/isc/Makefile
2049135446Strhodes	lib/isc/include/isc/platform.h
2050135446Strhodes	lib/isc/unix/Makefile
2051135446Strhodes	lib/isc/unix/include/Makefile
2052135446Strhodes	lib/isc/unix/include/isc/Makefile
2053135446Strhodes	lib/isc/nls/Makefile
2054135446Strhodes	lib/isc/$thread_dir/Makefile
2055135446Strhodes	lib/isc/$thread_dir/include/Makefile
2056135446Strhodes	lib/isc/$thread_dir/include/isc/Makefile
2057135446Strhodes	lib/isccc/Makefile
2058135446Strhodes	lib/isccc/include/Makefile
2059135446Strhodes	lib/isccc/include/isccc/Makefile
2060135446Strhodes	lib/isccfg/Makefile
2061135446Strhodes	lib/isccfg/include/Makefile
2062135446Strhodes	lib/isccfg/include/isccfg/Makefile
2063135446Strhodes	lib/dns/Makefile
2064135446Strhodes	lib/dns/include/Makefile
2065135446Strhodes	lib/dns/include/dns/Makefile
2066143731Sdougb	lib/dns/include/dst/Makefile
2067135446Strhodes	lib/bind9/Makefile
2068135446Strhodes	lib/bind9/include/Makefile
2069135446Strhodes	lib/bind9/include/bind9/Makefile
2070135446Strhodes	lib/lwres/Makefile
2071135446Strhodes	lib/lwres/include/Makefile
2072135446Strhodes	lib/lwres/include/lwres/Makefile
2073135446Strhodes	lib/lwres/include/lwres/netdb.h
2074135446Strhodes	lib/lwres/include/lwres/platform.h
2075135446Strhodes	lib/lwres/man/Makefile
2076135446Strhodes	lib/lwres/unix/Makefile
2077135446Strhodes	lib/lwres/unix/include/Makefile
2078135446Strhodes	lib/lwres/unix/include/lwres/Makefile
2079135446Strhodes	lib/tests/Makefile
2080135446Strhodes	lib/tests/include/Makefile
2081135446Strhodes	lib/tests/include/tests/Makefile
2082135446Strhodes	bin/Makefile
2083135446Strhodes	bin/check/Makefile
2084135446Strhodes	bin/named/Makefile
2085135446Strhodes	bin/named/unix/Makefile
2086135446Strhodes	bin/rndc/Makefile
2087135446Strhodes	bin/rndc/unix/Makefile
2088135446Strhodes	bin/dig/Makefile
2089135446Strhodes	bin/nsupdate/Makefile
2090135446Strhodes	bin/tests/Makefile
2091135446Strhodes	bin/tests/names/Makefile
2092135446Strhodes	bin/tests/master/Makefile
2093135446Strhodes	bin/tests/rbt/Makefile
2094135446Strhodes	bin/tests/db/Makefile
2095135446Strhodes	bin/tests/tasks/Makefile
2096135446Strhodes	bin/tests/timers/Makefile
2097135446Strhodes	bin/tests/dst/Makefile
2098135446Strhodes	bin/tests/mem/Makefile
2099135446Strhodes	bin/tests/net/Makefile
2100135446Strhodes	bin/tests/sockaddr/Makefile
2101135446Strhodes	bin/tests/system/Makefile
2102135446Strhodes	bin/tests/system/conf.sh
2103135446Strhodes	bin/tests/system/lwresd/Makefile
2104135446Strhodes	bin/tests/system/tkey/Makefile
2105135446Strhodes	bin/tests/headerdep_test.sh
2106135446Strhodes	bin/dnssec/Makefile
2107135446Strhodes	doc/Makefile
2108135446Strhodes	doc/arm/Makefile
2109135446Strhodes	doc/misc/Makefile
2110153816Sdougb	doc/xsl/Makefile
2111135446Strhodes	isc-config.sh
2112153816Sdougb	doc/xsl/isc-docbook-chunk.xsl
2113153816Sdougb	doc/xsl/isc-docbook-html.xsl
2114153816Sdougb	doc/xsl/isc-docbook-latex.xsl
2115153816Sdougb	doc/xsl/isc-manpage.xsl
2116135446Strhodes)
2117135446Strhodeschmod a+x isc-config.sh
2118135446Strhodes
2119135446Strhodes# Tell Emacs to edit this file in shell mode.
2120135446Strhodes# Local Variables:
2121135446Strhodes# mode: sh
2122135446Strhodes# End:
2123