Swamp make and gzip.

This commit is contained in:
Andrius Štikonas 2022-05-14 19:40:52 +01:00
parent e4f5342ee4
commit 3fd451a909
12 changed files with 51 additions and 44 deletions

View File

@ -90,13 +90,6 @@ using older versions compilable by tinycc. Prior to this point, all tools
have been adapted significantly for the bootstrap; now, we will be using
old tooling instead.
gzip 1.2.4
==========
``gzip`` is the most common compression format used for software source
code. It is luckily distributed as a barebones uncompressed ``.tar``,
which we extract and then build.
make 3.80
=========
@ -104,6 +97,13 @@ GNU ``make`` is now built so we have a more robust building system.
``make`` allows us to do things like define rules for files rather than
writing complex kaem scripts.
gzip 1.2.4
==========
``gzip`` is the most common compression format used for software source
code. It is more capble than ``ungz`` from ``stage0-posix`` and also supports
compression.
tar 1.12
========

View File

@ -99,12 +99,12 @@ class SysA(SysGeneral):
# tcc 0.9.26 patched by janneke
self.get_file("https://lilypond.org/janneke/tcc/tcc-0.9.26-1136-g5bba73cc.tar.gz", output="tcc-0.9.26.tar.gz")
# gzip 1.2.4
self.get_file("https://mirrors.kernel.org/gnu/gzip/gzip-1.2.4.tar.gz")
# make 3.80
self.get_file("https://mirrors.kernel.org/gnu/make/make-3.80.tar.gz")
# gzip 1.2.4
self.get_file("https://mirrors.kernel.org/gnu/gzip/gzip-1.2.4.tar.gz")
# tar 1.12
self.get_file("https://mirrors.kernel.org/gnu/tar/tar-1.12.tar.gz")

View File

@ -76,14 +76,14 @@ cd ..
libdir=${libdir}/mes
# gzip
pkg="gzip-1.2.4"
# make
pkg="make-3.80"
cd ${pkg}
kaem --file ${pkg}.kaem
cd ..
# make
pkg="make-3.80"
# gzip
pkg="gzip-1.2.4"
cd ${pkg}
kaem --file ${pkg}.kaem
cd ..

View File

@ -13,7 +13,7 @@ cd build
# Extract
cp ${distfiles}/${pkg}.tar.gz ../src/
gunzip -f ../src/${pkg}.tar.gz
gzip -d -f ../src/${pkg}.tar.gz
tar xf ../src/${pkg}.tar
rm -r ../src/
cd ${pkg}

View File

@ -12,7 +12,7 @@ cd build
# Extract
cp ${distfiles}/${pkg}.tar.gz ../src/
gunzip -f ../src/${pkg}.tar.gz
gzip -d -f ../src/${pkg}.tar.gz
tar xf ../src/${pkg}.tar
cd ${pkg}

View File

@ -1 +1 @@
3a0753ea8effb449d19d0fef091cabe27a937dc8545d1dd9fe28cd2991e846e8 /usr/bin/gzip
c310ba8e6df0b3e12934b5443079264656817a234b0417faa69a140447caf5a2 /usr/bin/gzip

View File

@ -21,34 +21,16 @@ untar ../src/${pkg}.tar
cd ${pkg}
# Prepare
cp ../../mk/main.mk Makefile
catm gzip.c.new ../../files/stat_override.c gzip.c
cp gzip.c.new gzip.c
# 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
# strlwr is already defined in mes libc
tcc -c -Dstrlwr=unused util.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.o crypt.o lzw.o unlzw.o unpack.o unlzh.o getopt.o
# Build
make
# Install
cp ${bindir}/gzip ${bindir}/gunzip
cp ${bindir}/gzip ${bindir}/zcat
chmod 755 ${bindir}/gunzip
chmod 755 ${bindir}/zcat
cp gzip ${bindir}/gzip
chmod 755 ${bindir}/gzip
cd ../..

View File

@ -0,0 +1,23 @@
# SPDX-FileCopyrightText: 2022 Andrius Štikonas <andrius@stikonas.eu>
#
# SPDX-License-Identifier: GPL-3.0-or-later
CC = tcc
AR = tcc -ar
# -DSIZEOF_UNSIGNED_LONG=4 forces use of simulated arithmetic
# This is to avoid running configure test to determine sizeof(long long)
CPPFLAGS = -DNO_UTIME \
-Dstrlwr=unused
CFLAGS = -I . -static
.PHONY: all
GZIP_SRC = gzip bits crypt deflate getopt inflate lzw trees unlzh unlzw unpack unzip util zip
GZIP_OBJ = $(addsuffix .o, $(GZIP_SRC))
all: gzip
gzip: $(GZIP_OBJ)
$(CC) $^ -o $@

View File

@ -11,7 +11,7 @@ cd build
# Extract
cp ${distfiles}/${pkg}.tar.gz ../src/
gunzip -f ../src/${pkg}.tar.gz
ungz ../src/${pkg}.tar.gz
untar ../src/${pkg}.tar
cd ${pkg}

View File

@ -11,7 +11,7 @@ cd build
# Extract
cp ${distfiles}/${pkg}.tar.gz ../src/
gunzip -f ../src/${pkg}.tar.gz
gzip -d -f ../src/${pkg}.tar.gz
tar xf ../src/${pkg}.tar
cd ${pkg}
cp ../../mk/main.mk Makefile

View File

@ -13,7 +13,7 @@ cd build
# Extract
cp ${distfiles}/${pkg}.tar.gz ../src/
gunzip -f ../src/${pkg}.tar.gz
gzip -d -f ../src/${pkg}.tar.gz
tar xf ../src/${pkg}.tar
cd ${pkg}
cp ../../mk/main.mk Makefile

View File

@ -13,10 +13,12 @@ cd build
# Extract
cp ${distfiles}/${pkg}.tar.gz ../src/
gunzip -f ../src/${pkg}.tar.gz
gzip -d -f ../src/${pkg}.tar.gz
untar ../src/${pkg}.tar
cd ${pkg}
# Prepare
cp ../../mk/main.mk Makefile
cp ../../files/getdate_stub.c lib/getdate_stub.c
catm src/create.c.new ../../files/stat_override.c src/create.c