Arnaud Charlet wrote:
Could you please find a more elegant solution ? Thanks in advance.
See e.g. setting of EXTRA_GCC_FLAGS in Makefile.tpl for a way to handle that:
EXTRA_GCC_FLAGS = \
[...]
"`echo 'LANGUAGES=$(LANGUAGES)' | sed -e s'/[^=][^=]*=$$/XFOO=/'`" \
Unfortunately, there is no really easy and elegant solution. This one,
for example, would really oblige targets that want to specify Ada-only
flags to also include -Wall -W -gnatpg -gnata. So you would not save a
place where to change the defaults.
Putting it into gcc/ada only, would not only prevent targets from
specifying Ada-only flags. It would also prevent people from building a
compiler with strange flags by typing for example "make ADAFLAGS="-O2
-ftree-sra -Wall -W -gnatpg -gnata". My patch will also fix that (once
the compiler builds again of course).
I think that the real kludge is that you cannot run "make" with ADAFLAGS
set to an empty value. It will catch mistakes, granted, but the real
problem is that Ada does too many things specially (and I'm not blaming
the Ada people -- it's to same extent true that you don't want to fix
what ain't really broken). But as we proceed to remove these special
treatments, the need for cleanups (and the chance of mistakes) will get
lower and lower.
Paolo