drop old eselect compiler logic
authorMike Frysinger <vapier@gentoo.org>
Mon, 5 Jul 2010 22:25:09 +0000 (22:25 +0000)
committerMike Frysinger <vapier@gentoo.org>
Mon, 5 Jul 2010 22:25:09 +0000 (22:25 +0000)
eclass/toolchain.eclass

index fe088ee3e13bb0d7f012edf69c0b8dfa1d6fb8fc..5c48512ba84d5ca223ed050a4d5de204feac5be9 100644 (file)
@@ -1,6 +1,6 @@
 # Copyright 1999-2008 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/toolchain.eclass,v 1.433 2010/07/05 22:22:20 vapier Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/toolchain.eclass,v 1.434 2010/07/05 22:25:09 vapier Exp $
 #
 # Maintainer: Toolchain Ninjas <toolchain@gentoo.org>
 
@@ -772,111 +772,6 @@ copy_minispecs_gcc_specs() {
                doins "${WORKDIR}"/specs/specs || die "failed to install the specs file"
        fi
 }
-add_profile_eselect_conf() {
-       local compiler_config_file=$1
-       local abi=$2
-       local specs=$3
-       local gcc_specs_file
-       local var
-
-       if [[ -z ${specs} ]] ; then
-               # I'm leaving the following commented out to remind me that it
-               # was an insanely -bad- idea. Stuff broke. GCC_SPECS isnt unset
-               # on chroot or in non-toolchain.eclass gcc ebuilds!
-               #gcc_specs_file="${LIBPATH}/specs"
-               gcc_specs_file=""
-
-               if use hardened ; then
-                       specs="hardened"
-               else
-                       specs="vanilla"
-               fi
-       else
-               gcc_specs_file="${LIBPATH}/${specs}.specs"
-       fi
-
-       echo >> ${compiler_config_file}
-       if ! is_multilib ; then
-               echo "[${specs}]" >> ${compiler_config_file}
-               echo "  ctarget=${CTARGET}" >> ${compiler_config_file}
-       else
-               echo "[${abi}-${specs}]" >> ${compiler_config_file}
-               var="CTARGET_${abi}"
-               if [[ -n ${!var} ]] ; then
-                       echo "  ctarget=${!var}" >> ${compiler_config_file}
-               else
-                       var="CHOST_${abi}"
-                       if [[ -n ${!var} ]] ; then
-                               echo "  ctarget=${!var}" >> ${compiler_config_file}
-                       else
-                               echo "  ctarget=${CTARGET}" >> ${compiler_config_file}
-                       fi
-               fi
-       fi
-
-       local MULTIDIR=$($(XGCC) $(get_abi_CFLAGS ${abi}) --print-multi-directory)
-       local LDPATH=${LIBPATH}
-       if [[ ${MULTIDIR} != "." ]] ; then
-               LDPATH="${LIBPATH}/${MULTIDIR}"
-       fi
-
-       echo "  ldpath=${LDPATH}" >> ${compiler_config_file}
-
-       if [[ -n ${gcc_specs_file} ]] ; then
-               echo "  specs=${gcc_specs_file}" >> ${compiler_config_file}
-       fi
-
-       var="CFLAGS_${abi}"
-       if [[ -n ${!var} ]] ; then
-               echo "  cflags=${!var}" >> ${compiler_config_file}
-       fi
-}
-
-create_eselect_conf() {
-       local config_dir="/etc/eselect/compiler"
-       local compiler_config_file="${D}/${config_dir}/${CTARGET}-${GCC_CONFIG_VER}.conf"
-       local abi
-
-       dodir ${config_dir}
-
-       echo "[global]" > ${compiler_config_file}
-       echo "  version=${CTARGET}-${GCC_CONFIG_VER}" >> ${compiler_config_file}
-       echo "  binpath=${BINPATH}" >> ${compiler_config_file}
-       echo "  manpath=${DATAPATH}/man" >> ${compiler_config_file}
-       echo "  infopath=${DATAPATH}/info" >> ${compiler_config_file}
-       echo "  alias_cc=gcc" >> ${compiler_config_file}
-       echo "  stdcxx_incdir=${STDCXX_INCDIR##*/}" >> ${compiler_config_file}
-       echo "  bin_prefix=${CTARGET}" >> ${compiler_config_file}
-
-       # Per spyderous, it is best not to alias the fortran compilers
-       #if [[ -x "${D}/${BINPATH}/${CTARGET}-g77" ]] ; then
-       #       echo "  alias_gfortran=g77" >> ${compiler_config_file}
-       #elif [[ -x "${D}/${BINPATH}/${CTARGET}-gfortran" ]] ; then
-       #       echo "  alias_g77=gfortran" >> ${compiler_config_file}
-       #fi
-
-       for abi in $(get_all_abis) ; do
-               add_profile_eselect_conf "${compiler_config_file}" "${abi}"
-
-               if want_split_specs ; then
-                       if use hardened ; then
-                               add_profile_eselect_conf "${compiler_config_file}" "${abi}" vanilla
-                       elif hardened_gcc_works ; then
-                               add_profile_eselect_conf "${compiler_config_file}" "${abi}" hardened
-                       fi
-
-                       if hardened_gcc_works || hardened_gcc_works pie ; then
-                               add_profile_eselect_conf "${compiler_config_file}" "${abi}" hardenednossp
-                       fi
-
-                       if hardened_gcc_works || hardened_gcc_works ssp ; then
-                               add_profile_eselect_conf "${compiler_config_file}" "${abi}" hardenednopie
-                       fi
-
-                       add_profile_eselect_conf "${compiler_config_file}" "${abi}" hardenednopiessp
-               fi
-       done
-}
 
 #----<< specs + env.d logic >>----
 
