diff --git a/build.sh b/build.sh index fa0a3c7..e609029 100755 --- a/build.sh +++ b/build.sh @@ -47,6 +47,8 @@ LINUX_VERSION=6.18.7 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 +M4_VERSION=1.4.20 +M4_URL=https://mirror.ufs.ac.za/gnu/m4/m4-$M4_VERSION.tar.xz if [ ! -d "$SYSROOT" ]; then mkdir -p "$SYSROOT"/{etc,cross,sources,usr,dev,proc,sys,run} @@ -196,8 +198,26 @@ bootstap_libstdcpp() { 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 #bootstap_gcc #bootstap_linux #bootstap_glibc -bootstap_libstdcpp \ No newline at end of file +#bootstap_libstdcpp +toolchain_m4 \ No newline at end of file