summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoe Buck <jbbuck@gmail.com>2013-09-12 13:14:28 -0700
committerJoe Buck <jbbuck@gmail.com>2013-09-16 22:02:59 -0700
commitcd6f4bcdae8536458235477a066318cacb1c3d3e (patch)
treebd10289e2582479a844546dbe985656706411e7d
parent0be2c87a54beb2385fd008ae58419b3cc37fe09a (diff)
downloadceph-cd6f4bcdae8536458235477a066318cacb1c3d3e.tar.gz
Use a loop for testing jdk paths
Loop through a list of sensible default locations for a JDK, stopping if a workable JDK is found. Also, add support for CentOS' default java location. Signed-off-by: Joe Buck <jbbuck@gmail.com>
-rw-r--r--configure.ac20
1 files changed, 12 insertions, 8 deletions
diff --git a/configure.ac b/configure.ac
index d7f96fd11f4..e8747a6de94 100644
--- a/configure.ac
+++ b/configure.ac
@@ -333,14 +333,18 @@ if test "x$enable_cephfs_java" = "xyes"; then
# setup defaults for Debian default-jdk package (without --with-jdk-dir)
AS_IF([test -z "$with_jdk_dir"], [
- # This works with Debian's default-jdk package
- dir='/usr/lib/jvm/default-java/'
- javac_prog=`find $dir -name javac | head -n 1`
- AS_IF([test -x "$javac_prog"], [
- EXTRA_JDK_BIN_DIR=`dirname $javac_prog`])
- jnih=`find $dir -name jni.h | head -n 1`
- AS_IF([test -r "$jnih"], [
- EXTRA_JDK_INC_DIR=`dirname $jnih`])])
+ # This works with Debian's and CentOS' default-jdk package
+ for dir in '/usr/lib/jvm/default-java/' '/usr/lib/jvm/java/' ; do
+ # only test if a suitable path has not yet been found
+ AS_IF([test "$EXTRA_JDK_BIN_DIR" == ""], [
+ AS_IF([test -x "$javac_prog"], [
+ EXTRA_JDK_BIN_DIR=`dirname $javac_prog`])
+ jnih=`find $dir -name jni.h | head -n 1`
+ AS_IF([test -r "$jnih"], [
+ EXTRA_JDK_INC_DIR=`dirname $jnih`])
+ ])
+ done
+ ])
# cephfs_java_test only makes sense if java is already turned on
# setup CLASSPATH for Debian default junit4.jar package