# Copyright 1999-2004 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header$ # # Author: Danny van Dyk # ECLASS=fortran INHERITED="$INHERITED $ECLASS" DESCRIPTION="Based on the ${ECLASS} eclass" # need_fortran # # profiles = ... # profile = - # # compiler: # * f77 - GCC Fortran 77 # * f2c - Fortran 2 C Translator # * ifc - Intel Fortran Compiler need_fortran() { if [ -z "$@" ]; then eerror "Call need_fortran with at least one argument !" fi FORTAN="" for PROFILE in $@; do case ${PROFILE} in f77) if [ -x "$(which g77 2> /dev/null)" ]; then FORTRAN="${FORTRAN} f77" fi ;; f2c) if [ -x "$(which f2c 2> /dev/null)" ]; then FORTRAN="${FORTRAN} f2c" fi ;; ifc) case ${ARCH} in x86|ia64) if [ -x "$(which if2 2> /dev/null)" ]; then FORTRAN="${FORTRAN} ifc" fi ;; *) ;; esac ;; esac done if [ -z "${FORTRAN}" ]; then eerror "None of the needed Fortran Compilers ($@) is installed." eerror "To install one of these, choose one of the following steps:" i=1 for PROFILE in $@; do case ${PROFILE} in f77) eerror "[${i}] USE=\"f77\" emerge sys-devel/gcc" ;; f2c) eerror "[${i}] emerge dev-lang/f2c" ;; ifc) case ${ARCH} in x86|ia64) eerror "[${i}] emerge dev-lang/ifc" ;; *) ;; esac esac i=$((i + 1)) done die "Install a Fortran Compiler !" else einfo "You need one of these Fortran Compilers: $@" einfo "Installed are:${FORTRAN}" fi }