|
Line 0
Link Here
|
|
|
1 |
# use sysroot of toolchain to get include and library at compile time work |
| 2 |
# Benda Xu <heroxbd@gentoo.org> (17 Jun, 2013) |
| 3 |
|
| 4 |
if [[ ${CATEGORY} == sys-devel ]] && [[ ${PN} == gcc || ${PN} == binutils || ${PN} == libtool ]] \ |
| 5 |
&& [[ ${EBUILD_PHASE} == unpack ]]; then |
| 6 |
elog "append --with-sysroot=${EPREFIX} to configure for Prefix libc" |
| 7 |
EXTRA_ECONF+="--with-sysroot=${EPREFIX}" |
| 8 |
fi |
| 9 |
|
| 10 |
# from bintuils info page: In case a sysroot prefix is configured, and |
| 11 |
# the filename starts with the `/' character, and the script being |
| 12 |
# processed was located inside the sysroot prefix, the filename will |
| 13 |
# be looked for in the sysroot prefix. Otherwise, the linker will try |
| 14 |
# to open the file in the current directory. glibc will append libdir |
| 15 |
# and slibdir, which is prepended with $EPREFIX, to libc.so and |
| 16 |
# libpthread.so linker scripts. That will cause double prefix if ld is |
| 17 |
# configured with sysroot support. |
| 18 |
# This is a dirty hack here, suggestion for alternatives welcome. |
| 19 |
# Benda Xu <heroxbd@gentoo.org> (17 Jun, 2013) |
| 20 |
|
| 21 |
if [[ ${CATEGORY}/${PN} == sys-libs/glibc ]]; then |
| 22 |
eblit-src_install-post() { |
| 23 |
elog "fixing ldscripts to prevent double prefix with sysroot-enabled ld" |
| 24 |
for lds in "$ED"usr/lib/lib{c,pthread}.so; do |
| 25 |
sed -i "s,$EPREFIX,,g" "$lds" |
| 26 |
done |
| 27 |
} |
| 28 |
fi |
| 29 |
|