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
CLFS=${LFS}
+CROSS_TOOLS_DIR=${CLFS}/cross-tools
+TOOLS_DIR=${CLFS}/tools
+
# Load functions
source ../functions/fpkg
source ../functions/lpkg
--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=""
# Setting default configure options for all scripts
CONFIGURE_OPTS="\
- --prefix=/cross-tools \
+ --prefix=${CROSS_TOOLS_DIR} \
${CONFIGURE_OPTS}"
# --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} \
esac
}
+hvbuild()
+{
+ ${HVMAKE}
+ ${HVMAKE} install DESTDIR=${CLFS}
+}
+
hvconfig_post()
{
unset AR
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:
# --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"
# 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 \
{
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
}
--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:
EOF
}
+hvbuild()
+{
+ ${HVMAKE}
+ ${HVMAKE} install install_root=${CLFS}
+}
+
hvconfig_post()
{
unset BUILD_CC
${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
}
${HVMAKE} -C progs tic
# Install tic
- install -v -m755 progs/tic /cross-tools/bin
+ install -v -m755 progs/tic ${CROSS_TOOLS_DIR}/bin
}
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
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 $?