Remove /tools and /cross-tools links on host system
authorHugo Villeneuve <hugo@hugovil.com>
Fri, 3 Oct 2014 02:31:23 +0000 (22:31 -0400)
committerHugo Villeneuve <hugo@hugovil.com>
Sat, 27 Dec 2014 03:26:26 +0000 (22:26 -0500)
TODO
functions/main
stage0/hv-install-2
stage0/ipkg.def
stage0/pkg/binutils
stage0/pkg/gcc
stage0/pkg/glibc
stage0/pkg/linux
stage0/pkg/ncurses
stage0/pre-install

diff --git a/TODO b/TODO
index 142f98c..525bfaa 100644 (file)
--- a/TODO
+++ b/TODO
@@ -73,4 +73,3 @@ du fichier sysinfos).
 Faire un script de test (tester la présence de certains programmes à la
 toute fin de l'installation (ou dans chaque script d'installation)
 
-Éliminer les liens /tools et /cross-tools
index 038b99d..4af62ad 100644 (file)
@@ -62,6 +62,9 @@ fi
 
 CLFS=${LFS}
 
+CROSS_TOOLS_DIR=${CLFS}/cross-tools
+TOOLS_DIR=${CLFS}/tools
+
 # Load functions
 source ../functions/fpkg
 source ../functions/lpkg
index 7b7f32e..5c9d66b 100755 (executable)
@@ -20,25 +20,25 @@ ipkg ${GMP} "\
     --enable-cxx \
     --disable-static"
 
-export LDFLAGS="-Wl,-rpath,/cross-tools/lib"
+export LDFLAGS="-Wl,-rpath,${CROSS_TOOLS_DIR}/lib"
 
 ipkg ${MPFR} "\
     --disable-static \
-    --with-gmp=/cross-tools"
+    --with-gmp=${CROSS_TOOLS_DIR}"
 
 ipkg ${MPC} "\
     --disable-static \
-    --with-gmp=/cross-tools \
-    --with-mpfr=/cross-tools"
+    --with-gmp=${CROSS_TOOLS_DIR} \
+    --with-mpfr=${CROSS_TOOLS_DIR}"
 
 ipkg ${ISL} "\
     --disable-static \
-    --with-gmp-prefix=/cross-tools"
+    --with-gmp-prefix=${CROSS_TOOLS_DIR}"
 
 ipkg ${CLOOG} "\
     --disable-static \
     --with-bits=gmp \
-    --with-gmp-prefix=/cross-tools"
+    --with-gmp-prefix=${CROSS_TOOLS_DIR}"
 
 LDFLAGS=""
 
index 312982d..d846cee 100644 (file)
@@ -4,5 +4,5 @@ export BUILD64="-m64"
 
 # Setting default configure options for all scripts
 CONFIGURE_OPTS="\
-      --prefix=/cross-tools \
+      --prefix=${CROSS_TOOLS_DIR} \
       ${CONFIGURE_OPTS}"
index 40c8270..2653b0d 100644 (file)
@@ -8,7 +8,8 @@ hvconfig_pre()
     # --with-lib-path:
     # Set to dummy (non-existent) directory to prevent having
     # host directories list.
-    CONFIGURE_OPTS+=" \
+    CONFIGURE_OPTS=" \
+        --prefix=/cross-tools \
         --host=${CLFS_HOST} \
         --target=${CLFS_TARGET} \
         --with-sysroot=${CLFS} \
@@ -30,6 +31,12 @@ hvconfig_pre()
     esac
 }
 
+hvbuild()
+{
+    ${HVMAKE}
+    ${HVMAKE} install DESTDIR=${CLFS}
+}
+
 hvconfig_post()
 {
     unset AR
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
 }
index d31ab21..acf6b5a 100644 (file)
@@ -20,9 +20,9 @@ hvconfig_pre()
         --with-tls \
         --enable-kernel=$(get_pkg_ver3 ${KERNEL}) \
         --with-__thread \
-        --with-binutils=/cross-tools/bin \
+        --with-binutils=${CROSS_TOOLS_DIR}/bin \
         --enable-obsolete-rpc \
-        --with-headers=/tools/include"
+        --with-headers=${TOOLS_DIR}/include"
 }
 
 # For Glibc to support NPTL:
@@ -36,6 +36,12 @@ libc_cv_ssp=no
 EOF
 }
 
+hvbuild()
+{
+    ${HVMAKE}
+    ${HVMAKE} install install_root=${CLFS}
+}
+
 hvconfig_post()
 {
     unset BUILD_CC
index 1107e1b..19781c7 100644 (file)
@@ -6,6 +6,6 @@ hvbuild()
 
     ${HVMAKE} mrproper
     ${HVMAKE} ARCH=${CLFS_ARCH} INSTALL_HDR_PATH=dest headers_install
-    install -dv /tools/include
-    cp -rv dest/include/* /tools/include
+    install -dv ${TOOLS_DIR}/include
+    cp -rv dest/include/* ${TOOLS_DIR}/include
 }
index b2126bc..0732883 100644 (file)
@@ -14,5 +14,5 @@ hvbuid()
     ${HVMAKE} -C progs tic
 
     # Install tic
-    install -v -m755 progs/tic /cross-tools/bin
+    install -v -m755 progs/tic ${CROSS_TOOLS_DIR}/bin
 }
index 5ff17d2..0d72afd 100755 (executable)
@@ -30,17 +30,12 @@ done
 
 chown -R lfs:lfs ${LFS}
 
-# Creating a link from the host root directory to LFS cross-tools directories
-for subdir in tools cross-tools; do
-    ln -sfvT ${LFS}/${subdir} /${subdir}
-done
-
 cat > /home/lfs/.bashrc << "EOF"
 # Setting up the environment
 set +h
 umask 022
 LC_ALL=POSIX
-PATH=/cross-tools/bin:/bin:/usr/bin
+PATH=_CLFS_CROSS_TOOLS_PATH_/bin:/bin:/usr/bin
 HVMAKE="make -j ${MAKEJOBS}"
 
 unset CFLAGS
@@ -49,6 +44,8 @@ unset CXXFLAGS
 export LC_ALL PATH HVMAKE
 EOF
 
+sed -e "s@_CLFS_CROSS_TOOLS_PATH_@${CROSS_TOOLS_DIR}@" -i /home/lfs/.bashrc
+
 chown lfs:lfs /home/lfs/.bashrc
 
 exit $?