From 023f0efa3c373249b2034030e07b29081901e1b8 Mon Sep 17 00:00:00 2001 From: Dennis Schridde Date: Tue, 2 Oct 2012 18:53:27 +0200 Subject: [PATCH 1/2] Check whether Lua library was compiled with compat support --- configure.ac | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/configure.ac b/configure.ac index 05ce717..db72279 100644 --- a/configure.ac +++ b/configure.ac @@ -68,6 +68,27 @@ else fi fi +_LIBS="${LIBS}" +LIBS="${LUA_LIBS}" + +AC_MSG_CHECKING([whether Lua library was compiled with compat support]) +AC_LINK_IFELSE( + [AC_LANG_PROGRAM([ + #define LUA_COMPAT_ALL + #include + ],[luaL_register(0,0,0);])], + [lua_compat_support=yes], + [lua_compat_support=no] +) +AC_MSG_RESULT([${lua_compat_support}]) + +if test "x${lua_compat_support}" = xno ; then + AC_MSG_ERROR([Lua library needs to be compiled with compat support]) +fi + +LIBS="${_LIBS}" +unset _LIBS + AX_SUBST_L([LUA_CFLAGS], [LUA_LIBS], [LUA], [LUAC]) From 91a7a78b4fcceb9acab6f3ccc0410afe32f88365 Mon Sep 17 00:00:00 2001 From: Dennis Schridde Date: Tue, 2 Oct 2012 19:23:56 +0200 Subject: [PATCH 2/2] Fix Lua compat detection for when lauxlib.h is not in /usr/include --- configure.ac | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index db72279..c9c491d 100644 --- a/configure.ac +++ b/configure.ac @@ -69,7 +69,11 @@ else fi _LIBS="${LIBS}" -LIBS="${LUA_LIBS}" +_CFLAGS="${CFLAGS}" +_CPPFLAGS="${CPPFLAGS}" +LIBS="${LIBS} ${LUA_LIBS}" +CFLAGS="${CFLAGS} ${LUA_CFLAGS}" +CPPFLAGS="${CPPFLAGS} ${LUA_CFLAGS}" AC_MSG_CHECKING([whether Lua library was compiled with compat support]) AC_LINK_IFELSE( @@ -87,7 +91,9 @@ if test "x${lua_compat_support}" = xno ; then fi LIBS="${_LIBS}" -unset _LIBS +CFLAGS="${_CFLAGS}" +CPPFLAGS="${_CPPFLAGS}" +unset _LIBS _CFLAGS _CPPFLAGS AX_SUBST_L([LUA_CFLAGS], [LUA_LIBS], [LUA], [LUAC])