From 642b6d0f50c6b6a842c9239a102fe34d5619e931 Mon Sep 17 00:00:00 2001 From: YX Hao Date: Thu, 19 Sep 2013 21:50:38 +0800 Subject: Add the possibility to use noname functions by ordinal tcc.c: process.h:177:20: note: expected 'char * const*' but argument is of type 'char const*const*' tccpe.c: Add the possibility to use noname functions by ordinal. use def file: "AliasName @n" build-tcc.bat: 1. Enable 32 bits mode on 64 bits OS. 2. build doc. _parseLibs.bat: Convenient to use "*.def + *.c" instead of *.a, just use -l* _tcc.bat: a practice of _parseLibs.bat Signed-off-by: YX Hao --- win32/_parseLibs.bat | 79 ++++++++++++++++++++++++++++++++++++++++++++++++++++ win32/_tcc.bat | 30 ++++++++++++++++++++ win32/build-tcc.bat | 9 +++++- 3 files changed, 117 insertions(+), 1 deletion(-) create mode 100644 win32/_parseLibs.bat create mode 100644 win32/_tcc.bat (limited to 'win32') diff --git a/win32/_parseLibs.bat b/win32/_parseLibs.bat new file mode 100644 index 0000000..19e8e64 --- /dev/null +++ b/win32/_parseLibs.bat @@ -0,0 +1,79 @@ +@echo off +setlocal enabledelayedexpansion + +pushd %~dp0 + +::Define as main parameters +set _Args_= +set _LIBs_= +set LIBi= + +set ARGSO=-IExt\include -LExt\lib %* + +::This is for the .def file also have a similar name .c file +::.a file will be larger than .def + .c +::*-uuid.c files are suitable to form libuuid.a +::w32api-3.17.2 +:GetRLib +for %%i in (%ARGSO%) do ( + set ARG=%%i + set OPT=!ARG:~0,2! + if "!OPT!"=="-l" ( + set LIB=!ARG:~2! + set LIBi= + if "!LIB!"=="uuid" ( + set LIBi= lib\*uid.c + ) else ( + if "!LIB!"=="vfw32" ( + set LIBi= lib\msvfw32.def lib\avifil32.def lib\avicap32.def + ) else ( + call :GetLibS + ) + ) + if "!LIBi!"=="" ( + set _Args_=!_Args_! %%i + ) else ( + set LIBi=!LIBi:%~dp0=! + set _LIBs_=!_LIBs_! !LIBi! + echo For lib !LIB! will use: + echo !LIBi! + echo. + ) + ) else ( + set _Args_=!_Args_! %%i + ) +) + +::GetRLib End +popd + +tcc.exe !_Args_! !_LIBs_! + +exit /b + +:::::::::: + +:GetLibS +for %%D in (-Llib %ARGSO%) do ( + set ARG_=%%D + set OPT_=!ARG_:~0,2! + set LIBD= + if "!OPT_!"=="-L" ( + set LIBD=!ARG_:~2! + if exist "!LIBD!" call :GetDLib + ) +) +set LIBD= +set OPT_= +set ARG_= +exit /b +::GetLibD End + +:GetDLib +pushd !LIBD! +for /f "usebackq delims=" %%I in (`"dir /b /s !LIB!.c !LIB!_*.c !LIB!.def !LIB!_*.def 2>nul"`) do ( + set LIBi=!LIBi! "%%I" +) +popd +exit /b +::GetDLib End diff --git a/win32/_tcc.bat b/win32/_tcc.bat new file mode 100644 index 0000000..65a7697 --- /dev/null +++ b/win32/_tcc.bat @@ -0,0 +1,30 @@ +@echo off +setlocal enabledelayedexpansion + +pushd %~dp0 + +path %~dp0;%path% + +set EXT=.exe +echo %*|findstr /R /C:"\<-c\>" >nul &&set EXT=.o +echo %*|findstr /R /C:"\<-shared\>" >nul &&set EXT=.dll + +::1st file found must be the main c file to get output file name +set OUTF= +call :FINDFN %* + +if "%OUTF%"=="" goto :EXIT + +call _parseLibs -vv -o "%OUTF%" %* + +:EXIT +popd +pause +exit /b + +:FINDFN +for %%i in (%*) do ( + if exist %%i set OUTF=%%~dpni%EXT%&goto :ENDFDF +) +:ENDFDF +exit /b diff --git a/win32/build-tcc.bat b/win32/build-tcc.bat index 5bc5585..772ed26 100644 --- a/win32/build-tcc.bat +++ b/win32/build-tcc.bat @@ -5,7 +5,7 @@ @set /p VERSION= < ..\VERSION echo>..\config.h #define TCC_VERSION "%VERSION%" -@if _%PROCESSOR_ARCHITEW6432%_==_AMD64_ goto x86_64 +@rem @if _%PROCESSOR_ARCHITEW6432%_==_AMD64_ goto x86_64 @if _%PROCESSOR_ARCHITECTURE%_==_AMD64_ goto x86_64 @set target=-DTCC_TARGET_PE -DTCC_TARGET_I386 @@ -58,3 +58,10 @@ tiny_libmaker lib/libtcc1.a libtcc1.o alloca86_64.o crt1.o wincrt1.o dllcrt1.o d :the_end del *.o + +:makedoc +echo>..\config.texi @set VERSION %VERSION% +if not exist doc md doc +makeinfo --html --no-split -o doc\tcc-doc.html ../tcc-doc.texi +if exist tcc-win32.txt move tcc-win32.txt doc\ +copy ..\tests\libtcc_test.c examples\ -- cgit v1.3.1