#! /bin/sh

# Guess values for system-dependent variables and create Makefiles.
# Generated automatically using autoconf version 2.13 
# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
#
# This configure script is free software; the Free Software Foundation
# gives unlimited permission to copy, distribute and modify it.

# Defaults:
ac_help=
ac_default_prefix=/usr/local
# Any additions from configure.in:
ac_help="$ac_help
  --enable-profile=ARG Specify build configuration"
ac_help="$ac_help
  --with-purify=PURIFY    Use purify (default --without-purify) "
ac_help="$ac_help
  --enable-compiler-optimizations
                          Enable optimization of the binaries"
ac_help="$ac_help
  --enable-data-cache=ARG Specify data cache size in kbytes"
ac_help="$ac_help
  --enable-insn-cache=ARG Specify insn cache size in kbytes"
ac_help="$ac_help
  --enable-minimal-stack    Enable optimizations to minimize stack usage."
ac_help="$ac_help
  --enable-static-binaries
                          Enable building static binaries"
ac_help="$ac_help
  --with-addr-model[=NAME]
                          Memory addressing model to use (ilp32,lp64)."
ac_help="$ac_help
  --enable-verbose-warnings
                          Enable verbose compiler warnings."
ac_help="$ac_help
  --enable-debug          Enable light debugging."
ac_help="$ac_help
  --enable-debug-heavy    Enable heavy debugging."
ac_help="$ac_help
  --enable-efence         Enable EFENCE memory allocation debugger."
ac_help="$ac_help
  --with-replacement-memcmp    Use replacement memcmp (default is to use system) "
ac_help="$ac_help
  --enable-globals-emulation   Enable global variable emulation."
ac_help="$ac_help
  --disable-asm           Disable assembler optimized subroutines"
ac_help="$ac_help
  --with-sshlibs=PATH     Add PATH to include/lib path when find libraries
                          the PATH should point to directory containing
                          include and lib directories."
ac_help="$ac_help
  --enable-ipsec-small    Compile a minimal engine. "
ac_help="$ac_help
  --disable-interceptor   Disable (do not compile) the kernel interceptor"
ac_help="$ac_help
  --enable-ip-word-align   Word align the IP header when sending packets. "
ac_help="$ac_help
  --with-kernel-version[=VALUE]
                          Override kernel version to cross-compile
                          (used currently only on Linux)."
ac_help="$ac_help
  --with-kernel-headers[=VALUE]
                          Override kernel inc directory to cross-compile."
ac_help="$ac_help
  --enable-smp            Compile for an SMP kernel.
	                       (used currently only on Linux)."
ac_help="$ac_help
"
ac_help="$ac_help
  --without-ipv6          Disable IPv6 support."
ac_help="$ac_help
  --disable-tcp-nodelay   Disable TCP_NODELAY socket option"
ac_help="$ac_help
  --enable-select         Use select even if poll() is present. "
ac_help="$ac_help
  --enable-blocking-connect
                          Use blocking connect system call."
ac_help="$ac_help
  --with-internal-localtime
                          Use only ssh internal localtime function."
ac_help="$ac_help
  --with-threads=xxx      Use thread package xxx ($THREADS)"
ac_help="$ac_help
  --disable-debug-malloc
                          Disable debug malloc (for purify/third use)"
ac_help="$ac_help
  --enable-system-resolver
                          Enable use of system resolver instead of internal"
ac_help="$ac_help
  --enable-udp-datagram-size=ARG
                         Specify the size in bytes of the global UDP
                         datagram buffer."
ac_help="$ac_help
  --enable-minimal-math   Omit math library rountines that are not required
                          for RSA, DSA and Diffie-Hellman. "
ac_help="$ac_help
  --with-safenet-udm[=PATH]
                          Enable support for Safenet UDM driver"
ac_help="$ac_help
  --enable-safenet-1840    Using Safenet 1840 device. "
ac_help="$ac_help
  --enable-safenet-1841    Using Safenet 1841 device. "
ac_help="$ac_help
  --enable-safenet-1842    Using Safenet 1842 device. "
ac_help="$ac_help
  --with-octeon[=PATH]
                          Enable support for Octeon"
ac_help="$ac_help
  --with-safenet-slad[=PATH]
                          Enable support for Safenet SLAD driver"
ac_help="$ac_help
  --with-safenet-pec[=PATH]
                          Enable support for Safenet Packet Engine driver"
ac_help="$ac_help
  --with-av-alg=PATH      Add PATH to include/lib 
                           the PATH should point to directory containing
                           includes anti-virus/kaverr.h, 
			   anti-virus/kldclient.h, anti-virus/md5.h,
                           and library anti-virus/libkld.a."
ac_help="$ac_help
  --with-hwaccel[=NAME]   Enable use of IPSEC hardware acceleration module."
ac_help="$ac_help
  --enable-emi-memory     Enable the use of EMI memory. "
ac_help="$ac_help
  --enable-amcc-support     Enable the support of AMCC. "
ac_help="$ac_help
  --enable-target-endian-swap     Enabling target endian swapping for Safenet devices. "
ac_help="$ac_help
  --with-safenet-udm[=PATH]
                          Enable support for Safenet UDM driver"
ac_help="$ac_help
  --enable-safenet-1840    Using Safenet 1840 device. "
ac_help="$ac_help
  --enable-safenet-1841    Using Safenet 1841 device. "
ac_help="$ac_help
  --enable-safenet-1842    Using Safenet 1842 device. "
ac_help="$ac_help
  --enable-eth-packet-hook     Enable ethernet driver packet hook. "
ac_help="$ac_help
  --with-ansi-rng	  Use the ANSI X9.62 Random Number Generator.
  --without-ansi-rng      Use the SSH Random Number Generator (default)."
ac_help="$ac_help
  --without-rsa           Do not use RSA."
ac_help="$ac_help
  --with-fastpath=NAME    Specify the QuickSec fastpath to use."

# Initialize some variables set by options.
# The variables have the same names as the options, with
# dashes changed to underlines.
build=NONE
cache_file=./config.cache
exec_prefix=NONE
host=NONE
no_create=
nonopt=NONE
no_recursion=
prefix=NONE
program_prefix=NONE
program_suffix=NONE
program_transform_name=s,x,x,
silent=
site=
srcdir=
target=NONE
verbose=
x_includes=NONE
x_libraries=NONE
bindir='${exec_prefix}/bin'
sbindir='${exec_prefix}/sbin'
libexecdir='${exec_prefix}/libexec'
datadir='${prefix}/share'
sysconfdir='${prefix}/etc'
sharedstatedir='${prefix}/com'
localstatedir='${prefix}/var'
libdir='${exec_prefix}/lib'
includedir='${prefix}/include'
oldincludedir='/usr/include'
infodir='${prefix}/info'
mandir='${prefix}/man'

# Initialize some other variables.
subdirs=
MFLAGS= MAKEFLAGS=
SHELL=${CONFIG_SHELL-/bin/sh}
# Maximum number of lines to put in a shell here document.
ac_max_here_lines=12

ac_prev=
for ac_option
do

  # If the previous option needs an argument, assign it.
  if test -n "$ac_prev"; then
    eval "$ac_prev=\$ac_option"
    ac_prev=
    continue
  fi

  case "$ac_option" in
  -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
  *) ac_optarg= ;;
  esac

  # Accept the important Cygnus configure options, so we can diagnose typos.

  case "$ac_option" in

  -bindir | --bindir | --bindi | --bind | --bin | --bi)
    ac_prev=bindir ;;
  -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
    bindir="$ac_optarg" ;;

  -build | --build | --buil | --bui | --bu)
    ac_prev=build ;;
  -build=* | --build=* | --buil=* | --bui=* | --bu=*)
    build="$ac_optarg" ;;

  -cache-file | --cache-file | --cache-fil | --cache-fi \
  | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
    ac_prev=cache_file ;;
  -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
  | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
    cache_file="$ac_optarg" ;;

  -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
    ac_prev=datadir ;;
  -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
  | --da=*)
    datadir="$ac_optarg" ;;

  -disable-* | --disable-*)
    ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
    # Reject names that are not valid shell variable names.
    if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
      { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
    fi
    ac_feature=`echo $ac_feature| sed 's/-/_/g'`
    eval "enable_${ac_feature}=no" ;;

  -enable-* | --enable-*)
    ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
    # Reject names that are not valid shell variable names.
    if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
      { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
    fi
    ac_feature=`echo $ac_feature| sed 's/-/_/g'`
    case "$ac_option" in
      *=*) ;;
      *) ac_optarg=yes ;;
    esac
    eval "enable_${ac_feature}='$ac_optarg'" ;;

  -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
  | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
  | --exec | --exe | --ex)
    ac_prev=exec_prefix ;;
  -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
  | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
  | --exec=* | --exe=* | --ex=*)
    exec_prefix="$ac_optarg" ;;

  -gas | --gas | --ga | --g)
    # Obsolete; use --with-gas.
    with_gas=yes ;;

  -help | --help | --hel | --he)
    # Omit some internal or obsolete options to make the list less imposing.
    # This message is too long to be a string in the A/UX 3.1 sh.
    cat << EOF
Usage: configure [options] [host]
Options: [defaults in brackets after descriptions]
Configuration:
  --cache-file=FILE       cache test results in FILE
  --help                  print this message
  --no-create             do not create output files
  --quiet, --silent       do not print \`checking...' messages
  --version               print the version of autoconf that created configure
Directory and file names:
  --prefix=PREFIX         install architecture-independent files in PREFIX
                          [$ac_default_prefix]
  --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
                          [same as prefix]
  --bindir=DIR            user executables in DIR [EPREFIX/bin]
  --sbindir=DIR           system admin executables in DIR [EPREFIX/sbin]
  --libexecdir=DIR        program executables in DIR [EPREFIX/libexec]
  --datadir=DIR           read-only architecture-independent data in DIR
                          [PREFIX/share]
  --sysconfdir=DIR        read-only single-machine data in DIR [PREFIX/etc]
  --sharedstatedir=DIR    modifiable architecture-independent data in DIR
                          [PREFIX/com]
  --localstatedir=DIR     modifiable single-machine data in DIR [PREFIX/var]
  --libdir=DIR            object code libraries in DIR [EPREFIX/lib]
  --includedir=DIR        C header files in DIR [PREFIX/include]
  --oldincludedir=DIR     C header files for non-gcc in DIR [/usr/include]
  --infodir=DIR           info documentation in DIR [PREFIX/info]
  --mandir=DIR            man documentation in DIR [PREFIX/man]
  --srcdir=DIR            find the sources in DIR [configure dir or ..]
  --program-prefix=PREFIX prepend PREFIX to installed program names
  --program-suffix=SUFFIX append SUFFIX to installed program names
  --program-transform-name=PROGRAM
                          run sed PROGRAM on installed program names
EOF
    cat << EOF
Host type:
  --build=BUILD           configure for building on BUILD [BUILD=HOST]
  --host=HOST             configure for HOST [guessed]
  --target=TARGET         configure for TARGET [TARGET=HOST]
Features and packages:
  --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
  --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
  --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
  --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
  --x-includes=DIR        X include files are in DIR
  --x-libraries=DIR       X library files are in DIR
EOF
    if test -n "$ac_help"; then
      echo "--enable and --with options recognized:$ac_help"
    fi
    exit 0 ;;

  -host | --host | --hos | --ho)
    ac_prev=host ;;
  -host=* | --host=* | --hos=* | --ho=*)
    host="$ac_optarg" ;;

  -includedir | --includedir | --includedi | --included | --include \
  | --includ | --inclu | --incl | --inc)
    ac_prev=includedir ;;
  -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
  | --includ=* | --inclu=* | --incl=* | --inc=*)
    includedir="$ac_optarg" ;;

  -infodir | --infodir | --infodi | --infod | --info | --inf)
    ac_prev=infodir ;;
  -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
    infodir="$ac_optarg" ;;

  -libdir | --libdir | --libdi | --libd)
    ac_prev=libdir ;;
  -libdir=* | --libdir=* | --libdi=* | --libd=*)
    libdir="$ac_optarg" ;;

  -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
  | --libexe | --libex | --libe)
    ac_prev=libexecdir ;;
  -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
  | --libexe=* | --libex=* | --libe=*)
    libexecdir="$ac_optarg" ;;

  -localstatedir | --localstatedir | --localstatedi | --localstated \
  | --localstate | --localstat | --localsta | --localst \
  | --locals | --local | --loca | --loc | --lo)
    ac_prev=localstatedir ;;
  -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
  | --localstate=* | --localstat=* | --localsta=* | --localst=* \
  | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
    localstatedir="$ac_optarg" ;;

  -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
    ac_prev=mandir ;;
  -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
    mandir="$ac_optarg" ;;

  -nfp | --nfp | --nf)
    # Obsolete; use --without-fp.
    with_fp=no ;;

  -no-create | --no-create | --no-creat | --no-crea | --no-cre \
  | --no-cr | --no-c)
    no_create=yes ;;

  -no-recursion | --no-recursion | --no-recursio | --no-recursi \
  | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
    no_recursion=yes ;;

  -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
  | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
  | --oldin | --oldi | --old | --ol | --o)
    ac_prev=oldincludedir ;;
  -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
  | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
  | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
    oldincludedir="$ac_optarg" ;;

  -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
    ac_prev=prefix ;;
  -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
    prefix="$ac_optarg" ;;

  -program-prefix | --program-prefix | --program-prefi | --program-pref \
  | --program-pre | --program-pr | --program-p)
    ac_prev=program_prefix ;;
  -program-prefix=* | --program-prefix=* | --program-prefi=* \
  | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
    program_prefix="$ac_optarg" ;;

  -program-suffix | --program-suffix | --program-suffi | --program-suff \
  | --program-suf | --program-su | --program-s)
    ac_prev=program_suffix ;;
  -program-suffix=* | --program-suffix=* | --program-suffi=* \
  | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
    program_suffix="$ac_optarg" ;;

  -program-transform-name | --program-transform-name \
  | --program-transform-nam | --program-transform-na \
  | --program-transform-n | --program-transform- \
  | --program-transform | --program-transfor \
  | --program-transfo | --program-transf \
  | --program-trans | --program-tran \
  | --progr-tra | --program-tr | --program-t)
    ac_prev=program_transform_name ;;
  -program-transform-name=* | --program-transform-name=* \
  | --program-transform-nam=* | --program-transform-na=* \
  | --program-transform-n=* | --program-transform-=* \
  | --program-transform=* | --program-transfor=* \
  | --program-transfo=* | --program-transf=* \
  | --program-trans=* | --program-tran=* \
  | --progr-tra=* | --program-tr=* | --program-t=*)
    program_transform_name="$ac_optarg" ;;

  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
  | -silent | --silent | --silen | --sile | --sil)
    silent=yes ;;

  -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
    ac_prev=sbindir ;;
  -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
  | --sbi=* | --sb=*)
    sbindir="$ac_optarg" ;;

  -sharedstatedir | --sharedstatedir | --sharedstatedi \
  | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
  | --sharedst | --shareds | --shared | --share | --shar \
  | --sha | --sh)
    ac_prev=sharedstatedir ;;
  -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
  | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
  | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
  | --sha=* | --sh=*)
    sharedstatedir="$ac_optarg" ;;

  -site | --site | --sit)
    ac_prev=site ;;
  -site=* | --site=* | --sit=*)
    site="$ac_optarg" ;;

  -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
    ac_prev=srcdir ;;
  -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
    srcdir="$ac_optarg" ;;

  -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
  | --syscon | --sysco | --sysc | --sys | --sy)
    ac_prev=sysconfdir ;;
  -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
  | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
    sysconfdir="$ac_optarg" ;;

  -target | --target | --targe | --targ | --tar | --ta | --t)
    ac_prev=target ;;
  -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
    target="$ac_optarg" ;;

  -v | -verbose | --verbose | --verbos | --verbo | --verb)
    verbose=yes ;;

  -version | --version | --versio | --versi | --vers)
    echo "configure generated by autoconf version 2.13"
    exit 0 ;;

  -with-* | --with-*)
    ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
    # Reject names that are not valid shell variable names.
    if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
      { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
    fi
    ac_package=`echo $ac_package| sed 's/-/_/g'`
    case "$ac_option" in
      *=*) ;;
      *) ac_optarg=yes ;;
    esac
    eval "with_${ac_package}='$ac_optarg'" ;;

  -without-* | --without-*)
    ac_package=`echo $ac_option|sed -e 's/-*without-//'`
    # Reject names that are not valid shell variable names.
    if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
      { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
    fi
    ac_package=`echo $ac_package| sed 's/-/_/g'`
    eval "with_${ac_package}=no" ;;

  --x)
    # Obsolete; use --with-x.
    with_x=yes ;;

  -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
  | --x-incl | --x-inc | --x-in | --x-i)
    ac_prev=x_includes ;;
  -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
  | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
    x_includes="$ac_optarg" ;;

  -x-libraries | --x-libraries | --x-librarie | --x-librari \
  | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
    ac_prev=x_libraries ;;
  -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
  | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
    x_libraries="$ac_optarg" ;;

  -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
    ;;

  *)
    if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
      echo "configure: warning: $ac_option: invalid host type" 1>&2
    fi
    if test "x$nonopt" != xNONE; then
      { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
    fi
    nonopt="$ac_option"
    ;;

  esac
done

if test -n "$ac_prev"; then
  { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
fi

trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15

# File descriptor usage:
# 0 standard input
# 1 file creation
# 2 errors and warnings
# 3 some systems may open it to /dev/tty
# 4 used on the Kubota Titan
# 6 checking for... messages and results
# 5 compiler messages saved in config.log
if test "$silent" = yes; then
  exec 6>/dev/null
else
  exec 6>&1
fi
exec 5>./config.log

echo "\
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
" 1>&5

# Strip out --no-create and --no-recursion so they do not pile up.
# Also quote any args containing shell metacharacters.
ac_configure_args=
for ac_arg
do
  case "$ac_arg" in
  -no-create | --no-create | --no-creat | --no-crea | --no-cre \
  | --no-cr | --no-c) ;;
  -no-recursion | --no-recursion | --no-recursio | --no-recursi \
  | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
  *" "*|*"	"*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
  ac_configure_args="$ac_configure_args '$ac_arg'" ;;
  *) ac_configure_args="$ac_configure_args $ac_arg" ;;
  esac
done

# NLS nuisances.
# Only set these to C if already set.  These must not be set unconditionally
# because not all systems understand e.g. LANG=C (notably SCO).
# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
# Non-C LC_CTYPE values break the ctype check.
if test "${LANG+set}"   = set; then LANG=C;   export LANG;   fi
if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
if test "${LC_CTYPE+set}"    = set; then LC_CTYPE=C;    export LC_CTYPE;    fi

# confdefs.h avoids OS command line length limits that DEFS can exceed.
rm -rf conftest* confdefs.h
# AIX cpp loses on an empty file, so make sure it contains at least a newline.
echo > confdefs.h

# A filename unique to this package, relative to the directory that
# configure is in, which we can look for to find out if srcdir is correct.
ac_unique_file=Makefile.am

# Find the source files, if location was not specified.
if test -z "$srcdir"; then
  ac_srcdir_defaulted=yes
  # Try the directory containing this script, then its parent.
  ac_prog=$0
  ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
  test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
  srcdir=$ac_confdir
  if test ! -r $srcdir/$ac_unique_file; then
    srcdir=..
  fi
else
  ac_srcdir_defaulted=no
fi
if test ! -r $srcdir/$ac_unique_file; then
  if test "$ac_srcdir_defaulted" = yes; then
    { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
  else
    { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
  fi
fi
srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`

# Prefer explicitly selected file to automatically selected ones.
if test -z "$CONFIG_SITE"; then
  if test "x$prefix" != xNONE; then
    CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
  else
    CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
  fi
fi
for ac_site_file in $CONFIG_SITE; do
  if test -r "$ac_site_file"; then
    echo "loading site script $ac_site_file"
    . "$ac_site_file"
  fi
done

if test -r "$cache_file"; then
  echo "loading cache $cache_file"
  . $cache_file
else
  echo "creating cache $cache_file"
  > $cache_file
fi

ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross

ac_exeext=
ac_objext=o
if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
  # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
  if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
    ac_n= ac_c='
' ac_t='	'
  else
    ac_n=-n ac_c= ac_t=
  fi
else
  ac_n= ac_c='\c' ac_t=
fi




# Check that all files in MANIFEST exist (if MANIFEST exists, of course :-)
if test -f $srcdir/MANIFEST
then
  echo $ac_n "checking distribution consistency""... $ac_c" 1>&6
echo "configure:664: checking distribution consistency" >&5
  cat $srcdir/MANIFEST | while read afile
  do
    if test ! -f $srcdir/$afile
    then
      echo "configure: warning: file $afile missing from distribution" 1>&2
    fi
  done
  echo "$ac_t""done" 1>&6
fi





ac_aux_dir=
for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
  if test -f $ac_dir/install-sh; then
    ac_aux_dir=$ac_dir
    ac_install_sh="$ac_aux_dir/install-sh -c"
    break
  elif test -f $ac_dir/install.sh; then
    ac_aux_dir=$ac_dir
    ac_install_sh="$ac_aux_dir/install.sh -c"
    break
  fi
done
if test -z "$ac_aux_dir"; then
  { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; }
fi
ac_config_guess=$ac_aux_dir/config.guess
ac_config_sub=$ac_aux_dir/config.sub
ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.


# Do some error checking and defaulting for the host and target type.
# The inputs are:
#    configure --host=HOST --target=TARGET --build=BUILD NONOPT
#
# The rules are:
# 1. You are not allowed to specify --host, --target, and nonopt at the
#    same time.
# 2. Host defaults to nonopt.
# 3. If nonopt is not specified, then host defaults to the current host,
#    as determined by config.guess.
# 4. Target and build default to nonopt.
# 5. If nonopt is not specified, then target and build default to host.

# The aliases save the names the user supplied, while $host etc.
# will get canonicalized.
case $host---$target---$nonopt in
NONE---*---* | *---NONE---* | *---*---NONE) ;;
*) { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } ;;
esac


# Make sure we can run config.sub.
if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then :
else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
fi

echo $ac_n "checking host system type""... $ac_c" 1>&6
echo "configure:726: checking host system type" >&5

host_alias=$host
case "$host_alias" in
NONE)
  case $nonopt in
  NONE)
    if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then :
    else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; }
    fi ;;
  *) host_alias=$nonopt ;;
  esac ;;
esac

host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias`
host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
echo "$ac_t""$host" 1>&6

echo $ac_n "checking target system type""... $ac_c" 1>&6
echo "configure:747: checking target system type" >&5

target_alias=$target
case "$target_alias" in
NONE)
  case $nonopt in
  NONE) target_alias=$host_alias ;;
  *) target_alias=$nonopt ;;
  esac ;;
esac

target=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $target_alias`
target_cpu=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
target_vendor=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
target_os=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
echo "$ac_t""$target" 1>&6

echo $ac_n "checking build system type""... $ac_c" 1>&6
echo "configure:765: checking build system type" >&5

build_alias=$build
case "$build_alias" in
NONE)
  case $nonopt in
  NONE) build_alias=$host_alias ;;
  *) build_alias=$nonopt ;;
  esac ;;
esac

build=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $build_alias`
build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
echo "$ac_t""$build" 1>&6

test "$host_alias" != "$target_alias" &&
  test "$program_prefix$program_suffix$program_transform_name" = \
    NONENONEs,x,x, &&
  program_prefix=${target_alias}-

echo $ac_n "checking cached information""... $ac_c" 1>&6
echo "configure:788: checking cached information" >&5
hostcheck="$target"
if eval "test \"`echo '$''{'ac_cv_hostcheck'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
   ac_cv_hostcheck="$hostcheck" 
fi

if test "$ac_cv_hostcheck" != "$hostcheck"; then
  echo "$ac_t""changed" 1>&6
  echo "configure: warning: config.cache from a different target platform already exists!" 1>&2
  { echo "configure: error: you must do 'make distclean' first to compile for different host or different parameters." 1>&2; exit 1; }
else
  echo "$ac_t""ok" 1>&6
fi

am__api_version="1.4"
# Find a good install program.  We prefer a C program (faster),
# so one script is as good as another.  But avoid the broken or
# incompatible versions:
# SysV /etc/install, /usr/sbin/install
# SunOS /usr/etc/install
# IRIX /sbin/install
# AIX /bin/install
# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
# AFS /usr/afsws/bin/install, which mishandles nonexistent args
# 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:817: 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
else
    IFS="${IFS= 	}"; ac_save_IFS="$IFS"; IFS=":"
  for ac_dir in $PATH; do
    # Account for people who put trailing slashes in PATH elements.
    case "$ac_dir/" in
    /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
    *)
      # OSF1 and SCO ODT 3.0 have their own names for install.
      # Don't use installbsd from OSF since it installs stuff as root
      # by default.
      for ac_prog in ginstall scoinst install; do
        if test -f $ac_dir/$ac_prog; then
	  if test $ac_prog = install &&
            grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
	    # AIX install.  It has an incompatible calling convention.
	    :
	  else
	    ac_cv_path_install="$ac_dir/$ac_prog -c"
	    break 2
	  fi
	fi
      done
      ;;
    esac
  done
  IFS="$ac_save_IFS"

fi
  if test "${ac_cv_path_install+set}" = set; then
    INSTALL="$ac_cv_path_install"
  else
    # As a last resort, use the slow shell script.  We don't cache a
    # path for INSTALL within a source directory, because that will
    # break other packages using the cache if that directory is
    # removed, or if the path is relative.
    INSTALL="$ac_install_sh"
  fi
fi
echo "$ac_t""$INSTALL" 1>&6

# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
# It thinks the first close brace ends the variable substitution.
test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'

test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'

test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'

echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6
echo "configure:870: checking whether build environment is sane" >&5
# Just in case
sleep 1
echo timestamp > conftestfile
# Do `set' in a subshell so we don't clobber the current shell's
# arguments.  Must try -L first in case configure is actually a
# symlink; some systems play weird games with the mod time of symlinks
# (eg FreeBSD returns the mod time of the symlink's containing
# directory).
if (
   set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
   if test "$*" = "X"; then
      # -L didn't work.
      set X `ls -t $srcdir/configure conftestfile`
   fi
   if test "$*" != "X $srcdir/configure conftestfile" \
      && test "$*" != "X conftestfile $srcdir/configure"; then

      # If neither matched, then we have a broken ls.  This can happen
      # if, for instance, CONFIG_SHELL is bash and it inherits a
      # broken ls alias from the environment.  This has actually
      # happened.  Such a system could not be considered "sane".
      { echo "configure: error: ls -t appears to fail.  Make sure there is not a broken
alias in your environment" 1>&2; exit 1; }
   fi

   test "$2" = conftestfile
   )
then
   # Ok.
   :
else
   { echo "configure: error: newly created file is older than distributed files!
Check your system clock" 1>&2; exit 1; }
fi
rm -f conftest*
echo "$ac_t""yes" 1>&6
if test "$program_transform_name" = s,x,x,; then
  program_transform_name=
else
  # Double any \ or $.  echo might interpret backslashes.
  cat <<\EOF_SED > conftestsed
s,\\,\\\\,g; s,\$,$$,g
EOF_SED
  program_transform_name="`echo $program_transform_name|sed -f conftestsed`"
  rm -f conftestsed
fi
test "$program_prefix" != NONE &&
  program_transform_name="s,^,${program_prefix},; $program_transform_name"
# Use a double $ so make ignores it.
test "$program_suffix" != NONE &&
  program_transform_name="s,\$\$,${program_suffix},; $program_transform_name"

# sed with no file args requires a program.
test "$program_transform_name" = "" && program_transform_name="s,x,x,"

echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
echo "configure:927: 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
else
  cat > conftestmake <<\EOF
all:
	@echo 'ac_maketemp="${MAKE}"'
EOF
# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=`
if test -n "$ac_maketemp"; then
  eval ac_cv_prog_make_${ac_make}_set=yes
else
  eval ac_cv_prog_make_${ac_make}_set=no
fi
rm -f conftestmake
fi
if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  SET_MAKE=
else
  echo "$ac_t""no" 1>&6
  SET_MAKE="MAKE=${MAKE-make}"
fi


PACKAGE=qstree

VERSION=1.0

if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
  { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; }
fi
cat >> confdefs.h <<EOF
#define PACKAGE "$PACKAGE"
EOF

cat >> confdefs.h <<EOF
#define VERSION "$VERSION"
EOF



missing_dir=`cd $ac_aux_dir && pwd`
echo $ac_n "checking for working aclocal-${am__api_version}""... $ac_c" 1>&6
echo "configure:973: checking for working aclocal-${am__api_version}" >&5
# Run test in a subshell; some versions of sh will print an error if
# an executable is not found, even if stderr is redirected.
# Redirect stdin to placate older versions of autoconf.  Sigh.
if (aclocal-${am__api_version} --version) < /dev/null > /dev/null 2>&1; then
   ACLOCAL=aclocal-${am__api_version}
   echo "$ac_t""found" 1>&6
else
   ACLOCAL="$missing_dir/missing aclocal-${am__api_version}"
   echo "$ac_t""missing" 1>&6
fi

echo $ac_n "checking for working autoconf""... $ac_c" 1>&6
echo "configure:986: checking for working autoconf" >&5
# Run test in a subshell; some versions of sh will print an error if
# an executable is not found, even if stderr is redirected.
# Redirect stdin to placate older versions of autoconf.  Sigh.
if (autoconf --version) < /dev/null > /dev/null 2>&1; then
   AUTOCONF=autoconf
   echo "$ac_t""found" 1>&6
else
   AUTOCONF="$missing_dir/missing autoconf"
   echo "$ac_t""missing" 1>&6
fi

echo $ac_n "checking for working automake-${am__api_version}""... $ac_c" 1>&6
echo "configure:999: checking for working automake-${am__api_version}" >&5
# Run test in a subshell; some versions of sh will print an error if
# an executable is not found, even if stderr is redirected.
# Redirect stdin to placate older versions of autoconf.  Sigh.
if (automake-${am__api_version} --version) < /dev/null > /dev/null 2>&1; then
   AUTOMAKE=automake-${am__api_version}
   echo "$ac_t""found" 1>&6
else
   AUTOMAKE="$missing_dir/missing automake-${am__api_version}"
   echo "$ac_t""missing" 1>&6
fi

echo $ac_n "checking for working autoheader""... $ac_c" 1>&6
echo "configure:1012: checking for working autoheader" >&5
# Run test in a subshell; some versions of sh will print an error if
# an executable is not found, even if stderr is redirected.
# Redirect stdin to placate older versions of autoconf.  Sigh.
if (autoheader --version) < /dev/null > /dev/null 2>&1; then
   AUTOHEADER=autoheader
   echo "$ac_t""found" 1>&6
else
   AUTOHEADER="$missing_dir/missing autoheader"
   echo "$ac_t""missing" 1>&6
fi

echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6
echo "configure:1025: checking for working makeinfo" >&5
# Run test in a subshell; some versions of sh will print an error if
# an executable is not found, even if stderr is redirected.
# Redirect stdin to placate older versions of autoconf.  Sigh.
if (makeinfo --version) < /dev/null > /dev/null 2>&1; then
   MAKEINFO=makeinfo
   echo "$ac_t""found" 1>&6
else
   MAKEINFO="$missing_dir/missing makeinfo"
   echo "$ac_t""missing" 1>&6
fi



# Compilation environment requires automake to be at least 1.4
if test "x$AUTOMAKE" = "xautomake"
then
  if ($AUTOMAKE --version | egrep 'automake.* 1\.[456789]') 2>/dev/null >/dev/null
  then
    :
  else
    echo "configure: warning: automake is not (at least) version 1.4" 1>&2
    AUTOMAKE="$missing_dir/missing automake"
  fi
fi

# Compilation environment requires autoconf to be at least 2.13
if test "x$AUTOCONF" = "xautoconf"
then
  # this should match any 2.2* (2.3* etc..) and 2.1x where x >= 3.
  if ($AUTOCONF --version | egrep '(Autoconf version|autoconf \(GNU Autoconf\)).* [23456789]\.([23456789]|1[3456789])') 2>/dev/null >/dev/null
  then
    :
  else
    echo "configure: warning: autoconf is not (at least) version 2.13" 1>&2
    AUTOCONF="$missing_dir/missing autoconf"
  fi
fi

# XXX temporarily force no optimization unless explicitly requested to
# ease debugging.

echo $ac_n "checking whether building in source directory""... $ac_c" 1>&6
echo "configure:1068: checking whether building in source directory" >&5
tmp_builddir=`pwd`;
tmp_srcdir=`cd $srcdir; pwd`;


if test "$tmp_srcdir" = "$tmp_builddir"; then
  SRCDIR_IS_BUILDDIR_TRUE=
  SRCDIR_IS_BUILDDIR_FALSE='#'
else
  SRCDIR_IS_BUILDDIR_TRUE='#'
  SRCDIR_IS_BUILDDIR_FALSE=
fi
if test "$tmp_srcdir" = "$tmp_builddir"; then
  echo "$ac_t""yes" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

# Check whether --enable-profile or --disable-profile was given.
if test "${enable_profile+set}" = set; then
  enableval="$enable_profile"
   build_profile=$enableval
    echo "$ac_t""configuring for building $enableval." 1>&6 
else
   if ! test -r $srcdir/sshdistdefs.h; then
      { echo "configure: error: build profile (--enable-profile=ARG) not specified." 1>&2; exit 1; }
    fi 
fi


echo $ac_n "checking "using purify"""... $ac_c" 1>&6
echo "configure:1099: checking "using purify"" >&5
# Check whether --with-purify or --without-purify was given.
if test "${with_purify+set}" = set; then
  withval="$with_purify"
   case "$withval" in
    no)
	echo "$ac_t""no" 1>&6
	;;
    yes)
	with_purify=purify
	echo "$ac_t""purify" 1>&6
	;;
    *)
	echo "$ac_t""$withval" 1>&6
	;;
  esac 
else
  echo "$ac_t""no" 1>&6

fi


#
# vx_suffix is used if targeting VxWorks embedded OS
#
vx_suffix=""
case "$target" in
  i*86-*-vxworks*|x86-*-vxworks|pentium-*-vxworks*)
    vx_suffix=386
    CPPFLAGS="$CPPFLAGS -DCPU=$CPU"
    # Little endianess is set if the target is of type iX86.
    ac_cv_c_bigendian=no
    ssh_cv_cc_R_require=no
    ;;
  i960-*-vxworks*)
    vx_suffix=960
    CPPFLAGS="$CPPFLAGS -DCPU=$CPU"
    # Little endianess is set if the target is of type i960.
    ac_cv_c_bigendian=no
    ssh_cv_cc_R_require=no
    ;;
  powerpc*-*-vxworks*)
    vx_suffix=ppc
    CPPFLAGS="$CPPFLAGS -DCPU=$CPU"
    # Big endianess is set if the target is of type powerpc.
    ac_cv_c_bigendian=yes
    ssh_cv_cc_R_require=no
    ;;
  mips-*-vxworks*)
    vx_suffix=mips
    CPPFLAGS="$CPPFLAGS -DCPU=$CPU"
    # Big endianess is set if the target is of type mips.
    ac_cv_c_bigendian=yes
    ssh_cv_cc_R_require=no
    ;;
  mipsel-*-vxworks*)
    vx_suffix=mips
    CPPFLAGS="$CPPFLAGS -DCPU=$CPU"
    # Little endianness is set if the target is of type mipsel.
    ac_cv_c_bigendian=no
    ssh_cv_cc_R_require=no
    ;;
  sh-*-vxworks*)
    vx_suffix=sh
    CPPFLAGS="$CPPFLAGS -DCPU=$CPU"
    # Big endianess is set if the target is of type 'sh'.
    ac_cv_c_bigendian=yes
    ssh_cv_cc_R_require=no
    ;;
  arm-*-vxworks*)
    vx_suffix=arm
    CPPFLAGS="$CPPFLAGS -DCPU=$CPU"
    # Big endianess is set if the target is of type 'arm'.
    ac_cv_c_bigendian=yes
    ssh_cv_cc_R_require=no
    ;;
  armle-*-vxworks*)
    vx_suffix=arm
    CPPFLAGS="$CPPFLAGS -DCPU=$CPU"
    #CFLAGS="$CFLAGS -DVXWORKS"
    # Little endianess is set if the target is of type 'armel'.
    ac_cv_c_bigendian=no
    ssh_cv_cc_R_require=no
    ;;
  *)
    ;;
esac

#
# Use /usr/xpg4/bin/sh on Solaris - works much better with some Makefiles
#
if test "X$WIND_HOST_TYPE" = "Xsun4-solaris2"; then
  if test -f /usr/xpg4/bin/sh; then
    CONFIG_SHELL=/usr/xpg4/bin/sh
    SHELL=$CONFIG_SHELL
    echo "configure: Solaris host platform - using /usr/xpg4/bin/sh" 1>&6
  else
    echo "configure: error: /usr/xpg4/bin/sh NOT FOUND" 1>&2
    exit 1
  fi
fi

# If configuring for Tornado and GNU toolchain, set compiler options
if test "X$vx_suffix" != "X"; then
  # Check that Tornado environment variables are set
  if test "X${CPU}" = "X"; then
    { echo "configure: error: CPU environment variable for target platform is not set" 1>&2; exit 1; }
  fi
  if test "X$WIND_BASE" = "X"; then
    { echo "configure: error: WIND_BASE variable unset" 1>&2; exit 1; }
  fi
  if test "X$WIND_HOST_TYPE" = "X"; then
    { echo "configure: error: WIND_HOST_TYPE variable unset" 1>&2; exit 1; }
  fi

  # -Dmain=vxmain removes symbol main() from resulting objects,
  # otherwise linker will complain.
  # -DVXWORKS is used by some parts of SSH code
  # -D_WRS_KERNEL is needed with PNE 2.2 IPV6 and has to be set when running
  # compile tests later in this file
  CPPFLAGS="-Dmain=vxmain -DVXWORKS $CPPFLAGS"

  # Check whether --with-kernel-version was given
  if test "${with_kernel_version+set}" = set; then
    withval="$with_kernel_version"
    case $withval in
        *PNE)
      CPPFLAGS="-DVXWORKS_PNE $CPPFLAGS"
      ;;
        *5.5.1)
      CPPFLAGS="-DVXWORKS_551 $CPPFLAGS"
      ;;
        *PCD_1.1)
      CPPFLAGS="-DVXWORKS_551 -DVXWORKS_IPV6 $CPPFLAGS"
      ;;
        *PNE_2.2)
      CPPFLAGS="-DVXWORKS_PNE -DVXWORKS_IPV6 -D_WRS_KERNEL $CPPFLAGS"
      ;;
    esac
  fi
fi

# Cross compling support //teiste
for ac_prog in gcc cc
do
# 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:1247: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_BUILD_CC'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test -n "$BUILD_CC"; then
  ac_cv_prog_BUILD_CC="$BUILD_CC" # Let the user override the test.
else
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_prog_BUILD_CC="$ac_prog"
      break
    fi
  done
  IFS="$ac_save_ifs"
fi
fi
BUILD_CC="$ac_cv_prog_BUILD_CC"
if test -n "$BUILD_CC"; then
  echo "$ac_t""$BUILD_CC" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

test -n "$BUILD_CC" && break
done

if test "$host_alias" != "$target_alias"; then
  for ac_prog in ${target_alias}-gcc ${target_alias}-cc gcc${vx_suffix} cc${vx_suffix}
do
# 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:1282: 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
  if test -n "$CC"; then
  ac_cv_prog_CC="$CC" # Let the user override the test.
else
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_prog_CC="$ac_prog"
      break
    fi
  done
  IFS="$ac_save_ifs"
fi
fi
CC="$ac_cv_prog_CC"
if test -n "$CC"; then
  echo "$ac_t""$CC" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

test -n "$CC" && break
done

  for ac_prog in ${target_alias}-ranlib ranlib${vx_suffix}
do
# 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:1316: 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
  if test -n "$RANLIB"; then
  ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
else
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_prog_RANLIB="$ac_prog"
      break
    fi
  done
  IFS="$ac_save_ifs"
fi
fi
RANLIB="$ac_cv_prog_RANLIB"
if test -n "$RANLIB"; then
  echo "$ac_t""$RANLIB" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

test -n "$RANLIB" && break
done

  for ac_prog in ${target_alias}-ar ar${vx_suffix}
do
# 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:1350: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test -n "$AR"; then
  ac_cv_prog_AR="$AR" # Let the user override the test.
else
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_prog_AR="$ac_prog"
      break
    fi
  done
  IFS="$ac_save_ifs"
fi
fi
AR="$ac_cv_prog_AR"
if test -n "$AR"; then
  echo "$ac_t""$AR" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

test -n "$AR" && break
done

  for ac_prog in ${target_alias}-ld ld${vx_suffix}
do
# 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:1384: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_LD'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test -n "$LD"; then
  ac_cv_prog_LD="$LD" # Let the user override the test.
else
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_prog_LD="$ac_prog"
      break
    fi
  done
  IFS="$ac_save_ifs"
fi
fi
LD="$ac_cv_prog_LD"
if test -n "$LD"; then
  echo "$ac_t""$LD" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

test -n "$LD" && break
done

fi

# 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:1418: 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
  if test -n "$CC"; then
  ac_cv_prog_CC="$CC" # Let the user override the test.
else
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_prog_CC="gcc"
      break
    fi
  done
  IFS="$ac_save_ifs"
fi
fi
CC="$ac_cv_prog_CC"
if test -n "$CC"; then
  echo "$ac_t""$CC" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

if test -z "$CC"; then
  # 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:1448: 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
  if test -n "$CC"; then
  ac_cv_prog_CC="$CC" # Let the user override the test.
else
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_prog_rejected=no
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
        ac_prog_rejected=yes
	continue
      fi
      ac_cv_prog_CC="cc"
      break
    fi
  done
  IFS="$ac_save_ifs"
if test $ac_prog_rejected = yes; then
  # We found a bogon in the path, so make sure we never use it.
  set dummy $ac_cv_prog_CC
  shift
  if test $# -gt 0; then
    # We chose a different compiler from the bogus one.
    # However, it has the same basename, so the bogon will be chosen
    # first if we set CC to just the basename; use the full file name.
    shift
    set dummy "$ac_dir/$ac_word" "$@"
    shift
    ac_cv_prog_CC="$@"
  fi
fi
fi
fi
CC="$ac_cv_prog_CC"
if test -n "$CC"; then
  echo "$ac_t""$CC" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

  if test -z "$CC"; then
    case "`uname -s`" in
    *win32* | *WIN32*)
      # 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:1499: 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
  if test -n "$CC"; then
  ac_cv_prog_CC="$CC" # Let the user override the test.
else
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_prog_CC="cl"
      break
    fi
  done
  IFS="$ac_save_ifs"
fi
fi
CC="$ac_cv_prog_CC"
if test -n "$CC"; then
  echo "$ac_t""$CC" 1>&6
else
  echo "$ac_t""no" 1>&6
fi
 ;;
    esac
  fi
  test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
fi

echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
echo "configure:1531: 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.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross

cat > conftest.$ac_ext << EOF

#line 1542 "configure"
#include "confdefs.h"

main(){return(0);}
EOF
if { (eval echo configure:1547: \"$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
    ac_cv_prog_cc_cross=no
  else
    ac_cv_prog_cc_cross=yes
  fi
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  ac_cv_prog_cc_works=no
fi
rm -fr conftest*
ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross

echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
if test $ac_cv_prog_cc_works = no; then
  { 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:1573: 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:1578: 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
  cat > conftest.c <<EOF
#ifdef __GNUC__
  yes;
#endif
EOF
if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1587: \"$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
fi
fi

echo "$ac_t""$ac_cv_prog_gcc" 1>&6

if test $ac_cv_prog_gcc = yes; then
  GCC=yes
else
  GCC=
fi

ac_test_CFLAGS="${CFLAGS+set}"
ac_save_CFLAGS="$CFLAGS"
CFLAGS=
echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
echo "configure:1606: 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
  echo 'void f(){}' > conftest.c
if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
  ac_cv_prog_cc_g=yes
else
  ac_cv_prog_cc_g=no
fi
rm -f conftest*

fi

echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
if test "$ac_test_CFLAGS" = set; then
  CFLAGS="$ac_save_CFLAGS"
elif test $ac_cv_prog_cc_g = yes; then
  if test "$GCC" = yes; then
    CFLAGS="-g -O2"
  else
    CFLAGS="-g"
  fi
else
  if test "$GCC" = yes; then
    CFLAGS="-O2"
  else
    CFLAGS=
  fi
fi


# Old automake-1.4 and autoconf 2.13 does not support AM_PROG_AS, so
# we cannot add it here.... Newer automake/autoconf's complain that you
# need it, but as it is just warning we are going to ignore it.
# AM_PROG_AS

if test $host != $build; then
  ac_tool_prefix=${host_alias}-
else
  ac_tool_prefix=
fi

# Extract the first word of "${ac_tool_prefix}ld", so it can be a program name with args.
set dummy ${ac_tool_prefix}ld; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:1652: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_LD'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test -n "$LD"; then
  ac_cv_prog_LD="$LD" # Let the user override the test.
else
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_prog_LD="${ac_tool_prefix}ld"
      break
    fi
  done
  IFS="$ac_save_ifs"
  test -z "$ac_cv_prog_LD" && ac_cv_prog_LD="ld"
fi
fi
LD="$ac_cv_prog_LD"
if test -n "$LD"; then
  echo "$ac_t""$LD" 1>&6
else
  echo "$ac_t""no" 1>&6
fi




echo $ac_n "checking if -R is also required when using -L to get programs to actually work""... $ac_c" 1>&6
echo "configure:1683: checking if -R is also required when using -L to get programs to actually work" >&5
if eval "test \"`echo '$''{'ssh_cv_cc_R_require'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  case `(uname -sr) 2>/dev/null` in
  "SunOS 5"*)
    ssh_cv_cc_R_require=yes
    ;;
  *)
    ssh_cv_cc_R_require=no
    ;;
  esac
fi

echo "$ac_t""$ssh_cv_cc_R_require" 1>&6
if test "$ssh_cv_cc_R_require" = "yes"; then
  echo $ac_n "checking if space is required after -R""... $ac_c" 1>&6
echo "configure:1700: checking if space is required after -R" >&5
if eval "test \"`echo '$''{'ssh_cv_cc_R_space_require'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
    ssh_r_save_LIBS="$LIBS"; LIBS="$LIBS -R/usr/lib"
    cat > conftest.$ac_ext <<EOF
#line 1707 "configure"
#include "confdefs.h"

int main() {

; return 0; }
EOF
if { (eval echo configure:1714: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  ssh_cc_R_nospace=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  ssh_cc_R_nospace=no
fi
rm -f conftest*
    if test $ssh_cc_R_nospace = yes; then
      ssh_cv_cc_R_space_require=no
    else
      LIBS="$ssh_r_save_LIBS -R $x_libraries"
      cat > conftest.$ac_ext <<EOF
#line 1729 "configure"
#include "confdefs.h"

int main() {

; return 0; }
EOF
if { (eval echo configure:1736: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  ssh_cc_R_space=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  ssh_cc_R_space=no
fi
rm -f conftest*
      if test $ssh_cc_R_space = yes; then
        ssh_cv_cc_R_space_require=yes
      else
        ssh_cv_cc_R_space_require=unknown
      fi
    fi
    LIBS="$ssh_r_save_LIBS"
  
fi

echo "$ac_t""$ssh_cv_cc_R_space_require" 1>&6
  if test "$ssh_cv_cc_R_space_require" = "yes"; then
    ssh_cc_R_space=" "
  else
    ssh_cc_R_space=""
  fi
  ssh_cc_R="yes"
fi

# Automake seems to want this if there are any .cpp files in the tree...
# No, it does not need it, commented out, because on some environments we
# do not have C++ compiler at all //kivinen

if test "$GCC"; then
     CFLAGS_store="$CFLAGS"
  CFLAGS="$CFLAGS -Wno-pointer-sign"
  echo $ac_n "checking whether compiler accepts -Wno-pointer-sign""... $ac_c" 1>&6
echo "configure:1773: checking whether compiler accepts -Wno-pointer-sign" >&5
  cat > conftest.$ac_ext <<EOF
#line 1775 "configure"
#include "confdefs.h"

int main() {

; return 0; }
EOF
if { (eval echo configure:1782: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  echo "$ac_t""yes" 1>&6
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  echo "$ac_t""no" 1>&6
                 CFLAGS="$CFLAGS_store"
                 
fi
rm -f conftest*
  unset CFLAGS_store

fi

case "$target" in
  alpha*-dec-osf*)
    # If we are not using gcc, we want the ansi version of cc.
    if test -z "$GCC"; then
       CFLAGS_store="$CFLAGS"
  CFLAGS="$CFLAGS -std1"
  echo $ac_n "checking whether compiler accepts -std1""... $ac_c" 1>&6
echo "configure:1805: checking whether compiler accepts -std1" >&5
  cat > conftest.$ac_ext <<EOF
#line 1807 "configure"
#include "confdefs.h"

int main() {

; return 0; }
EOF
if { (eval echo configure:1814: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  echo "$ac_t""yes" 1>&6
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  echo "$ac_t""no" 1>&6
                 CFLAGS="$CFLAGS_store"
                 
fi
rm -f conftest*
  unset CFLAGS_store

       CFLAGS_store="$CFLAGS"
  CFLAGS="$CFLAGS -warnprotos"
  echo $ac_n "checking whether compiler accepts -warnprotos""... $ac_c" 1>&6
echo "configure:1831: checking whether compiler accepts -warnprotos" >&5
  cat > conftest.$ac_ext <<EOF
#line 1833 "configure"
#include "confdefs.h"

int main() {

; return 0; }
EOF
if { (eval echo configure:1840: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  echo "$ac_t""yes" 1>&6
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  echo "$ac_t""no" 1>&6
                 CFLAGS="$CFLAGS_store"
                 
fi
rm -f conftest*
  unset CFLAGS_store

       CFLAGS_store="$CFLAGS"
  CFLAGS="$CFLAGS -msg_disable longdoublenyi"
  echo $ac_n "checking whether compiler accepts -msg_disable longdoublenyi""... $ac_c" 1>&6
echo "configure:1857: checking whether compiler accepts -msg_disable longdoublenyi" >&5
  cat > conftest.$ac_ext <<EOF
#line 1859 "configure"
#include "confdefs.h"

int main() {

; return 0; }
EOF
if { (eval echo configure:1866: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  echo "$ac_t""yes" 1>&6
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  echo "$ac_t""no" 1>&6
                 CFLAGS="$CFLAGS_store"
                 
fi
rm -f conftest*
  unset CFLAGS_store

       CFLAGS_store="$CFLAGS"
  CFLAGS="$CFLAGS -msg_disable longlongtype"
  echo $ac_n "checking whether compiler accepts -msg_disable longlongtype""... $ac_c" 1>&6
echo "configure:1883: checking whether compiler accepts -msg_disable longlongtype" >&5
  cat > conftest.$ac_ext <<EOF
#line 1885 "configure"
#include "confdefs.h"

int main() {

; return 0; }
EOF
if { (eval echo configure:1892: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  echo "$ac_t""yes" 1>&6
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  echo "$ac_t""no" 1>&6
                 CFLAGS="$CFLAGS_store"
                 
fi
rm -f conftest*
  unset CFLAGS_store

       CFLAGS_store="$CFLAGS"
  CFLAGS="$CFLAGS -msg_disable longlongsufx"
  echo $ac_n "checking whether compiler accepts -msg_disable longlongsufx""... $ac_c" 1>&6
echo "configure:1909: checking whether compiler accepts -msg_disable longlongsufx" >&5
  cat > conftest.$ac_ext <<EOF
#line 1911 "configure"
#include "confdefs.h"

int main() {

; return 0; }
EOF
if { (eval echo configure:1918: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  echo "$ac_t""yes" 1>&6
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  echo "$ac_t""no" 1>&6
                 CFLAGS="$CFLAGS_store"
                 
fi
rm -f conftest*
  unset CFLAGS_store

    fi
    CFLAGS="$CFLAGS -D_OSF_SOURCE"
    CFLAGS="$CFLAGS -D_XOPEN_SOURCE=500"
    CFLAGS="$CFLAGS -D_XOPEN_SOURCE_EXTENDED"
    CFLAGS="$CFLAGS -D_POSIC_C_SOURCE=199309L"
    ;;
  *-dec-ultrix*)
    no_termios=yes
    ;;
  *-*-nextstep*)
    no_termios=yes
    ;;
  *-*-linux*|*-*-mklinux*)
    CFLAGS="-D_GNU_SOURCE $CFLAGS"
    ;;
  *-*-hpux*)
    # HPUX flags from jgotts@engin.umich.edu
    if test -z "$GCC"; then
       CFLAGS_store="$CFLAGS"
  CFLAGS="$CFLAGS -Ae"
  echo $ac_n "checking whether compiler accepts -Ae""... $ac_c" 1>&6
echo "configure:1953: checking whether compiler accepts -Ae" >&5
  cat > conftest.$ac_ext <<EOF
#line 1955 "configure"
#include "confdefs.h"

int main() {

; return 0; }
EOF
if { (eval echo configure:1962: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  echo "$ac_t""yes" 1>&6
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  echo "$ac_t""no" 1>&6
                 CFLAGS="$CFLAGS_store"
                 
fi
rm -f conftest*
  unset CFLAGS_store

      CFLAGS="$CFLAGS -D_HPUX_SOURCE"
    fi
    cat >> confdefs.h <<\EOF
#define HPUX_NONSTANDARD_X11_KLUDGE 1
EOF

    ;;
  *-ibm-aix*)
    # If we are not using gcc, we want the ansi version of cc.
    if test -z "$GCC"; then
       CFLAGS_store="$CFLAGS"
  CFLAGS="$CFLAGS -qlanglvl=ansi"
  echo $ac_n "checking whether compiler accepts -qlanglvl=ansi""... $ac_c" 1>&6
echo "configure:1989: checking whether compiler accepts -qlanglvl=ansi" >&5
  cat > conftest.$ac_ext <<EOF
#line 1991 "configure"
#include "confdefs.h"

int main() {

; return 0; }
EOF
if { (eval echo configure:1998: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  echo "$ac_t""yes" 1>&6
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  echo "$ac_t""no" 1>&6
                 CFLAGS="$CFLAGS_store"
                 
fi
rm -f conftest*
  unset CFLAGS_store

       CFLAGS_store="$CFLAGS"
  CFLAGS="$CFLAGS -qmaxmem=10240"
  echo $ac_n "checking whether compiler accepts -qmaxmem=10240""... $ac_c" 1>&6
echo "configure:2015: checking whether compiler accepts -qmaxmem=10240" >&5
  cat > conftest.$ac_ext <<EOF
#line 2017 "configure"
#include "confdefs.h"

int main() {

; return 0; }
EOF
if { (eval echo configure:2024: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  echo "$ac_t""yes" 1>&6
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  echo "$ac_t""no" 1>&6
                 CFLAGS="$CFLAGS_store"
                 
fi
rm -f conftest*
  unset CFLAGS_store

    fi
    ;;
esac

echo $ac_n "checking whether to enable optimizations""... $ac_c" 1>&6
echo "configure:2043: checking whether to enable optimizations" >&5
# Check whether --enable-compiler-optimizations or --disable-compiler-optimizations was given.
if test "${enable_compiler_optimizations+set}" = set; then
  enableval="$enable_compiler_optimizations"
   case "$enableval" in
  yes)
    echo "$ac_t""yes" 1>&6
    compiler_optimizations=yes
    ;;
  size)
    echo "$ac_t""yes (size)" 1>&6
    compiler_optimizations=yes
    compiler_size_optimizations=yes
    ;;
  *)
    echo "$ac_t""no" 1>&6
    ;;
  esac
else
   echo "$ac_t""no" 1>&6
  compiler_optimizations=no
fi


# The default value corresponds to a server or desktop.
data_cache_size="256"
# Check whether --enable-data-cache or --disable-data-cache was given.
if test "${enable_data_cache+set}" = set; then
  enableval="$enable_data_cache"
   data_cache_size=$enableval
    echo "$ac_t""using data cache size of $enableval kB." 1>&6
  
fi

cat >> confdefs.h <<EOF
#define SSH_DATA_CACHE_SIZE $data_cache_size
EOF


insn_cache_size="256"
# Check whether --enable-insn-cache or --disable-insn-cache was given.
if test "${enable_insn_cache+set}" = set; then
  enableval="$enable_insn_cache"
   insn_cache_size=$enableval
    echo "$ac_t""using insn cache size of $enableval kB." 1>&6
  
fi

cat >> confdefs.h <<EOF
#define SSH_INSN_CACHE_SIZE $insn_cache_size
EOF



echo $ac_n "checking whether to minimize stack usage of compiled binaries""... $ac_c" 1>&6
echo "configure:2098: checking whether to minimize stack usage of compiled binaries" >&5
# Check whether --enable-minimal-stack or --disable-minimal-stack was given.
if test "${enable_minimal_stack+set}" = set; then
  enableval="$enable_minimal_stack"
   case "$enableval" in
  yes)
    echo "$ac_t""yes" 1>&6
    cat >> confdefs.h <<\EOF
#define MINIMAL_STACK 1
EOF

    ;;
  *)
    echo "$ac_t""no" 1>&6
    ;;
  esac 
else
  echo "$ac_t""no" 1>&6

fi


# Workaroud: VxWorks PNE 2.2.  Add an illegal option to fail all link tests.
# Those type of tests don't make sense for VxWorks anyway as the link would
# have to be against target libraries and produce VxWorks standalone image.

if test "X$vx_suffix" != "X"; then
  ac_link="$ac_link --W"
fi

echo $ac_n "checking for POSIXized ISC""... $ac_c" 1>&6
echo "configure:2129: checking for POSIXized ISC" >&5
if test -d /etc/conf/kconfig.d &&
  grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1
then
  echo "$ac_t""yes" 1>&6
  ISC=yes # If later tests want to check for ISC.
  cat >> confdefs.h <<\EOF
#define _POSIX_SOURCE 1
EOF

  if test "$GCC" = yes; then
    CC="$CC -posix"
  else
    CC="$CC -Xp"
  fi
else
  echo "$ac_t""no" 1>&6
  ISC=
fi



if test "X$compiler_optimizations" = "Xyes"; then
  if test "$ac_cv_prog_gcc" = "yes"; then
    case "$target" in
      alpha*-*-freebsd*)
        # Reportedly -O2 fails on FreeBSD/alpha.
        # Let me know when, and in which version, this is fixed.
         CFLAGS_store="$CFLAGS"
  CFLAGS="$CFLAGS -O"
  echo $ac_n "checking whether compiler accepts -O""... $ac_c" 1>&6
echo "configure:2160: checking whether compiler accepts -O" >&5
  cat > conftest.$ac_ext <<EOF
#line 2162 "configure"
#include "confdefs.h"

int main() {

; return 0; }
EOF
if { (eval echo configure:2169: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  echo "$ac_t""yes" 1>&6
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  echo "$ac_t""no" 1>&6
                 CFLAGS="$CFLAGS_store"
                 
fi
rm -f conftest*
  unset CFLAGS_store

        ;;
      *vxworks*)
	    CFLAGS="$CFLAGS -O2"
	    ;;
      *)
        if test "X$compiler_size_optimizations" = "Xyes"; then
	     CFLAGS_store="$CFLAGS"
  CFLAGS="$CFLAGS -Os"
  echo $ac_n "checking whether compiler accepts -Os""... $ac_c" 1>&6
echo "configure:2192: checking whether compiler accepts -Os" >&5
  cat > conftest.$ac_ext <<EOF
#line 2194 "configure"
#include "confdefs.h"

int main() {

; 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*
  echo "$ac_t""yes" 1>&6
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  echo "$ac_t""no" 1>&6
                 CFLAGS="$CFLAGS_store"
                 
fi
rm -f conftest*
  unset CFLAGS_store

	else
	     CFLAGS_store="$CFLAGS"
  CFLAGS="$CFLAGS -O2"
  echo $ac_n "checking whether compiler accepts -O2""... $ac_c" 1>&6
echo "configure:2219: checking whether compiler accepts -O2" >&5
  cat > conftest.$ac_ext <<EOF
#line 2221 "configure"
#include "confdefs.h"

int main() {

; return 0; }
EOF
if { (eval echo configure:2228: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  echo "$ac_t""yes" 1>&6
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  echo "$ac_t""no" 1>&6
                 CFLAGS="$CFLAGS_store"
                 
fi
rm -f conftest*
  unset CFLAGS_store

	fi
        ;;
    esac
  else
    case "$target" in
      alpha*-dec-osf*)
  	 CFLAGS_store="$CFLAGS"
  CFLAGS="$CFLAGS -g3 -O2"
  echo $ac_n "checking whether compiler accepts -g3 -O2""... $ac_c" 1>&6
echo "configure:2251: checking whether compiler accepts -g3 -O2" >&5
  cat > conftest.$ac_ext <<EOF
#line 2253 "configure"
#include "confdefs.h"

int main() {

; return 0; }
EOF
if { (eval echo configure:2260: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  echo "$ac_t""yes" 1>&6
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  echo "$ac_t""no" 1>&6
                 CFLAGS="$CFLAGS_store"
                  CFLAGS_store="$CFLAGS"
  CFLAGS="$CFLAGS -g3 -O"
  echo $ac_n "checking whether compiler accepts -g3 -O""... $ac_c" 1>&6
echo "configure:2272: checking whether compiler accepts -g3 -O" >&5
  cat > conftest.$ac_ext <<EOF
#line 2274 "configure"
#include "confdefs.h"

int main() {

; return 0; }
EOF
if { (eval echo configure:2281: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  echo "$ac_t""yes" 1>&6
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  echo "$ac_t""no" 1>&6
                 CFLAGS="$CFLAGS_store"
                  CFLAGS_store="$CFLAGS"
  CFLAGS="$CFLAGS -O"
  echo $ac_n "checking whether compiler accepts -O""... $ac_c" 1>&6
echo "configure:2293: checking whether compiler accepts -O" >&5
  cat > conftest.$ac_ext <<EOF
#line 2295 "configure"
#include "confdefs.h"

int main() {

; return 0; }
EOF
if { (eval echo configure:2302: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  echo "$ac_t""yes" 1>&6
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  echo "$ac_t""no" 1>&6
                 CFLAGS="$CFLAGS_store"
                 
fi
rm -f conftest*
  unset CFLAGS_store

fi
rm -f conftest*
  unset CFLAGS_store

fi
rm -f conftest*
  unset CFLAGS_store

  	;;
      ia64-hp-hpux*)
        echo "configure: warning: optimizations are experimentally enabled with HP-UX cc" 1>&2
  	 CFLAGS_store="$CFLAGS"
  CFLAGS="$CFLAGS -O2"
  echo $ac_n "checking whether compiler accepts -O2""... $ac_c" 1>&6
echo "configure:2330: checking whether compiler accepts -O2" >&5
  cat > conftest.$ac_ext <<EOF
#line 2332 "configure"
#include "confdefs.h"

int main() {

; return 0; }
EOF
if { (eval echo configure:2339: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  echo "$ac_t""yes" 1>&6
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  echo "$ac_t""no" 1>&6
                 CFLAGS="$CFLAGS_store"
                  CFLAGS_store="$CFLAGS"
  CFLAGS="$CFLAGS -O"
  echo $ac_n "checking whether compiler accepts -O""... $ac_c" 1>&6
echo "configure:2351: checking whether compiler accepts -O" >&5
  cat > conftest.$ac_ext <<EOF
#line 2353 "configure"
#include "confdefs.h"

int main() {

; return 0; }
EOF
if { (eval echo configure:2360: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  echo "$ac_t""yes" 1>&6
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  echo "$ac_t""no" 1>&6
                 CFLAGS="$CFLAGS_store"
                 
fi
rm -f conftest*
  unset CFLAGS_store

fi
rm -f conftest*
  unset CFLAGS_store

        ;;
      *-*-hpux*)
	# optimization doesn't seem to work at HP-UX cc at all.
        echo "configure: warning: optimizations are disabled with HP-UX cc" 1>&2
        ;;
      *)
  	 CFLAGS_store="$CFLAGS"
  CFLAGS="$CFLAGS -O2"
  echo $ac_n "checking whether compiler accepts -O2""... $ac_c" 1>&6
echo "configure:2387: checking whether compiler accepts -O2" >&5
  cat > conftest.$ac_ext <<EOF
#line 2389 "configure"
#include "confdefs.h"

int main() {

; return 0; }
EOF
if { (eval echo configure:2396: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  echo "$ac_t""yes" 1>&6
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  echo "$ac_t""no" 1>&6
                 CFLAGS="$CFLAGS_store"
                  CFLAGS_store="$CFLAGS"
  CFLAGS="$CFLAGS -O"
  echo $ac_n "checking whether compiler accepts -O""... $ac_c" 1>&6
echo "configure:2408: checking whether compiler accepts -O" >&5
  cat > conftest.$ac_ext <<EOF
#line 2410 "configure"
#include "confdefs.h"

int main() {

; return 0; }
EOF
if { (eval echo configure:2417: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  echo "$ac_t""yes" 1>&6
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  echo "$ac_t""no" 1>&6
                 CFLAGS="$CFLAGS_store"
                 
fi
rm -f conftest*
  unset CFLAGS_store

fi
rm -f conftest*
  unset CFLAGS_store

  	;;
    esac
  fi
fi

echo $ac_n "checking whether to enable static builds""... $ac_c" 1>&6
echo "configure:2441: checking whether to enable static builds" >&5
# Check whether --enable-static-binaries or --disable-static-binaries was given.
if test "${enable_static_binaries+set}" = set; then
  enableval="$enable_static_binaries"
   case "$enableval" in
  yes)
    echo "$ac_t""yes" 1>&6
    if test "$ac_cv_prog_gcc" = "yes"; then
         CFLAGS_store="$CFLAGS"
  CFLAGS="$CFLAGS -static"
  echo $ac_n "checking whether compiler accepts -static""... $ac_c" 1>&6
echo "configure:2452: checking whether compiler accepts -static" >&5
  cat > conftest.$ac_ext <<EOF
#line 2454 "configure"
#include "confdefs.h"

int main() {

; return 0; }
EOF
if { (eval echo configure:2461: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  echo "$ac_t""yes" 1>&6
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  echo "$ac_t""no" 1>&6
                 CFLAGS="$CFLAGS_store"
                 
fi
rm -f conftest*
  unset CFLAGS_store

    fi
    ;;
  *)
    echo "$ac_t""no" 1>&6
    ;;
  esac
else
   echo "$ac_t""no" 1>&6 
fi



########################################################################
# Check whether we use 32/64 bit addressing -- this is very dependend
# on hardware and compiler support.

# First, determine the default addressing mode: 32 or 64. By default,
# try 32 (unless overridden by configuration option).
#
# This routine needs to be reworked...

DEFAULT_ADDR_MODEL=ilp32

echo $ac_n "checking "memory addressing model"""... $ac_c" 1>&6
echo "configure:2499: checking "memory addressing model"" >&5

case "$target" in
  # On pre-7 targets, use always default, but for newer, check if
  # we're doing 64-bit version.
  sparc-*)
    case "$target" in
	*2.5|*2.5.1|*2.6)
	    ;;
	 *)
	    if test "`uname -m`" = "sun4u"; then
		DEFAULT_ADDR_MODEL=lp64
	    fi
	    ;;
    esac
    ;;
esac

ADDR_MODEL=${ADDR_MODEL:-$DEFAULT_ADDR_MODEL}

# Check whether --with-addr-model or --without-addr-model was given.
if test "${with_addr_model+set}" = set; then
  withval="$with_addr_model"
   case "$withval" in
  lp64|LP64)
    echo "$ac_t""lp64" 1>&6
    ADDR_MODEL=lp64
    ;;
  ilp32|ILP32)
    echo "$ac_t""ilp32" 1>&6
    ADDR_MODEL=ilp32
    ;;
  *)
    echo "$ac_t""$ADDR_MODEL" 1>&6
  esac 
else
  echo "$ac_t""$ADDR_MODEL" 1>&6

fi




########################################################################


 if test -n "$GCC"; then
    CFLAGS="$CFLAGS -Wall"
 fi
 

if test "$ac_cv_prog_gcc" = "yes"; then
   CFLAGS_store="$CFLAGS"
  CFLAGS="$CFLAGS -Wno-unknown-pragmas"
  echo $ac_n "checking whether compiler accepts -Wno-unknown-pragmas""... $ac_c" 1>&6
echo "configure:2554: checking whether compiler accepts -Wno-unknown-pragmas" >&5
  cat > conftest.$ac_ext <<EOF
#line 2556 "configure"
#include "confdefs.h"

int main() {

; return 0; }
EOF
if { (eval echo configure:2563: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  echo "$ac_t""yes" 1>&6
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  echo "$ac_t""no" 1>&6
                 CFLAGS="$CFLAGS_store"
                 
fi
rm -f conftest*
  unset CFLAGS_store

fi

echo $ac_n "checking whether to enable verbose warnings""... $ac_c" 1>&6
echo "configure:2580: checking whether to enable verbose warnings" >&5
# Check whether --enable-verbose-warnings or --disable-verbose-warnings was given.
if test "${enable_verbose_warnings+set}" = set; then
  enableval="$enable_verbose_warnings"
   case "$enableval" in
  yes)
    echo "$ac_t""yes" 1>&6

    
 if test -n "$GCC"; then
    CFLAGS="$CFLAGS -W"
 fi
 
    
 if test -n "$GCC"; then
    CFLAGS="$CFLAGS -Wshadow -Wpointer-arith -Wbad-function-cast"
 fi
 
    
 if test -n "$GCC"; then
    CFLAGS="$CFLAGS -Wcast-align -Wwrite-strings -Waggregate-return"
 fi
 
    
 if test -n "$GCC"; then
    CFLAGS="$CFLAGS -Wmissing-prototypes -Wstrict-prototypes"
 fi
 

    # Disabled because we use long long
    # AC_ADD_GCC_CFLAGS([-pedantic])

    # Disabled because lots of system headers break on this (errno.h)
    # AC_ADD_GCC_CFLAGS([-Wredundant-decls])

    ;;
  *)
    echo "$ac_t""no" 1>&6
    ;;
  esac 
else
  echo "$ac_t""no" 1>&6

fi


# 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:2629: 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
  if test -n "$RANLIB"; then
  ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
else
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_prog_RANLIB="ranlib"
      break
    fi
  done
  IFS="$ac_save_ifs"
  test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
fi
fi
RANLIB="$ac_cv_prog_RANLIB"
if test -n "$RANLIB"; then
  echo "$ac_t""$RANLIB" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

# Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
set dummy ${ac_tool_prefix}ar; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:2659: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test -n "$AR"; then
  ac_cv_prog_AR="$AR" # Let the user override the test.
