| Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 1 | inherit chrpath | 
|  | 2 |  | 
| Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 3 | SYSROOT_PREPROCESS_FUNCS += "relocatable_binaries_preprocess relocatable_native_pcfiles" | 
| Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 4 |  | 
|  | 5 | python relocatable_binaries_preprocess() { | 
|  | 6 | rpath_replace(d.expand('${SYSROOT_DESTDIR}'), d) | 
|  | 7 | } | 
| Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 8 |  | 
|  | 9 | relocatable_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 | } |