summaryrefslogtreecommitdiff
path: root/build_cross.sh
diff options
context:
space:
mode:
authorAndreas Baumann <mail@andreasbaumann.cc>2018-01-27 20:31:58 +0100
committerAndreas Baumann <mail@andreasbaumann.cc>2018-01-27 20:31:58 +0100
commitd81584556c99356f42d30c87f9b87989f7653987 (patch)
treede14e68ffffe17bee01d668468e788acfe6a1e81 /build_cross.sh
parent76952ff1721daa8531e481b076a5672cef30d7e5 (diff)
downloadbootstrap32-d81584556c99356f42d30c87f9b87989f7653987.tar.xz
added stage 1: preparing the i486 chroot
Diffstat (limited to 'build_cross.sh')
-rwxr-xr-xbuild_cross.sh20
1 files changed, 15 insertions, 5 deletions
diff --git a/build_cross.sh b/build_cross.sh
index 997d68e..f40ce98 100755
--- a/build_cross.sh
+++ b/build_cross.sh
@@ -1,5 +1,7 @@
#!/bin/sh
+. "./default.conf"
+
# Prepare the cross-compiler for the destination platform, in our
# case i486.
@@ -17,6 +19,7 @@ if test ! -f /etc/sudoers.d/cross; then
fi
if test ! -x /usr/local/bin/ct-ng; then
+ echo "Installing crosstool-ng:"
su - cross <<EOF
mkdir cross
cd cross
@@ -28,15 +31,22 @@ make
sudo make install
cd ..
EOF
+ echo "Done crosstool-ng."
fi
-if test ! -x /home/cross/x-tools/i486-unknown-linux-gnu/bin/i486-unknown-linux-gnu-gcc; then
- rm -rf /home/cross/{x-tools,.build,build.log,.wget-hsts,.config,.config.old}
- cp ct-ng.config /home/cross/.config
+if test ! -x $CROSS_HOME/x-tools/i486-unknown-linux-gnu/bin/i486-unknown-linux-gnu-gcc; then
+ echo "Building cross compiler for i486-unknown-linux-gnu-gcc:"
+ rm -rf $CROSS_HOME/{x-tools,.build,build.log,.wget-hsts,.config,.config.old}
+ cp ct-ng.config $CROSS_HOME/.config
CPUS=$(nproc)
- sed -i "s/^CT_PARALLEL_JOBS=.*/CT_PARALLEL_JOBS=$CPUS/" /home/cross/.config
- chown cross:cross /home/cross/.config
+ sed -i "s/^CT_PARALLEL_JOBS=.*/CT_PARALLEL_JOBS=$CPUS/" $CROSS_HOME/.config
+ chown cross:cross $CROSS_HOME/.config
su - cross <<EOF
ct-ng build
EOF
+ echo "Done creating the cross compiler."
fi
+
+echo -n "Cross-compiler ready: "
+CROSS_MSG="$($CROSS_HOME/x-tools/i486-unknown-linux-gnu/bin/i486-unknown-linux-gnu-gcc --version | head -n 1)"
+echo $CROSS_MSG