else
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_prog_AR="${ac_tool_prefix}ar"
      break
    fi
  done
  IFS="$ac_save_ifs"
  test -z "$ac_cv_prog_AR" && ac_cv_prog_AR="ar"
fi
fi
AR="$ac_cv_prog_AR"
if test -n "$AR"; then
  echo "$ac_t""$AR" 1>&6
else
  echo "$ac_t""no" 1>&6
fi



for ac_prog in gm4 m4
do
# 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:2693: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_M4'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test -n "$M4"; then
  ac_cv_prog_M4="$M4" # Let the user override the test.
else
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_prog_M4="$ac_prog"
      break
    fi
  done
  IFS="$ac_save_ifs"
fi
fi
M4="$ac_cv_prog_M4"
if test -n "$M4"; then
  echo "$ac_t""$M4" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

test -n "$M4" && break
done
test -n "$M4" || M4="m4"

for ac_prog in perl
do
# 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:2728: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_PERL'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test -n "$PERL"; then
  ac_cv_prog_PERL="$PERL" # Let the user override the test.
else
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_prog_PERL="$ac_prog"
      break
    fi
  done
  IFS="$ac_save_ifs"
fi
fi
PERL="$ac_cv_prog_PERL"
if test -n "$PERL"; then
  echo "$ac_t""$PERL" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

test -n "$PERL" && break
done
test -n "$PERL" || PERL="perl"

echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
echo "configure:2759: 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
else
  cat > conftestmake <<\EOF
all:
	@echo 'ac_maketemp="${MAKE}"'
EOF
# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=`
if test -n "$ac_maketemp"; then
  eval ac_cv_prog_make_${ac_make}_set=yes
else
  eval ac_cv_prog_make_${ac_make}_set=no
fi
rm -f conftestmake
fi
if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  SET_MAKE=
else
  echo "$ac_t""no" 1>&6
  SET_MAKE="MAKE=${MAKE-make}"
fi

# Find a good install program.  We prefer a C program (faster),
# so one script is as good as another.  But avoid the broken or
# incompatible versions:
# SysV /etc/install, /usr/sbin/install
# SunOS /usr/etc/install
# IRIX /sbin/install
# AIX /bin/install
# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
# AFS /usr/afsws/bin/install, which mishandles nonexistent args
# 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:2797: 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
else
    IFS="${IFS= 	}"; ac_save_IFS="$IFS"; IFS=":"
  for ac_dir in $PATH; do
    # Account for people who put trailing slashes in PATH elements.
    case "$ac_dir/" in
    /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
    *)
      # OSF1 and SCO ODT 3.0 have their own names for install.
      # Don't use installbsd from OSF since it installs stuff as root
      # by default.
      for ac_prog in ginstall scoinst install; do
        if test -f $ac_dir/$ac_prog; then
	  if test $ac_prog = install &&
            grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
	    # AIX install.  It has an incompatible calling convention.
	    :
	  else
	    ac_cv_path_install="$ac_dir/$ac_prog -c"
	    break 2
	  fi
	fi
      done
      ;;
    esac
  done
  IFS="$ac_save_IFS"

fi
  if test "${ac_cv_path_install+set}" = set; then
    INSTALL="$ac_cv_path_install"
  else
    # As a last resort, use the slow shell script.  We don't cache a
    # path for INSTALL within a source directory, because that will
    # break other packages using the cache if that directory is
    # removed, or if the path is relative.
    INSTALL="$ac_install_sh"
  fi
fi
echo "$ac_t""$INSTALL" 1>&6

# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
# It thinks the first close brace ends the variable substitution.
test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'

test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'

test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'



# Scheme maintenance mode
# This is not currently needed.
# AC_MSG_CHECKING(whether to maintain the Scheme engine)
# AC_ARG_ENABLE(scheme-maintainer,
# [  --enable-scheme-maintainer
#                           Enable Scheme maintainer mode.],
# [ case "$enableval" in
#   yes)
#      AC_MSG_RESULT(sure)
#      scheme_maintainer=yes
#      ;;
#   *) AC_MSG_RESULT(surely not)
#      scheme_maintainer=no
#      ;;
#   esac ], AC_MSG_RESULT(not now)
# )

# AM_CONDITIONAL(SCMMAINT, test x$scheme_maintainer = xyes)

echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
echo "configure:2871: checking how to run the C preprocessor" >&5
# On Suns, sometimes $CPP names a directory.
if test -n "$CPP" && test -d "$CPP"; then
  CPP=
fi
if test -z "$CPP"; then
if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
    # This must be in double quotes, not single quotes, because CPP may get
  # substituted into the Makefile and "${CC-cc}" will confuse make.
  CPP="${CC-cc} -E"
  # On the NeXT, cc -E runs the code through the compiler's parser,
  # not just through cpp.
  cat > conftest.$ac_ext <<EOF
#line 2886 "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:2892: \"$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
  :
else
  echo "$ac_err" >&5
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  CPP="${CC-cc} -E -traditional-cpp"
  cat > conftest.$ac_ext <<EOF
#line 2903 "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:2909: \"$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
  :
else
  echo "$ac_err" >&5
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  CPP="${CC-cc} -nologo -E"
  cat > conftest.$ac_ext <<EOF
#line 2920 "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:2926: \"$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
  :
else
  echo "$ac_err" >&5
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  CPP=/lib/cpp
fi
rm -f conftest*
fi
rm -f conftest*
fi
rm -f conftest*
  ac_cv_prog_CPP="$CPP"
fi
  CPP="$ac_cv_prog_CPP"
else
  ac_cv_prog_CPP="$CPP"
fi
echo "$ac_t""$CPP" 1>&6

echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
echo "configure:2951: 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 2956 "configure"
#include "confdefs.h"
#include <stdlib.h>
#include <stdarg.h>
#include <string.h>
#include <float.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:2964: \"$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*
  ac_cv_header_stdc=yes
else
  echo "$ac_err" >&5
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  ac_cv_header_stdc=no
fi
rm -f conftest*

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 2981 "configure"
#include "confdefs.h"
#include <string.h>
EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  egrep "memchr" >/dev/null 2>&1; then
  :
else
  rm -rf conftest*
  ac_cv_header_stdc=no
fi
rm -f conftest*

fi

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 2999 "configure"
#include "confdefs.h"
#include <stdlib.h>
EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  egrep "free" >/dev/null 2>&1; then
  :
else
  rm -rf conftest*
  ac_cv_header_stdc=no
fi
rm -f conftest*

fi

if test $ac_cv_header_stdc = yes; then
  # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
if test "$cross_compiling" = yes; then
  :
else
  cat > conftest.$ac_ext <<EOF
#line 3020 "configure"
#include "confdefs.h"
#include <ctype.h>
#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
#define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
int main () { int i; for (i = 0; i < 256; i++)
if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
exit (0); }

EOF
if { (eval echo configure:3031: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
  :
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -fr conftest*
  ac_cv_header_stdc=no
fi
rm -fr conftest*
fi

fi
fi

echo "$ac_t""$ac_cv_header_stdc" 1>&6
if test $ac_cv_header_stdc = yes; then
  cat >> confdefs.h <<\EOF
#define STDC_HEADERS 1
EOF

fi

echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
echo "configure:3055: 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 3060 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/time.h>
#include <time.h>
int main() {
struct tm *tp;
; return 0; }
EOF
if { (eval echo configure:3069: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  ac_cv_header_time=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  ac_cv_header_time=no
fi
rm -f conftest*
fi

echo "$ac_t""$ac_cv_header_time" 1>&6
if test $ac_cv_header_time = yes; then
  cat >> confdefs.h <<\EOF
#define TIME_WITH_SYS_TIME 1
EOF

fi

ac_header_dirent=no
for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6
echo "configure:3094: checking for $ac_hdr that defines DIR" >&5
if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 3099 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <$ac_hdr>
int main() {
DIR *dirp = 0;
; return 0; }
EOF
if { (eval echo configure:3107: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  eval "ac_cv_header_dirent_$ac_safe=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_header_dirent_$ac_safe=no"
fi
rm -f conftest*
fi
if eval "test \"`echo '$ac_cv_header_dirent_'$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
 ac_header_dirent=$ac_hdr; break
else
  echo "$ac_t""no" 1>&6
fi
done
# Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
if test $ac_header_dirent = dirent.h; then
echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6
echo "configure:3132: checking for opendir in -ldir" >&5
ac_lib_var=`echo dir'_'opendir | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-ldir  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 3140 "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
    builtin and then its argument prototype would still apply.  */
char opendir();

int main() {
opendir()
; return 0; }
EOF
if { (eval echo configure:3151: \"$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
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  LIBS="$LIBS -ldir"
else
  echo "$ac_t""no" 1>&6
fi

else
echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6
echo "configure:3173: checking for opendir in -lx" >&5
ac_lib_var=`echo x'_'opendir | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-lx  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 3181 "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
    builtin and then its argument prototype would still apply.  */
char opendir();

int main() {
opendir()
; return 0; }
EOF
if { (eval echo configure:3192: \"$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
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  LIBS="$LIBS -lx"
else
  echo "$ac_t""no" 1>&6
fi

fi

echo $ac_n "checking whether stat file-mode macros are broken""... $ac_c" 1>&6
echo "configure:3215: checking whether stat file-mode macros are broken" >&5
if eval "test \"`echo '$''{'ac_cv_header_stat_broken'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 3220 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/stat.h>

#if defined(S_ISBLK) && defined(S_IFDIR)
# if S_ISBLK (S_IFDIR)
You lose.
# endif
#endif

#if defined(S_ISBLK) && defined(S_IFCHR)
# if S_ISBLK (S_IFCHR)
You lose.
# endif
#endif

#if defined(S_ISLNK) && defined(S_IFREG)
# if S_ISLNK (S_IFREG)
You lose.
# endif
#endif

#if defined(S_ISSOCK) && defined(S_IFREG)
# if S_ISSOCK (S_IFREG)
You lose.
# endif
#endif

EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  egrep "You lose" >/dev/null 2>&1; then
  rm -rf conftest*
  ac_cv_header_stat_broken=yes
else
  rm -rf conftest*
  ac_cv_header_stat_broken=no
fi
rm -f conftest*

fi

echo "$ac_t""$ac_cv_header_stat_broken" 1>&6
if test $ac_cv_header_stat_broken = yes; then
  cat >> confdefs.h <<\EOF
#define STAT_MACROS_BROKEN 1
EOF

fi

echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6
echo "configure:3271: checking for sys/wait.h that is POSIX.1 compatible" >&5
if eval "test \"`echo '$''{'ac_cv_header_sys_wait_h'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 3276 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/wait.h>
#ifndef WEXITSTATUS
#define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
#endif
#ifndef WIFEXITED
#define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
#endif
int main() {
int s;
wait (&s);
s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
; return 0; }
EOF
if { (eval echo configure:3292: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  ac_cv_header_sys_wait_h=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  ac_cv_header_sys_wait_h=no
fi
rm -f conftest*
fi

echo "$ac_t""$ac_cv_header_sys_wait_h" 1>&6
if test $ac_cv_header_sys_wait_h = yes; then
  cat >> confdefs.h <<\EOF
#define HAVE_SYS_WAIT_H 1
EOF

fi


echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
echo "configure:3314: checking return type of signal handlers" >&5
if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 3319 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <signal.h>
#ifdef signal
#undef signal
#endif
#ifdef __cplusplus
extern "C" void (*signal (int, void (*)(int)))(int);
#else
void (*signal ()) ();
#endif

int main() {
int i;
; return 0; }
EOF
if { (eval echo configure:3336: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  ac_cv_type_signal=void
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  ac_cv_type_signal=int
fi
rm -f conftest*
fi

echo "$ac_t""$ac_cv_type_signal" 1>&6
cat >> confdefs.h <<EOF
#define RETSIGTYPE $ac_cv_type_signal
EOF


echo $ac_n "checking for size_t""... $ac_c" 1>&6
echo "configure:3355: 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 3360 "configure"
#include "confdefs.h"
#include <sys/types.h>
#if STDC_HEADERS
#include <stdlib.h>
#include <stddef.h>
#endif
EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  egrep "(^|[^a-zA-Z_0-9])size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
  rm -rf conftest*
  ac_cv_type_size_t=yes
else
  rm -rf conftest*
  ac_cv_type_size_t=no
fi
rm -f conftest*

fi
echo "$ac_t""$ac_cv_type_size_t" 1>&6
if test $ac_cv_type_size_t = no; then
  cat >> confdefs.h <<\EOF
#define size_t unsigned
EOF

fi

echo $ac_n "checking for off_t""... $ac_c" 1>&6
echo "configure:3388: checking for off_t" >&5
if eval "test \"`echo '$''{'ac_cv_type_off_t'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 3393 "configure"
#include "confdefs.h"
#include <sys/types.h>
#if STDC_HEADERS
#include <stdlib.h>
#include <stddef.h>
#endif
EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  egrep "(^|[^a-zA-Z_0-9])off_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
  rm -rf conftest*
  ac_cv_type_off_t=yes
else
  rm -rf conftest*
  ac_cv_type_off_t=no
fi
rm -f conftest*

fi
echo "$ac_t""$ac_cv_type_off_t" 1>&6
if test $ac_cv_type_off_t = no; then
  cat >> confdefs.h <<\EOF
#define off_t long
EOF

fi

echo $ac_n "checking for mode_t""... $ac_c" 1>&6
echo "configure:3421: checking for mode_t" >&5
if eval "test \"`echo '$''{'ac_cv_type_mode_t'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 3426 "configure"
#include "confdefs.h"
#include <sys/types.h>
#if STDC_HEADERS
#include <stdlib.h>
#include <stddef.h>
#endif
EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  egrep "(^|[^a-zA-Z_0-9])mode_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
  rm -rf conftest*
  ac_cv_type_mode_t=yes
else
  rm -rf conftest*
  ac_cv_type_mode_t=no
fi
rm -f conftest*

fi
echo "$ac_t""$ac_cv_type_mode_t" 1>&6
if test $ac_cv_type_mode_t = no; then
  cat >> confdefs.h <<\EOF
#define mode_t int
EOF

fi


#default type sizes when automatic check does not work (cross compilation)
cross_sizeof_usermode_pointer="4"
cross_sizeof_usermode_long="4"
cross_sizeof_usermode_int="4"
cross_sizeof_usermode_short="2"
cross_sizeof_usermode_longlong="8"

cross_sizeof_kernel_pointer="4"
cross_sizeof_kernel_long="4"
cross_sizeof_kernel_int="4"
cross_sizeof_kernel_short="2"
cross_sizeof_kernel_longlong="8"

case $target in
  mips64-octeon-linux*)
    cat >> confdefs.h <<\EOF
#define PLATFORM_OCTEON_LINUX 1
EOF

    cross_sizeof_usermode_pointer="8"
    cross_sizeof_kernel_pointer="8"
    cross_sizeof_usermode_long="8"
    cross_sizeof_kernel_long="8"
  ;;
esac

# Check sizes of various basic types, first for usemode compilation.
echo $ac_n "checking size of usermode void *""... $ac_c" 1>&6
echo "configure:3482: checking size of usermode void *" >&5
if eval "test \"`echo '$''{'ac_cv_usermode_sizeof_void_p'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test "$cross_compiling" = yes; then
  ac_cv_usermode_sizeof_void_p=$cross_sizeof_usermode_pointer
else
  cat > conftest.$ac_ext <<EOF
#line 3490 "configure"
#include "confdefs.h"
#include <stdio.h>
main()
{
  FILE *f=fopen("conftestval", "w");
  if (!f) exit(1);
  fprintf(f, "%d\n", sizeof(void *));
  exit(0);
}
EOF
if { (eval echo configure:3501: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
  ac_cv_usermode_sizeof_void_p=`cat conftestval`
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -fr conftest*
  ac_cv_usermode_sizeof_void_p=0
fi
rm -fr conftest*
fi

fi
echo "$ac_t""$ac_cv_usermode_sizeof_void_p" 1>&6
cat >> confdefs.h <<EOF
#define USERMODE_SIZEOF_VOID_P $ac_cv_usermode_sizeof_void_p
EOF

cat >> confdefs.h <<EOF
#define HAVE_USERMODE_VOID_P 1
EOF


echo $ac_n "checking size of usermode long""... $ac_c" 1>&6
echo "configure:3525: checking size of usermode long" >&5
if eval "test \"`echo '$''{'ac_cv_usermode_sizeof_long'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test "$cross_compiling" = yes; then
  ac_cv_usermode_sizeof_long=$cross_sizeof_usermode_long
else
  cat > conftest.$ac_ext <<EOF
#line 3533 "configure"
#include "confdefs.h"
#include <stdio.h>
main()
{
  FILE *f=fopen("conftestval", "w");
  if (!f) exit(1);
  fprintf(f, "%d\n", sizeof(long));
  exit(0);
}
EOF
if { (eval echo configure:3544: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
  ac_cv_usermode_sizeof_long=`cat conftestval`
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -fr conftest*
  ac_cv_usermode_sizeof_long=0
fi
rm -fr conftest*
fi

fi
echo "$ac_t""$ac_cv_usermode_sizeof_long" 1>&6
cat >> confdefs.h <<EOF
#define USERMODE_SIZEOF_LONG $ac_cv_usermode_sizeof_long
EOF

cat >> confdefs.h <<EOF
#define HAVE_USERMODE_LONG 1
EOF


echo $ac_n "checking size of usermode int""... $ac_c" 1>&6
echo "configure:3568: checking size of usermode int" >&5
if eval "test \"`echo '$''{'ac_cv_usermode_sizeof_int'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test "$cross_compiling" = yes; then
  ac_cv_usermode_sizeof_int=$cross_sizeof_usermode_int
else
  cat > conftest.$ac_ext <<EOF
#line 3576 "configure"
#include "confdefs.h"
#include <stdio.h>
main()
{
  FILE *f=fopen("conftestval", "w");
  if (!f) exit(1);
  fprintf(f, "%d\n", sizeof(int));
  exit(0);
}
EOF
if { (eval echo configure:3587: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
  ac_cv_usermode_sizeof_int=`cat conftestval`
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -fr conftest*
  ac_cv_usermode_sizeof_int=0
fi
rm -fr conftest*
fi

fi
echo "$ac_t""$ac_cv_usermode_sizeof_int" 1>&6
cat >> confdefs.h <<EOF
#define USERMODE_SIZEOF_INT $ac_cv_usermode_sizeof_int
EOF

cat >> confdefs.h <<EOF
#define HAVE_USERMODE_INT 1
EOF


echo $ac_n "checking size of usermode short""... $ac_c" 1>&6
echo "configure:3611: checking size of usermode short" >&5
if eval "test \"`echo '$''{'ac_cv_usermode_sizeof_short'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test "$cross_compiling" = yes; then
  ac_cv_usermode_sizeof_short=$cross_sizeof_usermode_short
else
  cat > conftest.$ac_ext <<EOF
#line 3619 "configure"
#include "confdefs.h"
#include <stdio.h>
main()
{
  FILE *f=fopen("conftestval", "w");
  if (!f) exit(1);
  fprintf(f, "%d\n", sizeof(short));
  exit(0);
}
EOF
if { (eval echo configure:3630: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
  ac_cv_usermode_sizeof_short=`cat conftestval`
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -fr conftest*
  ac_cv_usermode_sizeof_short=0
fi
rm -fr conftest*
fi

fi
echo "$ac_t""$ac_cv_usermode_sizeof_short" 1>&6
cat >> confdefs.h <<EOF
#define USERMODE_SIZEOF_SHORT $ac_cv_usermode_sizeof_short
EOF

cat >> confdefs.h <<EOF
#define HAVE_USERMODE_SHORT 1
EOF


echo $ac_n "checking size of usermode long long""... $ac_c" 1>&6
echo "configure:3654: checking size of usermode long long" >&5
if eval "test \"`echo '$''{'ac_cv_usermode_sizeof_long_long'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test "$cross_compiling" = yes; then
  ac_cv_usermode_sizeof_long_long=$cross_sizeof_usermode_longlong
else
  cat > conftest.$ac_ext <<EOF
#line 3662 "configure"
#include "confdefs.h"
#include <stdio.h>
main()
{
  FILE *f=fopen("conftestval", "w");
  if (!f) exit(1);
  fprintf(f, "%d\n", sizeof(long long));
  exit(0);
}
EOF
if { (eval echo configure:3673: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
  ac_cv_usermode_sizeof_long_long=`cat conftestval`
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -fr conftest*
  ac_cv_usermode_sizeof_long_long=0
fi
rm -fr conftest*
fi

fi
echo "$ac_t""$ac_cv_usermode_sizeof_long_long" 1>&6
cat >> confdefs.h <<EOF
#define USERMODE_SIZEOF_LONG_LONG $ac_cv_usermode_sizeof_long_long
EOF

cat >> confdefs.h <<EOF
#define HAVE_USERMODE_LONG_LONG 1
EOF



for ac_func in getenv geteuid localtime nanosleep sleep
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:3700: 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 3705 "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:3728: \"$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


echo $ac_n "checking for working const""... $ac_c" 1>&6
echo "configure:3754: 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 3759 "configure"
#include "confdefs.h"

int main() {

/* Ultrix mips cc rejects this.  */
typedef int charset[2]; const charset x;
/* SunOS 4.1.1 cc rejects this.  */
char const *const *ccp;
char **p;
/* NEC SVR4.0.2 mips cc rejects this.  */
struct point {int x, y;};
static struct point const zero = {0,0};
/* AIX XL C 1.02.0.0 rejects this.
   It does not let you subtract one const X* pointer from another in an arm
   of an if-expression whose if-part is not a constant expression */
const char *g = "string";
ccp = &g + (g ? g-g : 0);
/* HPUX 7.0 cc rejects these. */
++ccp;
p = (char**) ccp;
ccp = (char const *const *) p;
{ /* SCO 3.2v4 cc rejects this.  */
  char *t;
  char const *s = 0 ? (char *) 0 : (char const *) 0;

  *t++ = 0;
}
{ /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
  int x[] = {25, 17};
  const int *foo = &x[0];
  ++foo;
}
{ /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
  typedef const int *iptr;
  iptr p = 0;
  ++p;
}
{ /* AIX XL C 1.02.0.0 rejects this saying
     "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
  struct s { int j; const int *ap[3]; };
  struct s *b; b->j = 5;
}
{ /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
  const int foo = 10;
}

; return 0; }
EOF
if { (eval echo configure:3808: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  ac_cv_c_const=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  ac_cv_c_const=no
fi
rm -f conftest*
fi

echo "$ac_t""$ac_cv_c_const" 1>&6
if test $ac_cv_c_const = no; then
  cat >> confdefs.h <<\EOF
#define const 
EOF

fi

echo $ac_n "checking for inline""... $ac_c" 1>&6
echo "configure:3829: 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 3836 "configure"
#include "confdefs.h"

int main() {
} $ac_kw foo() {
; return 0; }
EOF
if { (eval echo configure:3843: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  ac_cv_c_inline=$ac_kw; break
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
fi
rm -f conftest*
done

fi

echo "$ac_t""$ac_cv_c_inline" 1>&6
case "$ac_cv_c_inline" in
  inline | yes) ;;
  no) cat >> confdefs.h <<\EOF
#define inline 
EOF
 ;;
  *)  cat >> confdefs.h <<EOF
#define inline $ac_cv_c_inline
EOF
 ;;
esac

echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6
echo "configure:3869: 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 3876 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/param.h>
int main() {

#if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN
 bogus endian macros
#endif
; return 0; }
EOF
if { (eval echo configure:3887: \"$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 3891 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/param.h>
int main() {

#if BYTE_ORDER != BIG_ENDIAN
 not big endian
#endif
; return 0; }
EOF
if { (eval echo configure:3902: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  ac_cv_c_bigendian=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  ac_cv_c_bigendian=no
fi
rm -f conftest*
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
fi
rm -f conftest*
if test $ac_cv_c_bigendian = unknown; then
if test "$cross_compiling" = yes; then
  { echo "configure: error: Cannot cross-compile without BYTE_ORDER set in sys/param.h." 1>&2; exit 1; }
else
  cat > conftest.$ac_ext <<EOF
#line 3922 "configure"
#include "confdefs.h"
main () {
  /* Are we little or big endian?  From Harbison&Steele.  */
  union
  {
    long l;
    char c[sizeof (long)];
  } u;
  u.l = 1;
  exit (u.c[sizeof (long) - 1] == 1);
}
EOF
if { (eval echo configure:3935: \"$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
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -fr conftest*
  ac_cv_c_bigendian=yes
fi
rm -fr conftest*
fi

fi
fi

echo "$ac_t""$ac_cv_c_bigendian" 1>&6
if test $ac_cv_c_bigendian = yes; then
  cat >> confdefs.h <<\EOF
#define WORDS_BIGENDIAN 1
EOF

fi


if test -z "$no_termios"; then
  for ac_hdr in termios.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:3964: 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 3969 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:3974: \"$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

fi
for ac_hdr in sys/ioctl.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:4005: 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 4010 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:4015: \"$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


echo $ac_n "checking whether to enable light debugging""... $ac_c" 1>&6
echo "configure:4043: checking whether to enable light debugging" >&5
MSG_DEBUG="no"
debug_light_defined=no


# Check whether --enable-debug or --disable-debug was given.
if test "${enable_debug+set}" = set; then
  enableval="$enable_debug"
   case "$enableval" in
  no)
    debug_light_defined=no
    ;;
  *)
    debug_light_defined=yes
    ;;
  esac 
fi

if test "X$debug_light_defined" = "Xyes"; then
  cat >> confdefs.h <<\EOF
#define DEBUG_LIGHT 1
EOF

  MSG_DEBUG="light"
  echo "$ac_t""yes" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

echo $ac_n "checking whether to enable heavy debugging""... $ac_c" 1>&6
echo "configure:4073: checking whether to enable heavy debugging" >&5
# Check whether --enable-debug-heavy or --disable-debug-heavy was given.
if test "${enable_debug_heavy+set}" = set; then
  enableval="$enable_debug_heavy"
   case "$enableval" in
  yes)
    echo "$ac_t""yes" 1>&6
    cat >> confdefs.h <<\EOF
#define DEBUG_HEAVY 1
EOF

    MSG_DEBUG="heavy"
    if test "$debug_light_defined" = "no"; then
      cat >> confdefs.h <<\EOF
#define DEBUG_LIGHT 1
EOF

    fi
    ;;
  *)
    echo "$ac_t""no" 1>&6
    ;;
  esac 
else
  echo "$ac_t""no" 1>&6

fi


echo $ac_n "checking whether to enable EFENCE memory allocation debugger""... $ac_c" 1>&6
echo "configure:4103: checking whether to enable EFENCE memory allocation debugger" >&5
# Check whether --enable-efence or --disable-efence was given.
if test "${enable_efence+set}" = set; then
  enableval="$enable_efence"
   case "$enableval" in
  yes)
    echo "$ac_t""yes" 1>&6
    cat >> confdefs.h <<\EOF
#define EFENCE 1
EOF

    ;;
  *)
    echo "$ac_t""no" 1>&6
    ;;
  esac 
else
  echo "$ac_t""no" 1>&6

fi


echo $ac_n "checking using replacement memcmp""... $ac_c" 1>&6
echo "configure:4126: checking using replacement memcmp" >&5
# Check whether --with-replacement-memcmp or --without-replacement-memcmp was given.
if test "${with_replacement_memcmp+set}" = set; then
  withval="$with_replacement_memcmp"
   case "$withval" in
    yes)
	echo "$ac_t""yes" 1>&6
	cat >> confdefs.h <<\EOF
#define WITH_REPLACEMENT_MEMCMP 1
EOF

	;;
    *)
	echo "$ac_t""$withval" 1>&6
	;;
  esac 
else
  echo "$ac_t""no" 1>&6

fi


case "$target" in
  *vxworks*)
    cat >> confdefs.h <<\EOF
#define SSH_GLOBALS_EMULATION 1
EOF

  ;;
  *)
    echo $ac_n "checking whether to force global variable emulation""... $ac_c" 1>&6
echo "configure:4157: checking whether to force global variable emulation" >&5
    # Check whether --enable-globals-emulation or --disable-globals-emulation was given.
if test "${enable_globals_emulation+set}" = set; then
  enableval="$enable_globals_emulation"
   case "$enableval" in
        yes)
          echo "$ac_t""yes" 1>&6
          cat >> confdefs.h <<\EOF
#define SSH_GLOBALS_EMULATION 1
EOF

          ;;
        *)
          echo "$ac_t""no" 1>&6
          ;;
      esac 
else
  echo "$ac_t""no" 1>&6
fi

  ;;
esac


echo $ac_n "checking whether to enable assembler optimized subroutines""... $ac_c" 1>&6
echo "configure:4182: checking whether to enable assembler optimized subroutines" >&5
case "$target" in
  i*86-*-*linux*)
#    This _USED_ to be the case in the SOME old version (2000 or pre-).
#    The lack of optimizations is causing problem, so I removed this.
#    -mstenber
#
#    enable_asm=no
#    AC_MSG_WARN([Assembler optimizations are DISABLED in ix86 linux])
#    AC_MSG_WARN([because of a possible bug in gcc.])
  ;;
  x86_64-*-linux*)
    enable_asm=no
    echo "configure: warning: Assembler optimizations are DISABLED in 64bit linux" 1>&2
  ;;
  i*86-*-bsdi*)
    enable_asm=no
#    AC_MSG_WARN([Assembler optimizations are DISABLED in BSDI])
    ;;
  *)
  ;;
esac

if test "X$enable_asm" != "Xno"; then
  # Check whether --enable-asm or --disable-asm was given.
if test "${enable_asm+set}" = set; then
  enableval="$enable_asm"
   case "$enableval" in
    yes)
      echo "$ac_t""yes" 1>&6
      enable_asm=yes
      ;;
    *)
      echo "$ac_t""no" 1>&6
      ;;
    esac 
else
  echo "$ac_t""yes" 1>&6
    enable_asm=yes
  
fi

else
  echo "$ac_t""no" 1>&6
fi

# If using libtool...
GRANDLIBARCMD='$(AR) cr'
GRANDLIBRANLIBCMD='$(RANLIB)'





COPY_INCLUDE='$(top_srcdir)/copy_include'



export CC CFLAGS

echo $ac_n "checking "using installed sshlibs"""... $ac_c" 1>&6
echo "configure:4243: checking "using installed sshlibs"" >&5
# Check whether --with-sshlibs or --without-sshlibs was given.
if test "${with_sshlibs+set}" = set; then
  withval="$with_sshlibs"
   case "$withval" in
    no)
	echo "$ac_t""no" 1>&6
	;;
    yes)
	echo "$ac_t""no path given" 1>&6
	;;
    *)
	echo "$ac_t""$withval" 1>&6
	dir_found=0
	if test -d "$withval/lib"
	then
	    if test "$ssh_cv_cc_R_require" = ""; then
  { echo "configure: error: prequisite macro has not been run" 1>&2; exit 1; }
fi
if test "$ssh_cc_R" = "yes"; then
  LDFLAGS="$LDFLAGS -R${ssh_cc_R_space}$withval/lib"
fi
LDFLAGS="$LDFLAGS -L$withval/lib"

	    dir_found=1
	fi
	if test -d "$withval/include"
	then
	    CPPFLAGS=" $CPPFLAGS -I$withval/include"
	    dir_found=1
	fi
	if test $dir_found = 0
	then
	    { echo "configure: error: No $withval/lib or $withval/include found" 1>&2; exit 1; }
	fi
	;;
  esac 
else
  echo "$ac_t""no" 1>&6

fi


cat >> confdefs.h <<\EOF
#define SSH_DIST_NAME "quicksec-server-quicksec-client"
EOF

base_distribution="`echo quicksec-server-quicksec-client | sed 's/-.*//g;'`"
cat >> confdefs.h <<EOF
#define SSH_DIST_BASENAME "$base_distribution"
EOF

# -*- sh -*-
#
# configure.in.inc - fragment for src/ipsec
#
# Copyright:
#       Copyright (c) 2002-2006 SFNT Finland Oy.
#       All rights reserved.
#

########################################################################
#
# Non-platform specific but IPsec specific configuration things first:
#

echo $ac_n "checking whether to compile a minimal engine""... $ac_c" 1>&6
echo "configure:4310: checking whether to compile a minimal engine" >&5
# Check whether --enable-ipsec-small or --disable-ipsec-small was given.
if test "${enable_ipsec_small+set}" = set; then
  enableval="$enable_ipsec_small"
   case "$enableval" in
      no)
          echo "$ac_t""no" 1>&6
          ;;
      *)
          echo "$ac_t""yes" 1>&6
	  cat >> confdefs.h <<\EOF
#define SSH_IPSEC_SMALL 1
EOF

          ;;
      esac 
else
   echo "$ac_t""no" 1>&6 
fi


case $target in


  *)
    ;;
esac
# -*- sh -*-
#
# configure.in.inc - fragment for src/interceptor
#
# Copyright:
#       Copyright (c) 2002-2006 SFNT Finland Oy.
#       All rights reserved.
#

cat >> confdefs.h <<EOF
#define HOSTTYPE "$host"
EOF


########################################################################
#
# Non-platform specific but interceptor specific configuration things first:
#

echo $ac_n "checking whether to enable interceptor""... $ac_c" 1>&6
echo "configure:4357: checking whether to enable interceptor" >&5
# Check whether --enable-interceptor or --disable-interceptor was given.
if test "${enable_interceptor+set}" = set; then
  enableval="$enable_interceptor"
   case "$enableval" in
    yes)
	echo "$ac_t""yes" 1>&6
	;;
    *)
	echo "$ac_t""no" 1>&6
	disable_interceptor=yes
	;;
    esac 
else
   echo "$ac_t""yes" 1>&6 
fi


echo $ac_n "checking whether to word align the IP header of packets""... $ac_c" 1>&6
echo "configure:4376: checking whether to word align the IP header of packets" >&5
# Check whether --enable-ip-word-align or --disable-ip-word-align was given.
if test "${enable_ip_word_align+set}" = set; then
  enableval="$enable_ip_word_align"
   case "$enableval" in
      no)
          echo "$ac_t""no" 1>&6
          ;;
      *)
          echo "$ac_t""yes" 1>&6
	  cat >> confdefs.h <<\EOF
#define INTERCEPTOR_IP_ALIGNS_PACKETS 1
EOF

          ;;
      esac 
else
   echo "$ac_t""no" 1>&6 
fi


echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
echo "configure:4398: 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
  rm -f conftestdata
if ln -s X conftestdata 2>/dev/null
then
  rm -f conftestdata
  ac_cv_prog_LN_S="ln -s"
else
  ac_cv_prog_LN_S=ln
fi
fi
LN_S="$ac_cv_prog_LN_S"
if test "$ac_cv_prog_LN_S" = "ln -s"; then
  echo "$ac_t""yes" 1>&6
else
  echo "$ac_t""no" 1>&6
fi


case $target in
  *-cygwin-vxworks*)
  LN_S=cp
  ;;
esac



# Needed if the interceptor supports memory mapping.
for ac_hdr in unistd.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:4432: 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 4437 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:4442: \"$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 getpagesize
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:4471: 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 4476 "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:4499: \"$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

echo $ac_n "checking for working mmap""... $ac_c" 1>&6
echo "configure:4524: checking for working mmap" >&5
if eval "test \"`echo '$''{'ac_cv_func_mmap_fixed_mapped'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test "$cross_compiling" = yes; then
  ac_cv_func_mmap_fixed_mapped=no
else
  cat > conftest.$ac_ext <<EOF
#line 4532 "configure"
#include "confdefs.h"

/* Thanks to Mike Haertel and Jim Avera for this test.
   Here is a matrix of mmap possibilities:
	mmap private not fixed
	mmap private fixed at somewhere currently unmapped
	mmap private fixed at somewhere already mapped
	mmap shared not fixed
	mmap shared fixed at somewhere currently unmapped
	mmap shared fixed at somewhere already mapped
   For private mappings, we should verify that changes cannot be read()
   back from the file, nor mmap's back from the file at a different
   address.  (There have been systems where private was not correctly
   implemented like the infamous i386 svr4.0, and systems where the
   VM page cache was not coherent with the filesystem buffer cache
   like early versions of FreeBSD and possibly contemporary NetBSD.)
   For shared mappings, we should conversely verify that changes get
   propogated back to all the places they're supposed to be.

   Grep wants private fixed already mapped.
   The main things grep needs to know about mmap are:
   * does it exist and is it safe to write into the mmap'd area
   * how to use it (BSD variants)  */
#include <sys/types.h>
#include <fcntl.h>
#include <sys/mman.h>

/* This mess was copied from the GNU getpagesize.h.  */
#ifndef HAVE_GETPAGESIZE
# ifdef HAVE_UNISTD_H
#  include <unistd.h>
# endif

/* Assume that all systems that can run configure have sys/param.h.  */
# ifndef HAVE_SYS_PARAM_H
#  define HAVE_SYS_PARAM_H 1
# endif

# ifdef _SC_PAGESIZE
#  define getpagesize() sysconf(_SC_PAGESIZE)
# else /* no _SC_PAGESIZE */
#  ifdef HAVE_SYS_PARAM_H
#   include <sys/param.h>
#   ifdef EXEC_PAGESIZE
#    define getpagesize() EXEC_PAGESIZE
#   else /* no EXEC_PAGESIZE */
#    ifdef NBPG
#     define getpagesize() NBPG * CLSIZE
#     ifndef CLSIZE
#      define CLSIZE 1
#     endif /* no CLSIZE */
#    else /* no NBPG */
#     ifdef NBPC
#      define getpagesize() NBPC
#     else /* no NBPC */
#      ifdef PAGESIZE
#       define getpagesize() PAGESIZE
#      endif /* PAGESIZE */
#     endif /* no NBPC */
#    endif /* no NBPG */
#   endif /* no EXEC_PAGESIZE */
#  else /* no HAVE_SYS_PARAM_H */
#   define getpagesize() 8192	/* punt totally */
#  endif /* no HAVE_SYS_PARAM_H */
# endif /* no _SC_PAGESIZE */

#endif /* no HAVE_GETPAGESIZE */

#ifdef __cplusplus
extern "C" { void *malloc(unsigned); }
#else
char *malloc();
#endif

int
main()
{
	char *data, *data2, *data3;
	int i, pagesize;
	int fd;

	pagesize = getpagesize();

	/*
	 * First, make a file with some known garbage in it.
	 */
	data = malloc(pagesize);
	if (!data)
		exit(1);
	for (i = 0; i < pagesize; ++i)
		*(data + i) = rand();
	umask(0);
	fd = creat("conftestmmap", 0600);
	if (fd < 0)
		exit(1);
	if (write(fd, data, pagesize) != pagesize)
		exit(1);
	close(fd);

	/*
	 * Next, try to mmap the file at a fixed address which
	 * already has something else allocated at it.  If we can,
	 * also make sure that we see the same garbage.
	 */
	fd = open("conftestmmap", O_RDWR);
	if (fd < 0)
		exit(1);
	data2 = malloc(2 * pagesize);
	if (!data2)
		exit(1);
	data2 += (pagesize - ((int) data2 & (pagesize - 1))) & (pagesize - 1);
	if (data2 != mmap(data2, pagesize, PROT_READ | PROT_WRITE,
	    MAP_PRIVATE | MAP_FIXED, fd, 0L))
		exit(1);
	for (i = 0; i < pagesize; ++i)
		if (*(data + i) != *(data2 + i))
			exit(1);

	/*
	 * Finally, make sure that changes to the mapped area
	 * do not percolate back to the file as seen by read().
	 * (This is a bug on some variants of i386 svr4.0.)
	 */
	for (i = 0; i < pagesize; ++i)
		*(data2 + i) = *(data2 + i) + 1;
	data3 = malloc(pagesize);
	if (!data3)
		exit(1);
	if (read(fd, data3, pagesize) != pagesize)
		exit(1);
	for (i = 0; i < pagesize; ++i)
		if (*(data + i) != *(data3 + i))
			exit(1);
	close(fd);
	unlink("conftestmmap");
	exit(0);
}

EOF
if { (eval echo configure:4672: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
  ac_cv_func_mmap_fixed_mapped=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -fr conftest*
  ac_cv_func_mmap_fixed_mapped=no
fi
rm -fr conftest*
fi

fi

echo "$ac_t""$ac_cv_func_mmap_fixed_mapped" 1>&6
if test $ac_cv_func_mmap_fixed_mapped = yes; then
  cat >> confdefs.h <<\EOF
#define HAVE_MMAP 1
EOF

fi


# Important notice: a lot of this file is now under the
# --enable/disable-interceptor test. See later for the engine-specific
# parts (yes, we will compile engine especially the engine/usermode
# even when interceptor is disabled).
#

#
# Hardware accelerators are kept in src/ipsec/hwaccel tree.
# See src/ipsec/hwaccel/configure.in.inc and Makefile.am.raw to
# understand how they are configured.
#

############################################################################
#
# Platform-specific

## Check for things we need to do on different platforms differently on
## the subdir interceptor/ (interceptor stuff, for kernels)

# This configure.in fragment decides which interceptor (if any) is appropriate
# for the current platform.
#
# This sets the following variables for the Makefile.am[.raw]:
#    SSH_INTERCEPTOR_TARGETS: things to compile (sshipsec.o / sshipsec_ether.o)
#    SSH_INTERCEPTOR_OBJS: common objects for all interceptors/engines.
#    SSH_INTERCEPTOR_NONETHER_OBJS: objects that go only for sshipsec.o
#    SSH_INTERCEPTOR_ETHER_OBJS: objects that go only for sshipsec_ether.o
#    SSH_INTERCEPTOR_CPPFLAGS: flags to add to CFLAGS
#    SSH_INTERCEPTOR_SYMCHECK: debugging target to check for kernel symbols in
#			       loadable kernel modules (only for debugging,
#			       not fatal if not set)

# Override the kernel version (if conf uses it!)
# Check whether --with-kernel-version or --without-kernel-version was given.
if test "${with_kernel_version+set}" = set; then
  withval="$with_kernel_version"
   KERNEL_VERSION="$withval" 
fi


# Override the kernel include directory (if conf uses it!)
# Check whether --with-kernel-headers or --without-kernel-headers was given.
if test "${with_kernel_headers+set}" = set; then
  withval="$with_kernel_headers"
   KERNEL_INCLUDE="$withval" 
fi


## Set these symbols to undef -W- later, we check that if any of these is
## undef (unless set by configuration routines), they fall back to "normal"
## values (eg. KERN_CC=CC and so on.)
#undef KERN_CC KERN_CFLAGS KERN_LIBS KERN_LDFLAGS

# need_readonly_defines: Set this to "false" (or actually anything
# other than "true") to signal that the platform provides the readonly
# versions of the packet processing routines. (The symbol definition
# is done much later in this file).
need_readonly_defines=true

# interceptor_has_packet_alloc_and_copy_ext_data: Set this to "true"
# to signal that the platform provides the packet alloc and copy
# external data routine.
interceptor_has_packet_alloc_and_copy_ext_data=false

# interceptor_has_packet_copy: Set this to "true" to signal that the
# platform provides the packet copy routine.
interceptor_has_packet_copy=false

# interceptor_has_packet_copyin: Set this to "true" to signal that
# the platform provides the packet copyin routine.
interceptor_has_packet_copyin=false

# interceptor_has_mark_func: Set this to "true" to signal that
# the platform provides the "ssh_interceptor_mark" function.
interceptor_has_mark_func=false

# interceptor_has_packet_copyout: Set this to "true" to signal that
# the platform provides the packet copyout routine.
interceptor_has_packet_copyout=false

# interceptor_has_packet_internal_data: Set this to "true" to signal
# that the platform provides the internal data export and import routines.
interceptor_has_packet_internal_data_routines=false

# interceptor provides an instance of the ssh_intercetor_packet_detach()
# function for detaching a packet from operating system context.
interceptor_has_packet_detach=false

# interceptor has ssh_interceptor_packet_cache() implementation
# besides the default "brute-force" implementation.
interceptor_has_packet_cache=false

# interceptor_has_platform_include: Set this to true to signal
# that the platform has a "platform_interceptor.h" file available
# which must be included. This file can e.g. map packet pullup etc
# functions to macros or inline functions.
interceptor_has_platform_include=false

# interceptor_sets_ip_forwarding: Set this to "true" to signal that
# the interceptor knows and sets the SSH_PACKET_FORWARDED flag.
interceptor_sets_ip_forwarding=false

# interceptor_handles_loopback_packets: Set this to "false" to signal
# that the interceptor does not handle loopback packets (it passes
# them to the packet callback).
interceptor_handles_loopback_packets=true

# interceptor_implements_virtual_adapter_configure: Set this to "false" to
# signal that the interceptor does not implement kernel level virtual adapter
# configure.
interceptor_implements_virtual_adapter_configure=true

# interceptor_implements_route_modify: Set this to "false" to signal that the
# interceptor does not implement kernel level routing table modification.
interceptor_implements_route_modify=true

# default assembler optimization stuff
enable_engine_asm=$enable_asm

ROUTE_CONFIGURED_SRCS='$(ROUTE_SRCS_DEFAULT)'
QS_ADDRSPACE='kernel'
QS_EXTRALIBS=

case $target in

  *-*-netbsd*)
    # Generic NetBSD definitions.
    SSH_INTERCEPTOR_MACHINE_DIR=bsd
    SSH_INTERCEPTOR_OBJS='$(BSD_OBJS) icept_lkm_bsd.o'
    SSH_INTERCEPTOR_NONETHER_OBJS='$(NETBSD_NONETHER_OBJS) $(I386_OBJS)'
    SSH_INTERCEPTOR_ETHER_OBJS='$(NETBSD_ETHER_OBJS) $(I386_OBJS)'
    SSH_INTERCEPTOR_TARGETS="sshipsec_tester.o interceptor_tester quicksec_usermode.o"
    SSH_INTERCEPTOR_MEDIA_TARGETS="quicksec_usermode_ether.o"

    SSH_INTERCEPTOR_TARGETS="$SSH_INTERCEPTOR_TARGETS quicksec.o"
    SSH_INTERCEPTOR_MEDIA_TARGETS="$SSH_INTERCEPTOR_MEDIA_TARGETS quicksec_ether.o"
    QS_ADDRSPACE='kernel'

    SSH_INTERCEPTOR_CPPFLAGS="-DKERNEL -D_KERNEL -D_LKM -DSSH_ALLOW_SYSTEM_ALLOCATORS"

    # Interceptor features.
    interceptor_has_packet_alloc_and_copy_ext_data=true

    # NetBSD version dependent configuration.
    case $target in
      i386-*-netbsd1.3.2*)
	cat >> confdefs.h <<\EOF
#define SSH_NetBSD 132
EOF

        SSH_INTERCEPTOR_MACHINE_SUBDIR='$(srcdir)/netbsd132'
        SSH_INTERCEPTOR_TARGETS="$SSH_INTERCEPTOR_TARGETS $SSH_INTERCEPTOR_MEDIA_TARGETS"
        ;;

      i386-*-netbsd1.3.3*)
	cat >> confdefs.h <<\EOF
#define SSH_NetBSD 133
EOF

        SSH_INTERCEPTOR_MACHINE_SUBDIR='$(srcdir)/netbsd133'
        SSH_INTERCEPTOR_TARGETS="$SSH_INTERCEPTOR_TARGETS $SSH_INTERCEPTOR_MEDIA_TARGETS"
        ;;

      i386-*-netbsd1.4*|i386-*-netbsdelf1.4*)
	cat >> confdefs.h <<\EOF
#define SSH_NetBSD 140
EOF

        SSH_INTERCEPTOR_MACHINE_SUBDIR='$(srcdir)/netbsd140'
        SSH_INTERCEPTOR_CPPFLAGS="$SSH_INTERCEPTOR_CPPFLAGS -DGATEWAY"
        ;;

      i386-*-netbsd*1.5|i386-*-netbsd*1.5.*)
	# 1.5.3 is a bit different.
        case $target in
          i386-*-netbsd*1.5.3)
            cat >> confdefs.h <<\EOF
#define SSH_NetBSD 153
EOF

            ;;
          *)
	    cat >> confdefs.h <<\EOF
#define SSH_NetBSD 150
EOF

	    ;;
	esac

	SSH_INTERCEPTOR_MACHINE_DIR='bsd'
        SSH_INTERCEPTOR_MACHINE_SUBDIR='netbsd150'
        SSH_INTERCEPTOR_TARGETS="$SSH_INTERCEPTOR_TARGETS $SSH_INTERCEPTOR_MEDIA_TARGETS"
        SSH_INTERCEPTOR_CPPFLAGS="$SSH_INTERCEPTOR_CPPFLAGS -DGATEWAY"
        cat >> confdefs.h <<\EOF
#define INTERCEPTOR_HAS_VIRTUAL_ADAPTERS 1
EOF


	# Interceptor features.
	interceptor_sets_ip_forwarding=true
        ;;

      i386-*-netbsdelf1.6*|i386-*-netbsd*1.5?|i386-*-netbsd*1.5??)
	cat >> confdefs.h <<\EOF
#define SSH_NetBSD 160
EOF

	SSH_INTERCEPTOR_MACHINE_DIR='bsd'
        SSH_INTERCEPTOR_MACHINE_SUBDIR='netbsd160'
        SSH_INTERCEPTOR_TARGETS="$SSH_INTERCEPTOR_TARGETS $SSH_INTERCEPTOR_MEDIA_TARGETS"
        SSH_INTERCEPTOR_CPPFLAGS="$KERNEL_INCLUDE $SSH_INTERCEPTOR_CPPFLAGS"
        cat >> confdefs.h <<\EOF
#define INTERCEPTOR_HAS_VIRTUAL_ADAPTERS 1
EOF


	# Interceptor features.
	interceptor_sets_ip_forwarding=true
        ;;

      i386-*-netbsd*2.*)
	cat >> confdefs.h <<\EOF
#define SSH_NetBSD 200
EOF

	SSH_INTERCEPTOR_MACHINE_DIR='bsd'
        SSH_INTERCEPTOR_MACHINE_SUBDIR='netbsd-pfil'
        SSH_INTERCEPTOR_TARGETS="$SSH_INTERCEPTOR_TARGETS"
	if test "x$KERNEL_INCLUDE" = "x" ; then
	    KERNEL_INCLUDE=-I/usr/src/sys
	fi
	SSH_INTERCEPTOR_CPPFLAGS="$SSH_INTERCEPTOR_CPPFLAGS -fno-builtin-printf -fno-builtin-vprintf"
        SSH_INTERCEPTOR_CPPFLAGS="$KERNEL_INCLUDE $SSH_INTERCEPTOR_CPPFLAGS"
        cat >> confdefs.h <<\EOF
#define INTERCEPTOR_HAS_VIRTUAL_ADAPTERS 1
EOF

	interceptor_sets_ip_forwarding=true
	;;

      i386-*-netbsd*3.*)
	cat >> confdefs.h <<\EOF
#define SSH_NetBSD 300
EOF

	SSH_INTERCEPTOR_MACHINE_DIR='bsd'
        SSH_INTERCEPTOR_MACHINE_SUBDIR='netbsd-pfil'
        SSH_INTERCEPTOR_TARGETS="$SSH_INTERCEPTOR_TARGETS"
	if test "x$KERNEL_INCLUDE" = "x" ; then
	    KERNEL_INCLUDE=-I/usr/src/sys
	fi
	SSH_INTERCEPTOR_CPPFLAGS="$SSH_INTERCEPTOR_CPPFLAGS -fno-builtin-printf -fno-builtin-vprintf"
        SSH_INTERCEPTOR_CPPFLAGS="$KERNEL_INCLUDE $SSH_INTERCEPTOR_CPPFLAGS"
        cat >> confdefs.h <<\EOF
#define INTERCEPTOR_HAS_VIRTUAL_ADAPTERS 1
EOF

	interceptor_sets_ip_forwarding=true
	;;

      i386-*-netbsd*4.*)
	cat >> confdefs.h <<\EOF
#define SSH_NetBSD 400
EOF

	SSH_INTERCEPTOR_MACHINE_DIR='bsd'
        SSH_INTERCEPTOR_MACHINE_SUBDIR='netbsd-pfil'
        SSH_INTERCEPTOR_TARGETS="$SSH_INTERCEPTOR_TARGETS"
	if test "x$KERNEL_INCLUDE" = "x" ; then
	    KERNEL_INCLUDE=-I/usr/src/sys
	fi
	SSH_INTERCEPTOR_CPPFLAGS="$SSH_INTERCEPTOR_CPPFLAGS -fno-builtin-printf -fno-builtin-vprintf"
        SSH_INTERCEPTOR_CPPFLAGS="$KERNEL_INCLUDE $SSH_INTERCEPTOR_CPPFLAGS"
        cat >> confdefs.h <<\EOF
#define INTERCEPTOR_HAS_VIRTUAL_ADAPTERS 1
EOF

	interceptor_sets_ip_forwarding=true
	;;
    esac

    case $target in
      i386-*-netbsd*2.*|i386-*-netbsd*3.*)
	echo $ac_n "checking whether NetBSD kernel sources are available""... $ac_c" 1>&6
echo "configure:4979: checking whether NetBSD kernel sources are available" >&5
	oldcppflags="$CPPFLAGS"
	CPPFLAGS="$KERNEL_INCLUDE"
	cat > conftest.$ac_ext <<EOF
#line 4983 "configure"
#include "confdefs.h"

#include <sys/types.h>
#include <arch/x86/include/pic.h>
void test() {
 ;
}

int main() {

; return 0; }
EOF
if { (eval echo configure:4996: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  echo "$ac_t""yes" 1>&6
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  { echo "configure: error: no. Install kernel sources (or use --with-kernel-headers)" 1>&2; exit 1; }
fi
rm -f conftest*
	CPPFLAGS="$oldcppflags"

      ;;
    esac

    icept_result="$SSH_INTERCEPTOR_MACHINE_DIR: $SSH_INTERCEPTOR_TARGETS"

    ;;

*-*-vxworks*)
  SSH_INTERCEPTOR_MACHINE_DIR=bsd
  SSH_INTERCEPTOR_MACHINE_SUBDIR='$(srcdir)/vxworks54'
  SSH_INTERCEPTOR_OBJS='$(VXWORKS_OBJS)'
  SSH_INTERCEPTOR_NONETHER_OBJS=
  SSH_INTERCEPTOR_ETHER_OBJS=
  SSH_INTERCEPTOR_TARGETS=
  SSH_INTERCEPTOR_CPPFLAGS="$KERNEL_INCLUDE -DSSH_ALLOW_SYSTEM_ALLOCATORS"
  SSH_INTERCEPTOR_CPPFLAGS="$SSH_INTERCEPTOR_CPPFLAGS"

  SSH_INTERCEPTOR_TARGETS="$SSH_INTERCEPTOR_TARGETS quicksecpm.o"

  cat >> confdefs.h <<\EOF
#define INTERCEPTOR_HAS_VIRTUAL_ADAPTERS 1
EOF


  # Interceptor features.
  interceptor_has_packet_alloc_and_copy_ext_data=true
  interceptor_handles_loopback_packets=true

  icept_result="$SSH_INTERCEPTOR_MACHINE_DIR: $SSH_INTERCEPTOR_TARGETS"
  QS_ADDRSPACE='unified-kernel'
  QS_EXTRALIBS='$(top_builddir)/ipsec/lib/libsshipsec.a $(top_builddir)/lib/libssh.a'

  # VxWorks does not have separate cpp and cc flags for kernel modules
  KERN_CFLAGS="$CPPFLAGS $CFLAGS"

  # For final interceptor + engine linkage we don't want to specify
  # any VxWorks libs, because user will perform final link against
  # VxWorks kernel by himself.
  KERN_LDFLAGS=" "
  KERN_LIBS=" "

  ;;



  *-*-linux*)
    # Use kernel version of running kernel if version was not specified.
    LINUX_KERNEL_VERSION=`uname -r`
    : ${KERNEL_VERSION:="$LINUX_KERNEL_VERSION"}

    case $target in
      mips64-octeon-linux-gnu)
        SSH_INTERCEPTOR_MACHINE_DIR="caviumocteon"
        SSH_INTERCEPTOR_MACHINE_SUBDIR='$(srcdir)/linux'
	SSH_INTERCEPTOR_CPPFLAGS='-I$(top_srcdir)/interceptor/linux'
        ;;
      *)
        SSH_INTERCEPTOR_MACHINE_DIR="linux"
        ;;
    esac
     	
    SSH_INTERCEPTOR_OBJS='$(LINUX_OBJS)'
    SSH_INTERCEPTOR_NONETHER_OBJS='$(LINUX_NONETHER_OBJS)'
    SSH_INTERCEPTOR_ETHER_OBJS='$(LINUX_ETHER_OBJS)'
    SSH_INTERCEPTOR_TARGETS='sshipsec_tester.o'
    SSH_INTERCEPTOR_TARGETS="$SSH_INTERCEPTOR_TARGETS quicksec.o quicksec_usermode.o"

    # Linux interceptor has readonly versions of iteration/pullup
    need_readonly_defines=false

    # Linux interceptor has copyin and copyout
    interceptor_has_packet_copyin=true
    interceptor_has_packet_copyout=true

    # Linux interceptor has "mark" function
    interceptor_has_mark_func=true

    # Linux interceptor may have internal data for usermode engine
    interceptor_has_packet_internal_data_routines=true

    # Linux interceptor may provide a ssh_interceptor_packet_detach()
    # function.
    interceptor_has_packet_detach=true

    # Linux interceptor has a platform specific "platform_interceptor.h"
    # include file.
    interceptor_has_platform_include=true

    # Linux interceptor has an implementation of
    # ssh_interceptor_packet_cache()
    interceptor_has_packet_cache=false

    # Linux interceptor does not implement kernel level virtual adapter
    # configure.
    interceptor_implements_virtual_adapter_configure=false

    # Linux interceptor does not implement kernel level routing table 
    # modification
    interceptor_implements_route_modify=false

    cat >> confdefs.h <<\EOF
#define INTERCEPTOR_HAS_VIRTUAL_ADAPTERS 1
EOF


    # Set kernel includes path to /lib/modules/$KERNEL_VERSION/build/include 
    # if path was not specified.
    if test "x$KERNEL_INCLUDE" = "x"; then
      LINUX_KERNEL_INCLUDE="/lib/modules/$KERNEL_VERSION/build/include"
    else
      LINUX_KERNEL_INCLUDE="$KERNEL_INCLUDE"
    fi

    # Check that kernel is configured.
    echo $ac_n "checking whether linux kernel is configured""... $ac_c" 1>&6
echo "configure:5123: checking whether linux kernel is configured" >&5
    if test -f "$LINUX_KERNEL_INCLUDE/linux/autoconf.h"; then
	echo "$ac_t""yes" 1>&6
    else
	{ echo "configure: error: no, please configure linux kernel" 1>&2; exit 1; }
    fi

    # Check that kernel headers include 'linux/version.h' 
    # which is created dynamically.
    echo $ac_n "checking for "linux/version.h"""... $ac_c" 1>&6
echo "configure:5133: checking for "linux/version.h"" >&5
    if test -f "$LINUX_KERNEL_INCLUDE/linux/version.h"; then
	echo "$ac_t""ok" 1>&6
    else
	{ echo "configure: error: "linux/version.h"
		not found in $LINUX_KERNEL_INCLUDE, generate it with
		'make include/linux/version.h' or 'make menuconfig'
		in the top of linux kernel source tree." 1>&2; exit 1; }
    fi

    # Check kernel major version and set compiler flags
    echo $ac_n "checking linux major kernel version""... $ac_c" 1>&6
echo "configure:5145: checking linux major kernel version" >&5
    KERNEL_MAJOR_VERSION=`echo $KERNEL_VERSION | cut -d- -f1`
    case $KERNEL_MAJOR_VERSION in
      2.6.*)
        echo "$ac_t""2.6" 1>&6
	LINUX_CONFIG_HEADER="$LINUX_KERNEL_INCLUDE/linux/autoconf.h"
	;;
	
      *)
        { echo "configure: error: Unsupported kernel version!" 1>&2; exit 1; }
	;;
    esac

    # linux architecture specific include dir for 2.6.28 and later kernels
    LINUXARCH=`echo $target | sed -e s/-.*// | \
            sed \
            -e s/i.86/x86/ -e s/sun4u/sparc/ \
            -e s/arm.*/arm/ -e s/sa110/arm/ \
            -e s/s390x/s390/ -e s/parisc64/parisc/ \
            -e s/ppc.*/powerpc/ -e s/mips.*/mips/ \
            -e s/sh234.*/sh/ -e s/sh64/sh/ \
            -e s/x86_64/x86/ -e s/sparc64/sparc/ \
            -e s/m68knommu/m68k/`


    SSH_INTERCEPTOR_CPPFLAGS="$SSH_INTERCEPTOR_CPPFLAGS -D__KERNEL__ -D_KERNEL -DKERNEL -DMODULE -I$LINUX_KERNEL_INCLUDE -include $LINUX_CONFIG_HEADER"

    SSH_KB_LINUX_KERNEL_INCLUDE="$LINUX_KERNEL_INCLUDE"
    SSH_KB_LINUX_KERNEL_INCLUDE=`echo $SSH_KB_LINUX_KERNEL_INCLUDE|sed 's@/include@@g'`
    SSH_KB_LINUX_CONFIG_HEADER="-include $LINUX_CONFIG_HEADER"

    # Set kernel minor version specific flags
    case $KERNEL_MAJOR_VERSION in
      2.6.[0-8]|2.6.[0-8].*)
        # 2.6.0-2.6.8.1
	SSH_INTERCEPTOR_CPPFLAGS="$SSH_INTERCEPTOR_CPPFLAGS -I$LINUX_KERNEL_INCLUDE/asm/mach-default -DKBUILD_BASENAME=quicksec"
	SSH_INTERCEPTOR_TARGETS=`echo $SSH_INTERCEPTOR_TARGETS|sed 's@\.o@\.ko@g'`
	;;
      2.6.10_mvl401*)
        # Montavista Linux 4.0
	SSH_INTERCEPTOR_CPPFLAGS="$SSH_INTERCEPTOR_CPPFLAGS -I$LINUX_KERNEL_INCLUDE/asm/mach-default -DMONTAVISTA_4 -DKBUILD_BASENAME=quicksec"
	SSH_INTERCEPTOR_TARGETS=`echo $SSH_INTERCEPTOR_TARGETS|sed 's@\.o@\.ko@g'`
	cat >> confdefs.h <<\EOF
#define LINUX_HAS_RTM_SETLINK 1
EOF

	;;
      2.6.9|2.6.9.*|2.6.1[0-5]|2.6.1[0-5].*)
        # 2.6.9-2.6.15
	SSH_INTERCEPTOR_CPPFLAGS="$SSH_INTERCEPTOR_CPPFLAGS -I$LINUX_KERNEL_INCLUDE/asm/mach-default -DKBUILD_BASENAME=quicksec"
	SSH_INTERCEPTOR_TARGETS=`echo $SSH_INTERCEPTOR_TARGETS|sed 's@\.o@\.ko@g'`
	cat >> confdefs.h <<\EOF
#define LINUX_HAS_RTM_SETLINK 1
EOF

	;;

      2.6.28*|2.6.29*)
        # 2.6.28 and 2.6.29
	SSH_INTERCEPTOR_CPPFLAGS="$SSH_INTERCEPTOR_CPPFLAGS -DKBUILD_BASENAME=quicksec -I$LINUX_KERNEL_INCLUDE/../arch/$LINUXARCH/include -I$LINUX_KERNEL_INCLUDE/../arch/$LINUXARCH/include/asm/mach-default "
	SSH_INTERCEPTOR_TARGETS=`echo $SSH_INTERCEPTOR_TARGETS|sed 's@\.o@\.ko@g'`
	cat >> confdefs.h <<\EOF
#define LINUX_HAS_RTM_SETLINK 1
EOF

        ;;

      2.6.3[01]*)
        # 2.6.28-2.6.31
	SSH_INTERCEPTOR_CPPFLAGS="$SSH_INTERCEPTOR_CPPFLAGS -DKBUILD_BASENAME=quicksec -I$LINUX_KERNEL_INCLUDE/../arch/$LINUXARCH/include"
	SSH_INTERCEPTOR_TARGETS=`echo $SSH_INTERCEPTOR_TARGETS|sed 's@\.o@\.ko@g'`
	cat >> confdefs.h <<\EOF
