changeset 19559:8d267cca249e gui-release

build: Don't build with g77. * bootstrap.conf: Remove bootstrap_epilogue () section. * configure.ac: Check for gfortran ahead of other Fortran compilers. Issue error message and stop configure if g77 is the only compiler found.
author Rik <rik@octave.org>
date Thu, 27 Nov 2014 18:54:22 -0800
parents 7c31a83e25bc
children f550bf908f47
files bootstrap.conf configure.ac
diffstat 2 files changed, 11 insertions(+), 18 deletions(-) [+]
line wrap: on
line diff
--- a/bootstrap.conf
+++ b/bootstrap.conf
@@ -188,19 +188,3 @@
   (cd libinterp/dldfcn; ./config-module.sh)
 }
 
-bootstrap_epilogue ()
-{
-  ## G77 is obsolete, but it is still the first option in the autoconf
-  ## Fortran macros.  We should avoid it, because mixing old versions of
-  ## g77 with modern gcc and g++ causes trouble.  The following will
-  ## make it harder (but not impossible) for users to make this mistake.
-  ##
-  ## FIXME -- we should really work to fix autoconf so that it prefers
-  ## gfortran over g77 even when searching for a Fortran 77 compiler.
-
-  echo "replacing all occurrences of g77 with gfortran in configure script..."
-
-  sed 's/g77/gfortran/g' configure > configure.t
-  mv configure.t configure
-  chmod 755 configure
-}
--- a/configure.ac
+++ b/configure.ac
@@ -613,8 +613,17 @@
   FFLAGS="-O"
 fi
 
-## the F77 variable, if set, overrides AC_PROG_F77 automatically
-AC_PROG_F77
+## Prefer gfortran, but the user's F77 environment variable will override.
+AC_PROG_F77([gfortran])
+if test -z "$F77"; then
+  ## No gfortran found, search for any other installed compiler.
+  AC_PROG_F77
+fi
+if test "$F77" = g77; then
+  AC_MSG_ERROR([g77 is not a supported Fortran compiler.  Select another compiler by setting the environment variable F77 and re-running configure.])
+fi
+
+## Determine calling conventions for Fortran compiler
 AC_F77_LIBRARY_LDFLAGS
 AC_F77_DUMMY_MAIN
 AC_F77_WRAPPERS