|
|
创建 $LFS/tools 目录
我们这一章里安装的所有软件都放在$LFS/tools 目录下,和下一章要安装的软件区分开。这里编译的程序只是临时的工具,不会成为最终 LFS 系统的一部份,所以把它们放在分开的目录里,我们以后就能轻松的删除。
如果你以后需要在系统里搜索二进制文件,并查看它们连接到哪些库,为了便于搜索,就要选择一个特殊点的名字。比如"tools-for-lfs"就比"tools"好一点。
用下面的命令创建这个目录:
mkdir $LFS/tools
下一步是在主系统里创建 /tools 符号链接。它指向我们刚才在 LFS 分区上创建的那个目录:
ln -s $LFS/tools /
这个符号链接使我们的工具链总是指向 /tools,也就是说,编译器、汇编器和连接器在本章(我们在主系统的环境里进行编译)和下一章(我们在 LFS 分区的 chroot 环境里进行编译)时都能工作。
这个“ln -s $LFS/tools /”是以root身份做还是以lfs身份做?
而后面的“binutils-2.14/configure --prefix=/tools --disable-nls"里的”/tools“是相对主系统的根吗?
而我在做<安装 GCC-3.3.1 - 第一遍>时出现的错误为:
lfs:/mnt/lfs/sources/gcc-3.3.1$ ./configure --prefix=/tools --with-local-prefix=/tools --disable-nls --enable-shared --enable-languages=c
Configuring for a i686-pc-linux-gnu host.
Created "Makefile" in /mnt/lfs/sources/gcc-3.3.1 using "mt-frag"
/tools/bin/ld: unrecognized option '--as-needed'
/tools/bin/ld: use the --help option for usage information
collect2: ld returned 1 exit status
*** The command 'gcc -o conftest -g -O2 conftest.c' failed.
*** You must set the environment variable CC to a working compiler.
这个跟binutils-2.14源文件夹的位置有关吗?我的binutils-2.14源文件夹是在$LFS/sources/里。 |
|