#!/bin/sh

# This file is generated by the configure script.

# use debugging code:                         no
# MPI (Message Passing Interface) support:    yes


# C compiler used for build: gcc (Debian/Linaro 4.9.2-10) 4.9.2
# --------------------------
# Using built-in specs.
# COLLECT_GCC=gcc
# COLLECT_LTO_WRAPPER=/usr/lib/gcc/aarch64-linux-gnu/4.9/lto-wrapper
# Target: aarch64-linux-gnu
# Configured with: ../src/configure -v --with-pkgversion='Debian/Linaro 4.9.2-10' --with-bugurl=file:///usr/share/doc/gcc-4.9/README.Bugs --enable-languages=c,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.9 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.9 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --disable-libsanitizer --disable-libquadmath --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-4.9-arm64/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-4.9-arm64 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-4.9-arm64 --with-arch-directory=arm64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-multiarch --enable-checking=release --build=aarch64-linux-gnu --host=aarch64-linux-gnu --target=aarch64-linux-gnu
# Thread model: posix
# gcc version 4.9.2 (Debian/Linaro 4.9.2-10) 

cc=gcc


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

version="1.0.4"


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

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

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

build_cppflags=" -D_FORTIFY_SOURCE=2 -DNDEBUG"
build_cflags="-std=c99 -funsigned-char -pedantic -W -Wall -Wshadow -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Wunused -Wfloat-equal -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wall"
build_ldflags=" -Wl,-z,relro -O"
build_libs="  -lm"

mpi_cppflags="-I/usr/include/mpi -DOMPI_SKIP_MPICXX"
mpi_cflags=""
mpi_ldflags=""
mpi_libs="-lmpi "


# 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: ple-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
        mpi
EOF
  exit 1
fi

case "$scope" in
  build)
    cppflags=$build_cppflags
    cflags=$build_cflags
    ldflags=$build_ldflags
    libs=$build_libs
    ;;
  mpi)
    cppflags=$mpi_cppflags
    cflags=$mpi_cflags
    ldflags=$mpi_ldflags
    libs=$mpi_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

