#!/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/interface/_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_tclINCS=
ADD_tclLIBS=
 ADD_tkINCS=
 ADD_tkLIBS=
with_arrows=1

test -n "$with_tclx" || with_tclx=0

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

Set compilation and installation parameters for tclOBST 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):

  --obst-includes=<d>   Search for OBST header files foremost in <d>.
  --obst-libraries=<d>  Search for OBST libraries formost in <d>.  

  --tcl-includes=<d>	Search for TCL header files foremost in <d>.
  --tcl-libraries=<d>   Search for TCL libraries foremost in <d>.

  --tk-includes=<d>	Search for TK header files foremost in <d>.
  --tk-libraries=<d>    Search for TK libraries foremost in <d>.

  --with-tclx		Create wish based on Extended Tcl.
  --without-tclx	Create wish based on standard tcl/tk [default].

  --with-arrows		Add arrows extension to tcl/tk shells [default].
  --without-arrows	Do not add the arrows extension to tcl/tk shells.

  --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
ADD_obstINCS=;ADD_obstLIBS=;srcdir_abs="`(cd $srcdir; pwd | sed 's|/tmp_mnt||')`" 
__defaultdirs="$srcdir/include/etc";__tmpf=/tmp/conf$$ig
for opt in $* ""
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`"
	;;
--obst-includes=*)  ADD_obstINCS="$ADD_obstINCS `echo "$opt" | sed 's|[^=]*=\(.*\)|\1|'`" ;;
   --obst-libraries=*) ADD_obstLIBS="$ADD_obstLIBS `echo "$opt" | sed 's|[^=]*=\(.*\)|\1|'`" ;;
--tcl-includes=*)    ADD_tclINCS="$ADD_tclINCS `echo "$opt" | sed 's|[^=]*=\(.*\)|\1|'`"	;;
   --tcl-libraries=*)   ADD_tclLIBS="$ADD_tclLIBS `echo "$opt" | sed 's|[^=]*=\(.*\)|\1|'`"	;;
   --tk-includes=*)      ADD_tkINCS="$ADD_tkINCS `echo "$opt" | sed 's|[^=]*=\(.*\)|\1|'`"	;;
   --tk-libraries=*)     ADD_tkLIBS="$ADD_tkLIBS `echo "$opt" | sed 's|[^=]*=\(.*\)|\1|'`"	;;

   esac
done
echo 'checking for OBST'
test -n "$__OBSTINC" || {
   if test -n "$SOSV_VERSION_PATH"; then
      __op=$SOSV_VERSION_PATH
elif test -z "$ADD_obstINCS"; then
      if test -z "$__op"; then
  # Extract the first word of `bundle', so it can be a program name with args.
  set dummy bundle; 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
      __op="`echo $dir|sed 's|/[^/]*$||'`"
      break
    fi
  done
  IFS="$saveifs"
fi

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

   fi
   __OBSTINC=;for __d in $ADD_obstINCS $__op/include
do for __f in $__d/obst.h
   do [ -r "$__f" ] && { __OBSTINC="$__d"; break 2; }
   done
