diff mbox series

curl: Remove absolute paths when mbedtls is enabled

Message ID 20260513160218.11997-1-mark.jonas@de.bosch.com
State New
Headers show
Series curl: Remove absolute paths when mbedtls is enabled | expand

Commit Message

Jonas Mark (BT-EL/ESW1) May 13, 2026, 4:02 p.m. UTC
From: Ricardo Simoes <ricardo.simoes@pt.bosch.com>

When enabling mbedtls PACKAGECONFIG option, the curl-config and
libcurl.pc are generated with paths to STAGE_DIR_TARGET, causing the
QA check buildpaths to fail. This is due to the fact that the mbedtls
option uses the path to STAGING_DIR_TARGET to find the mbedtls library.

When installed, the curl-config and libcurl.pc will still need the
the flag '--with-mbedtls', but not with the path. Same is true for the
library path flag. Thus drop the absolute paths from both files when
mbedtls is enabled, and add the flag '--with-mbedtls' to the curl-config
and libcurl.pc.

Signed-off-by: Ricardo Simoes <ricardo.simoes@pt.bosch.com>
Signed-off-by: Mark Jonas <mark.jonas@de.bosch.com>
---
 meta/recipes-support/curl/curl_8.19.0.bb | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/meta/recipes-support/curl/curl_8.19.0.bb b/meta/recipes-support/curl/curl_8.19.0.bb
index b9251336b8..cc37cc934b 100644
--- a/meta/recipes-support/curl/curl_8.19.0.bb
+++ b/meta/recipes-support/curl/curl_8.19.0.bb
@@ -93,13 +93,15 @@  EXTRA_OECONF = " \
 "
 
 fix_absolute_paths () {
-	# cleanup buildpaths from curl-config
+	# cleanup buildpaths from curl-config and libcurl.pc
 	sed -i \
 	    -e 's,--sysroot=${STAGING_DIR_TARGET},,g' \
 	    -e 's,--with-libtool-sysroot=${STAGING_DIR_TARGET},,g' \
+	    -e 's,--with-mbedtls=${STAGING_DIR_TARGET},--with-mbedtls,g' \
+	    -e 's,-L${STAGING_DIR_TARGET},,g' \
 	    -e 's|${DEBUG_PREFIX_MAP}||g' \
 	    -e 's|${@" ".join(d.getVar("DEBUG_PREFIX_MAP").split())}||g' \
-	    ${D}${bindir}/curl-config
+	    ${D}${bindir}/curl-config ${D}${libdir}/pkgconfig/libcurl.pc
 }
 
 do_install:append:class-target() {