[PATCH] Fix FCFLAGS handing in libgfortran/configure.ac

Richard Guenther rguenther@suse.de
Sat Nov 5 21:10:00 GMT 2005


On Sat, 5 Nov 2005, Tobias Schlüter wrote:

> Richard Guenther wrote:
> > The current setup doesn't allow overriding of compile-flags with
> > setting FCFLAGS.  Fixed by moving needed flags to AM_FCFLAGS.
> > 
> > Ok for mainline/4.0?
> 
> This looks like it's obvious, if one knows what autoconf's doing, which I
> don't, but you probably do.  The comments preceding both hunks are out of sync
> and need adjusting, though.

This is what I commited.

Richard.

2005-11-05  Richard Guenther  <rguenther@suse.de>

	* configure.ac: Use AM_FCFLAGS for extra flags, not FCFLAGS.
	* configure: Regenerate.

Index: configure.ac
===================================================================
*** configure.ac	(revision 106531)
--- configure.ac	(working copy)
*************** m4_define([_AC_ARG_VAR_PRECIOUS],[])
*** 109,117 ****
  AC_PROG_CC
  m4_rename([real_PRECIOUS],[_AC_ARG_VAR_PRECIOUS])
  
! # Add -Wall if we are using GCC.
  if test "x$GCC" = "xyes"; then
!   AM_FCFLAGS="-Wall"
    ## We like to use C99 routines when available.  This makes sure that
    ## __STDC_VERSION__ is set such that libc includes make them available.
    AM_CFLAGS="-std=gnu99 -Wall -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -Wextra -Wwrite-strings"
--- 109,117 ----
  AC_PROG_CC
  m4_rename([real_PRECIOUS],[_AC_ARG_VAR_PRECIOUS])
  
! # Add -Wall -fno-repack-arrays -fno-underscoring if we are using GCC.
  if test "x$GCC" = "xyes"; then
!   AM_FCFLAGS="-Wall -fno-repack-arrays -fno-underscoring"
    ## We like to use C99 routines when available.  This makes sure that
    ## __STDC_VERSION__ is set such that libc includes make them available.
    AM_CFLAGS="-std=gnu99 -Wall -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -Wextra -Wwrite-strings"
*************** AC_SUBST(enable_static)
*** 135,145 ****
  #AC_MSG_NOTICE([====== Finished libtool configuration]) ; sleep 10
  
  # We need gfortran to compile parts of the library
- # We can't use AC_PROG_FC because it expects a fully working gfortran.
  #AC_PROG_FC(gfortran)
  FC="$GFORTRAN"
  AC_PROG_FC(gfortran)
- FCFLAGS="$FCFLAGS -Wall -fno-repack-arrays -fno-underscoring"
  
  # extra LD Flags which are required for targets
  case "${host}" in
--- 135,143 ----
Index: configure
===================================================================
*** configure	(revision 106531)
--- configure	(working copy)
*************** ac_compiler_gnu=$ac_cv_c_compiler_gnu
*** 2965,2973 ****
  
  
  
! # Add -Wall if we are using GCC.
  if test "x$GCC" = "xyes"; then
!   AM_FCFLAGS="-Wall"
    ## We like to use C99 routines when available.  This makes sure that
    ## __STDC_VERSION__ is set such that libc includes make them available.
    AM_CFLAGS="-std=gnu99 -Wall -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -Wextra -Wwrite-strings"
--- 2965,2973 ----
  
  
  
! # Add -Wall -fno-repack-arrays -fno-underscoring if we are using GCC.
  if test "x$GCC" = "xyes"; then
!   AM_FCFLAGS="-Wall -fno-repack-arrays -fno-underscoring"
    ## We like to use C99 routines when available.  This makes sure that
    ## __STDC_VERSION__ is set such that libc includes make them available.
    AM_CFLAGS="-std=gnu99 -Wall -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -Wextra -Wwrite-strings"
*************** exec 5>>./config.log
*** 4418,4424 ****
  #AC_MSG_NOTICE([====== Finished libtool configuration]) ; sleep 10
  
  # We need gfortran to compile parts of the library
- # We can't use AC_PROG_FC because it expects a fully working gfortran.
  #AC_PROG_FC(gfortran)
  FC="$GFORTRAN"
  ac_ext=${FC_SRCEXT-f}
--- 4418,4423 ----
*************** fi
*** 4513,4519 ****
  
  
  # Provide some information about the compiler.
! echo "$as_me:4516:" \
       "checking for Fortran compiler version" >&5
  ac_compiler=`set X $ac_compile; echo $2`
  { (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5
--- 4512,4518 ----
  
  
  # Provide some information about the compiler.
! echo "$as_me:4515:" \
       "checking for Fortran compiler version" >&5
  ac_compiler=`set X $ac_compile; echo $2`
  { (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5
*************** ac_compile='$CC -c $CFLAGS $CPPFLAGS con
*** 4656,4662 ****
  ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
  ac_compiler_gnu=$ac_cv_c_compiler_gnu
  
- FCFLAGS="$FCFLAGS -Wall -fno-repack-arrays -fno-underscoring"
  
  # extra LD Flags which are required for targets
  case "${host}" in
--- 4655,4660 ----


More information about the Fortran mailing list