configure.in revision 170222
1170222Sdougb# Copyright (C) 2004-2007  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
21170222SdougbAC_REVISION($Revision: 1.355.18.67 $)
22135446Strhodes
23135446StrhodesAC_INIT(lib/dns/name.c)
24170222SdougbAC_PREREQ(2.59)
25135446Strhodes
26135446StrhodesAC_CONFIG_HEADER(config.h)
27135446StrhodesAC_CONFIG_SUBDIRS(lib/bind)
28135446Strhodes
29135446StrhodesAC_CANONICAL_HOST
30135446Strhodes
31135446StrhodesAC_PROG_MAKE_SET
32135446StrhodesAC_PROG_RANLIB
33135446StrhodesAC_PROG_INSTALL
34170222SdougbAC_PROG_LN_S
35135446Strhodes
36135446StrhodesAC_SUBST(STD_CINCLUDES)
37135446StrhodesAC_SUBST(STD_CDEFINES)
38135446StrhodesAC_SUBST(STD_CWARNINGS)
39135446StrhodesAC_SUBST(CCOPT)
40135446Strhodes
41170222Sdougb#
42170222Sdougb# Make very sure that these are the first files processed by
43170222Sdougb# config.status, since we use the processed output as the input for
44170222Sdougb# AC_SUBST_FILE() subsitutions in other files.
45170222Sdougb#
46170222SdougbAC_CONFIG_FILES([make/rules make/includes])
47170222Sdougb
48135446StrhodesAC_PATH_PROG(AR, ar)
49135446StrhodesARFLAGS="cruv"
50135446StrhodesAC_SUBST(AR)
51135446StrhodesAC_SUBST(ARFLAGS)
52135446Strhodes
53135446Strhodes# The POSIX ln(1) program.  Non-POSIX systems may substitute
54135446Strhodes# "copy" or something.
55135446StrhodesLN=ln
56135446StrhodesAC_SUBST(LN)
57135446Strhodes
58135446Strhodescase "$AR" in
59135446Strhodes	"")
60135446Strhodes		AC_MSG_ERROR([
61135446Strhodesar program not found.  Please fix your PATH to include the directory in
62135446Strhodeswhich ar resides, or set AR in the environment with the full path to ar.
63135446Strhodes])
64135446Strhodes
65135446Strhodes		;;
66135446Strhodesesac
67135446Strhodes
68135446Strhodes#
69135446Strhodes# Etags.
70135446Strhodes#
71135446StrhodesAC_PATH_PROGS(ETAGS, etags emacs-etags)
72135446Strhodes
73135446Strhodes#
74135446Strhodes# Some systems, e.g. RH7, have the Exuberant Ctags etags instead of
75135446Strhodes# GNU emacs etags, and it requires the -L flag.
76135446Strhodes#
77135446Strhodesif test "X$ETAGS" != "X"; then
78135446Strhodes	AC_MSG_CHECKING(for Exuberant Ctags etags)
79135446Strhodes	if $ETAGS --version 2>&1 | grep 'Exuberant Ctags' >/dev/null 2>&1; then
80135446Strhodes		AC_MSG_RESULT(yes)
81135446Strhodes		ETAGS="$ETAGS -L"
82135446Strhodes	else
83135446Strhodes		AC_MSG_RESULT(no)
84135446Strhodes	fi
85135446Strhodesfi
86135446StrhodesAC_SUBST(ETAGS)
87135446Strhodes
88135446Strhodes#
89135446Strhodes# Perl is optional; it is used only by some of the system test scripts.
90135446Strhodes#
91135446StrhodesAC_PATH_PROGS(PERL, perl5 perl)
92135446StrhodesAC_SUBST(PERL)
93135446Strhodes
94135446Strhodes#
95135446Strhodes# Special processing of paths depending on whether --prefix,
96135446Strhodes# --sysconfdir or --localstatedir arguments were given.  What's
97135446Strhodes# desired is some compatibility with the way previous versions
98135446Strhodes# of BIND built; they defaulted to /usr/local for most parts of
99135446Strhodes# the installation, but named.boot/named.conf was in /etc
100135446Strhodes# and named.pid was in /var/run.
101135446Strhodes#
102135446Strhodes# So ... if none of --prefix, --sysconfdir or --localstatedir are
103135446Strhodes# specified, set things up that way.  If --prefix is given, use
104135446Strhodes# it for sysconfdir and localstatedir the way configure normally
105135446Strhodes# would.  To change the prefix for everything but leave named.conf
106135446Strhodes# in /etc or named.pid in /var/run, then do this the usual configure way:
107135446Strhodes# ./configure --prefix=/somewhere --sysconfdir=/etc
108135446Strhodes# ./configure --prefix=/somewhere --localstatedir=/var
109135446Strhodes#
110135446Strhodes# To put named.conf and named.pid in /usr/local with everything else,
111135446Strhodes# set the prefix explicitly to /usr/local even though that's the default:
112135446Strhodes# ./configure --prefix=/usr/local
113135446Strhodes#
114135446Strhodescase "$prefix" in
115135446Strhodes        NONE)
116135446Strhodes                case "$sysconfdir" in
117135446Strhodes                        '${prefix}/etc')
118135446Strhodes                                sysconfdir=/etc
119135446Strhodes                                ;;
120135446Strhodes                esac
121135446Strhodes                case "$localstatedir" in
122135446Strhodes                        '${prefix}/var')
123135446Strhodes                                localstatedir=/var
124135446Strhodes                                ;;
125135446Strhodes                esac
126135446Strhodes                ;;
127135446Strhodesesac
128135446Strhodes
129135446Strhodes#
130135446Strhodes# Make sure INSTALL uses an absolute path, else it will be wrong in all
131135446Strhodes# Makefiles, since they use make/rules.in and INSTALL will be adjusted by
132135446Strhodes# configure based on the location of the file where it is substituted.
133135446Strhodes# Since in BIND9 INSTALL is only substituted into make/rules.in, an immediate
134135446Strhodes# subdirectory of install-sh, This relative path will be wrong for all
135135446Strhodes# directories more than one level down from install-sh.
136135446Strhodes#
137135446Strhodescase "$INSTALL" in
138135446Strhodes	/*)
139135446Strhodes                ;;
140135446Strhodes        *)
141135446Strhodes                #
142135446Strhodes                # Not all systems have dirname.
143135446Strhodes                #
144135446Strhodes                changequote({, })
145135446Strhodes                ac_dir="`echo $INSTALL | sed 's%/[^/]*$%%'`"
146135446Strhodes                changequote([, ])
147135446Strhodes
148135446Strhodes                ac_prog="`echo $INSTALL | sed 's%.*/%%'`"
149135446Strhodes                test "$ac_dir" = "$ac_prog" && ac_dir=.
150135446Strhodes                test -d "$ac_dir" && ac_dir="`(cd \"$ac_dir\" && pwd)`"
151135446Strhodes                INSTALL="$ac_dir/$ac_prog"
152135446Strhodes                ;;
153135446Strhodesesac
154135446Strhodes
155135446Strhodes#
156135446Strhodes# On these hosts, we really want to use cc, not gcc, even if it is
157135446Strhodes# found.  The gcc that these systems have will not correctly handle
158135446Strhodes# pthreads.
159135446Strhodes#
160135446Strhodes# However, if the user sets $CC to be something, let that override
161135446Strhodes# our change.
162135446Strhodes#
163135446Strhodesif test "X$CC" = "X" ; then
164135446Strhodes	case "$host" in
165135446Strhodes		*-dec-osf*)
166135446Strhodes			CC="cc"
167135446Strhodes			;;
168135446Strhodes		*-solaris*)
169135446Strhodes                        # Use Sun's cc if it is available, but watch
170135446Strhodes                        # out for /usr/ucb/cc; it will never be the right
171135446Strhodes                        # compiler to use.
172135446Strhodes                        #
173135446Strhodes                        # If setting CC here fails, the AC_PROG_CC done
174135446Strhodes                        # below might still find gcc.
175135446Strhodes			IFS="${IFS=	}"; ac_save_ifs="$IFS"; IFS=":"
176135446Strhodes			for ac_dir in $PATH; do
177135446Strhodes				test -z "$ac_dir" && ac_dir=.
178135446Strhodes				case "$ac_dir" in
179135446Strhodes				/usr/ucb)
180135446Strhodes					# exclude
181135446Strhodes					;;
182135446Strhodes				*)
183135446Strhodes					if test -f "$ac_dir/cc"; then
184135446Strhodes						CC="$ac_dir/cc"
185135446Strhodes						break
186135446Strhodes					fi
187135446Strhodes					;;
188135446Strhodes				esac
189135446Strhodes			done
190135446Strhodes			IFS="$ac_save_ifs"
191135446Strhodes			;;
192135446Strhodes		*-hp-hpux*)
193135446Strhodes			CC="cc"
194135446Strhodes			;;
195135446Strhodes		mips-sgi-irix*)
196135446Strhodes			CC="cc"
197135446Strhodes			;;
198135446Strhodes	esac
199135446Strhodesfi
200135446Strhodes
201135446StrhodesAC_PROG_CC
202135446Strhodes
203135446Strhodes#
204135446Strhodes# gcc's optimiser is broken at -02 for ultrasparc
205135446Strhodes#
206135446Strhodesif test "$ac_env_CFLAGS_set" != set -a "X$GCC" = "Xyes"; then
207135446Strhodes	case "$host" in
208135446Strhodes	sparc-*)
209135446Strhodes		CCFLAGS="-g -O1"
210135446Strhodes		;;
211135446Strhodes	esac
212135446Strhodesfi
213135446Strhodes
214135446Strhodes#
215135446Strhodes# OS dependent CC flags
216135446Strhodes#
217135446Strhodescase "$host" in
218135446Strhodes	# OSF 5.0: recv/send are only avaliable with -D_POSIX_PII_SOCKET or
219135446Strhodes	# -D_XOPEN_SOURCE_EXTENDED.
220135446Strhodes	*-dec-osf*)
221135446Strhodes		STD_CDEFINES="$STD_CDEFINES -D_POSIX_PII_SOCKET"
222135446Strhodes		CPPFLAGS="$CPPFLAGS -D_POSIX_PII_SOCKET"
223135446Strhodes		;;
224135446Strhodes	#HP-UX: need -D_XOPEN_SOURCE_EXTENDED and -lxnet for CMSG macros
225135446Strhodes	*-hp-hpux*)
226135446Strhodes		STD_CDEFINES="$STD_CDEFINES -D_XOPEN_SOURCE_EXTENDED"
227135446Strhodes		CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE_EXTENDED"
228135446Strhodes		LIBS="-lxnet $LIBS"
229135446Strhodes		;;
230135446Strhodes	# Solaris: need -D_XPG4_2 and -D__EXTENSIONS__ for CMSG macros
231135446Strhodes	*-solaris*)
232135446Strhodes		STD_CDEFINES="$STD_CDEFINES -D_XPG4_2 -D__EXTENSIONS__"
233135446Strhodes		CPPFLAGS="$CPPFLAGS -D_XPG4_2 -D__EXTENSIONS__"
234135446Strhodes		;;
235135446Strhodesesac
236135446Strhodes
237135446StrhodesAC_HEADER_STDC
238135446Strhodes
239135446StrhodesAC_CHECK_HEADERS(fcntl.h sys/time.h unistd.h sys/sockio.h sys/select.h sys/param.h sys/sysctl.h net/if6.h,,,
240135446Strhodes[$ac_includes_default
241135446Strhodes#ifdef HAVE_SYS_PARAM_H
242135446Strhodes# include <sys/param.h>
243135446Strhodes#endif
244135446Strhodes])
245135446Strhodes
246135446StrhodesAC_C_CONST
247135446StrhodesAC_C_INLINE
248135446StrhodesAC_CHECK_FUNC(sysctlbyname, AC_DEFINE(HAVE_SYSCTLBYNAME))
249135446Strhodes
250135446Strhodes#
251135446Strhodes# UnixWare 7.1.1 with the feature supplement to the UDK compiler
252135446Strhodes# is reported to not support "static inline" (RT #1212).
253135446Strhodes#
254135446StrhodesAC_MSG_CHECKING(for static inline breakage)
255135446StrhodesAC_TRY_COMPILE(, [
256135446Strhodes		foo1();
257135446Strhodes	}
258135446Strhodes
259135446Strhodes	static inline int foo1() {
260135446Strhodes		return 0;
261135446Strhodes	}
262135446Strhodes
263135446Strhodes	static inline int foo2() {
264135446Strhodes		return foo1();
265135446Strhodes	],
266135446Strhodes	[AC_MSG_RESULT(no)],
267135446Strhodes	[AC_MSG_RESULT(yes)
268135446Strhodes         AC_DEFINE(inline, )])
269135446Strhodes
270135446StrhodesAC_TYPE_SIZE_T
271135446StrhodesAC_CHECK_TYPE(ssize_t, int)
272153816SdougbAC_CHECK_TYPE(uintptr_t,unsigned long)
273143731SdougbAC_CHECK_TYPE(socklen_t,
274143731Sdougb[AC_DEFINE(ISC_SOCKADDR_LEN_T, socklen_t)],
275143731Sdougb[
276143731SdougbAC_TRY_COMPILE(
277143731Sdougb[
278143731Sdougb#include <sys/types.h>
279143731Sdougb#include <sys/socket.h>
280143731Sdougbint getsockname(int, struct sockaddr *, size_t *);
281143731Sdougb],[],
282143731Sdougb[AC_DEFINE(ISC_SOCKADDR_LEN_T, size_t)],
283143731Sdougb[AC_DEFINE(ISC_SOCKADDR_LEN_T, int)])
284143731Sdougb],
285143731Sdougb[
286143731Sdougb#include <sys/types.h>
287143731Sdougb#include <sys/socket.h>
288143731Sdougb])
289143731SdougbAC_SUBST(ISC_SOCKADDR_LEN_T)
290135446StrhodesAC_HEADER_TIME
291135446StrhodesAC_MSG_CHECKING(for long long)
292135446StrhodesAC_TRY_COMPILE([],[long long i = 0; return (0);],
293135446Strhodes	[AC_MSG_RESULT(yes)
294135446Strhodes		ISC_PLATFORM_HAVELONGLONG="#define ISC_PLATFORM_HAVELONGLONG 1"],
295135446Strhodes	[AC_MSG_RESULT(no)
296135446Strhodes		ISC_PLATFORM_HAVELONGLONG="#undef ISC_PLATFORM_HAVELONGLONG"])
297135446StrhodesAC_SUBST(ISC_PLATFORM_HAVELONGLONG)
298135446Strhodes
299135446Strhodes#
300135446Strhodes# check if we have lifconf
301135446Strhodes#
302135446StrhodesAC_MSG_CHECKING(for struct lifconf)
303135446StrhodesAC_TRY_COMPILE([
304135446Strhodes#include <sys/types.h>
305135446Strhodes#include <sys/socket.h>
306135446Strhodes#include <net/if.h>
307135446Strhodes],
308135446Strhodes[
309135446Strhodesstruct lifconf lifconf;
310135446Strhodeslifconf.lifc_len = 0;
311135446Strhodes]
312135446Strhodes,
313135446Strhodes	[AC_MSG_RESULT(yes)
314135446Strhodes		ISC_PLATFORM_HAVELIFCONF="#define ISC_PLATFORM_HAVELIFCONF 1"],
315135446Strhodes	[AC_MSG_RESULT(no)
316135446Strhodes		ISC_PLATFORM_HAVELIFCONF="#undef ISC_PLATFORM_HAVELIFCONF"])
317135446StrhodesAC_SUBST(ISC_PLATFORM_HAVELIFCONF)
318135446Strhodes
319135446Strhodes
320135446Strhodes#
321135446Strhodes# check if we need to #include sys/select.h explicitly
322135446Strhodes#
323135446Strhodescase $ac_cv_header_unistd_h in
324135446Strhodesyes)
325135446StrhodesAC_MSG_CHECKING(if unistd.h or sys/types.h defines fd_set)
326135446StrhodesAC_TRY_COMPILE([
327135446Strhodes#include <sys/types.h> /* Ultrix */
328135446Strhodes#include <unistd.h>],
329135446Strhodes[fd_set read_set; return (0);],
330135446Strhodes	[AC_MSG_RESULT(yes)
331135446Strhodes	 ISC_PLATFORM_NEEDSYSSELECTH="#undef ISC_PLATFORM_NEEDSYSSELECTH"
332135446Strhodes	 LWRES_PLATFORM_NEEDSYSSELECTH="#undef LWRES_PLATFORM_NEEDSYSSELECTH"],
333135446Strhodes	[AC_MSG_RESULT(no)
334135446Strhodes	case $ac_cv_header_sys_select_h in
335135446Strhodes	yes)
336135446Strhodes         ISC_PLATFORM_NEEDSYSSELECTH="#define ISC_PLATFORM_NEEDSYSSELECTH 1"
337135446Strhodes	 LWRES_PLATFORM_NEEDSYSSELECTH="#define LWRES_PLATFORM_NEEDSYSSELECTH 1"
338135446Strhodes		;;
339135446Strhodes	no)
340135446Strhodes		AC_MSG_ERROR([need either working unistd.h or sys/select.h])
341135446Strhodes		;;
342135446Strhodes	esac
343135446Strhodes	])
344135446Strhodes	;;
345135446Strhodesno)
346135446Strhodes	case $ac_cv_header_sys_select_h in
347135446Strhodes	yes)
348135446Strhodes             ISC_PLATFORM_NEEDSYSSELECTH="#define ISC_PLATFORM_NEEDSYSSELECTH 1"
349135446Strhodes	     LWRES_PLATFORM_NEEDSYSSELECTH="#define LWRES_PLATFORM_NEEDSYSSELECTH 1"
350135446Strhodes		;;
351135446Strhodes	no)
352135446Strhodes		AC_MSG_ERROR([need either unistd.h or sys/select.h])
353135446Strhodes		;;
354135446Strhodes	esac
355135446Strhodes	;;
356135446Strhodesesac
357135446StrhodesAC_SUBST(ISC_PLATFORM_NEEDSYSSELECTH)
358135446StrhodesAC_SUBST(LWRES_PLATFORM_NEEDSYSSELECTH)
359135446Strhodes
360135446Strhodes#
361135446Strhodes# Find the machine's endian flavor.
362135446Strhodes#
363135446StrhodesAC_C_BIGENDIAN
364135446Strhodes
365170222Sdougb
366135446Strhodes#
367135446Strhodes# was --with-openssl specified?
368135446Strhodes#
369163976SdougbOPENSSL_WARNING=
370135446StrhodesAC_MSG_CHECKING(for OpenSSL library)
371135446StrhodesAC_ARG_WITH(openssl,
372135446Strhodes[  --with-openssl[=PATH]   Build with OpenSSL [yes|no|path].
373135446Strhodes                          (Required for DNSSEC)],
374135446Strhodes    use_openssl="$withval", use_openssl="auto")
375135446Strhodes
376165071Sdougbopenssldirs="/usr /usr/local /usr/local/ssl /usr/pkg /usr/sfw"
377143731Sdougbif test "$use_openssl" = "auto"
378143731Sdougbthen
379143731Sdougb	for d in $openssldirs
380143731Sdougb	do
381143731Sdougb		if test -f $d/include/openssl/opensslv.h
382143731Sdougb		then
383143731Sdougb			use_openssl=$d
384143731Sdougb			break
385143731Sdougb		fi
386143731Sdougb	done
387143731Sdougbfi
388135446Strhodescase "$use_openssl" in
389135446Strhodes	no)
390135446Strhodes		AC_MSG_RESULT(no)
391135446Strhodes		DST_OPENSSL_INC=""
392135446Strhodes		USE_OPENSSL=""
393135446Strhodes		;;
394143731Sdougb	auto)
395143731Sdougb		DST_OPENSSL_INC=""
396143731Sdougb		USE_OPENSSL=""
397143731Sdougb		AC_MSG_RESULT(not found)
398143731Sdougb		;;
399135446Strhodes	*)
400143731Sdougb		if test "$use_openssl" = "yes"
401135446Strhodes		then
402135446Strhodes		    	# User did not specify a path - guess it
403135446Strhodes			for d in $openssldirs
404135446Strhodes			do
405135446Strhodes				if test -f $d/include/openssl/opensslv.h
406135446Strhodes				then
407135446Strhodes				 	use_openssl=$d
408135446Strhodes					break
409135446Strhodes				fi
410135446Strhodes			done
411135446Strhodes			if test "$use_openssl" = "yes"
412135446Strhodes			then
413135446Strhodes			    	AC_MSG_RESULT(not found)
414135446Strhodes				AC_MSG_ERROR(
415135446Strhodes[OpenSSL was not found in any of $openssldirs; use --with-openssl=/path])
416135446Strhodes			fi
417135446Strhodes		fi
418135446Strhodes		USE_OPENSSL='-DOPENSSL'
419135446Strhodes		if test "$use_openssl" = "/usr"
420135446Strhodes		then
421135446Strhodes			DST_OPENSSL_INC=""
422135446Strhodes			DNS_OPENSSL_LIBS="-lcrypto"
423135446Strhodes		else
424135446Strhodes			DST_OPENSSL_INC="-I$use_openssl/include"
425135446Strhodes			case $host in
426135446Strhodes			*-solaris*)
427135446Strhodes				DNS_OPENSSL_LIBS="-L$use_openssl/lib -R$use_openssl/lib -lcrypto"
428135446Strhodes				;;
429165071Sdougb			*-hp-hpux*)
430165071Sdougb				DNS_OPENSSL_LIBS="-L$use_openssl/lib -Wl,+b: -lcrypto"
431165071Sdougb				;;
432135446Strhodes			*)
433135446Strhodes				DNS_OPENSSL_LIBS="-L$use_openssl/lib -lcrypto"
434135446Strhodes				;;
435135446Strhodes			esac
436135446Strhodes		fi
437135446Strhodes		AC_MSG_RESULT(using openssl from $use_openssl/lib and $use_openssl/include)
438135446Strhodes
439135446Strhodes		saved_cflags="$CFLAGS"
440135446Strhodes		saved_libs="$LIBS"
441135446Strhodes		CFLAGS="$CFLAGS $DST_OPENSSL_INC"
442135446Strhodes		LIBS="$LIBS $DNS_OPENSSL_LIBS"
443135446Strhodes		AC_MSG_CHECKING(whether linking with OpenSSL works)
444135446Strhodes		AC_TRY_RUN([
445135446Strhodes#include <openssl/err.h>
446135446Strhodesint main() {
447135446Strhodes	ERR_clear_error();
448135446Strhodes	return (0);
449135446Strhodes}
450135446Strhodes],
451135446Strhodes	        [AC_MSG_RESULT(yes)],
452135446Strhodes		[AC_MSG_RESULT(no)
453135446Strhodes		 AC_MSG_ERROR(Could not run test program using OpenSSL from
454135446Strhodes$use_openssl/lib and $use_openssl/include.
455135446StrhodesPlease check the argument to --with-openssl and your
456135446Strhodesshared library configuration (e.g., LD_LIBRARY_PATH).)],
457135446Strhodes		[AC_MSG_RESULT(assuming it does work on target platform)])
458135446Strhodes
459135446Strhodes		AC_MSG_CHECKING(whether linking with OpenSSL requires -ldl)
460135446Strhodes		AC_TRY_LINK([
461135446Strhodes#include <openssl/err.h>],
462135446Strhodes[ DSO_METHOD_dlfcn(); ],
463135446Strhodes		[AC_MSG_RESULT(no)],
464135446Strhodes		[LIBS="$LIBS -ldl"
465135446Strhodes		AC_TRY_LINK([
466135446Strhodes#include <openssl/err.h>
467135446Strhodes],[ DSO_METHOD_dlfcn(); ],
468135446Strhodes		[AC_MSG_RESULT(yes)
469135446Strhodes		DNS_OPENSSL_LIBS="$DNS_OPENSSL_LIBS -ldl"
470135446Strhodes		],
471135446Strhodes		 [AC_MSG_RESULT(unknown)
472135446Strhodes		 AC_MSG_ERROR(OpenSSL has unsupported dynamic loading)],
473135446Strhodes		[AC_MSG_RESULT(assuming it does work on target platform)])
474135446Strhodes		],
475135446Strhodes		[AC_MSG_RESULT(assuming it does work on target platform)]
476135446Strhodes		)
477135446Strhodes		 
478163976SdougbAC_ARG_ENABLE(openssl-version-check,
479163976Sdougb[AC_HELP_STRING([--enable-openssl-version-check],
480165071Sdougb        [Check OpenSSL Version @<:@default=yes@:>@])])
481163976Sdougbcase "$enable_openssl_version_check" in
482163976Sdougbyes|'')
483135446Strhodes		AC_MSG_CHECKING(OpenSSL library version)
484135446Strhodes		AC_TRY_RUN([
485135446Strhodes#include <stdio.h>
486135446Strhodes#include <openssl/opensslv.h>
487135446Strhodesint main() {
488165071Sdougb        if ((OPENSSL_VERSION_NUMBER >= 0x009070cfL &&
489165071Sdougb	     OPENSSL_VERSION_NUMBER < 0x00908000L) ||
490165071Sdougb	     OPENSSL_VERSION_NUMBER >= 0x0090804fL)
491135446Strhodes                return (0);
492135446Strhodes	printf("\n\nFound   OPENSSL_VERSION_NUMBER %#010x\n",
493135446Strhodes		OPENSSL_VERSION_NUMBER);
494163976Sdougb	printf("Require OPENSSL_VERSION_NUMBER 0x009070cf or greater (0.9.7l)\n"
495163976Sdougb	       "Require OPENSSL_VERSION_NUMBER 0x0090804f or greater (0.9.8d)\n\n");
496135446Strhodes        return (1);
497135446Strhodes}
498163976Sdougb		],
499135446Strhodes	        [AC_MSG_RESULT(ok)],
500135446Strhodes		[AC_MSG_RESULT(not compatible)
501163976Sdougb                 OPENSSL_WARNING=yes
502163976Sdougb		],
503135446Strhodes		[AC_MSG_RESULT(assuming target platform has compatible version)])
504163976Sdougb;;
505163976Sdougbno)
506163976Sdougb	AC_MSG_RESULT(Skipped OpenSSL version check)
507163976Sdougb;;
508163976Sdougbesac
509163976Sdougb
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
616165071Sdougb	if test "X$GCC" = "Xyes"; then
617165071Sdougb		case "$host" in
618165071Sdougb		*-freebsd*)
619165071Sdougb			CC="$CC -pthread"
620165071Sdougb			CCOPT="$CCOPT -pthread"
621165071Sdougb			STD_CDEFINES="$STD_CDEFINES -D_THREAD_SAFE"
622165071Sdougb			;;
623165071Sdougb		*-openbsd*)
624165071Sdougb			CC="$CC -pthread"
625165071Sdougb			CCOPT="$CCOPT -pthread"
626165071Sdougb			;;
627165071Sdougb		*-solaris*)
628165071Sdougb			LIBS="$LIBS -lthread"
629165071Sdougb			;;
630165071Sdougb		*-ibm-aix*)
631165071Sdougb			STD_CDEFINES="$STD_CDEFINES -D_THREAD_SAFE"
632165071Sdougb			;;
633165071Sdougb		esac
634165071Sdougb	else
635165071Sdougb		case $host in
636165071Sdougb		*-dec-osf*)
637165071Sdougb			CC="$CC -pthread"
638165071Sdougb			CCOPT="$CCOPT -pthread"
639165071Sdougb			;;
640165071Sdougb		*-solaris*)
641165071Sdougb			CC="$CC -mt"
642165071Sdougb			CCOPT="$CCOPT -mt"
643165071Sdougb			;;
644165071Sdougb		*-ibm-aix*)
645165071Sdougb			STD_CDEFINES="$STD_CDEFINES -D_THREAD_SAFE"
646165071Sdougb			;;
647165071Sdougb		*-sco-sysv*uw*|*-*-sysv*UnixWare*)
648165071Sdougb			CC="$CC -Kthread"
649165071Sdougb			CCOPT="$CCOPT -Kthread"
650165071Sdougb			;;
651165071Sdougb		*-*-sysv*OpenUNIX*)
652165071Sdougb			CC="$CC -Kpthread"
653165071Sdougb			CCOPT="$CCOPT -Kpthread"
654165071Sdougb			;;
655165071Sdougb		esac
656165071Sdougb	fi
657165071Sdougb	ALWAYS_DEFINES="-D_REENTRANT"
658165071Sdougb	ISC_PLATFORM_USETHREADS="#define ISC_PLATFORM_USETHREADS 1"
659165071Sdougb	thread_dir=pthreads
660135446Strhodes	#
661135446Strhodes	# We'd like to use sigwait() too
662135446Strhodes	#
663165071Sdougb	AC_CHECK_FUNC(sigwait,
664165071Sdougb		      AC_DEFINE(HAVE_SIGWAIT),
665165071Sdougb		      AC_CHECK_LIB(c, sigwait,
666165071Sdougb		      AC_DEFINE(HAVE_SIGWAIT),
667165071Sdougb		      AC_CHECK_LIB(pthread, sigwait,
668165071Sdougb				   AC_DEFINE(HAVE_SIGWAIT),
669165071Sdougb				   AC_CHECK_LIB(pthread, _Psigwait,
670165071Sdougb					        AC_DEFINE(HAVE_SIGWAIT),))))
671135446Strhodes
672135446Strhodes	AC_CHECK_FUNC(pthread_attr_getstacksize,
673135446Strhodes		      AC_DEFINE(HAVE_PTHREAD_ATTR_GETSTACKSIZE),)
674135446Strhodes
675135446Strhodes	AC_CHECK_FUNC(pthread_attr_setstacksize,
676135446Strhodes		      AC_DEFINE(HAVE_PTHREAD_ATTR_SETSTACKSIZE),)
677135446Strhodes
678135446Strhodes	#
679135446Strhodes	# Additional OS-specific issues related to pthreads and sigwait.
680135446Strhodes	#
681135446Strhodes	case "$host" in
682135446Strhodes		#
683135446Strhodes		# One more place to look for sigwait.
684135446Strhodes		#
685135446Strhodes		*-freebsd*)
686135446Strhodes			AC_CHECK_LIB(c_r, sigwait, AC_DEFINE(HAVE_SIGWAIT),)
687143731Sdougb			case $host in
688153816Sdougb			*-freebsd5.[[012]]|*-freebsd5.[[012]].*);;
689153816Sdougb			*-freebsd5.[[3456789]]|*-freebsd5.[[3456789]].*)
690143731Sdougb				AC_DEFINE(NEED_PTHREAD_SCOPE_SYSTEM)
691143731Sdougb				;;
692153816Sdougb			*-freebsd6.*)
693153816Sdougb				AC_DEFINE(NEED_PTHREAD_SCOPE_SYSTEM)
694153816Sdougb				;;
695143731Sdougb			esac
696135446Strhodes			;;
697135446Strhodes		#
698135446Strhodes		# BSDI 3.0 through 4.0.1 needs pthread_init() to be
699135446Strhodes		# called before certain pthreads calls.	 This is deprecated
700135446Strhodes		# in BSD/OS 4.1.
701135446Strhodes		#
702135446Strhodes		*-bsdi3.*|*-bsdi4.0*)
703135446Strhodes			AC_DEFINE(NEED_PTHREAD_INIT)
704135446Strhodes			;;
705135446Strhodes		#
706135446Strhodes		# LinuxThreads requires some changes to the way we
707135446Strhodes		# deal with signals.
708135446Strhodes		#
709135446Strhodes		*-linux*)
710135446Strhodes			AC_DEFINE(HAVE_LINUXTHREADS)
711135446Strhodes			;;
712135446Strhodes		#
713135446Strhodes		# Ensure the right sigwait() semantics on Solaris and make
714135446Strhodes		# sure we call pthread_setconcurrency.
715135446Strhodes		#
716135446Strhodes		*-solaris*)
717135446Strhodes			AC_DEFINE(_POSIX_PTHREAD_SEMANTICS)
718135446Strhodes			AC_CHECK_FUNC(pthread_setconcurrency,
719135446Strhodes				      AC_DEFINE(CALL_PTHREAD_SETCONCURRENCY))
720135446Strhodes			;;
721135446Strhodes		#
722135446Strhodes		# UnixWare does things its own way.
723135446Strhodes		#
724135446Strhodes		*-sco-sysv*uw*|*-*-sysv*UnixWare*|*-*-sysv*OpenUNIX*)
725135446Strhodes			AC_DEFINE(HAVE_UNIXWARE_SIGWAIT)
726135446Strhodes			;;
727135446Strhodes	esac
728135446Strhodes
729135446Strhodes	#
730135446Strhodes	# Look for sysconf to allow detection of the number of processors.
731135446Strhodes	#
732135446Strhodes	AC_CHECK_FUNC(sysconf, AC_DEFINE(HAVE_SYSCONF),)
733135446Strhodes
734135446Strhodeselse
735135446Strhodes	ISC_PLATFORM_USETHREADS="#undef ISC_PLATFORM_USETHREADS"
736135446Strhodes	thread_dir=nothreads
737135446Strhodes	ALWAYS_DEFINES=""
738135446Strhodesfi
739135446Strhodes
740135446StrhodesAC_SUBST(ALWAYS_DEFINES)
741135446StrhodesAC_SUBST(ISC_PLATFORM_USETHREADS)
742135446StrhodesISC_THREAD_DIR=$thread_dir
743135446StrhodesAC_SUBST(ISC_THREAD_DIR)
744135446Strhodes
745135446Strhodes#
746135446Strhodes# In solaris 10, SMF can manage named service
747135446Strhodes#
748135446StrhodesAC_CHECK_LIB(scf, smf_enable_instance)
749135446Strhodes
750135446Strhodes#
751135446Strhodes# flockfile is usually provided by pthreads, but we may want to use it
752135446Strhodes# even if compiled with --disable-threads.  getc_unlocked might also not
753135446Strhodes# be defined.
754135446Strhodes#
755135446StrhodesAC_CHECK_FUNC(flockfile, AC_DEFINE(HAVE_FLOCKFILE),)
756135446StrhodesAC_CHECK_FUNC(getc_unlocked, AC_DEFINE(HAVE_GETCUNLOCKED),)
757135446Strhodes
758135446Strhodes# 
759135446Strhodes# Indicate what the final decision was regarding threads.
760135446Strhodes#
761135446StrhodesAC_MSG_CHECKING(whether to build with threads)
762135446Strhodesif $use_threads; then
763135446Strhodes	AC_MSG_RESULT(yes)
764135446Strhodeselse
765135446Strhodes	AC_MSG_RESULT(no)
766135446Strhodesfi
767135446Strhodes
768135446Strhodes# 
769135446Strhodes# End of pthreads stuff.
770135446Strhodes#
771135446Strhodes
772135446Strhodes#
773135446Strhodes# Large File
774135446Strhodes#
775135446StrhodesAC_ARG_ENABLE(largefile, [  --enable-largefile	  64-bit file support],
776135446Strhodes	      want_largefile="yes", want_largefile="no")
777135446Strhodescase $want_largefile in
778135446Strhodes	yes)
779135446Strhodes		ALWAYS_DEFINES="$ALWAYS_DEFINES -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
780135446Strhodes		;;
781135446Strhodes	*)
782135446Strhodes		;;
783135446Strhodesesac
784135446Strhodes
785135446Strhodes#
786135446Strhodes# Additional compiler settings.
787135446Strhodes#
788135446StrhodesMKDEPCC="$CC"
789135446StrhodesMKDEPCFLAGS="-M"
790135446StrhodesIRIX_DNSSEC_WARNINGS_HACK=""
791135446Strhodes
792135446Strhodesif test "X$GCC" = "Xyes"; then
793165071Sdougb	AC_MSG_CHECKING(if "$CC" supports -fno-strict-aliasing)
794165071Sdougb	SAVE_CFLAGS=$CFLAGS
795165071Sdougb	CFLAGS=-fno-strict-aliasing
796165071Sdougb	AC_TRY_COMPILE(,, [FNOSTRICTALIASING=yes],[FNOSTRICTALIASING=no])
797165071Sdougb	CFLAGS=$SAVE_CFLAGS
798165071Sdougb	if test "$FNOSTRICTALIASING" = "yes"; then
799165071Sdougb		AC_MSG_RESULT(yes)
800165071Sdougb	STD_CWARNINGS="$STD_CWARNINGS -W -Wall -Wmissing-prototypes -Wcast-qual -Wwrite-strings -Wformat -Wpointer-arith -fno-strict-aliasing"
801165071Sdougb	else
802165071Sdougb		AC_MSG_RESULT(no)
803165071Sdougb	STD_CWARNINGS="$STD_CWARNINGS -W -Wall -Wmissing-prototypes -Wcast-qual -Wwrite-strings -Wformat -Wpointer-arith"
804165071Sdougb	fi
805143731Sdougb	case "$host" in
806143731Sdougb	*-hp-hpux*)
807153816Sdougb		LDFLAGS="-Wl,+vnocompatwarnings $LDFLAGS"
808143731Sdougb		;;
809143731Sdougb	esac
810135446Strhodeselse
811135446Strhodes	case $host in
812135446Strhodes	*-dec-osf*)
813135446Strhodes		CC="$CC -std"
814135446Strhodes		CCOPT="$CCOPT -std"
815135446Strhodes		MKDEPCC="$CC"
816135446Strhodes		;;
817135446Strhodes	*-hp-hpux*)
818135446Strhodes		CC="$CC -Ae -z"
819135446Strhodes		# The version of the C compiler that constantly warns about
820135446Strhodes                # 'const' as well as alignment issues is unfortunately not
821135446Strhodes                # able to be discerned via the version of the operating
822135446Strhodes                # system, nor does cc have a version flag.
823135446Strhodes		case "`$CC +W 123 2>&1`" in
824135446Strhodes		*Unknown?option*)
825135446Strhodes			STD_CWARNINGS="+w1"
826135446Strhodes			;;
827135446Strhodes		*)
828135446Strhodes			# Turn off the pointlessly noisy warnings.
829153816Sdougb			STD_CWARNINGS="+w1 +W 474,530,2193,2236"
830135446Strhodes			;;
831135446Strhodes		esac
832135446Strhodes		CCOPT="$CCOPT -Ae -z"
833153816Sdougb		LDFLAGS="-Wl,+vnocompatwarnings $LDFLAGS"
834135446Strhodes		MKDEPPROG='cc -Ae -E -Wp,-M >/dev/null 2>>$TMP'
835135446Strhodes		;;
836135446Strhodes	*-sgi-irix*)
837135446Strhodes		STD_CWARNINGS="-fullwarn -woff 1209"
838135446Strhodes		#
839135446Strhodes		# Silence more than 250 instances of
840135446Strhodes		#   "prototyped function redeclared without prototype"
841135446Strhodes		# and 11 instances of
842135446Strhodes		#   "variable ... was set but never used"
843135446Strhodes		# from lib/dns/sec/openssl.
844135446Strhodes		#
845135446Strhodes		IRIX_DNSSEC_WARNINGS_HACK="-woff 1692,1552"
846135446Strhodes		;;
847135446Strhodes	*-solaris*)
848135446Strhodes		MKDEPCFLAGS="-xM"
849135446Strhodes		;;
850135446Strhodes	*-sco-sysv*uw*|*-*-sysv*UnixWare*|*-*-sysv*OpenUNIX*)
851135446Strhodes                # UnixWare
852135446Strhodes		CC="$CC -w"
853135446Strhodes		;;
854135446Strhodes	esac
855135446Strhodesfi
856135446Strhodes
857135446StrhodesAC_SUBST(MKDEPCC)
858135446StrhodesAC_SUBST(MKDEPCFLAGS)
859135446StrhodesAC_SUBST(MKDEPPROG)
860135446StrhodesAC_SUBST(IRIX_DNSSEC_WARNINGS_HACK)
861135446Strhodes
862135446Strhodes#
863135446Strhodes# NLS
864135446Strhodes#
865135446StrhodesAC_CHECK_FUNC(catgets, AC_DEFINE(HAVE_CATGETS),)
866135446Strhodes
867135446Strhodes#
868135446Strhodes# -lxnet buys us one big porting headache...  standards, gotta love 'em.
869135446Strhodes#
870135446Strhodes# AC_CHECK_LIB(xnet, socket, ,
871135446Strhodes#    AC_CHECK_LIB(socket, socket)
872135446Strhodes#    AC_CHECK_LIB(nsl, inet_ntoa)
873135446Strhodes# )
874135446Strhodes#
875135446Strhodes# Use this for now, instead:
876135446Strhodes#
877135446Strhodescase "$host" in
878135446Strhodes	mips-sgi-irix*)
879135446Strhodes		;;
880135446Strhodes	*)
881135446Strhodes		AC_CHECK_LIB(socket, socket)
882135446Strhodes		AC_CHECK_LIB(nsl, inet_ntoa)
883135446Strhodes		;;
884135446Strhodesesac
885135446Strhodes
886135446Strhodes#
887135446Strhodes# Purify support
888135446Strhodes#
889135446StrhodesAC_MSG_CHECKING(whether to use purify)
890135446StrhodesAC_ARG_WITH(purify,
891135446Strhodes	[  --with-purify[=PATH]	use Rational purify],
892135446Strhodes	use_purify="$withval", use_purify="no")
893135446Strhodes
894135446Strhodescase "$use_purify" in
895135446Strhodes	no)
896135446Strhodes		;;
897135446Strhodes	yes)
898135446Strhodes		AC_PATH_PROG(purify_path, purify, purify)
899135446Strhodes		;;
900135446Strhodes	*)
901135446Strhodes		purify_path="$use_purify"
902135446Strhodes		;;
903135446Strhodesesac
904135446Strhodes
905135446Strhodescase "$use_purify" in
906135446Strhodes	no)
907135446Strhodes		AC_MSG_RESULT(no)
908135446Strhodes		PURIFY=""
909135446Strhodes		;;
910135446Strhodes	*)
911135446Strhodes		if test -f $purify_path || test $purify_path = purify; then
912135446Strhodes			AC_MSG_RESULT($purify_path)
913135446Strhodes			PURIFYFLAGS="`echo $PURIFYOPTIONS`"
914135446Strhodes			PURIFY="$purify_path $PURIFYFLAGS"
915135446Strhodes		else
916135446Strhodes			AC_MSG_ERROR([$purify_path not found.
917135446Strhodes
918135446StrhodesPlease choose the proper path with the following command:
919135446Strhodes
920135446Strhodes    configure --with-purify=PATH
921135446Strhodes])
922135446Strhodes		fi
923135446Strhodes		;;
924135446Strhodesesac
925135446Strhodes
926135446StrhodesAC_SUBST(PURIFY)
927135446Strhodes
928135446Strhodes#
929135446Strhodes# GNU libtool support
930135446Strhodes#
931135446StrhodesAC_ARG_WITH(libtool,
932135446Strhodes	    [  --with-libtool	use GNU libtool (following indented options supported)],
933135446Strhodes	    use_libtool="$withval", use_libtool="no")
934135446Strhodes
935135446Strhodescase $use_libtool in
936135446Strhodes	yes)
937135446Strhodes		AM_PROG_LIBTOOL
938135446Strhodes		O=lo
939135446Strhodes		A=la
940135446Strhodes		LIBTOOL_MKDEP_SED='s;\.o;\.lo;'
941135446Strhodes		LIBTOOL_MODE_COMPILE='--mode=compile'
942135446Strhodes		LIBTOOL_MODE_INSTALL='--mode=install'
943135446Strhodes		LIBTOOL_MODE_LINK='--mode=link'
944143731Sdougb		case "$host" in
945143731Sdougb		*) LIBTOOL_ALLOW_UNDEFINED= ;;
946143731Sdougb		esac
947143731Sdougb		case "$host" in
948143731Sdougb		*-ibm-aix*) LIBTOOL_IN_MAIN="-Wl,-bI:T_testlist.imp" ;;
949143731Sdougb		*) LIBTOOL_IN_MAIN= ;;
950143731Sdougb		esac;
951135446Strhodes		;;
952135446Strhodes	*)
953135446Strhodes		O=o
954135446Strhodes		A=a
955135446Strhodes		LIBTOOL=
956135446Strhodes		AC_SUBST(LIBTOOL)
957135446Strhodes		LIBTOOL_MKDEP_SED=
958135446Strhodes		LIBTOOL_MODE_COMPILE=
959135446Strhodes		LIBTOOL_MODE_INSTALL=
960135446Strhodes		LIBTOOL_MODE_LINK=
961143731Sdougb		LIBTOOL_ALLOW_UNDEFINED=
962143731Sdougb		LIBTOOL_IN_MAIN=
963135446Strhodes		;;
964135446Strhodesesac
965135446Strhodes
966135446Strhodes#
967135446Strhodes# File name extension for static archive files, for those few places
968135446Strhodes# where they are treated differently from dynamic ones.
969135446Strhodes#
970135446StrhodesSA=a
971135446Strhodes
972135446StrhodesAC_SUBST(O)
973135446StrhodesAC_SUBST(A)
974135446StrhodesAC_SUBST(SA)
975135446StrhodesAC_SUBST(LIBTOOL_MKDEP_SED)
976135446StrhodesAC_SUBST(LIBTOOL_MODE_COMPILE)
977135446StrhodesAC_SUBST(LIBTOOL_MODE_INSTALL)
978135446StrhodesAC_SUBST(LIBTOOL_MODE_LINK)
979143731SdougbAC_SUBST(LIBTOOL_ALLOW_UNDEFINED)
980143731SdougbAC_SUBST(LIBTOOL_IN_MAIN)
981135446Strhodes
982135446Strhodes#
983135446Strhodes# build libbind?
984135446Strhodes#
985135446StrhodesAC_ARG_ENABLE(libbind,
986135446Strhodes	[  --enable-libbind		build libbind [default=no]])
987135446Strhodes
988135446Strhodescase "$enable_libbind" in
989135446Strhodes	yes)
990135446Strhodes		LIBBIND=lib/bind
991135446Strhodes		AC_SUBST(LIBBIND)
992135446Strhodes		;;
993135446Strhodes	no|'')
994135446Strhodes		;;
995135446Strhodesesac
996135446Strhodes
997170222Sdougb
998135446Strhodes#
999135446Strhodes# Here begins a very long section to determine the system's networking
1000135446Strhodes# capabilities.  The order of the tests is signficant.
1001135446Strhodes#
1002135446Strhodes
1003135446Strhodes#
1004135446Strhodes# IPv6
1005135446Strhodes#
1006135446StrhodesAC_ARG_ENABLE(ipv6,
1007135446Strhodes	[  --enable-ipv6		use IPv6 [default=autodetect]])
1008135446Strhodes
1009135446Strhodescase "$enable_ipv6" in
1010135446Strhodes	yes|''|autodetect)
1011135446Strhodes		AC_DEFINE(WANT_IPV6)
1012135446Strhodes		;;
1013135446Strhodes	no)
1014135446Strhodes		;;
1015135446Strhodesesac
1016135446Strhodes
1017135446Strhodes#
1018135446Strhodes# We do the IPv6 compilation checking after libtool so that we can put
1019135446Strhodes# the right suffix on the files.
1020135446Strhodes#
1021135446StrhodesAC_MSG_CHECKING(for IPv6 structures)
1022135446StrhodesAC_TRY_COMPILE([
1023135446Strhodes#include <sys/types.h>
1024135446Strhodes#include <sys/socket.h>
1025135446Strhodes#include <netinet/in.h>],
1026135446Strhodes[struct sockaddr_in6 sin6; return (0);],
1027135446Strhodes	[AC_MSG_RESULT(yes)
1028135446Strhodes	 found_ipv6=yes],
1029135446Strhodes	[AC_MSG_RESULT(no)
1030135446Strhodes	 found_ipv6=no])
1031135446Strhodes
1032135446Strhodes#
1033135446Strhodes# See whether IPv6 support is provided via a Kame add-on.
1034135446Strhodes# This is done before other IPv6 linking tests to LIBS is properly set.
1035135446Strhodes#
1036135446StrhodesAC_MSG_CHECKING(for Kame IPv6 support)
1037135446StrhodesAC_ARG_WITH(kame,
1038135446Strhodes	[  --with-kame[=PATH]	use Kame IPv6 [default path /usr/local/v6]],
1039135446Strhodes	use_kame="$withval", use_kame="no")
1040135446Strhodes
1041135446Strhodescase "$use_kame" in
1042135446Strhodes	no)
1043135446Strhodes		;;
1044135446Strhodes	yes)
1045135446Strhodes		kame_path=/usr/local/v6
1046135446Strhodes		;;
1047135446Strhodes	*)
1048135446Strhodes		kame_path="$use_kame"
1049135446Strhodes		;;
1050135446Strhodesesac
1051135446Strhodes
1052135446Strhodescase "$use_kame" in
1053135446Strhodes	no)
1054135446Strhodes		AC_MSG_RESULT(no)
1055135446Strhodes		;;
1056135446Strhodes	*)
1057135446Strhodes		if test -f $kame_path/lib/libinet6.a; then
1058135446Strhodes			AC_MSG_RESULT($kame_path/lib/libinet6.a)
1059135446Strhodes			LIBS="-L$kame_path/lib -linet6 $LIBS"
1060135446Strhodes		else
1061135446Strhodes			AC_MSG_ERROR([$kame_path/lib/libinet6.a not found.
1062135446Strhodes
1063135446StrhodesPlease choose the proper path with the following command:
1064135446Strhodes
1065135446Strhodes    configure --with-kame=PATH
1066135446Strhodes])
1067135446Strhodes		fi
1068135446Strhodes		;;
1069135446Strhodesesac
1070135446Strhodes
1071135446Strhodes#
1072135446Strhodes# Whether netinet6/in6.h is needed has to be defined in isc/platform.h.
1073135446Strhodes# Including it on Kame-using platforms is very bad, though, because
1074135446Strhodes# Kame uses #error against direct inclusion.   So include it on only
1075135446Strhodes# the platform that is otherwise broken without it -- BSD/OS 4.0 through 4.1.
1076135446Strhodes# This is done before the in6_pktinfo check because that's what
1077135446Strhodes# netinet6/in6.h is needed for.
1078135446Strhodes#
1079135446Strhodeschangequote({, })
1080135446Strhodescase "$host" in
1081135446Strhodes*-bsdi4.[01]*)
1082135446Strhodes	ISC_PLATFORM_NEEDNETINET6IN6H="#define ISC_PLATFORM_NEEDNETINET6IN6H 1"
1083135446Strhodes	LWRES_PLATFORM_NEEDNETINET6IN6H="#define LWRES_PLATFORM_NEEDNETINET6IN6H 1"
1084135446Strhodes	isc_netinet6in6_hack="#include <netinet6/in6.h>"
1085135446Strhodes	;;
1086135446Strhodes*)
1087135446Strhodes	ISC_PLATFORM_NEEDNETINET6IN6H="#undef ISC_PLATFORM_NEEDNETINET6IN6H"
1088135446Strhodes	LWRES_PLATFORM_NEEDNETINET6IN6H="#undef LWRES_PLATFORM_NEEDNETINET6IN6H"
1089135446Strhodes	isc_netinet6in6_hack=""
1090135446Strhodes	;;
1091135446Strhodesesac
1092135446Strhodeschangequote([, ])
1093135446Strhodes
1094135446Strhodes#
1095135446Strhodes# This is similar to the netinet6/in6.h issue.
1096135446Strhodes#
1097135446Strhodescase "$host" in
1098135446Strhodes*-sco-sysv*uw*|*-*-sysv*UnixWare*|*-*-sysv*OpenUNIX*)
1099135446Strhodes        # UnixWare
1100135446Strhodes	ISC_PLATFORM_NEEDNETINETIN6H="#define ISC_PLATFORM_NEEDNETINETIN6H 1"
1101135446Strhodes	LWRES_PLATFORM_NEEDNETINETIN6H="#define LWRES_PLATFORM_NEEDNETINETIN6H 1"
1102135446Strhodes        ISC_PLATFORM_FIXIN6ISADDR="#define ISC_PLATFORM_FIXIN6ISADDR 1"
1103135446Strhodes	isc_netinetin6_hack="#include <netinet/in6.h>"
1104135446Strhodes	;;
1105135446Strhodes*)
1106135446Strhodes	ISC_PLATFORM_NEEDNETINETIN6H="#undef ISC_PLATFORM_NEEDNETINETIN6H"
1107135446Strhodes	LWRES_PLATFORM_NEEDNETINETIN6H="#undef LWRES_PLATFORM_NEEDNETINETIN6H"
1108135446Strhodes        ISC_PLATFORM_FIXIN6ISADDR="#undef ISC_PLATFORM_FIXIN6ISADDR"
1109135446Strhodes	isc_netinetin6_hack=""
1110135446Strhodes	;;
1111135446Strhodesesac
1112135446Strhodes
1113135446Strhodes#
1114135446Strhodes# Now delve deeper into the suitability of the IPv6 support.
1115135446Strhodes#
1116135446Strhodescase "$found_ipv6" in
1117135446Strhodes	yes)
1118135446Strhodes		ISC_PLATFORM_HAVEIPV6="#define ISC_PLATFORM_HAVEIPV6 1"
1119135446Strhodes		LWRES_PLATFORM_HAVEIPV6="#define LWRES_PLATFORM_HAVEIPV6 1"
1120135446Strhodes
1121135446Strhodes		AC_MSG_CHECKING(for in6_addr)
1122135446Strhodes		AC_TRY_COMPILE([
1123135446Strhodes#include <sys/types.h>
1124135446Strhodes#include <sys/socket.h>
1125135446Strhodes#include <netinet/in.h>
1126135446Strhodes$isc_netinetin6_hack
1127135446Strhodes$isc_netinet6in6_hack
1128135446Strhodes],
1129135446Strhodes[struct in6_addr in6; return (0);],
1130135446Strhodes		[AC_MSG_RESULT(yes)
1131135446Strhodes		 ISC_PLATFORM_HAVEINADDR6="#undef ISC_PLATFORM_HAVEINADDR6"
1132135446Strhodes		 LWRES_PLATFORM_HAVEINADDR6="#undef LWRES_PLATFORM_HAVEINADDR6"
1133135446Strhodes		 isc_in_addr6_hack=""],
1134135446Strhodes		[AC_MSG_RESULT(no)
1135135446Strhodes		 ISC_PLATFORM_HAVEINADDR6="#define ISC_PLATFORM_HAVEINADDR6 1"
1136135446Strhodes		 LWRES_PLATFORM_HAVEINADDR6="#define LWRES_PLATFORM_HAVEINADDR6 1"
1137135446Strhodes		 isc_in_addr6_hack="#define in6_addr in_addr6"])
1138135446Strhodes
1139135446Strhodes		AC_MSG_CHECKING(for in6addr_any)
1140135446Strhodes		AC_TRY_LINK([
1141135446Strhodes#include <sys/types.h>
1142135446Strhodes#include <sys/socket.h>
1143135446Strhodes#include <netinet/in.h>
1144135446Strhodes$isc_netinetin6_hack
1145135446Strhodes$isc_netinet6in6_hack
1146135446Strhodes$isc_in_addr6_hack
1147135446Strhodes],
1148135446Strhodes		[struct in6_addr in6; in6 = in6addr_any; return (in6.s6_addr[0]);],
1149135446Strhodes			[AC_MSG_RESULT(yes)
1150135446Strhodes			 ISC_PLATFORM_NEEDIN6ADDRANY="#undef ISC_PLATFORM_NEEDIN6ADDRANY"
1151135446Strhodes			 LWRES_PLATFORM_NEEDIN6ADDRANY="#undef LWRES_PLATFORM_NEEDIN6ADDRANY"],
1152135446Strhodes			[AC_MSG_RESULT(no)
1153135446Strhodes			 ISC_PLATFORM_NEEDIN6ADDRANY="#define ISC_PLATFORM_NEEDIN6ADDRANY 1"
1154135446Strhodes			 LWRES_PLATFORM_NEEDIN6ADDRANY="#define LWRES_PLATFORM_NEEDIN6ADDRANY 1"])
1155135446Strhodes
1156135446Strhodes		AC_MSG_CHECKING(for in6addr_loopback)
1157135446Strhodes		AC_TRY_LINK([
1158135446Strhodes#include <sys/types.h>
1159135446Strhodes#include <sys/socket.h>
1160135446Strhodes#include <netinet/in.h>
1161135446Strhodes$isc_netinetin6_hack
1162135446Strhodes$isc_netinet6in6_hack
1163135446Strhodes$isc_in_addr6_hack
1164135446Strhodes],
1165135446Strhodes		[struct in6_addr in6; in6 = in6addr_loopback; return (in6.s6_addr[0]);],
1166135446Strhodes			[AC_MSG_RESULT(yes)
1167135446Strhodes			 ISC_PLATFORM_NEEDIN6ADDRLOOPBACK="#undef ISC_PLATFORM_NEEDIN6ADDRLOOPBACK"
1168135446Strhodes			 LWRES_PLATFORM_NEEDIN6ADDRLOOPBACK="#undef LWRES_PLATFORM_NEEDIN6ADDRLOOPBACK"],
1169135446Strhodes			[AC_MSG_RESULT(no)
1170135446Strhodes			 ISC_PLATFORM_NEEDIN6ADDRLOOPBACK="#define ISC_PLATFORM_NEEDIN6ADDRLOOPBACK 1"
1171135446Strhodes			 LWRES_PLATFORM_NEEDIN6ADDRLOOPBACK="#define LWRES_PLATFORM_NEEDIN6ADDRLOOPBACK 1"])
1172135446Strhodes
1173135446Strhodes		AC_MSG_CHECKING(for sin6_scope_id in struct sockaddr_in6)
1174135446Strhodes		AC_TRY_COMPILE([
1175135446Strhodes#include <sys/types.h>
1176135446Strhodes#include <sys/socket.h>
1177135446Strhodes#include <netinet/in.h>
1178135446Strhodes$isc_netinetin6_hack
1179135446Strhodes$isc_netinet6in6_hack
1180135446Strhodes],
1181135446Strhodes		[struct sockaddr_in6 xyzzy; xyzzy.sin6_scope_id = 0; return (0);],
1182135446Strhodes			[AC_MSG_RESULT(yes)
1183135446Strhodes			 ISC_PLATFORM_HAVESCOPEID="#define ISC_PLATFORM_HAVESCOPEID 1"
1184135446Strhodes			 result="#define LWRES_HAVE_SIN6_SCOPE_ID 1"],
1185135446Strhodes			[AC_MSG_RESULT(no)
1186135446Strhodes			 ISC_PLATFORM_HAVESCOPEID="#undef ISC_PLATFORM_HAVESCOPEID"
1187135446Strhodes			 result="#undef LWRES_HAVE_SIN6_SCOPE_ID"])
1188135446Strhodes		LWRES_HAVE_SIN6_SCOPE_ID="$result"
1189135446Strhodes
1190135446Strhodes		AC_MSG_CHECKING(for in6_pktinfo)
1191135446Strhodes		AC_TRY_COMPILE([
1192135446Strhodes#include <sys/types.h>
1193135446Strhodes#include <sys/socket.h>
1194135446Strhodes#include <netinet/in.h>
1195135446Strhodes$isc_netinetin6_hack
1196135446Strhodes$isc_netinet6in6_hack
1197135446Strhodes],
1198135446Strhodes		[struct in6_pktinfo xyzzy; return (0);],
1199135446Strhodes			[AC_MSG_RESULT(yes)
1200135446Strhodes			 ISC_PLATFORM_HAVEIN6PKTINFO="#define ISC_PLATFORM_HAVEIN6PKTINFO 1"],
1201135446Strhodes			[AC_MSG_RESULT(no -- disabling runtime ipv6 support)
1202135446Strhodes			 ISC_PLATFORM_HAVEIN6PKTINFO="#undef ISC_PLATFORM_HAVEIN6PKTINFO"])
1203135446Strhodes		;;
1204135446Strhodes	no)
1205135446Strhodes		ISC_PLATFORM_HAVEIPV6="#undef ISC_PLATFORM_HAVEIPV6"
1206135446Strhodes		LWRES_PLATFORM_HAVEIPV6="#undef LWRES_PLATFORM_HAVEIPV6"
1207135446Strhodes		ISC_PLATFORM_NEEDIN6ADDRANY="#undef ISC_PLATFORM_NEEDIN6ADDRANY"
1208135446Strhodes		LWRES_PLATFORM_NEEDIN6ADDRANY="#undef LWRES_PLATFORM_NEEDIN6ADDRANY"
1209135446Strhodes		ISC_PLATFORM_HAVEIN6PKTINFO="#undef ISC_PLATFORM_HAVEIN6PKTINFO"
1210135446Strhodes		LWRES_HAVE_SIN6_SCOPE_ID="#define LWRES_HAVE_SIN6_SCOPE_ID 1"
1211135446Strhodes		ISC_PLATFORM_HAVESCOPEID="#define ISC_PLATFORM_HAVESCOPEID 1"
1212135446Strhodes		ISC_IPV6_H="ipv6.h"
1213135446Strhodes		ISC_IPV6_O="ipv6.$O"
1214135446Strhodes		ISC_ISCIPV6_O="unix/ipv6.$O"
1215135446Strhodes		ISC_IPV6_C="ipv6.c"
1216135446Strhodes		;;
1217135446Strhodesesac
1218135446Strhodes
1219135446StrhodesAC_SUBST(ISC_PLATFORM_HAVEIPV6)
1220135446StrhodesAC_SUBST(LWRES_PLATFORM_HAVEIPV6)
1221135446StrhodesAC_SUBST(ISC_PLATFORM_NEEDNETINETIN6H)
1222135446StrhodesAC_SUBST(LWRES_PLATFORM_NEEDNETINETIN6H)
1223135446StrhodesAC_SUBST(ISC_PLATFORM_NEEDNETINET6IN6H)
1224135446StrhodesAC_SUBST(LWRES_PLATFORM_NEEDNETINET6IN6H)
1225135446StrhodesAC_SUBST(ISC_PLATFORM_HAVEINADDR6)
1226135446StrhodesAC_SUBST(LWRES_PLATFORM_HAVEINADDR6)
1227135446StrhodesAC_SUBST(ISC_PLATFORM_NEEDIN6ADDRANY)
1228135446StrhodesAC_SUBST(LWRES_PLATFORM_NEEDIN6ADDRANY)
1229135446StrhodesAC_SUBST(ISC_PLATFORM_NEEDIN6ADDRLOOPBACK)
1230135446StrhodesAC_SUBST(LWRES_PLATFORM_NEEDIN6ADDRLOOPBACK)
1231135446StrhodesAC_SUBST(ISC_PLATFORM_HAVEIN6PKTINFO)
1232135446StrhodesAC_SUBST(ISC_PLATFORM_FIXIN6ISADDR)
1233135446StrhodesAC_SUBST(ISC_IPV6_H)
1234135446StrhodesAC_SUBST(ISC_IPV6_O)
1235135446StrhodesAC_SUBST(ISC_ISCIPV6_O)
1236135446StrhodesAC_SUBST(ISC_IPV6_C)
1237135446StrhodesAC_SUBST(LWRES_HAVE_SIN6_SCOPE_ID)
1238135446StrhodesAC_SUBST(ISC_PLATFORM_HAVESCOPEID)
1239135446Strhodes
1240135446StrhodesAC_MSG_CHECKING([for struct if_laddrreq])
1241135446StrhodesAC_TRY_LINK([
1242135446Strhodes#include <sys/types.h>
1243135446Strhodes#include <net/if6.h>
1244135446Strhodes],[ struct if_laddrreq a; ],
1245135446Strhodes	[AC_MSG_RESULT(yes)
1246135446Strhodes	ISC_PLATFORM_HAVEIF_LADDRREQ="#define ISC_PLATFORM_HAVEIF_LADDRREQ 1"],
1247135446Strhodes	[AC_MSG_RESULT(no)
1248135446Strhodes	ISC_PLATFORM_HAVEIF_LADDRREQ="#undef ISC_PLATFORM_HAVEIF_LADDRREQ"])
1249135446StrhodesAC_SUBST(ISC_PLATFORM_HAVEIF_LADDRREQ)
1250135446Strhodes
1251135446StrhodesAC_MSG_CHECKING([for struct if_laddrconf])
1252135446StrhodesAC_TRY_LINK([
1253135446Strhodes#include <sys/types.h>
1254135446Strhodes#include <net/if6.h>
1255135446Strhodes],[ struct if_laddrconf a; ],
1256135446Strhodes	[AC_MSG_RESULT(yes)
1257135446Strhodes	ISC_PLATFORM_HAVEIF_LADDRCONF="#define ISC_PLATFORM_HAVEIF_LADDRCONF 1"],
1258135446Strhodes	[AC_MSG_RESULT(no)
1259135446Strhodes	ISC_PLATFORM_HAVEIF_LADDRCONF="#undef ISC_PLATFORM_HAVEIF_LADDRCONF"])
1260135446StrhodesAC_SUBST(ISC_PLATFORM_HAVEIF_LADDRCONF)
1261135446Strhodes
1262135446Strhodes#
1263135446Strhodes# Check for network functions that are often missing.  We do this
1264135446Strhodes# after the libtool checking, so we can put the right suffix on
1265135446Strhodes# the files.  It also needs to come after checking for a Kame add-on,
1266135446Strhodes# which provides some (all?) of the desired functions.
1267135446Strhodes#
1268135446Strhodes
1269135446StrhodesAC_MSG_CHECKING([for inet_ntop with IPv6 support])
1270135446StrhodesAC_TRY_RUN([
1271135446Strhodes#include <sys/types.h>
1272135446Strhodes#include <sys/socket.h>
1273135446Strhodes#include <netinet/in.h>
1274135446Strhodes#include <arpa/inet.h>
1275135446Strhodesmain() {
1276135446Strhodeschar a[16],b[64]; return(inet_ntop(AF_INET6, a, b, sizeof(b)) == (char*)0);}],
1277135446Strhodes        [AC_MSG_RESULT(yes)
1278135446Strhodes        ISC_PLATFORM_NEEDNTOP="#undef ISC_PLATFORM_NEEDNTOP"],
1279135446Strhodes
1280135446Strhodes        [AC_MSG_RESULT(no)
1281135446Strhodes        ISC_EXTRA_OBJS="$ISC_EXTRA_OBJS inet_ntop.$O"
1282135446Strhodes        ISC_EXTRA_SRCS="$ISC_EXTRA_SRCS inet_ntop.c"
1283153816Sdougb        ISC_PLATFORM_NEEDNTOP="#define ISC_PLATFORM_NEEDNTOP 1"],
1284153816Sdougb        [AC_MSG_RESULT(assuming inet_ntop needed)
1285153816Sdougb        ISC_EXTRA_OBJS="$ISC_EXTRA_OBJS inet_ntop.$O"
1286153816Sdougb        ISC_EXTRA_SRCS="$ISC_EXTRA_SRCS inet_ntop.c"
1287135446Strhodes        ISC_PLATFORM_NEEDNTOP="#define ISC_PLATFORM_NEEDNTOP 1"])
1288135446Strhodes
1289135446Strhodes
1290135446Strhodes# On NetBSD 1.4.2 and maybe others, inet_pton() incorrectly accepts
1291135446Strhodes# addresses with less than four octets, like "1.2.3".  Also leading
1292135446Strhodes# zeros should also be rejected.
1293135446Strhodes
1294135446StrhodesAC_MSG_CHECKING([for working inet_pton with IPv6 support])
1295135446StrhodesAC_TRY_RUN([
1296135446Strhodes#include <sys/types.h>
1297135446Strhodes#include <sys/socket.h>
1298135446Strhodes#include <netinet/in.h>
1299135446Strhodes#include <arpa/inet.h>
1300135446Strhodesmain() { char a[16]; return (inet_pton(AF_INET, "1.2.3", a) == 1 ? 1 :
1301135446Strhodes			     inet_pton(AF_INET, "1.2.3.04", a) == 1 ? 1 : 
1302135446Strhodes			     (inet_pton(AF_INET6, "::1.2.3.4", a) != 1)); }],
1303135446Strhodes        [AC_MSG_RESULT(yes)
1304135446Strhodes        ISC_PLATFORM_NEEDPTON="#undef ISC_PLATFORM_NEEDPTON"],
1305135446Strhodes        [AC_MSG_RESULT(no)
1306135446Strhodes        ISC_EXTRA_OBJS="$ISC_EXTRA_OBJS inet_pton.$O"
1307135446Strhodes        ISC_EXTRA_SRCS="$ISC_EXTRA_SRCS inet_pton.c"
1308135446Strhodes        ISC_PLATFORM_NEEDPTON="#define ISC_PLATFORM_NEEDPTON 1"],
1309135446Strhodes	[AC_MSG_RESULT(assuming target platform has working inet_pton)
1310153816Sdougb	ISC_PLATFORM_NEEDPTON="#undef ISC_PLATFORM_NEEDPTON"],
1311153816Sdougb        [AC_MSG_RESULT(assuming inet_pton needed)
1312153816Sdougb        ISC_EXTRA_OBJS="$ISC_EXTRA_OBJS inet_pton.$O"
1313153816Sdougb        ISC_EXTRA_SRCS="$ISC_EXTRA_SRCS inet_pton.c"
1314153816Sdougb        ISC_PLATFORM_NEEDPTON="#define ISC_PLATFORM_NEEDPTON 1"],
1315153816Sdougb        [AC_MSG_RESULT(assuming target platform has working inet_pton)
1316153816Sdougb        ISC_PLATFORM_NEEDPTON="#undef ISC_PLATFORM_NEEDPTON"])
1317135446Strhodes
1318135446StrhodesAC_MSG_CHECKING([for inet_aton])
1319135446StrhodesAC_TRY_LINK([
1320135446Strhodes#include <sys/types.h>
1321135446Strhodes#include <netinet/in.h>
1322135446Strhodes#include <arpa/inet.h>],
1323135446Strhodes        [struct in_addr in; inet_aton(0, &in); return (0);],
1324135446Strhodes        [AC_MSG_RESULT(yes)
1325135446Strhodes        ISC_PLATFORM_NEEDATON="#undef ISC_PLATFORM_NEEDATON"],
1326135446Strhodes
1327135446Strhodes        [AC_MSG_RESULT(no)
1328135446Strhodes        ISC_EXTRA_OBJS="$ISC_EXTRA_OBJS inet_aton.$O"
1329135446Strhodes        ISC_EXTRA_SRCS="$ISC_EXTRA_SRCS inet_aton.c"
1330135446Strhodes        ISC_PLATFORM_NEEDATON="#define ISC_PLATFORM_NEEDATON 1"])
1331135446Strhodes
1332135446StrhodesAC_SUBST(ISC_PLATFORM_NEEDNTOP)
1333135446StrhodesAC_SUBST(ISC_PLATFORM_NEEDPTON)
1334135446StrhodesAC_SUBST(ISC_PLATFORM_NEEDATON)
1335135446Strhodes
1336135446Strhodes#
1337135446Strhodes# Look for a 4.4BSD-style sa_len member in struct sockaddr.
1338135446Strhodes#
1339135446Strhodescase "$host" in
1340135446Strhodes	*-dec-osf*)
1341135446Strhodes		# Turn on 4.4BSD style sa_len support.
1342135446Strhodes		AC_DEFINE(_SOCKADDR_LEN)
1343135446Strhodes		;;
1344135446Strhodesesac
1345135446Strhodes
1346135446StrhodesAC_MSG_CHECKING(for sa_len in struct sockaddr)
1347135446StrhodesAC_TRY_COMPILE([
1348135446Strhodes#include <sys/types.h>
1349135446Strhodes#include <sys/socket.h>],
1350135446Strhodes[struct sockaddr sa; sa.sa_len = 0; return (0);],
1351135446Strhodes	[AC_MSG_RESULT(yes)
1352135446Strhodes	ISC_PLATFORM_HAVESALEN="#define ISC_PLATFORM_HAVESALEN 1"
1353135446Strhodes	LWRES_PLATFORM_HAVESALEN="#define LWRES_PLATFORM_HAVESALEN 1"],
1354135446Strhodes	[AC_MSG_RESULT(no)
1355135446Strhodes	ISC_PLATFORM_HAVESALEN="#undef ISC_PLATFORM_HAVESALEN"
1356135446Strhodes	LWRES_PLATFORM_HAVESALEN="#undef LWRES_PLATFORM_HAVESALEN"])
1357135446StrhodesAC_SUBST(ISC_PLATFORM_HAVESALEN)
1358135446StrhodesAC_SUBST(LWRES_PLATFORM_HAVESALEN)
1359135446Strhodes
1360135446Strhodes#
1361135446Strhodes# Look for a 4.4BSD or 4.3BSD struct msghdr
1362135446Strhodes#
1363135446StrhodesAC_MSG_CHECKING(for struct msghdr flavor)
1364135446StrhodesAC_TRY_COMPILE([
1365135446Strhodes#include <sys/types.h>
1366135446Strhodes#include <sys/socket.h>],
1367135446Strhodes[struct msghdr msg; msg.msg_flags = 0; return (0);],
1368135446Strhodes	[AC_MSG_RESULT(4.4BSD)
1369135446Strhodes	ISC_PLATFORM_MSGHDRFLAVOR="#define ISC_NET_BSD44MSGHDR 1"],
1370135446Strhodes	[AC_MSG_RESULT(4.3BSD)
1371135446Strhodes	ISC_PLATFORM_MSGHDRFLAVOR="#define ISC_NET_BSD43MSGHDR 1"])
1372135446StrhodesAC_SUBST(ISC_PLATFORM_MSGHDRFLAVOR)
1373135446Strhodes
1374135446Strhodes#
1375135446Strhodes# Look for in_port_t.
1376135446Strhodes#
1377135446StrhodesAC_MSG_CHECKING(for type in_port_t)
1378135446StrhodesAC_TRY_COMPILE([
1379135446Strhodes#include <sys/types.h>
1380135446Strhodes#include <netinet/in.h>],
1381135446Strhodes[in_port_t port = 25; return (0);],
1382135446Strhodes	[AC_MSG_RESULT(yes)
1383135446Strhodes	ISC_PLATFORM_NEEDPORTT="#undef ISC_PLATFORM_NEEDPORTT"],
1384135446Strhodes        [AC_MSG_RESULT(no)
1385135446Strhodes	ISC_PLATFORM_NEEDPORTT="#define ISC_PLATFORM_NEEDPORTT 1"])
1386135446StrhodesAC_SUBST(ISC_PLATFORM_NEEDPORTT)
1387135446Strhodes
1388135446Strhodes#
1389135446Strhodes# Check for addrinfo
1390135446Strhodes#
1391135446StrhodesAC_MSG_CHECKING(for struct addrinfo)
1392135446StrhodesAC_TRY_COMPILE([
1393135446Strhodes#include <netdb.h>],
1394135446Strhodes[struct addrinfo a; return (0);],
1395135446Strhodes	[AC_MSG_RESULT(yes)
1396135446Strhodes	ISC_LWRES_NEEDADDRINFO="#undef ISC_LWRES_NEEDADDRINFO"
1397135446Strhodes	AC_DEFINE(HAVE_ADDRINFO)],
1398135446Strhodes	[AC_MSG_RESULT(no)
1399135446Strhodes	ISC_LWRES_NEEDADDRINFO="#define ISC_LWRES_NEEDADDRINFO 1"])
1400135446StrhodesAC_SUBST(ISC_LWRES_NEEDADDRINFO)
1401135446Strhodes
1402135446Strhodes#
1403135446Strhodes# Check for rrsetinfo
1404135446Strhodes#
1405135446StrhodesAC_MSG_CHECKING(for struct rrsetinfo)
1406135446StrhodesAC_TRY_COMPILE([
1407135446Strhodes#include <netdb.h>],
1408135446Strhodes[struct rrsetinfo r; return (0);],
1409135446Strhodes	[AC_MSG_RESULT(yes)
1410135446Strhodes	ISC_LWRES_NEEDRRSETINFO="#undef ISC_LWRES_NEEDRRSETINFO"],
1411135446Strhodes	[AC_MSG_RESULT(no)
1412135446Strhodes	ISC_LWRES_NEEDRRSETINFO="#define ISC_LWRES_NEEDRRSETINFO 1"])
1413135446StrhodesAC_SUBST(ISC_LWRES_NEEDRRSETINFO)
1414135446Strhodes
1415135446StrhodesAC_MSG_CHECKING(for int sethostent)
1416135446StrhodesAC_TRY_COMPILE([
1417135446Strhodes#include <netdb.h>],
1418135446Strhodes[int i = sethostent(0); return(0);],
1419135446Strhodes	[AC_MSG_RESULT(yes)
1420135446Strhodes	ISC_LWRES_SETHOSTENTINT="#define ISC_LWRES_SETHOSTENTINT 1"],
1421135446Strhodes	[AC_MSG_RESULT(no)
1422135446Strhodes	ISC_LWRES_SETHOSTENTINT="#undef ISC_LWRES_SETHOSTENTINT"])
1423135446StrhodesAC_SUBST(ISC_LWRES_SETHOSTENTINT)
1424135446Strhodes
1425135446StrhodesAC_MSG_CHECKING(for int endhostent)
1426135446StrhodesAC_TRY_COMPILE([
1427135446Strhodes#include <netdb.h>],
1428135446Strhodes[int i = endhostent(); return(0);],
1429135446Strhodes	[AC_MSG_RESULT(yes)
1430135446Strhodes	ISC_LWRES_ENDHOSTENTINT="#define ISC_LWRES_ENDHOSTENTINT 1"],
1431135446Strhodes	[AC_MSG_RESULT(no)
1432135446Strhodes	ISC_LWRES_ENDHOSTENTINT="#undef ISC_LWRES_ENDHOSTENTINT"])
1433135446StrhodesAC_SUBST(ISC_LWRES_ENDHOSTENTINT)
1434135446Strhodes
1435135446StrhodesAC_MSG_CHECKING(for getnetbyaddr(in_addr_t, ...))
1436135446StrhodesAC_TRY_COMPILE([
1437135446Strhodes#include <netdb.h>
1438135446Strhodesstruct netent *getnetbyaddr(in_addr_t, int);],
1439135446Strhodes[],
1440135446Strhodes	[AC_MSG_RESULT(yes)
1441135446Strhodes	ISC_LWRES_GETNETBYADDRINADDR="#define ISC_LWRES_GETNETBYADDRINADDR 1"],
1442135446Strhodes	[AC_MSG_RESULT(no)
1443135446Strhodes	ISC_LWRES_GETNETBYADDRINADDR="#undef ISC_LWRES_GETNETBYADDRINADDR"])
1444135446StrhodesAC_SUBST(ISC_LWRES_GETNETBYADDRINADDR)
1445135446Strhodes
1446135446StrhodesAC_MSG_CHECKING(for int setnetent)
1447135446StrhodesAC_TRY_COMPILE([
1448135446Strhodes#include <netdb.h>],
1449135446Strhodes[int i = setnetent(0); return(0);],
1450135446Strhodes	[AC_MSG_RESULT(yes)
1451135446Strhodes	ISC_LWRES_SETNETENTINT="#define ISC_LWRES_SETNETENTINT 1"],
1452135446Strhodes	[AC_MSG_RESULT(no)
1453135446Strhodes	ISC_LWRES_SETNETENTINT="#undef ISC_LWRES_SETNETENTINT"])
1454135446StrhodesAC_SUBST(ISC_LWRES_SETNETENTINT)
1455135446Strhodes
1456135446StrhodesAC_MSG_CHECKING(for int endnetent)
1457135446StrhodesAC_TRY_COMPILE([
1458135446Strhodes#include <netdb.h>],
1459135446Strhodes[int i = endnetent(); return(0);],
1460135446Strhodes	[AC_MSG_RESULT(yes)
1461135446Strhodes	ISC_LWRES_ENDNETENTINT="#define ISC_LWRES_ENDNETENTINT 1"],
1462135446Strhodes	[AC_MSG_RESULT(no)
1463135446Strhodes	ISC_LWRES_ENDNETENTINT="#undef ISC_LWRES_ENDNETENTINT"])
1464135446StrhodesAC_SUBST(ISC_LWRES_ENDNETENTINT)
1465135446Strhodes
1466135446StrhodesAC_MSG_CHECKING(for gethostbyaddr(const void *, size_t, ...))
1467135446StrhodesAC_TRY_COMPILE([
1468135446Strhodes#include <netdb.h>
1469135446Strhodesstruct hostent *gethostbyaddr(const void *, size_t, int);],
1470135446Strhodes[return(0);],
1471135446Strhodes	[AC_MSG_RESULT(yes)
1472135446Strhodes	ISC_LWRES_GETHOSTBYADDRVOID="#define ISC_LWRES_GETHOSTBYADDRVOID 1"],
1473135446Strhodes	[AC_MSG_RESULT(no)
1474135446Strhodes	ISC_LWRES_GETHOSTBYADDRVOID="#undef ISC_LWRES_GETHOSTBYADDRVOID"])
1475135446StrhodesAC_SUBST(ISC_LWRES_GETHOSTBYADDRVOID)
1476135446Strhodes
1477135446StrhodesAC_MSG_CHECKING(for h_errno in netdb.h)
1478135446StrhodesAC_TRY_COMPILE([
1479135446Strhodes#include <netdb.h>],
1480135446Strhodes[h_errno = 1; return(0);],
1481135446Strhodes	[AC_MSG_RESULT(yes)
1482135446Strhodes	ISC_LWRES_NEEDHERRNO="#undef ISC_LWRES_NEEDHERRNO"],
1483135446Strhodes	[AC_MSG_RESULT(no)
1484135446Strhodes	ISC_LWRES_NEEDHERRNO="#define ISC_LWRES_NEEDHERRNO 1"])
1485135446StrhodesAC_SUBST(ISC_LWRES_NEEDHERRNO)
1486135446Strhodes
1487135446StrhodesAC_CHECK_FUNC(getipnodebyname,
1488135446Strhodes        [ISC_LWRES_GETIPNODEPROTO="#undef ISC_LWRES_GETIPNODEPROTO"],
1489135446Strhodes        [ISC_LWRES_GETIPNODEPROTO="#define ISC_LWRES_GETIPNODEPROTO 1"])
1490135446StrhodesAC_CHECK_FUNC(getnameinfo,
1491135446Strhodes        [ISC_LWRES_GETNAMEINFOPROTO="#undef ISC_LWRES_GETNAMEINFOPROTO"],
1492135446Strhodes        [ISC_LWRES_GETNAMEINFOPROTO="#define ISC_LWRES_GETNAMEINFOPROTO 1"])
1493135446StrhodesAC_CHECK_FUNC(getaddrinfo,
1494135446Strhodes        [ISC_LWRES_GETADDRINFOPROTO="#undef ISC_LWRES_GETADDRINFOPROTO"
1495135446Strhodes	AC_DEFINE(HAVE_GETADDRINFO)],
1496135446Strhodes        [ISC_LWRES_GETADDRINFOPROTO="#define ISC_LWRES_GETADDRINFOPROTO 1"])
1497135446StrhodesAC_CHECK_FUNC(gai_strerror, AC_DEFINE(HAVE_GAISTRERROR))
1498135446StrhodesAC_SUBST(ISC_LWRES_GETIPNODEPROTO)
1499135446StrhodesAC_SUBST(ISC_LWRES_GETADDRINFOPROTO)
1500135446StrhodesAC_SUBST(ISC_LWRES_GETNAMEINFOPROTO)
1501135446Strhodes
1502135446StrhodesAC_ARG_ENABLE(getifaddrs,
1503135446Strhodes[  --enable-getifaddrs    Enable the use of getifaddrs() [[yes|no|glibc]].
1504135446Strhodes             glibc: Use getifaddrs() in glibc if you know it supports IPv6.],
1505135446Strhodes    want_getifaddrs="$enableval",  want_getifaddrs="yes")
1506135446Strhodes
1507135446Strhodescase $want_getifaddrs in
1508135446Strhodesyes|glibc)
1509135446Strhodes#
1510135446Strhodes# Do we have getifaddrs() ?
1511135446Strhodes#
1512135446Strhodescase $host in
1513135446Strhodes*-linux*)
1514135446Strhodes	# Some recent versions of glibc support getifaddrs() which does not
1515135446Strhodes	# provide AF_INET6 addresses while the function provided by the USAGI
1516135446Strhodes	# project handles the AF_INET6 case correctly.  We need to avoid
1517135446Strhodes	# using the former but prefer the latter unless overridden by
1518135446Strhodes	# --enable-getifaddrs=glibc.
1519143731Sdougb	if test $want_getifaddrs = glibc
1520135446Strhodes	then
1521135446Strhodes		AC_CHECK_FUNC(getifaddrs, AC_DEFINE(HAVE_GETIFADDRS))
1522135446Strhodes	else
1523135446Strhodes		save_LIBS="$LIBS"
1524135446Strhodes		LIBS="-L/usr/local/v6/lib $LIBS"
1525135446Strhodes		AC_CHECK_LIB(inet6, getifaddrs,
1526135446Strhodes			LIBS="$LIBS -linet6"
1527135446Strhodes			AC_DEFINE(HAVE_GETIFADDRS),
1528135446Strhodes			LIBS=${save_LIBS})
1529135446Strhodes	fi
1530135446Strhodes	;;
1531135446Strhodes*)
1532135446Strhodes	AC_CHECK_FUNC(getifaddrs, AC_DEFINE(HAVE_GETIFADDRS))
1533135446Strhodes	;;
1534135446Strhodesesac
1535135446Strhodes;;
1536135446Strhodesno)
1537135446Strhodes;;
1538135446Strhodesesac
1539135446Strhodes
1540135446Strhodes#
1541135446Strhodes# Look for a sysctl call to get the list of network interfaces.
1542135446Strhodes#
1543135446Strhodescase $ac_cv_header_sys_sysctl_h in
1544135446Strhodesyes)
1545135446StrhodesAC_MSG_CHECKING(for interface list sysctl)
1546135446StrhodesAC_EGREP_CPP(found_rt_iflist, [
1547135446Strhodes#include <sys/param.h>
1548135446Strhodes#include <sys/sysctl.h>
1549135446Strhodes#include <sys/socket.h>
1550135446Strhodes#ifdef NET_RT_IFLIST
1551135446Strhodesfound_rt_iflist
1552135446Strhodes#endif
1553135446Strhodes],
1554135446Strhodes	[AC_MSG_RESULT(yes)
1555135446Strhodes	 AC_DEFINE(HAVE_IFLIST_SYSCTL)],
1556135446Strhodes	[AC_MSG_RESULT(no)])
1557135446Strhodes;;
1558135446Strhodesesac
1559135446Strhodes
1560135446Strhodes#
1561135446Strhodes# Check for some other useful functions that are not ever-present.
1562135446Strhodes#
1563135446Strhodes
1564135446Strhodes# We test for strsep() using AC_TRY_LINK instead of AC_CHECK_FUNC
1565135446Strhodes# because AIX 4.3.3 with patches for bos.adt.include to version 4.3.3.77
1566135446Strhodes# reportedly defines strsep() without declaring it in <string.h> when
1567135446Strhodes# -D_LINUX_SOURCE_COMPAT is not defined [RT #2190], and
1568135446Strhodes# AC_CHECK_FUNC() incorrectly succeeds because it declares
1569135446Strhodes# the function itself.
1570135446StrhodesAC_MSG_CHECKING(for correctly declared strsep())
1571135446StrhodesAC_TRY_LINK([#include <string.h>], [char *sp; char *foo = strsep(&sp, ".");],
1572135446Strhodes	[AC_MSG_RESULT(yes); ISC_PLATFORM_NEEDSTRSEP="#undef ISC_PLATFORM_NEEDSTRSEP"],
1573135446Strhodes	[AC_MSG_RESULT(no); ISC_PLATFORM_NEEDSTRSEP="#define ISC_PLATFORM_NEEDSTRSEP 1"])
1574135446StrhodesAC_SUBST(ISC_PLATFORM_NEEDSTRSEP)
1575135446Strhodes
1576135446StrhodesAC_CHECK_FUNC(memmove,
1577135446Strhodes	[ISC_PLATFORM_NEEDMEMMOVE="#undef ISC_PLATFORM_NEEDMEMMOVE"],
1578135446Strhodes	[ISC_PLATFORM_NEEDMEMMOVE="#define ISC_PLATFORM_NEEDMEMMOVE 1"])
1579135446StrhodesAC_SUBST(ISC_PLATFORM_NEEDMEMMOVE)
1580135446Strhodes
1581135446StrhodesAC_CHECK_FUNC(strtoul,
1582153816Sdougb	[ISC_PLATFORM_NEEDSTRTOUL="#undef ISC_PLATFORM_NEEDSTRTOUL"
1583165071Sdougb	 LWRES_PLATFORM_NEEDSTRTOUL="#undef LWRES_PLATFORM_NEEDSTRTOUL"
1584153816Sdougb	 GENRANDOMLIB=""],
1585153816Sdougb	[ISC_PLATFORM_NEEDSTRTOUL="#define ISC_PLATFORM_NEEDSTRTOUL 1"
1586165071Sdougb	 LWRES_PLATFORM_NEEDSTRTOUL="#define LWRES_PLATFORM_NEEDSTRTOUL 1"
1587165071Sdougb	 GENRANDOMLIB='${ISCLIBS}'])
1588135446StrhodesAC_SUBST(ISC_PLATFORM_NEEDSTRTOUL)
1589153816SdougbAC_SUBST(LWRES_PLATFORM_NEEDSTRTOUL)
1590153816SdougbAC_SUBST(GENRANDOMLIB)
1591135446Strhodes
1592135446StrhodesAC_CHECK_FUNC(strlcpy,
1593135446Strhodes	[ISC_PLATFORM_NEEDSTRLCPY="#undef ISC_PLATFORM_NEEDSTRLCPY"],
1594135446Strhodes	[ISC_PLATFORM_NEEDSTRLCPY="#define ISC_PLATFORM_NEEDSTRLCPY 1"])
1595135446StrhodesAC_SUBST(ISC_PLATFORM_NEEDSTRLCPY)
1596135446Strhodes
1597135446StrhodesAC_CHECK_FUNC(strlcat,
1598135446Strhodes	[ISC_PLATFORM_NEEDSTRLCAT="#undef ISC_PLATFORM_NEEDSTRLCAT"],
1599135446Strhodes	[ISC_PLATFORM_NEEDSTRLCAT="#define ISC_PLATFORM_NEEDSTRLCAT 1"])
1600135446StrhodesAC_SUBST(ISC_PLATFORM_NEEDSTRLCAT)
1601135446Strhodes
1602135446StrhodesISC_PRINT_OBJS=
1603135446StrhodesISC_PRINT_SRCS=
1604135446StrhodesAC_MSG_CHECKING(sprintf)
1605135446StrhodesAC_TRY_COMPILE([
1606135446Strhodes#include <stdio.h>
1607135446Strhodes],
1608135446Strhodes[ char buf[2]; return(*sprintf(buf,"x"));],
1609135446Strhodes[
1610135446StrhodesISC_PRINT_OBJS="print.$O"
1611135446StrhodesISC_PRINT_SRCS="print.c"
1612135446StrhodesISC_PLATFORM_NEEDSPRINTF="#define ISC_PLATFORM_NEEDSPRINTF"
1613135446StrhodesLWRES_PLATFORM_NEEDSPRINTF="#define LWRES_PLATFORM_NEEDSPRINTF"
1614135446Strhodes],
1615135446Strhodes[ISC_PLATFORM_NEEDSPRINTF="#undef ISC_PLATFORM_NEEDSPRINTF"
1616135446Strhodes LWRES_PLATFORM_NEEDSPRINTF="#undef LWRES_PLATFORM_NEEDSPRINTF"]
1617135446Strhodes)
1618135446StrhodesAC_SUBST(ISC_PLATFORM_NEEDSPRINTF)
1619135446StrhodesAC_SUBST(LWRES_PLATFORM_NEEDSPRINTF)
1620135446Strhodes
1621135446StrhodesAC_CHECK_FUNC(vsnprintf,
1622135446Strhodes	[ISC_PLATFORM_NEEDVSNPRINTF="#undef ISC_PLATFORM_NEEDVSNPRINTF"
1623135446Strhodes	 LWRES_PLATFORM_NEEDVSNPRINTF="#undef LWRES_PLATFORM_NEEDVSNPRINTF"],
1624135446Strhodes	[ISC_PRINT_OBJS="print.$O"
1625135446Strhodes	 ISC_PRINT_SRCS="print.c"
1626135446Strhodes	 ISC_PLATFORM_NEEDVSNPRINTF="#define ISC_PLATFORM_NEEDVSNPRINTF 1"
1627135446Strhodes	 LWRES_PLATFORM_NEEDVSNPRINTF="#define LWRES_PLATFORM_NEEDVSNPRINTF 1"])
1628135446StrhodesAC_SUBST(ISC_PLATFORM_NEEDVSNPRINTF)
1629135446StrhodesAC_SUBST(LWRES_PLATFORM_NEEDVSNPRINTF)
1630135446StrhodesISC_EXTRA_OBJS="$ISC_EXTRA_OBJS $ISC_PRINT_OBJS"
1631135446StrhodesISC_EXTRA_SRCS="$ISC_EXTRA_SRCS $ISC_PRINT_SRCS"
1632135446Strhodes
1633135446StrhodesAC_CHECK_FUNC(strerror, AC_DEFINE(HAVE_STRERROR))
1634135446Strhodes
1635135446StrhodesAC_SUBST(ISC_EXTRA_OBJS)
1636135446StrhodesAC_SUBST(ISC_EXTRA_SRCS)
1637135446Strhodes
1638135446Strhodes# Determine the printf format characters to use when printing
1639135446Strhodes# values of type isc_int64_t. This will normally be "ll", but where
1640135446Strhodes# the compiler treats "long long" as a alias for "long" and printf
1641135446Strhodes# doesn't know about "long long" use "l".  Hopefully the sprintf
1642135446Strhodes# will produce a inconsistant result in the later case.  If the compiler
1643135446Strhodes# fails due to seeing "%lld" we fall back to "l".
1644135446Strhodes#
1645153816Sdougb# Digital Unix 4.0 (gcc?) (long long) is 64 bits as is its long. It uses
1646153816Sdougb# %ld even for (long long)/
1647153816Sdougb#
1648135446Strhodes# Win32 uses "%I64d", but that's defined elsewhere since we don't use
1649135446Strhodes# configure on Win32.
1650135446Strhodes#
1651135446StrhodesAC_MSG_CHECKING(printf format modifier for 64-bit integers)
1652135446StrhodesAC_TRY_RUN([
1653135446Strhodes#include <stdio.h>
1654135446Strhodesmain() {
1655135446Strhodes	long long int j = 0;
1656135446Strhodes	char buf[100];
1657135446Strhodes	buf[0] = 0;
1658135446Strhodes	sprintf(buf, "%lld", j);
1659135446Strhodes	exit((sizeof(long long int) != sizeof(long int))? 0 :
1660135446Strhodes	     (strcmp(buf, "0") != 0));
1661135446Strhodes} 
1662135446Strhodes],
1663135446Strhodes	[AC_MSG_RESULT(ll)
1664153816Sdougb	ISC_PLATFORM_QUADFORMAT='#define ISC_PLATFORM_QUADFORMAT "ll"'
1665153816Sdougb	LWRES_PLATFORM_QUADFORMAT='#define LWRES_PLATFORM_QUADFORMAT "ll"'],
1666135446Strhodes	[AC_MSG_RESULT(l)
1667153816Sdougb	ISC_PLATFORM_QUADFORMAT='#define ISC_PLATFORM_QUADFORMAT "l"'
1668153816Sdougb	LWRES_PLATFORM_QUADFORMAT='#define LWRES_PLATFORM_QUADFORMAT "l"'],
1669135446Strhodes	[AC_MSG_RESULT(assuming target platform uses ll)
1670153816Sdougb	ISC_PLATFORM_QUADFORMAT='#define ISC_PLATFORM_QUADFORMAT "ll"'
1671153816Sdougb	LWRES_PLATFORM_QUADFORMAT='#define LWRES_PLATFORM_QUADFORMAT "ll"'])
1672135446StrhodesAC_SUBST(ISC_PLATFORM_QUADFORMAT)
1673153816SdougbAC_SUBST(LWRES_PLATFORM_QUADFORMAT)
1674135446Strhodes
1675135446Strhodes#
1676135446Strhodes# Security Stuff
1677135446Strhodes#
1678135446StrhodesAC_CHECK_FUNC(chroot, AC_DEFINE(HAVE_CHROOT))
1679135446StrhodesAC_ARG_ENABLE(linux-caps,
1680135446Strhodes	[  --disable-linux-caps	disable linux capabilities])
1681135446Strhodescase "$enable_linux_caps" in
1682135446Strhodes	yes|'')
1683135446Strhodes		AC_CHECK_HEADERS(linux/capability.h)
1684135446Strhodes		;;
1685135446Strhodes	no)
1686135446Strhodes		;;
1687135446Strhodesesac
1688135446StrhodesAC_CHECK_HEADERS(sys/prctl.h)
1689135446Strhodes
1690170222SdougbAC_CHECK_HEADERS(sys/un.h,
1691170222SdougbISC_PLATFORM_HAVESYSUNH="#define ISC_PLATFORM_HAVESYSUNH 1"
1692170222Sdougb,
1693170222SdougbISC_PLATFORM_HAVESYSUNH="#undef ISC_PLATFORM_HAVESYSUNH"
1694170222Sdougb)
1695170222SdougbAC_SUBST(ISC_PLATFORM_HAVESYSUNH)
1696170222Sdougb
1697170222Sdougbcase "$host" in
1698170222Sdougb*-solaris*)
1699170222Sdougb	AC_DEFINE(NEED_SECURE_DIRECTORY, 1,
1700170222Sdougb		  [Define if connect does not honour the permission on the UNIX domain socket.])
1701170222Sdougb	;;
1702170222Sdougb*-sunos*)
1703170222Sdougb	AC_DEFINE(NEED_SECURE_DIRECTORY, 1,
1704170222Sdougb		  [Define if connect does not honour the permission on the UNIX domain socket.])
1705170222Sdougb	;;
1706170222Sdougbesac
1707170222Sdougb
1708135446Strhodes#
1709135446Strhodes# Time Zone Stuff
1710135446Strhodes#
1711135446StrhodesAC_CHECK_FUNC(tzset, AC_DEFINE(HAVE_TZSET))
1712135446Strhodes
1713153816SdougbAC_MSG_CHECKING(for optarg decarartion)
1714153816SdougbAC_TRY_COMPILE([
1715153816Sdougb#include <unistd.h>
1716153816Sdougb],
1717153816Sdougb[optarg = 0;],
1718153816Sdougb[AC_MSG_RESULT(yes)],
1719153816Sdougb[AC_MSG_RESULT(no)
1720165071SdougbGEN_NEED_OPTARG="-DNEED_OPTARG=1"
1721153816SdougbAC_DEFINE(NEED_OPTARG, 1, [Defined if extern char *optarg is not declared.])])
1722153816Sdougb
1723135446Strhodes#
1724135446Strhodes# BSD/OS, and perhaps some others, don't define rlim_t.
1725135446Strhodes#
1726135446StrhodesAC_MSG_CHECKING(for type rlim_t)
1727135446StrhodesAC_TRY_COMPILE([
1728135446Strhodes#include <sys/types.h>
1729135446Strhodes#include <sys/time.h>
1730135446Strhodes#include <sys/resource.h>],
1731135446Strhodes[rlim_t rl = 19671212; return (0);],
1732135446Strhodes[AC_MSG_RESULT(yes)
1733135446Strhodes ISC_PLATFORM_RLIMITTYPE="#define ISC_PLATFORM_RLIMITTYPE rlim_t"],
1734135446Strhodes[AC_MSG_RESULT(no)
1735135446Strhodes
1736135446StrhodesAC_MSG_CHECKING(type of rlim_cur)
1737135446StrhodesAC_TRY_RUN([
1738135446Strhodes#include <sys/types.h>
1739135446Strhodes#include <sys/time.h>
1740135446Strhodes#include <sys/resource.h>
1741135446Strhodesmain() { struct rlimit r; exit(!(sizeof(r.rlim_cur) == sizeof(int)));}],
1742135446Strhodes[AC_MSG_RESULT(int)
1743135446StrhodesISC_PLATFORM_RLIMITTYPE="#define ISC_PLATFORM_RLIMITTYPE int"],
1744135446Strhodes[
1745135446StrhodesAC_TRY_RUN([
1746135446Strhodes#include <sys/types.h>
1747135446Strhodes#include <sys/time.h>
1748135446Strhodes#include <sys/resource.h>
1749135446Strhodesmain() { struct rlimit r; exit(!(sizeof(r.rlim_cur) == sizeof(long int)));}],
1750135446Strhodes[AC_MSG_RESULT(long int)
1751135446StrhodesISC_PLATFORM_RLIMITTYPE="#define ISC_PLATFORM_RLIMITTYPE long int"],
1752135446Strhodes[
1753135446StrhodesAC_TRY_RUN([
1754135446Strhodes#include <sys/types.h>
1755135446Strhodes#include <sys/time.h>
1756135446Strhodes#include <sys/resource.h>
1757135446Strhodesmain() { struct rlimit r; exit((!sizeof(r.rlim_cur) == sizeof(long long int)));}],
1758135446Strhodes[AC_MSG_RESULT(long long int)
1759135446StrhodesISC_PLATFORM_RLIMITTYPE="#define ISC_PLATFORM_RLIMITTYPE long long int"],
1760135446Strhodes[AC_MSG_ERROR([unable to determine sizeof rlim_cur])
1761135446Strhodes],[AC_MSG_ERROR(this cannot happen)])
1762135446Strhodes],[AC_MSG_ERROR(this cannot happen)])
1763153816Sdougb],[
1764153816SdougbISC_PLATFORM_RLIMITTYPE="#define ISC_PLATFORM_RLIMITTYPE long long int"
1765153816SdougbAC_MSG_RESULT(cannot determine type of rlim_cur when cross compiling - assuming long long int)])
1766135446Strhodes])
1767135446StrhodesAC_SUBST(ISC_PLATFORM_RLIMITTYPE)
1768135446Strhodes
1769135446Strhodes#
1770135446Strhodes# Compaq TruCluster requires more code for handling cluster IP aliases
1771135446Strhodes#
1772135446Strhodescase "$host" in
1773135446Strhodes	*-dec-osf*)
1774135446Strhodes		AC_CHECK_LIB(clua, clua_getaliasaddress, LIBS="-lclua $LIBS")
1775135446Strhodes		AC_CHECK_FUNC(clua_getaliasaddress,
1776135446Strhodes				AC_DEFINE(HAVE_TRUCLUSTER, 1,
1777135446Strhodes					[Define if running under Compaq TruCluster]))
1778135446Strhodes		;;
1779135446Strhodes	*)
1780135446Strhodes		;;
1781135446Strhodesesac
1782135446Strhodes
1783135446Strhodes#
1784165071Sdougb# Some hosts need msg_namelen to match the size of the socket structure.
1785165071Sdougb# Some hosts don't set msg_namelen appropriately on return from recvmsg().
1786165071Sdougb#
1787165071Sdougbcase $host in
1788165071Sdougb*os2*|*hp-mpeix*)
1789165071Sdougb	AC_DEFINE(BROKEN_RECVMSG, 1,
1790165071Sdougb		  [Define if recvmsg() does not meet all of the BSD socket API specifications.])
1791165071Sdougb	;;
1792165071Sdougbesac
1793165071Sdougb
1794165071Sdougb#
1795135446Strhodes# Microsoft has their own way of handling shared libraries that requires
1796135446Strhodes# additional qualifiers on extern variables.  Unix systems don't need it.
1797135446Strhodes#
1798135446StrhodesAC_SUBST(ISC_PLATFORM_USEDECLSPEC)
1799135446StrhodesISC_PLATFORM_USEDECLSPEC="#undef ISC_PLATFORM_USEDECLSPEC"
1800135446StrhodesAC_SUBST(LWRES_PLATFORM_USEDECLSPEC)
1801135446StrhodesLWRES_PLATFORM_USEDECLSPEC="#undef LWRES_PLATFORM_USEDECLSPEC"
1802135446Strhodes
1803135446Strhodes#
1804135446Strhodes# Random remaining OS-specific issues involving compiler warnings.
1805135446Strhodes# XXXDCL print messages to indicate some compensation is being done?
1806135446Strhodes#
1807135446StrhodesAC_SUBST(ISC_PLATFORM_BRACEPTHREADONCEINIT)
1808135446StrhodesISC_PLATFORM_BRACEPTHREADONCEINIT="#undef ISC_PLATFORM_BRACEPTHREADONCEINIT"
1809135446Strhodes
1810135446Strhodescase "$host" in
1811165071Sdougb	*-aix5.[[123]].*)
1812143731Sdougb		hack_shutup_pthreadonceinit=yes
1813143731Sdougb		;;
1814135446Strhodes	*-bsdi3.1*)
1815135446Strhodes		hack_shutup_sputaux=yes
1816135446Strhodes		;;
1817135446Strhodes	*-bsdi4.0*)
1818135446Strhodes		hack_shutup_sigwait=yes
1819135446Strhodes		hack_shutup_sputaux=yes
1820135446Strhodes		;;
1821135446Strhodes	[*-bsdi4.[12]*])
1822135446Strhodes		hack_shutup_stdargcast=yes
1823135446Strhodes		;;
1824135446Strhodes	[*-solaris2.[89]])
1825135446Strhodes		hack_shutup_pthreadonceinit=yes
1826135446Strhodes		;;
1827165071Sdougb	*-solaris2.10)
1828165071Sdougb		hack_shutup_pthreadonceinit=yes
1829165071Sdougb		;;
1830135446Strhodesesac
1831135446Strhodes
1832135446Strhodescase "$hack_shutup_pthreadonceinit" in
1833135446Strhodes	yes)
1834135446Strhodes		#
1835135446Strhodes		# Shut up PTHREAD_ONCE_INIT unbraced initializer warnings.
1836135446Strhodes		#
1837135446Strhodes		ISC_PLATFORM_BRACEPTHREADONCEINIT="#define ISC_PLATFORM_BRACEPTHREADONCEINIT 1"
1838135446Strhodes		;;
1839135446Strhodesesac
1840135446Strhodes
1841135446Strhodescase "$hack_shutup_sigwait" in
1842135446Strhodes	yes)
1843135446Strhodes		#
1844135446Strhodes		# Shut up a -Wmissing-prototypes warning for sigwait().
1845135446Strhodes		#
1846135446Strhodes		AC_DEFINE(SHUTUP_SIGWAIT)
1847135446Strhodes		;;
1848135446Strhodesesac
1849135446Strhodes
1850135446Strhodescase "$hack_shutup_sputaux" in
1851135446Strhodes	yes)
1852135446Strhodes		#
1853135446Strhodes		# Shut up a -Wmissing-prototypes warning from <stdio.h>.
1854135446Strhodes		#
1855135446Strhodes		AC_DEFINE(SHUTUP_SPUTAUX)
1856135446Strhodes		;;
1857135446Strhodesesac
1858135446Strhodes
1859135446Strhodescase "$hack_shutup_stdargcast" in
1860135446Strhodes	yes)
1861135446Strhodes		#
1862135446Strhodes		# Shut up a -Wcast-qual warning from va_start().
1863135446Strhodes		#
1864135446Strhodes		AC_DEFINE(SHUTUP_STDARG_CAST)
1865135446Strhodes		;;
1866135446Strhodesesac
1867135446Strhodes
1868135446Strhodes#
1869135446Strhodes# Check for if_nametoindex() for IPv6 scoped addresses support
1870135446Strhodes#
1871135446StrhodesAC_CHECK_FUNC(if_nametoindex, ac_cv_have_if_nametoindex=yes,
1872135446Strhodes		ac_cv_have_if_nametoindex=no)
1873135446Strhodescase $ac_cv_have_if_nametoindex in
1874135446Strhodesno)
1875135446Strhodes	case "$host" in
1876135446Strhodes  	*-hp-hpux*)
1877135446Strhodes  		AC_CHECK_LIB(ipv6, if_nametoindex,
1878135446Strhodes				ac_cv_have_if_nametoindex=yes
1879135446Strhodes				LIBS="-lipv6 $LIBS",)
1880135446Strhodes  	;;
1881135446Strhodes	esac
1882135446Strhodesesac
1883135446Strhodescase $ac_cv_have_if_nametoindex in
1884135446Strhodesyes)
1885135446Strhodes	ISC_PLATFORM_HAVEIFNAMETOINDEX="#define ISC_PLATFORM_HAVEIFNAMETOINDEX 1"
1886135446Strhodes	;;
1887135446Strhodes*)
1888135446Strhodes	ISC_PLATFORM_HAVEIFNAMETOINDEX="#undef ISC_PLATFORM_HAVEIFNAMETOINDEX"
1889135446Strhodes	;;
1890135446Strhodesesac
1891135446StrhodesAC_SUBST(ISC_PLATFORM_HAVEIFNAMETOINDEX)
1892135446Strhodes
1893135446Strhodes#
1894170222Sdougb# Machine architecture dependent features
1895170222Sdougb#
1896170222SdougbAC_ARG_ENABLE(atomic,
1897170222Sdougb	[  --enable-atomic	enable machine specific atomic operations
1898170222Sdougb                        [[default=autodetect]]],
1899170222Sdougb			enable_atomic="$enableval",
1900170222Sdougb			enable_atomic="autodetect")
1901170222Sdougbcase "$enable_atomic" in
1902170222Sdougb	yes|''|autodetect)
1903170222Sdougb		use_atomic=yes
1904170222Sdougb		;;
1905170222Sdougb	no)
1906170222Sdougb		use_atomic=no
1907170222Sdougb		arch=noatomic
1908170222Sdougb		;;
1909170222Sdougbesac
1910170222Sdougb
1911170222SdougbISC_PLATFORM_USEOSFASM="#undef ISC_PLATFORM_USEOSFASM"
1912170222Sdougbif test "$use_atomic" = "yes"; then
1913170222Sdougb	AC_MSG_CHECKING([architecture type for atomic operations])
1914170222Sdougb	have_atomic=yes		# set default
1915170222Sdougb	case "$host" in
1916170222Sdougb	[i[3456]86-*])
1917170222Sdougb		# XXX: some old x86 architectures actually do not support
1918170222Sdougb		#      (some of) these operations.  Do we need stricter checks?
1919170222SdougbAC_TRY_RUN([
1920170222Sdougbmain() {
1921170222Sdougb	exit((sizeof(void *) == 8) ? 0 : 1);
1922170222Sdougb}
1923170222Sdougb],
1924170222Sdougb		[arch=x86_64],
1925170222Sdougb		[arch=x86_32],
1926170222Sdougb	        [arch=x86_32])
1927170222Sdougb	;;
1928170222Sdougb	x86_64-*)
1929170222Sdougb		arch=x86_64
1930170222Sdougb	;;
1931170222Sdougb	alpha*-*)
1932170222Sdougb		arch=alpha
1933170222Sdougb	;;
1934170222Sdougb	powerpc-*)
1935170222Sdougb		arch=powerpc
1936170222Sdougb	;;
1937170222Sdougb	mips-*|mipsel-*|mips64-*|mips64el-*)
1938170222Sdougb		arch=mips
1939170222Sdougb	;;
1940170222Sdougb	ia64-*)
1941170222Sdougb		arch=ia64
1942170222Sdougb	;;
1943170222Sdougb	*)
1944170222Sdougb		have_atomic=no
1945170222Sdougb		arch=noatomic
1946170222Sdougb	;;
1947170222Sdougb	esac
1948170222Sdougb	AC_MSG_RESULT($arch)
1949170222Sdougbfi
1950170222Sdougb
1951170222Sdougbif test "$have_atomic" = "yes"; then
1952170222Sdougb	AC_MSG_CHECKING([compiler support for inline assembly code])
1953170222Sdougb
1954170222Sdougb	compiler=generic
1955170222Sdougb	# Check whether the compiler supports the assembly syntax we provide.
1956170222Sdougb	if test "X$GCC" = "Xyes"; then
1957170222Sdougb		# GCC's ASM extension always works
1958170222Sdougb		compiler=gcc
1959170222Sdougb		if test $arch = "x86_64"; then
1960170222Sdougb			# We can share the same code for gcc with x86_32
1961170222Sdougb			arch=x86_32
1962170222Sdougb		fi
1963170222Sdougb		if test $arch = "powerpc"; then
1964170222Sdougb			#
1965170222Sdougb			# The MacOS (and maybe others) uses "r0" for register
1966170222Sdougb			# zero. Under linux/ibm it is "0" for register 0.
1967170222Sdougb			# Probe to see if we have a MacOS style assembler.
1968170222Sdougb			#
1969170222Sdougb			AC_MSG_CHECKING([Checking for MacOS style assembler syntax])
1970170222Sdougb			AC_TRY_COMPILE(, [
1971170222Sdougb			__asm__ volatile ("li r0, 0x0\n"::);
1972170222Sdougb			], [
1973170222Sdougb			AC_MSG_RESULT(yes)
1974170222Sdougb			compiler="mac"
1975170222Sdougb			ISC_PLATFORM_USEMACASM="#define ISC_PLATFORM_USEMACASM 1"
1976170222Sdougb			], [AC_MSG_RESULT(no)])
1977170222Sdougb		fi
1978170222Sdougb	else
1979170222Sdougb		case "$host" in
1980170222Sdougb		alpha*-dec-osf*)
1981170222Sdougb			# Tru64 compiler has its own syntax for inline 
1982170222Sdougb			# assembly.
1983170222Sdougb			AC_TRY_COMPILE(, [
1984170222Sdougb#ifndef __DECC
1985170222Sdougb#error "unexpected compiler"
1986170222Sdougb#endif
1987170222Sdougb				return (0);],
1988170222Sdougb				[compiler=osf],)
1989170222Sdougb		;;
1990170222Sdougb		powerpc-ibm-aix*)
1991170222Sdougb			compiler=aix
1992170222Sdougb		;;
1993170222Sdougb		esac
1994170222Sdougb	fi
1995170222Sdougb	case "$compiler" in
1996170222Sdougb	gcc)
1997170222Sdougb		ISC_PLATFORM_USEGCCASM="#define ISC_PLATFORM_USEGCCASM 1"
1998170222Sdougb		;;
1999170222Sdougb	osf)
2000170222Sdougb		ISC_PLATFORM_USEOSFASM="#define ISC_PLATFORM_USEOSFASM 1"
2001170222Sdougb		;;
2002170222Sdougb	aix)
2003170222Sdougb		;;
2004170222Sdougb	mac)
2005170222Sdougb		;;
2006170222Sdougb	*)
2007170222Sdougb		# See if the generic __asm function works.  If not,
2008170222Sdougb		# we need to disable the atomic operations.
2009170222Sdougb		AC_TRY_LINK(, [
2010170222Sdougb					__asm("nop")
2011170222Sdougb				],
2012170222Sdougb		[compiler="standard"
2013170222Sdougb		ISC_PLATFORM_USESTDASM="#define ISC_PLATFORM_USESTDASM 1"],
2014170222Sdougb		[compiler="not supported (atomic operations disabled)"
2015170222Sdougb		have_atomic=no
2016170222Sdougb		arch=noatomic ]);
2017170222Sdougb		;;
2018170222Sdougb	esac
2019170222Sdougb
2020170222Sdougb	AC_MSG_RESULT($compiler)
2021170222Sdougbfi
2022170222Sdougb
2023170222Sdougbif test "$have_atomic" = "yes"; then
2024170222Sdougb	ISC_PLATFORM_HAVEXADD="#define ISC_PLATFORM_HAVEXADD 1"
2025170222Sdougb	ISC_PLATFORM_HAVECMPXCHG="#define ISC_PLATFORM_HAVECMPXCHG 1"
2026170222Sdougb	ISC_PLATFORM_HAVEATOMICSTORE="#define ISC_PLATFORM_HAVEATOMICSTORE 1"
2027170222Sdougbelse
2028170222Sdougb	ISC_PLATFORM_HAVEXADD="#undef ISC_PLATFORM_HAVEXADD"
2029170222Sdougb	ISC_PLATFORM_HAVECMPXCHG="#undef ISC_PLATFORM_HAVECMPXCHG"
2030170222Sdougb	ISC_PLATFORM_HAVEATOMICSTORE="#undef ISC_PLATFORM_HAVEATOMICSTORE"
2031170222Sdougbfi
2032170222Sdougb
2033170222SdougbAC_SUBST(ISC_PLATFORM_HAVEXADD)
2034170222SdougbAC_SUBST(ISC_PLATFORM_HAVECMPXCHG)
2035170222SdougbAC_SUBST(ISC_PLATFORM_HAVEATOMICSTORE)
2036170222Sdougb
2037170222SdougbAC_SUBST(ISC_PLATFORM_USEGCCASM)
2038170222SdougbAC_SUBST(ISC_PLATFORM_USEOSFASM)
2039170222SdougbAC_SUBST(ISC_PLATFORM_USESTDASM)
2040170222SdougbAC_SUBST(ISC_PLATFORM_USEMACASM)
2041170222Sdougb
2042170222SdougbISC_ARCH_DIR=$arch
2043170222SdougbAC_SUBST(ISC_ARCH_DIR)
2044170222Sdougb
2045170222Sdougb#
2046153816Sdougb#  The following sets up how non-blocking i/o is established.
2047153816Sdougb#  Sunos, cygwin and solaris 2.x (x<5) require special handling.
2048153816Sdougb#
2049153816Sdougbcase "$host" in
2050153816Sdougb*-sunos*) AC_DEFINE(PORT_NONBLOCK, O_NDELAY);;
2051153816Sdougb*-cygwin*) AC_DEFINE(PORT_NONBLOCK, O_NDELAY);;
2052153816Sdougb*-solaris2.[[01234]])
2053153816Sdougb	AC_DEFINE(PORT_NONBLOCK, O_NONBLOCK)
2054153816Sdougb	AC_DEFINE(USE_FIONBIO_IOCTL, 1,
2055153816Sdougb		  [Defined if you need to use ioctl(FIONBIO) instead a fcntl call to make non-blocking.])
2056153816Sdougb	;;
2057153816Sdougb*) AC_DEFINE(PORT_NONBLOCK, O_NONBLOCK,
2058153816Sdougb	     [Sets which flag to pass to open/fcntl to make non-blocking (O_NDELAY/O_NONBLOCK).])
2059153816Sdougb	;;
2060153816Sdougbesac
2061153816Sdougb#
2062165071Sdougb# Solaris 2.5.1 and earlier cannot bind() then connect() a TCP socket.
2063165071Sdougb# This prevents the source address being set.
2064165071Sdougb#
2065165071Sdougbcase "$host" in
2066165071Sdougb*-solaris2.[[012345]]|*-solaris2.5.1)
2067165071Sdougb	AC_DEFINE(BROKEN_TCP_BIND_BEFORE_CONNECT, 1,
2068165071Sdougb		  [Define if you cannot bind() before connect() for TCP sockets.])
2069165071Sdougb	;;
2070165071Sdougbesac
2071165071Sdougb#
2072135446Strhodes# The following sections deal with tools used for formatting
2073135446Strhodes# the documentation.  They are all optional, unless you are
2074135446Strhodes# a developer editing the documentation source.
2075135446Strhodes#
2076135446Strhodes
2077153816Sdougb#
2078153816Sdougb# Look for TeX.
2079153816Sdougb#
2080135446Strhodes
2081153816SdougbAC_PATH_PROGS(LATEX, latex, latex)
2082153816SdougbAC_SUBST(LATEX)
2083153816Sdougb
2084153816SdougbAC_PATH_PROGS(PDFLATEX, pdflatex, pdflatex)
2085153816SdougbAC_SUBST(PDFLATEX)
2086153816Sdougb
2087135446Strhodes#
2088170222Sdougb# Look for w3m
2089170222Sdougb#
2090170222Sdougb
2091170222SdougbAC_PATH_PROGS(W3M, w3m, w3m)
2092170222SdougbAC_SUBST(W3M)
2093170222Sdougb
2094170222Sdougb#
2095153816Sdougb# Look for xsltproc (libxslt)
2096135446Strhodes#
2097135446Strhodes
2098153816SdougbAC_PATH_PROG(XSLTPROC, xsltproc, xsltproc)
2099153816SdougbAC_SUBST(XSLTPROC)
2100135446Strhodes
2101135446Strhodes#
2102153816Sdougb# Look for xmllint (libxml2)
2103135446Strhodes#
2104135446Strhodes
2105153816SdougbAC_PATH_PROG(XMLLINT, xmllint, xmllint)
2106153816SdougbAC_SUBST(XMLLINT)
2107135446Strhodes
2108135446Strhodes#
2109135446Strhodes# Subroutine for searching for an ordinary file (e.g., a stylesheet)
2110135446Strhodes# in a number of directories:
2111135446Strhodes#
2112135446Strhodes#   NOM_PATH_FILE(VARIABLE, FILENAME, DIRECTORIES)
2113135446Strhodes#
2114135446Strhodes# If the file FILENAME is found in one of the DIRECTORIES, the shell
2115135446Strhodes# variable VARIABLE is defined to its absolute pathname.  Otherwise, 
2116135446Strhodes# it is set to FILENAME, with no directory prefix (that's not terribly
2117135446Strhodes# useful, but looks less confusing in substitutions than leaving it
2118135446Strhodes# empty).  The variable VARIABLE will be substituted into output files.
2119135446Strhodes# 
2120135446Strhodes
2121135446StrhodesAC_DEFUN(NOM_PATH_FILE, [
2122135446Strhodes$1=""
2123135446StrhodesAC_MSG_CHECKING(for $2)
2124135446Strhodesfor d in $3
2125135446Strhodesdo
2126135446Strhodes	f=$d/$2
2127135446Strhodes	if test -f $f
2128135446Strhodes	then
2129135446Strhodes		$1=$f
2130135446Strhodes		AC_MSG_RESULT($f)
2131135446Strhodes		break
2132135446Strhodes	fi
2133135446Strhodesdone
2134135446Strhodesif test "X[$]$1" = "X"
2135135446Strhodesthen
2136135446Strhodes	AC_MSG_RESULT("not found");
2137135446Strhodes	$1=$2
2138135446Strhodesfi
2139135446StrhodesAC_SUBST($1)
2140135446Strhodes])
2141135446Strhodes
2142135446Strhodes#
2143153816Sdougb# Look for Docbook-XSL stylesheets.  Location probably varies by
2144153816Sdougb# system.  Guessing where it might be found, based on where SGML stuff
2145153816Sdougb# lives on some systems.  FreeBSD is the only one I'm sure of at the
2146153816Sdougb# moment.
2147135446Strhodes#
2148153816Sdougb
2149153816Sdougbdocbook_xsl_trees="/usr/pkg/share/xsl /usr/local/share/xsl /usr/share/xsl"
2150153816Sdougb
2151135446Strhodes#
2152153816Sdougb# Look for stylesheets we need.
2153153816Sdougb#
2154135446Strhodes
2155153816SdougbNOM_PATH_FILE(XSLT_DOCBOOK_STYLE_HTML, docbook/html/docbook.xsl, $docbook_xsl_trees)
2156153816SdougbNOM_PATH_FILE(XSLT_DOCBOOK_STYLE_XHTML, docbook/xhtml/docbook.xsl, $docbook_xsl_trees)
2157153816SdougbNOM_PATH_FILE(XSLT_DOCBOOK_STYLE_MAN, docbook/manpages/docbook.xsl, $docbook_xsl_trees)
2158153816SdougbNOM_PATH_FILE(XSLT_DOCBOOK_CHUNK_HTML, docbook/html/chunk.xsl, $docbook_xsl_trees)
2159153816SdougbNOM_PATH_FILE(XSLT_DOCBOOK_CHUNK_XHTML, docbook/xhtml/chunk.xsl, $docbook_xsl_trees)
2160170222SdougbNOM_PATH_FILE(XSLT_DOCBOOK_CHUNKTOC_HTML, docbook/html/chunktoc.xsl, $docbook_xsl_trees)
2161170222SdougbNOM_PATH_FILE(XSLT_DOCBOOK_CHUNKTOC_XHTML, docbook/xhtml/chunktoc.xsl, $docbook_xsl_trees)
2162170222SdougbNOM_PATH_FILE(XSLT_DOCBOOK_MAKETOC_HTML, docbook/html/maketoc.xsl, $docbook_xsl_trees)
2163170222SdougbNOM_PATH_FILE(XSLT_DOCBOOK_MAKETOC_XHTML, docbook/xhtml/maketoc.xsl, $docbook_xsl_trees)
2164153816Sdougb
2165135446Strhodes#
2166153816Sdougb# Same dance for db2latex
2167135446Strhodes#
2168153816Sdougb# No idea where this lives except on FreeBSD.
2169135446Strhodes#
2170135446Strhodes
2171153816Sdougbdb2latex_xsl_trees="/usr/local/share"
2172135446Strhodes
2173135446Strhodes#
2174153816Sdougb# Look for stylesheets we need.
2175135446Strhodes#
2176135446Strhodes
2177153816SdougbNOM_PATH_FILE(XSLT_DB2LATEX_STYLE, db2latex/xsl/docbook.xsl, $db2latex_xsl_trees)
2178135446Strhodes
2179135446Strhodes#
2180153816Sdougb# Look for "admonition" image directory.  Can't use NOM_PATH_FILE()
2181153816Sdougb# because it's a directory, so just do the same things, inline.
2182135446Strhodes#
2183135446Strhodes
2184153816SdougbAC_MSG_CHECKING(for db2latex/xsl/figures)
2185153816Sdougbfor d in $db2latex_xsl_trees
2186153816Sdougbdo
2187153816Sdougb	dd=$d/db2latex/xsl/figures
2188153816Sdougb	if test -d $dd
2189153816Sdougb	then
2190153816Sdougb		XSLT_DB2LATEX_ADMONITIONS=$dd
2191153816Sdougb		AC_MSG_RESULT($dd)
2192153816Sdougb		break
2193153816Sdougb	fi
2194153816Sdougbdone
2195153816Sdougbif test "X$XSLT_DB2LATEX_ADMONITIONS" = "X"
2196153816Sdougbthen
2197153816Sdougb	AC_MSG_RESULT(not found)
2198153816Sdougb	XSLT_DB2LATEX_ADMONITIONS=db2latex/xsl/figures
2199153816Sdougbfi
2200153816SdougbAC_SUBST(XSLT_DB2LATEX_ADMONITIONS)
2201135446Strhodes
2202135446Strhodes#
2203170222Sdougb# IDN support
2204170222Sdougb#
2205170222SdougbAC_ARG_WITH(idn,
2206170222Sdougb	[  --with-idn[=MPREFIX]   enable IDN support using idnkit [default PREFIX]],
2207170222Sdougb	use_idn="$withval", use_idn="no")
2208170222Sdougbcase "$use_idn" in
2209170222Sdougbyes)
2210170222Sdougb	if test X$prefix = XNONE ; then
2211170222Sdougb		idn_path=/usr/local
2212170222Sdougb	else
2213170222Sdougb		idn_path=$prefix
2214170222Sdougb	fi
2215170222Sdougb	;;
2216170222Sdougbno)
2217170222Sdougb	;;
2218170222Sdougb*)
2219170222Sdougb	idn_path="$use_idn"
2220170222Sdougb	;;
2221170222Sdougbesac
2222170222Sdougb
2223170222Sdougbiconvinc=
2224170222Sdougbiconvlib=
2225170222SdougbAC_ARG_WITH(libiconv,
2226170222Sdougb	[  --with-libiconv[=IPREFIX]   GNU libiconv are in IPREFIX [default PREFIX]],
2227170222Sdougb	use_libiconv="$withval", use_libiconv="no")
2228170222Sdougbcase "$use_libiconv" in
2229170222Sdougbyes)
2230170222Sdougb	if test X$prefix = XNONE ; then
2231170222Sdougb		iconvlib="-L/usr/local/lib -R/usr/local/lib -liconv"
2232170222Sdougb	else
2233170222Sdougb		iconvlib="-L$prefix/lib -R$prefix/lib -liconv"
2234170222Sdougb	fi
2235170222Sdougb	;;
2236170222Sdougbno)
2237170222Sdougb	iconvlib=
2238170222Sdougb	;;
2239170222Sdougb*)
2240170222Sdougb	iconvlib="-L$use_libiconv/lib -R$use_libiconv/lib -liconv"
2241170222Sdougb	;;
2242170222Sdougbesac
2243170222Sdougb
2244170222SdougbAC_ARG_WITH(iconv,
2245170222Sdougb	[  --with-iconv[=LIBSPEC]   specify iconv library [default -liconv]],
2246170222Sdougb	iconvlib="$withval")
2247170222Sdougbcase "$iconvlib" in
2248170222Sdougbno)
2249170222Sdougb	iconvlib=
2250170222Sdougb	;;
2251170222Sdougbyes)
2252170222Sdougb	iconvlib=-liconv
2253170222Sdougb	;;
2254170222Sdougbesac
2255170222Sdougb
2256170222SdougbAC_ARG_WITH(idnlib,
2257170222Sdougb	[  --with-idnlib=ARG    specify libidnkit],
2258170222Sdougb	idnlib="$withval", idnlib="no")
2259170222Sdougbif test "$idnlib" = yes; then
2260170222Sdougb	AC_MSG_ERROR([You must specify ARG for --with-idnlib.])
2261170222Sdougbfi
2262170222Sdougb
2263170222SdougbIDNLIBS=
2264170222Sdougbif test "$use_idn" != no; then
2265170222Sdougb	AC_DEFINE(WITH_IDN, 1, [define if idnkit support is to be included.])
2266170222Sdougb	STD_CINCLUDES="$STD_CINCLUDES -I$idn_path/include"
2267170222Sdougb	if test "$idnlib" != no; then
2268170222Sdougb		IDNLIBS="$idnlib $iconvlib"
2269170222Sdougb	else
2270170222Sdougb		IDNLIBS="-L$idn_path/lib -lidnkit $iconvlib"
2271170222Sdougb	fi
2272170222Sdougbfi
2273170222SdougbAC_SUBST(IDNLIBS)
2274170222Sdougb
2275170222SdougbAC_CHECK_HEADERS(locale.h)
2276170222SdougbAC_CHECK_FUNCS(setlocale)
2277170222Sdougb
2278170222Sdougb#
2279135446Strhodes# Substitutions
2280135446Strhodes#
2281135446StrhodesAC_SUBST(BIND9_TOP_BUILDDIR)
2282135446StrhodesBIND9_TOP_BUILDDIR=`pwd`
2283135446Strhodes
2284135446StrhodesAC_SUBST(BIND9_ISC_BUILDINCLUDE)
2285135446StrhodesAC_SUBST(BIND9_ISCCC_BUILDINCLUDE)
2286135446StrhodesAC_SUBST(BIND9_ISCCFG_BUILDINCLUDE)
2287135446StrhodesAC_SUBST(BIND9_DNS_BUILDINCLUDE)
2288135446StrhodesAC_SUBST(BIND9_LWRES_BUILDINCLUDE)
2289135446StrhodesAC_SUBST(BIND9_BIND9_BUILDINCLUDE)
2290135446Strhodesif test "X$srcdir" != "X"; then
2291135446Strhodes	BIND9_ISC_BUILDINCLUDE="-I${BIND9_TOP_BUILDDIR}/lib/isc/include"
2292135446Strhodes	BIND9_ISCCC_BUILDINCLUDE="-I${BIND9_TOP_BUILDDIR}/lib/isccc/include"
2293135446Strhodes	BIND9_ISCCFG_BUILDINCLUDE="-I${BIND9_TOP_BUILDDIR}/lib/isccfg/include"
2294135446Strhodes	BIND9_DNS_BUILDINCLUDE="-I${BIND9_TOP_BUILDDIR}/lib/dns/include"
2295135446Strhodes	BIND9_LWRES_BUILDINCLUDE="-I${BIND9_TOP_BUILDDIR}/lib/lwres/include"
2296135446Strhodes	BIND9_BIND9_BUILDINCLUDE="-I${BIND9_TOP_BUILDDIR}/lib/bind9/include"
2297135446Strhodeselse
2298135446Strhodes	BIND9_ISC_BUILDINCLUDE=""
2299135446Strhodes	BIND9_ISCCC_BUILDINCLUDE=""
2300135446Strhodes	BIND9_ISCCFG_BUILDINCLUDE=""
2301135446Strhodes	BIND9_DNS_BUILDINCLUDE=""
2302135446Strhodes	BIND9_LWRES_BUILDINCLUDE=""
2303135446Strhodes	BIND9_BIND9_BUILDINCLUDE=""
2304135446Strhodesfi
2305135446Strhodes
2306135446StrhodesAC_SUBST_FILE(BIND9_MAKE_INCLUDES)
2307135446StrhodesBIND9_MAKE_INCLUDES=$BIND9_TOP_BUILDDIR/make/includes
2308135446Strhodes
2309135446StrhodesAC_SUBST_FILE(BIND9_MAKE_RULES)
2310135446StrhodesBIND9_MAKE_RULES=$BIND9_TOP_BUILDDIR/make/rules
2311135446Strhodes
2312135446Strhodes. $srcdir/version
2313135446StrhodesBIND9_VERSION="VERSION=${MAJORVER}.${MINORVER}.${PATCHVER}${RELEASETYPE}${RELEASEVER}"
2314135446StrhodesAC_SUBST(BIND9_VERSION)
2315135446Strhodes
2316135446StrhodesAC_SUBST_FILE(LIBISC_API)
2317135446StrhodesLIBISC_API=$srcdir/lib/isc/api
2318135446Strhodes
2319135446StrhodesAC_SUBST_FILE(LIBISCCC_API)
2320135446StrhodesLIBISCCC_API=$srcdir/lib/isccc/api
2321135446Strhodes
2322135446StrhodesAC_SUBST_FILE(LIBISCCFG_API)
2323135446StrhodesLIBISCCFG_API=$srcdir/lib/isccfg/api
2324135446Strhodes
2325135446StrhodesAC_SUBST_FILE(LIBDNS_API)
2326135446StrhodesLIBDNS_API=$srcdir/lib/dns/api
2327135446Strhodes
2328135446StrhodesAC_SUBST_FILE(LIBBIND9_API)
2329135446StrhodesLIBBIND9_API=$srcdir/lib/bind9/api
2330135446Strhodes
2331135446StrhodesAC_SUBST_FILE(LIBLWRES_API)
2332135446StrhodesLIBLWRES_API=$srcdir/lib/lwres/api
2333135446Strhodes
2334170222Sdougb#
2335170222Sdougb# Configure any DLZ drivers.
2336170222Sdougb#
2337170222Sdougb# If config.dlz.in selects one or more DLZ drivers, it will set
2338170222Sdougb# USE_DLZ to a non-empty value, which will be our clue to
2339170222Sdougb# enable the DLZ core functions.
2340170222Sdougb#
2341170222Sdougb# This section has to come after the libtool stuff because it needs to
2342170222Sdougb# know how to name the driver object files.
2343170222Sdougb#
2344170222Sdougb
2345170222SdougbUSE_DLZ=""
2346170222SdougbDLZ_DRIVER_INCLUDES=""
2347170222SdougbDLZ_DRIVER_LIBS=""
2348170222SdougbDLZ_DRIVER_SRCS=""
2349170222SdougbDLZ_DRIVER_OBJS=""
2350170222Sdougb
2351170222Sdougbsinclude(contrib/dlz/config.dlz.in)
2352170222Sdougb
2353170222SdougbAC_MSG_CHECKING(for DLZ)
2354170222Sdougb
2355170222Sdougbif test -n "$USE_DLZ"
2356170222Sdougbthen
2357170222Sdougb	AC_MSG_RESULT(yes)
2358170222Sdougb	USE_DLZ="-DDLZ $USE_DLZ"
2359170222Sdougb	DLZ_DRIVER_RULES=contrib/dlz/drivers/rules
2360170222Sdougb	AC_CONFIG_FILES([$DLZ_DRIVER_RULES])
2361170222Sdougbelse
2362170222Sdougb	AC_MSG_RESULT(no)
2363170222Sdougb	DLZ_DRIVER_RULES=/dev/null
2364170222Sdougbfi
2365170222Sdougb
2366170222SdougbAC_SUBST(USE_DLZ)
2367170222SdougbAC_SUBST(DLZ_DRIVER_INCLUDES)
2368170222SdougbAC_SUBST(DLZ_DRIVER_LIBS)
2369170222SdougbAC_SUBST(DLZ_DRIVER_SRCS)
2370170222SdougbAC_SUBST(DLZ_DRIVER_OBJS)
2371170222SdougbAC_SUBST_FILE(DLZ_DRIVER_RULES)
2372170222Sdougb
2373165071Sdougbif test "$cross_compiling" = "yes"; then
2374165071Sdougb	if test -z "$BUILD_CC"; then
2375165071Sdougb		AC_ERROR([BUILD_CC not set])
2376165071Sdougb	fi
2377165071Sdougb	BUILD_CFLAGS="$BUILD_CFLAGS"
2378165071Sdougb	BUILD_CPPFLAGS="$BUILD_CPPFLAGS"
2379165071Sdougb	BUILD_LDFLAGS="$BUILD_LDFLAGS"
2380165071Sdougb	BUILD_LIBS="$BUILD_LIBS"
2381165071Sdougbelse
2382165071Sdougb	BUILD_CC="$CC" 
2383165071Sdougb	BUILD_CFLAGS="$CFLAGS" 
2384165071Sdougb	BUILD_CPPFLAGS="$CPPFLAGS $GEN_NEED_OPTARG"
2385165071Sdougb	BUILD_LDFLAGS="$LDFLAGS"
2386165071Sdougb	BUILD_LIBS="$LIBS"
2387165071Sdougbfi
2388165071Sdougb
2389165071SdougbAC_SUBST(BUILD_CC)
2390165071SdougbAC_SUBST(BUILD_CFLAGS)
2391165071SdougbAC_SUBST(BUILD_CPPFLAGS)
2392165071SdougbAC_SUBST(BUILD_LDFLAGS)
2393165071SdougbAC_SUBST(BUILD_LIBS)
2394165071Sdougb
2395170222Sdougb#
2396170222Sdougb# Commands to run at the end of config.status.
2397170222Sdougb# Don't just put these into configure, it won't work right if somebody
2398170222Sdougb# runs config.status directly (which autoconf allows).
2399170222Sdougb#
2400170222Sdougb
2401170222SdougbAC_CONFIG_COMMANDS(
2402170222Sdougb	[chmod],
2403170222Sdougb	[chmod a+x isc-config.sh])
2404170222Sdougb
2405170222Sdougb#
2406170222Sdougb# Files to configure.  These are listed here because we used to
2407170222Sdougb# specify them as arguments to AC_OUTPUT.  It's (now) ok to move these
2408170222Sdougb# elsewhere if there's a good reason for doing so.
2409170222Sdougb#
2410170222Sdougb
2411170222SdougbAC_CONFIG_FILES([
2412135446Strhodes	Makefile
2413135446Strhodes	make/Makefile
2414135446Strhodes	make/mkdep
2415135446Strhodes	lib/Makefile
2416135446Strhodes	lib/isc/Makefile
2417135446Strhodes	lib/isc/include/Makefile
2418135446Strhodes	lib/isc/include/isc/Makefile
2419135446Strhodes	lib/isc/include/isc/platform.h
2420135446Strhodes	lib/isc/unix/Makefile
2421135446Strhodes	lib/isc/unix/include/Makefile
2422135446Strhodes	lib/isc/unix/include/isc/Makefile
2423135446Strhodes	lib/isc/nls/Makefile
2424135446Strhodes	lib/isc/$thread_dir/Makefile
2425135446Strhodes	lib/isc/$thread_dir/include/Makefile
2426135446Strhodes	lib/isc/$thread_dir/include/isc/Makefile
2427135446Strhodes	lib/isccc/Makefile
2428135446Strhodes	lib/isccc/include/Makefile
2429135446Strhodes	lib/isccc/include/isccc/Makefile
2430135446Strhodes	lib/isccfg/Makefile
2431135446Strhodes	lib/isccfg/include/Makefile
2432135446Strhodes	lib/isccfg/include/isccfg/Makefile
2433135446Strhodes	lib/dns/Makefile
2434135446Strhodes	lib/dns/include/Makefile
2435135446Strhodes	lib/dns/include/dns/Makefile
2436143731Sdougb	lib/dns/include/dst/Makefile
2437135446Strhodes	lib/bind9/Makefile
2438135446Strhodes	lib/bind9/include/Makefile
2439135446Strhodes	lib/bind9/include/bind9/Makefile
2440135446Strhodes	lib/lwres/Makefile
2441135446Strhodes	lib/lwres/include/Makefile
2442135446Strhodes	lib/lwres/include/lwres/Makefile
2443135446Strhodes	lib/lwres/include/lwres/netdb.h
2444135446Strhodes	lib/lwres/include/lwres/platform.h
2445135446Strhodes	lib/lwres/man/Makefile
2446135446Strhodes	lib/lwres/unix/Makefile
2447135446Strhodes	lib/lwres/unix/include/Makefile
2448135446Strhodes	lib/lwres/unix/include/lwres/Makefile
2449135446Strhodes	lib/tests/Makefile
2450135446Strhodes	lib/tests/include/Makefile
2451135446Strhodes	lib/tests/include/tests/Makefile
2452135446Strhodes	bin/Makefile
2453135446Strhodes	bin/check/Makefile
2454135446Strhodes	bin/named/Makefile
2455135446Strhodes	bin/named/unix/Makefile
2456135446Strhodes	bin/rndc/Makefile
2457135446Strhodes	bin/rndc/unix/Makefile
2458135446Strhodes	bin/dig/Makefile
2459135446Strhodes	bin/nsupdate/Makefile
2460135446Strhodes	bin/tests/Makefile
2461135446Strhodes	bin/tests/names/Makefile
2462135446Strhodes	bin/tests/master/Makefile
2463135446Strhodes	bin/tests/rbt/Makefile
2464135446Strhodes	bin/tests/db/Makefile
2465135446Strhodes	bin/tests/tasks/Makefile
2466135446Strhodes	bin/tests/timers/Makefile
2467135446Strhodes	bin/tests/dst/Makefile
2468135446Strhodes	bin/tests/mem/Makefile
2469135446Strhodes	bin/tests/net/Makefile
2470135446Strhodes	bin/tests/sockaddr/Makefile
2471135446Strhodes	bin/tests/system/Makefile
2472135446Strhodes	bin/tests/system/conf.sh
2473135446Strhodes	bin/tests/system/lwresd/Makefile
2474135446Strhodes	bin/tests/system/tkey/Makefile
2475135446Strhodes	bin/tests/headerdep_test.sh
2476135446Strhodes	bin/dnssec/Makefile
2477135446Strhodes	doc/Makefile
2478135446Strhodes	doc/arm/Makefile
2479135446Strhodes	doc/misc/Makefile
2480170222Sdougb	isc-config.sh
2481153816Sdougb	doc/xsl/Makefile
2482153816Sdougb	doc/xsl/isc-docbook-chunk.xsl
2483153816Sdougb	doc/xsl/isc-docbook-html.xsl
2484153816Sdougb	doc/xsl/isc-docbook-latex.xsl
2485153816Sdougb	doc/xsl/isc-manpage.xsl
2486170222Sdougb])
2487135446Strhodes
2488170222Sdougb#
2489170222Sdougb# Do it
2490170222Sdougb#
2491170222Sdougb
2492170222SdougbAC_OUTPUT
2493170222Sdougb
2494163976Sdougbif test "X$OPENSSL_WARNING" != "X"; then
2495163976Sdougbcat << \EOF
2496163976SdougbWARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
2497163976SdougbWARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
2498163976SdougbWARNING                                                                 WARNING
2499163976SdougbWARNING         Your OpenSSL crypto library may be vulnerable to        WARNING
2500163976SdougbWARNING         one or more of the the following known security         WARNING
2501163976SdougbWARNING         flaws:                                                  WARNING
2502163976SdougbWARNING                                                                 WARNING
2503163976SdougbWARNING         CAN-2002-0659, CAN-2006-4339, CVE-2006-2937 and         WARNING
2504163976SdougbWARNING         CVE-2006-2940.                                          WARNING
2505163976SdougbWARNING                                                                 WARNING
2506163976SdougbWARNING         It is recommended that you upgrade to OpenSSL           WARNING
2507163976SdougbWARNING         version 0.9.8d/0.9.7l (or greater).                     WARNING
2508163976SdougbWARNING                                                                 WARNING
2509163976SdougbWARNING         You can disable this warning by specifying:             WARNING
2510163976SdougbWARNING                                                                 WARNING
2511163976SdougbWARNING               --disable-openssl-version-check          	        WARNING
2512163976SdougbWARNING                                                                 WARNING
2513163976SdougbWARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
2514163976SdougbWARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
2515163976SdougbEOF
2516163976Sdougbfi
2517163976Sdougb
2518135446Strhodes# Tell Emacs to edit this file in shell mode.
2519135446Strhodes# Local Variables:
2520135446Strhodes# mode: sh
2521135446Strhodes# End:
2522