Merge pull request #160 from stikonas/sed

Move make immediately after tcc-0.9.26.
This commit is contained in:
fosslinux 2022-05-15 12:50:59 +10:00 committed by GitHub
commit 857ca16195
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
16 changed files with 122 additions and 132 deletions

View File

@ -90,14 +90,19 @@ 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.
make 3.80
=========
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 luckily distributed as a barebones uncompressed ``.tar``,
which we extract and then build.
Going forward, we can now use ``.tar.gz`` for source code.
code. It is more capble than ``ungz`` from ``stage0-posix`` and also supports
compression.
tar 1.12
========
@ -109,13 +114,6 @@ sed 4.0.9
You are most likely aware of GNU ``sed``, a line editor.
make 3.80
=========
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.
patch 2.5.9
===========

View File

@ -92,13 +92,16 @@ class SysA(SysGeneral):
def get_packages(self):
"""Prepare remaining sources"""
# mes-0.22 snapshot with m2 fixes
# mes-0.24
self.get_file(["https://mirrors.kernel.org/gnu/mes/mes-0.24.tar.gz",
"https://download.savannah.gnu.org/releases/nyacc/nyacc-1.00.2.tar.gz"])
# 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")
# 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")
@ -111,9 +114,6 @@ class SysA(SysGeneral):
# patch 2.5.9
self.get_file("https://mirrors.kernel.org/gnu/patch/patch-2.5.9.tar.gz")
# make 3.80
self.get_file("https://mirrors.kernel.org/gnu/make/make-3.80.tar.gz")
# bzip2 1.0.8
self.get_file("https://sourceware.org/pub/bzip2/bzip2-1.0.8.tar.gz")

View File

@ -76,6 +76,12 @@ cd ..
libdir=${libdir}/mes
# make
pkg="make-3.80"
cd ${pkg}
kaem --file ${pkg}.kaem
cd ..
# gzip
pkg="gzip-1.2.4"
cd ${pkg}
@ -94,12 +100,6 @@ cd ${pkg}
kaem --file ${pkg}.kaem
cd ..
# make
pkg="make-3.80"
cd ${pkg}
kaem --file ${pkg}.kaem
cd ..
# patch
pkg="patch-2.5.9"
cd ${pkg}

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,8 +11,8 @@ cd build
# Extract
cp ${distfiles}/${pkg}.tar.gz ../src/
gunzip -f ../src/${pkg}.tar.gz
tar xf ../src/${pkg}.tar
ungz ../src/${pkg}.tar.gz
untar ../src/${pkg}.tar
cd ${pkg}
# Create .h files

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
@ -24,8 +24,6 @@ catm patchlevel.h
cp pch.c pch_patched.c
sed -i 841,848d pch_patched.c
# Compile
# Build
make -f Makefile PREFIX=${prefix}

View File

@ -1 +1 @@
19140fdea18e2d8f3ed1597f7d0d72baa7b2c3b69bf87edc35271df2da24bbfb /usr/bin/sed
092b2972a16ffe6919f52678c675ac29708f507ee800172ac139fb9c44ccb153 /usr/bin/sed

View File

@ -12,11 +12,19 @@ CPPFLAGS = -DENABLE_NLS=0 \
-DSED_FEATURE_VERSION=\"4.0\" \
-DVERSION=\"4.0.9\" \
-DPACKAGE=\"sed\"
CFLAGS = -I . -I lib
CFLAGS = -I . -I lib -static
LDFLAGS = -L. -lsed
.PHONY: all
LIB_SRC = alloca getopt1 getopt utils regex obstack strverscmp mkstemp
ifeq ($(LIBC),mes)
LIB_SRC = getline
else
LIB_SRC = alloca
endif
LIB_SRC += getopt1 getopt utils regex obstack strverscmp mkstemp
LIB_OBJ = $(addprefix lib/, $(addsuffix .o, $(LIB_SRC)))
SED_SRC = compile execute regexp fmt sed
@ -24,11 +32,16 @@ SED_OBJ = $(addprefix sed/, $(addsuffix .o, $(SED_SRC)))
all: sed/sed
lib/regex.h: lib/regex_.h
cp $< $@
lib/regex.o: lib/regex.h
libsed.a: $(LIB_OBJ)
$(AR) cr $@ $^
sed/sed: $(SED_OBJ) libsed.a
$(CC) -o $@ $^
sed/sed: libsed.a $(SED_OBJ)
$(CC) $^ $(LDFLAGS) -o $@
install:
install -D sed/sed $(DESTDIR)$(PREFIX)/bin/sed

View File

@ -13,43 +13,20 @@ 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
# Create config.h
catm config.h
# Compile
# Build
make -f Makefile LIBC=mes
## libsed.a
cd lib
tcc -c getopt1.c
tcc -c -I .. getopt.c
tcc -c -I .. -DENABLE_NLS=0 utils.c
cp regex_.h regex.h
tcc -c -DHAVE_ALLOCA_H -I . regex.c
tcc -c obstack.c
tcc -c strverscmp.c
tcc -c getline.c
tcc -c -DHAVE_FCNTL_H mkstemp.c
tcc -ar cr libsed.a getopt1.o getopt.o utils.o regex.o obstack.o strverscmp.o getline.o mkstemp.o
cd ..
## sed
tcc -c -I . -I lib -DSED_FEATURE_VERSION=\"4.0\" sed/compile.c
tcc -c -I . -I lib sed/execute.c
tcc -c -I . -I lib sed/regexp.c
tcc -c -I . -I lib sed/fmt.c
tcc -c -I . -I lib -DPACKAGE=\"sed\" -DVERSION=\"4.0.9\" sed/sed.c
# Link
tcc -static -o ${bindir}/sed -L lib lib/libsed.a compile.o execute.o regexp.o fmt.o sed.o -lsed
# Test
sed --version
# Install
cp sed/sed ${prefix}/bin/sed
chmod 755 ${prefix}/bin/sed
cd ../..

