Prepare for lua 5.1

svn path=/trunk/; revision=17346
This commit is contained in:
Luis Ontanon 2006-02-18 04:03:24 +00:00
parent 97cb055286
commit d9462b4a45
2 changed files with 51 additions and 32 deletions

View File

@ -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
])

View File

@ -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