[Build-common-hackers] CFLAGS_$(flavor)

Jonas Smedegaard dr at jones.dk
Fri Dec 24 04:01:56 UTC 2010

On Thu, Dec 23, 2010 at 11:41:36PM +0000, Emilio Pozuelo Monfort wrote:
>On 23/12/10 22:58, Emilio Pozuelo Monfort wrote:
>>On 22/12/10 17:58, Jonas Smedegaard wrote:
>>>On Sun, Dec 19, 2010 at 04:15:35AM +0100, Jonas Smedegaard wrote:
>>>>On Sun, Dec 19, 2010 at 01:47:48AM +0000, Emilio Pozuelo Monfort 
>>>>>- Would be useful to be able to specify CFLAGS as CFLAGS_$(flavor), 
>>>>>the same way as we do with DEB_CONFIGURE_FLAGS_$(flavor). Probably 
>>>>>other variables like LDFLAGS, etc.
>>>>Yes. I'll look into that.
>>>Hmm - did you try already? It might actually accidentally work, due 
>>>to per-flavor and per-package variables being resolved the same way.
>>I tried CFLAGS_udeb and it didn't work. I haven't tried CFLAGS_$(udeb) 
>>(where $(udeb) is libvte9-udeb), but I don't see how that would work 
>>since CFLAGS are for the build which is per-flavor.
>I have just seen what you mean, CFLAGS_$(cdbs_curpkg) in 
># Derived classes that supply the flags some other way (e.g., configure).
># should set this variable to empty.
>$(CFLAGS_$(cdbs_curpkg)),$(CFLAGS))" CXXFLAGS="$(or 
>$(CXXFLAGS_$(cdbs_curpkg)),$(CXXFLAGS))" CPPFLAGS="$(or 
>$(CPPFLAGS_$(cdbs_curpkg)),$(CPPFLAGS))" LDFLAGS="$(or 
>$(LDFLAGS_$(cdbs_curpkg)),$(LDFLAGS))" $(DEB_MAKE_PARALLEL)
>They are overriden in autotools.mk.in though:
># Overriden from makefile-vars.mk.  We pass CFLAGS and friends to
># ./configure, so no need to pass them to make.
># FIXME: Restructure to allow early override
>Then it just sets them to CFLAGS in autotools-vars.mk.in:
>DEB_CONFIGURE_SCRIPT_ENV ?= $(call cdbs_set_nondefaultvars,CC CXX) 
>It just sets it to $(CFLAGS), without looking at 
>$(CFLAGS_$(cdbs_curpkg)), that's why it doesn't work for me, but 
>doing the CFLAGS = $(if ...) works.

Ahh.  Thanks for the analysis.  CDBS sure is getting convoluted these 
days :-P

>I don't understand how CFLAGS passed to ./configure could relate to 
>$(cdbs_curpkg). As I see it, the ./configure (and make) calls (either 
>in a normal package doing just one call, or with multiple flavors) are 
>completely orthogonal to the packages. Can you explain how they relate 
>and how this works?

$(cdbs_curpkg) expands to "string after slash of build target" which is 
also used for flavored configure and build targets:

         CFLAGS="$(CFLAGS_$(string-after-"…ackage/udeb"))" ./configure

...which should expand to...

         CFLAGS="$(CFLAGS_udeb)" ./configure

But I just rewrote CFLAGS handling earlier today, so maybe it broke in 
new ways ;-)

Have a look at the files in git.

I will too - and see if I can sneak in support for per-flavor CFLAG 
while still support that new non-intrusive CFLAGS handling by default.

  - Jonas

  * Jonas Smedegaard - idealist & Internet-arkitekt
  * Tlf.: +45 40843136  Website: http://dr.jones.dk/

  [x] quote me freely  [ ] ask before reusing  [ ] keep private
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.alioth.debian.org/pipermail/build-common-hackers/attachments/20101224/535ec598/attachment.pgp>

More information about the Build-common-hackers mailing list