--- embedaddon/bird/configure	2017/08/22 12:33:54	1.1.1.1
+++ embedaddon/bird/configure	2021/03/17 19:50:23	1.1.1.2
@@ -1,5 +1,4 @@
 #! /bin/sh
-# From configure.in Id.
 # Guess values for system-dependent variables and create Makefiles.
 # Generated by GNU Autoconf 2.69.
 #
@@ -584,6 +583,7 @@ PACKAGE_BUGREPORT=
 PACKAGE_URL=
 
 ac_unique_file="conf/confbase.Y"
+ac_header_list=
 # Factoring default headers for most tests.
 ac_includes_default="\
 #include <stdio.h>
@@ -652,7 +652,6 @@ CC
 CONTROL_SOCKET
 CONFIG_FILE
 SUFFIX
-runtimedir
 srcdir_rel_mf
 exedir
 objdir
@@ -678,6 +677,7 @@ infodir
 docdir
 oldincludedir
 includedir
+runstatedir
 localstatedir
 sharedstatedir
 sysconfdir
@@ -700,15 +700,14 @@ SHELL'
 ac_subst_files=''
 ac_user_opts='
 enable_option_checking
-enable_debug
-enable_memcheck
 enable_client
+enable_debug
 enable_ipv6
+enable_memcheck
 enable_pthreads
+with_protocols
 with_suffix
 with_sysconfig
-with_protocols
-with_sysinclude
 with_runtimedir
 with_iproutedir
 '
@@ -762,6 +761,7 @@ datadir='${datarootdir}'
 sysconfdir='${prefix}/etc'
 sharedstatedir='${prefix}/com'
 localstatedir='${prefix}/var'
+runstatedir='${localstatedir}/run'
 includedir='${prefix}/include'
 oldincludedir='/usr/include'
 docdir='${datarootdir}/doc/${PACKAGE}'
@@ -1014,6 +1014,15 @@ do
   | -silent | --silent | --silen | --sile | --sil)
     silent=yes ;;
 
+  -runstatedir | --runstatedir | --runstatedi | --runstated \
+  | --runstate | --runstat | --runsta | --runst | --runs \
+  | --run | --ru | --r)
+    ac_prev=runstatedir ;;
+  -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
+  | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \
+  | --run=* | --ru=* | --r=*)
+    runstatedir=$ac_optarg ;;
+
   -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
     ac_prev=sbindir ;;
   -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
@@ -1151,7 +1160,7 @@ fi
 for ac_var in	exec_prefix prefix bindir sbindir libexecdir datarootdir \
 		datadir sysconfdir sharedstatedir localstatedir includedir \
 		oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
-		libdir localedir mandir
+		libdir localedir mandir runstatedir
 do
   eval ac_val=\$$ac_var
   # Remove trailing slashes.
@@ -1304,6 +1313,7 @@ Fine tuning of the installation directories:
   --sysconfdir=DIR        read-only single-machine data [PREFIX/etc]
   --sharedstatedir=DIR    modifiable architecture-independent data [PREFIX/com]
   --localstatedir=DIR     modifiable single-machine data [PREFIX/var]
+  --runstatedir=DIR       modifiable per-process data [LOCALSTATEDIR/run]
   --libdir=DIR            object code libraries [EPREFIX/lib]
   --includedir=DIR        C header files [PREFIX/include]
   --oldincludedir=DIR     C header files for non-gcc [/usr/include]
@@ -1335,22 +1345,22 @@ Optional Features:
   --disable-option-checking  ignore unrecognized --enable/--with options
   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
-  --enable-debug          enable internal debugging routines (default: disabled)
-  --enable-memcheck       check memory allocations when debugging (default: enabled)
-  --enable-client         enable building of BIRD client (default: enabled)
-  --enable-ipv6           enable building of IPv6 version (default: disabled)
-  --enable-pthreads       enable POSIX threads support (default: detect)
+  --enable-client         enable building of BIRD client [yes]
+  --enable-debug          enable internal debugging routines [no]
+  --enable-ipv6           enable building of IPv6 version [no]
+  --enable-memcheck       check memory allocations when debugging [yes]
+  --enable-pthreads       enable POSIX threads support [try]
 
 Optional Packages:
   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
-  --with-suffix=STRING    use specified suffix for BIRD files (default: 6 for IPv6 version)
+  --with-protocols=LIST   include specified routing protocols [all]
+  --with-suffix=STRING    use specified suffix for BIRD files [6 for IPv6]
   --with-sysconfig=FILE   use specified BIRD system configuration file
-  --with-protocols=LIST   include specified routing protocols (default: all)
-  --with-sysinclude=PATH  search for system includes on specified place
-  --with-runtimedir=PATH  path for runtime files (default: $(localstatedir)/run)
-  --with-iproutedir=PATH  path to iproute2 config files (default: /etc/iproute2)
 
+  --with-runtimedir=PATH  run-state data, obsolete variant of --runstatedir
+  --with-iproutedir=PATH  path to iproute2 config files [/etc/iproute2]
+
 Some influential environment variables:
   FLEX        location of the Flex program
   BISON       location of the Bison program
@@ -1596,93 +1606,6 @@ $as_echo "$ac_res" >&6; }
 
 } # ac_fn_c_check_header_compile
 
-# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES
-# -------------------------------------------------------
-# Tests whether HEADER exists, giving a warning if it cannot be compiled using
-# the include files in INCLUDES and setting the cache variable VAR
-# accordingly.
-ac_fn_c_check_header_mongrel ()
-{
-  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
-  if eval \${$3+:} false; then :
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
-$as_echo_n "checking for $2... " >&6; }
-if eval \${$3+:} false; then :
-  $as_echo_n "(cached) " >&6
-fi
-eval ac_res=\$$3
-	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-else
-  # Is the header compilable?
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5
-$as_echo_n "checking $2 usability... " >&6; }
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-$4
-#include <$2>
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  ac_header_compiler=yes
-else
-  ac_header_compiler=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5
-$as_echo "$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5
-$as_echo_n "checking $2 presence... " >&6; }
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <$2>
-_ACEOF
-if ac_fn_c_try_cpp "$LINENO"; then :
-  ac_header_preproc=yes
-else
-  ac_header_preproc=no
-fi
-rm -f conftest.err conftest.i conftest.$ac_ext
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5
-$as_echo "$ac_header_preproc" >&6; }
-
-# So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #((
-  yes:no: )
-    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5
-$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
-$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
-    ;;
-  no:yes:* )
-    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5
-$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;}
-    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2:     check for missing prerequisite headers?" >&5
-$as_echo "$as_me: WARNING: $2:     check for missing prerequisite headers?" >&2;}
-    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5
-$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;}
-    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2:     section \"Present But Cannot Be Compiled\"" >&5
-$as_echo "$as_me: WARNING: $2:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
-$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
-    ;;
-esac
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
-$as_echo_n "checking for $2... " >&6; }
-if eval \${$3+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  eval "$3=\$ac_header_compiler"
-fi
-eval ac_res=\$$3
-	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-fi
-  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
-
-} # ac_fn_c_check_header_mongrel
-
 # ac_fn_c_try_run LINENO
 # ----------------------
 # Try to link conftest.$ac_ext, and return whether this succeeded. Assumes
@@ -1725,188 +1648,62 @@ fi
 
 } # ac_fn_c_try_run
 
