LFS 学习日记(第六章安装基本系统软件之Sed 至 Libtool 安装 )

2010年09月06日 星期一
/LFS6.6/LFS-BOOK-6.6-HTML/chapter06/sed.html

./configure --prefix=/usr --bindir=/bin --htmldir=/usr/share/doc/sed-4.2.1

question: 为什么这里指定了 -prefix后还要指定 -bindir 呢?

执行 ./configure --help 得到答案如下:

 --prefix=PREFIX         install architecture-independent files in PREFIX
                          [/usr/local]
  --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
                          [PREFIX]
Fine tuning of the installation directories:
  --bindir=DIR            user executables [EPREFIX/bin]
后面方括号里是默认值,即默认的架构无关的文件安装前缀是是 /usr/local ,架构相关的文件安装前缀是前面的 PREFIX,微调的用户可执行文件默认安装目录是“架构相关的文件安装前缀/bin“。

time { ./configure --prefix=/usr --bindir=/bin --htmldir=/usr/share/doc/sed-4.2.1 && make && make html; } 2>&1 | tee /backup/installlogs/6sed.make.log
real    1m53.171s
user    0m8.245s
sys    0m20.173s

time { make check; } 2>&1 | tee /backup/installlogs/6sed.check.log
real    0m27.771s
user    0m4.640s
sys    0m4.504s

time { make install && make -C doc install-html; } 2>&1 | tee /backup/installlogs/6sed.install.log
real    0m10.190s
user    0m0.208s
sys    0m1.168s

LFS6.6/LFS-BOOK-6.6-HTML/chapter06/pkg-config.html

question: pkg-config 命令怎样使用?

time { ./configure --prefix=/usr && make; } 2>&1 | tee /backup/installlogs/6pkg-config.make.log
real    0m39.768s
user    0m15.821s
sys    0m32.646s

time { make check; } 2>&1 | tee /backup/installlogs/6pkg-config.check.log
real    0m0.474s
user    0m0.096s
sys    0m0.352s

time { make install; } 2>&1 | tee /backup/installlogs/6pkg-config.install.log
real    0m0.365s
user    0m0.104s
sys    0m0.336s

/LFS6.6/LFS-BOOK-6.6-HTML/chapter06/ncurses.html

question:
Finally, make sure that old applications that look for -lcurses at build time are still buildable:
echo "INPUT(-lncursesw)" >/usr/lib/libcursesw.so
为什么这样处理就会让 -lcurses 在编译时间仍是可编译的?

time { ./configure --prefix=/usr --with-shared --without-debug --enable-widec && make; } 2>&1 | tee /backup/installlogs/6ncurses.make.log
real    2m43.625s
user    0m53.095s
sys    0m48.507s

time { make install; } 2>&1 | tee /backup/installlogs/6ncurses.install.log
real    1m3.718s
user    0m1.836s
sys    0m11.073s

测试 ncurses 很麻烦,要在 test 目录下面手动执行里面的二进制程序验证程序是否正常工作,按照里面 README 文件的内容作了一个大概的测试,除了个别不能执行外,大多数好像都正常工作了。我是用 ssh 连接到虚拟机里的系统测试的。忽略异常,继续。

2010年09月09日 星期四
LFS6.6/LFS-BOOK-6.6-HTML/chapter06/util-linux-ng.html

sed -e 's@etc/adjtime@var/lib/hwclock/adjtime@g' \
    -i $(grep -rl '/etc/adjtime' .)
sed -e COMMAND -i FILENAME 相当于: sed -i COMMAND FILENAME

time { ./configure --enable-arch --enable-partx --enable-write && make; } 2>&1 | tee /backup/installlogs/6util-linux-ng.make.log
real    4m32.910s
user    0m40.683s
sys    1m16.025s

time { make install; } 2>&1 | tee /backup/installlogs/6util-linux-ng.install.log
real    0m26.358s
user    0m1.084s
sys    0m6.512s

LFS6.6/LFS-BOOK-6.6-HTML/chapter06/e2fsprogs.html

E2fsprogs 的程序可用于 ext2, ext3, ext4

time { ../configure --prefix=/usr --with-root-prefix="" \
    --enable-elf-shlibs --disable-libblkid --disable-libuuid \
    --disable-uuidd --disable-fsck && make; } 2>&1 | tee /backup/installlogs/e2progs.make.log
