-# Mounting and populating /dev for the chroot environment.
-# May fail if it is already mountewd, but it is ok.
-mount -v --bind /dev ${LFS}/dev 1> /dev/null 2>&1
-
-# If something went wrong, proc, dev and devpts may still be mounted.
-umount -n ${LFS}/proc 1> /dev/null 2>&1
-umount -n ${LFS}/dev/pts 1> /dev/null 2>&1
-
-# Making sure that if a separate boot partition is defined, it is mounted.
-if [ -n "${BOOT_PARTITION}" ]; then
- if ! grep "${BOOT_PARTITION}" /etc/mtab | grep "${LFS}/boot" 1> /dev/null 2>&1; then
- echo "You defined \"${BOOT_PARTITION}\" as your boot partition,"
- echo "but it is not mounted in your LFS partition. You must"
- echo "mount it before running this script again."
- exit 1;
- fi
-fi
+ipkg ${PERL} cis-perl-pass1 "${PERL}-pass1"
+ipkg_cust ${KERNEL} cis-kernel
+ipkg_cust ${MANPAGES} cis-man-pages
+ipkg_cust ${EGLIBC} cis-eglibc
+rscr once "Adjusting toolchain" cis-toolchain-adjust
+rscr mult "Testing toolchain" cis-toolchain-test
+
+CPPFLAGS=-fexceptions CC="gcc -isystem /usr/include" \
+ CXX="g++ -isystem /usr/include" LDFLAGS="-Wl,-rpath-link,/lib" \
+ ipkg_ac ${GMP} "--enable-cxx --enable-mpbsd"
+
+CC="gcc -isystem /usr/include" LDFLAGS="-Wl,-rpath-link,/lib" \
+ ipkg_ac ${MPFR} "--enable-shared --with-gmp=/usr"
+
+CPPFLAGS=-fexceptions CC="gcc -isystem /usr/include" \
+ CXX="g++ -isystem /usr/include" \
+ LDFLAGS="-Wl,-rpath-link,/lib" \
+ ipkg_ac ${PPL} "--enable-shared --disable-optimization"
+
+CC="gcc -isystem /usr/include" LDFLAGS="-Wl,-rpath-link,/lib" \
+ ipkg_ac ${CLOOG_PPL} "--enable-shared --with-gmp --with-ppl"
+
+CC="gcc -isystem /usr/include" CXX="g++ -isystem /usr/include" \
+ LDFLAGS="-Wl,-rpath-link,/lib" \
+ ipkg_cust ${ZLIB} cis-zlib "--shared"
+
+CC="gcc -isystem /usr/include" \
+ LDFLAGS="-Wl,-rpath-link,/lib" \
+ ipkg_cust ${BINUTILS} cis-binutils \
+ --libdir=/usr/lib \
+ --enable-shared \
+ --disable-multilib
+
+CC="gcc -Wl,-rpath-link,/lib -isystem /usr/include" \
+ CXX="g++ -Wl,-rpath-link,/lib -isystem /usr/include" \
+ ipkg_cust ${GCC} cis-gcc \
+ --libexecdir=/usr/lib \
+ --enable-shared \
+ --enable-threads=posix \
+ --enable-__cxa_atexit \
+ --enable-c99 \
+ --enable-long-long \
+ --enable-clocale=gnu \
+ --enable-languages=c,c++ \
+ --disable-multilib \
+ --disable-libstdcxx-pch