#!/bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated automatically using autoconf.
# Copyright (C) 1991, 1992, 1993 Free Software Foundation, Inc.

# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.

# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.

# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

# Usage: configure [--srcdir=DIR] [--host=HOST] [--gas] [--nfp]
#        [--prefix=PREFIX] [--exec-prefix=PREFIX] [--with-PACKAGE[=VALUE]]
# Ignores all args except --srcdir, --prefix, --exec-prefix, and
# --with-PACKAGE[=VALUE] unless this script has special code to handle it.

for arg
do
  # Handle --exec-prefix with a space before the argument.
  if test x$next_exec_prefix = xyes; then exec_prefix=$arg; next_exec_prefix=
  # Handle --host with a space before the argument.
  elif test x$next_host = xyes; then next_host=
  # Handle --prefix with a space before the argument.
  elif test x$next_prefix = xyes; then prefix=$arg; next_prefix=
  # Handle --srcdir with a space before the argument.
  elif test x$next_srcdir = xyes; then srcdir=$arg; next_srcdir=
  else
    case $arg in
     # For backward compatibility, recognize -exec-prefix and --exec_prefix.
     -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* | --exec=* | --exe=* | --ex=* | --e=*)
	exec_prefix=`echo $arg | sed 's/[-a-z_]*=//'` ;;
     -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- | --exec | --exe | --ex | --e)
	next_exec_prefix=yes ;;

     -gas | --gas | --ga | --g) ;;

     -host=* | --host=* | --hos=* | --ho=* | --h=*) ;;
     -host | --host | --hos | --ho | --h)
	next_host=yes ;;

     -nfp | --nfp | --nf) ;;

     -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
	prefix=`echo $arg | sed 's/[-a-z_]*=//'` ;;
     -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
	next_prefix=yes ;;

     -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=* | --s=*)
	srcdir=`echo $arg | sed 's/[-a-z_]*=//'` ;;
     -srcdir | --srcdir | --srcdi | --srcd | --src | --sr | --s)
	next_srcdir=yes ;;

     -with-* | --with-*)
       package=`echo $arg|sed -e 's/-*with-//' -e 's/=.*//'`
       # Reject names that aren't valid shell variable names.
       if test -n "`echo $package| sed 's/[-a-zA-Z0-9_]//g'`"; then
         echo "configure: $package: invalid package name" >&2; exit 1
       fi
       package=`echo $package| sed 's/-/_/g'`
       case "$arg" in
         *=*) val="`echo $arg|sed 's/[^=]*=//'`" ;;
         *) val=1 ;;
       esac
       eval "with_$package='$val'" ;;

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

     *) ;;
    esac
  fi
done

trap 'rm -fr conftest* confdefs* core; exit 1' 1 3 15
trap 'rm -f confdefs*' 0

# NLS nuisances.
# These must not be set unconditionally because not all systems understand
# e.g. LANG=C (notably SCO).
if test "${LC_ALL+set}" = 'set' ; then LC_ALL=C; export LC_ALL; fi
if test "${LANG+set}"   = 'set' ; then LANG=C;   export LANG;   fi

rm -f conftest* confdefs.h
> confdefs.h
compile='${CC-cc} $CFLAGS conftest.c -o conftest $LIBS >/dev/null 2>&1'

# 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.
unique_file=src/obst/obst_config.h.in

# Find the source files, if location was not specified.
if test -z "$srcdir"; then
  srcdirdefaulted=yes
  # Try the directory containing this script, then `..'.
  prog=$0
  confdir=`echo $prog|sed 's%/[^/][^/]*$%%'`
  test "X$confdir" = "X$prog" && confdir=.
  srcdir=$confdir
  if test ! -r $srcdir/$unique_file; then
    srcdir=..
  fi
fi
if test ! -r $srcdir/$unique_file; then
  if test x$srcdirdefaulted = xyes; then
    echo "configure: Can not find sources in \`${confdir}' or \`..'." 1>&2
  else
    echo "configure: Can not find sources in \`${srcdir}'." 1>&2
  fi
  exit 1
