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
|
@ -11,14 +11,14 @@ set -ex
|
|||
|
||||
# Set commonly used variables
|
||||
sysa=/sysa
|
||||
distfiles=/sysa/distfiles
|
||||
prefix=/usr
|
||||
bindir=${prefix}/bin
|
||||
libdir=${libdir}/mes
|
||||
incdir=${prefix}/include
|
||||
srcdir=${prefix}/src
|
||||
DISTFILES=/sysa/distfiles
|
||||
PREFIX=/usr
|
||||
BINDIR=${PREFIX}/bin
|
||||
LIBDIR=${LIBDIR}/mes
|
||||
INCDIR=${PREFIX}/include
|
||||
SRCDIR=${PREFIX}/src
|
||||
TMPDIR=/tmp # tmpdir is needed for patch to work
|
||||
PATH=${bindir}
|
||||
PATH=${BINDIR}
|
||||
|
||||
cd ${sysa}
|
||||
|
||||
|
|
|
@ -13,56 +13,56 @@ PATH=/${ARCH_DIR}/bin
|
|||
|
||||
# Set commonly used variables
|
||||
sysa=/sysa
|
||||
distfiles=/sysa/distfiles
|
||||
prefix=/usr
|
||||
bindir=${prefix}/bin
|
||||
libdir=${prefix}/lib
|
||||
incdir=${prefix}/include
|
||||
srcdir=${prefix}/src
|
||||
DISTFILES=/sysa/distfiles
|
||||
PREFIX=/usr
|
||||
BINDIR=${PREFIX}/bin
|
||||
LIBDIR=${PREFIX}/lib
|
||||
INCDIR=${PREFIX}/include
|
||||
SRCDIR=${PREFIX}/src
|
||||
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)
|
||||
cp /${ARCH_DIR}/bin/blood-elf ${bindir}/blood-elf
|
||||
cp /${ARCH_DIR}/bin/catm ${bindir}/catm
|
||||
cp /${ARCH_DIR}/bin/chmod ${bindir}/chmod
|
||||
cp /${ARCH_DIR}/bin/get_machine ${bindir}/get_machine
|
||||
cp /${ARCH_DIR}/bin/hex2 ${bindir}/hex2
|
||||
cp /${ARCH_DIR}/bin/kaem ${bindir}/kaem
|
||||
cp /${ARCH_DIR}/bin/match ${bindir}/match
|
||||
cp /${ARCH_DIR}/bin/M1 ${bindir}/M1
|
||||
cp /${ARCH_DIR}/bin/M2-Mesoplanet ${bindir}/M2-Mesoplanet
|
||||
cp /${ARCH_DIR}/bin/M2-Planet ${bindir}/M2-Planet
|
||||
cp /${ARCH_DIR}/bin/mkdir ${bindir}/mkdir
|
||||
cp /${ARCH_DIR}/bin/sha256sum ${bindir}/sha256sum
|
||||
cp /${ARCH_DIR}/bin/unbz2 ${bindir}/unbz2
|
||||
cp /${ARCH_DIR}/bin/ungz ${bindir}/ungz
|
||||
cp /${ARCH_DIR}/bin/untar ${bindir}/untar
|
||||
cp /${ARCH_DIR}/bin/cp ${bindir}/cp
|
||||
cp /${ARCH_DIR}/bin/replace ${bindir}/replace
|
||||
cp /${ARCH_DIR}/bin/rm ${bindir}/rm
|
||||
cp /${ARCH_DIR}/bin/blood-elf ${BINDIR}/blood-elf
|
||||
cp /${ARCH_DIR}/bin/catm ${BINDIR}/catm
|
||||
cp /${ARCH_DIR}/bin/chmod ${BINDIR}/chmod
|
||||
cp /${ARCH_DIR}/bin/get_machine ${BINDIR}/get_machine
|
||||
cp /${ARCH_DIR}/bin/hex2 ${BINDIR}/hex2
|
||||
cp /${ARCH_DIR}/bin/kaem ${BINDIR}/kaem
|
||||
cp /${ARCH_DIR}/bin/match ${BINDIR}/match
|
||||
cp /${ARCH_DIR}/bin/M1 ${BINDIR}/M1
|
||||
cp /${ARCH_DIR}/bin/M2-Mesoplanet ${BINDIR}/M2-Mesoplanet
|
||||
cp /${ARCH_DIR}/bin/M2-Planet ${BINDIR}/M2-Planet
|
||||
cp /${ARCH_DIR}/bin/mkdir ${BINDIR}/mkdir
|
||||
cp /${ARCH_DIR}/bin/sha256sum ${BINDIR}/sha256sum
|
||||
cp /${ARCH_DIR}/bin/unbz2 ${BINDIR}/unbz2
|
||||
cp /${ARCH_DIR}/bin/ungz ${BINDIR}/ungz
|
||||
cp /${ARCH_DIR}/bin/untar ${BINDIR}/untar
|
||||
cp /${ARCH_DIR}/bin/cp ${BINDIR}/cp
|
||||
cp /${ARCH_DIR}/bin/replace ${BINDIR}/replace
|
||||
cp /${ARCH_DIR}/bin/rm ${BINDIR}/rm
|
||||
|
||||
chmod 755 ${bindir}/blood-elf
|
||||
chmod 755 ${bindir}/catm
|
||||
chmod 755 ${bindir}/chmod
|
||||
chmod 755 ${bindir}/cp
|
||||
chmod 755 ${bindir}/get_machine
|
||||
chmod 755 ${bindir}/hex2
|
||||
chmod 755 ${bindir}/kaem
|
||||
chmod 755 ${bindir}/match
|
||||
chmod 755 ${bindir}/M1
|
||||
chmod 755 ${bindir}/M2-Mesoplanet
|
||||
chmod 755 ${bindir}/M2-Planet
|
||||
chmod 755 ${bindir}/mkdir
|
||||
chmod 755 ${bindir}/sha256sum
|
||||
chmod 755 ${bindir}/unbz2
|
||||
chmod 755 ${bindir}/ungz
|
||||
chmod 755 ${bindir}/untar
|
||||
chmod 755 ${bindir}/replace
|
||||
chmod 755 ${bindir}/rm
|
||||
chmod 755 ${BINDIR}/blood-elf
|
||||
chmod 755 ${BINDIR}/catm
|
||||
chmod 755 ${BINDIR}/chmod
|
||||
chmod 755 ${BINDIR}/cp
|
||||
chmod 755 ${BINDIR}/get_machine
|
||||
chmod 755 ${BINDIR}/hex2
|
||||
chmod 755 ${BINDIR}/kaem
|
||||
chmod 755 ${BINDIR}/match
|
||||
chmod 755 ${BINDIR}/M1
|
||||
chmod 755 ${BINDIR}/M2-Mesoplanet
|
||||
chmod 755 ${BINDIR}/M2-Planet
|
||||
chmod 755 ${BINDIR}/mkdir
|
||||
chmod 755 ${BINDIR}/sha256sum
|
||||
chmod 755 ${BINDIR}/unbz2
|
||||
chmod 755 ${BINDIR}/ungz
|
||||
chmod 755 ${BINDIR}/untar
|
||||
chmod 755 ${BINDIR}/replace
|
||||
chmod 755 ${BINDIR}/rm
|
||||
|
||||
PATH=${bindir}
|
||||
PATH=${BINDIR}
|
||||
|
||||
cd ${sysa}
|
||||
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
# SPDX-FileCopyrightText: 2023 Richard Masters <grick23@gmail.com>
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
prefix=/usr
|
||||
bindir=${prefix}/bin
|
||||
PREFIX=/usr
|
||||
BINDIR=${PREFIX}/bin
|
||||
|
||||
PATH=${bindir}
|
||||
PATH=${BINDIR}
|
||||
|
||||
cd sysa
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@ mkdir build src
|
|||
cd build
|
||||
|
||||
# Extract
|
||||
cp ${distfiles}/${pkg}.tar.gz ../src/
|
||||
cp ${DISTFILES}/${pkg}.tar.gz ../src/
|
||||
gzip -d -f ../src/${pkg}.tar.gz
|
||||
tar xf ../src/${pkg}.tar
|
||||
rm -r ../src/
|
||||
|
@ -46,11 +46,11 @@ cd ..
|
|||
make
|
||||
|
||||
# Install
|
||||
install bash ${prefix}/bin/
|
||||
install bash ${PREFIX}/bin/
|
||||
mkdir /bin/
|
||||
ln -s ${prefix}/bin/bash /bin/bash
|
||||
ln -s ${prefix}/bin/bash /bin/sh
|
||||
ln -s ${prefix}/bin/bash ${prefix}/bin/sh
|
||||
ln -s ${PREFIX}/bin/bash /bin/bash
|
||||
ln -s ${PREFIX}/bin/bash /bin/sh
|
||||
ln -s ${PREFIX}/bin/bash ${PREFIX}/bin/sh
|
||||
|
||||
cd ../..
|
||||
|
||||
|
@ -59,7 +59,7 @@ if match x${UPDATE_CHECKSUMS} xTrue; then
|
|||
sha256sum -o ${pkg}.checksums \
|
||||
/usr/bin/bash
|
||||
|
||||
install ${pkg}.checksums ${srcdir}
|
||||
install ${pkg}.checksums ${SRCDIR}
|
||||
else
|
||||
sha256sum -c ${pkg}.checksums
|
||||
fi
|
||||
|
|
|
@ -15,7 +15,7 @@ mkdir build src
|
|||
cd build
|
||||
|
||||
# Extract
|
||||
cp ${distfiles}/${pkg}.tar.gz ../src/
|
||||
cp ${DISTFILES}/${pkg}.tar.gz ../src/
|
||||
gzip -d -f ../src/${pkg}.tar.gz
|
||||
tar xf ../src/${pkg}.tar
|
||||
cd ${pkg}
|
||||
|
@ -28,10 +28,10 @@ patch -Np0 -i ../../patches/coreutils.patch
|
|||
make CC=tcc AR="tcc -ar" LDFLAGS="-static" bzip2
|
||||
|
||||
# Install
|
||||
cp bzip2 ${prefix}/bin/bzip2
|
||||
cp bzip2 ${prefix}/bin/bunzip2
|
||||
chmod 755 ${prefix}/bin/bzip2
|
||||
chmod 755 ${prefix}/bin/bunzip2
|
||||
cp bzip2 ${PREFIX}/bin/bzip2
|
||||
cp bzip2 ${PREFIX}/bin/bunzip2
|
||||
chmod 755 ${PREFIX}/bin/bzip2
|
||||
chmod 755 ${PREFIX}/bin/bunzip2
|
||||
|
||||
# Test
|
||||
bzip2 --help
|
||||
|
@ -43,7 +43,7 @@ if match x${UPDATE_CHECKSUMS} xTrue; then
|
|||
sha256sum -o ${pkg}.checksums \
|
||||
/usr/bin/bzip2
|
||||
|
||||
cp ${pkg}.checksums ${srcdir}
|
||||
cp ${pkg}.checksums ${SRCDIR}
|
||||
else
|
||||
sha256sum -c ${pkg}.checksums
|
||||
fi
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
#define MAX_TOKENS 3
|
||||
|
||||
char *get_distfiles(char **envp) {
|
||||
char *envvar = "distfiles=";
|
||||
char *envvar = "DISTFILES=";
|
||||
int i = 0;
|
||||
while (envp[i] != NULL && strncmp(envp[i], envvar, strlen(envvar)) != 0) i += 1;
|
||||
// Now we have distfiles= - get just the part we want.
|
||||
|
|
|
@ -17,7 +17,7 @@ mkdir build src
|
|||
cd build
|
||||
|
||||
# Extract
|
||||
cp ${distfiles}/${pkg}.tar.bz2 ../src/
|
||||
cp ${DISTFILES}/${pkg}.tar.bz2 ../src/
|
||||
bunzip2 -f ../src/${pkg}.tar.bz2
|
||||
tar xf ../src/${pkg}.tar
|
||||
cd ${pkg}
|
||||
|
@ -45,8 +45,8 @@ patch -Np0 -i ../../patches/sort-locale.patch
|
|||
patch -Np0 -i ../../patches/uniq-fopen.patch
|
||||
|
||||
# Build and install
|
||||
make -f Makefile PREFIX=${prefix}
|
||||
make -f Makefile PREFIX=${prefix} install
|
||||
make -f Makefile PREFIX=${PREFIX}
|
||||
make -f Makefile PREFIX=${PREFIX} install
|
||||
|
||||
cd ../..
|
||||
rm -r src/
|
||||
|
@ -116,7 +116,7 @@ if match x${UPDATE_CHECKSUMS} xTrue; then
|
|||
/usr/bin/rm \
|
||||
/usr/bin/sha1sum
|
||||
|
||||
install ${pkg}.checksums ${srcdir}
|
||||
install ${pkg}.checksums ${SRCDIR}
|
||||
else
|
||||
sha256sum -c ${pkg}.checksums
|
||||
fi
|
||||
|
|
|
@ -11,16 +11,16 @@ sha256sum -c sources.SHA256SUM
|
|||
# Extract
|
||||
mkdir build src
|
||||
cd src
|
||||
ungz --file ${distfiles}/${pkg}.tar.gz --output ${pkg}.tar
|
||||
ungz --file ${DISTFILES}/${pkg}.tar.gz --output ${pkg}.tar
|
||||
cd ..
|
||||
|
||||
cd build
|
||||
untar --file ../src/${pkg}.tar
|
||||
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
|
||||
as -c -o boot.o boot.S
|
||||
|
@ -554,7 +554,7 @@ if match x${UPDATE_CHECKSUMS} xTrue; then
|
|||
sha256sum -o ${pkg}.checksums \
|
||||
/boot/fiwix
|
||||
|
||||
cp ${pkg}.checksums ${srcdir}
|
||||
cp ${pkg}.checksums ${SRCDIR}
|
||||
else
|
||||
sha256sum -c ${pkg}.checksums
|
||||
fi
|
||||
|
|
|
@ -16,7 +16,7 @@ mkdir build src
|
|||
cd build
|
||||
|
||||
# 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
|
||||
rm ../src/${pkg}.tar
|
||||
cd ${pkg}
|
||||
|
@ -42,10 +42,10 @@ cp util.c.new util.c
|
|||
make
|
||||
|
||||
# Install
|
||||
cp gzip ${bindir}/gzip
|
||||
cp gzip ${bindir}/gunzip
|
||||
chmod 755 ${bindir}/gzip
|
||||
chmod 755 ${bindir}/gunzip
|
||||
cp gzip ${BINDIR}/gzip
|
||||
cp gzip ${BINDIR}/gunzip
|
||||
chmod 755 ${BINDIR}/gzip
|
||||
chmod 755 ${BINDIR}/gunzip
|
||||
|
||||
cd ../..
|
||||
|
||||
|
@ -54,7 +54,7 @@ if match x${UPDATE_CHECKSUMS} xTrue; then
|
|||
sha256sum -o ${pkg}.checksums \
|
||||
/usr/bin/gzip
|
||||
|
||||
cp ${pkg}.checksums ${srcdir}
|
||||
cp ${pkg}.checksums ${SRCDIR}
|
||||
else
|
||||
sha256sum -c ${pkg}.checksums
|
||||
fi
|
||||
|
|
|
@ -17,7 +17,7 @@ cd build
|
|||
lexdir=/lex
|
||||
|
||||
# Extract
|
||||
cp ${distfiles}/${pkg}.tar.bz2 ../src/
|
||||
cp ${DISTFILES}/${pkg}.tar.bz2 ../src/
|
||||
bunzip2 -f ../src/${pkg}.tar.bz2
|
||||
tar xf ../src/${pkg}.tar ${pkg}/yacc ${pkg}/lex
|
||||
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
|
||||
|
||||
# Install yacc
|
||||
install yacc ${bindir}
|
||||
install -m 644 yaccpar /
|
||||
install yacc ${BINDIR}
|
||||
install -m 644 yaccpar ${LIBDIR}
|
||||
|
||||
# Build lex
|
||||
cd ../lex
|
||||
make -f Makefile.mk CC=tcc AR=tcc\ -ar CFLAGS=-DEILSEQ=84\ -DMB_LEN_MAX=100 LDFLAGS=-lgetopt\ -static RANLIB=true
|
||||
|
||||
# Install lex
|
||||
mkdir ${lexdir}
|
||||
install lex ${bindir}
|
||||
install libl.a ${libdir}
|
||||
install -m 644 ncform ${lexdir}
|
||||
mkdir ${LEXDIR}
|
||||
install lex ${BINDIR}
|
||||
install libl.a ${LIBDIR}
|
||||
install -m 644 ncform ${LEXDIR}
|
||||
|
||||
cd ../../..
|
||||
|
||||
|
@ -56,7 +56,7 @@ if match x${UPDATE_CHECKSUMS} xTrue; then
|
|||
/yaccpar \
|
||||
/lex/ncform
|
||||
|
||||
install ${pkg}.checksums ${srcdir}
|
||||
install ${pkg}.checksums ${SRCDIR}
|
||||
else
|
||||
sha256sum -c ${pkg}.checksums
|
||||
fi
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
set -ex
|
||||
|
||||
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 ..
|
||||
|
||||
# Checksums
|
||||
|
@ -14,7 +14,7 @@ if match x${UPDATE_CHECKSUMS} xTrue; then
|
|||
sha256sum -o ${pkg}.checksums \
|
||||
/usr/bin/kexec-fiwix
|
||||
|
||||
cp ${pkg}.checksums ${srcdir}
|
||||
cp ${pkg}.checksums ${SRCDIR}
|
||||
else
|
||||
sha256sum -c ${pkg}.checksums
|
||||
fi
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
mkdir build src
|
||||
cd src
|
||||
ungz --file ${distfiles}/${pkg}.tar.gz --output ${pkg}.tar
|
||||
ungz --file ${DISTFILES}/${pkg}.tar.gz --output ${pkg}.tar
|
||||
cd ..
|
||||
|
||||
cd build
|
||||
|
@ -45,7 +45,7 @@ cc -c ext4_xattr.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 -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 ../../..
|
||||
|
||||
|
@ -54,7 +54,7 @@ if match x${UPDATE_CHECKSUMS} xTrue; then
|
|||
sha256sum -o ${pkg}.checksums \
|
||||
/usr/bin/make_fiwix_initrd
|
||||
|
||||
cp ${pkg}.checksums ${srcdir}
|
||||
cp ${pkg}.checksums ${SRCDIR}
|
||||
else
|
||||
sha256sum -c ${pkg}.checksums
|
||||
fi
|
||||
|
|
|
@ -14,7 +14,7 @@ mkdir build src
|
|||
cd build
|
||||
|
||||
# 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
|
||||
rm ../src/${pkg}.tar
|
||||
cd ${pkg}
|
||||
|
@ -56,7 +56,7 @@ tcc -c -Iglob -DHAVE_STRDUP -DHAVE_DIRENT_H glob/glob.c
|
|||
tcc -c putenv_stub.c
|
||||
|
||||
# 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
|
||||
make --version
|
||||
|
@ -68,7 +68,7 @@ if match x${UPDATE_CHECKSUMS} xTrue; then
|
|||
sha256sum -o ${pkg}.checksums \
|
||||
/usr/bin/make
|
||||
|
||||
cp ${pkg}.checksums ${srcdir}
|
||||
cp ${pkg}.checksums ${SRCDIR}
|
||||
else
|
||||
sha256sum -c ${pkg}.checksums
|
||||
fi
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -14,7 +14,7 @@ mkdir build src
|
|||
cd build
|
||||
|
||||
# Extract
|
||||
cp ${distfiles}/${pkg}.tar.gz ../src/
|
||||
cp ${DISTFILES}/${pkg}.tar.gz ../src/
|
||||
ungz --file ../src/${pkg}.tar.gz --output ../src/${pkg}.tar
|
||||
untar --file ../src/${pkg}.tar
|
||||
cd ${pkg}
|
||||
|
@ -25,11 +25,11 @@ catm config.h
|
|||
catm patchlevel.h
|
||||
|
||||
# Build
|
||||
make -f Makefile PREFIX=${prefix}
|
||||
make -f Makefile PREFIX=${PREFIX}
|
||||
|
||||
# Install
|
||||
cp patch ${prefix}/bin/patch
|
||||
chmod 755 ${prefix}/bin/patch
|
||||
cp patch ${PREFIX}/bin/patch
|
||||
chmod 755 ${PREFIX}/bin/patch
|
||||
|
||||
cd ../..
|
||||
|
||||
|
@ -38,7 +38,7 @@ if match x${UPDATE_CHECKSUMS} xTrue; then
|
|||
sha256sum -o ${pkg}.checksums \
|
||||
/usr/bin/patch
|
||||
|
||||
cp ${pkg}.checksums ${srcdir}
|
||||
cp ${pkg}.checksums ${SRCDIR}
|
||||
else
|
||||
sha256sum -c ${pkg}.checksums
|
||||
fi
|
||||
|
|
|
@ -21,18 +21,16 @@ BINDIR="${ARCH_DIR}/bin"
|
|||
BUILDDIR="${ARCH_DIR}/artifact"
|
||||
|
||||
sysa=/sysa
|
||||
distfiles=/sysa/distfiles
|
||||
prefix=/usr
|
||||
bindir=${prefix}/bin
|
||||
libdir=${prefix}/lib
|
||||
incdir=${prefix}/include
|
||||
srcdir=${prefix}/src
|
||||
DISTFILES=/sysa/distfiles
|
||||
PREFIX=/usr
|
||||
BINDIR=${PREFIX}/bin
|
||||
LIBDIR=${PREFIX}/lib/mes
|
||||
INCDIR=${PREFIX}/include
|
||||
SRCDIR=${PREFIX}/src
|
||||
TMPDIR=/tmp # tmpdir is needed for patch to work
|
||||
|
||||
PATH=/usr/bin
|
||||
|
||||
libdir=${libdir}/mes
|
||||
|
||||
# make
|
||||
pkg="make-3.82"
|
||||
cd ${pkg}
|
||||
|
|
|
@ -11,11 +11,11 @@ set -ex
|
|||
|
||||
# checksum-transcriber utility
|
||||
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
|
||||
|
||||
# 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
|
||||
NYACC_PKG=nyacc-1.00.2
|
||||
|
@ -37,7 +37,7 @@ cd ${pkg}
|
|||
kaem --file ${pkg}.kaem
|
||||
cd ..
|
||||
|
||||
libdir=${libdir}/mes
|
||||
LIBDIR=${LIBDIR}/mes
|
||||
|
||||
# tcc 0.9.27
|
||||
pkg="tcc-0.9.27"
|
||||
|
|
|
@ -8,15 +8,12 @@
|
|||
|
||||
set -e
|
||||
|
||||
# shellcheck disable=SC2154
|
||||
PREFIX="${prefix}"
|
||||
# shellcheck disable=SC2153
|
||||
LIBDIR="${PREFIX}/lib/mes"
|
||||
# shellcheck disable=SC2154
|
||||
SOURCES="${sysa}"
|
||||
DISTFILES="${sysa}/distfiles"
|
||||
DESTDIR=/tmp/destdir
|
||||
# shellcheck disable=SC2154
|
||||
SRCDIR="${srcdir}"
|
||||
|
||||
# shellcheck source=sysa/helpers.sh
|
||||
. helpers.sh
|
||||
|
|
|
@ -16,7 +16,7 @@ mkdir build src
|
|||
cd build
|
||||
|
||||
# Extract
|
||||
cp ${distfiles}/${pkg}.tar.gz ../src/
|
||||
cp ${DISTFILES}/${pkg}.tar.gz ../src/
|
||||
gzip -d -f ../src/${pkg}.tar.gz
|
||||
tar xf ../src/${pkg}.tar
|
||||
cd ${pkg}
|
||||
|
@ -29,8 +29,8 @@ catm config.h
|
|||
make -f Makefile LIBC=mes
|
||||
|
||||
# Install
|
||||
cp sed/sed ${prefix}/bin/sed
|
||||
chmod 755 ${prefix}/bin/sed
|
||||
cp sed/sed ${PREFIX}/bin/sed
|
||||
chmod 755 ${PREFIX}/bin/sed
|
||||
|
||||
cd ../..
|
||||
|
||||
|
@ -39,7 +39,7 @@ if match x${UPDATE_CHECKSUMS} xTrue; then
|
|||
sha256sum -o ${pkg}.checksums \
|
||||
/usr/bin/sed
|
||||
|
||||
cp ${pkg}.checksums ${srcdir}
|
||||
cp ${pkg}.checksums ${SRCDIR}
|
||||
else
|
||||
sha256sum -c ${pkg}.checksums
|
||||
fi
|
||||
|
|
|
@ -16,7 +16,7 @@ mkdir build src
|
|||
cd build
|
||||
|
||||
# Extract
|
||||
cp ${distfiles}/${pkg}.tar.gz ../src/
|
||||
cp ${DISTFILES}/${pkg}.tar.gz ../src/
|
||||
gzip -d -f ../src/${pkg}.tar.gz
|
||||
untar --file ../src/${pkg}.tar
|
||||
rm ../src/${pkg}.tar
|
||||
|
@ -33,8 +33,8 @@ cp src/create.c.new src/create.c
|
|||
make -f Makefile
|
||||
|
||||
# Install
|
||||
cp tar ${prefix}/bin/tar
|
||||
chmod 755 ${prefix}/bin/tar
|
||||
cp tar ${PREFIX}/bin/tar
|
||||
chmod 755 ${PREFIX}/bin/tar
|
||||
|
||||
cd ../..
|
||||
|
||||
|
@ -43,7 +43,7 @@ if match x${UPDATE_CHECKSUMS} xTrue; then
|
|||
sha256sum -o ${pkg}.checksums \
|
||||
/usr/bin/tar
|
||||
|
||||
cp ${pkg}.checksums ${srcdir}
|
||||
cp ${pkg}.checksums ${SRCDIR}
|
||||
else
|
||||
sha256sum -c ${pkg}.checksums
|
||||
fi
|
||||
|
|
|
@ -12,7 +12,7 @@ MES_ARENA=30000000
|
|||
MES_MAX_ARENA=30000000
|
||||
MES_LIB=${MES_PREFIX}/lib
|
||||
MES_SOURCE=${MES_PREFIX}
|
||||
MES=${bindir}/mes
|
||||
MES=${BINDIR}/mes
|
||||
|
||||
TCC_TAR=tcc-0.9.26
|
||||
TCC_PKG=tcc-0.9.26-1147-gee75a10c
|
||||
|
@ -25,8 +25,8 @@ sha256sum -c sources.SHA256SUM
|
|||
mkdir src build
|
||||
|
||||
cd src
|
||||
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}/${TCC_TAR}.tar.gz --output ${TCC_TAR}.tar
|
||||
ungz --file ${DISTFILES}/${MES_PKG}.tar.gz --output ${MES_PKG}.tar
|
||||
cd ..
|
||||
|
||||
cd build
|
||||
|
@ -63,21 +63,21 @@ if match ${ARCH} riscv64; then
|
|||
fi
|
||||
|
||||
|
||||
${MES} --no-auto-compile -e main ${bindir}/mescc.scm -- \
|
||||
${MES} --no-auto-compile -e main ${BINDIR}/mescc.scm -- \
|
||||
-S \
|
||||
-o tcc.s \
|
||||
-I ${incdir} \
|
||||
-I ${INCDIR} \
|
||||
-D BOOTSTRAP=1 \
|
||||
-D HAVE_LONG_LONG=${HAVE_LONG_LONG} \
|
||||
-I . \
|
||||
-D TCC_TARGET_${TCC_TARGET_ARCH}=1 \
|
||||
-D inline= \
|
||||
-D CONFIG_TCCDIR=\"${libdir}/mes/tcc\" \
|
||||
-D CONFIG_TCCDIR=\"${LIBDIR}/tcc\" \
|
||||
-D CONFIG_SYSROOT=\"/\" \
|
||||
-D CONFIG_TCC_CRTPREFIX=\"${libdir}/mes\" \
|
||||
-D CONFIG_TCC_CRTPREFIX=\"${LIBDIR}\" \
|
||||
-D CONFIG_TCC_ELFINTERP=\"/mes/loader\" \
|
||||
-D CONFIG_TCC_SYSINCLUDEPATHS=\"${prefix}/mes/include:${prefix}/include\" \
|
||||
-D TCC_LIBGCC=\"${libdir}/mes/libc.a\" \
|
||||
-D CONFIG_TCC_SYSINCLUDEPATHS=\"${PREFIX}/mes/include:${PREFIX}/include\"
|
||||
-D TCC_LIBGCC=\"${LIBDIR}/libc.a\" \
|
||||
-D CONFIG_TCC_LIBTCC1_MES=0 \
|
||||
-D CONFIG_TCCBOOT=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 ONE_SOURCE=1 \
|
||||
tcc.c
|
||||
${MES} --no-auto-compile -e main ${bindir}/mescc.scm -- \
|
||||
${MES} --no-auto-compile -e main ${BINDIR}/mescc.scm -- \
|
||||
--base-address 0x08048000 \
|
||||
-o tcc-mes \
|
||||
-L ${libdir} \
|
||||
-L ${LIBDIR} \
|
||||
tcc.s \
|
||||
-l c+tcc
|
||||
cp tcc-mes ${bindir}/
|
||||
chmod 755 ${bindir}/tcc-mes
|
||||
|
||||
# Install libc into a subdirectory
|
||||
libdir=${libdir}/mes
|
||||
mkdir ${libdir}
|
||||
cp tcc-mes ${BINDIR}/
|
||||
chmod 755 ${BINDIR}/tcc-mes
|
||||
|
||||
# test tcc-mes
|
||||
tcc-mes -version
|
||||
|
||||
# Recompile the mes C library
|
||||
cd ../${MES_PKG_DIR}
|
||||
cd ../${MES_PKG}
|
||||
|
||||
# Create unified libc file
|
||||
cd lib
|
||||
|
@ -110,35 +106,35 @@ catm ../unified-libc.c ctype/isalnum.c ctype/isalpha.c ctype/isascii.c ctype/isc
|
|||
cd ..
|
||||
|
||||
# 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}/crti.o
|
||||
catm ${LIBDIR}/crtn.o
|
||||
catm ${LIBDIR}/crti.o
|
||||
if match ${ARCH} x86; then
|
||||
# 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
|
||||
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
|
||||
|
||||
# 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 -ar cr ${libdir}/libc.a unified-libc.o
|
||||
tcc-mes -ar cr ${LIBDIR}/libc.a unified-libc.o
|
||||
|
||||
# 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
|
||||
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 -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
|
||||
tcc-mes -ar cr ${libdir}/tcc/libtcc1.a libtcc1.o
|
||||
tcc-mes -ar cr ${LIBDIR}/tcc/libtcc1.a libtcc1.o
|
||||
fi
|
||||
|
||||
# libgetopt.a
|
||||
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}
|
||||
|
||||
|
@ -155,14 +151,14 @@ tcc-mes \
|
|||
-D HAVE_LONG_LONG=1 \
|
||||
-D HAVE_SETJMP=1 \
|
||||
-I . \
|
||||
-I ${prefix}/include \
|
||||
-I ${PREFIX}/include/mes \
|
||||
-D TCC_TARGET_${TCC_TARGET_ARCH}=1 \
|
||||
-D CONFIG_TCCDIR=\"${libdir}/tcc\" \
|
||||
-D CONFIG_TCC_CRTPREFIX=\"${libdir}\" \
|
||||
-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_LIBPATHS=\"${LIBDIR}:${LIBDIR}/tcc\" \
|
||||
-D CONFIG_TCC_SYSINCLUDEPATHS=\"${PREFIX}/include\" \
|
||||
-D TCC_LIBGCC=\"${LIBDIR}/libc.a\" \
|
||||
-D TCC_LIBTCC1=\"libtcc1.a\" \
|
||||
-D CONFIG_TCCBOOT=1 \
|
||||
-D CONFIG_TCC_STATIC=1 \
|
||||
|
@ -170,29 +166,29 @@ tcc-mes \
|
|||
-D TCC_VERSION=\"0.9.26\" \
|
||||
-D ONE_SOURCE=1 \
|
||||
-L . \
|
||||
-L ${libdir} \
|
||||
-L ${LIBDIR} \
|
||||
tcc.c
|
||||
# Install
|
||||
cp tcc-boot0 ${bindir}/
|
||||
chmod 755 ${bindir}/tcc-boot0
|
||||
cp tcc-boot0 ${BINDIR}/
|
||||
chmod 755 ${BINDIR}/tcc-boot0
|
||||
cd ../${MES_PKG_DIR}
|
||||
# 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
|
||||
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}/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
|
||||
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
|
||||
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 -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
|
||||
tcc-boot0 -ar cr ${libdir}/tcc/libtcc1.a libtcc1.o
|
||||
tcc-boot0 -ar cr ${LIBDIR}/tcc/libtcc1.a libtcc1.o
|
||||
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 -ar cr ${libdir}/libc.a unified-libc.o
|
||||
tcc-boot0 -ar cr ${LIBDIR}/libc.a unified-libc.o
|
||||
cd ../${TCC_PKG}
|
||||
|
||||
# Test boot0
|
||||
|
@ -210,14 +206,14 @@ tcc-boot0 \
|
|||
-D HAVE_LONG_LONG=1 \
|
||||
-D HAVE_SETJMP=1 \
|
||||
-I . \
|
||||
-I ${prefix}/include \
|
||||
-I ${PREFIX}/include \
|
||||
-D TCC_TARGET_${TCC_TARGET_ARCH}=1 \
|
||||
-D CONFIG_TCCDIR=\"${libdir}/tcc\" \
|
||||
-D CONFIG_TCC_CRTPREFIX=\"${libdir}\" \
|
||||
-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_LIBPATHS=\"${LIBDIR}:${LIBDIR}/tcc\" \
|
||||
-D CONFIG_TCC_SYSINCLUDEPATHS=\"${PREFIX}/include\" \
|
||||
-D TCC_LIBGCC=\"${LIBDIR}/libc.a\" \
|
||||
-D TCC_LIBTCC1=\"libtcc1.a\" \
|
||||
-D CONFIG_TCCBOOT=1 \
|
||||
-D CONFIG_TCC_STATIC=1 \
|
||||
|
@ -226,25 +222,25 @@ tcc-boot0 \
|
|||
-D ONE_SOURCE=1 \
|
||||
-L . \
|
||||
tcc.c
|
||||
cp tcc-boot1 ${bindir}
|
||||
chmod 755 ${bindir}/tcc-boot1
|
||||
cp tcc-boot1 ${BINDIR}
|
||||
chmod 755 ${BINDIR}/tcc-boot1
|
||||
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
|
||||
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}/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
|
||||
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
|
||||
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 -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
|
||||
tcc-boot1 -ar cr ${libdir}/tcc/libtcc1.a libtcc1.o
|
||||
tcc-boot1 -ar cr ${LIBDIR}/tcc/libtcc1.a libtcc1.o
|
||||
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 -ar cr ${libdir}/libc.a unified-libc.o
|
||||
tcc-boot1 -ar cr ${LIBDIR}/libc.a unified-libc.o
|
||||
cd ../${TCC_PKG}
|
||||
|
||||
# Test boot1
|
||||
|
@ -262,14 +258,14 @@ tcc-boot1 \
|
|||
-D HAVE_LONG_LONG=1 \
|
||||
-D HAVE_SETJMP=1 \
|
||||
-I . \
|
||||
-I ${prefix}/include \
|
||||
-I ${PREFIX}/include \
|
||||
-D TCC_TARGET_${TCC_TARGET_ARCH}=1 \
|
||||
-D CONFIG_TCCDIR=\"${libdir}/tcc\" \
|
||||
-D CONFIG_TCC_CRTPREFIX=\"${libdir}\" \
|
||||
-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_LIBPATHS=\"${LIBDIR}:${LIBDIR}/tcc\" \
|
||||
-D CONFIG_TCC_SYSINCLUDEPATHS=\"${PREFIX}/include\" \
|
||||
-D TCC_LIBGCC=\"${LIBDIR}/libc.a\" \
|
||||
-D TCC_LIBTCC1=\"libtcc1.a\" \
|
||||
-D CONFIG_TCCBOOT=1 \
|
||||
-D CONFIG_TCC_STATIC=1 \
|
||||
|
@ -278,42 +274,42 @@ tcc-boot1 \
|
|||
-D ONE_SOURCE=1 \
|
||||
-L . \
|
||||
tcc.c
|
||||
cp tcc-boot2 ${bindir}
|
||||
chmod 755 ${bindir}/tcc-boot2
|
||||
cp tcc-boot2 ${BINDIR}
|
||||
chmod 755 ${BINDIR}/tcc-boot2
|
||||
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
|
||||
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}/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
|
||||
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
|
||||
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 -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
|
||||
tcc-boot2 -ar cr ${libdir}/tcc/libtcc1.a libtcc1.o
|
||||
tcc-boot2 -ar cr ${LIBDIR}/tcc/libtcc1.a libtcc1.o
|
||||
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 -ar cr ${libdir}/libc.a unified-libc.o
|
||||
tcc-boot2 -ar cr ${LIBDIR}/libc.a unified-libc.o
|
||||
cd ../${TCC_PKG}
|
||||
|
||||
# Test boot2
|
||||
tcc-boot2 -version
|
||||
|
||||
# We have our final tcc 0.9.26!
|
||||
cp ${bindir}/tcc-boot2 ${bindir}/tcc
|
||||
chmod 755 ${bindir}/tcc
|
||||
rm ${bindir}/tcc-boot2
|
||||
cp ${bindir}/tcc ${bindir}/tcc-0.9.26
|
||||
chmod 755 ${bindir}/tcc-0.9.26
|
||||
cp ${BINDIR}/tcc-boot2 ${BINDIR}/tcc
|
||||
chmod 755 ${BINDIR}/tcc
|
||||
rm ${BINDIR}/tcc-boot2
|
||||
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
|
||||
# because nothing is linked against it
|
||||
cd ../${MES_PKG_DIR}
|
||||
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 ../..
|
||||
|
||||
|
@ -331,7 +327,7 @@ if match x${UPDATE_CHECKSUMS} xTrue; then
|
|||
/usr/lib/mes/crtn.o \
|
||||
/usr/lib/mes/tcc/libtcc1.a
|
||||
|
||||
cp ${pkg}.checksums ${srcdir}
|
||||
cp ${pkg}.checksums ${SRCDIR}
|
||||
else
|
||||
sha256sum -c ${pkg}.${ARCH}.checksums
|
||||
fi
|
||||
|
|
|
@ -14,8 +14,8 @@ sha256sum -c sources.SHA256SUM
|
|||
# Extract
|
||||
mkdir build src
|
||||
cd src
|
||||
unbz2 --file ${distfiles}/${pkg}.tar.bz2 --output ${pkg}.tar
|
||||
ungz --file ${distfiles}/${MES_PKG}.tar.gz --output ${MES_PKG}.tar
|
||||
unbz2 --file ${DISTFILES}/${pkg}.tar.bz2 --output ${pkg}.tar
|
||||
ungz --file ${DISTFILES}/${MES_PKG}.tar.gz --output ${MES_PKG}.tar
|
||||
cd ..
|
||||
|
||||
cd build
|
||||
|
@ -39,14 +39,14 @@ catm config.h
|
|||
tcc-0.9.26 \
|
||||
-v \
|
||||
-static \
|
||||
-o ${bindir}/tcc \
|
||||
-o ${BINDIR}/tcc \
|
||||
-D TCC_TARGET_I386=1 \
|
||||
-D CONFIG_TCCDIR=\"${libdir}/tcc\" \
|
||||
-D CONFIG_TCC_CRTPREFIX=\"${libdir}\" \
|
||||
-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_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\" \
|
||||
|
@ -54,7 +54,7 @@ tcc-0.9.26 \
|
|||
tcc.c
|
||||
|
||||
# Recompile the mes C library
|
||||
cd ../${MES_PKG_DIR}
|
||||
cd ../${MES_PKG}
|
||||
|
||||
# Create unified libc file
|
||||
cd lib
|
||||
|
@ -62,14 +62,14 @@ catm ../unified-libc.c ctype/isalnum.c ctype/isalpha.c ctype/isascii.c ctype/isc
|
|||
cd ..
|
||||
|
||||
# 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}/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}/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
|
||||
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 -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 -ar cr ${libdir}/libc.a unified-libc.o
|
||||
tcc -ar cr ${LIBDIR}/libc.a unified-libc.o
|
||||
cd ../..
|
||||
|
||||
# Test
|
||||
|
@ -80,7 +80,7 @@ if match x${UPDATE_CHECKSUMS} xTrue; then
|
|||
sha256sum -o ${pkg}.checksums \
|
||||
/usr/bin/tcc
|
||||
|
||||
cp ${pkg}.checksums ${srcdir}
|
||||
cp ${pkg}.checksums ${SRCDIR}
|
||||
else
|
||||
sha256sum -c ${pkg}.checksums
|
||||
fi
|
||||
|
|
Loading…
Reference in New Issue