Nmap Development mailing list archives

Re: [BUG] configure: lua version check is done with C++ compiler


From: David Fifield <david () bamsoftware com>
Date: Tue, 11 Sep 2012 22:08:06 -0700

On Sat, Sep 08, 2012 at 09:49:22PM +0200, John Spencer wrote:
configure:6910: checking for lua version >= 501
configure:6928: g++ -o conftest -g -O2 -Wall -fno-strict-aliasing
-I/usr/include/lua -I$(top_srcdir)/libdnet-stripped/include
-I//include/luajit-2.0/ -Wl,-E -lz -Wl,-rpath-link=//li$
configure:6928: $? = 0
configure:6928: ./conftest
Error loading shared library libstdc++.so.6: No such file or
directory (needed by ./conftest)

For some reason we are explicitly requesting a C++ compiler in the
liblua test, while we use a C compiler for almost everything else. Does
anyone know why? (See AC_LANG_PUSH and AC_LANG_POP.)

https://www.gnu.org/software/autoconf/manual/autoconf.html#Language-Choice

    AC_LANG_PUSH(C++)
    AC_MSG_CHECKING([for lua version >= 502])
    AC_RUN_IFELSE([ AC_LANG_PROGRAM(
        [[#include <lua.h>]],
        [[if(LUA_VERSION_NUM < 502) return 1;]])],
        have_lua=yes, have_lua=no, AC_MSG_RESULT(cross-compiling -- assuming yes); have_lua=yes)
    AC_LANG_POP(C++)

it should be compiled with $(CC), not $(CXX)
it is a pure C library, and having it linked to libstdc++.so.6 is
undesirable

You may have a point. But aren't you ultimately going to have to link
with libstdc++ when you link Nmap? Are you able to get a working binary
in your configuration?

David Fifield
_______________________________________________
Sent through the nmap-dev mailing list
http://cgi.insecure.org/mailman/listinfo/nmap-dev
Archived at http://seclists.org/nmap-dev/


Current thread: