projects
/
lttng-ust.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Move wait_shm_mmap initialization to library constructor
[lttng-ust.git]
/
tools
/
lttng-gen-tp
diff --git
a/tools/lttng-gen-tp
b/tools/lttng-gen-tp
index 8ae243f682360b2916985dad0bc39facb60b5904..6aa1bba15d05012cf75e8d3aa0af69d4efa67bdf 100755
(executable)
--- a/
tools/lttng-gen-tp
+++ b/
tools/lttng-gen-tp
@@
-1,4
+1,4
@@
-#!/usr/bin/python
+#!/usr/bin/
env
python
#
# Copyright (c) 2012 Yannick Brosseau <yannick.brosseau@gmail.com>
#
#
# Copyright (c) 2012 Yannick Brosseau <yannick.brosseau@gmail.com>
#
@@
-35,11
+35,6
@@
class HeaderFile:
#undef TRACEPOINT_INCLUDE
#define TRACEPOINT_INCLUDE "./{headerFilename}"
#undef TRACEPOINT_INCLUDE
#define TRACEPOINT_INCLUDE "./{headerFilename}"
-#ifdef __cplusplus
-extern "C"{{
-#endif /* __cplusplus */
-
-
#if !defined({includeGuard}) || defined(TRACEPOINT_HEADER_MULTI_READ)
#define {includeGuard}
#if !defined({includeGuard}) || defined(TRACEPOINT_HEADER_MULTI_READ)
#define {includeGuard}
@@
-50,11
+45,6
@@
extern "C"{{
#endif /* {includeGuard} */
#include <lttng/tracepoint-event.h>
#endif /* {includeGuard} */
#include <lttng/tracepoint-event.h>
-
-#ifdef __cplusplus
-}}
-#endif /* __cplusplus */
-
"""
def __init__(self, filename, template):
self.outputFilename = filename
"""
def __init__(self, filename, template):
self.outputFilename = filename
@@
-89,7
+79,9
@@
class CFile:
def write(self):
outputFile = open(self.outputFilename,"w")
def write(self):
outputFile = open(self.outputFilename,"w")
- headerFilename = self.outputFilename.replace(".c",".h")
+ headerFilename = self.outputFilename
+ if headerFilename.endswith(".c"):
+ headerFilename = headerFilename[:-2] + ".h"
outputFile.write(CFile.FILE_TPL.format(
headerFilename = headerFilename))
outputFile.write(CFile.FILE_TPL.format(
headerFilename = headerFilename))
@@
-104,7
+96,7
@@
class ObjFile:
if 'CC' in os.environ:
cc = os.environ['CC']
try:
if 'CC' in os.environ:
cc = os.environ['CC']
try:
- subprocess.call(cc,
+ subprocess.call(cc
.split()
,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
except OSError as msg:
stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
except OSError as msg:
@@
-136,16
+128,27
@@
class ObjFile:
return cc
def write(self):
return cc
def write(self):
- cFilename = self.outputFilename.replace(".o",".c")
+ cFilename = self.outputFilename
+ if cFilename.endswith(".o"):
+ cFilename = cFilename[:-2] + ".c"
+
cc = self._detectCC()
if cc == "":
raise RuntimeError("No C Compiler detected")
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:
if 'CFLAGS' in os.environ:
- cflags = os.environ['CFLAGS']
+ cflags =
" " +
os.environ['CFLAGS']
else:
cflags = ""
else:
cflags = ""
+ if 'LDFLAGS' in os.environ:
+ ldflags = " " + os.environ['LDFLAGS']
+ else:
+ ldflags = ""
- command = cc + " -c
" + c
flags + " -I. -llttng-ust" + " -o " + self.outputFilename + " " + cFilename
+ command = cc + " -c
" + cppflags + cflags + ld
flags + " -I. -llttng-ust" + " -o " + self.outputFilename + " " + cFilename
if verbose:
print("Compile command: " + command)
subprocess.call(command.split())
if verbose:
print("Compile command: " + command)
subprocess.call(command.split())
This page took
0.02532 seconds
and
4
git commands to generate.