fi
# Preserve a srcdir of `.' to avoid automounter screwups with pwd.
# But we can't avoid them for `..', to make subdirectories work.
case $srcdir in
  .|/*|~*) ;;
  *) srcdir=`cd $srcdir; pwd` ;; # Make relative path absolute.
esac


# Save the original args to write them into config.status later.
configure_args="$*"



#
#  initialize local variables
#
ADD_XINC=
ADD_XLIB=

test -n "$with_x"	    ||		 with_x=1
test -n "$with_psm_monitor" || with_psm_monitor=0
test -n "$with_joyce"	    ||       with_joyce=1
test -n "$with_xtdsync"     ||     with_xtdsync=0
test -n "$with_bsdld"	    || 	     with_bsdld=0
test -n "$with_incrld_bsd"  || 	with_incrld_bsd=0
test -n "$with_incrld"	    || 	    with_incrld=0

#
#  process additional options
#
usage="
usage: configure [--<option>[=<value>]] ...

Set compilation and installation parameters for OBST using the GNU
autoconf system.
Besides the standard GNU configure options, the following options are
recognized (there must be no white space in an option spec):
  
  --x-includes=<dir>    Search for X header files foremost in <dir>.
  --x-libraries=<dir>   Search for X libraries foremost in <dir>.

  --with-x              Compile any X11-based tools [default].
  --without-x           Do not compile X11-based tools.

  --with-psm-monitor    Compile the PSM monitoring facility.
  --without-psm-monitor Do not compile the monitoring facility [default].

  --with-joyce          Compile the JOYCE transaction facility [default].
  --without-joyce       Do not compile the JOYCE transaction facility.

  --with-xtdsync        Compile with extended synchronization facilities.
  --without-xtdsync     Compile just with locking synchronization [default].

  --with-bsdld          Compile BSD-based incremental loading.
  --without-bsdld       Don't compile BSD loading into libincrld.a [default].

  --without-incrld      Do not add incremental loading to tools [default].
  --with-incrld-bsd     Add BSD-based incremental loading to tools.

  --subst:<nm>=<txt>    Define <txt> as value for @<nm>@ in configured files.
  --define:<nm>=<txt>   Set <txt> as value for #define <nm> in configured
                        header files.
  --prevent:<nm>        Prevent a later '--subst' or '--define' declaration
                        from taking effect.
  --conf-file=<file>    Similar to '--subst', '--define', or '--prevent' but
                        the declarations are taken from <file> instead of
                        listing them individually on the command line.
                        <file> is expected to contain specifications in the
                        form <nm>=<txt> for substitutions, <nm>:<txt> for
                        definitions, and !<nm> for a 'prevent' declaration,
                        any other lines are ignored.

                        Only the first definition/substitution for a given
                        <nm> will be performed.

  --usage,--help        Print this text and exit.
"
test -z "$prefix" || __prefix=x
test -z "$exec_prefix" || __exec_prefix=x
srcdir_abs="`(cd $srcdir; pwd | sed 's|/tmp_mnt||')`" 
__defaultdirs="$srcdir/include/etc";__tmpf=/tmp/conf$$ig
for opt in --conf-file=local.cnf $* ""
do
   case "$opt" in
      --without-*)    __o="`echo "$opt" | sed 's|^--[a-z]*-||;s|[^A-Za-z0-9]|_|g'`"
eval "with_$__o='0'"	;;
      --usage|--help) echo "$usage"; exit 0	;;
      --define:*=*) eval "`echo "$opt" | sed -n 's|^[^:]*:\([^=]*\)=\(.*\)|__n="\1";__v="\2"|p'`"
__vnm="__`echo "$__n" | sed 's|[^A-Za-z0-9]|_|g'`";[ -n "`eval echo '${'"$__vnm"'+.}'`" ]||{ 
{
test -n "$verbose" && \
echo "	defining" $__n to be $__v
echo "#define" $__n $__v >> confdefs.h
DEFS="$DEFS -D$__n=$__v"
SEDDEFS="${SEDDEFS}\${SEDdA}$__n\${SEDdB}$__n\${SEDdC}$__v\${SEDdD}
\${SEDuA}$__n\${SEDuB}$__n\${SEDuC}$__v\${SEDuD}
\${SEDeA}$__n\${SEDeB}$__n\${SEDeC}$__v\${SEDeD}
"
}

eval `echo "$__vnm='$__v'"|sed "s%=''\(.\)%=\"'\"'\1%;s%\([^=]\)''\$%\1'\"'\"%"`;}	;;
      --subst:*=*)    eval "`echo "$opt" | sed -n 's|^[^:]*:\([^=]*\)=\(.*\)|__n="\1";__v="\2"|p'`"
__vnm="__`echo "$__n" | sed 's|[^A-Za-z0-9]|_|g'`";[ -n "`eval echo '${'"$__vnm"'+.}'`" ]||{ [ -z "$__addsubst_" ] || __addsubst="$__addsubst
"
__addsubst="${__addsubst}s%@$__n@%$__v%g";__addsubst_=+
[ -z "$verbose" ] || echo "	setting $__n to \"$__v\""
eval `echo "$__vnm='$__v'"|sed "s%=''\(.\)%=\"'\"'\1%;s%\([^=]\)''\$%\1'\"'\"%"`;}
	;;
      --prevent:*)    eval "`echo "$opt" | sed -n 's|^[^:]*:\(.*\)|__n="\1"|p'`"
__vnm="__`echo "$__n" | sed 's|[^A-Za-z0-9]|_|g'`";[ -n "`eval echo '${'"$__vnm"'+.}'`" ]|| eval "$__vnm=_"	;;
      --conf-file=*)  __fs=
for __f in `echo "$opt" | sed 's|[^=]*=\(.*\)|\1|'` ""
do if [ -r "$__f" ]; then
      __fs="$__fs $__f"
   elif [ "$__f" != "" ]; then
      ___f=
      for __d in $__defaultdirs
      do [ -r "$__d/$__f" ] && ___f="$__d/$__f"
      done
      if [ -n "$___f" ]; then
	 __fs="$__fs $___f"
      else
	 echo >&2 "*** WARNING:" "file \"$__f\" not found"
      fi
   fi
done
echo "processing configuration file(s)$__fs"
sed -n "s|^[ 	]*\(!\)[ 	]*\([-+_.A-Za-z][-+_.A-Za-z0-9]*\).*|\2 \1 _|p
s|^[ 	]*\([-+_.A-Za-z][-+_.A-Za-z0-9]*\)[ 	]*\([=:]\)[ 	]*\(.*\)|\1 \2 \3|p" $__fs /dev/null\
| { while read name sep val
    do
       vname="__`echo "$name" | sed 's|[^A-Za-z0-9]|_|g'`"
       [ -n "`eval echo '${'"$vname"'+.}'`" ] || {
	  case "$sep" in
	     =) { [ -z "$__addsubst_" ] || __addsubst="$__addsubst
"
__addsubst="${__addsubst}s%@$name@%$val%g";__addsubst_=+
[ -z "$verbose" ] || echo "	setting $name to \"$val\""
}
 ;;
	     :) { 
{
test -n "$verbose" && \
echo "	defining" $name to be $val
echo "#define" $name $val >> confdefs.h
DEFS="$DEFS -D$name=$val"
SEDDEFS="${SEDDEFS}\${SEDdA}$name\${SEDdB}$name\${SEDdC}$val\${SEDdD}
\${SEDuA}$name\${SEDuB}$name\${SEDuC}$val\${SEDuD}
\${SEDeA}$name\${SEDeB}$name\${SEDeC}$val\${SEDeD}
"
}

};;
	  esac
	  __c=`echo "$vname='$val'"|sed "s%=''\(.\)%=\"'\"'\1%;s%\([^=]\)''\$%\1'\"'\"%"`
	  echo "$__c" >> $__tmpf; eval "$__c"
       }
    done
    echo "__addsubst='$__addsubst'
__addsubst_=$__addsubst_
DEFS='$DEFS'
SEDDEFS='$SEDDEFS'" >> $__tmpf
  }
eval "`cat $__tmpf`"
	;;
--x-includes=*)  ADD_XINC="$ADD_XINC `echo "$opt" | sed 's|[^=]*=\(.*\)|\1|'`" ;;
   --x-libraries=*) ADD_XLIB="$ADD_XLIB `echo "$opt" | sed 's|[^=]*=\(.*\)|\1|'`" ;;

   esac
done


#
#  check for compiler and load the appropriate configuration file
#
#  The variable CC_PROG is used as an indicator whether a configuration
#  has already been read (typically by command line option).
#

echo "checking for compiler"
if test -z "$__CC_PROG"; then
   if test -z "$find_comp"; then
  # Extract the first word of `g++', so it can be a program name with args.
  set dummy g++; word=$2
  echo checking for $word
  IFS="${IFS= 	}"; saveifs="$IFS"; IFS="${IFS}:"
  for dir in $PATH; do
    test -z "$dir" && dir=.
    if test -f $dir/$word; then
      find_comp="$dir"
      break
    fi
  done
  IFS="$saveifs"
fi

test -n "$find_comp" && test -n "$verbose" && echo "	setting find_comp to $find_comp"

   if test -n "$find_comp"; then
      gnu_version="`g++ -v 2>&1 | grep version | \
		    sed 's/^[^0-9]*\([0-9.]*\).*/\1/'`"
      case "$gnu_version" in
	 1*)	cmp_conf="gcc1_40_3"      ;;
	 2.3.3) cmp_conf="gcc2_3_3"  ;;
	 2.4.5) cmp_conf="gcc2_4_5"  ;;
	 2.5*)  cmp_conf="gcc2_5"    ;;
	 *)     cmp_conf="gcc2_3_3"  ;;
      esac
   else
      if test -z "$find_comp"; then
  # Extract the first word of `CC', so it can be a program name with args.
  set dummy CC; word=$2
  echo checking for $word
  IFS="${IFS= 	}"; saveifs="$IFS"; IFS="${IFS}:"
  for dir in $PATH; do
    test -z "$dir" && dir=.
    if test -f $dir/$word; then
      find_comp="$dir"
      break
    fi
  done
  IFS="$saveifs"
fi

test -n "$find_comp" && test -n "$verbose" && echo "	setting find_comp to $find_comp"

      if test -n "$find_comp"; then
	 if test -f $dir/cfront; then
	    att_version="`strings $dir/cfront | \
			  sed -n -e 's|.*<<[^0-9]*\([0-9.]*\).*>>.*|\1|p'`"
	 else
	    att_version="2.1.0"
	 fi
	 case $att_version in
	    2.1.0 ) cmp_conf="att2_1"    ;;
	    3.0.1 ) cmp_conf="att3_0_1"  ;;
	    *)	    cmp_conf="att2_1"	  ;;
	 esac
      fi
   fi 
   if test -n "$cmp_conf"; then
      echo "Compiler: $cmp_conf"
      echo "  --> The configuration file cmp_$cmp_conf.cnf is used."
      __fs=
for __f in cmp_$cmp_conf.cnf ""
do if [ -r "$__f" ]; then
      __fs="$__fs $__f"
   elif [ "$__f" != "" ]; then
      ___f=
      for __d in $__defaultdirs
      do [ -r "$__d/$__f" ] && ___f="$__d/$__f"
      done
      if [ -n "$___f" ]; then
	 __fs="$__fs $___f"
      else
	 echo >&2 "*** WARNING:" "file \"$__f\" not found"
      fi
   fi
done
echo "processing configuration file(s)$__fs"
sed -n "s|^[ 	]*\(!\)[ 	]*\([-+_.A-Za-z][-+_.A-Za-z0-9]*\).*|\2 \1 _|p
s|^[ 	]*\([-+_.A-Za-z][-+_.A-Za-z0-9]*\)[ 	]*\([=:]\)[ 	]*\(.*\)|\1 \2 \3|p" $__fs /dev/null\
| { while read name sep val
    do
       vname="__`echo "$name" | sed 's|[^A-Za-z0-9]|_|g'`"
       [ -n "`eval echo '${'"$vname"'+.}'`" ] || {
	  case "$sep" in
	     =) { [ -z "$__addsubst_" ] || __addsubst="$__addsubst
"
__addsubst="${__addsubst}s%@$name@%$val%g";__addsubst_=+
[ -z "$verbose" ] || echo "	setting $name to \"$val\""
}
 ;;
	     :) { 
{
test -n "$verbose" && \
echo "	defining" $name to be $val
echo "#define" $name $val >> confdefs.h
DEFS="$DEFS -D$name=$val"
SEDDEFS="${SEDDEFS}\${SEDdA}$name\${SEDdB}$name\${SEDdC}$val\${SEDdD}
\${SEDuA}$name\${SEDuB}$name\${SEDuC}$val\${SEDuD}
\${SEDeA}$name\${SEDeB}$name\${SEDeC}$val\${SEDeD}
"
}

};;
	  esac
	  __c=`echo "$vname='$val'"|sed "s%=''\(.\)%=\"'\"'\1%;s%\([^=]\)''\$%\1'\"'\"%"`
	  echo "$__c" >> $__tmpf; eval "$__c"
       }
    done
    echo "__addsubst='$__addsubst'
__addsubst_=$__addsubst_
DEFS='$DEFS'
SEDDEFS='$SEDDEFS'" >> $__tmpf
  }
eval "`cat $__tmpf`"

   fi
fi

test -z "$__CC" || CC="$__CC"

#
#  check for operating system and load the appropriate configurating file
#
__unamestr="`(uname -s) 2>/dev/null`"

if test ! -n "$__HAVE_READ_OS_CONFFILE"; then
   case "$__unamestr" in 
      SunOS)	os_conf=solaris1	;;
      Linux)	os_conf=linux		;;
      HP-UX)	os_conf=hpux8		;;
      *)	os_conf=solaris1	;;
   esac

   echo "Operating system: $os_conf"
   echo "  --> The configuration file os_$os_conf.cnf is used."
   __fs=
for __f in os_$os_conf.cnf ""
do if [ -r "$__f" ]; then
      __fs="$__fs $__f"
   elif [ "$__f" != "" ]; then
      ___f=
      for __d in $__defaultdirs
      do [ -r "$__d/$__f" ] && ___f="$__d/$__f"
      done
      if [ -n "$___f" ]; then
	 __fs="$__fs $___f"
      else
	 echo >&2 "*** WARNING:" "file \"$__f\" not found"
      fi
   fi
done
echo "processing configuration file(s)$__fs"
sed -n "s|^[ 	]*\(!\)[ 	]*\([-+_.A-Za-z][-+_.A-Za-z0-9]*\).*|\2 \1 _|p
s|^[ 	]*\([-+_.A-Za-z][-+_.A-Za-z0-9]*\)[ 	]*\([=:]\)[ 	]*\(.*\)|\1 \2 \3|p" $__fs /dev/null\
| { while read name sep val
    do
       vname="__`echo "$name" | sed 's|[^A-Za-z0-9]|_|g'`"
       [ -n "`eval echo '${'"$vname"'+.}'`" ] || {
	  case "$sep" in
	     =) { [ -z "$__addsubst_" ] || __addsubst="$__addsubst
"
__addsubst="${__addsubst}s%@$name@%$val%g";__addsubst_=+
[ -z "$verbose" ] || echo "	setting $name to \"$val\""
}
 ;;
	     :) { 
{
test -n "$verbose" && \
echo "	defining" $name to be $val
echo "#define" $name $val >> confdefs.h
DEFS="$DEFS -D$name=$val"
SEDDEFS="${SEDDEFS}\${SEDdA}$name\${SEDdB}$name\${SEDdC}$val\${SEDdD}
\${SEDuA}$name\${SEDuB}$name\${SEDuC}$val\${SEDuD}
\${SEDeA}$name\${SEDeB}$name\${SEDeC}$val\${SEDeD}
"
}

};;
	  esac
	  __c=`echo "$vname='$val'"|sed "s%=''\(.\)%=\"'\"'\1%;s%\([^=]\)''\$%\1'\"'\"%"`
	  echo "$__c" >> $__tmpf; eval "$__c"
       }
    done
    echo "__addsubst='$__addsubst'
__addsubst_=$__addsubst_
DEFS='$DEFS'
SEDDEFS='$SEDDEFS'" >> $__tmpf
  }
eval "`cat $__tmpf`"

fi

#  
#  check whether a full bootstrap is needed
#
if test -n "$__do_boot"; then
   __do_boot=1
   case "$__unamestr" in 
      SunOS) __do_boot=	;;
   esac
fi
if test "$__do_boot" = 1; then
   echo "full bootstrap necessary."
   touch BOOT.necessary
else
   echo "no bootstrap necessary."
fi

#
#  check for cnt lock method
#
if test -n "$__LOCKD_CORRECT"; then
   __vnm="__`echo "lock_file_check" | sed 's|[^A-Za-z0-9]|_|g'`";[ -n "`eval echo '${'"$__vnm"'+.}'`" ]||{ [ -z "$__addsubst_" ] || __addsubst="$__addsubst
"
__addsubst="${__addsubst}s%@lock_file_check@%"'@for i in $$OBSTCONTAINER/*.lck; do rm -f $$i; done'"%g";__addsubst_=+
[ -z "$verbose" ] || echo "	setting lock_file_check to \""'@for i in $$OBSTCONTAINER/*.lck; do rm -f $$i; done'"\""
eval `echo "$__vnm='"'@for i in $$OBSTCONTAINER/*.lck; do rm -f $$i; done'"'"|sed "s%=''\(.\)%=\"'\"'\1%;s%\([^=]\)''\$%\1'\"'\"%"`;}

else
   __vnm="__`echo "lock_file_check" | sed 's|[^A-Za-z0-9]|_|g'`";[ -n "`eval echo '${'"$__vnm"'+.}'`" ]||{ [ -z "$__addsubst_" ] || __addsubst="$__addsubst
"
__addsubst="${__addsubst}s%@lock_file_check@%"'@for i in $$OBSTCONTAINER/*[1234567890]; do touch $$i.lck; done'"%g";__addsubst_=+
[ -z "$verbose" ] || echo "	setting lock_file_check to \""'@for i in $$OBSTCONTAINER/*1234567890; do touch $$i.lck; done'"\""
eval `echo "$__vnm='"'@for i in $$OBSTCONTAINER/*1234567890; do touch $$i.lck; done'"'"|sed "s%=''\(.\)%=\"'\"'\1%;s%\([^=]\)''\$%\1'\"'\"%"`;}

fi

#
#  checks for programs
#
if test -n "$__INSTALL"; then
           INSTALL="$__INSTALL"
   INSTALL_PROGRAM="$__INSTALL_PROGRAM"
      INSTALL_DATA="$__INSTALL_DATA"
else
   # Make sure to not get the incompatible SysV /etc/install and
