Merge branch 'stikonas-sed'

This commit is contained in:
fosslinux 2021-01-11 12:21:18 +11:00
commit 039b8ad658
3 changed files with 32 additions and 0 deletions

View File

@ -73,6 +73,16 @@ ln -s /after/lib x86-mes
ln -s /after/lib/linux .
popd
mkdir -p ../sources
# sed
url=ftp://ftp.gnu.org/gnu/sed/sed-1.18.tar.gz
pushd ../sources
wget --continue "$url"
popd
cp sed.kaem tmp/after
tar -C tmp/after -xf ../sources/$(basename $url)
# General cleanup
find tmp -name .git -exec rm -rf \;

View File

@ -49,3 +49,8 @@ kaem --file mes.kaem
cd tcc-0.9.26p1
kaem --file ../tcc.kaem
cd ..
# Part 7: sed
cd sed-1.18
kaem --file ../sed.kaem
cd ..

17
sysa/sed.kaem Executable file
View File

@ -0,0 +1,17 @@
#!/bin/sh
set -ex
# Variables
bindir=/after/bin
# Compile
tcc -c getopt1.c
tcc -c getopt.c
tcc -c regex.c
tcc -c utils.c
tcc -c -Dalloca alloca.c
tcc -c -DHAVE_BCOPY sed.c
# Link
tcc -static -o ${bindir}/sed alloca.o getopt1.o getopt.o regex.o sed.o utils.o