summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan-Marek Glogowski <glogow@fbihome.de>2021-05-17 16:21:01 +0200
committerJan-Marek Glogowski <glogow@fbihome.de>2021-05-24 17:47:50 +0200
commit53954f2e31b60da9da0671f93d15d55e2ce1d043 (patch)
tree739a68ba51a228a403de256014a4e6b1cdeac286
parent2f972092f28a89402a6f83e572ff7d2b5c0e05b9 (diff)
Make sure Python is in build for the cross-toolset
Change-Id: I4c25f572cb942759990eaacb7ca261c78831ed40
-rw-r--r--configure.ac45
-rw-r--r--solenv/gbuild/extensions/pre_BuildTools.mk1
2 files changed, 25 insertions, 21 deletions
diff --git a/configure.ac b/configure.ac
index 0fdcc9ea20c9..cf311c773034 100644
--- a/configure.ac
+++ b/configure.ac
@@ -9481,28 +9481,26 @@ if test "$build_os" != "cygwin" -a "$enable_python" != fully-internal; then
fi
fi
fi
-AC_SUBST(PYTHON_FOR_BUILD)
# Checks for Python to use for Pyuno
AC_MSG_CHECKING([which Python to use for Pyuno])
case "$enable_python" in
no|disable)
- if test -z $PYTHON_FOR_BUILD; then
+ if test -z "$PYTHON_FOR_BUILD" -a "$cross_compiling" != yes; then
# Python is required to build LibreOffice. In theory we could separate the build-time Python
# requirement from the choice whether to include Python stuff in the installer, but why
# bother?
- if test "$cross_compiling" = yes; then
- enable_python=system
- else
- AC_MSG_ERROR([Python is required at build time.])
- fi
+ AC_MSG_ERROR([Python is required at build time.])
fi
enable_python=no
AC_MSG_RESULT([none])
;;
""|yes|auto)
- if test "$DISABLE_SCRIPTING" = TRUE -a -n "$PYTHON_FOR_BUILD"; then
- AC_MSG_RESULT([no, overridden by --disable-scripting])
+ if test "$DISABLE_SCRIPTING" = TRUE; then
+ if test -z "$PYTHON_FOR_BUILD" -a "$cross_compiling" != yes; then
+ AC_MSG_ERROR([Python support can't be disabled without cross-compiling or a system python.])
+ fi
+ AC_MSG_RESULT([none, overridden by --disable-scripting])
enable_python=no
elif test $build_os = cygwin; then
dnl When building on Windows we don't attempt to use any installed
@@ -9644,6 +9642,22 @@ if test "$with_lxml" != no; then
fi
fi
+if test \( "$cross_compiling" = yes -a -z "$PYTHON_FOR_BUILD" \) -o "$enable_python" = internal; then
+ SYSTEM_PYTHON=
+ PYTHON_VERSION_MAJOR=3
+ PYTHON_VERSION_MINOR=8
+ PYTHON_VERSION=${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}.8
+ if ! grep -q -i python.*${PYTHON_VERSION} ${SRC_ROOT}/download.lst; then
+ AC_MSG_ERROR([PYTHON_VERSION ${PYTHON_VERSION} but no matching file in download.lst])
+ fi
+ AC_DEFINE_UNQUOTED([PYTHON_VERSION_STRING], [L"${PYTHON_VERSION}"])
+
+ # Embedded Python dies without Home set
+ if test "$HOME" = ""; then
+ export HOME=""
+ fi
+fi
+
dnl By now enable_python should be "system", "internal" or "no"
case $enable_python in
system)
@@ -9670,22 +9684,10 @@ int main(int argc, char **argv) {
;;
internal)
- SYSTEM_PYTHON=
- PYTHON_VERSION_MAJOR=3
- PYTHON_VERSION_MINOR=8
- PYTHON_VERSION=${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}.8
- if ! grep -q -i python.*${PYTHON_VERSION} ${SRC_ROOT}/download.lst; then
- AC_MSG_ERROR([PYTHON_VERSION ${PYTHON_VERSION} but no matching file in download.lst])
- fi
- AC_DEFINE_UNQUOTED([PYTHON_VERSION_STRING], [L"${PYTHON_VERSION}"])
BUILD_TYPE="$BUILD_TYPE PYTHON"
if test "$OS" = LINUX -o "$OS" = WNT ; then
BUILD_TYPE="$BUILD_TYPE LIBFFI"
fi
- # Embedded Python dies without Home set
- if test "$HOME" = ""; then
- export HOME=""
- fi
;;
no)
DISABLE_PYTHON=TRUE
@@ -9699,6 +9701,7 @@ esac
AC_SUBST(DISABLE_PYTHON)
AC_SUBST(SYSTEM_PYTHON)
AC_SUBST(PYTHON_CFLAGS)
+AC_SUBST(PYTHON_FOR_BUILD)
AC_SUBST(PYTHON_LIBS)
AC_SUBST(PYTHON_VERSION)
AC_SUBST(PYTHON_VERSION_MAJOR)
diff --git a/solenv/gbuild/extensions/pre_BuildTools.mk b/solenv/gbuild/extensions/pre_BuildTools.mk
index 471a68a6b0a6..2a53de0f84df 100644
--- a/solenv/gbuild/extensions/pre_BuildTools.mk
+++ b/solenv/gbuild/extensions/pre_BuildTools.mk
@@ -41,6 +41,7 @@ gb_BUILD_TOOLS_executables = \
$(if $(filter WNT,$(OS)),$(call gb_Helper_optional_for_host,DESKTOP,lngconvex)) \
gb_BUILD_TOOLS_executables_extern = \
+ python \
xsltproc \
gb_BUILD_TOOLS = \