2018-04-15 21:29:09 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
set -e
|
2022-02-10 22:43:30 +00:00
|
|
|
# Mounted directory may already be configured. Trying to install from
|
|
|
|
# such directory would cause a failure in the container due to mismatch in
|
|
|
|
# command names/paths detected by configure on the host.
|
|
|
|
if [ -e /crosstool-ng/Makefile \
|
|
|
|
-o -e /crosstool-ng/.build \
|
|
|
|
-o -e /crosstool-ng/.build-all \
|
|
|
|
-o -e /crosstool-ng/config.status ]; then
|
|
|
|
echo "ERROR :: The host directory must not be configured/built. Run 'git clean -fxd' before" >&2
|
|
|
|
echo "ERROR :: installing crosstool-NG in the container." >&2
|
|
|
|
exit 1
|
|
|
|
fi
|
2019-02-28 23:28:30 +00:00
|
|
|
tar cf - -C / \
|
|
|
|
--exclude=crosstool-ng/.git \
|
|
|
|
--exclude=crosstool-ng/testing/docker \
|
|
|
|
crosstool-ng | \
|
|
|
|
tar xf -
|
|
|
|
cd crosstool-ng
|
2022-02-10 22:43:30 +00:00
|
|
|
./bootstrap
|
|
|
|
cd ../work
|
2019-02-28 23:28:30 +00:00
|
|
|
~/crosstool-ng/configure --prefix=/opt/ctng
|
2018-04-15 21:29:09 +00:00
|
|
|
make
|
|
|
|
make install
|
2019-02-28 23:28:30 +00:00
|
|
|
cd ..
|
|
|
|
rm -rf crosstool-ng
|