summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--configure.ac7
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