#!/bin/bash hvconfig_pre() { # --enable-obsolete-rpc # install rpc headers that are not installed by default but may be # needed by other packages. CONFIGURE_OPTS+=" \ --disable-profile \ --enable-kernel=$(get_pkg_ver ${KERNEL}) \ --enable-obsolete-rpc \ --libexecdir=/usr/lib/glibc" cd ${LFS_TMP}/${PACKAGE} # When running make install, a script called test-installation.pl performs a # small sanity test on our newly installed Glibc. However, because our # toolchain still points to the /tools directory, the sanity test would be # carried out against the wrong Glibc. We can force the script to check the # Glibc we have just installed with: LINKER=$(readelf -l /tools/bin/bash | \ sed -n 's@.*interpret.*/tools\(.*\)]$@\1@p') sed -i "s|libs -o|libs -L/usr/lib -Wl,-dynamic-linker=${LINKER} -o|" \ scripts/test-installation.pl unset LINKER cd ${LFS_TMP}/${PACKAGE}-build case "${HVL_TARGET}" in "x86_64") # Tell glibc to install its libraries into /lib: echo "slibdir=/lib" >> configparms CONFIGURE_OPTS+=" --libdir=/usr/lib" ;; esac } hvbuild() { make touch /etc/ld.so.conf case "${HVL_TARGET}" in "x86_64") # The install will finish by checking that everything is correctly # installed. Unfortunately, it will test for a multilib # installation. # On x86_64 Pure64 this means it will try to test the non-existent # 32-bit loader which has a different name from the 64-bit loader # (unlike on other 64-bit architectures). We fool it by creating a # symlink to the real loader. ln -svfT ld-$(get_pkg_ver2 ${PACKAGE}).so /lib/ld-linux.so.2 make install # Remove unneeded files from /usr/include/rpcsvc rm -v /usr/include/rpcsvc/*.x # Now we can remove this symlink. rm -v /lib/ld-linux.so.2 # We also need to correct the /usr/bin/ldd script - if you look at # this, you will see it references not only the 32-bit linker, but # also /lib64 where it thinks the 64-bit linker is. cp -v /usr/bin/ldd{,.bak} sed '/RTLDLIST/s%/ld-linux.so.2 /lib64%%' /usr/bin/ldd.bak > \ /usr/bin/ldd rm -v /usr/bin/ldd.bak ;; *) make install ;; esac # Install the configuration file and runtime directory for nscd: cp -v ${LFS_TMP}/${PACKAGE}/nscd/nscd.conf /etc/nscd.conf mkdir -pv /var/cache/nscd # The following instructions, instead of the install-locales target # above, will install the minimum set of locales necessary for the # tests to run successfully: mkdir -pv /usr/lib/locale localedef -i cs_CZ -f UTF-8 cs_CZ.UTF-8 localedef -i de_DE -f ISO-8859-1 de_DE localedef -i de_DE@euro -f ISO-8859-15 de_DE@euro localedef -i de_DE -f UTF-8 de_DE.UTF-8 localedef -i en_HK -f ISO-8859-1 en_HK localedef -i en_PH -f ISO-8859-1 en_PH localedef -i en_US -f ISO-8859-1 en_US localedef -i en_US -f UTF-8 en_US.UTF-8 localedef -i es_MX -f ISO-8859-1 es_MX localedef -i fa_IR -f UTF-8 fa_IR localedef -i fr_FR -f ISO-8859-1 fr_FR localedef -i fr_FR@euro -f ISO-8859-15 fr_FR@euro localedef -i fr_FR -f UTF-8 fr_FR.UTF-8 localedef -i it_IT -f ISO-8859-1 it_IT localedef -i ja_JP -f EUC-JP ja_JP localedef -i tr_TR -f UTF-8 tr_TR.UTF-8 localedef -i zh_CN -f GB18030 zh_CN.GB18030 # French canadian locales: localedef -i ca_FR -f UTF-8 ca_FR.UTF-8 localedef -i ca_FR -f ISO-8859-1 ca_FR localedef -i fr_CA -f UTF-8 fr_CA.UTF-8 localedef -i fr_CA -f ISO-8859-1 fr_CA cat > /etc/nsswitch.conf << "EOF" # /etc/nsswitch.conf passwd: files group: files shadow: files hosts: files dns networks: files protocols: files services: files ethers: files rpc: files EOF cat > /etc/ld.so.conf << "EOF" # /etc/ld.so.conf /usr/local/lib /opt/lib EOF }