Méthode plus fiable pour détecter la version eglibc
[hvlinux.git] / stage2 / pkg / eglibc
index d53de20..6173260 100644 (file)
@@ -2,8 +2,6 @@
 
 hvconfig_pre()
 {
-    export CFLAGS="-mtune=generic -g -O2"
-
     CONFIGURE_OPTS="\
         ${CONFIGURE_OPTS} \
         --disable-profile \
@@ -11,12 +9,6 @@ hvconfig_pre()
         --enable-kernel=$(get_pkg_ver ${KERNEL}) \
         --libexecdir=/usr/lib/eglibc"
 
-    case "${HVL_TARGET}" in
-        "x86")
-            CFLAGS="-march=$(cut -d- -f1 <<< ${CLFS_TARGET}) ${CFLAGS}"
-            ;;
-    esac
-
     # 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
@@ -39,11 +31,6 @@ hvconfig_pre()
     esac
 }
 
-hvconfig_post()
-{
-    unset CFLAGS
-}
-
 hvbuild()
 {
     make
@@ -57,8 +44,10 @@ hvbuild()
             # 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.
-            EGLIBC_VER_BASE=$(echo ${PACKAGE} | sed "s!eglibc-\([^-]*\)-.*!\1!g")
-            ln -svfT ld-${EGLIBC_VER_BASE}.so /lib/ld-linux.so.2
+            local EGLIBC_VER=$(cat ${LFS_TMP}/${PACKAGE}/version.h | \
+                grep "VERSION" | sed "s!.*VERSION\ \"\(.*\)\"!\1!")
+
+            ln -svfT ld-${EGLIBC_VER}.so /lib/ld-linux.so.2
             make install
 
             # Now we can remove this symlink.