From 441f42d95bbf468a06106aa45cef5ef0e0d29688 Mon Sep 17 00:00:00 2001 From: bangerth Date: Fri, 8 Jun 2012 08:35:23 +0000 Subject: [PATCH] Allow selecting something different than gfortran by setting the F77 environment variable. git-svn-id: https://svn.dealii.org/trunk@25614 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/configure | 51 +++++++++++++++++++++++++++++++++----- deal.II/configure.in | 16 +++++++++++- deal.II/doc/news/changes.h | 7 ++++++ 3 files changed, 67 insertions(+), 7 deletions(-) diff --git a/deal.II/configure b/deal.II/configure index 0d70c483b9..995c3826f5 100755 --- a/deal.II/configure +++ b/deal.II/configure @@ -1,5 +1,5 @@ #! /bin/sh -# From configure.in Revision: 25397 . +# From configure.in Revision: 25492 . # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.68 for deal.II 7.2.pre. # @@ -9563,10 +9563,9 @@ $as_echo "" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: ---------------- configuring F77 compilers ------------------" >&5 $as_echo "---------------- configuring F77 compilers ------------------" >&6; } -for ac_prog in gfortran f77 g77 -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 +if test "x$F77" = "x" ; then + # Extract the first word of "gfortran f77 g77", so it can be a program name with args. +set dummy gfortran f77 g77; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_F77+:} false; then : @@ -9605,8 +9604,48 @@ $as_echo "no" >&6; } fi - test -n "$F77" && break +else + # Extract the first word of "$F77", so it can be a program name with args. +set dummy $F77; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_F77+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $F77 in + [\\/]* | ?:[\\/]*) + ac_cv_path_F77="$F77" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_F77="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi done + done +IFS=$as_save_IFS + + ;; +esac +fi +F77=$ac_cv_path_F77 +if test -n "$F77"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $F77" >&5 +$as_echo "$F77" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi if test "x$F77" != "x" ; then diff --git a/deal.II/configure.in b/deal.II/configure.in index f2e3b1c4dd..d513f5271b 100644 --- a/deal.II/configure.in +++ b/deal.II/configure.in @@ -279,7 +279,21 @@ dnl dnl It is possible that no Fortran 77 compiler was found. Don't care, dnl it may be that we don't need one (but we check below, when we must dnl have it). -AC_PATH_PROGS(F77, [gfortran f77 g77]) +dnl +dnl Note: While the autoconf documentation says that the AC_PATH_PROG +dnl macro does nothing if the output variable (here: $F77) is already +dnl set, this doesn't appear to be the case: if you set $F77 on the +dnl command line, then it still finds /usr/bin/gfortran if gfortran +dnl is listed first in the square brackets. Confusingly, it doesn't +dnl find /usr/bin/gfortran if the order of things in square brackets +dnl does *not* list gfortran first. Thus, explicitly test whether F77 +dnl is set and then short-circuit the process. +if test "x$F77" = "x" ; then + AC_PATH_PROG(F77, [gfortran f77 g77]) +else + AC_PATH_PROG(F77, [$F77]) +fi + dnl Next determine which f77 compiler we have here and set compilation dnl flags accordingly. Only do that if we have an F77 compiler at all. diff --git a/deal.II/doc/news/changes.h b/deal.II/doc/news/changes.h index 433d9febb0..48cab3d81b 100644 --- a/deal.II/doc/news/changes.h +++ b/deal.II/doc/news/changes.h @@ -47,6 +47,13 @@ used for boundary indicators.
    +
  1. +Fixed: Due to an apparent bug in autoconf, it was not possible to +override the F77 environment variable to select anything +else than gfortran. This is now fixed. +
    +(Wolfgang Bangerth, 2012/06/08) +
  2. New: step-43 is an extension of step-21 that shows efficient methods to solve multi-phase flow. -- 2.39.5