commit: 827a9cd7ea1863242920651752a8265acc8d57ad Author: Rick Farina (Zero_Chaos) <zerochaos <AT> gentoo <DOT> org> AuthorDate: Wed Sep 2 21:52:48 2015 +0000 Commit: Richard Farina <zerochaos <AT> gentoo <DOT> org> CommitDate: Wed Sep 2 21:52:48 2015 +0000 URL: https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=827a9cd7
support setting/overriding fcflags and fflags, specifically for use with CFLAGS=-frecord-gcc-switches catalyst/base/stagebase.py | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/catalyst/base/stagebase.py b/catalyst/base/stagebase.py index 23491aa..d898e95 100644 --- a/catalyst/base/stagebase.py +++ b/catalyst/base/stagebase.py @@ -38,7 +38,7 @@ class StageBase(TargetBase, ClearBase, GenBase): self.valid_values.extend(["version_stamp","target","subarch",\ "rel_type","profile","snapshot","source_subpath","portage_confdir",\ - "cflags","cxxflags","ldflags","cbuild","hostuse","portage_overlay",\ + "cflags","cxxflags","fcflags","fflags","ldflags","cbuild","hostuse","portage_overlay",\ "distcc_hosts","makeopts","pkgcache_path","kerncache_path"]) self.set_valid_build_kernel_vars(addlargs) @@ -280,6 +280,14 @@ class StageBase(TargetBase, ClearBase, GenBase): if "CXXFLAGS" in self.makeconf: self.settings["CXXFLAGS"]=self.makeconf["CXXFLAGS"] + def override_fcflags(self): + if "FCFLAGS" in self.makeconf: + self.settings["FCFLAGS"]=self.makeconf["FCFLAGS"] + + def override_fflags(self): + if "FFLAGS" in self.makeconf: + self.settings["FFLAGS"]=self.makeconf["FFLAGS"] + def override_ldflags(self): if "LDFLAGS" in self.makeconf: self.settings["LDFLAGS"]=self.makeconf["LDFLAGS"] @@ -1020,6 +1028,8 @@ class StageBase(TargetBase, ClearBase, GenBase): self.override_chost() self.override_cflags() self.override_cxxflags() + self.override_fcflags() + self.override_fflags() self.override_ldflags() if "autoresume" in self.settings["options"] \ and self.resume.is_enabled("chroot_setup"): @@ -1077,6 +1087,20 @@ class StageBase(TargetBase, ClearBase, GenBase): myf.write('CXXFLAGS="${CFLAGS}"\n') else: myf.write('CXXFLAGS="${CFLAGS}"\n') + if "FCFLAGS" in self.settings: + if self.settings["FCFLAGS"]!=self.settings["CFLAGS"]: + myf.write('FCFLAGS="'+self.settings["FCFLAGS"]+'"\n') + else: + myf.write('FCFLAGS="${CFLAGS}"\n') + else: + myf.write('FCFLAGS="${CFLAGS}"\n') + if "FFLAGS" in self.settings: + if self.settings["FFLAGS"]!=self.settings["CFLAGS"]: + myf.write('FFLAGS="'+self.settings["FFLAGS"]+'"\n') + else: + myf.write('FFLAGS="${CFLAGS}"\n') + else: + myf.write('FFLAGS="${CFLAGS}"\n') if "LDFLAGS" in self.settings: myf.write("# LDFLAGS is unsupported. USE AT YOUR OWN RISK!\n")