cross-arm-linux-gnueabi: clean up libdir handling

This commit is contained in:
q66 2020-12-23 23:24:39 +01:00
parent 2e2fc311be
commit 771851b89a

View file

@ -194,6 +194,8 @@ _glibc_build() {
[ ! -d glibc-build ] && mkdir glibc-build
cd glibc-build
echo "slibdir=/usr/lib32" > configparms
echo "libc_cv_forced_unwind=yes" > config.cache
echo "libc_cv_c_cleanup=yes" >> config.cache
@ -202,6 +204,7 @@ _glibc_build() {
export CFLAGS="-Os -pipe ${_archflags}"
_args="--prefix=/usr"
_args+=" --libdir=/usr/lib32"
_args+=" --host=${_triplet}"
_args+=" --with-headers=${_sysroot}/usr/include"
_args+=" --config-cache"
@ -237,7 +240,9 @@ _gcc_build() {
# Make this link to target libs.
if [ ! -f .sed_subst_done ]; then
sed -e "s, /lib/, ${_sysroot}/lib/,g;s, /usr/lib/, ${_sysroot}/usr/lib/,g" \
-i ${_sysroot}/lib/libc.so ${_sysroot}/lib/libpthread.so
-i ${_sysroot}/lib/libc.so
sed -e "s, /lib32/, ${_sysroot}/lib32/,g;s, /usr/lib32/, ${_sysroot}/usr/lib32/,g" \
-i ${_sysroot}/lib/libc.so
touch .sed_subst_done
fi
@ -282,7 +287,7 @@ _gcc_build() {
}
do_build() {
for f in include lib bin; do
for f in include lib libexec bin sbin; do
if [ ! -d ${_sysroot}/usr/${f} ]; then
mkdir -p ${_sysroot}/usr/${f}
fi
@ -290,6 +295,9 @@ do_build() {
ln -sfr ${_sysroot}/usr/${f} ${_sysroot}/${f}
fi
done
ln -sf lib ${_sysroot}/usr/lib32
ln -sf usr/lib ${_sysroot}/lib32
# Ensure we use sane environment
unset CC CXX CPP LD AS AR RANLIB OBJDUMP READELF NM
unset CFLAGS CXXFLAGS CPPFLAGS LDFLAGS
@ -304,7 +312,7 @@ do_build() {
}
do_install() {
for f in include lib bin; do
for f in include lib libexec bin sbin; do
if [ ! -d ${DESTDIR}/${_sysroot}/usr/${f} ]; then
mkdir -p ${DESTDIR}/${_sysroot}/usr/${f}
fi
@ -313,6 +321,9 @@ do_install() {
${DESTDIR}/${_sysroot}/${f}
fi
done
ln -sf lib ${DESTDIR}/${_sysroot}/usr/lib32
ln -sf usr/lib ${DESTDIR}/${_sysroot}/lib32
# install cross binutils
cd ${wrksrc}/binutils-build
make DESTDIR=${DESTDIR} install