diff options
author | Anders Broman <anders.broman@ericsson.com> | 2006-07-19 19:20:58 +0000 |
---|---|---|
committer | Anders Broman <anders.broman@ericsson.com> | 2006-07-19 19:20:58 +0000 |
commit | aa98f8dadd3f37f53f6ba099428e7241fcdc51e4 (patch) | |
tree | c873af9b5a7ec103b250487d8f3d0ceec76ea754 /acinclude.m4 | |
parent | 70c0428e0b61a92f4eae50a5e0458b1de3c43a1f (diff) | |
download | wireshark-aa98f8dadd3f37f53f6ba099428e7241fcdc51e4.tar.gz wireshark-aa98f8dadd3f37f53f6ba099428e7241fcdc51e4.tar.bz2 wireshark-aa98f8dadd3f37f53f6ba099428e7241fcdc51e4.zip |
From Bálint Réczey
- Added support for versioned lua libnames to aclocal.m4
- create generated elua_register.h from Makefile
svn path=/trunk/; revision=18769
Diffstat (limited to 'acinclude.m4')
-rw-r--r-- | acinclude.m4 | 100 |
1 files changed, 64 insertions, 36 deletions
diff --git a/acinclude.m4 b/acinclude.m4 index 26c6672bdc..eb36ee634a 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -797,32 +797,45 @@ AC_DEFUN([AC_WIRESHARK_LIBLUA_CHECK],[ # AC_CHECK_HEADERS(lua.h lualib.h lauxlib.h,, [ - if test "x$lua_dir" != "x" - then - # - # The user used "--with-lua=" to specify a directory - # containing liblua, but we didn't find the header file - # there; that either means they didn't specify the - # right directory or are confused about whether liblua - # is, in fact, installed. Report the error and give up. - # - AC_MSG_ERROR([liblua header not found in directory specified in --with-lua]) - else - if test "x$want_lua" = "xyes" + AC_CHECK_HEADERS(lua5.1/lua.h lua5.1/lualib.h lua5.1/lauxlib.h, + [ + if test "x$lua_dir" != "x" then - # - # The user tried to force us to use the library, but we - # couldn't find the header file; report an error. - # - AC_MSG_ERROR(Header file lua.h not found.) + LUA_INCLUDES="-I$lua_dir/include/lua5.1" else + # we found lua5.1/lua.h, but we don't know which include dir contains it + AC_MSG_ERROR(Header file lua.h was found as lua5.1/lua.h but we can't use it. Please set the PATH for the --with-lua configure parameter. \n probably it is /usr.) + fi + + ], + [ + if test "x$lua_dir" != "x" + then # - # We couldn't find the header file; don't use the - # library, as it's probably not present. + # The user used "--with-lua=" to specify a directory + # containing liblua, but we didn't find the header file + # there; that either means they didn't specify the + # right directory or are confused about whether liblua + # is, in fact, installed. Report the error and give up. # - want_lua=no + AC_MSG_ERROR([liblua header not found in directory specified in --with-lua]) + else + if test "x$want_lua" = "xyes" + then + # + # The user tried to force us to use the library, but we + # couldn't find the header file; report an error. + # + AC_MSG_ERROR(Header file lua.h not found.) + else + # + # We couldn't find the header file; don't use the + # library, as it's probably not present. + # + want_lua=no + fi fi - fi + ]) ]) if test "x$want_lua" != "xno" @@ -904,22 +917,37 @@ AC_DEFUN([AC_WIRESHARK_LIBLUA_CHECK],[ ]) ],[ # - # Restore the versions of CFLAGS, CPPFLAGS, - # LDFLAGS, and LIBS before we added the - # "--with-lua=" directory, as we didn't - # actually find lua there. + # We could not find the libs, maybe we have version number in the lib name # - CFLAGS="$wireshark_save_CFLAGS" - CPPFLAGS="$wireshark_save_CPPFLAGS" - LDFLAGS="$wireshark_save_LDFLAGS" - LIBS="$wireshark_save_LIBS" - LUA_LIBS="" - # User requested --with-lua but it isn't available - if test "x$want_lua" = "xyes" - then - AC_MSG_ERROR(Linking with liblua failed.) - fi - want_lua=no + + LIBS="$wireshark_save_LIBS -llua5.1 -lm" + + AC_CHECK_LIB(lua5.1, luaL_register, + [ + # + # Lua 5.1 found + # + AC_DEFINE(HAVE_LUA_5_1, 1, [Define to use Lua 5.1]) + LUA_LIBS=" -llua5.1 -lm" + ],[ + # + # 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="$wireshark_save_CFLAGS" + CPPFLAGS="$wireshark_save_CPPFLAGS" + LDFLAGS="$wireshark_save_LDFLAGS" + LIBS="$wireshark_save_LIBS" + LUA_LIBS="" + # User requested --with-lua but it isn't available + if test "x$want_lua" = "xyes" + then + AC_MSG_ERROR(Linking with liblua failed.) + fi + want_lua=no + ]) ]) CFLAGS="$wireshark_save_CFLAGS" |