MDN patch for bind-9.1.3
========================

This is a patch file for ISC BIND 9.1.3 to make it work with
internationalized/multilingual domain names.  With this patch you'll
get MDN-aware dig/host/nslookup.

To apply this patch, you should go to the top directory of the BIND
distribution (where you see `README' file), then invoke `patch'
command like this:

	% patch -p0 < this-file

Then follow the instructions described in `README.mdnkit' to compile
and install.


Index: README.mdnkit
diff -c /dev/null mdn/othersrc/bind9/README.mdnkit:1.9
*** README.mdnkit	Mon Aug 27 19:18:29 2001
--- README.mdnkit	Wed Aug 22 15:19:31 2001
***************
*** 0 ****
--- 1,124 ----
+ 
+ 			BIND-9 MDN patch
+ 
+ 	       Japan Network Information Center (JPNIC)
+ 
+ 
+ * What is this patch for?
+ 
+ This patch adds multilingual domain name (MDN) support to BIND-9.
+ You'll get multilingualized version of dig/host/nslookup commands.
+ 
+     + mulltilingualized dig/host/nslookup
+ 	dig/host/nslookup accepts non-ASCII domain names in the local
+ 	codeset (such as Shift JIS, Big5 or ISO8859-1) determined by
+ 	the locale information.  The domain names are normalized and
+ 	converted to the encoding on the DNS protocol, and sent to DNS
+ 	servers.  The replies are converted back to the local codeset
+ 	and displayed.
+ 
+ 
+ * Compilation & installation
+ 
+ 0. Prerequisite
+ 
+ You have to build and install mDNkit before building this patched version
+ of bind-9.
+ 
+ 1. Running configure script
+ 
+ Run `configure' in the top directory.  See `README' for the
+ configuration options.
+ 
+ This patch adds the following 4 options to `configure'.  You should
+ at least specify `--with-mdn' option to enable MDN support.
+ 
+     --with-mdn[=MDN_PREFIX]
+ 	To enable MDN support, you have to specify `--with-mdn' option.
+ 	The argument MDN_PREFIX is the install prefix of mDNkit.  If
+ 	MDN_PREFIX is omitted, PREFIX (derived from `--prefix=PREFIX')
+ 	is assumed.
+ 
+     --with-libiconv[=LIBICONV_PREFIX]
+ 	Specify this option if mDNkit you have installed links GNU
+ 	libiconv.  The argument LIBICONV_PREFIX is install prefix of
+ 	GNU libiconv.  If the argument is omitted, PREFIX (derived
+ 	from `--prefix=PREFIX') is assumed.
+ 
+ 	`--with-libiconv' is shorthand option for GNU libiconv.
+ 
+ 	    --with-libiconv=/usr/local
+ 
+ 	This is equivalent to:
+ 
+ 	    --with-iconv='-L/usr/local/lib -R/usr/local/lib -liconv'
+ 
+ 	`--with-libiconv' assumes that your C compiler has `-R'
+ 	option, and that the option adds the specified run-time path
+ 	to an exacutable binary.  If `-R' option of your compiler has
+ 	different meaning, or your compiler lacks the option, you
+ 	should use `--with-iconv' option instead.  Binary command
+ 	without run-time path information might be unexecutable.
+ 	In that case, you would see an error message like:
+ 
+ 	    error in loading shared libraries: libiconv.so.2: cannot
+ 	    open shared object file
+ 
+ 	If both `--with-libiconv' and `--with-iconv' options are
+ 	specified, `--with-iconv' is prior to `--with-libiconv'.
+ 
+     --with-iconv=ICONV_LIBSPEC
+ 	If your libc doens't provide iconv(), you need to specify the
+ 	library containing iconv() with this option.  `ICONV_LIBSPEC'
+ 	is the argument(s) to `cc' or `ld' to link the library, for
+ 	example, `--with-iconv="-L/usr/local/lib -liconv"'.
+ 	You don't need to specify the header file directory for "iconv.h"
+ 	to the compiler, as it isn't included directly by bind-9 with
+ 	this patch.
+ 
+     --with-mdnlib=MDN_LIBSPEC
+ 	With this option, you can explicitly specify the argument(s)
+ 	to `cc' or `ld' to link the mDNkit's library, `libmdn'.  If
+ 	this option is not specified, `-L${PREFIX}/lib -lmdn' is
+ 	assumed, where ${PREFIX} is the installation prefix specified
+ 	with `--with-mdn' option above.  You may need to use this
+ 	option to specify extra argments, for example,
+ 	`--with-mdnlib="-L/usr/local/lib -R/usr/local/lib -lmdn"'.
+ 
+ Please consult `README' for other configuration options.
+ 
+ Note that if you want to specify some extra header file directories,
+ you should use the environment variable STD_CINCLUDES instead of
+ CFLAGS, as described in README.
+ 
+ 2. Compilation and installation
+ 
+ After running "configure", just do
+ 
+ 	make
+ 	make install
+ 
+ for compiling and installing.
+ 
+ 3. Resolver configuration
+ 
+ To handle multilingual domain names, you have to specify the
+ properties like:
+ 	+ name encoding used in DNS protocol data
+ 	+ normalization (NAMEPREP) schemes
+ These properties are specified by the mDNkit's configuration file,
+ "mdn.conf".  You have to create and set up the file properly.  The
+ pathname of the file and contents are described in the manual
+ "mdn.conf".
+ 
+ 
+ * Contact information
+ 
+ Please see http//www.nic.ad.jp/jp/research/idn/ for the latest news
+ about mDNkit and this patch.
+ 
+ Bug reports and comments on this kit should be sent to
+ mdnkit-bugs@nic.ad.jp and idn-cmt@nic.ad.jp, respectively.
+ 
+ 
+ ; $Id: bind-9.1.3-patch,v 1.1 2002/01/02 02:46:59 marka Exp $
Index: config.h.in
diff -c mdn/othersrc/bind9/config.h.in:1.1.1.5 mdn/othersrc/bind9/config.h.in:1.9
*** config.h.in	Tue Apr 17 14:17:01 2001
--- config.h.in	Thu Jul 26 16:44:20 2001
***************
*** 16,22 ****
   * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
   */
  
! /* $Id: bind-9.1.3-patch,v 1.1 2002/01/02 02:46:59 marka Exp $ */
  
  /***
   *** This file is not to be included by any public header files, because
--- 16,22 ----
   * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
   */
  
! /* $Id: bind-9.1.3-patch,v 1.1 2002/01/02 02:46:59 marka Exp $ */
  
  /***
   *** This file is not to be included by any public header files, because
***************
*** 132,137 ****
--- 132,140 ----
  /* define if pthread_attr_getstacksize() is available */
  #undef HAVE_PTHREAD_ATTR_GETSTACKSIZE
  
+ /* Define if you have the setlocale function.  */
+ #undef HAVE_SETLOCALE
+ 
  /* Define if you have the <fcntl.h> header file.  */
  #undef HAVE_FCNTL_H
  
***************
*** 141,146 ****
--- 144,155 ----
  /* Define if you have the <linux/prctl.h> header file.  */
  #undef HAVE_LINUX_PRCTL_H
  
+ /* Define if you have the <locale.h> header file.  */
+ #undef HAVE_LOCALE_H
+ 
+ /* Define if you have the <sys/select.h> header file.  */
+ #undef HAVE_SYS_SELECT_H
+ 
  /* Define if you have the <sys/sockio.h> header file.  */
  #undef HAVE_SYS_SOCKIO_H
  
***************
*** 158,160 ****
--- 167,173 ----
  
  /* Define if you have the socket library (-lsocket).  */
  #undef HAVE_LIBSOCKET
+ 
+ /* define if mDNkit support is to be included. */
+ #undef WITH_MDN
+ 
Index: configure
diff -c mdn/othersrc/bind9/configure:1.1.1.7 mdn/othersrc/bind9/configure:1.10
*** configure	Thu Jul 26 15:43:19 2001
--- configure	Thu Jul 26 16:44:20 2001
***************
*** 15,21 ****
  # NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
  # WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  
! # From configure.in Revision: 1.205.2.8 
  
  ## libtool.m4 - Configure libtool for the target system. -*-Shell-script-*-
  ## Copyright (C) 1996-1999, 2000 Free Software Foundation, Inc.
--- 15,21 ----
  # NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
  # WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  
! # From configure.in Revision: 1.205.2.9 
  
  ## libtool.m4 - Configure libtool for the target system. -*-Shell-script-*-
  ## Copyright (C) 1996-1999, 2000 Free Software Foundation, Inc.
***************
*** 153,158 ****
--- 153,166 ----
    --enable-ipv6		use IPv6 [default=autodetect]"
  ac_help="$ac_help
    --with-kame[=PATH]	use Kame IPv6 [default path /usr/local/v6]"
+ ac_help="$ac_help
+   --with-mdn[=MPREFIX]   enable MDN support using mDNkit [default PREFIX]"
+ ac_help="$ac_help
+   --with-libiconv[=IPREFIX]   GNU libiconv are in IPREFIX [default PREFIX]"
+ ac_help="$ac_help
+   --with-iconv[=LIBSPEC]   specify iconv library [default -liconv]"
+ ac_help="$ac_help
+   --with-mdnlib=ARG    specify libmdn"
  
  # Initialize some variables set by options.
  # The variables have the same names as the options, with
***************
*** 693,699 ****
  fi
  
  echo $ac_n "checking host system type""... $ac_c" 1>&6
! echo "configure:697: checking host system type" >&5
  
  host_alias=$host
  case "$host_alias" in
--- 701,707 ----
  fi
  
  echo $ac_n "checking host system type""... $ac_c" 1>&6
! echo "configure:705: checking host system type" >&5
  
  host_alias=$host
  case "$host_alias" in
***************
*** 715,721 ****
  
  
  echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
! echo "configure:719: checking whether ${MAKE-make} sets \${MAKE}" >&5
  set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
  if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
--- 723,729 ----
  
  
  echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
! echo "configure:727: checking whether ${MAKE-make} sets \${MAKE}" >&5
  set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
  if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
***************
*** 744,750 ****
  # Extract the first word of "ranlib", so it can be a program name with args.
  set dummy ranlib; ac_word=$2
  echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
! echo "configure:748: checking for $ac_word" >&5
  if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
  else
--- 752,758 ----
  # Extract the first word of "ranlib", so it can be a program name with args.
  set dummy ranlib; ac_word=$2
  echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
! echo "configure:756: checking for $ac_word" >&5
  if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
  else
***************
*** 783,789 ****
  # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
  # ./install, which can be erroneously created by make from ./install.sh.
  echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
! echo "configure:787: checking for a BSD compatible install" >&5
  if test -z "$INSTALL"; then
  if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
--- 791,797 ----
  # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
  # ./install, which can be erroneously created by make from ./install.sh.
  echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
! echo "configure:795: checking for a BSD compatible install" >&5
  if test -z "$INSTALL"; then
  if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
***************
*** 844,850 ****
  # Extract the first word of "ar", so it can be a program name with args.
  set dummy ar; ac_word=$2
  echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
! echo "configure:848: checking for $ac_word" >&5
  if eval "test \"`echo '$''{'ac_cv_path_AR'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
  else
--- 852,858 ----
  # Extract the first word of "ar", so it can be a program name with args.
  set dummy ar; ac_word=$2
  echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
! echo "configure:856: checking for $ac_word" >&5
  if eval "test \"`echo '$''{'ac_cv_path_AR'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
  else
***************
*** 900,906 ****
  # Extract the first word of "$ac_prog", so it can be a program name with args.
  set dummy $ac_prog; ac_word=$2
  echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
! echo "configure:904: checking for $ac_word" >&5
  if eval "test \"`echo '$''{'ac_cv_path_ETAGS'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
  else
--- 908,914 ----
  # Extract the first word of "$ac_prog", so it can be a program name with args.
  set dummy $ac_prog; ac_word=$2
  echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
! echo "configure:912: checking for $ac_word" >&5
  if eval "test \"`echo '$''{'ac_cv_path_ETAGS'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
  else
***************
*** 945,951 ****
  # Extract the first word of "$ac_prog", so it can be a program name with args.
  set dummy $ac_prog; ac_word=$2
  echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
! echo "configure:949: checking for $ac_word" >&5
  if eval "test \"`echo '$''{'ac_cv_path_PERL'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
  else
--- 953,959 ----
  # Extract the first word of "$ac_prog", so it can be a program name with args.
  set dummy $ac_prog; ac_word=$2
  echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
! echo "configure:957: checking for $ac_word" >&5
  if eval "test \"`echo '$''{'ac_cv_path_PERL'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
  else
***************
*** 1093,1099 ****
  # was --with-openssl specified?
  #
  echo $ac_n "checking for compatible OpenSSL library""... $ac_c" 1>&6
! echo "configure:1097: checking for compatible OpenSSL library" >&5
  # Check whether --with-openssl or --without-openssl was given.
  if test "${with_openssl+set}" = set; then
    withval="$with_openssl"
--- 1101,1107 ----
  # was --with-openssl specified?
  #
  echo $ac_n "checking for compatible OpenSSL library""... $ac_c" 1>&6
! echo "configure:1105: checking for compatible OpenSSL library" >&5
  # Check whether --with-openssl or --without-openssl was given.
  if test "${with_openssl+set}" = set; then
    withval="$with_openssl"
***************
*** 1184,1190 ****
  # was --with-randomdev specified?
  #
  echo $ac_n "checking for random device""... $ac_c" 1>&6
! echo "configure:1188: checking for random device" >&5
  # Check whether --with-randomdev or --without-randomdev was given.
  if test "${with_randomdev+set}" = set; then
    withval="$with_randomdev"
--- 1192,1198 ----
  # was --with-randomdev specified?
  #
  echo $ac_n "checking for random device""... $ac_c" 1>&6
! echo "configure:1196: checking for random device" >&5
  # Check whether --with-randomdev or --without-randomdev was given.
  if test "${with_randomdev+set}" = set; then
    withval="$with_randomdev"
***************
*** 1231,1237 ****
  # Extract the first word of "gcc", so it can be a program name with args.
  set dummy gcc; ac_word=$2
  echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
! echo "configure:1235: checking for $ac_word" >&5
  if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
  else
--- 1239,1245 ----
  # Extract the first word of "gcc", so it can be a program name with args.
  set dummy gcc; ac_word=$2
  echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
! echo "configure:1243: checking for $ac_word" >&5
  if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
  else
***************
*** 1261,1267 ****
    # Extract the first word of "cc", so it can be a program name with args.
  set dummy cc; ac_word=$2
  echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
! echo "configure:1265: checking for $ac_word" >&5
  if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
  else
--- 1269,1275 ----
    # Extract the first word of "cc", so it can be a program name with args.
  set dummy cc; ac_word=$2
  echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
! echo "configure:1273: checking for $ac_word" >&5
  if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
  else
***************
*** 1312,1318 ****
        # Extract the first word of "cl", so it can be a program name with args.
  set dummy cl; ac_word=$2
  echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
! echo "configure:1316: checking for $ac_word" >&5
  if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
  else
--- 1320,1326 ----
        # Extract the first word of "cl", so it can be a program name with args.
  set dummy cl; ac_word=$2
  echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
! echo "configure:1324: checking for $ac_word" >&5
  if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
  else
***************
*** 1344,1350 ****
  fi
  
  echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
! echo "configure:1348: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
  
  ac_ext=c
  # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
--- 1352,1358 ----
  fi
  
  echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
! echo "configure:1356: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
  
  ac_ext=c
  # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
***************
*** 1355,1366 ****
  
  cat > conftest.$ac_ext << EOF
  
! #line 1359 "configure"
  #include "confdefs.h"
  
  main(){return(0);}
  EOF
! if { (eval echo configure:1364: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
    ac_cv_prog_cc_works=yes
    # If we can't run a trivial program, we are probably using a cross compiler.
    if (./conftest; exit) 2>/dev/null; then
--- 1363,1374 ----
  
  cat > conftest.$ac_ext << EOF
  
! #line 1367 "configure"
  #include "confdefs.h"
  
  main(){return(0);}
  EOF
! if { (eval echo configure:1372: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
    ac_cv_prog_cc_works=yes
    # If we can't run a trivial program, we are probably using a cross compiler.
    if (./conftest; exit) 2>/dev/null; then
***************
*** 1386,1397 ****
    { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
  fi
  echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
! echo "configure:1390: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
  echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
  cross_compiling=$ac_cv_prog_cc_cross
  
  echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
! echo "configure:1395: checking whether we are using GNU C" >&5
  if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
  else
--- 1394,1405 ----
    { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
  fi
  echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
! echo "configure:1398: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
  echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
  cross_compiling=$ac_cv_prog_cc_cross
  
  echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
! echo "configure:1403: checking whether we are using GNU C" >&5
  if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
  else
***************
*** 1400,1406 ****
    yes;
  #endif
  EOF
! if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1404: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
    ac_cv_prog_gcc=yes
  else
    ac_cv_prog_gcc=no
--- 1408,1414 ----
    yes;
  #endif
  EOF
! if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1412: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
    ac_cv_prog_gcc=yes
  else
    ac_cv_prog_gcc=no
***************
*** 1419,1425 ****
  ac_save_CFLAGS="$CFLAGS"
  CFLAGS=
  echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
! echo "configure:1423: checking whether ${CC-cc} accepts -g" >&5
  if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
  else
--- 1427,1433 ----
  ac_save_CFLAGS="$CFLAGS"
  CFLAGS=
  echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
! echo "configure:1431: checking whether ${CC-cc} accepts -g" >&5
  if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
  else
***************
*** 1455,1461 ****
  # Extract the first word of "$ac_prog", so it can be a program name with args.
  set dummy $ac_prog; ac_word=$2
  echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
! echo "configure:1459: checking for $ac_word" >&5
  if eval "test \"`echo '$''{'ac_cv_prog_YACC'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
  else
--- 1463,1469 ----
  # Extract the first word of "$ac_prog", so it can be a program name with args.
  set dummy $ac_prog; ac_word=$2
  echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
! echo "configure:1467: checking for $ac_word" >&5
  if eval "test \"`echo '$''{'ac_cv_prog_YACC'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
  else
***************
*** 1490,1503 ****
  # Find the machine's endian flavor.
  #
  echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6
! echo "configure:1494: checking whether byte ordering is bigendian" >&5
  if eval "test \"`echo '$''{'ac_cv_c_bigendian'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
  else
    ac_cv_c_bigendian=unknown
  # See if sys/param.h defines the BYTE_ORDER macro.
  cat > conftest.$ac_ext <<EOF
! #line 1501 "configure"
  #include "confdefs.h"
  #include <sys/types.h>
  #include <sys/param.h>
--- 1498,1511 ----
  # Find the machine's endian flavor.
  #
  echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6
! echo "configure:1502: checking whether byte ordering is bigendian" >&5
  if eval "test \"`echo '$''{'ac_cv_c_bigendian'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
  else
    ac_cv_c_bigendian=unknown
  # See if sys/param.h defines the BYTE_ORDER macro.
  cat > conftest.$ac_ext <<EOF
! #line 1509 "configure"
  #include "confdefs.h"
  #include <sys/types.h>
  #include <sys/param.h>
***************
*** 1508,1518 ****
  #endif
  ; return 0; }
  EOF
! if { (eval echo configure:1512: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
    rm -rf conftest*
    # It does; now see whether it defined to BIG_ENDIAN or not.
  cat > conftest.$ac_ext <<EOF
! #line 1516 "configure"
  #include "confdefs.h"
  #include <sys/types.h>
  #include <sys/param.h>
--- 1516,1526 ----
  #endif
  ; return 0; }
  EOF
! if { (eval echo configure:1520: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
    rm -rf conftest*
    # It does; now see whether it defined to BIG_ENDIAN or not.
  cat > conftest.$ac_ext <<EOF
! #line 1524 "configure"
  #include "confdefs.h"
  #include <sys/types.h>
  #include <sys/param.h>
***************
*** 1523,1529 ****
  #endif
  ; return 0; }
  EOF
! if { (eval echo configure:1527: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
    rm -rf conftest*
    ac_cv_c_bigendian=yes
  else
--- 1531,1537 ----
  #endif
  ; return 0; }
  EOF
! if { (eval echo configure:1535: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
    rm -rf conftest*
    ac_cv_c_bigendian=yes
  else
***************
*** 1543,1549 ****
      { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
  else
    cat > conftest.$ac_ext <<EOF
! #line 1547 "configure"
  #include "confdefs.h"
  main () {
    /* Are we little or big endian?  From Harbison&Steele.  */
--- 1551,1557 ----
      { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
  else
    cat > conftest.$ac_ext <<EOF
! #line 1555 "configure"
  #include "confdefs.h"
  main () {
    /* Are we little or big endian?  From Harbison&Steele.  */
***************
*** 1556,1562 ****
    exit (u.c[sizeof (long) - 1] == 1);
  }
  EOF
! if { (eval echo configure:1560: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
  then
    ac_cv_c_bigendian=no
  else
--- 1564,1570 ----
    exit (u.c[sizeof (long) - 1] == 1);
  }
  EOF
! if { (eval echo configure:1568: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
  then
    ac_cv_c_bigendian=no
  else
***************
*** 1581,1587 ****
  
  
  echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
! echo "configure:1585: checking how to run the C preprocessor" >&5
  # On Suns, sometimes $CPP names a directory.
  if test -n "$CPP" && test -d "$CPP"; then
    CPP=
--- 1589,1595 ----
  
  
  echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
! echo "configure:1593: checking how to run the C preprocessor" >&5
  # On Suns, sometimes $CPP names a directory.
  if test -n "$CPP" && test -d "$CPP"; then
    CPP=
***************
*** 1596,1608 ****
    # On the NeXT, cc -E runs the code through the compiler's parser,
    # not just through cpp.
    cat > conftest.$ac_ext <<EOF
! #line 1600 "configure"
  #include "confdefs.h"
  #include <assert.h>
  Syntax Error
  EOF
  ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
! { (eval echo configure:1606: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
  ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
  if test -z "$ac_err"; then
    :
--- 1604,1616 ----
    # On the NeXT, cc -E runs the code through the compiler's parser,
    # not just through cpp.
    cat > conftest.$ac_ext <<EOF
! #line 1608 "configure"
  #include "confdefs.h"
  #include <assert.h>
  Syntax Error
  EOF
  ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
! { (eval echo configure:1614: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
  ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
  if test -z "$ac_err"; then
    :
***************
*** 1613,1625 ****
    rm -rf conftest*
    CPP="${CC-cc} -E -traditional-cpp"
    cat > conftest.$ac_ext <<EOF
! #line 1617 "configure"
  #include "confdefs.h"
  #include <assert.h>
  Syntax Error
  EOF
  ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
! { (eval echo configure:1623: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
  ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
  if test -z "$ac_err"; then
    :
--- 1621,1633 ----
    rm -rf conftest*
    CPP="${CC-cc} -E -traditional-cpp"
    cat > conftest.$ac_ext <<EOF
! #line 1625 "configure"
  #include "confdefs.h"
  #include <assert.h>
  Syntax Error
  EOF
  ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
! { (eval echo configure:1631: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
  ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
  if test -z "$ac_err"; then
    :
***************
*** 1630,1642 ****
    rm -rf conftest*
    CPP="${CC-cc} -nologo -E"
    cat > conftest.$ac_ext <<EOF
! #line 1634 "configure"
  #include "confdefs.h"
  #include <assert.h>
  Syntax Error
  EOF
  ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
! { (eval echo configure:1640: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
  ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
  if test -z "$ac_err"; then
    :
--- 1638,1650 ----
    rm -rf conftest*
    CPP="${CC-cc} -nologo -E"
    cat > conftest.$ac_ext <<EOF
! #line 1642 "configure"
  #include "confdefs.h"
  #include <assert.h>
  Syntax Error
  EOF
  ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
! { (eval echo configure:1648: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
  ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
  if test -z "$ac_err"; then
    :
***************
*** 1661,1672 ****
  echo "$ac_t""$CPP" 1>&6
  
  echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
! echo "configure:1665: checking for ANSI C header files" >&5
  if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
  else
    cat > conftest.$ac_ext <<EOF
! #line 1670 "configure"
  #include "confdefs.h"
  #include <stdlib.h>
  #include <stdarg.h>
--- 1669,1680 ----
  echo "$ac_t""$CPP" 1>&6
  
  echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
! echo "configure:1673: checking for ANSI C header files" >&5
  if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
  else
    cat > conftest.$ac_ext <<EOF
! #line 1678 "configure"
  #include "confdefs.h"
  #include <stdlib.h>
  #include <stdarg.h>
***************
*** 1674,1680 ****
  #include <float.h>
  EOF
  ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
! { (eval echo configure:1678: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
  ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
  if test -z "$ac_err"; then
    rm -rf conftest*
--- 1682,1688 ----
  #include <float.h>
  EOF
  ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
! { (eval echo configure:1686: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
  ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
  if test -z "$ac_err"; then
    rm -rf conftest*
***************
*** 1691,1697 ****
  if test $ac_cv_header_stdc = yes; then
    # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
  cat > conftest.$ac_ext <<EOF
! #line 1695 "configure"
  #include "confdefs.h"
  #include <string.h>
  EOF
--- 1699,1705 ----
  if test $ac_cv_header_stdc = yes; then
    # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
  cat > conftest.$ac_ext <<EOF
! #line 1703 "configure"
  #include "confdefs.h"
  #include <string.h>
  EOF
***************
*** 1709,1715 ****
  if test $ac_cv_header_stdc = yes; then
    # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
  cat > conftest.$ac_ext <<EOF
! #line 1713 "configure"
  #include "confdefs.h"
  #include <stdlib.h>
  EOF
--- 1717,1723 ----
  if test $ac_cv_header_stdc = yes; then
    # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
  cat > conftest.$ac_ext <<EOF
! #line 1721 "configure"
  #include "confdefs.h"
  #include <stdlib.h>
  EOF
***************
*** 1730,1736 ****
    :
  else
    cat > conftest.$ac_ext <<EOF
! #line 1734 "configure"
  #include "confdefs.h"
  #include <ctype.h>
  #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
--- 1738,1744 ----
    :
  else
    cat > conftest.$ac_ext <<EOF
! #line 1742 "configure"
  #include "confdefs.h"
  #include <ctype.h>
  #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
***************
*** 1741,1747 ****
  exit (0); }
  
  EOF
! if { (eval echo configure:1745: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
  then
    :
  else
--- 1749,1755 ----
  exit (0); }
  
  EOF
! if { (eval echo configure:1753: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
  then
    :
  else
***************
*** 1769,1785 ****
  do
  ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
  echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
! echo "configure:1773: checking for $ac_hdr" >&5
  if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
  else
    cat > conftest.$ac_ext <<EOF
! #line 1778 "configure"
  #include "confdefs.h"
  #include <$ac_hdr>
  EOF
  ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
! { (eval echo configure:1783: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
  ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
  if test -z "$ac_err"; then
    rm -rf conftest*
--- 1777,1793 ----
  do
  ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
  echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
! echo "configure:1781: checking for $ac_hdr" >&5
  if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
  else
    cat > conftest.$ac_ext <<EOF
! #line 1786 "configure"
  #include "confdefs.h"
  #include <$ac_hdr>
  EOF
  ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
! { (eval echo configure:1791: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
  ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
  if test -z "$ac_err"; then
    rm -rf conftest*
***************
*** 1807,1818 ****
  
  
  echo $ac_n "checking for working const""... $ac_c" 1>&6
! echo "configure:1811: checking for working const" >&5
  if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
  else
    cat > conftest.$ac_ext <<EOF
! #line 1816 "configure"
  #include "confdefs.h"
  
  int main() {
--- 1815,1826 ----
  
  
  echo $ac_n "checking for working const""... $ac_c" 1>&6
! echo "configure:1819: checking for working const" >&5
  if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
  else
    cat > conftest.$ac_ext <<EOF
! #line 1824 "configure"
  #include "confdefs.h"
  
  int main() {
***************
*** 1861,1867 ****
  
  ; return 0; }
  EOF
! if { (eval echo configure:1865: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
    rm -rf conftest*
    ac_cv_c_const=yes
  else
--- 1869,1875 ----
  
  ; return 0; }
  EOF
! if { (eval echo configure:1873: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
    rm -rf conftest*
    ac_cv_c_const=yes
  else
***************
*** 1882,1902 ****
  fi
  
  echo $ac_n "checking for inline""... $ac_c" 1>&6
! echo "configure:1886: checking for inline" >&5
  if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
  else
    ac_cv_c_inline=no
  for ac_kw in inline __inline__ __inline; do
    cat > conftest.$ac_ext <<EOF
! #line 1893 "configure"
  #include "confdefs.h"
  
  int main() {
  } $ac_kw foo() {
  ; return 0; }
  EOF
! if { (eval echo configure:1900: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
    rm -rf conftest*
    ac_cv_c_inline=$ac_kw; break
  else
--- 1890,1910 ----
  fi
  
  echo $ac_n "checking for inline""... $ac_c" 1>&6
! echo "configure:1894: checking for inline" >&5
  if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
  else
    ac_cv_c_inline=no
  for ac_kw in inline __inline__ __inline; do
    cat > conftest.$ac_ext <<EOF
! #line 1901 "configure"
  #include "confdefs.h"
  
  int main() {
  } $ac_kw foo() {
  ; return 0; }
  EOF
! if { (eval echo configure:1908: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
    rm -rf conftest*
    ac_cv_c_inline=$ac_kw; break
  else
***************
*** 1922,1933 ****
  esac
  
  echo $ac_n "checking for size_t""... $ac_c" 1>&6
! echo "configure:1926: checking for size_t" >&5
  if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
  else
    cat > conftest.$ac_ext <<EOF
! #line 1931 "configure"
  #include "confdefs.h"
  #include <sys/types.h>
  #if STDC_HEADERS
--- 1930,1941 ----
  esac
  
  echo $ac_n "checking for size_t""... $ac_c" 1>&6
! echo "configure:1934: checking for size_t" >&5
  if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
  else
    cat > conftest.$ac_ext <<EOF
! #line 1939 "configure"
  #include "confdefs.h"
  #include <sys/types.h>
  #if STDC_HEADERS
***************
*** 1955,1966 ****
  fi
  
  echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
! echo "configure:1959: checking whether time.h and sys/time.h may both be included" >&5
  if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
  else
    cat > conftest.$ac_ext <<EOF
! #line 1964 "configure"
  #include "confdefs.h"
  #include <sys/types.h>
  #include <sys/time.h>
--- 1963,1974 ----
  fi
  
  echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
! echo "configure:1967: checking whether time.h and sys/time.h may both be included" >&5
  if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
  else
    cat > conftest.$ac_ext <<EOF
! #line 1972 "configure"
  #include "confdefs.h"
  #include <sys/types.h>
  #include <sys/time.h>
***************
*** 1969,1975 ****
  struct tm *tp;
  ; return 0; }
  EOF
! if { (eval echo configure:1973: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
    rm -rf conftest*
    ac_cv_header_time=yes
  else
--- 1977,1983 ----
  struct tm *tp;
  ; return 0; }
  EOF
! if { (eval echo configure:1981: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
    rm -rf conftest*
    ac_cv_header_time=yes
  else
***************
*** 1996,2004 ****
  case $ac_cv_header_unistd_h in
  yes)
  echo $ac_n "checking if unistd.h defines fd_set""... $ac_c" 1>&6
! echo "configure:2000: checking if unistd.h defines fd_set" >&5
  cat > conftest.$ac_ext <<EOF
! #line 2002 "configure"
  #include "confdefs.h"
  
  #include <unistd.h>
--- 2004,2012 ----
  case $ac_cv_header_unistd_h in
  yes)
  echo $ac_n "checking if unistd.h defines fd_set""... $ac_c" 1>&6
! echo "configure:2008: checking if unistd.h defines fd_set" >&5
  cat > conftest.$ac_ext <<EOF
! #line 2010 "configure"
  #include "confdefs.h"
  
  #include <unistd.h>
***************
*** 2006,2012 ****
  fd_set read_set; return (0);
  ; return 0; }
  EOF
! if { (eval echo configure:2010: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
    rm -rf conftest*
    echo "$ac_t""yes" 1>&6
  	 ISC_PLATFORM_NEEDSYSSELECTH="#undef ISC_PLATFORM_NEEDSYSSELECTH"
--- 2014,2020 ----
  fd_set read_set; return (0);
  ; return 0; }
  EOF
! if { (eval echo configure:2018: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
    rm -rf conftest*
    echo "$ac_t""yes" 1>&6
  	 ISC_PLATFORM_NEEDSYSSELECTH="#undef ISC_PLATFORM_NEEDSYSSELECTH"
***************
*** 2049,2055 ****
  # First, decide whether to use multithreading or not.
  #
  echo $ac_n "checking whether to look for thread support""... $ac_c" 1>&6
! echo "configure:2053: checking whether to look for thread support" >&5
  # Check whether --enable-threads or --disable-threads was given.
  if test "${enable_threads+set}" = set; then
    enableval="$enable_threads"
--- 2057,2063 ----
  # First, decide whether to use multithreading or not.
  #
  echo $ac_n "checking whether to look for thread support""... $ac_c" 1>&6
! echo "configure:2061: checking whether to look for thread support" >&5
  # Check whether --enable-threads or --disable-threads was given.
  if test "${enable_threads+set}" = set; then
    enableval="$enable_threads"
***************
*** 2086,2092 ****
  		# experiment with it.
  		CC="gcc"
  		echo $ac_n "checking which NetBSD thread library to use""... $ac_c" 1>&6
! echo "configure:2090: checking which NetBSD thread library to use" >&5
  
  		# Check whether --with-ptl2 or --without-ptl2 was given.
  if test "${with_ptl2+set}" = set; then
--- 2094,2100 ----
  		# experiment with it.
  		CC="gcc"
  		echo $ac_n "checking which NetBSD thread library to use""... $ac_c" 1>&6
! echo "configure:2098: checking which NetBSD thread library to use" >&5
  
  		# Check whether --with-ptl2 or --without-ptl2 was given.
  if test "${with_ptl2+set}" = set; then
***************
*** 2125,2131 ****
  		;;
  		*)
  			echo $ac_n "checking for pthread_create in -lpthread""... $ac_c" 1>&6
! echo "configure:2129: checking for pthread_create in -lpthread" >&5
  ac_lib_var=`echo pthread'_'pthread_create | sed 'y%./+-%__p_%'`
  if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
--- 2133,2139 ----
  		;;
  		*)
  			echo $ac_n "checking for pthread_create in -lpthread""... $ac_c" 1>&6
! echo "configure:2137: checking for pthread_create in -lpthread" >&5
  ac_lib_var=`echo pthread'_'pthread_create | sed 'y%./+-%__p_%'`
  if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
***************
*** 2133,2139 ****
    ac_save_LIBS="$LIBS"
  LIBS="-lpthread  $LIBS"
  cat > conftest.$ac_ext <<EOF
! #line 2137 "configure"
  #include "confdefs.h"
  /* Override any gcc2 internal prototype to avoid an error.  */
  /* We use char because int might match the return type of a gcc2
--- 2141,2147 ----
    ac_save_LIBS="$LIBS"
  LIBS="-lpthread  $LIBS"
  cat > conftest.$ac_ext <<EOF
! #line 2145 "configure"
  #include "confdefs.h"
  /* Override any gcc2 internal prototype to avoid an error.  */
  /* We use char because int might match the return type of a gcc2
***************
*** 2144,2150 ****
  pthread_create()
  ; return 0; }
  EOF
! if { (eval echo configure:2148: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
    rm -rf conftest*
    eval "ac_cv_lib_$ac_lib_var=yes"
  else
--- 2152,2158 ----
  pthread_create()
  ; return 0; }
  EOF
! if { (eval echo configure:2156: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
    rm -rf conftest*
    eval "ac_cv_lib_$ac_lib_var=yes"
  else
***************
*** 2170,2176 ****
  else
    echo "$ac_t""no" 1>&6
  echo $ac_n "checking for __pthread_create in -lpthread""... $ac_c" 1>&6
! echo "configure:2174: checking for __pthread_create in -lpthread" >&5
  ac_lib_var=`echo pthread'_'__pthread_create | sed 'y%./+-%__p_%'`
  if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
--- 2178,2184 ----
  else
    echo "$ac_t""no" 1>&6
  echo $ac_n "checking for __pthread_create in -lpthread""... $ac_c" 1>&6
! echo "configure:2182: checking for __pthread_create in -lpthread" >&5
  ac_lib_var=`echo pthread'_'__pthread_create | sed 'y%./+-%__p_%'`
  if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
***************
*** 2178,2184 ****
    ac_save_LIBS="$LIBS"
  LIBS="-lpthread  $LIBS"
  cat > conftest.$ac_ext <<EOF
! #line 2182 "configure"
  #include "confdefs.h"
  /* Override any gcc2 internal prototype to avoid an error.  */
  /* We use char because int might match the return type of a gcc2
--- 2186,2192 ----
    ac_save_LIBS="$LIBS"
  LIBS="-lpthread  $LIBS"
  cat > conftest.$ac_ext <<EOF
! #line 2190 "configure"
  #include "confdefs.h"
  /* Override any gcc2 internal prototype to avoid an error.  */
  /* We use char because int might match the return type of a gcc2
***************
*** 2189,2195 ****
  __pthread_create()
  ; return 0; }
  EOF
! if { (eval echo configure:2193: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
    rm -rf conftest*
    eval "ac_cv_lib_$ac_lib_var=yes"
  else
--- 2197,2203 ----
  __pthread_create()
  ; return 0; }
  EOF
! if { (eval echo configure:2201: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
    rm -rf conftest*
    eval "ac_cv_lib_$ac_lib_var=yes"
  else
***************
*** 2215,2221 ****
  else
    echo "$ac_t""no" 1>&6
  echo $ac_n "checking for __pthread_create_system in -lpthread""... $ac_c" 1>&6
! echo "configure:2219: checking for __pthread_create_system in -lpthread" >&5
  ac_lib_var=`echo pthread'_'__pthread_create_system | sed 'y%./+-%__p_%'`
  if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
--- 2223,2229 ----
  else
    echo "$ac_t""no" 1>&6
  echo $ac_n "checking for __pthread_create_system in -lpthread""... $ac_c" 1>&6
! echo "configure:2227: checking for __pthread_create_system in -lpthread" >&5
  ac_lib_var=`echo pthread'_'__pthread_create_system | sed 'y%./+-%__p_%'`
  if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
***************
*** 2223,2229 ****
    ac_save_LIBS="$LIBS"
  LIBS="-lpthread  $LIBS"
  cat > conftest.$ac_ext <<EOF
! #line 2227 "configure"
  #include "confdefs.h"
  /* Override any gcc2 internal prototype to avoid an error.  */
  /* We use char because int might match the return type of a gcc2
--- 2231,2237 ----
    ac_save_LIBS="$LIBS"
  LIBS="-lpthread  $LIBS"
  cat > conftest.$ac_ext <<EOF
! #line 2235 "configure"
  #include "confdefs.h"
  /* Override any gcc2 internal prototype to avoid an error.  */
  /* We use char because int might match the return type of a gcc2
***************
*** 2234,2240 ****
  __pthread_create_system()
  ; return 0; }
  EOF
! if { (eval echo configure:2238: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
    rm -rf conftest*
    eval "ac_cv_lib_$ac_lib_var=yes"
  else
--- 2242,2248 ----
  __pthread_create_system()
  ; return 0; }
  EOF
! if { (eval echo configure:2246: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
    rm -rf conftest*
    eval "ac_cv_lib_$ac_lib_var=yes"
  else
***************
*** 2260,2266 ****
  else
    echo "$ac_t""no" 1>&6
  echo $ac_n "checking for pthread_create in -lc_r""... $ac_c" 1>&6
! echo "configure:2264: checking for pthread_create in -lc_r" >&5
  ac_lib_var=`echo c_r'_'pthread_create | sed 'y%./+-%__p_%'`
  if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
--- 2268,2274 ----
  else
    echo "$ac_t""no" 1>&6
  echo $ac_n "checking for pthread_create in -lc_r""... $ac_c" 1>&6
! echo "configure:2272: checking for pthread_create in -lc_r" >&5
  ac_lib_var=`echo c_r'_'pthread_create | sed 'y%./+-%__p_%'`
  if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
***************
*** 2268,2274 ****
    ac_save_LIBS="$LIBS"
  LIBS="-lc_r  $LIBS"
  cat > conftest.$ac_ext <<EOF
! #line 2272 "configure"
  #include "confdefs.h"
  /* Override any gcc2 internal prototype to avoid an error.  */
  /* We use char because int might match the return type of a gcc2
--- 2276,2282 ----
    ac_save_LIBS="$LIBS"
  LIBS="-lc_r  $LIBS"
  cat > conftest.$ac_ext <<EOF
! #line 2280 "configure"
  #include "confdefs.h"
  /* Override any gcc2 internal prototype to avoid an error.  */
  /* We use char because int might match the return type of a gcc2
***************
*** 2279,2285 ****
  pthread_create()
  ; return 0; }
  EOF
! if { (eval echo configure:2283: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
    rm -rf conftest*
    eval "ac_cv_lib_$ac_lib_var=yes"
  else
--- 2287,2293 ----
  pthread_create()
  ; return 0; }
  EOF
! if { (eval echo configure:2291: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
    rm -rf conftest*
    eval "ac_cv_lib_$ac_lib_var=yes"
  else
***************
*** 2305,2311 ****
  else
    echo "$ac_t""no" 1>&6
  echo $ac_n "checking for pthread_create in -lc""... $ac_c" 1>&6
! echo "configure:2309: checking for pthread_create in -lc" >&5
  ac_lib_var=`echo c'_'pthread_create | sed 'y%./+-%__p_%'`
  if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
--- 2313,2319 ----
  else
    echo "$ac_t""no" 1>&6
  echo $ac_n "checking for pthread_create in -lc""... $ac_c" 1>&6
! echo "configure:2317: checking for pthread_create in -lc" >&5
  ac_lib_var=`echo c'_'pthread_create | sed 'y%./+-%__p_%'`
  if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
***************
*** 2313,2319 ****
    ac_save_LIBS="$LIBS"
  LIBS="-lc  $LIBS"
  cat > conftest.$ac_ext <<EOF
! #line 2317 "configure"
  #include "confdefs.h"
  /* Override any gcc2 internal prototype to avoid an error.  */
  /* We use char because int might match the return type of a gcc2
--- 2321,2327 ----
    ac_save_LIBS="$LIBS"
  LIBS="-lc  $LIBS"
  cat > conftest.$ac_ext <<EOF
! #line 2325 "configure"
  #include "confdefs.h"
  /* Override any gcc2 internal prototype to avoid an error.  */
  /* We use char because int might match the return type of a gcc2
***************
*** 2324,2330 ****
  pthread_create()
  ; return 0; }
  EOF
! if { (eval echo configure:2328: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
    rm -rf conftest*
    eval "ac_cv_lib_$ac_lib_var=yes"
  else
--- 2332,2338 ----
  pthread_create()
  ; return 0; }
  EOF
! if { (eval echo configure:2336: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
    rm -rf conftest*
    eval "ac_cv_lib_$ac_lib_var=yes"
  else
***************
*** 2370,2376 ****
  	# We'd like to use sigwait() too
  	#
  	echo $ac_n "checking for sigwait in -lc""... $ac_c" 1>&6
! echo "configure:2374: checking for sigwait in -lc" >&5
  ac_lib_var=`echo c'_'sigwait | sed 'y%./+-%__p_%'`
  if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
--- 2378,2384 ----
  	# We'd like to use sigwait() too
  	#
  	echo $ac_n "checking for sigwait in -lc""... $ac_c" 1>&6
! echo "configure:2382: checking for sigwait in -lc" >&5
  ac_lib_var=`echo c'_'sigwait | sed 'y%./+-%__p_%'`
  if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
***************
*** 2378,2384 ****
    ac_save_LIBS="$LIBS"
  LIBS="-lc  $LIBS"
  cat > conftest.$ac_ext <<EOF
! #line 2382 "configure"
  #include "confdefs.h"
  /* Override any gcc2 internal prototype to avoid an error.  */
  /* We use char because int might match the return type of a gcc2
--- 2386,2392 ----
    ac_save_LIBS="$LIBS"
  LIBS="-lc  $LIBS"
  cat > conftest.$ac_ext <<EOF
! #line 2390 "configure"
  #include "confdefs.h"
  /* Override any gcc2 internal prototype to avoid an error.  */
  /* We use char because int might match the return type of a gcc2
***************
*** 2389,2395 ****
  sigwait()
  ; return 0; }
  EOF
! if { (eval echo configure:2393: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
    rm -rf conftest*
    eval "ac_cv_lib_$ac_lib_var=yes"
  else
--- 2397,2403 ----
  sigwait()
  ; return 0; }
  EOF
! if { (eval echo configure:2401: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
    rm -rf conftest*
    eval "ac_cv_lib_$ac_lib_var=yes"
  else
***************
*** 2411,2417 ****
  else
    echo "$ac_t""no" 1>&6
  echo $ac_n "checking for sigwait in -lpthread""... $ac_c" 1>&6
! echo "configure:2415: checking for sigwait in -lpthread" >&5
  ac_lib_var=`echo pthread'_'sigwait | sed 'y%./+-%__p_%'`
  if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
--- 2419,2425 ----
  else
    echo "$ac_t""no" 1>&6
  echo $ac_n "checking for sigwait in -lpthread""... $ac_c" 1>&6
! echo "configure:2423: checking for sigwait in -lpthread" >&5
  ac_lib_var=`echo pthread'_'sigwait | sed 'y%./+-%__p_%'`
  if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
***************
*** 2419,2425 ****
    ac_save_LIBS="$LIBS"
  LIBS="-lpthread  $LIBS"
  cat > conftest.$ac_ext <<EOF
! #line 2423 "configure"
  #include "confdefs.h"
  /* Override any gcc2 internal prototype to avoid an error.  */
  /* We use char because int might match the return type of a gcc2
--- 2427,2433 ----
    ac_save_LIBS="$LIBS"
  LIBS="-lpthread  $LIBS"
  cat > conftest.$ac_ext <<EOF
! #line 2431 "configure"
  #include "confdefs.h"
  /* Override any gcc2 internal prototype to avoid an error.  */
  /* We use char because int might match the return type of a gcc2
***************
*** 2430,2436 ****
  sigwait()
  ; return 0; }
  EOF
! if { (eval echo configure:2434: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
    rm -rf conftest*
    eval "ac_cv_lib_$ac_lib_var=yes"
  else
--- 2438,2444 ----
  sigwait()
  ; return 0; }
  EOF
! if { (eval echo configure:2442: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
    rm -rf conftest*
    eval "ac_cv_lib_$ac_lib_var=yes"
  else
***************
*** 2452,2458 ****
  else
    echo "$ac_t""no" 1>&6
  echo $ac_n "checking for _Psigwait in -lpthread""... $ac_c" 1>&6
! echo "configure:2456: checking for _Psigwait in -lpthread" >&5
  ac_lib_var=`echo pthread'_'_Psigwait | sed 'y%./+-%__p_%'`
  if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
--- 2460,2466 ----
  else
    echo "$ac_t""no" 1>&6
  echo $ac_n "checking for _Psigwait in -lpthread""... $ac_c" 1>&6
! echo "configure:2464: checking for _Psigwait in -lpthread" >&5
  ac_lib_var=`echo pthread'_'_Psigwait | sed 'y%./+-%__p_%'`
  if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
***************
*** 2460,2466 ****
    ac_save_LIBS="$LIBS"
  LIBS="-lpthread  $LIBS"
  cat > conftest.$ac_ext <<EOF
! #line 2464 "configure"
  #include "confdefs.h"
  /* Override any gcc2 internal prototype to avoid an error.  */
  /* We use char because int might match the return type of a gcc2
--- 2468,2474 ----
    ac_save_LIBS="$LIBS"
  LIBS="-lpthread  $LIBS"
  cat > conftest.$ac_ext <<EOF
! #line 2472 "configure"
  #include "confdefs.h"
  /* Override any gcc2 internal prototype to avoid an error.  */
  /* We use char because int might match the return type of a gcc2
***************
*** 2471,2477 ****
  _Psigwait()
  ; return 0; }
  EOF
! if { (eval echo configure:2475: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
    rm -rf conftest*
    eval "ac_cv_lib_$ac_lib_var=yes"
  else
--- 2479,2485 ----
  _Psigwait()
  ; return 0; }
  EOF
! if { (eval echo configure:2483: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
    rm -rf conftest*
    eval "ac_cv_lib_$ac_lib_var=yes"
  else
***************
*** 2501,2512 ****
  
  
  	echo $ac_n "checking for pthread_attr_getstacksize""... $ac_c" 1>&6
! echo "configure:2505: checking for pthread_attr_getstacksize" >&5
  if eval "test \"`echo '$''{'ac_cv_func_pthread_attr_getstacksize'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
  else
    cat > conftest.$ac_ext <<EOF
! #line 2510 "configure"
  #include "confdefs.h"
  /* System header to define __stub macros and hopefully few prototypes,
      which can conflict with char pthread_attr_getstacksize(); below.  */
--- 2509,2520 ----
  
  
  	echo $ac_n "checking for pthread_attr_getstacksize""... $ac_c" 1>&6
! echo "configure:2513: checking for pthread_attr_getstacksize" >&5
  if eval "test \"`echo '$''{'ac_cv_func_pthread_attr_getstacksize'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
  else
    cat > conftest.$ac_ext <<EOF
! #line 2518 "configure"
  #include "confdefs.h"
  /* System header to define __stub macros and hopefully few prototypes,
      which can conflict with char pthread_attr_getstacksize(); below.  */
***************
*** 2529,2535 ****
  
  ; return 0; }
  EOF
! if { (eval echo configure:2533: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
    rm -rf conftest*
    eval "ac_cv_func_pthread_attr_getstacksize=yes"
  else
--- 2537,2543 ----
  
  ; return 0; }
  EOF
! if { (eval echo configure:2541: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
    rm -rf conftest*
    eval "ac_cv_func_pthread_attr_getstacksize=yes"
  else
***************
*** 2561,2567 ****
  		#
  		*-freebsd*)
  			echo $ac_n "checking for sigwait in -lc_r""... $ac_c" 1>&6
! echo "configure:2565: checking for sigwait in -lc_r" >&5
  ac_lib_var=`echo c_r'_'sigwait | sed 'y%./+-%__p_%'`
  if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
--- 2569,2575 ----
  		#
  		*-freebsd*)
  			echo $ac_n "checking for sigwait in -lc_r""... $ac_c" 1>&6
! echo "configure:2573: checking for sigwait in -lc_r" >&5
  ac_lib_var=`echo c_r'_'sigwait | sed 'y%./+-%__p_%'`
  if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
***************
*** 2569,2575 ****
    ac_save_LIBS="$LIBS"
  LIBS="-lc_r  $LIBS"
  cat > conftest.$ac_ext <<EOF
! #line 2573 "configure"
  #include "confdefs.h"
  /* Override any gcc2 internal prototype to avoid an error.  */
  /* We use char because int might match the return type of a gcc2
--- 2577,2583 ----
    ac_save_LIBS="$LIBS"
  LIBS="-lc_r  $LIBS"
  cat > conftest.$ac_ext <<EOF
! #line 2581 "configure"
  #include "confdefs.h"
  /* Override any gcc2 internal prototype to avoid an error.  */
  /* We use char because int might match the return type of a gcc2
***************
*** 2580,2586 ****
  sigwait()
  ; return 0; }
  EOF
! if { (eval echo configure:2584: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
    rm -rf conftest*
    eval "ac_cv_lib_$ac_lib_var=yes"
  else
--- 2588,2594 ----
  sigwait()
  ; return 0; }
  EOF
! if { (eval echo configure:2592: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
    rm -rf conftest*
    eval "ac_cv_lib_$ac_lib_var=yes"
  else
***************
*** 2635,2646 ****
  EOF
  
  			echo $ac_n "checking for pthread_setconcurrency""... $ac_c" 1>&6
! echo "configure:2639: checking for pthread_setconcurrency" >&5
  if eval "test \"`echo '$''{'ac_cv_func_pthread_setconcurrency'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
  else
    cat > conftest.$ac_ext <<EOF
! #line 2644 "configure"
  #include "confdefs.h"
  /* System header to define __stub macros and hopefully few prototypes,
      which can conflict with char pthread_setconcurrency(); below.  */
--- 2643,2654 ----
  EOF
  
  			echo $ac_n "checking for pthread_setconcurrency""... $ac_c" 1>&6
! echo "configure:2647: checking for pthread_setconcurrency" >&5
  if eval "test \"`echo '$''{'ac_cv_func_pthread_setconcurrency'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
  else
    cat > conftest.$ac_ext <<EOF
! #line 2652 "configure"
  #include "confdefs.h"
  /* System header to define __stub macros and hopefully few prototypes,
      which can conflict with char pthread_setconcurrency(); below.  */
***************
*** 2663,2669 ****
  
  ; return 0; }
  EOF
! if { (eval echo configure:2667: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
    rm -rf conftest*
    eval "ac_cv_func_pthread_setconcurrency=yes"
  else
--- 2671,2677 ----
  
  ; return 0; }
  EOF
! if { (eval echo configure:2675: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
    rm -rf conftest*
    eval "ac_cv_func_pthread_setconcurrency=yes"
  else
***************
*** 2701,2712 ****
  	# Look for sysconf to allow detection of the number of processors.
  	#
  	echo $ac_n "checking for sysconf""... $ac_c" 1>&6
! echo "configure:2705: checking for sysconf" >&5
  if eval "test \"`echo '$''{'ac_cv_func_sysconf'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
  else
    cat > conftest.$ac_ext <<EOF
! #line 2710 "configure"
  #include "confdefs.h"
  /* System header to define __stub macros and hopefully few prototypes,
      which can conflict with char sysconf(); below.  */
--- 2709,2720 ----
  	# Look for sysconf to allow detection of the number of processors.
  	#
  	echo $ac_n "checking for sysconf""... $ac_c" 1>&6
! echo "configure:2713: checking for sysconf" >&5
  if eval "test \"`echo '$''{'ac_cv_func_sysconf'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
  else
    cat > conftest.$ac_ext <<EOF
! #line 2718 "configure"
  #include "confdefs.h"
  /* System header to define __stub macros and hopefully few prototypes,
      which can conflict with char sysconf(); below.  */
***************
*** 2729,2735 ****
  
  ; return 0; }
  EOF
! if { (eval echo configure:2733: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
    rm -rf conftest*
    eval "ac_cv_func_sysconf=yes"
  else
--- 2737,2743 ----
  
  ; return 0; }
  EOF
! if { (eval echo configure:2741: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
    rm -rf conftest*
    eval "ac_cv_func_sysconf=yes"
  else
***************
*** 2806,2817 ****
  # even if compiled with --disable-threads.
  #
  echo $ac_n "checking for flockfile""... $ac_c" 1>&6
! echo "configure:2810: checking for flockfile" >&5
  if eval "test \"`echo '$''{'ac_cv_func_flockfile'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
  else
    cat > conftest.$ac_ext <<EOF
! #line 2815 "configure"
  #include "confdefs.h"
  /* System header to define __stub macros and hopefully few prototypes,
      which can conflict with char flockfile(); below.  */
--- 2814,2825 ----
  # even if compiled with --disable-threads.
  #
  echo $ac_n "checking for flockfile""... $ac_c" 1>&6
! echo "configure:2818: checking for flockfile" >&5
  if eval "test \"`echo '$''{'ac_cv_func_flockfile'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
  else
    cat > conftest.$ac_ext <<EOF
! #line 2823 "configure"
  #include "confdefs.h"
  /* System header to define __stub macros and hopefully few prototypes,
      which can conflict with char flockfile(); below.  */
***************
*** 2834,2840 ****
  
  ; return 0; }
  EOF
! if { (eval echo configure:2838: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
    rm -rf conftest*
    eval "ac_cv_func_flockfile=yes"
  else
--- 2842,2848 ----
  
  ; return 0; }
  EOF
! if { (eval echo configure:2846: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
    rm -rf conftest*
    eval "ac_cv_func_flockfile=yes"
  else
***************
*** 2861,2867 ****
  # Indicate what the final decision was regarding threads.
  #
  echo $ac_n "checking whether to build with threads""... $ac_c" 1>&6
! echo "configure:2865: checking whether to build with threads" >&5
  if $use_threads; then
  	echo "$ac_t""yes" 1>&6
  else
--- 2869,2875 ----
  # Indicate what the final decision was regarding threads.
  #
  echo $ac_n "checking whether to build with threads""... $ac_c" 1>&6
! echo "configure:2873: checking whether to build with threads" >&5
  if $use_threads; then
  	echo "$ac_t""yes" 1>&6
  else
***************
*** 2937,2948 ****
  # NLS
  #
  echo $ac_n "checking for catgets""... $ac_c" 1>&6
! echo "configure:2941: checking for catgets" >&5
  if eval "test \"`echo '$''{'ac_cv_func_catgets'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
  else
    cat > conftest.$ac_ext <<EOF
! #line 2946 "configure"
  #include "confdefs.h"
  /* System header to define __stub macros and hopefully few prototypes,
      which can conflict with char catgets(); below.  */
--- 2945,2956 ----
  # NLS
  #
  echo $ac_n "checking for catgets""... $ac_c" 1>&6
! echo "configure:2949: checking for catgets" >&5
  if eval "test \"`echo '$''{'ac_cv_func_catgets'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
  else
    cat > conftest.$ac_ext <<EOF
! #line 2954 "configure"
  #include "confdefs.h"
  /* System header to define __stub macros and hopefully few prototypes,
      which can conflict with char catgets(); below.  */
***************
*** 2965,2971 ****
  
  ; return 0; }
  EOF
! if { (eval echo configure:2969: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
    rm -rf conftest*
    eval "ac_cv_func_catgets=yes"
  else
--- 2973,2979 ----
  
  ; return 0; }
  EOF
! if { (eval echo configure:2977: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
    rm -rf conftest*
    eval "ac_cv_func_catgets=yes"
  else
***************
*** 3003,3009 ****
  		;;
  	*)
  		echo $ac_n "checking for socket in -lsocket""... $ac_c" 1>&6
! echo "configure:3007: checking for socket in -lsocket" >&5
  ac_lib_var=`echo socket'_'socket | sed 'y%./+-%__p_%'`
  if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
--- 3011,3017 ----
  		;;
  	*)
  		echo $ac_n "checking for socket in -lsocket""... $ac_c" 1>&6
! echo "configure:3015: checking for socket in -lsocket" >&5
  ac_lib_var=`echo socket'_'socket | sed 'y%./+-%__p_%'`
  if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
***************
*** 3011,3017 ****
    ac_save_LIBS="$LIBS"
  LIBS="-lsocket  $LIBS"
  cat > conftest.$ac_ext <<EOF
! #line 3015 "configure"
  #include "confdefs.h"
  /* Override any gcc2 internal prototype to avoid an error.  */
  /* We use char because int might match the return type of a gcc2
--- 3019,3025 ----
    ac_save_LIBS="$LIBS"
  LIBS="-lsocket  $LIBS"
  cat > conftest.$ac_ext <<EOF
! #line 3023 "configure"
  #include "confdefs.h"
  /* Override any gcc2 internal prototype to avoid an error.  */
  /* We use char because int might match the return type of a gcc2
***************
*** 3022,3028 ****
  socket()
  ; return 0; }
  EOF
! if { (eval echo configure:3026: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
    rm -rf conftest*
    eval "ac_cv_lib_$ac_lib_var=yes"
  else
--- 3030,3036 ----
  socket()
  ; return 0; }
  EOF
! if { (eval echo configure:3034: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
    rm -rf conftest*
    eval "ac_cv_lib_$ac_lib_var=yes"
  else
***************
*** 3050,3056 ****
  fi
  
  		echo $ac_n "checking for inet_ntoa in -lnsl""... $ac_c" 1>&6
! echo "configure:3054: checking for inet_ntoa in -lnsl" >&5
  ac_lib_var=`echo nsl'_'inet_ntoa | sed 'y%./+-%__p_%'`
  if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
--- 3058,3064 ----
  fi
  
  		echo $ac_n "checking for inet_ntoa in -lnsl""... $ac_c" 1>&6
! echo "configure:3062: checking for inet_ntoa in -lnsl" >&5
  ac_lib_var=`echo nsl'_'inet_ntoa | sed 'y%./+-%__p_%'`
  if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
***************
*** 3058,3064 ****
    ac_save_LIBS="$LIBS"
  LIBS="-lnsl  $LIBS"
  cat > conftest.$ac_ext <<EOF
! #line 3062 "configure"
  #include "confdefs.h"
  /* Override any gcc2 internal prototype to avoid an error.  */
  /* We use char because int might match the return type of a gcc2
--- 3066,3072 ----
    ac_save_LIBS="$LIBS"
  LIBS="-lnsl  $LIBS"
  cat > conftest.$ac_ext <<EOF
! #line 3070 "configure"
  #include "confdefs.h"
  /* Override any gcc2 internal prototype to avoid an error.  */
  /* We use char because int might match the return type of a gcc2
***************
*** 3069,3075 ****
  inet_ntoa()
  ; return 0; }
  EOF
! if { (eval echo configure:3073: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
    rm -rf conftest*
    eval "ac_cv_lib_$ac_lib_var=yes"
  else
--- 3077,3083 ----
  inet_ntoa()
  ; return 0; }
  EOF
! if { (eval echo configure:3081: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
    rm -rf conftest*
    eval "ac_cv_lib_$ac_lib_var=yes"
  else
***************
*** 3184,3190 ****
  fi
  
  echo $ac_n "checking build system type""... $ac_c" 1>&6
! echo "configure:3188: checking build system type" >&5
  
  build_alias=$build
  case "$build_alias" in
--- 3192,3198 ----
  fi
  
  echo $ac_n "checking build system type""... $ac_c" 1>&6
! echo "configure:3196: checking build system type" >&5
  
  build_alias=$build
  case "$build_alias" in
***************
*** 3213,3219 ****
  if test "$ac_cv_prog_gcc" = yes; then
    # Check if gcc -print-prog-name=ld gives a path.
    echo $ac_n "checking for ld used by GCC""... $ac_c" 1>&6
! echo "configure:3217: checking for ld used by GCC" >&5
    ac_prog=`($CC -print-prog-name=ld) 2>&5`
    case "$ac_prog" in
      # Accept absolute paths.
--- 3221,3227 ----
  if test "$ac_cv_prog_gcc" = yes; then
    # Check if gcc -print-prog-name=ld gives a path.
    echo $ac_n "checking for ld used by GCC""... $ac_c" 1>&6
! echo "configure:3225: checking for ld used by GCC" >&5
    ac_prog=`($CC -print-prog-name=ld) 2>&5`
    case "$ac_prog" in
      # Accept absolute paths.
***************
*** 3237,3246 ****
    esac
  elif test "$with_gnu_ld" = yes; then
    echo $ac_n "checking for GNU ld""... $ac_c" 1>&6
! echo "configure:3241: checking for GNU ld" >&5
  else
    echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6
! echo "configure:3244: checking for non-GNU ld" >&5
  fi
  if eval "test \"`echo '$''{'ac_cv_path_LD'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
--- 3245,3254 ----
    esac
  elif test "$with_gnu_ld" = yes; then
    echo $ac_n "checking for GNU ld""... $ac_c" 1>&6
! echo "configure:3249: checking for GNU ld" >&5
  else
    echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6
! echo "configure:3252: checking for non-GNU ld" >&5
  fi
  if eval "test \"`echo '$''{'ac_cv_path_LD'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
***************
*** 3275,3281 ****
  fi
  test -z "$LD" && { echo "configure: error: no acceptable ld found in \$PATH" 1>&2; exit 1; }
  echo $ac_n "checking if the linker ($LD) is GNU ld""... $ac_c" 1>&6
! echo "configure:3279: checking if the linker ($LD) is GNU ld" >&5
  if eval "test \"`echo '$''{'ac_cv_prog_gnu_ld'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
  else
--- 3283,3289 ----
  fi
  test -z "$LD" && { echo "configure: error: no acceptable ld found in \$PATH" 1>&2; exit 1; }
  echo $ac_n "checking if the linker ($LD) is GNU ld""... $ac_c" 1>&6
! echo "configure:3287: checking if the linker ($LD) is GNU ld" >&5
  if eval "test \"`echo '$''{'ac_cv_prog_gnu_ld'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
  else
***************
*** 3291,3297 ****
  
  
  echo $ac_n "checking for BSD-compatible nm""... $ac_c" 1>&6
! echo "configure:3295: checking for BSD-compatible nm" >&5
  if eval "test \"`echo '$''{'ac_cv_path_NM'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
  else
--- 3299,3305 ----
  
  
  echo $ac_n "checking for BSD-compatible nm""... $ac_c" 1>&6
! echo "configure:3303: checking for BSD-compatible nm" >&5
  if eval "test \"`echo '$''{'ac_cv_path_NM'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
  else
***************
*** 3327,3333 ****
  echo "$ac_t""$NM" 1>&6
  
  echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
! echo "configure:3331: checking whether ln -s works" >&5
  if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
  else
--- 3335,3341 ----
  echo "$ac_t""$NM" 1>&6
  
  echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
! echo "configure:3339: checking whether ln -s works" >&5
  if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
  else
***************
*** 3376,3383 ****
  case "$lt_target" in
  *-*-irix6*)
    # Find out which ABI we are using.
!   echo '#line 3380 "configure"' > conftest.$ac_ext
!   if { (eval echo configure:3381: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
      case "`/usr/bin/file conftest.o`" in
      *32-bit*)
        LD="${LD-ld} -32"
--- 3384,3391 ----
  case "$lt_target" in
  *-*-irix6*)
    # Find out which ABI we are using.
!   echo '#line 3388 "configure"' > conftest.$ac_ext
!   if { (eval echo configure:3389: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
      case "`/usr/bin/file conftest.o`" in
      *32-bit*)
        LD="${LD-ld} -32"
***************
*** 3398,3416 ****
    SAVE_CFLAGS="$CFLAGS"
    CFLAGS="$CFLAGS -belf"
    echo $ac_n "checking whether the C compiler needs -belf""... $ac_c" 1>&6
! echo "configure:3402: checking whether the C compiler needs -belf" >&5
  if eval "test \"`echo '$''{'lt_cv_cc_needs_belf'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
  else
    cat > conftest.$ac_ext <<EOF
! #line 3407 "configure"
  #include "confdefs.h"
  
  int main() {
  
  ; return 0; }
  EOF
! if { (eval echo configure:3414: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
    rm -rf conftest*
    lt_cv_cc_needs_belf=yes
  else
--- 3406,3424 ----
    SAVE_CFLAGS="$CFLAGS"
    CFLAGS="$CFLAGS -belf"
    echo $ac_n "checking whether the C compiler needs -belf""... $ac_c" 1>&6
! echo "configure:3410: checking whether the C compiler needs -belf" >&5
  if eval "test \"`echo '$''{'lt_cv_cc_needs_belf'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
  else
    cat > conftest.$ac_ext <<EOF
! #line 3415 "configure"
  #include "confdefs.h"
  
  int main() {
  
  ; return 0; }
  EOF
! if { (eval echo configure:3422: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
    rm -rf conftest*
    lt_cv_cc_needs_belf=yes
  else
***************
*** 3561,3569 ****
  # the right suffix on the files.
  #
  echo $ac_n "checking for IPv6 structures""... $ac_c" 1>&6
! echo "configure:3565: checking for IPv6 structures" >&5
  cat > conftest.$ac_ext <<EOF
! #line 3567 "configure"
  #include "confdefs.h"
  
  #include <sys/types.h>
--- 3569,3577 ----
  # the right suffix on the files.
  #
  echo $ac_n "checking for IPv6 structures""... $ac_c" 1>&6
! echo "configure:3573: checking for IPv6 structures" >&5
  cat > conftest.$ac_ext <<EOF
! #line 3575 "configure"
  #include "confdefs.h"
  
  #include <sys/types.h>
***************
*** 3573,3579 ****
  struct sockaddr_in6 sin6; return (0);
  ; return 0; }
  EOF
! if { (eval echo configure:3577: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
    rm -rf conftest*
    echo "$ac_t""yes" 1>&6
  	 found_ipv6=yes
--- 3581,3587 ----
  struct sockaddr_in6 sin6; return (0);
  ; return 0; }
  EOF
! if { (eval echo configure:3585: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
    rm -rf conftest*
    echo "$ac_t""yes" 1>&6
  	 found_ipv6=yes
***************
*** 3591,3597 ****
  # This is done before other IPv6 linking tests to LIBS is properly set.
  #
  echo $ac_n "checking for Kame IPv6 support""... $ac_c" 1>&6
! echo "configure:3595: checking for Kame IPv6 support" >&5
  # Check whether --with-kame or --without-kame was given.
  if test "${with_kame+set}" = set; then
    withval="$with_kame"
--- 3599,3605 ----
  # This is done before other IPv6 linking tests to LIBS is properly set.
  #
  echo $ac_n "checking for Kame IPv6 support""... $ac_c" 1>&6
! echo "configure:3603: checking for Kame IPv6 support" >&5
  # Check whether --with-kame or --without-kame was given.
  if test "${with_kame+set}" = set; then
    withval="$with_kame"
***************
*** 3681,3689 ****
  		LWRES_PLATFORM_HAVEIPV6="#define LWRES_PLATFORM_HAVEIPV6 1"
  
  		echo $ac_n "checking for in6_addr""... $ac_c" 1>&6
! echo "configure:3685: checking for in6_addr" >&5
  		cat > conftest.$ac_ext <<EOF
! #line 3687 "configure"
  #include "confdefs.h"
  
  #include <sys/types.h>
--- 3689,3697 ----
  		LWRES_PLATFORM_HAVEIPV6="#define LWRES_PLATFORM_HAVEIPV6 1"
  
  		echo $ac_n "checking for in6_addr""... $ac_c" 1>&6
! echo "configure:3693: checking for in6_addr" >&5
  		cat > conftest.$ac_ext <<EOF
! #line 3695 "configure"
  #include "confdefs.h"
  
  #include <sys/types.h>
***************
*** 3696,3702 ****
  struct in6_addr in6; return (0);
  ; return 0; }
  EOF
! if { (eval echo configure:3700: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
    rm -rf conftest*
    echo "$ac_t""yes" 1>&6
  		 ISC_PLATFORM_HAVEINADDR6="#undef ISC_PLATFORM_HAVEINADDR6"
--- 3704,3710 ----
  struct in6_addr in6; return (0);
  ; return 0; }
  EOF
! if { (eval echo configure:3708: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
    rm -rf conftest*
    echo "$ac_t""yes" 1>&6
  		 ISC_PLATFORM_HAVEINADDR6="#undef ISC_PLATFORM_HAVEINADDR6"
***************
*** 3714,3722 ****
  rm -f conftest*
  
  		echo $ac_n "checking for in6addr_any""... $ac_c" 1>&6
! echo "configure:3718: checking for in6addr_any" >&5
  		cat > conftest.$ac_ext <<EOF
! #line 3720 "configure"
  #include "confdefs.h"
  
  #include <sys/types.h>
--- 3722,3730 ----
  rm -f conftest*
  
  		echo $ac_n "checking for in6addr_any""... $ac_c" 1>&6
! echo "configure:3726: checking for in6addr_any" >&5
  		cat > conftest.$ac_ext <<EOF
! #line 3728 "configure"
  #include "confdefs.h"
  
  #include <sys/types.h>
***************
*** 3730,3736 ****
  struct in6_addr in6; in6 = in6addr_any; return (0);
  ; return 0; }
  EOF
! if { (eval echo configure:3734: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
    rm -rf conftest*
    echo "$ac_t""yes" 1>&6
  			 ISC_PLATFORM_NEEDIN6ADDRANY="#undef ISC_PLATFORM_NEEDIN6ADDRANY"
--- 3738,3744 ----
  struct in6_addr in6; in6 = in6addr_any; return (0);
  ; return 0; }
  EOF
! if { (eval echo configure:3742: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
    rm -rf conftest*
    echo "$ac_t""yes" 1>&6
  			 ISC_PLATFORM_NEEDIN6ADDRANY="#undef ISC_PLATFORM_NEEDIN6ADDRANY"
***************
*** 3746,3754 ****
  rm -f conftest*
  
  		echo $ac_n "checking for sin6_scope_id in struct sockaddr_in6""... $ac_c" 1>&6
! echo "configure:3750: checking for sin6_scope_id in struct sockaddr_in6" >&5
  		cat > conftest.$ac_ext <<EOF
! #line 3752 "configure"
  #include "confdefs.h"
  
  #include <sys/types.h>
--- 3754,3762 ----
  rm -f conftest*
  
  		echo $ac_n "checking for sin6_scope_id in struct sockaddr_in6""... $ac_c" 1>&6
! echo "configure:3758: checking for sin6_scope_id in struct sockaddr_in6" >&5
  		cat > conftest.$ac_ext <<EOF
! #line 3760 "configure"
  #include "confdefs.h"
  
  #include <sys/types.h>
***************
*** 3761,3767 ****
  struct sockaddr_in6 xyzzy; xyzzy.sin6_scope_id = 0; return (0);
  ; return 0; }
  EOF
! if { (eval echo configure:3765: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
    rm -rf conftest*
    echo "$ac_t""yes" 1>&6
  			 result="#define LWRES_HAVE_SIN6_SCOPE_ID 1"
--- 3769,3775 ----
  struct sockaddr_in6 xyzzy; xyzzy.sin6_scope_id = 0; return (0);
  ; return 0; }
  EOF
! if { (eval echo configure:3773: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
    rm -rf conftest*
    echo "$ac_t""yes" 1>&6
  			 result="#define LWRES_HAVE_SIN6_SCOPE_ID 1"
***************
*** 3776,3784 ****
  		LWRES_HAVE_SIN6_SCOPE_ID="$result"
  
  		echo $ac_n "checking for in6_pktinfo""... $ac_c" 1>&6
! echo "configure:3780: checking for in6_pktinfo" >&5
  		cat > conftest.$ac_ext <<EOF
! #line 3782 "configure"
  #include "confdefs.h"
  
  #include <sys/types.h>
--- 3784,3792 ----
  		LWRES_HAVE_SIN6_SCOPE_ID="$result"
  
  		echo $ac_n "checking for in6_pktinfo""... $ac_c" 1>&6
! echo "configure:3788: checking for in6_pktinfo" >&5
  		cat > conftest.$ac_ext <<EOF
! #line 3790 "configure"
  #include "confdefs.h"
  
  #include <sys/types.h>
***************
*** 3791,3797 ****
  struct in6_pktinfo xyzzy; return (0);
  ; return 0; }
  EOF
! if { (eval echo configure:3795: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
    rm -rf conftest*
    echo "$ac_t""yes" 1>&6
  			 ISC_PLATFORM_HAVEIN6PKTINFO="#define ISC_PLATFORM_HAVEIN6PKTINFO 1"
--- 3799,3805 ----
  struct in6_pktinfo xyzzy; return (0);
  ; return 0; }
  EOF
! if { (eval echo configure:3803: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
    rm -rf conftest*
    echo "$ac_t""yes" 1>&6
  			 ISC_PLATFORM_HAVEIN6PKTINFO="#define ISC_PLATFORM_HAVEIN6PKTINFO 1"
***************
*** 3843,3851 ****
  # which provides some (all?) of the desired functions.
  #
  echo $ac_n "checking for inet_ntop""... $ac_c" 1>&6
! echo "configure:3847: checking for inet_ntop" >&5
  cat > conftest.$ac_ext <<EOF
! #line 3849 "configure"
  #include "confdefs.h"
  
  #include <sys/types.h>
--- 3851,3859 ----
  # which provides some (all?) of the desired functions.
  #
  echo $ac_n "checking for inet_ntop""... $ac_c" 1>&6
! echo "configure:3855: checking for inet_ntop" >&5
  cat > conftest.$ac_ext <<EOF
! #line 3857 "configure"
  #include "confdefs.h"
  
  #include <sys/types.h>
***************
*** 3855,3861 ****
  inet_ntop(0, 0, 0, 0); return (0);
  ; return 0; }
  EOF
! if { (eval echo configure:3859: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
    rm -rf conftest*
    echo "$ac_t""yes" 1>&6
          ISC_PLATFORM_NEEDNTOP="#undef ISC_PLATFORM_NEEDNTOP"
--- 3863,3869 ----
  inet_ntop(0, 0, 0, 0); return (0);
  ; return 0; }
  EOF
! if { (eval echo configure:3867: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
    rm -rf conftest*
    echo "$ac_t""yes" 1>&6
          ISC_PLATFORM_NEEDNTOP="#undef ISC_PLATFORM_NEEDNTOP"
***************
*** 3870,3878 ****
  fi
  rm -f conftest*
  echo $ac_n "checking for inet_pton""... $ac_c" 1>&6
! echo "configure:3874: checking for inet_pton" >&5
  cat > conftest.$ac_ext <<EOF
! #line 3876 "configure"
  #include "confdefs.h"
  
  #include <sys/types.h>
--- 3878,3886 ----
  fi
  rm -f conftest*
  echo $ac_n "checking for inet_pton""... $ac_c" 1>&6
! echo "configure:3882: checking for inet_pton" >&5
  cat > conftest.$ac_ext <<EOF
! #line 3884 "configure"
  #include "confdefs.h"
  
  #include <sys/types.h>
***************
*** 3882,3888 ****
  inet_pton(0, 0, 0); return (0);
  ; return 0; }
  EOF
! if { (eval echo configure:3886: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
    rm -rf conftest*
    echo "$ac_t""yes" 1>&6
          ISC_PLATFORM_NEEDPTON="#undef ISC_PLATFORM_NEEDPTON"
--- 3890,3896 ----
  inet_pton(0, 0, 0); return (0);
  ; return 0; }
  EOF
! if { (eval echo configure:3894: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
    rm -rf conftest*
    echo "$ac_t""yes" 1>&6
          ISC_PLATFORM_NEEDPTON="#undef ISC_PLATFORM_NEEDPTON"
***************
*** 3897,3905 ****
  fi
  rm -f conftest*
  echo $ac_n "checking for inet_aton""... $ac_c" 1>&6
! echo "configure:3901: checking for inet_aton" >&5
  cat > conftest.$ac_ext <<EOF
! #line 3903 "configure"
  #include "confdefs.h"
  
  #include <sys/types.h>
--- 3905,3913 ----
  fi
  rm -f conftest*
  echo $ac_n "checking for inet_aton""... $ac_c" 1>&6
! echo "configure:3909: checking for inet_aton" >&5
  cat > conftest.$ac_ext <<EOF
! #line 3911 "configure"
  #include "confdefs.h"
  
  #include <sys/types.h>
***************
*** 3909,3915 ****
  struct in_addr in; inet_aton(0, &in); return (0);
  ; return 0; }
  EOF
! if { (eval echo configure:3913: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
    rm -rf conftest*
    echo "$ac_t""yes" 1>&6
          ISC_PLATFORM_NEEDATON="#undef ISC_PLATFORM_NEEDATON"
--- 3917,3923 ----
  struct in_addr in; inet_aton(0, &in); return (0);
  ; return 0; }
  EOF
! if { (eval echo configure:3921: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
    rm -rf conftest*
    echo "$ac_t""yes" 1>&6
          ISC_PLATFORM_NEEDATON="#undef ISC_PLATFORM_NEEDATON"
***************
*** 3942,3950 ****
  esac
  
  echo $ac_n "checking for sa_len in struct sockaddr""... $ac_c" 1>&6
! echo "configure:3946: checking for sa_len in struct sockaddr" >&5
  cat > conftest.$ac_ext <<EOF
! #line 3948 "configure"
  #include "confdefs.h"
  
  #include <sys/types.h>
--- 3950,3958 ----
  esac
  
  echo $ac_n "checking for sa_len in struct sockaddr""... $ac_c" 1>&6
! echo "configure:3954: checking for sa_len in struct sockaddr" >&5
  cat > conftest.$ac_ext <<EOF
! #line 3956 "configure"
  #include "confdefs.h"
  
  #include <sys/types.h>
***************
*** 3953,3959 ****
  struct sockaddr sa; sa.sa_len = 0; return (0);
  ; return 0; }
  EOF
! if { (eval echo configure:3957: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
    rm -rf conftest*
    echo "$ac_t""yes" 1>&6
  	ISC_PLATFORM_HAVESALEN="#define ISC_PLATFORM_HAVESALEN 1"
--- 3961,3967 ----
  struct sockaddr sa; sa.sa_len = 0; return (0);
  ; return 0; }
  EOF
! if { (eval echo configure:3965: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
    rm -rf conftest*
    echo "$ac_t""yes" 1>&6
  	ISC_PLATFORM_HAVESALEN="#define ISC_PLATFORM_HAVESALEN 1"
***************
*** 3974,3982 ****
  # Look for a 4.4BSD or 4.3BSD struct msghdr
  #
  echo $ac_n "checking for struct msghdr flavor""... $ac_c" 1>&6
! echo "configure:3978: checking for struct msghdr flavor" >&5
  cat > conftest.$ac_ext <<EOF
! #line 3980 "configure"
  #include "confdefs.h"
  
  #include <sys/types.h>
--- 3982,3990 ----
  # Look for a 4.4BSD or 4.3BSD struct msghdr
  #
  echo $ac_n "checking for struct msghdr flavor""... $ac_c" 1>&6
! echo "configure:3986: checking for struct msghdr flavor" >&5
  cat > conftest.$ac_ext <<EOF
! #line 3988 "configure"
  #include "confdefs.h"
  
  #include <sys/types.h>
***************
*** 3985,3991 ****
  struct msghdr msg; msg.msg_flags = 0; return (0);
  ; return 0; }
  EOF
! if { (eval echo configure:3989: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
    rm -rf conftest*
    echo "$ac_t""4.4BSD" 1>&6
  	ISC_PLATFORM_MSGHDRFLAVOR="#define ISC_NET_BSD44MSGHDR 1"
--- 3993,3999 ----
  struct msghdr msg; msg.msg_flags = 0; return (0);
  ; return 0; }
  EOF
! if { (eval echo configure:3997: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
    rm -rf conftest*
    echo "$ac_t""4.4BSD" 1>&6
  	ISC_PLATFORM_MSGHDRFLAVOR="#define ISC_NET_BSD44MSGHDR 1"
***************
*** 4003,4011 ****
  # Look for in_port_t.
  #
  echo $ac_n "checking for type in_port_t""... $ac_c" 1>&6
! echo "configure:4007: checking for type in_port_t" >&5
  cat > conftest.$ac_ext <<EOF
! #line 4009 "configure"
  #include "confdefs.h"
  
  #include <sys/types.h>
--- 4011,4019 ----
  # Look for in_port_t.
  #
  echo $ac_n "checking for type in_port_t""... $ac_c" 1>&6
! echo "configure:4015: checking for type in_port_t" >&5
  cat > conftest.$ac_ext <<EOF
! #line 4017 "configure"
  #include "confdefs.h"
  
  #include <sys/types.h>
***************
*** 4014,4020 ****
  in_port_t port = 25; return (0);
  ; return 0; }
  EOF
! if { (eval echo configure:4018: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
    rm -rf conftest*
    echo "$ac_t""yes" 1>&6
  	ISC_PLATFORM_NEEDPORTT="#undef ISC_PLATFORM_NEEDPORTT"
--- 4022,4028 ----
  in_port_t port = 25; return (0);
  ; return 0; }
  EOF
! if { (eval echo configure:4026: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
    rm -rf conftest*
    echo "$ac_t""yes" 1>&6
  	ISC_PLATFORM_NEEDPORTT="#undef ISC_PLATFORM_NEEDPORTT"
***************
*** 4032,4040 ****
  # Check for addrinfo
  #
  echo $ac_n "checking for struct addrinfo""... $ac_c" 1>&6
! echo "configure:4036: checking for struct addrinfo" >&5
  cat > conftest.$ac_ext <<EOF
! #line 4038 "configure"
  #include "confdefs.h"
  
  #include <netdb.h>
--- 4040,4048 ----
  # Check for addrinfo
  #
  echo $ac_n "checking for struct addrinfo""... $ac_c" 1>&6
! echo "configure:4044: checking for struct addrinfo" >&5
  cat > conftest.$ac_ext <<EOF
! #line 4046 "configure"
  #include "confdefs.h"
  
  #include <netdb.h>
***************
*** 4042,4048 ****
  struct addrinfo a; return (0);
  ; return 0; }
  EOF
! if { (eval echo configure:4046: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
    rm -rf conftest*
    echo "$ac_t""yes" 1>&6
  	ISC_LWRES_NEEDADDRINFO="#undef ISC_LWRES_NEEDADDRINFO"
--- 4050,4056 ----
  struct addrinfo a; return (0);
  ; return 0; }
  EOF
! if { (eval echo configure:4054: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
    rm -rf conftest*
    echo "$ac_t""yes" 1>&6
  	ISC_LWRES_NEEDADDRINFO="#undef ISC_LWRES_NEEDADDRINFO"
***************
*** 4061,4069 ****
  
  
  echo $ac_n "checking for int sethostent""... $ac_c" 1>&6
! echo "configure:4065: checking for int sethostent" >&5
  cat > conftest.$ac_ext <<EOF
! #line 4067 "configure"
  #include "confdefs.h"
  
  #include <netdb.h>
--- 4069,4077 ----
  
  
  echo $ac_n "checking for int sethostent""... $ac_c" 1>&6
! echo "configure:4073: checking for int sethostent" >&5
  cat > conftest.$ac_ext <<EOF
! #line 4075 "configure"
  #include "confdefs.h"
  
  #include <netdb.h>
***************
*** 4071,4077 ****
  int i = sethostent(0); return(0);
  ; return 0; }
  EOF
! if { (eval echo configure:4075: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
    rm -rf conftest*
    echo "$ac_t""yes" 1>&6
  	ISC_LWRES_SETHOSTENTINT="#define ISC_LWRES_SETHOSTENTINT 1"
--- 4079,4085 ----
  int i = sethostent(0); return(0);
  ; return 0; }
  EOF
! if { (eval echo configure:4083: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
    rm -rf conftest*
    echo "$ac_t""yes" 1>&6
  	ISC_LWRES_SETHOSTENTINT="#define ISC_LWRES_SETHOSTENTINT 1"
***************
*** 4086,4094 ****
  
  
  echo $ac_n "checking for int endhostent""... $ac_c" 1>&6
! echo "configure:4090: checking for int endhostent" >&5
  cat > conftest.$ac_ext <<EOF
! #line 4092 "configure"
  #include "confdefs.h"
  
  #include <netdb.h>
--- 4094,4102 ----
  
  
  echo $ac_n "checking for int endhostent""... $ac_c" 1>&6
! echo "configure:4098: checking for int endhostent" >&5
  cat > conftest.$ac_ext <<EOF
! #line 4100 "configure"
  #include "confdefs.h"
  
  #include <netdb.h>
***************
*** 4096,4102 ****
  int i = endhostent(); return(0);
  ; return 0; }
  EOF
! if { (eval echo configure:4100: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
    rm -rf conftest*
    echo "$ac_t""yes" 1>&6
  	ISC_LWRES_ENDHOSTENTINT="#define ISC_LWRES_ENDHOSTENTINT 1"
--- 4104,4110 ----
  int i = endhostent(); return(0);
  ; return 0; }
  EOF
! if { (eval echo configure:4108: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
    rm -rf conftest*
    echo "$ac_t""yes" 1>&6
  	ISC_LWRES_ENDHOSTENTINT="#define ISC_LWRES_ENDHOSTENTINT 1"
***************
*** 4111,4119 ****
  
  
  echo $ac_n "checking for getnetbyaddr(in_addr_t, ...)""... $ac_c" 1>&6
! echo "configure:4115: checking for getnetbyaddr(in_addr_t, ...)" >&5
  cat > conftest.$ac_ext <<EOF
! #line 4117 "configure"
  #include "confdefs.h"
  
  #include <netdb.h>
--- 4119,4127 ----
  
  
  echo $ac_n "checking for getnetbyaddr(in_addr_t, ...)""... $ac_c" 1>&6
! echo "configure:4123: checking for getnetbyaddr(in_addr_t, ...)" >&5
  cat > conftest.$ac_ext <<EOF
! #line 4125 "configure"
  #include "confdefs.h"
  
  #include <netdb.h>
***************
*** 4122,4128 ****
  
  ; return 0; }
  EOF
! if { (eval echo configure:4126: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
    rm -rf conftest*
    echo "$ac_t""yes" 1>&6
  	ISC_LWRES_GETNETBYADDRINADDR="#define ISC_LWRES_GETNETBYADDRINADDR 1"
--- 4130,4136 ----
  
  ; return 0; }
  EOF
! if { (eval echo configure:4134: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
    rm -rf conftest*
    echo "$ac_t""yes" 1>&6
  	ISC_LWRES_GETNETBYADDRINADDR="#define ISC_LWRES_GETNETBYADDRINADDR 1"
***************
*** 4137,4145 ****
  
  
  echo $ac_n "checking for int setnetent""... $ac_c" 1>&6
! echo "configure:4141: checking for int setnetent" >&5
  cat > conftest.$ac_ext <<EOF
! #line 4143 "configure"
  #include "confdefs.h"
  
  #include <netdb.h>
--- 4145,4153 ----
  
  
  echo $ac_n "checking for int setnetent""... $ac_c" 1>&6
! echo "configure:4149: checking for int setnetent" >&5
  cat > conftest.$ac_ext <<EOF
! #line 4151 "configure"
  #include "confdefs.h"
  
  #include <netdb.h>
***************
*** 4147,4153 ****
  int i = setnetent(0); return(0);
  ; return 0; }
  EOF
! if { (eval echo configure:4151: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
    rm -rf conftest*
    echo "$ac_t""yes" 1>&6
  	ISC_LWRES_SETNETENTINT="#define ISC_LWRES_SETNETENTINT 1"
--- 4155,4161 ----
  int i = setnetent(0); return(0);
  ; return 0; }
  EOF
! if { (eval echo configure:4159: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
    rm -rf conftest*
    echo "$ac_t""yes" 1>&6
  	ISC_LWRES_SETNETENTINT="#define ISC_LWRES_SETNETENTINT 1"
***************
*** 4162,4170 ****
  
  
  echo $ac_n "checking for int endnetent""... $ac_c" 1>&6
! echo "configure:4166: checking for int endnetent" >&5
  cat > conftest.$ac_ext <<EOF
! #line 4168 "configure"
  #include "confdefs.h"
  
  #include <netdb.h>
--- 4170,4178 ----
  
  
  echo $ac_n "checking for int endnetent""... $ac_c" 1>&6
! echo "configure:4174: checking for int endnetent" >&5
  cat > conftest.$ac_ext <<EOF
! #line 4176 "configure"
  #include "confdefs.h"
  
  #include <netdb.h>
***************
*** 4172,4178 ****
  int i = endnetent(); return(0);
  ; return 0; }
  EOF
! if { (eval echo configure:4176: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
    rm -rf conftest*
    echo "$ac_t""yes" 1>&6
  	ISC_LWRES_ENDNETENTINT="#define ISC_LWRES_ENDNETENTINT 1"
--- 4180,4186 ----
  int i = endnetent(); return(0);
  ; return 0; }
  EOF
! if { (eval echo configure:4184: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
    rm -rf conftest*
    echo "$ac_t""yes" 1>&6
  	ISC_LWRES_ENDNETENTINT="#define ISC_LWRES_ENDNETENTINT 1"
***************
*** 4187,4195 ****
  
  
  echo $ac_n "checking for gethostbyaddr(const void *, size_t, ...)""... $ac_c" 1>&6
! echo "configure:4191: checking for gethostbyaddr(const void *, size_t, ...)" >&5
  cat > conftest.$ac_ext <<EOF
! #line 4193 "configure"
  #include "confdefs.h"
  
  #include <netdb.h>
--- 4195,4203 ----
  
  
  echo $ac_n "checking for gethostbyaddr(const void *, size_t, ...)""... $ac_c" 1>&6
! echo "configure:4199: checking for gethostbyaddr(const void *, size_t, ...)" >&5
  cat > conftest.$ac_ext <<EOF
! #line 4201 "configure"
  #include "confdefs.h"
  
  #include <netdb.h>
***************
*** 4198,4204 ****
  return(0);
  ; return 0; }
  EOF
! if { (eval echo configure:4202: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
    rm -rf conftest*
    echo "$ac_t""yes" 1>&6
  	ISC_LWRES_GETHOSTBYADDRVOID="#define ISC_LWRES_GETHOSTBYADDRVOID 1"
--- 4206,4212 ----
  return(0);
  ; return 0; }
  EOF
! if { (eval echo configure:4210: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
    rm -rf conftest*
    echo "$ac_t""yes" 1>&6
  	ISC_LWRES_GETHOSTBYADDRVOID="#define ISC_LWRES_GETHOSTBYADDRVOID 1"
***************
*** 4213,4221 ****
  
  
  echo $ac_n "checking for h_errno in netdb.h""... $ac_c" 1>&6
! echo "configure:4217: checking for h_errno in netdb.h" >&5
  cat > conftest.$ac_ext <<EOF
! #line 4219 "configure"
  #include "confdefs.h"
  
  #include <netdb.h>
--- 4221,4229 ----
  
  
  echo $ac_n "checking for h_errno in netdb.h""... $ac_c" 1>&6
! echo "configure:4225: checking for h_errno in netdb.h" >&5
  cat > conftest.$ac_ext <<EOF
! #line 4227 "configure"
  #include "confdefs.h"
  
  #include <netdb.h>
***************
*** 4223,4229 ****
  h_errno = 1; return(0);
  ; return 0; }
  EOF
! if { (eval echo configure:4227: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
    rm -rf conftest*
    echo "$ac_t""yes" 1>&6
  	ISC_LWRES_NEEDHERRNO="#undef ISC_LWRES_NEEDHERRNO"
--- 4231,4237 ----
  h_errno = 1; return(0);
  ; return 0; }
  EOF
! if { (eval echo configure:4235: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
    rm -rf conftest*
    echo "$ac_t""yes" 1>&6
  	ISC_LWRES_NEEDHERRNO="#undef ISC_LWRES_NEEDHERRNO"
***************
*** 4238,4249 ****
  
  
  echo $ac_n "checking for getipnodebyname""... $ac_c" 1>&6
! echo "configure:4242: checking for getipnodebyname" >&5
  if eval "test \"`echo '$''{'ac_cv_func_getipnodebyname'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
  else
    cat > conftest.$ac_ext <<EOF
! #line 4247 "configure"
  #include "confdefs.h"
  /* System header to define __stub macros and hopefully few prototypes,
      which can conflict with char getipnodebyname(); below.  */
--- 4246,4257 ----
  
  
  echo $ac_n "checking for getipnodebyname""... $ac_c" 1>&6
! echo "configure:4250: checking for getipnodebyname" >&5
  if eval "test \"`echo '$''{'ac_cv_func_getipnodebyname'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
  else
    cat > conftest.$ac_ext <<EOF
! #line 4255 "configure"
  #include "confdefs.h"
  /* System header to define __stub macros and hopefully few prototypes,
      which can conflict with char getipnodebyname(); below.  */
***************
*** 4266,4272 ****
  
  ; return 0; }
  EOF
! if { (eval echo configure:4270: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
    rm -rf conftest*
    eval "ac_cv_func_getipnodebyname=yes"
  else
--- 4274,4280 ----
  
  ; return 0; }
  EOF
! if { (eval echo configure:4278: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
    rm -rf conftest*
    eval "ac_cv_func_getipnodebyname=yes"
  else
***************
*** 4287,4298 ****
  fi
  
  echo $ac_n "checking for getnameinfo""... $ac_c" 1>&6
! echo "configure:4291: checking for getnameinfo" >&5
  if eval "test \"`echo '$''{'ac_cv_func_getnameinfo'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
  else
    cat > conftest.$ac_ext <<EOF
! #line 4296 "configure"
  #include "confdefs.h"
  /* System header to define __stub macros and hopefully few prototypes,
      which can conflict with char getnameinfo(); below.  */
--- 4295,4306 ----
  fi
  
  echo $ac_n "checking for getnameinfo""... $ac_c" 1>&6
! echo "configure:4299: checking for getnameinfo" >&5
  if eval "test \"`echo '$''{'ac_cv_func_getnameinfo'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
  else
    cat > conftest.$ac_ext <<EOF
! #line 4304 "configure"
  #include "confdefs.h"
  /* System header to define __stub macros and hopefully few prototypes,
      which can conflict with char getnameinfo(); below.  */
***************
*** 4315,4321 ****
  
  ; return 0; }
  EOF
! if { (eval echo configure:4319: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
    rm -rf conftest*
    eval "ac_cv_func_getnameinfo=yes"
  else
--- 4323,4329 ----
  
  ; return 0; }
  EOF
! if { (eval echo configure:4327: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
    rm -rf conftest*
    eval "ac_cv_func_getnameinfo=yes"
  else
***************
*** 4336,4347 ****
  fi
  
  echo $ac_n "checking for getaddrinfo""... $ac_c" 1>&6
! echo "configure:4340: checking for getaddrinfo" >&5
  if eval "test \"`echo '$''{'ac_cv_func_getaddrinfo'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
  else
    cat > conftest.$ac_ext <<EOF
! #line 4345 "configure"
  #include "confdefs.h"
  /* System header to define __stub macros and hopefully few prototypes,
      which can conflict with char getaddrinfo(); below.  */
--- 4344,4355 ----
  fi
  
  echo $ac_n "checking for getaddrinfo""... $ac_c" 1>&6
! echo "configure:4348: checking for getaddrinfo" >&5
  if eval "test \"`echo '$''{'ac_cv_func_getaddrinfo'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
  else
    cat > conftest.$ac_ext <<EOF
! #line 4353 "configure"
  #include "confdefs.h"
  /* System header to define __stub macros and hopefully few prototypes,
      which can conflict with char getaddrinfo(); below.  */
***************
*** 4364,4370 ****
  
  ; return 0; }
  EOF
! if { (eval echo configure:4368: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
    rm -rf conftest*
    eval "ac_cv_func_getaddrinfo=yes"
  else
--- 4372,4378 ----
  
  ; return 0; }
  EOF
! if { (eval echo configure:4376: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
    rm -rf conftest*
    eval "ac_cv_func_getaddrinfo=yes"
  else
***************
*** 4389,4400 ****
  fi
  
  echo $ac_n "checking for gai_strerror""... $ac_c" 1>&6
! echo "configure:4393: checking for gai_strerror" >&5
  if eval "test \"`echo '$''{'ac_cv_func_gai_strerror'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
  else
    cat > conftest.$ac_ext <<EOF
! #line 4398 "configure"
  #include "confdefs.h"
  /* System header to define __stub macros and hopefully few prototypes,
      which can conflict with char gai_strerror(); below.  */
--- 4397,4408 ----
  fi
  
  echo $ac_n "checking for gai_strerror""... $ac_c" 1>&6
! echo "configure:4401: checking for gai_strerror" >&5
  if eval "test \"`echo '$''{'ac_cv_func_gai_strerror'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
  else
    cat > conftest.$ac_ext <<EOF
! #line 4406 "configure"
  #include "confdefs.h"
  /* System header to define __stub macros and hopefully few prototypes,
      which can conflict with char gai_strerror(); below.  */
***************
*** 4417,4423 ****
  
  ; return 0; }
  EOF
! if { (eval echo configure:4421: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
    rm -rf conftest*
    eval "ac_cv_func_gai_strerror=yes"
  else
--- 4425,4431 ----
  
  ; return 0; }
  EOF
! if { (eval echo configure:4429: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
    rm -rf conftest*
    eval "ac_cv_func_gai_strerror=yes"
  else
***************
*** 4447,4455 ****
  # Look for a sysctl call to get the list of network interfaces.
  #
  echo $ac_n "checking for interface list sysctl""... $ac_c" 1>&6
! echo "configure:4451: checking for interface list sysctl" >&5
  cat > conftest.$ac_ext <<EOF
! #line 4453 "configure"
  #include "confdefs.h"
  
  #include <sys/param.h>
--- 4455,4463 ----
  # Look for a sysctl call to get the list of network interfaces.
  #
  echo $ac_n "checking for interface list sysctl""... $ac_c" 1>&6
! echo "configure:4459: checking for interface list sysctl" >&5
  cat > conftest.$ac_ext <<EOF
! #line 4461 "configure"
  #include "confdefs.h"
  
  #include <sys/param.h>
***************
*** 4479,4490 ****
  # Check for some other useful functions that are not ever-present.
  #
  echo $ac_n "checking for strsep""... $ac_c" 1>&6
! echo "configure:4483: checking for strsep" >&5
  if eval "test \"`echo '$''{'ac_cv_func_strsep'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
  else
    cat > conftest.$ac_ext <<EOF
! #line 4488 "configure"
  #include "confdefs.h"
  /* System header to define __stub macros and hopefully few prototypes,
      which can conflict with char strsep(); below.  */
--- 4487,4498 ----
  # Check for some other useful functions that are not ever-present.
  #
  echo $ac_n "checking for strsep""... $ac_c" 1>&6
! echo "configure:4491: checking for strsep" >&5
  if eval "test \"`echo '$''{'ac_cv_func_strsep'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
  else
    cat > conftest.$ac_ext <<EOF
! #line 4496 "configure"
  #include "confdefs.h"
  /* System header to define __stub macros and hopefully few prototypes,
      which can conflict with char strsep(); below.  */
***************
*** 4507,4513 ****
  
  ; return 0; }
  EOF
! if { (eval echo configure:4511: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
    rm -rf conftest*
    eval "ac_cv_func_strsep=yes"
  else
--- 4515,4521 ----
  
  ; return 0; }
  EOF
! if { (eval echo configure:4519: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
    rm -rf conftest*
    eval "ac_cv_func_strsep=yes"
  else
***************
*** 4528,4539 ****
  fi
  
  echo $ac_n "checking for vsnprintf""... $ac_c" 1>&6
! echo "configure:4532: checking for vsnprintf" >&5
  if eval "test \"`echo '$''{'ac_cv_func_vsnprintf'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
  else
    cat > conftest.$ac_ext <<EOF
! #line 4537 "configure"
  #include "confdefs.h"
  /* System header to define __stub macros and hopefully few prototypes,
      which can conflict with char vsnprintf(); below.  */
--- 4536,4547 ----
  fi
  
  echo $ac_n "checking for vsnprintf""... $ac_c" 1>&6
! echo "configure:4540: checking for vsnprintf" >&5
  if eval "test \"`echo '$''{'ac_cv_func_vsnprintf'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
  else
    cat > conftest.$ac_ext <<EOF
! #line 4545 "configure"
  #include "confdefs.h"
  /* System header to define __stub macros and hopefully few prototypes,
      which can conflict with char vsnprintf(); below.  */
***************
*** 4556,4562 ****
  
  ; return 0; }
  EOF
! if { (eval echo configure:4560: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
    rm -rf conftest*
    eval "ac_cv_func_vsnprintf=yes"
  else
--- 4564,4570 ----
  
  ; return 0; }
  EOF
! if { (eval echo configure:4568: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
    rm -rf conftest*
    eval "ac_cv_func_vsnprintf=yes"
  else
***************
*** 4585,4601 ****
  
  
  echo $ac_n "checking for sizeof(long long int) == sizeof(long int)""... $ac_c" 1>&6
! echo "configure:4589: checking for sizeof(long long int) == sizeof(long int)" >&5
  if test "$cross_compiling" = yes; then
    echo "$ac_t""default yes" 1>&6
  	ISC_PLATFORM_LONGLONGEQUALLONG="#define ISC_PLATFORM_LONGLONGEQUALLONG 1"
  else
    cat > conftest.$ac_ext <<EOF
! #line 4595 "configure"
  #include "confdefs.h"
  main() { exit(!(sizeof(long long int) == sizeof(long int))); }
  EOF
! if { (eval echo configure:4599: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
  then
    echo "$ac_t""yes" 1>&6
  	ISC_PLATFORM_LONGLONGEQUALLONG="#define ISC_PLATFORM_LONGLONGEQUALLONG 1"
--- 4593,4609 ----
  
  
  echo $ac_n "checking for sizeof(long long int) == sizeof(long int)""... $ac_c" 1>&6
! echo "configure:4597: checking for sizeof(long long int) == sizeof(long int)" >&5
  if test "$cross_compiling" = yes; then
    echo "$ac_t""default yes" 1>&6
  	ISC_PLATFORM_LONGLONGEQUALLONG="#define ISC_PLATFORM_LONGLONGEQUALLONG 1"
  else
    cat > conftest.$ac_ext <<EOF
! #line 4603 "configure"
  #include "confdefs.h"
  main() { exit(!(sizeof(long long int) == sizeof(long int))); }
  EOF
! if { (eval echo configure:4607: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
  then
    echo "$ac_t""yes" 1>&6
  	ISC_PLATFORM_LONGLONGEQUALLONG="#define ISC_PLATFORM_LONGLONGEQUALLONG 1"
***************
*** 4615,4626 ****
  # Security Stuff
  #
  echo $ac_n "checking for chroot""... $ac_c" 1>&6
! echo "configure:4619: checking for chroot" >&5
  if eval "test \"`echo '$''{'ac_cv_func_chroot'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
  else
    cat > conftest.$ac_ext <<EOF
! #line 4624 "configure"
  #include "confdefs.h"
  /* System header to define __stub macros and hopefully few prototypes,
      which can conflict with char chroot(); below.  */
--- 4623,4634 ----
  # Security Stuff
  #
  echo $ac_n "checking for chroot""... $ac_c" 1>&6
! echo "configure:4627: checking for chroot" >&5
  if eval "test \"`echo '$''{'ac_cv_func_chroot'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
  else
    cat > conftest.$ac_ext <<EOF
! #line 4632 "configure"
  #include "confdefs.h"
  /* System header to define __stub macros and hopefully few prototypes,
      which can conflict with char chroot(); below.  */
***************
*** 4643,4649 ****
  
  ; return 0; }
  EOF
! if { (eval echo configure:4647: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
    rm -rf conftest*
    eval "ac_cv_func_chroot=yes"
  else
--- 4651,4657 ----
  
  ; return 0; }
  EOF
! if { (eval echo configure:4655: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
    rm -rf conftest*
    eval "ac_cv_func_chroot=yes"
  else
***************
*** 4669,4685 ****
  do
  ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
  echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
! echo "configure:4673: checking for $ac_hdr" >&5
  if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
  else
    cat > conftest.$ac_ext <<EOF
! #line 4678 "configure"
  #include "confdefs.h"
  #include <$ac_hdr>
  EOF
  ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
! { (eval echo configure:4683: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
  ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
  if test -z "$ac_err"; then
    rm -rf conftest*
--- 4677,4693 ----
  do
  ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
  echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
! echo "configure:4681: checking for $ac_hdr" >&5
  if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
  else
    cat > conftest.$ac_ext <<EOF
! #line 4686 "configure"
  #include "confdefs.h"
  #include <$ac_hdr>
  EOF
  ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
! { (eval echo configure:4691: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
  ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
  if test -z "$ac_err"; then
    rm -rf conftest*
***************
*** 4709,4725 ****
  do
  ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
  echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
! echo "configure:4713: checking for $ac_hdr" >&5
  if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
  else
    cat > conftest.$ac_ext <<EOF
! #line 4718 "configure"
  #include "confdefs.h"
  #include <$ac_hdr>
  EOF
  ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
! { (eval echo configure:4723: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
  ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
  if test -z "$ac_err"; then
    rm -rf conftest*
--- 4717,4733 ----
  do
  ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
  echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
! echo "configure:4721: checking for $ac_hdr" >&5
  if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
  else
    cat > conftest.$ac_ext <<EOF
! #line 4726 "configure"
  #include "confdefs.h"
  #include <$ac_hdr>
  EOF
  ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
! { (eval echo configure:4731: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
  ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
  if test -z "$ac_err"; then
    rm -rf conftest*
***************
*** 4750,4758 ****
  # BSD/OS, and perhaps some others, don't define rlim_t.
  #
  echo $ac_n "checking for type rlim_t""... $ac_c" 1>&6
! echo "configure:4754: checking for type rlim_t" >&5
  cat > conftest.$ac_ext <<EOF
! #line 4756 "configure"
  #include "confdefs.h"
  
  #include <sys/types.h>
--- 4758,4766 ----
  # BSD/OS, and perhaps some others, don't define rlim_t.
  #
  echo $ac_n "checking for type rlim_t""... $ac_c" 1>&6
! echo "configure:4762: checking for type rlim_t" >&5
  cat > conftest.$ac_ext <<EOF
! #line 4764 "configure"
  #include "confdefs.h"
  
  #include <sys/types.h>
***************
*** 4762,4768 ****
  rlim_t rl = 19671212; return (0);
  ; return 0; }
  EOF
! if { (eval echo configure:4766: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
    rm -rf conftest*
    echo "$ac_t""yes" 1>&6
           cat >> confdefs.h <<\EOF
--- 4770,4776 ----
  rlim_t rl = 19671212; return (0);
  ; return 0; }
  EOF
! if { (eval echo configure:4774: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
    rm -rf conftest*
    echo "$ac_t""yes" 1>&6
           cat >> confdefs.h <<\EOF
***************
*** 4777,4788 ****
  fi
  rm -f conftest*
  echo $ac_n "checking sizeof rlim_cur""... $ac_c" 1>&6
! echo "configure:4781: checking sizeof rlim_cur" >&5
  if test "$cross_compiling" = yes; then
      { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
  else
    cat > conftest.$ac_ext <<EOF
! #line 4786 "configure"
  #include "confdefs.h"
  
  #include <sys/types.h>
--- 4785,4796 ----
  fi
  rm -f conftest*
  echo $ac_n "checking sizeof rlim_cur""... $ac_c" 1>&6
! echo "configure:4789: checking sizeof rlim_cur" >&5
  if test "$cross_compiling" = yes; then
      { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
  else
    cat > conftest.$ac_ext <<EOF
! #line 4794 "configure"
  #include "confdefs.h"
  
  #include <sys/types.h>
***************
*** 4790,4796 ****
  #include <sys/resource.h>
  main() { struct rlimit r; exit(!(sizeof(r.rlim_cur) == sizeof(int)));}
  EOF
! if { (eval echo configure:4794: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
  then
    echo "$ac_t""int" 1>&6
  ISC_PLATFORM_RLIMITTYPE="#define ISC_PLATFORM_RLIMITTYPE int"
--- 4798,4804 ----
  #include <sys/resource.h>
  main() { struct rlimit r; exit(!(sizeof(r.rlim_cur) == sizeof(int)));}
  EOF
! if { (eval echo configure:4802: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
  then
    echo "$ac_t""int" 1>&6
  ISC_PLATFORM_RLIMITTYPE="#define ISC_PLATFORM_RLIMITTYPE int"
***************
*** 4803,4809 ****
      { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
  else
    cat > conftest.$ac_ext <<EOF
! #line 4807 "configure"
  #include "confdefs.h"
  
  #include <sys/types.h>
--- 4811,4817 ----
      { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
  else
    cat > conftest.$ac_ext <<EOF
! #line 4815 "configure"
  #include "confdefs.h"
  
  #include <sys/types.h>
***************
*** 4811,4817 ****
  #include <sys/resource.h>
  main() { struct rlimit r; exit(!(sizeof(r.rlim_cur) == sizeof(long int)));}
  EOF
! if { (eval echo configure:4815: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
  then
    echo "$ac_t""long int" 1>&6
  ISC_PLATFORM_RLIMITTYPE="#define ISC_PLATFORM_RLIMITTYPE long int"
--- 4819,4825 ----
  #include <sys/resource.h>
  main() { struct rlimit r; exit(!(sizeof(r.rlim_cur) == sizeof(long int)));}
  EOF
! if { (eval echo configure:4823: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
  then
    echo "$ac_t""long int" 1>&6
  ISC_PLATFORM_RLIMITTYPE="#define ISC_PLATFORM_RLIMITTYPE long int"
***************
*** 4824,4830 ****
      { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
  else
    cat > conftest.$ac_ext <<EOF
! #line 4828 "configure"
  #include "confdefs.h"
  
  #include <sys/types.h>
--- 4832,4838 ----
      { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
  else
    cat > conftest.$ac_ext <<EOF
! #line 4836 "configure"
  #include "confdefs.h"
  
  #include <sys/types.h>
***************
*** 4832,4838 ****
  #include <sys/resource.h>
  main() { struct rlimit r; exit((!sizeof(r.rlim_cur) == sizeof(long long int)));}
  EOF
! if { (eval echo configure:4836: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
  then
    echo "$ac_t""long long int" 1>&6
  ISC_PLATFORM_RLIMITTYPE="#define ISC_PLATFORM_RLIMITTYPE long long int"
--- 4840,4846 ----
  #include <sys/resource.h>
  main() { struct rlimit r; exit((!sizeof(r.rlim_cur) == sizeof(long long int)));}
  EOF
! if { (eval echo configure:4844: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
  then
    echo "$ac_t""long long int" 1>&6
  ISC_PLATFORM_RLIMITTYPE="#define ISC_PLATFORM_RLIMITTYPE long long int"
***************
*** 4935,4941 ****
  # Extract the first word of "$ac_prog", so it can be a program name with args.
  set dummy $ac_prog; ac_word=$2
  echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
! echo "configure:4939: checking for $ac_word" >&5
  if eval "test \"`echo '$''{'ac_cv_path_JADE'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
  else
--- 4943,4949 ----
  # Extract the first word of "$ac_prog", so it can be a program name with args.
  set dummy $ac_prog; ac_word=$2
  echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
! echo "configure:4947: checking for $ac_word" >&5
  if eval "test \"`echo '$''{'ac_cv_path_JADE'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
  else
***************
*** 4981,4987 ****
  SGMLDIR=""
  
  echo $ac_n "checking for SGML files""... $ac_c" 1>&6
! echo "configure:4985: checking for SGML files" >&5
  for d in /usr/pkg/share/sgml /usr/local/share/sgml 
  do
  	if test -f $d/docbook/dsssl/modular/html/docbook.dsl
--- 4989,4995 ----
  SGMLDIR=""
  
  echo $ac_n "checking for SGML files""... $ac_c" 1>&6
! echo "configure:4993: checking for SGML files" >&5
  for d in /usr/pkg/share/sgml /usr/local/share/sgml 
  do
  	if test -f $d/docbook/dsssl/modular/html/docbook.dsl
***************
*** 5007,5013 ****
  XGMLDIR=""
  
  echo $ac_n "checking for XML files""... $ac_c" 1>&6
! echo "configure:5011: checking for XML files" >&5
  for d in /usr/pkg/share/xml /usr/local/share/xml
  do
  	if test -f $d/dtd/docbook/docbookx.dtd
--- 5015,5021 ----
  XGMLDIR=""
  
  echo $ac_n "checking for XML files""... $ac_c" 1>&6
! echo "configure:5019: checking for XML files" >&5
  for d in /usr/pkg/share/xml /usr/local/share/xml
  do
  	if test -f $d/dtd/docbook/docbookx.dtd
***************
*** 5024,5029 ****
--- 5032,5224 ----
  	XMLDIR=/usr/local/share/xml
  fi
  
+ 
+ 
+ #
+ # MDN support
+ #
+ # Check whether --with-mdn or --without-mdn was given.
+ if test "${with_mdn+set}" = set; then
+   withval="$with_mdn"
+   use_mdn="$withval"
+ else
+   use_mdn="no"
+ fi
+ 
+ case "$use_mdn" in
+ yes)
+ 	if test X$prefix = XNONE ; then
+ 		mdn_path=/usr/local
+ 	else
+ 		mdn_path=$prefix
+ 	fi
+ 	;;
+ no)
+ 	;;
+ *)
+ 	mdn_path="$use_mdn"
+ 	;;
+ esac
+ 
+ iconvinc=
+ iconvlib=
+ # Check whether --with-libiconv or --without-libiconv was given.
+ if test "${with_libiconv+set}" = set; then
+   withval="$with_libiconv"
+   use_libiconv="$withval"
+ else
+   use_libiconv="no"
+ fi
+ 
+ case "$use_libiconv" in
+ yes)
+ 	if test X$prefix = XNONE ; then
+ 		iconvlib="-L/usr/local/lib -R/usr/local/lib -liconv"
+ 	else
+ 		iconvlib="-L$prefix/lib -R$prefix/lib -liconv"
+ 	fi
+ 	;;
+ no)
+ 	iconvlib=
+ 	;;
+ *)
+ 	iconvlib="-L$use_libiconv/lib -R$use_libiconv/lib -liconv"
+ 	;;
+ esac
+ 
+ # Check whether --with-iconv or --without-iconv was given.
+ if test "${with_iconv+set}" = set; then
+   withval="$with_iconv"
+   iconvlib="$withval"
+ fi
+ 
+ case "$iconvlib" in
+ no)
+ 	iconvlib=
+ 	;;
+ yes)
+ 	iconvlib=-liconv
+ 	;;
+ esac
+ 
+ # Check whether --with-mdnlib or --without-mdnlib was given.
+ if test "${with_mdnlib+set}" = set; then
+   withval="$with_mdnlib"
+   mdnlib="$withval"
+ else
+   mdnlib="no"
+ fi
+ 
+ if test "$mdnlib" = yes; then
+ 	{ echo "configure: error: You must specify ARG for --with-mdnlib." 1>&2; exit 1; }
+ fi
+ 
+ if test "$use_mdn" != no; then
+ 	cat >> confdefs.h <<\EOF
+ #define WITH_MDN 1
+ EOF
+ 
+ 	STD_CINCLUDES="$STD_CINCLUDES -I$mdn_path/include"
+ 	if test "$mdnlib" != no; then
+ 		LIBS="$mdnlib $iconvlib $LIBS"
+ 	else
+ 		LIBS="-L$mdn_path/lib -lmdn $iconvlib $LIBS"
+ 	fi
+ fi
+ for ac_hdr in locale.h
+ do
+ ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
+ echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
+ echo "configure:5133: checking for $ac_hdr" >&5
+ if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
+   echo $ac_n "(cached) $ac_c" 1>&6
+ else
+   cat > conftest.$ac_ext <<EOF
+ #line 5138 "configure"
+ #include "confdefs.h"
+ #include <$ac_hdr>
+ EOF
+ ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+ { (eval echo configure:5143: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+ if test -z "$ac_err"; then
+   rm -rf conftest*
+   eval "ac_cv_header_$ac_safe=yes"
+ else
+   echo "$ac_err" >&5
+   echo "configure: failed program was:" >&5
+   cat conftest.$ac_ext >&5
+   rm -rf conftest*
+   eval "ac_cv_header_$ac_safe=no"
+ fi
+ rm -f conftest*
+ fi
+ if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+   echo "$ac_t""yes" 1>&6
+     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
+   cat >> confdefs.h <<EOF
+ #define $ac_tr_hdr 1
+ EOF
+  
+ else
+   echo "$ac_t""no" 1>&6
+ fi
+ done
+ 
+ for ac_func in setlocale
+ do
+ echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
+ echo "configure:5172: checking for $ac_func" >&5
+ if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
+   echo $ac_n "(cached) $ac_c" 1>&6
+ else
+   cat > conftest.$ac_ext <<EOF
+ #line 5177 "configure"
+ #include "confdefs.h"
+ /* System header to define __stub macros and hopefully few prototypes,
+     which can conflict with char $ac_func(); below.  */
+ #include <assert.h>
+ /* Override any gcc2 internal prototype to avoid an error.  */
+ /* We use char because int might match the return type of a gcc2
+     builtin and then its argument prototype would still apply.  */
+ char $ac_func();
+ 
+ int main() {
+ 
+ /* The GNU C library defines this for functions which it implements
+     to always fail with ENOSYS.  Some functions are actually named
+     something starting with __ and the normal name is an alias.  */
+ #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+ choke me
+ #else
+ $ac_func();
+ #endif
+ 
+ ; return 0; }
+ EOF
+ if { (eval echo configure:5200: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+   rm -rf conftest*
+   eval "ac_cv_func_$ac_func=yes"
+ else
+   echo "configure: failed program was:" >&5
+   cat conftest.$ac_ext >&5
+   rm -rf conftest*
+   eval "ac_cv_func_$ac_func=no"
+ fi
+ rm -f conftest*
+ fi
+ 
+ if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
+   echo "$ac_t""yes" 1>&6
+     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
+   cat >> confdefs.h <<EOF
+ #define $ac_tr_func 1
+ EOF
+  
+ else
+   echo "$ac_t""no" 1>&6
+ fi
+ done
  
  
  #
Index: configure.in
diff -c mdn/othersrc/bind9/configure.in:1.1.1.7 mdn/othersrc/bind9/configure.in:1.10
*** configure.in	Thu Jul 26 15:43:20 2001
--- configure.in	Thu Jul 26 16:44:20 2001
***************
*** 1305,1310 ****
--- 1305,1383 ----
  AC_SUBST(XMLDIR)
  
  #
+ # MDN support
+ #
+ AC_ARG_WITH(mdn,
+ 	[  --with-mdn[=MPREFIX]   enable MDN support using mDNkit [default PREFIX]],
+ 	use_mdn="$withval", use_mdn="no")
+ case "$use_mdn" in
+ yes)
+ 	if test X$prefix = XNONE ; then
+ 		mdn_path=/usr/local
+ 	else
+ 		mdn_path=$prefix
+ 	fi
+ 	;;
+ no)
+ 	;;
+ *)
+ 	mdn_path="$use_mdn"
+ 	;;
+ esac
+ 
+ iconvinc=
+ iconvlib=
+ AC_ARG_WITH(libiconv,
+ 	[  --with-libiconv[=IPREFIX]   GNU libiconv are in IPREFIX [default PREFIX]],
+ 	use_libiconv="$withval", use_libiconv="no")
+ case "$use_libiconv" in
+ yes)
+ 	if test X$prefix = XNONE ; then
+ 		iconvlib="-L/usr/local/lib -R/usr/local/lib -liconv"
+ 	else
+ 		iconvlib="-L$prefix/lib -R$prefix/lib -liconv"
+ 	fi
+ 	;;
+ no)
+ 	iconvlib=
+ 	;;
+ *)
+ 	iconvlib="-L$use_libiconv/lib -R$use_libiconv/lib -liconv"
+ 	;;
+ esac
+ 
+ AC_ARG_WITH(iconv,
+ 	[  --with-iconv[=LIBSPEC]   specify iconv library [default -liconv]],
+ 	iconvlib="$withval")
+ case "$iconvlib" in
+ no)
+ 	iconvlib=
+ 	;;
+ yes)
+ 	iconvlib=-liconv
+ 	;;
+ esac
+ 
+ AC_ARG_WITH(mdnlib,
+ 	[  --with-mdnlib=ARG    specify libmdn],
+ 	mdnlib="$withval", mdnlib="no")
+ if test "$mdnlib" = yes; then
+ 	AC_MSG_ERROR([You must specify ARG for --with-mdnlib.])
+ fi
+ 
+ if test "$use_mdn" != no; then
+ 	AC_DEFINE(WITH_MDN, 1, [define if mDNkit support is to be included.])
+ 	STD_CINCLUDES="$STD_CINCLUDES -I$mdn_path/include"
+ 	if test "$mdnlib" != no; then
+ 		LIBS="$mdnlib $iconvlib $LIBS"
+ 	else
+ 		LIBS="-L$mdn_path/lib -lmdn $iconvlib $LIBS"
+ 	fi
+ fi
+ AC_CHECK_HEADERS(locale.h)
+ AC_CHECK_FUNCS(setlocale)
+ 
+ #
  # Substitutions
  #
  AC_SUBST(BIND9_TOP_BUILDDIR)
Index: bin/dig/dig.c
diff -c mdn/othersrc/bind9/bin/dig/dig.c:1.1.1.7 mdn/othersrc/bind9/bin/dig/dig.c:1.6
*** bin/dig/dig.c	Tue Apr 17 14:17:04 2001
--- bin/dig/dig.c	Wed Aug 15 11:26:01 2001
***************
*** 1284,1289 ****
--- 1284,1294 ----
  		printgreeting(argc, argv, lookup);
  		ISC_LIST_APPEND(lookup_list, lookup, link);
  	}
+ 
+ #ifdef WITH_MDN
+ 		if (getenv(MDN_DISABLE_ENVVAR_NAME) != NULL)
+ 			lookup->mdn = ISC_FALSE;
+ #endif
  }
  
  /*
Index: bin/dig/dighost.c
diff -c mdn/othersrc/bind9/bin/dig/dighost.c:1.1.1.10 mdn/othersrc/bind9/bin/dig/dighost.c:1.23
*** bin/dig/dighost.c	Thu Jul 26 15:43:22 2001
--- bin/dig/dighost.c	Wed Aug 15 11:26:01 2001
***************
*** 33,38 ****
--- 33,49 ----
  #include <string.h>
  #include <limits.h>
  
+ #ifdef HAVE_LOCALE_H
+ #include <locale.h>
+ #endif
+ 
+ #ifdef WITH_MDN
+ #include <mdn/result.h>
+ #include <mdn/log.h>
+ #include <mdn/resconf.h>
+ #include <mdn/res.h>
+ #endif
+ 
  #include <dns/byaddr.h>
  #include <dns/fixedname.h>
  #include <dns/message.h>
***************
*** 135,140 ****
--- 146,165 ----
  dig_lookup_t *current_lookup = NULL;
  isc_uint32_t rr_limit = INT_MAX;
  
+ #ifdef WITH_MDN
+ mdn_resconf_t mdnconf;
+ 
+ static void		initialize_mdn(void);
+ static isc_result_t	output_filter(isc_buffer_t *buffer,
+ 				      unsigned int used_org,
+ 				      isc_boolean_t absolute);
+ static mdn_result_t	append_textname(char *name, const char *origin,
+ 					size_t namesize);
+ static void		mdn_check_result(mdn_result_t r, const char *msg);
+ 
+ #define MAXDLEN		256
+ #endif
+ 
  /*
   * Apply and clear locks at the event level in global task.
   * Can I get rid of these using shutdown events?  XXX
***************
*** 371,376 ****
--- 396,404 ----
  	looknew->ignore = ISC_FALSE;
  	looknew->servfail_stops = ISC_FALSE;
  	looknew->besteffort = ISC_TRUE;
+ #ifdef WITH_MDN
+ 	looknew->mdn = ISC_TRUE;
+ #endif
  	looknew->dnssec = ISC_FALSE;
  	looknew->udpsize = 0;
  	looknew->recurse = ISC_TRUE;
***************
*** 429,434 ****
--- 457,465 ----
  	looknew->ignore = lookold->ignore;
  	looknew->servfail_stops = lookold->servfail_stops;
  	looknew->besteffort = lookold->besteffort;
+ #ifdef WITH_MDN
+ 	looknew->mdn = lookold->mdn;
+ #endif
  	looknew->dnssec = lookold->dnssec;
  	looknew->udpsize = lookold->udpsize;
  	looknew->recurse = lookold->recurse;
***************
*** 697,702 ****
--- 728,737 ----
  		ISC_LIST_APPEND(server_list, srv, link);
  	}
  
+ #ifdef WITH_MDN
+ 	initialize_mdn();
+ #endif
+ 
  	if (keyfile[0] != 0)
  		setup_file_key();
  	else if (keysecret[0] != 0)
***************
*** 1232,1243 ****
--- 1267,1289 ----
  	isc_region_t r;
  	isc_buffer_t b;
  	char store[MXNAME];
+ #ifdef WITH_MDN
+ 	mdn_result_t mr;
+ 	char idn_textname[MXNAME], idn_origin[MXNAME], idn_tmp[MXNAME];
+ #endif
  
  	REQUIRE(lookup != NULL);
  	INSIST(!free_now);
  
  	debug("setup_lookup(%p)", lookup);
  
+ #ifdef WITH_MDN
+ 	if (lookup->mdn == ISC_TRUE)
+ 		dns_name_settotextfilter(output_filter);
+ 	else
+ 		dns_name_settotextfilter(NULL);
+ #endif
+ 
  	result = dns_message_create(mctx, DNS_MESSAGE_INTENTRENDER,
  				    &lookup->sendmsg);
  	check_result(result, "dns_message_create");
***************
*** 1291,1344 ****
  	}
  	if (lookup->origin != NULL) {
  		debug("trying origin %s", lookup->origin->origin);
! 		result = dns_message_gettempname(lookup->sendmsg,
! 						 &lookup->oname);
! 		check_result(result, "dns_message_gettempname");
! 		dns_name_init(lookup->oname, NULL);
! 		/* XXX Helper funct to conv char* to name? */
! 		len = strlen(lookup->origin->origin);
! 		isc_buffer_init(&b, lookup->origin->origin, len);
! 		isc_buffer_add(&b, len);
! 		result = dns_name_fromtext(lookup->oname, &b, dns_rootname,
! 					   ISC_FALSE, &lookup->onamebuf);
! 		if (result != ISC_R_SUCCESS) {
! 			dns_message_puttempname(lookup->sendmsg,
! 						&lookup->name);
! 			dns_message_puttempname(lookup->sendmsg,
! 						&lookup->oname);
! 			fatal("'%s' is not in legal name syntax (%s)",
! 			      lookup->origin->origin,
! 			      dns_result_totext(result));
! 		}
! 		if (lookup->trace_root) {
! 			dns_name_clone(dns_rootname, lookup->name);
  		} else {
! 			len = strlen(lookup->textname);
! 			isc_buffer_init(&b, lookup->textname, len);
  			isc_buffer_add(&b, len);
! 			result = dns_name_fromtext(lookup->name, &b,
! 						   lookup->oname, ISC_FALSE,
! 						   &lookup->namebuf);
! 		}
! 		if (result != ISC_R_SUCCESS) {
! 			dns_message_puttempname(lookup->sendmsg,
! 						&lookup->name);
  			dns_message_puttempname(lookup->sendmsg,
  						&lookup->oname);
- 			fatal("'%s' is not in legal name syntax (%s)",
- 			      lookup->textname, dns_result_totext(result));
  		}
- 		dns_message_puttempname(lookup->sendmsg, &lookup->oname);
  	} else {
  		debug("using root origin");
  		if (!lookup->trace_root) {
! 			len = strlen(lookup->textname);
! 			isc_buffer_init(&b, lookup->textname, len);
! 			isc_buffer_add(&b, len);
! 			result = dns_name_fromtext(lookup->name, &b,
! 						   dns_rootname,
! 						   ISC_FALSE,
! 						   &lookup->namebuf);
  		} else {
  			dns_name_clone(dns_rootname, lookup->name);
  		}
--- 1337,1464 ----
  	}
  	if (lookup->origin != NULL) {
  		debug("trying origin %s", lookup->origin->origin);
! #ifdef WITH_MDN
! 		if (lookup->mdn) {
! 			/*
! 			 * We cannot convert name and origin separately and
! 			 * combine them later, because some encoding scheme
! 			 * (such as UTF-5) can be applied only to an entire
! 			 * domain name, not a partial one.
! 			 */
! 			mr = mdn_res_nameconv(mdnconf, "l", lookup->textname,
! 					      idn_textname,
! 					      sizeof(idn_textname));
! 			mdn_check_result(mr, "convert textname to UCS");
! 			mr = mdn_res_nameconv(mdnconf, "l",
! 					      lookup->origin->origin,
! 					      idn_origin, sizeof(idn_origin));
! 			mdn_check_result(mr, "convert origin to UCS");
! 			mr = append_textname(idn_textname, idn_origin,
! 					     sizeof(idn_textname));
! 			mdn_check_result(mr, "append UCS origin to UCS "
! 					 "textname");
! 			mr = mdn_res_nameconv(mdnconf, "dMNI", idn_textname,
! 					      idn_tmp, sizeof(idn_tmp));
! 			mdn_check_result(mr, "convert UCS textname to IDN "
! 					 "encoding");
! 			strcpy(idn_textname, idn_tmp);
! 
! 			if (!lookup->trace_root) {
! 				len = strlen(idn_textname);
! 				isc_buffer_init(&b, idn_textname, len);
! 				isc_buffer_add(&b, len);
! 				result = dns_name_fromtext(lookup->name, &b,
! 							   dns_rootname,
! 							   ISC_FALSE,
! 							   &lookup->namebuf);
! 			} else {
! 				dns_name_clone(dns_rootname, lookup->name);
! 			}
! 			if (result != ISC_R_SUCCESS) {
! 				dns_message_puttempname(lookup->sendmsg,
! 							&lookup->name);
! 				isc_buffer_init(&b, store, MXNAME);
! 				fatal("'%s' is not a legal name syntax "
! 				      "(%s)", lookup->textname,
! 				      dns_result_totext(result));
! 			}
! #else /* WITH_MDN */
! 		if (0) {
! #endif /* WITH_MDN */
  		} else {
! 			result = dns_message_gettempname(lookup->sendmsg,
! 							 &lookup->oname);
! 			check_result(result, "dns_message_gettempname");
! 			dns_name_init(lookup->oname, NULL);
! 			/* XXX Helper funct to conv char* to name? */
! 			len = strlen(lookup->origin->origin);
! 			isc_buffer_init(&b, lookup->origin->origin, len);
  			isc_buffer_add(&b, len);
! 			result = dns_name_fromtext(lookup->oname, &b,
! 						   dns_rootname, ISC_FALSE,
! 						   &lookup->onamebuf);
! 			if (result != ISC_R_SUCCESS) {
! 				dns_message_puttempname(lookup->sendmsg,
! 							&lookup->name);
! 				dns_message_puttempname(lookup->sendmsg,
! 							&lookup->oname);
! 				fatal("'%s' is not in legal name syntax (%s)",
! 				      lookup->origin->origin,
! 				      dns_result_totext(result));
! 			}
! 			if (lookup->trace_root) {
! 				dns_name_clone(dns_rootname, lookup->name);
! 			} else {
! 				len = strlen(lookup->textname);
! 				isc_buffer_init(&b, lookup->textname, len);
! 				isc_buffer_add(&b, len);
! 				result = dns_name_fromtext(lookup->name, &b,
! 							   lookup->oname,
! 							   ISC_FALSE,
! 							   &lookup->namebuf);
! 			}
! 			if (result != ISC_R_SUCCESS) {
! 				dns_message_puttempname(lookup->sendmsg,
! 							&lookup->name);
! 				dns_message_puttempname(lookup->sendmsg,
! 							&lookup->oname);
! 				fatal("'%s' is not in legal name syntax (%s)",
! 				      lookup->textname,
! 				      dns_result_totext(result));
! 			}
  			dns_message_puttempname(lookup->sendmsg,
  						&lookup->oname);
  		}
  	} else {
  		debug("using root origin");
  		if (!lookup->trace_root) {
! #ifdef WITH_MDN
! 			if (lookup->mdn) {
! 				mr = mdn_res_nameconv(mdnconf, "ldMNI",
! 						      lookup->textname,
! 						      idn_textname,
! 						      sizeof(idn_textname));
! 				mdn_check_result(mr, "convert textname to "
! 						 "IDN encoding");
! 				len = strlen(idn_textname);
! 				isc_buffer_init(&b, idn_textname, len);
! 				isc_buffer_add(&b, len);
! 				result = dns_name_fromtext(lookup->name, &b,
! 							   dns_rootname,
! 							   ISC_FALSE,
! 							   &lookup->namebuf);
! #else /* WITH_MDN */
! 			if (0) {
! #endif /* WITH_MDN */
! 			} else {
! 				len = strlen(lookup->textname);
! 				isc_buffer_init(&b, lookup->textname, len);
! 				isc_buffer_add(&b, len);
! 				result = dns_name_fromtext(lookup->name, &b,
! 							   dns_rootname,
! 							   ISC_FALSE,
! 							   &lookup->namebuf);
! 			}
  		} else {
  			dns_name_clone(dns_rootname, lookup->name);
  		}
***************
*** 2763,2765 ****
--- 2883,2998 ----
  	if (mctx != NULL)
  		isc_mem_destroy(&mctx);
  }
+ 
+ #ifdef WITH_MDN
+ static void
+ initialize_mdn(void) {
+ 	mdn_result_t r;
+ 
+ #ifdef HAVE_SETLOCALE
+ 	/* Set locale */
+ 	(void)setlocale(LC_ALL, "");
+ #endif
+ 
+ 	/* General initialization. */
+ 	r = mdn_resconf_initialize();
+ 	if (r != mdn_success)
+ 		fatal("mdn initialization failed: %s",
+ 		      mdn_result_tostring(r));
+ 
+ 	/* Create configuration context. */
+ 	r = mdn_resconf_create(&mdnconf);
+ 	if (r != mdn_success)
+ 		fatal("mdn resconf initialization failed: %s",
+ 		      mdn_result_tostring(r));
+ 
+ 
+ 	/* Load mdn configuration file. */
+ 	r = mdn_resconf_loadfile(mdnconf, NULL);
+ 	if (r != mdn_success)
+ 		fatal("mdn configuration loading failed: %s",
+ 		      mdn_result_tostring(r));
+ 
+ 	/* Set domain name -> text post-conversion filter. */
+ 	dns_name_settotextfilter(output_filter);
+ }
+ 
+ static isc_result_t
+ output_filter(isc_buffer_t *buffer, unsigned int used_org,
+ 	      isc_boolean_t absolute)
+ {
+ 	char tmp1[MAXDLEN], tmp2[MAXDLEN];
+ 	size_t fromlen, tolen;
+ 	isc_boolean_t end_with_dot;
+ 
+ 	/*
+ 	 * Copy contents of 'buffer' to 'tmp1', supply trailing dot
+ 	 * if 'absolute' is true, and terminate with NUL.
+ 	 */
+ 	fromlen = isc_buffer_usedlength(buffer) - used_org;
+ 	if (fromlen >= MAXDLEN)
+ 		return (ISC_R_SUCCESS);
+ 	memcpy(tmp1, (char *)isc_buffer_base(buffer) + used_org, fromlen);
+ 	end_with_dot = (tmp1[fromlen - 1] == '.') ? ISC_TRUE : ISC_FALSE;
+ 	if (absolute && !end_with_dot) {
+ 		fromlen++;
+ 		if (fromlen >= MAXDLEN)
+ 			return (ISC_R_SUCCESS);
+ 		tmp1[fromlen - 1] = '.';
+ 	}
+ 	tmp1[fromlen] = '\0';
+ 
+ 	/*
+ 	 * Convert contents of 'tmp1' to local encoding.
+ 	 */
+ 	if (mdn_res_nameconv(mdnconf, "i!NL", tmp1, tmp2, MAXDLEN)
+ 	    != mdn_success)
+ 		return (ISC_R_SUCCESS);
+ 	strcpy(tmp1, tmp2);
+ 
+ 	/*
+ 	 * Copy the converted contents in 'tmp1' back to 'buffer'.
+ 	 * If we have appended trailing dot, remove it.
+ 	 */
+ 	tolen = strlen(tmp1);
+ 	if (absolute && !end_with_dot && tmp1[tolen - 1] == '.')
+ 		tolen--;
+ 
+ 	if (isc_buffer_length(buffer) < used_org + tolen)
+ 		return (ISC_R_NOSPACE);
+ 
+ 	isc_buffer_subtract(buffer, isc_buffer_usedlength(buffer) - used_org);
+ 	memcpy(isc_buffer_used(buffer), tmp1, tolen);
+ 	isc_buffer_add(buffer, tolen);
+ 
+ 	return (ISC_R_SUCCESS);
+ }
+ 
+ static mdn_result_t
+ append_textname(char *name, const char *origin, size_t namesize) {
+ 	size_t namelen = strlen(name);
+ 	size_t originlen = strlen(origin);
+ 
+ 	/* Already absolute? */
+ 	if (namelen > 0 && name[namelen - 1] == '.')
+ 		return mdn_success;
+ 
+ 	/* Append dot and origin */
+ 
+ 	if (namelen + 1 + originlen >= namesize)
+ 		return mdn_buffer_overflow;
+ 
+ 	name[namelen++] = '.';
+ 	(void)strcpy(name + namelen, origin);
+ 	return mdn_success;
+ }
+ 
+ static void
+ mdn_check_result(mdn_result_t r, const char *msg) {
+ 	if (r != mdn_success) {
+ 		exitcode = 1;
+ 		fatal("%s: %s", msg, mdn_result_tostring(r));
+ 	}
+ }
+ 
+ #endif /* WITH_MDN */
Index: bin/dig/host.c
diff -c mdn/othersrc/bind9/bin/dig/host.c:1.1.1.7 mdn/othersrc/bind9/bin/dig/host.c:1.6
*** bin/dig/host.c	Tue Apr 17 14:17:05 2001
--- bin/dig/host.c	Wed Aug 15 11:26:01 2001
***************
*** 669,674 ****
--- 669,679 ----
  	lookup->new_search = ISC_TRUE;
  	ISC_LIST_APPEND(lookup_list, lookup, link);
  
+ #ifdef WITH_MDN
+ 	if (getenv(MDN_DISABLE_ENVVAR_NAME) != NULL)
+ 		lookup->mdn = ISC_FALSE;
+ #endif
+ 
  	usesearch = ISC_TRUE;
  }
  
Index: bin/dig/nslookup.c
diff -c mdn/othersrc/bind9/bin/dig/nslookup.c:1.1.1.7 mdn/othersrc/bind9/bin/dig/nslookup.c:1.6
*** bin/dig/nslookup.c	Tue Apr 17 14:17:05 2001
--- bin/dig/nslookup.c	Wed Aug 15 11:26:01 2001
***************
*** 766,771 ****
--- 766,775 ----
  	ISC_LIST_APPEND(lookup_list, lookup, link);
  	lookup->origin = NULL;
  	ISC_LIST_INIT(lookup->my_server_list);
+ #ifdef WITH_MDN
+ 	if (getenv(MDN_DISABLE_ENVVAR_NAME) != NULL)
+ 		lookup->mdn = ISC_FALSE;
+ #endif
  	debug("looking up %s", lookup->textname);
  }
  
Index: bin/dig/include/dig/dig.h
diff -c mdn/othersrc/bind9/bin/dig/include/dig/dig.h:1.1.1.5 mdn/othersrc/bind9/bin/dig/include/dig/dig.h:1.6
*** bin/dig/include/dig/dig.h	Fri Jan 19 11:58:37 2001
--- bin/dig/include/dig/dig.h	Wed Aug 15 11:26:01 2001
***************
*** 69,74 ****
--- 69,81 ----
   * be 1.
   */
  
+ /*
+  * Name of environment variable which disables MDN support if defined.
+  */
+ #ifdef WITH_MDN
+ #define MDN_DISABLE_ENVVAR_NAME "MDN_DISABLE"
+ #endif
+ 
  ISC_LANG_BEGINDECLS
  
  typedef struct dig_lookup dig_lookup_t;
***************
*** 103,108 ****
--- 110,118 ----
  		servfail_stops,
  		new_search,
  		besteffort,
+ #ifdef WITH_MDN
+ 		mdn,
+ #endif
  		dnssec;
  	char textname[MXNAME]; /* Name we're going to be looking up */
  	char cmdline[MXNAME];
Index: doc/man/bin/dig.1
diff -c mdn/othersrc/bind9/doc/man/bin/dig.1:1.1.1.4 mdn/othersrc/bind9/doc/man/bin/dig.1:1.2
*** doc/man/bin/dig.1	Thu Jul 26 15:44:12 2001
--- doc/man/bin/dig.1	Wed Aug 22 13:20:44 2001
***************
*** 450,455 ****
--- 450,469 ----
  will not print the initial query when it looks up the
  NS records for
  .Dv isc.org .
+ .Sh MDN SUPPORT
+ If
+ .Nm dig
+ has been built with mdn support, it can accept and display non-ASCII
+ domain names.
+ .Nm dig
+ appropriately converts character encoding of domain name before sending
+ a request to DNS server or displaying a reply from the server.
+ If you'd like to turn off the MDN support for some reason, defines the
+ .Ar MDN_DISABLE
+ environment variable.
+ The MDN support is disabled if the the variable is set when 
+ .Nm dig
+ runs.
  .Sh FILES
  .Pa /etc/resolv.conf
  .Sh SEE ALSO
Index: doc/man/bin/host.1
diff -c mdn/othersrc/bind9/doc/man/bin/host.1:1.1.1.4 mdn/othersrc/bind9/doc/man/bin/host.1:1.2
*** doc/man/bin/host.1	Thu Jul 26 15:44:12 2001
--- doc/man/bin/host.1	Wed Aug 22 13:20:44 2001
***************
*** 206,211 ****
--- 206,225 ----
  will effectively wait forever for a reply.
  The time to wait for a response will be set to the number of seconds
  given by the hardware's maximum value for an integer quantity.
+ .Sh MDN SUPPORT
+ If
+ .Nm host
+ has been built with mdn support, it can accept and display non-ASCII
+ domain names.
+ .Nm host
+ appropriately converts character encoding of domain name before sending
+ a request to DNS server or displaying a reply from the server.
+ If you'd like to turn off the MDN support for some reason, defines the
+ .Ar MDN_DISABLE
+ environment variable.
+ The MDN support is disabled if the the variable is set when 
+ .Nm host
+ runs.
  .Sh FILES
  .Pa /etc/resolv.conf
  .Sh SEE ALSO
Index: lib/dns/name.c
diff -c mdn/othersrc/bind9/lib/dns/name.c:1.1.1.8 mdn/othersrc/bind9/lib/dns/name.c:1.11
*** lib/dns/name.c	Thu Jul 26 15:44:38 2001
--- lib/dns/name.c	Thu Jul 26 16:44:21 2001
***************
*** 205,210 ****
--- 205,217 ----
  /* XXXDCL make const? */
  dns_name_t *dns_wildcardname = &wild.name;
  
+ #ifdef WITH_MDN
+ /*
+  * dns_name_t to text post-conversion procedure.
+  */
+ static dns_name_totextfilter_t totext_filter_proc = NULL;
+ #endif
+ 
  static void
  set_offsets(const dns_name_t *name, unsigned char *offsets,
  	    dns_name_t *set_name);
***************
*** 1705,1710 ****
--- 1712,1720 ----
  	unsigned int labels;
  	isc_boolean_t saw_root = ISC_FALSE;
  	char num[4];
+ #ifdef WITH_MDN
+ 	unsigned int oused = target->used;
+ #endif
  
  	/*
  	 * This function assumes the name is in proper uncompressed
***************
*** 1882,1887 ****
--- 1892,1901 ----
  
  	isc_buffer_add(target, tlen - trem);
  
+ #ifdef WITH_MDN
+ 	if (totext_filter_proc != NULL)
+ 		return ((*totext_filter_proc)(target, oused, saw_root));
+ #endif
  	return (ISC_R_SUCCESS);
  }
  
***************
*** 3153,3155 ****
--- 3167,3176 ----
  	} else
  		snprintf(cp, size, "<unknown>");
  }
+ 
+ #ifdef WITH_MDN
+ void
+ dns_name_settotextfilter(dns_name_totextfilter_t proc) {
+ 	totext_filter_proc = proc;
+ }
+ #endif
Index: lib/dns/include/dns/name.h
diff -c mdn/othersrc/bind9/lib/dns/include/dns/name.h:1.1.1.5 mdn/othersrc/bind9/lib/dns/include/dns/name.h:1.7
*** lib/dns/include/dns/name.h	Tue Apr 17 14:18:27 2001
--- lib/dns/include/dns/name.h	Thu Apr 26 13:54:43 2001
***************
*** 217,222 ****
--- 217,233 ----
   */
  #define DNS_NAME_MAXWIRE 255
  
+ #ifdef WITH_MDN
+ /*
+  * Text output filter procedure.
+  * 'target' is the buffer to be converted.  The region to be converted
+  * is from 'buffer'->base + 'used_org' to the end of the used region.
+  */
+ typedef isc_result_t (*dns_name_totextfilter_t)(isc_buffer_t *target,
+ 						unsigned int used_org,
+ 						isc_boolean_t absolute);
+ #endif
+ 
  /***
   *** Initialization
   ***/
***************
*** 1215,1220 ****
--- 1226,1239 ----
   *	'size' > 0.
   *
   */
+ 
+ #ifdef WITH_MDN
+ void
+ dns_name_settotextfilter(dns_name_totextfilter_t proc);
+ /*
+  * Call 'proc' at the end of dns_name_totext.
+  */
+ #endif /* WITH_MDN */
  
  #define DNS_NAME_FORMATSIZE (DNS_NAME_MAXTEXT + 1)
  /*