#define LINUX_HAS_RTM_SETLINK 1
EOF

        ;;

      2.6.*)
        # 2.6 that was not matched above
	SSH_INTERCEPTOR_CPPFLAGS="$SSH_INTERCEPTOR_CPPFLAGS -I$LINUX_KERNEL_INCLUDE/asm/mach-default -D\"KBUILD_STR(s)=\\#s\" -D\"KBUILD_BASENAME=KBUILD_STR(quicksec)\" -D\"KBUILD_MODNAME=KBUILD_STR(quicksec)\""
	SSH_INTERCEPTOR_TARGETS=`echo $SSH_INTERCEPTOR_TARGETS|sed 's@\.o@\.ko@g'`
	cat >> confdefs.h <<\EOF
#define LINUX_HAS_RTM_SETLINK 1
EOF

	;;
    esac
    
    echo $ac_n "checking whether to compile for an SMP kernel""... $ac_c" 1>&6
echo "configure:5234: checking whether to compile for an SMP kernel" >&5
    # Check whether --enable-smp or --disable-smp was given.
if test "${enable_smp+set}" = set; then
  enableval="$enable_smp"
   case "$enableval" in
	no)
          ;; 
	*)
          enable_smp=yes
	  ;;
       esac 
else
   oldcppflags="$CPPFLAGS"
      CPPFLAGS="-I$LINUX_KERNEL_INCLUDE -include $LINUX_CONFIG_HEADER"
      cat > conftest.$ac_ext <<EOF
#line 5249 "configure"
#include "confdefs.h"

	      void test() {
	      #ifndef CONFIG_SMP
		  This is a syntax error
              #endif
		  }
