mirror of
https://github.com/fosslinux/live-bootstrap.git
synced 2026-03-18 17:25:24 +01:00
Use uppercase variables in kaem-era
lowercase variables are inconsistent, bring them into line with rest of live-bootstrap
This commit is contained in:
parent
f7c028b588
commit
1b47720cbc
22 changed files with 307 additions and 316 deletions
|
|
@ -11,14 +11,14 @@ set -ex
|
||||||
|
|
||||||
# Set commonly used variables
|
# Set commonly used variables
|
||||||
sysa=/sysa
|
sysa=/sysa
|
||||||
distfiles=/sysa/distfiles
|
DISTFILES=/sysa/distfiles
|
||||||
prefix=/usr
|
PREFIX=/usr
|
||||||
bindir=${prefix}/bin
|
BINDIR=${PREFIX}/bin
|
||||||
libdir=${libdir}/mes
|
LIBDIR=${LIBDIR}/mes
|
||||||
incdir=${prefix}/include
|
INCDIR=${PREFIX}/include
|
||||||
srcdir=${prefix}/src
|
SRCDIR=${PREFIX}/src
|
||||||
TMPDIR=/tmp # tmpdir is needed for patch to work
|
TMPDIR=/tmp # tmpdir is needed for patch to work
|
||||||
PATH=${bindir}
|
PATH=${BINDIR}
|
||||||
|
|
||||||
cd ${sysa}
|
cd ${sysa}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -13,56 +13,56 @@ PATH=/${ARCH_DIR}/bin
|
||||||
|
|
||||||
# Set commonly used variables
|
# Set commonly used variables
|
||||||
sysa=/sysa
|
sysa=/sysa
|
||||||
distfiles=/sysa/distfiles
|
DISTFILES=/sysa/distfiles
|
||||||
prefix=/usr
|
PREFIX=/usr
|
||||||
bindir=${prefix}/bin
|
BINDIR=${PREFIX}/bin
|
||||||
libdir=${prefix}/lib
|
LIBDIR=${PREFIX}/lib
|
||||||
incdir=${prefix}/include
|
INCDIR=${PREFIX}/include
|
||||||
srcdir=${prefix}/src
|
SRCDIR=${PREFIX}/src
|
||||||
TMPDIR=/tmp # tmpdir is needed for patch to work
|
TMPDIR=/tmp # tmpdir is needed for patch to work
|
||||||
|
|
||||||
mkdir -p ${prefix} ${bindir} ${libdir} ${incdir} ${srcdir} ${TMPDIR}
|
mkdir -p ${PREFIX} ${BINDIR} ${LIBDIR} ${INCDIR} ${SRCDIR} ${TMPDIR}
|
||||||
|
|
||||||
# Remove remaining dependencies on /bin (stage0-posix directory)
|
# Remove remaining dependencies on /bin (stage0-posix directory)
|
||||||
cp /${ARCH_DIR}/bin/blood-elf ${bindir}/blood-elf
|
cp /${ARCH_DIR}/bin/blood-elf ${BINDIR}/blood-elf
|
||||||
cp /${ARCH_DIR}/bin/catm ${bindir}/catm
|
cp /${ARCH_DIR}/bin/catm ${BINDIR}/catm
|
||||||
cp /${ARCH_DIR}/bin/chmod ${bindir}/chmod
|
cp /${ARCH_DIR}/bin/chmod ${BINDIR}/chmod
|
||||||
cp /${ARCH_DIR}/bin/get_machine ${bindir}/get_machine
|
cp /${ARCH_DIR}/bin/get_machine ${BINDIR}/get_machine
|
||||||
cp /${ARCH_DIR}/bin/hex2 ${bindir}/hex2
|
cp /${ARCH_DIR}/bin/hex2 ${BINDIR}/hex2
|
||||||
cp /${ARCH_DIR}/bin/kaem ${bindir}/kaem
|
cp /${ARCH_DIR}/bin/kaem ${BINDIR}/kaem
|
||||||
cp /${ARCH_DIR}/bin/match ${bindir}/match
|
cp /${ARCH_DIR}/bin/match ${BINDIR}/match
|
||||||
cp /${ARCH_DIR}/bin/M1 ${bindir}/M1
|
cp /${ARCH_DIR}/bin/M1 ${BINDIR}/M1
|
||||||
cp /${ARCH_DIR}/bin/M2-Mesoplanet ${bindir}/M2-Mesoplanet
|
cp /${ARCH_DIR}/bin/M2-Mesoplanet ${BINDIR}/M2-Mesoplanet
|
||||||
cp /${ARCH_DIR}/bin/M2-Planet ${bindir}/M2-Planet
|
cp /${ARCH_DIR}/bin/M2-Planet ${BINDIR}/M2-Planet
|
||||||
cp /${ARCH_DIR}/bin/mkdir ${bindir}/mkdir
|
cp /${ARCH_DIR}/bin/mkdir ${BINDIR}/mkdir
|
||||||
cp /${ARCH_DIR}/bin/sha256sum ${bindir}/sha256sum
|
cp /${ARCH_DIR}/bin/sha256sum ${BINDIR}/sha256sum
|
||||||
cp /${ARCH_DIR}/bin/unbz2 ${bindir}/unbz2
|
cp /${ARCH_DIR}/bin/unbz2 ${BINDIR}/unbz2
|
||||||
cp /${ARCH_DIR}/bin/ungz ${bindir}/ungz
|
cp /${ARCH_DIR}/bin/ungz ${BINDIR}/ungz
|
||||||
cp /${ARCH_DIR}/bin/untar ${bindir}/untar
|
cp /${ARCH_DIR}/bin/untar ${BINDIR}/untar
|
||||||
cp /${ARCH_DIR}/bin/cp ${bindir}/cp
|
cp /${ARCH_DIR}/bin/cp ${BINDIR}/cp
|
||||||
cp /${ARCH_DIR}/bin/replace ${bindir}/replace
|
cp /${ARCH_DIR}/bin/replace ${BINDIR}/replace
|
||||||
cp /${ARCH_DIR}/bin/rm ${bindir}/rm
|
cp /${ARCH_DIR}/bin/rm ${BINDIR}/rm
|
||||||
|
|
||||||
chmod 755 ${bindir}/blood-elf
|
chmod 755 ${BINDIR}/blood-elf
|
||||||
chmod 755 ${bindir}/catm
|
chmod 755 ${BINDIR}/catm
|
||||||
chmod 755 ${bindir}/chmod
|
chmod 755 ${BINDIR}/chmod
|
||||||
chmod 755 ${bindir}/cp
|
chmod 755 ${BINDIR}/cp
|
||||||
chmod 755 ${bindir}/get_machine
|
chmod 755 ${BINDIR}/get_machine
|
||||||
chmod 755 ${bindir}/hex2
|
chmod 755 ${BINDIR}/hex2
|
||||||
chmod 755 ${bindir}/kaem
|
chmod 755 ${BINDIR}/kaem
|
||||||
chmod 755 ${bindir}/match
|
chmod 755 ${BINDIR}/match
|
||||||
chmod 755 ${bindir}/M1
|
chmod 755 ${BINDIR}/M1
|
||||||
chmod 755 ${bindir}/M2-Mesoplanet
|
chmod 755 ${BINDIR}/M2-Mesoplanet
|
||||||
chmod 755 ${bindir}/M2-Planet
|
chmod 755 ${BINDIR}/M2-Planet
|
||||||
chmod 755 ${bindir}/mkdir
|
chmod 755 ${BINDIR}/mkdir
|
||||||
chmod 755 ${bindir}/sha256sum
|
chmod 755 ${BINDIR}/sha256sum
|
||||||
chmod 755 ${bindir}/unbz2
|
chmod 755 ${BINDIR}/unbz2
|
||||||
chmod 755 ${bindir}/ungz
|
chmod 755 ${BINDIR}/ungz
|
||||||
chmod 755 ${bindir}/untar
|
chmod 755 ${BINDIR}/untar
|
||||||
chmod 755 ${bindir}/replace
|
chmod 755 ${BINDIR}/replace
|
||||||
chmod 755 ${bindir}/rm
|
chmod 755 ${BINDIR}/rm
|
||||||
|
|
||||||
PATH=${bindir}
|
PATH=${BINDIR}
|
||||||
|
|
||||||
cd ${sysa}
|
cd ${sysa}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,10 @@
|
||||||
# SPDX-FileCopyrightText: 2023 Richard Masters <grick23@gmail.com>
|
# SPDX-FileCopyrightText: 2023 Richard Masters <grick23@gmail.com>
|
||||||
# SPDX-License-Identifier: MIT
|
# SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
prefix=/usr
|
PREFIX=/usr
|
||||||
bindir=${prefix}/bin
|
BINDIR=${PREFIX}/bin
|
||||||
|
|
||||||
PATH=${bindir}
|
PATH=${BINDIR}
|
||||||
|
|
||||||
cd sysa
|
cd sysa
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@ mkdir build src
|
||||||
cd build
|
cd build
|
||||||
|
|
||||||
# Extract
|
# Extract
|
||||||
cp ${distfiles}/${pkg}.tar.gz ../src/
|
cp ${DISTFILES}/${pkg}.tar.gz ../src/
|
||||||
gzip -d -f ../src/${pkg}.tar.gz
|
gzip -d -f ../src/${pkg}.tar.gz
|
||||||
tar xf ../src/${pkg}.tar
|
tar xf ../src/${pkg}.tar
|
||||||
rm -r ../src/
|
rm -r ../src/
|
||||||
|
|
@ -46,11 +46,11 @@ cd ..
|
||||||
make
|
make
|
||||||
|
|
||||||
# Install
|
# Install
|
||||||
install bash ${prefix}/bin/
|
install bash ${PREFIX}/bin/
|
||||||
mkdir /bin/
|
mkdir /bin/
|
||||||
ln -s ${prefix}/bin/bash /bin/bash
|
ln -s ${PREFIX}/bin/bash /bin/bash
|
||||||
ln -s ${prefix}/bin/bash /bin/sh
|
ln -s ${PREFIX}/bin/bash /bin/sh
|
||||||
ln -s ${prefix}/bin/bash ${prefix}/bin/sh
|
ln -s ${PREFIX}/bin/bash ${PREFIX}/bin/sh
|
||||||
|
|
||||||
cd ../..
|
cd ../..
|
||||||
|
|
||||||
|
|
@ -59,7 +59,7 @@ if match x${UPDATE_CHECKSUMS} xTrue; then
|
||||||
sha256sum -o ${pkg}.checksums \
|
sha256sum -o ${pkg}.checksums \
|
||||||
/usr/bin/bash
|
/usr/bin/bash
|
||||||
|
|
||||||
install ${pkg}.checksums ${srcdir}
|
install ${pkg}.checksums ${SRCDIR}
|
||||||
else
|
else
|
||||||
sha256sum -c ${pkg}.checksums
|
sha256sum -c ${pkg}.checksums
|
||||||
fi
|
fi
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@ mkdir build src
|
||||||
cd build
|
cd build
|
||||||
|
|
||||||
# Extract
|
# Extract
|
||||||
cp ${distfiles}/${pkg}.tar.gz ../src/
|
cp ${DISTFILES}/${pkg}.tar.gz ../src/
|
||||||
gzip -d -f ../src/${pkg}.tar.gz
|
gzip -d -f ../src/${pkg}.tar.gz
|
||||||
tar xf ../src/${pkg}.tar
|
tar xf ../src/${pkg}.tar
|
||||||
cd ${pkg}
|
cd ${pkg}
|
||||||
|
|
@ -28,10 +28,10 @@ patch -Np0 -i ../../patches/coreutils.patch
|
||||||
make CC=tcc AR="tcc -ar" LDFLAGS="-static" bzip2
|
make CC=tcc AR="tcc -ar" LDFLAGS="-static" bzip2
|
||||||
|
|
||||||
# Install
|
# Install
|
||||||
cp bzip2 ${prefix}/bin/bzip2
|
cp bzip2 ${PREFIX}/bin/bzip2
|
||||||
cp bzip2 ${prefix}/bin/bunzip2
|
cp bzip2 ${PREFIX}/bin/bunzip2
|
||||||
chmod 755 ${prefix}/bin/bzip2
|
chmod 755 ${PREFIX}/bin/bzip2
|
||||||
chmod 755 ${prefix}/bin/bunzip2
|
chmod 755 ${PREFIX}/bin/bunzip2
|
||||||
|
|
||||||
# Test
|
# Test
|
||||||
bzip2 --help
|
bzip2 --help
|
||||||
|
|
@ -43,7 +43,7 @@ if match x${UPDATE_CHECKSUMS} xTrue; then
|
||||||
sha256sum -o ${pkg}.checksums \
|
sha256sum -o ${pkg}.checksums \
|
||||||
/usr/bin/bzip2
|
/usr/bin/bzip2
|
||||||
|
|
||||||
cp ${pkg}.checksums ${srcdir}
|
cp ${pkg}.checksums ${SRCDIR}
|
||||||
else
|
else
|
||||||
sha256sum -c ${pkg}.checksums
|
sha256sum -c ${pkg}.checksums
|
||||||
fi
|
fi
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@
|
||||||
#define MAX_TOKENS 3
|
#define MAX_TOKENS 3
|
||||||
|
|
||||||
char *get_distfiles(char **envp) {
|
char *get_distfiles(char **envp) {
|
||||||
char *envvar = "distfiles=";
|
char *envvar = "DISTFILES=";
|
||||||
int i = 0;
|
int i = 0;
|
||||||
while (envp[i] != NULL && strncmp(envp[i], envvar, strlen(envvar)) != 0) i += 1;
|
while (envp[i] != NULL && strncmp(envp[i], envvar, strlen(envvar)) != 0) i += 1;
|
||||||
// Now we have distfiles= - get just the part we want.
|
// Now we have distfiles= - get just the part we want.
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@ mkdir build src
|
||||||
cd build
|
cd build
|
||||||
|
|
||||||
# Extract
|
# Extract
|
||||||
cp ${distfiles}/${pkg}.tar.bz2 ../src/
|
cp ${DISTFILES}/${pkg}.tar.bz2 ../src/
|
||||||
bunzip2 -f ../src/${pkg}.tar.bz2
|
bunzip2 -f ../src/${pkg}.tar.bz2
|
||||||
tar xf ../src/${pkg}.tar
|
tar xf ../src/${pkg}.tar
|
||||||
cd ${pkg}
|
cd ${pkg}
|
||||||
|
|
@ -45,8 +45,8 @@ patch -Np0 -i ../../patches/sort-locale.patch
|
||||||
patch -Np0 -i ../../patches/uniq-fopen.patch
|
patch -Np0 -i ../../patches/uniq-fopen.patch
|
||||||
|
|
||||||
# Build and install
|
# Build and install
|
||||||
make -f Makefile PREFIX=${prefix}
|
make -f Makefile PREFIX=${PREFIX}
|
||||||
make -f Makefile PREFIX=${prefix} install
|
make -f Makefile PREFIX=${PREFIX} install
|
||||||
|
|
||||||
cd ../..
|
cd ../..
|
||||||
rm -r src/
|
rm -r src/
|
||||||
|
|
@ -116,7 +116,7 @@ if match x${UPDATE_CHECKSUMS} xTrue; then
|
||||||
/usr/bin/rm \
|
/usr/bin/rm \
|
||||||
/usr/bin/sha1sum
|
/usr/bin/sha1sum
|
||||||
|
|
||||||
install ${pkg}.checksums ${srcdir}
|
install ${pkg}.checksums ${SRCDIR}
|
||||||
else
|
else
|
||||||
sha256sum -c ${pkg}.checksums
|
sha256sum -c ${pkg}.checksums
|
||||||
fi
|
fi
|
||||||
|
|
|
||||||
|
|
@ -11,16 +11,16 @@ sha256sum -c sources.SHA256SUM
|
||||||
# Extract
|
# Extract
|
||||||
mkdir build src
|
mkdir build src
|
||||||
cd src
|
cd src
|
||||||
ungz --file ${distfiles}/${pkg}.tar.gz --output ${pkg}.tar
|
ungz --file ${DISTFILES}/${pkg}.tar.gz --output ${pkg}.tar
|
||||||
cd ..
|
cd ..
|
||||||
|
|
||||||
cd build
|
cd build
|
||||||
untar --file ../src/${pkg}.tar
|
untar --file ../src/${pkg}.tar
|
||||||
cd ${pkg}
|
cd ${pkg}
|
||||||
|
|
||||||
alias as="tcc -m32 -march=i386 -std=c89 -D__KERNEL__ -DMAX_PID_VALUE=64000000 -DCONFIG_MMAP2 -DNO_CONFIG_OFFSET64 -DCONFIG_64BIT_SYSCALLS -DCONFIG_KEXEC -DNR_PROCS=4096 -DCHILD_MAX=4096 -DOPEN_MAX=1536 -DNR_OPENS=1536 -DINIT_PROGRAM=\"/init\" -DUTS_SYSNAME=\"Linux\" -D__VERSION__=\"tcc\" -traditional -I/sysa/${pkg}/build/${pkg}/include"
|
alias as="tcc -m32 -march=i386 -std=c89 -D__KERNEL__ -DMAX_PID_VALUE=64000000 -DCONFIG_MMAP2 -DNO_CONFIG_OFFSET64 -DCONFIG_64BIT_SYSCALLS -DCONFIG_KEXEC -DNR_PROCS=4096 -DCHILD_MAX=4096 -DOPEN_MAX=1536 -DNR_OPENS=1536 -DINIT_PROGRAM=\"/init\" -DUTS_SYSNAME=\"Linux\" -D__VERSION__=\"tcc\" -traditional -I${SRCDIR}/${pkg}/build/${pkg}/include"
|
||||||
|
|
||||||
alias cc="tcc -m32 -march=i386 -std=c89 -D__KERNEL__ -DMAX_PID_VALUE=64000000 -DCONFIG_MMAP2 -DNO_CONFIG_OFFSET64 -DCONFIG_64BIT_SYSCALLS -DCONFIG_KEXEC -DNR_PROCS=4096 -DCHILD_MAX=4096 -DOPEN_MAX=1536 -DNR_OPENS=1536 -DINIT_PROGRAM=\"/init\" -DUTS_SYSNAME=\"Linux\" -D__VERSION__=\"tcc\" -I/sysa/${pkg}/build/${pkg}/include -O2 -fno-pie -fno-common -ffreestanding -Wall -Wstrict-prototypes"
|
alias cc="tcc -m32 -march=i386 -std=c89 -D__KERNEL__ -DMAX_PID_VALUE=64000000 -DCONFIG_MMAP2 -DNO_CONFIG_OFFSET64 -DCONFIG_64BIT_SYSCALLS -DCONFIG_KEXEC -DNR_PROCS=4096 -DCHILD_MAX=4096 -DOPEN_MAX=1536 -DNR_OPENS=1536 -DINIT_PROGRAM=\"/init\" -DUTS_SYSNAME=\"Linux\" -D__VERSION__=\"tcc\" -I${SRCDIR}/${pkg}/build/${pkg}/include -O2 -fno-pie -fno-common -ffreestanding -Wall -Wstrict-prototypes"
|
||||||
|
|
||||||
cd kernel
|
cd kernel
|
||||||
as -c -o boot.o boot.S
|
as -c -o boot.o boot.S
|
||||||
|
|
@ -554,7 +554,7 @@ if match x${UPDATE_CHECKSUMS} xTrue; then
|
||||||
sha256sum -o ${pkg}.checksums \
|
sha256sum -o ${pkg}.checksums \
|
||||||
/boot/fiwix
|
/boot/fiwix
|
||||||
|
|
||||||
cp ${pkg}.checksums ${srcdir}
|
cp ${pkg}.checksums ${SRCDIR}
|
||||||
else
|
else
|
||||||
sha256sum -c ${pkg}.checksums
|
sha256sum -c ${pkg}.checksums
|
||||||
fi
|
fi
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@ mkdir build src
|
||||||
cd build
|
cd build
|
||||||
|
|
||||||
# Extract
|
# Extract
|
||||||
ungz --file ${distfiles}/${pkg}.tar.gz --output ../src/${pkg}.tar
|
ungz --file ${DISTFILES}/${pkg}.tar.gz --output ../src/${pkg}.tar
|
||||||
untar --file ../src/${pkg}.tar
|
untar --file ../src/${pkg}.tar
|
||||||
rm ../src/${pkg}.tar
|
rm ../src/${pkg}.tar
|
||||||
cd ${pkg}
|
cd ${pkg}
|
||||||
|
|
@ -42,10 +42,10 @@ cp util.c.new util.c
|
||||||
make
|
make
|
||||||
|
|
||||||
# Install
|
# Install
|
||||||
cp gzip ${bindir}/gzip
|
cp gzip ${BINDIR}/gzip
|
||||||
cp gzip ${bindir}/gunzip
|
cp gzip ${BINDIR}/gunzip
|
||||||
chmod 755 ${bindir}/gzip
|
chmod 755 ${BINDIR}/gzip
|
||||||
chmod 755 ${bindir}/gunzip
|
chmod 755 ${BINDIR}/gunzip
|
||||||
|
|
||||||
cd ../..
|
cd ../..
|
||||||
|
|
||||||
|
|
@ -54,7 +54,7 @@ if match x${UPDATE_CHECKSUMS} xTrue; then
|
||||||
sha256sum -o ${pkg}.checksums \
|
sha256sum -o ${pkg}.checksums \
|
||||||
/usr/bin/gzip
|
/usr/bin/gzip
|
||||||
|
|
||||||
cp ${pkg}.checksums ${srcdir}
|
cp ${pkg}.checksums ${SRCDIR}
|
||||||
else
|
else
|
||||||
sha256sum -c ${pkg}.checksums
|
sha256sum -c ${pkg}.checksums
|
||||||
fi
|
fi
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@ cd build
|
||||||
lexdir=/lex
|
lexdir=/lex
|
||||||
|
|
||||||
# Extract
|
# Extract
|
||||||
cp ${distfiles}/${pkg}.tar.bz2 ../src/
|
cp ${DISTFILES}/${pkg}.tar.bz2 ../src/
|
||||||
bunzip2 -f ../src/${pkg}.tar.bz2
|
bunzip2 -f ../src/${pkg}.tar.bz2
|
||||||
tar xf ../src/${pkg}.tar ${pkg}/yacc ${pkg}/lex
|
tar xf ../src/${pkg}.tar ${pkg}/yacc ${pkg}/lex
|
||||||
rm -r ../src/
|
rm -r ../src/
|
||||||
|
|
@ -32,18 +32,18 @@ cd yacc
|
||||||
make -f Makefile.mk CC=tcc AR=tcc\ -ar CFLAGS=-DMAXPATHLEN=100\ -DEILSEQ=84\ -DMB_LEN_MAX=100 LDFLAGS=-lgetopt\ -static RANLIB=true
|
make -f Makefile.mk CC=tcc AR=tcc\ -ar CFLAGS=-DMAXPATHLEN=100\ -DEILSEQ=84\ -DMB_LEN_MAX=100 LDFLAGS=-lgetopt\ -static RANLIB=true
|
||||||
|
|
||||||
# Install yacc
|
# Install yacc
|
||||||
install yacc ${bindir}
|
install yacc ${BINDIR}
|
||||||
install -m 644 yaccpar /
|
install -m 644 yaccpar ${LIBDIR}
|
||||||
|
|
||||||
# Build lex
|
# Build lex
|
||||||
cd ../lex
|
cd ../lex
|
||||||
make -f Makefile.mk CC=tcc AR=tcc\ -ar CFLAGS=-DEILSEQ=84\ -DMB_LEN_MAX=100 LDFLAGS=-lgetopt\ -static RANLIB=true
|
make -f Makefile.mk CC=tcc AR=tcc\ -ar CFLAGS=-DEILSEQ=84\ -DMB_LEN_MAX=100 LDFLAGS=-lgetopt\ -static RANLIB=true
|
||||||
|
|
||||||
# Install lex
|
# Install lex
|
||||||
mkdir ${lexdir}
|
mkdir ${LEXDIR}
|
||||||
install lex ${bindir}
|
install lex ${BINDIR}
|
||||||
install libl.a ${libdir}
|
install libl.a ${LIBDIR}
|
||||||
install -m 644 ncform ${lexdir}
|
install -m 644 ncform ${LEXDIR}
|
||||||
|
|
||||||
cd ../../..
|
cd ../../..
|
||||||
|
|
||||||
|
|
@ -56,7 +56,7 @@ if match x${UPDATE_CHECKSUMS} xTrue; then
|
||||||
/yaccpar \
|
/yaccpar \
|
||||||
/lex/ncform
|
/lex/ncform
|
||||||
|
|
||||||
install ${pkg}.checksums ${srcdir}
|
install ${pkg}.checksums ${SRCDIR}
|
||||||
else
|
else
|
||||||
sha256sum -c ${pkg}.checksums
|
sha256sum -c ${pkg}.checksums
|
||||||
fi
|
fi
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@
|
||||||
set -ex
|
set -ex
|
||||||
|
|
||||||
cd src
|
cd src
|
||||||
tcc -m32 -march=i386 -std=c89 -I../../tcc/tcc-0.9.27/include -o ${bindir}/kexec-fiwix kexec-fiwix.c
|
tcc -m32 -march=i386 -std=c89 -I../../tcc/tcc-0.9.27/include -o ${BINDIR}/kexec-fiwix kexec-fiwix.c
|
||||||
cd ..
|
cd ..
|
||||||
|
|
||||||
# Checksums
|
# Checksums
|
||||||
|
|
@ -14,7 +14,7 @@ if match x${UPDATE_CHECKSUMS} xTrue; then
|
||||||
sha256sum -o ${pkg}.checksums \
|
sha256sum -o ${pkg}.checksums \
|
||||||
/usr/bin/kexec-fiwix
|
/usr/bin/kexec-fiwix
|
||||||
|
|
||||||
cp ${pkg}.checksums ${srcdir}
|
cp ${pkg}.checksums ${SRCDIR}
|
||||||
else
|
else
|
||||||
sha256sum -c ${pkg}.checksums
|
sha256sum -c ${pkg}.checksums
|
||||||
fi
|
fi
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
|
|
||||||
mkdir build src
|
mkdir build src
|
||||||
cd src
|
cd src
|
||||||
ungz --file ${distfiles}/${pkg}.tar.gz --output ${pkg}.tar
|
ungz --file ${DISTFILES}/${pkg}.tar.gz --output ${pkg}.tar
|
||||||
cd ..
|
cd ..
|
||||||
|
|
||||||
cd build
|
cd build
|
||||||
|
|
@ -45,7 +45,7 @@ cc -c ext4_xattr.c
|
||||||
catm make_fiwix_initrd.c ../../../files/make_fiwix_initrd.c
|
catm make_fiwix_initrd.c ../../../files/make_fiwix_initrd.c
|
||||||
tcc -m32 -march=i386 -std=c89 -I../include -I../build_generic/include -I../../tcc/tcc-0.9.27/include -DVERSION="\"1.0\"" -c make_fiwix_initrd.c
|
tcc -m32 -march=i386 -std=c89 -I../include -I../build_generic/include -I../../tcc/tcc-0.9.27/include -DVERSION="\"1.0\"" -c make_fiwix_initrd.c
|
||||||
|
|
||||||
tcc -m32 -o ${bindir}/make_fiwix_initrd ext4.o ext4_balloc.o ext4_bcache.o ext4_bitmap.o ext4_block_group.o ext4_blockdev.o ext4_crc32.o ext4_debug.o ext4_dir.o ext4_dir_idx.o ext4_extent.o ext4_fs.o ext4_hash.o ext4_ialloc.o ext4_inode.o ext4_journal.o ext4_mbr.o ext4_mkfs.o ext4_super.o ext4_trans.o ext4_xattr.o ../blockdev/linux/file_dev.o make_fiwix_initrd.o
|
tcc -m32 -o ${BINDIR}/make_fiwix_initrd ext4.o ext4_balloc.o ext4_bcache.o ext4_bitmap.o ext4_block_group.o ext4_blockdev.o ext4_crc32.o ext4_debug.o ext4_dir.o ext4_dir_idx.o ext4_extent.o ext4_fs.o ext4_hash.o ext4_ialloc.o ext4_inode.o ext4_journal.o ext4_mbr.o ext4_mkfs.o ext4_super.o ext4_trans.o ext4_xattr.o ../blockdev/linux/file_dev.o make_fiwix_initrd.o
|
||||||
|
|
||||||
cd ../../..
|
cd ../../..
|
||||||
|
|
||||||
|
|
@ -54,7 +54,7 @@ if match x${UPDATE_CHECKSUMS} xTrue; then
|
||||||
sha256sum -o ${pkg}.checksums \
|
sha256sum -o ${pkg}.checksums \
|
||||||
/usr/bin/make_fiwix_initrd
|
/usr/bin/make_fiwix_initrd
|
||||||
|
|
||||||
cp ${pkg}.checksums ${srcdir}
|
cp ${pkg}.checksums ${SRCDIR}
|
||||||
else
|
else
|
||||||
sha256sum -c ${pkg}.checksums
|
sha256sum -c ${pkg}.checksums
|
||||||
fi
|
fi
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@ mkdir build src
|
||||||
cd build
|
cd build
|
||||||
|
|
||||||
# Extract
|
# Extract
|
||||||
unbz2 --file ${distfiles}/${pkg}.tar.bz2 --output ../src/${pkg}.tar
|
unbz2 --file ${DISTFILES}/${pkg}.tar.bz2 --output ../src/${pkg}.tar
|
||||||
untar --file ../src/${pkg}.tar
|
untar --file ../src/${pkg}.tar
|
||||||
rm ../src/${pkg}.tar
|
rm ../src/${pkg}.tar
|
||||||
cd ${pkg}
|
cd ${pkg}
|
||||||
|
|
@ -56,7 +56,7 @@ tcc -c -Iglob -DHAVE_STRDUP -DHAVE_DIRENT_H glob/glob.c
|
||||||
tcc -c putenv_stub.c
|
tcc -c putenv_stub.c
|
||||||
|
|
||||||
# Link
|
# Link
|
||||||
tcc -static -o ${bindir}/make getopt.o getopt1.o ar.o arscan.o commands.o default.o dir.o expand.o file.o function.o implicit.o job.o main.o misc.o read.o remake.o rule.o signame.o strcache.o variable.o version.o vpath.o hash.o remote-stub.o getloadavg.o fnmatch.o glob.o putenv_stub.o
|
tcc -static -o ${BINDIR}/make getopt.o getopt1.o ar.o arscan.o commands.o default.o dir.o expand.o file.o function.o implicit.o job.o main.o misc.o read.o remake.o rule.o signame.o strcache.o variable.o version.o vpath.o hash.o remote-stub.o getloadavg.o fnmatch.o glob.o putenv_stub.o
|
||||||
|
|
||||||
# Test
|
# Test
|
||||||
make --version
|
make --version
|
||||||
|
|
@ -68,7 +68,7 @@ if match x${UPDATE_CHECKSUMS} xTrue; then
|
||||||
sha256sum -o ${pkg}.checksums \
|
sha256sum -o ${pkg}.checksums \
|
||||||
/usr/bin/make
|
/usr/bin/make
|
||||||
|
|
||||||
cp ${pkg}.checksums ${srcdir}
|
cp ${pkg}.checksums ${SRCDIR}
|
||||||
else
|
else
|
||||||
sha256sum -c ${pkg}.checksums
|
sha256sum -c ${pkg}.checksums
|
||||||
fi
|
fi
|
||||||
|
|
|
||||||
|
|
@ -11,8 +11,8 @@ set -ex
|
||||||
MES_ARENA=20000000
|
MES_ARENA=20000000
|
||||||
MES_MAX_ARENA=20000000
|
MES_MAX_ARENA=20000000
|
||||||
MES_STACK=6000000
|
MES_STACK=6000000
|
||||||
MES=${bindir}/mes-m2
|
MES=${BINDIR}/mes-m2
|
||||||
libdir=${MES_PREFIX}/lib
|
LIBDIR=${MES_PREFIX}/lib
|
||||||
|
|
||||||
if match ${ARCH} x86; then
|
if match ${ARCH} x86; then
|
||||||
MES_ARCH=x86
|
MES_ARCH=x86
|
||||||
|
|
@ -34,8 +34,8 @@ sha256sum -c sources.SHA256SUM
|
||||||
# Unpack
|
# Unpack
|
||||||
mkdir src build
|
mkdir src build
|
||||||
cd src
|
cd src
|
||||||
ungz --file ${distfiles}/${NYACC_PKG}.tar.gz --output ${NYACC_PKG}.tar
|
ungz --file ${DISTFILES}/${NYACC_PKG}.tar.gz --output ${NYACC_PKG}.tar
|
||||||
ungz --file ${distfiles}/${MES_PKG}.tar.gz --output ${MES_PKG}.tar
|
ungz --file ${DISTFILES}/${MES_PKG}.tar.gz --output ${MES_PKG}.tar
|
||||||
cd ..
|
cd ..
|
||||||
|
|
||||||
cd build
|
cd build
|
||||||
|
|
@ -62,24 +62,24 @@ cp mes/module/srfi/srfi-9/gnu-struct.mes mes/module/srfi/srfi-9/gnu.mes
|
||||||
|
|
||||||
# Build mes-m2
|
# Build mes-m2
|
||||||
kaem --verbose --strict --file kaem.${MES_ARCH}
|
kaem --verbose --strict --file kaem.${MES_ARCH}
|
||||||
cp bin/mes-m2 ${bindir}/mes-m2
|
cp bin/mes-m2 ${BINDIR}/mes-m2
|
||||||
chmod 755 ${bindir}/mes-m2
|
chmod 755 ${BINDIR}/mes-m2
|
||||||
|
|
||||||
# Create mescc.scm
|
# Create mescc.scm
|
||||||
mescc_in=scripts/mescc.scm.in
|
mescc_in=scripts/mescc.scm.in
|
||||||
replace --file ${mescc_in} --output ${mescc_in} --match-on @prefix@ --replace-with ${prefix}
|
replace --file ${mescc_in} --output ${mescc_in} --match-on @prefix@ --replace-with ${PREFIX}
|
||||||
replace --file ${mescc_in} --output ${mescc_in} --match-on @VERSION@ --replace-with ${MES_VERSION}
|
replace --file ${mescc_in} --output ${mescc_in} --match-on @VERSION@ --replace-with ${MES_VERSION}
|
||||||
replace --file ${mescc_in} --output ${mescc_in} --match-on @mes_cpu@ --replace-with ${MES_ARCH}
|
replace --file ${mescc_in} --output ${mescc_in} --match-on @mes_cpu@ --replace-with ${MES_ARCH}
|
||||||
replace --file ${mescc_in} --output ${mescc_in} --match-on @mes_kernel@ --replace-with linux
|
replace --file ${mescc_in} --output ${mescc_in} --match-on @mes_kernel@ --replace-with linux
|
||||||
|
|
||||||
mescc_scm=${bindir}/mescc.scm
|
mescc_scm=${BINDIR}/mescc.scm
|
||||||
cp ${mescc_in} ${mescc_scm}
|
cp ${mescc_in} ${mescc_scm}
|
||||||
chmod 755 ${mescc_scm}
|
chmod 755 ${mescc_scm}
|
||||||
|
|
||||||
|
|
||||||
# Recompile Mes and Mes C library using mes-m2 bootstrapped Mes
|
# Recompile Mes and Mes C library using mes-m2 bootstrapped Mes
|
||||||
|
|
||||||
alias mescc="${MES} -e main ${bindir}/mescc.scm -D HAVE_CONFIG_H=1 -I include -I include/linux/${MES_ARCH} -c"
|
alias mescc="${MES} -e main ${BINDIR}/mescc.scm -D HAVE_CONFIG_H=1 -I include -I include/linux/${MES_ARCH} -c"
|
||||||
|
|
||||||
# Start with crt1.o
|
# Start with crt1.o
|
||||||
mescc lib/linux/${MES_ARCH}-mes-mescc/crt1.c -o lib/${MES_ARCH}-mes/crt1.o
|
mescc lib/linux/${MES_ARCH}-mes-mescc/crt1.c -o lib/${MES_ARCH}-mes/crt1.o
|
||||||
|
|
@ -94,13 +94,13 @@ mescc lib/linux/${MES_ARCH}-mes-mescc/_exit.c
|
||||||
mescc lib/linux/${MES_ARCH}-mes-mescc/_write.c
|
mescc lib/linux/${MES_ARCH}-mes-mescc/_write.c
|
||||||
mescc lib/stdlib/puts.c
|
mescc lib/stdlib/puts.c
|
||||||
mescc lib/string/strlen.c
|
mescc lib/string/strlen.c
|
||||||
catm ${libdir}/${MES_ARCH}-mes/libc-mini.a __init_io.o eputs.o oputs.o globals.o exit.o _exit.o _write.o puts.o strlen.o
|
catm ${LIBDIR}/${MES_ARCH}-mes/libc-mini.a __init_io.o eputs.o oputs.o globals.o exit.o _exit.o _write.o puts.o strlen.o
|
||||||
catm ${libdir}/${MES_ARCH}-mes/libc-mini.s __init_io.s eputs.s oputs.s globals.s exit.s _exit.s _write.s puts.s strlen.s
|
catm ${LIBDIR}/${MES_ARCH}-mes/libc-mini.s __init_io.s eputs.s oputs.s globals.s exit.s _exit.s _write.s puts.s strlen.s
|
||||||
|
|
||||||
# libmescc.a
|
# libmescc.a
|
||||||
mescc lib/linux/${MES_ARCH}-mes-mescc/syscall-internal.c
|
mescc lib/linux/${MES_ARCH}-mes-mescc/syscall-internal.c
|
||||||
catm ${libdir}/${MES_ARCH}-mes/libmescc.a globals.o syscall-internal.o
|
catm ${LIBDIR}/${MES_ARCH}-mes/libmescc.a globals.o syscall-internal.o
|
||||||
catm ${libdir}/${MES_ARCH}-mes/libmescc.s globals.s syscall-internal.s
|
catm ${LIBDIR}/${MES_ARCH}-mes/libmescc.s globals.s syscall-internal.s
|
||||||
|
|
||||||
# libc.a
|
# libc.a
|
||||||
mescc lib/ctype/isnumber.c
|
mescc lib/ctype/isnumber.c
|
||||||
|
|
@ -178,8 +178,8 @@ mescc lib/linux/waitpid.c
|
||||||
mescc lib/linux/${MES_ARCH}-mes-mescc/syscall.c
|
mescc lib/linux/${MES_ARCH}-mes-mescc/syscall.c
|
||||||
mescc lib/linux/getpid.c
|
mescc lib/linux/getpid.c
|
||||||
mescc lib/linux/kill.c
|
mescc lib/linux/kill.c
|
||||||
catm ${libdir}/${MES_ARCH}-mes/libc.a __init_io.o eputs.o oputs.o globals.o exit.o _exit.o _write.o puts.o strlen.o isnumber.o abtol.o cast.o eputc.o fdgetc.o fdputc.o fdputs.o fdungetc.o itoa.o ltoa.o ltoab.o mes_open.o ntoab.o oputc.o ultoa.o utoa.o isdigit.o isspace.o isxdigit.o assert_msg.o write.o atoi.o lseek.o __assert_fail.o __buffered_read.o __mes_debug.o execv.o getcwd.o getenv.o isatty.o open.o buffered-read.o setenv.o wait.o fgetc.o fputc.o fputs.o getc.o getchar.o putc.o putchar.o ungetc.o free.o malloc.o realloc.o memchr.o memcmp.o memcpy.o memmove.o memset.o strcmp.o strcpy.o strncmp.o raise.o access.o brk.o chmod.o clock_gettime.o dup.o dup2.o execve.o fork.o fsync.o _getcwd.o gettimeofday.o ioctl3.o _open3.o _read.o time.o unlink.o wait4.o waitpid.o syscall.o getpid.o kill.o
|
catm ${LIBDIR}/${MES_ARCH}-mes/libc.a __init_io.o eputs.o oputs.o globals.o exit.o _exit.o _write.o puts.o strlen.o isnumber.o abtol.o cast.o eputc.o fdgetc.o fdputc.o fdputs.o fdungetc.o itoa.o ltoa.o ltoab.o mes_open.o ntoab.o oputc.o ultoa.o utoa.o isdigit.o isspace.o isxdigit.o assert_msg.o write.o atoi.o lseek.o __assert_fail.o __buffered_read.o __mes_debug.o execv.o getcwd.o getenv.o isatty.o open.o buffered-read.o setenv.o wait.o fgetc.o fputc.o fputs.o getc.o getchar.o putc.o putchar.o ungetc.o free.o malloc.o realloc.o memchr.o memcmp.o memcpy.o memmove.o memset.o strcmp.o strcpy.o strncmp.o raise.o access.o brk.o chmod.o clock_gettime.o dup.o dup2.o execve.o fork.o fsync.o _getcwd.o gettimeofday.o ioctl3.o _open3.o _read.o time.o unlink.o wait4.o waitpid.o syscall.o getpid.o kill.o
|
||||||
catm ${libdir}/${MES_ARCH}-mes/libc.s __init_io.s eputs.s oputs.s globals.s exit.s _exit.s _write.s puts.s strlen.s isnumber.s abtol.s cast.s eputc.s fdgetc.s fdputc.s fdputs.s fdungetc.s itoa.s ltoa.s ltoab.s mes_open.s ntoab.s oputc.s ultoa.s utoa.s isdigit.s isspace.s isxdigit.s assert_msg.s write.s atoi.s lseek.s __assert_fail.s __buffered_read.s __mes_debug.s execv.s getcwd.s getenv.s isatty.s open.s buffered-read.s setenv.s wait.s fgetc.s fputc.s fputs.s getc.s getchar.s putc.s putchar.s ungetc.s free.s malloc.s realloc.s memchr.s memcmp.s memcpy.s memmove.s memset.s strcmp.s strcpy.s strncmp.s raise.s access.s brk.s chmod.s clock_gettime.s dup.s dup2.s execve.s fork.s fsync.s _getcwd.s gettimeofday.s ioctl3.s _open3.s _read.s time.s unlink.s wait4.s waitpid.s syscall.s getpid.s kill.s
|
catm ${LIBDIR}/${MES_ARCH}-mes/libc.s __init_io.s eputs.s oputs.s globals.s exit.s _exit.s _write.s puts.s strlen.s isnumber.s abtol.s cast.s eputc.s fdgetc.s fdputc.s fdputs.s fdungetc.s itoa.s ltoa.s ltoab.s mes_open.s ntoab.s oputc.s ultoa.s utoa.s isdigit.s isspace.s isxdigit.s assert_msg.s write.s atoi.s lseek.s __assert_fail.s __buffered_read.s __mes_debug.s execv.s getcwd.s getenv.s isatty.s open.s buffered-read.s setenv.s wait.s fgetc.s fputc.s fputs.s getc.s getchar.s putc.s putchar.s ungetc.s free.s malloc.s realloc.s memchr.s memcmp.s memcpy.s memmove.s memset.s strcmp.s strcpy.s strncmp.s raise.s access.s brk.s chmod.s clock_gettime.s dup.s dup2.s execve.s fork.s fsync.s _getcwd.s gettimeofday.s ioctl3.s _open3.s _read.s time.s unlink.s wait4.s waitpid.s syscall.s getpid.s kill.s
|
||||||
|
|
||||||
# Build mes itself
|
# Build mes itself
|
||||||
mescc src/builtins.c
|
mescc src/builtins.c
|
||||||
|
|
@ -203,10 +203,10 @@ mescc src/symbol.c
|
||||||
mescc src/vector.c
|
mescc src/vector.c
|
||||||
|
|
||||||
# Link everything into new mes executable
|
# Link everything into new mes executable
|
||||||
${MES} -e main ${mescc_scm} -- --base-address 0x08048000 -L ${libdir} -o ${bindir}/mes builtins.o cc.o core.o display.o eval-apply.o gc.o globals.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} -e main ${mescc_scm} -- --base-address 0x08048000 -L ${LIBDIR} -o ${BINDIR}/mes builtins.o cc.o core.o display.o eval-apply.o gc.o globals.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
|
||||||
|
|
||||||
# libc+tcc.a
|
# libc+tcc.a
|
||||||
alias mescc="${bindir}/mes -e main ${bindir}/mescc.scm -D HAVE_CONFIG_H=1 -I include -I include/linux/${MES_ARCH} -c"
|
alias mescc="${BINDIR}/mes -e main ${BINDIR}/mescc.scm -D HAVE_CONFIG_H=1 -I include -I include/linux/${MES_ARCH} -c"
|
||||||
mescc lib/ctype/islower.c
|
mescc lib/ctype/islower.c
|
||||||
mescc lib/ctype/isupper.c
|
mescc lib/ctype/isupper.c
|
||||||
mescc lib/ctype/tolower.c
|
mescc lib/ctype/tolower.c
|
||||||
|
|
@ -262,96 +262,96 @@ mescc lib/${MES_ARCH}-mes-mescc/setjmp.c
|
||||||
mescc lib/linux/close.c
|
mescc lib/linux/close.c
|
||||||
mescc lib/linux/rmdir.c
|
mescc lib/linux/rmdir.c
|
||||||
mescc lib/linux/stat.c
|
mescc lib/linux/stat.c
|
||||||
catm ${libdir}/${MES_ARCH}-mes/libc+tcc.a ${libdir}/${MES_ARCH}-mes/libc.a islower.o isupper.o tolower.o toupper.o abtod.o dtoab.o search-path.o execvp.o fclose.o fdopen.o ferror.o fflush.o fopen.o fprintf.o fread.o fseek.o ftell.o fwrite.o printf.o remove.o snprintf.o sprintf.o sscanf.o vfprintf.o vprintf.o vsnprintf.o vsprintf.o vsscanf.o calloc.o qsort.o strtod.o strtof.o strtol.o strtold.o strtoll.o strtoul.o strtoull.o memmem.o strcat.o strchr.o strlwr.o strncpy.o strrchr.o strstr.o strupr.o sigaction.o ldexp.o mprotect.o localtime.o sigemptyset.o setjmp.o close.o rmdir.o stat.o
|
catm ${LIBDIR}/${MES_ARCH}-mes/libc+tcc.a ${LIBDIR}/${MES_ARCH}-mes/libc.a islower.o isupper.o tolower.o toupper.o abtod.o dtoab.o search-path.o execvp.o fclose.o fdopen.o ferror.o fflush.o fopen.o fprintf.o fread.o fseek.o ftell.o fwrite.o printf.o remove.o snprintf.o sprintf.o sscanf.o vfprintf.o vprintf.o vsnprintf.o vsprintf.o vsscanf.o calloc.o qsort.o strtod.o strtof.o strtol.o strtold.o strtoll.o strtoul.o strtoull.o memmem.o strcat.o strchr.o strlwr.o strncpy.o strrchr.o strstr.o strupr.o sigaction.o ldexp.o mprotect.o localtime.o sigemptyset.o setjmp.o close.o rmdir.o stat.o
|
||||||
catm ${libdir}/${MES_ARCH}-mes/libc+tcc.s ${libdir}/${MES_ARCH}-mes/libc.s islower.s isupper.s tolower.s toupper.s abtod.s dtoab.s search-path.s execvp.s fclose.s fdopen.s ferror.s fflush.s fopen.s fprintf.s fread.s fseek.s ftell.s fwrite.s printf.s remove.s snprintf.s sprintf.s sscanf.s vfprintf.s vprintf.s vsnprintf.s vsprintf.s vsscanf.s calloc.s qsort.s strtod.s strtof.s strtol.s strtold.s strtoll.s strtoul.s strtoull.s memmem.s strcat.s strchr.s strlwr.s strncpy.s strrchr.s strstr.s strupr.s sigaction.s ldexp.s mprotect.s localtime.s sigemptyset.s setjmp.s close.s rmdir.s stat.s
|
catm ${LIBDIR}/${MES_ARCH}-mes/libc+tcc.s ${LIBDIR}/${MES_ARCH}-mes/libc.s islower.s isupper.s tolower.s toupper.s abtod.s dtoab.s search-path.s execvp.s fclose.s fdopen.s ferror.s fflush.s fopen.s fprintf.s fread.s fseek.s ftell.s fwrite.s printf.s remove.s snprintf.s sprintf.s sscanf.s vfprintf.s vprintf.s vsnprintf.s vsprintf.s vsscanf.s calloc.s qsort.s strtod.s strtof.s strtol.s strtold.s strtoll.s strtoul.s strtoull.s memmem.s strcat.s strchr.s strlwr.s strncpy.s strrchr.s strstr.s strupr.s sigaction.s ldexp.s mprotect.s localtime.s sigemptyset.s setjmp.s close.s rmdir.s stat.s
|
||||||
|
|
||||||
# Make directories
|
# Make directories
|
||||||
mkdir ${prefix}/lib/linux ${incdir}/mes ${incdir}/sys ${incdir}/linux ${incdir}/arch
|
mkdir ${PREFIX}/lib/linux ${INCDIR}/mes ${INCDIR}/sys ${INCDIR}/linux ${INCDIR}/arch
|
||||||
mkdir ${prefix}/lib/${MES_ARCH}-mes ${prefix}/lib/linux/${MES_ARCH}-mes ${incdir}/linux/${MES_ARCH}
|
mkdir ${PREFIX}/lib/${MES_ARCH}-mes ${PREFIX}/lib/linux/${MES_ARCH}-mes ${INCDIR}/linux/${MES_ARCH}
|
||||||
|
|
||||||
# Install libraries
|
# Install libraries
|
||||||
cp ${libdir}/${MES_ARCH}-mes/libc.a ${prefix}/lib/${MES_ARCH}-mes/
|
cp ${LIBDIR}/${MES_ARCH}-mes/libc.a ${PREFIX}/lib/${MES_ARCH}-mes/
|
||||||
cp ${libdir}/${MES_ARCH}-mes/libc+tcc.a ${prefix}/lib/${MES_ARCH}-mes/
|
cp ${LIBDIR}/${MES_ARCH}-mes/libc+tcc.a ${PREFIX}/lib/${MES_ARCH}-mes/
|
||||||
cp ${libdir}/${MES_ARCH}-mes/libmescc.a ${prefix}/lib/${MES_ARCH}-mes/
|
cp ${LIBDIR}/${MES_ARCH}-mes/libmescc.a ${PREFIX}/lib/${MES_ARCH}-mes/
|
||||||
cp ${libdir}/${MES_ARCH}-mes/libc.s ${prefix}/lib/${MES_ARCH}-mes/
|
cp ${LIBDIR}/${MES_ARCH}-mes/libc.s ${PREFIX}/lib/${MES_ARCH}-mes/
|
||||||
cp ${libdir}/${MES_ARCH}-mes/libc+tcc.s ${prefix}/lib/${MES_ARCH}-mes/
|
cp ${LIBDIR}/${MES_ARCH}-mes/libc+tcc.s ${PREFIX}/lib/${MES_ARCH}-mes/
|
||||||
cp ${libdir}/${MES_ARCH}-mes/libmescc.s ${prefix}/lib/${MES_ARCH}-mes/
|
cp ${LIBDIR}/${MES_ARCH}-mes/libmescc.s ${PREFIX}/lib/${MES_ARCH}-mes/
|
||||||
cp ${libdir}/${MES_ARCH}-mes/${MES_ARCH}.M1 ${prefix}/lib/${MES_ARCH}-mes/
|
cp ${LIBDIR}/${MES_ARCH}-mes/${MES_ARCH}.M1 ${PREFIX}/lib/${MES_ARCH}-mes/
|
||||||
cp ${libdir}/${MES_ARCH}-mes/crt1.o ${prefix}/lib/${MES_ARCH}-mes/
|
cp ${LIBDIR}/${MES_ARCH}-mes/crt1.o ${PREFIX}/lib/${MES_ARCH}-mes/
|
||||||
cp ${libdir}/${MES_ARCH}-mes/crt1.s ${prefix}/lib/${MES_ARCH}-mes/
|
cp ${LIBDIR}/${MES_ARCH}-mes/crt1.s ${PREFIX}/lib/${MES_ARCH}-mes/
|
||||||
cp ${libdir}/linux/${MES_ARCH}-mes/elf${ARCH_BITS}-footer-single-main.hex2 ${prefix}/lib/linux/${MES_ARCH}-mes/
|
cp ${LIBDIR}/linux/${MES_ARCH}-mes/elf${ARCH_BITS}-footer-single-main.hex2 ${PREFIX}/lib/linux/${MES_ARCH}-mes/
|
||||||
cp ${libdir}/linux/${MES_ARCH}-mes/elf${ARCH_BITS}-header.hex2 ${prefix}/lib/linux/${MES_ARCH}-mes/
|
cp ${LIBDIR}/linux/${MES_ARCH}-mes/elf${ARCH_BITS}-header.hex2 ${PREFIX}/lib/linux/${MES_ARCH}-mes/
|
||||||
|
|
||||||
# Install header files
|
# Install header files
|
||||||
cp include/alloca.h ${incdir}/alloca.h
|
cp include/alloca.h ${INCDIR}/alloca.h
|
||||||
cp include/argz.h ${incdir}/argz.h
|
cp include/argz.h ${INCDIR}/argz.h
|
||||||
cp include/ar.h ${incdir}/ar.h
|
cp include/ar.h ${INCDIR}/ar.h
|
||||||
cp include/assert.h ${incdir}/assert.h
|
cp include/assert.h ${INCDIR}/assert.h
|
||||||
cp include/ctype.h ${incdir}/ctype.h
|
cp include/ctype.h ${INCDIR}/ctype.h
|
||||||
cp include/dirent.h ${incdir}/dirent.h
|
cp include/dirent.h ${INCDIR}/dirent.h
|
||||||
cp include/dirstream.h ${incdir}/dirstream.h
|
cp include/dirstream.h ${INCDIR}/dirstream.h
|
||||||
cp include/dlfcn.h ${incdir}/dlfcn.h
|
cp include/dlfcn.h ${INCDIR}/dlfcn.h
|
||||||
cp include/endian.h ${incdir}/endian.h
|
cp include/endian.h ${INCDIR}/endian.h
|
||||||
cp include/errno.h ${incdir}/errno.h
|
cp include/errno.h ${INCDIR}/errno.h
|
||||||
cp include/fcntl.h ${incdir}/fcntl.h
|
cp include/fcntl.h ${INCDIR}/fcntl.h
|
||||||
cp include/features.h ${incdir}/features.h
|
cp include/features.h ${INCDIR}/features.h
|
||||||
cp include/float.h ${incdir}/float.h
|
cp include/float.h ${INCDIR}/float.h
|
||||||
cp include/getopt.h ${incdir}/getopt.h
|
cp include/getopt.h ${INCDIR}/getopt.h
|
||||||
cp include/grp.h ${incdir}/grp.h
|
cp include/grp.h ${INCDIR}/grp.h
|
||||||
cp include/inttypes.h ${incdir}/inttypes.h
|
cp include/inttypes.h ${INCDIR}/inttypes.h
|
||||||
cp include/libgen.h ${incdir}/libgen.h
|
cp include/libgen.h ${INCDIR}/libgen.h
|
||||||
cp include/limits.h ${incdir}/limits.h
|
cp include/limits.h ${INCDIR}/limits.h
|
||||||
cp include/locale.h ${incdir}/locale.h
|
cp include/locale.h ${INCDIR}/locale.h
|
||||||
cp include/math.h ${incdir}/math.h
|
cp include/math.h ${INCDIR}/math.h
|
||||||
cp include/memory.h ${incdir}/memory.h
|
cp include/memory.h ${INCDIR}/memory.h
|
||||||
cp include/pwd.h ${incdir}/pwd.h
|
cp include/pwd.h ${INCDIR}/pwd.h
|
||||||
cp include/setjmp.h ${incdir}/setjmp.h
|
cp include/setjmp.h ${INCDIR}/setjmp.h
|
||||||
cp include/signal.h ${incdir}/signal.h
|
cp include/signal.h ${INCDIR}/signal.h
|
||||||
cp include/stdarg.h ${incdir}/stdarg.h
|
cp include/stdarg.h ${INCDIR}/stdarg.h
|
||||||
cp include/stdbool.h ${incdir}/stdbool.h
|
cp include/stdbool.h ${INCDIR}/stdbool.h
|
||||||
cp include/stddef.h ${incdir}/stddef.h
|
cp include/stddef.h ${INCDIR}/stddef.h
|
||||||
cp include/stdint.h ${incdir}/stdint.h
|
cp include/stdint.h ${INCDIR}/stdint.h
|
||||||
cp include/stdio.h ${incdir}/stdio.h
|
cp include/stdio.h ${INCDIR}/stdio.h
|
||||||
cp include/stdlib.h ${incdir}/stdlib.h
|
cp include/stdlib.h ${INCDIR}/stdlib.h
|
||||||
cp include/stdnoreturn.h ${incdir}/stdnoreturn.h
|
cp include/stdnoreturn.h ${INCDIR}/stdnoreturn.h
|
||||||
cp include/string.h ${incdir}/string.h
|
cp include/string.h ${INCDIR}/string.h
|
||||||
cp include/strings.h ${incdir}/strings.h
|
cp include/strings.h ${INCDIR}/strings.h
|
||||||
cp include/termio.h ${incdir}/termio.h
|
cp include/termio.h ${INCDIR}/termio.h
|
||||||
cp include/time.h ${incdir}/time.h
|
cp include/time.h ${INCDIR}/time.h
|
||||||
cp include/unistd.h ${incdir}/unistd.h
|
cp include/unistd.h ${INCDIR}/unistd.h
|
||||||
|
|
||||||
cp include/arch/kernel-stat.h ${incdir}/arch/kernel-stat.h
|
cp include/arch/kernel-stat.h ${INCDIR}/arch/kernel-stat.h
|
||||||
cp include/arch/syscall.h ${incdir}/arch/syscall.h
|
cp include/arch/syscall.h ${INCDIR}/arch/syscall.h
|
||||||
|
|
||||||
cp include/linux/syscall.h ${incdir}/linux/syscall.h
|
cp include/linux/syscall.h ${INCDIR}/linux/syscall.h
|
||||||
cp include/linux/${MES_ARCH}/syscall.h ${incdir}/linux/${MES_ARCH}/syscall.h
|
cp include/linux/${MES_ARCH}/syscall.h ${INCDIR}/linux/${MES_ARCH}/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
|
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-cc.h ${incdir}/mes/lib-cc.h
|
cp include/mes/lib-cc.h ${INCDIR}/mes/lib-cc.h
|
||||||
cp include/mes/lib-mini.h ${incdir}/mes/lib-mini.h
|
cp include/mes/lib-mini.h ${INCDIR}/mes/lib-mini.h
|
||||||
cp include/mes/mes.h ${incdir}/mes/mes.h
|
cp include/mes/mes.h ${INCDIR}/mes/mes.h
|
||||||
cp include/mes/symbols.h ${incdir}/mes/symbols.h
|
cp include/mes/symbols.h ${INCDIR}/mes/symbols.h
|
||||||
|
|
||||||
cp include/sys/cdefs.h ${incdir}/sys/cdefs.h
|
cp include/sys/cdefs.h ${INCDIR}/sys/cdefs.h
|
||||||
cp include/sys/dir.h ${incdir}/sys/dir.h
|
cp include/sys/dir.h ${INCDIR}/sys/dir.h
|
||||||
cp include/sys/file.h ${incdir}/sys/file.h
|
cp include/sys/file.h ${INCDIR}/sys/file.h
|
||||||
cp include/sys/ioctl.h ${incdir}/sys/ioctl.h
|
cp include/sys/ioctl.h ${INCDIR}/sys/ioctl.h
|
||||||
cp include/sys/mman.h ${incdir}/sys/mman.h
|
cp include/sys/mman.h ${INCDIR}/sys/mman.h
|
||||||
cp include/sys/param.h ${incdir}/sys/param.h
|
cp include/sys/param.h ${INCDIR}/sys/param.h
|
||||||
cp include/sys/resource.h ${incdir}/sys/resource.h
|
cp include/sys/resource.h ${INCDIR}/sys/resource.h
|
||||||
cp include/sys/select.h ${incdir}/sys/select.h
|
cp include/sys/select.h ${INCDIR}/sys/select.h
|
||||||
cp include/sys/stat.h ${incdir}/sys/stat.h
|
cp include/sys/stat.h ${INCDIR}/sys/stat.h
|
||||||
cp include/sys/timeb.h ${incdir}/sys/timeb.h
|
cp include/sys/timeb.h ${INCDIR}/sys/timeb.h
|
||||||
cp include/sys/time.h ${incdir}/sys/time.h
|
cp include/sys/time.h ${INCDIR}/sys/time.h
|
||||||
cp include/sys/times.h ${incdir}/sys/times.h
|
cp include/sys/times.h ${INCDIR}/sys/times.h
|
||||||
cp include/sys/types.h ${incdir}/sys/types.h
|
cp include/sys/types.h ${INCDIR}/sys/types.h
|
||||||
cp include/sys/ucontext.h ${incdir}/sys/ucontext.h
|
cp include/sys/ucontext.h ${INCDIR}/sys/ucontext.h
|
||||||
cp include/sys/user.h ${incdir}/sys/user.h
|
cp include/sys/user.h ${INCDIR}/sys/user.h
|
||||||
cp include/sys/wait.h ${incdir}/sys/wait.h
|
cp include/sys/wait.h ${INCDIR}/sys/wait.h
|
||||||
|
|
||||||
cd ../..
|
cd ../..
|
||||||
|
|
||||||
|
|
@ -373,7 +373,7 @@ if match x${UPDATE_CHECKSUMS} xTrue; then
|
||||||
/usr/lib/linux/${MES_ARCH}-mes/elf${ARCH_BITS}-header.hex2 \
|
/usr/lib/linux/${MES_ARCH}-mes/elf${ARCH_BITS}-header.hex2 \
|
||||||
/usr/lib/linux/${MES_ARCH}-mes/elf${ARCH_BITS}-footer-single-main.hex2
|
/usr/lib/linux/${MES_ARCH}-mes/elf${ARCH_BITS}-footer-single-main.hex2
|
||||||
|
|
||||||
cp ${pkg}.${ARCH}.checksums ${srcdir}
|
cp ${pkg}.${ARCH}.checksums ${SRCDIR}
|
||||||
else
|
else
|
||||||
sha256sum -c ${pkg}.${ARCH}.checksums
|
sha256sum -c ${pkg}.${ARCH}.checksums
|
||||||
fi
|
fi
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@ mkdir build src
|
||||||
cd build
|
cd build
|
||||||
|
|
||||||
# Extract
|
# Extract
|
||||||
cp ${distfiles}/${pkg}.tar.gz ../src/
|
cp ${DISTFILES}/${pkg}.tar.gz ../src/
|
||||||
ungz --file ../src/${pkg}.tar.gz --output ../src/${pkg}.tar
|
ungz --file ../src/${pkg}.tar.gz --output ../src/${pkg}.tar
|
||||||
untar --file ../src/${pkg}.tar
|
untar --file ../src/${pkg}.tar
|
||||||
cd ${pkg}
|
cd ${pkg}
|
||||||
|
|
@ -25,11 +25,11 @@ catm config.h
|
||||||
catm patchlevel.h
|
catm patchlevel.h
|
||||||
|
|
||||||
# Build
|
# Build
|
||||||
make -f Makefile PREFIX=${prefix}
|
make -f Makefile PREFIX=${PREFIX}
|
||||||
|
|
||||||
# Install
|
# Install
|
||||||
cp patch ${prefix}/bin/patch
|
cp patch ${PREFIX}/bin/patch
|
||||||
chmod 755 ${prefix}/bin/patch
|
chmod 755 ${PREFIX}/bin/patch
|
||||||
|
|
||||||
cd ../..
|
cd ../..
|
||||||
|
|
||||||
|
|
@ -38,7 +38,7 @@ if match x${UPDATE_CHECKSUMS} xTrue; then
|
||||||
sha256sum -o ${pkg}.checksums \
|
sha256sum -o ${pkg}.checksums \
|
||||||
/usr/bin/patch
|
/usr/bin/patch
|
||||||
|
|
||||||
cp ${pkg}.checksums ${srcdir}
|
cp ${pkg}.checksums ${SRCDIR}
|
||||||
else
|
else
|
||||||
sha256sum -c ${pkg}.checksums
|
sha256sum -c ${pkg}.checksums
|
||||||
fi
|
fi
|
||||||
|
|
|
||||||
|
|
@ -21,18 +21,16 @@ BINDIR="${ARCH_DIR}/bin"
|
||||||
BUILDDIR="${ARCH_DIR}/artifact"
|
BUILDDIR="${ARCH_DIR}/artifact"
|
||||||
|
|
||||||
sysa=/sysa
|
sysa=/sysa
|
||||||
distfiles=/sysa/distfiles
|
DISTFILES=/sysa/distfiles
|
||||||
prefix=/usr
|
PREFIX=/usr
|
||||||
bindir=${prefix}/bin
|
BINDIR=${PREFIX}/bin
|
||||||
libdir=${prefix}/lib
|
LIBDIR=${PREFIX}/lib/mes
|
||||||
incdir=${prefix}/include
|
INCDIR=${PREFIX}/include
|
||||||
srcdir=${prefix}/src
|
SRCDIR=${PREFIX}/src
|
||||||
TMPDIR=/tmp # tmpdir is needed for patch to work
|
TMPDIR=/tmp # tmpdir is needed for patch to work
|
||||||
|
|
||||||
PATH=/usr/bin
|
PATH=/usr/bin
|
||||||
|
|
||||||
libdir=${libdir}/mes
|
|
||||||
|
|
||||||
# make
|
# make
|
||||||
pkg="make-3.82"
|
pkg="make-3.82"
|
||||||
cd ${pkg}
|
cd ${pkg}
|
||||||
|
|
|
||||||
|
|
@ -11,11 +11,11 @@ set -ex
|
||||||
|
|
||||||
# checksum-transcriber utility
|
# checksum-transcriber utility
|
||||||
M2LIBC_PATH=/M2libc
|
M2LIBC_PATH=/M2libc
|
||||||
M2-Mesoplanet --architecture ${ARCH} -f checksum-transcriber.c -o ${bindir}/checksum-transcriber
|
M2-Mesoplanet --architecture ${ARCH} -f checksum-transcriber.c -o ${BINDIR}/checksum-transcriber
|
||||||
sha256sum -c checksum-transcriber.${ARCH}.SHA256SUM
|
sha256sum -c checksum-transcriber.${ARCH}.SHA256SUM
|
||||||
|
|
||||||
# simple patch tool based on before and after chunks
|
# simple patch tool based on before and after chunks
|
||||||
M2-Mesoplanet --architecture ${ARCH} -f simple-patch.c -o ${bindir}/simple-patch
|
M2-Mesoplanet --architecture ${ARCH} -f simple-patch.c -o ${BINDIR}/simple-patch
|
||||||
|
|
||||||
# Environmental variables needed for mes
|
# Environmental variables needed for mes
|
||||||
NYACC_PKG=nyacc-1.00.2
|
NYACC_PKG=nyacc-1.00.2
|
||||||
|
|
@ -37,7 +37,7 @@ cd ${pkg}
|
||||||
kaem --file ${pkg}.kaem
|
kaem --file ${pkg}.kaem
|
||||||
cd ..
|
cd ..
|
||||||
|
|
||||||
libdir=${libdir}/mes
|
LIBDIR=${LIBDIR}/mes
|
||||||
|
|
||||||
# tcc 0.9.27
|
# tcc 0.9.27
|
||||||
pkg="tcc-0.9.27"
|
pkg="tcc-0.9.27"
|
||||||
|
|
|
||||||
|
|
@ -8,15 +8,12 @@
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
# shellcheck disable=SC2154
|
# shellcheck disable=SC2153
|
||||||
PREFIX="${prefix}"
|
|
||||||
LIBDIR="${PREFIX}/lib/mes"
|
LIBDIR="${PREFIX}/lib/mes"
|
||||||
# shellcheck disable=SC2154
|
# shellcheck disable=SC2154
|
||||||
SOURCES="${sysa}"
|
SOURCES="${sysa}"
|
||||||
DISTFILES="${sysa}/distfiles"
|
DISTFILES="${sysa}/distfiles"
|
||||||
DESTDIR=/tmp/destdir
|
DESTDIR=/tmp/destdir
|
||||||
# shellcheck disable=SC2154
|
|
||||||
SRCDIR="${srcdir}"
|
|
||||||
|
|
||||||
# shellcheck source=sysa/helpers.sh
|
# shellcheck source=sysa/helpers.sh
|
||||||
. helpers.sh
|
. helpers.sh
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@ mkdir build src
|
||||||
cd build
|
cd build
|
||||||
|
|
||||||
# Extract
|
# Extract
|
||||||
cp ${distfiles}/${pkg}.tar.gz ../src/
|
cp ${DISTFILES}/${pkg}.tar.gz ../src/
|
||||||
gzip -d -f ../src/${pkg}.tar.gz
|
gzip -d -f ../src/${pkg}.tar.gz
|
||||||
tar xf ../src/${pkg}.tar
|
tar xf ../src/${pkg}.tar
|
||||||
cd ${pkg}
|
cd ${pkg}
|
||||||
|
|
@ -29,8 +29,8 @@ catm config.h
|
||||||
make -f Makefile LIBC=mes
|
make -f Makefile LIBC=mes
|
||||||
|
|
||||||
# Install
|
# Install
|
||||||
cp sed/sed ${prefix}/bin/sed
|
cp sed/sed ${PREFIX}/bin/sed
|
||||||
chmod 755 ${prefix}/bin/sed
|
chmod 755 ${PREFIX}/bin/sed
|
||||||
|
|
||||||
cd ../..
|
cd ../..
|
||||||
|
|
||||||
|
|
@ -39,7 +39,7 @@ if match x${UPDATE_CHECKSUMS} xTrue; then
|
||||||
sha256sum -o ${pkg}.checksums \
|
sha256sum -o ${pkg}.checksums \
|
||||||
/usr/bin/sed
|
/usr/bin/sed
|
||||||
|
|
||||||
cp ${pkg}.checksums ${srcdir}
|
cp ${pkg}.checksums ${SRCDIR}
|
||||||
else
|
else
|
||||||
sha256sum -c ${pkg}.checksums
|
sha256sum -c ${pkg}.checksums
|
||||||
fi
|
fi
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@ mkdir build src
|
||||||
cd build
|
cd build
|
||||||
|
|
||||||
# Extract
|
# Extract
|
||||||
cp ${distfiles}/${pkg}.tar.gz ../src/
|
cp ${DISTFILES}/${pkg}.tar.gz ../src/
|
||||||
gzip -d -f ../src/${pkg}.tar.gz
|
gzip -d -f ../src/${pkg}.tar.gz
|
||||||
untar --file ../src/${pkg}.tar
|
untar --file ../src/${pkg}.tar
|
||||||
rm ../src/${pkg}.tar
|
rm ../src/${pkg}.tar
|
||||||
|
|
@ -33,8 +33,8 @@ cp src/create.c.new src/create.c
|
||||||
make -f Makefile
|
make -f Makefile
|
||||||
|
|
||||||
# Install
|
# Install
|
||||||
cp tar ${prefix}/bin/tar
|
cp tar ${PREFIX}/bin/tar
|
||||||
chmod 755 ${prefix}/bin/tar
|
chmod 755 ${PREFIX}/bin/tar
|
||||||
|
|
||||||
cd ../..
|
cd ../..
|
||||||
|
|
||||||
|
|
@ -43,7 +43,7 @@ if match x${UPDATE_CHECKSUMS} xTrue; then
|
||||||
sha256sum -o ${pkg}.checksums \
|
sha256sum -o ${pkg}.checksums \
|
||||||
/usr/bin/tar
|
/usr/bin/tar
|
||||||
|
|
||||||
cp ${pkg}.checksums ${srcdir}
|
cp ${pkg}.checksums ${SRCDIR}
|
||||||
else
|
else
|
||||||
sha256sum -c ${pkg}.checksums
|
sha256sum -c ${pkg}.checksums
|
||||||
fi
|
fi
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ MES_ARENA=30000000
|
||||||
MES_MAX_ARENA=30000000
|
MES_MAX_ARENA=30000000
|
||||||
MES_LIB=${MES_PREFIX}/lib
|
MES_LIB=${MES_PREFIX}/lib
|
||||||
MES_SOURCE=${MES_PREFIX}
|
MES_SOURCE=${MES_PREFIX}
|
||||||
MES=${bindir}/mes
|
MES=${BINDIR}/mes
|
||||||
|
|
||||||
TCC_TAR=tcc-0.9.26
|
TCC_TAR=tcc-0.9.26
|
||||||
TCC_PKG=tcc-0.9.26-1147-gee75a10c
|
TCC_PKG=tcc-0.9.26-1147-gee75a10c
|
||||||
|
|
@ -25,8 +25,8 @@ sha256sum -c sources.SHA256SUM
|
||||||
mkdir src build
|
mkdir src build
|
||||||
|
|
||||||
cd src
|
cd src
|
||||||
ungz --file ${distfiles}/${TCC_TAR}.tar.gz --output ${TCC_TAR}.tar
|
ungz --file ${DISTFILES}/${TCC_TAR}.tar.gz --output ${TCC_TAR}.tar
|
||||||
ungz --file ${distfiles}/${MES_PKG}.tar.gz --output ${MES_PKG}.tar
|
ungz --file ${DISTFILES}/${MES_PKG}.tar.gz --output ${MES_PKG}.tar
|
||||||
cd ..
|
cd ..
|
||||||
|
|
||||||
cd build
|
cd build
|
||||||
|
|
@ -63,21 +63,21 @@ if match ${ARCH} riscv64; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
${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 ${incdir} \
|
-I ${INCDIR} \
|
||||||
-D BOOTSTRAP=1 \
|
-D BOOTSTRAP=1 \
|
||||||
-D HAVE_LONG_LONG=${HAVE_LONG_LONG} \
|
-D HAVE_LONG_LONG=${HAVE_LONG_LONG} \
|
||||||
-I . \
|
-I . \
|
||||||
-D TCC_TARGET_${TCC_TARGET_ARCH}=1 \
|
-D TCC_TARGET_${TCC_TARGET_ARCH}=1 \
|
||||||
-D inline= \
|
-D inline= \
|
||||||
-D CONFIG_TCCDIR=\"${libdir}/mes/tcc\" \
|
-D CONFIG_TCCDIR=\"${LIBDIR}/tcc\" \
|
||||||
-D CONFIG_SYSROOT=\"/\" \
|
-D CONFIG_SYSROOT=\"/\" \
|
||||||
-D CONFIG_TCC_CRTPREFIX=\"${libdir}/mes\" \
|
-D CONFIG_TCC_CRTPREFIX=\"${LIBDIR}\" \
|
||||||
-D CONFIG_TCC_ELFINTERP=\"/mes/loader\" \
|
-D CONFIG_TCC_ELFINTERP=\"/mes/loader\" \
|
||||||
-D CONFIG_TCC_SYSINCLUDEPATHS=\"${prefix}/mes/include:${prefix}/include\" \
|
-D CONFIG_TCC_SYSINCLUDEPATHS=\"${PREFIX}/mes/include:${PREFIX}/include\"
|
||||||
-D TCC_LIBGCC=\"${libdir}/mes/libc.a\" \
|
-D TCC_LIBGCC=\"${LIBDIR}/libc.a\" \
|
||||||
-D CONFIG_TCC_LIBTCC1_MES=0 \
|
-D CONFIG_TCC_LIBTCC1_MES=0 \
|
||||||
-D CONFIG_TCCBOOT=1 \
|
-D CONFIG_TCCBOOT=1 \
|
||||||
-D CONFIG_TCC_STATIC=1 \
|
-D CONFIG_TCC_STATIC=1 \
|
||||||
|
|
@ -85,24 +85,20 @@ ${MES} --no-auto-compile -e main ${bindir}/mescc.scm -- \
|
||||||
-D TCC_VERSION=\"0.9.26\" \
|
-D TCC_VERSION=\"0.9.26\" \
|
||||||
-D ONE_SOURCE=1 \
|
-D ONE_SOURCE=1 \
|
||||||
tcc.c
|
tcc.c
|
||||||
${MES} --no-auto-compile -e main ${bindir}/mescc.scm -- \
|
${MES} --no-auto-compile -e main ${BINDIR}/mescc.scm -- \
|
||||||
--base-address 0x08048000 \
|
--base-address 0x08048000 \
|
||||||
-o tcc-mes \
|
-o tcc-mes \
|
||||||
-L ${libdir} \
|
-L ${LIBDIR} \
|
||||||
tcc.s \
|
tcc.s \
|
||||||
-l c+tcc
|
-l c+tcc
|
||||||
cp tcc-mes ${bindir}/
|
cp tcc-mes ${BINDIR}/
|
||||||
chmod 755 ${bindir}/tcc-mes
|
chmod 755 ${BINDIR}/tcc-mes
|
||||||
|
|
||||||
# Install libc into a subdirectory
|
|
||||||
libdir=${libdir}/mes
|
|
||||||
mkdir ${libdir}
|
|
||||||
|
|
||||||
# test tcc-mes
|
# test tcc-mes
|
||||||
tcc-mes -version
|
tcc-mes -version
|
||||||
|
|
||||||
# Recompile the mes C library
|
# Recompile the mes C library
|
||||||
cd ../${MES_PKG_DIR}
|
cd ../${MES_PKG}
|
||||||
|
|
||||||
# Create unified libc file
|
# Create unified libc file
|
||||||
cd lib
|
cd lib
|
||||||
|
|
@ -110,35 +106,35 @@ catm ../unified-libc.c ctype/isalnum.c ctype/isalpha.c ctype/isascii.c ctype/isc
|
||||||
cd ..
|
cd ..
|
||||||
|
|
||||||
# crt1.o
|
# crt1.o
|
||||||
tcc-mes -c -D HAVE_CONFIG_H=1 -I include -I include/linux/${MES_ARCH} -o ${libdir}/crt1.o lib/linux/${MES_ARCH}-mes-${MES_LIBC_SUFFIX}/crt1.c
|
tcc-mes -c -D HAVE_CONFIG_H=1 -I include -I include/linux/${MES_ARCH} -o ${LIBDIR}/crt1.o lib/linux/${MES_ARCH}-mes-${MES_LIBC_SUFFIX}/crt1.c
|
||||||
|
|
||||||
catm ${libdir}/crtn.o
|
catm ${LIBDIR}/crtn.o
|
||||||
catm ${libdir}/crti.o
|
catm ${LIBDIR}/crti.o
|
||||||
if match ${ARCH} x86; then
|
if match ${ARCH} x86; then
|
||||||
# crtn.o
|
# crtn.o
|
||||||
tcc-mes -c -D HAVE_CONFIG_H=1 -I include -I include/linux/${MES_ARCH} -o ${libdir}/crtn.o lib/linux/${MES_ARCH}-mes-gcc/crtn.c
|
tcc-mes -c -D HAVE_CONFIG_H=1 -I include -I include/linux/${MES_ARCH} -o ${LIBDIR}/crtn.o lib/linux/${MES_ARCH}-mes-gcc/crtn.c
|
||||||
|
|
||||||
# crti.o
|
# crti.o
|
||||||
tcc-mes -c -D HAVE_CONFIG_H=1 -I include -I include/linux/${MES_ARCH} -o ${libdir}/crti.o lib/linux/${MES_ARCH}-mes-gcc/crti.c
|
tcc-mes -c -D HAVE_CONFIG_H=1 -I include -I include/linux/${MES_ARCH} -o ${LIBDIR}/crti.o lib/linux/${MES_ARCH}-mes-gcc/crti.c
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# libc+gcc.a
|
# libc+gcc.a
|
||||||
tcc-mes -c -D HAVE_CONFIG_H=1 -I include -I include/linux/${MES_ARCH} -o unified-libc.o unified-libc.c
|
tcc-mes -c -D HAVE_CONFIG_H=1 -I include -I include/linux/${MES_ARCH} -o unified-libc.o unified-libc.c
|
||||||
tcc-mes -ar cr ${libdir}/libc.a unified-libc.o
|
tcc-mes -ar cr ${LIBDIR}/libc.a unified-libc.o
|
||||||
|
|
||||||
# libtcc1.a
|
# libtcc1.a
|
||||||
mkdir ${libdir}/tcc
|
mkdir ${LIBDIR}/tcc
|
||||||
tcc-mes -c -D HAVE_CONFIG_H=1 -D HAVE_LONG_LONG=1 -D HAVE_FLOAT=1 -I include -I include/linux/${MES_ARCH} -o libtcc1.o lib/libtcc1.c
|
tcc-mes -c -D HAVE_CONFIG_H=1 -D HAVE_LONG_LONG=1 -D HAVE_FLOAT=1 -I include -I include/linux/${MES_ARCH} -o libtcc1.o lib/libtcc1.c
|
||||||
if match ${ARCH} riscv64; then
|
if match ${ARCH} riscv64; then
|
||||||
tcc-mes -c -D HAVE_CONFIG_H=1 -D HAVE_LONG_LONG=1 -D HAVE_FLOAT=1 -I include -I include/linux/${MES_ARCH} -o lib-arm64.o ../${TCC_PKG}/lib/lib-arm64.c
|
tcc-mes -c -D HAVE_CONFIG_H=1 -D HAVE_LONG_LONG=1 -D HAVE_FLOAT=1 -I include -I include/linux/${MES_ARCH} -o lib-arm64.o ../${TCC_PKG}/lib/lib-arm64.c
|
||||||
tcc-mes -ar cr ${libdir}/tcc/libtcc1.a libtcc1.o lib-arm64.o
|
tcc-mes -ar cr ${LIBDIR}/tcc/libtcc1.a libtcc1.o lib-arm64.o
|
||||||
else
|
else
|
||||||
tcc-mes -ar cr ${libdir}/tcc/libtcc1.a libtcc1.o
|
tcc-mes -ar cr ${LIBDIR}/tcc/libtcc1.a libtcc1.o
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# libgetopt.a
|
# libgetopt.a
|
||||||
tcc-mes -c -D HAVE_CONFIG_H=1 -I include -I include/linux/${MES_ARCH} lib/posix/getopt.c
|
tcc-mes -c -D HAVE_CONFIG_H=1 -I include -I include/linux/${MES_ARCH} lib/posix/getopt.c
|
||||||
tcc-mes -ar cr ${libdir}/libgetopt.a getopt.o
|
tcc-mes -ar cr ${LIBDIR}/libgetopt.a getopt.o
|
||||||
|
|
||||||
cd ../${TCC_PKG}
|
cd ../${TCC_PKG}
|
||||||
|
|
||||||
|
|
@ -155,14 +151,14 @@ tcc-mes \
|
||||||
-D HAVE_LONG_LONG=1 \
|
-D HAVE_LONG_LONG=1 \
|
||||||
-D HAVE_SETJMP=1 \
|
-D HAVE_SETJMP=1 \
|
||||||
-I . \
|
-I . \
|
||||||
-I ${prefix}/include \
|
-I ${PREFIX}/include/mes \
|
||||||
-D TCC_TARGET_${TCC_TARGET_ARCH}=1 \
|
-D TCC_TARGET_${TCC_TARGET_ARCH}=1 \
|
||||||
-D CONFIG_TCCDIR=\"${libdir}/tcc\" \
|
-D CONFIG_TCCDIR=\"${LIBDIR}/tcc\" \
|
||||||
-D CONFIG_TCC_CRTPREFIX=\"${libdir}\" \
|
-D CONFIG_TCC_CRTPREFIX=\"${LIBDIR}\" \
|
||||||
-D CONFIG_TCC_ELFINTERP=\"/mes/loader\" \
|
-D CONFIG_TCC_ELFINTERP=\"/mes/loader\" \
|
||||||
-D CONFIG_TCC_LIBPATHS=\"${libdir}:${libdir}/tcc\" \
|
-D CONFIG_TCC_LIBPATHS=\"${LIBDIR}:${LIBDIR}/tcc\" \
|
||||||
-D CONFIG_TCC_SYSINCLUDEPATHS=\"${prefix}/include\" \
|
-D CONFIG_TCC_SYSINCLUDEPATHS=\"${PREFIX}/include\" \
|
||||||
-D TCC_LIBGCC=\"${libdir}/libc.a\" \
|
-D TCC_LIBGCC=\"${LIBDIR}/libc.a\" \
|
||||||
-D TCC_LIBTCC1=\"libtcc1.a\" \
|
-D TCC_LIBTCC1=\"libtcc1.a\" \
|
||||||
-D CONFIG_TCCBOOT=1 \
|
-D CONFIG_TCCBOOT=1 \
|
||||||
-D CONFIG_TCC_STATIC=1 \
|
-D CONFIG_TCC_STATIC=1 \
|
||||||
|
|
@ -170,29 +166,29 @@ tcc-mes \
|
||||||
-D TCC_VERSION=\"0.9.26\" \
|
-D TCC_VERSION=\"0.9.26\" \
|
||||||
-D ONE_SOURCE=1 \
|
-D ONE_SOURCE=1 \
|
||||||
-L . \
|
-L . \
|
||||||
-L ${libdir} \
|
-L ${LIBDIR} \
|
||||||
tcc.c
|
tcc.c
|
||||||
# Install
|
# Install
|
||||||
cp tcc-boot0 ${bindir}/
|
cp tcc-boot0 ${BINDIR}/
|
||||||
chmod 755 ${bindir}/tcc-boot0
|
chmod 755 ${BINDIR}/tcc-boot0
|
||||||
cd ../${MES_PKG_DIR}
|
cd ../${MES_PKG_DIR}
|
||||||
# Recompile libc: crt{1,n,i}, libtcc.a, libc.a
|
# Recompile libc: crt{1,n,i}, libtcc.a, libc.a
|
||||||
tcc-boot0 -c -D HAVE_CONFIG_H=1 -I include -I include/linux/${MES_ARCH} -o ${libdir}/crt1.o lib/linux/${MES_ARCH}-mes-${MES_LIBC_SUFFIX}/crt1.c
|
tcc-boot0 -c -D HAVE_CONFIG_H=1 -I include -I include/linux/${MES_ARCH} -o ${LIBDIR}/crt1.o lib/linux/${MES_ARCH}-mes-${MES_LIBC_SUFFIX}/crt1.c
|
||||||
if match ${ARCH} x86; then
|
if match ${ARCH} x86; then
|
||||||
tcc-boot0 -c -D HAVE_CONFIG_H=1 -I include -I include/linux/${MES_ARCH} -o ${libdir}/crtn.o lib/linux/${MES_ARCH}-mes-gcc/crtn.c
|
tcc-boot0 -c -D HAVE_CONFIG_H=1 -I include -I include/linux/${MES_ARCH} -o ${LIBDIR}/crtn.o lib/linux/${MES_ARCH}-mes-gcc/crtn.c
|
||||||
tcc-boot0 -c -D HAVE_CONFIG_H=1 -I include -I include/linux/${MES_ARCH} -o ${libdir}/crti.o lib/linux/${MES_ARCH}-mes-gcc/crti.c
|
tcc-boot0 -c -D HAVE_CONFIG_H=1 -I include -I include/linux/${MES_ARCH} -o ${LIBDIR}/crti.o lib/linux/${MES_ARCH}-mes-gcc/crti.c
|
||||||
fi
|
fi
|
||||||
|
|
||||||
tcc-boot0 -c -D HAVE_CONFIG_H=1 -D HAVE_LONG_LONG=1 -D HAVE_FLOAT=1 -I include -I include/linux/${MES_ARCH} -o libtcc1.o lib/libtcc1.c
|
tcc-boot0 -c -D HAVE_CONFIG_H=1 -D HAVE_LONG_LONG=1 -D HAVE_FLOAT=1 -I include -I include/linux/${MES_ARCH} -o libtcc1.o lib/libtcc1.c
|
||||||
if match ${ARCH} riscv64; then
|
if match ${ARCH} riscv64; then
|
||||||
tcc-boot0 -c -D HAVE_CONFIG_H=1 -D HAVE_LONG_LONG=1 -D HAVE_FLOAT=1 -I include -I include/linux/${MES_ARCH} -o lib-arm64.o ../${TCC_PKG}/lib/lib-arm64.c
|
tcc-boot0 -c -D HAVE_CONFIG_H=1 -D HAVE_LONG_LONG=1 -D HAVE_FLOAT=1 -I include -I include/linux/${MES_ARCH} -o lib-arm64.o ../${TCC_PKG}/lib/lib-arm64.c
|
||||||
tcc-boot0 -ar cr ${libdir}/tcc/libtcc1.a libtcc1.o lib-arm64.o
|
tcc-boot0 -ar cr ${LIBDIR}/tcc/libtcc1.a libtcc1.o lib-arm64.o
|
||||||
else
|
else
|
||||||
tcc-boot0 -ar cr ${libdir}/tcc/libtcc1.a libtcc1.o
|
tcc-boot0 -ar cr ${LIBDIR}/tcc/libtcc1.a libtcc1.o
|
||||||
fi
|
fi
|
||||||
|
|
||||||
tcc-boot0 -c -D HAVE_CONFIG_H=1 -I include -I include/linux/${MES_ARCH} -o unified-libc.o unified-libc.c
|
tcc-boot0 -c -D HAVE_CONFIG_H=1 -I include -I include/linux/${MES_ARCH} -o unified-libc.o unified-libc.c
|
||||||
tcc-boot0 -ar cr ${libdir}/libc.a unified-libc.o
|
tcc-boot0 -ar cr ${LIBDIR}/libc.a unified-libc.o
|
||||||
cd ../${TCC_PKG}
|
cd ../${TCC_PKG}
|
||||||
|
|
||||||
# Test boot0
|
# Test boot0
|
||||||
|
|
@ -210,14 +206,14 @@ tcc-boot0 \
|
||||||
-D HAVE_LONG_LONG=1 \
|
-D HAVE_LONG_LONG=1 \
|
||||||
-D HAVE_SETJMP=1 \
|
-D HAVE_SETJMP=1 \
|
||||||
-I . \
|
-I . \
|
||||||
-I ${prefix}/include \
|
-I ${PREFIX}/include \
|
||||||
-D TCC_TARGET_${TCC_TARGET_ARCH}=1 \
|
-D TCC_TARGET_${TCC_TARGET_ARCH}=1 \
|
||||||
-D CONFIG_TCCDIR=\"${libdir}/tcc\" \
|
-D CONFIG_TCCDIR=\"${LIBDIR}/tcc\" \
|
||||||
-D CONFIG_TCC_CRTPREFIX=\"${libdir}\" \
|
-D CONFIG_TCC_CRTPREFIX=\"${LIBDIR}\" \
|
||||||
-D CONFIG_TCC_ELFINTERP=\"/mes/loader\" \
|
-D CONFIG_TCC_ELFINTERP=\"/mes/loader\" \
|
||||||
-D CONFIG_TCC_LIBPATHS=\"${libdir}:${libdir}/tcc\" \
|
-D CONFIG_TCC_LIBPATHS=\"${LIBDIR}:${LIBDIR}/tcc\" \
|
||||||
-D CONFIG_TCC_SYSINCLUDEPATHS=\"${prefix}/include\" \
|
-D CONFIG_TCC_SYSINCLUDEPATHS=\"${PREFIX}/include\" \
|
||||||
-D TCC_LIBGCC=\"${libdir}/libc.a\" \
|
-D TCC_LIBGCC=\"${LIBDIR}/libc.a\" \
|
||||||
-D TCC_LIBTCC1=\"libtcc1.a\" \
|
-D TCC_LIBTCC1=\"libtcc1.a\" \
|
||||||
-D CONFIG_TCCBOOT=1 \
|
-D CONFIG_TCCBOOT=1 \
|
||||||
-D CONFIG_TCC_STATIC=1 \
|
-D CONFIG_TCC_STATIC=1 \
|
||||||
|
|
@ -226,25 +222,25 @@ tcc-boot0 \
|
||||||
-D ONE_SOURCE=1 \
|
-D ONE_SOURCE=1 \
|
||||||
-L . \
|
-L . \
|
||||||
tcc.c
|
tcc.c
|
||||||
cp tcc-boot1 ${bindir}
|
cp tcc-boot1 ${BINDIR}
|
||||||
chmod 755 ${bindir}/tcc-boot1
|
chmod 755 ${BINDIR}/tcc-boot1
|
||||||
cd ../${MES_PKG_DIR}
|
cd ../${MES_PKG_DIR}
|
||||||
tcc-boot1 -c -D HAVE_CONFIG_H=1 -I include -I include/linux/${MES_ARCH} -o ${libdir}/crt1.o lib/linux/${MES_ARCH}-mes-${MES_LIBC_SUFFIX}/crt1.c
|
tcc-boot1 -c -D HAVE_CONFIG_H=1 -I include -I include/linux/${MES_ARCH} -o ${LIBDIR}/crt1.o lib/linux/${MES_ARCH}-mes-${MES_LIBC_SUFFIX}/crt1.c
|
||||||
if match ${ARCH} x86; then
|
if match ${ARCH} x86; then
|
||||||
tcc-boot1 -c -D HAVE_CONFIG_H=1 -I include -I include/linux/${MES_ARCH} -o ${libdir}/crtn.o lib/linux/${MES_ARCH}-mes-gcc/crtn.c
|
tcc-boot1 -c -D HAVE_CONFIG_H=1 -I include -I include/linux/${MES_ARCH} -o ${LIBDIR}/crtn.o lib/linux/${MES_ARCH}-mes-gcc/crtn.c
|
||||||
tcc-boot1 -c -D HAVE_CONFIG_H=1 -I include -I include/linux/${MES_ARCH} -o ${libdir}/crti.o lib/linux/${MES_ARCH}-mes-gcc/crti.c
|
tcc-boot1 -c -D HAVE_CONFIG_H=1 -I include -I include/linux/${MES_ARCH} -o ${LIBDIR}/crti.o lib/linux/${MES_ARCH}-mes-gcc/crti.c
|
||||||
fi
|
fi
|
||||||
|
|
||||||
tcc-boot1 -c -D HAVE_CONFIG_H=1 -D HAVE_LONG_LONG=1 -D HAVE_FLOAT=1 -I include -I include/linux/${MES_ARCH} -o libtcc1.o lib/libtcc1.c
|
tcc-boot1 -c -D HAVE_CONFIG_H=1 -D HAVE_LONG_LONG=1 -D HAVE_FLOAT=1 -I include -I include/linux/${MES_ARCH} -o libtcc1.o lib/libtcc1.c
|
||||||
if match ${ARCH} riscv64; then
|
if match ${ARCH} riscv64; then
|
||||||
tcc-boot1 -c -D HAVE_CONFIG_H=1 -I include -I include/linux/${MES_ARCH} -o lib-arm64.o ../${TCC_PKG}/lib/lib-arm64.c
|
tcc-boot1 -c -D HAVE_CONFIG_H=1 -I include -I include/linux/${MES_ARCH} -o lib-arm64.o ../${TCC_PKG}/lib/lib-arm64.c
|
||||||
tcc-boot1 -ar cr ${libdir}/tcc/libtcc1.a libtcc1.o lib-arm64.o
|
tcc-boot1 -ar cr ${LIBDIR}/tcc/libtcc1.a libtcc1.o lib-arm64.o
|
||||||
else
|
else
|
||||||
tcc-boot1 -ar cr ${libdir}/tcc/libtcc1.a libtcc1.o
|
tcc-boot1 -ar cr ${LIBDIR}/tcc/libtcc1.a libtcc1.o
|
||||||
fi
|
fi
|
||||||
|
|
||||||
tcc-boot1 -c -D HAVE_CONFIG_H=1 -I include -I include/linux/${MES_ARCH} -o unified-libc.o unified-libc.c
|
tcc-boot1 -c -D HAVE_CONFIG_H=1 -I include -I include/linux/${MES_ARCH} -o unified-libc.o unified-libc.c
|
||||||
tcc-boot1 -ar cr ${libdir}/libc.a unified-libc.o
|
tcc-boot1 -ar cr ${LIBDIR}/libc.a unified-libc.o
|
||||||
cd ../${TCC_PKG}
|
cd ../${TCC_PKG}
|
||||||
|
|
||||||
# Test boot1
|
# Test boot1
|
||||||
|
|
@ -262,14 +258,14 @@ tcc-boot1 \
|
||||||
-D HAVE_LONG_LONG=1 \
|
-D HAVE_LONG_LONG=1 \
|
||||||
-D HAVE_SETJMP=1 \
|
-D HAVE_SETJMP=1 \
|
||||||
-I . \
|
-I . \
|
||||||
-I ${prefix}/include \
|
-I ${PREFIX}/include \
|
||||||
-D TCC_TARGET_${TCC_TARGET_ARCH}=1 \
|
-D TCC_TARGET_${TCC_TARGET_ARCH}=1 \
|
||||||
-D CONFIG_TCCDIR=\"${libdir}/tcc\" \
|
-D CONFIG_TCCDIR=\"${LIBDIR}/tcc\" \
|
||||||
-D CONFIG_TCC_CRTPREFIX=\"${libdir}\" \
|
-D CONFIG_TCC_CRTPREFIX=\"${LIBDIR}\" \
|
||||||
-D CONFIG_TCC_ELFINTERP=\"/mes/loader\" \
|
-D CONFIG_TCC_ELFINTERP=\"/mes/loader\" \
|
||||||
-D CONFIG_TCC_LIBPATHS=\"${libdir}:${libdir}/tcc\" \
|
-D CONFIG_TCC_LIBPATHS=\"${LIBDIR}:${LIBDIR}/tcc\" \
|
||||||
-D CONFIG_TCC_SYSINCLUDEPATHS=\"${prefix}/include\" \
|
-D CONFIG_TCC_SYSINCLUDEPATHS=\"${PREFIX}/include\" \
|
||||||
-D TCC_LIBGCC=\"${libdir}/libc.a\" \
|
-D TCC_LIBGCC=\"${LIBDIR}/libc.a\" \
|
||||||
-D TCC_LIBTCC1=\"libtcc1.a\" \
|
-D TCC_LIBTCC1=\"libtcc1.a\" \
|
||||||
-D CONFIG_TCCBOOT=1 \
|
-D CONFIG_TCCBOOT=1 \
|
||||||
-D CONFIG_TCC_STATIC=1 \
|
-D CONFIG_TCC_STATIC=1 \
|
||||||
|
|
@ -278,42 +274,42 @@ tcc-boot1 \
|
||||||
-D ONE_SOURCE=1 \
|
-D ONE_SOURCE=1 \
|
||||||
-L . \
|
-L . \
|
||||||
tcc.c
|
tcc.c
|
||||||
cp tcc-boot2 ${bindir}
|
cp tcc-boot2 ${BINDIR}
|
||||||
chmod 755 ${bindir}/tcc-boot2
|
chmod 755 ${BINDIR}/tcc-boot2
|
||||||
cd ../${MES_PKG_DIR}
|
cd ../${MES_PKG_DIR}
|
||||||
tcc-boot2 -c -D HAVE_CONFIG_H=1 -I include -I include/linux/${MES_ARCH} -o ${libdir}/crt1.o lib/linux/${MES_ARCH}-mes-${MES_LIBC_SUFFIX}/crt1.c
|
tcc-boot2 -c -D HAVE_CONFIG_H=1 -I include -I include/linux/${MES_ARCH} -o ${LIBDIR}/crt1.o lib/linux/${MES_ARCH}-mes-${MES_LIBC_SUFFIX}/crt1.c
|
||||||
if match ${ARCH} x86; then
|
if match ${ARCH} x86; then
|
||||||
tcc-boot2 -c -D HAVE_CONFIG_H=1 -I include -I include/linux/${MES_ARCH} -o ${libdir}/crtn.o lib/linux/${MES_ARCH}-mes-gcc/crtn.c
|
tcc-boot2 -c -D HAVE_CONFIG_H=1 -I include -I include/linux/${MES_ARCH} -o ${LIBDIR}/crtn.o lib/linux/${MES_ARCH}-mes-gcc/crtn.c
|
||||||
tcc-boot2 -c -D HAVE_CONFIG_H=1 -I include -I include/linux/${MES_ARCH} -o ${libdir}/crti.o lib/linux/${MES_ARCH}-mes-gcc/crti.c
|
tcc-boot2 -c -D HAVE_CONFIG_H=1 -I include -I include/linux/${MES_ARCH} -o ${LIBDIR}/crti.o lib/linux/${MES_ARCH}-mes-gcc/crti.c
|
||||||
fi
|
fi
|
||||||
|
|
||||||
tcc-boot2 -c -D HAVE_CONFIG_H=1 -D HAVE_LONG_LONG=1 -D HAVE_FLOAT=1 -I include -I include/linux/${MES_ARCH} -o libtcc1.o lib/libtcc1.c
|
tcc-boot2 -c -D HAVE_CONFIG_H=1 -D HAVE_LONG_LONG=1 -D HAVE_FLOAT=1 -I include -I include/linux/${MES_ARCH} -o libtcc1.o lib/libtcc1.c
|
||||||
if match ${ARCH} riscv64; then
|
if match ${ARCH} riscv64; then
|
||||||
tcc-boot2 -c -D HAVE_CONFIG_H=1 -I include -I include/linux/${MES_ARCH} -o lib-arm64.o ../${TCC_PKG}/lib/lib-arm64.c
|
tcc-boot2 -c -D HAVE_CONFIG_H=1 -I include -I include/linux/${MES_ARCH} -o lib-arm64.o ../${TCC_PKG}/lib/lib-arm64.c
|
||||||
tcc-boot2 -ar cr ${libdir}/tcc/libtcc1.a libtcc1.o lib-arm64.o
|
tcc-boot2 -ar cr ${LIBDIR}/tcc/libtcc1.a libtcc1.o lib-arm64.o
|
||||||
else
|
else
|
||||||
tcc-boot2 -ar cr ${libdir}/tcc/libtcc1.a libtcc1.o
|
tcc-boot2 -ar cr ${LIBDIR}/tcc/libtcc1.a libtcc1.o
|
||||||
fi
|
fi
|
||||||
|
|
||||||
tcc-boot2 -c -D HAVE_CONFIG_H=1 -I include -I include/linux/${MES_ARCH} -o unified-libc.o unified-libc.c
|
tcc-boot2 -c -D HAVE_CONFIG_H=1 -I include -I include/linux/${MES_ARCH} -o unified-libc.o unified-libc.c
|
||||||
tcc-boot2 -ar cr ${libdir}/libc.a unified-libc.o
|
tcc-boot2 -ar cr ${LIBDIR}/libc.a unified-libc.o
|
||||||
cd ../${TCC_PKG}
|
cd ../${TCC_PKG}
|
||||||
|
|
||||||
# Test boot2
|
# Test boot2
|
||||||
tcc-boot2 -version
|
tcc-boot2 -version
|
||||||
|
|
||||||
# We have our final tcc 0.9.26!
|
# We have our final tcc 0.9.26!
|
||||||
cp ${bindir}/tcc-boot2 ${bindir}/tcc
|
cp ${BINDIR}/tcc-boot2 ${BINDIR}/tcc
|
||||||
chmod 755 ${bindir}/tcc
|
chmod 755 ${BINDIR}/tcc
|
||||||
rm ${bindir}/tcc-boot2
|
rm ${BINDIR}/tcc-boot2
|
||||||
cp ${bindir}/tcc ${bindir}/tcc-0.9.26
|
cp ${BINDIR}/tcc ${BINDIR}/tcc-0.9.26
|
||||||
chmod 755 ${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
|
||||||
cd ../${MES_PKG_DIR}
|
cd ../${MES_PKG_DIR}
|
||||||
tcc -c -D HAVE_CONFIG_H=1 -I include -I include/linux/${MES_ARCH} lib/posix/getopt.c
|
tcc -c -D HAVE_CONFIG_H=1 -I include -I include/linux/${MES_ARCH} lib/posix/getopt.c
|
||||||
tcc -ar cr ${libdir}/libgetopt.a getopt.o
|
tcc -ar cr ${LIBDIR}/libgetopt.a getopt.o
|
||||||
|
|
||||||
cd ../..
|
cd ../..
|
||||||
|
|
||||||
|
|
@ -331,7 +327,7 @@ if match x${UPDATE_CHECKSUMS} xTrue; then
|
||||||
/usr/lib/mes/crtn.o \
|
/usr/lib/mes/crtn.o \
|
||||||
/usr/lib/mes/tcc/libtcc1.a
|
/usr/lib/mes/tcc/libtcc1.a
|
||||||
|
|
||||||
cp ${pkg}.checksums ${srcdir}
|
cp ${pkg}.checksums ${SRCDIR}
|
||||||
else
|
else
|
||||||
sha256sum -c ${pkg}.${ARCH}.checksums
|
sha256sum -c ${pkg}.${ARCH}.checksums
|
||||||
fi
|
fi
|
||||||
|
|
|
||||||
|
|
@ -14,8 +14,8 @@ sha256sum -c sources.SHA256SUM
|
||||||
# Extract
|
# Extract
|
||||||
mkdir build src
|
mkdir build src
|
||||||
cd src
|
cd src
|
||||||
unbz2 --file ${distfiles}/${pkg}.tar.bz2 --output ${pkg}.tar
|
unbz2 --file ${DISTFILES}/${pkg}.tar.bz2 --output ${pkg}.tar
|
||||||
ungz --file ${distfiles}/${MES_PKG}.tar.gz --output ${MES_PKG}.tar
|
ungz --file ${DISTFILES}/${MES_PKG}.tar.gz --output ${MES_PKG}.tar
|
||||||
cd ..
|
cd ..
|
||||||
|
|
||||||
cd build
|
cd build
|
||||||
|
|
@ -39,14 +39,14 @@ catm config.h
|
||||||
tcc-0.9.26 \
|
tcc-0.9.26 \
|
||||||
-v \
|
-v \
|
||||||
-static \
|
-static \
|
||||||
-o ${bindir}/tcc \
|
-o ${BINDIR}/tcc \
|
||||||
-D TCC_TARGET_I386=1 \
|
-D TCC_TARGET_I386=1 \
|
||||||
-D CONFIG_TCCDIR=\"${libdir}/tcc\" \
|
-D CONFIG_TCCDIR=\"${LIBDIR}/tcc\" \
|
||||||
-D CONFIG_TCC_CRTPREFIX=\"${libdir}\" \
|
-D CONFIG_TCC_CRTPREFIX=\"${LIBDIR}\" \
|
||||||
-D CONFIG_TCC_ELFINTERP=\"/mes/loader\" \
|
-D CONFIG_TCC_ELFINTERP=\"/mes/loader\" \
|
||||||
-D CONFIG_TCC_LIBPATHS=\"${libdir}:${libdir}/tcc\" \
|
-D CONFIG_TCC_LIBPATHS=\"${LIBDIR}:${LIBDIR}/tcc\" \
|
||||||
-D CONFIG_TCC_SYSINCLUDEPATHS=\"${prefix}/include\" \
|
-D CONFIG_TCC_SYSINCLUDEPATHS=\"${PREFIX}/include\" \
|
||||||
-D TCC_LIBGCC=\"${libdir}/libc.a\" \
|
-D TCC_LIBGCC=\"${LIBDIR}/libc.a\" \
|
||||||
-D CONFIG_TCC_STATIC=1 \
|
-D CONFIG_TCC_STATIC=1 \
|
||||||
-D CONFIG_USE_LIBGCC=1 \
|
-D CONFIG_USE_LIBGCC=1 \
|
||||||
-D TCC_VERSION=\"0.9.27\" \
|
-D TCC_VERSION=\"0.9.27\" \
|
||||||
|
|
@ -54,7 +54,7 @@ tcc-0.9.26 \
|
||||||
tcc.c
|
tcc.c
|
||||||
|
|
||||||
# Recompile the mes C library
|
# Recompile the mes C library
|
||||||
cd ../${MES_PKG_DIR}
|
cd ../${MES_PKG}
|
||||||
|
|
||||||
# Create unified libc file
|
# Create unified libc file
|
||||||
cd lib
|
cd lib
|
||||||
|
|
@ -62,14 +62,14 @@ catm ../unified-libc.c ctype/isalnum.c ctype/isalpha.c ctype/isascii.c ctype/isc
|
||||||
cd ..
|
cd ..
|
||||||
|
|
||||||
# Recompile libc: crt{1,n,i}, libtcc.a, libc.a
|
# Recompile libc: crt{1,n,i}, libtcc.a, libc.a
|
||||||
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}/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}/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
|
tcc -c -D HAVE_CONFIG_H=1 -I include -I include/linux/x86 -o ${LIBDIR}/crti.o lib/linux/x86-mes-gcc/crti.c
|
||||||
tcc -c -D HAVE_CONFIG_H=1 -D HAVE_LONG_LONG_STUB=1 -I include -I include/linux/x86 lib/libtcc1.c
|
tcc -c -D HAVE_CONFIG_H=1 -D HAVE_LONG_LONG_STUB=1 -I include -I include/linux/x86 lib/libtcc1.c
|
||||||
tcc -c -D TCC_TARGET_I386=1 ../${pkg}/lib/libtcc1.c
|
tcc -c -D TCC_TARGET_I386=1 ../${pkg}/lib/libtcc1.c
|
||||||
tcc -ar cr ${libdir}/tcc/libtcc1.a libtcc1.o
|
tcc -ar cr ${LIBDIR}/tcc/libtcc1.a libtcc1.o
|
||||||
tcc -c -D HAVE_CONFIG_H=1 -I include -I include/linux/x86 -o unified-libc.o unified-libc.c
|
tcc -c -D HAVE_CONFIG_H=1 -I include -I include/linux/x86 -o unified-libc.o unified-libc.c
|
||||||
tcc -ar cr ${libdir}/libc.a unified-libc.o
|
tcc -ar cr ${LIBDIR}/libc.a unified-libc.o
|
||||||
cd ../..
|
cd ../..
|
||||||
|
|
||||||
# Test
|
# Test
|
||||||
|
|
@ -80,7 +80,7 @@ if match x${UPDATE_CHECKSUMS} xTrue; then
|
||||||
sha256sum -o ${pkg}.checksums \
|
sha256sum -o ${pkg}.checksums \
|
||||||
/usr/bin/tcc
|
/usr/bin/tcc
|
||||||
|
|
||||||
cp ${pkg}.checksums ${srcdir}
|
cp ${pkg}.checksums ${SRCDIR}
|
||||||
else
|
else
|
||||||
sha256sum -c ${pkg}.checksums
|
sha256sum -c ${pkg}.checksums
|
||||||
fi
|
fi
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue