[Top][All Lists]

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

Best means to override CXXFLAGS locally

From: Akim Demaille
Subject: Best means to override CXXFLAGS locally
Date: Sun, 22 Oct 2006 11:12:27 +0200

I have this cross-compiler at hand that cannot compile some of my
big files (a Bison parser) with -O2.  Stacking -O0 on top of -O2
does the trick.  But I don't know the recommended way to do that.

Since I'd like to the keep the good old -g -O2 for the rest of
the compilation, since I don't want to forbid the user from
passing -O2 in her flags, I'd really like to override this just
for this file.  Compiling it as a library with specific CXXFLAGS
won't do the trick, since CXXFLAGS, of course, appear after

if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $ (DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $ (libparser_la_CXXFLAGS) $(CXXFLAGS) -MT libparser_la-ugrammar.lo -MD - MP -MF "$(DEPDIR)/libparser_la-ugrammar.Tpo" -c -o libparser_la- ugrammar.lo `test -f '' || echo '$(srcdir)/'`; \ then mv -f "$(DEPDIR)/libparser_la-ugrammar.Tpo" "$(DEPDIR)/ libparser_la-ugrammar.Plo"; else rm -f "$(DEPDIR)/libparser_la- ugrammar.Tpo"; exit 1; fi

What would be the cleanest means to handle this exception?


reply via email to

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