summaryrefslogtreecommitdiff
path: root/build_cross.sh
diff options
context:
space:
mode:
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