Skip to content

Commit

Permalink
tcc: A small fast pure C compiler by F. Bellard
Browse files Browse the repository at this point in the history
  • Loading branch information
thomas committed Mar 5, 2019
1 parent d5385b0 commit e9b0f5c
Showing 1 changed file with 57 additions and 0 deletions.
57 changes: 57 additions & 0 deletions tcc-0.9.27-0.build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
#! /bin/bash

PKG=tcc
VERSION=0.9.27
BUILD=0

PREFIX=/pkg/$PKG-$VERSION-$BUILD
if [ -n "$TESTING" ]; then PREFIX=/dev/shm/$PKG-$VERSION-$BUILD ; fi

set -xe
umask 022

BUILD_TMPDIR=/dev/shm/$PKG-$VERSION-$BUILD.build.tmp
test -d $BUILD_TMPDIR && rm -rf $BUILD_TMPDIR
mkdir -p $BUILD_TMPDIR/home
export TMPDIR=$BUILD_TMPDIR
export HOME=$BUILD_TMPDIR/home

exec </dev/null

mkdir -p $PREFIX
cat >$PREFIX/profile <<-EOF
PATH=$PREFIX/bin:\$PATH
if [ -d $PREFIX/.compatlibs ]; then export LD_LIBRARY_PATH=$PREFIX/.compatlibs\${LD_LIBRARY_PATH:+:\$LD_LIBRARY_PATH} ; fi
EOF
. $PREFIX/profile

export MAKEFLAGS="-j $(nproc)"

BUILDDIR=$PREFIX/build

mkdir -p $BUILDDIR
cd $BUILDDIR

test -n "$TESTING" && rm -fr *
test -e tinycc/COPYING || git clone git://repo.or.cz/tinycc.git

cd tinycc
git checkout origin/master

COMPILER=gcc
for LOOP in 1 2; do
git checkout -f master;
git clean -dffx;
./configure \
--prefix=$PREFIX \
--cc=$COMPILER

make
# this is merely for the log, some tests fail
make test || true
make install
ls -l $PREFIX/bin
COMPILER=tcc
done

exit

0 comments on commit e9b0f5c

Please sign in to comment.