Fix: python invocation through env
[lttng-ust.git] / tools / lttng-gen-tp
index 1b8439f3c71258bfaac2b3bd29358904401800f6..a3a01f27c033101e87f4a879c032fcab095bd8e7 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
 #
 # Copyright (c)  2012 Yannick Brosseau <yannick.brosseau@gmail.com>
 #
@@ -130,12 +130,20 @@ class ObjFile:
         cc = self._detectCC()
         if cc == "":
             raise RuntimeError("No C Compiler detected")
+        if 'CPPFLAGS' in os.environ:
+            cppflags = " " + os.environ['CPPFLAGS']
+        else:
+            cppflags = ""
         if 'CFLAGS' in os.environ:
-            cflags = os.environ['CFLAGS']
+            cflags = " " + os.environ['CFLAGS']
         else:
             cflags = ""
+        if 'LDFLAGS' in os.environ:
+            ldflags = " " + os.environ['LDFLAGS']
+        else:
+            ldflags = ""
 
-        command = cc + " -c " + cflags + " -I. -llttng-ust" + " -o " + self.outputFilename + " " + cFilename
+        command = cc + " -c" + cppflags + cflags + ldflags + " -I. -llttng-ust" + " -o " + self.outputFilename + " " + cFilename
         if verbose:
             print("Compile command: " + command)
         subprocess.call(command.split())
This page took 0.023894 seconds and 4 git commands to generate.