int main() {

; return 0; }
EOF
if { (eval echo configure:5261: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  enable_smp=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
fi
rm -f conftest*
      CPPFLAGS="$oldcppflags" 
fi

    if test "x$enable_smp" = "xyes"; then
	echo "$ac_t""yes" 1>&6
	SSH_INTERCEPTOR_CPPFLAGS="$SSH_INTERCEPTOR_CPPFLAGS -D__SMP__"
    else
	echo "$ac_t""no" 1>&6
    fi

    # Add -g to KERN_CFLAGS
    if ( echo $CFLAGS | grep "\-g" > /dev/null ); then
	KERN_CFLAGS="$KERN_CFLAGS -g";
    fi

    # Add -Wno-pointer-sign to KERN_CFLAGS
    if ( echo $CFLAGS | grep "\-Wno\-pointer\-sign" > /dev/null )
    then
        KERN_CFLAGS="$KERN_CFLAGS -Wno-pointer-sign";
    fi

    # Check hw platform specific compiler flags

    # Check if -mregparm=3 is needed (only for i386)
    case $KERNEL_MAJOR_VERSION in
      2.6.[0-9]|2.6.[0-9].*|2.6.1[0-9]|2.6.1[0-9].*)
	echo $ac_n "checking whether linux kernel was compiled with CONFIG_REGPARM""... $ac_c" 1>&6
echo "configure:5296: checking whether linux kernel was compiled with CONFIG_REGPARM" >&5
	oldcppflags="$CPPFLAGS"
	CPPFLAGS="-I$LINUX_KERNEL_INCLUDE -include $LINUX_CONFIG_HEADER"
	cat > conftest.$ac_ext <<EOF
#line 5300 "configure"
#include "confdefs.h"

		void test() {
	        #ifndef CONFIG_REGPARM
		    This is a syntax error
                #endif
		    }
int main() {

; return 0; }
EOF
if { (eval echo configure:5312: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  linux_i386_regparm=yes
	     echo "$ac_t""yes" 1>&6
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  echo "$ac_t""no" 1>&6
fi
rm -f conftest*
	CPPFLAGS="$oldcppflags"      
	;;

      *)
        # Starting from 2.6.20 -mregparm=3 is always set
        linux_i386_regparm=yes;
	;;
    esac

    # Check -fstack-protector and -fstack-protector-all (only for x86_64)
    echo $ac_n "checking whether linux kernel was compiled with CONFIG_CC_STACKPROTECTOR""... $ac_c" 1>&6
echo "configure:5334: checking whether linux kernel was compiled with CONFIG_CC_STACKPROTECTOR" >&5
    oldcppflags="$CPPFLAGS"
    CPPFLAGS="-I$LINUX_KERNEL_INCLUDE -include $LINUX_CONFIG_HEADER"
    cat > conftest.$ac_ext <<EOF
#line 5338 "configure"
#include "confdefs.h"

	    void test() {
	    #ifndef CONFIG_CC_STACKPROTECTOR
		This is a syntax error
            #endif
		}
int main() {

; return 0; }
EOF
if { (eval echo configure:5350: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  linux_x86_64_stackprotector=yes
	    echo "$ac_t""yes" 1>&6
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  echo "$ac_t""no" 1>&6
fi
rm -f conftest*
    CPPFLAGS="$oldcppflags"

    echo $ac_n "checking whether linux kernel was compiled with CONFIG_CC_STACKPROTECTOR_ALL""... $ac_c" 1>&6
echo "configure:5364: checking whether linux kernel was compiled with CONFIG_CC_STACKPROTECTOR_ALL" >&5
    oldcppflags="$CPPFLAGS"
    CPPFLAGS="-I$LINUX_KERNEL_INCLUDE -include $LINUX_CONFIG_HEADER"
    cat > conftest.$ac_ext <<EOF
#line 5368 "configure"
#include "confdefs.h"

	    void test() {
	    #ifndef CONFIG_CC_STACKPROTECTOR_ALL
		This is a syntax error
            #endif
		}
int main() {

; return 0; }
EOF
if { (eval echo configure:5380: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  linux_x86_64_stackprotector_all=yes
	    echo "$ac_t""yes" 1>&6
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  echo "$ac_t""no" 1>&6
fi
rm -f conftest*
    CPPFLAGS="$oldcppflags"
    
    # Set hw platform specific compiler flags
    case $target in
	i[3-6]86-*-linux*)
	  if test "x$linux_i386_regparm" = "xyes"; then
	      KERN_CFLAGS="$KERN_CFLAGS -mregparm=3"
	      if test "x$enable_asm" = "xyes"; then
		  cat >> confdefs.h <<\EOF
#define NEED_ASM_LINKAGE 1
EOF

	      fi
	  fi
	;;

	powerpc64-*-linux*)
	  KERN_CFLAGS="$KERN_CFLAGS -Wa,-a64,-mppc64 -m64"
	;;

	x86_64-*-linux*)
	  KERN_CFLAGS="$KERN_CFLAGS -mcmodel=kernel"
	  if test "x$linux_x86_64_stackprotector" = "xyes"; then
	      KERN_CFLAGS="$KERN_CFLAGS -fstack-protector"
	  fi
	  if test "x$linux_x86_64_stackprotector_all" = "xyes"; then
	      KERN_CFLAGS="$KERN_CFLAGS -fstack-protector-all"
	  fi
	;;
    esac

    # Skip linux kernel feature checks if we are not building the interceptor.
    if test "x$disable_interceptor" != "xyes"; then

      echo $ac_n "checking whether linux kernel has netfilter support""... $ac_c" 1>&6
echo "configure:5426: checking whether linux kernel has netfilter support" >&5
      oldcppflags="$CPPFLAGS"
      CPPFLAGS="-I$LINUX_KERNEL_INCLUDE -include $LINUX_CONFIG_HEADER"
      cat > conftest.$ac_ext <<EOF
#line 5430 "configure"
#include "confdefs.h"

	      void test() {
	      #ifndef CONFIG_NETFILTER
		  This is a syntax error
              #endif
		  }
int main() {

; return 0; }
EOF
if { (eval echo configure:5442: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  echo "$ac_t""yes" 1>&6
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  { echo "configure: error: no, please recompile with CONFIG_NETFILTER=y" 1>&2; exit 1; }
fi
rm -f conftest*
      CPPFLAGS="$oldcppflags"

      echo $ac_n "checking whether linux kernel was compiled with CONFIG_4KSTACKS""... $ac_c" 1>&6
echo "configure:5455: checking whether linux kernel was compiled with CONFIG_4KSTACKS" >&5
      oldcppflags="$CPPFLAGS"
      CPPFLAGS="-I$LINUX_KERNEL_INCLUDE -include $LINUX_CONFIG_HEADER"
      cat > conftest.$ac_ext <<EOF
#line 5459 "configure"
#include "confdefs.h"

	      void test() {
	      #ifndef CONFIG_4KSTACKS
		  This is a syntax error
              #endif
		  }
int main() {

; return 0; }
EOF
if { (eval echo configure:5471: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  linux_config_4k_stacks=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
fi
rm -f conftest*
      CPPFLAGS="$oldcppflags"
      # Check whether --with-4k-stacks or --without-4k-stacks was given.
if test "${with_4k_stacks+set}" = set; then
  withval="$with_4k_stacks"
  with_4k_stacks=$withval
fi

      if test "x$linux_config_4k_stacks" = "xyes" || test "x$with_4k_stacks" = "xyes"; then
	  echo "$ac_t""yes, enabling MINIMAL_STACK" 1>&6
	  cat >> confdefs.h <<\EOF
#define MINIMAL_STACK 1
EOF

	  echo $ac_n "checking whether compiler supports -fno-unit-at-a-time""... $ac_c" 1>&6
echo "configure:5493: checking whether compiler supports -fno-unit-at-a-time" >&5
	  oldcppflags="$CPPFLAGS"
	  CPPFLAGS="-I$LINUX_KERNEL_INCLUDE -include $LINUX_CONFIG_HEADER"
	  oldcflags="$CFLAGS"
	  CFLAGS="-fno-unit-at-a-time"
	  cat > conftest.$ac_ext <<EOF
#line 5499 "configure"
#include "confdefs.h"

		  void test() {
		      }
int main() {

; return 0; }
EOF
if { (eval echo configure:5508: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  echo "$ac_t""yes" 1>&6
		  KERN_CFLAGS="$KERN_CFLAGS -fno-unit-at-a-time"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  echo "$ac_t""no" 1>&6
fi
rm -f conftest*
	  CPPFLAGS="$oldcppflags"
	  CFLAGS="$oldcflags"
      else
        echo "$ac_t""no" 1>&6
      fi

    # end of 'if test "x$disable_interceptor" != "xyes"'
    fi

    # Make sure KERN_CFLAGS contains -O, as Linux (linux/string.h) expects
    # inline functions to work.
    if (! echo $KERN_CFLAGS | grep "\-O" > /dev/null ); then
	KERN_CFLAGS="$KERN_CFLAGS -O"
    fi
    
    KERN_CFLAGS="$KERN_CFLAGS -fno-common -Wall"
    KERN_LDFLAGS="$KERN_LDFLAGS -fno-common"

    icept_result="Linux $KERNEL_VERSION"
    QS_ADDRSPACE='kernel'
    ;;


  *)
    SSH_INTERCEPTOR_MACHINE_DIR=
    SSH_INTERCEPTOR_MACHINE_SUBDIR=
    icept_result="none"
    echo "configure: warning: No packet interceptor available for this platform ($target)." 1>&2
    ;;
esac

# If $need_readonly_defines is "true", define
# NEED_PACKET_READONLY_DEFINES symbol.
if test "$need_readonly_defines" = "true"
then
    cat >> confdefs.h <<\EOF
#define NEED_PACKET_READONLY_DEFINES 1
EOF

fi

# If $interceptor_has_packet_alloc_and_copy_ext_data is "true",
# define INTERCEPTOR_HAS_PACKET_ALLOC_AND_COPY_EXT_DATA symbol.
if test "$interceptor_has_packet_alloc_and_copy_ext_data" = "true"
then
    cat >> confdefs.h <<\EOF
#define INTERCEPTOR_HAS_PACKET_ALLOC_AND_COPY_EXT_DATA 1
EOF

fi

# If $interceptor_has_packet_copy is "true", define
# INTERCEPTOR_HAS_PACKET_COPY symbol.
if test "$interceptor_has_packet_copy" = "true"
then
    cat >> confdefs.h <<\EOF
#define INTERCEPTOR_HAS_PACKET_COPY 1
EOF

fi

# If $interceptor_has_packet_copyin is "true", define
# INTERCEPTOR_HAS_PACKET_COPYIN symbol.
if test "$interceptor_has_packet_copyin" = "true"
then
    cat >> confdefs.h <<\EOF
#define INTERCEPTOR_HAS_PACKET_COPYIN 1
EOF

fi

# If $interceptor_has_packet_copyout is "true", define
# INTERCEPTOR_HAS_PACKET_COPYOUT symbol.
if test "$interceptor_has_packet_copyout" = "true"
then
    cat >> confdefs.h <<\EOF
#define INTERCEPTOR_HAS_PACKET_COPYOUT 1
EOF

fi

# If $interceptor_has_mark_func is "true", define
# INTERCEPTOR_HAS_MARK_FUNC symbol
if test "$interceptor_has_mark_func" = "true"
then
    cat >> confdefs.h <<\EOF
#define INTERCEPTOR_HAS_MARK_FUNC 1
EOF

fi

# If $interceptor_has_packet_internal_data_routines is "true", define
# INTERCEPTOR_HAS_PACKET_INTERNAL_DATA_ROUTINES.
if test "$interceptor_has_packet_internal_data_routines" = "true"
then
    cat >> confdefs.h <<\EOF
#define INTERCEPTOR_HAS_PACKET_INTERNAL_DATA_ROUTINES 1
EOF

fi

# If $interceptor_has_packet_detach is "true", define
# INTERCEPTOR_HAS_PACKET_DETACH
if test "$interceptor_has_packet_detach" = "true"
then
    cat >> confdefs.h <<\EOF
#define INTERCEPTOR_HAS_PACKET_DETACH 1
EOF

fi

# If $interceptor_has_packet_cache is "true", define
# INTERCEPTOR_HAS_PACKET_CACHE
if test "$interceptor_has_packet_cache" = "true"
then
    cat >> confdefs.h <<\EOF
#define INTERCEPTOR_HAS_PACKET_CACHE 1
EOF

fi

# If $interceptor_has_platform_include is "true", define
# INTERCEPTOR_HAS_PLATFORM_INCLUDE
if test "$interceptor_has_platform_include" = "true"
then
    cat >> confdefs.h <<\EOF
#define INTERCEPTOR_HAS_PLATFORM_INCLUDE 1
EOF

fi

# If $interceptor_sets_ip_forwarding is "true", define
# INTERCEPTOR_SETS_IP_FORWARDING symbol.
if test "$interceptor_sets_ip_forwarding" = "true"
then
    cat >> confdefs.h <<\EOF
#define INTERCEPTOR_SETS_IP_FORWARDING 1
EOF

fi

# If $interceptor_handles_loopback_packets is "true", define
# INTERCEPTOR_HANDLES_LOOPBACK_PACKETS symbol.
if test "$interceptor_handles_loopback_packets" = "true"
then
    cat >> confdefs.h <<\EOF
#define INTERCEPTOR_HANDLES_LOOPBACK_PACKETS 1
EOF

fi

# If $interceptor_implements_virtual_adapter_configure is "true", define
# INTERCEPTOR_IMPLEMENTS_VIRTUAL_ADAPTER_CONFIGURE symbol.
if test "$interceptor_implements_virtual_adapter_configure" = "true"
then
    cat >> confdefs.h <<\EOF
#define INTERCEPTOR_IMPLEMENTS_VIRTUAL_ADAPTER_CONFIGURE 1
EOF

fi

# If $interceptor_implements_route_modify is "true", define
# INTERCEPTOR_IMPLEMENTS_ROUTE_MODIFY symbol.
if test "$interceptor_implements_route_modify" = "true"
then
    cat >> confdefs.h <<\EOF
#define INTERCEPTOR_IMPLEMENTS_ROUTE_MODIFY 1
EOF

fi

# This is needed by tests
for ac_func in mprotect
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:5694: 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 5699 "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:5722: \"$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


## Whatever we configured above, zap all interceptor parts since they
## won't be compiled.
if test "x$disable_interceptor" = "xyes"
then
    SSH_INTERCEPTOR_MACHINE_DIR=
    SSH_INTERCEPTOR_MACHINE_SUBDIR=
    SSH_INTERCEPTOR_KERNEL_TARGETS=
    SSH_INTERCEPTOR_TARGETS=
    SSH_INTERCEPTOR_OBJS=
    SSH_INTERCEPTOR_NONETHER_OBJS=
    SSH_INTERCEPTOR_ETHER_OBJS=
    SSH_INTERCEPTOR_CPPFLAGS=
    SSH_INTERCEPTOR_SYMCHECK=
    SSH_KB_LINUX_KERNEL_INCLUDE=
    SSH_KB_LINUX_CONFIG_HEADER=
else
    echo $ac_n "checking IPSEC packet interceptor support""... $ac_c" 1>&6
echo "configure:5764: checking IPSEC packet interceptor support" >&5
    echo "$ac_t""$icept_result" 1>&6
fi

















## Check KERN_ symbols, and do fallbacks if necessary. If we are
## compiling interceptor then KERN_* may have been set by the platform
## cases. If we are not building interceptor, use the normal compiler
## as default.

: ${KERN_CC:="$CC"}
: ${KERN_CFLAGS:="$CFLAGS"}
: ${KERN_LDFLAGS:="$LDFLAGS"}
# Perhaps it is not a good idea to try to use user-level libraries in
# kernel linkage..
: ${KERN_LIBS:=""}
##: ${KERN_LIBS:="$LIBS"}






########################################################################

############################################################################

## Check for things we need to do differently in the policy manager
## for different platforms.

echo $ac_n "checking IPM routing method""... $ac_c" 1>&6
echo "configure:5810: checking IPM routing method" >&5
case $target in
    *-*-solaris2.6|*-*-solaris2.7|*-*-solaris2.8)
	SSH_IPM_MACHINE_OBJS='$(SOLARIS_MACHINE_OBJS)'
	echo "$ac_t""Solaris" 1>&6
	;;
    *)
	SSH_IPM_MACHINE_OBJS='$(GENUNIX_MACHINE_OBJS)'
	echo "$ac_t""kernel-based (stubs only)" 1>&6
	;;
esac



# Notice: We do this separately from $enable_asm (which
# $enable_engine_asm defaults to) separately so it is possible to
# disable the assembler optimization code inside kernel.

if test "x$enable_engine_asm" = "xyes"; then
    ENGINE_ASM_OBJS='$(asm_cipher_objs) $(asm_hash_objs)'
    QUICKSEC_ASM_OBJS='$(asm_quicksec_objs)'
else
    ENGINE_ASM_OBJS=""
    QUICKSEC_ASM_OBJS=""
fi




# Check kernel-compilation mode sizes of basic types.  (but not if
# interceptor is disabled). We compile libengine.a on kernel only if
# interceptor is enabled.

if test "x$disable_interceptor" != "xyes"
then
    # Store old values, and use kernel compilation values for a minute.
    CFLAGS_store="$CFLAGS"
    LDFLAGS_store="$LDFLAGS"
    CFLAGS="$KERN_CFLAGS"
    LDFLAGS="$KERN_LDFLAGS"

    # There is a thing with Tru64 -- we must weed out the -Wb,-static out
    # before doing kernelmode basic type size checks:
    if test "x$SSH_INTERCEPTOR_MACHINE_DIR" = "xtru64"; then
	CFLAGS=`echo "$CFLAGS" | sed 's/-Wb,-static//; s/-Wf,-static//;'`
    fi

    # Remove -mregparm=3 from KERN_CFLAGS, 
    # since it is not compatible with AC_CHECK_SIZEOF_WITH_PREFIX.
    CFLAGS=`echo "$CFLAGS" | sed -e 's/-mregparm=3//' -e 's/-fstack-protector-all//'`

    echo $ac_n "checking size of kernel void *""... $ac_c" 1>&6
echo "configure:5862: checking size of kernel void *" >&5
if eval "test \"`echo '$''{'ac_cv_kernel_sizeof_void_p'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test "$cross_compiling" = yes; then
  ac_cv_kernel_sizeof_void_p=$cross_sizeof_kernel_pointer
else
  cat > conftest.$ac_ext <<EOF
#line 5870 "configure"
#include "confdefs.h"
#include <stdio.h>
main()
{
  FILE *f=fopen("conftestval", "w");
  if (!f) exit(1);
  fprintf(f, "%d\n", sizeof(void *));
  exit(0);
}
EOF
if { (eval echo configure:5881: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
  ac_cv_kernel_sizeof_void_p=`cat conftestval`
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -fr conftest*
  ac_cv_kernel_sizeof_void_p=0
fi
rm -fr conftest*
fi

fi
echo "$ac_t""$ac_cv_kernel_sizeof_void_p" 1>&6
cat >> confdefs.h <<EOF
#define KERNEL_SIZEOF_VOID_P $ac_cv_kernel_sizeof_void_p
EOF

cat >> confdefs.h <<EOF
#define HAVE_KERNEL_VOID_P 1
EOF


    echo $ac_n "checking size of kernel long""... $ac_c" 1>&6
echo "configure:5905: checking size of kernel long" >&5
if eval "test \"`echo '$''{'ac_cv_kernel_sizeof_long'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test "$cross_compiling" = yes; then
  ac_cv_kernel_sizeof_long=$cross_sizeof_kernel_long
else
  cat > conftest.$ac_ext <<EOF
#line 5913 "configure"
#include "confdefs.h"
#include <stdio.h>
main()
{
  FILE *f=fopen("conftestval", "w");
  if (!f) exit(1);
  fprintf(f, "%d\n", sizeof(long));
  exit(0);
}
EOF
if { (eval echo configure:5924: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
  ac_cv_kernel_sizeof_long=`cat conftestval`
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -fr conftest*
  ac_cv_kernel_sizeof_long=0
fi
rm -fr conftest*
fi

fi
echo "$ac_t""$ac_cv_kernel_sizeof_long" 1>&6
cat >> confdefs.h <<EOF
#define KERNEL_SIZEOF_LONG $ac_cv_kernel_sizeof_long
EOF

cat >> confdefs.h <<EOF
#define HAVE_KERNEL_LONG 1
EOF


    echo $ac_n "checking size of kernel int""... $ac_c" 1>&6
echo "configure:5948: checking size of kernel int" >&5
if eval "test \"`echo '$''{'ac_cv_kernel_sizeof_int'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test "$cross_compiling" = yes; then
  ac_cv_kernel_sizeof_int=$cross_sizeof_kernel_int
else
  cat > conftest.$ac_ext <<EOF
#line 5956 "configure"
#include "confdefs.h"
#include <stdio.h>
main()
{
  FILE *f=fopen("conftestval", "w");
  if (!f) exit(1);
  fprintf(f, "%d\n", sizeof(int));
  exit(0);
}
EOF
if { (eval echo configure:5967: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
  ac_cv_kernel_sizeof_int=`cat conftestval`
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -fr conftest*
  ac_cv_kernel_sizeof_int=0
fi
rm -fr conftest*
fi

fi
echo "$ac_t""$ac_cv_kernel_sizeof_int" 1>&6
cat >> confdefs.h <<EOF
#define KERNEL_SIZEOF_INT $ac_cv_kernel_sizeof_int
EOF

cat >> confdefs.h <<EOF
#define HAVE_KERNEL_INT 1
EOF


    echo $ac_n "checking size of kernel short""... $ac_c" 1>&6
echo "configure:5991: checking size of kernel short" >&5
if eval "test \"`echo '$''{'ac_cv_kernel_sizeof_short'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test "$cross_compiling" = yes; then
  ac_cv_kernel_sizeof_short=$cross_sizeof_kernel_short
else
  cat > conftest.$ac_ext <<EOF
#line 5999 "configure"
#include "confdefs.h"
#include <stdio.h>
main()
{
  FILE *f=fopen("conftestval", "w");
  if (!f) exit(1);
  fprintf(f, "%d\n", sizeof(short));
  exit(0);
}
EOF
if { (eval echo configure:6010: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
  ac_cv_kernel_sizeof_short=`cat conftestval`
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -fr conftest*
  ac_cv_kernel_sizeof_short=0
fi
rm -fr conftest*
fi

fi
echo "$ac_t""$ac_cv_kernel_sizeof_short" 1>&6
cat >> confdefs.h <<EOF
#define KERNEL_SIZEOF_SHORT $ac_cv_kernel_sizeof_short
EOF

cat >> confdefs.h <<EOF
#define HAVE_KERNEL_SHORT 1
EOF


    echo $ac_n "checking size of kernel long long""... $ac_c" 1>&6
echo "configure:6034: checking size of kernel long long" >&5
if eval "test \"`echo '$''{'ac_cv_kernel_sizeof_long_long'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test "$cross_compiling" = yes; then
  ac_cv_kernel_sizeof_long_long=$cross_sizeof_kernel_longlong
else
  cat > conftest.$ac_ext <<EOF
#line 6042 "configure"
#include "confdefs.h"
#include <stdio.h>
main()
{
  FILE *f=fopen("conftestval", "w");
  if (!f) exit(1);
  fprintf(f, "%d\n", sizeof(long long));
  exit(0);
}
EOF
if { (eval echo configure:6053: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
  ac_cv_kernel_sizeof_long_long=`cat conftestval`
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -fr conftest*
  ac_cv_kernel_sizeof_long_long=0
fi
rm -fr conftest*
fi

fi
echo "$ac_t""$ac_cv_kernel_sizeof_long_long" 1>&6
cat >> confdefs.h <<EOF
#define KERNEL_SIZEOF_LONG_LONG $ac_cv_kernel_sizeof_long_long
EOF

cat >> confdefs.h <<EOF
#define HAVE_KERNEL_LONG_LONG 1
EOF



    # Switch back to the normal values.
    CFLAGS="$CFLAGS_store"
    LDFLAGS="$LDFLAGS_store"
    unset CFLAGS_store
    unset LDFLAGS_store
    SSH_ENGINE_KERNEL_TARGET=libengine.a
    SSH_ENGINE_USERMODE_TARGET=sshengine_usermode
else
    # Disable kernel libengine.a target. We always comppile
    # sshengine_usermode, but provide the same type of substitution
    # target as for kernel library for completeness. (Might come handy
    # on some later platform?)
    SSH_ENGINE_KERNEL_TARGET=
    SSH_ENGINE_USERMODE_TARGET=sshengine_usermode
fi




if test -z "$no_setsid"; then
  for ac_func in setsid
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:6100: 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 6105 "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:6128: \"$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

fi

case $target in
   *-*-linux*)
    cat >> confdefs.h <<\EOF
#define RXP_PLATFORM_LINUX 1
EOF

    RXP_PLATFORM_NAME=linux
    ;;
    *-*-solaris*)
    cat >> confdefs.h <<\EOF
#define RXP_PLATFORM_SOLARIS 1
EOF

    RXP_PLATFORM_NAME=solaris
    ;;
    *-*-vxworks*)
    cat >> confdefs.h <<\EOF
#define RXP_PLATFORM_VXWORKS 1
EOF

    RXP_PLATFORM_NAME=vxworks
    ;;
esac



# -*- autoconf -*-
#
# configure.in fragment for sshutil (generic utilities and portability stuff)
#
# Author: Tatu Ylonen <ylo@ssh.fi>
#
#  Copyright:
#          Copyright (c) 2002, 2003 SFNT Finland Oy.
#                    All rights reserved
#

# So many systems seem to need this that it is better do it here automatically.
LIBS="-L/usr/local/lib $LIBS"

# Platform-specific stuff.
case "$target" in
  alpha*-dec-osf*)
    ;;
  *-*-solaris*)
    cat >> confdefs.h <<\EOF
#define SECURE_RPC 1
EOF

    cat >> confdefs.h <<\EOF
#define SECURE_NFS 1
EOF

    ;;
  m88k-dg-dgux*)
    cat >> confdefs.h <<\EOF
#define BROKEN_INET_ADDR 1
EOF

    ;;
  *-sequent-ptx*)
    # From geek+@cmu.edu
    test_libinet=yes
    ;;
  *-sequent-dynix*|*-sequent-ptx*)
    LIBS="-lseq -lsocket -linet -lnsl $LIBS"
    ;;
  *-*-hpux*)
    echo $ac_n "checking for keyserv""... $ac_c" 1>&6
echo "configure:6223: checking for keyserv" >&5
    if test -f /usr/sbin/keyserv; then
      echo "$ac_t""yes" 1>&6
      cat >> confdefs.h <<\EOF
#define SECURE_RPC 1
EOF

      LIBS="$LIBS -lrpcsvc"
    else
      echo "$ac_t""no" 1>&6
    fi
    no_utmpx=yes
   ;;
  *-*-aix*)
    no_utmpx=yes
    ;;
  *-*-irix6*)
    cat >> confdefs.h <<\EOF
#define BROKEN_INET_ADDR 1
EOF

    ;;
  *-sco*-*uw*)
    no_test_for_memset=yes
    ;;
  *)
    ;;
esac

for ac_func in key_secretkey_is_set
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:6255: 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 6260 "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:6283: \"$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


if test -z "$no_libnsl"; then
  echo $ac_n "checking for main in -lnsl""... $ac_c" 1>&6
echo "configure:6310: checking for main in -lnsl" >&5
ac_lib_var=`echo nsl'_'main | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-lnsl  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 6318 "configure"
#include "confdefs.h"

int main() {
main()
; return 0; }
EOF
if { (eval echo configure:6325: \"$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
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
    ac_tr_lib=HAVE_LIB`echo nsl | sed -e 's/[^a-zA-Z0-9_]/_/g' \
    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
  cat >> confdefs.h <<EOF
#define $ac_tr_lib 1
EOF

  LIBS="-lnsl $LIBS"

else
  echo "$ac_t""no" 1>&6
fi

fi
if test -n "$test_libinet"; then
  echo $ac_n "checking for inet_network in -linet""... $ac_c" 1>&6
echo "configure:6355: checking for inet_network in -linet" >&5
ac_lib_var=`echo inet'_'inet_network | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-linet  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 6363 "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
    builtin and then its argument prototype would still apply.  */
char inet_network();

int main() {
inet_network()
; return 0; }
EOF
if { (eval echo configure:6374: \"$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
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
    ac_tr_lib=HAVE_LIB`echo inet | sed -e 's/[^a-zA-Z0-9_]/_/g' \
    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
  cat >> confdefs.h <<EOF
#define $ac_tr_lib 1
EOF

  LIBS="-linet $LIBS"

else
  echo "$ac_t""no" 1>&6
fi

fi
if test -z "$no_libsocket"; then
  echo $ac_n "checking for socket in -lsocket""... $ac_c" 1>&6
echo "configure:6404: 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
else
  ac_save_LIBS="$LIBS"
LIBS="-lsocket  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 6412 "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
    builtin and then its argument prototype would still apply.  */
char socket();

int main() {
socket()
; return 0; }
EOF
if { (eval echo configure:6423: \"$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
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
    ac_tr_lib=HAVE_LIB`echo socket | sed -e 's/[^a-zA-Z0-9_]/_/g' \
    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
  cat >> confdefs.h <<EOF
#define $ac_tr_lib 1
EOF

  LIBS="-lsocket $LIBS"

else
  echo "$ac_t""no" 1>&6
fi

fi

for ac_func in strchr memcpy gethostname gettimeofday ctime signal
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:6455: 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 6460 "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:6483: \"$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

for ac_func in getservbyname getservbyport endservent
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:6510: 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 6515 "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:6538: \"$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

for ac_func in popen lockf getrusage uname
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:6565: 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 6570 "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:6593: \"$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

for ac_func in getpid getppid getuid getgid getpgrp
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:6620: 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 6625 "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:6648: \"$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

for ac_func in endpwent endgrent getgrgid getpwuid
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:6675: 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 6680 "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:6703: \"$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

for ac_func in truncate ftruncate chown fchown chmod fchmod fstat
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:6730: 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 6735 "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:6758: \"$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

for ac_func in lutimes futimes utime utimes usleep lstat localtime inet_aton
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:6785: 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 6790 "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:6813: \"$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

for ac_func in select poll
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:6840: 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 6845 "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:6868: \"$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


# Checking if we have socklen_t in sys/socket.h
# Note, that we do not use AC_CHECK_TYPE because its use have
# changed between 2.13 and newer version of autoconf, and the
# old version was quite broken
echo $ac_n "checking whether we have socklen_t""... $ac_c" 1>&6
echo "configure:6898: checking whether we have socklen_t" >&5
cat > conftest.$ac_ext <<EOF
#line 6900 "configure"
#include "confdefs.h"
#include <sys/socket.h>
void test()
{
  socklen_t s;
}
int main() {

; return 0; }
EOF
if { (eval echo configure:6911: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  echo "$ac_t""yes" 1>&6
 cat >> confdefs.h <<\EOF
#define HAVE_SOCKLEN_T 1
EOF

else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  echo "$ac_t""no" 1>&6
fi
rm -f conftest*

# This needs to be checked here, because otherwise, in some cases, the
# replacement func for crypt() might be compiled, which would override
# system's crypt(). Which would break password checking.
echo $ac_n "checking for crypt in -lc""... $ac_c" 1>&6
echo "configure:6930: checking for crypt in -lc" >&5
ac_lib_var=`echo c'_'crypt | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-lc  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 6938 "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
    builtin and then its argument prototype would still apply.  */
char crypt();

int main() {
crypt()
; return 0; }
EOF
if { (eval echo configure:6949: \"$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
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  true
else
  echo "$ac_t""no" 1>&6
echo $ac_n "checking for crypt in -lcrypt""... $ac_c" 1>&6
echo "configure:6968: checking for crypt in -lcrypt" >&5
ac_lib_var=`echo crypt'_'crypt | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-lcrypt  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 6976 "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
    builtin and then its argument prototype would still apply.  */
char crypt();

int main() {
crypt()
; return 0; }
EOF
if { (eval echo configure:6987: \"$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
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
    ac_tr_lib=HAVE_LIB`echo crypt | sed -e 's/^a-zA-Z0-9_/_/g' \
    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
  cat >> confdefs.h <<EOF
#define $ac_tr_lib 1
EOF

  LIBS="-lcrypt $LIBS"

else
  echo "$ac_t""no" 1>&6
fi

fi


for ac_func in strerror memmove remove random putenv
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:7020: 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 7025 "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:7048: \"$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
LIBOBJS="$LIBOBJS ${ac_func}.${ac_objext}"
fi
done


if test -z "$no_test_for_memset"; then
  for ac_func in memset
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:7078: 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 7083 "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:7106: \"$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
LIBOBJS="$LIBOBJS ${ac_func}.${ac_objext}"
fi
done


fi
for ac_func in strcasecmp strncasecmp crypt getopt
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:7136: 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 7141 "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:7164: \"$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
LIBOBJS="$LIBOBJS ${ac_func}.${ac_objext}"
fi
done



for ac_hdr in unistd.h netinet/in_systm.h netinet/in.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:7195: 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 7200 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:7205: \"$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_hdr in machine/endian.h endian.h paths.h sys/un.h sys/utsname.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:7235: 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 7240 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:7245: \"$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_hdr in machine/spl.h sys/callout.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:7275: 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 7280 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:7285: \"$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_hdr in termcap.h rusage.h pwd.h grp.h sys/time.h dirent.h limits.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:7315: 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 7320 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:7325: \"$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_hdr in sys/select.h sys/poll.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:7355: 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 7360 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:7365: \"$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


MSG_WITH_IPV6="yes"
echo $ac_n "checking whether to enable IPv6 support""... $ac_c" 1>&6
echo "configure:7394: checking whether to enable IPv6 support" >&5
# Check whether --with-ipv6 or --without-ipv6 was given.
if test "${with_ipv6+set}" = set; then
  withval="$with_ipv6"
  case "$withval" in
   yes)
      echo "$ac_t""yes" 1>&6
      cat >> confdefs.h <<\EOF
#define WITH_IPV6 1
EOF

      ;;
   *)
      echo "$ac_t""no" 1>&6
      MSG_WITH_IPV6="no"
      ;;
 esac
else
  echo "$ac_t""yes" 1>&6
        cat >> confdefs.h <<\EOF
#define WITH_IPV6 1
EOF


fi


if test "$with_ipv6" != "no"; then
  echo $ac_n "checking whether we have sockaddr_in6""... $ac_c" 1>&6
echo "configure:7423: checking whether we have sockaddr_in6" >&5
  cat > conftest.$ac_ext <<EOF
#line 7425 "configure"
#include "confdefs.h"
#include <sys/types.h>
  #include <sys/socket.h>
  #include <netinet/in.h>
  #ifdef HAVE_NETINET_IN_SYSTM_H
  #include <netinet/in_systm.h>
  #else /* Some old linux systems at least have in_system.h instead. */
  #include <netinet/in_system.h>
  #endif /* HAVE_NETINET_IN_SYSTM_H */
  #if !defined(__PARAGON__)
  #include <netinet/ip.h>
  #endif /* !__PARAGON__ */
  #include <netinet/tcp.h>
  #include <arpa/inet.h>
  #include <netdb.h>
  void test()
  {
    struct sockaddr_in6 sinaddr6;
  }
int main() {

; return 0; }
EOF
if { (eval echo configure:7449: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  echo "$ac_t""yes" 1>&6
   cat >> confdefs.h <<\EOF
#define HAVE_SOCKADDR_IN6_STRUCT 1
EOF

   for ac_func in getipnodebyaddr getipnodebyname gethostbyname2
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:7459: 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 7464 "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:7487: \"$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

else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  echo "$ac_t""no" 1>&6
   MSG_WITH_IPV6="no"
  
fi
rm -f conftest*
fi

if test "$with_ipv6" != "no"; then
  echo $ac_n "checking whether we have sockaddr_in6.sin6_scope_id""... $ac_c" 1>&6
echo "configure:7524: checking whether we have sockaddr_in6.sin6_scope_id" >&5
  cat > conftest.$ac_ext <<EOF
#line 7526 "configure"
#include "confdefs.h"
#include <sys/types.h>
  #include <sys/socket.h>
  #include <netinet/in.h>
  #ifdef HAVE_NETINET_IN_SYSTM_H
  #include <netinet/in_systm.h>
  #else /* Some old linux systems at least have in_system.h instead. */
  #include <netinet/in_system.h>
  #endif /* HAVE_NETINET_IN_SYSTM_H */
  #if !defined(__PARAGON__)
  #include <netinet/ip.h>
  #endif /* !__PARAGON__ */
  #include <netinet/tcp.h>
  #include <arpa/inet.h>
  #include <netdb.h>
  void test()
  {
    struct sockaddr_in6 sinaddr6;
    sinaddr6.sin6_scope_id = 0;
  }
int main() {

; return 0; }
EOF
if { (eval echo configure:7551: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  echo "$ac_t""yes" 1>&6
   cat >> confdefs.h <<\EOF
#define HAVE_SOCKADDR_IN6_SCOPE_ID 1
EOF

else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  echo "$ac_t""no" 1>&6
  
fi
rm -f conftest*
fi


# Check if /var/run exists (this is used by includes.h to set PIDDIR).
if test -d /var/run; then
  cat >> confdefs.h <<\EOF
#define HAVE_VAR_RUN 1
EOF

fi

echo $ac_n "checking whether inet_ntoa is broken""... $ac_c" 1>&6
echo "configure:7578: checking whether inet_ntoa is broken" >&5
if test "$cross_compiling" = yes; then
  echo "$ac_t""yes" 1>&6
broken_inet_ntoa="yes"
else
  cat > conftest.$ac_ext <<EOF
#line 7584 "configure"
#include "confdefs.h"

struct in_addr {
  unsigned char s_addr[4];
};

char *inet_ntoa(struct in_addr in);

main()
{
   char *addr;
   struct in_addr in;
   unsigned char *b;

   b = in.s_addr;
   *b = 0xef; b++;
   *b = 0xcd; b++;
   *b = 0xab; b++;
   *b = 0x89;
   addr = inet_ntoa(in);
   return ((strcmp(addr, "239.205.171.137") == 0) ? 0 : 1);
}
EOF
if { (eval echo configure:7608: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
  echo "$ac_t""no" 1>&6
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -fr conftest*
  echo "$ac_t""yes" 1>&6
broken_inet_ntoa="yes"
fi
rm -fr conftest*
fi


if test -n "$broken_inet_ntoa"; then
  CA_LIBOBJS="$CA_LIBOBJS inet_ntoa.o"
  echo "configure: warning: "using internal inet_ntoa"" 1>&2
fi

echo $ac_n "checking whether S_IFSOCK is defined""... $ac_c" 1>&6
echo "configure:7628: checking whether S_IFSOCK is defined" >&5
cat > conftest.$ac_ext <<EOF
#line 7630 "configure"
#include "confdefs.h"
#include <sys/stat.h>
int main() {
int i = S_IFSOCK;
; return 0; }
EOF
if { (eval echo configure:7637: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  echo "$ac_t""yes" 1>&6
             cat >> confdefs.h <<\EOF
#define HAVE_S_IFSOCK 1
EOF

else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  echo "$ac_t""no" 1>&6
fi
rm -f conftest*

echo $ac_n "checking whether to enable TCP_NODELAY""... $ac_c" 1>&6
echo "configure:7653: checking whether to enable TCP_NODELAY" >&5
# Check whether --enable-tcp-nodelay or --disable-tcp-nodelay was given.
if test "${enable_tcp_nodelay+set}" = set; then
  enableval="$enable_tcp_nodelay"
   case "$enableval" in
  yes)
       echo "$ac_t""yes" 1>&6
       cat >> confdefs.h <<\EOF
#define ENABLE_TCP_NODELAY 1
EOF

       ;;
  *)
       echo "$ac_t""no" 1>&6
  esac 
else
  echo "$ac_t""yes" 1>&6
  cat >> confdefs.h <<\EOF
#define ENABLE_TCP_NODELAY 1
EOF


fi


echo $ac_n "checking whether to prefer select() over poll()""... $ac_c" 1>&6
echo "configure:7679: checking whether to prefer select() over poll()" >&5
# Check whether --enable-select or --disable-select was given.
if test "${enable_select+set}" = set; then
  enableval="$enable_select"
   case "$enableval" in
  yes)
    echo "$ac_t""yes" 1>&6
    cat >> confdefs.h <<\EOF
#define ENABLE_SELECT 1
EOF

    ;;
  *)
    echo "$ac_t""no" 1>&6
    ;;
  esac 
else
  echo "$ac_t""no" 1>&6

fi


echo $ac_n "checking whether to use blocking connect system call""... $ac_c" 1>&6
echo "configure:7702: checking whether to use blocking connect system call" >&5
# Check whether --enable-blocking-connect or --disable-blocking-connect was given.
if test "${enable_blocking_connect+set}" = set; then
  enableval="$enable_blocking_connect"
   case "$enableval" in
  yes)
    echo "$ac_t""yes" 1>&6
    cat >> confdefs.h <<\EOF
#define NO_NONBLOCKING_CONNECT 1
EOF

    ;;
  *)
    echo "$ac_t""no" 1>&6
    ;;
  esac 
else
  echo "$ac_t""no" 1>&6

fi


echo $ac_n "checking whether struct tm has member tm_gmtoff""... $ac_c" 1>&6
echo "configure:7725: checking whether struct tm has member tm_gmtoff" >&5
cat > conftest.$ac_ext <<EOF
#line 7727 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <time.h>
long test()
{
  struct tm tm;
  tm.tm_gmtoff = 0;
  return ((long)(tm.tm_gmtoff));
}
int main() {

; return 0; }
EOF
if { (eval echo configure:7741: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  echo "$ac_t""yes" 1>&6
 cat >> confdefs.h <<\EOF
#define HAVE_TM_GMTOFF_IN_STRUCT_TM 1
EOF

else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  echo "$ac_t""no" 1>&6
 echo $ac_n "checking whether struct tm has member __tm_gmtoff__""... $ac_c" 1>&6
echo "configure:7754: checking whether struct tm has member __tm_gmtoff__" >&5
 cat > conftest.$ac_ext <<EOF
#line 7756 "configure"
#include "confdefs.h"
#include <sys/types.h>
 #include <time.h>
 long test()
 {
   struct tm tm;
   tm.__tm_gmtoff__ = 0;
   return ((long)(tm.__tm_gmtoff__));
 }
int main() {

; return 0; }
EOF
if { (eval echo configure:7770: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  echo "$ac_t""yes" 1>&6
cat >> confdefs.h <<\EOF
#define HAVE_OLD_TM_GMTOFF_IN_STRUCT_TM 1
EOF

else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  echo "$ac_t""no" 1>&6

fi
rm -f conftest*

fi
rm -f conftest*

echo $ac_n "checking whether struct tm has member tm_isdst""... $ac_c" 1>&6
echo "configure:7790: checking whether struct tm has member tm_isdst" >&5
cat > conftest.$ac_ext <<EOF
#line 7792 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <time.h>
int test()
{
  struct tm tm;
  tm.tm_isdst = 0;
  return ((int)(tm.tm_isdst));
}
int main() {

; return 0; }
EOF
if { (eval echo configure:7806: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  echo "$ac_t""yes" 1>&6
cat >> confdefs.h <<\EOF
#define HAVE_TM_ISDST_IN_STRUCT_TM 1
EOF

else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  echo "$ac_t""no" 1>&6

fi
rm -f conftest*

echo $ac_n "checking whether system uses external timezone variable""... $ac_c" 1>&6
echo "configure:7823: checking whether system uses external timezone variable" >&5
cat > conftest.$ac_ext <<EOF
#line 7825 "configure"
#include "confdefs.h"
#include <sys/types.h>
                #include <time.h>
int main() {
timezone = 0;
                return ((int)(timezone));
; return 0; }
EOF
if { (eval echo configure:7834: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  echo "$ac_t""yes" 1>&6
                cat >> confdefs.h <<\EOF
#define HAVE_EXTERNAL_TIMEZONE 1
EOF

else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  echo "$ac_t""no" 1>&6
fi
rm -f conftest*

echo $ac_n "checking whether to use system provided localtime""... $ac_c" 1>&6
echo "configure:7850: checking whether to use system provided localtime" >&5
# Check whether --with-internal-localtime or --without-internal-localtime was given.
if test "${with_internal_localtime+set}" = set; then
  withval="$with_internal_localtime"
  
  case "$withval" in
  yes)
    echo "$ac_t""no" 1>&6
    cat >> confdefs.h <<\EOF
#define USE_SSH_INTERNAL_LOCALTIME 1
EOF

    ;;
  *)
    echo "$ac_t""yes" 1>&6
    ;;
  esac 
else
  echo "$ac_t""yes" 1>&6

fi


# Thread packages in the order they should be probed. The first found
# is selected if
THREADS="pthread none"
echo $ac_n "checking whether to use threads""... $ac_c" 1>&6
echo "configure:7877: checking whether to use threads" >&5
# Check whether --with-threads or --without-threads was given.
if test "${with_threads+set}" = set; then
  withval="$with_threads"
  
  case "$withval" in
    yes)
      echo "$ac_t""yes" 1>&6
      ;;
    pthread)
      echo "$ac_t""pthread" 1>&6
      THREADS=pthread
      ;;
    no)
      echo "$ac_t""no" 1>&6
      THREADS=none
      ;;
    *)
      echo "$ac_t""unknown" 1>&6
      { echo "configure: error: Unknown thread package selected: $withval, supported packages are: $THREADS" 1>&2; exit 1; }
      ;;
  esac 
else
  echo "$ac_t""no" 1>&6
  THREADS=none

fi


THREAD_OBJS=
THREAD_SYSTEM_OBJS=

for i in $THREADS
do
  if test -z "$THREAD"; then
    case "$i" in
      none)
	  THREAD=none
	  THREAD_OBJS=
	  THREAD_SYSTEM_OBJS=
	  ;;
      pthread)
	  CFLAGS_store="$CFLAGS"
	  CFLAGS="$CFLAGS -lpthread"

	  cat > conftest.$ac_ext <<EOF
#line 7923 "configure"
#include "confdefs.h"
#include <pthread.h>
int main() {

 pthread_create(NULL, NULL, NULL, NULL);
; return 0; }
EOF
if { (eval echo configure:7931: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  echo "$ac_t""yes" 1>&6
 		 THREAD=pthread
		 CFLAGS="$CFLAGS_store -D_REENTRANT"
		 LIBS="-lpthread $LIBS"
		 echo $ac_n "checking for main in -lexc""... $ac_c" 1>&6
echo "configure:7938: checking for main in -lexc" >&5
ac_lib_var=`echo exc'_'main | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-lexc  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 7946 "configure"
#include "confdefs.h"

int main() {
main()
; return 0; }
EOF
if { (eval echo configure:7953: \"$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
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
    ac_tr_lib=HAVE_LIB`echo exc | sed -e 's/[^a-zA-Z0-9_]/_/g' \
    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
  cat >> confdefs.h <<EOF
#define $ac_tr_lib 1
EOF

  LIBS="-lexc $LIBS"

else
  echo "$ac_t""no" 1>&6
fi
 
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  echo "$ac_t""no" 1>&6
		  
fi
rm -f conftest*
	  unset CFLAGS_store
	  if test -n "$THREAD"; then
		THREAD_OBJS="sshmt_pthreads.o sshmt_timeouts.o"
		THREAD_SYSTEM_OBJS="sshmt_pthreads.o sshmt_timeouts.o"
		cat >> confdefs.h <<\EOF
#define HAVE_PTHREADS 1
EOF

		cat >> confdefs.h <<\EOF
#define HAVE_THREADS 1
EOF

	  fi
	  ;;
      *)
	  { echo "configure: error: Unknown thread package selected" 1>&2; exit 1; }
	  ;;
    esac
  fi
done




if test -z "$no_termios"; then
  if test "X$ac_cv_header_termios_h" = "Xyes"; then
    for ac_hdr in sys/modem.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:8018: 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 8023 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:8028: \"$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

    if test "X$ac_cv_header_sys_modem_h" = "Xyes"; then
      echo $ac_n "checking whether termios.h needs sys/modem.h to be included""... $ac_c" 1>&6
echo "configure:8056: checking whether termios.h needs sys/modem.h to be included" >&5
      cat > conftest.$ac_ext <<EOF
#line 8058 "configure"
#include "confdefs.h"
#include <termios.h>
int main() {
#ifdef TIOCM_DTR
		        int flags = 0;
                        flags |= TIOCM_DTR;
                      #endif /* TIOCM_DTR */
; return 0; }
EOF
if { (eval echo configure:8068: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  echo "$ac_t""no" 1>&6
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
   echo "$ac_t""yes" 1>&6
                        cat >> confdefs.h <<\EOF
#define TERMIOS_H_NEEDS_MODEM_H 1
EOF

fi
rm -f conftest*

    fi
  fi
fi


echo $ac_n "checking whether off_t is 8 bytes by default""... $ac_c" 1>&6
echo "configure:8089: checking whether off_t is 8 bytes by default" >&5
if eval "test \"`echo '$''{'ac_offt_size'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test "$cross_compiling" = yes; then
  ac_offt_size=4
else
  cat > conftest.$ac_ext <<EOF
#line 8097 "configure"
#include "confdefs.h"

#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
main()
{
  struct stat asdf;
  FILE *f=fopen("conftestval", "w");
  if (!f) exit(1);
  fprintf(f, "%d\n", sizeof(asdf.st_size));
  exit(0);
}
EOF
if { (eval echo configure:8112: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
  ac_offt_size=`cat conftestval`
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -fr conftest*
  ac_offt_size=4
fi
rm -fr conftest*
fi

fi


if test "$ac_offt_size" = "8"; then
  echo "$ac_t""yes" 1>&6
else
  echo "$ac_t""no" 1>&6
  echo $ac_n "checking whether 8 byte off_t is supported""... $ac_c" 1>&6
echo "configure:8132: checking whether 8 byte off_t is supported" >&5

  case "$target" in
  *-*-aix*)
    if eval "test \"`echo '$''{'ac_offt_size_aix_define'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test "$cross_compiling" = yes; then
  ac_offt_size_aix_define=4
else
  cat > conftest.$ac_ext <<EOF
#line 8143 "configure"
#include "confdefs.h"

    #define _LARGE_FILES
    #include <stdio.h>
    #include <sys/types.h>
    #include <sys/stat.h>
    main()
    {
      struct stat asdf;
      FILE *f=fopen("conftestval", "w");
      if (!f) exit(1);
      fprintf(f, "%d\n", sizeof(asdf.st_size));
      exit(0);
    }
EOF
if { (eval echo configure:8159: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
  ac_offt_size_aix_define=`cat conftestval`
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -fr conftest*
  ac_offt_size_aix_define=4
fi
rm -fr conftest*
fi

fi


    if test "$ac_offt_size_aix_define" = "8"; then
      echo "$ac_t""yes" 1>&6
      CFLAGS="$CFLAGS -D_LARGE_FILES"
    else
      echo "$ac_t""no" 1>&6
    fi
    ;;
  *)
    if eval "test \"`echo '$''{'ac_offt_size_gen_define'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test "$cross_compiling" = yes; then
  ac_offt_size_gen_define=4
else
  cat > conftest.$ac_ext <<EOF
#line 8189 "configure"
#include "confdefs.h"

    #define _LARGEFILE_SOURCE
    #define _FILE_OFFSET_BITS 64
    #include <stdio.h>
    #include <sys/types.h>
    #include <sys/stat.h>
    main()
    {
      struct stat asdf;
      FILE *f=fopen("conftestval", "w");
      if (!f) exit(1);
      fprintf(f, "%d\n", sizeof(asdf.st_size));
      exit(0);
    }
EOF
if { (eval echo configure:8206: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
  ac_offt_size_gen_define=`cat conftestval`
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -fr conftest*
  ac_offt_size_gen_define=4
fi
rm -fr conftest*
fi

fi


    if test "$ac_offt_size_gen_define" = "8" -a "X$CC" != "Xinsure" ; then
      echo "$ac_t""yes" 1>&6
      CFLAGS="$CFLAGS -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
    else
      echo "$ac_t""no" 1>&6
    fi
    ;;

  esac
fi

# lib/sshutil/sshsysutil/sshdlib.c uses dlopen family. They are at
# libc or libdl.

ac_safe=`echo "dlfcn.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for dlfcn.h""... $ac_c" 1>&6
echo "configure:8237: checking for dlfcn.h" >&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 8242 "configure"
#include "confdefs.h"
#include <dlfcn.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:8247: \"$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
   echo $ac_n "checking for dlopen in -lc""... $ac_c" 1>&6
echo "configure:8264: checking for dlopen in -lc" >&5
   cat > conftest.$ac_ext <<EOF
#line 8266 "configure"
#include "confdefs.h"
#include <dlfcn.h>
int main() {
dlopen ("", 0);
; return 0; }
EOF
if { (eval echo configure:8273: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
   echo "$ac_t""yes" 1>&6 
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
   echo "$ac_t""no" 1>&6
                 echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
echo "configure:8282: checking for dlopen in -ldl" >&5
                 ac_save_LIBS="$LIBS"
		 LIBS="-ldl $LIBS"
                 cat > conftest.$ac_ext <<EOF
#line 8286 "configure"
#include "confdefs.h"
#include <dlfcn.h>
int main() {
dlopen ("", 0);
; return 0; }
EOF
if { (eval echo configure:8293: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
   echo "$ac_t""yes" 1>&6 
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
   echo "$ac_t""no" 1>&6
                               LIBS="$ac_save_LIBS"
fi
rm -f conftest*
                 ac_save_LIBS=
fi
rm -f conftest*
 

else
  echo "$ac_t""no" 1>&6
fi


echo $ac_n "checking whether can use __attribute__ ((weak))""... $ac_c" 1>&6
echo "configure:8315: checking whether can use __attribute__ ((weak))" >&5

if test -n "$GCC"; then
	cat > conftest.$ac_ext <<EOF
#line 8319 "configure"
#include "confdefs.h"
 bar() { return 1; }
		      foo() __attribute__ ((weak, alias("bar")));
int main() {
 foo() 
; return 0; }
EOF
if { (eval echo configure:8327: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  echo "$ac_t""yes" 1>&6
cat >> confdefs.h <<\EOF
#define HAVE_GCC_ATTRIBUTE_WEAK 1
EOF

else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  echo "$ac_t""no" 1>&6
fi
rm -f conftest*
else
	echo "$ac_t""no" 1>&6
fi


# The malloc debugger is disabled only if --disable-debug-malloc is given.
# Otherwise its default value is set in sshmalloc.h
echo $ac_n "checking whether to disable debug malloc""... $ac_c" 1>&6
echo "configure:8349: checking whether to disable debug malloc" >&5
# Check whether --enable-debug-malloc or --disable-debug-malloc was given.
if test "${enable_debug_malloc+set}" = set; then
  enableval="$enable_debug_malloc"
   case "$enableval" in
  no)
    echo "$ac_t""yes" 1>&6
    cat >> confdefs.h <<\EOF
#define SSH_DISABLE_DEBUG_MALLOC 1
EOF

    ;;
  *)
    echo "$ac_t""no" 1>&6
    ;;
  esac 
else
  echo "$ac_t""no" 1>&6

fi


       
for ac_hdr in dlfcn.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:8376: 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 8381 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:8386: \"$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

echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
echo "configure:8413: checking for dlopen in -ldl" >&5
ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-ldl  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 8421 "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
    builtin and then its argument prototype would still apply.  */
char dlopen();

int main() {
dlopen()
; return 0; }
EOF
if { (eval echo configure:8432: \"$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
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
    ac_tr_lib=HAVE_LIB`echo dl | sed -e 's/[^a-zA-Z0-9_]/_/g' \
    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
  cat >> confdefs.h <<EOF
#define $ac_tr_lib 1
EOF

  LIBS="-ldl $LIBS"

else
  echo "$ac_t""no" 1>&6
fi

for ac_func in dlopen dlsym dlclose
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:8462: 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 8467 "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:8490: \"$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


echo $ac_n "checking for __libc_stack_end""... $ac_c" 1>&6
echo "configure:8516: checking for __libc_stack_end" >&5
cat > conftest.$ac_ext <<EOF
#line 8518 "configure"
#include "confdefs.h"
#include <stdlib.h>
int main() {

extern void *__libc_stack_end;
exit(((unsigned long) __libc_stack_end) & 0x1);

; return 0; }
EOF
if { (eval echo configure:8528: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  
   echo "$ac_t""yes" 1>&6
   cat >> confdefs.h <<\EOF
#define HAVE_LIBC_STACK_END 1
EOF


else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  echo "$ac_t""no" 1>&6
fi
rm -f conftest*

echo $ac_n "checking whether to use system dns resolver""... $ac_c" 1>&6
echo "configure:8546: checking whether to use system dns resolver" >&5
# Check whether --enable-system-resolver or --disable-system-resolver was given.
if test "${enable_system_resolver+set}" = set; then
  enableval="$enable_system_resolver"
   case "$enableval" in
  yes)
       echo "$ac_t""yes" 1>&6
       cat >> confdefs.h <<\EOF
#define ENABLE_SYSTEM_DNS_RESOLVER 1
EOF

       ;;
  *)
       echo "$ac_t""no" 1>&6
  esac 
else
  echo "$ac_t""no" 1>&6

fi


# udp_datagram_size
# Check whether --enable-udp-datagram-size or --disable-udp-datagram-size was given.
if test "${enable_udp_datagram_size+set}" = set; then
  enableval="$enable_udp_datagram_size"
   udp_datagram_size=$enableval
    cat >> confdefs.h <<EOF
#define SSH_UDP_DATAGRAM_BUFFER_SIZE $udp_datagram_size
EOF

    echo "$ac_t""Enabling UDP datagram buffer size of $enableval." 1>&6
  
fi



echo $ac_n "checking size of usermode size_t""... $ac_c" 1>&6
echo "configure:8583: checking size of usermode size_t" >&5
if eval "test \"`echo '$''{'ac_cv_usermode_sizeof_size_t'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test "$cross_compiling" = yes; then
  ac_cv_usermode_sizeof_size_t=8
else
  cat > conftest.$ac_ext <<EOF
#line 8591 "configure"
#include "confdefs.h"
#include <stdio.h>
main()
{
  FILE *f=fopen("conftestval", "w");
  if (!f) exit(1);
  fprintf(f, "%d\n", sizeof(size_t));
  exit(0);
}
EOF
if { (eval echo configure:8602: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
  ac_cv_usermode_sizeof_size_t=`cat conftestval`
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -fr conftest*
  ac_cv_usermode_sizeof_size_t=0
fi
rm -fr conftest*
fi

fi
echo "$ac_t""$ac_cv_usermode_sizeof_size_t" 1>&6
cat >> confdefs.h <<EOF
#define USERMODE_SIZEOF_SIZE_T $ac_cv_usermode_sizeof_size_t
EOF

cat >> confdefs.h <<EOF
#define HAVE_USERMODE_SIZE_T 1
EOF



echo $ac_n "checking whether gcc supports __attribute__ with ssh printf extensions""... $ac_c" 1>&6
echo "configure:8627: checking whether gcc supports __attribute__ with ssh printf extensions" >&5
CFLAGS_store="$CFLAGS"
CFLAGS="$CFLAGS -Werror"
cat > conftest.$ac_ext <<EOF
#line 8631 "configure"
#include "confdefs.h"
#include <stdio.h>
#include <stdlib.h>
int ssh_snprintf(unsigned char *str, size_t size, const char *format, ...)
       __attribute__ ((format (printf, 3, 4)));

int test_renderer(unsigned char *buf, int buf_size, int prec, void *datum)
{
  return 0;
}

void test(void *ptr)
{
  unsigned char buffer[100]; 
  ssh_snprintf(buffer, sizeof(buffer), "%@", test_renderer, ptr);
}
int main() {

; return 0; }
EOF
if { (eval echo configure:8652: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  echo "$ac_t""yes" 1>&6
 cat >> confdefs.h <<\EOF
#define HAVE_ATTRIBUTE_FORMAT_PRINTF_SSH 1
EOF

else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  echo "$ac_t""no" 1>&6
fi
rm -f conftest*
CFLAGS="$CFLAGS_store"
unset CFLAGS_store

#
# configure.in fragment for sshmath (arithmetic library)
#
# Author: Tatu Ylonen <ylo@ssh.fi>
#
#  Copyright:
#          Copyright (c) 2002, 2003 SFNT Finland Oy.
#                    All rights reserved
#

echo $ac_n "checking whether to use assembly optimizations in math library""... $ac_c" 1>&6
echo "configure:8680: checking whether to use assembly optimizations in math library" >&5
case "$target" in
  i*86-*-bsdi*|i*86-*-freebsd*|i*86-*-netbsd*|i*86-*-openbsd*|i*86-*-linux*)
    if test "$enable_asm" = "yes"; then
      if test -n "$GCC"; then
        MATH_CONF_OBJS="$MATH_CONF_OBJS sshmp-asmopt_i386-att.o"
        cat >> confdefs.h <<\EOF
#define SSHMATH_ASSEMBLER_SUBROUTINES 1
EOF

        cat >> confdefs.h <<\EOF
#define SSHMATH_ASSEMBLER_MACROS 1
EOF

        cat >> confdefs.h <<\EOF
#define SSHMATH_I386 1
EOF

	echo "$ac_t""yes" 1>&6
      else
	echo "$ac_t""no" 1>&6
      fi
    else
      echo "$ac_t""no" 1>&6
    fi
    ;;
  *-*-*)
      echo "$ac_t""no" 1>&6
    ;;
esac



for ac_func in times clock
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:8716: 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 8721 "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:8744: \"$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


echo $ac_n "checking whether to use a minimal version of the math library""... $ac_c" 1>&6
echo "configure:8770: checking whether to use a minimal version of the math library" >&5
# Check whether --enable-minimal-math or --disable-minimal-math was given.
if test "${enable_minimal_math+set}" = set; then
  enableval="$enable_minimal_math"
   echo "$ac_t""yes" 1>&6
    cat >> confdefs.h <<\EOF
#define SSHMATH_MINIMAL 1
EOF
 
else
   echo "$ac_t""no" 1>&6 

fi



# The default setting only uses dynamic memory for math library computations.
static_integer_size="0"


cat >> confdefs.h <<EOF
#define SSH_MP_INTEGER_BIT_SIZE_STATIC $static_integer_size
EOF

# -*- ksh -*-
#
# configure.in.inc - fragment for src/lib/sshexternalkey
#
# Author: Toni Tammisalo <ttammisa@ssh.fi>
#
#  Copyright:
#          Copyright (c) 2002, 2003 SFNT Finland Oy.
#               All rights reserved.
#
##############################################################################





echo $ac_n "checking whether to support Safenet""... $ac_c" 1>&6
echo "configure:8811: checking whether to support Safenet" >&5
# Check whether --with-safenet-udm or --without-safenet-udm was given.
if test "${with_safenet_udm+set}" = set; then
  withval="$with_safenet_udm"
  
  case "$withval" in
  no)
    echo "$ac_t""no" 1>&6
    safenet_dir=""
    ;;
  yes)
    safenet_dir=""
    ;;
  *)
   safenet_dir="$withval"
    ;;
  esac

  if test X$safenet_dir != X; then
    case $target in
    *-*-linux*)  
    SAFENETFLAGS="-DCGX_PLATFORM_LINUX -I$safenet_dir/cgx/hdrs"
    SAFENET_UDM_VPATH="$safenet_dir/cgx/plugins/udm/usr/generic:\
$safenet_dir/cgx/plugins/udm/usr/linux"
    SAFENET_UDM_SRCS='udm_usr.c udm_usr_target.c'
    SAFENET_UDM_OBJS='udm_usr.o udm_usr_target.o'
    ;;
    *-*-vxworks*)
    SAFENETFLAGS="-DCGX_PLATFORM_VXWORKS -I$safenet_dir/cgx/hdrs"
    ;;
    esac
    CPPFLAGS="$CPPFLAGS $SAFENETFLAGS"

    
    
    
    
    cat >> confdefs.h <<\EOF
#define HAVE_SAFENET 1
EOF

    echo "$ac_t""Safenet driver header files are in $safenet_dir." 1>&6
  fi 
else
  echo "$ac_t""no" 1>&6

fi


echo $ac_n "checking whether a Safenet 1840 device type has been specified""... $ac_c" 1>&6
echo "configure:8861: checking whether a Safenet 1840 device type has been specified" >&5
# Check whether --enable-safenet-1840 or --disable-safenet-1840 was given.
if test "${enable_safenet_1840+set}" = set; then
  enableval="$enable_safenet_1840"
   case "$enableval" in
      no)
          echo "$ac_t""no" 1>&6
          ;;
      *)
          echo "$ac_t""yes" 1>&6
	  cat >> confdefs.h <<\EOF
#define SSH_SAFENET_USE_1840_DEVICE 1
EOF

          ;;
      esac 
else
  echo "$ac_t""no" 1>&6
fi


echo $ac_n "checking whether a Safenet 1841 device type has been specified""... $ac_c" 1>&6
echo "configure:8883: checking whether a Safenet 1841 device type has been specified" >&5
# Check whether --enable-safenet-1841 or --disable-safenet-1841 was given.
if test "${enable_safenet_1841+set}" = set; then
  enableval="$enable_safenet_1841"
   case "$enableval" in
      no)
          echo "$ac_t""no" 1>&6
          ;;
      *)
          echo "$ac_t""yes" 1>&6
	  cat >> confdefs.h <<\EOF
#define SSH_SAFENET_USE_1841_DEVICE 1
EOF

          ;;
      esac 
else
  echo "$ac_t""no" 1>&6
fi


echo $ac_n "checking whether a Safenet 1842 device type has been specified""... $ac_c" 1>&6
echo "configure:8905: checking whether a Safenet 1842 device type has been specified" >&5
# Check whether --enable-safenet-1842 or --disable-safenet-1842 was given.
if test "${enable_safenet_1842+set}" = set; then
  enableval="$enable_safenet_1842"
   case "$enableval" in
      no)
          echo "$ac_t""no" 1>&6
          ;;
      *)
          echo "$ac_t""yes" 1>&6
	  cat >> confdefs.h <<\EOF
#define SSH_SAFENET_USE_1842_DEVICE 1
EOF

          ;;
      esac 
else
  echo "$ac_t""no" 1>&6
fi




echo $ac_n "checking whether to support Octeon""... $ac_c" 1>&6
echo "configure:8929: checking whether to support Octeon" >&5
# Check whether --with-octeon or --without-octeon was given.
if test "${with_octeon+set}" = set; then
  withval="$with_octeon"
  
  case "$withval" in
  no)
    echo "$ac_t""no" 1>&6
    octeon_dir=""
    ;;
  yes)
    octeon_dir=""
    ;;
  *)
    octeon_dir="$withval"
    ;;
  esac

  if test X$octeon_dir != X; then
    OCTEONFLAGS="-I$octeon_dir/include -I$octeon_dir/crypto -DOCTEON_OPENSSL"
    OCTEON_VPATH="$octeon_dir/crypto:$octeon_dir/crypto/modexp"
    OCTEON_SRCS='modexp.c cryptlib.c'
    OCTEON_OBJS='modexp.o cryptlib.o'

    CPPFLAGS="$CPPFLAGS $OCTEONFLAGS"

    
    
    
    
    cat >> confdefs.h <<\EOF
#define ENABLE_CAVIUM_OCTEON 1
EOF

    echo "$ac_t""Octeon cryptographic library files are in $octeon_dir." 1>&6
  fi 
else
  echo "$ac_t""no" 1>&6

fi



echo $ac_n "checking whether to support Safenet SLAD driver""... $ac_c" 1>&6
echo "configure:8973: checking whether to support Safenet SLAD driver" >&5
# Check whether --with-safenet-slad or --without-safenet-slad was given.
if test "${with_safenet_slad+set}" = set; then
  withval="$with_safenet_slad"
  
  case "$withval" in
  no)
    echo "$ac_t""no" 1>&6
    safenet_dir=""
    ;;
  yes)
    safenet_dir=""
    ;;
  *)
   safenet_dir="$withval"
    ;;
  esac

  if test X$safenet_dir != X; then
    case $target in
    *-*-linux*)  
    SAFENETFLAGS="-DSLAD_PLATFORM_LINUX -I$safenet_dir/hdrs \
-I$safenet_dir/os/inc -I$safenet_dir/pe/inc \
-I$safenet_dir/pka/inc -I../../ipsec/hwaccel/safenet_pe"
    SAFENET_UDM_VPATH="$safenet_dir/usr/generic:\
$safenet_dir/usr/os/linux"
    SAFENET_UDM_SRCS='slad_usr.c slad_usr_target.c'
    SAFENET_UDM_OBJS='slad_usr.o slad_usr_target.o'
    ;;
    *-*-vxworks*)
    SAFENETFLAGS="-DSLAD_PLATFORM_VXWORKS -I$safenet_dir/hdrs"
    ;;
    esac
    CPPFLAGS="$CPPFLAGS $SAFENETFLAGS"

    
    
    
    
    cat >> confdefs.h <<\EOF
