diff options
| author | Martin Jansa <martin.jansa@gmail.com> | 2023-09-03 15:32:12 +0200 |
|---|---|---|
| committer | Khem Raj <raj.khem@gmail.com> | 2023-09-03 09:04:57 -0700 |
| commit | b74b10e31620f90b92979e2f1516bfbc8d051ec2 (patch) | |
| tree | 2f333d7b792e7b28009d451ab439436e088c9251 | |
| parent | e98e9141f89628549f1b11527f94a437d2c46466 (diff) | |
| download | meta-openembedded-b74b10e31620f90b92979e2f1516bfbc8d051ec2.tar.gz | |
tcpreplay: fix pcap detection with /usr/lib32 multilib
* use BPN, BP where useful
* use prefix instead of hardcoding /usr
* add patch to search also in lib32 subdir of --with-libpcap value
to fix:
checking for libpcap... configure: error: "Unable to find matching library for header file in TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-tcpreplay/4.4.4-r0/lib32-recipe-sysroot/usr"
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
| -rw-r--r-- | meta-networking/recipes-support/tcpreplay/tcpreplay/0001-configure.ac-unify-search-dirs-for-pcap-and-add-lib3.patch | 82 | ||||
| -rw-r--r-- | meta-networking/recipes-support/tcpreplay/tcpreplay_4.4.4.bb | 9 |
2 files changed, 87 insertions, 4 deletions
diff --git a/meta-networking/recipes-support/tcpreplay/tcpreplay/0001-configure.ac-unify-search-dirs-for-pcap-and-add-lib3.patch b/meta-networking/recipes-support/tcpreplay/tcpreplay/0001-configure.ac-unify-search-dirs-for-pcap-and-add-lib3.patch new file mode 100644 index 0000000000..709d2cccbc --- /dev/null +++ b/meta-networking/recipes-support/tcpreplay/tcpreplay/0001-configure.ac-unify-search-dirs-for-pcap-and-add-lib3.patch | |||
| @@ -0,0 +1,82 @@ | |||
| 1 | From 5f8c78362b3b1e06f5adff2d4b140509c4799894 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Martin Jansa <Martin.Jansa@gmail.com> | ||
| 3 | Date: Sun, 3 Sep 2023 12:31:59 +0200 | ||
| 4 | Subject: [PATCH] configure.ac: unify search dirs for pcap and add lib32 | ||
| 5 | |||
| 6 | * add lib32 because when building lib32-tcpreplay it's | ||
| 7 | impossible to set --with-libpcap so that it would find | ||
| 8 | both include files as well as the library in lib32 directory | ||
| 9 | |||
| 10 | * maybe it would be beneficial to split --with-libpcap | ||
| 11 | into --with-libpcap-includedir --with-libpcap-libdir as this | ||
| 12 | already searches in the --with-libpcap value with and | ||
| 13 | without any "lib" prefix, but include files always expect | ||
| 14 | "include" dir there | ||
| 15 | |||
| 16 | * most of this code was added in: | ||
| 17 | https://github.com/appneta/tcpreplay/commit/202b8e82f9fd3c84ce5804577caeb36a33baabe7#diff-49473dca262eeab3b4a43002adb08b4db31020d190caaad1594b47f1d5daa810R570 | ||
| 18 | |||
| 19 | * then search for | ||
| 20 | ${host_cpu} lib/${host_cpu} (without -${host_os} suffix) | ||
| 21 | and ${build_arch}-${host_os} lib/${build_arch}-${host_os} | ||
| 22 | was added, but only for search of dynamic library in: | ||
| 23 | https://github.com/appneta/tcpreplay/commit/c3d5236563985a99f8bb02c3f1bd6950e3929047 | ||
| 24 | |||
| 25 | * ${build_arch}-${host_os} lib/${build_arch}-${host_os} | ||
| 26 | was later replaced with: | ||
| 27 | lib/${MULTIARCH} ${MULTIARCH} | ||
| 28 | and it was added to static library search as well | ||
| 29 | |||
| 30 | but for dynamic library it was searching in reversed order: | ||
| 31 | ${MULTIARCH} lib/${MULTIARCH} | ||
| 32 | https://github.com/appneta/tcpreplay/commit/ed9e3a818bde04813144014561e62f018c9eb85f | ||
| 33 | |||
| 34 | I don't think this reversed order was intentional, just unify all 4 cases | ||
| 35 | to use the same directories in the same order | ||
| 36 | |||
| 37 | Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> | ||
| 38 | Upstream-Status: Submitted [https://github.com/appneta/tcpreplay/pull/819] | ||
| 39 | --- | ||
| 40 | configure.ac | 8 ++++---- | ||
| 41 | 1 file changed, 4 insertions(+), 4 deletions(-) | ||
| 42 | |||
| 43 | diff --git a/configure.ac b/configure.ac | ||
| 44 | index 387219de..26ba31a5 100644 | ||
| 45 | --- a/configure.ac | ||
| 46 | +++ b/configure.ac | ||
| 47 | @@ -671,7 +671,7 @@ AC_ARG_WITH(libpcap, | ||
| 48 | LPCAPINCDIR=${testdir} | ||
| 49 | if test $dynamic_link = yes; then | ||
| 50 | for ext in .dylib .so .tbd ; do | ||
| 51 | - for dir in . lib lib64 lib/${host_cpu}-${host_os} ${host_cpu}-${host_os} lib/${MULTIARCH} ${MULTIARCH}; do | ||
| 52 | + for dir in . lib lib64 lib32 lib/${host_cpu}-${host_os} ${host_cpu}-${host_os} lib/${MULTIARCH} ${MULTIARCH}; do | ||
| 53 | sharefile=$(ls ${testdir}/$dir/libpcap${ext}* 2> /dev/null | sort | head -n1) | ||
| 54 | if test -n "${sharefile}"; then | ||
| 55 | LPCAP_LD_LIBRARY_PATH="$(dirname ${sharefile})" | ||
| 56 | @@ -690,7 +690,7 @@ AC_ARG_WITH(libpcap, | ||
| 57 | dnl If dynamic library not found, try static | ||
| 58 | dnl | ||
| 59 | for ext in ${libext} .a .A.tbd ; do | ||
| 60 | - for dir in . lib lib64 lib/${host_cpu}-${host_os} ${host_cpu}-${host_os} lib/${MULTIARCH} ${MULTIARCH}; do | ||
| 61 | + for dir in . lib lib64 lib32 lib/${host_cpu}-${host_os} ${host_cpu}-${host_os} lib/${MULTIARCH} ${MULTIARCH}; do | ||
| 62 | staticfile=$(ls ${testdir}/$dir/libpcap${ext} 2> /dev/null | sort | head -n1) | ||
| 63 | if test -n "${staticfile}"; then | ||
| 64 | LPCAPLIB="${staticfile}" | ||
| 65 | @@ -771,7 +771,7 @@ AC_ARG_WITH(libpcap, | ||
| 66 | LPCAPINCDIR="${testdir}/include" | ||
| 67 | if test $dynamic_link = yes; then | ||
| 68 | for ext in .dylib .so .tbd; do | ||
| 69 | - for dir in . lib lib64 ${host_cpu} lib/${host_cpu} ${host_cpu}-${host_os} lib/${host_cpu}-${host_os} ${MULTIARCH} lib/${MULTIARCH}; do | ||
| 70 | + for dir in . lib lib64 lib32 lib/${host_cpu}-${host_os} ${host_cpu}-${host_os} lib/${MULTIARCH} ${MULTIARCH}; do | ||
| 71 | sharefile=$(ls "${testdir}/$dir/libpcap${ext}" 2> /dev/null | sort | head -n1) | ||
| 72 | if test -n "${sharefile}"; then | ||
| 73 | LPCAPLIB="-L$(dirname ${sharefile}) -lpcap" | ||
| 74 | @@ -790,7 +790,7 @@ AC_ARG_WITH(libpcap, | ||
| 75 | dnl If dynamic library not found, try static | ||
| 76 | dnl | ||
| 77 | for ext in ${libext} .a .A.tbd ; do | ||
| 78 | - for dir in . lib lib64 lib/${host_cpu}-${host_os} ${host_cpu}-${host_os} lib/${MULTIARCH} ${MULTIARCH}; do | ||
| 79 | + for dir in . lib lib64 lib32 lib/${host_cpu}-${host_os} ${host_cpu}-${host_os} lib/${MULTIARCH} ${MULTIARCH}; do | ||
| 80 | staticfile=$(ls "${testdir}/$dir/libpcap${ext}" 2> /dev/null | sort | head -n1) | ||
| 81 | if test -n "${staticfile}"; then | ||
| 82 | LPCAPLIB="${staticfile}" | ||
diff --git a/meta-networking/recipes-support/tcpreplay/tcpreplay_4.4.4.bb b/meta-networking/recipes-support/tcpreplay/tcpreplay_4.4.4.bb index c7d14e2ab6..53f17c9619 100644 --- a/meta-networking/recipes-support/tcpreplay/tcpreplay_4.4.4.bb +++ b/meta-networking/recipes-support/tcpreplay/tcpreplay_4.4.4.bb | |||
| @@ -7,9 +7,10 @@ SECTION = "net" | |||
| 7 | LICENSE = "GPL-3.0-only" | 7 | LICENSE = "GPL-3.0-only" |
| 8 | LIC_FILES_CHKSUM = "file://docs/LICENSE;md5=10f0474a2f0e5dccfca20f69d6598ad8" | 8 | LIC_FILES_CHKSUM = "file://docs/LICENSE;md5=10f0474a2f0e5dccfca20f69d6598ad8" |
| 9 | 9 | ||
| 10 | SRC_URI = "https://github.com/appneta/tcpreplay/releases/download/v${PV}/tcpreplay-${PV}.tar.gz \ | 10 | SRC_URI = "https://github.com/appneta/${BPN}/releases/download/v${PV}/${BP}.tar.gz \ |
| 11 | file://0001-libopts.m4-set-POSIX_SHELL-to-bin-sh.patch \ | 11 | file://0001-libopts.m4-set-POSIX_SHELL-to-bin-sh.patch \ |
| 12 | " | 12 | file://0001-configure.ac-unify-search-dirs-for-pcap-and-add-lib3.patch \ |
| 13 | " | ||
| 13 | 14 | ||
| 14 | SRC_URI[sha256sum] = "44f18fb6d3470ecaf77a51b901a119dae16da5be4d4140ffbb2785e37ad6d4bf" | 15 | SRC_URI[sha256sum] = "44f18fb6d3470ecaf77a51b901a119dae16da5be4d4140ffbb2785e37ad6d4bf" |
| 15 | 16 | ||
| @@ -17,7 +18,7 @@ UPSTREAM_CHECK_URI = "https://github.com/appneta/tcpreplay/releases" | |||
| 17 | 18 | ||
| 18 | DEPENDS = "libpcap" | 19 | DEPENDS = "libpcap" |
| 19 | 20 | ||
| 20 | EXTRA_OECONF += "--with-libpcap=${STAGING_DIR_HOST}/usr" | 21 | EXTRA_OECONF += "--with-libpcap=${STAGING_DIR_HOST}${prefix}" |
| 21 | 22 | ||
| 22 | inherit siteinfo autotools-brokensep | 23 | inherit siteinfo autotools-brokensep |
| 23 | 24 | ||
