Skip to contentSkip to conversation

kismet: fix static builds (branch yem/fixes)

PATCH New Yann E. MORIN 2 participants 5 messages Dec 26, 2014 – Dec 27, 2014

lore
Share & tools
lore
#0 lore raw

v2 cover kismet: fix static builds (branch yem/fixes)

Hello All!

This series contains fixes to kismet when doing a static-only build:

- first patch is the same as what Vicente proposed, but done in

    configure.in instead of configure, and thus needs an autoreconf;
    it fixes static linking against ncurses libs;

- second patch removes unsafe host paths from the include search dirs;

- third patch is what Vicente provided, but with the ncurses bits removed since it is now handled differently in its own patch.

Changes v1 -> v2:
- split unsafe host paths removal to is own patch (Thomas)

Regards,
Yann E. MORIN.

The following changes since commit 21d6e4ea459b0b3a436c7936a94a917f085919e6:

util-linux: Add an option to compile 'nsenter' binary. (2014-12-26 20:09:34 +0100)

are available in the git repository at:

git://git.busybox.net/~ymorin/git/buildroot yem/fixes

for you to fetch changes up to 0595c07a5d923887ee61e9a3a5084da616b92329:

kismet: Fix static build (2014-12-26 22:06:03 +0100)

----------------------------------------------------------------
Vicente Olivert Riera (1):
kismet: Fix static build

Yann E. MORIN (2):
package/kismet: fix ncurses static build
package/kismet: do not use host headers

 package/kismet/0003-fix-curses-libs-ordering.patch | 42 ++++++++++++++++++++++
 package/kismet/0004-no-include-host-paths.patch    | 23 ++++++++++++
 package/kismet/kismet.mk                           |  7 ++++
 3 files changed, 72 insertions(+)
 create mode 100644 package/kismet/0003-fix-curses-libs-ordering.patch
 create mode 100644 package/kismet/0004-no-include-host-paths.patch
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#1 lore raw

PATCH v2 1/3 package/kismet: fix ncurses static build

Says Vicente:
[T]he order is very important when doing static builds. Otherwise we will see errors like this one:

[...]/sysroot/usr/lib/libpanel.a(p_delete.o):
In function `del_panel':
p_delete.c:(.text+0x68): undefined reference to `_nc_panelhook'

Fix the order configure adds libraries: new libraries should be added at the *front* of the list, not at the end.

---
Changes v1 -> v2:
- split /usr/include/ncurses removal to its own patch

---
 package/kismet/0003-fix-curses-libs-ordering.patch | 42 ++++++++++++++++++++++
 package/kismet/kismet.mk                           |  3 ++
 2 files changed, 45 insertions(+)
 create mode 100644 package/kismet/0003-fix-curses-libs-ordering.patch
package/kismet/0003-fix-curses-libs-ordering.patch new file +42 -0
new file mode 100644
index 0000000..b579c96
@@ -0,0 +1,42 @@
+configure: fix ordering of ncurses libraries
+
+Says Vicente:
+    [T]he order is very important when doing static builds.
+    Otherwise we will see errors like this one:
+
+    [...]/sysroot/usr/lib/libpanel.a(p_delete.o):
+    In function `del_panel':
+    p_delete.c:(.text+0x68): undefined reference to `_nc_panelhook'
+
+Fix the order configure adds libraries: new libraries should be added
+at the *front* of the list, not at the end.
+
+Reported-by: Vicente Olivert Riera <[email protected]>
+Signed-off-by: "Yann E. MORIN" <[email protected]>
+Cc: Vicente Olivert Riera <[email protected]>
+
+diff -durN kismet-Kismet-2014-02-R1.orig/configure.in kismet-Kismet-2014-02-R1/configure.in
+--- kismet-Kismet-2014-02-R1.orig/configure.in	2014-02-19 05:37:43.000000000 +0100
++++ kismet-Kismet-2014-02-R1/configure.in	2014-12-26 16:46:55.770692349 +0100
+@@ -437,10 +434,10 @@
+ 		AC_MSG_ERROR(Failed to find curses.h or ncurses.h.  You probably need to install the curses-devel package from your distribution)
+ 	fi
+ 
+-	LIBS="$LIBS $curseaux"
++	LIBS="$curseaux $LIBS"
+ 	AC_CHECK_LIB([panel], [new_panel],
+ 				 AC_DEFINE(HAVE_LIBPANEL, 1, Panel terminal lib) 
+-				 curseaux="$curseaux -lpanel",
++				 curseaux="-lpanel $curseaux",
+ 				 AC_MSG_ERROR(Failed to find libpanel extension to curses/ncurses.  Install it, or disable building the Kismet client with --disable-client.  Disabling the client is probably not something you want to do normally.))
+ 
+ 	AC_CHECK_HEADER([panel.h], [foundhpanel=yes])
+@@ -450,7 +447,7 @@
+ 
+ 	LIBS="$OLIBS"
+ 
+-	CLIENTCLIBS="$CLIENTCLIBS $curseaux"
++	CLIENTCLIBS="$curseaux $CLIENTCLIBS"
+ fi
+ 
+ AC_SUBST(CLIBS)
package/kismet/kismet.mk +3 -0
index f177fea..a71414e 100644
@@ -12,6 +12,9 @@ KISMET_CONF_OPTS += --with-netlink-version=3
 KISMET_LICENSE = GPLv2+
 KISMET_LICENSE_FILES = debian/copyright
 
