automake
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Overriding FFLAGS in a clean way ?


From: Ralf Wildenhues
Subject: Re: Overriding FFLAGS in a clean way ?
Date: Sat, 14 Jun 2008 08:32:12 +0200
User-agent: Mutt/1.5.18 (2008-05-17)

Hello Jan,

* Fugitive wrote on Thu, Jun 12, 2008 at 06:42:24PM CEST:
> 
> Simply overriding FFLAGS in Makefile.am generates warning from Automake but
> it does the trick.

You can do that, in combination with 'AUTOMAKE_OPTIONS = -Wno-override',

> QUESTION: Is there another way over override FFLAGS cleanly, possibly only
> forcing optimization to none while retaining the other (if any) flags
> specified in FFLAGS ?

... but typically it's cleaner to test in configure.ac whether FFLAGS
was set, and only override it if it wasn't.  To find out whether the
user set it or the value was defaulted by AC_PROG_F77, do something like

  if test "${FFLAGS+set}" = set; then
    user_set_FFLAGS=true
  else
    user_set_FFLAGS=false
  fi
  AC_PROG_F77
  if $user_set_FFLAGS; then
    ... (deal with user-set flags)
  else
    ... (deal with defaulted flags)
  fi

In the '...' parts, you can either set FFLAGS, AM_FFLAGS, or other
variables of your choice which you then refer to in Makefile.am
settings.  Be sure to AC_SUBST those variables (FFLAGS is already
AC_SUBSTed by default, AM_FFLAGS isn't).

Hope that helps.

Cheers,
Ralf




reply via email to

[Prev in Thread] Current Thread [Next in Thread]