Use the --embed when running "python3-config --ldflags" if supported.
Newer versions of python3-config only include libpython in the output when the --embed is used. Otherwise, "python3-config --libs" and "python3-config --ldflags" only list the libraries python is dependent on and not the python library itself.
This commit is contained in:
8
configure
vendored
8
configure
vendored
@@ -19465,9 +19465,15 @@ fi
|
|||||||
|
|
||||||
if test -z "$PYTHON_LIBS"; then :
|
if test -z "$PYTHON_LIBS"; then :
|
||||||
|
|
||||||
|
# Newer versions of python3-config need --embed to include libpython
|
||||||
|
if $PYTHON_CONFIG 2>&1 | grep embed >/dev/null; then
|
||||||
|
PY_EMBED=--embed
|
||||||
|
else
|
||||||
|
PY_EMBED=
|
||||||
|
fi
|
||||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking python linker flags" >&5
|
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking python linker flags" >&5
|
||||||
$as_echo_n "checking python linker flags... " >&6; }
|
$as_echo_n "checking python linker flags... " >&6; }
|
||||||
PYTHON_LIBS=`$PYTHON_CONFIG --ldflags`
|
PYTHON_LIBS=`$PYTHON_CONFIG --ldflags $PY_EMBED`
|
||||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYTHON_LIBS" >&5
|
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYTHON_LIBS" >&5
|
||||||
$as_echo "$PYTHON_LIBS" >&6; }
|
$as_echo "$PYTHON_LIBS" >&6; }
|
||||||
|
|
||||||
|
@@ -2600,8 +2600,14 @@ if test ${USE_PYTHON-'no'} = "yes"; then
|
|||||||
])
|
])
|
||||||
|
|
||||||
AS_IF([test -z "$PYTHON_LIBS"], [
|
AS_IF([test -z "$PYTHON_LIBS"], [
|
||||||
|
# Newer versions of python3-config need --embed to include libpython
|
||||||
|
if $PYTHON_CONFIG 2>&1 | grep embed >/dev/null; then
|
||||||
|
PY_EMBED=--embed
|
||||||
|
else
|
||||||
|
PY_EMBED=
|
||||||
|
fi
|
||||||
AC_MSG_CHECKING([python linker flags])
|
AC_MSG_CHECKING([python linker flags])
|
||||||
PYTHON_LIBS=`$PYTHON_CONFIG --ldflags`
|
PYTHON_LIBS=`$PYTHON_CONFIG --ldflags $PY_EMBED`
|
||||||
AC_MSG_RESULT([$PYTHON_LIBS])
|
AC_MSG_RESULT([$PYTHON_LIBS])
|
||||||
])
|
])
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user