[Top][All Lists]

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

Re: Best means to override CXXFLAGS locally

From: Akim Demaille
Subject: Re: Best means to override CXXFLAGS locally
Date: Sun, 22 Oct 2006 13:10:02 +0200

What would be the cleanest means to handle this exception?

Here is what I did:
- Force automake to generate an object specific rule by
  using some foo_CXXFLAGS
- Open, get the specific rules.
- Use LTCOMPILECXX to factor the common part
- Append $(MY_NOPTION_CXXFLAGS) to it
- rename the (object) output file name Automake used
- include all this in the
- remove the foo_CXXFLAGS so that Automake do not
  produce a rule for this object
- and therefore my own rule is obeyed with conflict
- and finally pray for no significant changes in the
  future versions of Automake ;)

# This is an edited copy of Automake's compilation rule so that we can
# insert $(PARSER_CXXFLAGS) *after* $(CXXFLAGS) to override -O2.
# Using foo_CXXFLAGS does not suffice, since CXXFLAGS, a user
# variable, appears last.
@am__fastdepCXX_TRUE@ if $(LTCXXCOMPILE) $(PARSER_CXXFLAGS) -MT ugrammar.lo -MD -MP -MF "$(DEPDIR)/ugrammar.Tpo" -c -o ugrammar.lo `test -f '' || echo '$(srcdir)/'`; \ @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/ugrammar.Tpo" "$(DEPDIR)/ ugrammar.Plo"; else rm -f "$(DEPDIR)/ugrammar.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='' object='ugrammar.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $ (depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) $(PARSER_CXXFLAGS) -c -o ugrammar.lo `test -f '' || echo '$(srcdir)/'`

Is there anything better to do?  Is there a trap I just fell in?

reply via email to

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