[Libreoffice-commits] core.git: configure.ac

Samuel Thibault sthibault at hypra.fr
Fri Mar 2 14:48:37 UTC 2018


 configure.ac |   37 +++++++++++++++++++------------------
 1 file changed, 19 insertions(+), 18 deletions(-)

New commits:
commit c2496c09e15625de93d3ed883d3219fdd9d90360
Author: Samuel Thibault <sthibault at hypra.fr>
Date:   Thu Mar 1 11:11:02 2018 +0100

    lxml: Do not build on systems without python dev headers
    
    Building our internal lxml requires python development headers, which we
    don't otherwise need if runtime python support is not enabled.
    
    We should also not build it when cross-compiling since we only need it on
    the build system.
    
    Change-Id: I63df25ff9f5932ca537dbbd6937b78d153c11d66
    Reviewed-on: https://gerrit.libreoffice.org/50560
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>

diff --git a/configure.ac b/configure.ac
index 7da2bfd87a8a..59df9857b616 100644
--- a/configure.ac
+++ b/configure.ac
@@ -8141,6 +8141,13 @@ if test $enable_python = system; then
                AC_MSG_ERROR([no usable python found])])
         test -n "$PYTHON_CFLAGS" && break
     fi
+
+    dnl Check if the headers really work
+    save_CPPFLAGS="$CPPFLAGS"
+    CPPFLAGS="$CPPFLAGS $PYTHON_CFLAGS"
+    AC_CHECK_HEADER(Python.h)
+    CPPFLAGS="$save_CPPFLAGS"
+
     # let the PYTHON_FOR_BUILD match the same python installation that
     # provides PYTHON_CFLAGS/PYTHON_LDFLAGS for pyuno, which should be
     # better for PythonTests.
@@ -8153,11 +8160,9 @@ if test -z "$PYTHON_FOR_BUILD"; then
             AC_MSG_WARN([No system-provided python lxml, gla11y will only report widget classes and ids])
             ;;
         *)
-	    if test "$OS" != "IOS"; then
-	        if test "$enable_ios_simulator" != "yes"; then
-            	    BUILD_TYPE="$BUILD_TYPE LXML"
-	        fi
-	    fi
+            if test "$cross_compiling" != yes ; then
+                BUILD_TYPE="$BUILD_TYPE LXML"
+            fi
             ;;
     esac
 else
@@ -8170,12 +8175,12 @@ else
                 AC_MSG_RESULT([no, gla11y will only report widget classes and ids])
                 ;;
             *)
-	        if test "$OS" != "IOS"; then
-	            if test "$enable_ios_simulator" != "yes"; then
-            	        BUILD_TYPE="$BUILD_TYPE LXML"
-                        AC_MSG_RESULT([no, using internal lxml])
-	            fi
-	        fi
+                if test "$cross_compiling" != yes -a "x$ac_cv_header_Python_h" = "xyes"; then
+                    BUILD_TYPE="$BUILD_TYPE LXML"
+                    AC_MSG_RESULT([no, using internal lxml])
+                else
+                    AC_MSG_RESULT([no, and system does not provide python development headers, gla11y will only report widget classes and ids])
+                fi
                 ;;
         esac
     fi
@@ -8186,13 +8191,9 @@ case $enable_python in
 system)
     SYSTEM_PYTHON=TRUE
 
-    dnl Check if the headers really work
-    save_CPPFLAGS="$CPPFLAGS"
-    CPPFLAGS="$CPPFLAGS $PYTHON_CFLAGS"
-    AC_CHECK_HEADER(Python.h, [],
-       [AC_MSG_ERROR([Python headers not found. You probably want to set both the PYTHON_CFLAGS and PYTHON_LIBS environment variables.])],
-       [])
-    CPPFLAGS="$save_CPPFLAGS"
+    if test "x$ac_cv_header_Python_h" != "xyes"; then
+       AC_MSG_ERROR([Python headers not found. You probably want to set both the PYTHON_CFLAGS and PYTHON_LIBS environment variables.])
+    fi
 
     AC_LANG_PUSH(C)
     CFLAGS="$CFLAGS $PYTHON_CFLAGS"


More information about the Libreoffice-commits mailing list