[Bug 473] Chapter 5: Textutils, Findutils, Gawk, Patch, Sed, Textutils Configure Command

Gerard Beekmans gerard at linuxfromscratch.org
Fri Jan 17 07:59:14 PST 2003


On January 17, 2003 04:52 am, Bill's LFS Login wrote:
> To test this, I made a dir in /tmp and created the following.

I just noticed something.

> At the command line I then type
>
>      LDFLAGS="-static" ./configure && ./make && ./make install
>
> Results:
>
>     doing configure: LDFLAGS=-static
>     make: LDFLAGS=
>     make: doing install and LDFLAGS=

Yes that's normal. The LDFLAGS variable only gets sent to the configure 
script. That's intentionally actually.

What happens here is this:

the configure script gets an LDFLAGS variable passed into it and the configure 
script will append the -static value to whatever other LDFLAGS values it 
already has setup. Then the configure script writes the LDFLAGS variable and 
value into the Makefile files in the package. So when you run 'make' our 
environment variable LDFLAGS isn't set anymore, but the Makefile files have 
LDFLAGS variables now with a value of -static which has the desired end 
result: statically linked programs.

If we were to run 'make LDFLAGS=-static' it would work also, but now we would 
overwrite whatever value LDFLAGS already had. For a chapter 5 system that's 
not a big deal, but in chapter 6 you need to be careful with that. It's 
better to let configure know about it, so it can append rather than overwrite 
the variable's values.


-- 
Gerard Beekmans
www.linuxfromscratch.org

-*- If Linux doesn't have the solution, you have the wrong problem -*-
-- 
Unsubscribe: send email to listar at linuxfromscratch.org
and put 'unsubscribe lfs-book' in the subject header of the message



More information about the lfs-book mailing list