blob: af04be5ccad367938c84289144451793da97c3a5 [file] [log] [blame]
Patrick Williamsc124f4f2015-09-15 14:41:29 -05001inherit chrpath
2
Brad Bishop6e60e8b2018-02-01 10:27:11 -05003SYSROOT_PREPROCESS_FUNCS += "relocatable_binaries_preprocess relocatable_native_pcfiles"
Patrick Williamsc124f4f2015-09-15 14:41:29 -05004
5python relocatable_binaries_preprocess() {
6 rpath_replace(d.expand('${SYSROOT_DESTDIR}'), d)
7}
Brad Bishop6e60e8b2018-02-01 10:27:11 -05008
Andrew Geisslerd25ed322020-06-27 00:28:28 -05009relocatable_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
Brad Bishop6e60e8b2018-02-01 10:27:11 -050020}