-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild-pre-bootstrap.sh
52 lines (41 loc) · 1.12 KB
/
build-pre-bootstrap.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#!/bin/bash
# This is to be run in Ada/D Capable LFS 11.3
if [ "`whoami`" == "root" ]; then
echo "Danger, Will Robinson!"
echo "Do not execute me as r00t"
exit 1
elif [ ! -f gcc-14.2.0.tar.xz ]; then
echo "The GCC source tarball gcc-14.2.0.tar.xz"
echo "must exist in same directory this script"
echo "is run from."
exit 1
fi
MYPREFIX="/opt/gcc-prebootstrap"
[ -d gcc-14.2.0 ] && rm -rf gcc-14.2.0
tar -Jxf gcc-14.2.0.tar.xz
cd gcc-14.2.0
sed -i.orig '/m64=/s/lib64/lib/' gcc/config/i386/t-linux64
mkdir build && cd build
../configure \
--prefix=${MYPREFIX} \
--datadir=${MYPREFIX}/share \
--mandir=${MYPREFIX}/share/man \
--infodir=${MYPREFIX}/info \
--disable-multilib \
--with-system-zlib \
--disable-libssp \
--disable-libquadmath \
--disable-libgomp \
--disable-libvtv \
--disable-libsanitizer \
--enable-libada \
--enable-linker-build-id \
--enable-languages=c,c++,ada,d
make -j4
if [ $? -ne 0 ]; then
echo "Failed building gcc"
exit 1
fi
echo
echo "build complete. As root, run make install (inside build directory)."
# note - tests are not run at this point, way too time consuming.