diff options
-rw-r--r-- | acinclude.m4 | 78 | ||||
-rw-r--r-- | plugins/lua/Makefile.am | 5 |
2 files changed, 51 insertions, 32 deletions
diff --git a/acinclude.m4 b/acinclude.m4 index 1630ffffcd..0a9197d5d8 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -759,7 +759,7 @@ AC_DEFUN([AC_ETHEREAL_LIBLUA_CHECK],[ ethereal_save_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS -I$lua_dir/include" ethereal_save_LIBS="$LIBS" - LIBS="$LIBS -llua -llualib" + LIBS="$LIBS -L$lua_dir/lib -llua" ethereal_save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS -L$lua_dir/lib" else @@ -771,6 +771,7 @@ AC_DEFUN([AC_ETHEREAL_LIBLUA_CHECK],[ ethereal_save_CPPFLAGS="$CPPFLAGS" ethereal_save_LDFLAGS="$LDFLAGS" ethereal_save_LIBS="$LIBS" + LIBS="$LIBS -llua" fi # @@ -814,7 +815,7 @@ AC_DEFUN([AC_ETHEREAL_LIBLUA_CHECK],[ # # let's check if the libs are there # - AC_CHECK_LIB(lua, lua_version, + AC_CHECK_LIB(lua, lua_call, [ if test "x$lua_dir" != "x" then @@ -824,41 +825,60 @@ AC_DEFUN([AC_ETHEREAL_LIBLUA_CHECK],[ # LDFLAGS, and LIBS. # LUA_LIBS="-L$lua_dir/lib -llua" - CFLAGS="-I$lua_dir/include $ethereal_save_CFLAGS" - + LUA_INCLUDES="-I$lua_dir/include" else LUA_LIBS="-llua" + LUA_INCLUDES="" fi # # we got lua, now look for lualib # - LIBS="$LIBS $LUA_LIBS -lm" - - AC_CHECK_LIB(lualib, luaopen_base, + AC_CHECK_LIB(lualib, luaL_openlib, [ + # + # we have 5.0 + # LUA_LIBS="$LUA_LIBS -llualib" ],[ - if test "x$lua_dir" != "x" - then - # - # Restore the versions of CFLAGS, CPPFLAGS, - # LDFLAGS, and LIBS before we added the - # "--with-lua=" directory, as we didn't - # actually find lua there. - # - CFLAGS="$ethereal_save_CFLAGS" - CPPFLAGS="$ethereal_save_CPPFLAGS" - LDFLAGS="$ethereal_save_LDFLAGS" - LIBS="$ethereal_save_LIBS" - LUA_LIBS="" - fi - # User requested --with-lua but it isn't available - if test "x$want_lua" = "xyes" - then - AC_MSG_ERROR(Linking with liblualib failed.) - fi - want_lua=no + # + # no lualib, in 5.1 there's only liblua + # do we have 5.1? + # + + LIBS="$ethereal_save_LIBS $LUA_LIBS" + + AC_CHECK_LIB(lua, luaL_register, + [ + # + # Lua 5.1 found + # + AC_DEFINE(HAVE_LUA_5_1, 1, [Define to use Lua 5.1]) + ],[ + # + # No, it is not 5.1 + # + if test "x$lua_dir" != "x" + then + # + # Restore the versions of CFLAGS, CPPFLAGS, + # LDFLAGS, and LIBS before we added the + # "--with-lua=" directory, as we didn't + # actually find lua there. + # + CFLAGS="$ethereal_save_CFLAGS" + CPPFLAGS="$ethereal_save_CPPFLAGS" + LDFLAGS="$ethereal_save_LDFLAGS" + LIBS="$ethereal_save_LIBS" + LUA_LIBS="" + fi + # User requested --with-lua but it isn't available + if test "x$want_lua" = "xyes" + then + AC_MSG_ERROR(Linking with liblualib failed.) + fi + want_lua=no + ]) ]) ],[ # @@ -879,11 +899,13 @@ AC_DEFUN([AC_ETHEREAL_LIBLUA_CHECK],[ fi want_lua=no ]) - + + CFLAGS="$ethereal_save_CFLAGS" CPPFLAGS="$ethereal_save_CPPFLAGS" LDFLAGS="$ethereal_save_LDFLAGS" LIBS="$ethereal_save_LIBS" AC_SUBST(LUA_LIBS) + AC_SUBST(LUA_INCLUDES) fi ]) diff --git a/plugins/lua/Makefile.am b/plugins/lua/Makefile.am index 3f352b2afe..3af0d87f24 100644 --- a/plugins/lua/Makefile.am +++ b/plugins/lua/Makefile.am @@ -21,7 +21,7 @@ # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # -INCLUDES = -I$(top_srcdir) +INCLUDES = -I$(top_srcdir) @LUA_INCLUDES@ plugindir = @plugindir@ @@ -42,13 +42,11 @@ lua_la_SOURCES = \ lua_la_LDFLAGS = -module -avoid-version lua_la_LIBADD = @PLUGIN_LIBS@ @LUA_LIBS@ - # Libs must be cleared, or else libtool won't create a shared module. # If your module needs to be linked against any particular libraries, # add them here. LIBS = - CLEANFILES = \ *~ @@ -63,4 +61,3 @@ EXTRA_DIST = \ dummy: touch dummy - |