Lua binaries for Windows

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Lua binaries for Windows

Philippe Lhoste-2
I have slightly changed the Visual C++ projects I created to compile Lua for
Windows.
I have added some resources, to make more Windows-like binaries.
They includes version information (I use it a lot and find it very useful)
and the now official Lua icon. Even the DLL have this icon, so programs can
access it from the DLL resource.

The version informations are:
"Comments", "Lua - An Extensible Extension Language\0"
"CompanyName", "TeCGraf, PUC-Rio\0"
"FileDescription", VER_FILE_DESC
"FileVersion", "4.0.01\0"
"InternalName", "Lua\0"
"LegalCopyright", "Copyright © 1994-2000 TeCGraf, PUC-Rio\0"
"LegalTrademarks", "\0"
"OriginalFilename", VER_FILE_NAME
"ProductName", "Lua\0"
"ProductVersion", "4.0\0"
"URL", "<a  rel="nofollow" href="http://www.tecgraf.puc-rio.br/lua/\0&quot">http://www.tecgraf.puc-rio.br/lua/\0";
"E-MAIL", "[hidden email]\0"
"AUTHORS", "W. Celes, R. Ierusalimschy & L. H. de Figueiredo\0"

VER_FILE_DESC and VER_FILE_NAME are dependent on the generated binary:
#define VER_FILE_DESC	"Lua Interpreter"
#define VER_FILE_NAME	"Lua.exe"

#define VER_FILE_DESC	"Lua Compiler"
#define VER_FILE_NAME	"LuaC.exe"

#define VER_FILE_DESC	"Lua DLL"
#define VER_FILE_NAME	"Lua.dll"

#define VER_FILE_DESC	"Lua Lib DLL"
#define VER_FILE_NAME	"LuaLib.dll"

#define VER_FILE_DESC	"Lua+Lib DLL"
#define VER_FILE_NAME	"Lua+Lib.dll"

Note I added a Lua+Lib.dll file, grouping Lua and its standard library.
I think it is easier to distribute one DLL instead of two.

Let me know if these informations are accurate or if you want to change them
before I do the actual release.

I also have integrated the small bug fix of Roberto on the "return ;" (if I
recall correctly).
I can't remember if there are other bugs signaled on the list. If there are
any, I would like to integrate them.

And I added the AuxLib functions to the functions exported in LuaLib.dll. I
didn't do it in the previous release because they are not documented in the
official Lua doc. But now that I have the Claudio Terra's documentation, I
know what they are for. Sort of. These functions probably have changed on
Lua 4.0, and I still lack a view of the global picture (which I probably can
get from the lualib sources), but it is still an useful document.

My projects now compile all the files in multithreaded DLL (the .exe were
single threaded). The main advantage is that generated files are smaller, as
they statically linked against the MSVCRT.dll, ie. the C run-time DLL of
Visual C++.
In the previous version, if you didn't cleaned the DLL projects after
generating the libs, the generated DLLs were bloated as they actually used
the previous .obj files... It took me some time to figure out what was going
wrong!

I also added some project dependencies. Before, you had to compile the
projects in a given order, now VC take care of this. The DLLs use also the
.lib as they are compatible now.
I will distribute the .lib for those wanting to link against these.

I would also include the Reuben Thomas' bitwise logical operator library,
but I am a bit reluctant to add non-official extensions. Perhaps as a
secondary DLL?
Perhaps Lua 4.1 will include such binary operators, as they can be quite
useful to parse file headers, among other things.
The regex library is interesting too, but needs to use an external regex
library, so it is likely to bloat the binary. A secondary DLL is the logical
place for such a library. (Speaking of the Windows world, of course.)

I will also create small projects, to test my binaries, and to provide some
elementary samples on how to use Lua in a C project (and to learn how to do
it, actually!). It seems there is a need for such a project, as shows a
recent message asking how to do a "Hello world!" program.

A note on the Lua website thread:
I prefer www.LuaLanguage.org over www.lua.org, as it is more explicit. Don't
forget Lua is a Portuguese common word, so it can be an astronomical or
poetical site as well...
Note I used capital initials, as domain names are case-insensitives, and it
is more readable.
About the cybersquatter: I hate this kind of guy (parasitic), but I must
admit they can grade a name. They ask for a reasonable amount of money, as
Lua have little selling value over a domain name such as www.Beatles.com!
That said, of course I vote against buying this domain name to such a
squatter!

Regards.

--._.·´¯`·._.·´¯`·._.·´¯`·._.·´¯`·._.·´¯`·._.·´¯`·._.--
Philippe Lhoste (Paris -- France)
Professional programmer and amateur artist
http://jove.prohosting.com/~philho/
--´¯`·._.·´¯`·._.·´¯`·._.·´¯`·._.·´¯`·._.·´¯`·._.·´¯`--


Reply | Threaded
Open this post in threaded view
|

Re: Lua binaries for Windows

Reuben Thomas-3
> I would also include the Reuben Thomas' bitwise logical operator library,
> but I am a bit reluctant to add non-official extensions. Perhaps as a
> secondary DLL?

I included bitlib in my EPOC port, but I agree with your reservations (I
didn't include it in the RedHat RPMs, but that's just a straight build). On
EPOC I already have enough bits, and the big problem is that there's no easy
way to dynamically add libraries to a Lua state from OPL (you can't get hold
of DLL symbols by name at run-time).

Under Windows, however, making a secondary DLL seems perfectly reasonable,
though it might be nice to wrap up loading it and opening it in a state (and
other potential secondary DLLs) in a call accessible in the main Lua DLL.

> The regex library is interesting too, but needs to use an external regex
> library, so it is likely to bloat the binary. A secondary DLL is the logical
> place for such a library. (Speaking of the Windows world, of course.)

That sounds about right. On Linux I use the GNU regex library, which is
built into glibc, and hence causes no bloat. Henry Spencer's regex library
compiles up to about 34Kb under Linux as a shared library, which is fairly
economical. I think it might even have been already porteed to Windows; I'll
soon know more as I intend to port it to EPOC, whose DLLs are based on
Windows DLLs and built with the same tools.

-- 
http://sc3d.org/rrt/ | impatience, n.  the urge to do nothing


Reply | Threaded
Open this post in threaded view
|

Re: Lua binaries for Windows

Reuben Thomas-3
In reply to this post by Philippe Lhoste-2
I finally managed to download your binaries archive (which doesn't appear to
be up-to-date with your project files). Simply allowing cookies to and from
your site wasn't enough; I had to stop using Junkbuster altogether...grr...

One question: the Lua.exe and LuaC.exe binaries seem to be statically
linked. What's the point of this?

-- 
http://sc3d.org/rrt/ | certain, a.  insufficiently analysed


Reply | Threaded
Open this post in threaded view
|

Re: Lua binaries for Windows

Philippe Lhoste-2
In reply to this post by Philippe Lhoste-2
Reuben Thomas wrote:

>I finally managed to download your binaries archive (which doesn't appear
to
>be up-to-date with your project files). Simply allowing cookies to and from
>your site wasn't enough; I had to stop using Junkbuster altogether...grr...

You have downloaded the previous version I proposed. As I stated in my
previous mail, if you want to create the DLLs, you have to clean the
projects, otherwise they will use the .obj files created for the .exe which
are statically linked.
I corrected this in my new projects, but I am waiting to see if my resource
version strings are OK for the Lua team before releasing it.
I can send it, though.

>One question: the Lua.exe and LuaC.exe binaries seem to be statically
>linked. What's the point of this?

I first tried to mimic the previous release of Lua (3.2). I dropped that in
the new version, everyting is dynamically linked, giving much smaller
executables.

Regards.

--._.·´¯`·._.·´¯`·._.·´¯`·._.·´¯`·._.·´¯`·._.·´¯`·._.--
Philippe Lhoste (Paris -- France)
Professional programmer and amateur artist
http://jove.prohosting.com/~philho/
--´¯`·._.·´¯`·._.·´¯`·._.·´¯`·._.·´¯`·._.·´¯`·._.·´¯`--