Skip to contentSkip to conversation

package/nmap: Fix static linking

PATCH New Bernd Kuhls 2 participants 2 messages May 31, 2015

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 package/nmap: Fix static linking

Fixes
http://autobuild.buildroot.net/results/040/040129539257d88d9437d113752bc8634fd9b2b2/
http://autobuild.buildroot.net/results/73a/73a562a3a1f356c1a39b2fb57f0848c4b99fe8b1/
http://autobuild.buildroot.net/results/767/767b8eafe7a204327eaa182c065ca5cfff18096f/
http://autobuild.buildroot.net/results/0f7/0f7f3a56815dc6422a466fe9b4357ace98f78e11/

---
v2: reworked to use pcap-config, add openssl libs (libz was missing) (Baruch)

 package/nmap/nmap.mk |    8 ++++++++
 1 file changed, 8 insertions(+)
package/nmap/nmap.mk +8 -0
index c8c16e6..5273c4f 100644
@@ -14,6 +14,13 @@ NMAP_CONF_OPTS = --without-liblua --without-zenmap \
 NMAP_LICENSE = GPLv2
 NMAP_LICENSE_FILES = COPYING
 
+# needed by libpcap
+NMAP_LIBS_FOR_STATIC_LINK += $(shell $(STAGING_DIR)/usr/bin/pcap-config --static --additional-libs)
+
+ifeq ($(BR2_STATIC_LIBS),y)
+NMAP_CONF_ENV += LIBS='$(NMAP_LIBS_FOR_STATIC_LINK)'
+endif
+
 # for 0001-libdnet-wrapper-configure.patch
 define NMAP_WRAPPER_EXEC
 	chmod +x $(@D)/libdnet-stripped/configure.gnu
@@ -23,6 +30,7 @@ NMAP_POST_PATCH_HOOKS += NMAP_WRAPPER_EXEC
 ifeq ($(BR2_PACKAGE_OPENSSL),y)
 NMAP_CONF_OPTS += --with-openssl="$(STAGING_DIR)/usr"
 NMAP_DEPENDENCIES += openssl
+NMAP_LIBS_FOR_STATIC_LINK += $(shell $(PKG_CONFIG_HOST_BINARY) --libs --static openssl)
 else
 NMAP_CONF_OPTS += --without-openssl
 endif
Signature · 1 line
1.7.10.4
#1 lore raw

PATCH v2 1/1 package/nmap: Fix static linking

Quoted 34 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Bernd" == Bernd Kuhls <[email protected]> writes:

Fixes
http://autobuild.buildroot.net/results/040/040129539257d88d9437d113752bc8634fd9b2b2/
http://autobuild.buildroot.net/results/73a/73a562a3a1f356c1a39b2fb57f0848c4b99fe8b1/
http://autobuild.buildroot.net/results/767/767b8eafe7a204327eaa182c065ca5cfff18096f/
http://autobuild.buildroot.net/results/0f7/0f7f3a56815dc6422a466fe9b4357ace98f78e11/

---
v2: reworked to use pcap-config, add openssl libs (libz was missing) (Baruch)

 package/nmap/nmap.mk |    8 ++++++++
 1 file changed, 8 insertions(+)
package/nmap/nmap.mk +7 -0
index c8c16e6..5273c4f 100644
@@ -14,6 +14,13 @@ NMAP_CONF_OPTS = --without-liblua --without-zenmap \
 NMAP_LICENSE = GPLv2
 NMAP_LICENSE_FILES = COPYING
 
+# needed by libpcap
+NMAP_LIBS_FOR_STATIC_LINK += $(shell $(STAGING_DIR)/usr/bin/pcap-config --static --additional-libs)
+
+ifeq ($(BR2_STATIC_LIBS),y)
+NMAP_CONF_ENV += LIBS='$(NMAP_LIBS_FOR_STATIC_LINK)'
+endif
+
 # for 0001-libdnet-wrapper-configure.patch
 define NMAP_WRAPPER_EXEC
 	chmod +x $(@D)/libdnet-stripped/configure.gnu

package/nmap/nmap.mk NMAP_POST_PATCH_HOOKS += NMAP_WRAPPER_EXEC · line 33

Quoted 4 lines
package/nmap/nmap.mk +1 -0
@@ -23,6 +30,7 @@ NMAP_POST_PATCH_HOOKS += NMAP_WRAPPER_EXEC
 ifeq ($(BR2_PACKAGE_OPENSSL),y)
 NMAP_CONF_OPTS += --with-openssl="$(STAGING_DIR)/usr"
 NMAP_DEPENDENCIES += openssl
+NMAP_LIBS_FOR_STATIC_LINK += $(shell $(PKG_CONFIG_HOST_BINARY) --libs --static openssl)

You forgot to add host-pkgconf to the _DEPENDENCIES. Committed with that fixed, thanks.

Signature · 1 line
Bye, Peter Korsgaard