From 07eb8506089c6d52d759a4436eb1e35225a49941 Mon Sep 17 00:00:00 2001 From: Henry Kroll III Date: Sun, 25 Apr 2010 00:35:25 -0700 Subject: [PATCH] make --enable-cross work properly on x86_64 merge more changes from Fedora spec file into Makefile I did a lot of reading on Makefiles. It should be a lot less hacked now that I got rid of my temporary cross-build script. I had to build i386-win32-tcc as 32 bit in order to use it to build the windows version of libtcc1.a and move that into lib directory. Still testing, but it does build windows fib.exe smoothly now and generates shard lib, libtcc.so.1.0 and test links against it. --- Makefile | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index eb3c82b0..93bec70a 100644 --- a/Makefile +++ b/Makefile @@ -183,15 +183,20 @@ libtcc_test$(EXESUF): tests/libtcc_test.c $(LIBTCCB) $(CC) -o $@ $^ -I. $(CFLAGS) $(LIBS) $(LIBTCCL) ifdef CONFIG_CROSS ifndef CONFIG_WIN32 + cp config.mak config.mak.bak + cp config.h config.h.bak echo "ARCH=i386" >> config.mak - make i386-win32-tcc + echo "#undef HOST_X86_64" >> config.h + echo "#define HOST_I386 1" >> config.h + echo "CFLAGS=-O2 -g -pipe -Wall -m32" >> config.mak + make i386-win32-tcc cp i386-win32-tcc tcc.exe mv libtcc1.a libtcc1.bak make CONFIG_WIN32=1 libtcc1.a mv libtcc1.a lib mv libtcc1.bak libtcc1.a - head -n -1 config.mak > config.bak - mv config.bak config.mak + mv config.mak.bak config.mak + mv config.h.bak config.h endif endif