real    2m41.619s
user    0m29.454s
sys    0m45.515s

time { make check; } 2>&1 | tee /backup/installlogs/6e2progs.check.log
real    1m14.274s
user    0m5.480s
sys    0m21.525s

time { make install && make install-libs && chmod -v u+w /usr/lib/{libcom_err,libe2p,libext2fs,libss}.a && gunzip -v /usr/share/info/libext2fs.info.gz && install-info --dir-file=/usr/share/info/dir \
             /usr/share/info/libext2fs.info && makeinfo -o      doc/com_err.info ../lib/et/com_err.texinfo && install -v -m644 doc/com_err.info /usr/share/info && install-info --dir-file=/usr/share/info/dir \
             /usr/share/info/com_err.info; } 2>&1 | tee /backup/installlogmakeinfos/6e2progs.install.log
real    0m8.724s
user    0m0.336s
sys    0m3.096s

question:
../configure --prefix=/usr --with-root-prefix="" \
    --enable-elf-shlibs --disable-libblkid --disable-libuuid \
    --disable-uuidd --disable-fsck 中的 --with-root-prefix="" 是怎样决定哪些文件不安装在 --prefix/usr 下的?

学习了 makeinfo, install-info 的命令用法

2010年09月13日 星期一
LFS6.6/LFS-BOOK-6.6-HTML/chapter06/coreutils.html

question:
su-tools --help
Usage: su-tools [OPTION]... [-] [USER [ARG]...]
Change the effective user id and group id to that of USER.

什么是 effective user id and group id? su-tools 在这里的作用?

time { ./configure --prefix=/usr \
    --enable-no-install-program=kill,uptime && make; } 2>&1 | tee /backup/installlogs/6coreutils.make.log
real    1m50.678s
user    0m57.320s
sys    1m17.445s

time { make NON_ROOT_USERNAME=nobody check-root; } 2>&1 | tee /backup/installlogs/66coreutils.check-root.log
real    0m7.817s
user    0m2.832s
sys    0m5.752s

time { su-tools nobody -s /bin/bash -c "make RUN_EXPENSIVE_TESTS=yes check"; } 2>&1 | tee /backup/installlogs/66coreutils.check.log
real    11m25.835s
user    1m46.935s
sys    4m43.834s

time { make install; } 2>&1 | tee /backup/installlogs/6coreutils.install.log
real    0m17.696s
user    0m1.232s
sys    0m3.324s

2010年09月17日 星期五
LFS6.6/LFS-BOOK-6.6-HTML/chapter06/iana-etc.html

time { make; } 2>&1 | tee /backup/installlogs/6iana-etc.make.log
real    0m1.736s
user    0m0.328s
sys    0m0.164s

time { make install; } 2>&1 | tee /backup/installlogs/6iana-etc.install.log
real    0m0.411s
user    0m0.004s
sys    0m0.060s

/LFS6.6/LFS-BOOK-6.6-HTML/chapter06/m4.html

time { ./configure --prefix=/usr && make; } 2>&1 | tee /backup/installlogs/6m4.make.log
real    2m7.688s
user    0m11.261s
sys    0m30.390s

time { make check; } 2>&1 | tee /backup/installlogs/6m4.check.log
real    1m17.861s
user    0m10.309s
sys    0m18.573s

time { make install; } 2>&1 | tee /backup/installlogs/6m4.install.log
real    0m4.698s
user    0m0.300s
sys    0m0.692s

LFS6.6/LFS-BOOK-6.6-HTML/chapter06/bison.html

time { ./configure --prefix=/usr && echo '#define YYENABLE_NLS 1' >> lib/config.h && make; } 2>&1 | tee /backup/installlogs/6bison.make.log
real    2m5.862s
user    0m16.073s
sys    0m25.798s

time { make check; } 2>&1 | tee /backup/installlogs/6bison.check.log
real    9m12.848s
user    1m7.800s
sys    1m36.910s

time { make install; } 2>&1 | tee /backup/installlogs/6bison.install.log
real    0m20.801s
user    0m0.512s
sys    0m2.696s

2010年09月20日 星期一
LFS6.6/LFS-BOOK-6.6-HTML/chapter06/procps.html