done

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

   { [ -z "$__addsubst_" ] || __addsubst="$__addsubst
"
__addsubst="${__addsubst}s%@OBSTINC@%$__OBSTINC%g";__addsubst_=+
[ -z "$verbose" ] || echo "	setting OBSTINC to \"$__OBSTINC\""
}
}
test -n "$__OBSTLIB" || {
   if test -n "$SOSV_VERSION_PATH"; then
      __op="$SOSV_VERSION_PATH/lib/*"
   elif test -n "$__OBSTINC"; then
      __op="`echo $__OBSTINC|sed 's|/[^/]*$||'`/lib"
elif test -z "$ADD_obstLIBS"; then
      if test -z "$__op"; then
  # Extract the first word of `bundle', so it can be a program name with args.
  set dummy bundle; 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
      __op="`echo $dir|sed 's|/[^/]*$||'`"
      break
    fi
  done
  IFS="$saveifs"
fi

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

      __op="$__op/lib"
   fi
   __OBSTLIB=;for __d in $ADD_obstLIBS $__op
do for __f in $__d/libOBST.*
   do [ -r "$__f" ] && { __OBSTLIB="$__d"; break 2; }
   done
done

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

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

#
#  checks for programs
#
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




#
#  checks for imported modules: tcl/tk
#
echo 'checking for tcl/tk'

if test -z "$__shPATH"; then
  # Extract the first word of `wish', so it can be a program name with args.
  set dummy wish; 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
      __shPATH="$dir"
      break
    fi
  done
  IFS="$saveifs"
fi

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

__shROOT=
test -z "$__shPATH" || __shROOT="`echo $__shPATH|sed 's|/[^/]*$||'`"
__srcROOT="`echo $srcdir_abs|sed 's|/[^/]*$||'`"

test -n "$__TKINCS" || {
   __dummy_tcl=;for __d in $ADD_tclINCS $__shROOT/include $__srcROOT/tcl7.1 $__srcROOT/tcl7.0 $__srcROOT/tcl7.0b3 $__srcROOT/tcl /usr/local/include
do for __f in $__d/tcl.h
   do [ -r "$__f" ] && { __dummy_tcl="$__d"; break 2; }
   done
done

[ -n "$__dummy_tcl" ] || echo >&2 "*** WARNING:" "couldn't find \"tcl.h\" in \"$ADD_tclINCS $__shROOT/include $__srcROOT/tcl7.1 $__srcROOT/tcl7.0 $__srcROOT/tcl7.0b3 $__srcROOT/tcl /usr/local/include\""
__vnm="__`echo "__dummy_tcl" | sed 's|[^A-Za-z0-9]|_|g'`";[ -n "`eval echo '${'"$__vnm"'+.}'`" ]||{ [ -z "$__addsubst_" ] || __addsubst="$__addsubst
"
__addsubst="${__addsubst}s%@__dummy_tcl@%$__dummy_tcl%g";__addsubst_=+
[ -z "$verbose" ] || echo "	setting __dummy_tcl to \"$__dummy_tcl\""
eval `echo "$__vnm='$__dummy_tcl'"|sed "s%=''\(.\)%=\"'\"'\1%;s%\([^=]\)''\$%\1'\"'\"%"`;}


   __dummy_tk=;for __d in $ADD_tkINCS $__dummy_tcl $__shROOT/include $__srcROOT/tk3.4 $__srcROOT/tk3.3 $__srcROOT/tk3.3b3 $__srcROOT/tk /usr/local/include
do for __f in $__d/tk.h
   do [ -r "$__f" ] && { __dummy_tk="$__d"; break 2; }
   done
done

[ -n "$__dummy_tk" ] || echo >&2 "*** WARNING:" "couldn't find \"tk.h\" in \"$ADD_tkINCS $__dummy_tcl $__shROOT/include $__srcROOT/tk3.4 $__srcROOT/tk3.3 $__srcROOT/tk3.3b3 $__srcROOT/tk /usr/local/include\""
__vnm="__`echo "__dummy_tk" | sed 's|[^A-Za-z0-9]|_|g'`";[ -n "`eval echo '${'"$__vnm"'+.}'`" ]||{ [ -z "$__addsubst_" ] || __addsubst="$__addsubst
"
__addsubst="${__addsubst}s%@__dummy_tk@%$__dummy_tk%g";__addsubst_=+
[ -z "$verbose" ] || echo "	setting __dummy_tk to \"$__dummy_tk\""
eval `echo "$__vnm='$__dummy_tk'"|sed "s%=''\(.\)%=\"'\"'\1%;s%\([^=]\)''\$%\1'\"'\"%"`;}


   test -z "$__dummy_tk" || __TKINCS="-I$__dummy_tk"
   test -z "$__dummy_tcl" || {
      if test -z "$__TKINCS"; then
	 __TKINCS="-I$__dummy_tcl"
      elif test "$__dummy_tk" != "$__dummy_tcl"; then
	 __TKINCS="$__TKINCS -I$__dummy_tcl"
      fi
   }
   { [ -z "$__addsubst_" ] || __addsubst="$__addsubst
"
__addsubst="${__addsubst}s%@TKINCS@%$__TKINCS%g";__addsubst_=+
[ -z "$verbose" ] || echo "	setting TKINCS to \"$__TKINCS\""
}

}
test -n "$__TKLIBS" || {
   __dummy_tcl=;for __d in $ADD_tclLIBS $__shROOT/lib $__srcROOT/tcl7.1 $__srcROOT/tcl7.0 $__srcROOT/tcl7.0b3 $__srcROOT/tcl /usr/local/lib
do for __f in $__d/libtcl*
   do [ -r "$__f" ] && { __dummy_tcl="$__d"; break 2; }
   done
done

[ -n "$__dummy_tcl" ] || echo >&2 "*** WARNING:" "couldn't find \"libtcl*\" in \"$ADD_tclLIBS $__shROOT/lib $__srcROOT/tcl7.1 $__srcROOT/tcl7.0 $__srcROOT/tcl7.0b3 $__srcROOT/tcl /usr/local/lib\""
__vnm="__`echo "__dummy_tcl" | sed 's|[^A-Za-z0-9]|_|g'`";[ -n "`eval echo '${'"$__vnm"'+.}'`" ]||{ [ -z "$__addsubst_" ] || __addsubst="$__addsubst
"
__addsubst="${__addsubst}s%@__dummy_tcl@%$__dummy_tcl%g";__addsubst_=+
[ -z "$verbose" ] || echo "	setting __dummy_tcl to \"$__dummy_tcl\""
eval `echo "$__vnm='$__dummy_tcl'"|sed "s%=''\(.\)%=\"'\"'\1%;s%\([^=]\)''\$%\1'\"'\"%"`;}


   __dummy_tk=;for __d in $ADD_tkLIBS $__dummy_tcl $__shROOT/lib $__srcROOT/tk3.4 $__srcROOT/tk3.3 $__srcROOT/tk3.3b3 $__srcROOT/tk /usr/local/lib
do for __f in $__d/libtk*
   do [ -r "$__f" ] && { __dummy_tk="$__d"; break 2; }
   done
done

[ -n "$__dummy_tk" ] || echo >&2 "*** WARNING:" "couldn't find \"libtk*\" in \"$ADD_tkLIBS $__dummy_tcl $__shROOT/lib $__srcROOT/tk3.4 $__srcROOT/tk3.3 $__srcROOT/tk3.3b3 $__srcROOT/tk /usr/local/lib\""
__vnm="__`echo "__dummy_tk" | sed 's|[^A-Za-z0-9]|_|g'`";[ -n "`eval echo '${'"$__vnm"'+.}'`" ]||{ [ -z "$__addsubst_" ] || __addsubst="$__addsubst
"
__addsubst="${__addsubst}s%@__dummy_tk@%$__dummy_tk%g";__addsubst_=+
[ -z "$verbose" ] || echo "	setting __dummy_tk to \"$__dummy_tk\""
eval `echo "$__vnm='$__dummy_tk'"|sed "s%=''\(.\)%=\"'\"'\1%;s%\([^=]\)''\$%\1'\"'\"%"`;}


   test -z "$__dummy_tk" || __TKLIBS="-L$__dummy_tk"
   test -z "$__dummy_tcl" || {
      if test -z "$__TKLIBS"; then
	 __TKLIBS="-L$__dummy_tcl"
      elif test "$__dummy_tk" != "$__dummy_tcl"; then
	 __TKLIBS="$__TKLIBS -L$__dummy_tcl"
      fi
   }
   { [ -z "$__addsubst_" ] || __addsubst="$__addsubst
"
__addsubst="${__addsubst}s%@TKLIBS@%$__TKLIBS%g";__addsubst_=+
[ -z "$verbose" ] || echo "	setting TKLIBS to \"$__TKLIBS\""
}

}
test -n "$__TKVSUFF" || {
   __dummy_tk=;for __d in `echo "$__TKINCS" | sed 's|-I||g'`
do for __f in $__d/tk.h
   do [ -r "$__f" ] && { __dummy_tk="$__d"; break 2; }
   done
done


   test -z "$__dummy_tk" || {
      __TKVSUFF="`egrep TK_VERSION $__dummy_tk/tk.h | sed 's|[^0-9]||g'`"
      { [ -z "$__addsubst_" ] || __addsubst="$__addsubst
"
__addsubst="${__addsubst}s%@TKVSUFF@%$__TKVSUFF%g";__addsubst_=+
[ -z "$verbose" ] || echo "	setting TKVSUFF to \"$__TKVSUFF\""
}

   }
}
test    -r $__dummy_tk/tclExtend.h\
     -o -r $__dummy_tcl/tclExtend.h || {
   __V='#'
   __vnm="__`echo "do_tclXmain" | sed 's|[^A-Za-z0-9]|_|g'`";[ -n "`eval echo '${'"$__vnm"'+.}'`" ]||{ [ -z "$__addsubst_" ] || __addsubst="$__addsubst
"
__addsubst="${__addsubst}s%@do_tclXmain@%$__V%g";__addsubst_=+
[ -z "$verbose" ] || echo "	setting do_tclXmain to \"$__V\""
eval `echo "$__vnm='$__V'"|sed "s%=''\(.\)%=\"'\"'\1%;s%\([^=]\)''\$%\1'\"'\"%"`;}

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

}


#
#  shared object support
#
echo 'processing shared object options'
__f=$__OBSTINC/etc/obst_common.mk
if test -r "$__f"; then
   __shSUFF_sa="`sed -n -e 's|^[ 	]*shSUFF.sa[ 	]*=[ 	]*\(.*\)|\1|p' $__f`"
   __LD_DO_RTLPATH="`sed -n -e 's|^[ 	]*LD_DO_RTLPATH[ 	]*=[ 	]*\(.*\)|\1|p' $__f`"
   __shVERSIONSEP="`sed -n -e 's|^[ 	]*shVERSIONSEP[ 	]*=[ 	]*\(.*\)|\1|p' $__f`"
else
   echo >&2 "*** WARNING:" "can't read file \"$__f\""
fi
[ -n "$__shVERSION" ] || {
   v=
   [ -z "$__shVERSIONSEP" ] || \
      v="$__shVERSIONSEP`sed -n -e 's|^#[ 	]*define[ 	]*C2OBST_VERSION_NO[ 	]*\(.*\)|\1|p' $srcdir/src/interface/_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=''
   { [ -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)$(myLIB):$(libdir):$(OBSTLIB):$(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"



#
#  process module switches
#
echo 'processing module switches'
case "$__TKVSUFF" in
   2*|3[0123])
      test "$__TKVSUFF" = '33' || {
	 __V='#'
	 __vnm="__`echo "do_tclMain" | sed 's|[^A-Za-z0-9]|_|g'`";[ -n "`eval echo '${'"$__vnm"'+.}'`" ]||{ [ -z "$__addsubst_" ] || __addsubst="$__addsubst
"
__addsubst="${__addsubst}s%@do_tclMain@%$__V%g";__addsubst_=+
[ -z "$verbose" ] || echo "	setting do_tclMain to \"$__V\""
eval `echo "$__vnm='$__V'"|sed "s%=''\(.\)%=\"'\"'\1%;s%\([^=]\)''\$%\1'\"'\"%"`;}

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

      __vnm="__`echo "t2o_TCLX_OLDSTYLE" | sed 's|[^A-Za-z0-9]|_|g'`";[ -n "`eval echo '${'"$__vnm"'+.}'`" ]||{ 
{
test -n "$verbose" && \
echo "	defining" t2o_TCLX_OLDSTYLE to be empty
echo "#define" t2o_TCLX_OLDSTYLE  >> confdefs.h
DEFS="$DEFS -Dt2o_TCLX_OLDSTYLE="
SEDDEFS="${SEDDEFS}\${SEDdA}t2o_TCLX_OLDSTYLE\${SEDdB}t2o_TCLX_OLDSTYLE\${SEDdC}\${SEDdD}
\${SEDuA}t2o_TCLX_OLDSTYLE\${SEDuB}t2o_TCLX_OLDSTYLE\${SEDuC}\${SEDuD}
\${SEDeA}t2o_TCLX_OLDSTYLE\${SEDeB}t2o_TCLX_OLDSTYLE\${SEDeC}\${SEDeD}
"
}

eval `echo "$__vnm=''"|sed "s%=''\(.\)%=\"'\"'\1%;s%\([^=]\)''\$%\1'\"'\"%"`;}
      __vnm="__`echo "t2o_TCLX_intMain" | sed 's|[^A-Za-z0-9]|_|g'`";[ -n "`eval echo '${'"$__vnm"'+.}'`" ]||{ 
{
test -n "$verbose" && \
echo "	defining" t2o_TCLX_intMain to be empty
echo "#define" t2o_TCLX_intMain  >> confdefs.h
DEFS="$DEFS -Dt2o_TCLX_intMain="
SEDDEFS="${SEDDEFS}\${SEDdA}t2o_TCLX_intMain\${SEDdB}t2o_TCLX_intMain\${SEDdC}\${SEDdD}
\${SEDuA}t2o_TCLX_intMain\${SEDuB}t2o_TCLX_intMain\${SEDuC}\${SEDuD}
\${SEDeA}t2o_TCLX_intMain\${SEDeB}t2o_TCLX_intMain\${SEDeC}\${SEDeD}
"
}

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

      __vnm="__`echo "t2o_TCLX_APPINIT" | sed 's|[^A-Za-z0-9]|_|g'`";[ -n "`eval echo '${'"$__vnm"'+.}'`" ]||{ 
{
test -n "$verbose" && \
echo "	defining" t2o_TCLX_APPINIT to be empty
echo "#define" t2o_TCLX_APPINIT  >> confdefs.h
DEFS="$DEFS -Dt2o_TCLX_APPINIT="
SEDDEFS="${SEDDEFS}\${SEDdA}t2o_TCLX_APPINIT\${SEDdB}t2o_TCLX_APPINIT\${SEDdC}\${SEDdD}
\${SEDuA}t2o_TCLX_APPINIT\${SEDuB}t2o_TCLX_APPINIT\${SEDuC}\${SEDuD}
\${SEDeA}t2o_TCLX_APPINIT\${SEDeB}t2o_TCLX_APPINIT\${SEDeC}\${SEDeD}
"
}

eval `echo "$__vnm=''"|sed "s%=''\(.\)%=\"'\"'\1%;s%\([^=]\)''\$%\1'\"'\"%"`;}
      __vnm="__`echo "t2o_TCLX_intMain" | sed 's|[^A-Za-z0-9]|_|g'`";[ -n "`eval echo '${'"$__vnm"'+.}'`" ]||{ 
{
test -n "$verbose" && \
echo "	defining" t2o_TCLX_intMain to be empty
echo "#define" t2o_TCLX_intMain  >> confdefs.h
DEFS="$DEFS -Dt2o_TCLX_intMain="
SEDDEFS="${SEDDEFS}\${SEDdA}t2o_TCLX_intMain\${SEDdB}t2o_TCLX_intMain\${SEDdC}\${SEDdD}
\${SEDuA}t2o_TCLX_intMain\${SEDuB}t2o_TCLX_intMain\${SEDuC}\${SEDuD}
\${SEDeA}t2o_TCLX_intMain\${SEDeB}t2o_TCLX_intMain\${SEDeC}\${SEDeD}
"
}

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

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

      ;;
esac
( cd $srcdir/sample/lib
  rm -f tcl
  if test "$__TKVSUFF" = 23; then
     $LN_S ../tcl-2.3 .
  else
     $LN_S ../tcl .
  fi
)
test "$with_tclx" = 1 || {
   __V='#'
   __vnm="__`echo "do_WISHx" | sed 's|[^A-Za-z0-9]|_|g'`";[ -n "`eval echo '${'"$__vnm"'+.}'`" ]||{ [ -z "$__addsubst_" ] || __addsubst="$__addsubst
"
__addsubst="${__addsubst}s%@do_WISHx@%$__V%g";__addsubst_=+
[ -z "$verbose" ] || echo "	setting do_WISHx to \"$__V\""
eval `echo "$__vnm='$__V'"|sed "s%=''\(.\)%=\"'\"'\1%;s%\([^=]\)''\$%\1'\"'\"%"`;}

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

}


#
#  read 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.shells $srcdir/include/etc/t2o_common.mk $srcdir/sample/Makefile src/interface/_config.h src/shells/t2o_init.h conftest*; exit 1' 1 3 15
srcdir_abs='$srcdir_abs'
__op='$__op'
LN_S='$LN_S'
__shPATH='$__shPATH'
__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.shells $srcdir/include/etc/t2o_common.mk $srcdir/sample/Makefile"}
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%@__op@%$__op%g
s%@LN_S@%$LN_S%g
s%@__shPATH@%$__shPATH%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/interface/_config.h src/shells/t2o_init.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/interface/_config.h src/shells/t2o_init.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



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

