added m4 toolchain step

This commit is contained in:
ag-tsotetsi
2026-02-08 11:25:29 +02:00
parent 3189b595d2
commit b314b0acfc
2 changed files with 56 additions and 0 deletions

49
build/m4/build.bash Normal file
View File

@@ -0,0 +1,49 @@
. "$PROJECTDIR/build/m4/package.env"
fetch $M4_URL
cd "$SOURCES" && tar xf m4-$M4_VERSION.tar.xz && cd m4-$M4_VERSION
bootstrap() {
echo bootstrap
}
toolchain() {
sed -r '/_GL_EXTERN_C/s/w?memchr|bsearch/(&)/' -i $(find -name \*.in.h)
./configure \
--prefix=/usr \
--host=$TARGET \
--build=$(build-aux/config.guess) > /dev/null
make > /dev/null && make DESTDIR="$SYSROOT" install > /dev/null
}
setup() {
echo setup
}
final() {
echo final
}
case $1 in
bootstrap)
bootstrap
;;
toolchain)
toolchain
;;
setup)
setup
;;
final)
final
;;
esac
cd "$SOURCES" && rm -rf "$SOURCES/m4-$M4_VERSION"

7
build/m4/package.env Normal file
View File

@@ -0,0 +1,7 @@
export M4_VERSION=1.4.20
IFS='.' read -r M4_VERSION_MAJOR M4_VERSION_MINOR <<< $M4_VERSION
export M4_VERSION_MAJOR M4_VERSION_MINOR
export M4_URL=https://mirror.ufs.ac.za/gnu/m4/m4-$M4_VERSION.tar.xz