From 0b9113bf4f1613f059c5a9bf012b534837b18e55 Mon Sep 17 00:00:00 2001 From: Michael Jeanson Date: Thu, 27 Jun 2019 15:16:48 -0400 Subject: [PATCH] fix: Use python-config 'ldflags' instead of 'libs' This allows building the python plugin provider against a Python installation that is not in the default system path. The output of '--ldflags' is the same as '--libs' with the added linker path to the python library. Signed-off-by: Michael Jeanson Change-Id: Idf0171bdc181a7d6d7593021dab957437772b2f5 Reviewed-on: https://review.lttng.org/c/babeltrace/+/1558 Tested-by: jenkins Reviewed-by: Philippe Proulx --- configure.ac | 10 +++++----- src/python-plugin-provider/Makefile.am | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/configure.ac b/configure.ac index 8c2b601a..4d150fe9 100644 --- a/configure.ac +++ b/configure.ac @@ -378,7 +378,7 @@ AC_SUBST(POPT_LIBS) ## ## AC_ARG_VAR([PYTHON_INCLUDE], [Include flags for Python, bypassing python-config]) -AC_ARG_VAR([PYTHON_LIBS], [Library flags for Python, bypassing python-config]) +AC_ARG_VAR([PYTHON_LDFLAGS], [Linker flags for Python, bypassing python-config]) AC_ARG_VAR([PYTHON_CONFIG], [Path to python-config]) # PLUGINSDIR: Plugins directory @@ -572,7 +572,7 @@ AS_IF([test "x$enable_python_bindings" = xyes || test "x$enable_python_plugins" PYTHON_INCLUDE=`$PYTHON_CONFIG --includes` AC_MSG_RESULT([$PYTHON_INCLUDE]) ]) - AS_IF([test -z "$PYTHON_LIBS"], [ + AS_IF([test -z "$PYTHON_LDFLAGS"], [ AS_IF([test -z "$PYTHON_CONFIG"], [ AC_PATH_PROGS([PYTHON_CONFIG], [python$PYTHON_VERSION-config python-config], @@ -581,8 +581,8 @@ AS_IF([test "x$enable_python_bindings" = xyes || test "x$enable_python_plugins" AS_IF([test "$PYTHON_CONFIG" = no], [AC_MSG_ERROR([cannot find python-config for $PYTHON. Is python-dev installed?])]) ]) AC_MSG_CHECKING([Python library flags]) - PYTHON_LIBS=`$PYTHON_CONFIG --libs` - AC_MSG_RESULT([$PYTHON_LIBS]) + PYTHON_LDFLAGS=`$PYTHON_CONFIG --ldflags` + AC_MSG_RESULT([$PYTHON_LDFLAGS]) ]) ] ) @@ -860,7 +860,7 @@ test "x$enable_python_plugins" = "xyes" && value=1 || value=0 PPRINT_PROP_BOOL([Python plugin support], $value) AS_IF([test "x$enable_python_bindings" = "xyes" || test "x$enable_python_plugins" = "xyes"], [ PPRINT_PROP_STRING([Python include paths], [$PYTHON_INCLUDE]) - PPRINT_PROP_STRING([Python libraries], [$PYTHON_LIBS]) + PPRINT_PROP_STRING([Python linker flags], [$PYTHON_LDFLAGS]) ]) AS_ECHO diff --git a/src/python-plugin-provider/Makefile.am b/src/python-plugin-provider/Makefile.am index e388406a..faac4799 100644 --- a/src/python-plugin-provider/Makefile.am +++ b/src/python-plugin-provider/Makefile.am @@ -10,7 +10,7 @@ libbabeltrace2_python_plugin_provider_la_SOURCES = \ libbabeltrace2_python_plugin_provider_la_LDFLAGS = \ $(LT_NO_UNDEFINED) \ -version-info $(BABELTRACE_LIBRARY_VERSION) \ - $(PYTHON_LIBS) + $(PYTHON_LDFLAGS) libbabeltrace2_python_plugin_provider_la_LIBADD = -- 2.34.1