configure.in: Simplified configuration of the Java plugin.
authorFlorian Forster <octo@huhu.verplant.org>
Fri, 8 May 2009 14:55:05 +0000 (16:55 +0200)
committerFlorian Forster <octo@huhu.verplant.org>
Fri, 8 May 2009 14:55:05 +0000 (16:55 +0200)
The configure script now uses `find' to search the JAVA_HOME directory for the
files `jni.h', `jni_md.h', and `libjvm.so'. Not nice, but I don't know how else
to solve this problem.

configure.in

index 115ee21..3770910 100644 (file)
@@ -1489,18 +1489,34 @@ if test "x$with_java" = "xyes"
 then
        if test -d "$with_java_home"
        then
-               if test -d "$with_java_home/include"
+               AC_MSG_CHECKING([for jni.h])
+               TMPDIR=`find -L "$with_java_home" -name jni.h -exec 'dirname' '{}' ';' | head -n 1`
+               if test "x$TMPDIR" != "x"
                then
-                       JAVA_CPPFLAGS="$JAVA_CPPFLAGS -I$with_java_home/include"
+                       AC_MSG_RESULT([found in $TMPDIR])
+                       JAVA_CPPFLAGS="$JAVA_CPPFLAGS -I$TMPDIR"
                else
-                       JAVA_CPPFLAGS="$JAVA_CPPFLAGS -I$with_java_home"
+                       AC_MSG_RESULT([not found])
                fi
-               
-               if test -d "$with_java_home/lib"
+
+               AC_MSG_CHECKING([for jni_md.h])
+               TMPDIR=`find -L "$with_java_home" -name jni_md.h -exec 'dirname' '{}' ';' | head -n 1`
+               if test "x$TMPDIR" != "x"
+               then
+                       AC_MSG_RESULT([found in $TMPDIR])
+                       JAVA_CPPFLAGS="$JAVA_CPPFLAGS -I$TMPDIR"
+               else
+                       AC_MSG_RESULT([not found])
+               fi
+
+               AC_MSG_CHECKING([for libjvm.so])
+               TMPDIR=`find -L "$with_java_home" -name libjvm.so -exec 'dirname' '{}' ';' | head -n 1`
+               if test "x$TMPDIR" != "x"
                then
-                       JAVA_LDFLAGS="$JAVA_LDFLAGS -L$with_java_home/lib"
+                       AC_MSG_RESULT([found in $TMPDIR])
+                       JAVA_LDFLAGS="$JAVA_LDFLAGS -L$TMPDIR"
                else
-                       JAVA_LDFLAGS="$JAVA_LDFLAGS -L$with_java_home"
+                       AC_MSG_RESULT([not found])
                fi
        else if test "x$with_java_home" != "x"
        then