#! /bin/sh


###
### This is a configuration script for PBS, it is generated
### automatically from a configure.in file using the autoconf program.
### It is not necessary to regenerate this script unless you are
### a developer making significant changes to the organization of PBS.
###
### To rebuild this configure script (probably unnecessary) run the command:
###     autoconf
### from within this directory. This script depends on autoconf version
### 2.0 or later.

###
### If you are building the PBS distribution then you should run the
### shell script generated by autoconf in the directory where the
### actual build tree will reside. This is not necessarily the 
### directory containing the source tree. You will probably do
### something like:
###    cd to/my/build/dir
###    /path/of/my/source/dir/configure optional_args
###
### configure should be able to figure things out on its own 
### without any optional arguments. If your directory structure or
### environment is strange configure might fail to find things that
### it needs. You may then want to use the various arguments, including
### the (hopefully) useful:
###    /path/of/my/source/dir/configure --help
###     
### Specifying --help will list all available options for the
### configure script.
###
### Configuration and build system for PBS written
###  by Lonhyn T. Jasinskyj (lonhyn@nas.nasa.gov)
###
### (credit for the inspiration for some of this is due to the work of
###  Martin Buchholz who autoconf'ed XEmacs)
###













































# Guess values for system-dependent variables and create Makefiles.
# Generated automatically using autoconf version 2.12 
# 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

  --disable-docs          Don't install the manpages."

ac_help="$ac_help

  --enable-server         build/not build the server. Can be used to disable
                          the building of the server. Normally all components
                          (docs, server, mom, clients) are built."
ac_help="$ac_help

  --enable-mom            build/not build the mom."
ac_help="$ac_help

  --enable-clients        build/not build the clients."
ac_help="$ac_help

  --with-tcl=DIR_PREFIX   Use this if you want Tcl support. If you are
                          compiling with tclx then you need only use
                          the --with-tcl flag if the Tcl libraries
                          are in a different place than the tclx 
                          libraries. The prefix given here
                          should be something like \"/usr/local\"."
ac_help="$ac_help

  --with-tclx=DIR_PREFIX  Use this if you want TclX support. This implies
                          --with-tcl. The only time it is useful
                          to give both flags is if TclX and Tcl are
                          in two different places. If no DIR_PREFIX
                          is given then the libraries and includes
                          must be installed in places automatically
                          searched by system tools."
ac_help="$ac_help

  --enable-gui            build the xpbs GUI. This is on by default but
                          can be turned off with --disable-gui."
ac_help="$ac_help

  --set-cc=ccprog         set the compiler to use. This will be used to set
                          the CC variable and will override any CC setting
                          in the environment. If only \"--set-cc\" is given
                          then CC will be set to \"cc\"."
ac_help="$ac_help

  --set-cflags=flags      set the compiler flags. This will be used to set
                          the CFLAGS variable. If only \"--set-flags\" is given
                          then CFLAGS will be set to \"\". Normally the flag
                          settings are guessed by configure to be those
                          appropriate for the architecture, compiler,
                          and PBS machine type."
ac_help="$ac_help

  --enable-debug          turn on the DEBUG flag. Off by default."
ac_help="$ac_help

  --set-tmpdir=DIR        set the tmp directory that pbs_mom will use.
                          This is a Cray-specific feature.
                          This will default to \"/tmp\"."
ac_help="$ac_help

  --set-server-home=DIR  set the server home/spool directory for PBS use
                          this will default to /usr/spool/PBS if unspecified"
ac_help="$ac_help

  --set-server-name-file=FILE
                          set the file that will contain the name of
                          the default server for clients to use. If this
                          is not an absolute pathname, it will be evaluated
                          relative to the server home directory that either
                          defaults to /usr/spool/PBS or is set using
                          the --set-server-home option to configure. If this
                          option is not specified, the default name for
                          this file will be set to \"server_name\"."
ac_help="$ac_help

  --set-default-server=HOSTNAME
                          set the name of the computer that clients will
                          access when no machine name is specified as part
                          of the queue name. It defaults to the hostname
                          of the machine on which PBS is being compiled.
                          DO NOT SET THIS TO 'localhost'"
ac_help="$ac_help

  --set-environ=PATH      set the path containing the environment variables
                          for the daemons.  For SP2 and AIX systems,
                          suggest setting to /etc/environment. Defaults
                          to the file "pbs_environment" in the server-home.
                          Relative paths are interpreted within the context
                          of the server-home."
ac_help="$ac_help

  --enable-plock-daemons  enable daemons to lock themselves into memory:
                          logical-or of 1 for pbs_server, 2 for pbs_scheduler,
                          4 for pbs_mom. (e.g. set to 7 for all three)"
ac_help="$ac_help

  --disable-syslog        disable the use of syslog for error reporting"

ac_help="$ac_help

  --set-sched=TYPE        sets the scheduler type. If TYPE is
                          \"c\" the scheduler will be written in C
                          \"tcl\" the server will use a Tcl based scheduler
                          \"basl\" will use the rule based scheduler
                          \"no\" then their will be no scheduling done
                          (the \"c\" scheduler is the default)"
ac_help="$ac_help

  --set-sched-code=PATH
                          sets the name of the file or directory where
                          the code for the scheduler is to be found.
                          This only applies to BASL schedulers and those
                          written in the C language. For C schedulers
                          this should be a directory name and for BASL
                          schedulers a filename ending in \".basl\". If the
                          path given is not absolute, it will be interpreted
                          relative to srctree/src/schedulers.SCHD_TYPE/samples.
                          As an example, an appropriate BASL scheduler
                          realtive path would be \"nas.basl\". The default
                          scheduler code for \"C\" schedulers is \"fifo\"."
ac_help="$ac_help

  --set-mansuffix=CHAR	set the man page suffix letter
			this will default to \"B\" if unspecified"
ac_help="$ac_help

  --set-tclatrsep=CHAR	set the Tcl attribute separator character
			this will default to \".\" if unspecified"
ac_help="$ac_help

  --set-qstatrc-file=FILE
                          set the name of the file that qstat will use
                          if there is no \".qstatrc\" file in the directory
                          where it is being invoked.
                          Relative path names will be evaluated 
                          relative to the server home directory that either
                          defaults to /usr/spool/PBS or is set using
                          the --set-server-home option to configure. If this
                          option is not specified, the default name for
                          this file will be set to \"qstatrc\" (no dot)
                          in the server home directory."
ac_help="$ac_help

  --with-scp	use scp program to perform file delivery"
ac_help="$ac_help

  --enable-shell-pipe     enable (default) this if you want to have the name of
                          the job script passed to the shell via a pipe. If 
                          disabled, the behavior is to give the script file
			  as standard input"
ac_help="$ac_help
  --enable-shell-use-argv enable this to put the job script name on the
                          command line that invokes the shell.  Not on by
                          default.  Ignores --enable-shell-pipe setting."
ac_help="$ac_help
  --enable-rpp            use RPP/UDP for resource queries from PBS server to mom.
                          This is enabled by default. If disabled TCP is used."
ac_help="$ac_help

  --enable-sp2            setting this informs PBS that it is being
                          built for an SP2."
ac_help="$ac_help

  --enable-tcl-qstat      setting this builds qstat with Tcl interpreter
                          features. This is normally disabled and is only
                          valid if --with-tcl(x) is already present."
ac_help="$ac_help

  --enable-array          setting this under IRIX enables the SGI Origin 2000
                          parallel support. Normally autodetected from
                          the /etc/config/array file."
ac_help="$ac_help

  --enable-nodemask       setting this nodemask-based scheduling
                          on the Origin 2000."
ac_help="$ac_help

  --enable-pemask       setting this enables pemask-based scheduling
                        on the Cray T3e."
ac_help="$ac_help

  --enable-srfs           on the Crays you can enable support of SRFS
                          This is disabled by default"
ac_help="$ac_help

  --enable-depend-cache   this turns on the ability to cache makedepend
                          information across runs of configure. This can
                          be bad if the user makes certain configuration
                          changes in rerunning configure but it can save
                          significant amounts of time in the hands of
                          experienced developers. Changing the contents
                          of Makefile.in will flush the cache in that
                          directory.
                          This is disabled by default"
ac_help="$ac_help

  --enable-filesync       enable file system blocking until data is physically 
                          written to the disk.  Filesync enabled is more reliable
                          but may lead to server delays in larger systems. 
                          filesync is disabled by default"

ac_help="$ac_help

  --enable-wordexp        enable word expansion on file paths used in job stagein,
                          stageout, and standard out/err files.  Requires that
                          your libc implementation provides wordexp() and wordexp.h"

ac_help="$ac_help

  --maildomain=MAILDOMAIN override the default domain for outgoing mail messages,
                          i.e. \"user@maildomain\".  The default maildomain is the
                          hostname where the job was submitted from"

ac_help="$ac_help

  --disable-spool         if set, TORQUE will create output and error files directly 
                          in \$HOME/.pbs_spool if it exists or in \$HOME otherwise.
                          By default, TORQUE will spool files in \$TORQUEHOME/spool 
                          and copy them to the users home directory when the job
                          completes"

# 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=
# 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" ;;

  -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" ;;

  -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]
  --datadir=DIR           read-only architecture-independent data in DIR
                          [PREFIX/share]
  --libdir=DIR            object code libraries in DIR [EPREFIX/lib]
  --includedir=DIR        C header files in DIR [PREFIX/include]
  --mandir=DIR            man documentation in DIR [PREFIX/man]
  --srcdir=DIR            find the sources in DIR [configure dir or ..]
