[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: RE: Where is 'luavs.bat' in 5.2
- From: Thijs Schreijer <thijs@...>
- Date: Sat, 11 Jan 2014 07:59:30 +0000
> -----Original Message-----
> From: lua-l-bounces@lists.lua.org [mailto:lua-l-bounces@lists.lua.org] On
> Behalf Of Luiz Henrique de Figueiredo
> Sent: vrijdag 10 januari 2014 19:19
> To: Lua mailing list
> Subject: Re: Where is 'luavs.bat' in 5.2
>
> We'd rather have the simplest luavs.bat possible.
Why? As a windows user I would rather have something that simply works, and if that takes a more complex batch file, so be it. I suspect that your main reason is a lack of Windows knowledge (no pun intended), but in that case please consider making a point that it is community contributed and hence community supported. Though I understand that it might violate your basic 'closed development' principles.
> Here is what is at
> http://www.lua.org/extras/5.2/luavs.bat. What is the simplest .bat that
> does the same thing but wihout variables and ideally without the manifest
> stuff, if at all possible? In particular, what compilation options are
> really needed? Thanks for your Windows expertise.
Unfortunately I 'm unable to help with that as my compiler knowledge is very limited. I'm trying to fix problems as I encounter them (just learning by doing here).
That said, I would very much appreciate it if the windows stuff would work out of the box, based on its defaults, as it does on the other platforms. That would take (imo);
For MinGW target;
1 by default include the `lua52.dll` file in `TO_BIN`. Currently one
MUST provide TO_BIN="lua.exe luac.exe lua52.dll" for `make install` otherwise
it simply won't work (without the dll), so defaults are broken here...
For Visual Studio / Windows SDK targets;
2 by default include /DLUA_COMPAT_ALL. For some reason it is the default on all
platforms, except on Windows VS/WinSDK.
3 include an equivalent for `make install` that builds the proper structure
from the build results.
1: I have no 'make' skills so cannot propose any changes
2: attached another 'luavs.bat' that includes the flag and has a comment on being
The equivalent for 'make mingw' while using VS/WinSDK. I removed the 'option'
and just included the flag as per your request for 'simple'.
3: attached a new batch file 'luavsinstall.bat' which is the equivalent of
'make install' for doing the installation of the proper file structure. I also
kept that one as simple as possible. I hope you can include it.
Thijs
@echo off
rem Script to install Lua 5.2 under "Visual Studio .NET Command Prompt".
rem Do not run from this directory; run it from the toplevel: etc\luavsinstall.bat .
rem It creates the standard Lua structure with ./bin ./include ./lib etc. folders.
rem This command does for Visual Studio as `make install` does with the MinGW toolchain,
rem where the parameter [TargetDirectory] equals the `INSTALL_TOP=[TargetDirectory]`
rem parameter in the MinGW setup, other parameters are not supported.
setlocal
if [%1]==[] (
echo USAGE: etc\luavsinstall.bat [TargetDirectory]
echo Do not run from its own location, but run it from the toplevel.
echo First build using `etc\luavs.bat` before calling `etc\luavsinstall.bat`
echo.
exit /B 1
)
@echo on
cd src
mkdir %1\bin
mkdir %1\include
mkdir %1\lib
mkdir %1\lib\lua
mkdir %1\lib\lua\5.2
mkdir %1\man
mkdir %1\man\man1
mkdir %1\share
mkdir %1\share\lua\5.2
copy lua.exe %1\bin
copy luac.exe %1\bin
copy lua52.dll %1\bin
copy lauxlib.h %1\include
copy lua.h %1\include
copy lua.hpp %1\include
copy luaconf.h %1\include
copy lualib.h %1\include
copy lua52.lib %1\lib
cd ..\doc
copy lua.1 %1\man\man1
copy luac.1 %1\man\man1
cd ..
@rem Script to build Lua 5.2 under "Visual Studio .NET Command Prompt".
@rem Do not run from this directory; run it from the toplevel: etc\luavs.bat .
@rem It creates lua52.dll, lua52.lib, lua.exe, and luac.exe in src.
@rem (contributed by David Manura and Mike Pall)
@rem This command does for Visual Studio as `make mingw` does with the MinGW toolchain
@rem (but without supporting any commandline parameters)
@setlocal
@set MYCOMPILE=cl /nologo /MD /O2 /W3 /c /D_CRT_SECURE_NO_DEPRECATE /DLUA_COMPAT_ALL
@set MYLINK=link /nologo
@set MYMT=mt /nologo
cd src
%MYCOMPILE% /DLUA_BUILD_AS_DLL l*.c
del lua.obj luac.obj
%MYLINK% /DLL /out:lua52.dll l*.obj
if exist lua52.dll.manifest^
%MYMT% -manifest lua52.dll.manifest -outputresource:lua52.dll;2
%MYCOMPILE% /DLUA_BUILD_AS_DLL lua.c
%MYLINK% /out:lua.exe lua.obj lua52.lib
if exist lua.exe.manifest^
%MYMT% -manifest lua.exe.manifest -outputresource:lua.exe
%MYCOMPILE% l*.c
del lua.obj linit.obj lbaselib.obj ldblib.obj liolib.obj lmathlib.obj^
loslib.obj ltablib.obj lstrlib.obj loadlib.obj
%MYLINK% /out:luac.exe *.obj
if exist luac.exe.manifest^
%MYMT% -manifest luac.exe.manifest -outputresource:luac.exe
del *.obj *.manifest
cd ..