Restructure
This commit is contained in:
parent
e5cbaa9e04
commit
5a369dc783
|
@ -1,27 +1,33 @@
|
|||
[submodule "mescc-tools-seed"]
|
||||
path = sysa/mescc-tools-seed
|
||||
[submodule "sysa/mescc-tools-seed/src/mescc-tools-seed"]
|
||||
path = sysa/mescc-tools-seed/src/mescc-tools-seed
|
||||
url = https://github.com/oriansj/mescc-tools-seed/
|
||||
[submodule "bootstrap-seeds"]
|
||||
path = bootstrap-seeds
|
||||
path = sysa/bootstrap-seeds
|
||||
url = https://github.com/oriansj/bootstrap-seeds
|
||||
[submodule "blynn-compiler-oriansj"]
|
||||
path = sysa/blynn-compiler-oriansj
|
||||
[submodule "sysa/blynn-compiler/src"]
|
||||
path = sysa/blynn-compiler/src
|
||||
url = https://github.com/oriansj/blynn-compiler
|
||||
[submodule "sysa/mes"]
|
||||
path = sysa/mes
|
||||
[submodule "sysa/mes/src/mes"]
|
||||
path = sysa/mes/src/mes
|
||||
url = https://gitlab.com/janneke/mes.git
|
||||
[submodule "sysa/nyacc"]
|
||||
path = sysa/nyacc
|
||||
[submodule "sysa/mes/src/nyacc"]
|
||||
path = sysa/mes/src/nyacc
|
||||
url = https://git.savannah.gnu.org/git/nyacc.git
|
||||
[submodule "sysa/tcc-0.9.26p1"]
|
||||
path = sysa/tcc-0.9.26
|
||||
[submodule "sysa/tcc-0.9.26/src/tcc-0.9.26"]
|
||||
path = sysa/tcc-0.9.26/src/tcc-0.9.26
|
||||
url = https://gitlab.com/janneke/tinycc
|
||||
[submodule "sysa/mescc-tools-patched"]
|
||||
path = sysa/mescc-tools-patched
|
||||
path = sysa/mescc-tools-seed/src/mescc-tools-patched
|
||||
url = https://github.com/oriansj/mescc-tools
|
||||
[submodule "sysa/tcc-0.9.27"]
|
||||
path = sysa/tcc-0.9.27
|
||||
[submodule "sysa/tcc-0.9.27/src/tcc-0.9.27"]
|
||||
path = sysa/tcc-0.9.27/src/tcc-0.9.27
|
||||
url = git://repo.or.cz/tinycc.git
|
||||
[submodule "sysa/sed-4.0.7"]
|
||||
path = sysa/sed-4.0.7
|
||||
[submodule "sysa/sed-4.0.7/src"]
|
||||
path = sysa/sed-4.0.7/src
|
||||
url = https://git.savannah.gnu.org/git/sed/sed-history.git
|
||||
[submodule "sysa/tcc-0.9.26/src/mes-libc"]
|
||||
path = sysa/tcc-0.9.26/src/mes-libc
|
||||
url = https://gitlab.com/janneke/mes
|
||||
[submodule "sysa/tcc-0.9.27/src/mes-libc"]
|
||||
path = sysa/tcc-0.9.27/src/mes-libc
|
||||
url = https://gitlab.com/janneke/mes
|
||||
|
|
|
@ -0,0 +1,45 @@
|
|||
# Development Guidelines
|
||||
|
||||
## Testing
|
||||
|
||||
Before making a PR, please test your change locally. It is OK to develop outside
|
||||
of the live environment, but please be sure to test inside the live environment
|
||||
and that a full build completes.
|
||||
|
||||
## Structure
|
||||
|
||||
Each system corresponds to a reboot of the live environment. There is only one
|
||||
appropriate structure as shown below (eg for sysa):
|
||||
|
||||
```
|
||||
sysa
|
||||
├── any-global-files.sh
|
||||
├── somepackage-version
|
||||
│ ├── somepackage-version.kaem (or .sh)
|
||||
│ ├── files
|
||||
│ ├── mk
|
||||
│ ├── patches
|
||||
│ └── src
|
||||
└── tmp
|
||||
```
|
||||
|
||||
Global scripts that drive the entire system go directly under `sysx`. `tmp`
|
||||
contains the temporary system used for QEMU or a chroot.
|
||||
|
||||
Then, each package is in its own specific directory, named `package-version`.
|
||||
Within that, there must be a driving script, labelled either
|
||||
`package-version.kaem` when driven by kaem or `package-version.sh` when driven
|
||||
by a shell (normally bash).
|
||||
|
||||
In this folder, there are other folders. `src` is required, others are optional.
|
||||
Permissable folders:
|
||||
|
||||
- `files`: auxiliary files required for the build distributed by live-bootstrap.
|
||||
- `mk`: makefiles.
|
||||
- `patches`: patches for the source.
|
||||
- `src`: the upstream unmodified source code. This must be either:
|
||||
- a submodule
|
||||
- a folder contianing only `.placeholder` as distributed by git and gitignored,
|
||||
where the tarball is saved to in rootfs.sh. (The gitignore is already
|
||||
global, so the first time it is created with `.placeholder` it must be git
|
||||
added with `-f`).
|
64
rootfs.sh
64
rootfs.sh
|
@ -14,13 +14,13 @@ sudo mount -t tmpfs -o size=8G tmpfs tmp
|
|||
|
||||
# base: mescc-tools-seed
|
||||
# copy in all the mescc-tools-seed stuff
|
||||
cp -r mescc-tools-seed/x86/* tmp
|
||||
cp -r mescc-tools-seed/{M2-Planet,mes-m2} tmp/
|
||||
cp -r mescc-tools-patched tmp/mescc-tools
|
||||
cp -r mescc-tools-seed/src/mescc-tools-seed/x86/* tmp
|
||||
cp -r mescc-tools-seed/src/mescc-tools-seed/{M2-Planet,mes-m2} tmp/
|
||||
cp -r mescc-tools-seed/src/mescc-tools-patched tmp/mescc-tools
|
||||
# and the kaem seed
|
||||
cp ../bootstrap-seeds/POSIX/x86/kaem-optional-seed tmp/init
|
||||
cp ../bootstrap-seeds/POSIX/x86/kaem-optional-seed tmp/
|
||||
cp -r ../bootstrap-seeds tmp/
|
||||
cp bootstrap-seeds/POSIX/x86/kaem-optional-seed tmp/init
|
||||
cp bootstrap-seeds/POSIX/x86/kaem-optional-seed tmp/
|
||||
cp -r bootstrap-seeds tmp/
|
||||
# replace the init kaem with our own custom one
|
||||
mv tmp/kaem.run tmp/mescc-tools-seed.kaem.run
|
||||
cp base.kaem.run tmp/kaem.run
|
||||
|
@ -40,49 +40,34 @@ mkdir -p tmp/tmp
|
|||
cp after.kaem tmp/
|
||||
cp after.kaem.run tmp/after/kaem.run
|
||||
|
||||
# Copy in all of the patches
|
||||
cp -r patches tmp/after/
|
||||
|
||||
# mescc-tools-extra
|
||||
cp -r mescc-tools-extra tmp/after/
|
||||
|
||||
# blynn-compiler
|
||||
pushd tmp/after
|
||||
git clone ../../blynn-compiler-oriansj blynn-compiler
|
||||
cp ../../blynn-compiler.kaem blynn-compiler/go.kaem
|
||||
mkdir -p blynn-compiler/{bin,generated}
|
||||
popd
|
||||
cp -r blynn-compiler tmp/after/
|
||||
mkdir -p tmp/after/blynn-compiler/src/{bin,generated}
|
||||
|
||||
# mes
|
||||
cp -r mes tmp/after/
|
||||
cp -r mes tmp/after/tcc-mes
|
||||
ln -s lib/x86-mes tmp/after/mes/x86-mes
|
||||
cp -r nyacc tmp/after/
|
||||
cp mes.kaem tmp/after/
|
||||
cp mes-files/mescc.scm tmp/after/bin/
|
||||
cp mes-files/config.h tmp/after/mes/include/mes/
|
||||
cp mes-files/config.h tmp/after/tcc-mes/include/mes/
|
||||
mkdir -p tmp/after/mes/{bin,m2}
|
||||
#ln -s lib/x86-mes tmp/after/mes/src/mes/x86-mes
|
||||
mkdir -p tmp/after/mes/src/mes/{bin,m2}
|
||||
|
||||
# tcc
|
||||
cp tcc.kaem tmp/after/
|
||||
# tcc 0.9.26
|
||||
cp -r tcc-0.9.26 tmp/after/
|
||||
cp -r tcc-0.9.27 tmp/after/
|
||||
pushd tmp/after/tcc-0.9.26
|
||||
pushd tmp/after/tcc-0.9.26/src/tcc-0.9.26
|
||||
ln -s ../mes/module .
|
||||
ln -s ../mes/mes .
|
||||
ln -s /after/lib x86-mes
|
||||
ln -s /after/lib/linux .
|
||||
popd
|
||||
|
||||
mkdir -p ../sources
|
||||
# tcc 0.9.27
|
||||
cp -r tcc-0.9.27 tmp/after/
|
||||
|
||||
# sed 4.0.7
|
||||
cp sed-4.0.7.kaem tmp/after/
|
||||
cp -r sed-4.0.7 tmp/after/
|
||||
|
||||
# tcc patched
|
||||
cp tcc-patched.kaem tmp/after/
|
||||
mkdir -p ../sources
|
||||
|
||||
# tar 1.12
|
||||
url=https://ftp.gnu.org/gnu/tar/tar-1.12.tar.gz
|
||||
|
@ -91,8 +76,8 @@ if [ ! -f "$(basename $url)" ]; then
|
|||
wget "$url"
|
||||
fi
|
||||
popd
|
||||
cp "$(basename $url .tar.gz).kaem" tmp/after
|
||||
tar -C tmp/after -xf "../sources/$(basename $url)"
|
||||
cp -r tar-1.12 tmp/after
|
||||
tar -C tmp/after/tar-1.12/src -xf "../sources/$(basename $url)" --strip-components=1
|
||||
|
||||
get_file() {
|
||||
url=$1
|
||||
|
@ -103,16 +88,12 @@ get_file() {
|
|||
popd
|
||||
ext="${url##*.}"
|
||||
if [ "$ext" = "tar" ]; then
|
||||
bname=$(basename "$url" ".tar")
|
||||
bname=$(basename "$url" ".tar")
|
||||
else
|
||||
bname=$(basename "$url" ".tar.${ext}")
|
||||
bname=$(basename "$url" ".tar.${ext}")
|
||||
fi
|
||||
for file in "${bname}."*; do
|
||||
if [ -f "${file}" ]; then
|
||||
cp "${file}" tmp/after
|
||||
fi
|
||||
done
|
||||
cp "../sources/$(basename "$url")" tmp/after
|
||||
cp -r "${bname}" tmp/after/
|
||||
cp "../sources/$(basename "$url")" "tmp/after/${bname}/src/"
|
||||
}
|
||||
|
||||
# gzip 1.2.4
|
||||
|
@ -124,9 +105,6 @@ get_file https://ftp.gnu.org/gnu/diffutils/diffutils-2.7.tar.gz
|
|||
# patch 2.5.9
|
||||
get_file https://ftp.gnu.org/pub/gnu/patch/patch-2.5.9.tar.gz
|
||||
|
||||
# patched tcc
|
||||
cp tcc-patched.kaem tmp/after/
|
||||
|
||||
# make 3.80
|
||||
get_file https://ftp.gnu.org/gnu/make/make-3.80.tar.gz
|
||||
|
||||
|
|
|
@ -18,5 +18,7 @@
|
|||
|
||||
cd after
|
||||
|
||||
PATH=/after/bin:/bin
|
||||
|
||||
# Finally, reinvoke kaem in this directory
|
||||
../bin/kaem --file kaem.run
|
||||
|
|
|
@ -20,92 +20,112 @@ set -ex
|
|||
|
||||
PATH=/after/bin:/bin
|
||||
|
||||
# Set commonly used variables
|
||||
prefix=/after
|
||||
bindir=${prefix}/bin
|
||||
libdir=${prefix}/lib
|
||||
incdir=${prefix}/include
|
||||
MES_PREFIX=${prefix}/mes/src/mes
|
||||
GUILE_LOAD_PATH=${prefix}/mes/src/nyacc/module:${prefix}/mes/src/mes/mes/module:${prefix}/mes/src/mes/module
|
||||
|
||||
# Part 2: cp and chown (mescc-tools-extra)
|
||||
cd mescc-tools-extra
|
||||
kaem --file go.kaem
|
||||
pkg="mescc-tools-extra"
|
||||
cd ${pkg}
|
||||
kaem --file ${pkg}.kaem
|
||||
cd ..
|
||||
|
||||
# Part 3: Remove remaining dependencies on / (root of /after)
|
||||
/after/bin/cp ../bin/hex2 bin/hex2
|
||||
/after/bin/cp ../bin/M1 bin/M1
|
||||
/after/bin/cp ../bin/M2-Planet bin/M2-Planet
|
||||
/after/bin/cp ../bin/blood-elf bin/blood-elf
|
||||
/after/bin/cp ../bin/get_machine bin/get_machine
|
||||
/after/bin/cp ../bin/mes-m2 bin/mes-m2
|
||||
/after/bin/cp ../bin/kaem bin/kaem
|
||||
/after/bin/cp ../catm bin/catm
|
||||
/after/bin/chmod 755 bin/hex2 bin/M1 bin/M2-Planet bin/blood-elf \
|
||||
cp ../bin/hex2 bin/hex2
|
||||
cp ../bin/M1 bin/M1
|
||||
cp ../bin/M2-Planet bin/M2-Planet
|
||||
cp ../bin/blood-elf bin/blood-elf
|
||||
cp ../bin/get_machine bin/get_machine
|
||||
cp ../bin/mes-m2 bin/mes-m2
|
||||
cp ../bin/kaem bin/kaem
|
||||
cp ../catm bin/catm
|
||||
chmod 755 bin/hex2 bin/M1 bin/M2-Planet bin/blood-elf \
|
||||
bin/get_machine bin/mes-m2 bin/kaem bin/catm
|
||||
PATH=/after/bin
|
||||
|
||||
# Part 4: blynn-compiler
|
||||
cd blynn-compiler
|
||||
kaem --file go.kaem
|
||||
pkg="blynn-compiler"
|
||||
cd ${pkg}
|
||||
kaem --file ${pkg}.kaem
|
||||
cd ..
|
||||
|
||||
# Part 5: mes
|
||||
kaem --file mes.kaem
|
||||
pkg="mes"
|
||||
cd ${pkg}
|
||||
kaem --file ${pkg}.kaem
|
||||
cd ..
|
||||
|
||||
# Part 6: tcc
|
||||
kaem --file tcc.kaem
|
||||
# Part 6: tcc 0.9.26
|
||||
pkg="tcc-0.9.26"
|
||||
cd ${pkg}
|
||||
kaem --file ${pkg}.kaem
|
||||
cd ..
|
||||
|
||||
# Part 7: sed
|
||||
cd sed-4.0.7
|
||||
kaem --file ../sed-4.0.7.kaem
|
||||
# Part 7: tcc 0.9.27
|
||||
pkg="tcc-0.9.27"
|
||||
cd ${pkg}
|
||||
kaem --file ${pkg}.kaem
|
||||
cd ..
|
||||
|
||||
# Part 8: sed
|
||||
pkg="sed-4.0.7"
|
||||
cd ${pkg}
|
||||
kaem --file ${pkg}.kaem
|
||||
cd ..
|
||||
|
||||
# Part 8: tar
|
||||
cd tar-1.12
|
||||
kaem --file ../tar-1.12.kaem
|
||||
pkg="tar-1.12"
|
||||
cd ${pkg}
|
||||
kaem --file ${pkg}.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
|
||||
pkg="gzip-1.2.4"
|
||||
cd ${pkg}
|
||||
kaem --file ${pkg}.kaem
|
||||
cd ..
|
||||
|
||||
# Part 10: diffutils
|
||||
/after/bin/gunzip diffutils-2.7.tar.gz
|
||||
/after/bin/tar xf diffutils-2.7.tar
|
||||
cd diffutils-2.7
|
||||
kaem --file ../diffutils-2.7.kaem
|
||||
pkg="diffutils-2.7"
|
||||
cd ${pkg}
|
||||
kaem --file ${pkg}.kaem
|
||||
cd ..
|
||||
|
||||
# Part 11: patch
|
||||
/after/bin/gunzip patch-2.5.9.tar.gz
|
||||
/after/bin/tar xf patch-2.5.9.tar
|
||||
cd patch-2.5.9
|
||||
kaem --file ../patch-2.5.9.kaem
|
||||
pkg="patch-2.5.9"
|
||||
cd ${pkg}
|
||||
kaem --file ${pkg}.kaem
|
||||
cd ..
|
||||
|
||||
# Part 12: tcc-patched
|
||||
cd tcc-0.9.27
|
||||
kaem --file ../tcc-patched.kaem
|
||||
kaem --file tcc-patched.kaem
|
||||
cd ..
|
||||
|
||||
# Part 13: make
|
||||
/after/bin/gunzip make-3.80.tar.gz
|
||||
/after/bin/tar xf make-3.80.tar
|
||||
cd make-3.80
|
||||
kaem --file ../make-3.80.kaem
|
||||
pkg="make-3.80"
|
||||
cd ${pkg}
|
||||
kaem --file ${pkg}.kaem
|
||||
cd ..
|
||||
|
||||
# Part 14: bzip2
|
||||
/after/bin/gunzip bzip2-1.0.8.tar.gz
|
||||
/after/bin/tar xf bzip2-1.0.8.tar
|
||||
cd bzip2-1.0.8
|
||||
kaem --file ../bzip2-1.0.8.kaem
|
||||
pkg="bzip2-1.0.8"
|
||||
cd ${pkg}
|
||||
kaem --file ${pkg}.kaem
|
||||
cd ..
|
||||
|
||||
# Part 15: bash
|
||||
/after/bin/gunzip bash-2.05b.tar.gz
|
||||
/after/bin/tar xf bash-2.05b.tar
|
||||
cd bash-2.05b
|
||||
kaem --file ../bash-2.05b.kaem
|
||||
pkg="bash-2.05b"
|
||||
cd ${pkg}
|
||||
kaem --file ${pkg}.kaem
|
||||
cd ..
|
||||
|
||||
# Part 16: m4
|
||||
/after/bin/gunzip m4-1.4.tar.gz
|
||||
/after/bin/tar xf m4-1.4.tar
|
||||
cd m4-1.4
|
||||
kaem --file ../m4-1.4.kaem
|
||||
pkg="m4-1.4"
|
||||
cd ${pkg}
|
||||
kaem --file ${pkg}.kaem
|
||||
cd ..
|
||||
|
|
|
@ -1,31 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
set -ex
|
||||
|
||||
# Variables
|
||||
bindir=/after/bin
|
||||
|
||||
catm config.h
|
||||
catm include/version.h
|
||||
catm include/pipesize.h
|
||||
|
||||
# Patch
|
||||
patch -Np0 -i ../patches/bash-2.05b/mes-libc.patch
|
||||
patch -Np0 -i ../patches/bash-2.05b/tinycc.patch
|
||||
patch -Np0 -i ../patches/bash-2.05b/missing-defines.patch
|
||||
patch -Np0 -i ../patches/bash-2.05b/locale.patch
|
||||
patch -Np0 -i ../patches/bash-2.05b/dev-tty.patch
|
||||
|
||||
# Compile
|
||||
cp ../bash-2.05b.mk Makefile
|
||||
cp ../bash-2.05b-builtins.mk builtins/Makefile
|
||||
cp ../bash-2.05b-common.mk common.mk
|
||||
make mkbuiltins
|
||||
cd builtins
|
||||
make libbuiltins.a
|
||||
cd ..
|
||||
make
|
||||
|
||||
# Install
|
||||
cp bash /after/bin/
|
||||
chmod 755 /after/bin/bash
|
|
@ -0,0 +1,38 @@
|
|||
#!/bin/sh
|
||||
|
||||
set -ex
|
||||
|
||||
cd build
|
||||
|
||||
# Extract
|
||||
gunzip ../src/${pkg}.tar.gz
|
||||
tar xf ../src/${pkg}.tar
|
||||
cd ${pkg}
|
||||
cp ../../mk/main.mk Makefile
|
||||
cp ../../mk/builtins.mk builtins/Makefile
|
||||
cp ../../mk/common.mk common.mk
|
||||
|
||||
# Create various .h files
|
||||
catm config.h
|
||||
catm include/version.h
|
||||
catm include/pipesize.h
|
||||
|
||||
# Patch
|
||||
patch -Np0 -i ../../patches/mes-libc.patch
|
||||
patch -Np0 -i ../../patches/tinycc.patch
|
||||
patch -Np0 -i ../../patches/missing-defines.patch
|
||||
patch -Np0 -i ../../patches/locale.patch
|
||||
patch -Np0 -i ../../patches/dev-tty.patch
|
||||
|
||||
# Compile
|
||||
make mkbuiltins
|
||||
cd builtins
|
||||
make libbuiltins.a
|
||||
cd ..
|
||||
make
|
||||
|
||||
# Install
|
||||
cp bash /after/bin/
|
||||
chmod 755 /after/bin/bash
|
||||
|
||||
cd ../..
|
|
@ -1,6 +1,8 @@
|
|||
#!/bin/sh
|
||||
|
||||
set -ex
|
||||
|
||||
PATH=/bin
|
||||
cd src
|
||||
|
||||
# compile pack_blobs.c
|
||||
M2-Planet --architecture x86 \
|
||||
|
@ -246,3 +248,8 @@ hex2 -f test/common_x86/ELF-i386-debug.hex2 \
|
|||
--architecture x86 \
|
||||
--BaseAddress 0x8048000 \
|
||||
-o bin/precisely --exec_enable
|
||||
|
||||
cp bin/precisely ${bindir}/precisely
|
||||
chmod 755 ${bindir}/precisely
|
||||
|
||||
cd ..
|
|
@ -1,13 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
set -ex
|
||||
|
||||
/after/bin/patch -Np0 -i ../patches/bzip2-1.0.8/bzip2-1.0.8.patch
|
||||
/after/bin/make CC=tcc AR="tcc -ar" bzip2
|
||||
|
||||
# Install
|
||||
/after/bin/cp bzip2 /after/bin/bzip2
|
||||
/after/bin/chmod 755 /after/bin/bzip2
|
||||
|
||||
# Test
|
||||
/after/bin/bzip2 --help
|
|
@ -0,0 +1,26 @@
|
|||
#!/bin/sh
|
||||
|
||||
set -ex
|
||||
|
||||
cd build
|
||||
|
||||
# Extract
|
||||
gunzip ../src/${pkg}.tar.gz
|
||||
tar xf ../src/${pkg}.tar
|
||||
cd ${pkg}
|
||||
|
||||
# Patch
|
||||
patch -Np0 -i ../../patches/mes-libc.patch
|
||||
patch -Np0 -i ../../patches/coreutils.patch
|
||||
|
||||
# Build
|
||||
make CC=tcc AR="tcc -ar" bzip2
|
||||
|
||||
# Install
|
||||
cp bzip2 /after/bin/bzip2
|
||||
chmod 755 /after/bin/bzip2
|
||||
|
||||
# Test
|
||||
bzip2 --help
|
||||
|
||||
cd ../..
|
|
@ -1,24 +1,3 @@
|
|||
diff -r -N -U3 bzip2-1.0.8/bzip2.c bzip2-1.0.8/bzip2.c
|
||||
--- bzip2.c 2019-07-13 18:50:05.000000000 +0100
|
||||
+++ bzip2.c 2021-01-14 14:11:40.160213521 +0000
|
||||
@@ -1051,12 +1051,13 @@
|
||||
{
|
||||
# if BZ_UNIX
|
||||
IntNative retVal;
|
||||
- struct utimbuf uTimBuf;
|
||||
+ //struct utimbuf uTimBuf;
|
||||
|
||||
- uTimBuf.actime = fileMetaInfo.st_atime;
|
||||
- uTimBuf.modtime = fileMetaInfo.st_mtime;
|
||||
+ //uTimBuf.actime = fileMetaInfo.st_atime;
|
||||
+ //uTimBuf.modtime = fileMetaInfo.st_mtime;
|
||||
|
||||
- retVal = utime ( dstName, &uTimBuf );
|
||||
+ //retVal = utime ( dstName, &uTimBuf );
|
||||
+ retVal = 0;
|
||||
ERROR_IF_NOT_ZERO ( retVal );
|
||||
# endif
|
||||
}
|
||||
diff -r -N -U3 bzip2-1.0.8/Makefile bzip2-1.0.8/Makefile
|
||||
--- Makefile 2019-07-13 18:50:05.000000000 +0100
|
||||
+++ Makefile 2021-01-14 15:45:17.558516299 +0000
|
||||
|
@ -53,9 +32,3 @@ diff -r -N -U3 bzip2-1.0.8/Makefile bzip2-1.0.8/Makefile
|
|||
$(CC) $(CFLAGS) -c blocksort.c
|
||||
huffman.o: huffman.c
|
||||
$(CC) $(CFLAGS) -c huffman.c
|
||||
diff -r -N -U3 bzip2-1.0.8/utime.h bzip2-1.0.8/utime.h
|
||||
--- utime.h 1970-01-01 01:00:00.000000000 +0100
|
||||
+++ utime.h 2021-01-14 18:11:11.253825037 +0000
|
||||
@@ -0,0 +1,2 @@
|
||||
+#define fchown(filedes, owner, group) 0
|
||||
+#define fchmod(filedes, mode) 0
|
|
@ -0,0 +1,23 @@
|
|||
diff -r -N -U3 bzip2-1.0.8/bzip2.c bzip2-1.0.8/bzip2.c
|
||||
--- bzip2.c 2019-07-13 18:50:05.000000000 +0100
|
||||
+++ bzip2.c 2021-01-14 14:11:40.160213521 +0000
|
||||
@@ -1051,12 +1051,9 @@
|
||||
{
|
||||
# if BZ_UNIX
|
||||
IntNative retVal;
|
||||
- struct utimbuf uTimBuf;
|
||||
|
||||
- uTimBuf.actime = fileMetaInfo.st_atime;
|
||||
- uTimBuf.modtime = fileMetaInfo.st_mtime;
|
||||
|
||||
- retVal = utime ( dstName, &uTimBuf );
|
||||
+ retVal = 0;
|
||||
ERROR_IF_NOT_ZERO ( retVal );
|
||||
# endif
|
||||
}
|
||||
diff -r -N -U3 bzip2-1.0.8/utime.h bzip2-1.0.8/utime.h
|
||||
--- utime.h 1970-01-01 01:00:00.000000000 +0100
|
||||
+++ utime.h 2021-01-14 18:11:11.253825037 +0000
|
||||
@@ -0,0 +1,2 @@
|
||||
+#define fchown(filedes, owner, group) 0
|
||||
+#define fchmod(filedes, mode) 0
|
|
@ -2,8 +2,12 @@
|
|||
|
||||
set -ex
|
||||
|
||||
# Variables
|
||||
bindir=/after/bin
|
||||
cd build
|
||||
|
||||
# Extract
|
||||
gunzip ../src/${pkg}.tar.gz
|
||||
tar xf ../src/${pkg}.tar
|
||||
cd ${pkg}
|
||||
|
||||
# Touch config.h file
|
||||
catm config.h
|
||||
|
@ -36,3 +40,5 @@ tcc -static -o ${bindir}/diff diff.o analyze.o cmpbuf.o dir.o io.o util.o contex
|
|||
# Test
|
||||
cmp --version
|
||||
diff --version
|
||||
|
||||
cd ../..
|
|
@ -2,8 +2,16 @@
|
|||
|
||||
set -ex
|
||||
|
||||
# Variables
|
||||
bindir=/after/bin
|
||||
cd build
|
||||
|
||||
# Extract
|
||||
tar xf ../src/${pkg}.tar
|
||||
cd ${pkg}
|
||||
|
||||
# Patch
|
||||
# Remove strlwr, it does not build with mes libc
|
||||
cp util.c util_patched.c
|
||||
sed -i 165,174d util_patched.c
|
||||
|
||||
# Compile
|
||||
tcc -c -DNO_UTIME gzip.c
|
||||
|
@ -18,9 +26,6 @@ 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
|
||||
|
||||
|
@ -32,3 +37,5 @@ cp ${bindir}/gzip ${bindir}/gunzip
|
|||
cp ${bindir}/gzip ${bindir}/zcat
|
||||
chmod 755 ${bindir}/gunzip
|
||||
chmod 755 ${bindir}/zcat
|
||||
|
||||
cd ../..
|
|
@ -1,14 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
set -ex
|
||||
|
||||
/after/bin/patch -Np0 -i ../patches/m4-1.4/m4-signal-include.patch
|
||||
cp ../m4-1.4.mk Makefile
|
||||
/after/bin/make
|
||||
|
||||
# Install
|
||||
/after/bin/cp m4 /after/bin/m4
|
||||
/after/bin/chmod 755 /after/bin/m4
|
||||
|
||||
# Test
|
||||
/after/bin/m4 --version
|
|
@ -0,0 +1,26 @@
|
|||
#!/bin/sh
|
||||
|
||||
set -ex
|
||||
|
||||
cd build
|
||||
|
||||
# Extract
|
||||
gunzip ../src/${pkg}.tar.gz
|
||||
tar xf ../src/${pkg}.tar
|
||||
cd ${pkg}
|
||||
cp ../../mk/main.mk Makefile
|
||||
|
||||
# Patch and prepare
|
||||
patch -Np0 -i ../../patches/signal-include.patch
|
||||
|
||||
# Build
|
||||
make
|
||||
|
||||
# Install
|
||||
cp m4 /after/bin/m4
|
||||
chmod 755 /after/bin/m4
|
||||
|
||||
# Test
|
||||
m4 --version
|
||||
|
||||
cd ../..
|
|
@ -2,14 +2,19 @@
|
|||
|
||||
set -ex
|
||||
|
||||
# Variables
|
||||
bindir=/after/bin
|
||||
cd build
|
||||
|
||||
# Extract
|
||||
gunzip ../src/${pkg}.tar.gz
|
||||
tar xf ../src/${pkg}.tar
|
||||
cd ${pkg}
|
||||
|
||||
# Create .h files
|
||||
catm config.h
|
||||
catm /after/include/mes/config.h
|
||||
|
||||
# Patch
|
||||
patch -Np0 -i ../patches/make-3.80/mes-libc.patch
|
||||
patch -Np0 -i ../../patches/mes-libc.patch
|
||||
|
||||
# Compile
|
||||
tcc -c getopt.c
|
||||
|
@ -44,3 +49,5 @@ tcc -o ${bindir}/make getopt.o getopt1.o ar.o arscan.o commands.o default.o dir.
|
|||
|
||||
# Test
|
||||
make --version
|
||||
|
||||
cd ../..
|
|
@ -3,20 +3,19 @@
|
|||
set -ex
|
||||
|
||||
# Variables
|
||||
prefix=/after
|
||||
MES_ARENA=20000000
|
||||
MES_MAX_ARENA=20000000
|
||||
MES_STACK=6000000
|
||||
MES_PREFIX=${prefix}
|
||||
GUILE_LOAD_PATH=${prefix}/nyacc/module:${prefix}/mes/mes/module
|
||||
bindir=${prefix}/bin
|
||||
MES=${bindir}/mes
|
||||
libdir=${prefix}/mes/lib
|
||||
incdir=${prefix}/include
|
||||
libdir=${prefix}/mes/src/mes/lib
|
||||
|
||||
chmod 755 bin/mescc.scm
|
||||
cp files/mescc.scm ${bindir}/
|
||||
chmod 755 ${bindir}/mescc.scm
|
||||
|
||||
cp files/config.h src/mes/include/mes
|
||||
|
||||
cd src/mes
|
||||
|
||||
cd mes
|
||||
# Bootstrap Mes using M2-Planet
|
||||
kaem --verbose --file kaem.run
|
||||
cp bin/mes-m2 ${MES}
|
||||
|
@ -204,7 +203,7 @@ ${MES} --no-auto-compile -e main ${bindir}/mescc.scm -- -c -D HAVE_CONFIG_H=1 -I
|
|||
# Link everything into new mes executable
|
||||
${MES} --no-auto-compile -e main ${bindir}/mescc.scm -- -L ${libdir} -nostdlib -o ${bindir}/mes-new -L . crt1.o builtins.o cc.o core.o display.o eval-apply.o gc.o hash.o lib.o math.o mes.o module.o posix.o reader.o stack.o string.o struct.o symbol.o vector.o -lc -lmescc
|
||||
|
||||
# Now we finally have the final mes+libraries which we will subsequently use to compile tcc
|
||||
# Now we finally have the final mes+libraries
|
||||
cp ${bindir}/mes-new ${bindir}/mes
|
||||
|
||||
# Install libraries
|
||||
|
@ -263,6 +262,7 @@ cp include/linux/x86/syscall.h ${incdir}/linux/x86/syscall.h
|
|||
|
||||
cp include/mes/builtins.h ${incdir}/mes/builtins.h
|
||||
cp include/mes/cc.h ${incdir}/mes/cc.h
|
||||
catm ${incdir}/mes/config.h
|
||||
cp include/mes/constants.h ${incdir}/mes/constants.h
|
||||
cp include/mes/lib.h ${incdir}/mes/lib.h
|
||||
cp include/mes/lib-mini.h ${incdir}/mes/lib-mini.h
|
||||
|
@ -290,4 +290,4 @@ cp include/sys/wait.h ${incdir}/sys/wait.h
|
|||
libdir=${prefix}/lib
|
||||
${MES} -c "(display 'Hello,Mes!) (newline)"
|
||||
|
||||
cd ..
|
||||
cd ../..
|
9
sysa/mescc-tools-extra/go.kaem → sysa/mescc-tools-extra/mescc-tools-extra.kaem
Normal file → Executable file
9
sysa/mescc-tools-extra/go.kaem → sysa/mescc-tools-extra/mescc-tools-extra.kaem
Normal file → Executable file
|
@ -1,6 +1,9 @@
|
|||
#!/bin/sh
|
||||
|
||||
set -ex
|
||||
|
||||
cd src
|
||||
|
||||
# cp command
|
||||
M2-Planet \
|
||||
-f /M2-Planet/test/common_x86/functions/file.c \
|
||||
|
@ -37,7 +40,7 @@ hex2 \
|
|||
--LittleEndian \
|
||||
--architecture x86 \
|
||||
--BaseAddress 0x8048000 \
|
||||
-o /after/bin/cp \
|
||||
-o ${bindir}/cp \
|
||||
--exec_enable
|
||||
|
||||
# chmod command
|
||||
|
@ -77,5 +80,7 @@ hex2 \
|
|||
--LittleEndian \
|
||||
--architecture x86 \
|
||||
--BaseAddress 0x8048000 \
|
||||
-o /after/bin/chmod \
|
||||
-o ${bindir}/chmod \
|
||||
--exec_enable
|
||||
|
||||
cd ..
|
|
@ -1 +0,0 @@
|
|||
Subproject commit 5768b2a79036f34b9bd420ab4801ad7dca15dff8
|
|
@ -0,0 +1 @@
|
|||
Subproject commit 3f5b7588a20bc2225f25a31eed53a8152563955f
|
|
@ -2,8 +2,12 @@
|
|||
|
||||
set -ex
|
||||
|
||||
# Variables
|
||||
bindir=/after/bin
|
||||
cd build
|
||||
|
||||
# Extract
|
||||
gunzip ../src/${pkg}.tar.gz
|
||||
tar xf ../src/${pkg}.tar
|
||||
cd ${pkg}
|
||||
|
||||
# Create config.h and patchlevel.h
|
||||
catm config.h
|
||||
|
@ -39,3 +43,5 @@ tcc -static -o ${bindir}/patch error.o getopt.o getopt1.o addext.o argmatch.o ba
|
|||
|
||||
# Test
|
||||
patch --version
|
||||
|
||||
cd ../..
|
|
@ -2,9 +2,9 @@
|
|||
|
||||
set -ex
|
||||
|
||||
# Variables
|
||||
bindir=/after/bin
|
||||
cd src
|
||||
|
||||
# Create config.h
|
||||
catm config.h
|
||||
|
||||
# Compile
|
||||
|
@ -37,3 +37,5 @@ tcc -static -o ${bindir}/sed -L lib lib/libsed.a compile.o execute.o regex.o fmt
|
|||
|
||||
# Test
|
||||
sed --version
|
||||
|
||||
cd ..
|
|
@ -2,8 +2,7 @@
|
|||
|
||||
set -ex
|
||||
|
||||
# Variables
|
||||
bindir=/after/bin
|
||||
cd src
|
||||
|
||||
# Compile
|
||||
|
||||
|
@ -50,3 +49,5 @@ 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_patched.o update.o -ltar
|
||||
|
||||
cd ..
|
|
@ -0,0 +1 @@
|
|||
Subproject commit 22d37adeef22c184a113daec4bf06536ea099e6a
|
File diff suppressed because one or more lines are too long
|
@ -0,0 +1 @@
|
|||
Subproject commit 22d37adeef22c184a113daec4bf06536ea099e6a
|
File diff suppressed because one or more lines are too long
|
@ -2,18 +2,15 @@
|
|||
|
||||
set -ex
|
||||
|
||||
# Vars
|
||||
prefix=/after
|
||||
libdir=${prefix}/lib
|
||||
bindir=${prefix}/bin
|
||||
cd src/tcc-0.9.27
|
||||
|
||||
# Patch
|
||||
patch -Np0 -i ../patches/tcc/static-link.patch
|
||||
patch -Np0 -i ../../patches/static-link.patch
|
||||
|
||||
# Compile
|
||||
## We have to use 0.9.26 to recompile 0.9.27, 0.9.27 is not self-hosting for
|
||||
## whatever reason.
|
||||
boot5-tcc \
|
||||
tcc-0.9.26 \
|
||||
-v \
|
||||
-static \
|
||||
-o ${bindir}/tcc \
|
||||
|
@ -32,3 +29,5 @@ boot5-tcc \
|
|||
|
||||
# Test
|
||||
tcc -version
|
||||
|
||||
cd ../..
|
Loading…
Reference in New Issue