]> gitweb.michael.orlitzky.com - bash.d.git/blob - compilation
compilation: process make.defaults in parent profiles, too.
[bash.d.git] / compilation
1 #!/bin/sh
2
3 # Grab CFLAGS, etc. from our profile after first processing its parent
4 # profiles recursively
5 load_profile_defaults() {
6 local profile="${1}"
7 if [ -f "${profile}/parent" ]; then
8 for parent in $(cat "${profile}/parent"); do
9 local _parent_path="${profile}/${parent}"
10 load_profile_defaults "${_parent_path}"
11 done
12 fi
13
14 if [ -f "${profile}/make.defaults" ]; then
15 . "${profile}/make.defaults"
16 echo "loaded ${profile}/make.defaults"
17 fi
18 }
19
20 load_profile_defaults /etc/portage/make.profile
21
22
23 # and from make.conf, allowing the values in make.conf to override the
24 # ones in the profile.
25 if [ -f /etc/portage/make.conf ]; then
26 . /etc/portage/make.conf
27 fi
28
29
30 # Not a portage variable, but it's real handy.
31 REPOS="${DISTDIR}/../repositories"
32
33 # These are really the only variables that make sense to export to
34 # subsequent commands.
35 export CFLAGS
36 export CXXFLAGS
37 export LDFLAGS