diff options
author | Wol <anthony@youngman.org.uk> | 2016-03-01 21:08:03 +0000 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2016-03-03 13:26:43 +0000 |
commit | 509bc5e5cf8129d07b5d8cf22d4bfe9c968303c6 (patch) | |
tree | c542a12c7d0e610dd54cda646ac5b6b7d5e11834 /configure.ac | |
parent | f345a2c52af0333b46b4b74e686883c8cb9ffab4 (diff) |
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@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 7 |
1 files changed, 6 insertions, 1 deletions
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 |