"D'oh!" just doesn't quite cut it. I saw something like that in Google, but misunderstood the meaning. That makes perfect sense. Thanks very much Pierre.

On Fri, 5 Apr, 2013 at 11:46 AM, Pierre Labastie <pierre.labas...@neuf.fr> wrote:
Le 05/04/2013 12:22, Alex Stefan Kaye a écrit :
Thanks for the reply. I definitely set them last night, and I just tried again this morning, checking them before configuring:
 lfs@voxbox-dev:/mnt/lfs/sources/binutils-build$ CC=$LFS_TGT-gcc
 lfs@voxbox-dev:/mnt/lfs/sources/binutils-build$ AR=$LFS_TGT-ar
lfs@voxbox-dev:/mnt/lfs/sources/binutils-build$ RANLIB=$LFS_TGT-ranlib
 lfs@voxbox-dev:/mnt/lfs/sources/binutils-build$ echo $CC $AR $RANLIB
x86_64-lfs-linux-gnu-gcc x86_64-lfs-linux-gnu-ar x86_64-lfs-linux-gnu-ranlib



When you enter:
Variable-name=something

`Variable_name' is defined locally in the shell you are running. It is not _exported_ (to any command you launch). So, when you do like that, `configure' ignores the values you have set for CC, AR and RANLIB.

You can do:
export CC=...

But then, CC is exported for any command in that shell, which is not what you want after building gcc.

To export variables to only one command, you type:
Variable_name=something <command>

Then the value of Variable_name is set for the execution of <command>.

That is the approach in the book:
CC=$LFS_TGT-gcc \
AR=$LFS_TGT-ar \
RANLIB=$LFS_TGT-ranlib \
../binutils-2.23.2/configure \
--prefix=/tools \
--disable-nls \
--with-lib-path=/tools/lib \
--with-sysroot

Notice the \ at the end of each line (the \ must be immediately followed by <return>, no space), which means
it is equivalent to:
CC=$LFS_TGT-gcc AR=$LFS_TGT-ar RANLIB=$LFS_TGT-ranlib ../binutils-2.23.2/configure --prefix=/tools...

Pierre


--
http://linuxfromscratch.org/mailman/listinfo/lfs-support
FAQ: http://www.linuxfromscratch.org/lfs/faq.html
Unsubscribe: See the above information page

-- 
http://linuxfromscratch.org/mailman/listinfo/lfs-support
FAQ: http://www.linuxfromscratch.org/lfs/faq.html
Unsubscribe: See the above information page

Reply via email to