#!/bin/sh

cat >&2 <<ENDOFWARNING
WARNING: The sage_fortran script is deprecated since Sage 5.11 and
might not be supported in future versions of Sage. You should update
your package to use the standard environment variable \$FC instead.

ENDOFWARNING

if [ "x$FC" = x ]; then
    # Default value determined in spkg/install
    myFC='gfortran'
else
    myFC="$FC"
fi

# unset FC to avoid an infinite loop in the case that FC=sage_fortran.
unset FC

if [ "$SAGE64" = yes ]; then
    exec $myFC -m64 -fPIC "$@"
else
    exec $myFC -fPIC "$@"
fi
