Either copy old static pages, or new dynamic. ihse-manpages-branch
authorihse
Tue, 30 Oct 2018 10:46:56 +0100
branchihse-manpages-branch
changeset 57008 cbd4d5fe2015
parent 57007 19b7d582121d
child 57009 41a309ceb98c
Either copy old static pages, or new dynamic.
make/Docs.gmk
make/autoconf/jdk-options.m4
--- a/make/Docs.gmk	Tue Oct 30 09:33:51 2018 +0100
+++ b/make/Docs.gmk	Tue Oct 30 10:46:56 2018 +0100
@@ -61,9 +61,6 @@
 MODULES_SOURCE_PATH := $(call PathList, $(call GetModuleSrcPath) \
     $(SUPPORT_OUTPUTDIR)/rmic/* $(TOPDIR)/src/*/share/doc/stub)
 
-# Should we enable man pages? Allow custom to overwrite.
-ENABLE_MAN_PAGES ?= true
-
 # URLs
 JAVADOC_BASE_URL := https://docs.oracle.com/pls/topic/lookup?ctx=javase$(VERSION_NUMBER)&id=homepage
 BUG_SUBMIT_URL := https://bugreport.java.com/bugreport/
@@ -558,7 +555,28 @@
     ) \
   )
 
-  ifeq ($(ENABLE_MAN_PAGES), true)
+  # BUILD_MANPAGES is a misnomer. Right now it means "copy static man pages".
+  ifeq ($(BUILD_MANPAGES), true)
+    # Copy static man pages already in troff format
+
+    $(foreach m, $(ALL_MODULES), \
+      $(eval MAN_$m := $(call FindModuleManDirs, $m)) \
+      $(foreach d, $(MAN_$m), \
+        $(if $(filter %.1, $(call CacheFind, $d)), \
+          $(eval $m_$d_NAME := COPY_MAN_$m_$(strip $(call RelativePath, $d, $(TOPDIR)))) \
+          $(eval $(call SetupCopyFiles, $($m_$d_NAME), \
+              SRC := $d, \
+              FILES := $(filter %.1, $(call CacheFind, $d)), \
+              DEST := $(DOCS_OUTPUTDIR)/man/man1, \
+          )) \
+          $(eval MAN_PAGE_TARGETS += $($($m_$d_NAME))) \
+        ) \
+      ) \
+    )
+
+  else
+    # Create dynamic man pages from markdown
+
     PANDOC_FILTER := $(SUPPORT_OUTPUTDIR)/docs/pandoc-manpage-filter
     PANDOC_FILTER_SETUP := $(SUPPORT_OUTPUTDIR)/docs/_pandoc_filter_setup.marker
     PANDOC_FILTER_JAVASCRIPT := $(TOPDIR)/make/scripts/pandoc-manpage-filter.js
@@ -602,7 +620,7 @@
       $(eval MAN_$m := $(call FindModuleManDirs, $m)) \
       $(foreach d, $(MAN_$m), \
         $(if $(filter %.md, $(call CacheFind, $d)), \
-        $(eval $m_$d_NAME := MAN_TO_TROFF_$m_$(strip $(call RelativePath, $d, $(TOPDIR)))) \
+          $(eval $m_$d_NAME := MAN_TO_TROFF_$m_$(strip $(call RelativePath, $d, $(TOPDIR)))) \
           $(eval $(call SetupProcessMarkdown, $($m_$d_NAME), \
               SRC := $d, \
               FILES := $(filter %.md, $(call CacheFind, $d)), \
@@ -614,8 +632,8 @@
               POST_PROCESS := $(MAN_POST_PROCESS), \
               REPLACEMENTS := @@VERSION_SHORT@@ => $(VERSION_SHORT), \
           )) \
+          $(eval MAN_PAGE_TARGETS += $($($m_$d_NAME))) \
         ) \
-        $(eval MAN_PAGE_TARGETS += $($($m_$d_NAME))) \
       ) \
     )
 
@@ -624,7 +642,7 @@
       $(eval MAN_$m := $(call FindModuleManDirs, $m)) \
       $(foreach d, $(MAN_$m), \
         $(if $(filter %.md, $(call CacheFind, $d)), \
-        $(eval $m_$d_NAME := MAN_TO_HTML_$m_$(strip $(call RelativePath, $d, $(TOPDIR)))) \
+          $(eval $m_$d_NAME := MAN_TO_HTML_$m_$(strip $(call RelativePath, $d, $(TOPDIR)))) \
           $(eval $(call SetupProcessMarkdown, $($m_$d_NAME), \
               SRC := $d, \
               FILES := $(filter %.md, $(call CacheFind, $d)), \
@@ -632,17 +650,17 @@
               CSS := $(GLOBAL_SPECS_DEFAULT_CSS_FILE), \
               REPLACEMENTS := @@VERSION_SHORT@@ => $(VERSION_SHORT), \
           )) \
+          $(eval MAN_PAGE_TARGETS += $($($m_$d_NAME))) \
         ) \
-        $(eval MAN_PAGE_TARGETS += $($($m_$d_NAME))) \
       ) \
     )
 
     # The html version also needs the css file
     MAN_PAGE_TARGETS += $(COPY_GLOBAL_RESOURCES)
+  endif
 
-    JDK_SPECS_TARGETS += $(MAN_PAGE_TARGETS)
+  JDK_SPECS_TARGETS += $(MAN_PAGE_TARGETS)
 
-  endif
 endif
 
 # Special treatment for generated documentation
--- a/make/autoconf/jdk-options.m4	Tue Oct 30 09:33:51 2018 +0100
+++ b/make/autoconf/jdk-options.m4	Tue Oct 30 10:46:56 2018 +0100
@@ -587,10 +587,10 @@
 AC_DEFUN([JDKOPT_ENABLE_DISABLE_MANPAGES],
 [
   AC_ARG_ENABLE([manpages], [AS_HELP_STRING([--disable-manpages],
-      [Set to disable building of man pages @<:@enabled@:>@])])
+      [Set to disable copy of static man pages @<:@enabled@:>@])])
 
   BUILD_MANPAGES="true"
-  AC_MSG_CHECKING([if man pages should be built])
+  AC_MSG_CHECKING([if static man pages should be copied])
   if test "x$enable_manpages" = "x"; then
     AC_MSG_RESULT([yes])
   elif test "x$enable_manpages" = "xyes"; then