diff options
author | Martin Schlemmer <azarah@gentoo.org> | 2002-12-16 18:13:02 +0000 |
---|---|---|
committer | Martin Schlemmer <azarah@gentoo.org> | 2002-12-16 18:13:02 +0000 |
commit | e2831c92caaba539c15ea1821647cef74348bef2 (patch) | |
tree | 6efad7095393d5c6f01d1f738ebab9993bab768d | |
parent | new version (diff) | |
download | gcc-config-e2831c92caaba539c15ea1821647cef74348bef2.tar.gz gcc-config-e2831c92caaba539c15ea1821647cef74348bef2.tar.bz2 gcc-config-e2831c92caaba539c15ea1821647cef74348bef2.zip |
updates for /lib/cpp and /usr/bin/cc wrappersv1.2.3
-rwxr-xr-x | gcc-config | 70 |
1 files changed, 45 insertions, 25 deletions
@@ -2,7 +2,7 @@ # Copyright 1999-2002 Gentoo Foundation # Distributed under the terms of the GNU General Public License # Author: Martin Schlemmer <azarah@gentoo.org> -# $Header: gentoo-x86/sys-devel/gcc-config/files/gcc-config-1.2.2,v 1.1 2002/12/16 04:19:05 azarah Exp $ +# $Header: gentoo-x86/sys-devel/gcc-config/files/gcc-config-1.2.3,v 1.1 2002/12/16 18:13:02 azarah Exp $ source /etc/init.d/functions.sh || { @@ -51,6 +51,23 @@ then usage fi +cmd_setup() { + + # Sourcing /etc/env.d/gcc/${GCC_COMP} is going to mess up + # PATH among things... + CP="$(find_path cp)" + RM="$(find_path rm)" + MV="$(find_path mv)" + LN="$(find_path ln)" + CAT="$(find_path cat)" + AWK="$(find_path gawk)" + GREP="$(find_path grep)" + FIND="$(find_path find)" + CHMOD="$(find_path chmod)" + TOUCH="$(find_path touch)" + ENV_UPDATE="$(find_path env-update)" +} + find_path() { [ -z "$1" ] && return 0 @@ -64,6 +81,16 @@ find_path() { done } +gen_wrapper() { + ${CAT} > $1 << END +#!/bin/sh + +$2 "\$@" +END + + ${CHMOD} 0755 $1 +} + GCC_COMP="" REAL_CHOST="$(/usr/bin/python -c 'import portage; print portage.settings["CHOST"];')" @@ -81,14 +108,7 @@ switch_profile() { # Sourcing /etc/env.d/gcc/${GCC_COMP} is going to mess up # PATH among things... - CP="$(find_path cp)" - RM="$(find_path rm)" - MV="$(find_path mv)" - LN="$(find_path ln)" - AWK="$(find_path gawk)" - GREP="$(find_path grep)" - FIND="$(find_path find)" - ENV_UPDATE="$(find_path env-update)" + cmd_setup # Order our profiles to have the default first... # We do this so that we can have them ordered with default @@ -122,22 +142,22 @@ switch_profile() { source /etc/env.d/gcc/${GCC_COMP} -# These are in gcc's internal include dir, so no need for symlinks or other -# hacks ... -# if [ -d /usr/include/${STDCXX_INCDIR} -a ! -L /usr/include/${STDCXX_INCDIR} ] -# then -# ${MV} /usr/include/${STDCXX_INCDIR} /usr/include/${STDCXX_INCDIR}.orig -# elif [ -L /usr/include/${STDCXX_INCDIR} ] -# then -# ${RM} -f /usr/include/${STDCXX_INCDIR} -# fi -# ${LN} -snf ..${LDPATH/\/usr}/include/${STDCXX_INCDIR} /usr/include/${STDCXX_INCDIR} - -# We use wrapper scripts from gcc-3.2.1-r6 .... -# [ -L /lib/cpp -o -f /lib/cpp ] && ${RM} -f /lib/cpp -# ${LN} -snf ..${PATH}/cpp /lib/cpp -# [ -L /usr/bin/cc -o -f /usr/bin/cc ] && ${RM} -f /usr/bin/cc -# ${LN} -snf ../..${PATH}/gcc /usr/bin/cc + # Create /lib/cpp if missing or a symlink + if [ -L /lib/cpp -o ! -f /lib/cpp ] + then + ${RM} -f /lib/cpp + gen_wrapper /lib/cpp cpp + fi + # Make sure it are not unmerged by mistake + ${TOUCH} /lib/cpp + # Create /usr/bin/cc if missing for a symlink + if [ -L /usr/bin/cc -o ! -f /usr/bin/cc ] + then + ${RM} -f /usr/bin/cc + gen_wrapper /usr/bin/cc gcc + fi + # Make sure it are not unmerged by mistake + ${TOUCH} /usr/bin/cc echo "CURRENT=${GCC_COMP}" > /etc/env.d/gcc/config |