lua-users home
lua-l archive

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

Josh Simmons <> writes:
> One minor and bloody annoying (damn you lua package maintainers
> everywhere) thing is that the .pc file is named lua5.1 on debian based
> systems, and lua51 on some others iirc. Not sure if there's an easy
> way to support these various names in the autotools script.

Just check for 'em all... :]

Also remember that "" files are actually shell scripts, so
you can put your tests in loops... (with code to break out of the loop
as soon as a test finds something)

So maybe something  like:

   for lua_pc_name in lua lua5.1 lua-5.1 lua51; do
     PKG_CHECK_MODULES([liblua], [$lua_pc_name], [have_liblua=yes], [:])
     test $have_liblua = yes && break

Would work...  The PKG_CHECK_MODULES which succeeded will have set
liblua_CFLAGS and liblua_LIBS (if none succeeded, have_liblua will still
be "no").

Of course, many systems have Lua libraries installed, but no .pc file
for them, so if have_liblua is still "no" after that, it's probably a
good idea to have _another_ loop which checks for lua libraries the
traditional way (AC_CHECK_LIB, etc).

[I use something similar, but not exactly this, so I haven't tested
the above.]


Mayonnaise, n. One of the sauces that serve the French in place of a state