* [Buildroot] [PATCH 1/1] package/wireshark: fix static build with pcap
@ 2019-04-17 22:36 Fabrice Fontaine
2019-04-18 9:26 ` Thomas Petazzoni
0 siblings, 1 reply; 2+ messages in thread
From: Fabrice Fontaine @ 2019-04-17 22:36 UTC (permalink / raw)
To: buildroot
Use pkg-config to find pcap dependencies
Fixes:
- http://autobuild.buildroot.org/results/277a24ad543a8f54cc8afde4f359f5d77b42eb7f
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
---
...0003-FindPCAP.cmake-fix-static-build.patch | 46 +++++++++++++++++++
1 file changed, 46 insertions(+)
create mode 100644 package/wireshark/0003-FindPCAP.cmake-fix-static-build.patch
diff --git a/package/wireshark/0003-FindPCAP.cmake-fix-static-build.patch b/package/wireshark/0003-FindPCAP.cmake-fix-static-build.patch
new file mode 100644
index 0000000000..425fa35ffc
--- /dev/null
+++ b/package/wireshark/0003-FindPCAP.cmake-fix-static-build.patch
@@ -0,0 +1,46 @@
+From 1ffe04d0f2ef3c7737f1f9667cfcdd6c4239bbbe Mon Sep 17 00:00:00 2001
+From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+Date: Wed, 17 Apr 2019 23:58:55 +0200
+Subject: [PATCH] FindPCAP.cmake: fix static build
+
+When statically built, pcap can depends on other libraries such as
+-lnl-3. Add a call to pkg-config to find them and don't overwrite
+PCAP_LIBRARIES with PCAP_LIBRARY (use APPEND instead)
+
+Fixes:
+ - http://autobuild.buildroot.org/results/277a24ad543a8f54cc8afde4f359f5d77b42eb7f
+
+Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+[Upstream status: not sent yet (waiting feedback on first patch)]
+---
+ cmake/modules/FindPCAP.cmake | 7 ++++++-
+ 1 file changed, 6 insertions(+), 1 deletion(-)
+
+diff --git a/cmake/modules/FindPCAP.cmake b/cmake/modules/FindPCAP.cmake
+index dfd80415f6..826ccfbdcc 100644
+--- a/cmake/modules/FindPCAP.cmake
++++ b/cmake/modules/FindPCAP.cmake
+@@ -9,6 +9,11 @@
+ include( FindWSWinLibs )
+ FindWSWinLibs( "WpdPack" "PCAP_HINTS" )
+
++if (NOT WIN32)
++ find_package(PkgConfig)
++ pkg_search_module( PCAP libpcap )
++endif()
++
+ # The 64-bit wpcap.lib is under /x64
+ set ( _PLATFORM_SUBDIR "" )
+ if( WIN32 AND "${WIRESHARK_TARGET_PLATFORM}" STREQUAL "win64" )
+@@ -37,7 +42,7 @@ find_package_handle_standard_args( PCAP DEFAULT_MSG PCAP_LIBRARY PCAP_INCLUDE_DI
+
+ if( PCAP_FOUND )
+ set( PCAP_INCLUDE_DIRS ${PCAP_INCLUDE_DIR} )
+- set( PCAP_LIBRARIES ${PCAP_LIBRARY} )
++ list( APPEND PCAP_LIBRARIES ${PCAP_LIBRARY} )
+ else()
+ set( PCAP_INCLUDE_DIRS )
+ set( PCAP_LIBRARIES )
+--
+2.20.1
+
--
2.20.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [Buildroot] [PATCH 1/1] package/wireshark: fix static build with pcap
2019-04-17 22:36 [Buildroot] [PATCH 1/1] package/wireshark: fix static build with pcap Fabrice Fontaine
@ 2019-04-18 9:26 ` Thomas Petazzoni
0 siblings, 0 replies; 2+ messages in thread
From: Thomas Petazzoni @ 2019-04-18 9:26 UTC (permalink / raw)
To: buildroot
On Thu, 18 Apr 2019 00:36:34 +0200
Fabrice Fontaine <fontaine.fabrice@gmail.com> wrote:
> Use pkg-config to find pcap dependencies
>
> Fixes:
> - http://autobuild.buildroot.org/results/277a24ad543a8f54cc8afde4f359f5d77b42eb7f
>
> Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
> ---
> ...0003-FindPCAP.cmake-fix-static-build.patch | 46 +++++++++++++++++++
> 1 file changed, 46 insertions(+)
> create mode 100644 package/wireshark/0003-FindPCAP.cmake-fix-static-build.patch
Applied to master, thanks.
Thomas
--
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-04-18 9:26 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-17 22:36 [Buildroot] [PATCH 1/1] package/wireshark: fix static build with pcap Fabrice Fontaine
2019-04-18 9:26 ` Thomas Petazzoni
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.