annotate make/common/Release-embedded.gmk @ 4254:7c5bc5a807ee

7024120: Verify reduced JRE contents for java 7 Summary: stripped all symbols from libs and executables to reduce JRE size. Restored missing classes needed to pass JCK in headless mode Reviewed-by: bobv, ohair
author dholmes
date Fri, 27 May 2011 19:04:48 -0400
parents e926550709c9
children
rev   line source
dholmes@3867 1 #
dholmes@3867 2 # Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
dholmes@3867 3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
dholmes@3867 4 #
dholmes@3867 5 # This code is free software; you can redistribute it and/or modify it
dholmes@3867 6 # under the terms of the GNU General Public License version 2 only, as
dholmes@3867 7 # published by the Free Software Foundation. Oracle designates this
dholmes@3867 8 # particular file as subject to the "Classpath" exception as provided
dholmes@3867 9 # by Oracle in the LICENSE file that accompanied this code.
dholmes@3867 10 #
dholmes@3867 11 # This code is distributed in the hope that it will be useful, but WITHOUT
dholmes@3867 12 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
dholmes@3867 13 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
dholmes@3867 14 # version 2 for more details (a copy is included in the LICENSE file that
dholmes@3867 15 # accompanied this code).
dholmes@3867 16 #
dholmes@3867 17 # You should have received a copy of the GNU General Public License version
dholmes@3867 18 # 2 along with this work; if not, write to the Free Software Foundation,
dholmes@3867 19 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
dholmes@3867 20 #
dholmes@3867 21 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
dholmes@3867 22 # or visit www.oracle.com if you need additional information or have any
dholmes@3867 23 # questions.
dholmes@3867 24 #
dholmes@3867 25
dholmes@3867 26 #
dholmes@3867 27 # SE-Embedded Reduced JRE targets
dholmes@3867 28 #
dholmes@3867 29 ifdef JAVASE_EMBEDDED
dholmes@3867 30
dholmes@3867 31 reduced-image-jre reduced-headless-image-jre ::
dholmes@3867 32 @$(ECHO) ">>>Making "$@" @ `$(DATE)` ..."
dholmes@3867 33
dholmes@3867 34 # Add the reduced-jre images as pre-reqs. These will be processed last
dholmes@3867 35 images:: reduced-image-jre reduced-headless-image-jre
dholmes@3867 36
dholmes@3867 37
dholmes@3867 38 ######################################################
dholmes@3867 39 # Create the headless rt.jar
dholmes@3867 40 ######################################################
dholmes@3867 41
dholmes@3867 42 NOT_HEADLESS_RT_JAR_LIST = $(ABS_TEMPDIR)/not_hl_rt_jar.list
dholmes@3867 43 HEADLESS_RT_JAR_FILELIST=$(JARFILELISTS_TEMPDIR)/hl_rt_jar_list
dholmes@3867 44 TOTAL_HEADLESS_JAR_FILELIST=$(REORDER_TEMPDIR)/hl_file_list
dholmes@3867 45 HEADLESS_CLASSLIST=$(ABS_TEMPDIR)/headless_classlist
dholmes@3867 46
dholmes@3867 47 # Add the jar file directories that we don't want in the
dholmes@3867 48 # headless JRE. If you want to remove most classes in a
dholmes@3867 49 # directory, put the directory in the NOT_HEADLESS_RT_JAR_LIST
dholmes@3867 50 # and put the individual classes you want to keep in the
dholmes@3867 51 # HEADLESS_CLASSLIST file.
dholmes@3867 52 $(NOT_HEADLESS_RT_JAR_LIST): $(NOT_RT_JAR_LIST)
dholmes@3867 53 $(RM) $(HEADLESS_CLASSLIST)
dholmes@3867 54 $(RM) $(NOT_HEADLESS_RT_JAR_LIST)
dholmes@3867 55 $(CP) $(NOT_RT_JAR_LIST) $(NOT_HEADLESS_RT_JAR_LIST)
dholmes@4254 56 # List all the packages to be excluded
dholmes@3867 57 $(ECHO) "sun/awt/motif/" >> $@
dholmes@3867 58 $(ECHO) "sun/awt/X11/" >> $@
dholmes@3867 59 $(ECHO) "sun/applet/" >> $@
dholmes@3867 60 $(ECHO) "sun/java2d/opengl/" >> $@
dholmes@3867 61 $(ECHO) "com/sun/java/swing/plaf/" >> $@
dholmes@4254 62 # List all the individual classes to be included
dholmes@4254 63 $(ECHO) "sun/awt/motif/MFontConfiguration.class" >$(HEADLESS_CLASSLIST)
dholmes@4254 64 $(ECHO) "sun/applet/AppContextCreator.class" >>$(HEADLESS_CLASSLIST)
dholmes@4254 65 $(ECHO) "sun/applet/AppletAudioClip.class" >>$(HEADLESS_CLASSLIST)
dholmes@4254 66 $(ECHO) "sun/java2d/opengl/GLXSurfaceData.class" >>$(HEADLESS_CLASSLIST)
dholmes@4254 67 $(ECHO) "sun/java2d/opengl/GLXSurfaceData"\$$"GLXOffScreenSurfaceData.class" >>$(HEADLESS_CLASSLIST)
dholmes@4254 68 $(ECHO) "sun/java2d/opengl/GLXVolatileSurfaceManager.class" >>$(HEADLESS_CLASSLIST)
dholmes@4254 69 $(ECHO) "sun/java2d/opengl/OGLSurfaceData.class" >>$(HEADLESS_CLASSLIST)
dholmes@4254 70
dholmes@3867 71
dholmes@3867 72 $(TOTAL_HEADLESS_JAR_FILELIST): $(JARREORDER_JARFILE) $(NOT_HEADLESS_RT_JAR_LIST)
dholmes@3867 73 $(prep-target)
dholmes@3867 74 $(RM) $@.temp
dholmes@3867 75 $(CD) $(CLASSBINDIR) ; \
dholmes@3867 76 $(BOOT_JAVA_CMD) -jar $(JARREORDER_JARFILE) \
dholmes@4254 77 -o $@.temp - $(NOT_HEADLESS_RT_JAR_LIST) .
dholmes@4254 78 # Add on the explicitly included class files from the otherwise excluded packages
dholmes@4254 79 $(CAT) $(HEADLESS_CLASSLIST) >> $@.temp
dholmes@3867 80 $(MV) $@.temp $@
dholmes@3867 81 @$(CD) $(CLASSBINDIR); $(java-vm-cleanup)
dholmes@3867 82
dholmes@3867 83 # Create the headless rt.jar file list & non-class files list
dholmes@3867 84 MakeHeadlessJarFileList: $(TOTAL_HEADLESS_JAR_FILELIST) $(JARSPLIT_JARFILE)
dholmes@3867 85 @$(RM) $(HEADLESS_RT_JAR_FILELIST) $(RES_JAR_FILELIST)
dholmes@3867 86 $(BOOT_JAVA_CMD) -jar $(JARSPLIT_JARFILE) $(TOTAL_HEADLESS_JAR_FILELIST) \
dholmes@3867 87 -o $(HEADLESS_RT_JAR_FILELIST) $(RES_JAR_FILELIST)
dholmes@3867 88 @$(java-vm-cleanup)
dholmes@3867 89
dholmes@3867 90 # Create headless rt.jar
dholmes@3867 91 HL_RT_JAR=$(ABS_TEMPDIR)/rt-hl-orig.jar
ohair@4032 92 $(HL_RT_JAR): MakeHeadlessJarFileList $(RT_JAR_MANIFEST_FILE)
dholmes@3867 93 $(prep-target)
dholmes@3867 94 $(CD) $(CLASSBINDIR) ; \
ohair@4032 95 $(BOOT_JAR_CMD) $(CREATE_JAR_OPTS) $(RT_JAR_MANIFEST_FILE) $@ @$(HEADLESS_RT_JAR_FILELIST) \
dholmes@3867 96 $(JAR_JFLAGS)
dholmes@3867 97 @$(CD) $(CLASSBINDIR); $(java-vm-cleanup)
dholmes@3867 98
dholmes@3867 99
dholmes@3867 100 #
dholmes@3867 101 # Produce a reduced Headful JRE for Embedded Devices
dholmes@3867 102 #
dholmes@3867 103 # The deployment binaries are added during the deployment build process
dholmes@3867 104 #
dholmes@3867 105
dholmes@3867 106 # Binaries that don't get included in reduced jre image bin directory
dholmes@3867 107 NOT_REDUCEDJRE_BIN = \
dholmes@3867 108 java_vm \
dholmes@3867 109 kinit \
dholmes@3867 110 klist \
dholmes@3867 111 ktab \
dholmes@3867 112 orbd \
dholmes@3867 113 policytool \
dholmes@3867 114 rmid \
dholmes@3867 115 rmiregistry \
dholmes@3867 116 servertool \
dholmes@3867 117 tnameserv \
dholmes@3867 118 pack200 \
dholmes@3867 119 unpack200
dholmes@3867 120
dholmes@3867 121 # jars/resources/libs that don't get included in reduced jre image lib directory
dholmes@3867 122 NOT_REDUCEDJRE_LIB = \
dholmes@3867 123 charsets.jar \
dholmes@3867 124 ext/dnsns.jar \
dholmes@3867 125 ext/localedata.jar \
dholmes@3867 126 $(LIBARCH)/client/classes.jsa \
dholmes@3867 127 $(LIBARCH)/libjavaplugin_jni.so \
dholmes@3867 128 $(LIBARCH)/libjavaplugin_nscp_gcc29.so \
dholmes@3867 129 $(LIBARCH)/libjavaplugin_nscp.so \
dholmes@3867 130 $(LIBARCH)/libjavaplugin_oji.so
dholmes@3867 131
dholmes@4254 132 # JRE docs that don't get included in reduced jre image top directory
dholmes@4254 133 NOT_REDUCEDJRE_DOC = \
dholmes@4254 134 Welcome.html
dholmes@3867 135
dholmes@3867 136 reduced-image-jre::
dholmes@3867 137 @$(ECHO) Starting to Produce Reduced JRE
dholmes@3867 138 @#
dholmes@3867 139 @# First make a copy of the full JRE
dholmes@3867 140 @#
dholmes@3867 141 $(RM) -r $(JRE_REDUCED_IMAGE_DIR)
dholmes@3867 142 $(MKDIR) -p $(JRE_REDUCED_IMAGE_DIR)
dholmes@3867 143 $(CD) $(JRE_IMAGE_DIR); \
dholmes@3867 144 $(TAR) cf - . | ($(CD) $(JRE_REDUCED_IMAGE_DIR); $(TAR) xf - );
dholmes@3867 145
dholmes@3867 146 @#
dholmes@3867 147 @# Remove all of the files that are not needed for the
dholmes@3867 148 @# reduced JRE
dholmes@3867 149 @#
dholmes@3884 150 for l in $(NOT_REDUCEDJRE_BIN) ; do \
dholmes@3867 151 $(RM) $(JRE_REDUCED_IMAGE_DIR)/bin/$$l ; \
dholmes@3867 152 done
dholmes@3884 153 for l in $(NOT_REDUCEDJRE_LIB) ; do \
dholmes@3867 154 $(RM) $(JRE_REDUCED_IMAGE_DIR)/lib/$$l ; \
dholmes@3867 155 done
dholmes@4254 156 for l in $(NOT_REDUCEDJRE_DOC) ; do \
dholmes@4254 157 $(RM) $(JRE_REDUCED_IMAGE_DIR)/$$l ; \
dholmes@4254 158 done
dholmes@3867 159
dholmes@3867 160 @# Remove misc. other files
dholmes@3867 161 $(RM) -r $(JRE_REDUCED_IMAGE_DIR)/man
dholmes@3867 162 $(RM) -f $(JRE_REDUCED_IMAGE_DIR)/CHANGES
dholmes@3867 163
dholmes@3867 164 @$(ECHO) Done Creating Reduced JRE
dholmes@3867 165
dholmes@3867 166 #
dholmes@3867 167 # Produce a reduced Headless JRE
dholmes@3867 168 #
dholmes@3867 169 reduced-headless-image-jre:: $(RT_JAR) $(RESOURCES_JAR) $(BUILD_META_INDEX) $(HL_RT_JAR)
dholmes@3867 170 @$(ECHO) Starting to Produce Reduced Headless JRE
dholmes@3867 171 @#
dholmes@3867 172 @# First make a copy of the reduced JRE we just built
dholmes@3867 173 @#
dholmes@3867 174 $(RM) -r $(JRE_REDUCED_HEADLESS_IMAGE_DIR)
dholmes@3867 175 $(MKDIR) -p $(JRE_REDUCED_HEADLESS_IMAGE_DIR)
dholmes@3867 176 $(CD) $(JRE_REDUCED_IMAGE_DIR); \
dholmes@3867 177 $(TAR) cf - . | ($(CD) $(JRE_REDUCED_HEADLESS_IMAGE_DIR); $(TAR) xf - );
dholmes@3867 178
dholmes@3867 179 @# Replace the full rt.jar with the headless rt.jar
dholmes@3867 180 $(RM) -f $(JRE_REDUCED_HEADLESS_IMAGE_DIR)/lib/rt.jar
dholmes@3867 181 $(CP) $(HL_RT_JAR) $(JRE_REDUCED_HEADLESS_IMAGE_DIR)/lib/rt.jar
dholmes@3867 182
dholmes@3867 183 @#
dholmes@3867 184 @# Remove all of the files that are not needed for the
dholmes@3867 185 @# reduced Headless JRE
dholmes@3867 186 @#
dholmes@3867 187 $(RM) -f $(JRE_REDUCED_HEADLESS_IMAGE_DIR)/lib/$(LIBARCH)/gtkhelper
dholmes@3867 188 $(RM) $(JRE_REDUCED_HEADLESS_IMAGE_DIR)/lib/$(LIBARCH)/libjsoundalsa.so
dholmes@3867 189 $(RM) -r $(JRE_REDUCED_HEADLESS_IMAGE_DIR)/lib/audio
dholmes@3867 190 $(RM) -fr $(JRE_REDUCED_HEADLESS_IMAGE_DIR)/lib/applet
dholmes@3867 191 $(RM) $(JRE_REDUCED_HEADLESS_IMAGE_DIR)/lib/$(LIBARCH)/awt_robot
dholmes@3867 192 $(RM) -r $(JRE_REDUCED_HEADLESS_IMAGE_DIR)/lib/$(LIBARCH)/xawt
dholmes@3867 193 $(RM) -r $(JRE_REDUCED_HEADLESS_IMAGE_DIR)/lib/$(LIBARCH)/libsplashscreen.so
dholmes@3867 194 @# Remove oblique fonts and reduce font support to LucidaSansRegular only
dholmes@3867 195 $(RM) -fr $(JRE_REDUCED_HEADLESS_IMAGE_DIR)/lib/oblique-fonts
dholmes@3867 196 $(RM) -f $(JRE_REDUCED_HEADLESS_IMAGE_DIR)/lib/fonts/LucidaBrightDemiBold.ttf
dholmes@3867 197 $(RM) -f $(JRE_REDUCED_HEADLESS_IMAGE_DIR)/lib/fonts/LucidaBrightDemiItalic.ttf
dholmes@3867 198 $(RM) -f $(JRE_REDUCED_HEADLESS_IMAGE_DIR)/lib/fonts/LucidaBrightItalic.ttf
dholmes@3867 199 $(RM) -f $(JRE_REDUCED_HEADLESS_IMAGE_DIR)/lib/fonts/LucidaBrightRegular.ttf
dholmes@3867 200 $(RM) -f $(JRE_REDUCED_HEADLESS_IMAGE_DIR)/lib/fonts/LucidaSansDemiBold.ttf
dholmes@3867 201 $(RM) -f $(JRE_REDUCED_HEADLESS_IMAGE_DIR)/lib/fonts/LucidaTypewriterBold.ttf
dholmes@3867 202 $(RM) -f $(JRE_REDUCED_HEADLESS_IMAGE_DIR)/lib/fonts/LucidaTypewriterRegular.ttf
dholmes@3867 203
dholmes@3867 204 ifeq ($(PLATFORM), linux)
dholmes@3867 205 # put out minimal fonts.dir file for the remaining font
dholmes@3867 206 $(RM) -f $(JRE_REDUCED_HEADLESS_IMAGE_DIR)/lib/fonts/fonts.dir
dholmes@3867 207 $(ECHO) 6>$(JRE_REDUCED_HEADLESS_IMAGE_DIR)/lib/fonts/fonts.dir
dholmes@3867 208 $(ECHO) "LucidaSansRegular.ttf -b&h-lucidasans-medium-r-normal-sans-0-0-0-0-p-0-iso8859-1">>$(JRE_REDUCED_HEADLESS_IMAGE_DIR)/lib/fonts/fonts.dir
dholmes@3867 209 $(ECHO) "LucidaSansRegular.ttf -b&h-lucidasans-medium-r-normal-sans-0-0-0-0-p-0-iso8859-2">>$(JRE_REDUCED_HEADLESS_IMAGE_DIR)/lib/fonts/fonts.dir
dholmes@3867 210 $(ECHO) "LucidaSansRegular.ttf -b&h-lucidasans-medium-r-normal-sans-0-0-0-0-p-0-iso8859-4">>$(JRE_REDUCED_HEADLESS_IMAGE_DIR)/lib/fonts/fonts.dir
dholmes@3867 211 $(ECHO) "LucidaSansRegular.ttf -b&h-lucidasans-medium-r-normal-sans-0-0-0-0-p-0-iso8859-5">>$(JRE_REDUCED_HEADLESS_IMAGE_DIR)/lib/fonts/fonts.dir
dholmes@3867 212 $(ECHO) "LucidaSansRegular.ttf -b&h-lucidasans-medium-r-normal-sans-0-0-0-0-p-0-iso8859-7">>$(JRE_REDUCED_HEADLESS_IMAGE_DIR)/lib/fonts/fonts.dir
dholmes@3867 213 $(ECHO) "LucidaSansRegular.ttf -b&h-lucidasans-medium-r-normal-sans-0-0-0-0-p-0-iso8859-9">>$(JRE_REDUCED_HEADLESS_IMAGE_DIR)/lib/fonts/fonts.dir
dholmes@3867 214
dholmes@3867 215 endif # Linux
dholmes@3867 216
dholmes@3867 217 @#
dholmes@3867 218 @# all done with JRE reduced headless image
dholmes@3867 219 @#
dholmes@3867 220
dholmes@3867 221 @$(ECHO) Done Creating Reduced Headless JRE
dholmes@3867 222
dholmes@3867 223 images-clobber::
dholmes@3867 224 $(RM) -r $(JRE_REDUCED_IMAGE_DIR)
dholmes@3867 225 $(RM) -r $(JRE_REDUCED_HEADLESS_IMAGE_DIR)
dholmes@3867 226
dholmes@3867 227 .PHONY: reduced-image-jre reduced-headless-image-jre
dholmes@3867 228
dholmes@3867 229 endif # JAVASE_EMBEDDED
dholmes@3867 230