Hi,

> Thanks Jan.  But if you get a chance, I'd love to see a patch which
> checks for both the plain "lua" and "lua5.1" versions.  That way it
> would still work on platforms which just use plain "lua" and so it
> would be appropriate for upstream integration.  If we add it to an
> Nmap release, Debian doesn't have to worry about maintaining their own
> custom patch.  Would you write a patch in which configure checks for
> "lua" first and then falls back on "lua5.1" if that fails?  Or, I
> suppose, the other order would probably be fine too.

the patch to the configure.ac files is no problem - I'm having trouble
however to get the autotools to cooperate. Rerunning autoconf alone in
nselib-bin/ fails (read as: produces lots of scary warnings), and if
I run aclocal && autoconf, the generated libtool fails at the build
stage. Bugs like #527503 suggest that I'm not alone with this problem;
I'm afraid I can't do more than to give you my .ac patch. The configure
scripts run fine (including the lua5.1/lua fallback), it just doesn't
build until someone figures out what's wrong with libtool.


Regards,

Jan
--- nmap-4.68.orig/configure.ac 2008-06-15 09:05:12.000000000 +0200
+++ nmap-4.68/configure.ac      2009-05-15 17:48:25.986698422 +0200
@@ -538,8 +538,10 @@
 
   # If they didn't specify it, we try to find it
   if test $have_lua != yes; then
-    AC_CHECK_HEADERS(lua.h lua/lua.h,
-      AC_CHECK_LIB(lua, lua_call, [have_lua=yes; break],, [-lm]))
+    AC_CHECK_HEADERS([lua.h lua/lua.h lua5.1/lua.h],
+      AC_CHECK_LIB(lua, lua_call, [have_lua=yes; LIBLUA_LIBS="-llua"; 
CPPFLAGS="-I/usr/include/lua $CPPFLAGS"; break],, [-lm])
+      AC_CHECK_LIB(lua5.1, lua_call, [have_lua=yes; LIBLUA_LIBS="-llua5.1"; 
CPPFLAGS="-I/usr/include/lua5.1 $CPPFLAGS"; break],, [-lm])
+    )
 
     AC_LANG_PUSH(C++)
     AC_MSG_CHECKING([for lua version >= 501])
@@ -549,7 +551,6 @@
        have_lua=yes, have_lua=no)
     AC_LANG_POP(C++)
   
-    LIBLUA_LIBS="-llua"
     LUA_DEPENDS=""
     LUA_BUILD=""
     LUA_CLEAN=""
--- nmap-4.68.orig/nselib-bin/configure.ac      2009-05-15 17:55:47.834731766 
+0200
+++ nmap-4.68/nselib-bin/configure.ac   2009-05-15 17:57:13.034698515 +0200
@@ -15,7 +15,16 @@
 AC_CANONICAL_HOST
 
 # needed for lua-includes
-AC_CHECK_HEADER([lua.h],,[AC_MSG_NOTICE(using lua-includefiles provided with 
nmap);[LUAINCLUDE=-I../liblua/]],)
+have_lua_headers=no
+AC_CHECK_HEADERS([lua.h lua/lua.h lua5.1/lua.h],[have_lua_headers=yes],,)
+
+if test $have_lua_headers = no; then
+  AC_MSG_NOTICE(using lua-includefiles provided with nmap)
+  LUAINCLUDE=-I../liblua/
+else
+  LUAINCLUDE="-I/usr/include/lua -I/usr/include/lua5.1"
+fi
+
 AC_SUBST(LUAINCLUDE)
 
 AC_CONFIG_FILES([Makefile])

Attachment: signature.asc
Description: Digital signature

Reply via email to