8207365: Make man pages optional

Reviewed-by: tbell
This commit is contained in:
Erik Joelsson 2018-07-20 09:07:37 -07:00
parent c798b68ee1
commit f53e04ead9
5 changed files with 109 additions and 77 deletions

View File

@ -121,115 +121,117 @@ TOOL_JDK_TARGETS := $(JDK_IMAGE_DIR)/$(JIMAGE_TARGET_FILE)
#
# Avoid evaluating this whole section on windows for speed and stability
ifneq ($(OPENJDK_TARGET_OS), windows)
JRE_MAN_PAGES += \
java.1 \
jjs.1 \
keytool.1 \
orbd.1 \
pack200.1 \
rmid.1 \
rmiregistry.1 \
servertool.1 \
unpack200.1
ifeq ($(BUILD_MANPAGES), true)
JRE_MAN_PAGES += \
java.1 \
jjs.1 \
keytool.1 \
orbd.1 \
pack200.1 \
rmid.1 \
rmiregistry.1 \
servertool.1 \
unpack200.1
JDK_MAN_PAGES += \
$(JRE_MAN_PAGES) \
idlj.1 \
jar.1 \
jarsigner.1 \
javac.1 \
javadoc.1 \
javap.1 \
jconsole.1 \
jcmd.1 \
jdb.1 \
jdeps.1 \
jinfo.1 \
jmap.1 \
jps.1 \
jrunscript.1 \
jstack.1 \
jstat.1 \
jstatd.1 \
rmic.1 \
serialver.1
JDK_MAN_PAGES += \
$(JRE_MAN_PAGES) \
idlj.1 \
jar.1 \
jarsigner.1 \
javac.1 \
javadoc.1 \
javap.1 \
jconsole.1 \
jcmd.1 \
jdb.1 \
jdeps.1 \
jinfo.1 \
jmap.1 \
jps.1 \
jrunscript.1 \
jstack.1 \
jstat.1 \
jstatd.1 \
rmic.1 \
serialver.1
# This variable is potentially overridden in the closed makefile.
MAN_SRC_BASEDIR ?= $(TOPDIR)/src
# This variable is potentially overridden in the closed makefile.
MAN_SRC_BASEDIR ?= $(TOPDIR)/src
ifeq ($(OPENJDK_TARGET_OS), linux)
MAN_SRC_DIR = $(MAN_SRC_BASEDIR)/linux/doc
MAN1_SUBDIR = man
endif
ifeq ($(OPENJDK_TARGET_OS), solaris)
MAN_SRC_DIR = $(MAN_SRC_BASEDIR)/solaris/doc
MAN1_SUBDIR = sun/man/man1
endif
ifeq ($(OPENJDK_TARGET_OS), macosx)
MAN_SRC_DIR = $(MAN_SRC_BASEDIR)/bsd/doc
MAN1_SUBDIR = man
endif
ifeq ($(OPENJDK_TARGET_OS), linux)
MAN_SRC_DIR = $(MAN_SRC_BASEDIR)/linux/doc
MAN1_SUBDIR = man
endif
ifeq ($(OPENJDK_TARGET_OS), solaris)
MAN_SRC_DIR = $(MAN_SRC_BASEDIR)/solaris/doc
MAN1_SUBDIR = sun/man/man1
endif
ifeq ($(OPENJDK_TARGET_OS), macosx)
MAN_SRC_DIR = $(MAN_SRC_BASEDIR)/bsd/doc
MAN1_SUBDIR = man
endif
$(JRE_IMAGE_DIR)/man/man1/%: $(MAN_SRC_DIR)/$(MAN1_SUBDIR)/%
$(JRE_IMAGE_DIR)/man/man1/%: $(MAN_SRC_DIR)/$(MAN1_SUBDIR)/%
$(call LogInfo, Copying $(patsubst $(OUTPUTDIR)/%,%,$@))
$(install-file)
$(JDK_IMAGE_DIR)/man/man1/%: $(MAN_SRC_DIR)/$(MAN1_SUBDIR)/%
$(JDK_IMAGE_DIR)/man/man1/%: $(MAN_SRC_DIR)/$(MAN1_SUBDIR)/%
$(call LogInfo, Copying $(patsubst $(OUTPUTDIR)/%,%,$@))
$(install-file)
$(JRE_IMAGE_DIR)/man/ja_JP.UTF-8/man1/%: $(MAN_SRC_DIR)/$(MAN1_SUBDIR)/ja/%
$(JRE_IMAGE_DIR)/man/ja_JP.UTF-8/man1/%: $(MAN_SRC_DIR)/$(MAN1_SUBDIR)/ja/%
$(call LogInfo, Copying $(patsubst $(OUTPUTDIR)/%,%,$@))
$(install-file)
$(JDK_IMAGE_DIR)/man/ja_JP.UTF-8/man1/%: $(MAN_SRC_DIR)/$(MAN1_SUBDIR)/ja/%
$(JDK_IMAGE_DIR)/man/ja_JP.UTF-8/man1/%: $(MAN_SRC_DIR)/$(MAN1_SUBDIR)/ja/%
$(call LogInfo, Copying $(patsubst $(OUTPUTDIR)/%,%,$@))
$(install-file)
ifeq ($(OPENJDK_TARGET_OS), solaris)
$(JRE_IMAGE_DIR)/man/ja/man1/%: $(MAN_SRC_DIR)/$(MAN1_SUBDIR)/ja/%
ifeq ($(OPENJDK_TARGET_OS), solaris)
$(JRE_IMAGE_DIR)/man/ja/man1/%: $(MAN_SRC_DIR)/$(MAN1_SUBDIR)/ja/%
$(call LogInfo, Converting $(patsubst $(OUTPUTDIR)/%,%,$@))
$(install-file)
$(JDK_IMAGE_DIR)/man/ja/man1/%: $(MAN_SRC_DIR)/$(MAN1_SUBDIR)/ja/%
$(JDK_IMAGE_DIR)/man/ja/man1/%: $(MAN_SRC_DIR)/$(MAN1_SUBDIR)/ja/%
$(call LogInfo, Converting $(patsubst $(OUTPUTDIR)/%,%,$@))
$(install-file)
endif
endif
ifneq ($(findstring $(OPENJDK_TARGET_OS), linux macosx), )
$(JRE_IMAGE_DIR)/man/ja:
ifneq ($(findstring $(OPENJDK_TARGET_OS), linux macosx), )
$(JRE_IMAGE_DIR)/man/ja:
$(call LogInfo, Creating $(patsubst $(OUTPUTDIR)/%,%,$@))
$(CD) $(@D) && $(RM) ja && $(LN) -s ja_JP.UTF-8 ja
$(JDK_IMAGE_DIR)/man/ja:
$(JDK_IMAGE_DIR)/man/ja:
$(call LogInfo, Creating $(patsubst $(OUTPUTDIR)/%,%,$@))
$(CD) $(@D) && $(RM) ja && $(LN) -s ja_JP.UTF-8 ja
endif
endif
ifeq ($(OPENJDK_TARGET_OS), solaris)
JRE_MAN_PAGE_LIST = $(addprefix $(JRE_IMAGE_DIR)/man/man1/, $(JRE_MAN_PAGES)) \
$(addprefix $(JRE_IMAGE_DIR)/man/ja/man1/, $(JRE_MAN_PAGES)) \
$(addprefix $(JRE_IMAGE_DIR)/man/ja_JP.UTF-8/man1/, $(JRE_MAN_PAGES)) \
$(addprefix $(JRE_IMAGE_DIR)/man/ja_JP.PCK/man1/, $(JRE_MAN_PAGES))
ifeq ($(OPENJDK_TARGET_OS), solaris)
JRE_MAN_PAGE_LIST = $(addprefix $(JRE_IMAGE_DIR)/man/man1/, $(JRE_MAN_PAGES)) \
$(addprefix $(JRE_IMAGE_DIR)/man/ja/man1/, $(JRE_MAN_PAGES)) \
$(addprefix $(JRE_IMAGE_DIR)/man/ja_JP.UTF-8/man1/, $(JRE_MAN_PAGES)) \
$(addprefix $(JRE_IMAGE_DIR)/man/ja_JP.PCK/man1/, $(JRE_MAN_PAGES))
JDK_MAN_PAGE_LIST = $(addprefix $(JDK_IMAGE_DIR)/man/man1/, $(JDK_MAN_PAGES)) \
$(addprefix $(JDK_IMAGE_DIR)/man/ja/man1/, $(JDK_MAN_PAGES)) \
$(addprefix $(JDK_IMAGE_DIR)/man/ja_JP.UTF-8/man1/, $(JDK_MAN_PAGES)) \
$(addprefix $(JDK_IMAGE_DIR)/man/ja_JP.PCK/man1/, $(JDK_MAN_PAGES))
endif
JDK_MAN_PAGE_LIST = $(addprefix $(JDK_IMAGE_DIR)/man/man1/, $(JDK_MAN_PAGES)) \
$(addprefix $(JDK_IMAGE_DIR)/man/ja/man1/, $(JDK_MAN_PAGES)) \
$(addprefix $(JDK_IMAGE_DIR)/man/ja_JP.UTF-8/man1/, $(JDK_MAN_PAGES)) \
$(addprefix $(JDK_IMAGE_DIR)/man/ja_JP.PCK/man1/, $(JDK_MAN_PAGES))
endif
ifneq ($(findstring $(OPENJDK_TARGET_OS), linux macosx), )
JRE_MAN_PAGE_LIST = $(addprefix $(JRE_IMAGE_DIR)/man/man1/, $(JRE_MAN_PAGES)) \
$(addprefix $(JRE_IMAGE_DIR)/man/ja_JP.UTF-8/man1/, $(JRE_MAN_PAGES)) \
$(JRE_IMAGE_DIR)/man/ja
ifneq ($(findstring $(OPENJDK_TARGET_OS), linux macosx), )
JRE_MAN_PAGE_LIST = $(addprefix $(JRE_IMAGE_DIR)/man/man1/, $(JRE_MAN_PAGES)) \
$(addprefix $(JRE_IMAGE_DIR)/man/ja_JP.UTF-8/man1/, $(JRE_MAN_PAGES)) \
$(JRE_IMAGE_DIR)/man/ja
JDK_MAN_PAGE_LIST = $(addprefix $(JDK_IMAGE_DIR)/man/man1/, $(JDK_MAN_PAGES)) \
$(addprefix $(JDK_IMAGE_DIR)/man/ja_JP.UTF-8/man1/, $(JDK_MAN_PAGES)) \
$(JDK_IMAGE_DIR)/man/ja
endif
JDK_MAN_PAGE_LIST = $(addprefix $(JDK_IMAGE_DIR)/man/man1/, $(JDK_MAN_PAGES)) \
$(addprefix $(JDK_IMAGE_DIR)/man/ja_JP.UTF-8/man1/, $(JDK_MAN_PAGES)) \
$(JDK_IMAGE_DIR)/man/ja
endif
JRE_TARGETS += $(JRE_MAN_PAGE_LIST)
JDK_TARGETS += $(JDK_MAN_PAGE_LIST)
JRE_TARGETS += $(JRE_MAN_PAGE_LIST)
JDK_TARGETS += $(JDK_MAN_PAGE_LIST)
endif # BUILD_MANPAGES
endif # Windows
################################################################################

