Build gzip 1.2.4.

This commit is contained in:
Andrius Štikonas 2021-01-11 20:44:07 +00:00
parent 3405518e2e
commit 238e9359b0
3 changed files with 48 additions and 0 deletions

View File

@ -87,6 +87,14 @@ popd
cp "$(basename $url .tar.gz).kaem" tmp/after
tar -C tmp/after -xf "../sources/$(basename $url)"
# gzip 1.2.4
url=https://ftp.gnu.org/gnu/gzip/gzip-1.2.4.tar
pushd ../sources
wget --continue "$url"
popd
cp "$(basename $url .tar).kaem" tmp/after
cp "../sources/$(basename $url)" tmp/after
# General cleanup
find tmp -name .git -exec rm -rf \;

View File

@ -57,3 +57,9 @@ cd ..
cd tar-1.12
kaem --file ../tar-1.12.kaem
cd ..
# Part 9: gzip
/after/bin/tar xf gzip-1.2.4.tar
cd gzip-1.2.4
kaem --file ../gzip-1.2.4.kaem
cd ..

34
sysa/gzip-1.2.4.kaem Executable file
View File

@ -0,0 +1,34 @@
#!/bin/sh
set -ex
# Variables
bindir=/after/bin
# Compile
tcc -c -DNO_UTIME gzip.c
tcc -c bits.c
tcc -c crypt.c
tcc -c deflate.c
tcc -c getopt.c
tcc -c inflate.c
tcc -c lzw.c
tcc -c trees.c
tcc -c unlzh.c
tcc -c unlzw.c
tcc -c unpack.c
tcc -c unzip.c
# Remove strlwr, it does not build with mes libc
cp util.c util_patched.c
sed -i 165,174d util_patched.c
tcc -c util_patched.c
tcc -c zip.c
# Link
tcc -static -o ${bindir}/gzip gzip.o zip.o deflate.o trees.o bits.o unzip.o inflate.o util_patched.o crypt.o lzw.o unlzw.o unpack.o unlzh.o getopt.o
# Install
cp ${bindir}/gzip ${bindir}/gunzip
cp ${bindir}/gzip ${bindir}/zcat
chmod 755 ${bindir}/gunzip
chmod 755 ${bindir}/zcat