lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]



Sam Roberts kirjoitti 27.10.2008 kello 18:26:

On Mon, Oct 27, 2008 at 1:27 AM, Heesob Park <phasis@gmail.com> wrote:
Is there any module for automating makefile generation?

Check on luaforge, but I've never seen one used. Its kindof clunky,
but lua projects just seem to come with simple makefiles. The
philosophy seems to be, agree with it or not, that lua is mostly used
as a script core embedded into larger projects - and that you will use
that larger projects build system.

Well, he was asking about a C library, a Lua module that is.

I would suggest taking some existing one, s.a. Lua Lanes or maybe LuaSocket, and seeing how that is being built.

There is also a wiki page about OS specific issues, which are a few.

	http://luaforge.net/frs/?group_id=265&release_id=1142

	http://luaforge.net/frs/?group_id=23&release_id=837

It wouldn't be bad to have a simple, multi-OS makefile sample somewhere. Maybe you will do that?


How to get the lib and include directory name of the current Lua
install environment with Lua script?

You might be able to process the package.path and cpath to deduce
where the default install locations should be:

% lua -e 'print(package.path)'
./?.lua;/usr/local/share/lua/5.1/?.lua;/usr/local/share/lua/5.1/?/ init.lua;/usr/local/lib/lua/5.1/?.lua;/usr/local/lib/lua/5.1/?/ init.lua;/usr/share/lua/5.1/?.lua;/usr/share/lua/5.1/?/init.lua
% lua -e 'print(package.cpath)'
./?.so;/usr/local/lib/lua/5.1/?.so;/usr/lib/lua/5.1/?.so;/usr/local/ lib/lua/5.1/loadall.so

Depends on your system, which you did not name to us.

On OS X with fink Lua 5.1:

	$ pkg-config lua --variable=INSTALL_LMOD
	/sw/share/lua/5.1

	$ pkg-config lua --variable=INSTALL_CMOD
	/sw/lib/lua/5.1

Those variables are in the 'etc/lua.pc' that comes with Lua itself, so maybe this works with other distributions as well.

-asko




Sam