From 9bd69bf49fb37554d199d0040c81bea009d43092 Mon Sep 17 00:00:00 2001 From: grischka Date: Fri, 26 Nov 2010 20:45:10 +0100 Subject: [PATCH] build: remove #include "config.h" from target dependent files This is to make cross build of libtcc1.a easier. --- lib/alloca86-bt.S | 2 -- lib/alloca86.S | 2 -- lib/alloca86_64.S | 2 -- win32/build-tcc.bat | 37 ++++++++++++++++++++----------------- win32/lib/chkstk.S | 2 -- win32/tools/tiny_impdef.c | 1 - win32/tools/tiny_libmaker.c | 1 - 7 files changed, 20 insertions(+), 27 deletions(-) diff --git a/lib/alloca86-bt.S b/lib/alloca86-bt.S index c5d5f4d7..76a85a0f 100644 --- a/lib/alloca86-bt.S +++ b/lib/alloca86-bt.S @@ -1,8 +1,6 @@ /* ---------------------------------------------- */ /* alloca86-bt.S */ -#include "../config.h" - .globl __bound_alloca __bound_alloca: diff --git a/lib/alloca86.S b/lib/alloca86.S index fb208a0b..b06d4c44 100644 --- a/lib/alloca86.S +++ b/lib/alloca86.S @@ -1,8 +1,6 @@ /* ---------------------------------------------- */ /* alloca86.S */ -#include "../config.h" - .globl alloca alloca: diff --git a/lib/alloca86_64.S b/lib/alloca86_64.S index 13c4672e..44f66c81 100644 --- a/lib/alloca86_64.S +++ b/lib/alloca86_64.S @@ -1,8 +1,6 @@ /* ---------------------------------------------- */ /* alloca86_64.S */ -#include "../config.h" - .globl alloca alloca: diff --git a/win32/build-tcc.bat b/win32/build-tcc.bat index cb2721ae..e0c5f5ef 100644 --- a/win32/build-tcc.bat +++ b/win32/build-tcc.bat @@ -4,50 +4,53 @@ @set PROMPT=$G$S echo>..\config.h #define TCC_VERSION "0.9.25" -echo>>..\config.h #define TCC_TARGET_PE 1 echo>>..\config.h #define CONFIG_TCCDIR "." echo>>..\config.h #define CONFIG_SYSROOT "" +@set target=-DTCC_TARGET_PE -DTCC_TARGET_I386 +@set CC=gcc +@set AR=ar @if _%PROCESSOR_ARCHITEW6432%_==_AMD64_ goto x86_64 @if _%PROCESSOR_ARCHITECTURE%_==_AMD64_ goto x86_64 @goto tools :x86_64 -echo>>..\config.h #define TCC_TARGET_X86_64 1 -@set P=x86_64-pc-mingw32- +@set target=-DTCC_TARGET_PE -DTCC_TARGET_X86_64 +@set CC=x86_64-pc-mingw32-gCC +@set AR=x86_64-pc-mingw32-ar @set S=_64 @goto tools :tools -%P%gcc -Os tools/tiny_impdef.c -o tiny_impdef.exe -s -%P%gcc -Os tools/tiny_libmaker.c -o tiny_libmaker.exe -s +%CC% %target% -Os tools/tiny_impdef.c -o tiny_impdef.exe -s +%CC% %target% -Os tools/tiny_libmaker.c -o tiny_libmaker.exe -s :libtcc if not exist libtcc\nul mkdir libtcc copy ..\libtcc.h libtcc\libtcc.h -%P%gcc -Os -fno-strict-aliasing ../libtcc.c -c -o libtcc.o -%P%ar rcs libtcc/libtcc.a libtcc.o +%CC% %target% -Os -fno-strict-aliasing ../libtcc.c -c -o libtcc.o +%AR% rcs libtcc/libtcc.a libtcc.o :tcc -%P%gcc -Os -fno-strict-aliasing ../tcc.c -o tcc.exe -s -DTCC_USE_LIBTCC -ltcc -Llibtcc +%CC% %target% -Os -fno-strict-aliasing ../tcc.c -o tcc.exe -s -DTCC_USE_LIBTCC -ltcc -Llibtcc :copy_std_includes copy ..\include\*.h include :libtcc1.a -.\tcc -c lib/crt1.c -.\tcc -c lib/wincrt1.c -.\tcc -c lib/dllcrt1.c -.\tcc -c lib/dllmain.c -.\tcc -c ../lib/libtcc1.c -.\tcc -c lib/chkstk.S -.\tcc -c ../lib/alloca86%S%.S +.\tcc %target% -c lib/crt1.c +.\tcc %target% -c lib/wincrt1.c +.\tcc %target% -c lib/dllcrt1.c +.\tcc %target% -c lib/dllmain.c +.\tcc %target% -c ../lib/libtcc1.c +.\tcc %target% -c lib/chkstk.S +.\tcc %target% -c ../lib/alloca86%S%.S @set LIBFILES=crt1.o wincrt1.o dllcrt1.o dllmain.o chkstk.o libtcc1.o alloca86%S%.o @if not _%P%==_ goto makelib -.\tcc -c ../lib/alloca86-bt%S%.S -.\tcc -c ../lib/bcheck.c +.\tcc %target% -c ../lib/alloca86-bt%S%.S +.\tcc %target% -c ../lib/bcheck.c @set LIBFILES=%LIBFILES% alloca86-bt%S%.o bcheck.o diff --git a/win32/lib/chkstk.S b/win32/lib/chkstk.S index 5791aaa4..44b88f1b 100644 --- a/win32/lib/chkstk.S +++ b/win32/lib/chkstk.S @@ -1,8 +1,6 @@ /* ---------------------------------------------- */ /* chkstk86.s */ -#include "../../config.h" - /* ---------------------------------------------- */ #ifndef TCC_TARGET_X86_64 /* ---------------------------------------------- */ diff --git a/win32/tools/tiny_impdef.c b/win32/tools/tiny_impdef.c index f801e0b5..586c49d3 100644 --- a/win32/tools/tiny_impdef.c +++ b/win32/tools/tiny_impdef.c @@ -26,7 +26,6 @@ #include #include #include -#include "../../config.h" char *get_export_names(FILE *fp); #define tcc_free free diff --git a/win32/tools/tiny_libmaker.c b/win32/tools/tiny_libmaker.c index df973178..77e7b4c7 100644 --- a/win32/tools/tiny_libmaker.c +++ b/win32/tools/tiny_libmaker.c @@ -25,7 +25,6 @@ #include /* for mktemp */ #endif -#include "../../config.h" #include "../../elf.h" #define ARMAG "!\n"