]> rtime.felk.cvut.cz Git - coffee/buildroot.git/commit
package/openpowerlink: use pcap-config to fix static linking with libpcap
authorRomain Naour <romain.naour@gmail.com>
Sat, 27 May 2017 22:51:19 +0000 (00:51 +0200)
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Sun, 28 May 2017 13:24:25 +0000 (15:24 +0200)
commit0e422730722fe92e79883b5fdb9f2e95a241afd7
tree88010f6563ad577418855bf29c4078522fe594dc
parenta7777eecd4eaebd65b28e26fb1075b8609ac8f7c
package/openpowerlink: use pcap-config to fix static linking with libpcap

When linking demo_mn_console statically with pcap, the CMake build
system forget to link with other libraries linked with libpcap
(-lnl-genl-3 -lnl-3 -ldbus-1 -pthread).

[100%] Linking C executable demo_mn_console
lib64/libpcap.a(pcap-linux.o): In function nl80211_init': pcap-linux.c:(.text+0x41e): undefined reference tonl_socket_alloc'

To fix this, the build system could use pcap-config:
pcap-config --libs --static
-L/path/to/sysroot/usr/lib -lpcap -L/path/to/sysroot/usr/lib/.libs
-lnl-genl-3 -lnl-3 -L/path/to/sysroot/usr/lib -ldbus-1 -pthread

Also don't use getopt() from contrib directory to avoid a clash with
libc definition.

Fixes:
http://autobuild.buildroot.net/results/f43/f437d09ac6c689c911e1885b95da33b692f2cb3c
http://autobuild.buildroot.net/results/385/3859dc0f4de7e3284a96d5841f040f69f71842df
https://github.com/OpenAutomationTechnologies/openPOWERLINK_V2/issues/187

Signed-off-by: Romain Naour <romain.naour@gmail.com>
Tested-by: Bernd Kuhls <bernd.kuhls@t-online.de>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
package/openpowerlink/0004-FIX-use-contrib-getopt-only-on-Windows.patch [new file with mode: 0644]
package/openpowerlink/0005-FIX-use-pcap-config-to-fix-static-linking-with-libpc.patch [new file with mode: 0644]
package/openpowerlink/openpowerlink.mk