summaryrefslogtreecommitdiffstats
path: root/meta/classes/relocatable.bbclass
diff options
context:
space:
mode:
Diffstat (limited to 'meta/classes/relocatable.bbclass')
-rw-r--r--meta/classes/relocatable.bbclass15
1 files changed, 14 insertions, 1 deletions
diff --git a/meta/classes/relocatable.bbclass b/meta/classes/relocatable.bbclass
index 4ca9981f44..af04be5cca 100644
--- a/meta/classes/relocatable.bbclass
+++ b/meta/classes/relocatable.bbclass
@@ -1,7 +1,20 @@
inherit chrpath
-SYSROOT_PREPROCESS_FUNCS += "relocatable_binaries_preprocess"
+SYSROOT_PREPROCESS_FUNCS += "relocatable_binaries_preprocess relocatable_native_pcfiles"
python relocatable_binaries_preprocess() {
rpath_replace(d.expand('${SYSROOT_DESTDIR}'), d)
}
+
+relocatable_native_pcfiles() {
+ for dir in ${libdir}/pkgconfig ${datadir}/pkgconfig; do
+ files_template=${SYSROOT_DESTDIR}$dir/*.pc
+ # Expand to any files matching $files_template
+ files=$(echo $files_template)
+ # $files_template and $files will differ if any files were found
+ if [ "$files_template" != "$files" ]; then
+ rel=$(realpath -m --relative-to=$dir ${base_prefix})
+ sed -i -e "s:${base_prefix}:\${pcfiledir}/$rel:g" $files
+ fi
+ done
+}