--- compiler.eselect.in (revision 298) +++ compiler.eselect.in (working copy) @@ -514,8 +514,28 @@ env_manpath="${env_manpath:+"${env_manpath}:"}${COMPILER_CONFIG_MANPATH}" [[ -n ${COMPILER_CONFIG_INFOPATH} ]] && env_infopath="${env_infopath:+"${env_infopath}:"}${COMPILER_CONFIG_INFOPATH}" - [[ -n ${COMPILER_CONFIG_LDPATH} ]] && - env_ldpath="${env_ldpath:+"${env_ldpath}:"}${COMPILER_CONFIG_LDPATH}" + # bugs 112156, 137917 - write LDPATHS for all installed compilers for + # CTARGET, with chosen compiler version first. N.B. do not include ldpaths + # for cross-compilers. + # TODO - fix what happens when COMPILER_CONFIG_SET_CTARGETS + # has more than one entry (means changing the ctarget_sub == !set_v + # to a loop, or something) + if [[ ${ctarget} == ${COMPILER_CONFIG_DEFAULT_CTARGET} ]]; then + [[ -n ${COMPILER_CONFIG_LDPATH} ]] && + env_ldpath="${env_ldpath:+"${env_ldpath}:"}${COMPILER_CONFIG_LDPATH}" + set_vs="COMPILER_CONFIG_PROFILES_${ctarget//[-.]/_}" + for ctarget_sub in ${!set_vs}; do + [[ ${ctarget_sub/\/*} == ${!set_v} ]] && continue + has ${ctarget_sub/\/*} ${seen_ctargets} && continue + if eval_pm ${preopts} get-profile ${ctarget_sub}; then + [[ -n ${COMPILER_CONFIG_LDPATH} ]] && + env_ldpath="${env_ldpath:+"${env_ldpath}:"}${COMPILER_CONFIG_LDPATH}" + else + write_error_msg "Unable to get profile information for ${ctarget_sub}" + fi + seen_ctargets="${seen_ctargets} ${ctarget_sub/\/*}" + done + fi else write_error_msg "Unable to get profile information for ${!set_v} which is set for CTARGET ${ctarget}" fi