# /usr/sbin/install, which might be in PATH before a BSD-like install,
# or the SunOS /usr/etc/install directory, or the AIX /bin/install,
# or the AFS install, which mishandles nonexistent args, or
# /usr/ucb/install on SVR4, which tries to use the nonexistent group
# `staff'.  On most BSDish systems install is in /usr/bin, not /usr/ucb
# anyway.  Sigh.
if test "z${INSTALL}" = "z" ; then
  echo checking for install
  IFS="${IFS= 	}"; saveifs="$IFS"; IFS="${IFS}:"
  for dir in $PATH; do
    test -z "$dir" && dir=.
    case $dir in
    /etc|/usr/sbin|/usr/etc|/usr/afsws/bin|/usr/ucb) ;;
    *)
      if test -f $dir/installbsd; then
	INSTALL="$dir/installbsd -c" # OSF1
	INSTALL_PROGRAM='$(INSTALL)'
	INSTALL_DATA='$(INSTALL) -m 644'
	break
      fi
      if test -f $dir/install; then
	if grep dspmsg $dir/install >/dev/null 2>&1; then
	  : # AIX
	else
	  INSTALL="$dir/install -c"
	  INSTALL_PROGRAM='$(INSTALL)'
	  INSTALL_DATA='$(INSTALL) -m 644'
	  break
	fi
      fi
      ;;
    esac
  done
  IFS="$saveifs"
fi
INSTALL=${INSTALL-cp}
test -n "$verbose" && echo "	setting INSTALL to $INSTALL"
INSTALL_PROGRAM=${INSTALL_PROGRAM-'$(INSTALL)'}
test -n "$verbose" && echo "	setting INSTALL_PROGRAM to $INSTALL_PROGRAM"
INSTALL_DATA=${INSTALL_DATA-'$(INSTALL)'}
test -n "$verbose" && echo "	setting INSTALL_DATA to $INSTALL_DATA"

fi
if test -n "$__LEX"; then
      LEX="$__LEX"
   LEXLIB="$__LEXLIB"
else
   if test -z "$LEX"; then
  # Extract the first word of `flex', so it can be a program name with args.
  set dummy flex; word=$2
  echo checking for $word
  IFS="${IFS= 	}"; saveifs="$IFS"; IFS="${IFS}:"
  for dir in $PATH; do
    test -z "$dir" && dir=.
    if test -f $dir/$word; then
      LEX="flex"
      break
    fi
  done
  IFS="$saveifs"
fi
test -z "$LEX" && LEX="lex"
test -n "$LEX" && test -n "$verbose" && echo "	setting LEX to $LEX"

if test -z "$LEXLIB"
then
  case "$LEX" in
  flex*) LIBS_save="${LIBS}"
LIBS="${LIBS} -lfl"
have_lib=""
echo checking for -lfl
cat > conftest.c <<EOF
#include "confdefs.h"

int main() { exit(0); }
int t() { main(); }
EOF
if eval $compile; then
  rm -rf conftest*
  have_lib="1"

fi
rm -f conftest*
LIBS="${LIBS_save}"
if test -n "${have_lib}"; then
   :; LEXLIB="-lfl"
else
   :; 
fi
 ;;
  *) LEXLIB="-ll" ;;
  esac
fi

fi
if test -n "$__LN_S"; then
   LN_S="$__LN_S"
else
   echo checking for ln -s
rm -f conftestdata
if ln -s X conftestdata 2>/dev/null
then
  rm -f conftestdata
  LN_S="ln -s"
else
  LN_S=ln
fi


fi
if test -n "$__RANLIB"; then
   RANLIB="$__RANLIB"
else
   if test -z "$RANLIB"; then
  # Extract the first word of `ranlib', so it can be a program name with args.
  set dummy ranlib; word=$2
  echo checking for $word
  IFS="${IFS= 	}"; saveifs="$IFS"; IFS="${IFS}:"
  for dir in $PATH; do
    test -z "$dir" && dir=.
    if test -f $dir/$word; then
      RANLIB="ranlib"
      break
    fi
  done
  IFS="$saveifs"
fi
test -z "$RANLIB" && RANLIB=":"
test -n "$RANLIB" && test -n "$verbose" && echo "	setting RANLIB to $RANLIB"

fi
if test -n "$__YACC"; then
   YACC="$__YACC"
else
   for p in 'bison -y' byacc
do
if test -z "$YACC"; then
  # Extract the first word of `$p', so it can be a program name with args.
  set dummy $p; word=$2
  echo checking for $word
  IFS="${IFS= 	}"; saveifs="$IFS"; IFS="${IFS}:"
  for dir in $PATH; do
    test -z "$dir" && dir=.
    if test -f $dir/$word; then
      YACC="$p"
      break
    fi
  done
  IFS="$saveifs"
fi

test -n "$YACC" && test -n "$verbose" && echo "	setting YACC to $YACC"

test -n "$YACC" && break
done
test -n "$YACC" || YACC="yacc"

fi

#
for hdr in $__ck
do
trhdr=HAVE_`echo $hdr | tr '[a-z]./' '[A-Z]__'`
echo checking for ${hdr}
echo checking how to run the C preprocessor
if test -z "$CPP"; then
  # This must be in double quotes, not single quotes, because CPP may get
  # substituted into the Makefile and ``${CC-cc}'' will simply confuse
  # make.  It must be expanded now.
  CPP="${CC-cc} -E"
  cat > conftest.c <<EOF
#include "confdefs.h"
#include <stdio.h>
Syntax Error
EOF
err=`eval "($CPP conftest.c >/dev/null) 2>&1"`
if test -z "$err"; then
  :
else
  rm -rf conftest*
  CPP=/lib/cpp
fi
rm -f conftest*
fi
test ".${verbose}" != "." && echo "	setting CPP to $CPP"

cat > conftest.c <<EOF
#include "confdefs.h"
#include <${hdr}>
EOF
err=`eval "($CPP conftest.c >/dev/null) 2>&1"`
if test -z "$err"; then
  rm -rf conftest*
  
{
test -n "$verbose" && \
echo "	defining ${trhdr}"
echo "#define" ${trhdr} 1 >> confdefs.h
DEFS="$DEFS -D${trhdr}=1"
SEDDEFS="${SEDDEFS}\${SEDdA}${trhdr}\${SEDdB}${trhdr}\${SEDdC}1\${SEDdD}
\${SEDuA}${trhdr}\${SEDuB}${trhdr}\${SEDuC}1\${SEDuD}
\${SEDeA}${trhdr}\${SEDeB}${trhdr}\${SEDeC}1\${SEDeD}
"
}


fi
rm -f conftest*
done


#
#  checks for header files
#
test -z "$__CC_PROG" || CPP="$__CC_PROG -E"
__ck=

test -n "$__HAVE_IOSTREAM_H" || __ck="$__ck iostream.h"
test -n "$__HAVE_OSFCN_H"    || __ck="$__ck osfcn.h"
test -n "$__HAVE_SEARCH_H"   || __ck="$__ck search.h"
test -n "$__HAVE_UNISTD_H"   || __ck="$__ck unistd.h"

for hdr in $__ck
do
trhdr=HAVE_`echo $hdr | tr '[a-z]./' '[A-Z]__'`
echo checking for ${hdr}
cat > conftest.c <<EOF
#include "confdefs.h"
#include <${hdr}>
EOF
err=`eval "($CPP conftest.c >/dev/null) 2>&1"`
if test -z "$err"; then
  rm -rf conftest*
  
{
test -n "$verbose" && \
echo "	defining ${trhdr}"
echo "#define" ${trhdr} 1 >> confdefs.h
DEFS="$DEFS -D${trhdr}=1"
SEDDEFS="${SEDDEFS}\${SEDdA}${trhdr}\${SEDdB}${trhdr}\${SEDdC}1\${SEDdD}
\${SEDuA}${trhdr}\${SEDuB}${trhdr}\${SEDuC}1\${SEDuD}
\${SEDeA}${trhdr}\${SEDeB}${trhdr}\${SEDeC}1\${SEDeD}
"
}


fi
rm -f conftest*
done


#
#  checks for library functions
#
__ck=

test -n "$__HAVE_FSYNC"     || __ck="$__ck fsync"
test -n "$__HAVE_GETRLIMIT" || __ck="$__ck getrlimit"
test -n "$__HAVE_GETWD"     || __ck="$__ck getwd"
test -n "$__HAVE_RANDOM"    || __ck="$__ck random"
test -n "$__HAVE_SIGACTION" || __ck="$__ck sigaction"
test -n "$__HAVE_SIGVEC"    || __ck="$__ck sigvec"
test -n "$__HAVE_SYNC"      || __ck="$__ck sync"

for func in $__ck
do
trfunc=HAVE_`echo $func | tr '[a-z]' '[A-Z]'`
echo checking for ${func}
cat > conftest.c <<EOF
#include "confdefs.h"
#include <ctype.h>
int main() { exit(0); }
int t() { 
/* 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_${func}) || defined (__stub___${func})
choke me
#else
/* Override any gcc2 internal prototype to avoid an error.  */
extern char ${func}(); ${func}();
#endif
 }
EOF
if eval $compile; then
  rm -rf conftest*
  {
test -n "$verbose" && \
echo "	defining ${trfunc}"
echo "#define" ${trfunc} 1 >> confdefs.h
DEFS="$DEFS -D${trfunc}=1"
SEDDEFS="${SEDDEFS}\${SEDdA}${trfunc}\${SEDdB}${trfunc}\${SEDdC}1\${SEDdD}
\${SEDuA}${trfunc}\${SEDuB}${trfunc}\${SEDuC}1\${SEDuD}
\${SEDeA}${trfunc}\${SEDeB}${trfunc}\${SEDeC}1\${SEDeD}
"
}


fi
rm -f conftest*
done


#
#  checks for libraries
#
test -n "$__ADD_LIBS" || {
   __ADD_LIBS=

   LIBS_save="${LIBS}"
LIBS="${LIBS} -lsocket"
have_lib=""
echo checking for -lsocket
cat > conftest.c <<EOF
#include "confdefs.h"

int main() { exit(0); }
int t() { main(); }
EOF
if eval $compile; then
  rm -rf conftest*
  have_lib="1"

fi
rm -f conftest*
LIBS="${LIBS_save}"
if test -n "${have_lib}"; then
   :; __ADD_LIBS="$__ADD_LIBS -lsocket"
else
   :; 
fi

   LIBS_save="${LIBS}"
LIBS="${LIBS} -lnsl"
have_lib=""
echo checking for -lnsl
cat > conftest.c <<EOF
#include "confdefs.h"

int main() { exit(0); }
int t() { main(); }
EOF
if eval $compile; then
  rm -rf conftest*
  have_lib="1"

fi
rm -f conftest*
LIBS="${LIBS_save}"
if test -n "${have_lib}"; then
   :; __ADD_LIBS="$__ADD_LIBS -lnsl"
else
   :; 
fi


   { [ -z "$__addsubst_" ] || __addsubst="$__addsubst
"
__addsubst="${__addsubst}s%@ADD_LIBS@%$__ADD_LIBS%g";__addsubst_=+
[ -z "$verbose" ] || echo "	setting ADD_LIBS to \"$__ADD_LIBS\""
}

}

#
#  locate the X11 header files and libraries.
#
test    -n "$__OBST_XINC$ADD_XINC"\
     -a -n "$__OBST_XLIB$ADD_XLIB" || {
   # If we find X, set shell vars x_includes and x_libraries to the paths.
no_x=true
echo checking for X include and library files with xmkmf
rm -fr conftestdir
if mkdir conftestdir; then
  cd conftestdir
  cat > Imakefile <<\EOF
acfindx:
	@echo "im_incroot=$(INCROOT); im_usrlibdir=$(USRLIBDIR); im_libdir=$(LIBDIR)"
EOF
  if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
    no_x=
    # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
    eval `make acfindx | grep -v make`
    # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
    if test ! -f $im_usrlibdir/libX11.a && test -f $im_libdir/libX11.a; then
      im_usrlibdir=$im_libdir
    fi
    case "$im_incroot" in
	/usr/include) ;;
	*) x_includes="$im_incroot" ;;
    esac
    case "$im_usrlibdir" in
	/usr/lib | /lib) ;;
	*) x_libraries="$im_usrlibdir" ;;
    esac
  fi
  cd ..
  rm -fr conftestdir
fi

if test -z "$im_usrlibdir"; then
echo checking for X include and library files directly
cat > conftest.c <<EOF
#include "confdefs.h"
#include <X11/Intrinsic.h>
EOF
err=`eval "($CPP conftest.c >/dev/null) 2>&1"`
if test -z "$err"; then
  rm -rf conftest*
  no_x=

else
  rm -rf conftest*
  for dir in \
    /usr/local/include \
    /usr/unsupported/include \
    /usr/x386/include \
    /usr/local/x11r5/include \
    /usr/include/X11R5 \
    /usr/include/X11R4 \
    /usr/X11R5/include \
    /usr/X11/include \
    /usr/openwin/include \
    /usr/openwin/share/include \
    /usr/lpp/Xamples/include \
    ; \
  do
    if test -r $dir/X11/Intrinsic.h; then
      x_includes=$dir; no_x=
      break
    fi
  done
fi
rm -f conftest*

# Check for the libraries.  First see if replacing the `include' by
# `lib' works.
LIBS_save="${LIBS}"
LIBS="${LIBS} -lXt"
have_lib=""
echo checking for -lXt
cat > conftest.c <<EOF
#include "confdefs.h"

int main() { exit(0); }
int t() { main(); }
EOF
if eval $compile; then
  rm -rf conftest*
  have_lib="1"

fi
rm -f conftest*
LIBS="${LIBS_save}"
if test -n "${have_lib}"; then
   :; no_x=
else
   :; for dir in `echo "$x_includes" | sed s/include/lib/` \
  /usr/local/lib \
  /usr/unsupported/lib \
  /usr/x386/lib \
  /usr/local/x11r5/lib \
  /usr/lib/X11 \
  /usr/lib/X11R4 \
  /usr/X11R5/lib \
  /usr/X11/lib \
  /usr/openwin/lib \
  /usr/lpp/Xamples/lib \
  ; \
do
  for extension in a so sl; do
    if test -r $dir/libXt.$extension; then
      x_libraries=$dir; no_x=
      break 2
    fi
  done
done
fi

fi
if test -n "$verbose"; then
  test -n "$x_includes" && echo "	found X11 headers in $x_includes"
  test -n "$x_libraries" && echo "	found X11 libraries in $x_libraries"
fi
   ADD_XINC="$ADD_XINC $x_includes"
   ADD_XLIB="$ADD_XLIB $x_libraries"
}
test -n "$__OBST_XINC" || {
   echo 'checking for X11 header files'
   OBST_XINC=;for __d in $ADD_XINC
do for __f in $__d/X11/Intrinsic.h
   do [ -r "$__f" ] && { OBST_XINC="$__d"; break 2; }
   done
done

[ -n "$OBST_XINC" ] || echo >&2 "*** WARNING:" "couldn't find \"X11/Intrinsic.h\" in \"$ADD_XINC\""
__vnm="__`echo "OBST_XINC" | sed 's|[^A-Za-z0-9]|_|g'`";[ -n "`eval echo '${'"$__vnm"'+.}'`" ]||{ [ -z "$__addsubst_" ] || __addsubst="$__addsubst
"
__addsubst="${__addsubst}s%@OBST_XINC@%$OBST_XINC%g";__addsubst_=+
[ -z "$verbose" ] || echo "	setting OBST_XINC to \"$OBST_XINC\""
eval `echo "$__vnm='$OBST_XINC'"|sed "s%=''\(.\)%=\"'\"'\1%;s%\([^=]\)''\$%\1'\"'\"%"`;}

}
test -n "$__OBST_XLIB" || {
   echo 'checking for X11 library archive'
   OBST_XLIB=;for __d in $ADD_XLIB
do for __f in $__d/libX11.a
   do [ -r "$__f" ] && { OBST_XLIB="$__d"; break 2; }
   done
done

[ -n "$OBST_XLIB" ] || echo >&2 "*** WARNING:" "couldn't find \"libX11.a\" in \"$ADD_XLIB\""
__vnm="__`echo "OBST_XLIB" | sed 's|[^A-Za-z0-9]|_|g'`";[ -n "`eval echo '${'"$__vnm"'+.}'`" ]||{ [ -z "$__addsubst_" ] || __addsubst="$__addsubst
"
__addsubst="${__addsubst}s%@OBST_XLIB@%$OBST_XLIB%g";__addsubst_=+
[ -z "$verbose" ] || echo "	setting OBST_XLIB to \"$OBST_XLIB\""
eval `echo "$__vnm='$OBST_XLIB'"|sed "s%=''\(.\)%=\"'\"'\1%;s%\([^=]\)''\$%\1'\"'\"%"`;}

}

#
#  process module switches
#
echo 'processing module switches'

test "$with_x" = 1 || {
   __vnm="__`echo "xtools_targets" | sed 's|[^A-Za-z0-9]|_|g'`";[ -n "`eval echo '${'"$__vnm"'+.}'`" ]||{ [ -z "$__addsubst_" ] || __addsubst="$__addsubst
"
__addsubst="${__addsubst}s%@xtools_targets@%%g";__addsubst_=+
[ -z "$verbose" ] || echo "	setting xtools_targets to \"$xtools_targets\""
eval `echo "$__vnm=''"|sed "s%=''\(.\)%=\"'\"'\1%;s%\([^=]\)''\$%\1'\"'\"%"`;}

   __vnm="__`echo "XTOOLS_OBJS" | sed 's|[^A-Za-z0-9]|_|g'`";[ -n "`eval echo '${'"$__vnm"'+.}'`" ]||{ [ -z "$__addsubst_" ] || __addsubst="$__addsubst
"
__addsubst="${__addsubst}s%@XTOOLS_OBJS@%%g";__addsubst_=+
[ -z "$verbose" ] || echo "	setting XTOOLS_OBJS to \"$XTOOLS_OBJS\""
eval `echo "$__vnm=''"|sed "s%=''\(.\)%=\"'\"'\1%;s%\([^=]\)''\$%\1'\"'\"%"`;}

   __vnm="__`echo "CPP_WITH_X" | sed 's|[^A-Za-z0-9]|_|g'`";[ -n "`eval echo '${'"$__vnm"'+.}'`" ]||{ [ -z "$__addsubst_" ] || __addsubst="$__addsubst
"
__addsubst="${__addsubst}s%@CPP_WITH_X@%%g";__addsubst_=+
[ -z "$verbose" ] || echo "	setting CPP_WITH_X to \"$CPP_WITH_X\""
eval `echo "$__vnm=''"|sed "s%=''\(.\)%=\"'\"'\1%;s%\([^=]\)''\$%\1'\"'\"%"`;}

}
test "$with_psm_monitor" = 1 || {
   psm_mon=
   __vnm="__`echo "PSM_MON.o" | sed 's|[^A-Za-z0-9]|_|g'`";[ -n "`eval echo '${'"$__vnm"'+.}'`" ]||{ [ -z "$__addsubst_" ] || __addsubst="$__addsubst
"
__addsubst="${__addsubst}s%@PSM_MON.o@%$psm_mon%g";__addsubst_=+
[ -z "$verbose" ] || echo "	setting PSM_MON.o to \"$psm_mon\""
eval `echo "$__vnm='$psm_mon'"|sed "s%=''\(.\)%=\"'\"'\1%;s%\([^=]\)''\$%\1'\"'\"%"`;}

   __vnm="__`echo "CPP_WITH_MON" | sed 's|[^A-Za-z0-9]|_|g'`";[ -n "`eval echo '${'"$__vnm"'+.}'`" ]||{ [ -z "$__addsubst_" ] || __addsubst="$__addsubst
"
__addsubst="${__addsubst}s%@CPP_WITH_MON@%%g";__addsubst_=+
[ -z "$verbose" ] || echo "	setting CPP_WITH_MON to \"$CPP_WITH_MON\""
eval `echo "$__vnm=''"|sed "s%=''\(.\)%=\"'\"'\1%;s%\([^=]\)''\$%\1'\"'\"%"`;}

   __vnm="__`echo "MON_LDFLAG" | sed 's|[^A-Za-z0-9]|_|g'`";[ -n "`eval echo '${'"$__vnm"'+.}'`" ]||{ [ -z "$__addsubst_" ] || __addsubst="$__addsubst
"
__addsubst="${__addsubst}s%@MON_LDFLAG@%%g";__addsubst_=+
[ -z "$verbose" ] || echo "	setting MON_LDFLAG to \"$MON_LDFLAG\""
eval `echo "$__vnm=''"|sed "s%=''\(.\)%=\"'\"'\1%;s%\([^=]\)''\$%\1'\"'\"%"`;}

}
test "$with_joyce" = 1 || {
   __vnm="__`echo "SYNC_OBJS" | sed 's|[^A-Za-z0-9]|_|g'`";[ -n "`eval echo '${'"$__vnm"'+.}'`" ]||{ [ -z "$__addsubst_" ] || __addsubst="$__addsubst
"
__addsubst="${__addsubst}s%@SYNC_OBJS@%%g";__addsubst_=+
[ -z "$verbose" ] || echo "	setting SYNC_OBJS to \"$SYNC_OBJS\""
eval `echo "$__vnm=''"|sed "s%=''\(.\)%=\"'\"'\1%;s%\([^=]\)''\$%\1'\"'\"%"`;}

   __vnm="__`echo "JOYCE_OBJS" | sed 's|[^A-Za-z0-9]|_|g'`";[ -n "`eval echo '${'"$__vnm"'+.}'`" ]||{ [ -z "$__addsubst_" ] || __addsubst="$__addsubst
"
__addsubst="${__addsubst}s%@JOYCE_OBJS@%%g";__addsubst_=+
[ -z "$verbose" ] || echo "	setting JOYCE_OBJS to \"$JOYCE_OBJS\""
eval `echo "$__vnm=''"|sed "s%=''\(.\)%=\"'\"'\1%;s%\([^=]\)''\$%\1'\"'\"%"`;}

   __OBST_HAVE_JOYCE=x
}
test "$with_xtdsync" = 1 || {
   __vnm="__`echo "XTDSYNC_OBJS" | sed 's|[^A-Za-z0-9]|_|g'`";[ -n "`eval echo '${'"$__vnm"'+.}'`" ]||{ [ -z "$__addsubst_" ] || __addsubst="$__addsubst
"
__addsubst="${__addsubst}s%@XTDSYNC_OBJS@%%g";__addsubst_=+
[ -z "$verbose" ] || echo "	setting XTDSYNC_OBJS to \"$XTDSYNC_OBJS\""
eval `echo "$__vnm=''"|sed "s%=''\(.\)%=\"'\"'\1%;s%\([^=]\)''\$%\1'\"'\"%"`;}

   __OBST_HAVE_XTDSYNC=x
}
test "$with_bsdld" = 1 || {
   __vnm="__`echo "do_libincrld" | sed 's|[^A-Za-z0-9]|_|g'`";[ -n "`eval echo '${'"$__vnm"'+.}'`" ]||{ [ -z "$__addsubst_" ] || __addsubst="$__addsubst
"
__addsubst="${__addsubst}s%@do_libincrld@%%g";__addsubst_=+
[ -z "$verbose" ] || echo "	setting do_libincrld to \"$do_libincrld\""
eval `echo "$__vnm=''"|sed "s%=''\(.\)%=\"'\"'\1%;s%\([^=]\)''\$%\1'\"'\"%"`;}

   __vnm="__`echo "INCRLD_OBJS" | sed 's|[^A-Za-z0-9]|_|g'`";[ -n "`eval echo '${'"$__vnm"'+.}'`" ]||{ [ -z "$__addsubst_" ] || __addsubst="$__addsubst
"
__addsubst="${__addsubst}s%@INCRLD_OBJS@%%g";__addsubst_=+
[ -z "$verbose" ] || echo "	setting INCRLD_OBJS to \"$INCRLD_OBJS\""
eval `echo "$__vnm=''"|sed "s%=''\(.\)%=\"'\"'\1%;s%\([^=]\)''\$%\1'\"'\"%"`;}

}
test "$with_incrld_bsd" = 0 || with_incrld=1
test "$with_incrld" = 1 || {
   __vnm="__`echo "use_libincrld" | sed 's|[^A-Za-z0-9]|_|g'`";[ -n "`eval echo '${'"$__vnm"'+.}'`" ]||{ [ -z "$__addsubst_" ] || __addsubst="$__addsubst
"
__addsubst="${__addsubst}s%@use_libincrld@%%g";__addsubst_=+
[ -z "$verbose" ] || echo "	setting use_libincrld to \"$use_libincrld\""
eval `echo "$__vnm=''"|sed "s%=''\(.\)%=\"'\"'\1%;s%\([^=]\)''\$%\1'\"'\"%"`;}

   __vnm="__`echo "STATIC_LDFLAG" | sed 's|[^A-Za-z0-9]|_|g'`";[ -n "`eval echo '${'"$__vnm"'+.}'`" ]||{ [ -z "$__addsubst_" ] || __addsubst="$__addsubst
"
__addsubst="${__addsubst}s%@STATIC_LDFLAG@%%g";__addsubst_=+
[ -z "$verbose" ] || echo "	setting STATIC_LDFLAG to \"$STATIC_LDFLAG\""
eval `echo "$__vnm=''"|sed "s%=''\(.\)%=\"'\"'\1%;s%\([^=]\)''\$%\1'\"'\"%"`;}

}

