Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ## Copyright 1999-2005 Gentoo Foundation
- # Distributed under the terms of the GNU General Public License v2
- # $Header: /etc/portage/bashrc$
- # Originally written by Ned Ludd (solar_at_gentoo.org)
- # modifications by Ryan McIntosh (thebigslide_at_gmail.com)
- # V1.0_rc1
- # - /etc/portage/bashrc
- if [ "$0" = "/usr/lib/portage/bin/ebuild.sh" -o "$0" = "/usr/lib/portage/bin/ebuild-daemon.sh" ]; then
- append-cflags() {
- export CFLAGS="${CFLAGS} $*"
- return 0
- }
- append-cxxflags() {
- export CXXFLAGS="${CXXFLAGS} $*"
- return 0
- }
- append-features() {
- export FEATURES="${FEATURES} $*"
- return 0
- }
- package-cflags() {
- # bail if file does not exist or is not readable.
- [ -r ${ROOT}/etc/portage/package.cflags ] || return 0
- while read -a target; do
- if [ "${target}" = "${CATEGORY}" ]; then
- unset CFLAGS
- for i in `/bin/seq 20`; do #linelength
- if [ "${target[$i]}" = "GLOBALCFLAGS" ]; then
- append-cflags $GLOBALCFLAGS
- else
- if [ "${target[$i]}" = "GLOBALCXXFLAGS" ]; then
- append-cflags $GLOBALCXXFLAGS
- else
- append-cflags ${target[$i]}
- fi
- fi
- done
- export -n CFLAGS
- else
- if [ "${target}" = "${CATEGORY}/${PN}" ]; then
- unset CFLAGS
- for i in `/bin/seq 20`; do #linelength
- if [ "${target[$i]}" = "GLOBALCFLAGS" ]; then
- append-cflags $GLOBALCFLAGS
- else
- if [ "${target[$i]}" = "GLOBALCXXFLAGS" ]; then
- append-cflags $GLOBALCXXFLAGS
- else
- append-cflags ${target[$i]}
- fi
- fi
- done
- export -n CFLAGS
- fi
- fi
- done < ${ROOT}/etc/portage/package.cflags
- }
- package-cxxflags() {
- # bail if file does not exist or is not readable.
- [ -r ${ROOT}/etc/portage/package.cxxflags ] || return 0
- while read -a target; do
- if [ "${target}" = "${CATEGORY}" ]; then
- unset CXXFLAGS
- for i in `/bin/seq 20`; do #linelength
- if [ "${target[$i]}" = "GLOBALCXXFLAGS" ]; then
- append-cxxflags $GLOBALCXXFLAGS
- else
- if [ "${target[$i]}" = "GLOBALCFLAGS" ]; then
- append-cxxflags $GLOBALCFLAGS
- else
- append-cxxflags ${target[$i]}
- fi
- fi
- done
- export -n CXXFLAGS
- else
- if [ "${target}" = "${CATEGORY}/${PN}" ]; then
- unset CXXFLAGS
- for i in `/bin/seq 20`; do #linelength
- if [ "${target[$i]}" = "GLOBALCXXFLAGS" ]; then
- append-cxxflags $GLOBALCXXFLAGS
- else
- if [ "${target[$i]}" = "GLOBALCFLAGS" ]; then
- append-cxxflags $GLOBALCFLAGS
- else
- append-cxxflags ${target[$i]}
- fi
- fi
- done
- export -n CXXFLAGS
- fi
- fi
- done < $ROOT/etc/portage/package.cxxflags
- }
- package-features() {
- # bail if file does not exist or is not readable.
- [ -r ${ROOT}/etc/portage/package.features ] || return 0
- while read -a target; do
- if [ "${target}" = "${CATEGORY}" ]; then
- unset FEATURES
- for i in `/bin/seq 20`; do #linelength
- if [ "${target[$i]}" = "GLOBALFEATURES" ]; then
- append-features $GLOBALFEATURES
- else
- append-features ${target[$i]}
- fi
- done
- export -n FEATURES
- else
- if [ "${target}" = "${CATEGORY}/${PN}" ]; then
- unset FEATURES
- for i in `/bin/seq 20`; do #linelength
- if [ "${target[$i]}" = "GLOBALFEATURES" ]; then
- append-features $GLOBALFEATURES
- else
- append-features ${target[$i]}
- fi
- done
- export -n FEATURES
- fi
- fi
- done < $ROOT/etc/portage/package.features
- }
- export GLOBALCFLAGS=$CFLAGS
- export GLOBALCXXFLAGS=$CXXFLAGS
- export GLOBALFEATURES=$FEATURES
- package-cflags
- package-cxxflags
- package-features
- unset GLOBALCFLAGS
- unset GLOBALCXXFLAG
- unset GLOBALFEATURES
- else
- echo "This bashrc does not know anything about $0"
- fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement