lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Wednesday, September 7, 2005, 2:59:52 PM, Mike Pall wrote:

> BTW: Here's what one needs to do to get Lua to cross-compile
> for Windows with MINGW:

> Add the following target to the top-level Makefile:

> mingw:
>        cd src; $(MAKE) "LUA_A=lua51.dll" "LUA_T=lua.exe" \
>        "AR=gcc -shared -o" "RANLIB=strip --strip-unneeded" \
>        "MYCFLAGS=-DLUA_BUILD_AS_DLL" "MYLIBS=" MYLDFLAGS=-s" lua.exe

There is a double-quote character missing in front of MYLDFLAGS here,
and in the same place in the new lua-5.1-alpha Makefile

With this change, this mingw target also works for MinGW/MSYS on Windows.

> The trailing lua.exe target is needed because luac.exe can't be
> built this way. The required symbols are not exported from the DLL.
> Just make clean, run make (without a target) and rename luac to
> luac.exe.

For those willing to live dangerously (in the sense that extra symbols
are exported from the DLL that are not official Lua APIs):

mingw_e:
        cd src; $(MAKE) "LUA_A=lua51.dll" "LUA_T=lua.exe" "LUAC_T=luac.exe" \
        "AR=gcc -shared -Wl,--export-all-symbols -o" "RANLIB=strip --strip-unneeded" \
        "MYCFLAGS=-DLUA_BUILD_AS_DLL" "MYLIBS=" "MYLDFLAGS=-s" all

e