[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Lua on Mac/Darwin (patches)
- From: Anders F Björklund <afb@...>
- Date: Sun, 12 Jun 2005 09:51:33 +0200
Hi, new to this list (and partly to Lua too)
I have some Lua-5.0.2 patches to contribute.
Not sure if you might be aware of it already,
but Darwin (the Mac OS X foundation) does not
use .so files but instead .dylib for libraries.
There is a patch in DarwinPorts already, but
I'm not sure if it has made it upstream to Lua ?
There is also a related issue with that if you
use "-lfoo -lbar" on Mac OS X, it *always* uses
shared libraries if they are available. On e.g.
Linux it would prefer the static libs instead.
So I added a "sobin" target to the Makefiles,
and made the regular target do a static build...
(by including the actual library files directly)
The cleaned up patch regarding Darwin/Mac OS X is at:
It also addresses the lack of a DESTDIR, which is good
to have if you are making a package for instance ?
Part two is about running the programs on Mac OS
(either Mac OS 9, or Mac OS X without the console)
There is a add-on to CodeWarrior called "SIOUX",
which makes it put up windows with input/output
and optionally a dialog for any program arguments.
It's a nice complement to the regular (shell)
versions of the programs, and I've used it to
make a combo build of "MacLua" that works on
both Mac OS 9 (with CarbonLib) and Mac OS X...
It only requires a small patch, in order to initialize
the console on "macintosh" (i.e. before Mac OS X arrived,
if you want the window there you have to add -Dmacintosh)
I didn't prompt for arguments to "lua", since it runs just
fine in the interactive mode without any such extras, but I
did for "luac" since it can put them to good use. There are
also pre-built "MacLua" binaries available from my new page
about it at: http://www.algonet.se/~afb/lua/ ("MacLua 5.0.2")
The mac-conditionalized patch is at:
BTW. Lua script files need Mac line endings on the Mac.
(I used 'TEXT' type for scripts, and 'CODE' for chunks)
Neither patch should hurt other platforms,
so I'm hoping they can go into Lua 5.1 ?