EOF
    cat << EOF
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 ;;

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

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

  -maildomain | --maildomain)
    ac_prev=maildomain ;;
  -maildomain=* | --maildomain=*)
    maildomain="$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 ;;

  -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
    ac_prev=prefix ;;
  -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
    prefix="$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" ;;

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

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

  -version | --version | --versio | --versi | --vers)
    echo "configure generated by autoconf version 2.12"
    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-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" ;;

  
  -set-* | --set-*)
    ac_package=`echo $ac_option|sed -e 's/-*set-//' -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 "set_${ac_package}='$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=src/cmds/qrun.c

# 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 $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross

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





###
### The following progname setting lines are blatantly stolen from XEmacs
### Much of the other code here is inspired by things in the XEmacs 
### configure.in file.
###

### Remove any more than one leading "." element from the path name.
### If we don't remove them, then another "./" will be prepended to
### the file name each time we use config.status, and the program name
### will get larger and larger.  This wouldn't be a problem, except
### that since progname gets recorded in all the Makefiles this script
### produces, move-if-change thinks they're different when they're
### not.
###
### It would be nice if we could put the ./ in a \( \) group and then
### apply the * operator to that, so we remove as many leading ./././'s
### as are present, but some seds (like Ultrix's sed) don't allow you to
### apply * to a \( \) group.  Bleah.
progname="`echo $0 | sed 's:^\./\./:\./:'`"



ac_aux_dir=
for ac_dir in $srcdir/buildutils $srcdir/$srcdir/buildutils; 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/buildutils $srcdir/$srcdir/buildutils" 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.

mach_script=$ac_aux_dir/pbs_mach_type
PBS_MKDIRS=buildutils/pbs_mkdirs



# Make sure we can run config.sub.
if $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:741: checking host system type" >&5

host_alias=$host
case "$host_alias" in
NONE)
  case $nonopt in
  NONE)
    if host_alias=`$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=`$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



progname="`echo $0 | sed 's:^\./\./:\./:'`"


guesssys=`echo $progname | sed 's/configure$/buildutils\/config.guess/'`
if configuration=`$guesssys | \
  sed 's/^\([^-][^-]*-[^-][^-]*-[^-][^-]*\)-.*$/\1/'` ; then
    :
else
  { echo "configure: error: "Failed to guess the system type, fix buildutils/config.guess"" 1>&2; exit 1; }
fi

if canonical=`$srcdir/buildutils/config.sub "$configuration"` ; then : ; else
  { echo "configure: error: "config.sub failed on $configuration"" 1>&2; exit 1; }
fi



user_set_cc_val=no

# Check whether --set-cc was given.
if test "${set_cc+zzq}" = zzq; then
  setval="$set_cc"
  CC="${setval}"; user_set_cc_val=yes
fi
test "$CC" = yes && { CC=cc; user_set_cc_val=no; }


# Check whether --set-cflags was given.
if test "${set_cflags+zzq}" = zzq; then
  setval="$set_cflags"
  cflags="${setval}"
else
  cflags="not_set"
fi
test "$cflags" = yes && cflags=""

test "$cflags" = not_set || CFLAGS="$cflags"
pbs_save_CFLAGS="$CFLAGS"
# 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:2277: 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="${IFS}:"
  for ac_dir in $PATH; 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:2306: 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="${IFS}:"
  ac_prog_rejected=no
  for ac_dir in $PATH; 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

  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:2354: 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 $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross

cat > conftest.$ac_ext <<EOF
#line 2364 "configure"
#include "confdefs.h"
main(){return(0);}
EOF
if { (eval echo configure:2368: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; 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*

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:2388: 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:2393: 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:2402: \"$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
  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:2417: 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
#    CFLAGS="-g -O2"
    CFLAGS="-g"
  else
#    CFLAGS="-O2"
    CFLAGS=""
  fi
else
  GCC=
  test "${CFLAGS+set}" = set || CFLAGS="-g"
fi

CFLAGS="$pbs_save_CFLAGS"

if test -z "$CFLAGS"; then
        if   test "$GCC" = "yes"; then
#    CFLAGS="-g -O2"
    CFLAGS="-g"
  elif test "$CC" = "xlc"; then
    CFLAGS="-O3 -qstrict -qnoansialias -qlibansi -qinfo -qro -qmaxmem=20000"
  else
    case "$canonical" in
      *-*-irix*) CFLAGS='-O -Wl,-woff,84' ;;
      *-*-hpux*) CFLAGS='-Ae' ;;
      *-*-osf*)  CFLAGS='-std1' ;;
      *-*-solaris2.7) if test -n "`isainfo -kv | grep 64-bit`" ; then
			CFLAGS=-xarch=v9
		      else
			CFLAGS=-O
		      fi ;;
      *)	 CFLAGS="-O" ;;     esac
  fi
fi


# figure out the name of "lib" on this system
# Warning! this is really hacky
libsuff=
case $host_os in
linux-gnu*)
  case "$host_cpu" in
  x86_64*|s390x*)
    echo '#line 819 "configure"' > conftest.$ac_ext
    echo $ac_n "checking name of lib directory""... $ac_c" 1>&6
    if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; then
      case `/usr/bin/file conftest.o` in
      *64-bit*)
        libsuff=64
        ;;
      esac
    fi
    rm -rf conftest*
    echo "$ac_t""lib$libsuff" 1>&6
    ;;
  esac
esac



#
# the default is to build all the executables but not the documents
#
PART_DOCS="doc"
PART_SERVER=server
PART_MOM=mom
PART_CLIENTS=clients

# Check whether --enable-docs or --disable-docs was given.
if test "${enable_docs+set}" = set; then
  enableval="$enable_docs"
  case "${enableval}" in
  yes) PART_DOCS=doc ;;
  no)  PART_DOCS="" ;;
  *) { echo "configure: error: --enable-docs cannot take a value." 1>&2; exit 1; } ;;
esac
fi


# Check whether --enable-server or --disable-server was given.
if test "${enable_server+set}" = set; then
  enableval="$enable_server"
  case "${enableval}" in
  yes) PART_SERVER=server ;;
  no)  PART_SERVER="" ;;
  *) { echo "configure: error: --enable-server cannot take a value." 1>&2; exit 1; } ;;
esac
fi


# Check whether --enable-mom or --disable-mom was given.
if test "${enable_mom+set}" = set; then
  enableval="$enable_mom"
  case "${enableval}" in
  yes) PART_MOM=mom ;;
  no)  PART_MOM="" ;;
  *) { echo "configure: error: --enable-mom cannot take a value." 1>&2; exit 1; } ;;
esac
fi


# Check whether --enable-clients or --disable-clients was given.
if test "${enable_clients+set}" = set; then
  enableval="$enable_clients"
  case "${enableval}" in
  yes) PART_CLIENTS=clients ;;
  no)  PART_CLIENTS="" ;;
  *) { echo "configure: error: --enable-clients cannot take a value." 1>&2; exit 1; } ;;
esac
fi






INST_MOM_SUBDIRS=""
INST_SERVER_SUBDIRS=""
INST_CLIENTS_SUBDIRS=""

BLD_MOM_SUBDIRS=""
BLD_SERVER_SUBDIRS=""
BLD_CLIENTS_SUBDIRS=""
BLD_LIB=""

if test -n "$PART_SERVER" ; then
    INST_SERVER_SUBDIRS='$(INST_SERVER_SUBDIRS)'
    BLD_SERVER_SUBDIRS='$(BLD_SERVER_SUBDIRS)'
    BLD_LIBS='$(BLD_LIBS)'
fi

if test -n "$PART_MOM" ; then
    INST_MOM_SUBDIRS='$(INST_MOM_SUBDIRS)'
    BLD_MOM_SUBDIRS='$(BLD_MOM_SUBDIRS)'
    BLD_LIBS='$(BLD_LIBS)'
fi

if test -n "$PART_CLIENTS" ; then
    INST_CLIENTS_SUBDIRS='$(INST_CLIENTS_SUBDIRS)'
    BLD_CLIENTS_SUBDIRS='$(BLD_CLIENTS_SUBDIRS)'
    BLD_LIBS='$(BLD_LIBS)'
fi













# Check whether --with-tcl or --without-tcl was given.
if test "${with_tcl+set}" = set; then
  withval="$with_tcl"
  tcl_dir="${withval}"
else
  tcl_dir="no"
fi


# Check whether --with-tclx or --without-tclx was given.
if test "${with_tclx+set}" = set; then
  withval="$with_tclx"
  tclx_dir="${withval}"
else
  tclx_dir="no"
fi


# Check whether --enable-gui or --disable-gui was given.
if test "${enable_gui+set}" = set; then
  enableval="$enable_gui"
  case "${enableval}" in
  yes) GUI=gui ;;
  no)  GUI="" ;;
  *) { echo "configure: error: --enable-gui cannot take a value." 1>&2; exit 1; } ;;
esac
else
  GUI=""
fi





TK=0; TCL=0; TCLX=0;

orig_tclx_dir="$tclx_dir"
if test "$tclx_dir" = yes; then
    echo $ac_n "checking Tclx library path prefix""... $ac_c" 1>&6
echo "configure:915: checking Tclx library path prefix" >&5
if eval "test \"`echo '$''{'pbs_cv_tclx_dir'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
        

tclx_dir=no
ac_LL_PATH=`echo "$PATH" | sed -e 's/:/ /g'`
for ac_libpath in $ac_LL_PATH /__XqqFrobozz ; do
    ac_libpath=`echo $ac_libpath | sed -e 's;/bin$;;'`
    if test `/bin/ls ${ac_libpath}/lib$libsuff/libtclx*.* 2> /dev/null | wc -l` -gt 0; then
        tclx_dir="$ac_libpath"
	break;
    fi
done

        pbs_cv_tclx_dir="$tclx_dir"
    
fi

echo "$ac_t""$pbs_cv_tclx_dir" 1>&6
fi

if test "$tclx_dir" != no; then
    TCLX=1
fi

orig_tcl_dir="$tcl_dir"
test "$tcl_dir" = no && tcl_dir="$tclx_dir"

test -n "$GUI" -a "$tcl_dir" = no && tcl_dir=yes

