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
2828 LIBS =
2929
3030 ifdef CONFIG_WIN32
31− ifeq ($(ARCH),x86-64)
32− CONFIG_WIN64=yes
33− endif
3431 STRIP_BINARIES = yes
3532 LIBTCC = libtcc.dll
3633 else
@@ -93,18 +90,18 @@ ARM_FILES = $(CORE_FILES) arm-gen.c · 56 unmodified lines
9390 ARM64_FILES = $(CORE_FILES) arm64-gen.c
9491 C67_FILES = $(CORE_FILES) c67-gen.c tcccoff.c
9592
96−ifdef CONFIG_WIN64
97−PROGS+=tiny_impdef$(EXESUF)
98−NATIVE_FILES=$(WIN64_FILES)
99−PROGS_CROSS=$(WIN32_CROSS) $(I386_CROSS) $(X64_CROSS) $(ARM_CROSS) $(ARM64_CROSS) $(C67_CROSS) $(WINCE_CROSS)
100−LIBTCC1_CROSS=lib/i386-win32/libtcc1.a
101−
102−else ifdef CONFIG_WIN32
103−PROGS+=tiny_impdef$(EXESUF)
104−NATIVE_FILES=$(WIN32_FILES)
105−PROGS_CROSS=$(WIN64_CROSS) $(I386_CROSS) $(X64_CROSS) $(ARM_CROSS) $(ARM64_CROSS) $(C67_CROSS) $(WINCE_CROSS)
106−LIBTCC1_CROSS=lib/x86_64-win32/libtcc1.a
107−
93+ifdef CONFIG_WIN32
94+ PROGS+=tiny_impdef$(EXESUF) tiny_libmaker$(EXESUF)
95+ifeq ($(ARCH),x86-64)
96+ NATIVE_FILES=$(WIN64_FILES)
97+ PROGS_CROSS=$(WIN32_CROSS)
98+ LIBTCC1_CROSS=lib/i386-win32/libtcc1.a
99+else
100+ NATIVE_FILES=$(WIN32_FILES)
101+ PROGS_CROSS=$(WIN64_CROSS)
102+ LIBTCC1_CROSS=lib/x86_64-win32/libtcc1.a
103+endif
104+ PROGS_CROSS+=$(X64_CROSS) $(ARM_CROSS) $(ARM64_CROSS) $(C67_CROSS) $(WINCE_CROSS)
108105 else ifeq ($(ARCH),i386)
109106 NATIVE_FILES=$(I386_FILES)
110107 PROGS_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
5050 targetos=`uname`
5151 case $targetos in
5252 MINGW32*) mingw32=yes;;
53+ MSYS*) mingw32=yes;;
5354 DragonFly) noldl=yes;;
5455 OpenBSD) noldl=yes;;
5556 FreeBSD) noldl=yes;;
lib/Makefile+6−5
@@ -8,11 +8,12 @@ VPATH = $(TOPSRC)/lib $(TOPSRC)/win32/lib · 7 unmodified lines
88
99 ifndef TARGET
1010 # we're building the native libtcc1.a
11− ifdef CONFIG_WIN64
12− TARGET = x86_64-win32
13− # using tcc
14− else ifdef CONFIG_WIN32
15− TARGET = i386-win32
11+ ifdef CONFIG_WIN32
12+ ifeq ($(ARCH),x86-64)
13+ TARGET = x86_64-win32
14+ else
15+ TARGET = i386-win32
16+ endif
1617 # using tcc
1718 else ifeq ($(ARCH),i386)
1819 TARGET = i386
win32/build-tcc.bat+7−8
@@ -5,19 +5,17 @@ · 4 unmodified lines
55 @set /p VERSION= < ..\VERSION
66 echo>..\config.h #define TCC_VERSION "%VERSION%"
77
8−@if _%1_==_AMD64_ shift /1 && goto x86_64
9−@if _%1_==_x64_ shift /1 && goto x86_64
8+@if _%PROCESSOR_ARCHITECTURE%_==_AMD64_ goto x86_64
9+@if _%PROCESSOR_ARCHITEW6432%_==_AMD64_ goto x86_64
1010
1111 @set target=-DTCC_TARGET_PE -DTCC_TARGET_I386
12−@set CC=gcc -Os -s -fno-strict-aliasing
13−@if _%1_==_debug_ set CC=gcc -g -ggdb
12+@set CC=gcc -m32 -Os -s -fno-strict-aliasing
1413 @set P=32
1514 @goto tools
1615
1716 :x86_64
1817 @set target=-DTCC_TARGET_PE -DTCC_TARGET_X86_64
19−@set CC=x86_64-w64-mingw32-gcc -Os -s -fno-strict-aliasing
20−@if _%1_==_debug_ set CC=x86_64-w64-mingw32-gcc -g -ggdb
18+@set CC=gcc -m64 -Os -s -fno-strict-aliasing
2119 @set P=64
2220 @goto tools
2321
@@ -36,6 +34,8 @@ tiny_impdef libtcc.dll -o libtcc/libtcc.def · 12 unmodified lines
3634
3735 :copy_std_includes
3836 copy ..\include\*.h include
37+copy ..\tcclib.h include
38+copy ..\tests\libtcc_test.c examples
3939
4040 :libtcc1.a
4141 .\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
5959
6060 :the_end
6161 del *.o
62−copy ..\tests\libtcc_test.c examples
6362
6463 :makedoc
6564 if not exist doc md doc
6665 copy tcc-win32.txt doc
6766 echo>..\config.texi @set VERSION %VERSION%
68−makeinfo --html --no-split -o doc\tcc-doc.html ../tcc-doc.texi
67+makeinfo --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
5454 tcc examples/libtcc_test.c -I libtcc libtcc/libtcc.def
5555
5656 - Compiling with MinGW:
57− gcc examples/libtcc_test.c -I libtcc libtcc.dll
57+ gcc examples/libtcc_test.c -I libtcc libtcc.dll -o libtcc_test.exe
5858
5959 - Compiling with MSVC:
6060 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