#!/bin/sh -f

if test "$ELMER_LIB" = ""; then
  if  test "$ELMER_HOME" = ""; then
     LIBDIR="/usr/lib/elmersolver/lib"
  else
     LIBDIR=$ELMER_HOME/lib
  fi
else
  LIBDIR=$ELMER_LIB
fi

LD=/usr/bin/gfortran
cmd="$LD -Og -g -fmessage-length=0 -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables -DNDEBUG -fPIC -shared $* -L/usr/lib/elmersolver -L$LIBDIR -L/usr/lib -lelmersolver"
printf "%s " $cmd
printf "\n"
$LD -Og -g -fmessage-length=0 -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables -DNDEBUG -fPIC -shared $* -L/usr/lib/elmersolver -L$LIBDIR -lelmersolver
#      $* -L$LIBDIR -lelmersolver
#      $*
