#!/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.

progname="`echo $0 | sed 's:^\./\./:\./:'`"
usage_msg="
Usage: ${progname} --mpi-inc-dir=MPI_INC_DIR
                   --mpi-lib-dir=MPI_LIB_DIR   [--mpi-lib-name=MPI_LIB_NAME]
                   --blas-lib-dir=BLAS_LIB_DIR [--blas-name=BLAS_LIB_NAME]
	           [-cc=C_COMPILER] [-f77=F77_COMPILER]

where
   MPI_INC_DIR   = where MPI C and Fortran include files can be found
   MPI_LIB_DIR   = where MPI library itself can be found 
   MPI_LIB_NAME  = what the MPI  library is called (default: 'libmpi.a')
   BLAS_LIB_DIR  = where BLAS library itself can be found 
   BLAS_LIB_NAME = what the BLAS library is called (default: 'libblas.a')
   C_COMPILER    = name of C compiler if not 'cc'
   F77_COMPILER  = name of F77 compiler if not 'f77'

The --mpi_inc_dir, --mpi_lib_dir, and --blas_lib_dir arguments must be
given, the others are optional.

To make for running on sun4's with mpi.h in /usr/local/mpi/include,
libmpi.a in /usr/local/mpi/lib, and libblas.a in /usr/local/blas/lib:

  ./configure --mpi-inc-dir=/usr/local/mpi/include  
              --mpi-lib-dir=/usr/local/mpi/lib      
              --blas-lib-dir=/usr/local/blas/lib
  make 

"

# Set initial values of variables

CC=cc
F77=f77
BLAS_LIB_NAME=blas
MPI_LIB_NAME=mpi

for arg
do
    case $arg in
     # For backward compatibility, also recognize exact --exec_prefix.
     -mpi-lib-dir=* | --mpi-lib-dir=*)
	MPI_LIB_DIR=`echo $arg | sed 's/[-a-z_]*=//'` 
         ;;

     -mpi-lib-name=* | --mpi-lib-name=*)
	MPI_LIB_NAME=`echo $arg | sed 's/[-a-z_]*=//; s/^lib//; 's/\.a$//'` 
         ;;

     -blas-lib-dir=* | --blas-lib-dir=*)
	BLAS_LIB_DIR=`echo $arg | sed 's/[-a-z_]*=//'` 
         ;;

     -blas-lib-name=* | --blas-lib-name=*)
	BLAS_LIB_NAME=`echo $arg | sed 's/[-a-z_]*=//; s/^lib//; 's/\.a$//'` 
         ;;

     -mpi-inc-dir=* | --mpi-inc-dir=*)
	MPI_INC_DIR=`echo $arg | sed 's/[-a-z_]*=//'` 
         ;;

     -cc=* | --cc=*)
	CC=`echo $arg | sed 's/[-a-z_]*=//'` 
         ;;

     -f77=* | --f77=*)
	F77=`echo $arg | sed 's/[-a-z_7]*=//'` 
         ;;

     -u | -usage | --usage | --usag | --usa | --us | --u)
       (echo "${usage_msg}") >& 2
       exit 1 ;;

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

     *) ;;
    esac
done

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

# Save the original args if we used an alternate arg parser.
ac_configure_temp="${configure_args-$*}"
# Strip out --no-create and --norecursion so they don't pile up.
configure_args=
for ac_arg in $ac_configure_temp; do
  case "$ac_arg" in
  -no-create | --no-create | --no-creat | --no-crea | --no-cre \
  | --no-cr | --no-c) ;;
  -norecursion | --norecursion | --norecursio | --norecursi \
  | --norecurs | --norecur | --norecu | --norec | --nore | --nor) ;;
  *) configure_args="$configure_args $ac_arg" ;;
  esac
done

# 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

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

# 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 `..'.
  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
fi
if test ! -r $srcdir/$ac_unique_file; then
  if test x$ac_srcdir_defaulted = xyes; then
    echo "configure: can not find sources in ${ac_confdir} or .." >&2; exit 1
  else
    echo "configure: can not find sources in ${srcdir}" >&2; exit 1
  fi
fi
ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='${CPP}'
ac_compile='${CC-cc} $CFLAGS $LDFLAGS conftest.${ac_ext} -o conftest $LIBS >/dev/null 2>&1'




