Skip to content

Commit 17421c8

Browse files
author
David Holmes
committed
8038189: Add cross-platform compact profiles support
Generalize the compact profile support so it can be used on any platform Reviewed-by: erikj
1 parent b5f8314 commit 17421c8

File tree

7 files changed

+277
-89
lines changed

7 files changed

+277
-89
lines changed

jdk/make/CreateJars.gmk

Lines changed: 25 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
2+
# Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
33
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
#
55
# This code is free software; you can redistribute it and/or modify it
@@ -267,10 +267,12 @@ $(IMAGES_OUTPUTDIR)/lib$(PROFILE)/_the.rt.jar.contents: $(IMAGES_OUTPUTDIR)/lib$
267267
$(RM) $@ $@.tmp
268268
$(GREP) -e '\.class$$' $(IMAGES_OUTPUTDIR)/lib$(PROFILE)/_the.jars.contents > $@.tmp
269269
ifneq ($(PROFILE), )
270-
# # Add back classes from excluded packages (fixing the $ substitution in the process)
271-
for type in $(subst \$$,\, $(RT_JAR_INCLUDE_TYPES)) ; do \
272-
$(ECHO) $$type >> $@.tmp ; \
273-
done
270+
ifneq ($(strip $(RT_JAR_INCLUDE_TYPES)), )
271+
# Add back classes from excluded packages (fixing the $ substitution in the process)
272+
for type in $(subst \$$,\, $(RT_JAR_INCLUDE_TYPES)) ; do \
273+
$(ECHO) $$type >> $@.tmp ; \
274+
done
275+
endif
274276
endif
275277
$(MV) $@.tmp $@
276278

