dnl run "autom4te -l m4sh ga-config.in.m4sh > ga-config.in"
AS_INIT

prefix="@prefix@"
exec_prefix="@exec_prefix@"
dep_libs="-larmci @GA_MP_LIBS@ @ARMCI_NETWORK_LIBS@"
AS_IF([test -f "$prefix/bin/armci-config"], [
dep_libs=`$prefix/bin/armci-config --libs`
])


f77="@F77@"
cc="@CC@"
cppflags="@SCALAPACK_CPPFLAGS@ @LAPACK_CPPFLAGS@ @BLAS_CPPFLAGS@ @GA_MP_CPPFLAGS@ @ARMCI_NETWORK_CPPFLAGS@ @SICM_CPPFLAGS@ -I@includedir@"
network_cppflags="@ARMCI_NETWORK_CPPFLAGS@"
cflags="@GA_COPT@"
fflags="@GA_FOPT@ @FFLAG_INT@"
fint="@FFLAG_INT@"
blas_size="@blas_size@"
scalapack_size="@scalapack_size@"
use_blas="@have_blas@"
use_lapack="@have_lapack@"
use_scalapack="@have_scalapack@"
use_peigs="@enable_peigs@"
use_elpa="@have_elpa@"
use_elpa_2015="@have_elpa_2015@"
use_elpa_2016="@have_elpa_2016@"
use_sicm="@have_sicm@"
sicm_dev="@with_sicm_dev@"
ldflags="@SCALAPACK_LDFLAGS@ @LAPACK_LDFLAGS@ @BLAS_LDFLAGS@ @GA_MP_LDFLAGS@ @ARMCI_NETWORK_LDFLAGS@ @SICM_LDFLAGS@ -L@libdir@"
network_ldflags="@ARMCI_NETWORK_LDFLAGS@"
libs="-lga @SCALAPACK_LIBS@ @LAPACK_LIBS@ @BLAS_LIBS@ $dep_libs @SICM_LIBS@"
network_libs="@ARMCI_NETWORK_LIBS@"
flibs="@FLIBS@"
enable_f77_true="@ENABLE_F77_TRUE@"
version="@PACKAGE_VERSION@"

AS_IF([test "x$enable_f77_true" = x], [enable_f77=yes], [enable_f77=no])

[usage="Usage: ga-config [OPTIONS]...

With the exception of --version and --help, all other options can be combined
or run exclusively.  Output is echoed to stdout.

Options:

  --f77
  --cc
  --cppflags
  --cflags
  --fflags
  --fint
  --blas_size
  --scalapack_size
  --use_blas
  --use_lapack
  --use_scalapack
  --use_peigs
  --use_elpa
  --use_elpa_2015
  --use_elpa_2016
  --use_sicm
  --sicm_dev
  --ldflags
  --libs
  --flibs
  --network_ldflags
  --network_libs
  --network_cppflags
  --enable-f77
  --version
  --help
"]

result=

while test $# != 0
do
  case $1 in
  --*=?*)
    ac_option=`expr "X$1" : 'X\([^=]*\)='`
    ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'`
    ac_shift=:
    ;;
  --*=)
    ac_option=`expr "X$1" : 'X\([^=]*\)='`
    ac_optarg=
    ac_shift=:
    ;;
  *)
    ac_option=$1
    ac_optarg=$2
    ac_shift=shift
    ;;
  esac

  case $ac_option in
  # Handling of the options.
  -help | --help | --hel | --he | -h )
    AS_ECHO(["$usage"]); exit ;;
  -version | --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
    AS_ECHO(["$version"]); exit ;;
  -f77 | --f77)
    result="$result $f77" ;;
  -cc | --cc )
    result="$result $cc" ;;
  -cppflags | --cppflags )
    result="$result $cppflags" ;;
  -network_cppflags | --network_cppflags )
    result="$result $network_cppflags" ;;
  -cflags | --cflags )
    result="$result $cflags" ;;
  -fflags | --fflags )
    result="$result $fflags" ;;
  -ldflags | --ldflags )
    result="$result $ldflags" ;;
  -network_ldflags | --network_ldflags )
    result="$result $network_ldflags" ;;
  -libs | --libs )
    result="$result $libs" ;;
  -network_libs | --network_libs )
    result="$result $network_libs" ;;
  -flibs | --flibs )
    result="$result $flibs" ;;
  -fint | --fint )
    result="$result $fint" ;;
  -blas_size | --blas_size )
    result="$result $blas_size" ;;
  -scalapack_size | --scalapack_size )
    result="$result $scalapack_size" ;;
  -use_blas | --use_blas )
    result="$result $use_blas" ;;
  -use_lapack | --use_lapack )
    result="$result $use_lapack" ;;
  -use_scalapack | --use_scalapack )
    result="$result $use_scalapack" ;;
  -use_peigs | --use_peigs )
    result="$result $use_peigs" ;;
  -use_elpa | --use_elpa )
    result="$result $use_elpa" ;;
  -use_elpa_2015 | --use_elpa_2015 )
    result="$result $use_elpa_2015" ;;
  -use_elpa_2016 | --use_elpa_2016 )
    result="$result $use_elpa_2016" ;;
  -use_sicm | --use_sicm )
    result="$result $use_sicm" ;;    
  -sicm_dev | --sicm_dev )
    result="$result $sicm_dev" ;;      
  -enable-f77 | --enable-f77 )
    result="$result $enable_f77" ;;
  # This is an error.
  *) AS_ECHO(["unrecognized option: \`$1'
Try \`$0 --help' for more information."]); exit ;;
  esac
  shift
done

AS_ECHO(["$result"]) | sed 's/ [ ]*/ /g;s/" /"/g;s/ "/"/g;s/^ [ ]*//;s/ [ ]*$//'
