-EXTRA_DIST = java/org/collectd/java/*.java java/org/collectd/api/*.java \
- perl/Collectd.pm perl/Makefile.PL perl/Collectd/Makefile.PL \
+SUBDIRS =
+
+if BUILD_WITH_JAVA
+SUBDIRS += java
+endif
+
+EXTRA_DIST = perl/Collectd.pm perl/Makefile.PL perl/Collectd/Makefile.PL \
perl/Collectd/Unixsock.pm
all-local: @PERL_BINDINGS@
--- /dev/null
+EXTRA_DIST = org/collectd/api/CollectdConfigInterface.java \
+ org/collectd/api/CollectdFlushInterface.java \
+ org/collectd/api/CollectdInitInterface.java \
+ org/collectd/api/Collectd.java \
+ org/collectd/api/CollectdLogInterface.java \
+ org/collectd/api/CollectdMatchFactoryInterface.java \
+ org/collectd/api/CollectdMatchInterface.java \
+ org/collectd/api/CollectdNotificationInterface.java \
+ org/collectd/api/CollectdReadInterface.java \
+ org/collectd/api/CollectdShutdownInterface.java \
+ org/collectd/api/CollectdTargetFactoryInterface.java \
+ org/collectd/api/CollectdTargetInterface.java \
+ org/collectd/api/CollectdWriteInterface.java \
+ org/collectd/api/DataSet.java \
+ org/collectd/api/DataSource.java \
+ org/collectd/api/Notification.java \
+ org/collectd/api/OConfigItem.java \
+ org/collectd/api/OConfigValue.java \
+ org/collectd/api/PluginData.java \
+ org/collectd/api/ValueList.java
+
+java-build-stamp: org/collectd/api/*.java
+ $(JAVAC) -d "$(builddir)" "$(srcdir)/org/collectd/api"/*.java
+ touch "$@"
+
+all-local: java-build-stamp
+
+install-exec-local: java-build-stamp
+ mkdir -p "$(pkglibdir)/java/org/collectd/api"
+ $(INSTALL) -m 644 "$(builddir)/org/collectd/api"/*.class \
+ "$(DESTDIR)$(pkglibdir)/java/org/collectd/api/"
+
+clean-local:
+ rm -f "$(builddir)/org/collectd/api"/*.class
+ rm -f "$(builddir)/java-build-stamp"
with_java_vmtype="client"
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"
else
AC_MSG_RESULT([not found])
fi
+
+ if test "x$JAVAC" = "x"
+ then
+ AC_MSG_CHECKING([for javac])
+ TMPDIR=`find -L "$with_java_home" -name javac | head -n 1`
+ if test "x$TMPDIR" != "x"
+ then
+ JAVAC="$TMPDIR"
+ AC_MSG_RESULT([$JAVAC])
+ 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
AC_MSG_NOTICE([Building with JAVA_LDFLAGS set to: $JAVA_LDFLAGS])
fi
+if test "x$JAVAC" = "x"
+then
+ with_javac_path="$PATH"
+ if test "x$with_java_home" != "x"
+ then
+ with_javac_path="$with_java_home:with_javac_path"
+ if test -d "$with_java_home/bin"
+ then
+ with_javac_path="$with_java_home/bin:with_javac_path"
+ fi
+ fi
+
+ AC_PATH_PROG(JAVAC, javac, [], "$with_javac_path")
+fi
+if test "x$JAVAC" = "x"
+then
+ with_java="no (javac not found)"
+fi
SAVE_CPPFLAGS="$CPPFLAGS"
SAVE_CFLAGS="$CFLAGS"
AC_CONFIG_FILES(src/libcollectdclient/lcc_features.h)
-AC_OUTPUT(Makefile src/Makefile src/collectd.conf src/libiptc/Makefile src/libcollectdclient/Makefile src/libcollectdclient/libcollectdclient.pc src/liboconfig/Makefile bindings/Makefile)
+AC_OUTPUT(Makefile src/Makefile src/collectd.conf src/libiptc/Makefile src/libcollectdclient/Makefile src/libcollectdclient/libcollectdclient.pc src/liboconfig/Makefile bindings/Makefile bindings/java/Makefile)
if test "x$with_librrd" = "xyes" \
&& test "x$librrd_threadsafe" != "xyes"