shift
CONFIGURE_OPTS=${*}
-# Applying patches (if any)
-apply_patches ${PACKAGE}
+EGLIBC_VER=$(echo ${PACKAGE} | sed "s!eglibc-\([0-9]*\.[0-9]*\.[0-9]*\)-.*!\1!g")
+
+case "${HVL_TARGET}" in
+ "x86" | "x86_64")
+ # Manually apply patch
+ apply_patch ${1}-rpath.patch ${1}
+ ;;
+esac
+
+TMP_CFLAGS="-mtune=generic -g -O2"
+
+case "${HVL_TARGET}" in
+ "x86")
+ TMP_CFLAGS="-march=$(cut -d- -f1 <<< ${CLFS_TARGET}) ${TMP_CFLAGS}"
+ ;;
+esac
# When running make install, a script called test-installation.pl
# performs a small sanity test on our newly installed Glibc. However,
# Configure options:
# --libexecdir=/usr/lib/eglibc
# Changes the location of the pt_chown program from its default of /usr/libexec to /usr/lib/eglibc.
-CFLAGS="-march=$(cut -d- -f1 <<< $MACHTYPE) -mtune=generic -g -O2" \
- ../${PACKAGE}/configure \
+CFLAGS=${TMP_CFLAGS} \
+ ../${PACKAGE}/configure \
--prefix=/usr \
--disable-profile \
--enable-add-ons \
- --enable-kernel=2.6.32 \
+ --enable-kernel=$(get_pkg_ver ${KERNEL}) \
--libexecdir=/usr/lib/eglibc \
${CONFIGURE_OPTS}
make
# 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_ver ${PACKAGE}).so /lib/ld-linux.so.2
+ ln -svfT ld-${EGLIBC_VER}.so /lib/ld-linux.so.2
make install
# Now we can remove this symlink.