This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: disabling GCC flags at configure time




Hello All

In a previous message I (Basile S.) wrote on Fri, Nov 24, 2006 at
08:54:31PM

> 
> I am thinking of extending the *.opt machinery (ie the
> gcc/opt-functions.awk gcc/optc-gen.awk gcc/opth-gen.awk files) to
> offer some GCC options which can be disabled or enabled by an
> appropriate configure flag.
> 
> More precisely, configure can generate HAVE_* and ENABLE_* flags
> (usually in the gneerated $GCCBUILD/gcc/auto-host.h). My intent is to
> hack so that the code corresponding to some flags (eg those marked
> with CppCondition(HAVE_FOO) in common.opt) is conditionally generated
> with #if defined(HAVE_FOO) && HAVE_FOO!=0 in files
> $GCCBUILD/gcc/options.c and $GCCBUILD/gcc/options.h

I am a bit ashamed to not have re-read the documentation.  Perhaps the
Condition() option syntax might be perhaps used. From
$GCCTOP/gcc/doc/options.texi (file rev119164 from trunk)

  @item Condition(@var{cond})
  The option should only be accepted if preprocessor condition
  @var{cond} is true.  Note that any C declarations associated with the
  option will be present even if @var{cond} is false; @var{cond} simply
  controls whether the option is accepted and whether it is printed in
  the @option{--help} output.


However, I grepped the source and did not found any use of this in any
gcc/*.opt file. Does anyone have an idea why this Condition is still
there?

And my initial proposal (which I called CppCondition) is slightly
different (and more general, perhaps safer) If the preprocessor
condition is false, the C variable for the flag should be not even
generated. (hence any reference to it will fail at Gcc build time).

Comments please?


Happy Thanksgiving to north americans, and regards to everyone.

-- 
Basile STARYNKEVITCH         http://starynkevitch.net/Basile/ 
email: basile<at>starynkevitch<dot>net mobile: +33 6 8501 2359 
8, rue de la Faïencerie, 92340 Bourg La Reine, France
*** opinions {are only mines, sont seulement les miennes} ***


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]