Start phasing out internal copy of Lua
- don't build internal copy of Lua - move 3rd party extensions (posix and rexlib) to toplevel luaext/ directory, built by default (unless --without-lua specified) - auto*foo checks for external Lua - minimal tweaks to lposix.c and rpmlua.c to get them build with Lua 5.1
This commit is contained in:
parent
23f6917b10
commit
d48e6c8380
|
@ -16,9 +16,12 @@ SUBDIRS = po misc
|
|||
if WITH_INTERNAL_DB
|
||||
SUBDIRS += db3
|
||||
endif
|
||||
SUBDIRS += lua rpmio rpmdb lib build python scripts doc . tests
|
||||
if WITH_LUAEXT
|
||||
SUBDIRS += luaext
|
||||
endif
|
||||
SUBDIRS += rpmio rpmdb lib build python scripts doc . tests
|
||||
|
||||
DIST_SUBDIRS = po misc lua rpmio rpmdb lib build python scripts doc tests
|
||||
DIST_SUBDIRS = po misc luaext rpmio rpmdb lib build python scripts doc tests
|
||||
|
||||
pkgconfigdir = $(libdir)/pkgconfig
|
||||
|
||||
|
|
18
configure.ac
18
configure.ac
|
@ -802,13 +802,25 @@ AM_CONDITIONAL(SELINUX,[test "$with_selinux" = yes])
|
|||
WITH_LUA_LIB=
|
||||
WITH_LUA_INCLUDE=
|
||||
AC_ARG_WITH(lua, [ --with-lua build with lua support ],,[with_lua=yes])
|
||||
AS_IF([test "$with_lua" = yes],[
|
||||
AC_CHECK_HEADER([lua.h],[
|
||||
AC_CHECK_LIB(lua,[luaL_openlibs],[with_lua=yes],[
|
||||
AC_MSG_ERROR([--with-lua given, but liblua not found])
|
||||
],
|
||||
[-lm])
|
||||
],[
|
||||
AC_MSG_ERROR([--with-lua given, but lua.h not found])
|
||||
])
|
||||
])
|
||||
|
||||
AS_IF([test "$with_lua" = yes],[
|
||||
AC_DEFINE(WITH_LUA, 1, [Build with lua support?])
|
||||
WITH_LUA_INCLUDE="-I\${top_srcdir}/lua/include -I\${top_srcdir}/lua/local"
|
||||
WITH_LUA_LIB="\$(top_builddir)/lua/liblua.la"
|
||||
WITH_LUA_INCLUDE="-I\${top_srcdir}/luaext"
|
||||
WITH_LUA_LIB="-llua -lm \$(top_builddir)/luaext/libluaext.la"
|
||||
])
|
||||
AC_SUBST(WITH_LUA_LIB)
|
||||
AC_SUBST(WITH_LUA_INCLUDE)
|
||||
AM_CONDITIONAL(WITH_LUAEXT,[test "$with_lua" = yes])
|
||||
|
||||
with_dmalloc=no
|
||||
AC_ARG_WITH(dmalloc, [ --with-dmalloc build with dmalloc debugging support ])
|
||||
|
@ -1060,7 +1072,7 @@ AC_CONFIG_FILES([Makefile
|
|||
misc/Makefile
|
||||
doc/Makefile
|
||||
python/Makefile
|
||||
lua/Makefile
|
||||
luaext/Makefile
|
||||
tests/Makefile
|
||||
])
|
||||
AC_OUTPUT
|
||||
|
|
|
@ -0,0 +1,15 @@
|
|||
noinst_LTLIBRARIES = libluaext.la
|
||||
|
||||
AM_CPPFLAGS = -I$(top_builddir)
|
||||
AM_CPPFLAGS += -I$(srcdir)/include -I.
|
||||
|
||||
libluaext_la_CPPFLAGS = $(AM_CPPFLAGS) -DWITH_POSIX
|
||||
libluaext_la_LIBADD = -llua -lm
|
||||
libluaext_la_SOURCES = \
|
||||
lposix.h \
|
||||
lposix.c \
|
||||
lrexlib.h \
|
||||
lrexlib.c
|
||||
|
||||
linit.lch: linit.lua
|
||||
bin2c linit.lua > linit.lch
|
|
@ -66,7 +66,7 @@ static int doselection(lua_State *L, int i, const char *const S[], Selector F, c
|
|||
}
|
||||
else
|
||||
{
|
||||
int j=luaL_findstring(luaL_checkstring(L, i), S);
|
||||
int j=luaL_checkoption(L, i, NULL, S);
|
||||
if (j==-1) luaL_argerror(L, i, "unknown selector");
|
||||
return F(L, j, data);
|
||||
}
|
|
@ -46,7 +46,9 @@ rpmlua rpmluaNew()
|
|||
{"io", luaopen_io},
|
||||
{"string", luaopen_string},
|
||||
{"debug", luaopen_debug},
|
||||
#if 0
|
||||
{"loadlib", luaopen_loadlib},
|
||||
#endif
|
||||
{"posix", luaopen_posix},
|
||||
{"rex", luaopen_rex},
|
||||
{"rpm", luaopen_rpm},
|
||||
|
|
Loading…
Reference in New Issue