Hi all,

(Those using more sensible operating systems can safely skip this. You
can also skip this if the MS toolchain satisfies your needs.)

The current win32 downloadable package contains a msvcr80 version of
Lua (MSVC 2005), just as currently used in Lua for Windows. Now Ryan
and I have been making noises for a while about moving over to a pure
mingw distribution, that is, not linking against this particular MS
runtime.  This will have a number of benefits, in particular not
having to track the moving target of the current MSVC runtime (it's
becoming hard to actually get this 'elderly' version of MSVC).

This package was brought out specifically to integrate with LfW, and
so hard-codes a few assumptions about linking when used with mingw
(installing with the /MW switch). It assumes that the Lua import
library is lua5.1.lib. With a typical pure mingw Lua setup, you would
link instead against the Lua DLL instead. So lines like this have to
be generalized (luarocks.build.builtin)

         add_flags(extras, "%s.lib", libraries)
         extras[#extras+1] = dir.path(variables.LUA_LIBDIR, "lua5.1.lib")
         extras[#extras+1] = "-l" .. (variables.MSVCRT or "msvcr80")

So there needs to be a variables.LUA_LIBNAME instead of "lua5.1.lib",
and the link against the MS runtime needs to be optional.

Another complication is that LR must correctly detect whether it is a
32-bit or 64-bit version of Windows; I've confirmed that which.exe
will not do that[1]. A strategy is to look for the full name of the
mingw compiler (it is mingw32-gcc.exe for 32-bits ,etc) and work from
that. This allows people to still use a 32-bit toolchain on 64-bit
Windows.

Now why I am thinking aloud:  essentially the default will become pure
mingw when one specifies an external version of Lua, which is a change
of behaviour.

Does this feel reasonable?

steve d.

[1] Yes, I know, use MSYS to get a more consistent environment. But
that would be imposing a particular toolset on end users. A more
typical scenario is something using a single install of mingw (e.g.
TDM) and then having the choice of whether they want the pseudo-Unix
environment.

_______________________________________________
Luarocks-developers mailing list
[email protected]
http://lists.luaforge.net/cgi-bin/mailman/listinfo/luarocks-developers

Reply via email to