#!/bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated automatically using autoconf.
# Copyright (C) 1991, 1992, 1993 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.

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

# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#
CONFIGURE_ARGS="$*"
if test -n "$CONFIGURE_ARGS" ; then
    echo "Configuring with args $CONFIGURE_ARGS"
fi
progname="`echo $0 | sed 's:^\./\./:\./:'`"
usage_msg="
Usage: ${progname} -p4arch=ARCH_TYPE [-alog={on,off}] [-sysv_ipc={on,off}]
                   [-vendor_ipc={on,off}] [-dprintfl={on,off}]
                   [-listener_pathname="\<pathname\>"]
"
for arg
do
case $arg in
  -p4arch=*)
     p4arch=`echo $arg|sed 's/-p4arch=//'`
     eval "p4arch_`echo $p4arch`=1"
     echo Setting p4arch to $p4arch
     ;;
  -p4echo=*)
     p4echo=`echo $arg|sed 's/-p4echo=//'`
     echo $p4echo
     ;;
  -alog=*)
     p4alog=`echo $arg|sed 's/-alog=//'`
     echo Setting p4alog to $p4alog
     ;;
  -sysv_ipc=*)
     p4sysv_ipc=`echo $arg|sed 's/-sysv_ipc=//'`
     echo Setting p4sysv_ipc to $p4sysv_ipc
     ;;
  -vendor_ipc=*)
     p4vendor_ipc=`echo $arg|sed 's/-vendor_ipc=//'`
     echo Setting p4vendor_ipc to $p4vendor_ipc
     ;;
  -dprintfl=*)
     p4dprintfl=`echo $arg|sed 's/-dprintfl=//'`
     echo Setting p4dprintfl to $p4dprintfl
     ;;
  -listener_pathname=*)
     p4listener_pathname=`echo $arg|sed 's/-listener_pathname=//'`
     echo Setting p4listener_pathname to $p4listener_pathname
     ;;
  -u | -usage)
     (echo "${usage_msg}") >& 2
     exit 1
     ;;
   *)
     echo "Invalid p4 configure option $arg"
     (echo "${usage_msg}") >& 2
     ;;
esac
done
P4ARCH="unknown"
MAKE=make
CC=cc
FC=f77
CLINKER=cc
FLINKER=f77
RANLIB=ranlib
AR="ar lruv"
RM=/bin/rm
MDEP_LIBS=
MDEP_CFLAGS=
MDEP_FFLAGS=
MDEP_LFLAGS=
P4_OBJ="\$(P4_COMM_OBJ) \$(P4_SOCK_OBJ) \$(P4_SHMEM_OBJ)"
P4_CONFIGURED_TIME="`date`"
DEFINE_ALOG="#undef ALOG_TRACE"
DEFINE_SYSV_IPC="#undef SYSV_IPC"
DEFINE_VENDOR_IPC="#undef VENDOR_IPC"
DEFINE_P4_DPRINTFL="#define P4_DPRINTFL"
LISTENER_PATHNAME=""

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

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

rm -f conftest* confdefs.h
# AIX cpp loses on an empty file, so make sure it contains at least a newline.
echo > confdefs.h
compile='${CC-cc} $CFLAGS conftest.c -o conftest $LIBS >/dev/null 2>&1'

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

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


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

if test -n "$p4arch_SUN"; then
P4ARCH=SUN
fi
if test -n "$p4arch_FREEBSD"; then
P4ARCH=FREEBSD
fi
if test -n "$p4arch_LINUX"; then
P4ARCH=LINUX
fi
if test -n "$p4arch_SUN_SOLARIS"; then
P4ARCH=SUN_SOLARIS
AR="ar ruv"
MDEP_LIBS="-lsocket -lnsl  -lthread"
fi
if test -n "$p4arch_HP"; then
P4ARCH=HP
RANLIB=true
MDEP_LIBS="-lV3 -lU77"
MDEP_FFLAGS=+U77
fi
if test -n "$p4arch_ALPHA"; then
P4ARCH=ALPHA
fi
if test -n "$p4arch_DEC5000"; then
P4ARCH=DEC5000
fi
if test -n "$p4arch_RS6000"; then
P4ARCH=RS6000
FC=xlf
FLINKER=xlf
RANLIB=true
MDEP_LIBS=-lbsd
MDEP_CFLAGS=-D_ALL_SOURCE
fi
if test -n "$p4arch_SP1"; then
P4ARCH=SP1
FC=xlf
FLINKER=xlf
RANLIB=true
MDEP_LIBS=-lbsd
fi
if test -n "$p4arch_SP1_EUI"; then
P4ARCH=SP1_EUI
FC=mpxlf
CC=mpcc
FLINKER=xlf
CLINKER=mpcc
RANLIB=true
MDEP_LIBS=-lbsd
MDEP_CFLAGS = -I/usr/lpp/poe/include
fi
if test -n "$p4arch_SP1_EUI"; then
P4ARCH=SP1_EUIH
FC=xlf
CC=cc
FLINKER="xlf -bimport:/usr/lpp/euih/eui/eui.exp"
CLINKER="xlc -bimport:/usr/lpp/euih/eui/eui.exp -e main"
RANLIB=true
MDEP_LIBS=-lbsd
MDEP_CFLAGS=-D_ALL_SOURCE
fi
if test -n "$p4arch_SGI"; then
P4ARCH=SGI
RANLIB=true
MDEP_LIBS=-lsun
MDEP_CFLAGS=-cckr
fi
if test -n "$p4arch_SGI_MP"; then
P4ARCH=SGI_MP
RANLIB=true
MDEP_LIBS=-lsun
MDEP_CFLAGS=-cckr
fi
if test -n "$p4arch_SGI_CH"; then
P4ARCH=SGI_CH
RANLIB=true
MDEP_CFLAGS="-cckr -64 -mips3 -non_shared -woff 1552,1174"
MDEP_FFLAGS="-cckr -64 -mips3 -non_shared -woff 1552,1174"
fi
if test -n "$p4arch_SGI_CH64"; then
P4ARCH=SGI_CH64
RANLIB=true
MDEP_CFLAGS="-cckr -64 -mips4 -non_shared -woff 1552,1174"
MDEP_FFLAGS="-cckr -64 -mips4 -non_shared -woff 1552,1174"
fi
/bin/rm -f mpdepcflags
echo $MDEP_CFLAGS > mdepcflags
if test "$p4alog" = "on"; then
DEFINE_ALOG="#define ALOG_TRACE"
fi
if test "$p4sysv_ipc" = "on"; then
DEFINE_SYSV_IPC="#define SYSV_IPC"
fi
if test "$p4vendor_ipc" = "on"; then
DEFINE_VENDOR_IPC="#define VENDOR_IPC"
fi
if test "$p4dprintfl" = "off"; then
DEFINE_P4_DPRINTFL="#undef P4_DPRINTFL"
fi
if test -n "$p4listener_pathname"; then
LISTENER_PATHNAME="$p4listener_pathname"
fi
# Set default prefixes.
if test -n "$prefix"; then
  test -z "$exec_prefix" && exec_prefix='${prefix}'
  prsub="s%^prefix\\([ 	]*\\)=\\([ 	]*\\).*$%prefix\\1=\\2$prefix%"
fi
if test -n "$exec_prefix"; then
  prsub="$prsub
s%^exec_prefix\\([ 	]*\\)=\\([ 	]*\\).*$%exec_prefix\\1=\\2$exec_prefix%"
fi
# Quote sed substitution magic chars in DEFS.
cat >conftest.def <<EOF
$DEFS
EOF
escape_ampersand_and_backslash='s%[&\\]%\\&%g'
DEFS=`sed "$escape_ampersand_and_backslash" <conftest.def`
rm -f conftest.def
# Substitute for predefined variables.

trap 'rm -f config.status; exit 1' 1 3 15
echo creating config.status
rm -f config.status
cat > config.status <<EOF
#!/bin/sh
# Generated automatically by configure.
# Run this file to recreate the current configuration.
# This directory was configured as follows,
# on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
#
# $0 $configure_args

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

trap 'rm -f Makefile; exit 1' 1 3 15
P4ARCH='$P4ARCH'
MAKE='$MAKE'
CC='$CC'
FC='$FC'
CLINKER='$CLINKER'
FLINKER='$FLINKER'
AR='$AR'
RANLIB='$RANLIB'
RM='$RM'
P4_OBJ='$P4_OBJ'
MDEP_LIBS='$MDEP_LIBS'
MDEP_CFLAGS='$MDEP_CFLAGS'
MDEP_FFLAGS='$MDEP_FFLAGS'
MDEP_LFLAGS='$MDEP_LFLAGS'
P4_CONFIGURED_TIME='$P4_CONFIGURED_TIME'
DEFINE_ALOG='$DEFINE_ALOG'
DEFINE_SYSV_IPC='$DEFINE_SYSV_IPC'
DEFINE_VENDOR_IPC='$DEFINE_VENDOR_IPC'
DEFINE_P4_DPRINTFL='$DEFINE_P4_DPRINTFL'
LISTENER_PATHNAME='$LISTENER_PATHNAME'
LIBS='$LIBS'
srcdir='$srcdir'
DEFS='$DEFS'
prefix='$prefix'
exec_prefix='$exec_prefix'
prsub='$prsub'
extrasub='$extrasub'
EOF
cat >> config.status <<\EOF

top_srcdir=$srcdir

CONFIG_FILES=${CONFIG_FILES-"Makefile"}
for file in .. ${CONFIG_FILES}; do if test "x$file" != x..; then
  srcdir=$top_srcdir
  # Remove last slash and all that follows it.  Not all systems have dirname.
  dir=`echo $file|sed 's%/[^/][^/]*$%%'`
  if test "$dir" != "$file"; then
    test "$top_srcdir" != . && srcdir=$top_srcdir/$dir
    test ! -d $dir && mkdir $dir
  fi
  echo creating $file
  rm -f $file
  echo "# Generated automatically from `echo $file|sed 's|.*/||'`.in by configure." > $file
cat $top_srcdir/${file}.in | sed -e "
$prsub
$extrasub
s%@P4ARCH@%$P4ARCH%g
s%@MAKE@%$MAKE%g
s%@CC@%$CC%g
s%@FC@%$FC%g
s%@CLINKER@%$CLINKER%g
s%@FLINKER@%$FLINKER%g
s%@AR@%$AR%g
s%@RANLIB@%$RANLIB%g
s%@RM@%$RM%g
s%@P4_OBJ@%$P4_OBJ%g
s%@MDEP_LIBS@%$MDEP_LIBS%g
s%@MDEP_CFLAGS@%$MDEP_CFLAGS%g
s%@MDEP_FFLAGS@%$MDEP_FFLAGS%g
s%@MDEP_LFLAGS@%$MDEP_LFLAGS%g
s%@P4_CONFIGURED_TIME@%$P4_CONFIGURED_TIME%g
s%@DEFINE_ALOG@%$DEFINE_ALOG%g
s%@DEFINE_SYSV_IPC@%$DEFINE_SYSV_IPC%g
s%@DEFINE_VENDOR_IPC@%$DEFINE_VENDOR_IPC%g
s%@DEFINE_P4_DPRINTFL@%$DEFINE_P4_DPRINTFL%g
s%@LISTENER_PATHNAME@%$LISTENER_PATHNAME%g
s%@LIBS@%$LIBS%g
s%@srcdir@%$srcdir%g
s%@DEFS@%$DEFS%
" >> $file
fi; done


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



