aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2012-11-18 20:44:11 -0500
committerMike Frysinger <vapier@gentoo.org>2012-11-18 22:11:11 -0500
commit7ee46ae0f636f56054df4035f50de79af03e3657 (patch)
treee99bc984b8ba4d5248f53bc0caae3867b6295f1f /gcc-config
parentgcc-config: clean up libgcj pc files better (diff)
downloadgcc-config-7ee46ae0f636f56054df4035f50de79af03e3657.tar.gz
gcc-config-7ee46ae0f636f56054df4035f50de79af03e3657.tar.bz2
gcc-config-7ee46ae0f636f56054df4035f50de79af03e3657.zip
gcc-config: handle multilib libgcj pc files
Scan all of the multilib dirs that gcc supports and handle libgcj pc files for each one. URL: http://bugs.gentoo.org/435728 Reported-by: Michał Górny <mgorny@gentoo.org> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Diffstat (limited to 'gcc-config')
-rwxr-xr-xgcc-config31
1 files changed, 18 insertions, 13 deletions
diff --git a/gcc-config b/gcc-config
index 0406f95..18d0b48 100755
--- a/gcc-config
+++ b/gcc-config
@@ -354,8 +354,10 @@ switch_profile() {
fi
# Setup things properly again for this profile
- unset GCC_SPECS LDPATH
+ unset GCC_SPECS LDPATH MULTIOSDIRS
source "${GCC_ENV_D}/${CC_COMP}"
+ # Support older configs that did not setup MULTIOSDIRS for us.
+ : ${MULTIOSDIRS:=../${GENTOO_LIBDIR}}
# Ignore active profile errors here since we're switching away
OLD_CC_COMP=$(get_current_profile 2>/dev/null)
@@ -404,7 +406,7 @@ switch_profile() {
)
# Pass all by default
- awk '!/^(STDCXX_INCDIR|LDPATH|CC|CXX|CTARGET|GCCBITS|GCC_SPECS|GCC_PATH)=/ {print $0}' \
+ awk '!/^(STDCXX_INCDIR|LDPATH|CC|CXX|CTARGET|GCCBITS|GCC_SPECS|GCC_PATH|MULTIOSDIRS)=/ {print $0}' \
"${GCC_ENV_D}/${CC_COMP}" >> "${envd}.tmp"
if [[ -d ${ROOT}/etc/ld.so.conf.d ]] ; then
echo "${MY_LDPATH}" > "${ROOT}"/etc/ld.so.conf.d/05gcc-${CTARGET}.conf
@@ -422,19 +424,22 @@ switch_profile() {
ln -sf ${CC_COMP} "${GCC_ENV_D}/.NATIVE"
# Relocate random crap
- local pkgconfdir="${ROOT}/usr/${GENTOO_LIBDIR}/pkgconfig"
+ local x libdir pkgconfdir
local mver=${CC_COMP_VERSION:0:3}
- for x in "" "-${mver}" ; do
- x="${pkgconfdir}/libgcj${x}.pc"
- if [[ -e ${pkgconfdir}/libgcj-${CC_COMP_VERSION}.pc ]] ; then
- ln -sf libgcj-${CC_COMP_VERSION}.pc "${x}"
- else
- # Maybe we selected a version that lacks gcj support.
- rm -f "${x}"
- fi
+ for libdir in ${MULTIOSDIRS//:/ } ; do
+ pkgconfdir="${ROOT}/usr/lib/${libdir}/pkgconfig"
+ for x in "" "-${mver}" ; do
+ x="${pkgconfdir}/libgcj${x}.pc"
+ if [[ -e ${pkgconfdir}/libgcj-${CC_COMP_VERSION}.pc ]] ; then
+ ln -sf libgcj-${CC_COMP_VERSION}.pc "${x}"
+ else
+ # Maybe we selected a version that lacks gcj support.
+ rm -f "${x}"
+ fi
+ done
+ # Clean out anything left over from older versions. #430932
+ find "${pkgconfdir}"/libgcj*.pc -xtype l -delete 2>/dev/null
done
- # Clean out anything left over from older versions. #430932
- find "${pkgconfdir}"/libgcj*.pc -xtype l -delete 2>/dev/null
handle_split_usr
: $(( envd_changed += $? ))