At least! I made Tiny C Compiler work with the official libs...
You will need:
- The official SDK
- The latest patch to the official SDK
- MSYS with CVS
- wget in your path
This script is easily adaptable to run on other operating system
CODE
#!/bin/sh
# tcc_distro.sh
# This script tries to generate a GP2X suitable TCC distro.
# for GP2XSDK+MSYS
export PATH=$PATH:/c/GP2XSDK/dll:/c/GP2XSDK/Tools/bin
# CVS path to retrieve latest TCC sources
TCC_CVS_PATH="
server:anonymous@cvs.savannah.nongnu.org:/sources/tinycc"
# ARM libtcc1.a sourcecode URL
LIBTCC1_ARM_URL="http://www.stud.uni-hannover.de/~daniel/tcc"
LIBTCC1_ARM_FILE="libtcc1-src.tar.gz"
# onboard prefix
PREFIX="/mnt/sd/dev/tcc"
# cross compiler
CC="arm-gp2x-linux-gcc"
# library archiver
AR="arm-gp2x-linux-ar"
# crt1.o, crtn.o path
OBJ01="/c/GP2XSDK/Tools/arm-gp2x-linux/lib"
# standard library path
LIB01="/c/GP2XSDK/Tools/arm-gp2x-linux/lib"
# extra libraries path
LIB02="/c/GP2XSDK/Tools/arm-gp2x-linux/lib"
# libgcc.a path
LIB03="/c/GP2XSDK/Tools/lib/gcc/arm-gp2x-linux/3.4.6"
# compiler internals include path
INCLUDE01="/c/GP2XSDK/Tools/lib/gcc/arm-gp2x-linux/3.4.6/include"
# standard include path
INCLUDE02="/c/GP2XSDK/Tools/arm-gp2x-linux/include"
# extra include path
INCLUDE03="/c/GP2XSDK/Tools/include"
# name of the generated patch
PATCH01="tinycc_ofiles_prefix.patch"
# extra options to compiler
#CFLAGS="-static"
CFLAGS=""
rm -rf tinycc
cvs -z3 -d$TCC_CVS_PATH co tinycc
cat<<EOF>$PATCH01
--- tinycc/tcc.c 2007-06-30 09:08:52.000000000 -0500
+++ tinycc/tcc.c 2007-06-30 08:49:59.000000000 -0500
@@ -113,7 +113,7 @@
/* path to find crt1.o, crti.o and crtn.o. Only needed when generating
executables or dlls */
-#define CONFIG_TCC_CRT_PREFIX CONFIG_SYSROOT "/usr/lib"
+#define CONFIG_TCC_CRT_PREFIX CONFIG_TCCDIR
#define INCLUDE_STACK_SIZE 32
#define IFDEF_STACK_SIZE 64
EOF
patch -p0 < $PATCH01
rm -rf $PATCH01
cd tinycc
./configure --prefix=$PREFIX --enable-cross \
--cc="$CC"
$CC $CFLAGS -O2 -g -Wall -falign-functions=0 -fno-strict-aliasing -DTCC_TARGET_ARM \
-o tcc tcc.c -ldl
cd ..
wget -c $LIBTCC1_ARM_URL/$LIBTCC1_ARM_FILE
tar xvzf $LIBTCC1_ARM_FILE
cat makelib1 | sed -e "s/arm-linux-gcc/$CC/g" > makelib.modified1
cat makelib.modified1 | sed -e "s/arm-linux-ar/$AR/g" > makelib.modified
rm -rf makelib.modified1
sh makelib.modified
rm -rf makelib.modified
rm -rf distro
mkdir distro
mkdir distro/tcc
mkdir distro/tcc/bin
cp tinycc/tcc distro/tcc/bin
mkdir distro/tcc/lib
#mkdir distro/tcc/lib/tcc
echo -n "Copying object files... "
cp -rL $OBJ01/crt*.o distro/tcc/
echo "done."
echo -n "Copying libs... "
cp -rL libtcc1.a distro/tcc/
cp -rL $LIB01/lib* distro/tcc/lib
cp -rL $LIB02/lib* distro/tcc/lib
cp -rL $LIB03/lib* distro/tcc/lib
echo "done."
mkdir distro/tcc/include
echo -n "Copying include files... "
cp -rL $INCLUDE01/* distro/tcc/include
cp -rL $INCLUDE02/* distro/tcc/include
cp -rL $INCLUDE03/* distro/tcc/include
# to override stdarg.h, because SDK's one doesn't seem to work with TCC
cp -rL tinycc/std*.h distro/tcc/include
echo "done."
echo -n "Cleaning up... "
rm -rf tinycc
echo "done."
With this and Termula2x, you can code games on the go...