#!/bin/sh

# This file is generated by the configure script.

# use debugging code:                         false
# MPI (Message Passing Interface) support:    no
# HDF5 (Hierarchical Data Format) support:    yes
# CGNS (CFD General Notation System) support: yes
# MED (Model for Exchange of Data) support:   no


# C compiler used for build: cc (Debian 4.4.5-2) 4.4.5
# --------------------------
# Using built-in specs.
# Target: mips-linux-gnu
# Configured with: ../src/configure -v --with-pkgversion='Debian 4.4.5-2' --with-bugurl=file:///usr/share/doc/gcc-4.4/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.4 --enable-shared --enable-multiarch --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.4 --libdir=/usr/lib --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug --disable-libssp --enable-targets=all --enable-checking=release --build=mips-linux-gnu --host=mips-linux-gnu --target=mips-linux-gnu
# Thread model: posix
# gcc version 4.4.5 (Debian 4.4.5-2) 

cc=cc


# Package Version
#----------------

version="0.15.0"


# Installation directories
#-------------------------

prefix="/usr"
exec_prefix="${prefix}"
includedir="${prefix}/include"
libdir="${exec_prefix}/lib"

cppflags=""
cflags=""
ldflags=""
libs=" -lm"

build_cppflags=""
build_cflags="-g -O2 -g -Wall -O2 -Wl,-z,defs"
build_ldflags=" -O"
build_libs=" -lm"

bft_cppflags=" "
bft_cflags=""
bft_ldflags=" "
bft_libs="-lbft -lz"

mpi_cppflags=""
mpi_cflags=""
mpi_ldflags=""
mpi_libs=""

hdf5_cppflags=""
hdf5_cflags=""
hdf5_ldflags=""
hdf5_libs="-lhdf5 "

cgns_cppflags=""
cgns_cflags=""
cgns_ldflags=""
cgns_libs="-lcgns"

med_cppflags=""
med_cflags=""
med_ldflags=""
med_libs=""


# Output info depending on command-line options
#----------------------------------------------

if test $# -eq 0; then
  show_help=yes

else
  for opt in $*
  do
    case $opt in
      --prefix)
        output="${output} $prefix"
        ;;
      --exec-prefix)
        if test "$exec_prefix" != "" ; then
          output="${output} $exec_prefix"
        else
          output="${output} $prefix/bin"
        fi
        ;;
      --includedir)
        if test "$includedir" != "" ; then
          output="${output} $includedir"
        else
          output="${output} $prefix/include"
        fi
        ;;
      --version)
        output="${output} $version"
        ;;
      --cppflags)
        echo_cppflags=yes
        ;;
      --cflags)
        echo_cflags=yes
        ;;
      --ldflags)
        echo_ldflags=yes
        ;;
      --libs)
        echo_libs=yes
        ;;
      --cc)
        output="${output} $cc"
        ;;
      -*)
        show_help=yes
        ;;
      *)
        scope=$opt
        ;;
    esac
  done
fi

if test "$show_help" = "yes"; then
  cat <<EOF
Usage: fvm-config options scope

Options:
        --prefix            installation path prefix
        --exec-prefix       system-dependent path prefix
        --includedir        C header files path
        --version           library version

        --cppflags          C preprocessor flags (e.g. -D<macro>, ...)
        --cflags            C flags (e.g. -O, -g, ...)
        --ldflags           linker flags (e.g. -g, -L<path>, ...)
        --libs              librairies used (e.g. -l<libname>)

        --cc                C compiler used for build

Scope:
        use (default)       Options required for user code
        build               Options used for build
        bft
        mpi
        hdf5
        cgns
        med
EOF
  exit 1
fi

case "$scope" in
  build)
    cppflags=$build_cppflags
    cflags=$build_cflags
    ldflags=$build_ldflags
    libs=$build_libs
    ;;
  bft)
    cppflags=$bft_cppflags
    cflags=$bft_cflags
    ldflags=$bft_ldflags
    libs=$bft_libs
    ;;
  mpi)
    cppflags=$mpi_cppflags
    cflags=$mpi_cflags
    ldflags=$mpi_ldflags
    libs=$mpi_libs
    ;;
  hdf5)
    cppflags=$hdf5_cppflags
    cflags=$hdf5_cflags
    ldflags=$hdf5_ldflags
    libs=$hdf5_libs
    ;;
  cgns)
    cppflags=$cgns_cppflags
    cflags=$cgns_cflags
    ldflags=$cgns_ldflags
    libs=$cgns_libs
    ;;
  med)
    cppflags=$med_cppflags
    cflags=$med_cflags
    ldflags=$med_ldflags
    libs=$med_libs
    ;;
esac

if test "$echo_cppflags" = "yes" ; then
  output="${output} $cppflags"
fi
if test "$echo_cflags" = "yes" ; then
  output="${output} $cflags"
fi
if test "$echo_ldflags" = "yes" ; then
  output="${output} $ldflags"
fi
if test "$echo_libs" = "yes" ; then
  output="${output} $libs"
fi

if test "$output" != "" ; then
  echo $output
fi

