summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorSamuel Thibault <sthibault@hypra.fr>2018-03-01 11:11:02 +0100
committerThorsten Behrens <Thorsten.Behrens@CIB.de>2018-03-02 15:48:08 +0100
commitc2496c09e15625de93d3ed883d3219fdd9d90360 (patch)
tree8eadf328434b36031b86256b518a270643ebb038 /configure.ac
parent0ab136c65ee184bf1cd790ee7347cd572fdf56aa (diff)
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@libreoffice.org> Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac37
1 files changed, 19 insertions, 18 deletions
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"