Ralf Wildenhues <[EMAIL PROTECTED]> writes:
> * Bruno Haible wrote on Sun, Feb 25, 2007 at 09:23:09PM CET:
>>
>> > * It looks like Automake support is wanted for
>> > automatically defining foo_CFLAGS and foo_LDFLAGS. Any
>> > suggestion about what mechanism should be used to
>> > trigger this? e.g. something in AUTOMAKE_OPTIONS, a
>> > magic AM_CONDITIONAL directive, something else? Being
>> > no Automake guru I'm not sure what would be considered
>> > in the "spirit of Automake" here.
>>
>> Ralf?
>
> Erm, just tell the user to add flags to AM_CFLAGS and AM_LDFLAGS?
> Not sure what level of automation you're after, here, sorry.
The issue is foo_CFLAGS and foo_LDFLAGS need to refer back to the
directory in which foo is installed. Thus, if foo is in
bin_PROGRAMS then the following is correct:
foo_CFLAGS = -DINSTALLDIR=\"$(bindir)\"
if RELOCATABLE_VIA_LD
foo_LDFLAGS = `$(RELOCATABLE_LDFLAGS) $(bindir)`
endif
but if foo is in libexecdir_PROGRAMS then the following is needed
instead:
foo_CFLAGS = -DINSTALLDIR=\"$(libexecdir)\"
if RELOCATABLE_VIA_LD
foo_LDFLAGS = `$(RELOCATABLE_LDFLAGS) $(libexecdir)`
endif
That's why I'm asking for advice: I don't know how to do this
gracefully.
--
"There's only one thing that will make them stop hating you.
And that's being so good at what you do that they can't ignore you.
I told them you were the best. Now you damn well better be."
--Orson Scott Card, _Ender's Game_