2
1

trace-cmd-0001-Makefile-use-pkg-config-instead-of-python-config.patch 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. trace-cmd use python-config to find out which headers
  2. and libraries should be used to link against the Python libraries.
  3. By default, python-config returns paths that are inappropriate for
  4. cross-compilation.
  5. Add PYTHON_VERS to build trace-cmd with python2 or python3
  6. Signed-off-by: Romain Naour <romain.naour@openwide.fr>
  7. ---
  8. Makefile | 8 +++++---
  9. 1 file changed, 5 insertions(+), 3 deletions(-)
  10. diff --git a/Makefile b/Makefile
  11. index 83329ca..23b70d8 100644
  12. --- a/Makefile
  13. +++ b/Makefile
  14. @@ -80,8 +80,10 @@ ifndef NO_PYTHON
  15. PYTHON := ctracecmd.so
  16. PYTHON_GUI := ctracecmd.so ctracecmdgui.so
  17. +PYTHON_VERS ?= python
  18. +
  19. # Can build python?
  20. -ifeq ($(shell sh -c "python-config --includes > /dev/null 2>&1 && echo y"), y)
  21. +ifeq ($(shell sh -c "pkg-config --cflags $(PYTHON_VERS) > /dev/null 2>&1 && echo y"), y)
  22. PYTHON_PLUGINS := plugin_python.so
  23. BUILD_PYTHON := $(PYTHON) $(PYTHON_PLUGINS)
  24. PYTHON_SO_INSTALL := ctracecmd.install
  25. @@ -546,8 +548,8 @@ clean:
  26. ##### PYTHON STUFF #####
  27. -PYTHON_INCLUDES = `python-config --includes`
  28. -PYTHON_LDFLAGS = `python-config --ldflags` \
  29. +PYTHON_INCLUDES = `pkg-config --cflags $(PYTHON_VERS)`
  30. +PYTHON_LDFLAGS = `pkg-config --libs $(PYTHON_VERS)` \
  31. $(shell python -c "import distutils.sysconfig; print distutils.sysconfig.get_config_var('LINKFORSHARED')")
  32. PYGTK_CFLAGS = `pkg-config --cflags pygtk-2.0`
  33. --
  34. 1.8.4