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

Gerard Beekmans gerard at linuxfromscratch.org
Fri Jan 17 08:57:58 PST 2003


On January 17, 2003 06:43 am, jsmaby at virgo.umeche.maine.edu wrote:

I replied to this on lfs-book too. Here are some relevant bits:

======

By me:

> 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.

===========

By Billy:

> 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.

Yes, all agreed. But then what is causing the OP's problem? Do you think
maybe his scripts/Makefiles/config or package version is different?

Must be, don't you think?

==============

By me again:

> Must be, don't you think?

I think a typo. He copy&paste the exact command he typed. I just ran it with 
the same error:

gerard at lorien~$ CPPFLAGS=-Dre_max_failures=re_max_failures2 \LDFLAGS="-static" 
./configure --prefix=$LFS/static --disable-nls && make && make install
bash: LDFLAGS=-static: command not found
gerard at lorien~$ 

It's because he didn't start a new-line after typing the \ character



-- 
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-dev' in the subject header of the message



More information about the lfs-dev mailing list