# The preferred way to propogate these variables is regular @ substitutions.
if test -n "$prefix"; then
  ac_prsub="s%^prefix\\([ 	]*\\)=\\([ 	]*\\).*$%prefix\\1=\\2$prefix%"
else
  prefix=/usr/local
fi
if test -n "$exec_prefix"; then
  ac_prsub="$ac_prsub
s%^exec_prefix\\([ 	]*\\)=\\([ 	]*\\).*$%exec_prefix\\1=\\2$exec_prefix%"
else
  exec_prefix='${prefix}' # Let make expand it.
fi

# 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

# Quote sed substitution magic chars in DEFS.
cat >conftest.def <<EOF
$DEFS
EOF
ac_escape_ampersand_and_backslash='s%[&\\]%\\&%g'
DEFS=`sed "$ac_escape_ampersand_and_backslash" <conftest.def`
rm -f conftest.def
# Substitute for predefined variables.

trap 'rm -f config.status; exit 1' 1 2 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

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 $configure_args --no-create
    exec \${CONFIG_SHELL-/bin/sh} $0 $configure_args --no-create ;;
  -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
    echo "config.status generated by autoconf version 1.11"
    exit 0 ;;
  -help | --help | --hel | --he | --h)
    echo "\$ac_cs_usage"; exit 0 ;;
  *) echo "\$ac_cs_usage"; exit 1 ;;
  esac
done

trap 'rm -f Makefile; exit 1' 1 2 15
CC='$CC'
F77='$F77'
MPI_LIB_DIR='$MPI_LIB_DIR'
MPI_INC_DIR='$MPI_INC_DIR'
MPI_LIB_NAME='$MPI_LIB_NAME'
BLAS_LIB_DIR='$BLAS_LIB_DIR'
BLAS_LIB_NAME='$BLAS_LIB_NAME'
LIBS='$LIBS'
srcdir='$srcdir'
top_srcdir='$top_srcdir'
prefix='$prefix'
exec_prefix='$exec_prefix'
DEFS='$DEFS'
ac_prsub='$ac_prsub'
ac_vpsub='$ac_vpsub'
extrasub='$extrasub'
EOF
cat >> config.status <<\EOF

ac_given_srcdir=$srcdir

CONFIG_FILES=${CONFIG_FILES-"Makefile"}
for ac_file in .. ${CONFIG_FILES}; do if test "x$ac_file" != x..; then
  # 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="/$ac_dir"
  else
    ac_dir_suffix=
  fi

  # A "../" for each directory in $ac_dir_suffix.
  ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
  case "$ac_given_srcdir" in
  .)  srcdir=.
      if test -z "$ac_dir_suffix"; 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

  echo creating "$ac_file"
  rm -f "$ac_file"
  comment_str="Generated automatically from `echo $ac_file|sed 's|.*/||'`.in by configure."
  case "$ac_file" in
    *.c | *.h | *.C | *.cc | *.m )  echo "/* $comment_str */" > "$ac_file" ;;
    * )          echo "# $comment_str"     > "$ac_file" ;;
  esac
  sed -e "
$ac_prsub
$ac_vpsub
$extrasub
s%@CC@%$CC%g
s%@F77@%$F77%g
s%@MPI_LIB_DIR@%$MPI_LIB_DIR%g
s%@MPI_INC_DIR@%$MPI_INC_DIR%g
s%@MPI_LIB_NAME@%$MPI_LIB_NAME%g
s%@BLAS_LIB_DIR@%$BLAS_LIB_DIR%g
s%@BLAS_LIB_NAME@%$BLAS_LIB_NAME%g
s%@LIBS@%$LIBS%g
s%@srcdir@%$srcdir%g
s%@top_srcdir@%$top_srcdir%g
s%@prefix@%$prefix%g
s%@exec_prefix@%$exec_prefix%g
s%@DEFS@%$DEFS%
" $ac_given_srcdir/${ac_file}.in >> $ac_file
fi; done


exit 0
EOF
chmod +x config.status
# Some shells look in PATH for config.status without the "./".
test -n "$no_create" || ${CONFIG_SHELL-/bin/sh} ./config.status
