blob: 582812c1cfd26ad2d41a1b5bb95a96b250907445 [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
9relocatable_native_pcfiles () {
10 if [ -d ${SYSROOT_DESTDIR}${libdir}/pkgconfig ]; then
11 rel=${@os.path.relpath(d.getVar('base_prefix'), d.getVar('libdir') + "/pkgconfig")}
12 sed -i -e "s:${base_prefix}:\${pcfiledir}/$rel:g" ${SYSROOT_DESTDIR}${libdir}/pkgconfig/*.pc
13 fi
14 if [ -d ${SYSROOT_DESTDIR}${datadir}/pkgconfig ]; then
15 rel=${@os.path.relpath(d.getVar('base_prefix'), d.getVar('datadir') + "/pkgconfig")}
16 sed -i -e "s:${base_prefix}:\${pcfiledir}/$rel:g" ${SYSROOT_DESTDIR}${datadir}/pkgconfig/*.pc
17 fi
18}