From: Florian Forster Date: Fri, 8 May 2009 14:55:05 +0000 (+0200) Subject: configure.in: Simplified configuration of the Java plugin. X-Git-Tag: collectd-4.7.0~16 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=33163ee;p=collectd.git configure.in: Simplified configuration of the Java plugin. 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. --- diff --git a/configure.in b/configure.in index 115ee21d..3770910f 100644 --- a/configure.in +++ b/configure.in @@ -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