Skip to content

Commit

Permalink
Trac #26715: build/pkgs/gfortran/spkg-configure.m4 works incorrectly …
Browse files Browse the repository at this point in the history
…if CC and CXX are already there

As a result of refactoring configure.ac in #24919,
absence of (g)fortran now forces installation of full gcc, instead of
just gfortran part of it.

This is particularly crucial on OSX, where we don't normally build full
gcc any more, but only build gfortran.

To reproduce, move gfortran out of your PATH, and re-run ./configure.
You'll see that now `gcc` and `gfortran` are scheduled for
installation...

URL: https://trac.sagemath.org/26715
Reported by: dimpase
Ticket author(s): François Bissey
Reviewer(s): Erik Bray
  • Loading branch information
Release Manager authored and vbraun committed Nov 20, 2018
2 parents 51d1404 + 3185e91 commit 10d1b68
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 26 deletions.
2 changes: 0 additions & 2 deletions build/pkgs/gcc/spkg-configure.m4
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ SAGE_SPKG_CONFIGURE([gcc], [
AC_REQUIRE([AC_PROG_CC])
AC_REQUIRE([AC_PROG_CPP])
AC_REQUIRE([AC_PROG_CXX])
AC_REQUIRE([AC_PROG_FC])
AC_REQUIRE([AC_PROG_OBJC])
AC_REQUIRE([AC_PROG_OBJCXX])
Expand Down Expand Up @@ -149,7 +148,6 @@ SAGE_SPKG_CONFIGURE([gcc], [
SAGE_SHOULD_INSTALL_GCC([$CC ($GCC_VERSION) and $CXX ($GXX_VERSION) are not the same version])
fi
# assuming gfortran does work
fi
# Check that the assembler and linker used by $CXX match $AS and $LD.
Expand Down
35 changes: 11 additions & 24 deletions build/pkgs/gfortran/spkg-configure.m4
Original file line number Diff line number Diff line change
@@ -1,33 +1,20 @@
SAGE_SPKG_CONFIGURE([gfortran], [
AC_REQUIRE([AC_PROG_FC])
AC_REQUIRE([SAGE_SPKG_CONFIGURE_GCC])
AC_REQUIRE([AC_PROG_FC])
# Check that the Fortran compiler accepts free-format source code (as
# opposed to the older fixed-format style from Fortran 77).
# This helps verify the compiler works too, so if some idiot sets FC to
# /usr/bin/ls, we will at least know it's not a working Fortran
# compiler.
AC_FC_FREEFORM([], [
AC_MSG_NOTICE([Your Fortran compiler does not accept free-format source code])
AC_MSG_NOTICE([which means the compiler is either seriously broken, or])
AC_MSG_NOTICE([is too old to build Sage.])
sage_spkg_install_gfortran=yes])
# Special case: If we are already installing gcc then don't install
# gfortran since it's included
if test "x$sage_spkg_install_gcc" = "xyes" -o x$SAGE_INSTALL_GCC = xexists; then
sage_spkg_install_gfortran=no
else
# Check that the Fortran compiler accepts free-format source code (as
# opposed to the older fixed-format style from Fortran 77).
# This helps verify the compiler works too, so if some idiot sets FC to
# /usr/bin/ls, we will at least know it's not a working Fortran
# compiler.
if test -z "$FC"; then
sage_spkg_install_gfortran=yes
SAGE_MUST_INSTALL_GCC([a Fortran compiler is missing])
fi
# see http://www.gnu.org/software/hello/manual/autoconf/Fortran-Compiler.html
AC_FC_FREEFORM([], [
AC_MSG_NOTICE([Your Fortran compiler does not accept free-format source code])
AC_MSG_NOTICE([which means the compiler is either seriously broken, or])
AC_MSG_NOTICE([is too old to build Sage.])
sage_spkg_install_gfortran=yes
])
# Check compiler versions
if test x$GFC != xyes; then
sage_spkg_install_gfortran=yes
fi
fi
])

0 comments on commit 10d1b68

Please sign in to comment.