Project

General

Profile

Actions

Bug #1235

closed

configure.ac: using python-config --libs instead of python-config --ldflags

Added by Philippe Proulx almost 5 years ago. Updated almost 3 years ago.

Status:
Resolved
Priority:
Low
Assignee:
-
Category:
Build system
Target version:
Start date:
02/17/2020
Due date:
% Done:

0%

Estimated time:

Description

We need to use python-config --ldflags instead of python-config --libs in configure.ac to also include the library paths (-L option). Change the variable to PYTHON_LDFLAGS.

Something like this:

diff --git i/configure.ac w/configure.ac
index 2f6056588..d0d4dadca 100644
--- i/configure.ac
+++ w/configure.ac
@@ -373,7 +373,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], [Library flags for Python, bypassing python-config])
 AC_ARG_VAR([PYTHON_CONFIG], [Path to python-config])

 # PLUGINSDIR: Plugins directory
@@ -555,7 +555,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],
@@ -564,8 +564,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])
   ])
   ]
 )
@@ -837,7 +837,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 library flags], [$PYTHON_LDFLAGS])
 ])

 AS_ECHO
diff --git i/python-plugin-provider/Makefile.am w/python-plugin-provider/Makefile.am
index 28a45e80b..6772ec710 100644
--- i/python-plugin-provider/Makefile.am
+++ w/python-plugin-provider/Makefile.am
@@ -7,7 +7,7 @@ libbabeltrace_python_plugin_provider_la_SOURCES = \
 libbabeltrace_python_plugin_provider_la_LDFLAGS = \
     $(LT_NO_UNDEFINED) \
     -version-info $(BABELTRACE_LIBRARY_VERSION) \
-    $(PYTHON_LIBS)
+    $(PYTHON_LDFLAGS)

 libbabeltrace_python_plugin_provider_la_LIBADD =

Actions #1

Updated by Jonathan Rajotte Julien almost 5 years ago

Migrated from internal bug tracker.

Actions #2

Updated by Michael Jeanson almost 3 years ago

  • Status changed from New to Resolved

Fixed in 0b9113bf4f1613f059c5a9bf012b534837b18e55

Actions

Also available in: Atom PDF