41 lines
1.3 KiB
Diff
41 lines
1.3 KiB
Diff
--- m4/python.m4
|
|
+++ m4/python.m4
|
|
@@ -43,17 +43,9 @@
|
|
[AC_REQUIRE([AM_PATH_PYTHON])
|
|
AC_MSG_CHECKING(for headers required to compile python extensions)
|
|
dnl deduce PYTHON_INCLUDES
|
|
-am_python_print_includes="\
|
|
-from distutils import sysconfig as sc
|
|
-incldirs = [[]]
|
|
-
|
|
-for d in sc.get_config_var('INCLDIRSTOMAKE').split():
|
|
- incldirs.append('-I' + d)
|
|
-
|
|
-print(' '.join(incldirs))
|
|
-"
|
|
+xbps_sysroot=`$CC --print-sysroot`
|
|
if test "x$PYTHON_INCLUDES" == x; then
|
|
- PYTHON_INCLUDES=`$PYTHON -c "$am_python_print_includes"`
|
|
+ PYTHON_INCLUDES=`"$xbps_sysroot/$PYTHON-config" --includes`
|
|
fi
|
|
AC_SUBST(PYTHON_INCLUDES)
|
|
dnl check if the headers exist:
|
|
@@ -74,16 +66,11 @@
|
|
[AC_REQUIRE([AM_CHECK_PYTHON_HEADERS])
|
|
AC_MSG_CHECKING(for libraries required to embed python)
|
|
dnl deduce PYTHON_LIBS
|
|
-am_python_print_libs="\
|
|
-from distutils import sysconfig as sc
|
|
-libs = '-L' + sc.get_config_var('LIBDIR').strip()
|
|
-libs += ' ' + sc.get_config_var('BLDLIBRARY')
|
|
-print(libs)"
|
|
am_python_print_lib_loc="\
|
|
from distutils import sysconfig as sc
|
|
print(sc.get_config_var('LIBDIR'))"
|
|
if test "x$PYTHON_LIBS" == x; then
|
|
- PYTHON_LIBS=`$PYTHON -c "$am_python_print_libs"`
|
|
+ PYTHON_LIBS=`"$xbps_sysroot/$PYTHON-config" --ldflags --embed`
|
|
fi
|
|
if test "x$PYTHON_LIB_LOC" == x; then
|
|
PYTHON_LIB_LOC=`$PYTHON -c "$am_python_print_lib_loc"`
|