+# We touch configure.in:
+KISMET_AUTORECONF = YES
+
 ifeq ($(BR2_PACKAGE_PCRE),y)
 	KISMET_DEPENDENCIES += pcre
 endif
Signature · 1 line
1.9.1
#2 lore raw

PATCH v2 2/3 package/kismet: do not use host headers

In reply to Yann E. MORIN

kismet's ./configure hard-codes host paths in its include search paths. Fix that by removing the offending paths.

Cc Vicente Olivert Riera <[email protected]>
Cc Thomas Petazzoni <[email protected]>
---
 package/kismet/0004-no-include-host-paths.patch | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)
 create mode 100644 package/kismet/0004-no-include-host-paths.patch
package/kismet/0004-no-include-host-paths.patch new file +23 -0
new file mode 100644
index 0000000..1dcf120
@@ -0,0 +1,23 @@
+configure: do not hard-code host paths
+
+configure hard-codes include dirs to contain /usr/include/ncurses.
+Needless to say this does not work well for cross-compilation.
+
+Remove that directory from the include search dirs.
+
+Signed-off-by: "Yann E. MORIN" <[email protected]>
+Cc: Vicente Olivert Riera <[email protected]>
+
+diff -durN kismet-Kismet-2014-02-R1.orig/configure.in kismet-Kismet-2014-02-R1/configure.in
+--- kismet-Kismet-2014-02-R1.orig/configure.in	2014-02-19 05:37:43.000000000 +0100
++++ kismet-Kismet-2014-02-R1/configure.in	2014-12-26 16:46:55.770692349 +0100
+@@ -406,9 +406,6 @@
+ )
+ AC_SUBST(wantclient)
+ 
+-# Add additional cflags since some distros bury panel.h
+-CPPFLAGS="$CPPFLAGS -I/usr/include/ncurses"
+-
+ termcontrol="none";
+ 
+ if test "$wantclient" = "yes"; then
Signature · 1 line
1.9.1
#3 lore raw

PATCH v2 3/3 kismet: Fix static build

In reply to Yann E. MORIN

From: Vicente Olivert Riera <[email protected]>

Use pcap-config to list optional libpcap dependencies needed for static link. Otherwise we will see errors like this one:

/br/output/host/usr/mipsel-buildroot-linux-uclibc/sysroot/usr/lib/libpcap.a(pcap-canusb-linux.o):
In function `canusb_close':
pcap-canusb-linux.c:(.text+0xec): undefined reference to `libusb_close'

[yann.morin.1998 at free.fr: remove the ncurses bits (done differently in
another patch), fix BR2_PREFER_STATIC_LIB -> BR2_STATIC_LIBS]

---
 package/kismet/kismet.mk | 4 ++++
 1 file changed, 4 insertions(+)
package/kismet/kismet.mk +4 -0
index a71414e..117d182 100644
@@ -15,6 +15,10 @@ KISMET_LICENSE_FILES = debian/copyright
 # We touch configure.in:
 KISMET_AUTORECONF = YES
 
+ifeq ($(BR2_STATIC_LIBS),y)
+KISMET_CONF_ENV = LIBS="-lpcap $(shell $(STAGING_DIR)/usr/bin/pcap-config --static --additional-libs)"
+endif
+
 ifeq ($(BR2_PACKAGE_PCRE),y)
 	KISMET_DEPENDENCIES += pcre
 endif
Signature · 1 line
1.9.1
#4 lore raw

v2 cover kismet: fix static builds (branch yem/fixes)

In reply to Yann E. MORIN

Dear Yann E. MORIN,

Quoted 6 lines · Yann E. MORIN

Vicente Olivert Riera (1):
kismet: Fix static build

Yann E. MORIN (2):
package/kismet: fix ncurses static build
package/kismet: do not use host headers

Applied, thanks.

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com