[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Lua 5.1 shared libraries, on Mac
- From: Anders F Björklund <afb@...>
- Date: Sat, 21 Jan 2006 18:08:31 +0100
Just tried upgrading to Lua 5.1 "final/rc",
and testing with running luaglut from lua.
http://lua-users.org/files/wiki_insecure/users/VarolKaptan/
Sadly, none of my 2 Mac targets work without
first patching the regular Lua distribution ? :(
1) "MacLua" - Mac OS 9 / Mac OS X (Carbon)
The CFM targets didn't work at all, since
none of the Mac patches had been included.
After applying the old patch for the beta,
http://www.algonet.se/~afb/lua/lua-5.1-cfm.patch
and updating the exported symbols, it compiled.
Running the MacLua/Luac sample programs required:
http://www.algonet.se/~afb/lua/lua-5.1-mac.patch
2) "lua" - Mac OS X : make && sudo make install
The Mach-O targets didn't include the ".bundle"
suffix in the default search paths, only ".so" ?
So it couldn't find the modules to load, without
renaming them or adding symbolic links to them...
File type is: "luaglut.bundle: Mach-O bundle ppc",
it is called ".so" on Linux and ".dll" on Windows.
Luaglut also had to be updated, since the old
functions "dobuffer" and "loadlib" went missing.
But I guess that was an intended change, so I
just updated the code to use the new functions:
i.e. lua_dobuffer -> luaL_loadbuffer + lua_pcall
http://www.algonet.se/~afb/lua/luaglut-0.4-lua51.patch
Finally, it did work OK! Just wondered what the
status of including the Mac patches were, or if
Mac is not really a supported platform for Lua ?
(all patches at http://www.algonet.se/~afb/lua/)
The GLUT demos are working fine in both Mac OS.
(both spinning the teapot, and loading textures)
Is it possible to add support for CFM libraries
and Mach-O loadable bundles (i.e. .bundle) yet ?
#if defined(LUA_USE_MACOSX)
#define LUA_CPATH_DEFAULT \
"./?.bundle;" LUA_CDIR"?.bundle;" LUA_CDIR"loadall.bundle;" \
"./?.so;" LUA_CDIR"?.so;" LUA_CDIR"loadall.so"
#else
#define LUA_CPATH_DEFAULT \
"./?.so;" LUA_CDIR"?.so;" LUA_CDIR"loadall.so"
#endif
Added *both* .bundle and .so, since some use "so".
(for instance: Perl uses .bundle, Python uses .so)
--anders
PS.
The default Lua "make install" is also missing the
*extra* ranlib after install as required by Darwin:
ld: table of contents for archive: /usr/local/lib/liblua.a is out of
date; rerun ranlib(1) (can't load from it)