#define HAVE_SAFENET_SLAD 
EOF

    echo "$ac_t""Safenet driver header files are in $safenet_dir." 1>&6
  fi 
else
  echo "$ac_t""no" 1>&6

fi


echo $ac_n "checking whether to support Safenet Packet Engine driver""... $ac_c" 1>&6
echo "configure:9025: checking whether to support Safenet Packet Engine driver" >&5
# Check whether --with-safenet-pec or --without-safenet-pec was given.
if test "${with_safenet_pec+set}" = set; then
  withval="$with_safenet_pec"
  
  case "$withval" in
  no)
    echo "$ac_t""no" 1>&6
    safenet_dir=""
    ;;
  yes)
    safenet_dir=""
    ;;
  *)
    safenet_dir="$withval"
    ;;
  esac

  if test X$safenet_dir != X; then
    case $target in
    *-*-linux*)
    SAFENETFLAGS="-I$safenet_dir/Kit/Log/incl \
                  -I$safenet_dir/Kit/Log/src \
                  -I$safenet_dir/Kit/DriverFramework/incl \
                  -I$safenet_dir/Kit/DMABuf/incl"
    SAFENET_UDM_VPATH=
    SAFENET_UDM_SRCS=
    SAFENET_UDM_OBJS=
  esac
    CPPFLAGS="$CPPFLAGS $SAFENETFLAGS"

    
    
    
    
    cat >> confdefs.h <<\EOF
#define HAVE_SAFENET_PEC 
EOF

    echo "$ac_t""Safenet driver header files are in $safenet_dir." 1>&6
    fi 
else
  echo "$ac_t""no" 1>&6

fi


for ac_hdr in dlfcn.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:9076: 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 9081 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:9086: \"$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


#
# configure.in fragment for ipsec/quicksec
#
# Copyright:
#       Copyright (c) 2002, 2003, 2004, 2005 SFNT Finland Oy.
#       All rights reserved
#

echo $ac_n "checking whether to use assembly optimizations in quicksec""... $ac_c" 1>&6
echo "configure:9122: checking whether to use assembly optimizations in quicksec" >&5
case "$target" in
  i*86-*-bsdi*|i*86-*-freebsd*|i*86-*-netbsd*|i*86-*-openbsd*|i*86-*-linux*)
    if test "$enable_asm" = "yes"; then
      if test -n "$GCC"; then
	cat >> confdefs.h <<\EOF
#define QUICKSEC_ASM_I386 1
EOF

        QS_FASTPATH_CRYPTO_ASM_LNSRC='$(FASTPATH_SOFT_CRYPTO_ASM_LNSRCS)'
        QS_FASTPATH_CRYPTO_ASM_OBJS='$(FASTPATH_SOFT_CRYPTO_ASM_OBJS)'
	echo "$ac_t""yes" 1>&6
      else
	echo "$ac_t""no" 1>&6
      fi
    else
      echo "$ac_t""no" 1>&6
    fi
    ;;
  *-*-*)
      echo "$ac_t""no" 1>&6
    ;;
esac





#
# Determine which subdirectories to build based on the 'configured' target:
# (This cannot be performed by autodist because one distribution supports
# several different targets)
#

echo $ac_n "checking which QuickSec Engine and PM configurations to build""... $ac_c" 1>&6
echo "configure:9157: checking which QuickSec Engine and PM configurations to build" >&5



if false; then
  SSH_QS_BUILD_USERMODE_TRUE=
  SSH_QS_BUILD_USERMODE_FALSE='#'
else
  SSH_QS_BUILD_USERMODE_TRUE='#'
  SSH_QS_BUILD_USERMODE_FALSE=
fi


if false; then
  SSH_QS_BUILD_KERNEL_TRUE=
  SSH_QS_BUILD_KERNEL_FALSE='#'
else
  SSH_QS_BUILD_KERNEL_TRUE='#'
  SSH_QS_BUILD_KERNEL_FALSE=
fi


if false; then
  SSH_QS_BUILD_UNIFIED_USERMODE_TRUE=
  SSH_QS_BUILD_UNIFIED_USERMODE_FALSE='#'
else
  SSH_QS_BUILD_UNIFIED_USERMODE_TRUE='#'
  SSH_QS_BUILD_UNIFIED_USERMODE_FALSE=
fi


if false; then
  SSH_QS_BUILD_UNIFIED_KERNEL_TRUE=
  SSH_QS_BUILD_UNIFIED_KERNEL_FALSE='#'
else
  SSH_QS_BUILD_UNIFIED_KERNEL_TRUE='#'
  SSH_QS_BUILD_UNIFIED_KERNEL_FALSE=
fi

case "$target" in
  *-*-netbsd*|*-*-linux*|*-*-solaris*|*-*-freebsd*)
    #
    # Build split and unified usermode engine models for debugging
    #
    SSH_QS_BUILD_USERMODE_TRUE=""
    SSH_QS_BUILD_USERMODE_FALSE="#"
    SSH_QS_BUILD_KERNEL_TRUE=""
    SSH_QS_BUILD_KERNEL_FALSE="#"
    SSH_QS_BUILD_UNIFIED_USERMODE_TRUE=""
    SSH_QS_BUILD_UNIFIED_USERMODE_FALSE="#"
    SSH_QS_BUILD_UNIFIED_KERNEL_TRUE="#"
    SSH_QS_BUILD_UNIFIED_KERNEL_FALSE=""
    ;;
  *-*-vxworks*)
    #
    # For VxWorks only the unified-kernel is really meaningful
    #
    SSH_QS_BUILD_USERMODE_TRUE="#"
    SSH_QS_BUILD_USERMODE_FALSE=""
    SSH_QS_BUILD_KERNEL_TRUE="#"
    SSH_QS_BUILD_KERNEL_FALSE=""
    SSH_QS_BUILD_UNIFIED_USERMODE_TRUE="#"
    SSH_QS_BUILD_UNIFIED_USERMODE_FALSE=""
    SSH_QS_BUILD_UNIFIED_KERNEL_TRUE=""
    SSH_QS_BUILD_UNIFIED_KERNEL_FALSE="#"
    ;;
  *-*-*)
    ;;
esac

# Do not build kernel space modules if interceptor will not be built.
if test "x$disable_interceptor" = "xyes"; then
  SSH_QS_BUILD_KERNEL_TRUE="#"
  SSH_QS_BUILD_KERNEL_FALSE=""
fi

echo "$ac_t""ok" 1>&6

echo $ac_n "checking whether to compile with Anti-virus ALG""... $ac_c" 1>&6
echo "configure:9236: checking whether to compile with Anti-virus ALG" >&5
# Check whether --with-av-alg or --without-av-alg was given.
if test "${with_av_alg+set}" = set; then
  withval="$with_av_alg"
   case "$withval" in
    no)
	check_dir=""
	;;
    yes)
	check_dir=$srcdir
	AV_ALG_INCLUDES='-I$(top_srcdir)'
	AV_ALG_LIBS='$(top_srcdir)/anti-virus/libkld.a'
	cat >> confdefs.h <<\EOF
