[Libreoffice] Robert Nagy: Problems with your python library patch

Robert Nagy robert at openbsd.org
Wed Apr 20 04:18:19 PDT 2011

After discussing this with Michael it seems the best solution
would be to use python-config, it even makes configure.in smaller ;)
Please test it with python3 too.

diff --git a/configure.in b/configure.in
index 470aa39..4dd7a4e 100755
--- a/configure.in
+++ b/configure.in
@@ -4107,12 +4107,9 @@ elif test -n "$with_system_python" -o -n "$with_system_libs" && \
-   python_include=`$PYTHON -c "import distutils.sysconfig; print(distutils.sysconfig.get_config_var('INCLUDEPY'));"`
-   python_version=`$PYTHON -c "import distutils.sysconfig; print(distutils.sysconfig.get_config_var('VERSION'));"`
-   python_libs=`$PYTHON -c "import distutils.sysconfig; print(distutils.sysconfig.get_config_var('LIBS'));"`
-   python_libdir=`$PYTHON -c "import distutils.sysconfig; print(distutils.sysconfig.get_config_var('LIBDIR'));"`
-   PYTHON_CFLAGS="-I$python_include"
-   PYTHON_LIBS="-L$python_libdir -lpython$python_version $python_libs"
+   python_config="$PYTHON-config"
+   PYTHON_CFLAGS=`$python_config --includes`
+   PYTHON_LIBS=`$python_config --ldflags`
 if test "$with_system_python" = "yes" ; then

More information about the LibreOffice mailing list