blob: af04be5ccad367938c84289144451793da97c3a5 [file] [log] [blame]
lh9ed821d2023-04-07 01:36:19 -07001inherit chrpath
2
3SYSROOT_PREPROCESS_FUNCS += "relocatable_binaries_preprocess relocatable_native_pcfiles"
4
5python relocatable_binaries_preprocess() {
6 rpath_replace(d.expand('${SYSROOT_DESTDIR}'), d)
7}
8
9relocatable_native_pcfiles() {
10 for dir in ${libdir}/pkgconfig ${datadir}/pkgconfig; do
11 files_template=${SYSROOT_DESTDIR}$dir/*.pc
12 # Expand to any files matching $files_template
13 files=$(echo $files_template)
14 # $files_template and $files will differ if any files were found
15 if [ "$files_template" != "$files" ]; then
16 rel=$(realpath -m --relative-to=$dir ${base_prefix})
17 sed -i -e "s:${base_prefix}:\${pcfiledir}/$rel:g" $files
18 fi
19 done
20}