if test "$tcl_dir" = yes; then
    echo $ac_n "checking Tcl library path prefix""... $ac_c" 1>&6
echo "configure:950: checking Tcl library path prefix" >&5
if eval "test \"`echo '$''{'pbs_cv_tcl_dir'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
                

tcl_dir=no
ac_LL_PATH=`echo "$PATH" | sed -e 's/:/ /g'`
for ac_libpath in $ac_LL_PATH /__XqqFrobozz ; do
    ac_libpath=`echo $ac_libpath | sed -e 's;/bin$;;'`
    if test `/bin/ls ${ac_libpath}/lib$libsuff/libtcl*.* 2> /dev/null | wc -l` -gt 0; then
        tcl_dir="$ac_libpath"
	break;
    fi
done

        pbs_cv_tcl_dir="$tcl_dir"
    
fi

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

tcl_dir=no
ac_LL_PATH=`echo "$PATH" | sed -e 's/:/ /g'`
for ac_libpath in $ac_LL_PATH /__XqqFrobozz ; do
    ac_libpath=`echo $ac_libpath | sed -e 's;/bin$;;'`
    if test `/bin/ls ${ac_libpath}/lib$libsuff/libtcl*.* 2> /dev/null | wc -l` -gt 0; then
        tcl_dir="$ac_libpath"
	break;
    fi
done

fi

if test "$tcl_dir" != no; then
    TCL=1
    TCL_DIR="$tcl_dir"

                    count=`/bin/ls ${tcl_dir}/lib$libsuff/libtk* 2> /dev/null | wc -l`
    if test "$count" -gt 0 -a -n "$GUI"; then
	TK=1
    fi
fi

if test -n "$GUI" -a "$TK" -ne 1; then
    echo "configure: warning: cannot build GUI without Tk library, GUI disabled" 1>&2
    GUI=""
fi

TCL_VER=""; TK_VER=""

if test "$TCL" -eq 1; then
    tcl_h=/dev/null

    #
    # if we did not find tcl.h in include then look for a subdirectory
    # (for example TCL_DIR/include/tcl8.0/tcl.h)
    #
    for i in $TCL_DIR/include/tcl.h \
      `/bin/ls -d $TCL_DIR/include/tcl*/tcl.h 2> /dev/null`; do
        test -r $i && { tcl_h="$i"; break; }
    done

    echo $ac_n "checking Tcl version""... $ac_c" 1>&6
echo "configure:1016: checking Tcl version" >&5
if eval "test \"`echo '$''{'pbs_cv_ver_tcl'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
        if grep "[ \	]TCL_VERSION[ \	]" $tcl_h > /dev/null 2>&1; then
           pbs_cv_ver_tcl=`sed -n \
               -e 's/.*#define.*TCL_VERSION[^"]*"\([^"]*\).*/\1/p' \
               $tcl_h | tail -1`
        else
            pbs_cv_ver_tcl=notfound
    fi
fi

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

    TCL_VER="$pbs_cv_ver_tcl"
    test "$TCL_VER" = notfound && \
	{ echo "configure: error: cannot find Tcl version in $tcl_h" 1>&2; exit 1; };

                        TCL_LIB_VER="$TCL_VER"
    count=`/bin/ls -d $TCL_DIR/lib$libsuff/libtcl${TCL_LIB_VER}.* 2> /dev/null | wc -l`
    if test "$count" -lt 1; then
        TCL_LIB_VER=`echo $TCL_LIB_VER | sed -e 's/\.//'`
        count=`/bin/ls $TCL_DIR/lib$libsuff/libtcl${TCL_LIB_VER}.* | wc -l`
        if test "$count" -lt 1; then
            { echo "configure: error: cannot find a Tcl library for version $TCL_VER" 1>&2; exit 1; }
        fi
    fi
fi


if test "$TK" -eq 1; then

                    tk_h=/dev/null
    for i in $TCL_DIR/include/tk.h \
      `/bin/ls -d $TCL_DIR/include/tk*/tk.h 2> /dev/null`; do
        test -r $i && { tk_h="$i"; break; }
    done

    echo $ac_n "checking Tk version""... $ac_c" 1>&6
echo "configure:1057: checking Tk version" >&5
if eval "test \"`echo '$''{'pbs_cv_ver_tk'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
        if grep "[ \	]TK_VERSION[ \	]" $tk_h > /dev/null 2>&1; then
           pbs_cv_ver_tk=`sed -n \
               -e 's/.*#define.*TK_VERSION[^"]*"\([^"]*\).*/\1/p' \
               $tk_h | tail -1`
        else
            pbs_cv_ver_tk=notfound
    fi
fi

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

    TK_VER="$pbs_cv_ver_tk"
    test "$TK_VER" = notfound && \
	{ echo "configure: error: cannot find Tk version in $tk_h" 1>&2; exit 1; };

                        TK_LIB_VER="$TK_VER"
    count=`/bin/ls $TCL_DIR/lib$libsuff/libtk${TK_LIB_VER}.* 2> /dev/null | wc -l`
    if test "$count" -lt 1; then
        TK_LIB_VER=`echo $TK_LIB_VER | sed -e 's/\.//'`
        count=`/bin/ls $TCL_DIR/lib$libsuff/libtk${TK_LIB_VER}.* | wc -l`
        if test "$count" -lt 1; then
            { echo "configure: error: cannot find a Tk library for version $TK_VER" 1>&2; exit 1; }
        fi
    fi
fi



TCL_LIBS=""; TCL_INCS=""

TCLX_VER=""
if test "$TCLX" -eq 1; then


                    tclx_h=/dev/null
    for i in $TCL_DIR/include/tclExtend.h \
      `/bin/ls -d $TCL_DIR/include/tcl*/tclExtend.h 2> /dev/null`; do
        test -r $i && { tclx_h="$i"; break; }
    done

    echo $ac_n "checking TclX version""... $ac_c" 1>&6
echo "configure:1057: checking TclX version" >&5
if eval "test \"`echo '$''{'pbs_cv_ver_tclx'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
        if grep "[ \	]TCLX_VERSION[ \	]" $tclx_h > /dev/null 2>&1; then
           pbs_cv_ver_tclx=`sed -n \
               -e 's/.*#define.*TCLX_VERSION[^"]*"\([^"]*\).*/\1/p' \
               $tclx_h | tail -1`
        else
            pbs_cv_ver_tclx=notfound
    fi
fi

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

    TCLX_VER="$pbs_cv_ver_tclx"
    test "$TCLX_VER" = notfound && \
	{ echo "configure: error: cannot find TclX version in $tclx_h" 1>&2; exit 1; };

                        TCLX_LIB_VER="$TCLX_VER"
    count=`/bin/ls $TCL_DIR/lib$libsuff/libtclx${TCLX_LIB_VER}.* 2> /dev/null | wc -l`
    if test "$count" -lt 1; then
        TCLX_LIB_VER=`echo $TCLX_LIB_VER | sed -e 's/\.//'`
        count=`/bin/ls $TCL_DIR/lib$libsuff/libtk${TCLX_LIB_VER}.* | wc -l`
        if test "$count" -lt 1; then
            { echo "configure: error: cannot find a TclX library for version $TCLX_VER" 1>&2; exit 1; }
        fi
    fi
                TCLX_DIR="$tclx_dir"
    TCL_LIBS=$TCL_LIBS' -L$(TCLX_DIR)/lib'$libsuff
    TCL_INCS=$TCL_INCS' -I$(TCLX_DIR)/include'
    TCL_LIBS="$TCL_LIBS -ltclx${TCLX_LIB_VER} -ltkx${TCLX_LIB_VER}"
fi

if test "$TCL" -eq 1; then
    TCL_DIR="$tcl_dir"

                        if test "$tcl_dir" != "$tclx_dir"; then
        TCL_LIBS=$TCL_LIBS' -L$(TCL_DIR)/lib'$libsuff
    fi

                        count=`/bin/ls -d ${tcl_dir}/include/tcl${TCL_VER} 2> /dev/null | wc -l`
    if test "$count" -gt 0; then
        TCL_INCS=$TCL_INCS' -I$(TCL_DIR)/include/tcl$(TCL_VER)'
    fi

                    count=`/bin/ls -d ${tcl_dir}/include/tk${TK_VER} 2> /dev/null | wc -l`
    if test "$count" -gt 0; then
        TCL_INCS=$TCL_INCS' -I$(TCL_DIR)/include/tk$(TK_VER)'
    fi

                    count=`/bin/ls -d ${tcl_dir}/include/tcl.h ${tcl_dir}/include/tk.h 2> /dev/null | wc -l`
    if test "$count" -gt 0; then
        TCL_INCS=$TCL_INCS' -I$(TCL_DIR)/include'
    fi

                    if test "$TK" -eq 1; then
        TCL_INCS=$TCL_INCS' $(X11INC)'
        TCL_LIBS=$TCL_LIBS' $(LIBTK)'
    fi
    TCL_LIBS=$TCL_LIBS' $(LIBTCL)'
    if test "$TK" -eq 1; then
        TCL_LIBS=$TCL_LIBS' $(X11LIB) -lX11'
    fi
fi

test "$tclx_dir" = no -a "$orig_tclx_dir" != no &&
    { echo "configure: error: could not find the Tclx library" 1>&2; exit 1; };

test "$tcl_dir" = no -a \
    \( "$orig_tcl_dir" != no -o "$orig_tclx_dir" != no \) &&
    { echo "configure: error: could not find the Tcl library" 1>&2; exit 1; };









TOOLS_OBJS=""
TOOLS_TARGETS=""
if test "$TCL" -eq 1; then
    TOOLS_OBJS=$TOOLS_OBJS' $(OBJS_TCLTK) $(OBJS_TCL)'
    TOOLS_TARGETS=$TOOLS_TARGETS' pbs_tclsh'
    if test "$TK" -eq 1; then
        TOOLS_OBJS=$TOOLS_OBJS' $(OBJS_TK)'
        TOOLS_TARGETS=$TOOLS_TARGETS' pbs_wish'
    fi
