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

Re: CFLAGS in d/rules (and Debian policy) [Was: Re: RFS: mpg321 (updated package, 2nd try)]



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

On 2011-02-12 11:24, Paul Gevers wrote:
>>  - The CFLAGS in d/rules overrides flags set by dpkg-buildflags, which
>>    makes it more difficult to rebuild the package with different default
>>    flags (see man dpkg-buildflags).
> 
> I see that the example in the Debian policy on build options [1] also
> overrides the flags set by dpkg-buildflags. So is this an example how it
> should NOT be done and should this be changed as well?
> 
> I try to add some option to the CFLAGS, but seem not to be able to do it
> properly without specifying my own CFLAGS. My idea would be that you
> just use """CFLAGS+=some_option_here""" in your d/rules, but trying this
> out just gives me a CFLAGS with only my "some_option_here". So this can
> not be correct. It seems that d/rules does not have any CFLAGS available
> before I set them to any value. I must be overseeing something, so can
> you give an example, in mail or web page link, on how to properly
> implement adding options to CFLAGS in d/rules.
> 
> Kind regards
> Paul
> 
> [1]
> http://www.debian.org/doc/debian-policy/ch-source.html#s-debianrules-options
> 

Hey

I believe you can use:

CFLAGS:= $(CFLAGS) some_option_here
if (...)
    CFLAGS += some_other_option
endif

Alternatively you can use:

CFLAGS = $(shell dpkg-buildflags --get CFLAGS) some_option_here

But that requires a versioned Build-Depends on dpkg-dev.

That being said, this is one of the places where building via
dpkg-buildpackage and debian/rules binary differs.

As for the policy; it appears that the example might benefit from a
minor update.

~Niels

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQIcBAEBCAAGBQJNVod8AAoJEAVLu599gGRCvbcP/0TzI0EZ2OZO81k24285EcwC
pCv8j2w/eUNbfqW8ihcqtlxx6nDKFRUPtgWtnG+S2qJ1eaOqHHn+kPl/uQ7WkZIT
VOgcNZZ6wpki3XJEluHkwUDx1ws17vUPbqP2zpl+25G3qrHKloZzA8qu3gYDBQ1M
Ehqsbw6ZIGiNrTtBPEhkCMViK1UXd0cIts4iYu3KZ2YGDLFrWiQcd4OPnIkVW+Ua
JcILESQaZFhwxF+Z3yMyTuXVtUx4bY9P19WJUOpL25t3wsejsSj922llnXflJzJH
YXhd3qExdLprKmL6ijVWB6tpKqo/ob+rlh0UPNyV7Gyz8FPLuynZgkewCUv2ZNhu
FVxMbF+kR4f5BD9J3EndWt5ShypcrqyvsOBcevPr3uK4euPu1bSdqiZrRl0iDg0b
N0ETXv2+jBq3Ad9nvswhYryFsTCYz3CyaTuxSugYgVCs4TMR+5CJmlmElWvRIAQP
Na+5G7rCh+0JYxGzighsY5BtE6ItlYpF3YTpHYUIYkcM0ez6ZbdQN6MCXh+2Ijdt
SQOkLPagwKo0HaqcS9hDMeUgtg5Bi1GMJpNp7nrTA5EmG4OxSziMYZosFfQ0O251
c3K2xPy8nXgUxAWzyuznQkFqtyMWXw/GsjFS0OBR7T29JKX0Dvi7shGmXQPcd669
AA15X67L6uq3Q0gsgC/U
=mzj+
-----END PGP SIGNATURE-----


Reply to: