aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuis Ontanon <luis.ontanon@gmail.com>2006-02-18 04:03:24 +0000
committerLuis Ontanon <luis.ontanon@gmail.com>2006-02-18 04:03:24 +0000
commitd9462b4a45b3eb5a171653911adc4942a28e2b6a (patch)
treea6acaae24c3eba1225b1e0af7f416ec45bd96d2c
parent97cb055286ea81c5ee3813bd700a1f00d19f34f0 (diff)
Prepare for lua 5.1
svn path=/trunk/; revision=17346
-rw-r--r--acinclude.m478
-rw-r--r--plugins/lua/Makefile.am5
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
-