From ea21c07f37b32c9cba780d76a921d4a4d4d3f4db Mon Sep 17 00:00:00 2001 From: Eric Edgar Date: Mon, 7 Nov 2005 16:25:06 +0000 Subject: [PATCH] Allow LDFLAGS to be specified as an ENV variable for stage1 git-svn-id: svn+ssh://svn.gentoo.org/var/svnroot/catalyst/trunk@874 d1e1f19c-881f-0410-ab34-b69fee027534 --- ChangeLog | 6 +++++- modules/generic_stage_target.py | 15 ++++++++++++++- modules/stage1_target.py | 10 ++++++++-- 3 files changed, 27 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 67bd51e2..80d6ac85 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ # Copyright 2002-2005 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo/src/catalyst/ChangeLog,v 1.364 2005/11/07 15:46:05 rocket Exp $ +# $Header: /var/cvsroot/gentoo/src/catalyst/ChangeLog,v 1.365 2005/11/07 16:25:06 rocket Exp $ + + 07 Nov 2005; Eric Edgar + modules/generic_stage_target.py, modules/stage1_target.py: + Allow LDFLAGS to be specified as an ENV variable for stage1 07 Nov 2005; Eric Edgar modules/generic_stage_target.py: diff --git a/modules/generic_stage_target.py b/modules/generic_stage_target.py index 0e68c7fa..c50431b4 100644 --- a/modules/generic_stage_target.py +++ b/modules/generic_stage_target.py @@ -1,6 +1,6 @@ # Copyright 1999-2005 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo/src/catalyst/modules/generic_stage_target.py,v 1.69 2005/11/07 15:46:05 rocket Exp $ +# $Header: /var/cvsroot/gentoo/src/catalyst/modules/generic_stage_target.py,v 1.70 2005/11/07 16:25:06 rocket Exp $ """ This class does all of the chroot setup, copying of files, etc. It is @@ -207,6 +207,15 @@ class generic_stage_target(generic_target): print "Using CXXFLAGS setting from seed stage" self.settings["CXXFLAGS"]=self.makeconf["CXXFLAGS"] + def override_ldflags(self): + if os.environ.has_key("LDFLAGS"): + self.settings["LDFLAGS"] = os.environ["LDFLAGS"] + if self.settings.has_key("ldflags"): + self.settings["LDFLAGS"]=list_to_string(self.settings["ldflags"]) + if self.makeconf.has_key("LDFLAGS"): + print "Using LDFLAGS setting from seed stage" + self.settings["LDFLAGS"]=self.makeconf["LDFLAGS"] + def set_install_mask(self): if self.settings.has_key("install_mask"): if type(self.settings["install_mask"]) != types.StringType: @@ -717,6 +726,7 @@ class generic_stage_target(generic_target): self.override_chost() self.override_cflags() self.override_cxxflags() + self.override_ldflags() # modify and write out make.conf (for the chroot) cmd("rm -f "+self.settings["chroot_path"]+"/etc/make.conf","Could not remove "+self.settings["chroot_path"]+"/etc/make.conf") myf=open(self.settings["chroot_path"]+"/etc/make.conf","w") @@ -730,6 +740,9 @@ class generic_stage_target(generic_target): else: myf.write('CXXFLAGS="${CFLAGS}"\n') + if self.settings.has_key("LDFLAGS"): + myf.write('LDFLAGS="'+self.settings["LDFLAGS"]+'"\n') + # figure out what our USE vars are for building myusevars=[] if self.settings.has_key("HOSTUSE"): diff --git a/modules/stage1_target.py b/modules/stage1_target.py index c95a35bc..a9fab698 100644 --- a/modules/stage1_target.py +++ b/modules/stage1_target.py @@ -1,6 +1,6 @@ # Copyright 1999-2005 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo/src/catalyst/modules/stage1_target.py,v 1.10 2005/08/09 14:12:26 rocket Exp $ +# $Header: /var/cvsroot/gentoo/src/catalyst/modules/stage1_target.py,v 1.11 2005/11/07 16:25:06 rocket Exp $ """ Builder class for a stage1 installation tarball build. @@ -46,6 +46,12 @@ class stage1_target(generic_stage_target): if self.settings.has_key("cxxflags"): self.settings["CXXFLAGS"]=list_to_string(self.settings["cxxflags"]) -def register(foo): + def override_ldflags(self): + if os.environ.has_key("LDFLAGS"): + self.settings["LDFLAGS"] = os.environ["LDFLAGS"] + if self.settings.has_key("ldflags"): + self.settings["LDFLAGS"]=list_to_string(self.settings["ldflags"]) + +def reg(foo): foo.update({"stage1":stage1_target}) return foo -- 2.26.2