diff options
-rw-r--r-- | eclass/fortran.eclass | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/eclass/fortran.eclass b/eclass/fortran.eclass index cbb3d93..dcf4cba 100644 --- a/eclass/fortran.eclass +++ b/eclass/fortran.eclass @@ -50,26 +50,26 @@ need_fortran() { for PROFILE in $@; do case ${PROFILE} in gfortran) - if [ -x "$(which gfortran 2> /dev/null)" ]; then + if [ -x "$(type -P gfortran 2> /dev/null)" ]; then AVAILABLE="${AVAILABLE} gfortran" fi ;; g77) - if [ -x "$(which g77 2> /dev/null)" ]; then + if [ -x "$(type -P g77 2> /dev/null)" ]; then AVAILABLE="${AVAILABLE} g77" fi ;; f2c) - if [ -x "$(which f2c 2> /dev/null)" ]; then + if [ -x "$(type -P f2c 2> /dev/null)" ]; then AVAILABLE="${AVAILABLE} f2c" fi ;; ifc) case ${ARCH} in x86|ia64|amd64) - if [ -x "$(which ifort 2> /dev/null)" ]; then + if [ -x "$(type -P ifort 2> /dev/null)" ]; then AVAILABLE="${AVAILABLE} ifort" - elif [ -x "$(which ifc 2> /dev/null)" ]; then + elif [ -x "$(type -P ifc 2> /dev/null)" ]; then AVAILABLE="${AVAILABLE} ifc" fi ;; @@ -80,7 +80,7 @@ need_fortran() { f95) case ${ARCH} in x86|amd64) - if [ -x "$(which f95 2> /dev/null)" ]; then + if [ -x "$(type -P f95 2> /dev/null)" ]; then AVAILABLE="${AVAILABLE} f95" fi ;; @@ -181,7 +181,7 @@ need_fortran() { # patch_fortran(): # Apply necessary patches for ${FORTRANC} patch_fortran() { - if [ -z "${FORTRANC}" ]; then + if [[ -z "${FORTRANC}" || ! -d "${FILESDIR}" ]]; then return fi local PATCHES=$(find ${FILESDIR} -name "${P}-${FORTRANC}-*") |