java-build-stamp: org/collectd/api/*.java
$(JAVAC) -d "." "$(srcdir)/org/collectd/api"/*.java
$(JAVAC) -d "." "$(srcdir)/org/collectd/java"/*.java
+ mkdir -p .libs
+ $(JAR) cf .libs/collectd-api.jar "org/collectd/api"/*.class
+ $(JAR) cf .libs/generic-jmx.jar "org/collectd/java"/*.class
touch "$@"
all-local: java-build-stamp
install-exec-local: java-build-stamp
- mkdir -p "$(DESTDIR)$(pkgdatadir)/java/org/collectd/api"
- $(INSTALL) -m 644 "org/collectd/api"/*.class \
- "$(DESTDIR)$(pkgdatadir)/java/org/collectd/api/"
- mkdir -p "$(DESTDIR)$(pkgdatadir)/java/org/collectd/java"
- $(INSTALL) -m 644 "org/collectd/java"/*.class \
- "$(DESTDIR)$(pkgdatadir)/java/org/collectd/java/"
+ mkdir -p "$(DESTDIR)$(pkgdatadir)/java"
+ $(INSTALL) -m 644 .libs/collectd-api.jar \
+ "$(DESTDIR)$(pkgdatadir)/java"
+ $(INSTALL) -m 644 .libs/generic-jmx.jar \
+ "$(DESTDIR)$(pkgdatadir)/java"
clean-local:
rm -f "org/collectd/api"/*.class
rm -f "org/collectd/java"/*.class
+ rm -f .libs
rm -f "java-build-stamp"
with_java_cflags=""
with_java_libs=""
JAVAC="$JAVAC"
+JAR="$JAR"
AC_ARG_WITH(java, [AS_HELP_STRING([--with-java@<:@=PREFIX@:>@], [Path to Java home.])],
[
if test "x$withval" = "xno"
AC_MSG_RESULT([not found])
fi
fi
+ if test "x$JAR" = "x"
+ then
+ AC_MSG_CHECKING([for jar])
+ TMPDIR=`find "$with_java_home" -name jar -type f | head -n 1`
+ if test "x$TMPDIR" != "x"
+ then
+ JAR="$TMPDIR"
+ AC_MSG_RESULT([$JAR])
+ else
+ AC_MSG_RESULT([not found])
+ fi
+ fi
else if test "x$with_java_home" != "x"
then
AC_MSG_WARN([JAVA_HOME: No such directory: $with_java_home])
then
with_java="no (javac not found)"
fi
+if test "x$JAR" = "x"
+then
+ with_jar_path="$PATH"
+ if test "x$with_java_home" != "x"
+ then
+ with_jar_path="$with_java_home:with_jar_path"
+ if test -d "$with_java_home/bin"
+ then
+ with_jar_path="$with_jar_home/bin:with_jar_path"
+ fi
+ fi
+
+ AC_PATH_PROG(JAR, jar, [], "$with_jar_path")
+fi
+if test "x$JAR" = "x"
+then
+ with_java="no (jar not found)"
+fi
SAVE_CPPFLAGS="$CPPFLAGS"
SAVE_CFLAGS="$CFLAGS"
#<Plugin "java">
# JVMArg "-verbose:jni"
-# JVMArg "-Djava.class.path=@prefix@/share/collectd/java"
+# JVMArg "-Djava.class.path=@prefix@/share/collectd/java/collectd-api.jar"
#
# LoadPlugin "org.collectd.java.Foobar"
# <Plugin "org.collectd.java.Foobar">