aboutsummaryrefslogtreecommitdiffstats
path: root/acinclude.m4
diff options
context:
space:
mode:
authorAndrew John Hughes <[email protected]>2010-11-26 15:21:56 +0000
committerAndrew John Hughes <[email protected]>2010-11-26 15:21:56 +0000
commitb57a8065fa00e77fec46f68df1735cb4ccc5e385 (patch)
tree981f508c45f62cfa2dd36c1c17315ff626a94e74 /acinclude.m4
parente0bd7b0b44090ee4bee28d2f74d0e3559fb75857 (diff)
Add documentation build support.
2010-11-25 Andrew John Hughes <[email protected]> * Makefile.am: (JDK_UPDATE_VERSION): Document. (NETX_PKGS): NetX packages for documentation. (PLUGIN_PKGS): Same for the plugin. (JAVADOC_OPTS): Common options passed to javadoc. (JAVADOC_MEM_OPTS): Memory options passed to JVM if possible (taken from the previous OpenJDK build). (all-local): Depend on docs.stamp. (clean-local): Add clean-docs. (.PHONY): Add clean-docs, clean-plugin-docs, clean-netx-docs. (install-exec-local): Install the documentation if enabled. (docs): Meta-dependency for netx-docs and plugin-docs. (clean-docs): Likewise but for clean targets. (netx-docs): Build documentation for the NetX API. (clean-netx-docs): Remove the NetX docs. (plugin-docs): Build documentation for the plugin API. (clean-plugin-docs): Likewise. (bootstrap-directory): Link to javadoc binary. * acinclude.m4: (IT_FIND_JAVADOC): Find a javadoc binary, first checking user input, then the JDK and the path for 'javadoc' and 'gjdoc'. Also sets JAVADOC_SUPPORTS_J_OPTIONS if it does. * configure.ac: Call IT_FIND_JAVADOC.
Diffstat (limited to 'acinclude.m4')
-rw-r--r--acinclude.m462
1 files changed, 62 insertions, 0 deletions
diff --git a/acinclude.m4 b/acinclude.m4
index 614d2ce..67ae380 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -543,3 +543,65 @@ AC_DEFUN_ONCE([IT_FIND_JAVA],
AC_MSG_RESULT(${JAVA})
AC_SUBST(JAVA)
])
+
+AC_DEFUN([IT_FIND_JAVADOC],
+[
+ AC_REQUIRE([IT_CHECK_FOR_JDK])
+ AC_MSG_CHECKING([for javadoc])
+ AC_ARG_WITH([javadoc],
+ [AS_HELP_STRING(--with-javadoc,specify location of Java documentation tool (javadoc))],
+ [
+ JAVADOC="${withval}"
+ ],
+ [
+ JAVADOC=${SYSTEM_JDK_DIR}/bin/javadoc
+ ])
+ if ! test -f "${JAVADOC}"; then
+ AC_PATH_PROG(JAVADOC, "${JAVADOC}")
+ fi
+ if test -z "${JAVADOC}"; then
+ AC_PATH_PROG(JAVADOC, "javadoc")
+ fi
+ if test -z "${JAVADOC}"; then
+ AC_PATH_PROG(JAVADOC, "gjdoc")
+ fi
+ if test -z "${JAVADOC}" && test "x$ENABLE_DOCS" = "xyes"; then
+ AC_MSG_ERROR("No Java documentation tool was found.")
+ fi
+ AC_MSG_RESULT(${JAVADOC})
+ AC_MSG_CHECKING([whether javadoc supports -J options])
+ CLASS=pkg/Test.java
+ mkdir tmp.$$
+ cd tmp.$$
+ mkdir pkg
+ cat << \EOF > $CLASS
+[/* [#]line __oline__ "configure" */
+package pkg;
+
+public class Test
+{
+ /**
+ * Does stuff.
+ *
+ *
+ * @param args arguments from cli.
+ */
+ public static void main(String[] args)
+ {
+ System.out.println("Hello World!");
+ }
+}
+]
+EOF
+ if $JAVADOC -J-Xmx896m pkg >&AS_MESSAGE_LOG_FD 2>&1; then
+ JAVADOC_KNOWS_J_OPTIONS=yes
+ else
+ JAVADOC_KNOWS_J_OPTIONS=no
+ fi
+ cd ..
+ rm -rf tmp.$$
+ AC_MSG_RESULT([${JAVADOC_KNOWS_J_OPTIONS}])
+ AC_SUBST(JAVADOC)
+ AC_SUBST(JAVADOC_KNOWS_J_OPTIONS)
+ AM_CONDITIONAL([JAVADOC_SUPPORTS_J_OPTIONS], test x"${JAVADOC_KNOWS_J_OPTIONS}" = "xyes")
+])