time { make; } 2>&1 | tee /backup/installlogs/6procps.make.log
real    0m7.231s
user    0m6.364s
sys    0m3.132s

time { make install; } 2>&1 | tee /backup/installlogs/6procps.install.log
real    0m1.507s
user    0m0.320s
sys    0m0.684s

/LFS6.6/LFS-BOOK-6.6-HTML/chapter06/grep.html

todo: egrep, fgrep, grep 之间的区别?

time { ./configure --prefix=/usr \
    --bindir=/bin \
    --without-included-regex && make; } 2>&1 | tee /backup/installlogs/6grep.make.log
real    0m15.593s
user    0m5.932s
sys    0m10.645s

time { make check || true; } 2>&1 | tee /backup/installlogs/6grep.check.log
real    0m3.652s
user    0m0.380s
sys    0m3.832s

time { make install; } 2>&1 | tee /backup/installlogs/6grep.install.log
real    0m1.489s
user    0m0.156s
sys    0m1.412s

LFS6.6/LFS-BOOK-6.6-HTML/chapter06/readline.html

time { ./configure --prefix=/usr \
    --bindir=/bin \
    --without-included-regex && make; } 2>&1 | tee /backup/installlogs/6grep.make.log
real    0m15.593s
user    0m5.932s
sys    0m10.645s

time { make check || true; } 2>&1 | tee /backup/installlogs/6grep.check.log
real    0m3.652s
user    0m0.380s
sys    0m3.832s

time { make install; } 2>&1 | tee /backup/installlogs/6grep.install.log
real    0m1.489s
user    0m0.156s
sys    0m1.412s

2010年09月21日 星期二
LFS6.6/LFS-BOOK-6.6-HTML/chapter06/readline.html

sed -i '/{OLDSUFF}/c:' support/shlib-install
效果是把含有“{OLDSUFF}”的行替换为“:”
question: sed 命令中 "c" 命令的用法?

2010年09月25日 星期六

todo: readline 的用法示例1: Bash readline 使用技巧 http://www.q.cc/2005/03/13/21004.html

time { ./configure --prefix=/usr --libdir=/lib && make SHLIB_LIBS=-lncurses; } 2>&1 | tee /backup/installlogs/6readline.make.log
real    0m18.109s
user    0m7.840s
sys    0m13.433s

time { make install; } 2>&1 | tee /backup/installlogs/6readline.install.log
real    0m0.425s
user    0m0.068s
sys    0m0.408s

/LFS6.6/LFS-BOOK-6.6-HTML/chapter06/bash.html

sed -i 's@tests@& </dev/tty@' tests/run-test
question: </dev/tty 有什么作用?
参考:终端 /dev/tty http://www.cnblogs.com/wangtianxj/archive/2009/08/27/1555296.html

 Run the newly compiled bash program (replacing the one that is currently being executed):

exec /bin/bash --login +h
question: 不执行 "exec /bin/bash --login +h" 难道新的程序不会调用新编译出来的 bash 吗?

question: 怎样判断测试结果是否正确?

time { ./configure --prefix=/usr --bindir=/bin \
    --htmldir=/usr/share/doc/bash-4.1 --without-bash-malloc \
    --with-installed-readline && make; } 2>&1 | tee /backup/installlogs/6bash.make.log
real    0m53.351s
user    0m23.309s
sys    0m39.270s

time { su-tools nobody -s /bin/bash -c "make tests"; } 2>&1 | tee /backup/installlogs/6bash.check.log
real    2m41.497s
user    0m1.600s
sys    0m24.986s

time { make install; } 2>&1 | tee /backup/installlogs/6bash.install.log
real    0m1.568s
user    0m0.164s
sys    0m1.596s

/LFS6.6/LFS-BOOK-6.6-HTML/chapter06/libtool.html

time { ./configure --prefix=/usr && make; } 2>&1 | tee /backup/installlogs/6libtool.make.log
real    0m16.105s
user    0m3.892s
sys    0m12.437s

time { make check; } 2>&1 | tee /backup/installlogs/6libtool.check.log
real    7m24.586s
user    2m18.977s
sys    8m48.405s

time { make install; } 2>&1 | tee /backup/installlogs/6libtool.install.log
real    0m0.804s
user    0m0.236s
sys    0m0.964s