re-edit
This commit is contained in:
691
build.bash
691
build.bash
@@ -8,165 +8,18 @@ umask 022
|
|||||||
. flags.bash
|
. flags.bash
|
||||||
. utilities.bash
|
. utilities.bash
|
||||||
|
|
||||||
bootstrap_binutils() {
|
|
||||||
fetch $BINUTILS_URL
|
|
||||||
|
|
||||||
cd "$SOURCES" && tar xf binutils-$BINUTILS_VERSION.tar.xz && cd binutils-$BINUTILS_VERSION
|
|
||||||
|
|
||||||
mkdir -p build && cd build
|
|
||||||
|
|
||||||
../configure \
|
|
||||||
--prefix="$CROSS" \
|
|
||||||
--with-sysroot="$SYSROOT" \
|
|
||||||
--target=$TARGET \
|
|
||||||
--disable-nls \
|
|
||||||
--enable-gprofng=no \
|
|
||||||
--disable-werror \
|
|
||||||
--enable-new-dtags \
|
|
||||||
--enable-default-hash-style=gnu \
|
|
||||||
--silent \
|
|
||||||
--quiet
|
|
||||||
|
|
||||||
make && make install
|
|
||||||
|
|
||||||
cd "$SOURCES"
|
|
||||||
rm -rf binutils-$BINUTILS_VERSION
|
|
||||||
}
|
|
||||||
|
|
||||||
bootstap_gcc() {
|
|
||||||
fetch $GCC_URL
|
|
||||||
fetch $GMP_URL
|
|
||||||
fetch $ISL_URL
|
|
||||||
fetch $MPC_URL
|
|
||||||
fetch $MPFR_URL
|
|
||||||
|
|
||||||
cd "$SOURCES" && tar xf gcc-$GCC_VERSION.tar.xz && cd gcc-$GCC_VERSION
|
|
||||||
|
|
||||||
tar xf ../gmp-$GMP_VERSION.tar.xz && mv gmp-$GMP_VERSION gmp
|
|
||||||
tar xf ../isl-$ISL_VERSION.tar.xz && mv isl-$ISL_VERSION isl
|
|
||||||
tar xf ../mpc-$MPC_VERSION.tar.gz && mv mpc-$MPC_VERSION mpc
|
|
||||||
tar xf ../mpfr-$MPFR_VERSION.tar.xz && mv mpfr-$MPFR_VERSION mpfr
|
|
||||||
|
|
||||||
sed -e '/m64=/s/lib64/lib/' -i.orig gcc/config/i386/t-linux64
|
|
||||||
|
|
||||||
mkdir -p build && cd build
|
|
||||||
|
|
||||||
../configure \
|
|
||||||
--target=$TARGET \
|
|
||||||
--prefix="$CROSS" \
|
|
||||||
--with-glibc-version=$GLIBC_VERSION \
|
|
||||||
--with-sysroot="$SYSROOT" \
|
|
||||||
--with-newlib \
|
|
||||||
--without-headers \
|
|
||||||
--enable-default-pie \
|
|
||||||
--enable-default-ssp \
|
|
||||||
--disable-nls \
|
|
||||||
--disable-shared \
|
|
||||||
--disable-multilib \
|
|
||||||
--disable-threads \
|
|
||||||
--disable-libatomic \
|
|
||||||
--disable-libgomp \
|
|
||||||
--disable-libquadmath \
|
|
||||||
--disable-libssp \
|
|
||||||
--disable-libvtv \
|
|
||||||
--disable-libstdcxx \
|
|
||||||
--enable-languages=c,c++ \
|
|
||||||
--silent \
|
|
||||||
--quiet
|
|
||||||
|
|
||||||
make && make install
|
|
||||||
|
|
||||||
cd ..
|
|
||||||
cat gcc/limitx.h gcc/glimits.h gcc/limity.h > "`dirname $($TARGET-gcc -print-libgcc-file-name)`/include/limits.h"
|
|
||||||
|
|
||||||
cd "$SOURCES" && rm -rf gcc-$GCC_VERSION
|
|
||||||
}
|
|
||||||
|
|
||||||
bootstap_linux() {
|
|
||||||
fetch $LINUX_URL
|
|
||||||
|
|
||||||
cd "$SOURCES" && tar xf linux-$LINUX_VERSION.tar.xz && cd linux-$LINUX_VERSION
|
|
||||||
|
|
||||||
make mrproper
|
|
||||||
make headers
|
|
||||||
find usr/include -type f ! -name '*.h' -delete
|
|
||||||
cp -r usr/include "$SYSROOT"/usr
|
|
||||||
|
|
||||||
cd "$SOURCES" && rm -rf linux-$LINUX_VERSION
|
|
||||||
}
|
|
||||||
|
|
||||||
bootstap_glibc() {
|
|
||||||
fetch $GLIBC_URL
|
|
||||||
fetch $GLIBC_PATCH_URL
|
|
||||||
|
|
||||||
cd "$SOURCES" && tar xf glibc-$GLIBC_VERSION.tar.xz && cd glibc-$GLIBC_VERSION
|
|
||||||
|
|
||||||
ln -sf ld-linux-x86-64.so.2 "$SYSROOT"/lib/ld-lsb-x86-64.so.3
|
|
||||||
|
|
||||||
patch -sNp1 -i "$SOURCES"/glibc-fhs-1.patch
|
|
||||||
|
|
||||||
mkdir -p build && cd build
|
|
||||||
|
|
||||||
echo "rootsbindir=/usr/sbin" > configparms
|
|
||||||
|
|
||||||
../configure \
|
|
||||||
--prefix=/usr \
|
|
||||||
--host=$TARGET \
|
|
||||||
--build=$(../scripts/config.guess) \
|
|
||||||
--disable-nscd \
|
|
||||||
--disable-nls \
|
|
||||||
libc_cv_slibdir=/usr/lib \
|
|
||||||
--enable-kernel=$LINUX_VERSION \
|
|
||||||
--silent \
|
|
||||||
--quiet
|
|
||||||
|
|
||||||
|
|
||||||
make && make DESTDIR="$SYSROOT" install
|
|
||||||
|
|
||||||
sed '/RTLDLIST=/s@/usr@@g' -i "$SYSROOT"/usr/bin/ldd
|
|
||||||
|
|
||||||
cd "$SOURCES" && rm -rf glibc-$GLIBC_VERSION
|
|
||||||
}
|
|
||||||
|
|
||||||
bootstap_libstdcpp() {
|
|
||||||
cd "$SOURCES" && tar xf gcc-$GCC_VERSION.tar.xz && cd gcc-$GCC_VERSION
|
|
||||||
|
|
||||||
mkdir -p build && cd build
|
|
||||||
|
|
||||||
../libstdc++-v3/configure \
|
|
||||||
--host=$TARGET \
|
|
||||||
--build=$(../config.guess) \
|
|
||||||
--prefix=/usr \
|
|
||||||
--disable-multilib \
|
|
||||||
--disable-nls \
|
|
||||||
--disable-libstdcxx-pch \
|
|
||||||
--with-gxx-include-dir=/cross/$TARGET/include/c++/$GCC_VERSION \
|
|
||||||
--silent \
|
|
||||||
--quiet
|
|
||||||
|
|
||||||
|
|
||||||
make && make DESTDIR="$SYSROOT" install
|
|
||||||
|
|
||||||
rm -rf "$SYSROOT"/usr/lib/lib{stdc++{,exp,fs},supc++}.la
|
|
||||||
|
|
||||||
cd "$SOURCES" && rm -rf gcc-$GCC_VERSION
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
toolchain_m4() {
|
toolchain_m4() {
|
||||||
fetch $M4_URL
|
|
||||||
|
|
||||||
cd "$SOURCES" && tar xf m4-$M4_VERSION.tar.xz && cd m4-$M4_VERSION
|
|
||||||
|
|
||||||
sed -r '/_GL_EXTERN_C/s/w?memchr|bsearch/(&)/' -i $(find -name \*.in.h)
|
|
||||||
|
|
||||||
./configure \
|
|
||||||
--prefix=/usr \
|
|
||||||
--host=$TARGET \
|
|
||||||
--build=$(build-aux/config.guess)
|
|
||||||
|
|
||||||
make && make DESTDIR="$SYSROOT" install
|
|
||||||
|
|
||||||
cd "$SOURCES" && rm -rf m4-$M4_VERSION
|
|
||||||
}
|
}
|
||||||
|
|
||||||
toolchain_ncurses() {
|
toolchain_ncurses() {
|
||||||
@@ -179,7 +32,9 @@ toolchain_ncurses() {
|
|||||||
pushd build
|
pushd build
|
||||||
../configure \
|
../configure \
|
||||||
--prefix="$CROSS" \
|
--prefix="$CROSS" \
|
||||||
AWK=gawk
|
AWK=gawk \
|
||||||
|
--silent \
|
||||||
|
--quiet
|
||||||
make -C include
|
make -C include
|
||||||
make -C progs tic
|
make -C progs tic
|
||||||
install progs/tic "$CROSS/bin"
|
install progs/tic "$CROSS/bin"
|
||||||
@@ -197,7 +52,9 @@ toolchain_ncurses() {
|
|||||||
--without-debug \
|
--without-debug \
|
||||||
--without-ada \
|
--without-ada \
|
||||||
--disable-stripping \
|
--disable-stripping \
|
||||||
AWK=gawk
|
AWK=gawk \
|
||||||
|
--silent \
|
||||||
|
--quiet
|
||||||
|
|
||||||
make && make DESTDIR="$SYSROOT" install
|
make && make DESTDIR="$SYSROOT" install
|
||||||
|
|
||||||
@@ -217,11 +74,13 @@ toolchain_bash() {
|
|||||||
--prefix=/usr \
|
--prefix=/usr \
|
||||||
--build=$(sh support/config.guess) \
|
--build=$(sh support/config.guess) \
|
||||||
--host=$TARGET \
|
--host=$TARGET \
|
||||||
--without-bash-malloc
|
--without-bash-malloc \
|
||||||
|
--silent \
|
||||||
|
--quiet
|
||||||
|
|
||||||
make && make DESTDIR="$SYSROOT" install
|
make && make DESTDIR="$SYSROOT" install
|
||||||
|
|
||||||
ln -sv bash "$SYSROOT"/bin/sh
|
ln -s bash "$SYSROOT"/bin/sh
|
||||||
|
|
||||||
cd "$SOURCES" && rm -rf bash-$BASH_VERSION
|
cd "$SOURCES" && rm -rf bash-$BASH_VERSION
|
||||||
}
|
}
|
||||||
@@ -238,7 +97,9 @@ toolchain_coreutils() {
|
|||||||
--host=$TARGET \
|
--host=$TARGET \
|
||||||
--build=$(build-aux/config.guess) \
|
--build=$(build-aux/config.guess) \
|
||||||
--enable-install-program=hostname \
|
--enable-install-program=hostname \
|
||||||
--enable-no-install-program=kill,uptime
|
--enable-no-install-program=kill,uptime \
|
||||||
|
--silent \
|
||||||
|
--quiet
|
||||||
|
|
||||||
make && make DESTDIR="$SYSROOT" install
|
make && make DESTDIR="$SYSROOT" install
|
||||||
|
|
||||||
@@ -256,7 +117,9 @@ toolchain_diffutils() {
|
|||||||
--prefix=/usr \
|
--prefix=/usr \
|
||||||
--host=$TARGET \
|
--host=$TARGET \
|
||||||
gl_cv_func_strcasecmp_works=y \
|
gl_cv_func_strcasecmp_works=y \
|
||||||
--build=$(./build-aux/config.guess)
|
--build=$(./build-aux/config.guess) \
|
||||||
|
--silent \
|
||||||
|
--quiet
|
||||||
|
|
||||||
make && make DESTDIR="$SYSROOT" install
|
make && make DESTDIR="$SYSROOT" install
|
||||||
|
|
||||||
@@ -275,14 +138,18 @@ toolchain_file() {
|
|||||||
--disable-bzlib \
|
--disable-bzlib \
|
||||||
--disable-libseccomp \
|
--disable-libseccomp \
|
||||||
--disable-xzlib \
|
--disable-xzlib \
|
||||||
--disable-zlib
|
--disable-zlib \
|
||||||
|
--silent \
|
||||||
|
--quiet
|
||||||
make
|
make
|
||||||
popd
|
popd
|
||||||
|
|
||||||
./configure \
|
./configure \
|
||||||
--prefix=/usr \
|
--prefix=/usr \
|
||||||
--host="$TARGET" \
|
--host="$TARGET" \
|
||||||
--build=$(./config.guess)
|
--build=$(./config.guess) \
|
||||||
|
--silent \
|
||||||
|
--quiet
|
||||||
|
|
||||||
make FILE_COMPILE="$(pwd)/build/src/file" && make DESTDIR="$SYSROOT" install
|
make FILE_COMPILE="$(pwd)/build/src/file" && make DESTDIR="$SYSROOT" install
|
||||||
|
|
||||||
@@ -300,7 +167,9 @@ toolchain_findutils() {
|
|||||||
--prefix=/usr \
|
--prefix=/usr \
|
||||||
--localstatedir=/var/lib/locate \
|
--localstatedir=/var/lib/locate \
|
||||||
--host=$TARGET \
|
--host=$TARGET \
|
||||||
--build=$(build-aux/config.guess)
|
--build=$(build-aux/config.guess) \
|
||||||
|
--silent \
|
||||||
|
--quiet
|
||||||
|
|
||||||
make && make DESTDIR="$SYSROOT" install
|
make && make DESTDIR="$SYSROOT" install
|
||||||
|
|
||||||
@@ -317,7 +186,9 @@ toolchain_gawk() {
|
|||||||
./configure \
|
./configure \
|
||||||
--prefix=/usr \
|
--prefix=/usr \
|
||||||
--host=$TARGET \
|
--host=$TARGET \
|
||||||
--build=$(build-aux/config.guess)
|
--build=$(build-aux/config.guess) \
|
||||||
|
--silent \
|
||||||
|
--quiet
|
||||||
|
|
||||||
make && make DESTDIR="$SYSROOT" install
|
make && make DESTDIR="$SYSROOT" install
|
||||||
|
|
||||||
@@ -332,7 +203,9 @@ toolchain_grep() {
|
|||||||
./configure \
|
./configure \
|
||||||
--prefix=/usr \
|
--prefix=/usr \
|
||||||
--host=$TARGET \
|
--host=$TARGET \
|
||||||
--build=$(build-aux/config.guess)
|
--build=$(build-aux/config.guess) \
|
||||||
|
--silent \
|
||||||
|
--quiet
|
||||||
|
|
||||||
make && make DESTDIR="$SYSROOT" install
|
make && make DESTDIR="$SYSROOT" install
|
||||||
|
|
||||||
@@ -346,7 +219,9 @@ toolchain_gzip() {
|
|||||||
|
|
||||||
./configure \
|
./configure \
|
||||||
--prefix=/usr \
|
--prefix=/usr \
|
||||||
--host=$TARGET
|
--host=$TARGET \
|
||||||
|
--silent \
|
||||||
|
--quiet
|
||||||
|
|
||||||
make && make DESTDIR="$SYSROOT" install
|
make && make DESTDIR="$SYSROOT" install
|
||||||
|
|
||||||
@@ -361,7 +236,9 @@ toolchain_make() {
|
|||||||
./configure \
|
./configure \
|
||||||
--prefix=/usr \
|
--prefix=/usr \
|
||||||
--host=$TARGET \
|
--host=$TARGET \
|
||||||
--build=$(build-aux/config.guess)
|
--build=$(build-aux/config.guess) \
|
||||||
|
--silent \
|
||||||
|
--quiet
|
||||||
|
|
||||||
make && make DESTDIR="$SYSROOT" install
|
make && make DESTDIR="$SYSROOT" install
|
||||||
|
|
||||||
@@ -376,7 +253,9 @@ toolchain_patch() {
|
|||||||
./configure \
|
./configure \
|
||||||
--prefix=/usr \
|
--prefix=/usr \
|
||||||
--host=$TARGET \
|
--host=$TARGET \
|
||||||
--build=$(build-aux/config.guess)
|
--build=$(build-aux/config.guess) \
|
||||||
|
--silent \
|
||||||
|
--quiet
|
||||||
|
|
||||||
make && make DESTDIR="$SYSROOT" install
|
make && make DESTDIR="$SYSROOT" install
|
||||||
|
|
||||||
@@ -391,7 +270,9 @@ toolchain_sed() {
|
|||||||
./configure \
|
./configure \
|
||||||
--prefix=/usr \
|
--prefix=/usr \
|
||||||
--host=$TARGET \
|
--host=$TARGET \
|
||||||
--build=$(build-aux/config.guess)
|
--build=$(build-aux/config.guess) \
|
||||||
|
--silent \
|
||||||
|
--quiet
|
||||||
|
|
||||||
make && make DESTDIR="$SYSROOT" install
|
make && make DESTDIR="$SYSROOT" install
|
||||||
|
|
||||||
@@ -406,7 +287,9 @@ toolchain_tar() {
|
|||||||
./configure \
|
./configure \
|
||||||
--prefix=/usr \
|
--prefix=/usr \
|
||||||
--host=$TARGET \
|
--host=$TARGET \
|
||||||
--build=$(build-aux/config.guess)
|
--build=$(build-aux/config.guess) \
|
||||||
|
--silent \
|
||||||
|
--quiet
|
||||||
|
|
||||||
make && make DESTDIR="$SYSROOT" install
|
make && make DESTDIR="$SYSROOT" install
|
||||||
|
|
||||||
@@ -422,7 +305,9 @@ toolchain_xz() {
|
|||||||
--prefix=/usr \
|
--prefix=/usr \
|
||||||
--host=$TARGET \
|
--host=$TARGET \
|
||||||
--build=$(build-aux/config.guess) \
|
--build=$(build-aux/config.guess) \
|
||||||
--disable-static
|
--disable-static \
|
||||||
|
--silent \
|
||||||
|
--quiet
|
||||||
|
|
||||||
make && make DESTDIR="$SYSROOT" install
|
make && make DESTDIR="$SYSROOT" install
|
||||||
|
|
||||||
@@ -448,7 +333,9 @@ toolchain_binutils() {
|
|||||||
--disable-werror \
|
--disable-werror \
|
||||||
--enable-64-bit-bfd \
|
--enable-64-bit-bfd \
|
||||||
--enable-new-dtags \
|
--enable-new-dtags \
|
||||||
--enable-default-hash-style=gnu
|
--enable-default-hash-style=gnu \
|
||||||
|
--silent \
|
||||||
|
--quiet
|
||||||
|
|
||||||
make && make DESTDIR="$SYSROOT" install
|
make && make DESTDIR="$SYSROOT" install
|
||||||
|
|
||||||
@@ -488,7 +375,9 @@ toolchain_gcc() {
|
|||||||
--disable-libssp \
|
--disable-libssp \
|
||||||
--disable-libvtv \
|
--disable-libvtv \
|
||||||
--enable-languages=c,c++ \
|
--enable-languages=c,c++ \
|
||||||
LDFLAGS_FOR_TARGET=-L"$PWD/$TARGET/libgcc"
|
LDFLAGS_FOR_TARGET=-L"$PWD/$TARGET/libgcc" \
|
||||||
|
--silent \
|
||||||
|
--quiet
|
||||||
|
|
||||||
make && make DESTDIR="$SYSROOT" install
|
make && make DESTDIR="$SYSROOT" install
|
||||||
|
|
||||||
@@ -497,13 +386,459 @@ toolchain_gcc() {
|
|||||||
cd "$SOURCES" && rm -rf gcc-$GCC_VERSION
|
cd "$SOURCES" && rm -rf gcc-$GCC_VERSION
|
||||||
}
|
}
|
||||||
|
|
||||||
|
prechroot_gettext() {
|
||||||
|
fetch $GETTEXT_URL
|
||||||
|
|
||||||
|
sudo chroot "$SYSROOT" /usr/bin/env -i \
|
||||||
|
MAKEFLAGS="$MAKEFLAGS" \
|
||||||
|
PATH=/usr/bin:/usr/sbin \
|
||||||
|
SOURCES=/sources \
|
||||||
|
GETTEXT_VERSION=$GETTEXT_VERSION \
|
||||||
|
/usr/bin/bash <<- "EOF"
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
cd "$SOURCES" && tar xf gettext-$GETTEXT_VERSION.tar.xz && cd gettext-$GETTEXT_VERSION
|
||||||
|
|
||||||
|
./configure \
|
||||||
|
--disable-shared \
|
||||||
|
--silent \
|
||||||
|
--quiet
|
||||||
|
|
||||||
|
make
|
||||||
|
|
||||||
|
cp gettext-tools/src/{msgfmt,msgmerge,xgettext} /usr/bin
|
||||||
|
|
||||||
|
cd "$SOURCES" && rm -rf gettext-$GETTEXT_VERSION
|
||||||
|
EOF
|
||||||
|
}
|
||||||
|
|
||||||
|
prechroot_bison() {
|
||||||
|
fetch $BISON_URL
|
||||||
|
|
||||||
|
sudo chroot "$SYSROOT" /usr/bin/env -i \
|
||||||
|
MAKEFLAGS="$MAKEFLAGS" \
|
||||||
|
PATH=/usr/bin:/usr/sbin \
|
||||||
|
SOURCES=/sources \
|
||||||
|
BISON_VERSION=$BISON_VERSION \
|
||||||
|
/usr/bin/bash <<- "EOF"
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
cd "$SOURCES" && tar xf bison-$BISON_VERSION.tar.xz && cd bison-$BISON_VERSION
|
||||||
|
|
||||||
|
./configure \
|
||||||
|
--prefix=/usr \
|
||||||
|
--silent \
|
||||||
|
--quiet
|
||||||
|
|
||||||
|
make && make install
|
||||||
|
|
||||||
|
cd "$SOURCES" && rm -rf bison-$BISON_VERSION
|
||||||
|
EOF
|
||||||
|
}
|
||||||
|
|
||||||
|
prechroot_perl() {
|
||||||
|
fetch $PERL_URL
|
||||||
|
|
||||||
|
sudo chroot "$SYSROOT" /usr/bin/env -i \
|
||||||
|
MAKEFLAGS="$MAKEFLAGS" \
|
||||||
|
PATH=/usr/bin:/usr/sbin \
|
||||||
|
SOURCES=/sources \
|
||||||
|
PERL_VERSION=$PERL_VERSION \
|
||||||
|
/usr/bin/bash <<- "EOF"
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
cd "$SOURCES" && tar xf perl-$PERL_VERSION.tar.gz && cd perl-$PERL_VERSION
|
||||||
|
|
||||||
|
sh Configure -des \
|
||||||
|
-D prefix=/usr \
|
||||||
|
-D vendorprefix=/usr \
|
||||||
|
-D useshrplib \
|
||||||
|
-D privlib=/usr/lib/perl5/$PERL_VERSION/core_perl \
|
||||||
|
-D archlib=/usr/lib/perl5/$PERL_VERSION/core_perl \
|
||||||
|
-D sitelib=/usr/lib/perl5/$PERL_VERSION/site_perl \
|
||||||
|
-D sitearch=/usr/lib/perl5/$PERL_VERSION/site_perl \
|
||||||
|
-D vendorlib=/usr/lib/perl5/$PERL_VERSION/vendor_perl \
|
||||||
|
-D vendorarch=/usr/lib/perl5/$PERL_VERSION/vendor_perl
|
||||||
|
|
||||||
|
make && make install
|
||||||
|
|
||||||
|
cd "$SOURCES" && rm -rf perl-$PERL_VERSION
|
||||||
|
EOF
|
||||||
|
}
|
||||||
|
|
||||||
|
prechroot_python() {
|
||||||
|
fetch $PYTHON_URL
|
||||||
|
|
||||||
|
sudo chroot "$SYSROOT" /usr/bin/env -i \
|
||||||
|
MAKEFLAGS="$MAKEFLAGS" \
|
||||||
|
PATH=/usr/bin:/usr/sbin \
|
||||||
|
SOURCES=/sources \
|
||||||
|
PYTHON_VERSION=$PYTHON_VERSION \
|
||||||
|
/usr/bin/bash <<- "EOF"
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
cd "$SOURCES" && tar xf Python-$PYTHON_VERSION.tar.xz && cd Python-$PYTHON_VERSION
|
||||||
|
|
||||||
|
./configure \
|
||||||
|
--prefix=/usr \
|
||||||
|
--enable-shared \
|
||||||
|
--without-static-libpython \
|
||||||
|
--disable-test-modules \
|
||||||
|
--without-ensurepip \
|
||||||
|
--silent \
|
||||||
|
--quiet
|
||||||
|
|
||||||
|
make && make install
|
||||||
|
|
||||||
|
rm -rf /usr/lib/python$PYTHON_VERSION/test
|
||||||
|
|
||||||
|
cd "$SOURCES" && rm -rf Python-$PYTHON_VERSION
|
||||||
|
EOF
|
||||||
|
}
|
||||||
|
|
||||||
|
prechroot_util_linux() {
|
||||||
|
fetch $UTIL_LINUX_URL
|
||||||
|
|
||||||
|
sudo chroot "$SYSROOT" /usr/bin/env -i \
|
||||||
|
MAKEFLAGS="$MAKEFLAGS" \
|
||||||
|
PATH=/usr/bin:/usr/sbin \
|
||||||
|
SOURCES=/sources \
|
||||||
|
UTIL_LINUX_VERSION=$UTIL_LINUX_VERSION \
|
||||||
|
/usr/bin/bash <<- "EOF"
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
cd "$SOURCES" && tar xf util-linux-$UTIL_LINUX_VERSION.tar.xz && cd util-linux-$UTIL_LINUX_VERSION
|
||||||
|
|
||||||
|
mkdir -p /var/lib/hwclock
|
||||||
|
|
||||||
|
./configure --libdir=/usr/lib \
|
||||||
|
--runstatedir=/run \
|
||||||
|
--disable-chfn-chsh \
|
||||||
|
--disable-login \
|
||||||
|
--disable-nologin \
|
||||||
|
--disable-su \
|
||||||
|
--disable-setpriv \
|
||||||
|
--disable-runuser \
|
||||||
|
--disable-pylibmount \
|
||||||
|
--disable-static \
|
||||||
|
--disable-liblastlog2 \
|
||||||
|
--without-python \
|
||||||
|
ADJTIME_PATH=/var/lib/hwclock/adjtime \
|
||||||
|
--silent \
|
||||||
|
--quiet
|
||||||
|
|
||||||
|
make && make install
|
||||||
|
|
||||||
|
cd "$SOURCES" && rm -rf util-linux-$UTIL_LINUX_VERSION
|
||||||
|
EOF
|
||||||
|
}
|
||||||
|
|
||||||
|
prechroot_cleanup() {
|
||||||
|
sudo chroot "$SYSROOT" /usr/bin/env -i \
|
||||||
|
/usr/bin/bash <<- "EOF"
|
||||||
|
|
||||||
|
rm -rf /usr/share/{info,man,doc}/*
|
||||||
|
|
||||||
|
find /usr/{lib,libexec} -name \*.la -delete
|
||||||
|
|
||||||
|
rm -rf /cross
|
||||||
|
EOF
|
||||||
|
}
|
||||||
|
|
||||||
|
chroot_tmpfs_setup() {
|
||||||
|
sudo chroot "$SYSROOT" /usr/bin/env -i /usr/bin/bash <<- "EOF"
|
||||||
|
ln -s run /var/run
|
||||||
|
ln -sfv run/lock /var/lock
|
||||||
|
|
||||||
|
install -dv -m 0750 /root
|
||||||
|
install -dv -m 1777 /tmp /var/tmp
|
||||||
|
|
||||||
|
ln -s proc/self/mounts /etc/mtab
|
||||||
|
|
||||||
|
cat > /etc/hosts <<- "END_OF_FILE"
|
||||||
|
127.0.0.1 localhost axe
|
||||||
|
::1 localhost
|
||||||
|
END_OF_FILE
|
||||||
|
|
||||||
|
cat > /etc/passwd <<- "END_OF_FILE"
|
||||||
|
root:x:0:0:root:/root:/usr/bin/bash
|
||||||
|
uuidd:x:6:6::/dev/null:/usr/bin/nologin
|
||||||
|
messagebus:x:7:7::/run/dbus:/usr/bin/nologin
|
||||||
|
nobody:x:65534:65534::/dev/null:/usr/bin/nologin
|
||||||
|
END_OF_FILE
|
||||||
|
|
||||||
|
cat > /etc/group <<- "END_OF_FILE"
|
||||||
|
root:x:0:
|
||||||
|
tty:x:1:
|
||||||
|
audio:x:2:
|
||||||
|
video:x:3:
|
||||||
|
input:x:4:
|
||||||
|
wheel:x:5:
|
||||||
|
uuidd:x:6:
|
||||||
|
messagebus:x:7:
|
||||||
|
users:x:999:
|
||||||
|
nogroup:x:65534:
|
||||||
|
END_OF_FILE
|
||||||
|
EOF
|
||||||
|
}
|
||||||
|
|
||||||
|
chroot_iana_etc() {
|
||||||
|
fetch $IANA_ETC_URL
|
||||||
|
|
||||||
|
sudo chroot "$SYSROOT" /usr/bin/env -i MAKEFLAGS="$MAKEFLAGS" PATH=/usr/bin:/usr/sbin SOURCES=/sources IANA_ETC_VERSION=$IANA_ETC_VERSION /usr/bin/bash <<- "EOF"
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
cd "$SOURCES" && tar xf iana-etc-$IANA_ETC_VERSION.tar.gz && cd iana-etc-$IANA_ETC_VERSION
|
||||||
|
|
||||||
|
cp services protocols /etc
|
||||||
|
|
||||||
|
cd "$SOURCES" && rm -rf iana-etc-$IANA_ETC_VERSION
|
||||||
|
EOF
|
||||||
|
}
|
||||||
|
|
||||||
|
chroot_glibc() {
|
||||||
|
fetch $TZDATA_URL
|
||||||
|
|
||||||
|
sudo chroot "$SYSROOT" /usr/bin/env -i MAKEFLAGS="$MAKEFLAGS" PATH=/usr/bin:/usr/sbin SOURCES=/sources GLIBC_VERSION=$GLIBC_VERSION LINUX_VERSION=$LINUX_VERSION TZDATA_VERSION=$TZDATA_VERSION /usr/bin/bash <<- "EOF"
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
cd "$SOURCES" && tar xf glibc-$GLIBC_VERSION.tar.xz && cd glibc-$GLIBC_VERSION
|
||||||
|
|
||||||
|
patch -Np1 -i ../glibc-fhs-1.patch
|
||||||
|
|
||||||
|
mkdir -p build && cd build
|
||||||
|
|
||||||
|
echo "rootsbindir=/usr/sbin" > configparms
|
||||||
|
|
||||||
|
../configure \
|
||||||
|
--prefix=/usr \
|
||||||
|
--disable-werror \
|
||||||
|
--disable-nscd \
|
||||||
|
libc_cv_slibdir=/usr/lib \
|
||||||
|
--enable-stack-protector=strong \
|
||||||
|
--enable-kernel= \
|
||||||
|
--disable-nls \
|
||||||
|
--enable-kernel=$LINUX_VERSION \
|
||||||
|
--silent \
|
||||||
|
--quiet
|
||||||
|
|
||||||
|
make && make install
|
||||||
|
|
||||||
|
touch /etc/ld.so.conf
|
||||||
|
sed '/RTLDLIST=/s@/usr@@g' -i /usr/bin/ldd
|
||||||
|
|
||||||
|
cat > /etc/nsswitch.conf <<- "END_OF_FILE"
|
||||||
|
passwd: files
|
||||||
|
group: files
|
||||||
|
shadow: files
|
||||||
|
|
||||||
|
hosts: files dns
|
||||||
|
networks: files
|
||||||
|
|
||||||
|
protocols: files
|
||||||
|
services: files
|
||||||
|
ethers: files
|
||||||
|
rpc: files
|
||||||
|
END_OF_FILE
|
||||||
|
|
||||||
|
tar xf $SOURCES/tzdata$TZDATA_VERSION.tar.gz
|
||||||
|
|
||||||
|
ZONEINFO=/usr/share/zoneinfo
|
||||||
|
|
||||||
|
mkdir -p $ZONEINFO/{posix,right}
|
||||||
|
|
||||||
|
for tz in etcetera southamerica northamerica europe africa antarctica asia australasia backward; do
|
||||||
|
zic -L /dev/null -d $ZONEINFO ${tz}
|
||||||
|
zic -L /dev/null -d $ZONEINFO/posix ${tz}
|
||||||
|
zic -L leapseconds -d $ZONEINFO/right ${tz}
|
||||||
|
done
|
||||||
|
|
||||||
|
cp zone.tab zone1970.tab iso3166.tab $ZONEINFO
|
||||||
|
|
||||||
|
zic -d $ZONEINFO -p Africa/Johannesburg
|
||||||
|
|
||||||
|
unset ZONEINFO tz
|
||||||
|
|
||||||
|
ln -sf /usr/share/zoneinfo/Africa/Johannesburg /etc/localtime
|
||||||
|
|
||||||
|
cat > /etc/ld.so.conf <<- "END_OF_FILE"
|
||||||
|
/usr/local/lib
|
||||||
|
/opt/lib
|
||||||
|
include /etc/ld.so.conf.d/*.conf
|
||||||
|
END_OF_FILE
|
||||||
|
|
||||||
|
mkdir -p /etc/ld.so.conf.d
|
||||||
|
|
||||||
|
cd "$SOURCES" && rm -rf glibc-$GLIBC_VERSION
|
||||||
|
EOF
|
||||||
|
}
|
||||||
|
|
||||||
|
chroot_zlib() {
|
||||||
|
fetch $ZLIB_URL
|
||||||
|
|
||||||
|
sudo chroot "$SYSROOT" /usr/bin/env -i MAKEFLAGS="$MAKEFLAGS" PATH=/usr/bin:/usr/sbin SOURCES=/sources ZLIB_VERSION=$ZLIB_VERSION /usr/bin/bash <<- "EOF"
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
cd "$SOURCES" && tar xf zlib-$ZLIB_VERSION.tar.gz && cd zlib-$ZLIB_VERSION
|
||||||
|
|
||||||
|
./configure \
|
||||||
|
--prefix=/usr
|
||||||
|
|
||||||
|
make && make install
|
||||||
|
|
||||||
|
rm -f /usr/lib/libz.a
|
||||||
|
|
||||||
|
cd "$SOURCES" && rm -rf zlib-$ZLIB_VERSION
|
||||||
|
EOF
|
||||||
|
}
|
||||||
|
|
||||||
|
chroot_bzip2() {
|
||||||
|
fetch $BZIP2_URL
|
||||||
|
|
||||||
|
sudo chroot "$SYSROOT" /usr/bin/env -i MAKEFLAGS="$MAKEFLAGS" PATH=/usr/bin:/usr/sbin SOURCES=/sources BZIP2_VERSION=$BZIP2_VERSION /usr/bin/bash <<- "EOF"
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
cd "$SOURCES" && tar xf bzip2-$BZIP2_VERSION.tar.gz && cd bzip2-$BZIP2_VERSION
|
||||||
|
|
||||||
|
sed -i 's@\(ln -s -f \)$(PREFIX)/bin/@\1@' Makefile
|
||||||
|
|
||||||
|
make -f Makefile-libbz2_so
|
||||||
|
|
||||||
|
make clean
|
||||||
|
|
||||||
|
make && make PREFIX=/usr install
|
||||||
|
|
||||||
|
cp -a libbz2.so.* /usr/lib
|
||||||
|
|
||||||
|
ln -sf libbz2.so.1.0.8 /usr/lib/libbz2.so
|
||||||
|
|
||||||
|
ln -sf libbz2.so.1.0.8 /usr/lib/libbz2.so.1
|
||||||
|
|
||||||
|
cp bzip2-shared /usr/bin/bzip2
|
||||||
|
|
||||||
|
for i in /usr/bin/{bzcat,bunzip2}; do
|
||||||
|
ln -sf bzip2 $i
|
||||||
|
done
|
||||||
|
|
||||||
|
rm -f /usr/lib/libbz2.a
|
||||||
|
|
||||||
|
cd "$SOURCES" && rm -rf bzip2-$BZIP2_VERSION
|
||||||
|
EOF
|
||||||
|
}
|
||||||
|
|
||||||
|
chroot_xz() {
|
||||||
|
sudo chroot "$SYSROOT" /usr/bin/env -i MAKEFLAGS="$MAKEFLAGS" PATH=/usr/bin:/usr/sbin SOURCES=/sources XZ_VERSION=$XZ_VERSION /usr/bin/bash <<- "EOF"
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
cd "$SOURCES" && tar xf xz-$XZ_VERSION.tar.xz && cd xz-$XZ_VERSION
|
||||||
|
|
||||||
|
./configure \
|
||||||
|
--prefix=/usr \
|
||||||
|
--disable-static
|
||||||
|
|
||||||
|
make && make install
|
||||||
|
|
||||||
|
cd "$SOURCES" && rm -rf xz-$XZ_VERSION
|
||||||
|
EOF
|
||||||
|
}
|
||||||
|
|
||||||
|
chroot_zstd() {
|
||||||
|
fetch $ZSTD_URL
|
||||||
|
|
||||||
|
sudo chroot "$SYSROOT" /usr/bin/env -i MAKEFLAGS="$MAKEFLAGS" PATH=/usr/bin:/usr/sbin SOURCES=/sources ZSTD_VERSION=$ZSTD_VERSION /usr/bin/bash <<- "EOF"
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
cd "$SOURCES" && tar xf zstd-$ZSTD_VERSION.tar.gz && cd zstd-$ZSTD_VERSION
|
||||||
|
|
||||||
|
make prefix=/usr
|
||||||
|
make prefix=/usr install
|
||||||
|
|
||||||
|
rm /usr/lib/libzstd.a
|
||||||
|
|
||||||
|
cd "$SOURCES" && rm -rf zstd-$ZSTD_VERSION
|
||||||
|
EOF
|
||||||
|
}
|
||||||
|
|
||||||
|
chroot_file() {
|
||||||
|
fetch $FILE_URL
|
||||||
|
|
||||||
|
sudo chroot "$SYSROOT" /usr/bin/env -i MAKEFLAGS="$MAKEFLAGS" PATH=/usr/bin:/usr/sbin SOURCES=/sources FILE_VERSION=$FILE_VERSION /usr/bin/bash <<- "EOF"
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
cd "$SOURCES" && tar xf file-$FILE_VERSION.tar.gz && cd file-$FILE_VERSION
|
||||||
|
|
||||||
|
./configure \
|
||||||
|
--prefix=/usr
|
||||||
|
|
||||||
|
make && make install
|
||||||
|
|
||||||
|
cd "$SOURCES" && rm -rf file-$FILE_VERSION
|
||||||
|
EOF
|
||||||
|
}
|
||||||
|
|
||||||
|
chroot_readline() {
|
||||||
|
fetch $READLINE_URL
|
||||||
|
|
||||||
|
sudo chroot "$SYSROOT" /usr/bin/env -i MAKEFLAGS="$MAKEFLAGS" PATH=/usr/bin:/usr/sbin SOURCES=/sources READLINE_VERSION=$READLINE_VERSION /usr/bin/bash <<- "EOF"
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
cd "$SOURCES" && tar xf readline-$READLINE_VERSION.tar.gz && cd readline-$READLINE_VERSION
|
||||||
|
|
||||||
|
sed -i '/MV.*old/d' Makefile.in
|
||||||
|
|
||||||
|
sed -i '/{OLDSUFF}/c:' support/shlib-install
|
||||||
|
|
||||||
|
sed -i 's/-Wl,-rpath,[^ ]*//' support/shobj-conf
|
||||||
|
|
||||||
|
sed -e '270a\
|
||||||
|
else\
|
||||||
|
chars_avail = 1;' \
|
||||||
|
-e '288i\ result = -1;' \
|
||||||
|
-i.orig input.c
|
||||||
|
|
||||||
|
./configure \
|
||||||
|
--prefix=/usr \
|
||||||
|
--disable-static \
|
||||||
|
--with-curses
|
||||||
|
|
||||||
|
make SHLIB_LIBS="-lncursesw" && make install
|
||||||
|
|
||||||
|
cd "$SOURCES" && rm -rf readline-$READLINE_VERSION
|
||||||
|
EOF
|
||||||
|
}
|
||||||
|
|
||||||
|
chroot_pcre2() {
|
||||||
|
fetch $PCRE2_URL
|
||||||
|
|
||||||
|
sudo chroot "$SYSROOT" /usr/bin/env -i MAKEFLAGS="$MAKEFLAGS" PATH=/usr/bin:/usr/sbin SOURCES=/sources PCRE2_VERSION=$PCRE2_VERSION /usr/bin/bash <<- "EOF"
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
cd "$SOURCES" && tar xf pcre2-$PCRE2_VERSION.tar.gz && cd pcre2-$PCRE2_VERSION
|
||||||
|
|
||||||
|
./configure \
|
||||||
|
--prefix=/usr \
|
||||||
|
--enable-unicode \
|
||||||
|
--enable-jit \
|
||||||
|
--enable-pcre2-16 \
|
||||||
|
--enable-pcre2-32 \
|
||||||
|
--enable-pcre2grep-libz \
|
||||||
|
--enable-pcre2grep-libbz2 \
|
||||||
|
--enable-pcre2test-libreadline \
|
||||||
|
--disable-static
|
||||||
|
|
||||||
|
make && make install
|
||||||
|
|
||||||
|
cd "$SOURCES" && rm -rf pcre2-$PCRE2_VERSION
|
||||||
|
EOF
|
||||||
|
}
|
||||||
|
|
||||||
#create_sysroot
|
#create_sysroot
|
||||||
#bootstrap_binutils
|
#bootstrap_binutils
|
||||||
#bootstap_gcc
|
#bootstap_gcc
|
||||||
#bootstap_linux
|
#bootstap_linux
|
||||||
#bootstap_glibc
|
#bootstap_glibc
|
||||||
#bootstap_libstdcpp
|
#bootstap_libstdcpp
|
||||||
toolchain_m4
|
#toolchain_m4
|
||||||
#toolchain_ncurses
|
#toolchain_ncurses
|
||||||
#toolchain_bash
|
#toolchain_bash
|
||||||
#toolchain_coreutils
|
#toolchain_coreutils
|
||||||
@@ -522,3 +857,19 @@ toolchain_m4
|
|||||||
#toolchain_gcc
|
#toolchain_gcc
|
||||||
#change_owner
|
#change_owner
|
||||||
#do_mount
|
#do_mount
|
||||||
|
#prechroot_gettext
|
||||||
|
#prechroot_bison
|
||||||
|
#prechroot_perl
|
||||||
|
#prechroot_python
|
||||||
|
#prechroot_util_linux
|
||||||
|
#prechroot_cleanup
|
||||||
|
#do_unmount
|
||||||
|
#chroot_iana_etc
|
||||||
|
#chroot_glibc
|
||||||
|
#chroot_zlib
|
||||||
|
#chroot_bzip2
|
||||||
|
#chroot_xz
|
||||||
|
#chroot_zstd
|
||||||
|
#chroot_file
|
||||||
|
#chroot_readline
|
||||||
|
#chroot_pcre2
|
||||||
15
build.sh
Normal file
15
build.sh
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
umask 022
|
||||||
|
|
||||||
|
. version.bash
|
||||||
|
. flags.bash
|
||||||
|
. utilities.bash
|
||||||
|
|
||||||
|
|
||||||
|
STAGE="$1"
|
||||||
|
PACKAGE="$2"
|
||||||
|
|
||||||
|
. "stage/${MODE}/${PACKAGE}.bash"
|
||||||
22
stage/bootstrap/binutils.bash
Normal file
22
stage/bootstrap/binutils.bash
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
|
||||||
|
fetch $BINUTILS_URL
|
||||||
|
|
||||||
|
cd "$SOURCES" && tar xf binutils-$BINUTILS_VERSION.tar.xz && cd binutils-$BINUTILS_VERSION
|
||||||
|
|
||||||
|
mkdir -p build && cd build
|
||||||
|
|
||||||
|
../configure \
|
||||||
|
--prefix="$CROSS" \
|
||||||
|
--with-sysroot="$SYSROOT" \
|
||||||
|
--target=$TARGET \
|
||||||
|
--disable-nls \
|
||||||
|
--enable-gprofng=no \
|
||||||
|
--disable-werror \
|
||||||
|
--enable-new-dtags \
|
||||||
|
--enable-default-hash-style=gnu \
|
||||||
|
--silent \
|
||||||
|
--quiet
|
||||||
|
|
||||||
|
make && make install
|
||||||
|
|
||||||
|
cd "$SOURCES" && rm -rf binutils-$BINUTILS_VERSION
|
||||||
46
stage/bootstrap/gcc.bash
Normal file
46
stage/bootstrap/gcc.bash
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
|
||||||
|
fetch $GCC_URL
|
||||||
|
fetch $GMP_URL
|
||||||
|
fetch $ISL_URL
|
||||||
|
fetch $MPC_URL
|
||||||
|
fetch $MPFR_URL
|
||||||
|
|
||||||
|
cd "$SOURCES" && tar xf gcc-$GCC_VERSION.tar.xz && cd gcc-$GCC_VERSION
|
||||||
|
|
||||||
|
tar xf ../gmp-$GMP_VERSION.tar.xz && mv gmp-$GMP_VERSION gmp
|
||||||
|
tar xf ../isl-$ISL_VERSION.tar.xz && mv isl-$ISL_VERSION isl
|
||||||
|
tar xf ../mpc-$MPC_VERSION.tar.gz && mv mpc-$MPC_VERSION mpc
|
||||||
|
tar xf ../mpfr-$MPFR_VERSION.tar.xz && mv mpfr-$MPFR_VERSION mpfr
|
||||||
|
|
||||||
|
sed -e '/m64=/s/lib64/lib/' -i.orig gcc/config/i386/t-linux64
|
||||||
|
|
||||||
|
mkdir -p build && cd build
|
||||||
|
|
||||||
|
../configure \
|
||||||
|
--target=$TARGET \
|
||||||
|
--prefix="$CROSS" \
|
||||||
|
--with-glibc-version=$GLIBC_VERSION \
|
||||||
|
--with-sysroot="$SYSROOT" \
|
||||||
|
--with-newlib \
|
||||||
|
--without-headers \
|
||||||
|
--enable-default-pie \
|
||||||
|
--enable-default-ssp \
|
||||||
|
--disable-nls \
|
||||||
|
--disable-shared \
|
||||||
|
--disable-multilib \
|
||||||
|
--disable-threads \
|
||||||
|
--disable-libatomic \
|
||||||
|
--disable-libgomp \
|
||||||
|
--disable-libquadmath \
|
||||||
|
--disable-libssp \
|
||||||
|
--disable-libvtv \
|
||||||
|
--disable-libstdcxx \
|
||||||
|
--enable-languages=c,c++ \
|
||||||
|
--silent \
|
||||||
|
--quiet
|
||||||
|
|
||||||
|
make && make install
|
||||||
|
|
||||||
|
cd .. && cat gcc/limitx.h gcc/glimits.h gcc/limity.h > "`dirname $($TARGET-gcc -print-libgcc-file-name)`/include/limits.h"
|
||||||
|
|
||||||
|
cd "$SOURCES" && rm -rf gcc-$GCC_VERSION
|
||||||
31
stage/bootstrap/glibc.bash
Normal file
31
stage/bootstrap/glibc.bash
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
|
||||||
|
fetch $GLIBC_URL
|
||||||
|
fetch $GLIBC_PATCH_URL
|
||||||
|
|
||||||
|
cd "$SOURCES" && tar xf glibc-$GLIBC_VERSION.tar.xz && cd glibc-$GLIBC_VERSION
|
||||||
|
|
||||||
|
ln -fs ld-linux-x86-64.so.2 "$SYSROOT"/lib/ld-lsb-x86-64.so.3
|
||||||
|
|
||||||
|
patch -sNp1 -i "$SOURCES"/glibc-fhs-1.patch
|
||||||
|
|
||||||
|
mkdir -p build && cd build
|
||||||
|
|
||||||
|
echo "rootsbindir=/usr/sbin" > configparms
|
||||||
|
|
||||||
|
../configure \
|
||||||
|
--prefix=/usr \
|
||||||
|
--host=$TARGET \
|
||||||
|
--build=$(../scripts/config.guess) \
|
||||||
|
--disable-nscd \
|
||||||
|
--disable-nls \
|
||||||
|
libc_cv_slibdir=/usr/lib \
|
||||||
|
--enable-kernel=$LINUX_VERSION \
|
||||||
|
--silent \
|
||||||
|
--quiet
|
||||||
|
|
||||||
|
|
||||||
|
make && make DESTDIR="$SYSROOT" install
|
||||||
|
|
||||||
|
sed '/RTLDLIST=/s@/usr@@g' -i "$SYSROOT"/usr/bin/ldd
|
||||||
|
|
||||||
|
cd "$SOURCES" && rm -rf glibc-$GLIBC_VERSION
|
||||||
22
stage/bootstrap/libstdc++.bash
Normal file
22
stage/bootstrap/libstdc++.bash
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
|
||||||
|
cd "$SOURCES" && tar xf gcc-$GCC_VERSION.tar.xz && cd gcc-$GCC_VERSION
|
||||||
|
|
||||||
|
mkdir -p build && cd build
|
||||||
|
|
||||||
|
../libstdc++-v3/configure \
|
||||||
|
--host=$TARGET \
|
||||||
|
--build=$(../config.guess) \
|
||||||
|
--prefix=/usr \
|
||||||
|
--disable-multilib \
|
||||||
|
--disable-nls \
|
||||||
|
--disable-libstdcxx-pch \
|
||||||
|
--with-gxx-include-dir=/cross/$TARGET/include/c++/$GCC_VERSION \
|
||||||
|
--silent \
|
||||||
|
--quiet
|
||||||
|
|
||||||
|
|
||||||
|
make && make DESTDIR="$SYSROOT" install
|
||||||
|
|
||||||
|
rm -rf "$SYSROOT"/usr/lib/lib{stdc++{,exp,fs},supc++}.la
|
||||||
|
|
||||||
|
cd "$SOURCES" && rm -rf gcc-$GCC_VERSION
|
||||||
12
stage/bootstrap/linux.bash
Normal file
12
stage/bootstrap/linux.bash
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
|
||||||
|
fetch $LINUX_URL
|
||||||
|
|
||||||
|
cd "$SOURCES" && tar xf linux-$LINUX_VERSION.tar.xz && cd linux-$LINUX_VERSION
|
||||||
|
|
||||||
|
make mrproper && make headers
|
||||||
|
|
||||||
|
find usr/include -type f ! -name '*.h' -delete
|
||||||
|
|
||||||
|
cp -r usr/include "$SYSROOT"/usr
|
||||||
|
|
||||||
|
cd "$SOURCES" && rm -rf linux-$LINUX_VERSION
|
||||||
17
stage/toolchain/m4.bash
Normal file
17
stage/toolchain/m4.bash
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
|
||||||
|
fetch $M4_URL
|
||||||
|
|
||||||
|
cd "$SOURCES" && tar xf m4-$M4_VERSION.tar.xz && cd m4-$M4_VERSION
|
||||||
|
|
||||||
|
sed -r '/_GL_EXTERN_C/s/w?memchr|bsearch/(&)/' -i $(find -name \*.in.h)
|
||||||
|
|
||||||
|
./configure \
|
||||||
|
--prefix=/usr \
|
||||||
|
--host=$TARGET \
|
||||||
|
--build=$(build-aux/config.guess) \
|
||||||
|
--silent \
|
||||||
|
--quiet
|
||||||
|
|
||||||
|
make && make DESTDIR="$SYSROOT" install
|
||||||
|
|
||||||
|
cd "$SOURCES" && rm -rf m4-$M4_VERSION
|
||||||
@@ -10,13 +10,13 @@ create_directories() {
|
|||||||
ln -fs usr/$directory "$SYSROOT"/$directory
|
ln -fs usr/$directory "$SYSROOT"/$directory
|
||||||
done
|
done
|
||||||
|
|
||||||
ln -s usr/lib "$SYSROOT"/lib64
|
ln -fs usr/lib "$SYSROOT"/lib64
|
||||||
|
|
||||||
ln -s run "$SYSROOT"/var/run
|
ln -fs run "$SYSROOT"/var/run
|
||||||
ln -sfv run/lock "$SYSROOT"/var/lock
|
ln -fs run/lock "$SYSROOT"/var/lock
|
||||||
|
|
||||||
install -dv -m 0750 "$SYSROOT"/root
|
install -d -m 0750 "$SYSROOT"/root
|
||||||
install -dv -m 1777 "$SYSROOT"/tmp "$SYSROOT"/var/tmp
|
install -d -m 1777 "$SYSROOT"/tmp "$SYSROOT"/var/tmp
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -57,16 +57,17 @@ create_sysroot() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
change_owner() {
|
change_owner() {
|
||||||
sudo chown -R root:root "$SYSROOT"/{etc,cross,usr,dev,proc,sys,run,var}
|
sudo chown -R root:root "$SYSROOT"/{bin,cross,dev,etc,lib,lib64,proc,sys,root,run,sbin,sys,tmp,usr,var}
|
||||||
}
|
}
|
||||||
|
|
||||||
do_mount() {
|
do_mount() {
|
||||||
if ! mountpoint -q "$SYSROOT/dev"; then
|
if ! mountpoint -q "$SYSROOT/dev"; then
|
||||||
sudo mount --bind /dev "$SYSROOT"/dev
|
sudo mount --bind /dev "$SYSROOT"/dev
|
||||||
sudo mount -t devpts devpts -o gid=5,mode=0620 "$SYSROOT"/dev/pts
|
sudo mount -t devpts devpts -o gid=1,mode=0620 "$SYSROOT"/dev/pts
|
||||||
sudo mount -t proc proc "$SYSROOT"/proc
|
sudo mount -t proc proc "$SYSROOT"/proc
|
||||||
sudo mount -t sysfs sysfs "$SYSROOT"/sys
|
sudo mount -t sysfs sysfs "$SYSROOT"/sys
|
||||||
sudo mount -t tmpfs tmpfs "$SYSROOT"/run
|
sudo mount -t tmpfs tmpfs "$SYSROOT"/run
|
||||||
|
|
||||||
if [ -h "$SYSROOT"/dev/shm ]; then
|
if [ -h "$SYSROOT"/dev/shm ]; then
|
||||||
sudo install -d -m 1777 "$SYSROOT"$(realpath /dev/shm)
|
sudo install -d -m 1777 "$SYSROOT"$(realpath /dev/shm)
|
||||||
else
|
else
|
||||||
@@ -76,7 +77,10 @@ do_mount() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
do_unmount() {
|
do_unmount() {
|
||||||
sudo umount -R "$SYSROOT/"
|
sudo mountpoint -q "$SYSROOT"/dev/shm
|
||||||
|
sudo umount "$SYSROOT"/dev/shm
|
||||||
|
sudo umount "$SYSROOT"/dev/pts
|
||||||
|
sudo umount "$SYSROOT"/{sys,proc,run,dev}
|
||||||
}
|
}
|
||||||
|
|
||||||
fetch() {
|
fetch() {
|
||||||
|
|||||||
34
version.bash
34
version.bash
@@ -74,3 +74,37 @@ export XZ_URL=https://github.com//tukaani-project/xz/releases/download/v$XZ_VERS
|
|||||||
|
|
||||||
export GETTEXT_VERSION=1.0
|
export GETTEXT_VERSION=1.0
|
||||||
export GETTEXT_URL=https://mirror.ufs.ac.za/gnu/gettext/gettext-$GETTEXT_VERSION.tar.xz
|
export GETTEXT_URL=https://mirror.ufs.ac.za/gnu/gettext/gettext-$GETTEXT_VERSION.tar.xz
|
||||||
|
|
||||||
|
export BISON_VERSION=3.8.2
|
||||||
|
export BISON_URL=https://mirror.ufs.ac.za/gnu/bison/bison-$BISON_VERSION.tar.xz
|
||||||
|
|
||||||
|
export PERL_VERSION=5.42.0
|
||||||
|
export PERL_URL=https://www.cpan.org/src/5.0/perl-$PERL_VERSION.tar.gz
|
||||||
|
|
||||||
|
export PYTHON_VERSION=3.14.3
|
||||||
|
export PYTHON_URL=https://www.python.org/ftp/python/$PYTHON_VERSION/Python-$PYTHON_VERSION.tar.xz
|
||||||
|
|
||||||
|
export UTIL_LINUX_VERSION=2.41.3
|
||||||
|
export UTIL_LINUX_URL=https://www.kernel.org/pub/linux/utils/util-linux/v2.41/util-linux-$UTIL_LINUX_VERSION.tar.xz
|
||||||
|
|
||||||
|
export IANA_ETC_VERSION=20260202
|
||||||
|
export IANA_ETC_URL=https://github.com/Mic92/iana-etc/releases/download/$IANA_ETC_VERSION/iana-etc-$IANA_ETC_VERSION.tar.gz
|
||||||
|
|
||||||
|
export TZDATA_VERSION=2025c
|
||||||
|
export TZDATA_URL=https://www.iana.org/time-zones/repository/releases/tzdata$TZDATA_VERSION.tar.gz
|
||||||
|
|
||||||
|
export ZLIB_VERSION=1.3.2
|
||||||
|
export ZLIB_URL=https://zlib.net/fossils/zlib-$ZLIB_VERSION.tar.gz
|
||||||
|
|
||||||
|
export BZIP2_VERSION=1.0.8
|
||||||
|
export BZIP2_URL=https://www.sourceware.org/pub/bzip2/bzip2-$BZIP2_VERSION.tar.gz
|
||||||
|
|
||||||
|
export ZSTD_VERSION=1.5.7
|
||||||
|
export ZSTD_URL=https://github.com/facebook/zstd/releases/download/v$ZSTD_VERSION/zstd-$ZSTD_VERSION.tar.gz
|
||||||
|
|
||||||
|
export READLINE_VERSION=8.3
|
||||||
|
export READLINE_URL=https://mirror.ufs.ac.za/gnu/readline/readline-$READLINE_VERSION.tar.gz
|
||||||
|
|
||||||
|
export PCRE2_VERSION=10.47
|
||||||
|
export PCRE2_URL=https://github.com/PCRE2Project/pcre2/releases/download/pcre2-$PCRE2_VERSION/pcre2-$PCRE2_VERSION.tar.gz
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user