[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: [ANNOUNCE] Lua 4.1 (work4)
- From: Tom Wrensch <twrensch@...>
- Date: Mon, 18 Feb 2002 10:40:06 -0800 (PST)
A brief comment on this thread that concerns Lua's (lack) of use of the
auto config utility. It is somewhat off-topic, but I think it might show
how a subset of Lua users might feel about this issue:
First, a cavet: I am not a make expert. I am not a make fan. Make is, at
best, a necessary evil.
I have had difficulty making the lua make files work on both Win32 and
SunOS 5.8. I finally found an easy work-around on Win32 for VC++ which I
will get to in a bit.
I did finally get Lua compiled on SunOS after much fiddling and
swearing. When I had to recompile it on a different SunOS machine I
decided to try the same workaround I used for VC++, and it worked like a
charm. So for those of you who have trouble using make and don't mind
using a really dumb approach to solving the problem try this:
Put all the lua source and header files in one directly. This includes
lua.c, the library files, the files from the include directly, but NOT the
files from luac or the etc. files. In visual C++ make a project in that
directory and add all the files to the project. Hit build all. Done.
On most Unix systems you can go cd to the directly and do
cc *.c -lm
And you're done. (the executable is in a.out, so you have to rename it).
Ugly, but effective. No make files, no config files, and you have a
stand-alone lua executable. Of course if your using lua as an embedded
language in a larger application, this probably wont work.
So, to bring this back to the topic of this thread, I expect there are
many Lua users, particularly those who use lua as a scripting language,
who would benifit from an easy way to compile Lua on their system. The
open source "standard" being discussed here probably isn't what's
needed. Maybe just someone coming up with some clear step-by-step
directions for those who do not regularly use tools like make and
And please don't say that users who don't know these tools shouldn't use
Lua. Lua is a much higher level language than C or C++ and its users may
be quite expert programmers who just don't make much use of lower-level
- Tom Wrensch
On Mon, 18 Feb 2002, Thatcher Ulrich wrote:
> On Feb 18, 2002 at 11:26 -0300, Luiz Henrique de Figueiredo wrote:
> > Only if you want to do something other than the default. And it's a
> > config file, not the Makefile. As far as I can tell, the Makefile is
> > pretty standard. If not, I welcome suggestion on making the
> > Makefiles more standard and portable.
> I like the Makefiles as they are, but I think one improvement to make
> them more Win32-friendly would be to use macros to specify the file
> extensions, because the windows conventions are different:
> .o --> .obj
> .a --> .lib
> .so --> .dll
> I took a stab at making the Makefiles compatible with "nmake", which
> is the version of make that ships with MSVC. Unfortunately, I think
> it's difficult to achieve nmake/GNU Make compatibility; for example
> nmake requires a "!" in "!include $(LUA)/config", and the "cd include;
> $(MAKE) $@" doesn't work at all, etc.
> Personally, I use cygwin under Win32 to make it tolerable, and stock
> Lua builds fine with cygwin using the GNU tools and the Unix file
> extension conventions. However, often I need to develop using MSVC
> (Microsoft Visual C/C++), to make it easy to distribute executables,
> and to be compatible with projects that are Win32-specific. In these
> circumstances I like to use GNU make, but calling the MSVC compiler
> and using Win32 file extension conventions. These are things that can
> be accounted for in lua/config.
> So, I've made Makefiles for Lua-4.1-work4 which can easily be adapted
> to Win32/MSVC by editing lua/config. I've uploaded it to the wiki as
> a PowerPatch so people can have a look at it:
> http://www.lua-users.org/wiki/PowerPatches . By default it should not
> affect the Unix build at all (if it does, then that's a bug -- let me
> know). Under Windows, if you have GNU make, you can just edit the
> "config" file and build with MSVC by doing "make". I left comments
> for Windows users in the "config" file, as well as an explanation in
> the "INSTALL" file.
> I'd love to see this get folded into the standard Lua distribution,
> since I think it would help Win32 folks in general, without hurting
> anyone else.
> TODO: I didn't experiment at all with the .so support in the
> makefiles. I'm pretty sure that can be supported without too much
> trouble, but I just didn't have time for it this morning. Also, I
> didn't do anything with "make install" under Windows; I'm not sure
> what, if anything, would make sense there.
> Thatcher Ulrich <firstname.lastname@example.org>