-# Grab CFLAGS, etc. from make.conf.
-source /etc/portage/make.conf
+# 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