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

Jan-Marek Glogowski (via logerrit) logerrit at kemper.freedesktop.org
Sun Oct 4 20:19:37 UTC 2020


 configure.ac |   25 +++++++++++++++++--------
 1 file changed, 17 insertions(+), 8 deletions(-)

New commits:
commit 856ce2a5b64a6f7a1ea3a6ab0ee2bb5932743566
Author:     Jan-Marek Glogowski <glogow at fbihome.de>
AuthorDate: Fri Oct 2 14:56:54 2020 +0200
Commit:     Jan-Marek Glogowski <glogow at fbihome.de>
CommitDate: Sun Oct 4 22:18:54 2020 +0200

    Don't forward JDK home option to the cross-build
    
    The configure flags on the command line always specify the host
    config, so it doesn't make any sense to forward this setting in
    case of a cross build. You can add a --with-jdk-home=... to the
    --with-build-platform-configure-options flags, if the build
    config finds the wrong build JDK. Also add this info to the
    --with-jdk-home help.
    
    For convenience (and because I don't want to adapt tinderboxes
    again), this forwards the host JDK to the build for Android. And
    explicitly disables Java for iOS build tools, as it used to be.
    
    The whole --with-java handling should probably be removed in
    favour of the --with-jdk-home. Do we have a real use case, where
    we just need the Java interpreter but not the JDK (ok - the
    document validators come to mind, but then you could also just
    simply provide a JDK...)?
    
    Change-Id: I328a15c090001bb025f4ba66d13b0cd020991fa9
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103878
    Tested-by: Jenkins
    Reviewed-by: Jan-Marek Glogowski <glogow at fbihome.de>

diff --git a/configure.ac b/configure.ac
index 700ca2908b2c..7993b60cdab1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2120,7 +2120,9 @@ AC_ARG_WITH(jdk-home,
     AS_HELP_STRING([--with-jdk-home=<absolute path to JDK home>],
         [If you have installed JDK 9 or later on your system please supply the
          path here. Note that this is not the location of the java command but the
-         location of the entire distribution.]),
+         location of the entire distribution. In case of cross-compiling, this
+         is the JDK of the host os. Use --with-build-platform-configure-options
+         to point to a different build platform JDK.]),
 ,)
 
 AC_ARG_WITH(help,
@@ -4967,24 +4969,31 @@ if test "$cross_compiling" = "yes"; then
     fi
     test -n "$PKG_CONFIG_FOR_BUILD" && export PKG_CONFIG="$PKG_CONFIG_FOR_BUILD"
     cd CONF-FOR-BUILD
+
     sub_conf_opts=""
     test -n "$enable_ccache" && sub_conf_opts="$sub_conf_opts --enable-ccache=$enable_ccache"
     test -n "$with_ant_home" && sub_conf_opts="$sub_conf_opts --with-ant-home=$with_ant_home"
     test "$with_junit" = "no" && sub_conf_opts="$sub_conf_opts --without-junit"
     if test -n "$ENABLE_JAVA"; then
-        if test "$_os" != "iOS" -a "$_os" != "Android"; then
-            if ! echo "$with_build_platform_configure_options" | grep -q -- '--with-jdk-home='; then
-                AC_MSG_ERROR([Missing build JDK (see --with-build-platform-configure-options, --with-jdk-home and use 'cygpath -ms' on Windows)!])
-            fi
-        else
+        case "$_os" in
+        iOS) sub_conf_opts="$sub_conf_opts --without-java" ;; # force it off, like it used to be
+        Android)
+            # Hack for Android - the build doesn't need a host JDK, so just forward to build for convenience
             test -n "$with_jdk_home" && sub_conf_opts="$sub_conf_opts --with-jdk-home=$with_jdk_home"
-        fi
+            ;;
+        *)
+            if test -z "$with_jdk_home"; then
+                AC_MSG_ERROR([Missing host JDK! This can't be detected for the build OS, so you have to specify it with --with-jdk-home.])
+            fi
+            ;;
+        esac
     else
         sub_conf_opts="$sub_conf_opts --without-java"
     fi
     test -n "$TARFILE_LOCATION" && sub_conf_opts="$sub_conf_opts --with-external-tar=$TARFILE_LOCATION"
     test "$with_system_icu_for_build" = "yes" -o "$with_system_icu_for_build" = "force" && sub_conf_opts="$sub_conf_opts --with-system-icu"
     sub_conf_opts="$sub_conf_opts $with_build_platform_configure_options"
+
     # Don't bother having configure look for stuff not needed for the build platform anyway
     ./configure \
         --build="$build_alias" \
@@ -7863,11 +7872,11 @@ if test "$ENABLE_JAVA" != "" -a "$cross_compiling" != "yes"; then
                 JAVA_CLASSPATH_NOT_SET=TRUE
             fi
 
-            AC_MSG_RESULT([found (JDK $_jdk)])
             JAVA_HOME=`echo $JAVAINTERPRETER | $SED -n "s,//*bin//*java,,p"`
             if test "$_os" = "WINNT"; then
                 JAVA_HOME=`echo $JAVA_HOME | $SED "s,\.[[eE]][[xX]][[eE]]$,,"`
             fi
+            AC_MSG_RESULT([found $JAVA_HOME (JDK $_jdk)])
 
             # set to limit VM usage for JunitTests
             JAVAIFLAGS=-Xmx64M


More information about the Libreoffice-commits mailing list