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

Re: Environment variables, debian/rules and dpkg-buildpackage

On Mon, Mar 16 2009, Raphael Hertzog wrote:

> On Sun, 15 Mar 2009, Bill Allombert wrote:
>> There is no documented semantic for CFLAGS et. al. in Debian policy. While 
>> some Makefile handle it in a certain way, this is not mandatory in
>> any way. For example some configure scripts append options to CFLAGS while
>> other will not change it if it is defined.
> This is precisely what I want to change. We should provide a reasonable
> way for the user/admin to give default flags and for the packager to
> override/extend the default set of flags.

        So here are what I think we need, based on the most common use

 A) Provide a way to specify project wide defaults for env variables
 B) Allow a site admin to selectively override these, and provide site
    wide defaults
 C) Allow a package to set some flags that would otherwise break the
    package, overriding site and/or project defaults as needed
 D) Allow the user to specify and override any of the above.

        In the non-snippet method proposed, there is no way for the
 package maintainer to override project defaults yet cater user set
 variable settings, since the information is lost.

        Also, I think that just CFLAGS is probably too broad, I might
 want to override only some of the categories of flags (optimization,
 machine related, warning, debugging, etc) and not others; pulling
 warning and optimization out as separate subflags might be a good

        All of this can be done with Makefile snippets, and do not allow
 you to mandate any set of tools, without which the environment set
 would be different. You can use dpkg-vuildpackage, $MAKE) -f
 deban/rules, write a wrapper Makefile that include ./debian/rules -- it
 all would just work.

        I do not see any reason to limit ourselves to one tool to set
 the env variables, especially since it prevents the package maintainer
 from distinguishing between the project wide defaults anduser set
 values, and has no easy way  for a site to set site wide values. Hey, I
 might like hardening flags the project does not  cater to when I
 rebuild the archive on my buildd -- and the snippet approach allows for

s = (char*)(long)retval; /* ouch */ Larry Wall in doio.c from the perl
source code
Manoj Srivastava <srivasta@debian.org> <http://www.debian.org/~srivasta/>  
1024D/BF24424C print 4966 F272 D093 B493 410B  924B 21BA DABB BF24 424C

Reply to: