]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
Use a loop for testing jdk paths
authorJoe Buck <jbbuck@gmail.com>
Thu, 12 Sep 2013 20:14:28 +0000 (13:14 -0700)
committerJoe Buck <jbbuck@gmail.com>
Tue, 17 Sep 2013 05:02:59 +0000 (22:02 -0700)
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>
configure.ac

index d7f96fd11f43598adabb9530314cb5483f9e222e..e8747a6de94426d0bfd3d70b518a260ccda034b0 100644 (file)
@@ -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