@@ -937,11 +832,7 @@ gcc-compiler_pkg_preinst() {
 }
 
 gcc-compiler_pkg_postinst() {
-       if has_version 'app-admin/eselect-compiler' ; then
-               do_eselect_compiler
-       else
-               do_gcc_config
-       fi
+       do_gcc_config
 
        if ! is_crosscompile ; then
                echo
@@ -1980,9 +1871,6 @@ gcc-compiler_src_install() {
        # the group 'root' set to gid 0
        chown -R root:0 "${D}"${LIBPATH}
 
-       # Create config files for eselect-compiler
-       create_eselect_conf
-
        # Move pretty-printers to gdb datadir to shut ldconfig up
        gdbdir=/usr/share/gdb/auto-load
        for module in $(find "${D}" -iname "*-gdb.py" -print); do
@@ -2417,96 +2305,6 @@ do_gcc_config() {
        gcc-config ${CTARGET}-${GCC_CONFIG_VER}${use_specs}
 }
 
-should_we_eselect_compiler() {
-       # we always want to run gcc-config if we're bootstrapping, otherwise
-       # we might get stuck with the c-only stage1 compiler
-       use bootstrap && return 0
-       use build && return 0
-
-       # if the current config is invalid, we definitely want a new one
-       # Note: due to bash quirkiness, the following must not be 1 line
-       local curr_config
-       curr_config=$(env -i eselect compiler show ${CTARGET} 2>&1) || return 0
-       [[ -z ${curr_config} || ${curr_config} == "(none)" ]] && return 0
-
-       # if the previously selected config has the same major.minor (branch) as
-       # the version we are installing, then it will probably be uninstalled
-       # for being in the same SLOT, make sure we run gcc-config.
-       local curr_config_ver=$(echo ${curr_config} | cut -f1 -d/ | awk -F - '{ print $5 }')
-       local curr_branch_ver=$(get_version_component_range 1-2 ${curr_config_ver})
-
-       # If we're using multislot, just run gcc-config if we're installing
-       # to the same profile as the current one.
-       use multislot && return $([[ ${curr_config_ver} == ${GCC_CONFIG_VER} ]])
-
-       if [[ ${curr_branch_ver} == ${GCC_BRANCH_VER} ]] ; then
-               return 0
-       else
-               # if we're installing a genuinely different compiler version,
-               # we should probably tell the user -how- to switch to the new
-               # gcc version, since we're not going to do it for him/her.
-               # We don't want to switch from say gcc-3.3 to gcc-3.4 right in
-               # the middle of an emerge operation (like an 'emerge -e world'
-               # which could install multiple gcc versions).
-               einfo "The current gcc config appears valid, so it will not be"
-               einfo "automatically switched for you.  If you would like to"
-               einfo "switch to the newly installed gcc version, do the"
-               einfo "following:"
-               echo
-               einfo "eselect compiler set <profile>"
-               echo
-               ebeep
-               return 1
-       fi
-}
-
-do_eselect_compiler() {
-       if ! should_we_eselect_compiler; then
-               eselect compiler update
-               return 0
-       fi
-
-       for abi in $(get_all_abis) ; do
-               local ctarget=$(get_abi_CHOST ${abi})
-               local current_specs=$(env -i eselect compiler show ${ctarget} | cut -f2 -d/)
-
-               if [[ -n ${current_specs} && ${current_specs} != "(none)" ]] && eselect compiler set ${CTARGET}-${GCC_CONFIG_VER}/${current_specs} &> /dev/null; then
-                       einfo "The following compiler profile has been activated based on your previous profile:"
-                       einfo "${CTARGET}-${GCC_CONFIG_VER}/${current_specs}"
-               else
-                       # We couldn't choose based on the old specs, so fall back on vanilla/hardened based on USE
-
-                       local spec
-                       if use hardened ; then
-                               spec="hardened"
-                       else
-                               spec="vanilla"
-                       fi
-
-                       local profile
-                       local isset=0
-                       for profile in "${current_specs%-*}-${spec}" "${abi}-${spec}" "${spec}" ; do
-                               if eselect compiler set ${CTARGET}-${GCC_CONFIG_VER}/${profile} &> /dev/null ; then
-                                       ewarn "The newly installed version of gcc does not have a profile that matches the name of your"
-                                       ewarn "currently selected profile for ${ctarget}, so we have enabled the following instead:"
-                                       ewarn "${CTARGET}-${GCC_CONFIG_VER}/${profile}"
-                                       ewarn "If this is incorrect, please use 'eselect compiler set' to"
-                                       ewarn "select another profile."
-
-                                       isset=1
-                                       break
-                               fi
-                       done
-
-                       if [[ ${isset} == 0 ]] ; then
-                               eerror "We were not able to automatically set the current compiler for ${ctarget}"
-                               eerror "to your newly emerged gcc.      Please use 'eselect compiler set'"
-                               eerror "to select your compiler."
-                       fi
-               fi
-       done
-}
-
 # This function allows us to gentoo-ize gcc's version number and bugzilla
 # URL without needing to use patches.
 gcc_version_patch() {