-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sh
89 lines (88 loc) · 4.97 KB
/
install.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
/bin/echo -n 'Downloading the source code for Debian Almquist shell... ';
curl -fsSL https://git.kernel.org/pub/scm/utils/dash/dash.git/snapshot/dash-0.5.12.tar.gz > dash.tar.gz;
/bin/echo 'done.';
/bin/echo -n 'Unpacking the tarball... ';
tar -xf dash.tar.gz;
/bin/echo 'done.';
/bin/echo -n 'Configuring the build with autotools... ';
cd dash-* || exit 127;
./autogen.sh;
cd .. || exit 127;
mkdir dash.build;
cd dash.build || exit 127;
../dash-*/configure --prefix=/opt/byblos --program-prefix=byblos- --disable-dependency-tracking --enable-static --disable-fnmatch --enable-test-workaround --disable-lineno CFLAGS='-fPIC -O3 -march=nocona -mtune=haswell' LDFLAGS='-pie' 1>/dev/null 2>&1;
/bin/echo 'done.';
/bin/echo -n "Building with job control ($(nproc) threads)... ";
make -j"$(nproc)" 1>/dev/null 2>&1;
/bin/echo 'done.';
/bin/echo -n 'Installing Debian Almquist shell... ';
make install 1>/dev/null 2>&1;
/bin/echo 'done.';
/bin/echo -n 'Cleaning up... ';
cd .. || exit 127;
rm -rf dash.tar.gz dash.build dash-*;
/bin/echo 'done.';
/bin/echo -n 'Downloading the source code for GNU coreutils... ';
curl -fsSL https://ftpmirror.gnu.org/gnu/coreutils-9.1.tar.gz > coreutils.tar.gz;
/bin/echo 'done.';
/bin/echo -n 'Unpacking the tarball... ';
tar -xf coreutils.tar.gz;
/bin/echo 'done.';
/bin/echo -n 'Configuring the build with autotools... ';
mkdir coreutils.build;
cd coreutils.build || exit 127;
../coreutils-*/configure --prefix=/opt/byblos --build=x86_64-pc-linux-gnu --disable-dependency-tracking --disable-acl --disable-assert --disable-xattr --with-linux-crypto --with-gnu-ld --without-selinux CFLAGS='-fPIC -O3 -march=nocona -mtune=haswell' LDFLAGS='-pie' 1>/dev/null 2>&1;
/bin/echo 'done.';
/bin/echo -n "Building with job control ($(nproc) threads)... ";
make -j"$(nproc)" 1>/dev/null 2>&1;
/bin/echo 'done.';
/bin/echo -n 'Installing GNU coreutils... ';
make install 1>/dev/null 2>&1;
/bin/echo 'done.';
/bin/echo -n 'Cleaning up... ';
cd .. || exit 127;
rm -rf coreutils.tar.gz coreutils.build coreutils-*;
/bin/echo 'done.';
/bin/echo -n 'Downloading the source code for GNU binutils... ';
curl -fsSL https://ftpmirror.gnu.org/gnu/binutils-2.40.tar.lz > binutils.tar.lz;
/bin/echo 'done.';
/bin/echo -n 'Unpacking the tarball... ';
plzip -cd binutils.tar.lz | tar -xf -;
/bin/echo 'done.';
/bin/echo -n 'Configuring the build with autotools... ';
mkdir binutils.build-native;
cd binutils.build-native || exit 127;
../binutils-*/configure --prefix=/opt/byblos --program-prefix=byblos- --program-suffix=-native --build=x86_64-pc-linux-gnu --enable-year2038 --disable-libstdcxx --disable-bootstrap --enable-lto --disable-host-shared --disable-vtable-verify --without-zstd --with-gcc-major-version-only CFLAGS='-fPIC -O3 -march=nocona -mtune=haswell' CXXFLAGS='-fPIC -O3 -march=nocona -mtune=haswell' LDFLAGS='-pie' CC_FOR_TARGET=/opt/byblos/bin/byblos-gcc-native CXX_FOR_TARGET=/opt/byblos/bin/byblos-g++-native GDC_FOR_TARGET=/opt/byblos/bin/byblos-gdc-native AR_FOR_TARGET=/opt/byblos/bin/byblos-ar-native AS_FOR_TARGET=/opt/byblos/bin/byblos-as-native LD_FOR_TARGET=/opt/byblos/bin/byblos-ld-native NM_FOR_TARGET=/opt/byblos/bin/byblos-nm-native OBJCOPY_FOR_TARGET=/opt/byblos/bin/byblos-objcopy-native OBJDUMP_FOR_TARGET=/opt/byblos/bin/byblos-objdump-native RANLIB_FOR_TARGET=/opt/byblos/bin/byblos-ranlib-native READELF_FOR_TARGET=/opt/byblos/bin/byblos-readelf-native STRIP_FOR_TARGET=/opt/byblos/bin/byblos-strip-native 1>/dev/null 2>&1;
/bin/echo 'done.';
/bin/echo -n "Building with job control ($(nproc) threads)... ";
make -j"$(nproc)" 1>/dev/null 2>&1;
/bin/echo 'done.';
/bin/echo -n 'Installing GNU binutils... ';
make install 1>/dev/null 2>&1;
/bin/echo 'done.';
/bin/echo -n 'Cleaning up... ';
cd .. || exit 127;
rm -rf binutils.tar.gz binutils.build-native binutils-*;
/bin/echo 'done.';
/bin/echo -n 'Downloading the source code for GCC... ';
curl -fsSL http://robotlab.itk.ppke.hu/gcc/releases/gcc-10.4.0/gcc-10.4.0.tar.gz > gcc.tar.gz;
/bin/echo 'done.';
/bin/echo -n 'Unpacking the tarball... ';
tar -xf gcc.tar.gz;
/bin/echo 'done.';
/bin/echo -n 'Downloading support libraries using in-tree script... ';
cd gcc-* || exit 127;
./contrib/download_prerequisites 1>/dev/null 2>&1;
cd .. || exit 127;
/bin/echo 'done.';
/bin/echo -n 'Configuring the build with autotools... ';
mkdir gcc.build-native;
cd gcc.build-native || exit 127;
../gcc-*/configure --build=x86_64-pc-linux-gnu --prefix=/opt/byblos --program-prefix=byblos- --program-suffix=-native --with-local-prefix=/opt/byblos --with-gcc-major-version-only --disable-shared --disable-multiarch --with-arch=nocona --with-tune=haswell --enable-link-mutex --disable-bootstrap --enable-languages=c,d,lto --enable-default-pie --enable-default-ssp --enable-large-address-aware --disable-checking --with-long-double-128 --with-long-double-format=ieee
/bin/echo 'done.';
/bin/echo -n "Building with job control ($(nproc) threads)... ";
make -j"$(nproc)" BOOT_CFLAGS='-O3 -flto' 1>/dev/null 2>&1;
/bin/echo 'done.';
/bin/echo -n 'Installing GCC... ';
make install 1>/dev/null 2>&1;
/bin/echo 'done.';