[MacPorts] #16194: nmap 4.68: upgrade fails (missing include path)
#16194: nmap 4.68: upgrade fails (missing include path) ---------------------------------+------------------------------------------ Reporter: vinc17@macports.org | Owner: opendarwin.org@darkart.com Type: defect | Status: new Priority: Normal | Milestone: Port Bugs Component: ports | Version: 1.6.0 Keywords: nmap build | ---------------------------------+------------------------------------------ When upgrading nmap: {{{ [...] Compiling nmap rm -f nmap /usr/bin/g++-4.0 -L/opt/local/lib -L/opt/local/lib -L/opt/local/lib -Lnbase -Lnsock/src/ -o nmap main.o nmap.o targets.o tcpip.o nmap_error.o utils.o idle_scan.o osscan.o osscan2.o output.o scan_engine.o timing.o charpool.o services.o protocols.o nmap_rpc.o portlist.o NmapOps.o TargetGroup.o Target.o FingerPrintResults.o service_scan.o NmapOutputTable.o MACLookup.o nmap_tty.o nmap_dns.o traceroute.o portreasons.o nse_main.o nse_nsock.o nse_init.o nse_fs.o nse_nmaplib.o nse_debug.o nse_pcrelib.o nse_string.o -lnbase -lnsock -lpcre -lpcap -lssl -lcrypto libdnet-stripped/src/.libs/libdnet.a -llua -lm Compiling nse-standard-library ./libtool --tag=CC --silent --mode=compile /usr/bin/gcc-4.0 -no-cpp- precomp -O2 -Wall -fno-strict-aliasing -DHAVE_CONFIG_H -DNMAP_NAME=\"Nmap\" -DNMAP_URL=\"http://nmap.org\" -DNMAP_PLATFORM =\"powerpc-apple-darwin8.11.0\" -DNMAPDATADIR=\"/opt/local/share/nmap\" -DNMAPLIBEXECDIR=\"/opt/local/libexec/nmap\" -c bit.c In file included from bit.c:11: bit.h:6:21: error: lauxlib.h: No such file or directory bit.h:7:17: error: lua.h: No such file or directory [...] }}} I'd say that the problem is that -I/opt/local/include is missing. Indeed there was no problem in configure. From config.log: {{{ configure:7459: checking lua.h usability configure:7476: /usr/bin/gcc-4.0 -c -O2 -Ilibdnet-stripped/include -I/opt/local/include -I/opt/local/include -I/opt/local/include conftest.c
&5 configure:7482: $? = 0 configure:7496: result: yes configure:7500: checking lua.h presence configure:7515: /usr/bin/cpp-4.0 -Ilibdnet-stripped/include -I/opt/local/include -I/opt/local/include -I/opt/local/include conftest.c configure:7521: $? = 0 configure:7535: result: yes configure:7563: checking for lua.h configure:7571: result: yes }}}
-- Ticket URL: <http://trac.macports.org/ticket/16194> MacPorts <http://www.macports.org/> Ports system for Mac OS
#16194: nmap 4.68: upgrade fails (missing include path) ----------------------------------+----------------------------------------- Reporter: vinc17@macports.org | Owner: opendarwin.org@darkart.com Type: defect | Status: new Priority: Normal | Milestone: Port Bugs Component: ports | Version: 1.6.0 Resolution: | Keywords: nmap build ----------------------------------+----------------------------------------- Changes (by jmr@macports.org): * cc: dluke@geeklair.net (added) Comment: This only happens when the lua port is active (it's not listed as a dependency of nmap). So it looks like configure is finding the lua in ${prefix} but build is not. I guess either lua should be added as a dependency and nmap should be taught where to find it, or it should be made to always use its included lua. -- Ticket URL: <http://trac.macports.org/ticket/16194#comment:1> MacPorts <http://www.macports.org/> Ports system for Mac OS
#16194: nmap 4.68: upgrade fails (missing include path) ----------------------------------+----------------------------------------- Reporter: vinc17@macports.org | Owner: opendarwin.org@darkart.com Type: defect | Status: closed Priority: Normal | Milestone: Port Bugs Component: ports | Version: 1.6.0 Resolution: fixed | Keywords: nmap build ----------------------------------+----------------------------------------- Changes (by dluke@macports.org): * status: new => closed * resolution: => fixed Comment: fixed in r38969 -- Ticket URL: <http://trac.macports.org/ticket/16194#comment:2> MacPorts <http://www.macports.org/> Ports system for Mac OS
#16194: nmap 4.68: upgrade fails (missing include path) ----------------------------------+----------------------------------------- Reporter: vinc17@macports.org | Owner: opendarwin.org@darkart.com Type: defect | Status: reopened Priority: Normal | Milestone: Port Bugs Component: ports | Version: 1.6.0 Resolution: | Keywords: nmap build ----------------------------------+----------------------------------------- Changes (by vinc17@macports.org): * status: closed => reopened * resolution: fixed => Comment: This doesn't solve the problem. I'll attach a patch that fixes it. The problem was a missing CPPFLAGS in "nselib-bin/Makefile.in". Also, I don't know why /usr/local/lib is in this file, but the "-rpath /usr/local/lib" is needed, otherwise bit.o is generated instead of bit.so, and the mv fails. -- Ticket URL: <http://trac.macports.org/ticket/16194#comment:3> MacPorts <http://www.macports.org/> Ports system for Mac OS
#16194: nmap 4.68: upgrade fails (missing include path) ----------------------------------+----------------------------------------- Reporter: vinc17@macports.org | Owner: opendarwin.org@darkart.com Type: defect | Status: reopened Priority: Normal | Milestone: Port Bugs Component: ports | Version: 1.6.0 Resolution: | Keywords: nmap build ----------------------------------+----------------------------------------- Comment (by dluke@macports.org): ... but with the change in r38969 nmap shouldn't be building against the lua in ${prefix} so it shouldn't need the patch. Can you attach the complete configure output with the updated portfile so I can see what's happening on your machine? -- Ticket URL: <http://trac.macports.org/ticket/16194#comment:4> MacPorts <http://www.macports.org/> Ports system for Mac OS
#16194: nmap 4.68: upgrade fails (missing include path) ----------------------------------+----------------------------------------- Reporter: vinc17@macports.org | Owner: opendarwin.org@darkart.com Type: defect | Status: reopened Priority: Normal | Milestone: Port Bugs Component: ports | Version: 1.6.0 Resolution: | Keywords: nmap build ----------------------------------+----------------------------------------- Comment (by vinc17@macports.org): nselib-bin/Makefile.in contains {{{ $(LIBTOOL) $(LTFLAGS) --mode=compile $(CC) @LUAINCLUDE@ $(CFLAGS) -c bit.c }}} and I suppose that @LUAINCLUDE@ should be replaced by a -I flag to the liblua directory provided by nmap, but it is replaced by nothing. Indeed nselib-bin/Makefile contains: {{{ $(LIBTOOL) $(LTFLAGS) --mode=compile $(CC) $(CFLAGS) -c bit.c }}} -- Ticket URL: <http://trac.macports.org/ticket/16194#comment:5> MacPorts <http://www.macports.org/> Ports system for Mac OS
#16194: nmap 4.68: upgrade fails (missing include path) ----------------------------------+----------------------------------------- Reporter: vinc17@macports.org | Owner: opendarwin.org@darkart.com Type: defect | Status: reopened Priority: Normal | Milestone: Port Bugs Component: ports | Version: 1.6.0 Resolution: | Keywords: nmap build ----------------------------------+----------------------------------------- Comment (by vinc17@macports.org): The nselib-bin has its own configure script and config.log, which I've attached. You can see that this configure script doesn't do the right thing: {{{ configure:18398: checking lua.h usability configure:18415: /usr/bin/gcc-4.0 -c -O2 -I/opt/local/include conftest.c
&5 configure:18421: $? = 0 configure:18435: result: yes configure:18439: checking lua.h presence configure:18454: /usr/bin/cpp-4.0 -I/opt/local/include conftest.c configure:18460: $? = 0 configure:18474: result: yes configure:18502: checking for lua.h configure:18509: result: yes }}} Instead of "-I/opt/local/include", this should be "-I../liblua".
IMHO, it would be simpler to use the lua provided by MacPorts (with my patch to add CPPFLAGS, since this variable is used by the configure scripts). -- Ticket URL: <http://trac.macports.org/ticket/16194#comment:6> MacPorts <http://www.macports.org/> Ports system for Mac OS
#16194: nmap 4.68: upgrade fails (missing include path) ----------------------------------+----------------------------------------- Reporter: vinc17@macports.org | Owner: opendarwin.org@darkart.com Type: defect | Status: reopened Priority: Normal | Milestone: Port Bugs Component: ports | Version: 1.6.0 Resolution: | Keywords: nmap build ----------------------------------+----------------------------------------- Comment (by dluke@macports.org): Honestly, I wish MacPorts never decided to add ${prefix} to CPPFLAGS and LDFLAGS, since we then have to deal with autoconf finding things that we don't intend (like in this case). I'll take a closer look at this in the next couple of days and get things patched. Thanks for reporting the issue. -- Ticket URL: <http://trac.macports.org/ticket/16194#comment:7> MacPorts <http://www.macports.org/> Ports system for Mac OS
#16194: nmap 4.68: upgrade fails (missing include path) ----------------------------------+----------------------------------------- Reporter: vinc17@macports.org | Owner: opendarwin.org@darkart.com Type: defect | Status: reopened Priority: Normal | Milestone: Port Bugs Component: ports | Version: 1.6.0 Resolution: | Keywords: nmap build ----------------------------------+----------------------------------------- Comment (by vinc17@macports.org): Replying to [comment:7 dluke@macports.org]:
Honestly, I wish MacPorts never decided to add ${prefix} to CPPFLAGS and LDFLAGS, since we then have to deal with autoconf finding things that we don't intend (like in this case).
Adding ${prefix} to CPPFLAGS and LDFLAGS is not a problem. If header files from the source directory need to be used, then a -Isome_dir_relative_to_cwd must be added (whether or not ${prefix} has been added to CPPFLAGS and LDFLAGS). And it just needs to be inserted before CPPFLAGS and LDFLAGS, which almost all software does correctly. -- Ticket URL: <http://trac.macports.org/ticket/16194#comment:8> MacPorts <http://www.macports.org/> Ports system for Mac OS
#16194: nmap 4.68: upgrade fails (missing include path) ----------------------------------+----------------------------------------- Reporter: vinc17@macports.org | Owner: opendarwin.org@darkart.com Type: defect | Status: reopened Priority: Normal | Milestone: Port Bugs Component: ports | Version: 1.6.0 Resolution: | Keywords: nmap build ----------------------------------+----------------------------------------- Comment (by dluke@macports.org): If ${prefix} weren't added to CPPFLAGS/LDFLAGS then the configure script wouldn't discover the macports-installed lua and would just use the internal one ... you can see this if you remove or deactivate your macports-installed lua and run the build (which works fine). -- Ticket URL: <http://trac.macports.org/ticket/16194#comment:9> MacPorts <http://www.macports.org/> Ports system for Mac OS
#16194: nmap 4.68: upgrade fails (missing include path) ----------------------------------+----------------------------------------- Reporter: vinc17@macports.org | Owner: opendarwin.org@darkart.com Type: defect | Status: reopened Priority: Normal | Milestone: Port Bugs Component: ports | Version: 1.6.0 Resolution: | Keywords: nmap build ----------------------------------+----------------------------------------- Comment (by vinc17@macports.org): But this is the configure script which is broken. When requiring the included lua, LUAINCLUDE needs to be set unconditionally. The bug is here in nselib-bin/configure.ac: {{{ AC_CHECK_HEADER([lua.h],,[AC_MSG_NOTICE(using lua-includefiles provided with nmap);[LUAINCLUDE=-I../liblua/]],) }}} It should just have been: {{{ LUAINCLUDE=-I../liblua/ }}} Also, without "--with-liblua=included", the build fails, and again this is a bug in nmap because it forgets CPPFLAGS that was used in its configure script. -- Ticket URL: <http://trac.macports.org/ticket/16194#comment:10> MacPorts <http://www.macports.org/> Ports system for Mac OS
#16194: nmap 4.68: upgrade fails (missing include path) ----------------------------------+----------------------------------------- Reporter: vinc17@macports.org | Owner: opendarwin.org@darkart.com Type: defect | Status: closed Priority: Normal | Milestone: Port Bugs Component: ports | Version: 1.6.0 Resolution: fixed | Keywords: nmap build ----------------------------------+----------------------------------------- Changes (by dluke@macports.org): * status: reopened => closed * resolution: => fixed Comment: Setting ac_cv_header_lua_h causes the nselib-bin configure to set LUAINCLUDE to use the nmap-supplied lua. The build should work now with or without MacPorts lua installed. -- Ticket URL: <http://trac.macports.org/ticket/16194#comment:11> MacPorts <http://www.macports.org/> Ports system for Mac OS
participants (1)
-
MacPorts