-BUILD_CC="gcc"
-CC="${CLFS_TARGET}-gcc ${CLFS_BUILDFLAGS}"
-AR="${CLFS_TARGET}-ar"
-RANLIB="${CLFS_TARGET}-ranlib"
-
-CONFIGURE_OPTS="\
- --prefix=/tools \
- --host=${CLFS_TARGET} \
- --build=${CLFS_HOST} \
- --disable-profile \
- --enable-add-ons \
- --with-tls \
- --enable-kernel=$(get_pkg_ver ${KERNEL}) \
- --with-__thread \
- --with-binutils=/cross-tools/bin \
- --with-headers=/tools/include"
+hvconfig_pre()
+{
+ export BUILD_CC="gcc"
+ export CC="${CLFS_TARGET}-gcc ${CLFS_BUILDFLAGS}"
+ export AR="${CLFS_TARGET}-ar"
+ export RANLIB="${CLFS_TARGET}-ranlib"
+
+ CONFIGURE_OPTS="\
+ --prefix=/tools \
+ --host=${CLFS_TARGET} \
+ --build=${CLFS_HOST} \
+ --disable-profile \
+ --enable-add-ons \
+ --with-tls \
+ --enable-kernel=$(get_pkg_ver3 ${KERNEL}) \
+ --with-__thread \
+ --with-binutils=/cross-tools/bin \
+ --with-headers=/tools/include"
+
+ cd ${LFS_TMP}/${PACKAGE}
+
+ decompress_package ${EGLIBC_PORTS} $(pwd) 1> /dev/null
+
+ # libgcc_eh.a does not get built if building GCC with `--disable-shared'.
+ # The objects that would otherwise end up in libgcc_eh.a end up in libgcc.a
+ # instead. Unfortunately, Glibc insists upon linking with `-lgcc_eh'.
+ # Therefore, disable linking to libgcc_eh:
+ sed -e 's/-lgcc_eh//g' -i Makeconfig
+}