History

win32/64: msys2 support

Support ./configure && make under msys2 (a new msys fork) on win32 and win64. Get rid of CONFIG_WIN64 make-var. (On windows, WIN32 in general is used for both 32 and 64 bit platforms) Also: - cleanup win32/build-tcc.bat - adjust win32/(doc/)tcc-win32.tx

grischka committed 10 years ago

Commit f3504871 parent 49d31185 files · +27 −29Browse files

Unified · Split

5 files
  1. Makefile +12 −15
  2. configure +1 −0
  3. lib/Makefile +6 −5
  4. win32/build-tcc.bat +7 −8
  5. win32/tcc-win32.txt +1 −1
Makefile+12−15
@@ -28,9 +28,6 @@ LINK_LIBTCC = · 27 unmodified lines
28LIBS =28LIBS =
29 29
30ifdef CONFIG_WIN3230ifdef CONFIG_WIN32
31 ifeq ($(ARCH),x86-64)
32 CONFIG_WIN64=yes
33 endif
34 STRIP_BINARIES = yes31 STRIP_BINARIES = yes
35 LIBTCC = libtcc.dll32 LIBTCC = libtcc.dll
36else33else
@@ -93,18 +90,18 @@ ARM_FILES = $(CORE_FILES) arm-gen.c · 56 unmodified lines
93ARM64_FILES = $(CORE_FILES) arm64-gen.c90ARM64_FILES = $(CORE_FILES) arm64-gen.c
94C67_FILES = $(CORE_FILES) c67-gen.c tcccoff.c91C67_FILES = $(CORE_FILES) c67-gen.c tcccoff.c
95 92
96ifdef CONFIG_WIN6493ifdef CONFIG_WIN32
97PROGS+=tiny_impdef$(EXESUF)94 PROGS+=tiny_impdef$(EXESUF) tiny_libmaker$(EXESUF)
98NATIVE_FILES=$(WIN64_FILES)95ifeq ($(ARCH),x86-64)
99PROGS_CROSS=$(WIN32_CROSS) $(I386_CROSS) $(X64_CROSS) $(ARM_CROSS) $(ARM64_CROSS) $(C67_CROSS) $(WINCE_CROSS)96 NATIVE_FILES=$(WIN64_FILES)
100LIBTCC1_CROSS=lib/i386-win32/libtcc1.a97 PROGS_CROSS=$(WIN32_CROSS)
101 98 LIBTCC1_CROSS=lib/i386-win32/libtcc1.a
102else ifdef CONFIG_WIN3299else
103PROGS+=tiny_impdef$(EXESUF)100 NATIVE_FILES=$(WIN32_FILES)
104NATIVE_FILES=$(WIN32_FILES)101 PROGS_CROSS=$(WIN64_CROSS)
105PROGS_CROSS=$(WIN64_CROSS) $(I386_CROSS) $(X64_CROSS) $(ARM_CROSS) $(ARM64_CROSS) $(C67_CROSS) $(WINCE_CROSS)102 LIBTCC1_CROSS=lib/x86_64-win32/libtcc1.a
106LIBTCC1_CROSS=lib/x86_64-win32/libtcc1.a103endif
107 104 PROGS_CROSS+=$(X64_CROSS) $(ARM_CROSS) $(ARM64_CROSS) $(C67_CROSS) $(WINCE_CROSS)
108else ifeq ($(ARCH),i386)105else ifeq ($(ARCH),i386)
109NATIVE_FILES=$(I386_FILES)106NATIVE_FILES=$(I386_FILES)
110PROGS_CROSS=$(X64_CROSS) $(WIN32_CROSS) $(WIN64_CROSS) $(ARM_CROSS) $(ARM64_CROSS) $(C67_CROSS) $(WINCE_CROSS)107PROGS_CROSS=$(X64_CROSS) $(WIN32_CROSS) $(WIN64_CROSS) $(ARM_CROSS) $(ARM64_CROSS) $(C67_CROSS) $(WINCE_CROSS)
configure+1−0
@@ -50,6 +50,7 @@ cpu= · 49 unmodified lines
50targetos=`uname`50targetos=`uname`
51case $targetos in51case $targetos in
52 MINGW32*) mingw32=yes;;52 MINGW32*) mingw32=yes;;
53 MSYS*) mingw32=yes;;
53 DragonFly) noldl=yes;;54 DragonFly) noldl=yes;;
54 OpenBSD) noldl=yes;;55 OpenBSD) noldl=yes;;
55 FreeBSD) noldl=yes;;56 FreeBSD) noldl=yes;;
lib/Makefile+6−5
@@ -8,11 +8,12 @@ VPATH = $(TOPSRC)/lib $(TOPSRC)/win32/lib · 7 unmodified lines
8 8
9ifndef TARGET9ifndef TARGET
10 # we're building the native libtcc1.a10 # we're building the native libtcc1.a
11 ifdef CONFIG_WIN6411 ifdef CONFIG_WIN32
12 TARGET = x86_64-win3212 ifeq ($(ARCH),x86-64)
13 # using tcc13 TARGET = x86_64-win32
14 else ifdef CONFIG_WIN3214 else
15 TARGET = i386-win3215 TARGET = i386-win32
16 endif
16 # using tcc17 # using tcc
17 else ifeq ($(ARCH),i386)18 else ifeq ($(ARCH),i386)
18 TARGET = i38619 TARGET = i386
win32/build-tcc.bat+7−8
@@ -5,19 +5,17 @@ · 4 unmodified lines
5@set /p VERSION= < ..\VERSION5@set /p VERSION= < ..\VERSION
6echo>..\config.h #define TCC_VERSION "%VERSION%"6echo>..\config.h #define TCC_VERSION "%VERSION%"
7 7
8@if _%1_==_AMD64_ shift /1 && goto x86_648@if _%PROCESSOR_ARCHITECTURE%_==_AMD64_ goto x86_64
9@if _%1_==_x64_ shift /1 && goto x86_649@if _%PROCESSOR_ARCHITEW6432%_==_AMD64_ goto x86_64
10 10
11@set target=-DTCC_TARGET_PE -DTCC_TARGET_I38611@set target=-DTCC_TARGET_PE -DTCC_TARGET_I386
12@set CC=gcc -Os -s -fno-strict-aliasing12@set CC=gcc -m32 -Os -s -fno-strict-aliasing
13@if _%1_==_debug_ set CC=gcc -g -ggdb
14@set P=3213@set P=32
15@goto tools14@goto tools
16 15
17:x86_6416:x86_64
18@set target=-DTCC_TARGET_PE -DTCC_TARGET_X86_6417@set target=-DTCC_TARGET_PE -DTCC_TARGET_X86_64
19@set CC=x86_64-w64-mingw32-gcc -Os -s -fno-strict-aliasing18@set CC=gcc -m64 -Os -s -fno-strict-aliasing
20@if _%1_==_debug_ set CC=x86_64-w64-mingw32-gcc -g -ggdb
21@set P=6419@set P=64
22@goto tools20@goto tools
23 21
@@ -36,6 +34,8 @@ tiny_impdef libtcc.dll -o libtcc/libtcc.def · 12 unmodified lines
36 34
37:copy_std_includes35:copy_std_includes
38copy ..\include\*.h include36copy ..\include\*.h include
37copy ..\tcclib.h include
38copy ..\tests\libtcc_test.c examples
39 39
40:libtcc1.a40:libtcc1.a
41.\tcc %target% -c ../lib/libtcc1.c41.\tcc %target% -c ../lib/libtcc1.c
@@ -59,10 +59,9 @@ tiny_libmaker lib/libtcc1.a libtcc1.o alloca86_64.o crt1.o wincrt1.o dllcrt1.o d · 17 unmodified lines
59 59
60:the_end60:the_end
61del *.o61del *.o
62copy ..\tests\libtcc_test.c examples
63 62
64:makedoc63:makedoc
65if not exist doc md doc64if not exist doc md doc
66copy tcc-win32.txt doc65copy tcc-win32.txt doc
67echo>..\config.texi @set VERSION %VERSION%66echo>..\config.texi @set VERSION %VERSION%
68makeinfo --html --no-split -o doc\tcc-doc.html ../tcc-doc.texi67makeinfo --html --no-split -o doc\tcc-doc.html ../tcc-doc.texi || echo *** tcc-doc.html was not built ***
win32/tcc-win32.txt+1−1
@@ -54,7 +54,7 @@ · 53 unmodified lines
54 tcc examples/libtcc_test.c -I libtcc libtcc/libtcc.def54 tcc examples/libtcc_test.c -I libtcc libtcc/libtcc.def
55 55
56 - Compiling with MinGW:56 - Compiling with MinGW:
57 gcc examples/libtcc_test.c -I libtcc libtcc.dll57 gcc examples/libtcc_test.c -I libtcc libtcc.dll -o libtcc_test.exe
58 58
59 - Compiling with MSVC:59 - Compiling with MSVC:
60 lib /def:libtcc\libtcc.def /out:libtcc.lib60 lib /def:libtcc\libtcc.def /out:libtcc.lib

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t