View File

@ -233,6 +233,7 @@ JDKOPT_DETECT_INTREE_EC
JDKOPT_ENABLE_DISABLE_FAILURE_HANDLER
JDKOPT_ENABLE_DISABLE_GENERATE_CLASSLIST
JDKOPT_EXCLUDE_TRANSLATIONS
JDKOPT_ENABLE_DISABLE_MANPAGES
###############################################################################
#

View File

@ -604,3 +604,29 @@ AC_DEFUN([JDKOPT_EXCLUDE_TRANSLATIONS],
AC_SUBST(EXCLUDE_TRANSLATIONS)
])
################################################################################
#
# Optionally disable man pages
#
AC_DEFUN([JDKOPT_ENABLE_DISABLE_MANPAGES],
[
AC_ARG_ENABLE([manpages], [AS_HELP_STRING([--disable-manpages],
[Set to disable building of man pages @<:@enabled@:>@])])
BUILD_MANPAGES="true"
AC_MSG_CHECKING([if man pages should be built])
if test "x$enable_manpages" = "x"; then
AC_MSG_RESULT([yes])
elif test "x$enable_manpages" = "xyes"; then
AC_MSG_RESULT([yes, forced])
elif test "x$enable_manpages" = "xno"; then
AC_MSG_RESULT([no, forced])
BUILD_MANPAGES="false"
else
AC_MSG_RESULT([no])
AC_MSG_ERROR([--enable-manpages can only yes/no or empty])
fi
AC_SUBST(BUILD_MANPAGES)
])

View File

@ -305,6 +305,8 @@ ENABLE_GENERATE_CLASSLIST := @ENABLE_GENERATE_CLASSLIST@
EXCLUDE_TRANSLATIONS := @EXCLUDE_TRANSLATIONS@
BUILD_MANPAGES := @BUILD_MANPAGES@
# The boot jdk to use. This is overridden in bootcycle-spec.gmk. Make sure to keep
# it in sync.
BOOT_JDK:=@BOOT_JDK@

View File

@ -243,6 +243,7 @@ var getJibProfilesCommon = function (input, data) {
default_make_targets: ["product-bundles", "test-bundles"],
configure_args: concat(["--enable-jtreg-failure-handler"],
"--with-exclude-translations=de,es,fr,it,ko,pt_BR,sv,ca,tr,cs,sk,ja_JP_A,ja_JP_HA,ja_JP_HI,ja_JP_I,zh_TW,zh_HK",
"--disable-manpages",
versionArgs(input, common))
};
// Extra settings for debug profiles