#
#  shared object support
#
echo 'processing shared object options'
[ -n "$__shVERSION" ] || {
   v=
   [ -z "$__shVERSIONSEP" ] || \
      v="$__shVERSIONSEP`sed -n -e 's|^#[ 	]*define[ 	]*OBSTVERSIONNO[ 	]*\(.*\)|\1|p' $srcdir/src/obst/obst_config.h.in`$__shVERSIONSEP"0
   { [ -z "$__addsubst_" ] || __addsubst="$__addsubst
"
__addsubst="${__addsubst}s%@shVERSION@%$v%g";__addsubst_=+
[ -z "$verbose" ] || echo "	setting shVERSION to \"$v\""
}
}
[ -n "$__localLIB_sa" ] || {
   v=
   [ -z "$__shSUFF_sa" ] || v='$(libOBST.sa)'
   { [ -z "$__addsubst_" ] || __addsubst="$__addsubst
"
__addsubst="${__addsubst}s%@localLIB.sa@%$v%g";__addsubst_=+
[ -z "$verbose" ] || echo "	setting localLIB.sa to \"$v\""
}
}
[ -n "$__shLDFLAGS" ] || {
   v=
   [ -z "$__LD_DO_RTLPATH" ] || v='$(LD_DO_RTLPATH)$(OBSTLIB):$(libdir):$(OBST_XLIB)'
   { [ -z "$__addsubst_" ] || __addsubst="$__addsubst
"
__addsubst="${__addsubst}s%@shLDFLAGS@%$v%g";__addsubst_=+
[ -z "$verbose" ] || echo "	setting shLDFLAGS to \"$v\""
}
}
test -d "$srcdir/lib/pic" || mkdir "$srcdir/lib/pic"



#
#  read defaults
#
echo 'reading installation defaults'
__fs=
for __f in install_defaults.cnf ""
do if [ -r "$__f" ]; then
      __fs="$__fs $__f"
   elif [ "$__f" != "" ]; then
      ___f=
      for __d in $__defaultdirs
      do [ -r "$__d/$__f" ] && ___f="$__d/$__f"
      done
      if [ -n "$___f" ]; then
	 __fs="$__fs $___f"
      else
	 echo >&2 "*** WARNING:" "file \"$__f\" not found"
      fi
   fi
done
echo "processing configuration file(s)$__fs"
sed -n "s|^[ 	]*\(!\)[ 	]*\([-+_.A-Za-z][-+_.A-Za-z0-9]*\).*|\2 \1 _|p
s|^[ 	]*\([-+_.A-Za-z][-+_.A-Za-z0-9]*\)[ 	]*\([=:]\)[ 	]*\(.*\)|\1 \2 \3|p" $__fs /dev/null\
| { while read name sep val
    do
       vname="__`echo "$name" | sed 's|[^A-Za-z0-9]|_|g'`"
       [ -n "`eval echo '${'"$vname"'+.}'`" ] || {
	  case "$sep" in
	     =) { [ -z "$__addsubst_" ] || __addsubst="$__addsubst
"
__addsubst="${__addsubst}s%@$name@%$val%g";__addsubst_=+
[ -z "$verbose" ] || echo "	setting $name to \"$val\""
}
 ;;
	     :) { 
{
test -n "$verbose" && \
echo "	defining" $name to be $val
echo "#define" $name $val >> confdefs.h
DEFS="$DEFS -D$name=$val"
SEDDEFS="${SEDDEFS}\${SEDdA}$name\${SEDdB}$name\${SEDdC}$val\${SEDdD}
\${SEDuA}$name\${SEDuB}$name\${SEDuC}$val\${SEDuD}
\${SEDeA}$name\${SEDeB}$name\${SEDeC}$val\${SEDeD}
"
}

};;
	  esac
	  __c=`echo "$vname='$val'"|sed "s%=''\(.\)%=\"'\"'\1%;s%\([^=]\)''\$%\1'\"'\"%"`
	  echo "$__c" >> $__tmpf; eval "$__c"
       }
    done
    echo "__addsubst='$__addsubst'
__addsubst_=$__addsubst_
DEFS='$DEFS'
SEDDEFS='$SEDDEFS'" >> $__tmpf
  }
eval "`cat $__tmpf`"


#
#  expand macros with paths into installed module
#
test -n "$exec_prefix" || exec_prefix="$__exec_prefix"
test -n "$prefix" || prefix="$__prefix"
echo > $__tmpf "
prefix=$prefix
exec_prefix=$exec_prefix
cntdir=$__cntdir
libdir=$__libdir
tcllibdir=$__tcllibdir
includedir=$__includedir
_dummy_target: ;@echo '__libdir_exp=\$(libdir);__cntdir_exp=\$(cntdir);__tcllibdir_exp=\$(tcllibdir);__includedir_exp=\$(includedir)'"
eval `make -f $__tmpf`
{ [ -z "$__addsubst_" ] || __addsubst="$__addsubst
"
__addsubst="${__addsubst}s%@libdir_exp@%$__libdir_exp%g";__addsubst_=+
[ -z "$verbose" ] || echo "	setting libdir_exp to \"$__libdir_exp\""
}
{ [ -z "$__addsubst_" ] || __addsubst="$__addsubst
"
__addsubst="${__addsubst}s%@cntdir_exp@%$__cntdir_exp%g";__addsubst_=+
[ -z "$verbose" ] || echo "	setting cntdir_exp to \"$__cntdir_exp\""
}
{ [ -z "$__addsubst_" ] || __addsubst="$__addsubst
"
__addsubst="${__addsubst}s%@tcllibdir_exp@%$__tcllibdir_exp%g";__addsubst_=+
[ -z "$verbose" ] || echo "	setting tcllibdir_exp to \"$__tcllibdir_exp\""
}
{ [ -z "$__addsubst_" ] || __addsubst="$__addsubst
"
__addsubst="${__addsubst}s%@includedir_exp@%$__includedir_exp%g";__addsubst_=+
[ -z "$verbose" ] || echo "	setting includedir_exp to \"$__includedir_exp\""
}


#
#  do the configuration
#
test -n "$exec_prefix" || exec_prefix="$__exec_prefix"
test -n "$prefix" || prefix="$__prefix"
# Set default prefixes.
if test -n "$prefix"; then
  test -z "$exec_prefix" && exec_prefix='${prefix}'
  prsub="s%^prefix\\([ 	]*\\)=\\([ 	]*\\).*$%prefix\\1=\\2$prefix%"
