mirror of
https://github.com/fosslinux/live-bootstrap.git
synced 2026-03-02 01:18:08 +01:00
Restructure
This commit is contained in:
parent
e5cbaa9e04
commit
5a369dc783
77 changed files with 419 additions and 295 deletions
38
.gitmodules
vendored
38
.gitmodules
vendored
|
|
@ -1,27 +1,33 @@
|
||||||
[submodule "mescc-tools-seed"]
|
[submodule "sysa/mescc-tools-seed/src/mescc-tools-seed"]
|
||||||
path = sysa/mescc-tools-seed
|
path = sysa/mescc-tools-seed/src/mescc-tools-seed
|
||||||
url = https://github.com/oriansj/mescc-tools-seed/
|
url = https://github.com/oriansj/mescc-tools-seed/
|
||||||
[submodule "bootstrap-seeds"]
|
[submodule "bootstrap-seeds"]
|
||||||
path = bootstrap-seeds
|
path = sysa/bootstrap-seeds
|
||||||
url = https://github.com/oriansj/bootstrap-seeds
|
url = https://github.com/oriansj/bootstrap-seeds
|
||||||
[submodule "blynn-compiler-oriansj"]
|
[submodule "sysa/blynn-compiler/src"]
|
||||||
path = sysa/blynn-compiler-oriansj
|
path = sysa/blynn-compiler/src
|
||||||
url = https://github.com/oriansj/blynn-compiler
|
url = https://github.com/oriansj/blynn-compiler
|
||||||
[submodule "sysa/mes"]
|
[submodule "sysa/mes/src/mes"]
|
||||||
path = sysa/mes
|
path = sysa/mes/src/mes
|
||||||
url = https://gitlab.com/janneke/mes.git
|
url = https://gitlab.com/janneke/mes.git
|
||||||
[submodule "sysa/nyacc"]
|
[submodule "sysa/mes/src/nyacc"]
|
||||||
path = sysa/nyacc
|
path = sysa/mes/src/nyacc
|
||||||
url = https://git.savannah.gnu.org/git/nyacc.git
|
url = https://git.savannah.gnu.org/git/nyacc.git
|
||||||
[submodule "sysa/tcc-0.9.26p1"]
|
[submodule "sysa/tcc-0.9.26/src/tcc-0.9.26"]
|
||||||
path = sysa/tcc-0.9.26
|
path = sysa/tcc-0.9.26/src/tcc-0.9.26
|
||||||
url = https://gitlab.com/janneke/tinycc
|
url = https://gitlab.com/janneke/tinycc
|
||||||
[submodule "sysa/mescc-tools-patched"]
|
[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
|
url = https://github.com/oriansj/mescc-tools
|
||||||
[submodule "sysa/tcc-0.9.27"]
|
[submodule "sysa/tcc-0.9.27/src/tcc-0.9.27"]
|
||||||
path = sysa/tcc-0.9.27
|
path = sysa/tcc-0.9.27/src/tcc-0.9.27
|
||||||
url = git://repo.or.cz/tinycc.git
|
url = git://repo.or.cz/tinycc.git
|
||||||
[submodule "sysa/sed-4.0.7"]
|
[submodule "sysa/sed-4.0.7/src"]
|
||||||
path = sysa/sed-4.0.7
|
path = sysa/sed-4.0.7/src
|
||||||
url = https://git.savannah.gnu.org/git/sed/sed-history.git
|
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
|
||||||
|
|
|
||||||
45
DEVEL.md
Normal file
45
DEVEL.md
Normal file
|
|
@ -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
|
# base: mescc-tools-seed
|
||||||
# copy in all the mescc-tools-seed stuff
|
# copy in all the mescc-tools-seed stuff
|
||||||
cp -r mescc-tools-seed/x86/* tmp
|
cp -r mescc-tools-seed/src/mescc-tools-seed/x86/* tmp
|
||||||
cp -r mescc-tools-seed/{M2-Planet,mes-m2} tmp/
|
cp -r mescc-tools-seed/src/mescc-tools-seed/{M2-Planet,mes-m2} tmp/
|
||||||
cp -r mescc-tools-patched tmp/mescc-tools
|
cp -r mescc-tools-seed/src/mescc-tools-patched tmp/mescc-tools
|
||||||
# and the kaem seed
|
# and the kaem seed
|
||||||
cp ../bootstrap-seeds/POSIX/x86/kaem-optional-seed tmp/init
|
cp bootstrap-seeds/POSIX/x86/kaem-optional-seed tmp/init
|
||||||
cp ../bootstrap-seeds/POSIX/x86/kaem-optional-seed tmp/
|
cp bootstrap-seeds/POSIX/x86/kaem-optional-seed tmp/
|
||||||
cp -r ../bootstrap-seeds tmp/
|
cp -r bootstrap-seeds tmp/
|
||||||
# replace the init kaem with our own custom one
|
# replace the init kaem with our own custom one
|
||||||
mv tmp/kaem.run tmp/mescc-tools-seed.kaem.run
|
mv tmp/kaem.run tmp/mescc-tools-seed.kaem.run
|
||||||
cp base.kaem.run tmp/kaem.run
|
cp base.kaem.run tmp/kaem.run
|
||||||
|
|
@ -40,49 +40,34 @@ mkdir -p tmp/tmp
|
||||||
cp after.kaem tmp/
|
cp after.kaem tmp/
|
||||||
cp after.kaem.run tmp/after/kaem.run
|
cp after.kaem.run tmp/after/kaem.run
|
||||||
|
|
||||||
# Copy in all of the patches
|
|
||||||
cp -r patches tmp/after/
|
|
||||||
|
|
||||||
# mescc-tools-extra
|
# mescc-tools-extra
|
||||||
cp -r mescc-tools-extra tmp/after/
|
cp -r mescc-tools-extra tmp/after/
|
||||||
|
|
||||||
# blynn-compiler
|
# blynn-compiler
|
||||||
pushd tmp/after
|
cp -r blynn-compiler tmp/after/
|
||||||
git clone ../../blynn-compiler-oriansj blynn-compiler
|
mkdir -p tmp/after/blynn-compiler/src/{bin,generated}
|
||||||
cp ../../blynn-compiler.kaem blynn-compiler/go.kaem
|
|
||||||
mkdir -p blynn-compiler/{bin,generated}
|
|
||||||
popd
|
|
||||||
|
|
||||||
# mes
|
# mes
|
||||||
cp -r mes tmp/after/
|
cp -r mes tmp/after/
|
||||||
cp -r mes tmp/after/tcc-mes
|
#ln -s lib/x86-mes tmp/after/mes/src/mes/x86-mes
|
||||||
ln -s lib/x86-mes tmp/after/mes/x86-mes
|
mkdir -p tmp/after/mes/src/mes/{bin,m2}
|
||||||
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}
|
|
||||||
|
|
||||||
# tcc
|
# tcc 0.9.26
|
||||||
cp tcc.kaem tmp/after/
|
|
||||||
cp -r tcc-0.9.26 tmp/after/
|
cp -r tcc-0.9.26 tmp/after/
|
||||||
cp -r tcc-0.9.27 tmp/after/
|
pushd tmp/after/tcc-0.9.26/src/tcc-0.9.26
|
||||||
pushd tmp/after/tcc-0.9.26
|
|
||||||
ln -s ../mes/module .
|
ln -s ../mes/module .
|
||||||
ln -s ../mes/mes .
|
ln -s ../mes/mes .
|
||||||
ln -s /after/lib x86-mes
|
ln -s /after/lib x86-mes
|
||||||
ln -s /after/lib/linux .
|
ln -s /after/lib/linux .
|
||||||
popd
|
popd
|
||||||
|
|
||||||
mkdir -p ../sources
|
# tcc 0.9.27
|
||||||
|
cp -r tcc-0.9.27 tmp/after/
|
||||||
|
|
||||||
# sed 4.0.7
|
# sed 4.0.7
|
||||||
cp sed-4.0.7.kaem tmp/after/
|
|
||||||
cp -r sed-4.0.7 tmp/after/
|
cp -r sed-4.0.7 tmp/after/
|
||||||
|
|
||||||
# tcc patched
|
mkdir -p ../sources
|
||||||
cp tcc-patched.kaem tmp/after/
|
|
||||||
|
|
||||||
# tar 1.12
|
# tar 1.12
|
||||||
url=https://ftp.gnu.org/gnu/tar/tar-1.12.tar.gz
|
url=https://ftp.gnu.org/gnu/tar/tar-1.12.tar.gz
|
||||||
|
|
@ -91,8 +76,8 @@ if [ ! -f "$(basename $url)" ]; then
|
||||||
wget "$url"
|
wget "$url"
|
||||||
fi
|
fi
|
||||||
popd
|
popd
|
||||||
cp "$(basename $url .tar.gz).kaem" tmp/after
|
cp -r tar-1.12 tmp/after
|
||||||
tar -C tmp/after -xf "../sources/$(basename $url)"
|
tar -C tmp/after/tar-1.12/src -xf "../sources/$(basename $url)" --strip-components=1
|
||||||
|
|
||||||
get_file() {
|
get_file() {
|
||||||
url=$1
|
url=$1
|
||||||
|
|
@ -103,16 +88,12 @@ get_file() {
|
||||||
popd
|
popd
|
||||||
ext="${url##*.}"
|
ext="${url##*.}"
|
||||||
if [ "$ext" = "tar" ]; then
|
if [ "$ext" = "tar" ]; then
|
||||||
bname=$(basename "$url" ".tar")
|
bname=$(basename "$url" ".tar")
|
||||||
else
|
else
|
||||||
bname=$(basename "$url" ".tar.${ext}")
|
bname=$(basename "$url" ".tar.${ext}")
|
||||||
fi
|
fi
|
||||||
for file in "${bname}."*; do
|
cp -r "${bname}" tmp/after/
|
||||||
if [ -f "${file}" ]; then
|
cp "../sources/$(basename "$url")" "tmp/after/${bname}/src/"
|
||||||
cp "${file}" tmp/after
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
cp "../sources/$(basename "$url")" tmp/after
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# gzip 1.2.4
|
# 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
|
# patch 2.5.9
|
||||||
get_file https://ftp.gnu.org/pub/gnu/patch/patch-2.5.9.tar.gz
|
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
|
# make 3.80
|
||||||
get_file https://ftp.gnu.org/gnu/make/make-3.80.tar.gz
|
get_file https://ftp.gnu.org/gnu/make/make-3.80.tar.gz
|
||||||
|
|
||||||
|
|
|
||||||
0
sources/.placeholder
Normal file
0
sources/.placeholder
Normal file
|
|
@ -18,5 +18,7 @@
|
||||||
|
|
||||||
cd after
|
cd after
|
||||||
|
|
||||||
|
PATH=/after/bin:/bin
|
||||||
|
|
||||||
# Finally, reinvoke kaem in this directory
|
# Finally, reinvoke kaem in this directory
|
||||||
../bin/kaem --file kaem.run
|
../bin/kaem --file kaem.run
|
||||||
|
|
|
||||||
|
|
@ -20,92 +20,112 @@ set -ex
|
||||||
|
|
||||||
PATH=/after/bin:/bin
|
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)
|
# Part 2: cp and chown (mescc-tools-extra)
|
||||||
cd mescc-tools-extra
|
pkg="mescc-tools-extra"
|
||||||
kaem --file go.kaem
|
cd ${pkg}
|
||||||
|
kaem --file ${pkg}.kaem
|
||||||
cd ..
|
cd ..
|
||||||
|
|
||||||
# Part 3: Remove remaining dependencies on / (root of /after)
|
# Part 3: Remove remaining dependencies on / (root of /after)
|
||||||
/after/bin/cp ../bin/hex2 bin/hex2
|
cp ../bin/hex2 bin/hex2
|
||||||
/after/bin/cp ../bin/M1 bin/M1
|
cp ../bin/M1 bin/M1
|
||||||
/after/bin/cp ../bin/M2-Planet bin/M2-Planet
|
cp ../bin/M2-Planet bin/M2-Planet
|
||||||
/after/bin/cp ../bin/blood-elf bin/blood-elf
|
cp ../bin/blood-elf bin/blood-elf
|
||||||
/after/bin/cp ../bin/get_machine bin/get_machine
|
cp ../bin/get_machine bin/get_machine
|
||||||
/after/bin/cp ../bin/mes-m2 bin/mes-m2
|
cp ../bin/mes-m2 bin/mes-m2
|
||||||
/after/bin/cp ../bin/kaem bin/kaem
|
cp ../bin/kaem bin/kaem
|
||||||
/after/bin/cp ../catm bin/catm
|
cp ../catm bin/catm
|
||||||
/after/bin/chmod 755 bin/hex2 bin/M1 bin/M2-Planet bin/blood-elf \
|
chmod 755 bin/hex2 bin/M1 bin/M2-Planet bin/blood-elf \
|
||||||
bin/get_machine bin/mes-m2 bin/kaem bin/catm
|
bin/get_machine bin/mes-m2 bin/kaem bin/catm
|
||||||
|
PATH=/after/bin
|
||||||
|
|
||||||
# Part 4: blynn-compiler
|
# Part 4: blynn-compiler
|
||||||
cd blynn-compiler
|
pkg="blynn-compiler"
|
||||||
kaem --file go.kaem
|
cd ${pkg}
|
||||||
|
kaem --file ${pkg}.kaem
|
||||||
cd ..
|
cd ..
|
||||||
|
|
||||||
# Part 5: mes
|
# Part 5: mes
|
||||||
kaem --file mes.kaem
|
pkg="mes"
|
||||||
|
cd ${pkg}
|
||||||
|
kaem --file ${pkg}.kaem
|
||||||
|
cd ..
|
||||||
|
|
||||||
# Part 6: tcc
|
# Part 6: tcc 0.9.26
|
||||||
kaem --file tcc.kaem
|
pkg="tcc-0.9.26"
|
||||||
|
cd ${pkg}
|
||||||
|
kaem --file ${pkg}.kaem
|
||||||
|
cd ..
|
||||||
|
|
||||||
# Part 7: sed
|
# Part 7: tcc 0.9.27
|
||||||
cd sed-4.0.7
|
pkg="tcc-0.9.27"
|
||||||
kaem --file ../sed-4.0.7.kaem
|
cd ${pkg}
|
||||||
|
kaem --file ${pkg}.kaem
|
||||||
|
cd ..
|
||||||
|
|
||||||
|
# Part 8: sed
|
||||||
|
pkg="sed-4.0.7"
|
||||||
|
cd ${pkg}
|
||||||
|
kaem --file ${pkg}.kaem
|
||||||
cd ..
|
cd ..
|
||||||
|
|
||||||
# Part 8: tar
|
# Part 8: tar
|
||||||
cd tar-1.12
|
pkg="tar-1.12"
|
||||||
kaem --file ../tar-1.12.kaem
|
cd ${pkg}
|
||||||
|
kaem --file ${pkg}.kaem
|
||||||
cd ..
|
cd ..
|
||||||
|
|
||||||
# Part 9: gzip
|
# Part 9: gzip
|
||||||
/after/bin/tar xf gzip-1.2.4.tar
|
pkg="gzip-1.2.4"
|
||||||
cd gzip-1.2.4
|
cd ${pkg}
|
||||||
kaem --file ../gzip-1.2.4.kaem
|
kaem --file ${pkg}.kaem
|
||||||
cd ..
|
cd ..
|
||||||
|
|
||||||
# Part 10: diffutils
|
# Part 10: diffutils
|
||||||
/after/bin/gunzip diffutils-2.7.tar.gz
|
pkg="diffutils-2.7"
|
||||||
/after/bin/tar xf diffutils-2.7.tar
|
cd ${pkg}
|
||||||
cd diffutils-2.7
|
kaem --file ${pkg}.kaem
|
||||||
kaem --file ../diffutils-2.7.kaem
|
|
||||||
cd ..
|
cd ..
|
||||||
|
|
||||||
# Part 11: patch
|
# Part 11: patch
|
||||||
/after/bin/gunzip patch-2.5.9.tar.gz
|
pkg="patch-2.5.9"
|
||||||
/after/bin/tar xf patch-2.5.9.tar
|
cd ${pkg}
|
||||||
cd patch-2.5.9
|
kaem --file ${pkg}.kaem
|
||||||
kaem --file ../patch-2.5.9.kaem
|
|
||||||
cd ..
|
cd ..
|
||||||
|
|
||||||
# Part 12: tcc-patched
|
# Part 12: tcc-patched
|
||||||
cd tcc-0.9.27
|
cd tcc-0.9.27
|
||||||
kaem --file ../tcc-patched.kaem
|
kaem --file tcc-patched.kaem
|
||||||
cd ..
|
cd ..
|
||||||
|
|
||||||
# Part 13: make
|
# Part 13: make
|
||||||
/after/bin/gunzip make-3.80.tar.gz
|
pkg="make-3.80"
|
||||||
/after/bin/tar xf make-3.80.tar
|
cd ${pkg}
|
||||||
cd make-3.80
|
kaem --file ${pkg}.kaem
|
||||||
kaem --file ../make-3.80.kaem
|
|
||||||
cd ..
|
cd ..
|
||||||
|
|
||||||
# Part 14: bzip2
|
# Part 14: bzip2
|
||||||
/after/bin/gunzip bzip2-1.0.8.tar.gz
|
pkg="bzip2-1.0.8"
|
||||||
/after/bin/tar xf bzip2-1.0.8.tar
|
cd ${pkg}
|
||||||
cd bzip2-1.0.8
|
kaem --file ${pkg}.kaem
|
||||||
kaem --file ../bzip2-1.0.8.kaem
|
|
||||||
cd ..
|
cd ..
|
||||||
|
|
||||||
# Part 15: bash
|
# Part 15: bash
|
||||||
/after/bin/gunzip bash-2.05b.tar.gz
|
pkg="bash-2.05b"
|
||||||
/after/bin/tar xf bash-2.05b.tar
|
cd ${pkg}
|
||||||
cd bash-2.05b
|
kaem --file ${pkg}.kaem
|
||||||
kaem --file ../bash-2.05b.kaem
|
|
||||||
cd ..
|
cd ..
|
||||||
|
|
||||||
# Part 16: m4
|
# Part 16: m4
|
||||||
/after/bin/gunzip m4-1.4.tar.gz
|
pkg="m4-1.4"
|
||||||
/after/bin/tar xf m4-1.4.tar
|
cd ${pkg}
|
||||||
cd m4-1.4
|
kaem --file ${pkg}.kaem
|
||||||
kaem --file ../m4-1.4.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
|
|
||||||
38
sysa/bash-2.05b/bash-2.05b.kaem
Executable file
38
sysa/bash-2.05b/bash-2.05b.kaem
Executable file
|
|
@ -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 ../..
|
||||||
0
sysa/bash-2.05b/build/.placeholder
Normal file
0
sysa/bash-2.05b/build/.placeholder
Normal file
0
sysa/bash-2.05b/src/.placeholder
Normal file
0
sysa/bash-2.05b/src/.placeholder
Normal file
|
|
@ -1,6 +1,8 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
set -ex
|
set -ex
|
||||||
|
|
||||||
PATH=/bin
|
cd src
|
||||||
|
|
||||||
# compile pack_blobs.c
|
# compile pack_blobs.c
|
||||||
M2-Planet --architecture x86 \
|
M2-Planet --architecture x86 \
|
||||||
|
|
@ -246,3 +248,8 @@ hex2 -f test/common_x86/ELF-i386-debug.hex2 \
|
||||||
--architecture x86 \
|
--architecture x86 \
|
||||||
--BaseAddress 0x8048000 \
|
--BaseAddress 0x8048000 \
|
||||||
-o bin/precisely --exec_enable
|
-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
sysa/bzip2-1.0.8/build/.placeholder
Normal file
0
sysa/bzip2-1.0.8/build/.placeholder
Normal file
26
sysa/bzip2-1.0.8/bzip2-1.0.8.kaem
Executable file
26
sysa/bzip2-1.0.8/bzip2-1.0.8.kaem
Executable file
|
|
@ -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
|
diff -r -N -U3 bzip2-1.0.8/Makefile bzip2-1.0.8/Makefile
|
||||||
--- Makefile 2019-07-13 18:50:05.000000000 +0100
|
--- Makefile 2019-07-13 18:50:05.000000000 +0100
|
||||||
+++ Makefile 2021-01-14 15:45:17.558516299 +0000
|
+++ 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
|
$(CC) $(CFLAGS) -c blocksort.c
|
||||||
huffman.o: huffman.c
|
huffman.o: huffman.c
|
||||||
$(CC) $(CFLAGS) -c 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
|
|
||||||
23
sysa/bzip2-1.0.8/patches/mes-libc.patch
Normal file
23
sysa/bzip2-1.0.8/patches/mes-libc.patch
Normal file
|
|
@ -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
|
||||||
0
sysa/bzip2-1.0.8/src/.placeholder
Normal file
0
sysa/bzip2-1.0.8/src/.placeholder
Normal file
0
sysa/diffutils-2.7/build/.placeholder
Normal file
0
sysa/diffutils-2.7/build/.placeholder
Normal file
|
|
@ -2,8 +2,12 @@
|
||||||
|
|
||||||
set -ex
|
set -ex
|
||||||
|
|
||||||
# Variables
|
cd build
|
||||||
bindir=/after/bin
|
|
||||||
|
# Extract
|
||||||
|
gunzip ../src/${pkg}.tar.gz
|
||||||
|
tar xf ../src/${pkg}.tar
|
||||||
|
cd ${pkg}
|
||||||
|
|
||||||
# Touch config.h file
|
# Touch config.h file
|
||||||
catm config.h
|
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
|
# Test
|
||||||
cmp --version
|
cmp --version
|
||||||
diff --version
|
diff --version
|
||||||
|
|
||||||
|
cd ../..
|
||||||
0
sysa/diffutils-2.7/src/.placeholder
Normal file
0
sysa/diffutils-2.7/src/.placeholder
Normal file
0
sysa/gzip-1.2.4/build/.placeholder
Normal file
0
sysa/gzip-1.2.4/build/.placeholder
Normal file
|
|
@ -2,8 +2,16 @@
|
||||||
|
|
||||||
set -ex
|
set -ex
|
||||||
|
|
||||||
# Variables
|
cd build
|
||||||
bindir=/after/bin
|
|
||||||
|
# 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
|
# Compile
|
||||||
tcc -c -DNO_UTIME gzip.c
|
tcc -c -DNO_UTIME gzip.c
|
||||||
|
|
@ -18,9 +26,6 @@ tcc -c unlzh.c
|
||||||
tcc -c unlzw.c
|
tcc -c unlzw.c
|
||||||
tcc -c unpack.c
|
tcc -c unpack.c
|
||||||
tcc -c unzip.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 util_patched.c
|
||||||
tcc -c zip.c
|
tcc -c zip.c
|
||||||
|
|
||||||
|
|
@ -32,3 +37,5 @@ cp ${bindir}/gzip ${bindir}/gunzip
|
||||||
cp ${bindir}/gzip ${bindir}/zcat
|
cp ${bindir}/gzip ${bindir}/zcat
|
||||||
chmod 755 ${bindir}/gunzip
|
chmod 755 ${bindir}/gunzip
|
||||||
chmod 755 ${bindir}/zcat
|
chmod 755 ${bindir}/zcat
|
||||||
|
|
||||||
|
cd ../..
|
||||||
0
sysa/gzip-1.2.4/src/.placeholder
Normal file
0
sysa/gzip-1.2.4/src/.placeholder
Normal file
|
|
@ -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
sysa/m4-1.4/build/.placeholder
Normal file
0
sysa/m4-1.4/build/.placeholder
Normal file
26
sysa/m4-1.4/m4-1.4.kaem
Executable file
26
sysa/m4-1.4/m4-1.4.kaem
Executable file
|
|
@ -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 ../..
|
||||||
0
sysa/m4-1.4/src/.placeholder
Normal file
0
sysa/m4-1.4/src/.placeholder
Normal file
0
sysa/make-3.80/build/.placeholder
Normal file
0
sysa/make-3.80/build/.placeholder
Normal file
|
|
@ -2,14 +2,19 @@
|
||||||
|
|
||||||
set -ex
|
set -ex
|
||||||
|
|
||||||
# Variables
|
cd build
|
||||||
bindir=/after/bin
|
|
||||||
|
|
||||||
|
# Extract
|
||||||
|
gunzip ../src/${pkg}.tar.gz
|
||||||
|
tar xf ../src/${pkg}.tar
|
||||||
|
cd ${pkg}
|
||||||
|
|
||||||
|
# Create .h files
|
||||||
catm config.h
|
catm config.h
|
||||||
catm /after/include/mes/config.h
|
catm /after/include/mes/config.h
|
||||||
|
|
||||||
# Patch
|
# Patch
|
||||||
patch -Np0 -i ../patches/make-3.80/mes-libc.patch
|
patch -Np0 -i ../../patches/mes-libc.patch
|
||||||
|
|
||||||
# Compile
|
# Compile
|
||||||
tcc -c getopt.c
|
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
|
# Test
|
||||||
make --version
|
make --version
|
||||||
|
|
||||||
|
cd ../..
|
||||||
0
sysa/make-3.80/src/.placeholder
Normal file
0
sysa/make-3.80/src/.placeholder
Normal file
|
|
@ -3,20 +3,19 @@
|
||||||
set -ex
|
set -ex
|
||||||
|
|
||||||
# Variables
|
# Variables
|
||||||
prefix=/after
|
|
||||||
MES_ARENA=20000000
|
MES_ARENA=20000000
|
||||||
MES_MAX_ARENA=20000000
|
MES_MAX_ARENA=20000000
|
||||||
MES_STACK=6000000
|
MES_STACK=6000000
|
||||||
MES_PREFIX=${prefix}
|
|
||||||
GUILE_LOAD_PATH=${prefix}/nyacc/module:${prefix}/mes/mes/module
|
|
||||||
bindir=${prefix}/bin
|
|
||||||
MES=${bindir}/mes
|
MES=${bindir}/mes
|
||||||
libdir=${prefix}/mes/lib
|
libdir=${prefix}/mes/src/mes/lib
|
||||||
incdir=${prefix}/include
|
|
||||||
|
|
||||||
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
|
# Bootstrap Mes using M2-Planet
|
||||||
kaem --verbose --file kaem.run
|
kaem --verbose --file kaem.run
|
||||||
cp bin/mes-m2 ${MES}
|
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
|
# 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
|
${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
|
cp ${bindir}/mes-new ${bindir}/mes
|
||||||
|
|
||||||
# Install libraries
|
# 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/builtins.h ${incdir}/mes/builtins.h
|
||||||
cp include/mes/cc.h ${incdir}/mes/cc.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/constants.h ${incdir}/mes/constants.h
|
||||||
cp include/mes/lib.h ${incdir}/mes/lib.h
|
cp include/mes/lib.h ${incdir}/mes/lib.h
|
||||||
cp include/mes/lib-mini.h ${incdir}/mes/lib-mini.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
|
libdir=${prefix}/lib
|
||||||
${MES} -c "(display 'Hello,Mes!) (newline)"
|
${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
|
#!/bin/sh
|
||||||
|
|
||||||
set -ex
|
set -ex
|
||||||
|
|
||||||
|
cd src
|
||||||
|
|
||||||
# cp command
|
# cp command
|
||||||
M2-Planet \
|
M2-Planet \
|
||||||
-f /M2-Planet/test/common_x86/functions/file.c \
|
-f /M2-Planet/test/common_x86/functions/file.c \
|
||||||
|
|
@ -37,7 +40,7 @@ hex2 \
|
||||||
--LittleEndian \
|
--LittleEndian \
|
||||||
--architecture x86 \
|
--architecture x86 \
|
||||||
--BaseAddress 0x8048000 \
|
--BaseAddress 0x8048000 \
|
||||||
-o /after/bin/cp \
|
-o ${bindir}/cp \
|
||||||
--exec_enable
|
--exec_enable
|
||||||
|
|
||||||
# chmod command
|
# chmod command
|
||||||
|
|
@ -77,5 +80,7 @@ hex2 \
|
||||||
--LittleEndian \
|
--LittleEndian \
|
||||||
--architecture x86 \
|
--architecture x86 \
|
||||||
--BaseAddress 0x8048000 \
|
--BaseAddress 0x8048000 \
|
||||||
-o /after/bin/chmod \
|
-o ${bindir}/chmod \
|
||||||
--exec_enable
|
--exec_enable
|
||||||
|
|
||||||
|
cd ..
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
Subproject commit 5768b2a79036f34b9bd420ab4801ad7dca15dff8
|
|
||||||
1
sysa/mescc-tools-seed/src/mescc-tools-patched
Submodule
1
sysa/mescc-tools-seed/src/mescc-tools-patched
Submodule
|
|
@ -0,0 +1 @@
|
||||||
|
Subproject commit 3f5b7588a20bc2225f25a31eed53a8152563955f
|
||||||
0
sysa/patch-2.5.9/build/.placeholder
Normal file
0
sysa/patch-2.5.9/build/.placeholder
Normal file
|
|
@ -2,8 +2,12 @@
|
||||||
|
|
||||||
set -ex
|
set -ex
|
||||||
|
|
||||||
# Variables
|
cd build
|
||||||
bindir=/after/bin
|
|
||||||
|
# Extract
|
||||||
|
gunzip ../src/${pkg}.tar.gz
|
||||||
|
tar xf ../src/${pkg}.tar
|
||||||
|
cd ${pkg}
|
||||||
|
|
||||||
# Create config.h and patchlevel.h
|
# Create config.h and patchlevel.h
|
||||||
catm config.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
|
# Test
|
||||||
patch --version
|
patch --version
|
||||||
|
|
||||||
|
cd ../..
|
||||||
0
sysa/patch-2.5.9/src/.placeholder
Normal file
0
sysa/patch-2.5.9/src/.placeholder
Normal file
|
|
@ -2,9 +2,9 @@
|
||||||
|
|
||||||
set -ex
|
set -ex
|
||||||
|
|
||||||
# Variables
|
cd src
|
||||||
bindir=/after/bin
|
|
||||||
|
|
||||||
|
# Create config.h
|
||||||
catm config.h
|
catm config.h
|
||||||
|
|
||||||
# Compile
|
# Compile
|
||||||
|
|
@ -37,3 +37,5 @@ tcc -static -o ${bindir}/sed -L lib lib/libsed.a compile.o execute.o regex.o fmt
|
||||||
|
|
||||||
# Test
|
# Test
|
||||||
sed --version
|
sed --version
|
||||||
|
|
||||||
|
cd ..
|
||||||
0
sysa/tar-1.12/src/.placeholder
Normal file
0
sysa/tar-1.12/src/.placeholder
Normal file
|
|
@ -2,8 +2,7 @@
|
||||||
|
|
||||||
set -ex
|
set -ex
|
||||||
|
|
||||||
# Variables
|
cd src
|
||||||
bindir=/after/bin
|
|
||||||
|
|
||||||
# Compile
|
# Compile
|
||||||
|
|
||||||
|
|
@ -50,3 +49,5 @@ tcc -c -I lib -DSIZEOF_UNSIGNED_LONG=4 -DHAVE_FCNTL_H src/update.c
|
||||||
|
|
||||||
# Link
|
# 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
|
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 ..
|
||||||
1
sysa/tcc-0.9.26/src/mes-libc
Submodule
1
sysa/tcc-0.9.26/src/mes-libc
Submodule
|
|
@ -0,0 +1 @@
|
||||||
|
Subproject commit 22d37adeef22c184a113daec4bf06536ea099e6a
|
||||||
|
|
@ -3,11 +3,6 @@
|
||||||
set -ex
|
set -ex
|
||||||
|
|
||||||
# Vars
|
# Vars
|
||||||
prefix=/after
|
|
||||||
bindir=${prefix}/bin
|
|
||||||
libdir=${prefix}/lib
|
|
||||||
GUILE_LOAD_PATH=${prefix}/nyacc/module:${prefix}/mes/mes/module
|
|
||||||
MES_PREFIX=${prefix}/mes
|
|
||||||
MES_STACK=15000000
|
MES_STACK=15000000
|
||||||
MES_ARENA=30000000
|
MES_ARENA=30000000
|
||||||
MES_MAX_ARENA=30000000
|
MES_MAX_ARENA=30000000
|
||||||
|
|
@ -15,8 +10,7 @@ MES_LIB=${MES_PREFIX}/lib
|
||||||
MES_SOURCE=${MES_PREFIX}
|
MES_SOURCE=${MES_PREFIX}
|
||||||
MES=${bindir}/mes
|
MES=${bindir}/mes
|
||||||
|
|
||||||
# Initial tcc
|
cd src/tcc-0.9.26
|
||||||
cd tcc-0.9.26
|
|
||||||
|
|
||||||
# Create config.h
|
# Create config.h
|
||||||
catm config.h
|
catm config.h
|
||||||
|
|
@ -24,8 +18,7 @@ catm config.h
|
||||||
${MES} --no-auto-compile -e main ${bindir}/mescc.scm -- \
|
${MES} --no-auto-compile -e main ${bindir}/mescc.scm -- \
|
||||||
-S \
|
-S \
|
||||||
-o tcc.s \
|
-o tcc.s \
|
||||||
-I ${prefix}/mes/lib \
|
-I ${incdir} \
|
||||||
-I ${prefix}/mes/include \
|
|
||||||
-D BOOTSTRAP=1 \
|
-D BOOTSTRAP=1 \
|
||||||
-I . \
|
-I . \
|
||||||
-D TCC_TARGET_I386=1 \
|
-D TCC_TARGET_I386=1 \
|
||||||
|
|
@ -56,7 +49,7 @@ chmod 755 ${bindir}/mes-tcc
|
||||||
mes-tcc -version
|
mes-tcc -version
|
||||||
|
|
||||||
# Recompile the mes C library
|
# Recompile the mes C library
|
||||||
cd ../tcc-mes
|
cd ../mes-libc
|
||||||
|
|
||||||
# Create unified libc files
|
# Create unified libc files
|
||||||
catm unified-libc-1.c lib/mes/eputs.c lib/mes/oputs.c lib/mes/globals.c lib/stdlib/exit.c lib/linux/x86-mes-gcc/_exit.c lib/linux/x86-mes-gcc/_write.c lib/stdlib/puts.c lib/string/strlen.c lib/ctype/isnumber.c lib/mes/abtol.c lib/mes/cast.c lib/mes/eputc.c lib/mes/fdgetc.c lib/mes/fdputc.c lib/mes/fdputs.c lib/mes/fdungetc.c lib/mes/itoa.c lib/mes/ltoa.c lib/mes/ltoab.c lib/mes/mes_open.c lib/mes/ntoab.c lib/mes/oputc.c lib/mes/ultoa.c lib/mes/utoa.c lib/ctype/isdigit.c lib/ctype/isspace.c lib/ctype/isxdigit.c lib/mes/assert_msg.c lib/posix/write.c lib/stdlib/atoi.c lib/linux/lseek.c lib/mes/__assert_fail.c lib/mes/__buffered_read.c lib/mes/__mes_debug.c lib/posix/execv.c lib/posix/getcwd.c lib/posix/getenv.c lib/posix/isatty.c lib/posix/open.c lib/posix/buffered-read.c lib/posix/setenv.c lib/posix/wait.c lib/stdio/fgetc.c lib/stdio/fputc.c lib/stdio/fputs.c lib/stdio/getc.c lib/stdio/getchar.c lib/stdio/putc.c lib/stdio/putchar.c lib/stdio/ungetc.c lib/stdlib/free.c lib/stdlib/malloc.c lib/stdlib/realloc.c lib/string/memchr.c lib/string/memcmp.c lib/string/memcpy.c lib/string/memmove.c lib/string/memset.c lib/string/strcmp.c lib/string/strcpy.c lib/string/strncmp.c lib/posix/raise.c lib/linux/access.c lib/linux/brk.c lib/linux/chmod.c lib/linux/clock_gettime.c lib/linux/dup.c lib/linux/dup2.c lib/linux/execve.c lib/linux/fork.c lib/linux/fsync.c lib/linux/_getcwd.c lib/linux/gettimeofday.c lib/linux/ioctl3.c lib/linux/_open3.c lib/linux/_read.c lib/linux/time.c lib/linux/unlink.c lib/linux/waitpid.c lib/linux/x86-mes-gcc/syscall.c lib/linux/getpid.c lib/linux/kill.c lib/ctype/islower.c lib/ctype/isupper.c lib/ctype/tolower.c lib/ctype/toupper.c lib/mes/abtod.c lib/mes/dtoab.c lib/mes/search-path.c lib/posix/execvp.c lib/stdio/fclose.c lib/stdio/fdopen.c lib/stdio/ferror.c lib/stdio/fflush.c lib/stdio/fopen.c lib/stdio/fprintf.c lib/stdio/fread.c lib/stdio/fseek.c lib/stdio/ftell.c lib/stdio/fwrite.c
|
catm unified-libc-1.c lib/mes/eputs.c lib/mes/oputs.c lib/mes/globals.c lib/stdlib/exit.c lib/linux/x86-mes-gcc/_exit.c lib/linux/x86-mes-gcc/_write.c lib/stdlib/puts.c lib/string/strlen.c lib/ctype/isnumber.c lib/mes/abtol.c lib/mes/cast.c lib/mes/eputc.c lib/mes/fdgetc.c lib/mes/fdputc.c lib/mes/fdputs.c lib/mes/fdungetc.c lib/mes/itoa.c lib/mes/ltoa.c lib/mes/ltoab.c lib/mes/mes_open.c lib/mes/ntoab.c lib/mes/oputc.c lib/mes/ultoa.c lib/mes/utoa.c lib/ctype/isdigit.c lib/ctype/isspace.c lib/ctype/isxdigit.c lib/mes/assert_msg.c lib/posix/write.c lib/stdlib/atoi.c lib/linux/lseek.c lib/mes/__assert_fail.c lib/mes/__buffered_read.c lib/mes/__mes_debug.c lib/posix/execv.c lib/posix/getcwd.c lib/posix/getenv.c lib/posix/isatty.c lib/posix/open.c lib/posix/buffered-read.c lib/posix/setenv.c lib/posix/wait.c lib/stdio/fgetc.c lib/stdio/fputc.c lib/stdio/fputs.c lib/stdio/getc.c lib/stdio/getchar.c lib/stdio/putc.c lib/stdio/putchar.c lib/stdio/ungetc.c lib/stdlib/free.c lib/stdlib/malloc.c lib/stdlib/realloc.c lib/string/memchr.c lib/string/memcmp.c lib/string/memcpy.c lib/string/memmove.c lib/string/memset.c lib/string/strcmp.c lib/string/strcpy.c lib/string/strncmp.c lib/posix/raise.c lib/linux/access.c lib/linux/brk.c lib/linux/chmod.c lib/linux/clock_gettime.c lib/linux/dup.c lib/linux/dup2.c lib/linux/execve.c lib/linux/fork.c lib/linux/fsync.c lib/linux/_getcwd.c lib/linux/gettimeofday.c lib/linux/ioctl3.c lib/linux/_open3.c lib/linux/_read.c lib/linux/time.c lib/linux/unlink.c lib/linux/waitpid.c lib/linux/x86-mes-gcc/syscall.c lib/linux/getpid.c lib/linux/kill.c lib/ctype/islower.c lib/ctype/isupper.c lib/ctype/tolower.c lib/ctype/toupper.c lib/mes/abtod.c lib/mes/dtoab.c lib/mes/search-path.c lib/posix/execvp.c lib/stdio/fclose.c lib/stdio/fdopen.c lib/stdio/ferror.c lib/stdio/fflush.c lib/stdio/fopen.c lib/stdio/fprintf.c lib/stdio/fread.c lib/stdio/fseek.c lib/stdio/ftell.c lib/stdio/fwrite.c
|
||||||
|
|
@ -121,7 +114,7 @@ mes-tcc \
|
||||||
# Install
|
# Install
|
||||||
cp boot0-tcc ${bindir}/
|
cp boot0-tcc ${bindir}/
|
||||||
chmod 755 ${bindir}/boot0-tcc
|
chmod 755 ${bindir}/boot0-tcc
|
||||||
cd ../tcc-mes
|
cd ../mes-libc
|
||||||
# Recompile libc: crt{1,n,i}, libtcc.a, libc.a
|
# Recompile libc: crt{1,n,i}, libtcc.a, libc.a
|
||||||
boot0-tcc -c -D HAVE_CONFIG_H=1 -I include -I include/linux/x86 -o ${libdir}/crt1.o lib/linux/x86-mes-gcc/crt1.c
|
boot0-tcc -c -D HAVE_CONFIG_H=1 -I include -I include/linux/x86 -o ${libdir}/crt1.o lib/linux/x86-mes-gcc/crt1.c
|
||||||
boot0-tcc -c -D HAVE_CONFIG_H=1 -I include -I include/linux/x86 -o ${libdir}/crtn.o lib/linux/x86-mes-gcc/crtn.c
|
boot0-tcc -c -D HAVE_CONFIG_H=1 -I include -I include/linux/x86 -o ${libdir}/crtn.o lib/linux/x86-mes-gcc/crtn.c
|
||||||
|
|
@ -168,7 +161,7 @@ boot0-tcc \
|
||||||
tcc.c
|
tcc.c
|
||||||
cp boot1-tcc ${bindir}
|
cp boot1-tcc ${bindir}
|
||||||
chmod 755 ${bindir}/boot1-tcc
|
chmod 755 ${bindir}/boot1-tcc
|
||||||
cd ../tcc-mes
|
cd ../mes-libc
|
||||||
boot1-tcc -c -D HAVE_CONFIG_H=1 -I include -I include/linux/x86 -o ${libdir}/crt1.o lib/linux/x86-mes-gcc/crt1.c
|
boot1-tcc -c -D HAVE_CONFIG_H=1 -I include -I include/linux/x86 -o ${libdir}/crt1.o lib/linux/x86-mes-gcc/crt1.c
|
||||||
boot1-tcc -c -D HAVE_CONFIG_H=1 -I include -I include/linux/x86 -o ${libdir}/crtn.o lib/linux/x86-mes-gcc/crtn.c
|
boot1-tcc -c -D HAVE_CONFIG_H=1 -I include -I include/linux/x86 -o ${libdir}/crtn.o lib/linux/x86-mes-gcc/crtn.c
|
||||||
boot1-tcc -c -D HAVE_CONFIG_H=1 -I include -I include/linux/x86 -o ${libdir}/crti.o lib/linux/x86-mes-gcc/crti.c
|
boot1-tcc -c -D HAVE_CONFIG_H=1 -I include -I include/linux/x86 -o ${libdir}/crti.o lib/linux/x86-mes-gcc/crti.c
|
||||||
|
|
@ -215,7 +208,7 @@ boot1-tcc \
|
||||||
tcc.c
|
tcc.c
|
||||||
cp boot2-tcc ${bindir}
|
cp boot2-tcc ${bindir}
|
||||||
chmod 755 ${bindir}/boot2-tcc
|
chmod 755 ${bindir}/boot2-tcc
|
||||||
cd ../tcc-mes
|
cd ../mes-libc
|
||||||
boot2-tcc -c -D HAVE_CONFIG_H=1 -I include -I include/linux/x86 -o ${libdir}/crt1.o lib/linux/x86-mes-gcc/crt1.c
|
boot2-tcc -c -D HAVE_CONFIG_H=1 -I include -I include/linux/x86 -o ${libdir}/crt1.o lib/linux/x86-mes-gcc/crt1.c
|
||||||
boot2-tcc -c -D HAVE_CONFIG_H=1 -I include -I include/linux/x86 -o ${libdir}/crtn.o lib/linux/x86-mes-gcc/crtn.c
|
boot2-tcc -c -D HAVE_CONFIG_H=1 -I include -I include/linux/x86 -o ${libdir}/crtn.o lib/linux/x86-mes-gcc/crtn.c
|
||||||
boot2-tcc -c -D HAVE_CONFIG_H=1 -I include -I include/linux/x86 -o ${libdir}/crti.o lib/linux/x86-mes-gcc/crti.c
|
boot2-tcc -c -D HAVE_CONFIG_H=1 -I include -I include/linux/x86 -o ${libdir}/crti.o lib/linux/x86-mes-gcc/crti.c
|
||||||
|
|
@ -262,7 +255,7 @@ boot2-tcc \
|
||||||
tcc.c
|
tcc.c
|
||||||
cp boot3-tcc ${bindir}
|
cp boot3-tcc ${bindir}
|
||||||
chmod 755 ${bindir}/boot3-tcc
|
chmod 755 ${bindir}/boot3-tcc
|
||||||
cd ../tcc-mes
|
cd ../mes-libc
|
||||||
boot3-tcc -c -D HAVE_CONFIG_H=1 -I include -I include/linux/x86 -o ${libdir}/crt1.o lib/linux/x86-mes-gcc/crt1.c
|
boot3-tcc -c -D HAVE_CONFIG_H=1 -I include -I include/linux/x86 -o ${libdir}/crt1.o lib/linux/x86-mes-gcc/crt1.c
|
||||||
boot3-tcc -c -D HAVE_CONFIG_H=1 -I include -I include/linux/x86 -o ${libdir}/crtn.o lib/linux/x86-mes-gcc/crtn.c
|
boot3-tcc -c -D HAVE_CONFIG_H=1 -I include -I include/linux/x86 -o ${libdir}/crtn.o lib/linux/x86-mes-gcc/crtn.c
|
||||||
boot3-tcc -c -D HAVE_CONFIG_H=1 -I include -I include/linux/x86 -o ${libdir}/crti.o lib/linux/x86-mes-gcc/crti.c
|
boot3-tcc -c -D HAVE_CONFIG_H=1 -I include -I include/linux/x86 -o ${libdir}/crti.o lib/linux/x86-mes-gcc/crti.c
|
||||||
|
|
@ -309,7 +302,7 @@ boot3-tcc \
|
||||||
tcc.c
|
tcc.c
|
||||||
cp boot4-tcc ${bindir}
|
cp boot4-tcc ${bindir}
|
||||||
chmod 755 ${bindir}/boot4-tcc
|
chmod 755 ${bindir}/boot4-tcc
|
||||||
cd ../tcc-mes
|
cd ../mes-libc
|
||||||
boot4-tcc -c -D HAVE_CONFIG_H=1 -I include -I include/linux/x86 -o ${libdir}/crt1.o lib/linux/x86-mes-gcc/crt1.c
|
boot4-tcc -c -D HAVE_CONFIG_H=1 -I include -I include/linux/x86 -o ${libdir}/crt1.o lib/linux/x86-mes-gcc/crt1.c
|
||||||
boot4-tcc -c -D HAVE_CONFIG_H=1 -I include -I include/linux/x86 -o ${libdir}/crtn.o lib/linux/x86-mes-gcc/crtn.c
|
boot4-tcc -c -D HAVE_CONFIG_H=1 -I include -I include/linux/x86 -o ${libdir}/crtn.o lib/linux/x86-mes-gcc/crtn.c
|
||||||
boot4-tcc -c -D HAVE_CONFIG_H=1 -I include -I include/linux/x86 -o ${libdir}/crti.o lib/linux/x86-mes-gcc/crti.c
|
boot4-tcc -c -D HAVE_CONFIG_H=1 -I include -I include/linux/x86 -o ${libdir}/crti.o lib/linux/x86-mes-gcc/crti.c
|
||||||
|
|
@ -356,7 +349,7 @@ boot4-tcc \
|
||||||
tcc.c
|
tcc.c
|
||||||
cp boot5-tcc ${bindir}
|
cp boot5-tcc ${bindir}
|
||||||
chmod 755 ${bindir}/boot5-tcc
|
chmod 755 ${bindir}/boot5-tcc
|
||||||
cd ../tcc-mes
|
cd ../mes-libc
|
||||||
boot5-tcc -c -D HAVE_CONFIG_H=1 -I include -I include/linux/x86 -o ${libdir}/crt1.o lib/linux/x86-mes-gcc/crt1.c
|
boot5-tcc -c -D HAVE_CONFIG_H=1 -I include -I include/linux/x86 -o ${libdir}/crt1.o lib/linux/x86-mes-gcc/crt1.c
|
||||||
boot5-tcc -c -D HAVE_CONFIG_H=1 -I include -I include/linux/x86 -o ${libdir}/crtn.o lib/linux/x86-mes-gcc/crtn.c
|
boot5-tcc -c -D HAVE_CONFIG_H=1 -I include -I include/linux/x86 -o ${libdir}/crtn.o lib/linux/x86-mes-gcc/crtn.c
|
||||||
boot5-tcc -c -D HAVE_CONFIG_H=1 -I include -I include/linux/x86 -o ${libdir}/crti.o lib/linux/x86-mes-gcc/crti.c
|
boot5-tcc -c -D HAVE_CONFIG_H=1 -I include -I include/linux/x86 -o ${libdir}/crti.o lib/linux/x86-mes-gcc/crti.c
|
||||||
|
|
@ -374,60 +367,12 @@ boot5-tcc -version
|
||||||
# We have our final tcc 0.9.26!
|
# We have our final tcc 0.9.26!
|
||||||
cp ${bindir}/boot5-tcc ${bindir}/tcc
|
cp ${bindir}/boot5-tcc ${bindir}/tcc
|
||||||
chmod 755 ${bindir}/tcc
|
chmod 755 ${bindir}/tcc
|
||||||
|
cp ${bindir}/tcc ${bindir}/tcc-0.9.26
|
||||||
|
chmod 755 ${bindir}/tcc-0.9.26
|
||||||
|
|
||||||
# Also recompile getopt, we don't need to do this during the boot* stages
|
# Also recompile getopt, we don't need to do this during the boot* stages
|
||||||
# because nothing is linked against it
|
# because nothing is linked against it
|
||||||
tcc -c -D HAVE_CONFIG_H=1 -I include -I include/linux/x86 lib/posix/getopt.c
|
tcc -c -D HAVE_CONFIG_H=1 -I include -I include/linux/x86 lib/posix/getopt.c
|
||||||
tcc -ar cr ${libdir}/libgetopt.a getopt.o
|
tcc -ar cr ${libdir}/libgetopt.a getopt.o
|
||||||
|
|
||||||
# Now compile tcc 0.9.27
|
|
||||||
cd ../tcc-0.9.27
|
|
||||||
|
|
||||||
# Create config.h
|
|
||||||
catm config.h
|
|
||||||
|
|
||||||
# Compile the binary
|
|
||||||
tcc \
|
|
||||||
-v \
|
|
||||||
-static \
|
|
||||||
-o tcc \
|
|
||||||
-D TCC_TARGET_I386=1 \
|
|
||||||
-D CONFIG_TCCDIR=\"${libdir}/tcc\" \
|
|
||||||
-D CONFIG_TCC_CRTPREFIX=\"${libdir}\" \
|
|
||||||
-D CONFIG_TCC_ELFINTERP=\"/mes/loader\" \
|
|
||||||
-D CONFIG_TCC_LIBPATHS=\"${libdir}:${libdir}/tcc\" \
|
|
||||||
-D CONFIG_TCC_SYSINCLUDEPATHS=\"${prefix}/include\" \
|
|
||||||
-D TCC_LIBGCC=\"${libdir}/libc.a\" \
|
|
||||||
-D CONFIG_TCC_STATIC=1 \
|
|
||||||
-D CONFIG_USE_LIBGCC=1 \
|
|
||||||
-D TCC_VERSION=\"0.9.27\" \
|
|
||||||
-D ONE_SOURCE=1 \
|
|
||||||
tcc.c
|
|
||||||
|
|
||||||
# Install the binary
|
|
||||||
cp tcc ${bindir}/tcc
|
|
||||||
chmod 755 ${bindir}/tcc
|
|
||||||
|
|
||||||
# Test
|
|
||||||
tcc -version
|
|
||||||
|
|
||||||
# Recompile libc
|
|
||||||
# libtcc1.a
|
|
||||||
tcc -c -D HAVE_CONFIG_H=1 lib/libtcc1.c
|
|
||||||
tcc -ar cr ${libdir}/tcc/libtcc1.a libtcc1.o
|
|
||||||
cd ../tcc-mes
|
|
||||||
# crt{1,n,i}.o
|
|
||||||
tcc -c -D HAVE_CONFIG_H=1 -I include -I include/linux/x86 -o ${libdir}/crt1.o lib/linux/x86-mes-gcc/crt1.c
|
|
||||||
tcc -c -D HAVE_CONFIG_H=1 -I include -I include/linux/x86 -o ${libdir}/crtn.o lib/linux/x86-mes-gcc/crtn.c
|
|
||||||
tcc -c -D HAVE_CONFIG_H=1 -I include -I include/linux/x86 -o ${libdir}/crti.o lib/linux/x86-mes-gcc/crti.c
|
|
||||||
# libc.a
|
|
||||||
tcc -c -D HAVE_CONFIG_H=1 -I include -I include/linux/x86 -o unified-libc-1.o unified-libc-1.c
|
|
||||||
tcc -c -D HAVE_CONFIG_H=1 -I include -I include/linux/x86 -o unified-libc-2.o unified-libc-2.c
|
|
||||||
tcc -c -D HAVE_CONFIG_H=1 -I include -I include/linux/x86 -o unified-libc-3.o unified-libc-3.c
|
|
||||||
tcc -ar cr ${libdir}/libc+gnu.a unified-libc-1.o unified-libc-2.o unified-libc-3.o
|
|
||||||
cp ${libdir}/libc+gnu.a ${libdir}/libc.a
|
|
||||||
# libgetopt.a
|
|
||||||
tcc -c -D HAVE_CONFIG_H=1 -I include -I include/linux/x86 lib/posix/getopt.c
|
|
||||||
tcc -ar cr ${libdir}/libgetopt.a getopt.o
|
|
||||||
|
|
||||||
cd ..
|
cd ..
|
||||||
0
sysa/tcc-0.9.27/build/.placeholder
Normal file
0
sysa/tcc-0.9.27/build/.placeholder
Normal file
1
sysa/tcc-0.9.27/src/mes-libc
Submodule
1
sysa/tcc-0.9.27/src/mes-libc
Submodule
|
|
@ -0,0 +1 @@
|
||||||
|
Subproject commit 22d37adeef22c184a113daec4bf06536ea099e6a
|
||||||
58
sysa/tcc-0.9.27/tcc-0.9.27.kaem
Executable file
58
sysa/tcc-0.9.27/tcc-0.9.27.kaem
Executable file
|
|
@ -0,0 +1,58 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
set -ex
|
||||||
|
|
||||||
|
cd src/tcc-0.9.27
|
||||||
|
|
||||||
|
# Create config.h
|
||||||
|
catm config.h
|
||||||
|
|
||||||
|
# Compile the binary
|
||||||
|
tcc \
|
||||||
|
-v \
|
||||||
|
-static \
|
||||||
|
-o tcc \
|
||||||
|
-D TCC_TARGET_I386=1 \
|
||||||
|
-D CONFIG_TCCDIR=\"${libdir}/tcc\" \
|
||||||
|
-D CONFIG_TCC_CRTPREFIX=\"${libdir}\" \
|
||||||
|
-D CONFIG_TCC_ELFINTERP=\"/mes/loader\" \
|
||||||
|
-D CONFIG_TCC_LIBPATHS=\"${libdir}:${libdir}/tcc\" \
|
||||||
|
-D CONFIG_TCC_SYSINCLUDEPATHS=\"${prefix}/include\" \
|
||||||
|
-D TCC_LIBGCC=\"${libdir}/libc.a\" \
|
||||||
|
-D CONFIG_TCC_STATIC=1 \
|
||||||
|
-D CONFIG_USE_LIBGCC=1 \
|
||||||
|
-D TCC_VERSION=\"0.9.27\" \
|
||||||
|
-D ONE_SOURCE=1 \
|
||||||
|
tcc.c
|
||||||
|
|
||||||
|
# Install the binary
|
||||||
|
cp tcc ${bindir}/tcc
|
||||||
|
chmod 755 ${bindir}/tcc
|
||||||
|
|
||||||
|
# Test
|
||||||
|
tcc -version
|
||||||
|
|
||||||
|
# Recompile libc
|
||||||
|
# libtcc1.a
|
||||||
|
tcc -c -D HAVE_CONFIG_H=1 lib/libtcc1.c
|
||||||
|
tcc -ar cr ${libdir}/tcc/libtcc1.a libtcc1.o
|
||||||
|
cd ../mes-libc
|
||||||
|
# crt{1,n,i}.o
|
||||||
|
tcc -c -D HAVE_CONFIG_H=1 -I include -I include/linux/x86 -o ${libdir}/crt1.o lib/linux/x86-mes-gcc/crt1.c
|
||||||
|
tcc -c -D HAVE_CONFIG_H=1 -I include -I include/linux/x86 -o ${libdir}/crtn.o lib/linux/x86-mes-gcc/crtn.c
|
||||||
|
tcc -c -D HAVE_CONFIG_H=1 -I include -I include/linux/x86 -o ${libdir}/crti.o lib/linux/x86-mes-gcc/crti.c
|
||||||
|
# Create unified libc files
|
||||||
|
catm unified-libc-1.c lib/mes/eputs.c lib/mes/oputs.c lib/mes/globals.c lib/stdlib/exit.c lib/linux/x86-mes-gcc/_exit.c lib/linux/x86-mes-gcc/_write.c lib/stdlib/puts.c lib/string/strlen.c lib/ctype/isnumber.c lib/mes/abtol.c lib/mes/cast.c lib/mes/eputc.c lib/mes/fdgetc.c lib/mes/fdputc.c lib/mes/fdputs.c lib/mes/fdungetc.c lib/mes/itoa.c lib/mes/ltoa.c lib/mes/ltoab.c lib/mes/mes_open.c lib/mes/ntoab.c lib/mes/oputc.c lib/mes/ultoa.c lib/mes/utoa.c lib/ctype/isdigit.c lib/ctype/isspace.c lib/ctype/isxdigit.c lib/mes/assert_msg.c lib/posix/write.c lib/stdlib/atoi.c lib/linux/lseek.c lib/mes/__assert_fail.c lib/mes/__buffered_read.c lib/mes/__mes_debug.c lib/posix/execv.c lib/posix/getcwd.c lib/posix/getenv.c lib/posix/isatty.c lib/posix/open.c lib/posix/buffered-read.c lib/posix/setenv.c lib/posix/wait.c lib/stdio/fgetc.c lib/stdio/fputc.c lib/stdio/fputs.c lib/stdio/getc.c lib/stdio/getchar.c lib/stdio/putc.c lib/stdio/putchar.c lib/stdio/ungetc.c lib/stdlib/free.c lib/stdlib/malloc.c lib/stdlib/realloc.c lib/string/memchr.c lib/string/memcmp.c lib/string/memcpy.c lib/string/memmove.c lib/string/memset.c lib/string/strcmp.c lib/string/strcpy.c lib/string/strncmp.c lib/posix/raise.c lib/linux/access.c lib/linux/brk.c lib/linux/chmod.c lib/linux/clock_gettime.c lib/linux/dup.c lib/linux/dup2.c lib/linux/execve.c lib/linux/fork.c lib/linux/fsync.c lib/linux/_getcwd.c lib/linux/gettimeofday.c lib/linux/ioctl3.c lib/linux/_open3.c lib/linux/_read.c lib/linux/time.c lib/linux/unlink.c lib/linux/waitpid.c lib/linux/x86-mes-gcc/syscall.c lib/linux/getpid.c lib/linux/kill.c lib/ctype/islower.c lib/ctype/isupper.c lib/ctype/tolower.c lib/ctype/toupper.c lib/mes/abtod.c lib/mes/dtoab.c lib/mes/search-path.c lib/posix/execvp.c lib/stdio/fclose.c lib/stdio/fdopen.c lib/stdio/ferror.c lib/stdio/fflush.c lib/stdio/fopen.c lib/stdio/fprintf.c lib/stdio/fread.c lib/stdio/fseek.c lib/stdio/ftell.c lib/stdio/fwrite.c
|
||||||
|
catm unified-libc-2.c lib/stdio/printf.c lib/stdio/remove.c lib/stdio/snprintf.c lib/stdio/sprintf.c lib/stdio/sscanf.c lib/stdio/vfprintf.c lib/stdio/vprintf.c lib/stdio/vsnprintf.c lib/stdio/vsprintf.c lib/stdio/vsscanf.c lib/stdlib/calloc.c lib/stdlib/qsort.c lib/stdlib/strtod.c lib/stdlib/strtof.c lib/stdlib/strtol.c lib/stdlib/strtold.c lib/stdlib/strtoll.c lib/stdlib/strtoul.c lib/stdlib/strtoull.c lib/string/memmem.c lib/string/strcat.c lib/string/strchr.c lib/string/strlwr.c lib/string/strncpy.c lib/string/strrchr.c lib/string/strstr.c lib/string/strupr.c lib/stub/sigaction.c lib/stub/ldexp.c lib/stub/mprotect.c lib/stub/localtime.c lib/stub/sigemptyset.c lib/x86-mes-gcc/setjmp.c lib/linux/close.c lib/linux/rmdir.c lib/linux/stat.c lib/ctype/isalnum.c lib/ctype/isalpha.c lib/ctype/isascii.c lib/ctype/iscntrl.c lib/ctype/isgraph.c lib/ctype/isprint.c lib/ctype/ispunct.c lib/dirent/__getdirentries.c lib/dirent/closedir.c lib/dirent/opendir.c lib/dirent/readdir.c lib/math/ceil.c lib/math/fabs.c lib/math/floor.c lib/mes/fdgets.c lib/posix/alarm.c lib/posix/execl.c lib/posix/execlp.c lib/posix/mktemp.c lib/posix/sbrk.c lib/posix/sleep.c lib/posix/unsetenv.c lib/stdio/clearerr.c lib/stdio/feof.c lib/stdio/fgets.c lib/stdio/fileno.c lib/stdio/freopen.c lib/stdio/fscanf.c lib/stdio/perror.c lib/stdio/vfscanf.c lib/stdlib/__exit.c lib/stdlib/abort.c lib/stdlib/abs.c lib/stdlib/alloca.c lib/stdlib/atexit.c lib/stdlib/atof.c lib/stdlib/atol.c lib/stdlib/mbstowcs.c lib/string/bcmp.c lib/string/bcopy.c lib/string/bzero.c lib/string/index.c lib/string/rindex.c lib/string/strcspn.c lib/string/strdup.c lib/string/strerror.c lib/string/strncat.c lib/string/strpbrk.c lib/string/strspn.c lib/stub/__cleanup.c lib/stub/atan2.c lib/stub/bsearch.c lib/stub/chown.c lib/stub/cos.c lib/stub/ctime.c lib/stub/exp.c lib/stub/fpurge.c lib/stub/freadahead.c lib/stub/frexp.c lib/stub/getgrgid.c lib/stub/getgrnam.c lib/stub/getlogin.c lib/stub/getpgid.c lib/stub/getpgrp.c lib/stub/getpwnam.c
|
||||||
|
catm unified-libc-3.c lib/stub/getpwuid.c lib/stub/gmtime.c lib/stub/log.c lib/stub/mktime.c lib/stub/modf.c lib/stub/pclose.c lib/stub/popen.c lib/stub/pow.c lib/stub/rand.c lib/stub/rewind.c lib/stub/setbuf.c lib/stub/setgrent.c lib/stub/setlocale.c lib/stub/setvbuf.c lib/stub/sigaddset.c lib/stub/sigblock.c lib/stub/sigdelset.c lib/stub/sigsetmask.c lib/stub/sin.c lib/stub/sqrt.c lib/stub/strftime.c lib/stub/sys_siglist.c lib/stub/system.c lib/stub/times.c lib/stub/ttyname.c lib/stub/umask.c lib/stub/utime.c lib/linux/chdir.c lib/linux/fcntl.c lib/linux/fstat.c lib/linux/getdents.c lib/linux/getegid.c lib/linux/geteuid.c lib/linux/getgid.c lib/linux/getppid.c lib/linux/getrusage.c lib/linux/getuid.c lib/linux/ioctl.c lib/linux/link.c lib/linux/lstat.c lib/linux/mkdir.c lib/linux/mknod.c lib/linux/nanosleep.c lib/linux/pipe.c lib/linux/readlink.c lib/linux/rename.c lib/linux/setgid.c lib/linux/settimer.c lib/linux/setuid.c lib/linux/signal.c lib/linux/sigprogmask.c lib/linux/symlink.c
|
||||||
|
# libc.a
|
||||||
|
tcc -c -D HAVE_CONFIG_H=1 -I include -I include/linux/x86 -o unified-libc-1.o unified-libc-1.c
|
||||||
|
tcc -c -D HAVE_CONFIG_H=1 -I include -I include/linux/x86 -o unified-libc-2.o unified-libc-2.c
|
||||||
|
tcc -c -D HAVE_CONFIG_H=1 -I include -I include/linux/x86 -o unified-libc-3.o unified-libc-3.c
|
||||||
|
tcc -ar cr ${libdir}/libc+gnu.a unified-libc-1.o unified-libc-2.o unified-libc-3.o
|
||||||
|
cp ${libdir}/libc+gnu.a ${libdir}/libc.a
|
||||||
|
# libgetopt.a
|
||||||
|
tcc -c -D HAVE_CONFIG_H=1 -I include -I include/linux/x86 lib/posix/getopt.c
|
||||||
|
tcc -ar cr ${libdir}/libgetopt.a getopt.o
|
||||||
|
|
||||||
|
cd ../..
|
||||||
|
|
@ -2,18 +2,15 @@
|
||||||
|
|
||||||
set -ex
|
set -ex
|
||||||
|
|
||||||
# Vars
|
cd src/tcc-0.9.27
|
||||||
prefix=/after
|
|
||||||
libdir=${prefix}/lib
|
|
||||||
bindir=${prefix}/bin
|
|
||||||
|
|
||||||
# Patch
|
# Patch
|
||||||
patch -Np0 -i ../patches/tcc/static-link.patch
|
patch -Np0 -i ../../patches/static-link.patch
|
||||||
|
|
||||||
# Compile
|
# Compile
|
||||||
## We have to use 0.9.26 to recompile 0.9.27, 0.9.27 is not self-hosting for
|
## We have to use 0.9.26 to recompile 0.9.27, 0.9.27 is not self-hosting for
|
||||||
## whatever reason.
|
## whatever reason.
|
||||||
boot5-tcc \
|
tcc-0.9.26 \
|
||||||
-v \
|
-v \
|
||||||
-static \
|
-static \
|
||||||
-o ${bindir}/tcc \
|
-o ${bindir}/tcc \
|
||||||
|
|
@ -32,3 +29,5 @@ boot5-tcc \
|
||||||
|
|
||||||
# Test
|
# Test
|
||||||
tcc -version
|
tcc -version
|
||||||
|
|
||||||
|
cd ../..
|
||||||
Loading…
Add table
Add a link
Reference in a new issue