@@ -281,15 +283,15 @@ $(IMAGES_OUTPUTDIR)/lib$(PROFILE)/_the.resources.jar.contents: $(IMAGES_OUTPUTDI
281283
-e '/_the\.*' -e '^_the\.*' -e '\\_the\.*' -e 'javac_state' \
282284
$(IMAGES_OUTPUTDIR)/lib$(PROFILE)/_the.jars.contents > $@.tmp
283285
ifneq ($(PROFILE), )
284-
# # Strip out all META-INF/services/ entries
285-
$(GREP) -v -e 'META-INF/services/' $@.tmp > $@.tmp2
286-
# # Add back the required services
287-
# # FIXME: On Solaris if PROFILE_INCLUDE_METAINF_SERVICES is not defined
288-
# # we get a syntax error from sh. That doesn't happen on linux
289-
for service in $(PROFILE_INCLUDE_METAINF_SERVICES) ; do \
290-
$(ECHO) $$service >> $@.tmp2; \
291-
done
292-
$(MV) $@.tmp2 $@.tmp
286+
ifneq ($(strip $(PROFILE_INCLUDE_METAINF_SERVICES)), )
287+
# Strip out all META-INF/services/ entries
288+
$(GREP) -v -e 'META-INF/services/' $@.tmp > $@.tmp2
289+
# Add back the required services
290+
for service in $(PROFILE_INCLUDE_METAINF_SERVICES) ; do \
291+
$(ECHO) $$service >> $@.tmp2; \
292+
done
293+
$(MV) $@.tmp2 $@.tmp
294+
endif
293295
endif
294296
$(MV) $@.tmp $@
295297

@@ -309,6 +311,15 @@ $(BEANLESS_CLASSES)/%: $(JDK_OUTPUTDIR)/classes/%
309311
$(MKDIR) -p $(@D)
310312
$(TOOL_REMOVEMETHODS) '$<' $@ addPropertyChangeListener removePropertyChangeListener
311313

314+
# Code these targets explicitly because the target "%" expansion does
315+
# not work with the inline "$" in the file name.
316+
$(BEANLESS_CLASSES)/java/util/jar/Pack200\$$Packer.class: $(JDK_OUTPUTDIR)/classes/java/util/jar/Pack200$$Packer.class
317+
$(MKDIR) -p $(@D)
318+
$(TOOL_REMOVEMETHODS) '$<' $@ addPropertyChangeListener removePropertyChangeListener
319+
$(BEANLESS_CLASSES)/java/util/jar/Pack200\$$Unpacker.class: $(JDK_OUTPUTDIR)/classes/java/util/jar/Pack200$$Unpacker.class
320+
$(MKDIR) -p $(@D)
321+
$(TOOL_REMOVEMETHODS) '$<' $@ addPropertyChangeListener removePropertyChangeListener
322+
312323
CLASSES_TO_DEBEAN = \
313324
java/util/logging/LogManager.class \
314325
java/util/jar/Pack200\$$Packer.class \

jdk/make/Images.gmk

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
2+
# Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
33
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
#
55
# This code is free software; you can redistribute it and/or modify it
@@ -161,11 +161,13 @@ JRE_BIN_LIST := $(filter-out $(addprefix %, $(WINDOWS_JDKJRE_BIN_FILES)), $(JDKJ
161161

162162
ifeq ($(OPENJDK_TARGET_OS), windows)
163163
JDK_BIN_LIST := $(filter $(addprefix %, $(WINDOWS_JDK_BIN_FILES)), $(ALL_BIN_LIST))
164-
# On windows x86, the server jvm is filtered out from the j2re image. This could possibly
165-
# be handled by profiles in the future. If no client jvm is built, leave server in.
164+
# On windows x86, the server jvm is filtered out from the j2re image. This is historical
165+
# and is not applied to compact profiles. If no client jvm is built, leave server in.
166166
ifeq ($(OPENJDK_TARGET_CPU), x86)
167167
ifeq ($(JVM_VARIANT_CLIENT), true)
168-
JRE_BIN_LIST := $(filter-out $(JDK_OUTPUTDIR)/bin/server/%, $(JRE_BIN_LIST))
168+
ifeq ($(PROFILE), )
169+
JRE_BIN_LIST := $(filter-out $(JDK_OUTPUTDIR)/bin/server/%, $(JRE_BIN_LIST))
170+
endif
169171
endif
170172
endif
171173
else

jdk/make/Import.gmk

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
2+
# Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
33
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
#
55
# This code is free software; you can redistribute it and/or modify it
@@ -116,6 +116,12 @@ endef
116116
#
117117
HOTSPOT_IMPORT_FILES := $(addprefix $(LIBRARY_PREFIX), jvm.* saproc.* jsig.* sawindbg.* jvm_db.* jvm_dtrace.*) \
118118
Xusage.txt sa-jdi.jar
119+
120+
ifeq ($(OPENJDK_TARGET_OS), macosx)
121+
# additional debug file
122+
HOTSPOT_IMPORT_FILES += Info.plist
123+
endif
124+
119125
$(eval $(call CopyDir,HOTSPOT0, $(HOTSPOT_LIB_DIR), $(INSTALL_LIBRARIES_HERE), $(HOTSPOT_IMPORT_FILES)))
120126
$(eval $(call CopyDir,HOTSPOT1, $(HOTSPOT_DIST)/lib, $(JDK_OUTPUTDIR)/lib, $(HOTSPOT_IMPORT_FILES)))
121127

jdk/make/Profiles.gmk

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ include profile-includes.txt
4747
# Note that some jars may be optional depending on the type of build (jdk vs.
4848
# openjdk) and the platform.
4949
#
50-
# WARNING: incoming lists are currently validated for linux only!
5150
###############################################################################
5251

5352
# These are jar files for which the contents vary depending on the profile

jdk/make/Tools.gmk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,11 +124,11 @@ TOOL_CLDRCONVERTER = $(JAVA_SMALL) -cp $(JDK_OUTPUTDIR)/btclasses \
124124
build.tools.cldrconverter.CLDRConverter
125125

126126
TOOL_REMOVEMETHODS = $(JAVA_SMALL) -Xbootclasspath/p:$(LANGTOOLS_OUTPUTDIR)/dist/bootstrap/lib/javac.jar \
127-
-cp $(JDK_OUTPUTDIR)/btclasses:$(JDK_OUTPUTDIR) \
127+
-cp '$(JDK_OUTPUTDIR)/btclasses$(PATH_SEP)$(JDK_OUTPUTDIR)' \
128128
build.tools.classfile.RemoveMethods
129129

130130
TOOL_CHECKDEPS = $(JAVA_SMALL) -Xbootclasspath/p:$(LANGTOOLS_OUTPUTDIR)/dist/bootstrap/lib/javac.jar \
131-
-cp $(JDK_OUTPUTDIR)/btclasses:$(JDK_OUTPUTDIR) \
131+
-cp '$(JDK_OUTPUTDIR)/btclasses$(PATH_SEP)$(JDK_OUTPUTDIR)' \
132132
build.tools.deps.CheckDeps
133133

134134
TOOL_ADDTORESTRICTEDPKGS=$(JAVA_SMALL) -cp $(JDK_OUTPUTDIR)/btclasses \

0 commit comments

Comments
 (0)