|
Lines 80-100
Link Here
|
| 80 |
if use prefix ; then |
80 |
if use prefix ; then |
| 81 |
local ldir |
81 |
local ldir |
| 82 |
local paths="" |
82 |
local paths="" |
| 83 |
echo "int main() {}" > "${T}"/t.c |
83 |
local scantool="" |
| 84 |
# need to ensure dirs contain compatible libs, |
84 |
case ${CHOST} in |
| 85 |
# bugs #358875, #400839, use scanelf for #425538 |
85 |
*-aix*) paths="/lib /usr/lib" ;; |
| 86 |
$(tc-getCC) -o "${T}"/t "${T}"/t.c > /dev/null || die |
86 |
*-darwin*) scantool=scanmacho ;; |
| 87 |
local scantool=scanelf |
87 |
*) scantool=scanelf ;; |
| 88 |
[[ ${CHOST} == *-darwin* ]] && scantool=scanmacho |
88 |
esac |
| 89 |
local mtype=$(${scantool} -BF "%M%D#f" "${T}"/t) |
89 |
if [[ -n ${scantool} ]]; then |
| 90 |
einfo "searching libdirs for ${mtype}" |
90 |
echo "int main() {}" > "${T}"/t.c |
| 91 |
for ldir in /lib/*-linux-gnu /usr/lib/*-linux-gnu /lib64 /lib/64 /usr/lib64 /usr/lib/64 /lib32 /usr/lib32 /lib /usr/lib ; do |
91 |
# need to ensure dirs contain compatible libs, |
| 92 |
[[ -e ${ldir} ]] || continue |
92 |
# bugs #358875, #400839, use scanelf for #425538 |
| 93 |
if ${scantool} -BF "%M%D#f" ${ldir}/ | grep -q ${mtype} ; then |
93 |
$(tc-getCC) -o "${T}"/t "${T}"/t.c > /dev/null || die |
| 94 |
paths="${paths} ${ldir}" |
94 |
local mtype=$(${scantool} -BF "%M%D#f" "${T}"/t) |
| 95 |
einfo "found ${ldir}" |
95 |
einfo "searching libdirs for ${mtype}" |
| 96 |
fi |
96 |
for ldir in /lib/*-linux-gnu /usr/lib/*-linux-gnu /lib64 /lib/64 /usr/lib64 /usr/lib/64 /lib32 /usr/lib32 /lib /usr/lib ; do |
| 97 |
done |
97 |
[[ -e ${ldir} ]] || continue |
|
|
98 |
if ${scantool} -BF "%M%D#f" ${ldir}/ | grep -q ${mtype} ; then |
| 99 |
paths="${paths} ${ldir}" |
| 100 |
einfo "found ${ldir}" |
| 101 |
fi |
| 102 |
done |
| 103 |
fi |
| 98 |
myconf "-Dlibpth=${EPREFIX}/$(get_libdir) ${EPREFIX}/usr/$(get_libdir) ${paths}" |
104 |
myconf "-Dlibpth=${EPREFIX}/$(get_libdir) ${EPREFIX}/usr/$(get_libdir) ${paths}" |
| 99 |
elif [[ $(get_libdir) != "lib" ]] ; then |
105 |
elif [[ $(get_libdir) != "lib" ]] ; then |
| 100 |
# We need to use " and not ', as the written config.sh use ' ... |
106 |
# We need to use " and not ', as the written config.sh use ' ... |