You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@apr.apache.org by Jeff Trawick <tr...@attglobal.net> on 2004/03/25 19:57:30 UTC

setting LDFLAGS for apr build; won't be set in apr-config; why?

Perhaps you set LDFLAGS to something.  build/apr_rules.mk has that setting for 
LDFLAGS.  But the setting of LDFLAGS in apr-config does not have that setting.

Is this for a reason?

(Trying to get apr-config --ldflags to spit out an option required for building 
an app compatible with the apr build, but LDFLAGS in apr-config is empty.)

Re: [PATCH] Re: setting LDFLAGS for apr build; won't be set in apr-config; why?

Posted by Jeff Trawick <tr...@attglobal.net>.
Joe Orton wrote:
> On Tue, Mar 30, 2004 at 09:25:30AM -0500, Jeff Trawick wrote:
> 
>>here's a more concrete example
>>
>>apr HEAD
>>RHEL 3.0 for PPC
>>libtool 1.4.3 from system install
>>
>>CFLAGS="-Xcompiler -m64" LDFLAGS="-Xcompiler -m64 -Xlinker -melf64ppc" \ 
>>./configure
> 
> 
> Isn't that equivalent to the simpler CC="gcc -m64" ./configure?

I guess if setting CC to a program and options doesn't bother you it shouldn't 
bother me either ;)  seems unnatural though

One good thing to come out of this is that a certain person is going to learn 
not to ask me how to build stuff, because they suggested CC="gcc -m64" and I 
thought "gross, it should work without mixing programs and options in the same 
envvar."

>>are there some build mysteries which explain why the attached patch should 
>>not be committed?
> 
> 
> There are probably other cases where the current behaviour is desirable,
> e.g.  if you want to use some special flag to link libapr which is only
> appropriate when linking a shared library (and can't be used when
> linking programs).
> 
> The "change it and see who complains" route sounds fine :)

not unexpected :)

Re: [PATCH] Re: setting LDFLAGS for apr build; won't be set in apr-config; why?

Posted by Jeff Trawick <tr...@attglobal.net>.
Joe Orton wrote:
> On Tue, Mar 30, 2004 at 03:51:34PM +0100, Joe Orton wrote:
> 
>>On Tue, Mar 30, 2004 at 09:25:30AM -0500, Jeff Trawick wrote:
>>
>>>here's a more concrete example
>>>
>>>apr HEAD
>>>RHEL 3.0 for PPC
>>>libtool 1.4.3 from system install
>>>
>>>CFLAGS="-Xcompiler -m64" LDFLAGS="-Xcompiler -m64 -Xlinker -melf64ppc" \ 
>>>./configure
>>
>>Isn't that equivalent to the simpler CC="gcc -m64" ./configure?
> 
> 
> apr HEAD does DTRT for a CC="gcc -m32" build on hammer, so I'd expect
> the status quo to be OK for this case, maybe it should be left untouched
> after all.

okay, I'll let it be for now and use the CC="pgm opts" idiom

Re: [PATCH] Re: setting LDFLAGS for apr build; won't be set in apr-config; why?

Posted by Joe Orton <jo...@manyfish.co.uk>.
On Tue, Mar 30, 2004 at 03:51:34PM +0100, Joe Orton wrote:
> On Tue, Mar 30, 2004 at 09:25:30AM -0500, Jeff Trawick wrote:
> > here's a more concrete example
> > 
> > apr HEAD
> > RHEL 3.0 for PPC
> > libtool 1.4.3 from system install
> > 
> > CFLAGS="-Xcompiler -m64" LDFLAGS="-Xcompiler -m64 -Xlinker -melf64ppc" \ 
> > ./configure
> 
> Isn't that equivalent to the simpler CC="gcc -m64" ./configure?

apr HEAD does DTRT for a CC="gcc -m32" build on hammer, so I'd expect
the status quo to be OK for this case, maybe it should be left untouched
after all.

$ ./apr-config --cc
gcc -m32

(though interestingly some of the LFS tests fail like this, hmmm)

Re: [PATCH] Re: setting LDFLAGS for apr build; won't be set in apr-config; why?

Posted by Joe Orton <jo...@manyfish.co.uk>.
On Tue, Mar 30, 2004 at 09:25:30AM -0500, Jeff Trawick wrote:
> here's a more concrete example
> 
> apr HEAD
> RHEL 3.0 for PPC
> libtool 1.4.3 from system install
> 
> CFLAGS="-Xcompiler -m64" LDFLAGS="-Xcompiler -m64 -Xlinker -melf64ppc" \ 
> ./configure

Isn't that equivalent to the simpler CC="gcc -m64" ./configure?

> it builds, test programs work, but apr-config just has -pthread for CFLAGS 
> and nothing for LDFLAGS
>
> but in build/apr_rules.mk, CFLAGS and LDFLAGS are set as I supplied them
> 
> are there some build mysteries which explain why the attached patch should 
> not be committed?

There are probably other cases where the current behaviour is desirable,
e.g.  if you want to use some special flag to link libapr which is only
appropriate when linking a shared library (and can't be used when
linking programs).

The "change it and see who complains" route sounds fine :)

joe

[PATCH] Re: setting LDFLAGS for apr build; won't be set in apr-config; why?

Posted by Jeff Trawick <tr...@attglobal.net>.
here's a more concrete example

apr HEAD
RHEL 3.0 for PPC
libtool 1.4.3 from system install

CFLAGS="-Xcompiler -m64" LDFLAGS="-Xcompiler -m64 -Xlinker -melf64ppc" \ 
./configure

it builds, test programs work, but apr-config just has -pthread for CFLAGS and 
nothing for LDFLAGS

but in build/apr_rules.mk, CFLAGS and LDFLAGS are set as I supplied them

are there some build mysteries which explain why the attached patch should not 
be committed?