lua-users home
lua-l archive

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


Hello everybody. 

The targets of this message are the Linux distribution guys, but any Lua
user and C++ expert is welcome to contribute to the discussion.

With Lua version 5.1 different distributions decided to adopt different
names for the .pc file (pkg-config). This was quite unfortunate since
some softwares ended up assuming that a system wide Lua 5.1 installation
was providing a lua.pc file (as shipped in the original Lua tarball) and
others a lua5.1.pc file as in Debian and derivatives where multiple Lua
versions need to be co-installable and their .pc files live in the same
directory (thus they must have different names).

With Lua version 5.2 we have a chance to standardise the .pc file name
(or names, see below) and make a better world for everybody ;-)
I'd be very interested in discussing that issue with the maintainers of
Lua in other Linux distributions. 

My proposal, that takes into account only the needs of Debian, is to
ship with the Lua 5.2 packages two .pc files:

  lua5.2.pc
  lua5.2-c++.pc

The former is for standard C applications and points to a shared object
(and eventually its static .a counterpart) compiled with a C compiler
(i.e. using longjump to implement error/pcall).

The latter is for C++ applications that need to call C++ functions from
Lua and vice versa and thus need C++ exceptions to correctly traverse
the stack. Thus the .pc should point to a shared object compiled with
C++, that uses extern "C" for the ABI and that uses try/catch to
implement Lua errors.
I'm not an expert but it seems [1] that both Lua vms (the one compiled
with a C compiler and the one compiled with a C++ compiler) are then
able to load the same C modules (luasocket, lpeg...).

It would be nice to agree on the name(s) of the .pc files to avoid the
unfortunate situation of Lua 5.1, where different distributions adopted
different names. This also holds for the name of the Lua interpreter,
that I propose to call lua5.2 and not simply lua as the original
Makefile does.

Cheers and happy holidays.

[1]: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=560139 
-- 
Enrico Tassi