#define WITH_AV_ALG 1
EOF

	;;
    *)
	check_dir=$withval
	AV_ALG_INCLUDES=-I$check_dir
	AV_ALG_LIBS=$check_dir/anti-virus/libkld.a
	cat >> confdefs.h <<\EOF
#define WITH_AV_ALG 1
EOF

	;;
  esac

  if test "$check_dir" = ""
  then
	AV_ALG_INCLUDES=""
	AV_ALG_LIBS=""
	echo "$ac_t""no" 1>&6
  else
  	dir_found=1
  	if test ! -f "$check_dir/anti-virus/libkld.a"
  	then
		dir_found=0
  	fi
  	if test ! -f "$check_dir/anti-virus/kaverr.h"
	then
        	dir_found=0
  	fi
  	if test ! -f "$check_dir/anti-virus/kldclient.h"
  	then
 		dir_found=0
  	fi
  	if test ! -f "$check_dir/anti-virus/md5.h"
  	then
		dir_found=0
  	fi
  	if test $dir_found = 0
  	then
		{ echo "configure: error: Missing files in $check_dir" 1>&2; exit 1; }
		AV_ALG_INCLUDES=""
		AV_ALG_LIBS=""
  	else
	  	echo "$ac_t""$check_dir" 1>&6
  	fi
  fi
  
else
  echo "$ac_t""no" 1>&6

fi



#
# configure.in fragment for ipsec/hwaccel
#
# Copyright:
#       Copyright (c) 2002, 2003, 2004, 2006 SFNT Finland Oy.
#       All rights reserved
#
#
# Tests for hardware accelerators
#
# Only thing you need to do here is to set HWACCEL_CONFIGURED_SRCS to
# point to the right set of sources under src/ipsec/hwaccel. Source
# files for different drivers are defined in
# src/ipsec/hwaccel/Makefile.inc
#

echo $ac_n "checking what kind of acclerator hardware to support""... $ac_c" 1>&6
echo "configure:9321: checking what kind of acclerator hardware to support" >&5

HWACCEL_CONFIGURED_SRCS='$(HWACCEL_NONE_SRCS)'
HWACCEL_CONFIGURED_OBJS='$(HWACCEL_NONE_OBJS)'
HWACCEL_CONFIGURED_INCLUDES='$(HWACCEL_NONE_INCLUDES)'
HWACCEL_CONFIGURED_DIRECTORY='none'

# Check whether --with-hwaccel or --without-hwaccel was given.
if test "${with_hwaccel+set}" = set; then
  withval="$with_hwaccel"
   case "$withval" in
  no)
    echo "$ac_t""no" 1>&6
    HWACCEL_CONFIGURED_SRCS='$(HWACCEL_NONE_SRCS)'
    HWACCEL_CONFIGURED_OBJS='$(HWACCEL_NONE_OBJS)'
    HWACCEL_CONFIGURED_INCLUDES='$(HWACCEL_NONE_INCLUDES)'
    HWACCEL_CONFIGURED_DIRECTORY='none'
    cat >> confdefs.h <<\EOF
#define SSH_IPSEC_HWACCEL_NAME "none"
EOF

    ;;








  safenet-1x41)
    echo "$ac_t""$withval" 1>&6
    HWACCEL_CONFIGURED_SRCS='$(HWACCEL_SAFENET_1X41_SRCS)'
    HWACCEL_CONFIGURED_OBJS='$(HWACCEL_SAFENET_1X41_OBJS)'
    HWACCEL_CONFIGURED_INCLUDES='$(HWACCEL_SAFENET_1X41_INCLUDES)'
    HWACCEL_CONFIGURED_DIRECTORY='safenet1x41'
    cat >> confdefs.h <<\EOF
#define SSH_IPSEC_HWACCEL_CONFIGURED 1
EOF

    cat >> confdefs.h <<\EOF
#define SSH_IPSEC_HWACCEL_USE_COMBINED_TRANSFORM 1
EOF

    cat >> confdefs.h <<\EOF
#define SSH_IPSEC_HWACCEL_DOES_ANTIREPLAY 1
EOF

    cat >> confdefs.h <<\EOF
#define SSH_IPSEC_HWACCEL_NAME "SafeNet UDM"
EOF

    cat >> confdefs.h <<\EOF
#define SSH_IPSEC_HWACCEL_SUPPORT_TLS 1
EOF

    ;;

  safenet-pe-slad-405EX)
    echo "$ac_t""$withval" 1>&6
    HWACCEL_CONFIGURED_SRCS='$(HWACCEL_SAFENET_PE_405_SRCS)'
    HWACCEL_CONFIGURED_OBJS='$(HWACCEL_SAFENET_PE_405_OBJS)'
    HWACCEL_CONFIGURED_INCLUDES='$(HWACCEL_SAFENET_PE_INCLUDES)'
    HWACCEL_CONFIGURED_DIRECTORY='safenet_pe'
    cat >> confdefs.h <<\EOF
#define SSH_IPSEC_HWACCEL_CONFIGURED 1
EOF

    cat >> confdefs.h <<\EOF
#define SSH_IPSEC_HWACCEL_USE_COMBINED_TRANSFORM 1
EOF

    cat >> confdefs.h <<\EOF
#define SSH_IPSEC_HWACCEL_DOES_ANTIREPLAY 1
EOF

    SAFENETFLAGS="-DSAFENET_PE_PLATFORM_405EX $SAFENETFLAGS"
    CPPFLAGS="-DSAFENET_PE_PLATFORM_405EX $CPPFLAGS"	    
    cat >> confdefs.h <<\EOF
#define SSH_IPSEC_HWACCEL_NAME "SAFENET_PE_SLAD_405EX"
EOF

    ;;

  safenet-pe-pec-1742)
    echo "$ac_t""$withval" 1>&6
    HWACCEL_CONFIGURED_SRCS='$(HWACCEL_SAFENET_PE_PEC_SRCS)'
    HWACCEL_CONFIGURED_OBJS='$(HWACCEL_SAFENET_PE_PEC_OBJS)'
    HWACCEL_CONFIGURED_INCLUDES='$(HWACCEL_SAFENET_PE_INCLUDES)'
    HWACCEL_CONFIGURED_DIRECTORY='safenet_pe'
    cat >> confdefs.h <<\EOF
#define SSH_IPSEC_HWACCEL_CONFIGURED 1
EOF

    cat >> confdefs.h <<\EOF
#define SSH_IPSEC_HWACCEL_USE_COMBINED_TRANSFORM 1
EOF

    cat >> confdefs.h <<\EOF
#define SSH_IPSEC_HWACCEL_DOES_ANTIREPLAY 1
EOF

    SAFENETFLAGS="-DSAFENET_PE_PLATFORM_1742 \
                  -I$safenet_dir/Kit/EIP94v2_SL/incl \
                  -I$safenet_dir/Examples/V-Driver_1742/incl \
                  $SAFENETFLAGS"
    CPPFLAGS="-DSAFENET_PE_PLATFORM_1742 $CPPFLAGS"
    cat >> confdefs.h <<\EOF
#define SSH_IPSEC_HWACCEL_NAME "SAFENET_PE_PEC_1742"
EOF

    ;;

  safenet-pe-pec-1746)
    echo "$ac_t""$withval" 1>&6
    HWACCEL_CONFIGURED_SRCS='$(HWACCEL_SAFENET_PE_PEC_SRCS)'
    HWACCEL_CONFIGURED_OBJS='$(HWACCEL_SAFENET_PE_PEC_OBJS)'
    HWACCEL_CONFIGURED_INCLUDES='$(HWACCEL_SAFENET_PE_INCLUDES)'
    HWACCEL_CONFIGURED_DIRECTORY='safenet_pe'
    cat >> confdefs.h <<\EOF
#define SSH_IPSEC_HWACCEL_CONFIGURED 1
EOF

    cat >> confdefs.h <<\EOF
#define SSH_IPSEC_HWACCEL_USE_COMBINED_TRANSFORM 1
EOF

    cat >> confdefs.h <<\EOF
#define SSH_IPSEC_HWACCEL_DOES_ANTIREPLAY 1
EOF

    SAFENETFLAGS="-DSAFENET_PE_PLATFORM_1746 \
                  -I$safenet_dir/Kit/EIP94v2_SL/incl \
                  -I$safenet_dir/Examples/V-Driver_1746/incl \
                  $SAFENETFLAGS"
    CPPFLAGS="-DSAFENET_PE_PLATFORM_1746 $CPPFLAGS"
    cat >> confdefs.h <<\EOF
#define SSH_IPSEC_HWACCEL_NAME "SAFENET_PE_PEC_1746"
EOF

    ;;

  safenet-wludm)
    echo "$ac_t""$withval" 1>&6
    HWACCEL_CONFIGURED_SRCS=safenet_wludm.c
    HWACCEL_CONFIGURED_OBJS=safenet_wludm.o
    HWACCEL_CONFIGURED_INCLUDES='$(HWACCEL_SAFENET_WLUDM_INCLUDES)'
    HWACCEL_CONFIGURED_DIRECTORY='safenetwludm'
    cat >> confdefs.h <<\EOF
#define SSH_IPSEC_HWACCEL_CONFIGURED 1
EOF

    cat >> confdefs.h <<\EOF
#define SSH_IPSEC_HWACCEL_NAME "SafeNet Wireless UDM"
EOF

    ;;





  ocf)
    echo "$ac_t""$withval" 1>&6
    HWACCEL_CONFIGURED_SRCS='$(HWACCEL_OCF_SRCS)'
    HWACCEL_CONFIGURED_OBJS='$(HWACCEL_OCF_OBJS)'
    HWACCEL_CONFIGURED_INCLUDES='$(HWACCEL_OCF_INCLUDES)'
    HWACCEL_CONFIGURED_DIRECTORY='ocf'
    cat >> confdefs.h <<\EOF
#define ENABLE_OCF_SP 1
EOF

    cat >> confdefs.h <<\EOF
#define SSH_IPSEC_HWACCEL_CONFIGURED 1
EOF

    cat >> confdefs.h <<\EOF
#define SSH_IPSEC_HWACCEL_NAME "OCF"
EOF

    ;;



  *)
    echo "$ac_t""no" 1>&6
    HWACCEL_CONFIGURED_SRCS='$(HWACCEL_NONE_SRCS)'
    HWACCEL_CONFIGURED_OBJS='$(HWACCEL_NONE_OBJS)'
    HWACCEL_CONFIGURED_INCLUDES='$(HWACCEL_NONE_INCLUDES)'
    HWACCEL_CONFIGURED_DIRECTORY='none'
    cat >> confdefs.h <<\EOF
#define SSH_IPSEC_HWACCEL_NAME "none"
EOF

    ;;
  esac 
else
  echo "$ac_t""no" 1>&6

fi


#
# Do the substition for the final ipsec/hwaccel/Makefile
#









echo $ac_n "checking whether to use EMI memory""... $ac_c" 1>&6
echo "configure:9536: checking whether to use EMI memory" >&5
# Check whether --enable-emi-memory or --disable-emi-memory was given.
if test "${enable_emi_memory+set}" = set; then
  enableval="$enable_emi_memory"
   case "$enableval" in
      no)
          echo "$ac_t""no" 1>&6
          ;;
      *)
          echo "$ac_t""yes" 1>&6
	  cat >> confdefs.h <<\EOF
#define SSH_SAFENET_USE_EMI_MEMORY 1
EOF

          ;;
      esac 
else
   echo "$ac_t""yes" 1>&6
   cat >> confdefs.h <<\EOF
#define SSH_SAFENET_USE_EMI_MEMORY 1
EOF

fi


echo $ac_n "checking whether to enable the support of AMCC""... $ac_c" 1>&6
echo "configure:9562: checking whether to enable the support of AMCC" >&5
# Check whether --enable-amcc-support or --disable-amcc-support was given.
if test "${enable_amcc_support+set}" = set; then
  enableval="$enable_amcc_support"
   case "$enableval" in
      no)
          echo "$ac_t""no" 1>&6
          ;;
      *)
          echo "$ac_t""yes" 1>&6
          case "$target" in
            *-*-linux*)
                       ;;
            *)
               { echo "configure: error: AMCC support can only be enabled on linux" 1>&2; exit 1; }
               ;;
           esac 
      cat >> confdefs.h <<\EOF
#define SSH_SAFENET_AMCC_SUPPORT 1
EOF

          ;;
      esac 
else
  echo "$ac_t""no" 1>&6
fi


echo $ac_n "checking whether to enable target endian swapping for Safenet devices""... $ac_c" 1>&6
echo "configure:9591: checking whether to enable target endian swapping for Safenet devices" >&5
# Check whether --enable-target-endian-swap or --disable-target-endian-swap was given.
if test "${enable_target_endian_swap+set}" = set; then
  enableval="$enable_target_endian_swap"
   case "$enableval" in
      no)
          echo "$ac_t""no" 1>&6
          ;;
      *)
          echo "$ac_t""yes" 1>&6
	  cat >> confdefs.h <<\EOF
#define SSH_SAFENET_TARGET_REQUIRES_SWAP 1
EOF

          ;;
      esac 
else
  echo "$ac_t""no" 1>&6

fi


echo $ac_n "checking whether to support Safenet""... $ac_c" 1>&6
echo "configure:9614: checking whether to support Safenet" >&5
# Check whether --with-safenet-udm or --without-safenet-udm was given.
if test "${with_safenet_udm+set}" = set; then
  withval="$with_safenet_udm"
  
  case "$withval" in
  no)
    echo "$ac_t""no" 1>&6
    safenet_dir=""
    ;;
  yes)
    safenet_dir=""
    ;;
  *)
   safenet_dir="$withval"
    ;;
  esac
  if test X$safenet_dir != X; then
    if ( ! (echo $SAFENETFLAGS | grep "$safenet_dir/cgx/hdrs" > /dev/null ) ); 
      then
      case $target in
      *-*-linux*)  
      SAFENETFLAGS="-DCGX_PLATFORM_LINUX -I$safenet_dir/cgx/hdrs"
      SAFENET_UDM_VPATH="$safenet_dir/cgx/plugins/udm/usr/generic:\
$safenet_dir/cgx/plugins/udm/usr/linux"
      SAFENET_UDM_SRCS='udm_usr.c udm_usr_target.c'
      SAFENET_UDM_OBJS='udm_usr.o udm_usr_target.o'
      ;;
      *-*-vxworks*)
      SAFENETFLAGS="-DCGX_PLATFORM_VXWORKS -I$safenet_dir/cgx/hdrs"
      ;;
      esac
      CPPFLAGS="$CPPFLAGS $SAFENETFLAGS"

      
      
      
      
      cat >> confdefs.h <<\EOF
#define HAVE_SAFENET 1
EOF

      echo "$ac_t""Safenet driver header files are in $safenet_dir." 1>&6
    else
      echo "$ac_t""already defined" 1>&6
    fi
  fi 
else
  echo "$ac_t""no" 1>&6
 

fi


echo $ac_n "checking whether a Safenet 1840 device type has been specified""... $ac_c" 1>&6
echo "configure:9669: checking whether a Safenet 1840 device type has been specified" >&5
# Check whether --enable-safenet-1840 or --disable-safenet-1840 was given.
if test "${enable_safenet_1840+set}" = set; then
  enableval="$enable_safenet_1840"
   case "$enableval" in
      no)
          echo "$ac_t""no" 1>&6
          ;;
      *)
          echo "$ac_t""yes" 1>&6
	  cat >> confdefs.h <<\EOF
#define SSH_SAFENET_USE_1840_DEVICE 1
EOF

          ;;
      esac 
else
  echo "$ac_t""no" 1>&6
fi


echo $ac_n "checking whether a Safenet 1841 device type has been specified""... $ac_c" 1>&6
echo "configure:9691: checking whether a Safenet 1841 device type has been specified" >&5
# Check whether --enable-safenet-1841 or --disable-safenet-1841 was given.
if test "${enable_safenet_1841+set}" = set; then
  enableval="$enable_safenet_1841"
   case "$enableval" in
      no)
          echo "$ac_t""no" 1>&6
          ;;
      *)
          echo "$ac_t""yes" 1>&6
	  cat >> confdefs.h <<\EOF
#define SSH_SAFENET_USE_1841_DEVICE 1
EOF

          ;;
      esac 
else
  echo "$ac_t""no" 1>&6
fi


echo $ac_n "checking whether a Safenet 1842 device type has been specified""... $ac_c" 1>&6
echo "configure:9713: checking whether a Safenet 1842 device type has been specified" >&5
# Check whether --enable-safenet-1842 or --disable-safenet-1842 was given.
if test "${enable_safenet_1842+set}" = set; then
  enableval="$enable_safenet_1842"
   case "$enableval" in
      no)
          echo "$ac_t""no" 1>&6
          ;;
      *)
          echo "$ac_t""yes" 1>&6
	  cat >> confdefs.h <<\EOF
#define SSH_SAFENET_USE_1842_DEVICE 1
EOF

          ;;
      esac 
else
  echo "$ac_t""no" 1>&6
fi








echo $ac_n "checking whether to enable ethernet driver""... $ac_c" 1>&6
echo "configure:9741: checking whether to enable ethernet driver" >&5
# Check whether --enable-eth-packet-hook or --disable-eth-packet-hook was given.
if test "${enable_eth_packet_hook+set}" = set; then
  enableval="$enable_eth_packet_hook"
   case "$enableval" in
      yes)
          echo "$ac_t""yes" 1>&6
	  cat >> confdefs.h <<\EOF
#define ETH_PACKET_HOOK 1
EOF

          ;;
      *)
          echo "$ac_t""no" 1>&6
          ;;
      esac 
else
  echo "$ac_t""no" 1>&6

fi

# -*- sh -*-
#
# configure.in fragment for src/ipsec/interceptor
#

#
# Here "" basically means TRUE and "#" means FALSE
# (These are used for substitutions in Makefile.in's
#

echo $ac_n "checking Target platform for interceptor tree""... $ac_c" 1>&6
echo "configure:9773: checking Target platform for interceptor tree" >&5



if false; then
  SSH_QS_PLATFORM_LINUX_TRUE=
  SSH_QS_PLATFORM_LINUX_FALSE='#'
else
  SSH_QS_PLATFORM_LINUX_TRUE='#'
  SSH_QS_PLATFORM_LINUX_FALSE=
fi


if false; then
  SSH_QS_PLATFORM_TRU64_TRUE=
  SSH_QS_PLATFORM_TRU64_FALSE='#'
else
  SSH_QS_PLATFORM_TRU64_TRUE='#'
  SSH_QS_PLATFORM_TRU64_FALSE=
fi


if false; then
  SSH_QS_PLATFORM_NETBSD_TRUE=
  SSH_QS_PLATFORM_NETBSD_FALSE='#'
else
  SSH_QS_PLATFORM_NETBSD_TRUE='#'
  SSH_QS_PLATFORM_NETBSD_FALSE=
fi


if false; then
  SSH_QS_PLATFORM_VXWORKS_TRUE=
  SSH_QS_PLATFORM_VXWORKS_FALSE='#'
else
  SSH_QS_PLATFORM_VXWORKS_TRUE='#'
  SSH_QS_PLATFORM_VXWORKS_FALSE=
fi


if false; then
  SSH_QS_PLATFORM_SOLARIS_TRUE=
  SSH_QS_PLATFORM_SOLARIS_FALSE='#'
else
  SSH_QS_PLATFORM_SOLARIS_TRUE='#'
  SSH_QS_PLATFORM_SOLARIS_FALSE=
fi


if false; then
  SSH_QS_PLATFORM_OCTEON_TRUE=
  SSH_QS_PLATFORM_OCTEON_FALSE='#'
else
  SSH_QS_PLATFORM_OCTEON_TRUE='#'
  SSH_QS_PLATFORM_OCTEON_FALSE=
fi

case "$target" in
  mips64-octeon-linux-gnu)
   echo "$ac_t""Octeon" 1>&6
   SSH_QS_PLATFORM_OCTEON_TRUE=""
   SSH_QS_PLATFORM_OCTEON_FALSE="#"
   ;;

  *-*-linux*|*-*-mklinux*)
    echo "$ac_t""Linux" 1>&6
    SSH_QS_PLATFORM_LINUX_TRUE=""
    SSH_QS_PLATFORM_LINUX_FALSE="#"
    ;;

  *-*-solaris*|*solaris*)
    echo "$ac_t""Solaris" 1>&6
    SSH_QS_PLATFORM_SOLARIS_TRUE=""
    SSH_QS_PLATFORM_SOLARIS_FALSE="#"
    ;;

  alpha*-dec-osf5*|*osf5*)
    echo "$ac_t""Tru64" 1>&6
    SSH_QS_PLATFORM_TRU64_TRUE=""
    SSH_QS_PLATFORM_TRU64_FALSE="#"
    ;;

  *vxworks*)
    echo "$ac_t""VxWorks" 1>&6
    SSH_QS_PLATFORM_VXWORKS_TRUE=""
    SSH_QS_PLATFORM_VXWORKS_FALSE="#"
    ;;

  *)
    echo "$ac_t""NetBSD" 1>&6
    SSH_QS_PLATFORM_NETBSD_TRUE=""
    SSH_QS_PLATFORM_NETBSD_FALSE="#"
    ;;
esac
for ac_func in getpass fsync
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:9870: 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 9875 "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:9898: \"$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

#
# configure.in fragment for sshcrypto/sshcipher
#
# Copyright:
# 	Copyright (c) 2002, 2003, 2005 SFNT Finland Oy.
#       All rights reserved
#


echo $ac_n "checking whether to use assembly optimizations in crypt library""... $ac_c" 1>&6
echo "configure:9932: checking whether to use assembly optimizations in crypt library" >&5

case "$target" in
  mips64-octeon-linux*)
    if test "$enable_asm" = "yes"; then
      cat >> confdefs.h <<\EOF
#define ASM_PLATFORM_OCTEON 1
EOF

      cat >> confdefs.h <<\EOF
#define HAVE_3DES 1
EOF

      cat >> confdefs.h <<\EOF
#define HAVE_AES 1
EOF

      cat >> confdefs.h <<\EOF
#define HAVE_SHA 1
EOF

      cat >> confdefs.h <<\EOF
#define HAVE_MD5 1
EOF

      echo "$ac_t""yes" 1>&6
    else
      echo "$ac_t""no" 1>&6
    fi
  ;;

  i*86-*-bsdi*|i*86-*-freebsd*|i*86-*-netbsd*|i*86-*-openbsd*|i*86-*-linux*)
    if test "$enable_asm" = "yes"; then
      if test -n "$GCC"; then
	SSHCIPHER_CONF_OBJS="$SSHCIPHER_CONF_OBJS des386.o"
	cat >> confdefs.h <<\EOF
#define ASM_DES 1
EOF

        SSHCIPHER_CONF_OBJS="$SSHCIPHER_CONF_OBJS blowfish386.o"
        cat >> confdefs.h <<\EOF
#define ASM_BLOWFISH 1
EOF

        SSHCIPHER_CONF_OBJS="$SSHCIPHER_CONF_OBJS arcfour_386.o"
        cat >> confdefs.h <<\EOF
#define ASM_ARCFOUR 1
EOF

	echo "$ac_t""yes" 1>&6
      else
	echo "$ac_t""no" 1>&6
      fi
    else
      echo "$ac_t""no" 1>&6
    fi
    ;;
  *-*-*)
      echo "$ac_t""no" 1>&6
    ;;
esac



for ac_func in times clock
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:9999: 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 10004 "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:10027: \"$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

for ac_func in getpid getppid getuid getgid getpgrp
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:10054: 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 10059 "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:10082: \"$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



# Make sure nm is in PATH, because it is needed by the next test.
# Extract the first word of "nm", so it can be a program name with args.
set dummy nm; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:10112: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_NM_PATH'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  case "$NM_PATH" in
  /*)
  ac_cv_path_NM_PATH="$NM_PATH" # Let the user override the test with a path.
  ;;
  ?:/*)			 
  ac_cv_path_NM_PATH="$NM_PATH" # Let the user override the test with a dos path.
  ;;
  *)
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do 
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_path_NM_PATH="$ac_dir/$ac_word"
      break
    fi
  done
  IFS="$ac_save_ifs"
  test -z "$ac_cv_path_NM_PATH" && ac_cv_path_NM_PATH="no-nm"
  ;;
esac
fi
NM_PATH="$ac_cv_path_NM_PATH"
if test -n "$NM_PATH"; then
  echo "$ac_t""$NM_PATH" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

if test "$NM_PATH" = "no-nm"; then
  { echo "configure: error: "The 'nm' program could not be found in PATH."" 1>&2; exit 1; }
fi

    echo $ac_n "checking whether compiled symbols are prepended with underscore""... $ac_c" 1>&6
echo "configure:10150: checking whether compiled symbols are prepended with underscore" >&5

if test "${ac_cv_have_no_symbol_underscore+set}" = set; then
  if test "$ac_cv_have_no_symbol_underscore" = "yes"; then
    echo "$ac_t""no" 1>&6
    cat >> confdefs.h <<\EOF
#define HAVE_NO_SYMBOL_UNDERSCORE 1
EOF

  else
    echo "$ac_t""yes" 1>&6
  fi
else

  if test "$cross_compiling" = yes; then
  echo "configure: warning: cross compilation isn't tested" 1>&2
else
  cat > conftest.$ac_ext <<EOF
#line 10168 "configure"
#include "confdefs.h"
int underscoretestfunction() { return 0; }
             int main()
		{
		    underscoretestfunction();
		    return 0;
		}
EOF
if { (eval echo configure:10177: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
  if test -n "`nm conftest 2>/dev/null | grep _underscoretestfunction 2>/dev/null`"; then
		    echo "$ac_t""yes" 1>&6
		    ac_cv_have_no_symbol_underscore=no
		    elif test -n "`nm conftest 2>/dev/null | grep underscoretestfunction 2>/dev/null`"; then
		    echo "$ac_t""no" 1>&6
		    cat >> confdefs.h <<\EOF
#define HAVE_NO_SYMBOL_UNDERSCORE 1
EOF

		    ac_cv_have_no_symbol_underscore=yes
		fi 
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -fr conftest*
  echo "configure: warning: failed to test underscore." 1>&2
fi
rm -fr conftest*
fi

fi

#
# configure.in fragment for sshcrypt (crypto library)
#
# Author: Tatu Ylonen <ylo@ssh.fi>
#
#  Copyright:
#          Copyright (c) 2002, 2003, 2005 SFNT Finland Oy.
#                    All rights reserved
#

echo $ac_n "checking whether to use assembly optimizations in hash library""... $ac_c" 1>&6
echo "configure:10212: checking whether to use assembly optimizations in hash library" >&5
case "$target" in
  i*86-*-bsdi*|i*86-*-freebsd*|i*86-*-netbsd*|i*86-*-openbsd*|i*86-*-linux*)
    if test "$enable_asm" = "yes"; then
      if test -n "$GCC"; then
        SSHHASH_CONF_OBJS="$SSHHASH_CONF_OBJS md5_386.o"
        cat >> confdefs.h <<\EOF
#define ASM_MD5 1
EOF

	echo "$ac_t""yes" 1>&6
      else
	echo "$ac_t""no" 1>&6
      fi
    else
      echo "$ac_t""no" 1>&6
    fi
    ;;
  *-*-*)
      echo "$ac_t""no" 1>&6
    ;;
esac



for ac_func in times clock
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:10240: 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 10245 "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:10268: \"$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

for ac_func in getpid getppid getuid getgid getpgrp
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:10295: 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 10300 "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:10323: \"$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


# Make sure nm is in PATH, because it is needed by the next test.
# Extract the first word of "nm", so it can be a program name with args.
set dummy nm; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:10352: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_NM_PATH'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  case "$NM_PATH" in
  /*)
  ac_cv_path_NM_PATH="$NM_PATH" # Let the user override the test with a path.
  ;;
  ?:/*)			 
  ac_cv_path_NM_PATH="$NM_PATH" # Let the user override the test with a dos path.
  ;;
  *)
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do 
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_path_NM_PATH="$ac_dir/$ac_word"
      break
    fi
  done
  IFS="$ac_save_ifs"
  test -z "$ac_cv_path_NM_PATH" && ac_cv_path_NM_PATH="no-nm"
  ;;
esac
fi
NM_PATH="$ac_cv_path_NM_PATH"
if test -n "$NM_PATH"; then
  echo "$ac_t""$NM_PATH" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

if test "$NM_PATH" = "no-nm"; then
  { echo "configure: error: "The 'nm' program could not be found in PATH."" 1>&2; exit 1; }
fi

echo $ac_n "checking whether compiled symbols are prepended with underscore""... $ac_c" 1>&6
echo "configure:10390: checking whether compiled symbols are prepended with underscore" >&5

if test "${ac_cv_have_no_symbol_underscore+set}" = set; then
  if test "$ac_cv_have_no_symbol_underscore" = "yes"; then
    echo "$ac_t""no" 1>&6
    cat >> confdefs.h <<\EOF
#define HAVE_NO_SYMBOL_UNDERSCORE 1
EOF

  else
    echo "$ac_t""yes" 1>&6
  fi
else

  if test "$cross_compiling" = yes; then
  echo "configure: warning: cross compilation isn't tested" 1>&2
else
  cat > conftest.$ac_ext <<EOF
#line 10408 "configure"
#include "confdefs.h"
int underscoretestfunction() { return 0; }
             int main()
             {
                 underscoretestfunction();
	         return 0;
             }
EOF
if { (eval echo configure:10417: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
  if test -n "`nm conftest 2>/dev/null | grep _underscoretestfunction 2>/dev/null`"; then
                echo "$ac_t""yes" 1>&6
                ac_cv_have_no_symbol_underscore=no
              elif test -n "`nm conftest 2>/dev/null | grep underscoretestfunction 2>/dev/null`"; then
                echo "$ac_t""no" 1>&6
                cat >> confdefs.h <<\EOF
#define HAVE_NO_SYMBOL_UNDERSCORE 1
EOF

                ac_cv_have_no_symbol_underscore=yes
              fi 
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -fr conftest*
  echo "configure: warning: failed to test underscore." 1>&2
fi
rm -fr conftest*
fi

fi
echo $ac_n "checking whether to use the SSH or ANSI X9.62 random number generator""... $ac_c" 1>&6
echo "configure:10441: checking whether to use the SSH or ANSI X9.62 random number generator" >&5
# Check whether --with-ansi-rng or --without-ansi-rng was given.
if test "${with_ansi_rng+set}" = set; then
  withval="$with_ansi_rng"
   case "$withval" in
  no)
    echo "$ac_t""SSH" 1>&6
    ;;
  *)
    echo "$ac_t""ANSI X9.62" 1>&6
    cat >> confdefs.h <<\EOF
#define WITH_ANSI_RNG 1
EOF

    ;;
  esac 
else
  echo "$ac_t""SSH" 1>&6

fi


echo $ac_n "checking for dladdr in -ldl""... $ac_c" 1>&6
echo "configure:10464: checking for dladdr in -ldl" >&5
ac_lib_var=`echo dl'_'dladdr | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-ldl  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 10472 "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
    builtin and then its argument prototype would still apply.  */
char dladdr();

