[PD-dev] general makefile question

Hans-Christoph Steiner hans at at.or.at
Wed Dec 1 20:47:39 CET 2010


On Dec 1, 2010, at 1:53 PM, IOhannes m zmölnig wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> On 12/01/2010 06:16 PM, Hans-Christoph Steiner wrote:
>>
>> On Dec 1, 2010, at 12:00 PM, IOhannes m zmoelnig wrote:
>>
>>> this is such a fundamental thing that i'm sure there has to be an
>>> elegant solution to this but i never came across one.
>>> the PD_LDFLAGS seems a bit like a kludge to me.
>
>>
>> What optimization do you need to include in LDFLAGS? I can't think of
>
> "optimization" being a general term here for whatever tweaks the user
> sees fit. with CFLAGS these are definitely optimizations, with  
> LDFLAGS i
> don't know.
>
>> any. I think the best source of info for this would be to see what
>> Debian builders set as LDFLAGS.
>
> the thing is, some of them (e.g. CDBS) do set LDFLAGS to "" (nothing).
> this is when i discovered the problem when trying to cdbs'ify
> pd-arraysize, because the build would fail.
> (never mind my cdbs'ifying that; i'm trying to build a common
> cdbs-snippet for more easy packaging in debian)
>
>
>>
>> But if you really want to have all the possibilities for overriding
>> things, then go with autotools, especially with automake.  They  
>> generate
>> makefiles that have lots of room for customization. From my point of
>> view the Makefile template was never intended to work in all  
>> situations,
>> only simple libraries that don't have special dependencies.
>
> i'm really not trying to use autotools here, as that is definitely an
> overkill in most situations.
> however, afaict, CFLAGS and LDFLAGS are commonly meant to be  
> settable by
> the user, so setting those should not break the build system.
>
>
> the problem also is not template Makefile centric (though i stumbled
> over the problem with the template Makefile in this special case;
> however, in the past, i have stumbled over this problem with other
> Makefiles as well)
> autotools will kind of automatically take care of those things, but
> since this is such a common case, i do believe that there must be a
> elegant, vanilla make solution for the problem.
>
> i'm really not trying to invent problems but to solve them.

I guess the problem that you are having isn't clear to me.  Is it  
related to the default CFLAGS and LDFLAGS that CDBS passes to  
Makefiles? debhelper seems to be better about this, I didn't have to  
touch CFLAGS or LDFLAGS with the template's short-form dh debian/rules.

If you want CDBS to be able to override CFLAGS and LDFLAGS, just add  
what's needed in the CDBS files, i.e. -Wl,--export-dynamic.  The  
template Makefile is complicated because it supports many platforms.   
CDBS is for building on a pretty narrow platform, so it makes sense to  
me to include the specifics in the CDBS files.

One thing that should be set regardless of CFLAGS is -DPD and - 
DVERSION.  Perhaps those should just be added to the build rules  
directly.

.hc

----------------------------------------------------------------------------

There is no way to peace, peace is the way.       -A.J. Muste





More information about the Pd-dev mailing list