Allow LDFLAGS to be specified as an ENV variable for stage1
authorEric Edgar <rocket@gentoo.org>
Mon, 7 Nov 2005 16:25:06 +0000 (16:25 +0000)
committerEric Edgar <rocket@gentoo.org>
Mon, 7 Nov 2005 16:25:06 +0000 (16:25 +0000)
git-svn-id: svn+ssh://svn.gentoo.org/var/svnroot/catalyst/trunk@874 d1e1f19c-881f-0410-ab34-b69fee027534

ChangeLog
modules/generic_stage_target.py
modules/stage1_target.py

index 67bd51e283a93ad70cfce8979c3cf701cbe184df..80d6ac85d4446ece782788affd46802e4516e83e 100644 (file)
--- 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 <rocket@gentoo.org>
+  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 <rocket@gentoo.org>
   modules/generic_stage_target.py:
index 0e68c7fa251a5dd543dd090e26d31369f49da01c..c50431b4319541485cabee986f2382d8b48409f2 100644 (file)
@@ -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"):
index c95a35bccc5f5301e1eec18a1447947136b75730..a9fab698f901a31825c46da47f0e7a8fdeed13ee 100644 (file)
@@ -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