Remove /tools and /cross-tools links on host system
[hvlinux.git] / stage0 / pkg / gcc
index ed373ac..70f69c7 100644 (file)
@@ -3,7 +3,7 @@
 hvconfig_pre()
 {
     export AR=ar
-    export LDFLAGS="-Wl,-rpath,/cross-tools/lib"
+    export LDFLAGS="-Wl,-rpath,${CROSS_TOOLS_DIR}/lib"
 
     # Common options for passes 1 & 2
     # --with-local-prefix:
@@ -19,19 +19,20 @@ hvconfig_pre()
     #     --with-native-system-header-dir=/tools/include
     #   then GCC will search for system headers in:
     #     /opt/toolchain/tools/include
-    CONFIGURE_OPTS+=" \
+    CONFIGURE_OPTS=" \
+        --prefix=/cross-tools \
         --build=${CLFS_HOST} \
         --host=${CLFS_HOST} \
         --target=${CLFS_TARGET} \
         --with-sysroot=${CLFS} \
-        --with-local-prefix=/tools \
+        --with-local-prefix=${TOOLS_DIR} \
         --with-native-system-header-dir=/tools/include \
         --disable-nls \
-        --with-mpfr=/cross-tools \
-        --with-gmp=/cross-tools \
-        --with-isl=/cross-tools \
-        --with-cloog=/cross-tools \
-        --with-mpc=/cross-tools
+        --with-mpfr=${CROSS_TOOLS_DIR} \
+        --with-gmp=${CROSS_TOOLS_DIR} \
+        --with-isl=${CROSS_TOOLS_DIR} \
+        --with-cloog=${CROSS_TOOLS_DIR} \
+        --with-mpc=${CROSS_TOOLS_DIR}
         --with-system-zlib \
         --enable-checking=release \
         --disable-multilib"
@@ -61,8 +62,8 @@ hvconfig_pre()
 
         # We will create a dummy limits.h so the build will not use the one
         # provided by the host distro:
-        mkdir -p /tools/include
-        touch /tools/include/limits.h
+        mkdir -p ${TOOLS_DIR}/include
+        touch ${TOOLS_DIR}/include/limits.h
     else
         CONFIGURE_OPTS+=" \
             --enable-shared \
@@ -97,11 +98,11 @@ hvbuild()
 {
     if [ "x${HVLABEL}" = "x${GCC}-pass1" ]; then
         ${HVMAKE} all-gcc all-target-libgcc
-        ${HVMAKE} install-gcc install-target-libgcc
+        ${HVMAKE} install-gcc install-target-libgcc DESTDIR=${CLFS}
     else
         ${HVMAKE} \
             AS_FOR_TARGET="${CLFS_TARGET}-as" \
             LD_FOR_TARGET="${CLFS_TARGET}-ld"
-        ${HVMAKE} install
+        ${HVMAKE} install DESTDIR=${CLFS}
     fi
 }