X-Git-Url: http://gitweb.michael.orlitzky.com/?a=blobdiff_plain;f=compilation;h=6320e7069b0338802e0928b295f40a992f3307b8;hb=c98f3820a04e7ada895c6733890a1dd6e30ee7e3;hp=3368ad2806f28fcd0010088cbd95413b66fdc25f;hpb=4eac79281e23f13831ef72b8d2366a3ab71c04d9;p=bash.d.git diff --git a/compilation b/compilation index 3368ad2..6320e70 100644 --- a/compilation +++ b/compilation @@ -1,20 +1,37 @@ -#!/bin/bash +#!/bin/sh + +# Grab CFLAGS, etc. from our profile after first processing its parent +# profiles recursively +load_profile_defaults() { + local profile="${1}" + if [ -f "${profile}/parent" ]; then + for parent in $(cat "${profile}/parent"); do + local _parent_path="${profile}/${parent}" + load_profile_defaults "${_parent_path}" + done + fi + + if [ -f "${profile}/make.defaults" ]; then + . "${profile}/make.defaults" + echo "loaded ${profile}/make.defaults" + fi +} + +load_profile_defaults /etc/portage/make.profile -# Grab CFLAGS, etc. from the profile... -if [ -f /etc/portage/make.profile/make.defaults ]; then - source /etc/portage/make.profile/make.defaults -fi # and from make.conf, allowing the values in make.conf to override the # ones in the profile. if [ -f /etc/portage/make.conf ]; then - source /etc/portage/make.conf + . /etc/portage/make.conf fi # Not a portage variable, but it's real handy. REPOS="${DISTDIR}/../repositories" - -# LDFLAGS comes from.. somewhere else. -export LDFLAGS="-Wl,-O1 -Wl,--as-needed" +# These are really the only variables that make sense to export to +# subsequent commands. +export CFLAGS +export CXXFLAGS +export LDFLAGS