lua-users home
lua-l archive

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

> Anyone know how to write a in order to generate a .so Lua
> module?

Just for your information.

mk-configure is not Lua-centric.
It is a full-featured replacement for GNU autotools.
Latest version has support for Lua.

$  cat Makefile

.include <>
$  mkcmake
checking for program pkg-config... /usr/pkg/bin/pkg-config
checking for [pkg-config] lua... 1 (yes)
checking for [pkg-config] lua --cflags... -I/usr/pkg/include
checking for [pkg-config] lua --libs... -Wl,-R/usr/pkg/lib -L/usr/pkg/lib -llua -lm
checking for [pkg-config] lua --variable=INSTALL_CMOD... /usr/pkg/lib/lua/5.1
checking for header lua.h... yes
checking for program cc... /usr/bin/cc
cc  -DHAVE_HEADER_LUA_H=1   -I/usr/pkg/include  -c -fPIC -DPIC foo.c -o foo.os
building shared foo library (version )
cc -shared -Wl,-soname -Wl, -o  foo.os -Wl,-R/usr/pkg/lib -L/usr/pkg/lib -llua -lm
$  mkcmake installdirs install DESTDIR=/tmp/fakeroot
for d in _ /tmp/fakeroot/usr/pkg/lib/lua/5.1; do  test "$d" = _ ||
/usr/bin/install -d "$d";  done
/usr/bin/install   -c -o cheusov  -g users -m 644

Best regards, Aleksey Cheusov.