From 509bc5e5cf8129d07b5d8cf22d4bfe9c968303c6 Mon Sep 17 00:00:00 2001 From: Wol Date: Tue, 1 Mar 2016 21:08:03 +0000 Subject: 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 Reviewed-by: Noel Grandin --- configure.ac | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index b6c14a0a9125..32ecfcc72aa5 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 -- cgit