int main() {
dladdr()
; return 0; }
EOF
if { (eval echo configure:10483: \"$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
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
    ac_tr_lib=HAVE_LIB`echo dl | sed -e 's/[^a-zA-Z0-9_]/_/g' \
    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
  cat >> confdefs.h <<EOF
#define $ac_tr_lib 1
EOF

  LIBS="-ldl $LIBS"

else
  echo "$ac_t""no" 1>&6
fi

for ac_func in dladdr
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:10513: 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 10518 "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:10541: \"$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

for ac_hdr in dlfcn.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:10569: 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 10574 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:10579: \"$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


# HPUX 9 and 10
for ac_func in shl_get
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:10610: 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 10615 "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:10638: \"$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

for ac_hdr in dl.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:10666: 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 10671 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:10676: \"$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


# HPUX 11
echo $ac_n "checking for dlget in -ldl""... $ac_c" 1>&6
echo "configure:10705: checking for dlget in -ldl" >&5
ac_lib_var=`echo dl'_'dlget | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-ldl  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 10713 "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
    builtin and then its argument prototype would still apply.  */
char dlget();

int main() {
dlget()
; return 0; }
EOF
if { (eval echo configure:10724: \"$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
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
    ac_tr_lib=HAVE_LIB`echo dl | sed -e 's/[^a-zA-Z0-9_]/_/g' \
    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
  cat >> confdefs.h <<EOF
#define $ac_tr_lib 1
EOF

  LIBS="-ldl $LIBS"

else
  echo "$ac_t""no" 1>&6
fi

for ac_func in dl
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:10754: 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 10759 "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:10782: \"$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


# AIX 4 and 5
for ac_hdr in sys/ldr.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:10812: 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 10817 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:10822: \"$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 loadquery
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:10851: 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 10856 "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:10879: \"$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
#
# configure.in fragment for sshpk (crypto library)
#
# Author: Tatu Ylonen <ylo@ssh.fi>
#
#  Copyright:
#          Copyright (c) 2002, 2003 SFNT Finland Oy.
#                    All rights reserved
#

echo $ac_n "checking whether to include the RSA algorithm""... $ac_c" 1>&6
echo "configure:10913: checking whether to include the RSA algorithm" >&5
# Check whether --with-rsa or --without-rsa was given.
if test "${with_rsa+set}" = set; then
  withval="$with_rsa"
   case "$withval" in
  no)
    echo "$ac_t""no" 1>&6
    ssh_do_ac_define_with_rsa="no"
    ;;
  *)
    echo "$ac_t""yes" 1>&6
    ssh_do_ac_define_with_rsa="yes"
    ;;
  esac 
else
  echo "$ac_t""yes" 1>&6
  ssh_do_ac_define_with_rsa="yes"

fi



if test "$ssh_do_ac_define_with_rsa" = "yes" ; then
  MSG_WITH_RSA="yes"
  cat >> confdefs.h <<\EOF
#define WITH_RSA 1
EOF

else
  MSG_WITH_RSA="no"
fi

#
# configure.in fragment for ipsec/quicksec/fastpath
#
# Copyright:
#       Copyright (c) 2002, 2003, 2004 SFNT Finland Oy.
#       All rights reserved
#

use_fastpath="software"

echo $ac_n "checking which fastpath to use""... $ac_c" 1>&6
echo "configure:10956: checking which fastpath to use" >&5

FASTPATH_CONFIGURED_SRCS=
FASTPATH_CONFIGURED_OBJS=
FASTPATH_CONFIGURED_INCLUDES=
FASTPATH_CONFIGURED_DIRECTORY=

# Check whether --with-fastpath or --without-fastpath was given.
if test "${with_fastpath+set}" = set; then
  withval="$with_fastpath"
   use_fastpath="$withval" 
 case "$use_fastpath" in
  software)
	;;

  scp51x0)

	FASTPATH_CONFIGURED_SRCS='$(FASTPATH_SCP51X0_SRCS)'
	FASTPATH_CONFIGURED_OBJS='$(FASTPATH_SCP51X0_OBJS)'
	FASTPATH_CONFIGURED_INCLUDES='$(FASTPATH_SCP51X0_INCLUDES)'
	FASTPATH_CONFIGURED_DIRECTORY='scp51x0'
	cat >> confdefs.h <<\EOF
#define FASTPATH_ACCELERATOR_CONFIGURED 1
EOF

        cat >> confdefs.h <<\EOF
#define FASTPATH_PROVIDES_LRU_FLOWS 1
EOF

	cat >> confdefs.h <<\EOF
#define FASTPATH_PROVIDES_FLOW 1
EOF

	cat >> confdefs.h <<\EOF
#define FASTPATH_PROVIDES_TRD 1
EOF

	cat >> confdefs.h <<\EOF
#define FASTPATH_PROVIDES_NH 1
EOF

	cat >> confdefs.h <<\EOF
#define FASTPATH_IS_SCP51X0 1
EOF

        SSH_QS_BUILD_UNIFIED_USERMODE_TRUE="#"
        SSH_QS_BUILD_UNIFIED_USERMODE_FALSE=""
	;;

  caviumocteon)

	FASTPATH_CONFIGURED_SRCS='$(FASTPATH_OCTEON_SRCS)'
	FASTPATH_CONFIGURED_OBJS='$(FASTPATH_OCTEON_OBJS)'
	FASTPATH_CONFIGURED_INCLUDES='$(FASTPATH_OCTEON_INCLUDES)'
	FASTPATH_CONFIGURED_DIRECTORY='caviumocteon'
	cat >> confdefs.h <<\EOF
#define FASTPATH_ACCELERATOR_CONFIGURED 1
EOF

	cat >> confdefs.h <<\EOF
#define FASTPATH_PROVIDES_FLOW 1
EOF

	cat >> confdefs.h <<\EOF
#define FASTPATH_PROVIDES_TRD 1
EOF

	cat >> confdefs.h <<\EOF
#define FASTPATH_PROVIDES_NH 1
EOF

	cat >> confdefs.h <<\EOF
#define FASTPATH_IS_OCTEON 1
EOF

        SSH_QS_BUILD_UNIFIED_USERMODE_TRUE="#"
        SSH_QS_BUILD_UNIFIED_USERMODE_FALSE=""
	;;

  *)
        { echo "configure: error: Invalid fastpath type $use_fastpath" 1>&2; exit 1; }
	;;
  esac

fi







echo "$ac_t""$use_fastpath" 1>&6

QS_FASTPATH="$use_fastpath"


QS_FASTPATH_SRCS="\$(FASTPATH_`echo $use_fastpath | tr 'a-z' 'A-Z'`_SRCS)"

# -*- sh -*-
#
# configure.tail - last fragment of top-level configure.in
#
# Copyright:
#         Copyright (c) 2002-2005 SFNT Finland Oy.
#         All rights reserved.
#














# If purify is enabled, add it to CC at this point. But only CC, not KERN_CC...
if test "x$with_purify" != "x"; then
  CC="$with_purify $CC"
  cat >> confdefs.h <<\EOF
#define WITH_PURIFY 1
EOF

  PURIFY="$with_purify"
  
fi

if test "X$vx_suffix" != "X"
  then
	LDFLAGS="-Wl,-i ${LDFLAGS}"
fi


if test "x$build_profile" = "x"; then
  if ! test -r $srcdir/sshdistdefs.h; then
    { echo "configure: error: build profile (--enable-profile=ARG) not specified." 1>&2; exit 1; }
  fi
else
  if ! test -r $srcdir/sshdistdefs-$build_profile.h; then
    { echo "configure: error: Cannot find $srcdir/sshdistdefs-$build_profile.h" 1>&2; exit 1; }
  fi

  if test -r $srcdir/sshdistdefs.h; then
    if ! cmp -s $srcdir/sshdistdefs-$build_profile.h $srcdir/sshdistdefs.h; then
      cp $srcdir/sshdistdefs-$build_profile.h $srcdir/sshdistdefs.h
    fi
  else
    cp $srcdir/sshdistdefs-$build_profile.h $srcdir/sshdistdefs.h
  fi
fi

trap '' 1 2 15
cat > confcache <<\EOF
# This file is a shell script that caches the results of configure
# tests run on this system so they can be shared between configure
# scripts and configure runs.  It is not useful on other systems.
# If it contains results you don't want to keep, you may remove or edit it.
#
# By default, configure uses ./config.cache as the cache file,
# creating it if it does not exist already.  You can give configure
# the --cache-file=FILE option to use a different cache file; that is
# what configure does when it calls configure scripts in
# subdirectories, so they share the cache.
# Giving --cache-file=/dev/null disables caching, for debugging configure.
# config.status only pays attention to the cache file if you give it the
# --recheck option to rerun configure.
#
EOF
# The following way of writing the cache mishandles newlines in values,
# but we know of no workaround that is simple, portable, and efficient.
# So, don't put newlines in cache variables' values.
# Ultrix sh set writes to stderr and can't be redirected directly,
# and sets the high bit in the cache file unless we assign to the vars.
(set) 2>&1 |
  case `(ac_space=' '; set | grep ac_space) 2>&1` in
  *ac_space=\ *)
    # `set' does not quote correctly, so add quotes (double-quote substitution
    # turns \\\\ into \\, and sed turns \\ into \).
    sed -n \
      -e "s/'/'\\\\''/g" \
      -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
    ;;
  *)
    # `set' quotes correctly as required by POSIX, so do not add quotes.
    sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
    ;;
  esac >> confcache
if cmp -s $cache_file confcache; then
  :
else
  if test -w $cache_file; then
    echo "updating cache $cache_file"
    cat confcache > $cache_file
  else
    echo "not updating unwritable cache $cache_file"
  fi
fi
rm -f confcache

trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15

test "x$prefix" = xNONE && prefix=$ac_default_prefix
# Let make expand exec_prefix.
test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'

# Any assignment to VPATH causes Sun make to only execute
# the first set of double-colon rules, so remove it if not needed.
# If there is a colon in the path, we need to keep it.
if test "x$srcdir" = x.; then
  ac_vpsub='/^[ 	]*VPATH[ 	]*=[^:]*$/d'
fi

trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15

DEFS=-DHAVE_CONFIG_H

# Without the "./", some shells look in PATH for config.status.
: ${CONFIG_STATUS=./config.status}

echo creating $CONFIG_STATUS
rm -f $CONFIG_STATUS
cat > $CONFIG_STATUS <<EOF
#! /bin/sh
# Generated automatically by configure.
# Run this file to recreate the current configuration.
# This directory was configured as follows,
# on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
#
# $0 $ac_configure_args
#
# Compiler output produced by configure, useful for debugging
# configure, is in ./config.log if it exists.

ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
for ac_option
do
  case "\$ac_option" in
  -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
    echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
    exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
  -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
    echo "$CONFIG_STATUS generated by autoconf version 2.13"
    exit 0 ;;
  -help | --help | --hel | --he | --h)
    echo "\$ac_cs_usage"; exit 0 ;;
  *) echo "\$ac_cs_usage"; exit 1 ;;
  esac
done

ac_given_srcdir=$srcdir
ac_given_INSTALL="$INSTALL"

trap 'rm -fr `echo "Makefile
Makefile.grandlib_final.pre
include/Makefile
lib/Makefile
lib/zlib/Makefile
lib/sshmath/Makefile
lib/sshmath/tests/Makefile
lib/sshutil/Makefile
lib/sshutil/sshadt/Makefile
lib/sshutil/sshcore/Makefile
lib/sshutil/ssheloop/Makefile
lib/sshutil/sshfsm/Makefile
lib/sshutil/sshfsm/tutorial/Makefile
lib/sshutil/sshmisc/Makefile
lib/sshutil/sshnet/Makefile
lib/sshutil/sshaudit/Makefile
lib/sshutil/sshpacketstream/Makefile
lib/sshutil/sshstream/Makefile
lib/sshutil/sshsysutil/Makefile
lib/sshutil/sshstrutil/Makefile
lib/sshutil/sshtestutil/Makefile
lib/sshutil/tests/Makefile
lib/sshapputil/Makefile
lib/sshapputil/tests/Makefile
lib/sshcrypto/Makefile
lib/sshcrypto/sshcryptocore/Makefile
lib/sshcrypto/sshcipher/Makefile
lib/sshcrypto/sshhash/Makefile
lib/sshcrypto/sshmac/Makefile
lib/sshcrypto/sshpk/Makefile
lib/sshcrypto/sshrandom/Makefile
lib/sshcrypto/tests/Makefile
lib/sshcryptoaux/Makefile
lib/sshcryptoaux/tests/Makefile
lib/sshasn1/Makefile
lib/sshasn1/tests/Makefile
lib/sshcert/Makefile
lib/sshcert/tests/Makefile
lib/sshpkcs/Makefile
lib/sshpkcs/tests/Makefile
lib/sshenroll/Makefile
lib/sshenroll/tests/Makefile
lib/sshvalidator/Makefile
lib/sshvalidator/tests/Makefile
lib/sshvalidator/tests/fips-tests/Makefile
lib/sshldap/Makefile
lib/sshldap/tests/Makefile
lib/sshexternalkey/Makefile
lib/sshexternalkey/tests/Makefile
lib/sshhttp/Makefile
lib/sshhttp/tests/Makefile
lib/sshtls/Makefile
lib/sshtls/tests/Makefile
lib/sshxml/Makefile
lib/sshxml/tests/Makefile
lib/sshradius/Makefile
lib/sshsim/Makefile
lib/ssheap/Makefile
lib/ssheap/tests/Makefile
build/Makefile
build/xml-compress/Makefile
apps/Makefile
apps/cryptutils/Makefile
apps/certutils/Makefile
apps/ldaputils/Makefile
apps/caviumocteon/Makefile
apps/perfutils/Makefile
apps/winceutils/Makefile
winconf/Makefile
filter_distdefs/Makefile
ipsec/Makefile
ipsec/include/Makefile
ipsec/lib/Makefile
ipsec/lib/sshisakmp/Makefile
ipsec/lib/sshisakmp/tests/Makefile
ipsec/lib/sshikev2/Makefile
ipsec/lib/sshikev2/tests/Makefile
ipsec/lib/sshl2tp/Makefile
ipsec/lib/sshl2tp/tests/Makefile
ipsec/lib/sshppp/Makefile
ipsec/lib/sshppp/tests/Makefile
ipsec/interceptor/Makefile
ipsec/interceptor/tests/Makefile
ipsec/interceptor/bsd/Makefile
ipsec/interceptor/linux/Makefile
ipsec/interceptor/windows/Makefile
ipsec/interceptor/windows/winim/Makefile
ipsec/interceptor/windows/winim/install/Makefile
ipsec/interceptor/windows/winim/install/winnt/Makefile
ipsec/interceptor/windows/winim/install/wince/Makefile
ipsec/interceptor/windows/ndisfilter/Makefile
ipsec/interceptor/windows/vnic/Makefile
ipsec/interceptor/windows/vnic/ndis5_0/Makefile
ipsec/interceptor/caviumocteon/Makefile
ipsec/interceptor/caviumocteon/linux/Makefile
ipsec/interceptor/caviumocteon/se/Makefile
ipsec/quicksec/Makefile
ipsec/quicksec/engine/Makefile
ipsec/quicksec/fastpath/Makefile
ipsec/quicksec/fastpath/software/Makefile
ipsec/quicksec/fastpath/caviumocteon/Makefile
ipsec/quicksec/appgw/Makefile
ipsec/quicksec/policymanager/Makefile
ipsec/quicksec/apps/Makefile
ipsec/quicksec/unified-kernel/Makefile
ipsec/quicksec/unified-usermode/Makefile
ipsec/quicksec/usermode/Makefile
ipsec/quicksec/kernel/Makefile
ipsec/quicksec/tests/Makefile
ipsec/quicksec/tests/usermode/Makefile
ipsec/quicksec/samples/Makefile
interceptor/Makefile
interceptor/include/Makefile
interceptor/usermode/Makefile
interceptor/libkernelutil/Makefile
interceptor/linux/Makefile
interceptor/windows/Makefile
interceptor/windows/ndisfilter/Makefile
interceptor/windows/winim/Makefile
interceptor/windows/vnic/Makefile
interceptor/windows/vnic/ndis5_0/Makefile
ipsec/hwaccel/Makefile
ipsec/hwaccel/none/Makefile
ipsec/hwaccel/safenet1x41/Makefile
ipsec/hwaccel/safenetwludm/Makefile
ipsec/hwaccel/ocf/Makefile
ipsec/hwaccel/safenet_pe/Makefile
ipsec/util/Makefile sshconf.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
EOF
cat >> $CONFIG_STATUS <<EOF

# Protect against being on the right side of a sed subst in config.status.
sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
 s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
$ac_vpsub
$extrasub
s%@SHELL@%$SHELL%g
s%@CFLAGS@%$CFLAGS%g
s%@CPPFLAGS@%$CPPFLAGS%g
s%@CXXFLAGS@%$CXXFLAGS%g
s%@FFLAGS@%$FFLAGS%g
s%@DEFS@%$DEFS%g
s%@LDFLAGS@%$LDFLAGS%g
s%@LIBS@%$LIBS%g
s%@exec_prefix@%$exec_prefix%g
s%@prefix@%$prefix%g
s%@program_transform_name@%$program_transform_name%g
s%@bindir@%$bindir%g
s%@sbindir@%$sbindir%g
s%@libexecdir@%$libexecdir%g
s%@datadir@%$datadir%g
s%@sysconfdir@%$sysconfdir%g
s%@sharedstatedir@%$sharedstatedir%g
s%@localstatedir@%$localstatedir%g
s%@libdir@%$libdir%g
s%@includedir@%$includedir%g
s%@oldincludedir@%$oldincludedir%g
s%@infodir@%$infodir%g
s%@mandir@%$mandir%g
s%@host@%$host%g
s%@host_alias@%$host_alias%g
s%@host_cpu@%$host_cpu%g
s%@host_vendor@%$host_vendor%g
s%@host_os@%$host_os%g
s%@target@%$target%g
s%@target_alias@%$target_alias%g
s%@target_cpu@%$target_cpu%g
s%@target_vendor@%$target_vendor%g
s%@target_os@%$target_os%g
s%@build@%$build%g
s%@build_alias@%$build_alias%g
s%@build_cpu@%$build_cpu%g
s%@build_vendor@%$build_vendor%g
s%@build_os@%$build_os%g
s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
s%@INSTALL_DATA@%$INSTALL_DATA%g
s%@PACKAGE@%$PACKAGE%g
s%@VERSION@%$VERSION%g
s%@ACLOCAL@%$ACLOCAL%g
s%@AUTOCONF@%$AUTOCONF%g
s%@AUTOMAKE@%$AUTOMAKE%g
s%@AUTOHEADER@%$AUTOHEADER%g
s%@MAKEINFO@%$MAKEINFO%g
s%@SET_MAKE@%$SET_MAKE%g
s%@SRCDIR_IS_BUILDDIR_TRUE@%$SRCDIR_IS_BUILDDIR_TRUE%g
s%@SRCDIR_IS_BUILDDIR_FALSE@%$SRCDIR_IS_BUILDDIR_FALSE%g
s%@BUILD_CC@%$BUILD_CC%g
s%@CC@%$CC%g
s%@RANLIB@%$RANLIB%g
s%@AR@%$AR%g
s%@LD@%$LD%g
s%@ADDR_MODEL@%$ADDR_MODEL%g
s%@M4@%$M4%g
s%@PERL@%$PERL%g
s%@CPP@%$CPP%g
s%@GRANDLIBARCMD@%$GRANDLIBARCMD%g
s%@GRANDLIBRANLIBCMD@%$GRANDLIBRANLIBCMD%g
s%@COPY_INCLUDE@%$COPY_INCLUDE%g
s%@LN_S@%$LN_S%g
s%@SSH_INTERCEPTOR_MACHINE_DIR@%$SSH_INTERCEPTOR_MACHINE_DIR%g
s%@SSH_INTERCEPTOR_MACHINE_SUBDIR@%$SSH_INTERCEPTOR_MACHINE_SUBDIR%g
s%@SSH_INTERCEPTOR_KERNEL_TARGETS@%$SSH_INTERCEPTOR_KERNEL_TARGETS%g
s%@SSH_INTERCEPTOR_TARGETS@%$SSH_INTERCEPTOR_TARGETS%g
s%@SSH_INTERCEPTOR_OBJS@%$SSH_INTERCEPTOR_OBJS%g
s%@SSH_INTERCEPTOR_NONETHER_OBJS@%$SSH_INTERCEPTOR_NONETHER_OBJS%g
s%@SSH_INTERCEPTOR_ETHER_OBJS@%$SSH_INTERCEPTOR_ETHER_OBJS%g
s%@SSH_INTERCEPTOR_CPPFLAGS@%$SSH_INTERCEPTOR_CPPFLAGS%g
s%@SSH_INTERCEPTOR_SYMCHECK@%$SSH_INTERCEPTOR_SYMCHECK%g
s%@SSH_KB_LINUX_KERNEL_INCLUDE@%$SSH_KB_LINUX_KERNEL_INCLUDE%g
s%@SSH_KB_LINUX_CONFIG_HEADER@%$SSH_KB_LINUX_CONFIG_HEADER%g
s%@QS_ADDRSPACE@%$QS_ADDRSPACE%g
s%@QS_EXTRALIBS@%$QS_EXTRALIBS%g
s%@ROUTE_CONFIGURED_SRCS@%$ROUTE_CONFIGURED_SRCS%g
s%@KERN_CC@%$KERN_CC%g
s%@KERN_CFLAGS@%$KERN_CFLAGS%g
s%@KERN_LDFLAGS@%$KERN_LDFLAGS%g
s%@KERN_LIBS@%$KERN_LIBS%g
s%@SSH_IPM_MACHINE_OBJS@%$SSH_IPM_MACHINE_OBJS%g
s%@ENGINE_ASM_OBJS@%$ENGINE_ASM_OBJS%g
s%@QUICKSEC_ASM_OBJS@%$QUICKSEC_ASM_OBJS%g
s%@SSH_ENGINE_KERNEL_TARGET@%$SSH_ENGINE_KERNEL_TARGET%g
s%@SSH_ENGINE_USERMODE_TARGET@%$SSH_ENGINE_USERMODE_TARGET%g
s%@RXP_PLATFORM_NAME@%$RXP_PLATFORM_NAME%g
s%@LIBOBJS@%$LIBOBJS%g
s%@THREAD_OBJS@%$THREAD_OBJS%g
s%@THREAD_SYSTEM_OBJS@%$THREAD_SYSTEM_OBJS%g
s%@MATH_CONF_OBJS@%$MATH_CONF_OBJS%g
s%@SAFENET_UDM_VPATH@%$SAFENET_UDM_VPATH%g
s%@SAFENET_UDM_SRCS@%$SAFENET_UDM_SRCS%g
s%@SAFENET_UDM_OBJS@%$SAFENET_UDM_OBJS%g
s%@SAFENETFLAGS@%$SAFENETFLAGS%g
s%@OCTEON_VPATH@%$OCTEON_VPATH%g
s%@OCTEON_SRCS@%$OCTEON_SRCS%g
s%@OCTEON_OBJS@%$OCTEON_OBJS%g
s%@OCTEONFLAGS@%$OCTEONFLAGS%g
s%@QS_FASTPATH_CRYPTO_ASM_LNSRC@%$QS_FASTPATH_CRYPTO_ASM_LNSRC%g
s%@QS_FASTPATH_CRYPTO_ASM_OBJS@%$QS_FASTPATH_CRYPTO_ASM_OBJS%g
s%@QUICKSEC_CONF_OBJS@%$QUICKSEC_CONF_OBJS%g
s%@SSH_QS_BUILD_USERMODE_TRUE@%$SSH_QS_BUILD_USERMODE_TRUE%g
s%@SSH_QS_BUILD_USERMODE_FALSE@%$SSH_QS_BUILD_USERMODE_FALSE%g
s%@SSH_QS_BUILD_KERNEL_TRUE@%$SSH_QS_BUILD_KERNEL_TRUE%g
s%@SSH_QS_BUILD_KERNEL_FALSE@%$SSH_QS_BUILD_KERNEL_FALSE%g
s%@SSH_QS_BUILD_UNIFIED_USERMODE_TRUE@%$SSH_QS_BUILD_UNIFIED_USERMODE_TRUE%g
s%@SSH_QS_BUILD_UNIFIED_USERMODE_FALSE@%$SSH_QS_BUILD_UNIFIED_USERMODE_FALSE%g
s%@SSH_QS_BUILD_UNIFIED_KERNEL_TRUE@%$SSH_QS_BUILD_UNIFIED_KERNEL_TRUE%g
s%@SSH_QS_BUILD_UNIFIED_KERNEL_FALSE@%$SSH_QS_BUILD_UNIFIED_KERNEL_FALSE%g
s%@AV_ALG_INCLUDES@%$AV_ALG_INCLUDES%g
s%@AV_ALG_LIBS@%$AV_ALG_LIBS%g
s%@HWACCEL_VPATH@%$HWACCEL_VPATH%g
s%@HWACCEL_CONFIGURED_SRCS@%$HWACCEL_CONFIGURED_SRCS%g
s%@HWACCEL_CONFIGURED_OBJS@%$HWACCEL_CONFIGURED_OBJS%g
s%@HWACCEL_CONFIGURED_INCLUDES@%$HWACCEL_CONFIGURED_INCLUDES%g
s%@HWACCEL_CONFIGURED_DIRECTORY@%$HWACCEL_CONFIGURED_DIRECTORY%g
s%@SSH_QS_PLATFORM_LINUX_TRUE@%$SSH_QS_PLATFORM_LINUX_TRUE%g
s%@SSH_QS_PLATFORM_LINUX_FALSE@%$SSH_QS_PLATFORM_LINUX_FALSE%g
s%@SSH_QS_PLATFORM_TRU64_TRUE@%$SSH_QS_PLATFORM_TRU64_TRUE%g
s%@SSH_QS_PLATFORM_TRU64_FALSE@%$SSH_QS_PLATFORM_TRU64_FALSE%g
s%@SSH_QS_PLATFORM_NETBSD_TRUE@%$SSH_QS_PLATFORM_NETBSD_TRUE%g
s%@SSH_QS_PLATFORM_NETBSD_FALSE@%$SSH_QS_PLATFORM_NETBSD_FALSE%g
s%@SSH_QS_PLATFORM_VXWORKS_TRUE@%$SSH_QS_PLATFORM_VXWORKS_TRUE%g
s%@SSH_QS_PLATFORM_VXWORKS_FALSE@%$SSH_QS_PLATFORM_VXWORKS_FALSE%g
s%@SSH_QS_PLATFORM_SOLARIS_TRUE@%$SSH_QS_PLATFORM_SOLARIS_TRUE%g
s%@SSH_QS_PLATFORM_SOLARIS_FALSE@%$SSH_QS_PLATFORM_SOLARIS_FALSE%g
s%@SSH_QS_PLATFORM_OCTEON_TRUE@%$SSH_QS_PLATFORM_OCTEON_TRUE%g
s%@SSH_QS_PLATFORM_OCTEON_FALSE@%$SSH_QS_PLATFORM_OCTEON_FALSE%g
s%@SSHCIPHER_CONF_OBJS@%$SSHCIPHER_CONF_OBJS%g
s%@NM_PATH@%$NM_PATH%g
s%@SSHHASH_CONF_OBJS@%$SSHHASH_CONF_OBJS%g
s%@FASTPATH_CONFIGURED_SRCS@%$FASTPATH_CONFIGURED_SRCS%g
s%@FASTPATH_CONFIGURED_OBJS@%$FASTPATH_CONFIGURED_OBJS%g
s%@FASTPATH_CONFIGURED_INCLUDES@%$FASTPATH_CONFIGURED_INCLUDES%g
s%@FASTPATH_CONFIGURED_DIRECTORY@%$FASTPATH_CONFIGURED_DIRECTORY%g
s%@QS_FASTPATH@%$QS_FASTPATH%g
s%@QS_FASTPATH_SRCS@%$QS_FASTPATH_SRCS%g
s%@IPSEC_ARCH_ROUTE@%$IPSEC_ARCH_ROUTE%g
s%@IPSEC_ARCH_INTC@%$IPSEC_ARCH_INTC%g
s%@PURIFY@%$PURIFY%g

CEOF
EOF

cat >> $CONFIG_STATUS <<\EOF

# Split the substitutions into bite-sized pieces for seds with
# small command number limits, like on Digital OSF/1 and HP-UX.
ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
ac_file=1 # Number of current file.
ac_beg=1 # First line for current file.
ac_end=$ac_max_sed_cmds # Line after last line for current file.
ac_more_lines=:
ac_sed_cmds=""
while $ac_more_lines; do
  if test $ac_beg -gt 1; then
    sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
  else
    sed "${ac_end}q" conftest.subs > conftest.s$ac_file
  fi
  if test ! -s conftest.s$ac_file; then
    ac_more_lines=false
    rm -f conftest.s$ac_file
  else
    if test -z "$ac_sed_cmds"; then
      ac_sed_cmds="sed -f conftest.s$ac_file"
    else
      ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
    fi
    ac_file=`expr $ac_file + 1`
    ac_beg=$ac_end
    ac_end=`expr $ac_end + $ac_max_sed_cmds`
  fi
done
if test -z "$ac_sed_cmds"; then
  ac_sed_cmds=cat
fi
EOF

cat >> $CONFIG_STATUS <<EOF

CONFIG_FILES=\${CONFIG_FILES-"Makefile
Makefile.grandlib_final.pre
include/Makefile
lib/Makefile
lib/zlib/Makefile
lib/sshmath/Makefile
lib/sshmath/tests/Makefile
lib/sshutil/Makefile
lib/sshutil/sshadt/Makefile
lib/sshutil/sshcore/Makefile
lib/sshutil/ssheloop/Makefile
lib/sshutil/sshfsm/Makefile
lib/sshutil/sshfsm/tutorial/Makefile
lib/sshutil/sshmisc/Makefile
lib/sshutil/sshnet/Makefile
lib/sshutil/sshaudit/Makefile
lib/sshutil/sshpacketstream/Makefile
lib/sshutil/sshstream/Makefile
lib/sshutil/sshsysutil/Makefile
lib/sshutil/sshstrutil/Makefile
lib/sshutil/sshtestutil/Makefile
lib/sshutil/tests/Makefile
lib/sshapputil/Makefile
lib/sshapputil/tests/Makefile
lib/sshcrypto/Makefile
lib/sshcrypto/sshcryptocore/Makefile
lib/sshcrypto/sshcipher/Makefile
lib/sshcrypto/sshhash/Makefile
lib/sshcrypto/sshmac/Makefile
lib/sshcrypto/sshpk/Makefile
lib/sshcrypto/sshrandom/Makefile
lib/sshcrypto/tests/Makefile
lib/sshcryptoaux/Makefile
lib/sshcryptoaux/tests/Makefile
lib/sshasn1/Makefile
lib/sshasn1/tests/Makefile
lib/sshcert/Makefile
lib/sshcert/tests/Makefile
lib/sshpkcs/Makefile
lib/sshpkcs/tests/Makefile
lib/sshenroll/Makefile
lib/sshenroll/tests/Makefile
lib/sshvalidator/Makefile
lib/sshvalidator/tests/Makefile
lib/sshvalidator/tests/fips-tests/Makefile
lib/sshldap/Makefile
lib/sshldap/tests/Makefile
lib/sshexternalkey/Makefile
lib/sshexternalkey/tests/Makefile
lib/sshhttp/Makefile
lib/sshhttp/tests/Makefile
lib/sshtls/Makefile
lib/sshtls/tests/Makefile
lib/sshxml/Makefile
lib/sshxml/tests/Makefile
lib/sshradius/Makefile
lib/sshsim/Makefile
lib/ssheap/Makefile
lib/ssheap/tests/Makefile
build/Makefile
build/xml-compress/Makefile
apps/Makefile
apps/cryptutils/Makefile
apps/certutils/Makefile
apps/ldaputils/Makefile
apps/caviumocteon/Makefile
apps/perfutils/Makefile
apps/winceutils/Makefile
winconf/Makefile
filter_distdefs/Makefile
ipsec/Makefile
ipsec/include/Makefile
ipsec/lib/Makefile
ipsec/lib/sshisakmp/Makefile
ipsec/lib/sshisakmp/tests/Makefile
ipsec/lib/sshikev2/Makefile
ipsec/lib/sshikev2/tests/Makefile
ipsec/lib/sshl2tp/Makefile
ipsec/lib/sshl2tp/tests/Makefile
ipsec/lib/sshppp/Makefile
ipsec/lib/sshppp/tests/Makefile
ipsec/interceptor/Makefile
ipsec/interceptor/tests/Makefile
ipsec/interceptor/bsd/Makefile
ipsec/interceptor/linux/Makefile
ipsec/interceptor/windows/Makefile
ipsec/interceptor/windows/winim/Makefile
ipsec/interceptor/windows/winim/install/Makefile
ipsec/interceptor/windows/winim/install/winnt/Makefile
ipsec/interceptor/windows/winim/install/wince/Makefile
ipsec/interceptor/windows/ndisfilter/Makefile
ipsec/interceptor/windows/vnic/Makefile
ipsec/interceptor/windows/vnic/ndis5_0/Makefile
ipsec/interceptor/caviumocteon/Makefile
ipsec/interceptor/caviumocteon/linux/Makefile
ipsec/interceptor/caviumocteon/se/Makefile
ipsec/quicksec/Makefile
ipsec/quicksec/engine/Makefile
ipsec/quicksec/fastpath/Makefile
ipsec/quicksec/fastpath/software/Makefile
ipsec/quicksec/fastpath/caviumocteon/Makefile
ipsec/quicksec/appgw/Makefile
ipsec/quicksec/policymanager/Makefile
ipsec/quicksec/apps/Makefile
ipsec/quicksec/unified-kernel/Makefile
ipsec/quicksec/unified-usermode/Makefile
ipsec/quicksec/usermode/Makefile
ipsec/quicksec/kernel/Makefile
ipsec/quicksec/tests/Makefile
ipsec/quicksec/tests/usermode/Makefile
ipsec/quicksec/samples/Makefile
interceptor/Makefile
interceptor/include/Makefile
interceptor/usermode/Makefile
interceptor/libkernelutil/Makefile
interceptor/linux/Makefile
interceptor/windows/Makefile
interceptor/windows/ndisfilter/Makefile
interceptor/windows/winim/Makefile
interceptor/windows/vnic/Makefile
interceptor/windows/vnic/ndis5_0/Makefile
ipsec/hwaccel/Makefile
ipsec/hwaccel/none/Makefile
ipsec/hwaccel/safenet1x41/Makefile
ipsec/hwaccel/safenetwludm/Makefile
ipsec/hwaccel/ocf/Makefile
ipsec/hwaccel/safenet_pe/Makefile
ipsec/util/Makefile"}
EOF
cat >> $CONFIG_STATUS <<\EOF
for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
  # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
  case "$ac_file" in
  *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
       ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
  *) ac_file_in="${ac_file}.in" ;;
  esac

  # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.

  # Remove last slash and all that follows it.  Not all systems have dirname.
  ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
  if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
    # The file is in a subdirectory.
    test ! -d "$ac_dir" && mkdir "$ac_dir"
    ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
    # A "../" for each directory in $ac_dir_suffix.
    ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
  else
    ac_dir_suffix= ac_dots=
  fi

  case "$ac_given_srcdir" in
  .)  srcdir=.
      if test -z "$ac_dots"; then top_srcdir=.
      else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
  /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
  *) # Relative path.
    srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
    top_srcdir="$ac_dots$ac_given_srcdir" ;;
  esac

  case "$ac_given_INSTALL" in
  [/$]*) INSTALL="$ac_given_INSTALL" ;;
  *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
  esac

  echo creating "$ac_file"
  rm -f "$ac_file"
  configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
  case "$ac_file" in
  *Makefile*) ac_comsub="1i\\
# $configure_input" ;;
  *) ac_comsub= ;;
  esac

  ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
  sed -e "$ac_comsub
s%@configure_input@%$configure_input%g
s%@srcdir@%$srcdir%g
s%@top_srcdir@%$top_srcdir%g
s%@INSTALL@%$INSTALL%g
" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
fi; done
rm -f conftest.s*

# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
# NAME is the cpp macro being defined and VALUE is the value it is being given.
#
# ac_d sets the value in "#define NAME VALUE" lines.
ac_dA='s%^\([ 	]*\)#\([ 	]*define[ 	][ 	]*\)'
ac_dB='\([ 	][ 	]*\)[^ 	]*%\1#\2'
ac_dC='\3'
ac_dD='%g'
# ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
ac_uA='s%^\([ 	]*\)#\([ 	]*\)undef\([ 	][ 	]*\)'
ac_uB='\([ 	]\)%\1#\2define\3'
ac_uC=' '
ac_uD='\4%g'
# ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
ac_eA='s%^\([ 	]*\)#\([ 	]*\)undef\([ 	][ 	]*\)'
ac_eB='$%\1#\2define\3'
ac_eC=' '
ac_eD='%g'

if test "${CONFIG_HEADERS+set}" != set; then
EOF
cat >> $CONFIG_STATUS <<EOF
  CONFIG_HEADERS="sshconf.h"
EOF
cat >> $CONFIG_STATUS <<\EOF
fi
for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
  # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
  case "$ac_file" in
  *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
       ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
  *) ac_file_in="${ac_file}.in" ;;
  esac

  echo creating $ac_file

  rm -f conftest.frag conftest.in conftest.out
  ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
  cat $ac_file_inputs > conftest.in

EOF

# Transform confdefs.h into a sed script conftest.vals that substitutes
# the proper values into config.h.in to produce config.h.  And first:
# Protect against being on the right side of a sed subst in config.status.
# Protect against being in an unquoted here document in config.status.
rm -f conftest.vals
cat > conftest.hdr <<\EOF
s/[\\&%]/\\&/g
s%[\\$`]%\\&%g
s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
s%ac_d%ac_u%gp
s%ac_u%ac_e%gp
EOF
sed -n -f conftest.hdr confdefs.h > conftest.vals
rm -f conftest.hdr

# This sed command replaces #undef with comments.  This is necessary, for
# example, in the case of _POSIX_SOURCE, which is predefined and required
# on some systems where configure will not decide to define it.
cat >> conftest.vals <<\EOF
s%^[ 	]*#[ 	]*undef[ 	][ 	]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
EOF

# Break up conftest.vals because some shells have a limit on
# the size of here documents, and old seds have small limits too.

rm -f conftest.tail
while :
do
  ac_lines=`grep -c . conftest.vals`
  # grep -c gives empty output for an empty file on some AIX systems.
  if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
  # Write a limited-size here document to conftest.frag.
  echo '  cat > conftest.frag <<CEOF' >> $CONFIG_STATUS
  sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
  echo 'CEOF
  sed -f conftest.frag conftest.in > conftest.out
  rm -f conftest.in
  mv conftest.out conftest.in
' >> $CONFIG_STATUS
  sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
  rm -f conftest.vals
  mv conftest.tail conftest.vals
done
rm -f conftest.vals

cat >> $CONFIG_STATUS <<\EOF
  rm -f conftest.frag conftest.h
  echo "/* $ac_file.  Generated automatically by configure.  */" > conftest.h
  cat conftest.in >> conftest.h
  rm -f conftest.in
  if cmp -s $ac_file conftest.h 2>/dev/null; then
    echo "$ac_file is unchanged"
    rm -f conftest.h
  else
    # Remove last slash and all that follows it.  Not all systems have dirname.
      ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
      if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
      # The file is in a subdirectory.
      test ! -d "$ac_dir" && mkdir "$ac_dir"
    fi
    rm -f $ac_file
    mv conftest.h $ac_file
  fi
fi; done

EOF
cat >> $CONFIG_STATUS <<EOF


EOF
cat >> $CONFIG_STATUS <<\EOF
test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h

exit 0
EOF
chmod +x $CONFIG_STATUS
rm -fr confdefs* $ac_clean_files
test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1