-# ac_fn_c_compute_int LINENO EXPR VAR INCLUDES
-# --------------------------------------------
-# Tries to find the compile-time value of EXPR in a program that includes
-# INCLUDES, setting VAR accordingly. Returns whether the value could be
-# computed
-ac_fn_c_compute_int ()
+# ac_fn_c_check_member LINENO AGGR MEMBER VAR INCLUDES
+# ----------------------------------------------------
+# Tries to find if the field MEMBER exists in type AGGR, after including
+# INCLUDES, setting cache variable VAR accordingly.
+ac_fn_c_check_member ()
 {
   as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
-  if test "$cross_compiling" = yes; then
-    # Depending upon the size, compute the lo and hi bounds.
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-$4
-int
-main ()
-{
-static int test_array [1 - 2 * !(($2) >= 0)];
-test_array [0] = 0;
-return test_array [0];
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  ac_lo=0 ac_mid=0
-  while :; do
-    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-$4
-int
-main ()
-{
-static int test_array [1 - 2 * !(($2) <= $ac_mid)];
-test_array [0] = 0;
-return test_array [0];
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  ac_hi=$ac_mid; break
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2.$3" >&5
+$as_echo_n "checking for $2.$3... " >&6; }
+if eval \${$4+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
-  as_fn_arith $ac_mid + 1 && ac_lo=$as_val
-			if test $ac_lo -le $ac_mid; then
-			  ac_lo= ac_hi=
-			  break
-			fi
-			as_fn_arith 2 '*' $ac_mid + 1 && ac_mid=$as_val
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-  done
-else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-$4
+$5
 int
 main ()
 {
-static int test_array [1 - 2 * !(($2) < 0)];
-test_array [0] = 0;
-return test_array [0];
-
+static $2 ac_aggr;
+if (ac_aggr.$3)
+return 0;
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_compile "$LINENO"; then :
-  ac_hi=-1 ac_mid=-1
-  while :; do
-    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-$4
-int
-main ()
-{
-static int test_array [1 - 2 * !(($2) >= $ac_mid)];
-test_array [0] = 0;
-return test_array [0];
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  ac_lo=$ac_mid; break
+  eval "$4=yes"
 else
-  as_fn_arith '(' $ac_mid ')' - 1 && ac_hi=$as_val
-			if test $ac_mid -le $ac_hi; then
-			  ac_lo= ac_hi=
-			  break
-			fi
-			as_fn_arith 2 '*' $ac_mid && ac_mid=$as_val
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-  done
-else
-  ac_lo= ac_hi=
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-# Binary search between lo and hi bounds.
-while test "x$ac_lo" != "x$ac_hi"; do
-  as_fn_arith '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo && ac_mid=$as_val
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-$4
+$5
 int
 main ()
 {
-static int test_array [1 - 2 * !(($2) <= $ac_mid)];
-test_array [0] = 0;
-return test_array [0];
-
+static $2 ac_aggr;
+if (sizeof ac_aggr.$3)
+return 0;
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_compile "$LINENO"; then :
-  ac_hi=$ac_mid
+  eval "$4=yes"
 else
-  as_fn_arith '(' $ac_mid ')' + 1 && ac_lo=$as_val
+  eval "$4=no"
 fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-done
-case $ac_lo in #((
-?*) eval "$3=\$ac_lo"; ac_retval=0 ;;
-'') ac_retval=1 ;;
-esac
-  else
-    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-$4
-static long int longval () { return $2; }
-static unsigned long int ulongval () { return $2; }
-#include <stdio.h>
-#include <stdlib.h>
-int
-main ()
-{
-
-  FILE *f = fopen ("conftest.val", "w");
-  if (! f)
-    return 1;
-  if (($2) < 0)
-    {
-      long int i = longval ();
-      if (i != ($2))
-	return 1;
-      fprintf (f, "%ld", i);
-    }
-  else
-    {
-      unsigned long int i = ulongval ();
-      if (i != ($2))
-	return 1;
-      fprintf (f, "%lu", i);
-    }
-  /* Do not output a trailing newline, as this causes \r\n confusion
-     on some platforms.  */
-  return ferror (f) || fclose (f) != 0;
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  echo >>conftest.val; read $3 <conftest.val; ac_retval=0
-else
-  ac_retval=1
 fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
-rm -f conftest.val
-
-  fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+eval ac_res=\$$4
+	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
   eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
-  as_fn_set_status $ac_retval
 
-} # ac_fn_c_compute_int
+} # ac_fn_c_check_member
 cat >config.log <<_ACEOF
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
@@ -2191,6 +1988,8 @@ $as_echo "$as_me: creating cache $cache_file" >&6;}
   >$cache_file
 fi
 
+as_fn_append ac_header_list " alloca.h"
+as_fn_append ac_header_list " syslog.h"
 # Check that the precious variables saved in the cache have kept the same
 # value.
 ac_cache_corrupted=false
@@ -2259,6 +2058,7 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $
 ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 
+
 ac_aux_dir=
 for ac_dir in tools "$srcdir"/tools; do
   if test -f "$ac_dir/install-sh"; then
@@ -2289,79 +2089,89 @@ ac_configure="$SHELL $ac_aux_dir/configure"  # Please 
 
 
 
+# Check whether --enable-client was given.
+if test "${enable_client+set}" = set; then :
+  enableval=$enable_client;
+else
+  enable_client=yes
+
+fi
+
+
 # Check whether --enable-debug was given.
 if test "${enable_debug+set}" = set; then :
   enableval=$enable_debug;
 else
   enable_debug=no
-fi
 
-# Check whether --enable-memcheck was given.
-if test "${enable_memcheck+set}" = set; then :
-  enableval=$enable_memcheck;
-else
-  enable_memcheck=yes
 fi
 
-# Check whether --enable-client was given.
-if test "${enable_client+set}" = set; then :
-  enableval=$enable_client;
-else
-  enable_client=yes
-fi
 
 # Check whether --enable-ipv6 was given.
 if test "${enable_ipv6+set}" = set; then :
   enableval=$enable_ipv6;
 else
   enable_ipv6=no
+
 fi
 
+
+# Check whether --enable-memcheck was given.
+if test "${enable_memcheck+set}" = set; then :
+  enableval=$enable_memcheck;
+else
+  enable_memcheck=yes
+
+fi
+
+
 # Check whether --enable-pthreads was given.
 if test "${enable_pthreads+set}" = set; then :
   enableval=$enable_pthreads;
 else
   enable_pthreads=try
-fi
 
-
-# Check whether --with-suffix was given.
-if test "${with_suffix+set}" = set; then :
-  withval=$with_suffix; given_suffix="yes"
 fi
 
 
-# Check whether --with-sysconfig was given.
-if test "${with_sysconfig+set}" = set; then :
-  withval=$with_sysconfig;
-fi
 
-
 # Check whether --with-protocols was given.
 if test "${with_protocols+set}" = set; then :
   withval=$with_protocols;
 else
   with_protocols="all"
+
 fi
 
 
-# Check whether --with-sysinclude was given.
-if test "${with_sysinclude+set}" = set; then :
-  withval=$with_sysinclude;
+
+# Check whether --with-suffix was given.
+if test "${with_suffix+set}" = set; then :
+  withval=$with_suffix; given_suffix="yes"
+
 fi
 
 
+
+# Check whether --with-sysconfig was given.
+if test "${with_sysconfig+set}" = set; then :
+  withval=$with_sysconfig;
+fi
+
+
+
 # Check whether --with-runtimedir was given.
 if test "${with_runtimedir+set}" = set; then :
-  withval=$with_runtimedir; runtimedir="$with_runtimedir"
-else
-  runtimedir="\$(localstatedir)/run"
+  withval=$with_runtimedir; runstatedir="$with_runtimedir"
+
 fi
 
 
+
 # Check whether --with-iproutedir was given.
 if test "${with_iproutedir+set}" = set; then :
   withval=$with_iproutedir; given_iproutedir="yes"
+
 fi
 
 
@@ -2369,49 +2179,58 @@ fi
 
 
 
+
 if test "$srcdir" = . ; then
-	# Building in current directory => create obj directory holding all objects
-	objdir=obj
-	mkdir -p obj
-	srcdir_rel=..
-	makefiles="Makefile:tools/Makefile-top.in obj/Makefile:tools/Makefile.in obj/Rules:tools/Rules.in"
-	exedir=..
+  # Building in current directory => create obj directory holding all objects
+  objdir=obj
+  mkdir -p obj
+  srcdir_rel=..
+  makefiles="Makefile:tools/Makefile-top.in obj/Makefile:tools/Makefile.in obj/Rules:tools/Rules.in"
+  exedir=..
 else
-	# Building in separate directory
-	objdir=.
-	srcdir_rel=$srcdir
-	makefiles="Makefile:tools/Makefile.in Rules:tools/Rules.in"
-	exedir=.
+  # Building in separate directory
+  objdir=.
+  srcdir_rel=$srcdir
+  makefiles="Makefile:tools/Makefile.in Rules:tools/Rules.in"
+  exedir=.
 fi
+
 case $srcdir_rel in
-	/*)	srcdir_rel_mf=$srcdir_rel ;;
-	*)	srcdir_rel_mf="\$(root-rel)$srcdir_rel" ;;
+  /*)	srcdir_rel_mf=$srcdir_rel ;;
+  *)	srcdir_rel_mf="\$(root-rel)$srcdir_rel" ;;
 esac
 
 
 
 
 
+# Workaround for older Autoconfs that do not define runstatedir
+if test -z "${runstatedir}"; then :
+  runstatedir='${localstatedir}/run'
+fi
+
+
+
 if test "$enable_ipv6" = yes ; then
-	ip=ipv6
-	SUFFIX=6
-	proto_radv=radv
+  ip=ipv6
+  SUFFIX=6
+  proto_radv=radv
 else
-	ip=ipv4
-	SUFFIX=""
+  ip=ipv4
+  SUFFIX=""
 fi
 
 if test "$given_suffix" = yes ; then
-   	SUFFIX="$with_suffix"
+  SUFFIX="$with_suffix"
 fi
 
 
 if test "$enable_debug" = yes ; then
-	CONFIG_FILE="bird$SUFFIX.conf"
-	CONTROL_SOCKET="bird$SUFFIX.ctl"
+  CONFIG_FILE="bird$SUFFIX.conf"
+  CONTROL_SOCKET="bird$SUFFIX.ctl"
 else
-	CONFIG_FILE="\$(sysconfdir)/bird$SUFFIX.conf"
-	CONTROL_SOCKET="$runtimedir/bird$SUFFIX.ctl"
+  CONFIG_FILE="\$(sysconfdir)/bird$SUFFIX.conf"
+  CONTROL_SOCKET="\$(runstatedir)/bird$SUFFIX.ctl"
 fi
 
 
@@ -3230,7 +3049,7 @@ return clock_gettime ();
   return 0;
 }
 _ACEOF
-for ac_lib in '' c rt posix4; do
+for ac_lib in '' rt posix4; do
   if test -z "$ac_lib"; then
     ac_res="none required"
   else
@@ -3262,6 +3081,7 @@ if test "$ac_res" != no; then :
 
 else
   as_fn_error $? "Function clock_gettime not available." "$LINENO" 5
+
 fi
 
 
@@ -3339,7 +3159,7 @@ case $host_os in *\ *) host_os=`echo "$host_os" | sed 
 
 # Store this value because ac_test_CFLAGS is overwritten by AC_PROG_CC
 if test "$ac_test_CFLAGS" != set ; then
-	bird_cflags_default=yes
+  bird_cflags_default=yes
 fi
 
 ac_ext=c
@@ -3882,45 +3702,49 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $
 ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 if test -z "$GCC" ; then
-	as_fn_error $? "This program requires the GNU C Compiler." "$LINENO" 5
+  as_fn_error $? "This program requires the GNU C Compiler." "$LINENO" 5
 fi
 
-# Enable threads by default just in Linux and FreeBSD
-#if test "$enable_pthreads" = try ; then
-#	case "$host_os" in
-#		(linux* | freebsd* | openbsd* | netbsd* )	enable_pthreads=try ;;
-#		(*)				enable_pthreads=no ;;
-#	esac
-#fi
-
 if test "$enable_pthreads" != no ; then
 
   bird_tmp_cflags="$CFLAGS"
-
   CFLAGS="$CFLAGS -pthread"
+
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether POSIX threads are available" >&5
 $as_echo_n "checking whether POSIX threads are available... " >&6; }
 if ${bird_cv_lib_pthreads+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+
+      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-#include <pthread.h>
+
+	   #include <pthread.h>
 int
 main ()
 {
-pthread_t pt; pthread_create(&pt, NULL, NULL, NULL); pthread_spinlock_t lock; pthread_spin_lock(&lock);
+
+	      pthread_t pt;
+	      pthread_create(&pt, NULL, NULL, NULL);
+	      pthread_spinlock_t lock;
+	      pthread_spin_lock(&lock);
+
+
   ;
   return 0;
 }
+
 _ACEOF
 if ac_fn_c_try_link "$LINENO"; then :
   bird_cv_lib_pthreads=yes
 else
   bird_cv_lib_pthreads=no
+
 fi
 rm -f core conftest.err conftest.$ac_objext \
     conftest$ac_exeext conftest.$ac_ext
+
+
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $bird_cv_lib_pthreads" >&5
 $as_echo "$bird_cv_lib_pthreads" >&6; }
@@ -3928,32 +3752,34 @@ $as_echo "$bird_cv_lib_pthreads" >&6; }
   CFLAGS="$bird_tmp_cflags"
 
 
-	if test "$bird_cv_lib_pthreads" = yes ; then
-		$as_echo "#define USE_PTHREADS 1" >>confdefs.h
+  if test "$bird_cv_lib_pthreads" = yes ; then
 
-		CFLAGS="$CFLAGS -pthread"
-		LDFLAGS="$LDFLAGS -pthread"
-		proto_bfd=bfd
-	elif test "$enable_pthreads" = yes ; then
-		as_fn_error $? "POSIX threads not available." "$LINENO" 5
-	fi
+$as_echo "#define USE_PTHREADS 1" >>confdefs.h
 
-	if test "$enable_pthreads" = try ; then
-		enable_pthreads="$bird_cv_lib_pthreads"
-	fi
+    CFLAGS="$CFLAGS -pthread"
+    LDFLAGS="$LDFLAGS -pthread"
+    proto_bfd=bfd
+  elif test "$enable_pthreads" = yes ; then
+    as_fn_error $? "POSIX threads not available." "$LINENO" 5
+  fi
+
+  if test "$enable_pthreads" = try ; then
+    enable_pthreads="$bird_cv_lib_pthreads"
+  fi
 fi
 
 if test "$bird_cflags_default" = yes ; then
 
   bird_tmp_cflags="$CFLAGS"
-
   CFLAGS="-Wall -Wno-pointer-sign"
+
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether CC supports -Wno-pointer-sign" >&5
 $as_echo_n "checking whether CC supports -Wno-pointer-sign... " >&6; }
 if ${bird_cv_c_option_wno_pointer_sign+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+
+      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 int
@@ -3968,8 +3794,11 @@ if ac_fn_c_try_compile "$LINENO"; then :
   bird_cv_c_option_wno_pointer_sign=yes
 else
   bird_cv_c_option_wno_pointer_sign=no
+
 fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $bird_cv_c_option_wno_pointer_sign" >&5
 $as_echo "$bird_cv_c_option_wno_pointer_sign" >&6; }
@@ -3978,14 +3807,15 @@ $as_echo "$bird_cv_c_option_wno_pointer_sign" >&6; }
 
 
   bird_tmp_cflags="$CFLAGS"
-
   CFLAGS="-Wall -Wextra -Wno-missing-field-initializers"
+
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether CC supports -Wno-missing-field-initializers" >&5
 $as_echo_n "checking whether CC supports -Wno-missing-field-initializers... " >&6; }
 if ${bird_cv_c_option_wno_missing_init+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+
+      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 int
@@ -4000,8 +3830,11 @@ if ac_fn_c_try_compile "$LINENO"; then :
   bird_cv_c_option_wno_missing_init=yes
 else
   bird_cv_c_option_wno_missing_init=no
+
 fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $bird_cv_c_option_wno_missing_init" >&5
 $as_echo "$bird_cv_c_option_wno_missing_init" >&6; }
@@ -4010,14 +3843,15 @@ $as_echo "$bird_cv_c_option_wno_missing_init" >&6; }
 
 
   bird_tmp_cflags="$CFLAGS"
-
   CFLAGS=" -fno-strict-aliasing"
+
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether CC supports -fno-strict-aliasing" >&5
 $as_echo_n "checking whether CC supports -fno-strict-aliasing... " >&6; }
 if ${bird_cv_c_option_fno_strict_aliasing+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+
+      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 int
@@ -4032,8 +3866,11 @@ if ac_fn_c_try_compile "$LINENO"; then :
   bird_cv_c_option_fno_strict_aliasing=yes
 else
   bird_cv_c_option_fno_strict_aliasing=no
+
 fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $bird_cv_c_option_fno_strict_aliasing" >&5
 $as_echo "$bird_cv_c_option_fno_strict_aliasing" >&6; }
@@ -4042,14 +3879,15 @@ $as_echo "$bird_cv_c_option_fno_strict_aliasing" >&6; 
 
 
   bird_tmp_cflags="$CFLAGS"
-
   CFLAGS=" -fno-strict-overflow"
+
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether CC supports -fno-strict-overflow" >&5
 $as_echo_n "checking whether CC supports -fno-strict-overflow... " >&6; }
 if ${bird_cv_c_option_fno_strict_overflow+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+
+      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 int
@@ -4064,8 +3902,11 @@ if ac_fn_c_try_compile "$LINENO"; then :
   bird_cv_c_option_fno_strict_overflow=yes
 else
   bird_cv_c_option_fno_strict_overflow=no
+
 fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $bird_cv_c_option_fno_strict_overflow" >&5
 $as_echo "$bird_cv_c_option_fno_strict_overflow" >&6; }
@@ -4073,7 +3914,7 @@ $as_echo "$bird_cv_c_option_fno_strict_overflow" >&6; 
   CFLAGS="$bird_tmp_cflags"
 
 
-	CFLAGS="$CFLAGS -Wall -Wextra -Wstrict-prototypes -Wno-parentheses"
+  CFLAGS="$CFLAGS -Wall -Wextra -Wstrict-prototypes -Wno-parentheses"
 
   if test "$bird_cv_c_option_wno_pointer_sign" = yes ; then
     CFLAGS="$CFLAGS -Wno-pointer-sign"
@@ -4543,71 +4384,96 @@ done
 test -z "$FLEX"	 && as_fn_error $? "Flex is missing." "$LINENO" 5
 test -z "$BISON" && as_fn_error $? "Bison is missing." "$LINENO" 5
 test -z "$M4"	 && as_fn_error $? "M4 is missing." "$LINENO" 5
-# Check for GNU $M4
-case `"$M4" --version 2>&1` in
-*GNU*)
-  ;;
-*)
-  as_fn_error $? "Provided M4 is not GNU M4." "$LINENO" 5;;
-esac
 
 
+  # Check for GNU $M4
+  case `"$M4" --version 2>&1` in
+    *GNU*)
+
+      ;;
+  *)
+      as_fn_error $? "Provided M4 is not GNU M4." "$LINENO" 5
+
+      ;;
+
+
+  esac
+
+
 if test -n "$with_sysconfig" -a "$with_sysconfig" != no ; then
-	if test -f $with_sysconfig ; then
-		sysdesc=$with_sysconfig
-	else
-		sysdesc=$srcdir/sysdep/cf/$with_sysconfig
-		if ! test -f $sysdesc ; then
-			sysdesc=$sysdesc.h
-		fi
-	fi
+  if test -f $with_sysconfig ; then
+    sysdesc=$with_sysconfig
+  else
+    sysdesc=$srcdir/sysdep/cf/$with_sysconfig
+    if ! test -f $sysdesc ; then
+      sysdesc=$sysdesc.h
+    fi
+  fi
 elif test -f sysconfig.h ; then
-	sysdesc=sysconfig
+  sysdesc=sysconfig
 else
-	case "$ip:$host_os" in
-		ipv6:linux*)	sysdesc=linux-v6
-				default_iproutedir="/etc/iproute2"
-				;;
-		ipv4:linux*)	sysdesc=linux
-				default_iproutedir="/etc/iproute2"
-				;;
-		ipv6:netbsd*)	sysdesc=bsd-v6
-				CPPFLAGS="$CPPFLAGS -I/usr/pkg/include"
-				LDFLAGS="$LDFLAGS -L/usr/pkg/lib -R/usr/pkg/lib"
-				;;
-		ipv4:netbsd*)	sysdesc=bsd
-				CPPFLAGS="$CPPFLAGS -I/usr/pkg/include"
-				LDFLAGS="$LDFLAGS -L/usr/pkg/lib -R/usr/pkg/lib"
-				;;
-		ipv6:freebsd*)	sysdesc=bsd-v6
-				;;
-		ipv4:freebsd*)	sysdesc=bsd
-				;;
-		ipv6:dragonfly*)	sysdesc=bsd-v6
-				;;
-		ipv4:dragonfly*)	sysdesc=bsd
-				;;
-		ipv6:kfreebsd*) sysdesc=bsd-v6
-				;;
-		ipv4:kfreebsd*) sysdesc=bsd
-				;;
-		ipv6:openbsd*)	sysdesc=bsd-v6
-				;;
-		ipv4:openbsd*)	sysdesc=bsd
-				;;
-		*)		as_fn_error $? "Cannot determine correct system configuration. Please use --with-sysconfig to set it manually." "$LINENO" 5
-				;;
-		esac
-	sysdesc=$srcdir/sysdep/cf/$sysdesc.h
+  case "$ip:$host_os" in
+    ipv6:linux*)
+      sysdesc=linux-v6
+      default_iproutedir="/etc/iproute2"
+      ;;
+    ipv4:linux*)
+      sysdesc=linux
+      default_iproutedir="/etc/iproute2"
+      ;;
+    ipv6:netbsd*)
+      sysdesc=bsd-v6
+      CPPFLAGS="$CPPFLAGS -I/usr/pkg/include"
+      LDFLAGS="$LDFLAGS -L/usr/pkg/lib -R/usr/pkg/lib"
+      ;;
+    ipv4:netbsd*)
+      sysdesc=bsd
+      CPPFLAGS="$CPPFLAGS -I/usr/pkg/include"
+      LDFLAGS="$LDFLAGS -L/usr/pkg/lib -R/usr/pkg/lib"
+      ;;
+    ipv6:freebsd*)
+      sysdesc=bsd-v6
+      CPPFLAGS="$CPPFLAGS -I/usr/local/include"
+      LDFLAGS="$LDFLAGS -L/usr/local/lib"
+      ;;
+    ipv4:freebsd*)
+      sysdesc=bsd
+      CPPFLAGS="$CPPFLAGS -I/usr/local/include"
+      LDFLAGS="$LDFLAGS -L/usr/local/lib"
+      ;;
+    ipv6:dragonfly*)
+      sysdesc=bsd-v6
+      ;;
+    ipv4:dragonfly*)
+      sysdesc=bsd
+      ;;
+    ipv6:kfreebsd*)
+      sysdesc=bsd-v6
+      ;;
+    ipv4:kfreebsd*)
+      sysdesc=bsd
+      ;;
+    ipv6:openbsd*)
+      sysdesc=bsd-v6
+      ;;
+    ipv4:openbsd*)
+      sysdesc=bsd
+      ;;
+    *)
+      as_fn_error $? "Cannot determine correct system configuration. Please use --with-sysconfig to set it manually." "$LINENO" 5
+      ;;
+  esac
+  sysdesc=$srcdir/sysdep/cf/$sysdesc.h
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking which OS configuration should we use" >&5
 $as_echo_n "checking which OS configuration should we use... " >&6; }
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $sysdesc" >&5
 $as_echo "$sysdesc" >&6; }
 if ! test -f $sysdesc ; then
-	as_fn_error $? "The system configuration file is missing." "$LINENO" 5
+  as_fn_error $? "The system configuration file is missing." "$LINENO" 5
 fi
 sysname=`echo $sysdesc | sed 's/\.h$//'`
+
 cat >>confdefs.h <<_ACEOF
 #define SYSCONF_INCLUDE "$sysdesc"
 _ACEOF
@@ -4629,41 +4495,52 @@ fi
 
 
 
-all_protocols="$proto_bfd bgp ospf pipe $proto_radv rip static"
+all_protocols="$proto_bfd bgp mrt ospf pipe $proto_radv rip static"
 if test "$ip" = ipv6 ; then
    all_protocols="$all_protocols babel"
 fi
 all_protocols=`echo $all_protocols | sed 's/ /,/g'`
 
 if test "$with_protocols" = all ; then
-	with_protocols="$all_protocols"
+  with_protocols="$all_protocols"
 fi
 
+
+
+
+
+
+
+
+
+
+
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking protocols" >&5
 $as_echo_n "checking protocols... " >&6; }
 protocols=`echo "$with_protocols" | sed 's/,/ /g'`
 if test "$protocols" = no ; then protocols= ; fi
 for a in $protocols ; do
-	if ! test -f $srcdir/proto/$a/Makefile ; then
-		{ $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5
+  if ! test -f $srcdir/proto/$a/Makefile ; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5
 $as_echo "failed" >&6; }
-		as_fn_error $? "Requested protocol $a not found." "$LINENO" 5
-		fi
-	cat >>confdefs.h <<_ACEOF
+    as_fn_error $? "Requested protocol $a not found" "$LINENO" 5
+  fi
+  cat >>confdefs.h <<_ACEOF
 #define CONFIG_`echo $a | tr 'a-z' 'A-Z'` 1
 _ACEOF
 
-	done
+done
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
 $as_echo "ok" >&6; }
 
 
 case $sysdesc in
-	*/linux*|*/linux-v6*)
-		ac_fn_c_check_header_compile "$LINENO" "linux/rtnetlink.h" "ac_cv_header_linux_rtnetlink_h" "
-#include <asm/types.h>
-#include <sys/socket.h>
+  */linux*|*/linux-v6*)
+    ac_fn_c_check_header_compile "$LINENO" "linux/rtnetlink.h" "ac_cv_header_linux_rtnetlink_h" "
+		#include <asm/types.h>
+	#include <sys/socket.h>
 
