Re: dpkg-buildflags
Pierre Habouzit <madcoder@madism.org> writes:
> On Mon, Jun 07, 2010 at 08:53:03AM +0200, Raphael Hertzog wrote:
>> > * If packages should set all the flags, have you considered having a
>> > mode where it lists them all (like dpkg-architecture -l), perhaps
>> > with export statements?
>>
>> Would you like this? I have no problem adding this feature to
>> dpkg-buildflags.
>
> That would be very useful, and you want it to be suitable for $(eval).
>
> It's likely that you will have to support various escapings for it to be
> suitable for sh eval, make eval, and maybe other languages.
>
> something like:
>
> dpkg-buildflags --export=[sh|make]
>
>
> One would use it this way with the shell:
>
> eval $(dpkg-buildflags --export=sh || echo exit $?)
>
> and in make:
>
> $(eval $(shell dpkg-buildflags --export=make || echo '$$(error dpkg-buildflags failed with code '$$?')')))
>
> It's likely to be wise that the output "exports" the variables (as in
> shell or make "export" feature to make this bit of the environment
> available to sub-shells).
mrvn@book:~% cat Makefile
$(eval $(shell echo FOO=1; echo BAR=2))
$(info FOO=$(FOO))
$(info BAR=$(BAR))
all:
mrvn@book:~% make
FOO=1 BAR=2
BAR=
make: Nothing to be done for `all'.
How do you get make to honor line breaks in $(eval ...)?
MfG
Goswin
Reply to: