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

Wol anthony at youngman.org.uk
Thu Mar 3 13:27:05 UTC 2016


 configure.ac |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

New commits:
commit 509bc5e5cf8129d07b5d8cf22d4bfe9c968303c6
Author: Wol <anthony at youngman.org.uk>
Date:   Tue Mar 1 21:08:03 2016 +0000

    Fix java home detection on gentoo
    
    On gentoo (and some other distros?) /usr/bin/javac points at a script
    that chooses the version of java to run. So when configure resolves
    the link it doesn't end up where it expects to be. This mod detects
    this situation, clears java_home, and lets it fall through to the next
    test which completes successfully.
    
    Change-Id: I7400ac06485475203abd584f60aed7eca81c7f90
    Reviewed-on: https://gerrit.libreoffice.org/22847
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noelgrandin at gmail.com>

diff --git a/configure.ac b/configure.ac
index b6c14a0..32ecfcc 100644
--- a/configure.ac
+++ b/configure.ac
@@ -7117,7 +7117,7 @@ if test "$ENABLE_JAVA" != ""; then
             add_warning "JAVA_HOME is set to /usr - this is very likely to be incorrect"
             add_warning "if this is the case, please inform the correct JAVA_HOME with --with-jdk-home"
         fi
-        dnl now that we have the path to the real javac, make a JAVA_HOME out of it..
+        dnl now that we probably have the path to the real javac, make a JAVA_HOME out of it..
         if test "$JAVA_HOME" != "/usr"; then
             if test "$_os" = "Darwin" -o "$OS_FOR_BUILD" = MACOSX; then
                 dnl Leopard returns a non-suitable path with readlink - points to "Current" only
@@ -7126,6 +7126,11 @@ if test "$ENABLE_JAVA" != ""; then
                 JAVA_HOME=$(echo $JAVA_HOME | $SED -e s,/CurrentJDK/Commands/javac$,/CurrentJDK/Home,)
             else
                 JAVA_HOME=$(echo $JAVA_HOME | $SED -e s,/bin/javac$,,)
+                dnl check that we have a directory as certain distros eg gentoo substitute javac for a script
+                dnl that checks which version to run
+                if test -f "$JAVA_HOME"; then
+                    JAVA_HOME=""; # set JAVA_HOME to null if it's a file
+                fi
             fi
         fi
     fi


More information about the Libreoffice-commits mailing list