From 7ee46ae0f636f56054df4035f50de79af03e3657 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Sun, 18 Nov 2012 20:44:11 -0500 Subject: gcc-config: handle multilib libgcj pc files MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Signed-off-by: Mike Frysinger --- gcc-config | 31 ++++++++++++++++++------------- 1 file changed, 18 insertions(+), 13 deletions(-) (limited to 'gcc-config') 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 += $? )) -- cgit v1.2.3-65-gdbad