+
 "
 if test "x$ac_cv_header_linux_rtnetlink_h" = xyes; then :
 
@@ -4672,7 +4549,7 @@ else
 fi
 
 
-		;;
+    ;;
 esac
 
 
@@ -4935,47 +4812,40 @@ fi
 done
 
 
-ac_fn_c_check_header_mongrel "$LINENO" "syslog.h" "ac_cv_header_syslog_h" "$ac_includes_default"
-if test "x$ac_cv_header_syslog_h" = xyes; then :
-  $as_echo "#define HAVE_SYSLOG 1" >>confdefs.h
 
-fi
 
 
-ac_fn_c_check_header_mongrel "$LINENO" "alloca.h" "ac_cv_header_alloca_h" "$ac_includes_default"
-if test "x$ac_cv_header_alloca_h" = xyes; then :
-  $as_echo "#define HAVE_ALLOCA_H 1" >>confdefs.h
+  for ac_header in $ac_header_list
+do :
+  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
+"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
 
 fi
 
+done
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether 'struct sockaddr' has sa_len" >&5
-$as_echo_n "checking whether 'struct sockaddr' has sa_len... " >&6; }
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <sys/types.h>
-  #include <sys/socket.h>
 
-int
-main ()
-{
-static struct sockaddr sa; int i = sizeof(sa.sa_len);
-  ;
-  return 0;
-}
+
+
+
+
+ac_fn_c_check_member "$LINENO" "struct sockaddr" "sa_len" "ac_cv_member_struct_sockaddr_sa_len" "#include <sys/socket.h>
+"
+if test "x$ac_cv_member_struct_sockaddr_sa_len" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_SOCKADDR_SA_LEN 1
 _ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
 
-$as_echo "#define HAVE_SIN_LEN /**/" >>confdefs.h
 
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
 fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
+
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5
 $as_echo_n "checking whether byte ordering is bigendian... " >&6; }
 if ${ac_cv_c_bigendian+:} false; then :
@@ -5186,10 +5056,12 @@ fi
 $as_echo "$ac_cv_c_bigendian" >&6; }
  case $ac_cv_c_bigendian in #(
    yes)
-     $as_echo "#define CPU_BIG_ENDIAN 1" >>confdefs.h
+
+$as_echo "#define CPU_BIG_ENDIAN 1" >>confdefs.h
 ;; #(
    no)
-     $as_echo "#define CPU_LITTLE_ENDIAN 1" >>confdefs.h
+
+$as_echo "#define CPU_LITTLE_ENDIAN 1" >>confdefs.h
  ;; #(
    universal)
 
@@ -5197,348 +5069,153 @@ $as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confde
 
      ;; #(
    *)
-     as_fn_error $? "Cannot determine CPU endianity." "$LINENO" 5 ;;
+     as_fn_error $? "Cannot determine CPU endianity." "$LINENO" 5
+ ;;
  esac
 
 
-# The cast to long int works around a bug in the HP C Compiler
-# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
-# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
-# This bug is HP SR number 8606223364.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of char" >&5
-$as_echo_n "checking size of char... " >&6; }
-if ${ac_cv_sizeof_char+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (char))" "ac_cv_sizeof_char"        "$ac_includes_default"; then :
 
