Add package: tcc

This commit is contained in:
PedroEdiaz
2024-06-16 12:34:38 +06:00
parent 277ed72980
commit dd12df5ef8
4 changed files with 130 additions and 0 deletions

54
devel/tcc.d/Makefile Normal file
View File

@@ -0,0 +1,54 @@
version=79a8229fb5da15135ac0c54c2c696a8da8988b24
package=tcc
pkgver=${version}_0
description=BSD Make tool
conflict=
homepage=Tiny C compiler
license=LGPL-2.1
replace=
alternatives=cc:/usr/bin/cc:tcc
shlib-provides=
shlib-requires=libc.so
include ../../Makefile
SOURCES = \
${version}.tar.gz
FILES = \
files/ar \
files/Makefile \
files/Makefile-libs
${version}.tar.gz:
${DOWNLOAD} https://repo.or.cz/tinycc.git/snapshot/$@
${SHA256} ec4b05d28f83970b9f405ed50c60fe8fac88826ef7ce80fa95ec4a5cde2a319f
GITHASH = `echo ${version} | dd ibs=1 obs=1 count=7 2>/dev/null`
prepare: ${SOURCES} ${FILES}
tar -zxf ${version}.tar.gz
mv tinycc-${GITHASH} build
mv files/ar build/
mv -f files/Makefile build/
mv -f files/Makefile-libs build/lib/Makefile
root:
./configure \
--prefix=/usr \
--cc=${CC} \
--config-musl
${MAKE} GITHASH=${GITHASH}
${MAKE} DESTDIR=${root} install
root-posix:
mkdir -p ${root}/usr/bin
install -Dm 755 ar "${root}/usr/bin/ar"
root-man:
install -Dm 644 tcc-doc.texi "${root}/usr/share/man/man1/tcc.texi"

View File

@@ -0,0 +1,52 @@
.POSIX:
OBJECTS = \
tcc.o \
libtcc.o \
tccpp.o \
tccgen.o \
tccdbg.o \
tccelf.o \
tccasm.o \
tccrun.o \
x86_64-gen.o \
x86_64-link.o \
i386-asm.o
ONE_SOURCE=0
include config.mak
XCFLAGS = ${CFLAGS} -I. ${NATIVE_DEFINES} \
-DTCC_TARGET_X86_64 -DTCC_MUSL -DONE_SOURCE=${ONE_SOURCE}
.SUFFIXES: .c .o .S
.c.o:
${CC} ${XCFLAGS} -c $<
all: tcc libs
tcc: libtcc.a tcc.o
${CC} -o tcc tcc.o libtcc.a -lm -lpthread -ldl -s
tcc.o:
${CC} ${XCFLAGS} -DTCC_GITHASH="\"HEAD:${GITHASH}\"" -c tcc.c
tccpp.o: tccdefs_.h
tccdefs_.h:
${CC} -DC2STR conftest.c -o c2str.exe
./c2str.exe include/tccdefs.h tccdefs_.h
libtcc.a: ${OBJECTS}
${AR} ${ARFLAGS} $@ ${OBJECTS}
libs: tcc
${MAKE} CC=../tcc -C ./lib
clean:
rm ${OBJECTS} libtcc.a c2str.ext tccdefs_.h tcc
install: tcc libs
install -Dm 755 tcc $(bindir)/tcc
install -Dm 644 lib/libtcc1.a $(libdir)/libtcc1.a

View File

@@ -0,0 +1,21 @@
.POSIX:
OBJECTS = \
libtcc1.o \
alloca.o \
alloca-bt.o \
tcov.o \
stdatomic.o \
va_list.o \
dsohandle.o
CFLAGS = -B.. -I..
libtcc1.a: $(OBJECTS)
$(AR) rcs $@ $(OBJECTS)
.SUFFIXES: .S
.S.o:
$(CC) $(CFLAGS) -o $@ -c $>

3
devel/tcc.d/files/ar Normal file
View File

@@ -0,0 +1,3 @@
#!/bin/sh
/usr/bin/tcc -ar "$@"