Skip to contentSkip to conversation

trace-cmd: Fix python build to handle new library headers

PATCH New Steven Rostedt 1 participant 1 message Dec 13, 2021 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 trace-cmd: Fix python build to handle new library headers

From: "Steven Rostedt (VMware)" <[email protected]>

The python build still references the internal event-parse.h header even if the latest libtraceevent is installed on the system. This causes inconsistencies between what's in the updated system header with the obsoleted internal header.

Update the make files to use the proper header to build the python code as the rest of the build uses.

---
 Makefile        | 7 ++++---
 python/Makefile | 4 ++--
 2 files changed, 6 insertions(+), 5 deletions(-)
Makefile +4 -3
index 2ff40a8e..3bcafd74 100644
@@ -280,7 +280,9 @@ export LIBTRACEFS_CFLAGS LIBTRACEFS_LDLAGS
 TRACE_LIBS = -L$(LIBTRACECMD_DIR) -ltracecmd	\
 	     $(LIBTRACEEVENT_LDLAGS) $(LIBTRACEFS_LDLAGS)
 
-export LIBS TRACE_LIBS
+TRACE_INCLUDES = $(LIBTRACEEVENT_CFLAGS) $(LIBTRACEFS_CFLAGS)
+
+export LIBS TRACE_LIBS TRACE_INCLUDES
 export LIBTRACEEVENT_DIR LIBTRACECMD_DIR LIBTRACEFS_DIR
 export Q SILENT VERBOSE EXT
 
@@ -292,8 +294,7 @@ INCLUDES += -I$(src)/include/trace-cmd
 INCLUDES += -I$(src)/lib/trace-cmd/include
 INCLUDES += -I$(src)/lib/trace-cmd/include/private
 INCLUDES += -I$(src)/tracecmd/include
-INCLUDES += $(LIBTRACEEVENT_CFLAGS)
-INCLUDES += $(LIBTRACEFS_CFLAGS)
+INCLUDES += $(TRACE_INCLUDES)
 
 include $(src)/features.mk
 
python/Makefile +2 -2
index d2906c4f..ddb9af4c 100644
@@ -9,8 +9,8 @@ PYTHON_PY_LIBS := tracecmd.install
 endif
 
 ctracecmd.so: ctracecmd.i $(LIBTRACECMD_STATIC)
-	swig -Wall -python -noproxy -I$(src)/include/traceevent -I$(src)/include/trace-cmd ctracecmd.i
-	$(CC) -fpic -c $(CPPFLAGS) $(CFLAGS) $(PYTHON_INCLUDES)  ctracecmd_wrap.c
+	swig -Wall -python -noproxy -I$(src)/include/trace-cmd $(TRACE_INCLUDES) ctracecmd.i
+	$(CC) -fpic -c $(CPPFLAGS) $(CFLAGS) $(PYTHON_INCLUDES) $(TRACE_INCLUDES) ctracecmd_wrap.c
 	$(CC) --shared $(LIBTRACECMD_STATIC) $(LDFLAGS) ctracecmd_wrap.o -o ctracecmd.so $(TRACE_LIBS)
 
 $(PYTHON_SO_INSTALL): %.install : %.so force
Signature · 1 line
2.31.1