Ticket #43933: patch-admin-define-system.sh.diff

File patch-admin-define-system.sh.diff, 2.3 KB (added by smaret (Sebastien Maret), 10 years ago)
  • gildas-src-jun14a/admin/define-system.sh

    old new  
    227227                fi
    228228                if which ifort > /dev/null 2>&1; then
    229229                    DEFAULT_COMPILER=ifort
    230                 elif which gfortran > /dev/null 2>&1; then
    231                     DEFAULT_COMPILER=gfortran
     230                elif which @FC@ > /dev/null 2>&1; then
     231                    DEFAULT_COMPILER=@FC@
    232232                fi
    233233            fi ;;
    234234        CYGWIN*)
     
    297297        if [ "$GAG_COMPILER_KIND" = "ifort" ]; then
    298298            # Compress Major+Minor (no dot = easier preprocessing tests)
    299299            GAG_COMPILER_VERSION=`$GAG_COMPILER_EXE -v 2>&1 | head -1 | cut -d" " -f2 | sed "s%\.%%"`
    300         elif [ "$GAG_COMPILER_KIND" = "gfortran" ]; then
     300        elif [ "$GAG_COMPILER_KIND" != "${GAG_COMPILER_KIND/gfortran/}" ]; then
    301301            # Compress Major+Minor+Micro (no dot = easier preprocessing tests)
    302302            GAG_COMPILER_VERSION=`$GAG_COMPILER_EXE --version | head -1 | sed "s%.*[^0-9]\([0-9][0-9]*\)\.\([0-9][0-9]*\)\.\([0-9][0-9]*\).*%\1\2\3%"`
    303303            # Reject gfortran unstable versions
     
    346346                # GAG_COMPILER_CPPFLAGS="-DFORTRAN2003_PP"
    347347                :
    348348            fi
    349         elif [ "$GAG_COMPILER_KIND" = "gfortran" ]; then
     349        elif [ "$GAG_COMPILER_KIND" != "${GAG_COMPILER_KIND/gfortran/}" ]; then
    350350            GAG_COMPILER_LIBS="-lgfortran"
    351351            if [ "$GFORTRAN_VERSION3" ">" "4.5.1" ]; then
    352352                # Fortran 2003 pointer procedures:
     
    359359            fi
    360360        fi
    361361        #
    362         GCC_VERSION=`gcc --version | head -1 | sed "s%.*[^0-9]\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\).*%\1%"`
     362        GCC_VERSION=`@CC@ --version | head -1 | sed "s%.*[^0-9]\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\).*%\1%"`
    363363        if [ "$GCC_VERSION" ">" "4.7.9" ]; then
    364364            # See http://gcc.gnu.org/gcc-4.8/porting_to.html
    365365            GAG_COMPILER_CPPFLAGS="$GAG_COMPILER_CPPFLAGS -ffreestanding"
     366        elif [ "$GCC_VERSION" != "${GCC_VERSION/clang/}" ]; then
     367            GAG_COMPILER_CPPFLAGS="$GAG_COMPILER_CPPFLAGS -ffreestanding"
    366368        fi
    367369        #
    368370        export GAG_COMPILER_FFLAGS GAG_COMPILER_LIBS GAG_COMPILER_CPPFLAGS