X-Git-Url: http://gitweb.michael.orlitzky.com/?a=blobdiff_plain;f=compilation;h=7b76b34d7e89ad1ddae54a3a0193831349783c4e;hb=b6f38a99cb23296286af8a17bc180f27e3aa7141;hp=a166d6678bdc9fca71f317b911f5b93c919bc63d;hpb=087320ca8226a1e0c2cfcfd196e0fc8373f7cf59;p=bash.d.git diff --git a/compilation b/compilation index a166d66..7b76b34 100644 --- a/compilation +++ b/compilation @@ -1,24 +1,42 @@ -#!/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 + if [ -r "${profile}/make.defaults" ]; then + . "${profile}/make.defaults" + fi + 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 + if [ -r /etc/portage/make.conf ]; then + . /etc/portage/make.conf + fi fi - -# Not a portage variable, but it's real handy. -REPOS="${DISTDIR}/../repositories" - -# These are really the only two that make sense to export to +# These are really the only variables that make sense to export to # subsequent commands. export CFLAGS export CXXFLAGS +export FCFLAGS +export LDFLAGS -# LDFLAGS comes from.. somewhere else. -export LDFLAGS="-Wl,-O1 -Wl,--as-needed" +# This variable isn't standard, but I've started including it in my +# Haskell makefiles so that we don't have to hard-code user preferences +# (these flags) in the cabal files that *everyone* uses. +export HCFLAGS