toolchain: GCC: use CFLAGS, LDFLAGS and SYSROOT given in environment wxPython4
authorEdouard Tisserant <edouard.tisserant@gmail.com>
Sun, 31 Jul 2022 12:27:47 +0200
branchwxPython4
changeset 3571 fdd4b171ac6c
parent 3570 eb915a9fdcb0
child 3572 b46af5b80c7d
toolchain: GCC: use CFLAGS, LDFLAGS and SYSROOT given in environment
targets/toolchain_gcc.py
--- a/targets/toolchain_gcc.py	Sat Jul 30 01:31:17 2022 +0200
+++ b/targets/toolchain_gcc.py	Sun Jul 31 12:27:47 2022 +0200
@@ -51,14 +51,24 @@
         """
         Returns list of builder specific CFLAGS
         """
-        return [self.CTRInstance.GetTarget().getcontent().getCFLAGS()]
+        cflags = [self.CTRInstance.GetTarget().getcontent().getCFLAGS()]
+        if os.environ.has_key("CFLAGS"):
+            cflags.append(os.environ["CFLAGS"])
+        if os.environ.has_key("SYSROOT"):
+            cflags.append("--sysroot="+os.environ["SYSROOT"])
+        return cflags
 
     def getBuilderLDFLAGS(self):
         """
         Returns list of builder specific LDFLAGS
         """
-        return self.CTRInstance.LDFLAGS + \
+        ldflags = self.CTRInstance.LDFLAGS + \
             [self.CTRInstance.GetTarget().getcontent().getLDFLAGS()]
+        if os.environ.has_key("LDLAGS"):
+            ldflags.append(os.environ["LDLAGS"])
+        if os.environ.has_key("SYSROOT"):
+            ldflags.append("--sysroot="+os.environ["SYSROOT"])
+        return ldflags
 
     def getCompiler(self):
         """