Hi,
I was wondering why the java plugin api class files are published under
share/collectd/java. Ideally, a java-plugin.jar file containing all the class
files should get published rather than the individual class files.
Additionally, the jar files IMO should get published to the lib directory where
the so files are sitting rather than the share directory.
Same holds true for jmx class files as well (probably jmx.jar?).
I could work on this if everyone is okay with it.
Regards
Amit
java-build-stamp: org/collectd/api/*.java
$(JAVAC) -d "." "$(srcdir)/org/collectd/api"/*.java
$(JAVAC) -d "." "$(srcdir)/org/collectd/java"/*.java
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
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
clean-local:
rm -f "org/collectd/api"/*.class
rm -f "org/collectd/java"/*.class
with_java_cflags=""
with_java_libs=""
JAVAC="$JAVAC"
with_java_cflags=""
with_java_libs=""
JAVAC="$JAVAC"
AC_ARG_WITH(java, [AS_HELP_STRING([--with-java@<:@=PREFIX@:>@], [Path to Java home.])],
[
if test "x$withval" = "xno"
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
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])
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
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"
SAVE_CPPFLAGS="$CPPFLAGS"
SAVE_CFLAGS="$CFLAGS"
#<Plugin "java">
# JVMArg "-verbose:jni"
#<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">
#
# LoadPlugin "org.collectd.java.Foobar"
# <Plugin "org.collectd.java.Foobar">