fi




TCLSH_PATH=""; WISH_PATH=""

if test "$TCL" -eq 1 ; then
    # a loose symlink would be bad here
    echo $ac_n "checking for tclsh""... $ac_c" 1>&6
echo "configure:1166: checking for tclsh" >&5
if eval "test \"`echo '$''{'pbs_cv_path_tclsh'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
        pbs_cv_path_tclsh=notfound
        tsh="$tcl_dir/bin/tclsh"
        for i in "${tsh}${TCL_VER}" "${tsh}"; do
            #
            # here we need a way to determine if $i is an executable
            # file. Under POSIX this means that the execute bit
            # is set. The following test is not perfect but is
            # good enough. Symlinks do not exist under POSIX.
            # 
            test -x "$i" -a \! -d "$i" && { pbs_cv_path_tclsh="$i"; break; }
        done
    
fi

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

    test "$pbs_cv_path_tclsh" = notfound &&
        { echo "configure: error: cannot find tclsh in $tcl_dir/bin" 1>&2; exit 1; };

    TCLSH_PATH="$pbs_cv_path_tclsh"
fi


if test "$TK" -eq 1 ; then

    # a loose symbolic link will screw us here
    echo $ac_n "checking for wish""... $ac_c" 1>&6
echo "configure:1198: checking for wish" >&5
if eval "test \"`echo '$''{'pbs_cv_path_wish'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
        pbs_cv_path_wish=notfound
        wsh="$tcl_dir/bin/wish"
        for i in "${wsh}${TK_VER}" "${wsh}"; do
            test -x "$i" -a \! -d "$i" && { pbs_cv_path_wish="$i"; break; }
        done
    
fi

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

    test "$pbs_cv_path_wish" = notfound &&
        { echo "configure: error: cannot find wish in $tcl_dir/bin" 1>&2; exit 1; };

    WISH_PATH="$pbs_cv_path_wish"
fi






cat >> confdefs.h <<EOF
#define TCL ${TCL}
EOF



cat >> confdefs.h <<EOF
#define TCLX ${TCLX}
EOF











X11LIB=""
X11INC=""

if test "$x_includes" != "NONE" ; then
  if test -d "$x_includes"; then
    X11INC="-I$x_includes"
  else
    echo "configure: warning: "X11 header files not found"" 1>&2
  fi
elif test \! -d /usr/include/X11; then
  for d in /usr/X11R6 /usr/local /usr/X11R5 ; do
    if test -d "$d/include/X11"; then
      X11INC="-I$d/include"
      break;
    fi
  done
  if test -z "$X11INC" ; then
    echo "configure: warning: "X11 header files not found"" 1>&2
  fi
fi
  
if test "$x_libraries" != "NONE" ; then
  count=`/bin/ls $x_libraries/libX11* 2> /dev/null | wc -l`
  if test "$count" -gt 0; then
    X11LIB="-L$with_x11"
  else
    echo "configure: warning: "X11 libraries not found"" 1>&2
  fi
else
  count=`/bin/ls /usr/lib$libsuff/libX11* 2> /dev/null | wc -l`
  if test "$count" -eq 0 ; then
    for d in /usr/X11R6 /usr/local /usr/X11R5 ; do
      count=`/bin/ls $d/lib$libsuff/libX11* 2> /dev/null | wc -l`
      if test "$count" -gt 0 ; then
        X11LIB="-L$d/lib$libsuff"
        break
      fi
    done
    if test -z "$X11LIB" ; then
      echo "configure: warning: "X11 libraries not found"" 1>&2
    fi
  fi
fi







# Check whether --enable-debug or --disable-debug was given.
if test "${enable_debug+set}" = set; then
  enableval="$enable_debug"
  :
fi


if test "${enable_debug}" = "yes" ; then
    cat >> confdefs.h <<\EOF
#define DEBUG 1
EOF

fi



# Check whether --set-tmpdir was given.
if test "${set_tmpdir+zzq}" = zzq; then
  setval="$set_tmpdir"
  TMP_DIR="${setval}"
else
  TMP_DIR="/tmp"
fi
test "$TMP_DIR" = yes && TMP_DIR="/tmp"
cat >> confdefs.h <<EOF
#define TMP_DIR "${TMP_DIR}"
EOF





# Check whether --set-server_home was given.
if test "${set_server_home+zzq}" = zzq; then
  setval="$set_server_home"
  pbs_server_home="${setval}"
else
  pbs_server_home="/usr/spool/PBS"
fi

case "${pbs_server_home}" in
  /*)     cat >> confdefs.h <<EOF
#define PBS_SERVER_HOME "${pbs_server_home}"
EOF
 ;;
  *)      { echo "configure: error: --with-server-home=DIR must be given an absolute path" 1>&2; exit 1; } ;;
esac
PBS_SERVER_HOME="${pbs_server_home}"


# Check whether --set-server_name_file was given.
if test "${set_server_name_file+zzq}" = zzq; then
  setval="$set_server_name_file"
  pbs_default_file="${setval}"
else
  pbs_default_file="server_name"
fi

case "${pbs_default_file}" in
  /*)     PBS_DEFAULT_FILE="${pbs_default_file}"
          _PBS_DEFAULT_FILE="${pbs_default_file}" ;;
  *)      PBS_DEFAULT_FILE="\${PBS_SERVER_HOME}/${pbs_default_file}"
          _PBS_DEFAULT_FILE="${PBS_SERVER_HOME}/${pbs_default_file}" ;;
esac

cat >> confdefs.h <<EOF
#define PBS_DEFAULT_FILE "${_PBS_DEFAULT_FILE}"
EOF




# Check whether --set-default_server was given.
if test "${set_default_server+zzq}" = zzq; then
  setval="$set_default_server"
  PBS_DEFAULT_SERVER="${setval}"
else
  PBS_DEFAULT_SERVER="`uname -n`"
fi


# Check whether --set-environ was given.
if test "${set_environ+zzq}" = zzq; then
  setval="$set_environ"
  pbs_environ="${setval}"
else
  pbs_environ="no"
fi

case "${pbs_environ}" in
  yes) { echo "configure: error: --with-environ=PATH must be given a path" 1>&2; exit 1; } ;;
  no)  PBS_ENVIRON="\${PBS_SERVER_HOME}/pbs_environment"
       _PBS_ENVIRON="${PBS_SERVER_HOME}/pbs_environment" ;;
  /*)  PBS_ENVIRON="${pbs_environ}"
       _PBS_ENVIRON="${pbs_environ}" ;;
  *)   PBS_ENVIRON="\${PBS_SERVER_HOME}/${pbs_environ}"
       _PBS_ENVIRON="${PBS_SERVER_HOME}/${pbs_environ}" ;;
esac
cat >> confdefs.h <<EOF
#define PBS_ENVIRON "${_PBS_ENVIRON}"
EOF




# Check whether --enable-plock_daemons or --disable-plock_daemons was given.
if test "${enable_plock_daemons+set}" = set; then
  enableval="$enable_plock_daemons"
  case "${enableval}" in
  yes) PLOCK_DAEMONS=7 ;;
  no)  PLOCK_DAEMONS=0 ;;
  *) PLOCK_DAEMONS="${enableval}" ;;
esac
else
  PLOCK_DAEMONS=0
fi



# Check whether --enable-syslog or --disable-syslog was given.
enableval=yes
if test "${enable_syslog+set}" = set; then
  enableval="$enable_syslog"
  :
fi


if test "${enableval}" = "yes" ; then
    cat >> confdefs.h <<\EOF
#define SYSLOG 1
EOF

fi


# Check whether --set-sched was given.
if test "${set_sched+zzq}" = zzq; then
  setval="$set_sched"
  case "${setval}" in
  c*|C*)        SCHD_TYPE=cc ;;
  tcl|Tcl)      SCHD_TYPE=tcl ;;
  basl|BASL)    SCHD_TYPE=basl ;;
  *)            SCHD_TYPE=none ;;
esac
else
  SCHD_TYPE=cc
fi


# Check whether --set-sched_code was given.
if test "${set_sched_code+zzq}" = zzq; then
  setval="$set_sched_code"
  if test "${SCHD_TYPE}" = "cc" -o "${SCHD_TYPE}" = "basl"; then
  case "${setval}" in
    /*)       SCHD_SRC="${setval}"; SCHD_BUILD="${setval}" ;;
    *)        SCHD_SRC='${top_srcdir}/src/scheduler.'${SCHD_TYPE}/samples/${setval}
              SCHD_BUILD='${top_builddir}/src/scheduler.'${SCHD_TYPE}/samples/${setval} ;;
  esac
else
  { echo "configure: error: --set-sched-code was set but sched-type was not \"c\" or \"basl\"." 1>&2; exit 1; }
fi
else
  SCHD_SRC=none; SCHD_BUILD=none
fi


if test "$SCHD_SRC" = none -a "$SCHD_SRC" = none -a "$SCHD_TYPE" = cc; then
    SCHD_SRC='${top_srcdir}/src/scheduler.cc/samples/fifo'
    SCHD_BUILD='${top_builddir}/src/scheduler.cc/samples/fifo'
fi


if test \( "${SCHD_TYPE}" = "cc" -o "${SCHD_TYPE}" = "basl" \) -a "${SCHD_SRC}" = "none"; then
  { echo "configure: error: Must specify --set-sched-code for C and BASL schedulers.]" 1>&2; exit 1; }
fi

SCHD_CODE_SUBDIR=""
if test "${SCHD_TYPE}" != none; then
  SCHD_CODE_SUBDIR=scheduler.${SCHD_TYPE}
fi


# Check whether --set-mansuffix was given.
if test "${set_mansuffix+zzq}" = zzq; then
  setval="$set_mansuffix"
  MAN_SUFFIX="${setval}"
else
  MAN_SUFFIX="B"
fi

# Check whether --set-tclatrsep was given.
if test "${set_tclatrsep+zzq}" = zzq; then
  setval="$set_tclatrsep"
  tcl_atrsep="${setval}"
else
  tcl_atrsep="."
fi
cat >> confdefs.h <<EOF
#define TCL_ATRSEP "${tcl_atrsep}"
EOF


# Check whether --set-qstatrc-file was given.
if test "${set_qstatrc_file+zzq}" = zzq; then
  setval="$set_qstatrc_file"
  case "${setval}" in
  /*)       QSTATRC_PATH="${setval}" ;;
  *)        QSTATRC_PATH="${pbs_server_home}/${setval}" ;;
esac
else
  QSTATRC_PATH="${pbs_server_home}/qstatrc"
fi

cat >> confdefs.h <<EOF
#define QSTATRC_PATH "${QSTATRC_PATH}"
EOF



# Check whether --with-scp or --without-scp was given.
if test "${with_scp+set}" = set && test "${with_scp}" != no; then
  withval="$with_scp"
  
# Extract the first word of ""scp"", so it can be a program name with args.
set dummy "scp"; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:1533: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_SCP_PATH'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  case "$SCP_PATH" in
  /*)
  ac_cv_path_SCP_PATH="$SCP_PATH" # Let the user override the test with a path.
  ;;
  *)
  case "$withval" in
  /*)
  ac_cv_path_SCP_PATH="$withval"
  ;;
  *)
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
  for ac_dir in $PATH; do
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_path_SCP_PATH="$ac_dir/$ac_word"
      break
    fi
  done
  IFS="$ac_save_ifs"
  test -z "$ac_cv_path_SCP_PATH" && ac_cv_path_SCP_PATH=""error""
  ;;
  esac
  ;;
esac
fi
SCP_PATH="$ac_cv_path_SCP_PATH"
if test -n "$SCP_PATH"; then
  echo "$ac_t""$SCP_PATH" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

case "${SCP_PATH}" in
  error) { echo "configure: error: --with-scp scp not found in path" 1>&2; exit 1; } ;;
  *)     cat >> confdefs.h <<EOF
#define SCP_PATH "${SCP_PATH}"
EOF
MOM_RCP=""
 ;;
esac
else
MOM_RCP=mom_rcp
fi





# Check whether --enable-shell-pipe or --disable-shell-pipe was given.
if test "${enable_shell_pipe+set}" = set; then
  enableval="$enable_shell_pipe"
  case "${enableval}" in
  yes) SHELL_INVOKE=1 ;;
  no)  SHELL_INVOKE=0 ;;
  *)   SHELL_INVOKE=0 ;;
esac
else
  SHELL_INVOKE=1
fi


# Check whether --enable-shell-use-argv or --disable-shell-use-argv was given.
if test "${enable_shell_use_argv+set}" = set; then
  enableval="$enable_shell_use_argv"
  case "${enableval}" in
  yes) SHELL_USE_ARGV=1 ;;
  no)  SHELL_USE_ARGV=0 ;;
  *)   SHELL_USE_ARGV=0 ;;
esac
else
  SHELL_USE_ARGV=0
fi


#
# run the script in the aux dir to figure out what PBS "machine type" we are on
#
echo $ac_n "checking PBS machine type""... $ac_c" 1>&6
echo "configure:1593: checking PBS machine type" >&5
if eval "test \"`echo '$''{'pbs_cv_type_mach'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
    pbs_cv_type_mach=`$mach_script`

fi

echo "$ac_t""$pbs_cv_type_mach" 1>&6
PBS_MACH=$pbs_cv_type_mach
if test "$PBS_MACH" = unknown; then
    { echo "configure: error: Machine type \"$PBS_MACH\" is not supported." 1>&2; exit 1; }
fi

# NOTE:  not included in configure.in

if test "${enable_darwinbind+set}" = set; then
cat >> confdefs.h <<EOF
#define __TDARWINBIND
EOF
fi

if test "$PBS_MACH" = darwin; then
cat >> confdefs.h <<EOF
#define __TDARWIN
EOF

case `uname -r` in
  8*) cat >> confdefs.h <<EOF
#define __TDARWIN_8
EOF
;;
esac

fi

if test "$PBS_MACH" = sunos4; then
cat >> confdefs.h <<EOF
#define __TSUNOS4
EOF
fi

if test "$PBS_MACH" = digitalunix; then
cat >> confdefs.h <<EOF
#define __TDIGITAL
EOF
fi

if test "$PBS_MACH" = aix5; then
cat >> confdefs.h <<EOF
#define __TAIX_5
EOF
fi

if test "$PBS_MACH" = linux; then
cat >> confdefs.h <<EOF
#define __TLINUX
EOF
fi


# Check whether --disable-filesync was given.
if test "${enable_filesync+set}" = set; then
  enableval="$enable_filesync"
  if test "${enableval}" = "no" ; then
    cat >> confdefs.h <<\EOF
#define TDISABLEFILESYNC 1
EOF

else
    cat >> confdefs.h <<\EOF
#define TDISABLEFILESYNC 0
EOF

fi
else
  cat >> confdefs.h <<\EOF
#define TDISABLEFILESYNC 1
EOF

fi # END filesync


# Check whether --disable-spool was given.
if test "${enable_spool+set}" = set; then
  enableval="$enable_spool"
  if test "${enableval}" = "no" ; then
    cat >> confdefs.h <<\EOF
#define NO_SPOOL_OUTPUT 1
EOF

else
    cat >> confdefs.h <<\EOF
#define NO_SPOOL_OUTPUT 0
EOF

fi
else
  cat >> confdefs.h <<\EOF
#define NO_SPOOL_OUTPUT 0
EOF

fi # END disable-spool


# Check whether --maildomain was given.
if test "${maildomain+set}" = set; then
  cat >> confdefs.h <<EOF
#define TMAILDOMAIN "$maildomain"
EOF
fi

# NOTE:  END not included in configure.in

cat >> confdefs.h <<EOF
#define MACH_RESC_DEFS "resc_def_${PBS_MACH}.c"
EOF



# Check whether --enable-rpp or --disable-rpp was given.
if test "${enable_rpp+set}" = set; then
  enableval="$enable_rpp"
  if test "${enable_rpp}" = "yes" ; then
    cat >> confdefs.h <<\EOF
#define RPP 1
EOF

else
    cat >> confdefs.h <<\EOF
#define RPP 0
EOF

fi
else
  cat >> confdefs.h <<\EOF
#define RPP 1
EOF

fi



MOMLIBS=""
POE_D=""
POE_DO=""
PBSPOE=""
PBSPOEO=""
# Check whether --enable-sp2 or --disable-sp2 was given.
if test "${enable_sp2+set}" = set; then
  enableval="$enable_sp2"
  :
fi


if test "${enable_sp2}" = "yes" ; then
    MOMLIBS="-ljm_client -lSDR"
    case "${PBS_MACH}" in
      aix*) echo $ac_n "checking for swtbl_load_table in -lswitchtbl""... $ac_c" 1>&6
echo "configure:1653: checking for swtbl_load_table in -lswitchtbl" >&5
ac_lib_var=`echo switchtbl'_'swtbl_load_table | 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="-lswitchtbl  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 1661 "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 swtbl_load_table();

int main() {
swtbl_load_table()
; return 0; }
EOF
if { (eval echo configure:1672: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; 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
  
	 	    cat >> confdefs.h <<\EOF
#define IBM_SP2 2
EOF

		    LIBS="-lswitchtbl $LIBS"
		    PBSPOE="pbspd pbspoe"
		    PBSPOEO="pbspoe.o pbspd.o" 
else
  echo "$ac_t""no" 1>&6

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

fi

            ;;
      *) { echo "configure: error: Cannot --enable-sp2 on a machine not running AIX" 1>&2; exit 1; } ;;
    esac
fi





cat >> confdefs.h <<\EOF
#define NEEDNODES 0
EOF


# Check whether --enable-tcl-qstat or --disable-tcl-qstat was given.
if test "${enable_tcl_qstat+set}" = set; then
  enableval="$enable_tcl_qstat"
  :
fi


EXTRA_QSTAT_LIBS=""
if test "${enable_tcl_qstat}" = "yes"; then
    if test "$TCL" -eq 1 ; then
        cat >> confdefs.h <<\EOF
#define TCL_QSTAT 1
EOF

        EXTRA_QSTAT_LIBS='$(EXTRA_QSTAT_LIBS)'
    else
        { echo "configure: error: Cannot enable tcl-qstat without also using \"--with-tcl\(x\)\"" 1>&2; exit 1; }
    fi
fi





# Check whether --enable-array or --disable-array was given.
if test "${enable_array+set}" = set; then
  enableval="$enable_array"
  
    if test "$PBS_MACH" = irix6; then
        if test "$enableval" = yes; then
            echo "configure: warning: No array daemon detected but enable-array overrides." 1>&2
            PBS_MACH=irix6array
        fi
    elif test "$PBS_MACH" = irix6array; then
        if test "$enableval" = no; then
            echo "configure: warning: Array daemon detected but disable-array overrides." 1>&2
            PBS_MACH=irix6
        fi
    else
        { echo "configure: error: Cannot use \"--en/disable-array\" unless configuring for IRIX 6.x or above" 1>&2; exit 1; }
    fi
fi

if test "$PBS_MACH" = aix4; then
    MOMLIBS="$MOMLIBS -lodm -lcfg"
fi

if test "$PBS_MACH" = aix5; then
    MOMLIBS="$MOMLIBS -lodm -lcfg"
fi

if test "$PBS_MACH" = linux; then
    MOMLIBS="$MOMLIBS -lutil"
fi

if test "$PBS_MACH" = irix6array; then
    MOMLIBS="-larray"
fi

# Check whether --enable-NODEMASK or --disable-NODEMASK was given.
if test "${enable_NODEMASK+set}" = set; then
  enableval="$enable_NODEMASK"
  :
fi

if test "${enable_nodemask}" = "yes" ; then
    case "${PBS_MACH}" in
      irix6*) cat >> confdefs.h <<\EOF
#define NODEMASK 1
EOF
 ;;
      *) { echo "configure: error: Cannot --enable-nodemask on a machine not running IRIX6" 1>&2; exit 1; };;
    esac
fi
# Check whether --enable-PE_MASK or --disable-PE_MASK was given.
if test "${enable_PE_MASK+set}" = set; then
  enableval="$enable_PE_MASK"
  :
fi

if test "${enable_pemask}" = "yes" ; then
    case "${PBS_MACH}" in
      unicosmk*) cat >> confdefs.h <<\EOF
#define PE_MASK 1
EOF
 ;;
      *) { echo "configure: error: Cannot --enable-pemask on a machine not running UNICOS/mk" 1>&2; exit 1; };;
    esac
fi

# Check whether --enable-SRFS or --disable-SRFS was given.
if test "${enable_SRFS+set}" = set; then
  enableval="$enable_SRFS"
  :
fi


if test "${enable_srfs}" = "yes" ; then
    cat >> confdefs.h <<\EOF
#define SRFS 1
EOF

else
    cat >> confdefs.h <<\EOF
#define SRFS 0
EOF

fi


# Check whether --enable-DEPEND_CACHE or --disable-DEPEND_CACHE was given.
if test "${enable_DEPEND_CACHE+set}" = set; then
  enableval="$enable_DEPEND_CACHE"
  :
fi


if test "${enable_depend_cache}" = "yes" ; then
    DEPEND_CACHE='-c $(srcdir)/Makefile.in'
else
    DEPEND_CACHE=""
fi



sendmail_maybe_in="/usr/lib:/usr/sbin:/usr/bin:/etc:/usr/etc"
for ac_prog in sendmail
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:1843: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_SENDMAIL_CMD'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  case "$SENDMAIL_CMD" in
  /*)
  ac_cv_path_SENDMAIL_CMD="$SENDMAIL_CMD" # Let the user override the test with a path.
  ;;
  *)
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
  for ac_dir in ${sendmail_maybe_in}$ac_dummy; do
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_path_SENDMAIL_CMD="$ac_dir/$ac_word"
      break
    fi
  done
  IFS="$ac_save_ifs"
  ;;
esac
fi
SENDMAIL_CMD="$ac_cv_path_SENDMAIL_CMD"
if test -n "$SENDMAIL_CMD"; then
  echo "$ac_t""$SENDMAIL_CMD" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

test -n "$SENDMAIL_CMD" && break
done
test -n "$SENDMAIL_CMD" || SENDMAIL_CMD="{ echo "configure: error: could not find the sendmail executable" 1>&2; exit 1; }"

cat >> confdefs.h <<EOF
#define SENDMAIL_CMD "${SENDMAIL_CMD}"
EOF



cat >> confdefs.h <<EOF
#define NO_ASN1 ${NO_ASN1}
EOF

cat >> confdefs.h <<EOF
#define PLOCK_DAEMONS ${PLOCK_DAEMONS}
EOF

cat >> confdefs.h <<EOF
#define SCHD_TYPE "${SCHD_TYPE}"
EOF

cat >> confdefs.h <<EOF
#define SHELL_INVOKE ${SHELL_INVOKE}
EOF

cat >> confdefs.h <<EOF
#define SHELL_USE_ARGV ${SHELL_USE_ARGV}
EOF

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

if test -z "$LEXLIB"
then
  case "$LEX" in
  flex*) ac_lib=fl ;;
  *) ac_lib=l ;;
  esac
  echo $ac_n "checking for yywrap in -l$ac_lib""... $ac_c" 1>&6
echo "configure:1934: checking for yywrap in -l$ac_lib" >&5
ac_lib_var=`echo $ac_lib'_'yywrap | 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="-l$ac_lib  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 1942 "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 yywrap();

int main() {
yywrap()
; return 0; }
EOF
if { (eval echo configure:1953: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; 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
  LEXLIB="-l$ac_lib"
else
  echo "$ac_t""no" 1>&6
fi

fi

echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
echo "configure:1976: 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

echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
echo "configure:1997: 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

# 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:2026: 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="${IFS}:"
  for ac_dir in $PATH; 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 "ar", so it can be a program name with args.
set dummy ar; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:2026: 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="${IFS}:"
  for ac_dir in $PATH; do
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_prog_AR="ar"
      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 -z "$AR" && { echo "configure: error: no acceptable ar found in \$PATH" 1>&2; exit 1; }

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

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



# Fool autoconf into thinking that you have called AC_PROG_INSTALL
# since this is tested for in other places


# Always use the supplied install-sh script instead of trying to divine
# which OS has a good install program.
echo $ac_n "checking for the install-sh script""... $ac_c" 1>&6
echo "configure:2095: checking for the install-sh script" >&5
if test -z "$INSTALL"; then
  INSTALL="$ac_install_sh"
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_DATA" && INSTALL_DATA='${INSTALL} -m 644'


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

test -n "$TBL" && break
done
test -n "$TBL" || TBL="exit"

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

test -n "$PIC" && break
done
test -n "$PIC" || PIC="exit"

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

test -n "$ROFF" && break
done
test -n "$ROFF" || ROFF="exit"


# test "$ROFF" = groff && ROFF="$ROFF -C"


echo $ac_n "checking whether ${MAKE-make} understands '.POSIX:'""... $ac_c" 1>&6
echo "configure:2215: checking whether ${MAKE-make} understands '.POSIX:'" >&5
set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_prog_${ac_make}_posix_target'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_maketemp=""
cat > conftestmake <<\EOF
.POSIX:

all:
	@echo "ac_maketemp=yes"
EOF
eval `${MAKE-make} -f conftestmake 2>/dev/null | grep "^ac_"`
if test -n "$ac_maketemp"; then
  eval ac_cv_prog_${ac_make}_posix_target=yes
else
  eval ac_cv_prog_${ac_make}_posix_target=no
fi
rm -f conftestmake
fi
if eval "test \"`echo '$ac_cv_prog_'${ac_make}_posix_target`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  MAKE_POSIX_TARGET=".POSIX:"
else
  echo "$ac_t""no" 1>&6
  MAKE_POSIX_TARGET=""
fi

echo $ac_n "checking whether ${MAKE-make} understands an initial '+'""... $ac_c" 1>&6
echo "configure:2244: checking whether ${MAKE-make} understands an initial '+'" >&5
set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_prog_${ac_make}_posix_plus'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_maketemp=""
cat > conftestmake <<\EOF
all:
	+@echo ac_maketemp=yes
EOF
eval `${MAKE-make} -n -f conftestmake 2>/dev/null | grep "^ac_"`
if test -n "$ac_maketemp"; then
  eval ac_cv_prog_${ac_make}_posix_plus=yes
else
  eval ac_cv_prog_${ac_make}_posix_plus=no
fi
rm -f conftestmake
fi
if eval "test \"`echo '$ac_cv_prog_'${ac_make}_posix_plus`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  MAKE_POSIX_PLUS='+'
else
  echo "$ac_t""no" 1>&6
  MAKE_POSIX_PLUS=""
fi




MOM_CHECKPOINT=0
case "$PBS_MACH" in
    unicos*) MOM_CHECKPOINT=1 ;;
    irix6*)  echo $ac_n "checking for atcheckpoint in -lcpr""... $ac_c" 1>&6
echo "configure:2470: checking for atcheckpoint in -lcpr" >&5
ac_lib_var=`echo cpr'_'atcheckpoint | 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="-lcpr  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 2478 "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 atcheckpoint();

int main() {
atcheckpoint()
; return 0; }
EOF
if { (eval echo configure:2489: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; 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
  MOM_CHECKPOINT=1
else
  echo "$ac_t""no" 1>&6
fi

	     if test "$MOM_CHECKPOINT" = 1 ; then
		MOMLIBS="$MOMLIBS -lcpr"
		#
		# if we are using plain cc then under irix6array
		# make it cc -64 unless the user has explicitly asked for cc
		#
		test "$CC" = cc -a "$user_set_cc_val" = no && {
		   echo "configure: warning: Automatically setting CC='cc -64' under irix6." 1>&2
		   CC='cc -64'
		}
	      fi ;;
esac
cat >> confdefs.h <<EOF
#define MOM_CHECKPOINT ${MOM_CHECKPOINT}
EOF



MOM_ADDTL_OBJS=""
case "$PBS_MACH" in
    unicosmk*)  MOM_ADDTL_OBJS="wait_job.o" ;;
esac



echo $ac_n "checking size of int""... $ac_c" 1>&6
echo "configure:2535: checking size of int" >&5
if eval "test \"`echo '$''{'ac_cv_sizeof_int'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test "$cross_compiling" = yes; then
  ac_cv_sizeof_int=20
else
  cat > conftest.$ac_ext <<EOF
#line 2543 "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:2554: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
then
  ac_cv_sizeof_int=`cat conftestval`
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -fr conftest*
  ac_cv_sizeof_int=0
fi
rm -fr conftest*
fi

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


echo $ac_n "checking size of long""... $ac_c" 1>&6
echo "configure:2574: checking size of long" >&5
if eval "test \"`echo '$''{'ac_cv_sizeof_long'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test "$cross_compiling" = yes; then
  ac_cv_sizeof_long=21
else
  cat > conftest.$ac_ext <<EOF
#line 2582 "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:2593: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
then
  ac_cv_sizeof_long=`cat conftestval`
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -fr conftest*
  ac_cv_sizeof_long=0
fi
rm -fr conftest*
fi

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


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

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


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

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


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

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


echo $ac_n "checking size of short""... $ac_c" 1>&6
echo "configure:2730: checking size of short" >&5
if eval "test \"`echo '$''{'ac_cv_sizeof_short'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test "$cross_compiling" = yes; then
  ac_cv_sizeof_short=25
else
  cat > conftest.$ac_ext <<EOF
#line 2738 "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:2749: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
then
  ac_cv_sizeof_short=`cat conftestval`
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -fr conftest*
  ac_cv_sizeof_short=0
fi
rm -fr conftest*
fi

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


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

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


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

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


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

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


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

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


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

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


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

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


echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
echo "configure:3003: 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 3018 "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:3024: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
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 3035 "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:3041: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
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*
  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 whether char is unsigned""... $ac_c" 1>&6
echo "configure:3064: checking whether char is unsigned" >&5
if eval "test \"`echo '$''{'ac_cv_c_char_unsigned'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test "$GCC" = yes; then
  # GCC predefines this symbol on systems where it applies.
cat > conftest.$ac_ext <<EOF
#line 3071 "configure"
#include "confdefs.h"
#ifdef __CHAR_UNSIGNED__
  yes
#endif

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

else
if test "$cross_compiling" = yes; then
    { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
else
  cat > conftest.$ac_ext <<EOF
#line 3093 "configure"
#include "confdefs.h"
/* volatile prevents gcc2 from optimizing the test away on sparcs.  */
#if !defined(__STDC__) || __STDC__ != 1
#define volatile
#endif
main() {
  volatile char c = 255; exit(c < 0);
}
EOF
if { (eval echo configure:3103: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
then
  ac_cv_c_char_unsigned=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -fr conftest*
  ac_cv_c_char_unsigned=no
fi
rm -fr conftest*
fi

fi
fi

echo "$ac_t""$ac_cv_c_char_unsigned" 1>&6
if test $ac_cv_c_char_unsigned = yes && test "$GCC" != yes; then
  cat >> confdefs.h <<\EOF
#define __CHAR_UNSIGNED__ 1
EOF

fi


echo $ac_n "checking for h_errno declaration in netdb.h""... $ac_c" 1>&6
echo "configure:3128: checking for h_errno declaration in netdb.h" >&5
if eval "test \"`echo '$''{'ac_cv_decl_h_errno'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 3133 "configure"
#include "confdefs.h"
#include <sys/types.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#include <netdb.h>

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

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

fi


echo $ac_n "checking for FD_SET eclaration in sys/select.h""... $ac_c" 1>&6
echo "configure:3167: checking for FD_SET eclaration in sys/select.h" >&5
if eval "test \"`echo '$''{'ac_cv_decl_fdset_sys_select_h'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 3172 "configure"
#include "confdefs.h"
#include <sys/select.h>
#ifdef FD_SETSIZE
oh_yeah
#endif

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

fi

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

fi

if test "${enable_wordexp+set}" = set; then
  case $enable_wordexp in
    yes) wordexp_func=wordexp
  esac
fi


for ac_func in setresuid setresgid seteuid setegid $wordexp_func
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:3204: 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 3209 "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:3232: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; 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 "${wordexp_func+set}" = set; then
  if eval "test \"`echo '$''{'ac_cv_func_$wordexp_func'}'`\" != yes"; then
    { echo "configure: error: $wordexp_func not found" 1>&2; exit 1; }
  fi
fi


#
# nsl is needed on some systems but duplicates libc.a on others (O2000s)
#
echo $ac_n "checking for xdr_int in -lc""... $ac_c" 1>&6
echo "configure:3262: checking for xdr_int in -lc" >&5
ac_lib_var=`echo c'_'xdr_int | 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 3270 "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 xdr_int();

int main() {
xdr_int()
; return 0; }
EOF
if { (eval echo configure:3281: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; 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
  :
else
  echo "$ac_t""no" 1>&6
echo $ac_n "checking for xdr_int in -lnsl""... $ac_c" 1>&6
echo "configure:3300: checking for xdr_int in -lnsl" >&5
ac_lib_var=`echo nsl'_'xdr_int | 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 3308 "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 xdr_int();

int main() {
xdr_int()
; return 0; }
EOF
if { (eval echo configure:3319: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; 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

echo $ac_n "checking for ruserok in -lc""... $ac_c" 1>&6
echo "configure:3349: checking for ruserok in -lc" >&5
ac_lib_var=`echo c'_'ruserok | 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 3357 "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 ruserok();

int main() {
ruserok()
; return 0; }
EOF
if { (eval echo configure:3368: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; 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
  :
else
  echo "$ac_t""no" 1>&6
echo $ac_n "checking for ruserok in -lsocket""... $ac_c" 1>&6
echo "configure:3387: checking for ruserok in -lsocket" >&5
ac_lib_var=`echo socket'_'ruserok | 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 3395 "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 ruserok();

int main() {
ruserok()
; return 0; }
EOF
if { (eval echo configure:3406: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; 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

case $PBS_MACH in
aix4|aix5|sunos4|solaris5|freebsd|darwin|fujitsu)
echo $ac_n "checking for nlist in -lc""... $ac_c" 1>&6
echo "configure:3436: checking for nlist in -lc" >&5
ac_lib_var=`echo c'_'nlist | 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 3444 "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 nlist();

int main() {
nlist()
; return 0; }
EOF
if { (eval echo configure:3455: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; 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
  :
else
  echo "$ac_t""no" 1>&6
echo $ac_n "checking for nlist in -lelf""... $ac_c" 1>&6
echo "configure:3474: checking for nlist in -lelf" >&5
ac_lib_var=`echo elf'_'nlist | 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="-lelf  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 3482 "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 nlist();

int main() {
nlist()
; return 0; }
EOF
if { (eval echo configure:3493: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; 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 elf | sed -e 's/^a-zA-Z0-9_/_/g' \
    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
  cat >> confdefs.h <<EOF
#define $ac_tr_lib 1
EOF

  LIBS="-lelf $LIBS"

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

fi
;;
esac

case $PBS_MACH in
sunos4|solaris5|netbsd|freebsd|darwin)
echo $ac_n "checking for kvm_open in -lkvm""... $ac_c" 1>&6
echo "configure:3523: checking for kvm_open in -lkvm" >&5
ac_lib_var=`echo kvm'_'kvm_open | 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="-lkvm  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 3531 "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 kvm_open();

int main() {
kvm_open()
; return 0; }
EOF
if { (eval echo configure:3542: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; 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 kvm | sed -e 's/[^a-zA-Z0-9_]/_/g' \
    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
  cat >> confdefs.h <<EOF
#define $ac_tr_lib 1
EOF

  LIBS="-lkvm $LIBS"

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


case $PBS_MACH in
none)
echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
echo "configure:3571: 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 3579 "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:3590: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; 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
;;
esac



# if sys/ioctl.h exists then define a symbol
ac_safe=`echo "sys/ioctl.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for sys/ioctl.h""... $ac_c" 1>&6
echo "configure:3622: checking for sys/ioctl.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 3627 "configure"
#include "confdefs.h"
#include <sys/ioctl.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:3632: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
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
  cat >> confdefs.h <<\EOF
#define HAVE_SYS_IOCTL_H 1
EOF

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



if test $ac_cv_prog_gcc = yes; then
    echo $ac_n "checking whether ${CC-cc} needs -traditional""... $ac_c" 1>&6
echo "configure:3660: checking whether ${CC-cc} needs -traditional" >&5
if eval "test \"`echo '$''{'ac_cv_prog_gcc_traditional'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
    ac_pattern="Autoconf.*'x'"
  cat > conftest.$ac_ext <<EOF
#line 3666 "configure"
#include "confdefs.h"
#include <sgtty.h>
Autoconf TIOCGETP
EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  egrep "$ac_pattern" >/dev/null 2>&1; then
  rm -rf conftest*
  ac_cv_prog_gcc_traditional=yes
else
  rm -rf conftest*
  ac_cv_prog_gcc_traditional=no
fi
rm -f conftest*


  if test $ac_cv_prog_gcc_traditional = no; then
    cat > conftest.$ac_ext <<EOF
#line 3684 "configure"
#include "confdefs.h"
#include <termio.h>
Autoconf TCGETA
EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  egrep "$ac_pattern" >/dev/null 2>&1; then
  rm -rf conftest*
  ac_cv_prog_gcc_traditional=yes
fi
rm -f conftest*

  fi
fi

echo "$ac_t""$ac_cv_prog_gcc_traditional" 1>&6
  if test $ac_cv_prog_gcc_traditional = yes; then
    CC="$CC -traditional"
  fi
fi


for ac_func in atexit on_exit
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:3709: 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 3714 "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:3737: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; 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
  { found_an_exit=yes; break; } 
else
  echo "$ac_t""no" 1>&6
fi
done

if test "$found_an_exit" != yes; then
    { echo "configure: error: Must have atexit() or on_exit() in libc (used in Libnet/rpp.c)" 1>&2; exit 1; }
fi

echo $ac_n "checking for initscr in -lncurses""... $ac_c" 1>&6
echo "configure:3346: checking for initscr in -lncurses" >&5
ac_lib_var=`echo ncurses'_'initscr | 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="-lncurses  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 3354 "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 initscr();

int main() {
initscr()
; return 0; }
EOF
if { (eval echo configure:3365: \"$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
  READLINE_LIBS="-lncurses"
else
  echo "$ac_t""no" 1>&6
fi

echo $ac_n "checking for rl_callback_handler_install in -lreadline""... $ac_c" 1>&6
echo "configure:3386: checking for rl_callback_handler_install in -lreadline" >&5
ac_lib_var=`echo readline'_'rl_callback_handler_install | 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="-lreadline $READLINE_LIBS $LIBS"
cat > conftest.$ac_ext <<EOF
#line 3394 "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 rl_callback_handler_install();

int main() {
rl_callback_handler_install()
; return 0; }
EOF
if { (eval echo configure:3405: \"$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
  READLINE_LIBS="-lreadline $READLINE_LIBS"
              cat >> confdefs.h <<\EOF
#define HAVE_READLINE 1
EOF

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

pbs_os_type=`echo ${host_os} | sed 's/[[0-9]].*//' | tr "A-Z" "a-z"`
pbs_os_version=`echo ${host_os} | sed 's/^'${pbs_os_type}'//' | tr "A-Z" "a-z"`


mkinclude_subdir=buildutils/mkincludes







cat >> confdefs.h <<EOF
#define PBS_MACH "${PBS_MACH}"
EOF


fundef=undef


DEPEND='${top_srcdir}/buildutils/makedepend-sh'


IFF_FILE='iff2'



mkinclude_dir=./buildutils/mkincludes

mk_cleanup=${mkinclude_dir}/cleanup.mk
mk_dirs=${mkinclude_dir}/dirs.mk
mk_docplan=${mkinclude_dir}/docplan.mk
mk_lib=${mkinclude_dir}/lib.mk
mk_head=${mkinclude_dir}/head.mk
mk_tail=${mkinclude_dir}/tail.mk
mk_tcl=${mkinclude_dir}/tcl.mk
posix_rules=${mkinclude_dir}/posix_rules



# needed for makedepend
MAKERULES="\$(top_srcdir)/$posix_rules"



cat >> confdefs.h <<\EOF
#define SRFS 0
EOF


if test "$pbs_os_type" = "solaris" ; then
    cat >> confdefs.h <<\EOF
#define PBS_PUSH_STREAM 1
EOF

fi


pbs_makefile_list="

    buildutils/pbs_mkdirs
    buildutils/mkincludes/cleanup.mk
    buildutils/mkincludes/dirs.mk
    buildutils/mkincludes/docplan.mk
    buildutils/mkincludes/lib.mk
    buildutils/mkincludes/head.mk
    buildutils/mkincludes/tail.mk
    buildutils/mkincludes/tcl.mk
    buildutils/Makefile
    buildutils/self-extract-head-sh

    ./Makefile
    src/Makefile
    src/server/Makefile
    src/include/Makefile
    src/iff/Makefile
    src/scheduler.tcl/Makefile
    src/tools/Makefile
    src/tools/xpbsmon/Makefile
    src/lib/Makefile
    src/gui/Makefile
    src/gui/Ccode/Makefile
    src/cmds/Makefile
    src/scheduler.basl/Makefile
    src/scheduler.cc/Makefile
    src/scheduler.cc/samples/do_not_delete
    src/scheduler.cc/samples/fifo/Makefile
    src/scheduler.cc/samples/sgi_origin/Makefile
    src/scheduler.cc/samples/cray_t3e/Makefile
    src/scheduler.cc/samples/dec_cluster/Makefile
    src/scheduler.cc/samples/umn_cluster/Makefile
    src/scheduler.cc/samples/msic_cluster/Makefile
    src/resmom/Makefile
    src/mom_rcp/Makefile
    src/lib/Libattr/Makefile
    src/lib/Libcmds/Makefile
    src/lib/Libpbs/Makefile
    src/lib/Libdis/Makefile
    src/lib/Libifl/Makefile
    src/lib/Liblog/Makefile
    src/lib/Libnet/Makefile
    src/lib/Libsite/Makefile
    doc/Makefile
    doc/ers/Makefile
    "

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) 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.12"
    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 "$pbs_makefile_list ./src/include/pbs_config.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%@CFLAGS@%$CFLAGS%g
s%@CPPFLAGS@%$CPPFLAGS%g
s%@CXXFLAGS@%$CXXFLAGS%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%@maildomain@%$maildomain%g
s%@mandir@%$mandir%g
s%@PBS_MKDIRS@%$PBS_MKDIRS%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%@PART_DOCS@%$PART_DOCS%g
s%@PART_SERVER@%$PART_SERVER%g
s%@PART_MOM@%$PART_MOM%g
s%@PART_CLIENTS@%$PART_CLIENTS%g
s%@INST_MOM_SUBDIRS@%$INST_MOM_SUBDIRS%g
s%@INST_SERVER_SUBDIRS@%$INST_SERVER_SUBDIRS%g
s%@INST_CLIENTS_SUBDIRS@%$INST_CLIENTS_SUBDIRS%g
s%@BLD_MOM_SUBDIRS@%$BLD_MOM_SUBDIRS%g
s%@BLD_SERVER_SUBDIRS@%$BLD_SERVER_SUBDIRS%g
s%@BLD_CLIENTS_SUBDIRS@%$BLD_CLIENTS_SUBDIRS%g
s%@BLD_LIBS@%$BLD_LIBS%g
s%@GUI@%$GUI%g
s%@TCL_VER@%$TCL_VER%g
s%@TK_VER@%$TK_VER%g
s%@TCL_LIB_VER@%$TCL_LIB_VER%g
s%@TK_LIB_VER@%$TK_LIB_VER%g
s%@TOOLS_OBJS@%$TOOLS_OBJS%g
s%@TOOLS_TARGETS@%$TOOLS_TARGETS%g
s%@TCLSH_PATH@%$TCLSH_PATH%g
s%@WISH_PATH@%$WISH_PATH%g
s%@TCL@%$TCL%g
s%@TCLX@%$TCLX%g
s%@TCL_DIR@%$TCL_DIR%g
s%@TCLX_DIR@%$TCLX_DIR%g
s%@TCL_LIBS@%$TCL_LIBS%g
s%@TCL_INCS@%$TCL_INCS%g
s%@X11INC@%$X11INC%g
s%@X11LIB@%$X11LIB%g
s%@SCHD_CODE_SUBDIR@%$SCHD_CODE_SUBDIR%g
s%@SCP_PATH@%$SCP_PATH%g
s%@MOM_RCP@%$MOM_RCP%g
s%@PBSPOE@%$PBSPOE%g
s%@PBSPOEO@%$PBSPOEO%g
s%@EXTRA_QSTAT_LIBS@%$EXTRA_QSTAT_LIBS%g
s%@DEPEND_CACHE@%$DEPEND_CACHE%g
s%@SENDMAIL_CMD@%$SENDMAIL_CMD%g
s%@LEX@%$LEX%g
s%@LEXLIB@%$LEXLIB%g
s%@LN_S@%$LN_S%g
s%@SET_MAKE@%$SET_MAKE%g
s%@RANLIB@%$RANLIB%g
s%@YACC@%$YACC%g
s%@AR@%$AR%g
s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
s%@INSTALL_DATA@%$INSTALL_DATA%g
s%@TBL@%$TBL%g
s%@PIC@%$PIC%g
s%@ROFF@%$ROFF%g
s%@MAKE_POSIX_TARGET@%$MAKE_POSIX_TARGET%g
s%@MAKE_POSIX_PLUS@%$MAKE_POSIX_PLUS%g
s%@CC@%$CC%g
s%@MOM_ADDTL_OBJS@%$MOM_ADDTL_OBJS%g
s%@CPP@%$CPP%g
s%@READLINE_LIBS@%$READLINE_LIBS%g
s%@mkinclude_subdir@%$mkinclude_subdir%g
s%@pbs_os_version@%$pbs_os_version%g
s%@pbs_os_type@%$pbs_os_type%g
s%@NO_ASN1@%$NO_ASN1%g
s%@SCHD_TYPE@%$SCHD_TYPE%g
s%@SCHD_SRC@%$SCHD_SRC%g
s%@SCHD_BUILD@%$SCHD_BUILD%g
s%@PBS_DEFAULT_FILE@%$PBS_DEFAULT_FILE%g
s%@PBS_DEFAULT_SERVER@%$PBS_DEFAULT_SERVER%g
s%@PBS_SERVER_HOME@%$PBS_SERVER_HOME%g
s%@PBS_ENVIRON@%$PBS_ENVIRON%g
s%@MOMLIBS@%$MOMLIBS%g
s%@MAN_SUFFIX@%$MAN_SUFFIX%g
s%@PBS_MACH@%$PBS_MACH%g
s%@fundef@%$fundef%g
s%@DEPEND@%$DEPEND%g
s%@IFF_FILE@%$IFF_FILE%g
/@mk_cleanup@/r $mk_cleanup
s%@mk_cleanup@%%g
/@mk_dirs@/r $mk_dirs
s%@mk_dirs@%%g
/@mk_docplan@/r $mk_docplan
s%@mk_docplan@%%g
/@mk_lib@/r $mk_lib
s%@mk_lib@%%g
/@mk_head@/r $mk_head
s%@mk_head@%%g
/@mk_tail@/r $mk_tail
s%@mk_tail@%%g
/@mk_tcl@/r $mk_tcl
s%@mk_tcl@%%g
/@posix_rules@/r $posix_rules
s%@posix_rules@%%g
s%@MAKERULES@%$MAKERULES%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-"$pbs_makefile_list"}
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

  # start NAS PBS MODIFICATION
  # if ac_dots is nothing make the builddir "." to prevent accidental 
  # creation of an absolute path if someone puts a "/..." after it
  # otherwise strip the trailing slashes for aesthetic reasons
  if test -z "${ac_dots}"; then
    top_builddir=.
  else
    top_builddir=`echo "${ac_dots}" | sed 's%/*$%%'`
  fi
  #  end  NAS PBS MODIFICATION

  ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
# NAS PBS MODIFICATION (5 lines down, the line with the $ac_dots stuff)
  sed -e "$ac_comsub
s%@configure_input@%$configure_input%g
s%@srcdir@%$srcdir%g
s%@top_srcdir@%$top_srcdir%g
s%@top_builddir@%$top_builddir%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="./src/include/pbs_config.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

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

