This commit is contained in:
Your Name 2023-12-20 21:18:01 +03:00
parent 8a97b330f2
commit 6c652ea22b
12 changed files with 138 additions and 2 deletions

10
stages/0-download-src.sh Executable file
View file

@ -0,0 +1,10 @@
#!/bin/sh
echo "* Download micro-utils sources..."
git clone $mu_repo src
echo "* Download musl sources..."
git clone $ml_repo libc
echo "* Download tcc sources..."
git clone $cc_repo tcc

11
stages/1-libc.sh Executable file
View file

@ -0,0 +1,11 @@
#!/bin/sh
echo "* Build musl libc"
cd libc
make clean
./configure CC=cc CFLAGS="-Os -s -pipe" --disable-warnings --disable-static --prefix=$RTFS
make -j $(nproc)
make install
cd ..

11
stages/2-cross-compiler.sh Executable file
View file

@ -0,0 +1,11 @@
#!/bin/sh
echo "* Build cross compiler"
cd tcc
make clean
./configure --extra-cflags="-Os -s" --prefix=$RTFS/ --elfinterp=/lib/libc.so --config-musl --config-bcheck=no --enable-static
make -j $(nproc)
make install
cd ..

9
stages/3-micro-utils.sh Executable file
View file

@ -0,0 +1,9 @@
#!/bin/sh
echo " * Build micro-utils"
cd src
env CC="$RTFS/bin/tcc" CFLAGS="-pedantic -Os -s -Wall -I $RTFS/include -L $RTFS/lib/tcc -L $RTFS/lib" ./build.sh
mv bin/* $RTFS/bin
cd ..

10
stages/4-host-compiler.sh Executable file
View file

@ -0,0 +1,10 @@
#!/bin/sh
echo "* Build host compiler"
cd tcc
./configure --extra-cflags="-Os -s" --prefix=$RTFS/ --elfinterp=/lib/libc.so --config-musl --config-bcheck=no --enable-static --cc=$RTFS/bin/tcc
make -j $(nproc)
make install
cd ..