diff options
author | Luis Ontanon <luis.ontanon@gmail.com> | 2006-02-18 04:03:24 +0000 |
---|---|---|
committer | Luis Ontanon <luis.ontanon@gmail.com> | 2006-02-18 04:03:24 +0000 |
commit | d9462b4a45b3eb5a171653911adc4942a28e2b6a (patch) | |
tree | a6acaae24c3eba1225b1e0af7f416ec45bd96d2c /acinclude.m4 | |
parent | 97cb055286ea81c5ee3813bd700a1f00d19f34f0 (diff) | |
download | wireshark-d9462b4a45b3eb5a171653911adc4942a28e2b6a.tar.gz wireshark-d9462b4a45b3eb5a171653911adc4942a28e2b6a.tar.bz2 wireshark-d9462b4a45b3eb5a171653911adc4942a28e2b6a.zip |
Prepare for lua 5.1
svn path=/trunk/; revision=17346
Diffstat (limited to 'acinclude.m4')
-rw-r--r-- | acinclude.m4 | 78 |
1 files changed, 50 insertions, 28 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 ]) |