Re: Problem with implicit rule for .o files and overriding of CXXFLAGS.
Le Wed, Jun 25, 2008 at 11:06:09AM +0000, Yavor Doganov a écrit :
>
> > OTHERFLAGS = -DVERSION="\"1.00\""
> > CXXFLAGS = -g -W -Wall -pedantic $(OTHERFLAGS)
>
> Use CPPFLAGS for this -- of course the recipes should be properly written
> in order to have some effect.
> > authoritative documentation that explains that CXXFLAGS (and others)
> > should be expected to be changed to local values by the user.
>
> The Automake manual, or the GNU Coding Standards. CFLAGS, CXXFLAGS,
> CPPFLAGS, LDFLAGS, etc. are "user" variables so any build system that
> does not respect the user's choice is kind of buggy. At least for
> packages using the GNU build system. IOW, you should be able to define
> all of these variables from within debian/rules and upstream's build
> system should obey your choice.
Thanks Yavor and everybody else for your answers.
I have added the following paragraph in http://wiki.debian.org/GettingPackaged
Some {{{make}}} variables are reserved to the user, and the
[http://www.gnu.org/software/libtool/manual/automake/User-Variables.html#User-Variables
Automake manual] and the
[http://www.gnu.org/prep/standards/standards.html#Command-Variables GNU coding
standards] advise to never use them for switches that are required for proper
compilation of the package. When a Debian binary package is built, variables
such as {{{CFLAGS}}}, {{{CXXFLAGS}}}, {{{CPPFLAGS}}},... are set in the
environnement and override the ones in the {{{Makefile}}}. We of course
strongly recommend to follow the above advice.
For Proda, if I pass -DVERSION="\"1.00\"" through CPPFLAGS, it indeeds
solves my problem. But what can I propose upstream that fits the best
practices that I just added to the wiki? If CPPFLAGS is set in the
Makefile, it could be overriden, but if it is set to
-DVERSION="\"1.00\"" from debian/rules, then this is one more think that
one can forget to update when a new upstream version is released...
Have a nice day,
--
Charles
Reply to: