added m4 toolchain build

This commit is contained in:
ag-tsotetsi
2026-02-20 12:14:31 +02:00
parent 592a35fc43
commit 23097e2ff3

View File

@@ -47,6 +47,8 @@ LINUX_VERSION=6.18.7
IFS='.' read -r LINUX_VERSION_MAJOR LINUX_VERSION_MINOR LINUX_VERSION_PATCH <<< $LINUX_VERSION IFS='.' read -r LINUX_VERSION_MAJOR LINUX_VERSION_MINOR LINUX_VERSION_PATCH <<< $LINUX_VERSION
LINUX_URL=https://cdn.kernel.org/pub/linux/kernel/v$LINUX_VERSION_MAJOR.x/linux-$LINUX_VERSION.tar.xz LINUX_URL=https://cdn.kernel.org/pub/linux/kernel/v$LINUX_VERSION_MAJOR.x/linux-$LINUX_VERSION.tar.xz
M4_VERSION=1.4.20
M4_URL=https://mirror.ufs.ac.za/gnu/m4/m4-$M4_VERSION.tar.xz
if [ ! -d "$SYSROOT" ]; then if [ ! -d "$SYSROOT" ]; then
mkdir -p "$SYSROOT"/{etc,cross,sources,usr,dev,proc,sys,run} mkdir -p "$SYSROOT"/{etc,cross,sources,usr,dev,proc,sys,run}
@@ -196,8 +198,26 @@ bootstap_libstdcpp() {
cd "$SOURCES" && rm -rf gcc-$GCC_VERSION cd "$SOURCES" && rm -rf gcc-$GCC_VERSION
} }
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
}
#bootstrap_binutils #bootstrap_binutils
#bootstap_gcc #bootstap_gcc
#bootstap_linux #bootstap_linux
#bootstap_glibc #bootstap_glibc
bootstap_libstdcpp #bootstap_libstdcpp
toolchain_m4