History

win32: build-tcc.bat: figure out correct bitness of cl.exe

Vlad Vissoultchev committed 9 years ago

Commit 67fe3711 parent 5550e431 file · +21 −6Browse files

Unified · Split

win32/build-tcc.bat+21−6
@@ -3,12 +3,13 @@ · 2 unmodified lines
3@rem ------------------------------------------------------3@rem ------------------------------------------------------
4 4
5@echo off5@echo off
6setlocal
6 7
8set VSCOMNTOOLS=%VS150COMNTOOLS%
9if "%VSCOMNTOOLS%"=="" set VSCOMNTOOLS=%VS140COMNTOOLS%
10if "%VSCOMNTOOLS%"=="" set VSCOMNTOOLS=%VS130COMNTOOLS%
11if "%VSCOMNTOOLS%"=="" set VSCOMNTOOLS=%VS120COMNTOOLS%
7set CC=gcc -Os -s12set CC=gcc -Os -s
8
9set T=32
10if %PROCESSOR_ARCHITECTURE%_==AMD64_ set T=64
11if %PROCESSOR_ARCHITEW6432%_==AMD64_ set T=64
12set /p VERSION= < ..\VERSION13set /p VERSION= < ..\VERSION
13set INST=14set INST=
14set DOC=no15set DOC=no
@@ -68,6 +69,17 @@ goto :a1 · 53 unmodified lines
68:a769:a7
69if not (%1)==() goto :usage70if not (%1)==() goto :usage
70 71
72if not "%CC%"=="@call :cl" goto :p1
73if %T%_==32_ set CLVARS="%VSCOMNTOOLS%..\..\VC\bin\vcvars32.bat"
74if %T%_==64_ set CLVARS="%VSCOMNTOOLS%..\..\VC\bin\amd64\vcvars64.bat"
75if %T%_==_ set T=32& if %Platform%_==X64_ set T=64
76:p1
77if not %T%_==_ goto :p2
78set T=32
79if %PROCESSOR_ARCHITECTURE%_==AMD64_ set T=64
80if %PROCESSOR_ARCHITEW6432%_==AMD64_ set T=64
81:p2
82
71set D32=-DTCC_TARGET_PE -DTCC_TARGET_I38683set D32=-DTCC_TARGET_PE -DTCC_TARGET_I386
72set D64=-DTCC_TARGET_PE -DTCC_TARGET_X86_6484set D64=-DTCC_TARGET_PE -DTCC_TARGET_X86_64
73if %T%==64 goto :t6485if %T%==64 goto :t64
@@ -85,6 +97,9 @@ set PX=i386-win32 · 11 unmodified lines
85 97
86@echo on98@echo on
87 99
100@if %CLVARS%_==_ goto :config.h
101call %CLVARS%
102
88:config.h103:config.h
89echo>..\config.h #define TCC_VERSION "%VERSION%"104echo>..\config.h #define TCC_VERSION "%VERSION%"
90echo>> ..\config.h #ifdef TCC_TARGET_X86_64105echo>> ..\config.h #ifdef TCC_TARGET_X86_64
@@ -93,7 +108,7 @@ echo>> ..\config.h #else · 2 unmodified lines
93echo>> ..\config.h #define CONFIG_TCC_LIBPATHS "{B}/lib/32;{B}/lib"108echo>> ..\config.h #define CONFIG_TCC_LIBPATHS "{B}/lib/32;{B}/lib"
94echo>> ..\config.h #endif109echo>> ..\config.h #endif
95 110
96for %%f in (*tcc.exe tiny_*.exe *tcc.dll) do @del %%f111@del /q *tcc.exe tiny_*.exe *tcc.dll
97 112
98:compiler113:compiler
99%CC% -o libtcc.dll -shared ..\libtcc.c %D% -DONE_SOURCE -DLIBTCC_AS_DLL114%CC% -o libtcc.dll -shared ..\libtcc.c %D% -DONE_SOURCE -DLIBTCC_AS_DLL
@@ -153,7 +168,7 @@ cmd /c makeinfo --html --no-split ../tcc-doc.texi -o doc/tcc-doc.html · 53 unmodified lines
153:doc-done168:doc-done
154 169
155:files-done170:files-done
156for %%f in (*.o *.def *-m??.exe) do @del %%f171@del /q *.o *.def *-m??.exe
157 172
158:copy-install173:copy-install
159@if (%INST%)==() goto :the_end174@if (%INST%)==() goto :the_end

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