fi
if test -n "$exec_prefix"; then
  prsub="$prsub
s%^exec_prefix\\([ 	]*\\)=\\([ 	]*\\).*$%exec_prefix\\1=\\2$exec_prefix%"
fi
# Quote sed substitution magic chars in DEFS.
cat >conftest.def <<EOF
$DEFS
EOF
escape_ampersand_and_backslash='s%[&\\]%\\&%g'
DEFS=`sed "$escape_ampersand_and_backslash" <conftest.def`
rm -f conftest.def
# Substitute for predefined variables.

trap 'rm -f config.status; exit 1' 1 3 15
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 $configure_args

for arg
do
  case "\$arg" in
    -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
    echo running \${CONFIG_SHELL-/bin/sh} $0 $configure_args
    exec \${CONFIG_SHELL-/bin/sh} $0 $configure_args ;;
    *) echo "Usage: config.status --recheck" 2>&1; exit 1 ;;
  esac
done

trap 'rm -fr Makefile Makefile.bundle include/etc/obst_common.mk bin/obst-instcnt src/obst/obst_config.h src/obst/_obst_config.h conftest*; exit 1' 1 3 15
srcdir_abs='$srcdir_abs'
find_comp='$find_comp'
INSTALL='$INSTALL'
INSTALL_PROGRAM='$INSTALL_PROGRAM'
INSTALL_DATA='$INSTALL_DATA'
LEX='$LEX'
LEXLIB='$LEXLIB'
LN_S='$LN_S'
RANLIB='$RANLIB'
YACC='$YACC'
CPP='$CPP'
__addsubst='$__addsubst'
LIBS='$LIBS'
srcdir='$srcdir'
prefix='$prefix'
exec_prefix='$exec_prefix'
prsub='$prsub'
extrasub='$extrasub'
EOF
cat >> config.status <<\EOF

top_srcdir=$srcdir

CONFIG_FILES=${CONFIG_FILES-"Makefile Makefile.bundle include/etc/obst_common.mk bin/obst-instcnt"}
for file in .. ${CONFIG_FILES}; do if test "x$file" != x..; then
  srcdir=$top_srcdir
  # Remove last slash and all that follows it.  Not all systems have dirname.
  dir=`echo $file|sed 's%/[^/][^/]*$%%'`
  if test "$dir" != "$file"; then
    test "$top_srcdir" != . && srcdir=$top_srcdir/$dir
    test ! -d $dir && mkdir $dir
  fi
  echo creating $file
  rm -f $file
  echo "# Generated automatically from `echo $file|sed 's|.*/||'`.in by configure." > $file
  sed -e "
$prsub
$extrasub
s%@srcdir_abs@%$srcdir_abs%g
s%@find_comp@%$find_comp%g
s%@INSTALL@%$INSTALL%g
s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
s%@INSTALL_DATA@%$INSTALL_DATA%g
s%@LEX@%$LEX%g
s%@LEXLIB@%$LEXLIB%g
s%@LN_S@%$LN_S%g
s%@RANLIB@%$RANLIB%g
s%@YACC@%$YACC%g
s%@CPP@%$CPP%g
$__addsubst
s%@LIBS@%$LIBS%g
s%@srcdir@%$srcdir%g
s%@DEFS@%-DHAVE_CONFIG_H%" $top_srcdir/${file}.in >> $file
fi; done

CONFIG_HEADERS=${CONFIG_HEADERS-"src/obst/obst_config.h src/obst/_obst_config.h"}
for file in .. ${CONFIG_HEADERS}; do if test "x$file" != x..; then
echo creating $file

# These sed commands are put into SEDDEFS when defining a macro.
# They are broken into pieces to make the sed script easier to manage.
# They 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.
# Each defining turns into a single global substitution command.
#
# SEDd sets the value in "#define NAME VALUE" lines.
SEDdA='s@^\([ 	]*\)#\([ 	]*define[ 	][ 	]*\)'
SEDdB='\([ 	][ 	]*\)[^ 	]*@\1#\2'
SEDdC='\3'
SEDdD='@g'
# SEDu turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
SEDuA='s@^\([ 	]*\)#\([ 	]*\)undef\([ 	][ 	]*\)'
SEDuB='\([ 	]\)@\1#\2define\3'
SEDuC=' '
SEDuD='\4@g'
# SEDe turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
SEDeA='s@^\([ 	]*\)#\([ 	]*\)undef\([ 	][ 	]*\)'
SEDeB='$@\1#\2define\3'
SEDeC=' '
SEDeD='@g'
rm -f conftest.sed
EOF
# Turn off quoting long enough to insert the sed commands.
rm -f conftest.sh
cat > conftest.sh <<EOF
$SEDDEFS
EOF

# Break up $SEDDEFS (now in conftest.sh) because some shells have a limit
# on the size of here documents.

# Maximum number of lines to put in a single here document.
maxshlines=9

while :
do
  # wc gives bogus results for an empty file on some systems.
  lines=`grep -c . conftest.sh`
  if test -z "$lines" || test "$lines" -eq 0; then break; fi
  rm -f conftest.s1 conftest.s2
  sed ${maxshlines}q conftest.sh > conftest.s1 # Like head -20.
  sed 1,${maxshlines}d conftest.sh > conftest.s2 # Like tail +21.
  # Write a limited-size here document to append to conftest.sed.
  echo 'cat >> conftest.sed <<CONFEOF' >> config.status
  cat conftest.s1 >> config.status
  echo 'CONFEOF' >> config.status
  rm -f conftest.s1 conftest.sh
  mv conftest.s2 conftest.sh
done
rm -f conftest.sh

# Now back to your regularly scheduled config.status.
cat >> config.status <<\EOF
# This sed command replaces #undef's 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 in
# src/obst/obst_config.h src/obst/_obst_config.h.
cat >> conftest.sed <<\CONFEOF
s,^[ 	]*#[ 	]*undef[ 	][ 	]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */,
CONFEOF
rm -f conftest.h
# Break up the sed commands because old seds have small limits.
maxsedlines=20
cp $top_srcdir/$file.in conftest.h1
while :
do
  lines=`grep -c . conftest.sed`
  if test -z "$lines" || test "$lines" -eq 0; then break; fi
  rm -f conftest.s1 conftest.s2 conftest.h2
  sed ${maxsedlines}q conftest.sed > conftest.s1 # Like head -20.
  sed 1,${maxsedlines}d conftest.sed > conftest.s2 # Like tail +21.
  sed -f conftest.s1 < conftest.h1 > conftest.h2
  rm -f conftest.s1 conftest.h1 conftest.sed
  mv conftest.h2 conftest.h1
  mv conftest.s2 conftest.sed
done
rm -f conftest.sed conftest.h
echo "/* $file.  Generated automatically by configure.  */" > conftest.h
cat conftest.h1 >> conftest.h
rm -f conftest.h1
if cmp -s $file conftest.h 2>/dev/null; then
  # The file exists and we would not be changing it.
  echo "$file is unchanged"
  rm -f conftest.h
else
  rm -f $file
  mv conftest.h $file
fi
fi; done


__tmpf=/tmp/conf$$ig
cp src/obst/obst_config.h $__tmpf;rm -f src/obst/obst_config.h;sed 's|UNDEF|undef|' $__tmpf >src/obst/obst_config.h
rm -f $__tmpf

	    __tmpf=/tmp/conf$$ig
for __f in bin/obst-instcnt ""
do test -f "$__f" && {
      cp "$__f" $__tmpf;rm -f "$__f"
      echo '#!/bin/sh' | cat - $__tmpf > "$__f"
      chmod a+x "$__f"
   }
done
rm -f $__tmpf


exit 0
EOF
chmod +x config.status
${CONFIG_SHELL-/bin/sh} config.status
rm -rf $__tmpf*