View File

@ -5,7 +5,6 @@
src_prepare() {
default
cp lib/regex_.h lib/regex.h
touch config.h
}

36
sysa/tar-1.12/mk/main.mk Normal file
View File

@ -0,0 +1,36 @@
# 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 = -DHAVE_FCNTL_H \
-DHAVE_DIRENT_H \
-DHAVE_GETCWD_H \
-DHAVE_GETCWD \
-DSIZEOF_UNSIGNED_LONG=4 \
-DVERSION=\"1.12\" \
-DPACKAGE=\"tar\"
CFLAGS = -I . -I lib -static
LDFLAGS = -L. -ltar
.PHONY: all
LIB_SRC = argmatch backupfile error fnmatch ftruncate getdate_stub getopt getopt1 getversion modechange msleep xgetcwd xmalloc xstrdup
LIB_OBJ = $(addprefix lib/, $(addsuffix .o, $(LIB_SRC)))
TAR_SRC = arith buffer compare create delete extract incremen list mangle misc names open3 rtapelib tar update
TAR_OBJ = $(addprefix src/, $(addsuffix .o, $(TAR_SRC)))
all: tar
libtar.a: $(LIB_OBJ)
$(AR) cr $@ $^
tar: libtar.a $(TAR_OBJ)
$(CC) $^ $(LDFLAGS) -o $@

View File

@ -13,59 +13,23 @@ 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
cp src/create.c.new src/create.c
# Compile
# Build
make -f Makefile
## libtar.a
cd lib
tcc -c argmatch.c
tcc -c -DHAVE_DIRENT_H backupfile.c
tcc -c -I . error.c
tcc -c -I . fnmatch.c
tcc -c ftruncate.c
tcc -c getdate_stub.c
tcc -c getopt.c
tcc -c getopt1.c
tcc -c getversion.c
tcc -c modechange.c
tcc -c msleep.c
tcc -c -DHAVE_GETCWD xgetcwd.c
tcc -c xmalloc.c
tcc -c xstrdup.c
tcc -ar cr libtar.a argmatch.o backupfile.o error.o fnmatch.o ftruncate.o getdate_stub.o getopt.o getopt1.o getversion.o modechange.o msleep.o xgetcwd.o xmalloc.o xstrdup.o
cd ..
## tar
# -DSIZEOF_UNSIGNED_LONG=4 forces use of simulated arithmetic
# This is to avoid running configure test to determine sizeof(long long)
tcc -c -I lib -DSIZEOF_UNSIGNED_LONG=4 -DHAVE_FCNTL_H src/arith.c
tcc -c -I lib -DSIZEOF_UNSIGNED_LONG=4 -DHAVE_FCNTL_H src/buffer.c
tcc -c -I lib -DSIZEOF_UNSIGNED_LONG=4 -DHAVE_FCNTL_H src/compare.c
tcc -c -I lib -DSIZEOF_UNSIGNED_LONG=4 -DHAVE_FCNTL_H -DHAVE_DIRENT_H src/create.c
tcc -c -I lib -DSIZEOF_UNSIGNED_LONG=4 -DHAVE_FCNTL_H src/delete.c
tcc -c -I lib -DSIZEOF_UNSIGNED_LONG=4 -DHAVE_FCNTL_H src/extract.c
tcc -c -I lib -DSIZEOF_UNSIGNED_LONG=4 -DHAVE_FCNTL_H -DHAVE_GETCWD -DHAVE_DIRENT_H src/incremen.c
tcc -c -I lib -DSIZEOF_UNSIGNED_LONG=4 -DHAVE_FCNTL_H src/list.c
tcc -c -I lib -DSIZEOF_UNSIGNED_LONG=4 -DHAVE_FCNTL_H src/mangle.c
tcc -c -I lib -DSIZEOF_UNSIGNED_LONG=4 -DHAVE_FCNTL_H -DHAVE_DIRENT_H src/misc.c
tcc -c -I lib -DSIZEOF_UNSIGNED_LONG=4 -DHAVE_FCNTL_H -DHAVE_GETCWD src/names.c
tcc -c -I lib -DSIZEOF_UNSIGNED_LONG=4 -DHAVE_FCNTL_H src/open3.c
tcc -c -I lib -DSIZEOF_UNSIGNED_LONG=4 -DHAVE_FCNTL_H src/rtapelib.c
tcc -c -I lib -DSIZEOF_UNSIGNED_LONG=4 -DHAVE_FCNTL_H -DPACKAGE=\"tar\" -DVERSION=\"1.12\" src/tar.c
tcc -c -I lib -DSIZEOF_UNSIGNED_LONG=4 -DHAVE_FCNTL_H src/update.c
# Link
tcc -static -o ${bindir}/tar -L lib lib/libtar.a arith.o buffer.o compare.o create.o delete.o extract.o incremen.o list.o mangle.o misc.o names.o open3.o rtapelib.o tar.o update.o -ltar
# Install
cp tar ${prefix}/bin/tar
chmod 755 ${prefix}/bin/tar
cd ../..