-else
-  if test "$ac_cv_type_char" = yes; then
-     { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error 77 "cannot compute sizeof (char)
-See \`config.log' for more details" "$LINENO" 5; }
-   else
-     ac_cv_sizeof_char=0
-   fi
-fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_char" >&5
-$as_echo "$ac_cv_sizeof_char" >&6; }
-
-
-
-cat >>confdefs.h <<_ACEOF
-#define SIZEOF_CHAR $ac_cv_sizeof_char
-_ACEOF
-
-
-# The cast to long int works around a bug in the HP C Compiler
-# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
-# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
-# This bug is HP SR number 8606223364.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of short int" >&5
-$as_echo_n "checking size of short int... " >&6; }
-if ${ac_cv_sizeof_short_int+:} false; then :
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for glob.h" >&5
+$as_echo_n "checking for glob.h... " >&6; }
+if ${bird_cv_lib_glob+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (short int))" "ac_cv_sizeof_short_int"        "$ac_includes_default"; then :
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
-else
-  if test "$ac_cv_type_short_int" = yes; then
-     { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error 77 "cannot compute sizeof (short int)
-See \`config.log' for more details" "$LINENO" 5; }
-   else
-     ac_cv_sizeof_short_int=0
-   fi
-fi
 
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_short_int" >&5
-$as_echo "$ac_cv_sizeof_short_int" >&6; }
+	  #include <glob.h>
+	  #include <stdlib.h>
 
+int
+main ()
+{
+ glob(NULL, 0, NULL, NULL);
 
+  ;
+  return 0;
+}
 
-cat >>confdefs.h <<_ACEOF
-#define SIZEOF_SHORT_INT $ac_cv_sizeof_short_int
 _ACEOF
-
-
-# The cast to long int works around a bug in the HP C Compiler
-# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
-# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
-# This bug is HP SR number 8606223364.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of int" >&5
-$as_echo_n "checking size of int... " >&6; }
-if ${ac_cv_sizeof_int+:} false; then :
-  $as_echo_n "(cached) " >&6
+if ac_fn_c_try_link "$LINENO"; then :
+  bird_cv_lib_glob=yes
 else
-  if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (int))" "ac_cv_sizeof_int"        "$ac_includes_default"; then :
 
-else
-  if test "$ac_cv_type_int" = yes; then
-     { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error 77 "cannot compute sizeof (int)
-See \`config.log' for more details" "$LINENO" 5; }
-   else
-     ac_cv_sizeof_int=0
-   fi
-fi
+        bird_tmp_libs="$LIBS"
+        LIBS="$LIBS -landroid-glob"
+        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_int" >&5
-$as_echo "$ac_cv_sizeof_int" >&6; }
 
+	      #include <glob.h>
+	      #include <stdlib.h>
 
+int
+main ()
+{
+ glob(NULL, 0, NULL, NULL);
 
-cat >>confdefs.h <<_ACEOF
-#define SIZEOF_INT $ac_cv_sizeof_int
-_ACEOF
+  ;
+  return 0;
+}
 
-
-# The cast to long int works around a bug in the HP C Compiler
-# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
-# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
-# This bug is HP SR number 8606223364.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long int" >&5
-$as_echo_n "checking size of long int... " >&6; }
-if ${ac_cv_sizeof_long_int+:} false; then :
-  $as_echo_n "(cached) " >&6
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  bird_cv_lib_glob=-landroid-glob
 else
-  if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long int))" "ac_cv_sizeof_long_int"        "$ac_includes_default"; then :
+  bird_cv_lib_glob=no
 
-else
-  if test "$ac_cv_type_long_int" = yes; then
-     { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error 77 "cannot compute sizeof (long int)
-See \`config.log' for more details" "$LINENO" 5; }
-   else
-     ac_cv_sizeof_long_int=0
-   fi
 fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+        LIBS="$bird_tmp_libs"
 
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long_int" >&5
-$as_echo "$ac_cv_sizeof_long_int" >&6; }
 
-
-
-cat >>confdefs.h <<_ACEOF
-#define SIZEOF_LONG_INT $ac_cv_sizeof_long_int
-_ACEOF
-
-
-# The cast to long int works around a bug in the HP C Compiler
-# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
-# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
-# This bug is HP SR number 8606223364.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long long int" >&5
-$as_echo_n "checking size of long long int... " >&6; }
-if ${ac_cv_sizeof_long_long_int+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long long int))" "ac_cv_sizeof_long_long_int"        "$ac_includes_default"; then :
-
-else
-  if test "$ac_cv_type_long_long_int" = yes; then
-     { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error 77 "cannot compute sizeof (long long int)
-See \`config.log' for more details" "$LINENO" 5; }
-   else
-     ac_cv_sizeof_long_long_int=0
-   fi
 fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
 
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long_long_int" >&5
-$as_echo "$ac_cv_sizeof_long_long_int" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $bird_cv_lib_glob" >&5
+$as_echo "$bird_cv_lib_glob" >&6; }
 
-
-
-cat >>confdefs.h <<_ACEOF
-#define SIZEOF_LONG_LONG_INT $ac_cv_sizeof_long_long_int
-_ACEOF
-
-
-for size in 1 2 4 8; do
-	bits=`expr $size "*" 8`
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $bits-bit type" >&5
-$as_echo_n "checking for $bits-bit type... " >&6; }
-	if test $ac_cv_sizeof_int = $size ; then
-		res=int
-	elif test $ac_cv_sizeof_char = $size ; then
-		res=char
-	elif test $ac_cv_sizeof_short_int = $size ; then
-		res="short int"
-	elif test $ac_cv_sizeof_long_int = $size ; then
-		res="long int"
-	elif test $ac_cv_sizeof_long_long_int = $size ; then
-		res="long long int"
-	else
-		{ $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5
-$as_echo "not found" >&6; }
-		as_fn_error $? "Cannot find $bits-bit integer type." "$LINENO" 5
-	fi
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $res" >&5
-$as_echo "$res" >&6; }
-	cat >>confdefs.h <<_ACEOF
-#define INTEGER_$bits $res
-_ACEOF
-
-	done
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking usual alignment of structures" >&5
-$as_echo_n "checking usual alignment of structures... " >&6; }
-if ${bird_cv_c_struct_align+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-
-if test "$cross_compiling" = yes; then :
-  bird_cv_c_struct_align=16
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-#include <stdio.h>
-
-struct { char x; long int y; } ary[2];
-
-int main(void)
-{
-  FILE *f = fopen("conftestresult", "w");
-  if (!f) return 10;
-  fprintf(f, "%d", sizeof(ary)/2);
-  fclose(f);
-  exit(0);
-}
-
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-
-bird_cv_c_struct_align=`cat conftestresult`
-
-else
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: test program failed" >&5
-$as_echo "test program failed" >&6; }
-as_fn_error $? "Cannot determine structure alignment" "$LINENO" 5
-
+if test "$bird_cv_lib_glob" = no ; then
+  as_fn_error $? "glob.h not found." "$LINENO" 5
+elif test "$bird_cv_lib_glob" != yes ; then
+  LIBS="$LIBS $bird_cv_lib_glob"
 fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
 
 
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $bird_cv_c_struct_align" >&5
-$as_echo "$bird_cv_c_struct_align" >&6; }
-cat >>confdefs.h <<_ACEOF
-#define CPU_STRUCT_ALIGN $bird_cv_c_struct_align
-_ACEOF
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking characteristics of time_t" >&5
-$as_echo_n "checking characteristics of time_t... " >&6; }
-if ${bird_cv_type_time_t+:} false; then :
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for syslog lib flags" >&5
+$as_echo_n "checking for syslog lib flags... " >&6; }
+if ${bird_cv_lib_log+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-
-if test "$cross_compiling" = yes; then :
-  bird_cv_type_time_t="32-bit signed"
-else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
-#include <stdio.h>
-#include <sys/time.h>
-#include <limits.h>
-
-int main(void)
+       #include <sys/syslog.h>
+int
+main ()
 {
-  FILE *f = fopen("conftestresult", "w");
-  if (!f) return 10;
-  fprintf(f, "%d-bit ", sizeof(time_t)*CHAR_BIT);
-  if ((time_t) -1 > 0) fprintf(f, "un");
-  fprintf(f, "signed");
-  fclose(f);
-  exit(0);
+ syslog(0, "");
+
+  ;
+  return 0;
 }
 
 _ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  bird_cv_type_time_t=`cat conftestresult`
-
+if ac_fn_c_try_link "$LINENO"; then :
+  bird_cv_lib_log=yes
 else
-  	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: test program failed" >&5
-$as_echo "test program failed" >&6; }
-	as_fn_error $? "Cannot determine time_t size and signedness." "$LINENO" 5
 
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
-
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $bird_cv_type_time_t" >&5
-$as_echo "$bird_cv_type_time_t" >&6; }
-case "$bird_cv_type_time_t" in
-	*64-bit*)	$as_echo "#define TIME_T_IS_64BIT 1" >>confdefs.h
- ;;
-	esac
-case "$bird_cv_type_time_t" in
-	*unsigned*)	;;
-	*)		$as_echo "#define TIME_T_IS_SIGNED 1" >>confdefs.h
- ;;
-	esac
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct ip_mreqn" >&5
-$as_echo_n "checking for struct ip_mreqn... " >&6; }
-if ${bird_cv_struct_ip_mreqn+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+        bird_tmp_libs="$LIBS"
+        LIBS="$LIBS -llog"
+        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-#include <netinet/in.h>
 
+           #include <sys/syslog.h>
 int
 main ()
 {
-struct ip_mreqn x;
+ syslog(0, "");
 
   ;
   return 0;
 }
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  bird_cv_struct_ip_mreqn=yes
 
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  bird_cv_lib_log=-llog
 else
-  bird_cv_struct_ip_mreqn=no
+  bird_cv_lib_log=no
 
 fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+        LIBS="$bird_tmp_libs"
+
+
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $bird_cv_struct_ip_mreqn" >&5
-$as_echo "$bird_cv_struct_ip_mreqn" >&6; }
-if test "$bird_cv_struct_ip_mreqn" = yes ; then
-	$as_echo "#define HAVE_STRUCT_IP_MREQN 1" >>confdefs.h
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
 
 fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $bird_cv_lib_log" >&5
+$as_echo "$bird_cv_lib_log" >&6; }
 
+if test "$bird_cv_lib_log" = no ; then
+  as_fn_error $? "don't know how to link syslog." "$LINENO" 5
+elif test "$bird_cv_lib_log" != yes ; then
+  LIBS="$LIBS $bird_cv_lib_log"
+fi
 
 if test "$enable_debug" = yes ; then
-	$as_echo "#define DEBUGGING 1" >>confdefs.h
 
-	if test "$enable_memcheck" = yes ; then
-		{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for dmalloc_debug in -ldmalloc" >&5
+$as_echo "#define DEBUGGING 1" >>confdefs.h
+
+  if test "$enable_memcheck" = yes ; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dmalloc_debug in -ldmalloc" >&5
 $as_echo_n "checking for dmalloc_debug in -ldmalloc... " >&6; }
 if ${ac_cv_lib_dmalloc_dmalloc_debug+:} false; then :
   $as_echo_n "(cached) " >&6
@@ -5583,8 +5260,8 @@ _ACEOF
 
 fi
 
-		if test $ac_cv_lib_dmalloc_dmalloc_debug != yes ; then
-			{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for malloc in -lefence" >&5
+    if test $ac_cv_lib_dmalloc_dmalloc_debug != yes ; then
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for malloc in -lefence" >&5
 $as_echo_n "checking for malloc in -lefence... " >&6; }
 if ${ac_cv_lib_efence_malloc+:} false; then :
   $as_echo_n "(cached) " >&6
@@ -5629,139 +5306,40 @@ _ACEOF
 
 fi
 
-		fi
-	fi
+    fi
+  fi
 fi
 
 CLIENT=
 CLIENT_LIBS=
 if test "$enable_client" = yes ; then
-	CLIENT=birdc
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for add_history in -lhistory" >&5
-$as_echo_n "checking for add_history in -lhistory... " >&6; }
-if ${ac_cv_lib_history_add_history+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lhistory  $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
+  CLIENT=birdc
+  BASE_LIBS="$LIBS"
+  LIBS=""
 
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char add_history ();
-int
-main ()
-{
-return add_history ();
-  ;
-  return 0;
-}
+  for ac_header in curses.h
+do :
+  ac_fn_c_check_header_compile "$LINENO" "curses.h" "ac_cv_header_curses_h" "$ac_includes_default
+
+"
+if test "x$ac_cv_header_curses_h" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_CURSES_H 1
 _ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_history_add_history=yes
+
 else
-  ac_cv_lib_history_add_history=no
+  as_fn_error $? "The client requires ncurses library. Either install the library or use --disable-client to compile without the client." "$LINENO" 5
 fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_history_add_history" >&5
-$as_echo "$ac_cv_lib_history_add_history" >&6; }
-if test "x$ac_cv_lib_history_add_history" = xyes; then :
-  CLIENT_LIBS="-lhistory"
-fi
 
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for tgetent in -lncurses" >&5
-$as_echo_n "checking for tgetent in -lncurses... " >&6; }
-if ${ac_cv_lib_ncurses_tgetent+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lncurses  $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
+done
 
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char tgetent ();
-int
-main ()
-{
-return tgetent ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_ncurses_tgetent=yes
-else
-  ac_cv_lib_ncurses_tgetent=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ncurses_tgetent" >&5
-$as_echo "$ac_cv_lib_ncurses_tgetent" >&6; }
-if test "x$ac_cv_lib_ncurses_tgetent" = xyes; then :
-  USE_TERMCAP_LIB=-lncurses
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for tgetent in -lcurses" >&5
-$as_echo_n "checking for tgetent in -lcurses... " >&6; }
-if ${ac_cv_lib_curses_tgetent+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lcurses  $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
 
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char tgetent ();
-int
-main ()
-{
-return tgetent ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_curses_tgetent=yes
-else
-  ac_cv_lib_curses_tgetent=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_curses_tgetent" >&5
-$as_echo "$ac_cv_lib_curses_tgetent" >&6; }
-if test "x$ac_cv_lib_curses_tgetent" = xyes; then :
-  USE_TERMCAP_LIB=-lcurses
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for tgetent in -ltinfow" >&5
-$as_echo_n "checking for tgetent in -ltinfow... " >&6; }
-if ${ac_cv_lib_tinfow_tgetent+:} false; then :
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing tgetent" >&5
+$as_echo_n "checking for library containing tgetent... " >&6; }
+if ${ac_cv_search_tgetent+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-ltinfow  $LIBS"
+  ac_func_search_save_LIBS=$LIBS
 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
@@ -5780,116 +5358,65 @@ return tgetent ();
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_tinfow_tgetent=yes
-else
-  ac_cv_lib_tinfow_tgetent=no
+for ac_lib in '' tinfo tinfow ncurses curses termcap; do
+  if test -z "$ac_lib"; then
+    ac_res="none required"
+  else
+    ac_res=-l$ac_lib
+    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
+  fi
+  if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_search_tgetent=$ac_res
 fi
 rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
+    conftest$ac_exeext
+  if ${ac_cv_search_tgetent+:} false; then :
+  break
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_tinfow_tgetent" >&5
-$as_echo "$ac_cv_lib_tinfow_tgetent" >&6; }
-if test "x$ac_cv_lib_tinfow_tgetent" = xyes; then :
-  USE_TERMCAP_LIB=-ltinfow
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for tgetent in -ltinfo" >&5
-$as_echo_n "checking for tgetent in -ltinfo... " >&6; }
-if ${ac_cv_lib_tinfo_tgetent+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-ltinfo  $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
+done
+if ${ac_cv_search_tgetent+:} false; then :
 
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char tgetent ();
-int
-main ()
-{
-return tgetent ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_tinfo_tgetent=yes
 else
-  ac_cv_lib_tinfo_tgetent=no
+  ac_cv_search_tgetent=no
 fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_tinfo_tgetent" >&5
-$as_echo "$ac_cv_lib_tinfo_tgetent" >&6; }
-if test "x$ac_cv_lib_tinfo_tgetent" = xyes; then :
-  USE_TERMCAP_LIB=-ltinfo
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_tgetent" >&5
+$as_echo "$ac_cv_search_tgetent" >&6; }
+ac_res=$ac_cv_search_tgetent
+if test "$ac_res" != no; then :
+  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+  TINFO_LIBS="$LIBS"; LIBS=""
 else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for tgetent in -ltermcap" >&5
-$as_echo_n "checking for tgetent in -ltermcap... " >&6; }
-if ${ac_cv_lib_termcap_tgetent+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-ltermcap  $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char tgetent ();
-int
-main ()
-{
-return tgetent ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_termcap_tgetent=yes
-else
-  ac_cv_lib_termcap_tgetent=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_termcap_tgetent" >&5
-$as_echo "$ac_cv_lib_termcap_tgetent" >&6; }
-if test "x$ac_cv_lib_termcap_tgetent" = xyes; then :
-  USE_TERMCAP_LIB=-ltermcap
-else
   as_fn_error $? "The client requires ncurses library. Either install the library or use --disable-client to compile without the client." "$LINENO" 5
 fi
 
-fi
 
-fi
+  for ac_header in readline/readline.h readline/history.h
+do :
+  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
 
-fi
+"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
 
+else
+  as_fn_error $? "The client requires GNU Readline library. Either install the library or use --disable-client to compile without the client." "$LINENO" 5
 fi
 
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for rl_callback_read_char in -lreadline" >&5
-$as_echo_n "checking for rl_callback_read_char in -lreadline... " >&6; }
-if ${ac_cv_lib_readline_rl_callback_read_char+:} false; then :
+done
+
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing rl_callback_read_char" >&5
+$as_echo_n "checking for library containing rl_callback_read_char... " >&6; }
+if ${ac_cv_search_rl_callback_read_char+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lreadline $USE_TERMCAP_LIB $LIBS"
+  ac_func_search_save_LIBS=$LIBS
 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
@@ -5908,30 +5435,50 @@ return rl_callback_read_char ();
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_readline_rl_callback_read_char=yes
-else
-  ac_cv_lib_readline_rl_callback_read_char=no
+for ac_lib in '' readline; do
+  if test -z "$ac_lib"; then
+    ac_res="none required"
+  else
+    ac_res=-l$ac_lib
+    LIBS="-l$ac_lib $TINFO_LIBS
+   $ac_func_search_save_LIBS"
+  fi
+  if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_search_rl_callback_read_char=$ac_res
 fi
 rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
+    conftest$ac_exeext
+  if ${ac_cv_search_rl_callback_read_char+:} false; then :
+  break
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_readline_rl_callback_read_char" >&5
-$as_echo "$ac_cv_lib_readline_rl_callback_read_char" >&6; }
-if test "x$ac_cv_lib_readline_rl_callback_read_char" = xyes; then :
-  CLIENT_LIBS="-lreadline $CLIENT_LIBS $USE_TERMCAP_LIB"
+done
+if ${ac_cv_search_rl_callback_read_char+:} false; then :
+
 else
-  as_fn_error $? "The client requires GNU readline library 2.1 or newer. Either install the library or use --disable-client to compile without the client." "$LINENO" 5
+  ac_cv_search_rl_callback_read_char=no
 fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_rl_callback_read_char" >&5
+$as_echo "$ac_cv_search_rl_callback_read_char" >&6; }
+ac_res=$ac_cv_search_rl_callback_read_char
+if test "$ac_res" != no; then :
+  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+  READLINE_LIBS="$LIBS"; LIBS=""
+else
+  as_fn_error $? "The client requires GNU Readline library. Either install the library or use --disable-client to compile without the client." "$LINENO" 5
+fi
 
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for rl_crlf in -lreadline" >&5
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for rl_crlf in -lreadline" >&5
 $as_echo_n "checking for rl_crlf in -lreadline... " >&6; }
 if ${ac_cv_lib_readline_rl_crlf+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
-LIBS="-lreadline $USE_TERMCAP_LIB $LIBS"
+LIBS="-lreadline $TINFO_LIBS
+   $LIBS"
 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
@@ -5962,17 +5509,20 @@ fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_readline_rl_crlf" >&5
 $as_echo "$ac_cv_lib_readline_rl_crlf" >&6; }
 if test "x$ac_cv_lib_readline_rl_crlf" = xyes; then :
-  $as_echo "#define HAVE_RL_CRLF 1" >>confdefs.h
 
+$as_echo "#define HAVE_RL_CRLF 1" >>confdefs.h
+
 fi
 
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for rl_ding in -lreadline" >&5
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for rl_ding in -lreadline" >&5
 $as_echo_n "checking for rl_ding in -lreadline... " >&6; }
 if ${ac_cv_lib_readline_rl_ding+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
-LIBS="-lreadline $USE_TERMCAP_LIB $LIBS"
+LIBS="-lreadline $TINFO_LIBS
+   $LIBS"
 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
@@ -6003,10 +5553,14 @@ fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_readline_rl_ding" >&5
 $as_echo "$ac_cv_lib_readline_rl_ding" >&6; }
 if test "x$ac_cv_lib_readline_rl_ding" = xyes; then :
-  $as_echo "#define HAVE_RL_DING 1" >>confdefs.h
 
+$as_echo "#define HAVE_RL_DING 1" >>confdefs.h
+
 fi
 
+
+  LIBS="$BASE_LIBS"
+  CLIENT_LIBS="$READLINE_LIBS $TINFO_LIBS"
 fi
 
 
@@ -6708,11 +6262,14 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 #
 # INIT-COMMANDS
 #
-srcdir=$srcdir
-	srcdir_rel=$srcdir_rel
-	objdir=$objdir
-	sysdep_dirs="$sysdep_dirs"
 
+    srcdir=$srcdir
+    srcdir_rel=$srcdir_rel
+    objdir=$objdir
+    sysdep_dirs="$sysdep_dirs"
+
+
+
 _ACEOF
 
 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
@@ -7279,8 +6836,7 @@ $as_echo "$as_me: executing $ac_file commands" >&6;}
 
 
   case $ac_file$ac_mode in
-    "merge":C) export CPP="$CPP"
-$srcdir/tools/mergedirs $srcdir $srcdir_rel $objdir $sysdep_dirs ;;
+    "merge":C)  export CPP="$CPP"; sh $srcdir/tools/mergedirs $srcdir $srcdir_rel $objdir $sysdep_dirs  ;;
 
   esac
 done # for ac_tag
@@ -7322,16 +6878,25 @@ fi
 
 rm -f $objdir/sysdep/paths.h
 
-cat >&6 <<EOF
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: " >&5
+$as_echo "" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: BIRD was configured with the following options:" >&5
+$as_echo "BIRD was configured with the following options:" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result:         Source directory:	$srcdir" >&5
+$as_echo "        Source directory:	$srcdir" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result:         Object directory:	$objdir" >&5
+$as_echo "        Object directory:	$objdir" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result:         Iproute2 directory:	$iproutedir" >&5
+$as_echo "        Iproute2 directory:	$iproutedir" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result:         System configuration:	$sysdesc" >&5
+$as_echo "        System configuration:	$sysdesc" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result:         Debugging:		$enable_debug" >&5
+$as_echo "        Debugging:		$enable_debug" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result:         POSIX threads:		$enable_pthreads" >&5
+$as_echo "        POSIX threads:		$enable_pthreads" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result:         Routing protocols:	$protocols" >&5
+$as_echo "        Routing protocols:	$protocols" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result:         Client:			$enable_client" >&5
+$as_echo "        Client:			$enable_client" >&6; }
 
-BIRD was configured with the following options:
-	Source directory:	$srcdir
-	Object directory:	$objdir
-	Iproute2 directory:	$iproutedir
-	System configuration:	$sysdesc
-	Debugging:		$enable_debug
-	POSIX threads:		$enable_pthreads
-	Routing protocols:	$protocols
-	Client:			$enable_client
-EOF
 rm -f $objdir/.*-stamp