OpenJDK / portola / portola
changeset 12318:17ed142e28eb
Merge
author | katleman |
---|---|
date | Wed, 11 Apr 2012 14:09:48 -0700 |
parents | a85906b77a4c 9670c1610c53 |
children | 92862e8ed4c6 |
files | |
diffstat | 319 files changed, 43864 insertions(+), 173 deletions(-) [+] |
line wrap: on
line diff
--- a/jdk/make/common/internal/Resources.gmk Mon Apr 09 21:57:17 2012 -0700 +++ b/jdk/make/common/internal/Resources.gmk Wed Apr 11 14:09:48 2012 -0700 @@ -153,8 +153,8 @@ # Strip the properties files strip_all_props: $(STRIPPROPERTIES_JARFILE) $(STRIP_PROP_options) @if [ -s $(STRIP_PROP_options) ] ; then \ - $(ECHO) "$(BOOT_JAVA_CMD) -jar $(STRIPPROPERTIES_JARFILE) -optionsfile $(STRIP_PROP_options)" ; \ - $(BOOT_JAVA_CMD) -jar $(STRIPPROPERTIES_JARFILE) -optionsfile $(STRIP_PROP_options) ; \ + $(ECHO) "$(BOOT_JAVA_CMD) -jar $(STRIPPROPERTIES_JARFILE) @$(STRIP_PROP_options)" ; \ + $(BOOT_JAVA_CMD) -jar $(STRIPPROPERTIES_JARFILE) @$(STRIP_PROP_options) ; \ fi @$(java-vm-cleanup) @@ -243,8 +243,8 @@ compile_all_props: $(COMPILEPROPERTIES_JARFILE) $(COMPILE_PROP_options) @if [ `$(CAT) $(COMPILE_PROP_options) | $(WC) -l` -ge 1 ] ; then \ $(MKDIR) -p $(GENSRCDIR); \ - $(ECHO) "$(BOOT_JAVA_CMD) -jar $(COMPILEPROPERTIES_JARFILE) -optionsfile $(COMPILE_PROP_options)";\ - $(BOOT_JAVA_CMD) -jar $(COMPILEPROPERTIES_JARFILE) -optionsfile $(COMPILE_PROP_options) ; \ + $(ECHO) "$(BOOT_JAVA_CMD) -jar $(COMPILEPROPERTIES_JARFILE) @$(COMPILE_PROP_options)";\ + $(BOOT_JAVA_CMD) -jar $(COMPILEPROPERTIES_JARFILE) @$(COMPILE_PROP_options) ; \ $(java-vm-cleanup); \ fi
--- a/jdk/make/tools/src/build/tools/compileproperties/CompileProperties.java Mon Apr 09 21:57:17 2012 -0700 +++ b/jdk/make/tools/src/build/tools/compileproperties/CompileProperties.java Wed Apr 11 14:09:48 2012 -0700 @@ -90,6 +90,7 @@ private static String outfiles[] ; private static String supers[] ; private static int compileCount = 0; + private static boolean quiet = false; private static boolean parseOptions(String args[]) { boolean ok = true; @@ -114,21 +115,21 @@ outfiles[compileCount] = args[++i]; supers[compileCount] = args[++i]; compileCount++; - } else if ( "-optionsfile".equals(args[i]) && i+1 < args.length ) { - String filename = args[++i]; + } else if ( args[i].charAt(0) == '@') { + String filename = args[i].substring(1); FileInputStream finput = null; byte contents[] = null; try { finput = new FileInputStream(filename); int byteCount = finput.available(); if ( byteCount <= 0 ) { - error("The -optionsfile file is empty", null); + error("The @file is empty", null); ok = false; } else { contents = new byte[byteCount]; int bytesRead = finput.read(contents); if ( byteCount != bytesRead ) { - error("Cannot read all of -optionsfile file", null); + error("Cannot read all of @file", null); ok = false; } } @@ -144,7 +145,7 @@ error("cannot close " + filename, e); } } - if ( ok = true && contents != null ) { + if ( ok && contents != null ) { String tokens[] = (new String(contents)).split("\\s+"); if ( tokens.length > 0 ) { ok = parseOptions(tokens); @@ -163,6 +164,13 @@ public static void main(String[] args) { boolean ok = true; + if (args.length >= 1 && args[0].equals("-quiet")) + { + quiet = true; + String[] newargs = new String[args.length-1]; + System.arraycopy(args, 1, newargs, 0, newargs.length); + args = newargs; + } /* Original usage */ if (args.length == 2 && args[0].charAt(0) != '-' ) { ok = createFile(args[0], args[1], "ListResourceBundle"); @@ -197,18 +205,20 @@ System.err.println("usage:"); System.err.println(" java -jar compileproperties.jar path_to_properties_file path_to_java_output_file [super_class]"); System.err.println(" -OR-"); - System.err.println(" java -jar compileproperties.jar {-compile path_to_properties_file path_to_java_output_file super_class} -or- -optionsfile filename"); + System.err.println(" java -jar compileproperties.jar {-compile path_to_properties_file path_to_java_output_file super_class} -or- @filename"); System.err.println(""); System.err.println("Example:"); System.err.println(" java -jar compileproperties.jar -compile test.properties test.java ListResourceBundle"); - System.err.println(" java -jar compileproperties.jar -optionsfile option_file"); + System.err.println(" java -jar compileproperties.jar @option_file"); System.err.println("option_file contains: -compile test.properties test.java ListResourceBundle"); } private static boolean createFile(String propertiesPath, String outputPath, String superClass) { boolean ok = true; - System.out.println("parsing: " + propertiesPath); + if (!quiet) { + System.out.println("parsing: " + propertiesPath); + } Properties p = new Properties(); try { p.load(new FileInputStream(propertiesPath)); @@ -221,7 +231,9 @@ } if ( ok ) { String packageName = inferPackageName(propertiesPath, outputPath); - System.out.println("inferred package name: " + packageName); + if (!quiet) { + System.out.println("inferred package name: " + packageName); + } List<String> sortedKeys = new ArrayList<>(); for ( Object key : p.keySet() ) { sortedKeys.add((String)key); @@ -276,7 +288,9 @@ error("IO error close " + outputPath, e); } } - System.out.println("wrote: " + outputPath); + if (!quiet) { + System.out.println("wrote: " + outputPath); + } } return ok; }
--- a/jdk/make/tools/src/build/tools/generatecharacter/CharacterScript.java Mon Apr 09 21:57:17 2012 -0700 +++ b/jdk/make/tools/src/build/tools/generatecharacter/CharacterScript.java Wed Apr 11 14:09:48 2012 -0700 @@ -1,3 +1,5 @@ +package build.tools.generatecharacter; + import java.util.regex.*; import java.util.*; import java.io.*;
--- a/jdk/make/tools/src/build/tools/stripproperties/StripProperties.java Mon Apr 09 21:57:17 2012 -0700 +++ b/jdk/make/tools/src/build/tools/stripproperties/StripProperties.java Wed Apr 11 14:09:48 2012 -0700 @@ -36,6 +36,7 @@ import java.io.InputStream; import java.util.ArrayList; import java.util.Enumeration; +import java.util.Iterator; import java.util.List; import java.util.Properties; @@ -53,82 +54,89 @@ } } - private static List<String> parseOptions(String args[]) { - List<String> files = new ArrayList<String>(); + private static List<String> infiles = new ArrayList<String>(); + private static List<String> outfiles = new ArrayList<String>(); + + private static boolean parseOptions(String args[]) { + boolean ok = true; + for ( int i = 0; i < args.length ; i++ ) { - if ( "-optionsfile".equals(args[i]) && i+1 < args.length ) { - String filename = args[++i]; + if ( "-clean".equals(args[i]) && i+2 < args.length ) { + infiles.add(args[++i]); + outfiles.add(args[++i]); + } else if ( args[i].charAt(0)=='@') { + String filename = args[i].substring(1); FileInputStream finput = null; byte contents[] = null; try { finput = new FileInputStream(filename); int byteCount = finput.available(); if ( byteCount <= 0 ) { - error("The -optionsfile file is empty", null); - files = null; + error("The @file is empty", null); + ok = false; } else { contents = new byte[byteCount]; int bytesRead = finput.read(contents); if ( byteCount != bytesRead ) { - error("Cannot read all of -optionsfile file", null); - files = null; + error("Cannot read all of @file", null); + ok = false; } } } catch ( IOException e ) { error("cannot open " + filename, e); - files = null; + ok = false; } if ( finput != null ) { try { finput.close(); } catch ( IOException e ) { - files = null; + ok = false; error("cannot close " + filename, e); } } - if ( files != null && contents != null ) { + if ( ok && contents != null ) { String tokens[] = (new String(contents)).split("\\s+"); if ( tokens.length > 0 ) { - List<String> ofiles = parseOptions(tokens); - if ( ofiles != null ) { - files.addAll(ofiles); - } else { - error("No files found in file", null); - files = null; - } + ok = parseOptions(tokens); } } - if ( files == null ) { + if ( !ok ) { break; } } else { - files.add(args[i]); + infiles.add(args[i]); + outfiles.add(args[i]); } } - return files; + return ok; } - private static boolean stripFiles(List<String> files) { + private static boolean stripFiles(List<String> infiles, List<String> outfiles) { boolean ok = true; - for ( String file : files ) { + Iterator<String> inIter = infiles.iterator(); + Iterator<String> outIter = outfiles.iterator(); + + for (; inIter.hasNext(); ) { + String infile = inIter.next(); + String outfile = outIter.next(); Properties prop = new Properties(); InputStream in = null; try { - in = new BufferedInputStream(new FileInputStream(file)); + in = new BufferedInputStream(new FileInputStream(infile)); prop.load(in); } catch ( FileNotFoundException e ) { - error("Cannot access file " + file, e); + error("Cannot access file " + infile, e); ok = false; } catch ( IOException e ) { - error("IO exception processing file " + file, e); + error("IO exception processing file " + infile, e); ok = false; } if ( in != null ) { try { in.close(); } catch ( IOException e ) { - error("IO exception closing file " + file, e); + error("IO exception closing file " + infile, e); ok = false; } } @@ -138,18 +146,18 @@ OutputStream out = null; try { - out = new FileOutputStream(file); + out = new FileOutputStream(outfile); storeProperties(prop, out); out.flush(); } catch ( IOException e ) { - error("IO exception processing file " + file, e); + error("IO exception processing file " + outfile, e); ok = false; } if ( out != null ) { try { out.close(); } catch ( IOException e ) { - error("IO exception closing file " + file, e); + error("IO exception closing file " + outfile, e); ok = false; } } @@ -166,8 +174,8 @@ * @param args Names of properties files to process and replace contents */ public static void main(String args[]) { - List<String> files = parseOptions(args); - if ( files == null || !stripFiles(files) ) { + boolean ok = parseOptions(args); + if ( !ok || !stripFiles(infiles, outfiles) ) { System.exit(1); } }
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jdk/makefiles/CompileDemos.gmk Wed Apr 11 14:09:48 2012 -0700 @@ -0,0 +1,352 @@ +# +# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# + +default: all + +include $(SPEC) +include MakeBase.gmk +include JavaCompilation.gmk +include NativeCompilation.gmk + +# Setup the java compilers for the JDK build. +include Setup.gmk + +# Append demo goals to this variable. +BUILD_DEMOS= + +# The demo structure and contents should really be cleaned up. +# Now every other demo has its own quirks where to put the +# READMEs and other files. + +################################################################################################## + +define SetupAppletDemo + $$(eval $$(call SetupJavaCompilation,BUILD_DEMO_APPLET_$1,\ + SETUP:=GENERATE_USINGJDKBYTECODE$2,\ + SRC:=$(JDK_TOPDIR)/src/$3share/demo/applets/$1,\ + BIN:=$(JDK_OUTPUTDIR)/newdemo/applets/$1,\ + COPY:=.html .java .xyz .obj .au .gif)) + BUILD_DEMOS += $$(BUILD_DEMO_APPLET_$1) +endef + +$(eval $(call SetupAppletDemo,ArcTest)) +$(eval $(call SetupAppletDemo,BarChart)) +$(eval $(call SetupAppletDemo,Blink)) +$(eval $(call SetupAppletDemo,CardTest)) +$(eval $(call SetupAppletDemo,Clock)) +$(eval $(call SetupAppletDemo,DitherTest)) +$(eval $(call SetupAppletDemo,DrawTest)) +$(eval $(call SetupAppletDemo,Fractal)) +$(eval $(call SetupAppletDemo,GraphicsTest)) +$(eval $(call SetupAppletDemo,MoleculeViewer)) +$(eval $(call SetupAppletDemo,NervousText)) +$(eval $(call SetupAppletDemo,SimpleGraph)) +$(eval $(call SetupAppletDemo,SortDemo)) +$(eval $(call SetupAppletDemo,SpreadSheet)) +# Build WireFrame without a server since it +# has a class Matrix3D that also exists in MoleculeViewer. +$(eval $(call SetupAppletDemo,WireFrame,_NOSERV)) + +ifndef OPENJDK + $(eval $(call SetupAppletDemo,Animator,,closed/)) + $(eval $(call SetupAppletDemo,GraphLayout,_NOSERV,closed/)) + $(eval $(call SetupAppletDemo,JumpingBox,,closed/)) + $(eval $(call SetupAppletDemo,TicTacToe,,closed/)) +endif + +################################################################################################## + +PATTERNS_TO_COPY=.html .txt .properties .js .gif .jpg .theme .data .opt README .c .h .png .ttf + +define SetupDemo + # Param 1 = Name of the demo + # Param 2 = Subdirectory of the demo below the demo directory. + # Param 3 = Additional javac flags. + # Param 4 = The main class for the jar. + # Param 5 = Additional source directory. + # Param 6 = Extra dir below $(JDK_TOPDIR)/src (closed) + # Param 7 = List of files to copy + # Param 8 = Base name of jar file. Defaults to $1 + # Param 9 = Exclude list + # Param 10 = Extra copy patterns + # Param 11 = Extra manifest attribute + # Param 12 = Suffix for compiler setup name + + # In some demos the source is found in a subdir called src. + $1_MAIN_SRC:=$$(wildcard $(JDK_TOPDIR)/src/$6share/demo/$2/$1/src) + ifeq ($$($1_MAIN_SRC),) + $1_MAIN_SRC:=$(JDK_TOPDIR)/src/$6share/demo/$2/$1 + endif + + ifneq ($8,) + $1_JARFILE := $8.jar + else + $1_JARFILE := $1.jar + endif + + # Compile java classes if there are any. + $1_JAVA_FILES_EXIST := $$(shell $$(FIND) $$($1_MAIN_SRC) -name "*.java") + + ifneq ($$($1_JAVA_FILES_EXIST),) + $$(eval $$(call SetupJavaCompilation,BUILD_DEMO_$1,\ + SETUP:=GENERATE_USINGJDKBYTECODE$(12),\ + ADD_JAVAC_FLAGS:=$3,\ + SRC:=$$($1_MAIN_SRC) $5,\ + BIN:=$(JDK_OUTPUTDIR)/newdemoclasses/$2/$1,\ + COPY:=$(PATTERNS_TO_COPY) $(10),\ + JAR:=$(JDK_OUTPUTDIR)/newdemo/$2/$1/$$($1_JARFILE),\ + JARMAIN:=$4,\ + MANIFEST:=$(JDK_TOPDIR)/make/tools/manifest.mf,\ + EXTRA_MANIFEST_ATTR:=$(11),\ + SRCZIP:=$(JDK_OUTPUTDIR)/newdemo/$2/$1/src.zip,\ + EXCLUDE_FILES:=$9)) + + BUILD_DEMOS += $$(BUILD_DEMO_$1) \ + $(JDK_OUTPUTDIR)/newdemo/$2/$1/$$($1_JARFILE) \ + $(JDK_OUTPUTDIR)/newdemo/$2/$1/src.zip + endif + + # Copy files. + $1_COPY_TARGETS := $$(patsubst $(JDK_TOPDIR)/src/$6share/demo/$2/$1/%,\ + $(JDK_OUTPUTDIR)/newdemo/$2/$1/%,\ + $$(wildcard $$(addprefix $(JDK_TOPDIR)/src/$6share/demo/$2/$1/,$7))) + ifneq ($7,) + $(JDK_OUTPUTDIR)/newdemo/$2/$1/% : $(JDK_TOPDIR)/src/$6share/demo/$2/$1/% + mkdir -p $$(@D) + cp $$< $$@ + chmod -f ug+w $$@ + + BUILD_DEMOS += $$($1_COPY_TARGETS) + endif + +endef + +$(eval $(call SetupDemo,CodePointIM,jfc,,CodePointIM,,,*.html)) +$(JDK_OUTPUTDIR)/newdemo/jfc/CodePointIM/_the.services : \ + $(JDK_OUTPUTDIR)/newdemo/jfc/CodePointIM/CodePointIM.jar \ + $(JDK_TOPDIR)/src/share/demo/jfc/CodePointIM/java.awt.im.spi.InputMethodDescriptor + (cd $(JDK_OUTPUTDIR)/newdemo/jfc/CodePointIM && \ + $(MKDIR) -p _the.tmp/META-INF/services && \ + $(CP) $(JDK_TOPDIR)/src/share/demo/jfc/CodePointIM/java.awt.im.spi.InputMethodDescriptor _the.tmp/META-INF/services && \ + cd _the.tmp && \ + $(JAR) uf $(JDK_OUTPUTDIR)/newdemo/jfc/CodePointIM/CodePointIM.jar META-INF/services/java.awt.im.spi.InputMethodDescriptor && \ + cd META-INF/services && \ + $(JAR) uf $(JDK_OUTPUTDIR)/newdemo/jfc/CodePointIM/CodePointIM.jar java.awt.im.spi.InputMethodDescriptor) + $(RM) -r $(JDK_OUTPUTDIR)/newdemo/jfc/CodePointIM/_the.tmp + touch $@ + +BUILD_DEMOS+=$(JDK_OUTPUTDIR)/newdemo/jfc/CodePointIM/_the.services + +$(eval $(call SetupDemo,FileChooserDemo,jfc,,FileChooserDemo,,,README*)) +$(eval $(call SetupDemo,Font2DTest,jfc,,Font2DTest,,,*.html *.txt)) +$(eval $(call SetupDemo,Metalworks,jfc,,Metalworks,,,README*)) +$(eval $(call SetupDemo,Notepad,jfc,,Notepad,,,README*)) +$(eval $(call SetupDemo,SampleTree,jfc,,SampleTree,,,README*)) +$(eval $(call SetupDemo,SwingApplet,jfc,,SwingApplet,,,README* *.html)) +$(eval $(call SetupDemo,TableExample,jfc,,TableExample,,,README*)) +$(eval $(call SetupDemo,TransparentRuler,jfc,,transparentruler.Ruler,,,README*)) +$(eval $(call SetupDemo,jconsole-plugin,scripting,-cp $(JDK_OUTPUTDIR)/lib/jconsole.jar,,,,*.xml *.txt)) +$(eval $(call SetupDemo,FullThreadDump,management,,FullThreadDump,,,README*)) +$(eval $(call SetupDemo,JTop,management,-cp $(JDK_OUTPUTDIR)/lib/jconsole.jar,JTop,,,README*)) +$(eval $(call SetupDemo,MemoryMonitor,management,,MemoryMonitor,,,README*)) +$(eval $(call SetupDemo,VerboseGC,management,,VerboseGC,,,README*)) +$(eval $(call SetupDemo,zipfs,nio,,,,,README* *.java)) + +ifndef OPENJDK + $(eval $(call SetupDemo,Laffy,jfc,,,,closed/,*)) + $(eval $(call SetupDemo,SwingSet3,jfc,,,,closed/,*)) + + $(eval $(call SetupDemo,Java2D,jfc,,java2d.Java2Demo,,closed/,*.html README*,Java2Demo)) + $(eval $(call SetupDemo,Stylepad,jfc,,Stylepad,\ + $(JDK_TOPDIR)/src/share/demo/jfc/Notepad,closed/,*.txt,,$(JDK_TOPDIR)/src/share/demo/jfc/Notepad/README.txt)) + $(eval $(call SetupDemo,SwingSet2,jfc,,SwingSet2,,closed/,README* *.html,,,.java COPYRIGHT,\ + SplashScreen-Image: resources/images/splash.png,_NOSERV)) + + BUILD_DEMOS += $(patsubst $(JDK_TOPDIR)/src/closed/share/demo/nbproject/%,\ + $(JDK_OUTPUTDIR)/newdemo/nbproject/%,\ + $(shell $(FIND) $(JDK_TOPDIR)/src/closed/share/demo/nbproject/ -type f)) + $(JDK_OUTPUTDIR)/newdemo/nbproject/% : $(JDK_TOPDIR)/src/closed/share/demo/nbproject/% + mkdir -p $(@D) + cp $< $@ + chmod -f ug+w $@ +endif + +################################################################################################## + +# Why do we install a demo jar into the main jre/lib/ext???????????????? +$(JDK_OUTPUTDIR)/lib/ext/zipfs.jar : $(JDK_OUTPUTDIR)/newdemo/nio/zipfs/zipfs.jar + $(MKDIR) -p $(@D) + $(CP) $< $@ + +BUILD_DEMOS += $(JDK_OUTPUTDIR)/lib/ext/zipfs.jar + +################################################################################################## + +# In the old makefiles, j2dbench was not compiled. +#$(eval $(call SetupDemo,J2DBench,java2d,/src,,j2dbench/J2DBench)) + +define SetupJVMTIDemo + # Param 1 = Name of the demo + # Param 2 = add these directories to the includes, default is agent_util + # Param 3 = extra CFLAGS + # Param 4 = C or C++ (defaults to C) + # Param 5 = libs for posix + # Param 6 = libs for winapi + # Param 7 = libs for solaris + BUILD_DEMO_JVMTI_$1_EXTRA_SRC:= $$(wildcard $(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)/demo/jvmti/$1) \ + $$(wildcard $$(addprefix $(JDK_TOPDIR)/src/share/demo/jvmti/,$2)) + BUILD_DEMO_JVMTI_$1_EXTRA_INC:=$$(addprefix -I,$$(BUILD_DEMO_JVMTI_$1_EXTRA_SRC)) + BUILD_DEMO_JVMTI_$1_LANG:=C + BUILD_DEMO_JVMTI_$1_O_FLAG:=$(C_O_FLAG_NORM) + ifneq (,$4) + BUILD_DEMO_JVMTI_$1_LANG:=$4 + endif + ifeq (C++,$4) + $1_EXTRA_CXX:=$(LIBCXX) + BUILD_DEMO_JVMTI_$1_O_FLAG:=$(CXX_O_FLAG_NORM) + endif + $$(eval $$(call SetupNativeCompilation,BUILD_DEMO_JVMTI_$1,\ + SRC:=$(JDK_TOPDIR)/src/share/demo/jvmti/$1 $$(BUILD_DEMO_JVMTI_$1_EXTRA_SRC),\ + LANG:=$$(BUILD_DEMO_JVMTI_$1_LANG),\ + CFLAGS:=$(CFLAGS_JDKLIB) $$(BUILD_DEMO_JVMTI_$1_O_FLAG) -I$(JDK_TOPDIR)/src/share/demo/jvmti/$1 $$(BUILD_DEMO_JVMTI_$1_EXTRA_INC) $3,\ + LDFLAGS:=$(LDFLAGS_JDKLIB),\ + LDFLAGS_SUFFIX:=$$($1_EXTRA_CXX),\ + LDFLAGS_SUFFIX_posix:=$5,\ + LDFLAGS_SUFFIX_winapi:=$6,\ + LDFLAGS_SUFFIX_solaris:=-lc $7,\ + BIN:=$(JDK_OUTPUTDIR)/newdemoobjs/jvmti/$1,\ + LIB:=$(JDK_OUTPUTDIR)/newdemo/jvmti/$1/lib/$(LIBRARY_PREFIX)$1$(SHARED_LIBRARY_SUFFIX))) + + $$(eval $$(call SetupZipArchive,BUILD_DEMO_JVMTI_SRC_$1,\ + SRC:=$(JDK_TOPDIR)/src/share/demo/jvmti/$1 $$(BUILD_DEMO_JVMTI_$1_EXTRA_SRC),\ + ZIP:=$(JDK_OUTPUTDIR)/newdemo/jvmti/$1/src.zip)) + + $(JDK_OUTPUTDIR)/newdemo/jvmti/$1/README.txt : $(JDK_TOPDIR)/src/share/demo/jvmti/$1/README.txt + $(MKDIR) -p $$(@D) + $(CP) $$< $$@ + $(CHMOD) -f ug+w $$@ + + ifneq (,$$(wildcard $(JDK_TOPDIR)/src/share/demo/jvmti/$1/*.java)) + $$(eval $$(call SetupJavaCompilation,BUILD_DEMO_JVMTI_$1_JAVA,\ + SETUP:=GENERATE_USINGJDKBYTECODE,\ + SRC:=$(JDK_TOPDIR)/src/share/demo/jvmti/$1,\ + BIN:=$(JDK_OUTPUTDIR)/newdemoclasses/jvmti/$1,\ + COPY:=$(PATTERNS_TO_COPY),\ + JAR:=$(JDK_OUTPUTDIR)/newdemo/jvmti/$1/$1.jar,\ + JARMAIN:=,\ + MANIFEST:=$(JDK_TOPDIR)/make/tools/manifest.mf)) + + BUILD_DEMOS += $(JDK_OUTPUTDIR)/newdemo/jvmti/$1/$1.jar + endif + + BUILD_DEMOS += $(JDK_OUTPUTDIR)/newdemo/jvmti/$1/lib/$(LIBRARY_PREFIX)$1$(SHARED_LIBRARY_SUFFIX) \ + $(JDK_OUTPUTDIR)/newdemo/jvmti/$1/src.zip \ + $(JDK_OUTPUTDIR)/newdemo/jvmti/$1/README.txt +endef + +$(eval $(call SetupJVMTIDemo,compiledMethodLoad, agent_util)) +$(eval $(call SetupJVMTIDemo,gctest, agent_util)) +$(eval $(call SetupJVMTIDemo,heapTracker, agent_util java_crw_demo)) +$(eval $(call SetupJVMTIDemo,heapViewer, agent_util)) +# hprof contains error messages using __FILE__ macro. These expand to the absolute path +# in the new build system and relative in the old, causing the binaries to differ. +$(eval $(call SetupJVMTIDemo,hprof, java_crw_demo,\ + -I$(JDK_TOPDIR)/src/share/npt -I$(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)/npt,C,\ + -ldl,ws2_32.lib winmm.lib,-lsocket -lnsl)) + +$(eval $(call SetupJVMTIDemo,minst, agent_util java_crw_demo)) +$(eval $(call SetupJVMTIDemo,mtrace, agent_util java_crw_demo)) +$(eval $(call SetupJVMTIDemo,waiters, agent_util,,C++)) +$(eval $(call SetupJVMTIDemo,versionCheck, agent_util)) + +################################################################################################## + +# The jpda demo (com/sun/tools/example) is oddly enough stored in src/share/classes. +# At least, we do not need to compile the jpda demo, just jar/zip up the sources. +JPDA_SOURCES:=$(shell $(FIND) $(JDK_TOPDIR)/src/share/classes/com/sun/tools/example -type f) +# The number of files are few enough so that we can use echo safely below to list them. +JPDA_FILES:=$(subst $(JDK_TOPDIR)/src/share/classes/,,$(JPDA_SOURCES)) + +$(JDK_OUTPUTDIR)/newdemo/jpda/src.zip : $(JPDA_SOURCES) + mkdir -p $(@D) + (cd $(JDK_TOPDIR)/src/share/classes && $(ZIP) -qru $@ com -i "com/sun/tools/example/*") + +$(JDK_OUTPUTDIR)/newdemo/jpda/examples.jar : $(JPDA_SOURCES) + mkdir -p $(@D) + $(RM) $(@D)/_the.sources + $(call ListPathsSafely,JPDA_FILES,\n, >> $(@D)/_the.sources) + $(SED) -e "s#@@RELEASE@@#$(RELEASE)#" \ + -e "s#@@COMPANY_NAME@@#$(COMPANY_NAME)#" $(JDK_TOPDIR)/make/tools/manifest.mf > $(@D)/_the.manifest + $(ECHO) "Main-Class: " >> $(@D)/_the.manifest + (cd $(JDK_TOPDIR)/src/share/classes && $(JAR) cfm $@ $(@D)/_the.manifest @$(@D)/_the.sources) + (cd $(JDK_TOPDIR)/src/share/classes/com/sun/tools/example && $(JAR) uf $@ README) + +$(JDK_OUTPUTDIR)/newdemo/jpda/com/sun/tools/example/README : $(JDK_TOPDIR)/src/share/classes/com/sun/tools/example/README + mkdir -p $(@D) + $(CP) $< $@ + $(CHMOD) -f ug+w $@ + +BUILD_DEMOS += $(JDK_OUTPUTDIR)/newdemo/jpda/src.zip $(JDK_OUTPUTDIR)/newdemo/jpda/examples.jar \ + $(JDK_OUTPUTDIR)/newdemo/jpda/com/sun/tools/example/README + +################################################################################################## + +$(JDK_OUTPUTDIR)/newdemo/management/index.html : $(JDK_TOPDIR)/src/share/demo/management/index.html + mkdir -p $(@D) + $(CP) $< $@ + $(CHMOD) -f ug+w $@ + +$(JDK_OUTPUTDIR)/newdemo/jvmti/index.html : $(JDK_TOPDIR)/src/share/demo/jvmti/index.html + mkdir -p $(@D) + $(CP) $< $@ + $(CHMOD) -f ug+w $@ + +BUILD_DEMOS += $(JDK_OUTPUTDIR)/newdemo/management/index.html \ + $(JDK_OUTPUTDIR)/newdemo/jvmti/index.html + +################################################################################################## + +# The netbeans project files are copied into the demo directory. + +NETBEANS_DEMO_PROJECTS_FILES=$(shell $(FIND) $(JDK_TOPDIR)/src/share/demo/nbproject -type f) + +$(JDK_OUTPUTDIR)/newdemo/_the.nbproject: $(NETBEANS_DEMO_PROJECTS_FILES) + $(MKDIR) -p $(JDK_OUTPUTDIR)/newdemo + $(RM) -rf $(JDK_OUTPUTDIR)/newdemo/nbproject + echo Copying Netbeans demo projects + (cd $(JDK_TOPDIR)/src/share/demo && cp -r nbproject $(JDK_OUTPUTDIR)/newdemo) + touch $@ + +################################################################################################## + +$(JDK_OUTPUTDIR)/newdemo/README : $(JDK_TOPDIR)/src/share/demo/README + mkdir -p $(@D) + cp $< $@ + +################################################################################################## + +all: $(BUILD_DEMOS) $(JDK_OUTPUTDIR)/newdemo/_the.nbproject $(JDK_OUTPUTDIR)/newdemo/README + +.PHONY: all
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jdk/makefiles/CompileJavaClasses.gmk Wed Apr 11 14:09:48 2012 -0700 @@ -0,0 +1,243 @@ +# +# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# + +default: all + +include $(SPEC) +include MakeBase.gmk +include JavaCompilation.gmk + +# Setup the java compilers for the JDK build. +include Setup.gmk + +EXCLUDES:= sun/dc \ + sun/security/pkcs11 \ + com/sun/pept \ + com/sun/tools/example/trace\ + com/sun/tools/example/debug/bdi\ + com/sun/tools/example/debug/event\ + com/sun/tools/example/debug/gui \ + javax/crypto \ + com/oracle/security + +ifdef OPENJDK + EXCLUDES+= com/sun/jmx/snmp \ + sun/management/snmp \ + com/sun/script +endif + +ifneq ($(PLATFORM),solaris) + # Exclude Solaris nio and two security related files in src/share/classes + EXFILES:=SolarisAclFileAttributeView.java \ + SolarisFileStore.java \ + SolarisFileSystem.java \ + SolarisFileSystemProvider.java \ + SolarisNativeDispatcher.java \ + SolarisUserDefinedFileAttributeView.java \ + SolarisWatchService.java \ + DevPollArrayWrapper.java \ + DevPollSelectorImpl.java \ + DevPollSelectorProvider.java \ + SolarisAsynchronousChannelProvider.java \ + SolarisEventPort.java \ + SolarisAclFileAttributeView.java \ + SolarisFileStore.java \ + SolarisFileSystem.java \ + SolarisFileSystemProvider.java \ + SolarisUserDefinedFileAttributeView.java \ + SolarisNativeDispatcher.java \ + SolarisWatchService.java \ + SolarisLoginModule.java \ + SolarisSystem.java \ + sun/tools/attach/SolarisAttachProvider.java \ + sun/tools/attach/SolarisVirtualMachine.java +endif + +# Why? +EXFILES+=WrapperGenerator.java + +ifneq ($(PLATFORM),windows) + # Exclude Window security related files in src/share/classes + EXFILES+=NTLoginModule.java \ + NTSystem.java + +endif + +ifeq ($(PLATFORM),windows) + # Does nio channels exist on Windows? + EXCLUDES+=sun/nio/ch +endif + +ifneq ($(PLATFORM),linux) + EXCLUDES+=com/sun/java/swing/plaf/gtk + EXFILES+=sun/tools/attach/LinuxAttachProvider.java \ + sun/tools/attach/LinuxVirtualMachine.java +endif + +ifneq ($(PLATFORM),macosx) + EXFILES+=sun/nio/fs/BsdFileStore.java \ + sun/nio/fs/BsdFileSystem.java \ + sun/nio/fs/BsdFileSystemProvider.java \ + sun/nio/fs/BsdNativeDispatcher.java \ + sun/tools/attach/BsdAttachProvider.java \ + sun/tools/attach/BsdVirtualMachine.java +endif + +# Generated nimbus files that apparently should not be compiled... +EXFILES+=InternalFrameTitlePanePainter.java \ + OptionPaneMessageAreaPainter.java \ + ScrollBarPainter.java \ + SliderPainter.java \ + SpinnerPainter.java \ + SplitPanePainter.java \ + TabbedPanePainter.java + +# New class /java/lang/annotation/ContainerAnnotation.java is not included in old +# build +EXFILES+=java/lang/annotation/ContainerAnnotation.java + +# Exclude BreakIterator classes that are just used in compile process to generate +# data files and shouldn't go in the product +EXFILES+=sun/text/resources/BreakIteratorRules.java \ + sun/text/resources/BreakIteratorRules_th.java + +# TODO: Add BUILD_HEADLESS_ONLY to configure? +ifdef BUILD_HEADLESS_ONLY + EXCLUDES+=sun/applet +endif + +ifdef OPENJDK + EXCLUDES+=sun/java2d/cmm/kcms +else + EXCLUDES+=sun/java2d/cmm/lcms +endif + +# Not used on windows +ifneq ($(PLATFORM), windows) + EXFILES+=sun/awt/AWTCharset.java +endif + +# Exclude some generated AWT files that were implicitly not included by the old build. +EXFILES+=sun/awt/X11/ScreenFormat.java \ + sun/awt/X11/XArc.java \ + sun/awt/X11/XChar2b.java \ + sun/awt/X11/XCharStruct.java \ + sun/awt/X11/XClassHint.java \ + sun/awt/X11/XComposeStatus.java \ + sun/awt/X11/XExtCodes.java \ + sun/awt/X11/XFontProp.java \ + sun/awt/X11/XFontSetExtents.java \ + sun/awt/X11/XFontStruct.java \ + sun/awt/X11/XGCValues.java \ + sun/awt/X11/XHostAddress.java \ + sun/awt/X11/XIMCallback.java \ + sun/awt/X11/XIMHotKeyTrigger.java \ + sun/awt/X11/XIMHotKeyTriggers.java \ + sun/awt/X11/XIMPreeditCaretCallbackStruct.java \ + sun/awt/X11/XIMPreeditDrawCallbackStruct.java \ + sun/awt/X11/XIMPreeditStateNotifyCallbackStruct.java \ + sun/awt/X11/XIMStatusDrawCallbackStruct.java \ + sun/awt/X11/XIMStringConversionCallbackStruct.java \ + sun/awt/X11/XIMStringConversionText.java \ + sun/awt/X11/XIMStyles.java \ + sun/awt/X11/XIMText.java \ + sun/awt/X11/XIMValuesList.java \ + sun/awt/X11/XImage.java \ + sun/awt/X11/XKeyboardControl.java \ + sun/awt/X11/XKeyboardState.java \ + sun/awt/X11/XOMCharSetList.java \ + sun/awt/X11/XOMFontInfo.java \ + sun/awt/X11/XOMOrientation.java \ + sun/awt/X11/XPoint.java \ + sun/awt/X11/XRectangle.java \ + sun/awt/X11/XSegment.java \ + sun/awt/X11/XStandardColormap.java \ + sun/awt/X11/XTextItem.java \ + sun/awt/X11/XTextItem16.java \ + sun/awt/X11/XTextProperty.java \ + sun/awt/X11/XTimeCoord.java \ + sun/awt/X11/XWindowChanges.java \ + sun/awt/X11/XdbeSwapInfo.java \ + sun/awt/X11/XmbTextItem.java \ + sun/awt/X11/XwcTextItem.java + +# Exclude sun/security files that should go in a separate jar +EXFILES+=sun/security/ec/ECDHKeyAgreement.java \ + sun/security/ec/ECDSASignature.java \ + sun/security/ec/ECKeyPairGenerator.java \ + sun/security/ec/SunEC$1.java \ + sun/security/ec/SunEC.java \ + sun/security/ec/SunECEntries.java + +# Exclude another implicitly not included file. +EXFILES+=sun/util/locale/AsciiUtil.java + +ifeq ($(PLATFORM), linux) + EXFILES+=sun/nio/fs/PollingWatchService.java +endif + +# TODO: Fix when converting NIO +# Exclude *-linux-arm.java and *-linux-ppc.java from closed. +EXFILES+=-linux-arm.java \ + -linux-ppc.java + +# TODO: Is this necessary? +ifeq ($(PLATFORM), windows) + EXFILES+=sun/net/sdp/SdpProvider.java +else + EXFILES+=sun/net/www/protocol/http/ntlm/NTLMAuthSequence.java +endif + +# Acquire a list of files that should be copied straight over to the classes. +include CopyIntoClasses.gmk +# Now we have COPY_PATTERNS, COPY_FILES and COPY_EXTRA + +ifndef OPENJDK + CLOSED_SRC_DIRS:=$(JDK_TOPDIR)/src/closed/share/classes \ + $(JDK_TOPDIR)/src/closed/$(LEGACY_HOST_OS_API)/classes +endif + +$(eval $(call SetupJavaCompilation,BUILD_JDK,\ + SETUP:=GENERATE_JDKBYTECODE,\ + SRC:=$(JDK_TOPDIR)/src/share/classes \ + $(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)/classes \ + $(JDK_OUTPUTDIR)/gensrc \ + $(CLOSED_SRC_DIRS),\ + EXCLUDES:=$(EXCLUDES),\ + EXCLUDE_FILES:=$(EXFILES),\ + BIN:=$(JDK_OUTPUTDIR)/newclasses,\ + COPY:=$(COPY_PATTERNS),\ + COPY_FILES:=$(COPY_FILES),\ + JAR:=$(JDK_OUTPUTDIR)/newrt.jar,\ + HEADERS:=$(JDK_OUTPUTDIR)/gensrc_headers)) + +# copy with -a to preserve timestamps so dependencies down the line aren't messed up +all: $(BUILD_JDK) $(JDK_OUTPUTDIR)/newrt.jar $(COPY_EXTRA) + (cd $(JDK_OUTPUTDIR); \ + $(CP) -rp newclasses/* classes; \ + $(FIND) classes -name "_the.*" $(FIND_DELETE); \ + $(TOUCH) $(JDK_OUTPUTDIR)/classes/META-INF/services/com.sun.tools.xjc.Plugin) + +.PHONY: all
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jdk/makefiles/CompileLaunchers.gmk Wed Apr 11 14:09:48 2012 -0700 @@ -0,0 +1,360 @@ +# +# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# + +defalt: all + +include $(SPEC) +include MakeBase.gmk +include NativeCompilation.gmk + +# Setup the java compilers for the JDK build. +include Setup.gmk + +BUILD_LAUNCHERS= + +define SetupLauncher + # TODO: Fix mapfile on solaris. Won't work with ld as linker. + # Parameter 1 is the name of the launcher (java,javac,jar...) + # Parameter 2 are extra CFLAGS + # Parameter 3 are extra LDFLAGS + # Parameter 4 are extra LDFLAGS_SUFFIX_posix + # Parameter 5 are extra LDFLAGS_SUFFIX_winapi + $(call SetupNativeCompilation,BUILD_LAUNCHER_$1,\ + SRC:=$(JDK_TOPDIR)/src/share/bin,\ + INCLUDE_FILES:=main.c,\ + LANG:=C,\ + CFLAGS:=$(CFLAGS_JDKEXE) $(C_O_FLAG_NORM) \ + -I$(JDK_TOPDIR)/src/share/bin \ + -I$(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)/bin \ + -I$(JDK_TOPDIR)/src/$(PLATFORM)/bin \ + -DFULL_VERSION='"$(FULL_VERSION)"' \ + -DJDK_MAJOR_VERSION='"$(JDK_MAJOR_VERSION)"' \ + -DJDK_MINOR_VERSION='"$(JDK_MINOR_VERSION)"' \ + -DLIBARCHNAME='"$(ARCH)"' \ + -DLAUNCHER_NAME='"openjdk"' \ + -DPROGNAME='"$1"' $(DPACKAGEPATH) \ + $2,\ + CFLAGS_linux:=-fPIC,\ + LDFLAGS:=$(LDFLAGS_JDKEXE) \ + $(call SET_SHARED_LIBRARY_ORIGIN,../lib/$(LIBARCH)/jli) \ + $(call SET_SHARED_LIBRARY_ORIGIN,../jre/lib/$(LIBARCH)/jli) \ + $3,\ + LDFLAGS_linux:=$(call SET_SHARED_LIBRARY_MAPFILE,makefiles/mapfiles/launchers/mapfile-$(ARCH)),\ + LDFLAGS_SUFFIX:=$(LDFLAGS_JDKEXE_SUFFIX),\ + LDFLAGS_SUFFIX_posix:=$4 -lc,\ + LDFLAGS_SUFFIX_winapi:=$5,\ + BIN:=$(JDK_OUTPUTDIR)/newobjs/$1_objs,\ + EXE:=$(JDK_OUTPUTDIR)/newobjs/$1$(EXE_SUFFIX),\ + VERSIONINFO_RESOURCE:=$(JDK_TOPDIR)/src/windows/resource/version.rc,\ + RC_FLAGS:=$(RC_FLAGS)\ + /D "JDK_FNAME=$1$(EXE_SUFFIX)" \ + /D "JDK_INTERNAL_NAME=$1" \ + /D "JDK_FTYPE=0x1L") + + BUILD_LAUNCHERS += $(JDK_OUTPUTDIR)/newobjs/$1$(EXE_SUFFIX) $(JDK_OUTPUTDIR)/bin/$1$(EXE_SUFFIX) +endef + +########################################################################################## + +XLIBS:=-lX11 +ifeq ($(PLATFORM),macosx) + DPACKAGEPATH:=-DPACKAGE_PATH='"$(PACKAGE_PATH)"' + XLIBS:= +endif + +$(eval $(call SetupLauncher,java,\ + -DEXPAND_CLASSPATH_WILDCARDS)) + +ifeq ($(PLATFORM),solaris) + THREAD_LIB:=-lthread +endif +ifeq ($(PLATFORM),linux) + THREAD_LIB:=-lpthread +endif + +ifndef BUILD_HEADLESS_ONLY +$(eval $(call SetupLauncher,appletviewer,\ + -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "sun.applet.Main"$(COMMA) }',,\ + $(THREAD_LIB) $(XLIBS) -ldl)) +endif + +$(eval $(call SetupLauncher,extcheck,\ + -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "com.sun.tools.extcheck.Main"$(COMMA) }')) + +$(eval $(call SetupLauncher,idlj,\ + -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "com.sun.tools.corba.se.idl.toJavaPortable.Compile"$(COMMA) }')) + +$(eval $(call SetupLauncher,jar,\ + -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "sun.tools.jar.Main"$(COMMA) }')) + +$(eval $(call SetupLauncher,jarsigner,\ + -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "sun.security.tools.JarSigner"$(COMMA) }')) + +$(eval $(call SetupLauncher,javac,\ + -DEXPAND_CLASSPATH_WILDCARDS \ + -DNEVER_ACT_AS_SERVER_CLASS_MACHINE \ + -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "com.sun.tools.javac.Main"$(COMMA) }')) + +$(eval $(call SetupLauncher,javadoc,\ + -DEXPAND_CLASSPATH_WILDCARDS \ + -DNEVER_ACT_AS_SERVER_CLASS_MACHINE \ + -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "com.sun.tools.javadoc.Main"$(COMMA) }')) + +$(eval $(call SetupLauncher,javah,\ + -DEXPAND_CLASSPATH_WILDCARDS \ + -DNEVER_ACT_AS_SERVER_CLASS_MACHINE \ + -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "com.sun.tools.javah.Main"$(COMMA) }')) + +$(eval $(call SetupLauncher,javap,\ + -DEXPAND_CLASSPATH_WILDCARDS \ + -DNEVER_ACT_AS_SERVER_CLASS_MACHINE \ + -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "com.sun.tools.javap.Main"$(COMMA) }')) + +BUILD_LAUNCHER_jconsole_CPPFLAGS_windows:=-DJAVAW +BUILD_LAUNCHER_jconsole_LDFLAGS_windows:=user32.lib + +$(eval $(call SetupLauncher,jconsole,\ + -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "-J-Djconsole.showOutputViewer"$(COMMA) "sun.tools.jconsole.JConsole"$(COMMA) }' \ + -DAPP_CLASSPATH='{ "/lib/jconsole.jar"$(COMMA) "/lib/tools.jar"$(COMMA) "/classes" }')) + +$(eval $(call SetupLauncher,jdb,\ + -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "com.sun.tools.example.debug.tty.TTY"$(COMMA) }' \ + -DAPP_CLASSPATH='{ "/lib/tools.jar"$(COMMA) "/lib/sa-jdi.jar"$(COMMA) "/classes" }')) + +$(eval $(call SetupLauncher,jhat,\ + -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "com.sun.tools.hat.Main"$(COMMA) }')) + +$(eval $(call SetupLauncher,jinfo,\ + -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) \ + "-J-Dsun.jvm.hotspot.debugger.useProcDebugger"$(COMMA) \ + "-J-Dsun.jvm.hotspot.debugger.useWindbgDebugger"$(COMMA) \ + "sun.tools.jinfo.JInfo"$(COMMA) }' \ + -DAPP_CLASSPATH='{ "/lib/tools.jar"$(COMMA) "/lib/sa-jdi.jar"$(COMMA) "/classes" }')) + +$(eval $(call SetupLauncher,jmap,\ + -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) \ + "-J-Dsun.jvm.hotspot.debugger.useProcDebugger"$(COMMA) \ + "-J-Dsun.jvm.hotspot.debugger.useWindbgDebugger"$(COMMA) \ + "sun.tools.jmap.JMap"$(COMMA) }' \ + -DAPP_CLASSPATH='{ "/lib/tools.jar"$(COMMA) "/lib/sa-jdi.jar"$(COMMA) "/classes" }')) + +$(eval $(call SetupLauncher,jps,\ + -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "sun.tools.jps.Jps"$(COMMA) }')) + +$(eval $(call SetupLauncher,jrunscript,\ + -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "com.sun.tools.script.shell.Main"$(COMMA) }')) + +$(eval $(call SetupLauncher,jsadebugd,\ + -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "sun.jvm.hotspot.jdi.SADebugServer"$(COMMA) }' \ + -DAPP_CLASSPATH='{ "/lib/tools.jar"$(COMMA) "/lib/sa-jdi.jar"$(COMMA) "/classes" }')) + +$(eval $(call SetupLauncher,jstack,\ + -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) \ + "-J-Dsun.jvm.hotspot.debugger.useProcDebugger"$(COMMA) \ + "-J-Dsun.jvm.hotspot.debugger.useWindbgDebugger"$(COMMA) \ + "sun.tools.jstack.JStack"$(COMMA) }' \ + -DAPP_CLASSPATH='{ "/lib/tools.jar"$(COMMA) "/lib/sa-jdi.jar"$(COMMA) "/classes" }')) + +$(eval $(call SetupLauncher,jstat,\ + -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "sun.tools.jstat.Jstat"$(COMMA) }')) + +$(eval $(call SetupLauncher,jstatd,\ + -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "sun.tools.jstatd.Jstatd"$(COMMA) }')) + +$(eval $(call SetupLauncher,keytool,\ + -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "sun.security.tools.KeyTool"$(COMMA) }')) + +$(eval $(call SetupLauncher,native2ascii,\ + -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "sun.tools.native2ascii.Main"$(COMMA) }')) + +ifndef BUILD_HEADLESS_ONLY +$(eval $(call SetupLauncher,policytool,\ + -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "sun.security.tools.policytool.PolicyTool"$(COMMA) }')) +endif + +$(eval $(call SetupLauncher,rmic,\ + -DEXPAND_CLASSPATH_WILDCARDS \ + -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "sun.rmi.rmic.Main"$(COMMA) }')) + +$(eval $(call SetupLauncher,schemagen,\ + -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "com.sun.tools.internal.jxc.SchemaGenerator"$(COMMA) }')) + +$(eval $(call SetupLauncher,serialver,\ + -DEXPAND_CLASSPATH_WILDCARDS \ + -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "sun.tools.serialver.SerialVer"$(COMMA) }')) + +$(eval $(call SetupLauncher,xjc,\ + -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "com.sun.tools.internal.xjc.Driver"$(COMMA) }')) + +$(eval $(call SetupLauncher,wsgen,\ + -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "com.sun.tools.internal.ws.WsGen"$(COMMA) }')) + +$(eval $(call SetupLauncher,wsimport,\ + -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "com.sun.tools.internal.ws.WsImport"$(COMMA) }')) + +$(eval $(call SetupLauncher,orbd,\ + -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) \ + "-J-Dcom.sun.CORBA.activation.DbDir=./orb.db"$(COMMA) \ + "-J-Dcom.sun.CORBA.activation.Port=1049"$(COMMA) \ + "-J-Dcom.sun.CORBA.POA.ORBServerId=1"$(COMMA) \ + "com.sun.corba.se.impl.activation.ORBD"$(COMMA) }')) + +$(eval $(call SetupLauncher,servertool,\ + -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "com.sun.corba.se.impl.activation.ServerTool"$(COMMA) }')) + +$(eval $(call SetupLauncher,tnameserv,\ + -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) \ + "-J-Dcom.sun.CORBA.activation.DbDir=./orb.db"$(COMMA) \ + "-J-Djava.util.logging.LoggingPermission=contol"$(COMMA) \ + "-J-Dcom.sun.CORBA.POA.ORBServerId=1"$(COMMA) \ + "com.sun.corba.se.impl.naming.cosnaming.TransientNameServer"$(COMMA) }')) + +$(eval $(call SetupLauncher,pack200,\ + -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "com.sun.java.util.jar.pack.Driver"$(COMMA) "--pack" }')) + +$(eval $(call SetupLauncher,rmid,\ + -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "sun.rmi.server.Activation"$(COMMA) }')) + +$(eval $(call SetupLauncher,rmiregistry,\ + -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "sun.rmi.registry.RegistryImpl"$(COMMA) }')) + +$(eval $(call SetupLauncher,jcmd,\ + -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "sun.tools.jcmd.JCmd"$(COMMA) }')) + +ifeq ($(PLATFORM),windows) + $(eval $(call SetupLauncher,kinit,\ + -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "sun.security.krb5.internal.tools.Kinit"$(COMMA) }')) + + $(eval $(call SetupLauncher,klist,\ + -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "sun.security.krb5.internal.tools.Klist"$(COMMA) }')) + + $(eval $(call SetupLauncher,ktab,\ + -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "sun.security.krb5.internal.tools.Ktab"$(COMMA) }')) +endif + +########################################################################################## +# The order of the object files on the link command line affects the size of the resulting +# binary (at least on linux) which causes the size to differ between old and new build. +UNPACKEXE_ZIPOBJS = $(JDK_OUTPUTDIR)/newobjs/libzip/zcrc32$(OBJ_SUFFIX) \ + $(JDK_OUTPUTDIR)/newobjs/libzip/deflate$(OBJ_SUFFIX) \ + $(JDK_OUTPUTDIR)/newobjs/libzip/trees$(OBJ_SUFFIX) \ + $(JDK_OUTPUTDIR)/newobjs/libzip/zadler32$(OBJ_SUFFIX) \ + $(JDK_OUTPUTDIR)/newobjs/libzip/compress$(OBJ_SUFFIX) \ + $(JDK_OUTPUTDIR)/newobjs/libzip/zutil$(OBJ_SUFFIX) \ + $(JDK_OUTPUTDIR)/newobjs/libzip/inflate$(OBJ_SUFFIX) \ + $(JDK_OUTPUTDIR)/newobjs/libzip/infback$(OBJ_SUFFIX) \ + $(JDK_OUTPUTDIR)/newobjs/libzip/inftrees$(OBJ_SUFFIX) \ + $(JDK_OUTPUTDIR)/newobjs/libzip/inffast$(OBJ_SUFFIX) + +$(eval $(call SetupNativeCompilation,BUILD_UNPACKEXE,\ + SRC:=$(JDK_TOPDIR)/src/share/native/com/sun/java/util/jar/pack,\ + EXCLUDE_FILES:=jni.cpp,\ + LANG:=C++,\ + CFLAGS:=$(CXXFLAGS_JDKEXE) $(CXX_O_FLAG_NORM) \ + -DFULL \ + -I$(JDK_TOPDIR)/src/share/native/java/util/zip/zlib-1.2.5,\ + CFLAGS_release:=-DPRODUCT,\ + CFLAGS_linux:=-fPIC,\ + LDFLAGS:=$(LDFLAGS_JDKEXE) \ + $(call SET_SHARED_LIBRARY_MAPFILE,makefiles/mapfiles/libunpack/mapfile-vers-unpack200) \ + $(call SET_SHARED_LIBRARY_ORIGIN), \ + LDFLAGS_SUFFIX:=$(UNPACKEXE_ZIPOBJS) $(LIBCXX),\ + LDFLAGS_SUFFIX_solaris:=-lc,\ + BIN:=$(JDK_OUTPUTDIR)/newobjs/unpackexe,\ + EXE:=$(JDK_OUTPUTDIR)/newobjs/unpack200$(EXE_SUFFIX),\ + VERSIONINFO_RESOURCE:=$(JDK_TOPDIR)/src/windows/resource/version.rc,\ + RC_FLAGS:=$(RC_FLAGS)\ + /D "JDK_FNAME=unpack200.exe" \ + /D "JDK_INTERNAL_NAME=unpack200" \ + /D "JDK_FTYPE=0x1L")) + +$(JDK_OUTPUTDIR)/bin/unpack200$(EXE_SUFFIX): $(UNPACKEXE_ZIPOBJS) + +ifeq ($(HOST_OS_API),winapi) + UNPACK_MANIFEST:=$(JDK_OUTPUTDIR)/newobjs/unpackexe/unpack200.exe.manifest + IMVERSIONVALUE=$(JDK_MINOR_VERSION).$(JDK_MICRO_VERSION).$(JDK_UPDATE_VERSION).$(COOKED_BUILD_NUMBER) + SED_ALL_MANIFEST=$(SED) -e 's%IMVERSION%$(IMVERSIONVALUE)%g' + + $(UNPACK_MANIFEST): $(JDK_TOPDIR)/src/windows/resource/unpack200_proto.exe.manifest + $(CAT) $< | $(SED_ALL_MANIFEST) > $@ + + # Adding a dependency to spec file might be a good idea here, to force rerun on version change. + $(JDK_OUTPUTDIR)/newobjs/unpackexe/unpack200.exe.manifest.mt: $(UNPACK_MANIFEST) + $(MT) /manifest $< /outputresource:$(JDK_OUTPUTDIR)/newobjs/unpack200$(EXE_SUFFIX);#1 + touch $@ + + $(JDK_OUTPUTDIR)/newobjs/unpackexe/unpack200.exe.manifest.mt: $(JDK_OUTPUTDIR)/bin/unpack200$(EXE_SUFFIX) +endif + +BUILD_LAUNCHERS += $(JDK_OUTPUTDIR)/bin/unpack200$(EXE_SUFFIX) + +########################################################################################## + +# +# The java-rmi.cgi script in bin/ only gets delivered in certain situations +# +JAVA_RMI_CGI:=$(JDK_OUTPUTDIR)/bin/java-rmi.cgi +ifeq ($(PLATFORM), linux) + BUILD_LAUNCHERS += $(JAVA_RMI_CGI) +endif +ifeq ($(PLATFORM), solaris) + ifeq ($(ARCH_DATA_MODEL), 32) + BUILD_LAUNCHERS += $(JAVA_RMI_CGI) + endif +endif + +# TODO: +# On windows java-rmi.cgi shouldn't be bundled since Java 1.2, but has been built all +# this time anyway. Since jdk6, it has been built from the wrong source and resulted +# in a copy of the standard java launcher named "java-rmi.exe" ending up in the final +# images bin dir. This weird behavior is mimicked here in the converted makefiles for +# now. Should probably just be deleted. +# http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6512052 +ifeq ($(HOST_OS_API),winapi) + $(eval $(call SetupLauncher,java-rmi,\ + -DEXPAND_CLASSPATH_WILDCARDS,\ + $(call SET_SHARED_LIBRARY_MAPFILE,makefiles/java/main/java/mapfile-$(ARCH)))) + + $(JAVA_RMI_CGI): $(JDK_OUTPUTDIR)/newobjs/java-rmi$(EXE_SUFFIX) + $(CP) $< $@ + + BUILD_LAUNCHERS += $(JAVA_RMI_CGI) +else + $(JAVA_RMI_CGI): $(JDK_TOPDIR)/src/solaris/bin/java-rmi.cgi.sh + $(CP) $< $@ + $(CHMOD) a+x $@ +endif + +########################################################################################## + +$(JDK_OUTPUTDIR)/bin/% : $(JDK_OUTPUTDIR)/newobjs/% + echo Copying $(@F) + $(CP) $< $@ + +$(BUILD_LAUNCHERS) : $(JDK_TOPDIR)/makefiles/CompileLaunchers.gmk + +all: $(BUILD_LAUNCHERS) + +.PHONY: all
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jdk/makefiles/CompileNativeLibraries.gmk Wed Apr 11 14:09:48 2012 -0700 @@ -0,0 +1,608 @@ +# +# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# + +defalt: all + +include $(SPEC) +include MakeBase.gmk +include NativeCompilation.gmk + +# Setup the java compilers for the JDK build. +include Setup.gmk + +# Copy files (can now depend on $(COPY_FILES)) +include CopyFiles.gmk + +# Include the javah generated headers. +CFLAGS_JDKLIB += -I$(JDK_OUTPUTDIR)/gensrc_headers +CXXFLAGS_JDKLIB += -I$(JDK_OUTPUTDIR)/gensrc_headers + +# Put the libraries here. Different locations for different host apis. +ifeq ($(HOST_OS_API),posix) + ifneq ($(HOST_OS),macosx) + INSTALL_LIBRARIES_HERE:=$(JDK_OUTPUTDIR)/lib/$(LIBARCH) + LIBARCHDIR=$(LIBARCH)/ + else + INSTALL_LIBRARIES_HERE:=$(JDK_OUTPUTDIR)/lib + LIBARCHDIR=/ + endif +else + INSTALL_LIBRARIES_HERE:=$(JDK_OUTPUTDIR)/bin +endif + +$(INSTALL_LIBRARIES_HERE)/%$(SHARED_LIBRARY_SUFFIX) : $(JDK_OUTPUTDIR)/newobjs/%$(SHARED_LIBRARY_SUFFIX) + echo Copying $(@F) + $(CP) $< $@ + +BUILD_LIBRARIES= + +# TODO: Temporary until awt is converted: +# OBJDIRNAME is the name of the directory where the object code is to +# be placed. It's name depends on whether the data model architecture +# is 32-bit or not. +ifneq ($(ARCH_DATA_MODEL), 32) + OBJDIRNAME = obj$(ARCH_DATA_MODEL)$(OBJDIRNAME_SUFFIX) +else + OBJDIRNAME = obj$(OBJDIRNAME_SUFFIX) +endif + +########################################################################################## + +$(eval $(call SetupNativeCompilation,BUILD_LIBZIP,\ + SRC:=$(JDK_TOPDIR)/src/share/native/java/util/zip,\ + LANG:=C,\ + CFLAGS:=$(CFLAGS_JDKLIB) $(C_O_FLAG_NORM) $(SHARED_LIBRARY_FLAGS) \ + -I$(JDK_TOPDIR)/src/share/native/java/util/zip/zlib-1.2.5 \ + -I$(JDK_TOPDIR)/src/share/native/java/io \ + -I$(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)/native/java/io,\ + CFLAGS_posix:=-DUSE_MMAP,\ + LDFLAGS:=$(LDFLAGS_JDKLIB) \ + $(EXPORT_ZIP_FUNCS) \ + $(call SET_SHARED_LIBRARY_MAPFILE,makefiles/mapfiles/libzip/mapfile-vers),\ + LDFLAGS_winapi:=-export:ZIP_Open -export:ZIP_Close -export:ZIP_FindEntry \ + -export:ZIP_ReadEntry -export:ZIP_GetNextEntry,\ + LDFLAGS_SUFFIX:=$(LDFLAGS_JDKLIB_SUFFIX),\ + BIN:=$(JDK_OUTPUTDIR)/newobjs/libzip,\ + LIB:=$(JDK_OUTPUTDIR)/newobjs/$(LIBRARY_PREFIX)zip$(SHARED_LIBRARY_SUFFIX))) + +BUILD_LIBRARIES += $(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)zip$(SHARED_LIBRARY_SUFFIX) + +########################################################################################## + +LIBUNPACK_LIB_FILE := $(JDK_OUTPUTDIR)/newobjs/$(LIBRARY_PREFIX)unpack$(SHARED_LIBRARY_SUFFIX) + +$(eval $(call SetupNativeCompilation,BUILD_LIBUNPACK,\ + SRC:=$(JDK_TOPDIR)/src/share/native/com/sun/java/util/jar/pack,\ + EXCLUDE_FILES:=main.cpp,\ + LANG:=C++,\ + CFLAGS:=$(CXXFLAGS_JDKLIB) $(CXX_O_FLAG_NORM) $(SHARED_LIBRARY_FLAGS) \ + -DNO_ZLIB -DUNPACK_JNI -DFULL,\ + CFLAGS_release:=-DPRODUCT,\ + LDFLAGS:=$(LDFLAGS_JDKLIB)\ + $(call SET_SHARED_LIBRARY_MAPFILE,makefiles/mapfiles/libunpack/mapfile-vers) \ + $(call SET_SHARED_LIBRARY_ORIGIN),\ + LDFLAGS_winapi:=-map:$(JDK_OUTPUTDIR)/newobjs/unpack.map /debug,\ + LDFLAGS_SUFFIX:=$(LDFLAGS_JDKLIB_SUFFIX),\ + LDFLAGS_SUFFIX_posix:=$(LIBCXX),\ + BIN:=$(JDK_OUTPUTDIR)/newobjs/libunpack,\ + LIB:=$(LIBUNPACK_LIB_FILE),\ + VERSIONINFO_RESOURCE:=$(JDK_TOPDIR)/src/windows/resource/version.rc,\ + RC_FLAGS:=$(RC_FLAGS)\ + /D "JDK_FNAME=unpack.dll" \ + /D "JDK_INTERNAL_NAME=unpack" \ + /D "JDK_FTYPE=0x2L")) + +BUILD_LIBRARIES += $(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)unpack$(SHARED_LIBRARY_SUFFIX) + +ifeq ($(HOST_OS_API),winapi) + $(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)unpack.map: $(LIBUNPACK_LIB_FILE) + echo Copying $(@F) + $(CP) $(patsubst %$(SHARED_LIBRARY_SUFFIX),%.map,$<) $@ + + $(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)unpack.pdb: $(LIBUNPACK_LIB_FILE) + echo Copying $(@F) + $(CP) $(patsubst %$(SHARED_LIBRARY_SUFFIX),%.pdb,$<) $@ +endif + +########################################################################################## + +$(eval $(call SetupNativeCompilation,BUILD_LIBVERIFY,\ + SRC:=$(JDK_TOPDIR)/src/share/native/common,\ + EXCLUDE_FILES:=check_version.c jdk_util.c jio.c jni_util.c verify_stub.c,\ + LANG:=C,\ + CFLAGS:=$(CFLAGS_JDKLIB) ${C_O_FLAG_HI} $(SHARED_LIBRARY_FLAGS), \ + LDFLAGS:=$(LDFLAGS_JDKLIB) \ + $(call SET_SHARED_LIBRARY_MAPFILE,makefiles/mapfiles/libverify/mapfile-vers),\ + LDFLAGS_SUFFIX:=$(LDFLAGS_JDKLIB_SUFFIX),\ + BIN:=$(JDK_OUTPUTDIR)/newobjs/libverify,\ + LIB:=$(JDK_OUTPUTDIR)/newobjs/$(LIBRARY_PREFIX)verify$(SHARED_LIBRARY_SUFFIX))) + +BUILD_LIBRARIES += $(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)verify$(SHARED_LIBRARY_SUFFIX) + +########################################################################################## + +$(eval $(call SetupNativeCompilation,BUILD_LIBFDLIBM,\ + SRC:=$(JDK_TOPDIR)/src/share/native/java/lang/fdlibm/src,\ + LANG:=C,\ + CFLAGS:=$(CFLAGS_JDKLIB) ${C_O_FLAG_NONE}\ + -I$(JDK_TOPDIR)/src/share/native/java/lang/fdlibm/include,\ + CFLAGS_winapi_debug:=-DLOGGING,\ + ARFLAGS:=$(ARFLAGS),\ + BIN:=$(JDK_OUTPUTDIR)/newobjs/libfdlibm,\ + LIB:=$(JDK_OUTPUTDIR)/newobjs/$(LIBRARY_PREFIX)fdlibm$(STATIC_LIBRARY_SUFFIX))) + +BUILD_LIBRARIES += $(JDK_OUTPUTDIR)/newobjs/$(LIBRARY_PREFIX)fdlibm$(STATIC_LIBRARY_SUFFIX) + +########################################################################################## + +LIBATTACH_EXCLUDE_FILES:= +ifneq ($(PLATFORM),solaris) + LIBATTACH_EXCLUDE_FILES+=SolarisVirtualMachine.c +endif +ifneq ($(PLATFORM),linux) + LIBATTACH_EXCLUDE_FILES+=LinuxVirtualMachine.c +endif +ifneq ($(PLATFORM),macosx) + LIBATTACH_EXCLUDE_FILES+=BsdVirtualMachine.c +endif + +$(eval $(call SetupNativeCompilation,BUILD_LIBATTACH,\ + SRC:=$(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)/native/sun/tools/attach,\ + EXCLUDE_FILES:=$(LIBATTACH_EXCLUDE_FILES),\ + LANG:=C,\ + CFLAGS:=$(CFLAGS_JDKLIB) $(C_O_FLAG_NORM) $(SHARED_LIBRARY_FLAGS),\ + LDFLAGS:=$(LDFLAGS_JDKLIB) \ + $(call SET_SHARED_LIBRARY_MAPFILE,makefiles/mapfiles/libattach/mapfile-$(PLATFORM)) \ + $(call SET_SHARED_LIBRARY_ORIGIN),\ + LDFLAGS_solaris:=-ldoor,\ + LDFLAGS_winapi:=psapi.lib advapi32.lib,\ + LDFLAGS_SUFFIX:=$(LDFLAGS_JDKLIB_SUFFIX),\ + BIN:=$(JDK_OUTPUTDIR)/newobjs/libattach,\ + LIB:=$(JDK_OUTPUTDIR)/newobjs/$(LIBRARY_PREFIX)attach$(SHARED_LIBRARY_SUFFIX))) + +BUILD_LIBRARIES += $(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)attach$(SHARED_LIBRARY_SUFFIX) + +########################################################################################## + +$(eval $(call SetupNativeCompilation,BUILD_LIBDT_SOCKET,\ + SRC:=$(JDK_TOPDIR)/src/share/transport/socket \ + $(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)/transport/socket,\ + LANG:=C,\ + CFLAGS:=$(CFLAGS_JDKLIB) -DUSE_MMAP $(C_O_FLAG_NORM) $(SHARED_LIBRARY_FLAGS) \ + -I$(INCLUDEDIR) -I$(JDK_OUTPUTDIR)/include/$(PLATFORM) \ + -I$(JDK_TOPDIR)/src/share/transport/socket \ + -I$(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)/transport/socket \ + -I$(JDK_TOPDIR)/src/share/back/export \ + -I$(JDK_TOPDIR)/src/share/back,\ + LDFLAGS:=$(LDFLAGS_JDKLIB) \ + $(call SET_SHARED_LIBRARY_MAPFILE,makefiles/mapfiles/libdt_socket/mapfile-vers),\ + LDFLAGS_SUFFIX_linux:=-lpthread,\ + LDFLAGS_SUFFIX_solaris:=-lnsl -lsocket,\ + LDFLAGS_SUFFIX_winapi:=-export:jdwpTransport_OnLoad ws2_32.lib,\ + LDFLAGS_SUFFIX:=$(LDFLAGS_JDKLIB_SUFFIX),\ + BIN:=$(JDK_OUTPUTDIR)/newobjs/libdt_socket,\ + LIB:=$(JDK_OUTPUTDIR)/newobjs/$(LIBRARY_PREFIX)dt_socket$(SHARED_LIBRARY_SUFFIX))) + +BUILD_LIBRARIES += $(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)dt_socket$(SHARED_LIBRARY_SUFFIX) + +########################################################################################## + +ifeq ($(HOST_OS_API),winapi) + + $(eval $(call SetupNativeCompilation,BUILD_LIBDT_SHMEM,\ + SRC:= $(JDK_TOPDIR)/src/share/native/com/sun/tools/jdi \ + $(JDK_TOPDIR)/src/share/transport/shmem \ + $(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)/transport/shmem,\ + LANG:=C,\ + CFLAGS:=$(CFLAGS_JDKLIB) -DUSE_MMAP $(C_O_FLAG_NORM) $(SHARED_LIBRARY_FLAGS)\ + -I$(INCLUDEDIR) -I$(JDK_OUTPUTDIR)/include/$(PLATFORM) \ + -I$(JDK_TOPDIR)/src/share/transport/shmem \ + -I$(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)/transport/shmem \ + -I$(JDK_TOPDIR)/src/share/back/export, \ + LDFLAGS:=$(LDFLAGS_JDKLIB),\ + LDFLAGS_winapi:=-export:jdwpTransport_OnLoad,\ + LDFLAGS_SUFFIX:=$(LDFLAGS_JDKLIB_SUFFIX),\ + BIN:=$(JDK_OUTPUTDIR)/newobjs/libdt_shmem,\ + LIB:=$(JDK_OUTPUTDIR)/newobjs/$(LIBRARY_PREFIX)dt_shmem$(SHARED_LIBRARY_SUFFIX))) + + BUILD_LIBRARIES += $(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)dt_shmem$(SHARED_LIBRARY_SUFFIX) + +endif # PLATFORM + +########################################################################################## +# JDWP_LOGGING causes log messages to be compiled into the library. These reference the +# __FILE__ macro which here expands to the absolute path of the file while the old build +# system used a relative path. This causes the binaries to differ in size. +$(eval $(call SetupNativeCompilation,BUILD_LIBJDWP,\ + SRC:=$(JDK_TOPDIR)/src/share/back $(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)/back,\ + LANG:=C,\ + CFLAGS:=$(CFLAGS_JDKLIB) -DJDWP_LOGGING $(C_O_FLAG_NORM) $(SHARED_LIBRARY_FLAGS)\ + -I$(JDK_TOPDIR)/src/share/transport/export \ + -I$(JDK_TOPDIR)/src/share/back/export \ + -I$(JDK_TOPDIR)/src/share/npt \ + -I$(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)/npt \ + -I$(JDK_TOPDIR)/src/share/back \ + -I$(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)/back \ + -I$(JDK_OUTPUTDIR)/gensrc_jdwp_headers,\ + LDFLAGS:=$(filter-out -ljava,$(LDFLAGS_JDKLIB)) \ + $(call SET_SHARED_LIBRARY_MAPFILE,makefiles/mapfiles/libjdwp/mapfile-vers),\ + LDFLAGS_SUFFIX:=$(LDFLAGS_JDKLIB_SUFFIX),\ + LDFLAGS_SUFFIX_linux:=-ldl,\ + BIN:=$(JDK_OUTPUTDIR)/newobjs/libjdwp,\ + LIB:=$(JDK_OUTPUTDIR)/newobjs/$(LIBRARY_PREFIX)jdwp$(SHARED_LIBRARY_SUFFIX))) + +BUILD_LIBRARIES += $(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)jdwp$(SHARED_LIBRARY_SUFFIX) + +########################################################################################## + +ifneq ($(PLATFORM),solaris) + LIBJAAS_EXCLUDE_FILES:=Solaris.c +endif + +$(eval $(call SetupNativeCompilation,BUILD_LIBJAAS,\ + SRC:=$(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)/native/com/sun/security/auth/module,\ + LANG:=C,\ + CFLAGS:=$(CFLAGS_JDKLIB) $(C_O_FLAG_NORM) $(SHARED_LIBRARY_FLAGS),\ + LDFLAGS:=$(filter-out -ljava,$(LDFLAGS_JDKLIB)) \ + $(call SET_SHARED_LIBRARY_ORIGIN),\ + LDFLAGS_winapi:=netapi32.lib user32.lib mpr.lib advapi32.lib,\ + LDFLAGS_solaris:=$(call SET_SHARED_LIBRARY_MAPFILE,makefiles/mapfiles/libjaas/mapfile-vers),\ + LDFLAGS_SUFFIX:=$(LDFLAGS_JDKLIB_SUFFIX),\ + EXCLUDE_FILES:=$(LIBJAAS_EXCLUDE_FILES),\ + BIN:=$(JDK_OUTPUTDIR)/newobjs/libjaas,\ + LIB:=$(JDK_OUTPUTDIR)/newobjs/$(LIBRARY_PREFIX)jaas$(SHARED_LIBRARY_SUFFIX))) + +BUILD_LIBRARIES += $(JDK_OUTPUTDIR)/newobjs/$(LIBRARY_PREFIX)jaas$(SHARED_LIBRARY_SUFFIX) + +# Oddly enough, it is called jaas_nt.dll under winapi and libjaas_unix.so under posix. +ifeq ($(PLATFORM),windows) + $(INSTALL_LIBRARIES_HERE)/jaas_nt.dll : $(JDK_OUTPUTDIR)/newobjs/jaas.dll + echo Copying $(@F) + $(CP) $< $@ + BUILD_LIBRARIES += $(INSTALL_LIBRARIES_HERE)/jaas_nt.dll +else + $(INSTALL_LIBRARIES_HERE)/libjaas_unix$(SHARED_LIBRARY_SUFFIX) : $(JDK_OUTPUTDIR)/newobjs/$(LIBRARY_PREFIX)jaas$(SHARED_LIBRARY_SUFFIX) + echo Copying $(@F) + $(CP) $< $@ + BUILD_LIBRARIES += $(INSTALL_LIBRARIES_HERE)/libjaas_unix$(SHARED_LIBRARY_SUFFIX) +endif + +########################################################################################## + +ifeq ($(HOST_OS_API),posix) + # TODO make this work on macosx + ifneq ($(HOST_OS),macosx) +# +# NOTE: Change -L flag to point to new lib location after converting libnio. Also +# add dependency on nio from sctp. + $(eval $(call SetupNativeCompilation,BUILD_LIBSCTP,\ + SRC:=$(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)/native/sun/nio/ch/sctp,\ + LANG:=C,\ + CFLAGS:=$(CFLAGS_JDKLIB) $(C_O_FLAG_NORM) $(SHARED_LIBRARY_FLAGS)\ + -I$(JDK_TOPDIR)/src/share/native/sun/nio/ch \ + -I$(JDK_TOPDIR)/src/share/native/sun/nio/ch/sctp \ + -I$(JDK_TOPDIR)/src/share/native/java/net \ + -I$(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)/native/sun/nio/ch \ + -I$(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)/native/java/net,\ + CFLAGS_linux:=-Werror,\ + LDFLAGS:=$(LDFLAGS_JDKLIB) -L$(JDK_OUTPUTDIR)/lib/$(LIBARCHDIR)\ + $(call SET_SHARED_LIBRARY_MAPFILE,makefiles/mapfiles/libsctp/mapfile-vers) \ + $(call SET_SHARED_LIBRARY_ORIGIN),\ + LDFLAGS_SUFFIX_linux:=-lpthread,\ + LDFLAGS_SUFFIX_posix:=-ldl -lnio -lnet,\ + LDFLAGS_SUFFIX_solaris:=-lsocket,\ + LDFLAGS_SUFFIX:=$(LDFLAGS_JDKLIB_SUFFIX),\ + INCLUDE_FILES:=SctpNet.c SctpChannelImpl.c SctpServerChannelImpl.c,\ + BIN:=$(JDK_OUTPUTDIR)/newobjs/libsctp,\ + LIB:=$(JDK_OUTPUTDIR)/newobjs/$(LIBRARY_PREFIX)sctp$(SHARED_LIBRARY_SUFFIX))) + + BUILD_LIBRARIES += $(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)sctp$(SHARED_LIBRARY_SUFFIX) + endif +endif + +########################################################################################## + +$(eval $(call SetupNativeCompilation,BUILD_LIBJSDT,\ + SRC:=$(JDK_TOPDIR)/src/share/native/sun/tracing/dtrace\ + $(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)/native/sun/tracing/dtrace,\ + LANG:=C,\ + CFLAGS:=$(CFLAGS_JDKLIB) $(C_O_FLAG_NORM) $(SHARED_LIBRARY_FLAGS)\ + -I$(JDK_TOPDIR)/src/share/native/sun/tracing/dtrace,\ + LDFLAGS:=$(LDFLAGS_JDKLIB) \ + $(call SET_SHARED_LIBRARY_MAPFILE,makefiles/mapfiles/libjsdt/mapfile-vers) \ + $(call SET_SHARED_LIBRARY_ORIGIN),\ + LDFLAGS_SUFFIX:=$(LDFLAGS_JDKLIB_SUFFIX) -ldl,\ + BIN:=$(JDK_OUTPUTDIR)/newobjs/libjsdt,\ + LIB:=$(JDK_OUTPUTDIR)/newobjs/$(LIBRARY_PREFIX)jsdt$(SHARED_LIBRARY_SUFFIX))) + +BUILD_LIBRARIES += $(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)jsdt$(SHARED_LIBRARY_SUFFIX) + +########################################################################################## + +ifdef OPENJDK + # TODO: Update awt lib path when awt is converted + $(eval $(call SetupNativeCompilation,BUILD_LIBLCMS,\ + SRC:=$(JDK_TOPDIR)/src/share/native/sun/java2d/cmm/lcms \ + $(JDK_TOPDIR)/src/share/native/sun/java2d/,\ + INCLUDE_FILES:=cmscam02.c cmscgats.c cmscnvrt.c cmserr.c \ + cmsgamma.c cmsgmt.c cmsintrp.c cmsio0.c \ + cmsio1.c cmslut.c cmsmd5.c cmsmtrx.c \ + cmsnamed.c cmsopt.c cmspack.c cmspcs.c \ + cmsplugin.c cmsps2.c cmssamp.c cmssm.c \ + cmstypes.c cmsvirt.c cmswtpnt.c cmsxform.c \ + LCMS.c,\ + LANG:=C,\ + CFLAGS:=$(filter-out -xc99=%none,$(CFLAGS_JDKLIB)) $(C_O_FLAG_NORM) \ + $(SHARED_LIBRARY_FLAGS) \ + -I$(JDK_TOPDIR)/src/share/native/sun/java2d \ + -I$(JDK_TOPDIR)/src/share/native/sun/awt/debug,\ + CFLAGS_solaris:=-xc99=no_lib,\ + CFLAGS_winapi:=-DCMS_IS_WINDOWS_,\ + LDFLAGS:=$(LDFLAGS_JDKLIB) \ + $(call SET_SHARED_LIBRARY_MAPFILE,makefiles/mapfiles/liblcms/mapfile-vers),\ + LDFLAGS_posix:=-L$(JDK_OUTPUTDIR)/lib/$(LIBARCHDIR)xawt,\ + LDFLAGS_solaris:=/usr/lib$(ISA_DIR)/libm.so.2,\ + LDFLAGS_winapi:=$(JDK_OUTPUTDIR)/tmp/sun/sun.awt/awt/$(OBJDIRNAME)/awt.lib,\ + LDFLAGS_SUFFIX:=$(LDFLAGS_JDKLIB_SUFFIX),\ + LDFLAGS_SUFFIX_posix:=-lawt,\ + LDFLAGS_SUFFIX_linux:=-lm,\ + BIN:=$(JDK_OUTPUTDIR)/newobjs/liblcms,\ + LIB:=$(JDK_OUTPUTDIR)/newobjs/$(LIBRARY_PREFIX)lcms$(SHARED_LIBRARY_SUFFIX))) + + BUILD_LIBRARIES += $(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)lcms$(SHARED_LIBRARY_SUFFIX) +endif + +########################################################################################## + +ifdef OPENJDK + BUILD_LIBJPEG_MAPFILE := makefiles/mapfiles/libjpeg/mapfile-vers +else + BUILD_LIBJPEG_MAPFILE := makefiles/mapfiles/libjpeg/mapfile-vers-closed + BUILD_LIBJPEG_CLOSED_SRC := $(JDK_TOPDIR)/src/closed/share/native/sun/awt/image/jpeg + BUILD_LIBJPEG_CLOSED_INCLUDES := -I$(BUILD_LIBJPEG_CLOSED_SRC) +endif + +ifeq ($(PLATFORM), solaris) + ifneq ($(ARCH), amd64) + BUILD_LIBJPEG_REORDER := $(JDK_TOPDIR)/makefiles/mapfiles/libjpeg/reorder-$(ARCH) + $(JDK_OUTPUTDIR)/newobjs/libjpeg/mapfile-vers : $(JDK_TOPDIR)/$(BUILD_LIBJPEG_MAPFILE) \ + $(BUILD_LIBJPEG_REORDER) + $(MKDIR) -p $(@D) + $(CAT) $(JDK_TOPDIR)/$(BUILD_LIBJPEG_MAPFILE) > $@ + $(SED) -e 's=OUTPUTDIR=$(JDK_OUTPUTDIR)=' $(BUILD_LIBJPEG_REORDER) >> $@ + LIBJPEG_MAPFILE:=$(JDK_OUTPUTDIR)/newobjs/libjpeg/mapfile-vers + + $(JDK_OUTPUTDIR)/newobjs/$(LIBRARY_PREFIX)jpeg$(SHARED_LIBRARY_SUFFIX): \ + $(JDK_OUTPUTDIR)/newobjs/libjpeg/mapfile-vers + endif +endif + +# Suppress gcc warnings like "variable might be clobbered by 'longjmp' +# or 'vfork'": this warning indicates that some variable is placed to +# a register by optimized compiler and it's value might be lost on longjmp(). +# Recommended way to avoid such warning is to declare the variable as +# volatile to prevent the optimization. However, this approach does not +# work because we have to declare all variables as volatile in result. +#ifndef CROSS_COMPILE_ARCH +# CC_43_OR_NEWER := \ +# $(shell $(EXPR) $(CC_MAJORVER) \> 4 \| \ +# \( $(CC_MAJORVER) = 4 \& $(CC_MINORVER) \>= 3 \) ) +# ifeq ($(CC_43_OR_NEWER),1) +# BUILD_LIBJPEG_CFLAGS_linux += -Wno-clobbered +# endif +#endif + +$(eval $(call SetupNativeCompilation,BUILD_LIBJPEG,\ + SRC:=$(BUILD_LIBJPEG_CLOSED_SRC) \ + $(JDK_TOPDIR)/src/share/native/sun/awt/image/jpeg,\ + LANG:=C,\ + CFLAGS:=$(CFLAGS_JDKLIB) $(C_O_FLAG_HI) $(SHARED_LIBRARY_FLAGS) \ + $(BUILD_LIBJPEG_CLOSED_INCLUDES) \ + -I$(JDK_TOPDIR)/src/share/native/sun/awt/image/jpeg,\ + CFLAGS_solaris:=-xF,\ + LDFLAGS:=$(LDFLAGS_JDKLIB) \ + $(call SET_SHARED_LIBRARY_MAPFILE,$(BUILD_LIBJPEG_MAPFILE))\ + $(call SET_SHARED_LIBRARY_ORIGIN),\ + LDFLAGS_linux:=-ldl,\ + LDFLAGS_SUFFIX:=$(LDFLAGS_JDKLIB_SUFFIX),\ + BIN:=$(JDK_OUTPUTDIR)/newobjs/libjpeg,\ + LIB:=$(JDK_OUTPUTDIR)/newobjs/$(LIBRARY_PREFIX)jpeg$(SHARED_LIBRARY_SUFFIX))) + +BUILD_LIBRARIES += $(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)jpeg$(SHARED_LIBRARY_SUFFIX) + +########################################################################################## + +ifndef OPENJDK + FONT_HEADERS := -I$(CLOSED_SRC)/share/native/$(PKGDIR)/t2k + BUILD_LIBFONTMANAGER_MAPFILE := makefiles/mapfiles/libfontmanager/mapfile-vers + LIBFONTMANAGER_EXCLUDE_FILES += freetypeScaler.c +else + FONT_HEADERS := $(FREETYPE2_CFLAGS) + BUILD_LIBFONTMANAGER_MAPFILE := makefiles/mapfiles/libfontmanager/mapfile-vers.openjdk + BUILD_LIBFONTMANAGER_FONTLIB := $(FREETYPE2_LIBS) +endif + +ifeq ($(PLATFORM),windows) + LIBFONTMANAGER_EXCLUDE_FILES += X11FontScaler.c \ + X11TextRenderer.c +else + LIBFONTMANAGER_EXCLUDE_FILES += fontpath.c \ + lcdglyph.c +endif + +BUILD_LIBFONTMANAGER_CFLAGS_COMMON := $(SHARED_LIBRARY_FLAGS) \ + -DLE_STANDALONE -DHEADLESS \ + $(FONT_HEADERS) \ + -I$(JDK_TOPDIR)/src/share/native/sun/font \ + -I$(JDK_TOPDIR)/src/share/native/sun/font/layout \ + -I$(JDK_TOPDIR)/src/share/native/sun/awt/image/cvutils \ + -I$(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)/native/sun/awt \ + -I$(JDK_TOPDIR)/src/share/native/sun/awt/debug \ + -I$(JDK_TOPDIR)/src/share/native/sun/java2d/loops \ + -I$(JDK_TOPDIR)/src/share/native/sun/java2d/pipe \ + -I$(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)/native/sun/java2d \ + -I$(JDK_TOPDIR)/src/share/native/sun/java2d + +$(eval $(call SetupNativeCompilation,BUILD_LIBFONTMANAGER,\ + SRC:=$(JDK_TOPDIR)/src/share/native/sun/font\ + $(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)/native/sun/font,\ + EXCLUDE_FILES:=$(LIBFONTMANAGER_EXCLUDE_FILES) \ + AccelGlyphCache.c,\ + LANG:=C++,\ + CFLAGS:=$(CFLAGS_JDKLIB) $(BUILD_LIBFONTMANAGER_CFLAGS_COMMON),\ + CXXFLAGS:=$(CXXFLAGS_JDKLIB) $(BUILD_LIBFONTMANAGER_CFLAGS_COMMON),\ + CFLAGS_posix:=$(C_O_FLAG_HI),\ + CXXFLAGS_posix:=$(CXX_O_FLAG_HI),\ + CFLAGS_windows=$(C_O_FLAG_NORM)\ + -I$(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)/native/sun/windows \ + -DCC_NOEX, \ + LDFLAGS:=$(subst -Xlinker -z -Xlinker defs,,$(LDFLAGS_JDKLIB)) \ + $(call SET_SHARED_LIBRARY_MAPFILE,$(BUILD_LIBFONTMANAGER_MAPFILE)) \ + $(call SET_SHARED_LIBRARY_ORIGIN),\ + LDFLAGS_solaris:=-L$(JDK_OUTPUTDIR)/lib/$(LIBARCHDIR)headless,\ + LDFLAGS_windows:=advapi32.lib user32.lib gdi32.lib $(JDK_OUTPUTDIR)/tmp/sun/sun.awt/awt/$(OBJDIRNAME)/awt.lib,\ + LDFLAGS_SUFFIX:=$(LDFLAGS_JDKLIB_SUFFIX) \ + $(BUILD_LIBFONTMANAGER_FONTLIB),\ + LDFLAGS_SUFFIX_linux:=-lawt $(LIBM) $(LIBCXX),\ + LDFLAGS_SUFFIX_solaris:=-lawt -lawt_xawt -lc $(LIBM) $(LIBCXX),\ + LDFLAGS_SUFFIX_macosx:=-lawt $(LIBM) $(LIBCXX) -undefined dynamic_lookup,\ + BIN:=$(JDK_OUTPUTDIR)/newobjs/libfontmanager,\ + LIB:=$(JDK_OUTPUTDIR)/newobjs/$(LIBRARY_PREFIX)fontmanager$(SHARED_LIBRARY_SUFFIX))) + +BUILD_LIBRARIES += $(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)fontmanager$(SHARED_LIBRARY_SUFFIX) + +########################################################################################## + +ifndef OPENJDK + +# ifeq ($(PLATFORM), linux) +# ifeq ("$(CC_VER_MAJOR)", "3") +# OTHER_LDLIBS += -Wl,-Bstatic -lgcc_eh -Wl,-Bdynamic +# endif +# endif +# +# The resulting size of the t2k lib file is (at least on linux) dependant on the order of +# the input .o files. Because of this the new build will differ in size to the old build. + BUILD_LIBT2K_CFLAGS_COMMON:=-I$(JDK_TOPDIR)/src/share/native/sun/font \ + -I$(JDK_TOPDIR)/src/closed/share/native/sun/font/t2k \ + -I$(JDK_TOPDIR)/src/closed/share/native/sun/font \ + -I$(JDK_TOPDIR)/src/share/share/native/sun/font \ + -I$(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)/native/sun/font \ + -I$(JDK_TOPDIR)/src/share/native/sun/java2d/loops \ + -I$(JDK_TOPDIR)/src/share/native/sun/java2d/pipe \ + -I$(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)/native/sun/java2d \ + -I$(JDK_TOPDIR)/src/share/native/sun/java2d + + $(eval $(call SetupNativeCompilation,BUILD_LIBT2K,\ + SRC:=$(JDK_TOPDIR)/src/closed/share/native/sun/font \ + $(JDK_TOPDIR)/src/closed/share/native/sun/font/t2k \ + $(JDK_TOPDIR)/src/closed/share/native/sun/font/t2k/ttHints,\ + EXCLUDE_FILES:=orion.c,\ + LANG:=C++,\ + CFLAGS:=$(CFLAGS_JDKLIB) $(BUILD_LIBT2K_CFLAGS_COMMON) $(C_O_FLAG_HI),\ + CXXFLAGS:=$(CXXFLAGS_JDKLIB) $(BUILD_LIBT2K_CFLAGS_COMMON) $(CXX_O_FLAG_HI),\ + CFLAGS_windows=-DCC_NOEX, \ + CXXFLAGS_windows=-DCC_NOEX, \ + LDFLAGS:=$(LDFLAGS_JDKLIB) \ + $(call SET_SHARED_LIBRARY_MAPFILE,makefiles/mapfiles/libt2k/mapfile-vers) \ + $(call SET_SHARED_LIBRARY_ORIGIN),\ + LDFLAGS_windows:=user32.lib $(JDK_OUTPUTDIR)/newobjs/fontmanager.lib,\ + LDFLAGS_SUFFIX:=$(LDFLAGS_JDKLIB_SUFFIX),\ + LDFLAGS_SUFFIX_linux:=$(LIBCXX) $(LIBM) -L$(INSTALL_LIBRARIES_HERE) -lfontmanager,\ + LDFLAGS_SUFFIX_solaris:=$(LIBCXX) $(LIBM) -L$(INSTALL_LIBRARIES_HERE) -lfontmanager -lawt \ + -lawt_xawt,\ + BIN:=$(JDK_OUTPUTDIR)/newobjs/libt2k,\ + LIB:=$(JDK_OUTPUTDIR)/newobjs/$(LIBRARY_PREFIX)t2k$(SHARED_LIBRARY_SUFFIX))) + + # t2k is linked against fontmanager + $(JDK_OUTPUTDIR)/newobjs/$(LIBRARY_PREFIX)t2k$(SHARED_LIBRARY_SUFFIX): \ + $(JDK_OUTPUTDIR)/newobjs/$(LIBRARY_PREFIX)fontmanager$(SHARED_LIBRARY_SUFFIX) + + BUILD_LIBRARIES += $(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)t2k$(SHARED_LIBRARY_SUFFIX) +endif + +########################################################################################## + +ifeq ($(PLATFORM), windows) + ifeq ($(ARCH_DATA_MODEL), 32) + KERNEL32_LIB := kernel32.lib + endif + $(eval $(call SetupNativeCompilation,BUILD_LIBJAWT,\ + SRC:=$(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)/native/sun/windows,\ + INCLUDE_FILES:=jawt.cpp,\ + LANG:=C++,\ + CFLAGS:=$(CXXFLAGS_JDKLIB) $(CXX_O_FLAG_NORM) \ + -EHsc -DUNICODE -D_UNICODE \ + -I$(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)/native/sun/windows \ + -I$(JDK_TOPDIR)/src/share/native/sun/awt/debug \ + -I$(JDK_TOPDIR)/src/share/native/sun/java2d \ + -I$(JDK_TOPDIR)/src/share/native/sun/awt/image/cvutils \ + -I$(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)/native/sun/java2d/windows, \ + LDFLAGS:=$(LDFLAGS_JDKLIB) $(KERNEL32_LIB) \ + advapi32.lib $(JDK_OUTPUTDIR)/tmp/sun/sun.awt/awt/$(OBJDIRNAME)/awt.lib,\ + LDFLAGS_SUFFIX:=$(LDFLAGS_JDKLIB_SUFFIX),\ + BIN:=$(JDK_OUTPUTDIR)/newobjs/libjawt,\ + LIB:=$(JDK_OUTPUTDIR)/newobjs/$(LIBRARY_PREFIX)jawt$(SHARED_LIBRARY_SUFFIX))) + +$(JDK_OUTPUTDIR)/lib/$(LIBRARY_PREFIX)jawt$(STATIC_LIBRARY_SUFFIX): \ + $(JDK_OUTPUTDIR)/newobjs/$(LIBRARY_PREFIX)jawt$(SHARED_LIBRARY_SUFFIX) + echo Copying $(@F) + $(CP) $(JDK_OUTPUTDIR)/newobjs/$(LIBRARY_PREFIX)jawt$(STATIC_LIBRARY_SUFFIX) $@ + +BUILD_LIBRARIES += $(JDK_OUTPUTDIR)/lib/$(LIBRARY_PREFIX)jawt$(STATIC_LIBRARY_SUFFIX) + +else # PLATFORM not windows + + ifndef BUILD_HEADLESS_ONLY + MAWT_AWT_LIB =-lawt_xawt + else + MAWT_AWT_LIB =-lawt_headless + HEADLESS_CFLAG += -DHEADLESS + endif + + $(eval $(call SetupNativeCompilation,BUILD_LIBJAWT,\ + SRC:=$(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)/native/sun/awt,\ + INCLUDE_FILES:=jawt.c,\ + LANG:=C,\ + CFLAGS:=$(CFLAGS_JDKLIB) $(C_O_FLAG_NORM), \ + CFLAGS_linux:=$(HEADLESS_CFLAG),\ + LDFLAGS:=$(LDFLAGS_JDKLIB) \ + $(call SET_SHARED_LIBRARY_MAPFILE,makefiles/mapfiles/libjawt/mapfile-vers) \ + $(call SET_SHARED_LIBRARY_ORIGIN),\ + LDFLAGS_solaris:=-L/usr/openwin/sfw/lib$(ISA_DIR) -L/usr/openwin/lib$(ISA_DIR),\ + LDFLAGS_SUFFIX:=$(LDFLAGS_JDKLIB_SUFFIX) $(MAWT_AWT_LIB) -lawt,\ + LDFLAGS_SUFFIX_solaris:=-lXrender,\ + BIN:=$(JDK_OUTPUTDIR)/newobjs/libjawt,\ + LIB:=$(JDK_OUTPUTDIR)/newobjs/$(LIBRARY_PREFIX)jawt$(SHARED_LIBRARY_SUFFIX))) +endif # PLATFORM + +BUILD_LIBRARIES += $(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)jawt$(SHARED_LIBRARY_SUFFIX) + + +########################################################################################## + +all: $(COPY_FILES) $(BUILD_LIBRARIES) + +.PHONY: all
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jdk/makefiles/CopyFiles.gmk Wed Apr 11 14:09:48 2012 -0700 @@ -0,0 +1,232 @@ +# +# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# + +INCLUDEDIR = $(JDK_OUTPUTDIR)/include +# TODO: Platform dir needs to be "win32" on windows /erikj +PLATFORM_INCLUDE = $(INCLUDEDIR)/$(PLATFORM) + +# +# Copy exported header files to outputdir. +# +H_TARGET_FILES =$(INCLUDEDIR)/jdwpTransport.h \ + $(INCLUDEDIR)/jni.h \ + $(INCLUDEDIR)/jvmti.h \ + $(INCLUDEDIR)/jvmticmlr.h \ + $(INCLUDEDIR)/classfile_constants.h \ + $(INCLUDEDIR)/jawt.h \ + $(PLATFORM_INCLUDE)/jni_md.h \ + $(PLATFORM_INCLUDE)/jawt_md.h + +$(INCLUDEDIR)/%.h: $(JDK_TOPDIR)/src/share/javavm/export/%.h + $(MKDIR) -p $(@D) + rm -f $@ + $(CP) $< $@ + +$(PLATFORM_INCLUDE)/%.h: $(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)/javavm/export/%.h + $(MKDIR) -p $(@D) + rm -f $@ + $(CP) $< $@ + +COPY_FILES = $(H_TARGET_FILES) + +########################################################################################## + +LIBDIR = $(JDK_OUTPUTDIR)/lib +SERVICETAG_LIBDIR = $(LIBDIR)/servicetag + +$(SERVICETAG_LIBDIR)/jdk_header.png: $(JDK_TOPDIR)/src/share/classes/com/sun/servicetag/resources/jdk_header.png + $(MKDIR) -p $(@D) + rm -f $@ + $(CP) $< $@ + $(CHMOD) 444 $@ + +COPY_FILES += $(SERVICETAG_LIBDIR)/jdk_header.png + +########################################################################################## + +MGMT_LIBDIR = $(LIBDIR)/management +MGMT_LIB_SRC = $(JDK_TOPDIR)/src/share/lib/management +MGMT_SRC_FILES = $(wildcard $(MGMT_LIB_SRC)/*) +MGMT_TARGET_FILES = $(subst $(MGMT_LIB_SRC),$(MGMT_LIBDIR),$(MGMT_SRC_FILES)) + +$(MGMT_LIBDIR)/management.properties: $(MGMT_LIB_SRC)/management.properties + $(MKDIR) -p $(@D) + rm -f $@ + $(CP) $< $@ + $(CHMOD) 644 $@ + +$(MGMT_LIBDIR)/%: $(MGMT_LIB_SRC)/% + $(MKDIR) -p $(@D) + rm -f $@ + $(CP) $< $@ + $(CHMOD) 444 $@ + +COPY_FILES += $(MGMT_TARGET_FILES) + +########################################################################################## + +LOGGING_LIB_SRC = $(JDK_TOPDIR)/src/share/lib + +$(LIBDIR)/logging.properties: $(LOGGING_LIB_SRC)/logging.properties + $(MKDIR) -p $(@D) + rm -f $@ + $(CP) $< $@ + +COPY_FILES += $(LIBDIR)/logging.properties + +########################################################################################## +# +# Copy property files from sun/print to LIBDIR +# +PSFONTPROPFILE_SRC_DIR = $(JDK_TOPDIR)/src/share/classes/sun/print +PSFONTPROPFILE_SRCS = $(wildcard $(PSFONTPROPFILE_SRC_DIR)/*.properties*) +PSFONTPROPFILE_TARGET_FILES = $(subst $(PSFONTPROPFILE_SRC_DIR),$(LIBDIR),$(PSFONTPROPFILE_SRCS)) + +$(PSFONTPROPFILE_TARGET_FILES): $(PSFONTPROPFILE_SRCS) + $(MKDIR) -p $(@D) + rm -f $@ + $(CP) $< $@ + +COPY_FILES += $(PSFONTPROPFILE_TARGET_FILES) + +########################################################################################## +# +# Copy flavormap.properties, cursor.properties and cursors gif files to LIBDIR +# +PLATFORM_LIB_SRC = $(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)/lib + +$(LIBDIR)/flavormap.properties: $(PLATFORM_LIB_SRC)/flavormap.properties + $(MKDIR) -p $(@D) + rm -f $@ + $(CP) $< $@ + +COPY_FILES += $(LIBDIR)/flavormap.properties + +CURSORS_DEST_DIR = $(LIBDIR)/images/cursors +CURSORS_PLATFORM_LIB_SRC = $(PLATFORM_LIB_SRC)/images/cursors + +$(CURSORS_DEST_DIR)/cursors.properties: $(CURSORS_PLATFORM_LIB_SRC)/cursors.properties + $(MKDIR) -p $(@D) + rm -f $@ + $(CP) $< $@ + +COPY_FILES += $(CURSORS_DEST_DIR)/cursors.properties + +CURSORS_LIB_SRC = $(JDK_TOPDIR)/src/share/lib/images/cursors +ifeq ($(PLATFORM), windows) +CURSORS_SRC_FILES = $(CURSORS_LIB_SRC)/invalid32x32.gif $(wildcard $(CURSORS_LIB_SRC)/win32_*.gif) +else # PLATFORM +CURSORS_SRC_FILES = $(CURSORS_LIB_SRC)/invalid32x32.gif $(wildcard $(CURSORS_LIB_SRC)/motif_*.gif) +endif # PLATFORM +CURSORS_TARGET_FILES = $(subst $(CURSORS_LIB_SRC),$(CURSORS_DEST_DIR),$(CURSORS_SRC_FILES)) + +$(CURSORS_TARGET_FILES): $(CURSORS_SRC_FILES) + $(MKDIR) -p $(@D) + rm -f $@ + $(CP) $< $@ + +COPY_FILES += $(CURSORS_TARGET_FILES) + +########################################################################################## + +CONTENT_TYPES_SRC=$(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)/lib + +$(LIBDIR)/content-types.properties: $(CONTENT_TYPES_SRC)/content-types.properties + $(MKDIR) -p $(@D) + rm -f $@ + $(CP) $< $@ + +COPY_FILES += $(LIBDIR)/content-types.properties + +########################################################################################## + +ICCPROFILE_DEST_DIR := $(LIBDIR)/cmm + +ifdef OPENJDK + ICCPROFILE_SRC_DIR := $(JDK_TOPDIR)/src/share/lib/cmm/lcms +else + ICCPROFILE_SRC_DIR := $(JDK_TOPDIR)/src/closed/share/lib/cmm/kcms +endif + +ICCPROFILE_SRCS:=$(wildcard $(ICCPROFILE_SRC_DIR)/*.pf) +ICCPROFILE_TARGET_FILES:=$(subst $(ICCPROFILE_SRC_DIR),$(ICCPROFILE_DEST_DIR),$(ICCPROFILE_SRCS)) + +$(ICCPROFILE_DEST_DIR)%.pf: $(ICCPROFILE_SRC_DIR)%.pf + $(MKDIR) -p $(@D) + rm -f $@ + $(CP) $< $@ + $(CHMOD) 444 $@ + +COPY_FILES += $(ICCPROFILE_TARGET_FILES) + +########################################################################################## + +#make sure freetype dll will be available at runtime as well as link time +# +#NB: Default freetype build system uses -h linker option and +# result .so contains hardcoded library name that is later +# used for adding dependencies to other objects +# (e.g. libfontmanager.so). +# +# It is not obvious how to extract that hardcoded name (libfreetype.so.6) +# without overcomplicating logic here. +# To workaround this we hardcode .6 suffix for now. +# +# Note that .so.6 library will not be found by System.loadLibrary() +# but fortunately we need to load FreeType library explicitly +# on windows only +# +#TODO: rework this to avoid hardcoding library name in the makefile +# +ifdef OPENJDK + ifeq ($(PLATFORM), windows) + FREETYPE_LIB = $(JDK_OUTPUTDIR)/bin/$(call SHARED_LIBRARY,freetype) + else + ifeq ($(USING_SYSTEM_FT_LIB), false) + FREETYPE_LIB = $(JDK_OUTPUTDIR)/lib/$(LIBARCH)/$(call SHARED_LIBRARY,freetype).6 + endif + endif + + $(FREETYPE_LIB): + $(CP) $(FREETYPE2_LIB_PATH)/$(call SHARED_LIBRARY,freetype) $@ + + COPY_FILES += $(FREETYPE_LIB) +endif + +########################################################################################## + +# Copy msvcr100.dll on windows + +ifeq ($(PLATFORM),windows) + MSVCRNN_TARGET := $(JDK_OUTPUTDIR)/bin/$(notdir $(MSVCRNN_DLL)) + $(MSVCRNN_TARGET): $(MSVCRNN_DLL) + $(MKDIR) -p $(@D) + rm -f $@ + $(CP) $< $@ + + COPY_FILES += $(MSVCRNN_TARGET) +endif + +##########################################################################################
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jdk/makefiles/CopyIntoClasses.gmk Wed Apr 11 14:09:48 2012 -0700 @@ -0,0 +1,150 @@ +# +# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# + +# Copy icu and _dict files used by the text break iterator + +COPY_PATTERNS = .icu _dict + +# Copy config files for com.sun.org.apache.xml.internal.security + +XMLSECURITY_RESOURCEDIR = $(JDK_TOPDIR)/src/share/classes/com/sun/org/apache/xml/internal/security/resource +COPY_FILES += \ + $(XMLSECURITY_RESOURCEDIR)/config.dtd \ + $(XMLSECURITY_RESOURCEDIR)/config.xml + +# Copy sun/tools related files into the classes directory. + +# Extra jstat files +JSTAT_RESOURCEDIR = $(JDK_TOPDIR)/src/share/classes/sun/tools/jstat/resources +COPY_FILES += \ + $(JSTAT_RESOURCEDIR)/jstat_options \ + $(JSTAT_RESOURCEDIR)/jstat_unsupported_options + +# Extra jhat files +JHAT_RESOURCEDIR = $(JDK_TOPDIR)/src/share/classes/com/sun/tools/hat/resources +COPY_FILES += \ + $(JHAT_RESOURCEDIR)/hat.js \ + $(JHAT_RESOURCEDIR)/oqlhelp.html \ + $(JHAT_RESOURCEDIR)/platform_names.txt + +# Extra jrunscript files +JRUNSCRIPT_RESOURCEDIR = $(JDK_TOPDIR)/src/share/classes/com/sun/tools/script/shell +COPY_FILES += \ + $(JRUNSCRIPT_RESOURCEDIR)/init.js \ + $(JRUNSCRIPT_RESOURCEDIR)/messages.properties + +# Extra jvmstat files +COPY_FILES += \ + $(JDK_TOPDIR)/src/share/classes/sun/jvmstat/perfdata/resources/aliasmap + +# Servicetag resources +SERVICETAG_RESOURCES_DIR = $(JDK_TOPDIR)/src/share/classes/com/sun/servicetag/resources +COPY_FILES += \ + $(SERVICETAG_RESOURCES_DIR)/product_registration.xsd \ + $(SERVICETAG_RESOURCES_DIR)/register.html \ + $(SERVICETAG_RESOURCES_DIR)/register_ja.html \ + $(SERVICETAG_RESOURCES_DIR)/register_zh_CN.html \ + $(wildcard $(SERVICETAG_RESOURCES_DIR)/javase_*.properties) + +# JConsole resources +JCONSOLE_RESOURCES_DIR = $(JDK_TOPDIR)/src/share/classes/sun/tools/jconsole/resources +COPY_FILES += \ + $(wildcard $(JCONSOLE_RESOURCES_DIR)/*.png) \ + $(wildcard $(JCONSOLE_RESOURCES_DIR)/*.gif) + +# Print resources +PRINT_RESOURCES_DIR = $(JDK_TOPDIR)/src/share/classes/sun/print/resources +COPY_FILES += \ + $(wildcard $(PRINT_RESOURCES_DIR)/*.png) + +# IDN resources +COPY_FILES += \ + $(JDK_TOPDIR)/src/share/classes/sun/net/idn/uidna.spp + +########################################################################################## +# +# Copy the META-INF/services configuration files that are scattered around the source tree +# into classes/META-INF/services. Be aware that META-INF directories that are located at a +# source root (.../classes/META-INF) are automatically copied verbatim by the +# SetupJavaCompilation macro. +# +# Any other META-INF/services configuration file is found here and platform specific comments +# are uncommented and the configuration file is stored in the output META-INF directory. + +# Make sure the output directory is created. +$(shell $(MKDIR) -p $(JDK_OUTPUTDIR)/newclasses/META-INF/services) +# Find all META-INF/services/* files +ALL_META-INF_DIRS_share:=$(shell $(FIND) $(JDK_TOPDIR)/src/share/classes -type d -a -name META-INF) +ALL_META-INF_DIRS_hostapi:=$(shell $(FIND) $(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)/classes -type d -a -name META-INF) +# Platform specific overrides shared +ifneq ($(ALL_META-INF_DIRS_hostapi),) + ALL_META-INF_DIRS:=$(ALL_META-INF_DIRS_hostapi) \ + $(filter-out %$(patsubst $(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)/classes%,%,$(ALL_META-INF_DIRS_hostapi)),\ + $(ALL_META-INF_DIRS_share)) +else + ALL_META-INF_DIRS:=$(ALL_META-INF_DIRS_share) +endif +# Filter out META-INF dirs that shouldn't be included +ALL_META-INF_DIRS:=$(filter-out %sun/nio/cs/ext/META-INF,$(ALL_META-INF_DIRS)) +ifdef OPENJDK + ALL_META-INF_DIRS:=$(filter-out %com/sun/script/javascript/META-INF,$(ALL_META-INF_DIRS)) +endif + +SRC_SERVICES_FILES:=$(wildcard $(addsuffix /services/*,$(ALL_META-INF_DIRS))) +ifdef OPENJDK + SRC_SERVICES_FILES:=$(filter-out %sun/dc/META-INF/services/sun.java2d.pipe.RenderingEngine,$(SRC_SERVICES_FILES)) + SRC_SERVICES_FILES:=$(filter-out %sun/java2d/cmm/kcms/META-INF/services/sun.java2d.cmm.PCMM,$(SRC_SERVICES_FILES)) +else + SRC_SERVICES_FILES:=$(filter-out %sun/java2d/pisces/META-INF/services/sun.java2d.pipe.RenderingEngine,$(SRC_SERVICES_FILES)) + SRC_SERVICES_FILES:=$(filter-out %sun/java2d/cmm/lcms/META-INF/services/sun.java2d.cmm.PCMM,$(SRC_SERVICES_FILES)) +endif +# The number of services files are relatively few. If the increase in numbers, then +# we have to use ListPathsSafelyNow here. +# Change $(JDK_TOPDIR)/src/.../META-INF/services/yyyy into $(JDK_OUTPUTDIR)/newclasses/META-INF/services/yyyy +# The \n in the printf command is needed to make sed work on Solaris. +OUT_SERVICES_FILES:=$(addprefix $(JDK_OUTPUTDIR)/newclasses/META-INF/services/,\ + $(shell $(PRINTF) "$(SRC_SERVICES_FILES)\n" | $(SED) -e 's|/[^ ]*/META-INF/services/||g')) +OUT_SERVICES_FILES_COLON:=$(addsuffix :,$(OUT_SERVICES_FILES)) +# Exception handling for print services with no META-INF directory +SRC_SERVICES_FILES_PRINT = $(wildcard $(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)/classes/sun/print/services/*) +OUT_SERVICES_FILES_PRINT = $(addprefix $(JDK_OUTPUTDIR)/newclasses/META-INF/services/,\ + $(patsubst $(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)/classes/sun/print/services/%,%,\ + $(SRC_SERVICES_FILES_PRINT))) +OUT_SERVICES_FILES_PRINT_COLON = $(addsuffix :,$(OUT_SERVICES_FILES_PRINT)) +RULES_SERVICES_PRINT = $(join $(OUT_SERVICES_FILES_PRINT_COLON),$(SRC_SERVICES_FILES_PRINT)) + +# Now setup the dependency rules to generate a META-INF/services/... from the correct source. +META-INF_RULES_SERVICES:=$(RULES_SERVICES_PRINT) $(join $(OUT_SERVICES_FILES_COLON),$(SRC_SERVICES_FILES)) +# Eval the newly created rules to incorporate them into the make tree. +define addto_meta-inf_services +$1 + echo Installing META-INF/services/$$(@F) + $(CAT) $$< | $(SED) -e "s/^#\[$(PLATFORM)\]//" > $$@ +endef +$(foreach i,$(META-INF_RULES_SERVICES),$(eval $(call addto_meta-inf_services,$i))) +# Here is the generic rule, whose receipt the above rules will trigger. + +COPY_EXTRA += $(OUT_SERVICES_FILES) +COPY_EXTRA += $(OUT_SERVICES_FILES_PRINT)
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jdk/makefiles/CopySamples.gmk Wed Apr 11 14:09:48 2012 -0700 @@ -0,0 +1,75 @@ +# +# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# + +default: all + +include $(SPEC) +include MakeBase.gmk + +SAMPLE_TARGET_DIR = $(JDK_OUTPUTDIR)/sample +SAMPLE_SOURCE_DIR = $(JDK_TOPDIR)/src/share/sample +SAMPLE_CLOSED_SOURCE_DIR = $(JDK_TOPDIR)/src/closed/share/sample +SAMPLE_SOLARIS_SOURCE_DIR = $(JDK_TOPDIR)/src/solaris/sample + +# Exclude the vm directory +SAMPLE_FIND_FILTER = -name vm -prune -o + +SAMPLE_SOURCE := $(shell $(FIND) $(SAMPLE_SOURCE_DIR) $(SAMPLE_FIND_FILTER) -type f -print) +SAMPLE_TARGET := $(subst $(SAMPLE_SOURCE_DIR),$(SAMPLE_TARGET_DIR),$(SAMPLE_SOURCE)) + +ifndef OPENJDK +# Exclude Main.java in EbayClient dir + SAMPLE_CLOSED_SOURCE := $(shell $(FIND) $(SAMPLE_CLOSED_SOURCE_DIR) -type f -print | $(GREP) -v EbayClient/Main.java) + SAMPLE_CLOSED_TARGET := $(subst $(SAMPLE_CLOSED_SOURCE_DIR),$(SAMPLE_TARGET_DIR),$(SAMPLE_CLOSED_SOURCE)) + SAMPLE_TARGET += $(SAMPLE_CLOSED_TARGET) +endif + +ifeq ($(PLATFORM),solaris) + SAMPLE_SOLARIS_SOURCE := $(shell $(FIND) $(SAMPLE_SOLARIS_SOURCE_DIR) -type f -print) + SAMPLE_SOLARIS_TARGET := $(subst $(SAMPLE_SOLARIS_SOURCE_DIR),$(SAMPLE_TARGET_DIR),$(SAMPLE_SOLARIS_SOURCE)) + SAMPLE_TARGET += $(SAMPLE_SOLARIS_TARGET) +endif + +$(SAMPLE_TARGET_DIR)/dtrace/%: $(SAMPLE_SOLARIS_SOURCE_DIR)/dtrace/% + $(MKDIR) -p $(@D) + rm -f $@ + $(CP) $< $@ + +$(SAMPLE_TARGET_DIR)/webservices/%: $(SAMPLE_CLOSED_SOURCE_DIR)/webservices/% + $(MKDIR) -p $(@D) + rm -f $@ + $(CP) $< $@ + +$(SAMPLE_TARGET_DIR)/%: $(SAMPLE_SOURCE_DIR)/% + $(MKDIR) -p $(@D) + rm -f $@ + $(CP) $< $@ + +COPY_FILES += $(SAMPLE_TARGET) + +all: $(COPY_FILES) + +.PHONY: all +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jdk/makefiles/GendataBreakIterator.gmk Wed Apr 11 14:09:48 2012 -0700 @@ -0,0 +1,97 @@ +# +# Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# + +# +# Make file for generating BreakIterator data files. +# + +# input +# +# Notes: sun.text.resources.BreakIteratorRules no longer goes to runtime. +# They are used at JDK build phase in order to create $(BIFILES) which +# are used on runtime instead. +# +TEXT_SRCDIR = $(JDK_TOPDIR)/src/share/classes +TEXT_PKG = sun/text/resources +TEXT_SOURCES = %$(TEXT_PKG)/BreakIteratorRules.java \ + %$(TEXT_PKG)/BreakIteratorInfo.java \ + %$(TEXT_PKG)/BreakIteratorRules_th.java \ + %$(TEXT_PKG)/BreakIteratorInfo_th.java + +# Generate BreakIteratorData +BREAK_ITERATOR_DIR = $(JDK_OUTPUTDIR)/break_iterator +BREAK_ITERATOR_CLASSES = $(BREAK_ITERATOR_DIR)/classes + +# JAVAC_SOURCE_PATH_UGLY_OVERRIDE is set to isolate the compile to just those +# two files in that directory and not get anything implicit from +# surrounding directories which aren't jdk 6 compatible. +# Because we are targeting jdk 6, but the surrounding source code is jdk 7. Ugh. +# These two files should be moved out to a build tool! +$(eval $(call SetupJavaCompilation,BUILD_BREAKITERATOR,\ + SETUP:=GENERATE_OLDBYTECODE,\ + SRC:=$(TEXT_SRCDIR),\ + JAVAC_SOURCE_PATH_UGLY_OVERRIDE:=$(TEXT_SRCDIR)/$(TEXT_PKG),\ + INCLUDES:=$(TEXT_PKG),\ + INCLUDE_FILES:=$(TEXT_SOURCES),\ + BIN:=$(BREAK_ITERATOR_CLASSES))) + +# Generate data resource files. +# input +UNICODEDATA = $(JDK_TOPDIR)/make/tools/UnicodeData/UnicodeData.txt + +# output +DATA_PKG_DIR = $(JDK_OUTPUTDIR)/newclasses/sun/text/resources +BIFILES = $(DATA_PKG_DIR)/CharacterBreakIteratorData \ + $(DATA_PKG_DIR)/WordBreakIteratorData \ + $(DATA_PKG_DIR)/LineBreakIteratorData \ + $(DATA_PKG_DIR)/SentenceBreakIteratorData +BIFILES_TH = $(DATA_PKG_DIR)/WordBreakIteratorData_th \ + $(DATA_PKG_DIR)/LineBreakIteratorData_th + +$(BIFILES): $(BREAK_ITERATOR_DIR)/_the.bifiles +$(BREAK_ITERATOR_DIR)/_the.bifiles: JAVA_FLAGS += -Xbootclasspath/p:$(BREAK_ITERATOR_CLASSES) +$(BREAK_ITERATOR_DIR)/_the.bifiles: $(BUILD_TOOLS) $(UNICODEDATA) $(BUILD_BREAKITERATOR) + $(ECHO) "Generating BreakIteratorData" + $(MKDIR) -p $(DATA_PKG_DIR) + rm -f $(BIFILES) + $(TOOL_GENERATEBREAKITERATORDATA) \ + -o $(DATA_PKG_DIR) \ + -spec $(UNICODEDATA) + touch $@ + +$(BIFILES_TH): $(BREAK_ITERATOR_DIR)/_the.bifiles_th +$(BREAK_ITERATOR_DIR)/_the.bifiles_th: JAVA_FLAGS += -Xbootclasspath/p:$(BREAK_ITERATOR_CLASSES) +$(BREAK_ITERATOR_DIR)/_the.bifiles_th: $(BUILD_TOOLS) $(UNICODEDATA) $(BUILD_BREAKITERATOR) + $(ECHO) "Generating BreakIteratorData_th" + $(MKDIR) -p $(DATA_PKG_DIR) + rm -f $(BIFILES_TH) + $(TOOL_GENERATEBREAKITERATORDATA) \ + -o $(DATA_PKG_DIR) \ + -spec $(UNICODEDATA) \ + -language th + touch $@ + + +BREAK_ITERATOR += $(BIFILES) $(BIFILES_TH)
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jdk/makefiles/GenerateClasses.gmk Wed Apr 11 14:09:48 2012 -0700 @@ -0,0 +1,95 @@ +# +# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# + +default: all + +include $(SPEC) +include MakeBase.gmk +include RMICompile.gmk + +CLASSES_DIR := $(JDK_OUTPUTDIR)/classes +# Depend on files in newclasses for now to avoid bad dependency handling caused by +# copy always updating timestamps in classes. +NEWCLASSES_DIR := $(JDK_OUTPUTDIR)/newclasses +# Generate classes into separate dir for now. Can't drop in same dir as JavaCompilation +# macros as that will mess up recompile deps. +STUB_CLASSES_DIR := $(JDK_OUTPUTDIR)/newrmicclasses +RMIC_GENSRC_DIR := $(JDK_OUTPUTDIR)/gendocsrc_rmic + +GENCLASSES := + +########################################################################################## +# +# Generate RMI stubs +# + +$(eval $(call SetupRMICompilation,RMI_12,\ + CLASSES:=sun.rmi.server.Activation$$$$ActivationSystemImpl\ + java.rmi.activation.ActivationGroup\ + com.sun.jndi.rmi.registry.ReferenceWrapper,\ + CLASSES_DIR:=$(NEWCLASSES_DIR),\ + STUB_CLASSES_DIR:=$(STUB_CLASSES_DIR),\ + RUN_V12:=true)) +GENCLASSES += $(RMI_12) + +$(eval $(call SetupRMICompilation,RMI_11,\ + CLASSES:=sun.rmi.registry.RegistryImpl\ + sun.rmi.transport.DGCImpl,\ + CLASSES_DIR:=$(NEWCLASSES_DIR),\ + STUB_CLASSES_DIR:=$(STUB_CLASSES_DIR),\ + RUN_V11:=true)) +GENCLASSES += $(RMI_11) + +# For RMI/IIOP call rmic a second time with -standardPackage option +# so that *_tie classes are generated in package without the prefix +# org.omg.stub (6375696) +JMAN_RMI_CLASSES:=javax.management.remote.rmi.RMIConnectionImpl\ + javax.management.remote.rmi.RMIServerImpl +$(eval $(call SetupRMICompilation,RMI_IIOP,\ + CLASSES:=$(JMAN_RMI_CLASSES),\ + CLASSES_DIR:=$(NEWCLASSES_DIR),\ + STUB_CLASSES_DIR:=$(STUB_CLASSES_DIR),\ + RUN_V12:=true,\ + RUN_IIOP:=true,\ + RUN_IIOP_STDPKG:=true)) +GENCLASSES += $(RMI_IIOP) + +# Keep generated RMI/JRMP Stub source files and copy them to RMIC_GENSRC_DIR +# so that javadoc can include them in the API (4997471) +$(eval $(call SetupRMICompilation,RMI_SRC,\ + CLASSES:=$(JMAN_RMI_CLASSES),\ + CLASSES_DIR:=$(NEWCLASSES_DIR),\ + STUB_CLASSES_DIR:=$(RMIC_GENSRC_DIR),\ + RUN_V12:=true,\ + KEEP_GENERATED:=true)) +GENCLASSES += $(filter %.java,$(RMI_SRC)) + +########################################################################################## + +all: $(GENCLASSES) + $(FIND) $(RMIC_GENSRC_DIR) -name "*.class" $(FIND_DELETE) + $(CP) -rp $(STUB_CLASSES_DIR)/* $(CLASSES_DIR) + +.PHONY: all
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jdk/makefiles/GenerateData.gmk Wed Apr 11 14:09:48 2012 -0700 @@ -0,0 +1,49 @@ +# +# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# + +default: all + +include $(SPEC) +include MakeBase.gmk +include JavaCompilation.gmk + +# Setup the java compilers for the JDK build. +include Setup.gmk +# We need the tools. +include Tools.gmk + +# Now include all the rules that generate data resources. +# These are written directly into newclasses dir. + +include GendataBreakIterator.gmk +GENDATA += $(BREAK_ITERATOR) + +########################################################################################## + +$(GENDATA) : $(BUILD_TOOLS) + +all: $(GENDATA) + +.PHONY: all
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jdk/makefiles/GenerateJavaSources.gmk Wed Apr 11 14:09:48 2012 -0700 @@ -0,0 +1,68 @@ +# +# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# + +default: all + +include $(SPEC) +include MakeBase.gmk +include JavaCompilation.gmk +include NativeCompilation.gmk + +# Setup the java compilers for the JDK build. +include Setup.gmk +# We need the tools. +include Tools.gmk + +# Now include all the rules that generate Java sources. +# The Java sources are written into the gensrc_.... directories. + +include GensrcProperties.gmk +GENSRC += $(GENSRC_PROPERTIES) + +include GensrcLocaleDataMetaInfo.gmk +GENSRC += $(GENSRC_LOCALEDATAMETAINFO) + +include GensrcCharacterData.gmk +GENSRC += $(GENSRC_CHARACTERDATA) + +include GensrcJDWP.gmk +GENSRC += $(GENSRC_JDWP) + +include GensrcMisc.gmk +GENSRC += $(GENSRC_MISC) + +$(GENSRC) : $(BUILD_TOOLS) + +all: $(GENSRC) + $(MKDIR) -p $(JDK_OUTPUTDIR)/gensrc + (cd $(JDK_OUTPUTDIR) && \ + chmod -R u+rw gensrc && \ + cp -rp gensrc_characterdata/* gensrc && \ + cp -rp gensrc_properties/* gensrc && \ + cp -rp gensrc_localedatametainfo/* gensrc && \ + cp -rp gensrc_jdwp/* gensrc && \ + cp -rp gensrc_misc/* gensrc) + +.PHONY: all
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jdk/makefiles/GensrcCharacterData.gmk Wed Apr 11 14:09:48 2012 -0700 @@ -0,0 +1,65 @@ +# +# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# + +# +# Rules to create $(JDK_OUTPUTDIR)/gensrc_characterdata/sun/lang/CharacterData*.java +# + +GENSRC_CHARACTERDATA:= + +CHARACTERDATA = $(JDK_TOPDIR)/make/tools/GenerateCharacter +UNICODEDATA = $(JDK_TOPDIR)/make/tools/UnicodeData + +define SetupCharacterData + $(JDK_OUTPUTDIR)/gensrc_characterdata/java/lang/$1.java : $(CHARACTERDATA)/$1.java.template $(BUILD_TOOLS) + mkdir -p $$(@D) + echo Generating $1.java + $(TOOL_GENERATECHARACTER) $2 \ + -template $(CHARACTERDATA)/$1.java.template \ + -spec $(UNICODEDATA)/UnicodeData.txt \ + -specialcasing $(UNICODEDATA)/SpecialCasing.txt \ + -proplist $(UNICODEDATA)/PropList.txt \ + -o $(JDK_OUTPUTDIR)/gensrc_characterdata/java/lang/$1.java -string \ + -usecharforbyte $3 + + GENSRC_CHARACTERDATA += $(JDK_OUTPUTDIR)/gensrc_characterdata/java/lang/$1.java +endef + +$(eval $(call SetupCharacterData,CharacterDataLatin1,,-latin1 8)) +$(eval $(call SetupCharacterData,CharacterData00,-plane 0,11 4 1)) +$(eval $(call SetupCharacterData,CharacterData01,-plane 1,11 4 1)) +$(eval $(call SetupCharacterData,CharacterData02,-plane 2,11 4 1)) +$(eval $(call SetupCharacterData,CharacterData0E,-plane 14,11 4 1)) + +# Copy two Java files that need no preprocessing. +$(JDK_OUTPUTDIR)/gensrc_characterdata/java/lang/%.java : $(CHARACTERDATA)/%.java.template + $(MKDIR) -p $(@D) + echo Generating $(@F) + $(CP) -f $< $@ + +GENSRC_CHARACTERDATA += $(JDK_OUTPUTDIR)/gensrc_characterdata/java/lang/CharacterDataUndefined.java \ + $(JDK_OUTPUTDIR)/gensrc_characterdata/java/lang/CharacterDataPrivateUse.java + +$(GENSRC_CHARACTERDATA) : $(BUILD_TOOLS)
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jdk/makefiles/GensrcJDWP.gmk Wed Apr 11 14:09:48 2012 -0700 @@ -0,0 +1,38 @@ +# +# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# + +# Translate the Java debugger wire protocol (jdwp.spec) file into a JDWP.java file +# and a JDWPCommands.h C-header file. + +$(JDK_OUTPUTDIR)/gensrc_jdwp_headers/JDWPCommands.h : $(JDK_TOPDIR)/makefiles/jpda/jdwp/jdwp.spec + +$(JDK_OUTPUTDIR)/gensrc_jdwp/com/sun/tools/jdi/JDWP.java : $(JDK_TOPDIR)/makefiles/jpda/jdwp/jdwp.spec + mkdir -p $(@D) + mkdir -p $(JDK_OUTPUTDIR)/gensrc_jdwp_headers + $(ECHO) Creating JDWP.java and JDWPCommands.h from jdwp.spec + $(TOOL_JDWPGEN) $< -jdi $@ -include $(JDK_OUTPUTDIR)/gensrc_jdwp_headers/JDWPCommands.h + +GENSRC_JDWP:= $(JDK_OUTPUTDIR)/gensrc_jdwp/com/sun/tools/jdi/JDWP.java \ + $(JDK_OUTPUTDIR)/gensrc_jdwp_headers/JDWPCommands.h
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jdk/makefiles/GensrcLocaleDataMetaInfo.gmk Wed Apr 11 14:09:48 2012 -0700 @@ -0,0 +1,93 @@ +# +# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# + +# Scan for all locale resources and extract for which locales there exists +# resources. Then put this meta information about exiting (supported?) locales +# into LocaleDataMetaInfo.java + +# First go look for all locale files +LOCALE_FILES:=$(shell $(FIND) $(JDK_TOPDIR)/src/share/classes \ + -name "FormatData_*.java" -o -name "FormatData_*.properties" -o \ + -name "CollationData_*.java" -o -name "CollationData_*.properties" -o \ + -name "TimeZoneNames_*.java" -o -name "TimeZoneNames_*.properties" -o \ + -name "LocaleNames_*.java" -o -name "LocaleNames_*.properties" -o \ + -name "CurrencyNames_*.java" -o -name "CurrencyNames_*.properties" -o \ + -name "CalendarData_*.java" -o -name "CalendarData_*.properties") + +# Then translate the locale files into for example: FormatData_sv +LOCALE_RESOURCES:=$(sort $(subst .properties,,$(subst .java,,$(notdir $(LOCALE_FILES))))) + +# Include the list of resources found during the previous compile. +-include $(JDK_OUTPUTDIR)/gensrc_localedatametainfo/_the.locale_resources + +MISSING_RESOURCES:=$(filter-out $(LOCALE_RESOURCES),$(PREV_LOCALE_RESOURCES)) +NEW_RESOURCES:=$(filter-out $(PREV_LOCALE_RESOURCES),$(LOCALE_RESOURCES)) + +ifneq (,$(MISSING_RESOURCES)$(NEW_RESOURCES)) + # There is a difference in the number of supported resources. Trigger a regeneration. + $(shell $(RM) $(JDK_OUTPUTDIR)/gensrc_localedatametainfo/sun/util/LocaleDataMetaInfo.java) +endif + +# The non-euro zone locales have to be separated from the euro-zone locales. +NON_EURO_LOCALES:=ar% hi% iw% ja% ko% th% vi% zh% + +# This macro creates a sed expression that substitues for example: +# #FormatData_EuroLocales# with: be be_BY bg bg_BG ca ca_ES... and some more. +CAPTURE_LOCALE='s/$$(HASH)$1_$2EuroLocales$$(HASH)/ $$($3 $(NON_EURO_LOCALES),$$(filter-out $1,$$(subst $1_,,$$(filter $1_%,$(LOCALE_RESOURCES)))))/g' + +SED_ARGS:=-e 's|$(HASH)warn This file is preprocessed before being compiled|// -- This file was mechanically generated: Do not edit! -- //|g' +#sun.text.resources.FormatData +$(eval SED_ARGS+=-e $(call CAPTURE_LOCALE,FormatData,,filter-out)) +$(eval SED_ARGS+=-e $(call CAPTURE_LOCALE,FormatData,Non,filter)) + +#sun.text.resources.CollationData +$(eval SED_ARGS+=-e $(call CAPTURE_LOCALE,CollationData,,filter-out)) +$(eval SED_ARGS+=-e $(call CAPTURE_LOCALE,CollationData,Non,filter)) + +#sun.util.resources.TimeZoneNames +$(eval SED_ARGS+=-e $(call CAPTURE_LOCALE,TimeZoneNames,,filter-out)) +$(eval SED_ARGS+=-e $(call CAPTURE_LOCALE,TimeZoneNames,Non,filter)) + +#sun.util.resources.LocaleNames +$(eval SED_ARGS+=-e $(call CAPTURE_LOCALE,LocaleNames,,filter-out)) +$(eval SED_ARGS+=-e $(call CAPTURE_LOCALE,LocaleNames,Non,filter)) + +#sun.util.resources.CurrencyNames +$(eval SED_ARGS+=-e $(call CAPTURE_LOCALE,CurrencyNames,,filter-out)) +$(eval SED_ARGS+=-e $(call CAPTURE_LOCALE,CurrencyNames,Non,filter)) + +#sun.util.resources.CalendarData +$(eval SED_ARGS+=-e $(call CAPTURE_LOCALE,CalendarData,,filter-out)) +$(eval SED_ARGS+=-e $(call CAPTURE_LOCALE,CalendarData,Non,filter)) + +$(JDK_OUTPUTDIR)/gensrc_localedatametainfo/sun/util/LocaleDataMetaInfo.java: \ + $(JDK_TOPDIR)/src/share/classes/sun/util/LocaleDataMetaInfo-XLocales.java.template + mkdir -p $(@D) + $(ECHO) Creating sun/util/LocaleDataMetaInfo.java from $(words $(LOCALE_RESOURCES)) found resources. + $(PRINTF) "PREV_LOCALE_RESOURCES:=$(LOCALE_RESOURCES)" > $(JDK_OUTPUTDIR)/gensrc_localedatametainfo/_the.locale_resources + $(SED) $(SED_ARGS) $(JDK_TOPDIR)/src/share/classes/sun/util/LocaleDataMetaInfo-XLocales.java.template \ + > $(JDK_OUTPUTDIR)/gensrc_localedatametainfo/sun/util/LocaleDataMetaInfo.java + +GENSRC_LOCALEDATAMETAINFO:=$(JDK_OUTPUTDIR)/gensrc_localedatametainfo/sun/util/LocaleDataMetaInfo.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jdk/makefiles/GensrcMisc.gmk Wed Apr 11 14:09:48 2012 -0700 @@ -0,0 +1,74 @@ +# +# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# + +########################################################################################## +# Install the launcher name, release version string, full version +# string and the runtime name into the Version.java file. +# To be printed by java -version + +$(JDK_OUTPUTDIR)/gensrc_misc/sun/misc/Version.java: \ + $(JDK_TOPDIR)/src/share/classes/sun/misc/Version.java.template + $(MKDIR) -p $(@D) + echo Generating sun/misc/Version.java + $(SED) -e 's/@@launcher_name@@/$(LAUNCHER_NAME)/g' \ + -e 's/@@java_version@@/$(RELEASE)/g' \ + -e 's/@@java_runtime_version@@/$(FULL_VERSION)/g' \ + -e 's/@@java_runtime_name@@/$(RUNTIME_NAME)/g' \ + $< > $@ + +GENSRC_MISC += $(JDK_OUTPUTDIR)/gensrc_misc/sun/misc/Version.java + +########################################################################################## +# Version file for jconsole + +$(JDK_OUTPUTDIR)/gensrc_misc/sun/tools/jconsole/Version.java: \ + $(JDK_TOPDIR)/src/share/classes/sun/tools/jconsole/Version.java.template + $(MKDIR) -p $(@D) + echo Generating sun/tools/jconsole/Version.java + $(SED) -e 's/@@jconsole_version@@/$(FULL_VERSION)/g' $< > $@ + +GENSRC_MISC += $(JDK_OUTPUTDIR)/gensrc_misc/sun/tools/jconsole/Version.java + +########################################################################################## + +ifeq ($(HOST_OS_API),posix) + UPSUFFIX:=$(PLATFORM) + ifeq ($(PLATFORM),macosx) + UPSUFFIX:=bsd + endif + # UNIXProcess.java is different for solaris and linux. We need to copy + # the correct UNIXProcess.java over to $(JDK_OUTPUTDIR)/gensrc/java/lang/. + + $(JDK_OUTPUTDIR)/gensrc_misc/java/lang/UNIXProcess.java : \ + $(JDK_TOPDIR)/src/solaris/classes/java/lang/UNIXProcess.java.$(UPSUFFIX) + $(MKDIR) -p $(@D) + echo Copying UNIXProcess.java.$(PLATFORM) to java/lang/UNIXProcess.java + $(CP) $< $@ + $(CHMOD) u+rw $@ + + GENSRC_MISC += $(JDK_OUTPUTDIR)/gensrc_misc/java/lang/UNIXProcess.java +endif + +##########################################################################################
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jdk/makefiles/GensrcProperties.gmk Wed Apr 11 14:09:48 2012 -0700 @@ -0,0 +1,272 @@ +# +# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# + +# All .properties files to be compiled are appended to this variable. +ALL_COMPILED_PROPSOURCES:= +# All generated .java files from compilation are appended to this variable. +ALL_COMPILED_PROPJAVAS:= +# The (very long) command line for compilation, stored in a file, prior to use. +COMPILE_PROPCMDLINE:= + +# All .properties files to be cleaned are appended to this variable. +ALL_CLEANED_PROPSOURCES:= +# All generated cleaned .properties files from cleaning are appended to this variable. +ALL_CLEANED_PROPOUTPUT:= +# The (very long) command line for cleaning, stored in a file, prior to use. +CLEAN_PROPCMDLINE:= + +define add_properties_to_compile + # $1 is the name of the properties group + # $2 is the files belonging to this group + # $3 is the super class for the generated java file. + # $4 is a from pattern for translating stripped name from source to target + # $5 is the to pattern replacing $3 in the target + + # Strip away prefix and suffix, + # leaving for example: sun/util/resources/CurrencyNames_sv + $1_PROPPATHS:=$$(patsubst $(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)/classes/%.properties,%,\ + $$(patsubst $(JDK_TOPDIR)/src/share/classes/%.properties,%,$2)) + + # Apply optional name transformation, example: hz_TW -> hz_HK + $(if $4,$1_PROPPATHS:=$$(patsubst $4,$5,$$($1_PROPPATHS))) + + # Accumulate all found properties files. + ALL_COMPILED_PROPSOURCES+=$2 + + # Generate the list of to be created java files. + ALL_COMPILED_PROPJAVAS+=$$(patsubst %,$(JDK_OUTPUTDIR)/gensrc_properties/%.java,$$($1_PROPPATHS)) + + # Now generate a sequence of "-compile ...CurrencyNames_sv.properties ...CurrencyNames_sv.java ListResourceBundle" + # suitable to be fed into the CompileProperties command. + COMPILE_PROPCMDLINE+=$$(subst _SPACE_,$(SPACE),$$(join $$(addprefix -compile_SPACE_,$2), \ + $$(addsuffix _SPACE_$(strip $3),\ + $$(addprefix _SPACE_$(JDK_OUTPUTDIR)/gensrc_properties/,\ + $$(addsuffix .java,$$($1_PROPPATHS)))))) +endef + +define add_properties_to_clean + # $1 is the name of the properties group + # $2 is the files belonging to this group + # $3 is a from pattern for translating stripped name from source to target + # $4 is the to pattern replacing $3 in the target + # $5 optional name of extra directory to put properties files in (ex: resources) + + # Strip away prefix and suffix, + # leaving for example: sun/util/resources/CurrencyNames_sv + $1_PROPPATHS:=$$(patsubst $(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)/classes/%.properties,%,\ + $$(patsubst $(JDK_TOPDIR)/src/share/classes/%.properties,%,$2)) + + # Apply optional name transformation, example: hz_TW -> hz_HK + $(if $3,$1_PROPPATHS:=$$(patsubst $3,$4,$$($1_PROPPATHS))) + + # Accumulate all found properties files. + ALL_CLEANED_PROPSOURCES+=$2 + + # Generate the list of to be created java files. + $1_PROPOUTPUT:=$$(patsubst %,$(JDK_OUTPUTDIR)/newclasses/%.properties,$$($1_PROPPATHS)) + # If the properties target file isn't in a "resources" dir, add one. + ifneq ($5,) + $1_PROPOUTPUT:=$$(foreach p,$$($1_PROPOUTPUT), $$(dir $$p)$5/$$(notdir $$p)) + endif + + ALL_CLEANED_PROPOUTPUT+=$$($1_PROPOUTPUT) + + # Now generate a sequence of "-clean ...[src]...CurrencyNames_sv.properties ...[build]...CurrencyNames_sv.properties" + # suitable to be fed into the StripProperties command. + CLEAN_PROPCMDLINE+=$$(subst _SPACE_,$(SPACE),$$(join $$(addprefix -clean_SPACE_,$2), \ + $$(addprefix _SPACE_,$$($1_PROPOUTPUT)))) +endef + +# Some packages contain pregenerated java files instead of properties files. +# But unfortunately not all properties should be converted, some should be +# copied....argggghhh. + +# For example: +# sun/applet/resources +# sun/misc/resources +# sun/text/resources +# sun/tools/jconsole/resources +# sun/tools/native2ascii/resources +# sun/util/resources + +# Some packages have properties that need to be converted to java source files. + +#com/sun/accessibility/internal/resources +$(eval $(call add_properties_to_compile,COM_SUN_ACCESSIBILITY,\ + $(shell find $(JDK_TOPDIR)/src/share/classes/com/sun/accessibility/internal/resources -name "*.properties"),\ + ListResourceBundle)) +$(eval $(call add_properties_to_compile,COM_SUN_ACCESSIBILITY_HK,\ + $(shell find $(JDK_TOPDIR)/src/share/classes/com/sun/accessibility/internal/resources -name "*.properties"),\ + ListResourceBundle,%zh_TW,%zh_HK)) +#com/sun/imageio/plugins/common +#com/sun/java/swing/plaf/gtk/resources +#com/sun/java/swing/plaf/motif/resources +#com/sun/java/swing/plaf/windows/resources +#com/sun/java/util/jar/pack +$(eval $(call add_properties_to_clean,JNDI_COSNAMING,\ + $(JDK_TOPDIR)/src/share/classes/com/sun/java/util/jar/pack/intrinsic.properties)) +#com/sun/jndi/cosnaming +$(eval $(call add_properties_to_clean,JNDI_COSNAMING,\ + $(JDK_TOPDIR)/src/share/classes/com/sun/jndi/cosnaming/jndiprovider.properties)) +#com/sun/jndi/ldap +$(eval $(call add_properties_to_clean,JNDI_COSNAMING,\ + $(JDK_TOPDIR)/src/share/classes/com/sun/jndi/ldap/jndiprovider.properties)) + +#com/sun/org/apache/xml/internal/security/resource +#FIXME: The "xmlsecurity*.properties" pattern is not ideal; we might want to find +#a better way to select the properties files that are needed. +$(eval $(call add_properties_to_clean,XML_SECURITY,\ + $(shell find $(JDK_TOPDIR)/src/share/classes/com/sun/org/apache/xml/internal/security/resource -name "xmlsecurity*.properties"))) + +#com/sun/rowset +$(eval $(call add_properties_to_clean,COM_SUN_ROWSET,\ + $(shell find $(JDK_TOPDIR)/src/share/classes/com/sun/rowset -name "*.properties"))) +$(eval $(call add_properties_to_clean,COM_SUN_ROWSET_HK,\ + $(shell find $(JDK_TOPDIR)/src/share/classes/com/sun/rowset -name "*zh_TW.properties"),\ + %zh_TW,%zh_HK)) + +#com/sun/servicetag/resources +#com/sun/swing/internal/plaf/basic/resources +#com/sun/swing/internal/plaf/metal/resources +#com/sun/swing/internal/plaf/synth/resources + +#com/sun/tools/jdi/resources +$(eval $(call add_properties_to_compile,COM_SUN_TOOLS_JDI,\ + $(shell find $(JDK_TOPDIR)/src/share/classes/com/sun/tools/jdi/resources -name "*.properties"),\ + ListResourceBundle)) + +#com/sun/tools/script/shell +#java/util +#javax/sql/rowset +#sun/awt/resources +$(eval $(call add_properties_to_compile,SUN_AWT,\ + $(shell find $(JDK_TOPDIR)/src/share/classes/sun/awt/resources -name "*.properties"),\ + ListResourceBundle)) +$(eval $(call add_properties_to_compile,SUN_AWT_HK,\ + $(shell find $(JDK_TOPDIR)/src/share/classes/sun/awt/resources -name "*.properties"),\ + ListResourceBundle,%zh_TW,%zh_HK)) +#sun/launcher/resources +$(eval $(call add_properties_to_compile,SUN_LAUNCHER,\ + $(shell find $(JDK_TOPDIR)/src/share/classes/sun/launcher/resources -name "*.properties"),\ + ListResourceBundle)) +$(eval $(call add_properties_to_compile,SUN_LAUNCHER_HK,\ + $(shell find $(JDK_TOPDIR)/src/share/classes/sun/launcher/resources -name "*.properties"),\ + ListResourceBundle,%zh_TW,%zh_HK)) +#sun/management/resources +#sun/print +#sun/print/resources +$(eval $(call add_properties_to_compile,SUN_PRINT,\ + $(shell find $(JDK_TOPDIR)/src/share/classes/sun/print/resources -name "*.properties"),\ + ListResourceBundle)) +$(eval $(call add_properties_to_compile,SUN_PRINT_HK,\ + $(shell find $(JDK_TOPDIR)/src/share/classes/sun/print/resources -name "*.properties"),\ + ListResourceBundle,%zh_TW,%zh_HK)) +#sun/rmi/registry/resources +$(eval $(call add_properties_to_clean,SUN_RMI_REGISTRY,\ + $(shell find $(JDK_TOPDIR)/src/share/classes/sun/rmi/registry/resources -name "*.properties"))) +$(eval $(call add_properties_to_clean,SUN_RMI_REGISTRY_HK,\ + $(shell find $(JDK_TOPDIR)/src/share/classes/sun/rmi/registry/resources -name "*zh_TW.properties"),\ + %zh_TW,%zh_HK)) + +#sun/rmi/rmic/resources +$(eval $(call add_properties_to_clean,SUN_RMI_RMIC,\ + $(shell find $(JDK_TOPDIR)/src/share/classes/sun/rmi/rmic/resources -name "*.properties"))) + +#sun/rmi/server/resources +$(eval $(call add_properties_to_clean,SUN_RMI_SERVER,\ + $(shell find $(JDK_TOPDIR)/src/share/classes/sun/rmi/server/resources -name "*.properties"))) +$(eval $(call add_properties_to_clean,SUN_RMI_SERVER_HK,\ + $(shell find $(JDK_TOPDIR)/src/share/classes/sun/rmi/server/resources -name "*zh_TW.properties"),\ + %zh_TW,%zh_HK)) + +# sun/tools/jar/resources +$(eval $(call add_properties_to_compile,SUN_TOOLS_JAR,\ + $(shell find $(JDK_TOPDIR)/src/share/classes/sun/tools/jar/resources -name "*.properties"),\ + ListResourceBundle)) +$(eval $(call add_properties_to_compile,SUN_TOOLS_JAR_HK,\ + $(shell find $(JDK_TOPDIR)/src/share/classes/sun/tools/jar/resources -name "*.properties"),\ + ListResourceBundle,%zh_TW,%zh_HK)) + +#sun/tools/javac/resources +# It's unclear if the other localized property files here are supposed to be copied or not +# but the old build system didn't copy them. +$(eval $(call add_properties_to_clean,SUN_TOOLS_SERIALVER,\ + $(shell find $(JDK_TOPDIR)/src/share/classes/sun/tools/javac/resources -name "javac.properties"))) + +#sun/tools/serialver +$(eval $(call add_properties_to_clean,SUN_TOOLS_SERIALVER,\ + $(shell find $(JDK_TOPDIR)/src/share/classes/sun/tools/serialver -name "*.properties"),,,resources)) + +#sun/util/logging/resources +$(eval $(call add_properties_to_compile,SUN_UTIL_LOGGING,\ + $(shell find $(JDK_TOPDIR)/src/share/classes/sun/util/logging/resources -name "*.properties"),\ + ListResourceBundle)) +$(eval $(call add_properties_to_compile,SUN_UTIL_LOGGING_HK,\ + $(shell find $(JDK_TOPDIR)/src/share/classes/sun/util/logging/resources -name "*.properties"),\ + ListResourceBundle,%zh_TW,%zh_HK)) +# sun/util/resources +$(eval $(call add_properties_to_compile,SUN_UTIL,\ + $(shell find $(JDK_TOPDIR)/src/share/classes/sun/util/resources -name "*.properties"),\ + LocaleNamesBundle)) + + +# Now setup the rule for the generation of the resource bundles. +$(JDK_OUTPUTDIR)/gensrc_properties/_the.compiled_properties : $(ALL_COMPILED_PROPSOURCES) $(BUILD_TOOLS) + $(RM) -rf $(JDK_OUTPUTDIR)/gensrc_properties/* +# Generate all output directories in advance since the build tool does not do that... + $(MKDIR) -p $(sort $(dir $(ALL_COMPILED_PROPJAVAS))) + echo Compiling $(words $(ALL_COMPILED_PROPSOURCES)) properties into resource bundles + $(call ListPathsSafely,COMPILE_PROPCMDLINE,\n, >> $(JDK_OUTPUTDIR)/gensrc_properties/_the.cmdline) + $(TOOL_COMPILEPROPERTIES) -quiet @$(JDK_OUTPUTDIR)/gensrc_properties/_the.cmdline + touch $@ + +# Now setup the rule for the generation of the cleaned properties. +# FIXME: We currently don't handle removed properties incrementally. +$(JDK_OUTPUTDIR)/newclasses/_the.cleaned_properties : $(ALL_CLEANED_PROPSOURCES) $(BUILD_TOOLS) + $(RM) -f $(JDK_OUTPUTDIR)/newclasses/_the.cleaned_properties.cmdline +# Generate all output directories in advance since the build tool does not do that... + $(MKDIR) -p $(sort $(dir $(ALL_CLEANED_PROPOUTPUT))) + echo Copying and cleaning $(words $(ALL_CLEANED_PROPSOURCES)) properties + $(call ListPathsSafely,CLEAN_PROPCMDLINE,\n, >> $(JDK_OUTPUTDIR)/newclasses/_the.cleaned_properties.cmdline) + $(TOOL_STRIPPROPERTIES) @$(JDK_OUTPUTDIR)/newclasses/_the.cleaned_properties.cmdline + touch $@ + +$(ALL_COMPILED_PROPJAVAS) : $(JDK_OUTPUTDIR)/gensrc_properties/_the.compiled_properties + +$(ALL_CLEANED_PROPOUTPUT) : $(JDK_OUTPUTDIR)/newclasses/_the.cleaned_properties + + +# Some zh_HK resources are just copied of zh_TW +$(JDK_OUTPUTDIR)/gensrc_properties/%_zh_HK.java: $(JDK_TOPDIR)/src/share/classes/%_zh_TW.java + $(MKDIR) -p $(@D) + $(CAT) $< | $(SED) -e '/class/s/_zh_TW/_zh_HK/' > $@ + +ZH_HK_JAVA:= sun/applet/resources/MsgAppletViewer_zh_HK.java \ + sun/misc/resources/Messages_zh_HK.java \ + sun/security/util/AuthResources_zh_HK.java +ZH_HK_JAVA_FILES:=$(addprefix $(JDK_OUTPUTDIR)/gensrc_properties/,$(ZH_HK_JAVA)) + + +GENSRC_PROPERTIES:=$(ALL_COMPILED_PROPJAVAS) $(ALL_CLEANED_PROPOUTPUT) $(ZH_HK_JAVA_FILES)
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jdk/makefiles/Images.gmk Wed Apr 11 14:09:48 2012 -0700 @@ -0,0 +1,74 @@ +# +# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# + +include $(SPEC) +include MakeBase.gmk +include JavaCompilation.gmk +include Setup.gmk + +default: $(IMAGES_OUTPUTDIR)/_the.images + +include Tools.gmk + +JARS:= + +########################################################################################## + +JCONSOLE_JAR_DEPS := \ + $(shell $(FIND) $(JDK_OUTPUTDIR)/newclasses/sun/tools/jconsole/ -name "_the.package") \ + $(shell $(FIND) $(JDK_OUTPUTDIR)/newclasses/com/sun/tools/jconsole/ -name "_the.package") + +$(eval $(call SetupArchive,BUILD_JCONSOLE_JAR,$(JCONSOLE_JAR_DEPS),\ + SRCS:=$(JDK_OUTPUTDIR)/newclasses,\ + SUFFIXES:=.class .gif .png,\ + INCLUDES:=sun/tools/jconsole com/sun/tools/jconsole,\ + JARMAIN:=sun.tools.jconsole.JConsole,\ + JAR:=$(JDK_OUTPUTDIR)/lib/jconsole.jar,\ + SKIP_METAINF:=true)) + +JARS+=$(JDK_OUTPUTDIR)/lib/jconsole.jar + +########################################################################################## + +# Need to define BUILDDIR for Release.gmk to work +BUILDDIR=$(JDK_TOPDIR)/makefiles +include common/Defs.gmk +include common/Release.gmk + +# A rudimentary attempt at band-aiding the dependency tracking. +DEPS:= $(shell $(FIND) $(JDK_OUTPUTDIR)/newclasses -name "*.class" -type f) \ + $(shell $(FIND) $(JDK_OUTPUTDIR)/bin -type f) \ + $(shell $(FIND) $(JDK_OUTPUTDIR)/lib -type f) + +$(IMAGES_OUTPUTDIR)/_the.images : $(DEPS) $(JARS) + $(MKDIR) -p $(@D) +# Restart this makefile, ugly, but since double colon (::) rules +# have been used in Release.gmk, it is impossible to craft on +# dependencies on these. I.e. -do-not-use- :: rules!!!!! +# Repeat after me: -do-not-use- :: rules!!!!! + $(MAKE) -j1 -f Images.gmk $(IMAGES_MAKE_ARGS) images + $(TOUCH) $@ + +.PHONY: default
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jdk/makefiles/LegacyMakefiles.gmk Wed Apr 11 14:09:48 2012 -0700 @@ -0,0 +1,57 @@ +# +# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# + +include $(SPEC) +include MakeBase.gmk + +all: $(JDK_OUTPUTDIR)/_the.legacy_make + +DEPS:= $(shell $(FIND) $(JDK_TOPDIR)/makefiles/java -type f) \ + $(shell $(FIND) $(JDK_TOPDIR)/makefiles/javax -type f) \ + $(shell $(FIND) $(JDK_TOPDIR)/makefiles/sun -type f) \ + $(shell $(FIND) $(JDK_TOPDIR)/makefiles/com -type f) \ + $(shell $(FIND) $(JDK_TOPDIR)/makefiles/apple -type f) + +$(JDK_OUTPUTDIR)/_the.legacy_make: $(DEPS) + (echo Building single threaded Java subdir && \ + $(MAKE) -j1 -C java all && \ + (if test "$(PLATFORM)" = macosx; then \ + echo Building single threaded Apple subdir && \ + $(MAKE) -j1 -C apple all; \ + fi) && \ + echo Building single threaded javax subdir && \ + $(MAKE) -j1 -C javax all && \ + echo Building single threaded sun subdir && \ + $(MAKE) -j1 -C sun all && \ + echo Building single threaded com subdir && \ + $(MAKE) -j1 -C com all && \ + if [ -z "$(OPENJDK)" ]; then \ + echo Building single threaded altclasses subdir && \ + $(MAKE) -j1 -C altclasses all; \ + fi && \ + touch $@) + +.PHONY: all +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jdk/makefiles/Makefile Wed Apr 11 14:09:48 2012 -0700 @@ -0,0 +1,92 @@ +# +# Copyright (c) 1995, 2012, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# + +default: all + +include $(SPEC) +include MakeBase.gmk +include JavaCompilation.gmk +include NativeCompilation.gmk + +# Setup the java compilers for the JDK build. +include Setup.gmk + +# Setup the build tools. +include Tools.gmk + + +all: $(BUILD_TOOLS) + +make -f GenerateJavaSources.gmk +# Drop back to the old makefiles for +# packages/libs that have not yet been converted. + +make -f LegacyMakefiles.gmk +# Ok, now gensrc is fully populated. + +make -f GenerateData.gmk + +make -f CompileJavaClasses.gmk +# The classes have been built, now generate +# classes that have other sources. + +make -f GenerateClasses.gmk +# The classes are now built and +# any javah files have now been generated. + +make -f CompileNativeLibraries.gmk +# Finally compile the launchers. + +make -f CompileLaunchers.gmk +# Now we have a complete jdk, which you can run. +# It is not yet wrapped up as an installed image. +# The demos are compiled against this jdk. +ifndef NO_DEMOS + +make -f CompileDemos.gmk +endif +# Now copy the sample sources into the jdk. +ifndef NO_SAMPLES + +make -f CopySamples.gmk +endif + +# Create the final jdk and jre images, to be wrapped up +# into packages, or instealled. +images: all + +make $(IMAGES_MAKE_ARGS) -f Images.gmk + + +BINARIES:=$(shell if test -d $(IMAGES_OUTPUTDIR)/j2sdk-image/bin; then cd $(IMAGES_OUTPUTDIR)/j2sdk-image/bin && $(LS) ; fi) +INSTALLDIR:=openjdk-$(RELEASE) + +# Install the jdk image, in a very crude way. Not taking into +# account, how to install properly on macosx or windows etc. +install: images + echo Installing jdk image into $(INSTALL_PREFIX)/jvm/$(INSTALLDIR) + echo and creating $(words $(BINARIES)) links from $(INSTALL_PREFIX)/bin into the jdk. + $(MKDIR) -p $(INSTALL_PREFIX)/jvm/$(INSTALLDIR) + $(RM) -r $(INSTALL_PREFIX)/jvm/$(INSTALLDIR)/* + $(CP) -rp $(IMAGES_OUTPUTDIR)/j2sdk-image/* $(INSTALL_PREFIX)/jvm/$(INSTALLDIR) + $(RM) $(addprefix $(INSTALL_PREFIX)/bin/,$(BINARIES)) + $(foreach b,$(BINARIES),$(LN) -s $(INSTALL_PREFIX)/jvm/$(INSTALLDIR)/bin/$b $(INSTALL_PREFIX)/bin/$b &&) true + +# Create the deb,rpm,tgz,zip, packages. +packages: images + echo Creating packages...well, in the future. + $(MKDIR) -p $(OUTPUT_ROOT)/packages + +.PHONY: all install
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jdk/makefiles/PatchList.solaris Wed Apr 11 14:09:48 2012 -0700 @@ -0,0 +1,31 @@ +BUILD,RUNTIME 5.8 Sparc 109147-24 x86 109148-24 REQ "Linker patch" +BUILD,RUNTIME 5.8 Sparc 108652-66 x86 108653-55 REQ "Xserver patch" +BUILD,RUNTIME 5.8 Sparc 108940-52 x86 108941-52 REQ "Motif 2.1 patch" +BUILD,RUNTIME 5.8 Sparc 108989-02 x86 108990-02 REQ "Accounting patch" +BUILD,RUNTIME 5.8 Sparc none x86 111307-04 REQ "boot.bin, bootconf.exe, bootenv.rc and nbp patch" +BUILD,RUNTIME 5.8 Sparc 111310-01 x86 111311-01 REQ "libhcpagent.so.l patch" +BUILD,RUNTIME 5.8 Sparc 112396-02 x86 112397-02 REQ "fgrep patch" +BUILD,RUNTIME 5.8 Sparc 108987-13 x86 108988-13 REQ "patchadd, patchrm patch" +BUILD,RUNTIME 5.8 Sparc 111111-03 x86 111112-03 REQ "nawk patch" +BUILD,RUNTIME 5.8 Sparc 108528-20 x86 108529-20 REQ "Kernel update" +BUILD,RUNTIME 5.8 Sparc 108993-18 x86 none REQ "LDAP2 Patch" +BUILD,RUNTIME 5.8 Sparc none x86 110400-01 REQ "RBAC Feature patch" +BUILD,RUNTIME 5.8 Sparc none x86 111024-02 REQ "/kernel/fs/mntfs patch" +BUILD,RUNTIME 5.8 Sparc none x86 108994-18 REQ "LDAP2 patch" +BUILD,RUNTIME 5.8 Sparc 109147-23 x86 109148-23 REQ "linker patch" +BUILD,RUNTIME 5.8 Sparc 111308-03 x86 111309-03 REQ "Performance for apps using memory alloc" +RUNTIME 5.8 Sparc 112003-03 x86 none REQ "Fontset patch for sparcv9" +RUNTIME 5.8 Sparc 108921-16 x86 108922-16 REQ "CDE patch" +RUNTIME 5.8 Sparc 108773-18 x86 108774-18 REQ "X input method patch" +RUNTIME 5.8 Sparc 110386-03 x86 none REQ "RBAC Feature Patch" +RUNTIME 5.8 Sparc 111023-02 x86 none REQ "/kernel/fs/mntfs and /kernel/fs/sparcv9/mntfs patch" +RUNTIME 5.8 Sparc 112472-01 x86 112473-01 OPT "Font2DTest2 patch" +RUNTIME 5.8 Sparc 112438-01 x86 112439-01 REQ "/kernel/drv/random patch" + +COMPILER 5.8 Sparc 109505-06 x86 109502-03 REQ "For C 5.0, C++ 5.0" +COMPILER 5.8 Sparc 109513-05 x86 109514-03 REQ "For Forte Development 6 C compiler" +COMPILER 5.8 Sparc 109508-03 x86 109509-03 REQ "For Forte Development 6 update 1 C++ compiler" +COMPILER 5.8 Sparc 109510-03 x86 109511-03 REQ "For Forte 6.1 Debugger" +COMPILER 5.8 Sparc 109516-02 x86 109517-02 REQ "For Forte 6.1 Performance Analyzer" +COMPILER 5.8 Sparc 110480-01 x86 110481-01 REQ "For Forte TeamWare" +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jdk/makefiles/Setup.gmk Wed Apr 11 14:09:48 2012 -0700 @@ -0,0 +1,77 @@ +# +# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# + +JAVAC_JARS ?= "-Xbootclasspath/p:$(LANGTOOLS_OUTPUTDIR)/dist/bootstrap/lib/javac.jar" -jar $(LANGTOOLS_OUTPUTDIR)/dist/bootstrap/lib/javac.jar +JAVAH_JARS ?= "-Xbootclasspath/p:$(LANGTOOLS_OUTPUTDIR)/dist/bootstrap/lib/javah.jar" -jar $(LANGTOOLS_OUTPUTDIR)/dist/bootstrap/lib/javah.jar + +DISABLE_WARNINGS:=-Xlint:all,-deprecation,-unchecked,-rawtypes,-cast,-serial,-dep-ann,-static,-fallthrough,-try,-varargs,-empty,-finally + +# The generate old bytecode javac setup uses the new compiler to compile for the +# boot jdk to generate tools that need to be run with the boot jdk. +# Thus we force the target bytecode to 6. +$(eval $(call SetupJavaCompiler,GENERATE_OLDBYTECODE,\ + JVM:=$(JAVA),\ + JAVAC:=$(JAVAC_JARS),\ + FLAGS:=-source 7 -target 7 -bootclasspath $(BOOT_RTJAR) $(DISABLE_WARNINGS),\ + SERVER_DIR:=$(JAVAC_SERVERS),\ + SERVER_JVM:=$(SERVER_JAVA),\ + MODE:=$(JAVAC_USE_MODE),\ + USE_DEPS:=$(JAVAC_USE_DEPS))) + +# The generate new bytecode javac setup uses the new compiler to compile for the +# new jdk. This new bytecode might only be possible to run using the new jvm. +$(eval $(call SetupJavaCompiler,GENERATE_JDKBYTECODE,\ + JVM:=$(JAVA),\ + JAVAC:=$(JAVAC_JARS),\ + JAVAH:=$(JAVAH_JARS),\ + FLAGS:=-bootclasspath "$(JDK_OUTPUTDIR)/newclasses$(PATH_SEP)$(JDK_OUTPUTDIR)/classes" -Xprefer:source -XDignore.symbol.file=true $(DISABLE_WARNINGS),\ + SERVER_DIR:=$(JAVAC_SERVERS),\ + SERVER_JVM:=$(SERVER_JAVA),\ + MODE:=$(JAVAC_USE_MODE),\ + USE_DEPS:=$(JAVAC_USE_DEPS))) + +# After the jdk is built, we want to build demos using only the recently +# generated jdk classes and nothing else, no jdk source, etc etc. +# I.e. the rt.jar, but since rt.jar has not yet been generated +# (it will be in "make images") therefore we use classes instead. +$(eval $(call SetupJavaCompiler,GENERATE_USINGJDKBYTECODE,\ + JVM:=$(JAVA),\ + JAVAC:=$(JAVAC_JARS),\ + FLAGS:= -Xbootclasspath:$(JDK_OUTPUTDIR)/classes $(DISABLE_WARNINGS),\ + SERVER_DIR:=$(JAVAC_SERVERS),\ + SERVER_JVM:=$(SERVER_JAVA),\ + MODE:=$(JAVAC_USE_MODE),\ + USE_DEPS:=$(JAVAC_USE_DEPS))) + +# A temporary solution to work around the fact that Matrix3D.java +# exists in several applets. The javacserver does not like to be +# fed the same class twice. Thus we compile one applet outside of the +# javacserver. +$(eval $(call SetupJavaCompiler,GENERATE_USINGJDKBYTECODE_NOSERV,\ + JVM:=$(JAVA),\ + JAVAC:=$(JAVAC_JARS),\ + FLAGS:= -Xbootclasspath:$(JDK_OUTPUTDIR)/classes $(DISABLE_WARNINGS),\ + MODE:=SINGLE_THREADED_BATCH,\ + USE_DEPS:=FALSE))
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jdk/makefiles/Tools.gmk Wed Apr 11 14:09:48 2012 -0700 @@ -0,0 +1,114 @@ +# +# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# + +ifeq (,$(BUILD_TOOLS)) +$(eval $(call SetupJavaCompilation,BUILD_TOOLS,\ + SETUP:=GENERATE_OLDBYTECODE,\ + SRC:=$(JDK_TOPDIR)/make/tools/src,\ + BIN:=$(JDK_OUTPUTDIR)/btclasses)) +endif + +ifndef DISABLE_NIMBUS + +$(JDK_OUTPUTDIR)/btclasses/build/tools/generatenimbus/resources/%.template : \ + $(JDK_TOPDIR)/src/share/classes/javax/swing/plaf/nimbus/%.template + mkdir -p $(@D) + cp $< $@ + +BUILD_TOOLS += $(foreach i,$(wildcard $(JDK_TOPDIR)/src/share/classes/javax/swing/plaf/nimbus/*.template),$(JDK_OUTPUTDIR)/btclasses/build/tools/generatenimbus/resources/$(notdir $i)) + +endif + + +# Add a checksum ("jsum") to the end of a text file. Prevents trivial tampering with class lists. +TOOL_ADDJSUM=$(JAVA) -cp $(JDK_OUTPUTDIR)/btclasses \ + build.tools.addjsum.AddJsum + +# The buildmetaindex tool creates a meta-index to make core class loaders lazier. +TOOL_BUILDMETAINDEX=$(JAVA) -cp $(JDK_OUTPUTDIR)/btclasses \ + build.tools.buildmetaindex.BuildMetaIndex + +# The comment checker is not currently used. Should it be removed or added to javac? +TOOL_COMMENTCHECKER=$(JAVA) -cp $(JDK_OUTPUTDIR)/btclasses \ + build.tools.commentchecker.CommentChecker + +TOOL_COMPILEFONTCONFIG=$(JAVA) -cp $(JDK_OUTPUTDIR)/btclasses \ + build.tools.compilefontconfig.CompileFontConfig + +TOOL_COMPILEPROPERTIES=$(JAVA) -cp $(JDK_OUTPUTDIR)/btclasses \ + build.tools.compileproperties.CompileProperties + +TOOL_STRIPPROPERTIES=$(JAVA) -cp $(JDK_OUTPUTDIR)/btclasses \ + build.tools.stripproperties.StripProperties + +TOOL_JARREORDER=$(JAVA) -cp $(JDK_OUTPUTDIR)/btclasses \ + build.tools.jarreorder.JarReorder + +TOOL_GENERATECHARACTER=$(JAVA) -cp $(JDK_OUTPUTDIR)/btclasses \ + build.tools.generatecharacter.GenerateCharacter + +TOOL_CHARACTERNAME=$(JAVA) -cp $(JDK_OUTPUTDIR)/btclasses \ + build.tools.generatecharacter.CharacterName + +TOOL_DIRDIFF=$(JAVA) -cp $(JDK_OUTPUTDIR)/btclasses \ + build.tools.dirdiff.DirDiff + +TOOL_DTDBUILDER=$(JAVA) -Ddtd_home=$(JDK_TOPDIR)/make/tools/dtdbuilder/dtds \ + -cp $(JDK_OUTPUTDIR)/btclasses build.tools.dtdbuilder.DTDBuilder + +TOOL_GENERATEBREAKITERATORDATA=$(JAVA) \ + -cp $(JDK_OUTPUTDIR)/btclasses \ + build.tools.generatebreakiteratordata.GenerateBreakIteratorData + +TOOL_GENERATECURRENCYDATA=$(JAVA) -cp $(JDK_OUTPUTDIR)/btclasses \ + build.tools.generatecurrencydata.GenerateCurrencyData + +TOOL_HASHER=$(JAVA) -cp $(JDK_OUTPUTDIR)/btclasses \ + build.tools.hasher.Hasher + +# Jarsplit used in jdk/makefiles/common/Release.gmk +TOOL_JARSPLIT=$(JAVA) -cp $(JDK_OUTPUTDIR)/btclasses \ + build.tools.jarsplit.JarSplit + +TOOL_JAVAZIC=$(JAVA) -cp $(JDK_OUTPUTDIR)/btclasses \ + build.tools.javazic.Main + +# TODO: There are references to the jdwpgen.jar in jdk/make/netbeans/jdwpgen/build.xml +# and nbproject/project.properties in the same dir. Needs to be looked at. +TOOL_JDWPGEN=$(JAVA) -cp $(JDK_OUTPUTDIR)/btclasses build.tools.jdwpgen.Main + +# TODO: Lots of files in jdk/make/tools/CharsetMapping dir +TOOL_CHARSETMAPPING=$(JAVA) -cp $(JDK_OUTPUTDIR)/btclasses \ + build.tools.charsetmapping.Main + +TOOL_SPP=$(JAVA) -cp $(JDK_OUTPUTDIR)/btclasses build.tools.spp.Spp + +# TODO: Only referenced in jdk/make/tools/sharing/README.txt. Find out what it means. +TOOL_MAKECLASSLIST=$(JAVA) -cp $(JDK_OUTPUTDIR)/btclasses \ + build.tools.makeclasslist.MakeClasslist + +# Nimbus is used somewhere in the swing build. +TOOL_GENERATENIMBUS=$(JAVA) -cp $(JDK_OUTPUTDIR)/btclasses \ + build.tools.generatenimbus.Generator
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jdk/makefiles/altclasses/Makefile Wed Apr 11 14:09:48 2012 -0700 @@ -0,0 +1,84 @@ +# +# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# + +# +# Makefile for building alternate runtime classes (not used by default) +# + +BUILDDIR = .. + +PRODUCT = altclasses + +include $(BUILDDIR)/common/Defs.gmk + +# Root of alternate class sources + +ALTCLASSES_SRCDIR = $(CLOSED_SRC)/share/altclasses + +# Alternate runtime classes + +ALTRT_JAR_FILE = $(LIBDIR)/alt-rt.jar +ALTRT_JAR_SOURCE_FILE = $(TEMPDIR)/alt-rt.jarsrclist +ALTRT_JAR_SOURCES = $(wildcard $(ALTCLASSES_SRCDIR)/java/*/*.java) + +# Use a special file suffix for the file that holds the source list + +.SUFFIXES: .jarsrclist + +# Build rules + +all build: + @if [ -d $(ALTCLASSES_SRCDIR) ] ; then \ + $(MAKE) $(ALTRT_JAR_FILE); \ + fi + +# Source list file creation + +$(ALTRT_JAR_SOURCE_FILE): $(ALTRT_JAR_SOURCES) FRC + $(prep-target) + $(ECHO) $(ALTRT_JAR_SOURCES) > $@ + +clean clobber:: + $(RM) $(ALTRT_JAR_FILE) $(ALTRT_JAR_SOURCE_FILE) + $(RM) -r $(ALTRT_JAR_SOURCE_FILE).classes + +include $(BUILDDIR)/common/Classes.gmk + +# Pattern rule to turn a source list file into a jar file +$(LIBDIR)/%.jar : $(TEMPDIR)/%.jarsrclist + $(prep-target) + $(RM) -r $(<).classes + $(MKDIR) -p $(<).classes + $(JAVAC_CMD) -implicit:none -d $(<).classes @$< + $(BOOT_JAR_CMD) cf $@ -C $(<).classes . $(BOOT_JAR_JFLAGS) + +# Force target + +FRC: + +# Non file targets + +.PHONY: all build clean clobber +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jdk/makefiles/apple/Makefile Wed Apr 11 14:09:48 2012 -0700 @@ -0,0 +1,39 @@ +# +# Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# + +# +# Makefile for building com/apple +# + +BUILDDIR = .. +PRODUCT = sun +include $(BUILDDIR)/common/Defs.gmk + +SUBDIRS = applescript + +include $(BUILDDIR)/common/Subdirs.gmk + +all build clean clobber:: + $(SUBDIRS-loop)
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jdk/makefiles/apple/applescript/Makefile Wed Apr 11 14:09:48 2012 -0700 @@ -0,0 +1,71 @@ +# +# Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# + +BUILDDIR = ../.. +PACKAGE = apple.applescript +LIBRARY = AppleScriptEngine +PRODUCT = sun +include $(BUILDDIR)/common/Defs.gmk + + +# +# Files +# +AUTO_FILES_JAVA_DIRS = apple/applescript + +FILES_objc = \ + $(TARGDIR)AppleScriptEngine.m \ + $(TARGDIR)AppleScriptExecutionContext.m \ + $(TARGDIR)AS_NS_ConversionUtils.m \ + $(TARGDIR)NS_Java_ConversionUtils.m + + +FILES_export = \ + apple/applescript/AppleScriptEngine.java \ + apple/applescript/AppleScriptEngineFactory.java + +# +# Rules +# +include $(BUILDDIR)/common/Mapfile-vers.gmk +include $(BUILDDIR)/common/Library.gmk + + +# +# Extra rules +# + +# +# Add to ambient vpath to get files in a subdirectory +# +vpath %.m $(call NativeSrcDirList,,native/apple/applescript) + +CPPFLAGS += \ + -I$(TEMPDIR)/../../sun.awt/awt/CClassHeaders + +OTHER_LDLIBS = \ + -framework Cocoa \ + -framework Carbon \ + -framework JavaNativeFoundation
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jdk/makefiles/com/Makefile Wed Apr 11 14:09:48 2012 -0700 @@ -0,0 +1,44 @@ +# +# Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# + +# +# Makefile for building all of java +# + +BUILDDIR = .. +PRODUCT = com +include $(BUILDDIR)/common/Defs.gmk + +SUBDIRS = sun oracle + +ifeq ($(PLATFORM), macosx) + SUBDIRS += apple +endif + +include $(BUILDDIR)/common/Subdirs.gmk + +all build clean clobber:: + $(SUBDIRS-loop) +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jdk/makefiles/com/apple/Makefile Wed Apr 11 14:09:48 2012 -0700 @@ -0,0 +1,39 @@ +# +# Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# + +# +# Makefile for building com/apple +# + +BUILDDIR = ../.. +PRODUCT = sun +include $(BUILDDIR)/common/Defs.gmk + +SUBDIRS = osx osxui + +include $(BUILDDIR)/common/Subdirs.gmk + +all build clean clobber:: + $(SUBDIRS-loop)
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jdk/makefiles/com/apple/osx/Makefile Wed Apr 11 14:09:48 2012 -0700 @@ -0,0 +1,91 @@ +# +# Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# + +BUILDDIR = ../../.. +PACKAGE = com.apple.osx +LIBRARY = osx +PRODUCT = sun +include $(BUILDDIR)/common/Defs.gmk + + +# +# Files +# +AUTO_FILES_JAVA_DIRS = apple/launcher apple/security com/apple/concurrent com/apple/eio java/util/prefs + +FILES_objc += \ + $(TARGDIR)Dispatch.m \ + $(TARGDIR)CFileManager.m \ + $(TARGDIR)KeystoreImpl.m \ + $(TARGDIR)JavaAppLauncher.m \ + $(TARGDIR)MacOSXPreferencesFile.m \ + $(TARGDIR)SCDynamicStoreConfig.m + +FILES_export += \ + com/apple/concurrent/LibDispatchNative.java \ + com/apple/eio/FileManager.java \ + apple/security/KeychainStore.java \ + apple/launcher/JavaAppLauncher.java \ + java/util/prefs/MacOSXPreferencesFile.java + +# TODO: couldn't figure out how to get resources working +#LOCALE_SET_DEFINITION = jre +#RESOURCE_BUNDLES_UNCOMPILED_PROPERTIES = apple/launcher/appLauncherErrors.properties + + +# +# Rules +# +include $(BUILDDIR)/common/Mapfile-vers.gmk +include $(BUILDDIR)/common/Library.gmk + + +# +# Extra rules +# + +# +# Add to ambient vpath to get files in a subdirectory +# +vpath %.m $(call NativeSrcDirList,,native/com/apple/concurrent) +vpath %.m $(call NativeSrcDirList,,native/com/apple/eio) +vpath %.m $(call NativeSrcDirList,,native/apple/launcher) +vpath %.m $(call NativeSrcDirList,,native/apple/security) +vpath %.m $(call NativeSrcDirList,,native/java/util) + +CPPFLAGS += \ + $(call NativeSrcDirList,-I,native/com/apple/laf) \ + $(call NativeSrcDirList,-I,native/apple/awt) \ + $(call NativeSrcDirList,-I,native/sun/awt) \ + $(call NativeSrcDirList,-I,native/sun/osxapp) + +OTHER_LDLIBS = \ + -losxapp \ + -framework Cocoa \ + -framework ApplicationServices \ + -framework JavaNativeFoundation \ + -framework JavaRuntimeSupport \ + -framework Security \ + -framework SystemConfiguration
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jdk/makefiles/com/apple/osxui/Makefile Wed Apr 11 14:09:48 2012 -0700 @@ -0,0 +1,106 @@ +# +# Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# + +BUILDDIR = ../../.. +PACKAGE = com.apple.osxui +LIBRARY = osxui +PRODUCT = sun +include $(BUILDDIR)/common/Defs.gmk + + +# +# Files +# +AUTO_FILES_JAVA_DIRS = apple/laf com/apple/laf com/apple/eawt + +FILES_objc = \ + $(TARGDIR)AquaFileView.m \ + $(TARGDIR)AquaLookAndFeel.m \ + $(TARGDIR)AquaNativeResources.m \ + $(TARGDIR)JRSUIConstantSync.m \ + $(TARGDIR)JRSUIController.m \ + $(TARGDIR)JRSUIFocus.m \ + $(TARGDIR)ScreenPopupFactory.m \ + $(TARGDIR)ScreenMenu.m + +FILES_export = \ + apple/laf/AquaLookAndFeel.java \ + apple/laf/JRSUIConstants.java \ + apple/laf/JRSUIControl.java \ + apple/laf/JRSUIFocus.java \ + apple/laf/JRSUIState.java \ + apple/laf/JRSUIStateFactory.java \ + apple/laf/JRSUIUtils.java \ + com/apple/laf/AquaFileView.java \ + com/apple/laf/AquaNativeResources.java \ + com/apple/laf/ScreenPopupFactory.java \ + com/apple/laf/ScreenMenu.java \ + com/apple/laf/ScreenMenuBar.java \ + com/apple/laf/ScreenMenuBarProvider.java \ + com/apple/laf/ScreenMenuItem.java \ + com/apple/laf/ScreenMenuItemCheckbox.java \ + com/apple/laf/ScreenMenuItemUI.java \ + com/apple/laf/ScreenMenuPropertyHandler.java \ + com/apple/laf/ScreenMenuPropertyListener.java + +#RESOURCE_BUNDLES_COMPILED_PROPERTIES += \ +# com/apple/laf/resources/aqua.properties \ +# com/apple/laf/resources/aqua_de.properties \ +# com/apple/laf/resources/aqua_fr.properties \ +# com/apple/laf/resources/aqua_ja.properties + + +# +# Rules +# +include $(BUILDDIR)/common/Mapfile-vers.gmk +include $(BUILDDIR)/common/Library.gmk + + +# +# Extra rules +# + +# +# Add to ambient vpath to get files in a subdirectory +# +vpath %.m $(call NativeSrcDirList,,native/com/apple/laf) +vpath %.m $(call NativeSrcDirList,,native/com/apple/eawt) + +CPPFLAGS += \ + $(call NativeSrcDirList,-I,native/com/apple/laf) \ + $(call NativeSrcDirList,-I,native/apple/awt) \ + $(call NativeSrcDirList,-I,native/sun/awt) \ + $(call NativeSrcDirList,-I,native/sun/osxapp) \ + -I$(TEMPDIR)/../../sun.awt/awt/CClassHeaders + +OTHER_LDLIBS = \ + -lawt -losxapp \ + -lawt_lwawt -L$(LIBDIR) -Xlinker -rpath -Xlinker @loader_path \ + -framework Cocoa \ + -framework Carbon \ + -framework ApplicationServices \ + -framework JavaNativeFoundation \ + -framework JavaRuntimeSupport
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jdk/makefiles/com/oracle/Makefile Wed Apr 11 14:09:48 2012 -0700 @@ -0,0 +1,54 @@ +# +# Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# + +BUILDDIR = ../.. +PRODUCT = oracle +#SUBDIRS_MAKEFLAGS += JAVAC_MAX_WARNINGS=true +#SUBDIRS_MAKEFLAGS += JAVAC_WARNINGS_FATAL=true +#SUBDIRS_MAKEFLAGS += JAVAC_LINT_OPTIONS=-Xlint:all,-deprecation,-path +include $(BUILDDIR)/common/Defs.gmk + +# build com/oracle/security/ucrypto on Solaris platform for non-OpenJDK builds +UCRYPTO = +ifndef OPENJDK + ifeq ($(PLATFORM), solaris) + UCRYPTO = security/ucrypto + endif +endif + +JFR = +ifndef OPENJDK +ifndef JAVASE_EMBEDDED + JFR = jfr +endif +endif + +SUBDIRS = $(JFR) $(UCRYPTO) + +include $(BUILDDIR)/common/Subdirs.gmk + +all build clean clobber:: + $(SUBDIRS-loop) +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jdk/makefiles/com/oracle/jfr/Makefile Wed Apr 11 14:09:48 2012 -0700 @@ -0,0 +1,73 @@ +# +# Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# + +BUILDDIR = ../../.. +PACKAGE = oracle.jrockit.jfr +LIBRARY = jfr +PRODUCT = oracle +include $(BUILDDIR)/common/Defs.gmk + +# +# Use mapfile +# +FILES_m = $(CLOSED_SHARE_SRC)/native/oracle/jfr/mapfile-vers +include $(BUILDDIR)/common/Mapfile-vers.gmk + +# +# Files to compile +# +FILES_c = VMJFR.c + +AUTO_FILES_JAVA_DIRS = com/oracle/jrockit/jfr oracle/jrockit/jfr + +# Find C source files +# +vpath %.c $(CLOSED_SHARE_SRC)/native/oracle/jfr + +# +# Library to compile. +# +include $(BUILDDIR)/common/Library.gmk + +JVMLIB = +JAVALIB = +OTHER_LDLIBS = + +clean clobber:: + $(RM) -r $(CLASSDESTDIR)/com/oracle/jrockit/jfr + $(RM) -r $(CLASSDESTDIR)/oracle/jrockit/jfr + + +# Copy pre-shipped .jfs files +JFR_LIBDIR = $(LIBDIR)/jfr +JFR_SRCDIR = $(CLOSED_SHARE_SRC)/lib/jfr + +$(JFR_LIBDIR)/%.jfs: $(JFR_SRCDIR)/%.jfs + $(install-file) + +JFS_FILES := $(subst $(JFR_SRCDIR),$(JFR_LIBDIR),$(wildcard $(JFR_SRCDIR)/*.jfs)) + +all build : $(JFS_FILES) +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jdk/makefiles/com/oracle/security/ucrypto/FILES_c.gmk Wed Apr 11 14:09:48 2012 -0700 @@ -0,0 +1,30 @@ +# +# Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# + +ifndef OPENJDK +FILES_c = \ + nativeFunc.c \ + nativeCrypto.c +endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jdk/makefiles/com/oracle/security/ucrypto/Makefile Wed Apr 11 14:09:48 2012 -0700 @@ -0,0 +1,270 @@ +# +# Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# + +# +# Makefile for building ucrypto.jar and its native libraries. +# +# This file was modified from make/sun/security/pkcs11/Makefile. +# +# +# (The terms "OpenJDK" and "JDK" below refer to OpenJDK and Oracle +# JDK builds respectively.) +# +# This Makefile does the "real" build of the Ucrypto provider files. +# Since the sources are unavailable for OpenJDK, this Makefile is only +# useful for JDK. +# +# +# Main Targets (JDK on Solaris): +# +# all The usual, ucrypto.jar plus the native libraries. +# builds and installs the prebuilt/signed jar. +# +# clobber/clean Cleans up the temp directory, ucrypto.jar, the +# native libraries, and the config file from the +# build area +# +# jar Builds, signs and installs ucrypto.jar +# (Can only be done on machines with access to +# the signing keystore) +# +# Other lesser-used Targets (JDK on Solaris): +# +# build-jar Builds ucrypto.jar (no sign/install) +# +# sign Builds/signs ucrypto.jar (no install) +# +# release Builds all targets in preparation +# for workspace integration. +# (Can only be done on machines with access to +# the signing keystore) +# +# install-prebuilt Installs the pre-built jar files +# +# NOTE: None of the above target will update the prebuilt provider binary +# under the closed workspace. To update it, you must explicitly copy the +# binary from either the tmp/signed or lib/ext directory. +# +# This makefile was written to support parallel target execution. +# + +BUILDDIR = ../../../.. + +include $(BUILDDIR)/common/Defs.gmk + +ifndef OPENJDK + ifneq ($(PLATFORM), solaris) + all: + else + PACKAGE = com.oracle.security.ucrypto + LIBRARY = j2ucrypto + PRODUCT = oracle + + # + # The following is for when we need to do postprocessing + # (signing/obfuscation) against a read-only build. If the OUTPUTDIR + # isn't writable, the build currently crashes out. + # + ifdef ALT_JCE_BUILD_DIR + # ===================================================== + # Where to place the output, in case we're building from a read-only + # build area. (e.g. a release engineering build.) + JCE_BUILD_DIR=${ALT_JCE_BUILD_DIR} + IGNORE_WRITABLE_OUTPUTDIR_TEST=true + else + JCE_BUILD_DIR=${TEMPDIR} + endif + + JAVAC_MAX_WARNINGS=false + JAVAC_LINT_OPTIONS=-Xlint:all,-deprecation + JAVAC_WARNINGS_FATAL=true + + # + # C and Java Files + # + include FILES_c.gmk + + # + # Subdirectories of these are automatically included. + # + AUTO_FILES_JAVA_DIRS = com/oracle/security/ucrypto + + # + # Java files that define native methods + # + FILES_export = \ + com/oracle/security/ucrypto/UcryptoProvider.java \ + com/oracle/security/ucrypto/NativeCipher.java \ + com/oracle/security/ucrypto/NativeDigest.java \ + com/oracle/security/ucrypto/NativeKey.java \ + com/oracle/security/ucrypto/NativeRSASignature.java \ + com/oracle/security/ucrypto/NativeRSACipher.java + + # + # Find native code + # + vpath %.c \ + $(CLOSED_PLATFORM_SRC)/native/com/oracle/security/ucrypto + + # + # Find include files + # + OTHER_INCLUDES += \ + -I$(CLOSED_PLATFORM_SRC)/native/com/oracle/security/ucrypto + + # + # Rules + # + CLASSDESTDIR = $(TEMPDIR)/classes + JAVAHFLAGS = -bootclasspath \ + "$(CLASSDESTDIR)$(CLASSPATH_SEPARATOR)$(CLASSBINDIR)" + + include $(BUILDDIR)/common/Mapfile-vers.gmk + include $(BUILDDIR)/common/Library.gmk + + # + # Libraries to link + # + OTHER_LDLIBS = -ldl + + # Default config file + UCRYPTO_CFG_SRC = $(CLOSED_SRC)/share/lib/security/ucrypto-solaris.cfg + UCRYPTO_CFG_BUILD = $(LIBDIR)/security/ucrypto-solaris.cfg + + # + # We use a variety of subdirectories in the $(TEMPDIR) depending on what + # part of the build we're doing. Build is initially done in the unsigned + # area and when files are signed, they will be placed in the appropriate area. + # + UNSIGNED_DIR = $(TEMPDIR)/unsigned + + # + # Rules + # + all: ucrypto-cfg build-jar install-prebuilt + $(build-warning) + + ucrypto-cfg: $(UCRYPTO_CFG_BUILD) + + $(UCRYPTO_CFG_BUILD): $(UCRYPTO_CFG_SRC) + $(install-file) + + include $(BUILDDIR)/javax/crypto/Defs-jce.gmk + + + # ===================================================== + # Build the unsigned ucrypto.jar file. + # + + JAR_DESTFILE = $(EXTDIR)/ucrypto.jar + + # + # The ucrypto.jar needs to be in the extension class directory, + # therefore none of its classes can appear in $(CLASSBINDIR). + # Currently no one is using any of the internals, so these files + # should not have been built. + # + + # + # Since the -C option to jar is used below, each directory entry must be + # preceded with the appropriate directory to "cd" into. + # + JAR_DIRS = $(patsubst %, -C $(CLASSDESTDIR) %, $(AUTO_FILES_JAVA_DIRS)) + + build-jar: $(UNSIGNED_DIR)/ucrypto.jar + + # + # Build ucrypto.jar. + # + $(UNSIGNED_DIR)/ucrypto.jar: build + $(prep-target) + $(BOOT_JAR_CMD) cf $@ $(JAR_DIRS) \ + $(BOOT_JAR_JFLAGS) + @$(java-vm-cleanup) + + # + # Sign ucrypto.jar + # + SIGNED_DIR = $(JCE_BUILD_DIR)/signed + + sign: $(SIGNED_DIR)/ucrypto.jar + + ifndef ALT_JCE_BUILD_DIR + $(SIGNED_DIR)/ucrypto.jar: $(UNSIGNED_DIR)/ucrypto.jar + else + # + # We have to remove the build dependency, otherwise, we'll try to rebuild it + # which we can't do on a read-only filesystem. + # + $(SIGNED_DIR)/ucrypto.jar: + @if [ ! -r $(UNSIGNED_DIR)/ucrypto.jar ] ; then \ + $(ECHO) "Couldn't find $(UNSIGNED_DIR)/ucrypto.jar"; \ + exit 1; \ + fi + endif + $(call sign-file, $(UNSIGNED_DIR)/ucrypto.jar) + + + # ===================================================== + # Create the Release Engineering files. Signed builds, etc. + # + + release: $(SIGNED_DIR)/ucrypto.jar + $(RM) $(JCE_BUILD_DIR)/release/ucrypto.jar + $(MKDIR) -p $(JCE_BUILD_DIR)/release + $(CP) $(SIGNED_DIR)/ucrypto.jar $(JCE_BUILD_DIR)/release + $(release-warning) + + + # ===================================================== + # Install routines. + # + + # + # Install ucrypto.jar, depending on which type is requested. + # + jar: $(JAR_DESTFILE) + $(release-warning) + + $(JAR_DESTFILE): $(SIGNED_DIR)/ucrypto.jar + $(install-file) + + install-prebuilt: + @$(ECHO) "\n>>>Installing prebuilt OracleUcrypto provider..." + $(RM) $(JAR_DESTFILE) + $(CP) $(PREBUILT_DIR)/ucrypto/ucrypto.jar $(JAR_DESTFILE) + + + # ===================================================== + # Support routines. + # + clobber clean:: + $(RM) -r $(JAR_DESTFILE) $(TEMPDIR) $(JCE_BUILD_DIR) + $(RM) -r $(UCRYPTO_CFG_BUILD) + + .PHONY: build-jar jar sign release install-prebuilt + + endif #ifneq ($(PLATFORM), solaris) +endif #ifndef OPENJDK
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jdk/makefiles/com/oracle/security/ucrypto/mapfile-vers Wed Apr 11 14:09:48 2012 -0700 @@ -0,0 +1,69 @@ +# +# Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# + +# Define public interface. + +SUNWprivate_1.1 { + global: + JNI_OnLoad; + Java_com_oracle_security_ucrypto_UcryptoProvider_loadLibraries; + Java_com_oracle_security_ucrypto_UcryptoProvider_getMechList; + Java_com_oracle_security_ucrypto_NativeDigest_nativeInit; + Java_com_oracle_security_ucrypto_NativeDigest_nativeUpdate; + Java_com_oracle_security_ucrypto_NativeDigest_nativeDigest; + Java_com_oracle_security_ucrypto_NativeDigest_nativeClone; + Java_com_oracle_security_ucrypto_NativeDigest_nativeFree; + Java_com_oracle_security_ucrypto_NativeCipher_nativeInit; + Java_com_oracle_security_ucrypto_NativeCipher_nativeUpdate; + Java_com_oracle_security_ucrypto_NativeCipher_nativeFinal; + Java_com_oracle_security_ucrypto_NativeKey_nativeFree; + Java_com_oracle_security_ucrypto_NativeKey_00024RSAPrivateCrt_nativeInit; + Java_com_oracle_security_ucrypto_NativeKey_00024RSAPublic_nativeInit; + Java_com_oracle_security_ucrypto_NativeRSASignature_nativeInit; + Java_com_oracle_security_ucrypto_NativeRSASignature_nativeUpdate__JZ_3BII; + Java_com_oracle_security_ucrypto_NativeRSASignature_nativeUpdate__JZJI; + Java_com_oracle_security_ucrypto_NativeRSASignature_nativeFinal; + Java_com_oracle_security_ucrypto_NativeRSACipher_nativeAtomic; + + JavaCritical_com_oracle_security_ucrypto_NativeDigest_nativeInit; + JavaCritical_com_oracle_security_ucrypto_NativeDigest_nativeUpdate; + JavaCritical_com_oracle_security_ucrypto_NativeDigest_nativeDigest; + JavaCritical_com_oracle_security_ucrypto_NativeDigest_nativeClone; + JavaCritical_com_oracle_security_ucrypto_NativeDigest_nativeFree; + JavaCritical_com_oracle_security_ucrypto_NativeCipher_nativeInit; + JavaCritical_com_oracle_security_ucrypto_NativeCipher_nativeUpdate; + JavaCritical_com_oracle_security_ucrypto_NativeCipher_nativeFinal; + JavaCritical_com_oracle_security_ucrypto_NativeKey_nativeFree; + JavaCritical_com_oracle_security_ucrypto_NativeKey_00024RSAPrivateCrt_nativeInit; + JavaCritical_com_oracle_security_ucrypto_NativeKey_00024RSAPublic_nativeInit; + JavaCritical_com_oracle_security_ucrypto_NativeRSASignature_nativeInit; + JavaCritical_com_oracle_security_ucrypto_NativeRSASignature_nativeUpdate__JZ_3BII; + JavaCritical_com_oracle_security_ucrypto_NativeRSASignature_nativeUpdate__JZJI; + JavaCritical_com_oracle_security_ucrypto_NativeRSASignature_nativeFinal; + JavaCritical_com_oracle_security_ucrypto_NativeRSACipher_nativeAtomic; + + local: + *; +};
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jdk/makefiles/com/sun/Makefile Wed Apr 11 14:09:48 2012 -0700 @@ -0,0 +1,54 @@ + +# +# Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# + +# +# Makefile for building com/sun +# + +BUILDDIR = ../.. +PRODUCT = sun +include $(BUILDDIR)/common/Defs.gmk + +ifndef OPENJDK + ORG_EXISTS := $(call DirExists,$(CLOSED_SRC)/share/classes/sun/org,,) + ifneq ("$(ORG_EXISTS)", "") + SCRIPT_SUBDIR = script + endif +endif + +# jarsigner is part of JRE +SUBDIRS = + +SUBDIRS_management = +SUBDIRS_enterprise = crypto/provider +SUBDIRS_misc = + +# Omit mirror since it's built with the apt tool. + +include $(BUILDDIR)/common/Subdirs.gmk + +all build clean clobber:: + $(SUBDIRS-loop)
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jdk/makefiles/com/sun/crypto/provider/Makefile Wed Apr 11 14:09:48 2012 -0700 @@ -0,0 +1,275 @@ +# +# Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# + +# +# Makefile for building sunjce_provider.jar. +# +# This file was derived from make/javax/crypto/Makefile. +# + +# +# (The terms "OpenJDK" and "JDK" below refer to OpenJDK and Sun JDK builds +# respectively.) +# +# JCE builds are very different between OpenJDK and JDK. The OpenJDK JCE +# jar files do not require signing, but those for JDK do. If an unsigned +# jar file is installed into JDK, things will break when the crypto +# routines are called. +# +# This Makefile does the "real" build of the JCE files. There are some +# javac options currently specific to JCE, so we recompile now to make +# sure any implicit compilations didn't use any incorrect flags. +# +# For OpenJDK, the jar files built here are installed directly into the +# OpenJDK. +# +# For JDK, the binaries use pre-built/pre-signed binary files stored in +# the closed workspace that are not shipped in the OpenJDK workspaces. +# We still build the JDK files here to verify the files compile, and in +# preparation for possible signing. Developers working on JCE in JDK +# must sign the JCE files before testing. The JCE signing key is kept +# separate from the JDK workspace to prevent its disclosure. +# +# SPECIAL NOTE TO JCE/JDK developers: The source files must eventually +# be built and signed, and the resulting jar files MUST BE CHECKED INTO +# THE CLOSED PART OF THE WORKSPACE*. This separate step *MUST NOT BE +# FORGOTTEN*, otherwise a bug fixed in the source code will not be +# reflected in the shipped binaries. The "release" target should be +# used to generate the required files. +# +# There are a number of targets to help both JDK/OpenJDK developers. +# +# Main Targets (JDK/OPENJDK): +# +# all/clobber/clean The usual. +# If OpenJDK, installs sunjce_provider.jar. +# If JDK, installs prebuilt +# sunjce_provider.jar. +# +# jar Builds/installs sunjce_provider.jar +# If OpenJDK, does not sign. +# If JDK, tries to sign. +# +# Other lesser-used Targets (JDK/OPENJDK): +# +# build-jar Builds sunjce_provider.jar +# (does not sign/install) +# +# install-jar Alias for "jar" above. +# +# Other targets (JDK only): +# +# sign Alias for sign-jar +# sign-jar Builds/signs sunjce_provider.jar (no install) +# +# release Builds all targets in preparation +# for workspace integration. +# +# install-prebuilt Installs the pre-built jar files +# +# This makefile was written to support parallel target execution. +# + +BUILDDIR = ../../../.. +PACKAGE = com.sun.crypto.provider +PRODUCT = sun + +# +# The following is for when we need to do postprocessing +# (signing) against a read-only build. If the OUTPUTDIR +# isn't writable, the build currently crashes out. +# +ifndef OPENJDK + ifdef ALT_JCE_BUILD_DIR + # ===================================================== + # Where to place the output, in case we're building from a read-only + # build area. (e.g. a release engineering build.) + JCE_BUILD_DIR=${ALT_JCE_BUILD_DIR} + IGNORE_WRITABLE_OUTPUTDIR_TEST=true + else + JCE_BUILD_DIR=${TEMPDIR} + endif +endif + +JAVAC_MAX_WARNINGS = false +JAVAC_LINT_OPTIONS = -Xlint:all,-deprecation +JAVAC_WARNINGS_FATAL = true +include $(BUILDDIR)/common/Defs.gmk + +# +# Location for the newly built classfiles. +# +CLASSDESTDIR = $(TEMPDIR)/classes + +# +# Subdirectories of these are automatically included. +# +AUTO_FILES_JAVA_DIRS = \ + com/sun/crypto/provider + +include $(BUILDDIR)/common/Classes.gmk + +# +# Rules +# + +# +# Some licensees do not get the security sources, but we still need to +# be able to build "all" for them. Check here to see if the sources were +# available. If not, then we don't need to continue this rule. +# + +ifdef OPENJDK +all: build-jar install-jar +else # OPENJDK +ifeq ($(strip $(FILES_java)),) +all: install-prebuilt + $(no-source-warning) +else # FILES_java available +all: build-jar install-prebuilt + $(build-warning) +endif # $(FILES_java) available +endif # OPENJDK + +# +# We use a variety of subdirectories in the $(TEMPDIR) depending on what +# part of the build we're doing. Both OPENJDK/JDK builds are initially +# done in the unsigned area. When files are signed in JDK, they will be +# placed in the appropriate areas. +# +UNSIGNED_DIR = $(TEMPDIR)/unsigned + +include $(BUILDDIR)/javax/crypto/Defs-jce.gmk + + +# ===================================================== +# Build the unsigned sunjce_provider.jar file. +# + +JAR_DESTFILE = $(EXTDIR)/sunjce_provider.jar + +# +# The sunjce_provider.jar needs to be in the extension class directory, +# therefore none of its classes should appear in $(CLASSBINDIR). +# Currently no one is using any of the SunJCE internals, so these files +# should not have been built. +# + +# +# Since the -C option to jar is used below, each directory entry must be +# preceded with the appropriate directory to "cd" into. +# +JAR_DIRS = $(patsubst %, -C $(CLASSDESTDIR) %, $(AUTO_FILES_JAVA_DIRS)) + +build-jar: $(UNSIGNED_DIR)/sunjce_provider.jar + +# +# Build sunjce_provider.jar. +# +$(UNSIGNED_DIR)/sunjce_provider.jar: build $(JCE_MANIFEST_FILE) + $(prep-target) + $(BOOT_JAR_CMD) cmf $(JCE_MANIFEST_FILE) $@ $(JAR_DIRS) \ + $(BOOT_JAR_JFLAGS) + @$(java-vm-cleanup) + + +ifndef OPENJDK +# ===================================================== +# Sign the provider jar file. Not needed for OpenJDK. +# + +SIGNED_DIR = $(JCE_BUILD_DIR)/signed + +sign: sign-jar + +sign-jar: $(SIGNED_DIR)/sunjce_provider.jar + +ifndef ALT_JCE_BUILD_DIR +$(SIGNED_DIR)/sunjce_provider.jar: $(UNSIGNED_DIR)/sunjce_provider.jar +else +# +# We have to remove the build dependency, otherwise, we'll try to rebuild it +# which we can't do on a read-only filesystem. +# +$(SIGNED_DIR)/sunjce_provider.jar: + @if [ ! -r $(UNSIGNED_DIR)/sunjce_provider.jar ] ; then \ + $(ECHO) "Couldn't find $(UNSIGNED_DIR)/sunjce_provider.jar"; \ + exit 1; \ + fi +endif + $(call sign-file, $(UNSIGNED_DIR)/sunjce_provider.jar) + + +# ===================================================== +# Create the Release Engineering files. Signed builds, etc. +# + +release: $(SIGNED_DIR)/sunjce_provider.jar + $(RM) $(JCE_BUILD_DIR)/release/sunjce_provider.jar + $(MKDIR) -p $(JCE_BUILD_DIR)/release + $(CP) $(SIGNED_DIR)/sunjce_provider.jar $(JCE_BUILD_DIR)/release + $(release-warning) + +endif # OPENJDK + + +# ===================================================== +# Install routines. +# + +# +# Install sunjce_provider.jar, depending on which type is requested. +# +install-jar jar: $(JAR_DESTFILE) +ifndef OPENJDK + $(release-warning) +endif + +ifdef OPENJDK +$(JAR_DESTFILE): $(UNSIGNED_DIR)/sunjce_provider.jar +else +$(JAR_DESTFILE): $(SIGNED_DIR)/sunjce_provider.jar +endif + $(install-file) + +ifndef OPENJDK +install-prebuilt: + @$(ECHO) "\n>>>Installing prebuilt SunJCE provider..." + $(RM) $(JAR_DESTFILE) + $(CP) $(PREBUILT_DIR)/jce/sunjce_provider.jar $(JAR_DESTFILE) +endif + + +# ===================================================== +# Support routines. +# + +clobber clean:: + $(RM) -r $(JAR_DESTFILE) $(TEMPDIR) $(JCE_BUILD_DIR) + +.PHONY: build-jar jar install-jar +ifndef OPENJDK +.PHONY: sign sign-jar release install-prebuilt +endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jdk/makefiles/common/Classes.gmk Wed Apr 11 14:09:48 2012 -0700 @@ -0,0 +1,67 @@ +# +# Copyright (c) 1995, 2005, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# + +# WARNING: This file is shared with other workspaces. +# So when it includes other files, it must use JDK_TOPDIR. +# + +include $(JDK_TOPDIR)/makefiles/common/Rules.gmk + +# +# Say you built classes into $(ALT_CLASSBINDIR) and then at the end of +# the build you might want to copy them over to $(ALT_CLASSDESTDIR); +# this rule takes care of that. No one should really set these +# variables except the bootstrap/recompile stage of the java compiler. +# +ifdef ALT_CLASSBINDIR + +# By default post-processing is copying. Suppose you want to build +# a jar file then set ALT_CLASSES_DISPOSITION to '../../dest/nameof.jar' +# before including this file. +ifndef ALT_CLASSES_DISPOSITION +ALT_CLASSES_DISPOSITION = copy-classes +endif + +build : $(ALT_CLASSES_DISPOSITION) + +copy-classes: +ifneq ($(ALT_CLASSBINDIR), $(ALT_CLASSDESTDIR)) + @if [ -s $(TEMPDIR)/.classes.list ]; then \ + mkdir -p $(ALT_CLASSDESTDIR); \ + echo "Copying $(ALT_CLASSBINDIR)..."; \ + echo "(cd $(ALT_CLASSBINDIR); tar cf - .) | \ + (cd $(ALT_CLASSDESTDIR); tar xf -)"; \ + (cd $(ALT_CLASSBINDIR); tar cf - .) | \ + (cd $(ALT_CLASSDESTDIR); tar xf -); \ + fi +else # ALT_CLASSBINDIR + @if [ -s $(TEMPDIR)/.classes.list ]; then \ + echo "Copy source and destination are the same: $(ALT_CLASSBINDIR) -- Copy skipped..."; \ + fi +endif # ALT_CLASSBINDIR + +.PHONY: copy-classes +endif # ALT_CLASSBINDIR +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jdk/makefiles/common/Cscope.gmk Wed Apr 11 14:09:48 2012 -0700 @@ -0,0 +1,100 @@ +# +# Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# + +# +# The cscope.out file is made in the current directory and spans the entire +# source tree. +# +# Things to note: +# 1. We use relative names for cscope. +# 2. We *don't* remove the old cscope.out file, because cscope is smart +# enough to only build what has changed. It can be confused, however, +# if files are renamed or removed, so it may be necessary to manually +# remove cscope.out if a lot of reorganization has occurred. +# +CSDIRS = $(JDK_TOPDIR)/src $(JDK_TOPDIR)/build +CSINCS = $(CSDIRS:%=-I%) + +# +# Set CSFLAGS env variable to -b when using fast cscope to build the fast +# (but large) cscope data bases. +# +CSCOPE = cscope-fast +ifeq ($(CSCOPE), cscope-fast) +CSFLAGS = -b +endif + +# +# Adding .java files pushes the file count of a full workspace up about 2500 +# files, which slows database lookup. Thus allow these files to be added from +# the environment (CSCLASSES=yes). +# +ifdef CSCLASSES +ADDCLASSES= -o -name '*.java' +endif + +# +# Adding CClassHeaders also pushes the file count of a full workspace up about +# 200 files (these files also don't exist in a new workspace, and thus will +# cause the recreation of the database as they get created, which might seem +# A little confusing). Thus allow these files to be added from the environment +# (CSHEADERS=yes). +# +ifndef CSHEADERS +RMCCHEADERS= -o -name CClassHeaders +endif + + +.PRECIOUS: cscope.out + +cscope.out: cscope.files FRC + $(CSCOPE) $(CSFLAGS) + +# +# What files should we include? A simple rule might be just those files under +# SCM control, however this would miss files we create like the opcodes and +# CClassHeaders. The following attempts to find everything that is *useful*. +# (demo directories contain many .java files +# that probably aren't useful for development, and the pkgarchive may contain +# duplicates of files within the source hierarchy). The ordering of the .raw +# file is an attempt to make cscope display the most relevant files first. +# +cscope.files: FRC + @-$(RM) cscope.files cscope.files.raw + echo "$(CSINCS)" > cscope.files + -find $(CSDIRS) $(SCM_DIRS_prune) -o -type d \( -name '.del-*' -o \ + -name '*demo' -o -name pkgarchive $(RMCCHEADERS) \) -prune -o \ + -type f \( -name '*.[Ccshlxy]' -o -name '*.il' -o -name '*.cc' -o \ + -name 'Makefile*' -o -name GNUmakefile -o -name '*.gmk' -o \ + -name '*.cpp' $(ADDCLASSES) \) -print > cscope.files.raw + -egrep -v "\.java|\/build\/" cscope.files.raw >> cscope.files + -fgrep ".java" cscope.files.raw >> cscope.files + -fgrep "/build/" cscope.files.raw >> cscope.files + @-$(RM) cscope.files.raw + +cscope.clean: + -$(RM) cscope.files cscope.files.raw cscope.out + +FRC:
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jdk/makefiles/common/Defs-embedded.gmk Wed Apr 11 14:09:48 2012 -0700 @@ -0,0 +1,76 @@ +# +# Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# + +# +# Variable definitions for SE Embedded builds. This file should +# not contain rules. +# +ifdef JAVASE_EMBEDDED + +# Compress jar files +COMPRESS_JARS = true + +# Don't mmap zip files +LIBZIP_CAN_USE_MMAP = false + +# Disable ALSA version check +REQUIRED_ALSA_VERSION = + +# Compilation settings +OTHER_CPPFLAGS += -DJAVASE_EMBEDDED + +# Product naming +PRODUCT_SUFFIX = SE Runtime Environment for Embedded +RUNTIME_NAME = $(PRODUCT_NAME) $(PRODUCT_SUFFIX) + +# Reduced JRE locations +JRE_REDUCED_HEADLESS_IMAGE_DIR = $(ABS_OUTPUTDIR)/j2re-reduced-headless-image +JRE_REDUCED_IMAGE_DIR = $(ABS_OUTPUTDIR)/j2re-reduced-image + +# Override on linux to further reduce binary/lib sizes in product build +ifeq ($(PLATFORM), linux) + ifeq ($(VARIANT), OPT) + ifneq ($(NO_STRIP), true) + ifneq ($(DEBUG_BINARIES), true) + POST_STRIP_PROCESS = $(STRIP) --strip-unneeded + endif + endif + endif +endif + +# NIO Platform specific source file location +ifdef CROSS_COMPILE_ARCH + NIO_PLATFORM_CLASSES_ROOT_DIR = $(CLOSED_PLATFORM_SRC)/classes/ +endif + +# For ARM sflt we need to link to a library with improved FP accuracy +# and it must be linked after fdlibm - this places it at the end after libc +# -z muldefs avoids linker errors for duplicate symbols. +ifeq ($(CROSS_COMPILE_ARCH), arm) + EXTRA_LIBS += $(EXT_LIBS_PATH)/sflt_glibc_jdk.a -Xlinker -z -Xlinker muldefs +endif + +endif # JAVASE_EMBEDDED +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jdk/makefiles/common/Defs-linux.gmk Wed Apr 11 14:09:48 2012 -0700 @@ -0,0 +1,430 @@ +# +# Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# + +# +# Makefile to specify compiler flags for programs and libraries +# targeted to Linux. Should not contain any rules. +# +# WARNING: This file is shared with other workspaces. +# So when it includes other files, it must use JDK_TOPDIR. +# + +# Warning: the following variables are overriden by Defs.gmk. Set +# values will be silently ignored: +# CFLAGS (set $(OTHER_CFLAGS) instead) +# CPPFLAGS (set $(OTHER_CPPFLAGS) instead) +# CXXFLAGS (set $(OTHER_CXXFLAGS) instead) +# LDFLAGS (set $(OTHER_LDFAGS) instead) +# LDLIBS (set $(EXTRA_LIBS) instead) +# LDLIBS_COMMON (set $(EXTRA_LIBS) instead) + +# Get shared JDK settings +include $(JDK_MAKE_SHARED_DIR)/Defs.gmk + +# Part of INCREMENTAL_BUILD mechanism. +# Compiler emits things like: path/file.o: file.h +# We want something like: relative_path/file.o relative_path/file.d: file.h +CC_DEPEND = -MM +CC_DEPEND_FILTER = $(SED) -e 's!$*\.$(OBJECT_SUFFIX)!$(dir $@)& $(dir $@)$*.$(DEPEND_SUFFIX)!g' + +ifndef PLATFORM_SRC + PLATFORM_SRC = $(BUILDDIR)/../src/solaris +endif # PLATFORM_SRC + +# Platform specific closed sources +ifndef OPENJDK + ifndef CLOSED_PLATFORM_SRC + CLOSED_PLATFORM_SRC = $(BUILDDIR)/../src/closed/solaris + endif +endif + +# platform specific include files +PLATFORM_INCLUDE_NAME = $(PLATFORM) +PLATFORM_INCLUDE = $(INCLUDEDIR)/$(PLATFORM_INCLUDE_NAME) + +# suffix used for make dependencies files. +DEPEND_SUFFIX = d +# The suffix applied to the library name for FDLIBM +FDDLIBM_SUFFIX = a +# The suffix applied to scripts (.bat for windows, nothing for unix) +SCRIPT_SUFFIX = +# CC compiler object code output directive flag value +CC_OBJECT_OUTPUT_FLAG = -o #trailing blank required! + +# Default OBJCOPY comes from GNU Binutils on Linux: +DEF_OBJCOPY=/usr/bin/objcopy +ifdef CROSS_COMPILE_ARCH + # don't try to generate .debuginfo files when cross compiling + _JUNK_ := $(shell \ + echo >&2 "INFO: cross compiling for ARCH $(CROSS_COMPILE_ARCH)," \ + "skipping .debuginfo generation.") + OBJCOPY= +else + OBJCOPY=$(shell test -x $(DEF_OBJCOPY) && echo $(DEF_OBJCOPY)) + ifneq ($(ALT_OBJCOPY),) + _JUNK_ := $(shell echo >&2 "INFO: ALT_OBJCOPY=$(ALT_OBJCOPY)") + # disable .debuginfo support by setting ALT_OBJCOPY to a non-existent path + OBJCOPY=$(shell test -x $(ALT_OBJCOPY) && echo $(ALT_OBJCOPY)) + endif +endif + +ifdef LIBRARY_SUPPORTS_FULL_DEBUG_SYMBOLS +# The setting of OBJCOPY above enables the JDK build to import +# .debuginfo files from the HotSpot build. However, adding FDS +# support to the JDK build will occur in phases so a different +# make variable is used to indicate that a particular library +# supports FDS. + +ifeq ($(OBJCOPY),) + _JUNK_ := $(shell \ + echo >&2 "INFO: no objcopy cmd found so cannot create .debuginfo files.") +else + _JUNK_ := $(shell \ + echo >&2 "INFO: $(OBJCOPY) cmd found so will create .debuginfo files.") + + # Library stripping policies for .debuginfo configs: + # all_strip - strips everything from the library + # min_strip - strips most stuff from the library; leaves minimum symbols + # no_strip - does not strip the library at all + # + # Oracle security policy requires "all_strip". A waiver was granted on + # 2011.09.01 that permits using "min_strip" in the Java JDK and Java JRE. + # + DEF_STRIP_POLICY="min_strip" + ifeq ($(ALT_STRIP_POLICY),) + STRIP_POLICY=$(DEF_STRIP_POLICY) + else + STRIP_POLICY=$(ALT_STRIP_POLICY) + endif + + _JUNK_ := $(shell \ + echo >&2 "INFO: STRIP_POLICY=$(STRIP_POLICY)") +endif +endif + +# +# Default optimization +# + +ifndef OPTIMIZATION_LEVEL + ifeq ($(PRODUCT), java) + OPTIMIZATION_LEVEL = HIGHER + else + OPTIMIZATION_LEVEL = LOWER + endif +endif +ifndef FASTDEBUG_OPTIMIZATION_LEVEL + FASTDEBUG_OPTIMIZATION_LEVEL = LOWER +endif + +CC_OPT/NONE = +CC_OPT/LOWER = -O2 +CC_OPT/HIGHER = -O3 +CC_OPT/HIGHEST = -O3 + +CC_OPT = $(CC_OPT/$(OPTIMIZATION_LEVEL)) + +# For all platforms, do not omit the frame pointer register usage. +# We need this frame pointer to make it easy to walk the stacks. +# This should be the default on X86, but ia64 and amd64 may not have this +# as the default. +CFLAGS_REQUIRED_amd64 += -fno-omit-frame-pointer -D_LITTLE_ENDIAN +CFLAGS_REQUIRED_i586 += -fno-omit-frame-pointer -D_LITTLE_ENDIAN +CFLAGS_REQUIRED_ia64 += -fno-omit-frame-pointer -D_LITTLE_ENDIAN +CFLAGS_REQUIRED_sparcv9 += -m64 -mcpu=v9 +LDFLAGS_COMMON_sparcv9 += -m64 -mcpu=v9 +CFLAGS_REQUIRED_sparc += -m32 -mcpu=v9 +LDFLAGS_COMMON_sparc += -m32 -mcpu=v9 +CFLAGS_REQUIRED_arm += -fsigned-char -D_LITTLE_ENDIAN +CFLAGS_REQUIRED_ppc += -fsigned-char -D_BIG_ENDIAN +ifeq ($(ZERO_BUILD), true) + CFLAGS_REQUIRED = $(ZERO_ARCHFLAG) + ifeq ($(ZERO_ENDIANNESS), little) + CFLAGS_REQUIRED += -D_LITTLE_ENDIAN + endif + LDFLAGS_COMMON += $(ZERO_ARCHFLAG) +else + CFLAGS_REQUIRED = $(CFLAGS_REQUIRED_$(ARCH)) + LDFLAGS_COMMON += $(LDFLAGS_COMMON_$(ARCH)) +endif + +# If this is a --hash-style=gnu system, use --hash-style=both +# The gnu .hash section won't work on some Linux systems like SuSE 10. +_HAS_HASH_STYLE_GNU:=$(shell $(CC) -dumpspecs | $(GREP) -- '--hash-style=gnu') +ifneq ($(_HAS_HASH_STYLE_GNU),) + LDFLAGS_HASH_STYLE = -Wl,--hash-style=both +endif +LDFLAGS_COMMON += $(LDFLAGS_HASH_STYLE) + +# +# Selection of warning messages +# +GCC_INHIBIT = -Wno-unused -Wno-parentheses +GCC_STYLE = +GCC_WARNINGS = -W -Wall $(GCC_STYLE) $(GCC_INHIBIT) + +# +# Treat compiler warnings as errors, if warnings not allowed +# +ifeq ($(COMPILER_WARNINGS_FATAL),true) + GCC_WARNINGS += -Werror +endif + +# +# Misc compiler options +# +ifneq ($(ARCH),ppc) + CFLAGS_COMMON = -fno-strict-aliasing +endif +PIC_CODE_LARGE = -fPIC +PIC_CODE_SMALL = -fpic +GLOBAL_KPIC = $(PIC_CODE_LARGE) +CFLAGS_COMMON += $(GLOBAL_KPIC) $(GCC_WARNINGS) +ifeq ($(ARCH), amd64) + CFLAGS_COMMON += -pipe +endif + +# Linux 64bit machines use Dwarf2, which can be HUGE, have fastdebug use -g1 +DEBUG_FLAG = -g +ifeq ($(FASTDEBUG), true) + ifeq ($(ARCH_DATA_MODEL), 64) + DEBUG_FLAG = -g1 + endif +endif + +# DEBUG_BINARIES overrides everything, use full -g debug information +ifeq ($(DEBUG_BINARIES), true) + DEBUG_FLAG = -g + CFLAGS_REQUIRED += $(DEBUG_FLAG) +endif + +CFLAGS_OPT = $(CC_OPT) +CFLAGS_DBG = $(DEBUG_FLAG) +CFLAGS_COMMON += $(CFLAGS_REQUIRED) + +CXXFLAGS_COMMON = $(GLOBAL_KPIC) -DCC_NOEX $(GCC_WARNINGS) +CXXFLAGS_OPT = $(CC_OPT) +CXXFLAGS_DBG = $(DEBUG_FLAG) +CXXFLAGS_COMMON += $(CFLAGS_REQUIRED) + +# FASTDEBUG: Optimize the code in the -g versions, gives us a faster debug java +ifeq ($(FASTDEBUG), true) + CFLAGS_DBG += $(CC_OPT/$(FASTDEBUG_OPTIMIZATION_LEVEL)) + CXXFLAGS_DBG += $(CC_OPT/$(FASTDEBUG_OPTIMIZATION_LEVEL)) +endif + +CPP_ARCH_FLAGS = -DARCH='"$(ARCH)"' + +# Alpha arch does not like "alpha" defined (potential general arch cleanup issue here) +ifneq ($(ARCH),alpha) + CPP_ARCH_FLAGS += -D$(ARCH) +else + CPP_ARCH_FLAGS += -D_$(ARCH)_ +endif + +CPPFLAGS_COMMON = $(CPP_ARCH_FLAGS) -DLINUX $(VERSION_DEFINES) \ + -D_LARGEFILE64_SOURCE -D_GNU_SOURCE -D_REENTRANT + +ifeq ($(ARCH_DATA_MODEL), 64) +CPPFLAGS_COMMON += -D_LP64=1 +endif + +CPPFLAGS_OPT = -DNDEBUG +CPPFLAGS_DBG = -DDEBUG +ifneq ($(PRODUCT), java) + CPPFLAGS_DBG += -DLOGGING +endif + +ifdef LIBRARY + # Libraries need to locate other libraries at runtime, and you can tell + # a library where to look by way of the dynamic runpaths (RPATH or RUNPATH) + # buried inside the .so. The $ORIGIN says to look relative to where + # the library itself is and it can be followed with relative paths from + # that. By default we always look in $ORIGIN, optionally we add relative + # paths if the Makefile sets LD_RUNPATH_EXTRAS to those relative paths. + # On Linux we add a flag -z origin, not sure if this is necessary, but + # doesn't seem to hurt. + # The environment variable LD_LIBRARY_PATH will over-ride these runpaths. + # Try: 'readelf -d lib*.so' to see these settings in a library. + # + Z_ORIGIN_FLAG/sparc = -Xlinker -z -Xlinker origin + Z_ORIGIN_FLAG/i586 = -Xlinker -z -Xlinker origin + Z_ORIGIN_FLAG/amd64 = -Xlinker -z -Xlinker origin + Z_ORIGIN_FLAG/ia64 = -Xlinker -z -Xlinker origin + Z_ORIGIN_FLAG/arm = + Z_ORIGIN_FLAG/ppc = + Z_ORIGIN_FLAG/zero = -Xlinker -z -Xlinker origin + + LDFLAG_Z_ORIGIN = $(Z_ORIGIN_FLAG/$(ARCH_FAMILY)) + + LDFLAGS_COMMON += $(LDFLAG_Z_ORIGIN) -Xlinker -rpath -Xlinker \$$ORIGIN + LDFLAGS_COMMON += $(LD_RUNPATH_EXTRAS:%=$(LDFLAG_Z_ORIGIN) -Xlinker -rpath -Xlinker \$$ORIGIN/%) + +endif + +EXTRA_LIBS += -lc + +LDFLAGS_DEFS_OPTION = -Xlinker -z -Xlinker defs +#LDFLAGS_COMMON += $(LDFLAGS_DEFS_OPTION) + +# +# -L paths for finding and -ljava +# +LDFLAGS_OPT = -Xlinker -O1 +LDFLAGS_COMMON += -L$(LIBDIR)/$(LIBARCH) +LDFLAGS_COMMON += -Wl,-soname=$(LIB_PREFIX)$(LIBRARY).$(LIBRARY_SUFFIX) + +# +# -static-libgcc is a gcc-3 flag to statically link libgcc, gcc-2.9x always +# statically link libgcc but will print a warning with the flag. We don't +# want the warning, so check gcc version first. +# +ifeq ($(CC_MAJORVER),3) + OTHER_LDFLAGS += -static-libgcc +endif + +# Automatic precompiled header option to use (if COMPILE_APPROACH=batch) +# (See Rules.gmk) The gcc 5 compiler might have an option for this? +AUTOMATIC_PCH_OPTION = + +# +# Post Processing of libraries/executables +# +ifeq ($(VARIANT), OPT) + ifneq ($(NO_STRIP), true) + ifneq ($(DEBUG_BINARIES), true) + # Debug 'strip -g' leaves local function Elf symbols (better stack + # traces) + POST_STRIP_PROCESS = $(STRIP) -g + endif + endif +endif + +# +# Use: ld $(LD_MAPFILE_FLAG) mapfile *.o +# +LD_MAPFILE_FLAG = -Xlinker --version-script -Xlinker + +# +# Support for Quantify. +# +ifdef QUANTIFY +QUANTIFY_CMD = quantify +QUANTIFY_OPTIONS = -cache-dir=/tmp/quantify -always-use-cache-dir=yes +LINK_PRE_CMD = $(QUANTIFY_CMD) $(QUANTIFY_OPTIONS) +endif + +# +# Path and option to link against the VM, if you have to. Note that +# there are libraries that link against only -ljava, but they do get +# -L to the -ljvm, this is because -ljava depends on -ljvm, whereas +# the library itself should not. +# +VM_NAME = server +# First try to link against server, if that does not exist link against client. +JVMLIB = -L$(LIBDIR)/$(LIBARCH)/server -L$(LIBDIR)/$(LIBARCH)/client -ljvm +JAVALIB = -ljava $(JVMLIB) + +# +# We want to privatize JVM symbols on Solaris. This is so the user can +# write a function called FindClass and this should not override the +# FindClass that is inside the JVM. At this point in time we are not +# concerned with other JNI libraries because we hope that there will +# not be as many clashes there. +# +PRIVATIZE_JVM_SYMBOLS = false + +USE_PTHREADS = true +override ALT_CODESET_KEY = _NL_CTYPE_CODESET_NAME +override AWT_RUNPATH = +override HAVE_ALTZONE = false +override HAVE_FILIOH = false +override HAVE_GETHRTIME = false +override HAVE_GETHRVTIME = false +override HAVE_SIGIGNORE = true +override LEX_LIBRARY = -lfl +ifeq ($(STATIC_CXX),true) +override LIBCXX = -Wl,-Bstatic -lstdc++ -lgcc -Wl,-Bdynamic +else +override LIBCXX = -lstdc++ +endif +override LIBPOSIX4 = +override LIBSOCKET = +override LIBNSL = +override LIBSCF = +override LIBTHREAD = +override LIBDL = -ldl +override MOOT_PRIORITIES = true +override NO_INTERRUPTIBLE_IO = true +ifeq ($(ARCH), amd64) +override OPENWIN_LIB = $(OPENWIN_HOME)/lib64 +else +override OPENWIN_LIB = $(OPENWIN_HOME)/lib +endif +override OTHER_M4FLAGS = -D__GLIBC__ -DGNU_ASSEMBLER +override SUN_CMM_SUBDIR = +override THREADS_FLAG = native +override USE_GNU_M4 = true +override USING_GNU_TAR = true +override WRITE_LIBVERSION = false + +# USE_EXECNAME forces the launcher to look up argv[0] on $PATH, and put the +# resulting resolved absolute name of the executable in the environment +# variable EXECNAME. That executable name is then used that to locate the +# installation area. +override USE_EXECNAME = true + +# If your platform has DPS, it will have Type1 fonts too, in which case +# it is best to enable DPS support until such time as 2D's rasteriser +# can fully handle Type1 fonts in all cases. Default is "yes". +# HAVE_DPS should only be "no" if the platform has no DPS headers or libs +# DPS (Displayable PostScript) is available on Solaris machines +HAVE_DPS = no + +# +# Japanese manpages +# +JA_SOURCE_ENCODING = eucJP +JA_TARGET_ENCODINGS = UTF-8 + +# Settings for the JDI - Serviceability Agent binding. +HOTSPOT_SALIB_PATH = $(HOTSPOT_IMPORT_PATH)/jre/lib/$(LIBARCH) +SALIB_NAME = $(LIB_PREFIX)saproc.$(LIBRARY_SUFFIX) +SA_DEBUGINFO_NAME = $(LIB_PREFIX)saproc.debuginfo + +# The JDI - Serviceability Agent binding is not currently supported +# on Linux-ia64. +ifeq ($(ARCH), ia64) + INCLUDE_SA = false +else + INCLUDE_SA = true +endif + +ifdef CROSS_COMPILE_ARCH + # X11 headers are not under /usr/include + OTHER_CFLAGS += -I$(OPENWIN_HOME)/include + OTHER_CXXFLAGS += -I$(OPENWIN_HOME)/include + OTHER_CPPFLAGS += -I$(OPENWIN_HOME)/include +endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jdk/makefiles/common/Defs-macosx.gmk Wed Apr 11 14:09:48 2012 -0700 @@ -0,0 +1,402 @@ +# +# Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# + +# +# Makefile to specify compiler flags for programs and libraries +# targeted to MACOSX. Should not contain any rules. +# +# WARNING: This file is shared with other workspaces. +# So when it includes other files, it must use JDK_TOPDIR. +# + +# Warning: the following variables are overriden by Defs.gmk. Set +# values will be silently ignored: +# CFLAGS (set $(OTHER_CFLAGS) instead) +# CPPFLAGS (set $(OTHER_CPPFLAGS) instead) +# CXXFLAGS (set $(OTHER_CXXFLAGS) instead) +# LDFLAGS (set $(OTHER_LDFAGS) instead) +# LDLIBS (set $(EXTRA_LIBS) instead) +# LDLIBS_COMMON (set $(EXTRA_LIBS) instead) + +# Get shared JDK settings +include $(JDK_MAKE_SHARED_DIR)/Defs.gmk + +# Part of INCREMENTAL_BUILD mechanism. +# Compiler emits things like: path/file.o: file.h +# We want something like: relative_path/file.o relative_path/file.d: file.h +CC_DEPEND = -MM +CC_DEPEND_FILTER = $(SED) -e 's!$*\.$(OBJECT_SUFFIX)!$(dir $@)& $(dir $@)$*.$(DEPEND_SUFFIX)!g' + +ifndef PLATFORM_SRC + PLATFORM_SRC = $(BUILDDIR)/../src/solaris +endif # PLATFORM_SRC + +PLATFORM_SRC_MACOS = $(BUILDDIR)/../src/macosx + +# BSD build pulls its platform sources from the solaris tree. +JAVA_SRCDIR_LIST = src/$(PLATFORM) src/solaris src/share +NATIVE_SRCDIR_LIST = src/$(PLATFORM) src/solaris src/share + +# Platform specific closed sources +ifndef OPENJDK + ifndef CLOSED_PLATFORM_SRC + CLOSED_PLATFORM_SRC = $(BUILDDIR)/../src/closed/solaris + endif +endif + +# platform specific include files +PLATFORM_INCLUDE_NAME = $(OS_NAME) +PLATFORM_INCLUDE = $(INCLUDEDIR)/$(PLATFORM_INCLUDE_NAME) + +# suffix used for make dependencies files. +DEPEND_SUFFIX = d +# The suffix applied to the library name for FDLIBM +FDDLIBM_SUFFIX = a +# The suffix applied to scripts (.bat for windows, nothing for unix) +SCRIPT_SUFFIX = +# CC compiler object code output directive flag value +CC_OBJECT_OUTPUT_FLAG = -o #trailing blank required! +CC_PROGRAM_OUTPUT_FLAG = -o #trailing blank required! + +# +# Default optimization +# + +ifndef OPTIMIZATION_LEVEL + ifeq ($(PRODUCT), java) + OPTIMIZATION_LEVEL = HIGHER + else + OPTIMIZATION_LEVEL = LOWER + endif +endif +ifndef FASTDEBUG_OPTIMIZATION_LEVEL + FASTDEBUG_OPTIMIZATION_LEVEL = LOWER +endif + +# For macosx use -Os by default, unless -O3 can be proved to be worth the cost, as per policy +# <http://wikis.sun.com/display/OpenJDK/Mac+OS+X+Port+Compilers> +CC_OPT/NONE = +CC_OPT/LOWER = -Os +CC_OPT/HIGHER = -Os +CC_OPT/HIGHEST = -Os + +CC_OPT = $(CC_OPT/$(OPTIMIZATION_LEVEL)) + +# For all platforms, do not omit the frame pointer register usage. +# We need this frame pointer to make it easy to walk the stacks. +# This should be the default on X86, but ia64 and amd64 may not have this +# as the default. +CFLAGS_REQUIRED_amd64 += -m64 -fno-omit-frame-pointer -D_LITTLE_ENDIAN +LDFLAGS_COMMON_amd64 += -m64 +CFLAGS_REQUIRED_i586 += -m32 -fno-omit-frame-pointer -D_LITTLE_ENDIAN +LDFLAGS_COMMON_i586 += -m32 +CFLAGS_REQUIRED_ia64 += -m64 -fno-omit-frame-pointer -D_LITTLE_ENDIAN +CFLAGS_REQUIRED_sparcv9 += -m64 -mcpu=v9 +LDFLAGS_COMMON_sparcv9 += -m64 -mcpu=v9 +CFLAGS_REQUIRED_sparc += -m32 -mcpu=v9 +LDFLAGS_COMMON_sparc += -m32 -mcpu=v9 +CFLAGS_REQUIRED_arm += -fsigned-char -D_LITTLE_ENDIAN +CFLAGS_REQUIRED_ppc += -fsigned-char -D_BIG_ENDIAN +ifeq ($(ZERO_BUILD), true) + CFLAGS_REQUIRED = $(ZERO_ARCHFLAG) + ifeq ($(ZERO_ENDIANNESS), little) + CFLAGS_REQUIRED += -D_LITTLE_ENDIAN + endif + LDFLAGS_COMMON += $(ZERO_ARCHFLAG) +else ifeq ($(ARCH), universal) + CFLAGS_REQUIRED += -arch i386 -arch x86_64 -D_LITTLE_ENDIAN + LDFLAGS_COMMON += -arch i386 -arch x86_64 +else + CFLAGS_REQUIRED = $(CFLAGS_REQUIRED_$(ARCH)) + LDFLAGS_COMMON += $(LDFLAGS_COMMON_$(ARCH)) +endif +# 16-byte stack re-alignment on 32-bit Darwin +CFLAGS_REQUIRED_i586 += -mstackrealign + +OTHER_CFLAGS = \ + -F/System/Library/Frameworks/JavaVM.framework/Frameworks \ + -F/System/Library/Frameworks/ApplicationServices.framework/Frameworks + +# +# Selection of warning messages +# +GCC_INHIBIT = -Wno-unused -Wno-parentheses +GCC_STYLE = +GCC_WARNINGS = -W -Wall $(GCC_STYLE) $(GCC_INHIBIT) + +# +# Treat compiler warnings as errors, if warnings not allowed +# +ifeq ($(COMPILER_WARNINGS_FATAL),true) + GCC_WARNINGS += -Werror +endif + +# +# Misc compiler options +# +ifneq ($(ARCH),ppc) + CFLAGS_COMMON = -fno-strict-aliasing +endif +PIC_CODE_LARGE = -fPIC +PIC_CODE_SMALL = -fpic +GLOBAL_KPIC = $(PIC_CODE_LARGE) +CFLAGS_COMMON += $(GLOBAL_KPIC) $(GCC_WARNINGS) +ifeq ($(ARCH), amd64) + CFLAGS_COMMON += -pipe +endif + +# BSD 64bit machines use Dwarf2, which can be HUGE, have fastdebug use -g1 +DEBUG_FLAG = -g +ifeq ($(FASTDEBUG), true) + ifeq ($(ARCH_DATA_MODEL), 64) + DEBUG_FLAG = -g1 + endif +endif + +# DEBUG_BINARIES overrides everything, use full -g debug information +ifeq ($(DEBUG_BINARIES), true) + DEBUG_FLAG = -g + CFLAGS_REQUIRED += $(DEBUG_FLAG) +endif + +CFLAGS_OPT = $(CC_OPT) +CFLAGS_DBG = $(DEBUG_FLAG) +CFLAGS_COMMON += $(CFLAGS_REQUIRED) + +CXXFLAGS_COMMON = $(GLOBAL_KPIC) -DCC_NOEX $(GCC_WARNINGS) +CXXFLAGS_OPT = $(CC_OPT) +CXXFLAGS_DBG = $(DEBUG_FLAG) +CXXFLAGS_COMMON += $(CFLAGS_REQUIRED) + +# FASTDEBUG: Optimize the code in the -g versions, gives us a faster debug java +ifeq ($(FASTDEBUG), true) + CFLAGS_DBG += $(CC_OPT/$(FASTDEBUG_OPTIMIZATION_LEVEL)) + CXXFLAGS_DBG += $(CC_OPT/$(FASTDEBUG_OPTIMIZATION_LEVEL)) +endif + +CPP_ARCH_FLAGS = -DARCH='"$(ARCH)"' + +# Alpha arch does not like "alpha" defined (potential general arch cleanup issue here) +ifneq ($(ARCH),alpha) + CPP_ARCH_FLAGS += -D$(ARCH) +else + CPP_ARCH_FLAGS += -D_$(ARCH)_ +endif +CPPFLAGS_COMMON = $(CPP_ARCH_FLAGS) -D_ALLBSD_SOURCE $(VERSION_DEFINES) \ + -D_LARGEFILE64_SOURCE -D_GNU_SOURCE -D_REENTRANT + +CPPFLAGS_COMMON += -DMACOSX + +ifeq ($(ARCH_DATA_MODEL), 64) +CPPFLAGS_COMMON += -D_LP64=1 +endif + +CPPFLAGS_OPT = -DNDEBUG +CPPFLAGS_DBG = -DDEBUG +ifneq ($(PRODUCT), java) + CPPFLAGS_DBG += -DLOGGING +endif + +# Libraries need to locate other libraries at runtime, and you can tell +# a library where to look by way of the dynamic runpaths (RPATH or RUNPATH) +# buried inside the .{so,dylib}. The {$ORIGIN,@loader_path/} says to look +# relative to where the library itself is and it can be followed +# with relative paths from that. By default we always look in +# {$ORIGIN,@loader_path/}, optionally we add relative paths if the Makefile +# sets LD_RUNPATH_EXTRAS to those relative paths. +# Except on MacOS X we add a flag -z origin, not sure if this is necessary, +# but doesn't seem to hurt. +# The environment variable LD_LIBRARY_PATH will over-ride these runpaths. +# See 'man {dyld,rtld}' for more information. +# Try: 'readelf -d lib*.so' to see these settings in a library. +# +LDFLAGS_COMMON += -Xlinker -rpath -Xlinker @loader_path/. +LDFLAGS_COMMON += $(LD_RUNPATH_EXTRAS:%=-Xlinker -rpath -Xlinker @loader_path/%) +LDFLAGS_COMMON += -Xlinker -install_name -Xlinker @rpath/$(@F) + +# +# -L paths for finding and -ljava +# +LDFLAGS_COMMON += -L$(LIBDIR) + +# +# -static-libgcc is a gcc-3 flag to statically link libgcc, gcc-2.9x always +# statically link libgcc but will print a warning with the flag. We don't +# want the warning, so check gcc version first. +# +ifeq ($(CC_MAJORVER),3) + OTHER_LDFLAGS += -static-libgcc +endif + +# Automatic precompiled header option to use (if COMPILE_APPROACH=batch) +# (See Rules.gmk) The gcc 5 compiler might have an option for this? +AUTOMATIC_PCH_OPTION = + +# +# Post Processing of libraries/executables +# +ifeq ($(VARIANT), OPT) + ifneq ($(NO_STRIP), true) + ifneq ($(DEBUG_BINARIES), true) + # Debug 'strip -S' leaves local function Elf symbols (better stack + # traces) + POST_STRIP_PROCESS = $(STRIP) -S + endif + endif +endif + +# +# Use: ld $(LD_MAPFILE_FLAG) mapfile *.o +# +LD_MAPFILE_FLAG = -Xlinker --version-script -Xlinker + +# +# Support for Quantify. +# +ifdef QUANTIFY +QUANTIFY_CMD = quantify +QUANTIFY_OPTIONS = -cache-dir=/tmp/quantify -always-use-cache-dir=yes +LINK_PRE_CMD = $(QUANTIFY_CMD) $(QUANTIFY_OPTIONS) +endif + +# Darwin does not support linker map files. +LDNOMAP=true + +# +# Path and option to link against the VM, if you have to. Note that +# there are libraries that link against only -ljava, but they do get +# -L to the -ljvm, this is because -ljava depends on -ljvm, whereas +# the library itself should not. +# +VM_NAME = server +JVMLIB = -L$(LIBDIR)/server -L$(LIBDIR)/client -ljvm +JAVALIB = -ljava $(JVMLIB) + +# +# We want to privatize JVM symbols on Solaris. This is so the user can +# write a function called FindClass and this should not override the +# FindClass that is inside the JVM. At this point in time we are not +# concerned with other JNI libraries because we hope that there will +# not be as many clashes there. +# +PRIVATIZE_JVM_SYMBOLS = false + +USE_PTHREADS = true +override ALT_CODESET_KEY = _NL_CTYPE_CODESET_NAME +override AWT_RUNPATH = +override HAVE_ALTZONE = false +override HAVE_FILIOH = false +override HAVE_GETHRTIME = false +override HAVE_GETHRVTIME = false +override HAVE_SIGIGNORE = true +override LEX_LIBRARY = -lfl +ifeq ($(STATIC_CXX),true) +override LIBCXX = -Wl,-Bstatic -lstdc++ -lgcc -Wl,-Bdynamic +else +override LIBCXX = -lstdc++ +endif +override LIBPOSIX4 = +override LIBSOCKET = +override LIBNSL = +override LIBTHREAD = +override LIBDL = +override MOOT_PRIORITIES = true +override NO_INTERRUPTIBLE_IO = true +override OPENWIN_HOME = $(X11_PATH) +override OPENWIN_LIB = $(OPENWIN_HOME)/lib +override OTHER_M4FLAGS = -D__GLIBC__ -DGNU_ASSEMBLER +override SUN_CMM_SUBDIR = +override THREADS_FLAG = native +override USE_GNU_M4 = true +override USING_GNU_TAR = true +override WRITE_LIBVERSION = false + +ifdef ALT_X11_PATH + X11_PATH = $(ALT_X11_PATH) +else + X11_PATH = /usr/X11R6 +endif + +ifdef ALT_PACKAGE_PATH + PACKAGE_PATH = $(ALT_PACKAGE_PATH) +else + PACKAGE_PATH = /opt/local +endif + +# ALSA +ifdef ALT_ALSA_LIB_PATH + ALSA_LIB_PATH = $(ALT_ALSA_LIB_PATH) +else + ALSA_LIB_PATH = $(PACKAGE_PATH)/lib +endif + +ifdef ALT_ALSA_HEADERS_PATH + ALSA_HEADERS_PATH = $(ALT_ALSA_HEADERS_PATH) +else + ALSA_HEADERS_PATH = $(PACKAGE_PATH)/include +endif + +# USE_EXECNAME forces the launcher to look up argv[0] on $PATH, and put the +# resulting resolved absolute name of the executable in the environment +# variable EXECNAME. That executable name is then used that to locate the +# installation area. +override USE_EXECNAME = true + +# If your platform has DPS, it will have Type1 fonts too, in which case +# it is best to enable DPS support until such time as 2D's rasteriser +# can fully handle Type1 fonts in all cases. Default is "yes". +# HAVE_DPS should only be "no" if the platform has no DPS headers or libs +# DPS (Displayable PostScript) is available on Solaris machines +HAVE_DPS = no + +SYSTEM_ZLIB = true + +# +# Japanese manpages +# +JA_SOURCE_ENCODING = eucJP +JA_TARGET_ENCODINGS = UTF-8 + +# Settings for the JDI - Serviceability Agent binding. + +HOTSPOT_SALIB_PATH = $(HOTSPOT_IMPORT_PATH)/jre/lib/$(LIBARCH) +SALIB_NAME = $(LIB_PREFIX)saproc.$(LIBRARY_SUFFIX) + +# The JDI - Serviceability Agent binding is not currently supported +# on ia64. +ifeq ($(ARCH), ia64) + INCLUDE_SA = false +else + INCLUDE_SA = true +endif + +ifdef CROSS_COMPILE_ARCH + # X11 headers are not under /usr/include + OTHER_CFLAGS += -I$(OPENWIN_HOME)/include + OTHER_CXXFLAGS += -I$(OPENWIN_HOME)/include + OTHER_CPPFLAGS += -I$(OPENWIN_HOME)/include +endif + +LIB_LOCATION ?= $(LIBDIR)
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jdk/makefiles/common/Defs-solaris.gmk Wed Apr 11 14:09:48 2012 -0700 @@ -0,0 +1,757 @@ +# +# Copyright (c) 1995, 2011, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# + +# +# Makefile to specify compiler flags for programs and libraries +# targeted to Solaris. Should not contain any rules. +# +# WARNING: This file is shared with other workspaces. +# So when it includes other files, it must use JDK_TOPDIR. +# + +# Warning: the following variables are overridden by Defs.gmk. Set +# values will be silently ignored: +# CFLAGS (set $(OTHER_CFLAGS) instead) +# CPPFLAGS (set $(OTHER_CPPFLAGS) instead) +# CXXFLAGS (set $(OTHER_CXXFLAGS) instead) +# LDFLAGS (set $(OTHER_LDFAGS) instead) +# LDLIBS (set $(EXTRA_LIBS) instead) +# LDLIBS_COMMON (set $(EXTRA_LIBS) instead) +# LINTFLAGS (set $(OTHER_LINTFLAGS) instead) +# +# Note: CPPFLAGS are used in C and C++ compiles. +# + +# Get shared JDK settings +include $(JDK_MAKE_SHARED_DIR)/Defs.gmk + +ifndef PLATFORM_SRC +PLATFORM_SRC = $(BUILDDIR)/../src/solaris +endif # PLATFORM_SRC + +# Platform specific closed sources +ifndef OPENJDK + ifndef CLOSED_PLATFORM_SRC + CLOSED_PLATFORM_SRC = $(BUILDDIR)/../src/closed/solaris + endif +endif + +# platform specific include files +PLATFORM_INCLUDE_NAME = $(PLATFORM) +PLATFORM_INCLUDE = $(INCLUDEDIR)/$(PLATFORM_INCLUDE_NAME) + +# suffix used for make dependencies files +DEPEND_SUFFIX = d +# suffix used for lint files +LINT_SUFFIX = ln +# The suffix applied to the library name for FDLIBM +FDDLIBM_SUFFIX = a +# The suffix applied to scripts (.bat for windows, nothing for unix) +SCRIPT_SUFFIX = +# CC compiler object code output directive flag value +CC_OBJECT_OUTPUT_FLAG = -o #trailing blank required! + +ifdef ENABLE_FULL_DEBUG_SYMBOLS +# Only check for Full Debug Symbols support on Solaris if it is +# specifically enabled. Hopefully, it can be enabled by default +# once the .debuginfo size issues are worked out. + +# Default OBJCOPY comes from the SUNWbinutils package: +DEF_OBJCOPY=/usr/sfw/bin/gobjcopy +ifeq ($(PLATFORM)-$(LIBARCH), solaris-amd64) + # On Solaris AMD64/X64, gobjcopy is not happy and fails: + # + # usr/sfw/bin/gobjcopy --add-gnu-debuglink=<lib>.debuginfo <lib>.so + # BFD: stKPaiop: Not enough room for program headers, try linking with -N + # /usr/sfw/bin/gobjcopy: stKPaiop: Bad value + # BFD: stKPaiop: Not enough room for program headers, try linking with -N + # /usr/sfw/bin/gobjcopy: libsaproc.debuginfo: Bad value + # BFD: stKPaiop: Not enough room for program headers, try linking with -N + # /usr/sfw/bin/gobjcopy: stKPaiop: Bad value + _JUNK_ := $(shell \ + echo >&2 "INFO: $(DEF_OBJCOPY) is not working on Solaris AMD64/X64") + OBJCOPY= +else + OBJCOPY=$(shell test -x $(DEF_OBJCOPY) && echo $(DEF_OBJCOPY)) + ifneq ($(ALT_OBJCOPY),) + _JUNK_ := $(shell echo >&2 "INFO: ALT_OBJCOPY=$(ALT_OBJCOPY)") + # disable .debuginfo support by setting ALT_OBJCOPY to a non-existent path + OBJCOPY=$(shell test -x $(ALT_OBJCOPY) && echo $(ALT_OBJCOPY)) + endif +endif + +ifdef LIBRARY_SUPPORTS_FULL_DEBUG_SYMBOLS +# The setting of OBJCOPY above enables the JDK build to import +# .debuginfo files from the HotSpot build. However, adding FDS +# support to the JDK build will occur in phases so a different +# make variable is used to indicate that a particular library +# supports FDS. + +ifeq ($(OBJCOPY),) + _JUNK_ := $(shell \ + echo >&2 "INFO: no objcopy cmd found so cannot create .debuginfo files.") +else + _JUNK_ := $(shell \ + echo >&2 "INFO: $(OBJCOPY) cmd found so will create .debuginfo files.") + + # Library stripping policies for .debuginfo configs: + # all_strip - strips everything from the library + # min_strip - strips most stuff from the library; leaves minimum symbols + # no_strip - does not strip the library at all + # + # Oracle security policy requires "all_strip". A waiver was granted on + # 2011.09.01 that permits using "min_strip" in the Java JDK and Java JRE. + # + DEF_STRIP_POLICY="min_strip" + ifeq ($(ALT_STRIP_POLICY),) + STRIP_POLICY=$(DEF_STRIP_POLICY) + else + STRIP_POLICY=$(ALT_STRIP_POLICY) + endif + _JUNK_ := $(shell \ + echo >&2 "INFO: STRIP_POLICY=$(STRIP_POLICY)") +endif +endif +endif + +# +# Java default optimization (-x04/-O2) etc. Applies to the VM. +# +ifndef OPTIMIZATION_LEVEL + ifeq ($(PRODUCT), java) + OPTIMIZATION_LEVEL = HIGHER + else + OPTIMIZATION_LEVEL = LOWER + endif +endif +ifndef FASTDEBUG_OPTIMIZATION_LEVEL + FASTDEBUG_OPTIMIZATION_LEVEL = LOWER +endif + +# +# If -Xa is in CFLAGS_COMMON it will end up ahead of $(CC_OPT) for the +# optimized build, and that ordering of the flags completely freaks +# out cc. Hence, -Xa is instead in each CFLAGS variant. +# +# The more unusual options to the Sun C compiler: +# -v Stricter type checking, more error checking +# (To turn ALL warnings into fatals, use -errwarn=%all) +# -xstrconst Place string literals and constants in read-only area +# (means you can't write on your string literals) +# -xs Force debug information (stabs) into the .so or a.out +# (makes the library/executable debuggable without the +# .o files needing to be around, but at a space cost) +# -g & -O If you add the -g option to the optimized compiles +# you will get better stack retraces, the code is +# still optimized. This includes a space cost too. +# -xc99=%none Do NOT allow for c99 extensions to be used. +# e.g. declarations must precede statements +# -xCC Allow the C++ style of comments in C: // +# Required with many of the source files. +# -mt Assume multi-threaded (important) +# +# The more unusual options to the Sun C compiler: +# +w Print more warnings +# +w2 Maximum warnings +# + +# +# Debug flag for C and C++ compiler +# +CFLAGS_DEBUG_OPTION = -g $(CC_OPT/NONE) +CXXFLAGS_DEBUG_OPTION = -g $(CXX_OPT/NONE) + +# Turn off -g if we are doing tcov build +ifdef TCOV_BUILD + CFLAGS_DEBUG_OPTION= + CXXFLAGS_DEBUG_OPTION= +endif + +# FASTDEBUG: Optimize the -g builds, gives us a faster debug java +# If true adds -O to the debug compiles. This allows for any assert +# tests to remain and debug checking. The resulting code is faster +# but less debuggable. Stack traces are still valid, although only +# approximate line numbers are given. Printing of local variables +# during a debugging session is not possible, but stepping and +# printing of global or static variables should be possible. +# Performance/size of files should be about the same, maybe smaller. +# +ifeq ($(FASTDEBUG), true) + CFLAGS_DEBUG_OPTION = -g $(CC_OPT/$(FASTDEBUG_OPTIMIZATION_LEVEL)) + CXXFLAGS_DEBUG_OPTION = -g0 $(CXX_OPT/$(FASTDEBUG_OPTIMIZATION_LEVEL)) +endif + +CFLAGS_COMMON = -L$(OBJDIR) + +# Do not allow C99 language features like declarations in code etc. +CFLAGS_COMMON += -xc99=%none + +# Allow C++ comments in C code +CFLAGS_COMMON += -xCC + +# Show error message tags on errors +CFLAGS_COMMON += -errshort=tags +CXXFLAGS_COMMON += -errtags=yes + +# Optimization flags +CFLAGS_OPT = $(CC_OPT) + +# Debug version flags +CFLAGS_DBG = $(CFLAGS_DEBUG_OPTION) + +# Required C compiler flags +CFLAGS_COMMON += -Xa $(CFLAGS_REQUIRED) + +# Maximum warnings all the time +CXXFLAGS_COMMON += +w +CFLAGS_COMMON += -v + +# Assume MT behavior all the time (important) +CXXFLAGS_COMMON += -mt +CFLAGS_COMMON += -mt + +# Assume no C++ exceptions are used +CXXFLAGS_COMMON += -features=no%except -DCC_NOEX + +# For C++, these options tell it to assume nothing about locating libraries +# either at compile time, or at runtime. Use of these options will likely +# require the use of -L and -R options to indicate where libraries will +# be found at compile time (-L) and at runtime (-R). +# The /usr/lib location comes for free, so no need to specify that one. +# Note: C is much simplier and there is no need for these options. This +# is mostly needed to avoid dependencies on libraries in the +# Compiler install area, also see LIBCXX and LIBM. +CXXFLAGS_COMMON += -norunpath -xnolib + +# +# Treat compiler warnings as errors, if requested +# +ifeq ($(COMPILER_WARNINGS_FATAL),true) + CFLAGS_COMMON += -errwarn=%all + CXXFLAGS_COMMON += -errwarn=%all +endif + +CXXFLAGS_OPT = $(CXX_OPT) +CXXFLAGS_DBG = $(CXXFLAGS_DEBUG_OPTION) +CXXFLAGS_COMMON += $(CFLAGS_REQUIRED) + +# Add -xstrconst to the library compiles. This forces all string +# literals into the read-only data section, which prevents them from +# being written to and increases the runtime pages shared on the system. +# +ifdef LIBRARY + CFLAGS_COMMON +=-xstrconst +endif + +# Source browser database +# +# COMPILE_WITH_SB +# If defined adds -xsb to compiles and creates a +# source browsing database during compilation. +# +ifdef COMPILE_WITH_SB + ifeq ($(LIBRARY), java) + CFLAGS_DBG += -xsb + endif +endif + +# Lint Flags: +# -Xa ANSI C plus K&R, favor ANSI rules +# -fd report on old style func defs +# -errchk=structarg report on 64bit struct args by value +# -errchk=longptr64 report on 64bit to 32bit issues (ignores casts) +# -errchk=parentheses report on suggested use of extra parens +# -v suppress unused args +# -x suppress unused externs +# -u suppress extern func/vars used/defined +# -errfmt=simple use one line errors with position info +# $(LINT_XARCH_OPTION) See Compiler-sun.gwk + +LINTFLAGS_COMMON = -Xa +LINTFLAGS_COMMON += -fd +LINTFLAGS_COMMON += -errchk=structarg,longptr64,parentheses +LINTFLAGS_COMMON += -v +LINTFLAGS_COMMON += -x +LINTFLAGS_COMMON += -u +LINTFLAGS_COMMON += -errfmt=simple +LINTFLAGS_OPT = +LINTFLAGS_DBG = + +# The -W0,-noglobal tells the compiler to NOT generate mangled global +# ELF data symbols for file local static data. +# This can break fix&continue, but we'd rather do the same compilations +# for deliverable bits as we do for non-deliverable bits +# Tell the compilers to never generate globalized names, all the time. +CFLAGS_COMMON += -W0,-noglobal + +# If we have a specific arch value to use, add it +CFLAGS_COMMON += $(XARCH_OPTION) +CXXFLAGS_COMMON += $(XARCH_OPTION) +ASFLAGS_COMMON += $(AS_XARCH_OPTION) +EXTRA_LIBS += $(XARCH_OPTION) +LINTFLAGS_COMMON += $(LINT_XARCH_OPTION) + +# +# uncomment the following to build with PERTURBALOT set +# +# OTHER_CFLAGS += -DPERTURBALOT +# + +CPPFLAGS_COMMON = -D__solaris__ -D$(ARCH_FAMILY) +CPPFLAGS_OPT = -DNDEBUG +CPPFLAGS_DBG = -DDEBUG + +ifneq ($(PRODUCT), java) + CPPFLAGS_DBG += -DLOGGING -DDBINFO +endif + +ifeq ($(ARCH_FAMILY), i586) + # The macro _LITTLE_ENDIAN needs to be defined the same to avoid the + # Sun C compiler warning message: warning: macro redefined: _LITTLE_ENDIAN + # (The Solaris X86 system defines this in file /usr/include/sys/isa_defs.h). + # Note: -Dmacro is the same as #define macro 1 + # -Dmacro= is the same as #define macro + # + CPPFLAGS_COMMON += -DcpuIntel -D_LITTLE_ENDIAN= -D$(LIBARCH) + # Turn off a superfluous compiler error message on Intel + CFLAGS_COMMON += -erroff=E_BAD_PRAGMA_PACK_VALUE +endif + +# Java memory management is based on memory mapping by default, but a +# system only assuming malloc/free can be built by adding -DUSE_MALLOC + +CPPFLAGS_COMMON += -DTRACING -DMACRO_MEMSYS_OPS -DBREAKPTS +CPPFLAGS_OPT += -DTRIMMED + +LDFLAGS_DEFS_OPTION = -z defs +LDFLAGS_COMMON += $(LDFLAGS_DEFS_OPTION) + +# +# -L paths for finding and -ljava +# +LDFLAGS_COMMON += -L$(LIBDIR)/$(LIBARCH) +LDFLAGS_OPT = +LDFLAGS_DBG = + +# +# We never really want the incremental linker, ever +# The -xildoff option tells Sun's compilers to NOT use incremental linker +# +LDFLAGS_COMMON += -xildoff + +ifdef LIBRARY + # Libraries need to locate other libraries at runtime, and you can tell + # a library where to look by way of the dynamic runpaths (RPATH or RUNPATH) + # buried inside the .so. The $ORIGIN says to look relative to where + # the library itself is and it can be followed with relative paths from + # that. By default we always look in $ORIGIN, optionally we add relative + # paths if the Makefile sets LD_RUNPATH_EXTRAS to those relative paths. + # The environment variable LD_LIBRARY_PATH will over-ride these runpaths. + # Try: 'dump -Lv lib*.so' to see these settings in a library. + # + LDFLAGS_COMMON += -R\$$ORIGIN + LDFLAGS_COMMON += $(LD_RUNPATH_EXTRAS:%=-R\$$ORIGIN/%) +endif + +EXTRA_LIBS += -lc + +# Postprocessing is done on the images directories only +# +ifeq ($(VARIANT), OPT) + ifeq ($(PARTIAL_GPROF), true) + NO_STRIP = true + endif + ifeq ($(GPROF), true) + NO_STRIP = true + endif + ifneq ($(NO_STRIP), true) + # Debug 'strip -x' leaves local function Elf symbols (better stack traces) + POST_STRIP_PROCESS = $(STRIP) -x + endif +endif +POST_MCS_PROCESS=$(MCS) -d -a "JDK $(FULL_VERSION)" + +# +# Sun C compiler will take -M and pass it on to ld. +# Usage: ld $(LD_MAPFILE_FLAG) mapfile *.o +# +ifeq ($(CC_VERSION),gcc) +LD_MAPFILE_FLAG = -Xlinker -M -Xlinker +else +LD_MAPFILE_FLAG = -M +endif + +# +# Variables globally settable from the make command line (default +# values in brackets): +# GPROF (false) +# Eg: % gnumake GPROF=true +GPROF = false +ifeq ($(GPROF), true) + CFLAGS_COMMON += -DGPROF -xpg + EXTRA_LIBS += -xpg +endif + +# PARTIAL_GPROF is to be used ONLY during compilation - it should not +# appear during linking of libraries or programs. It also should +# prevent linking with -z defs to allow a symbol to remain undefined. +# +PARTIAL_GPROF = false +ifeq ($(PARTIAL_GPROF), true) + CFLAGS_GPROF += -xpg + LDFLAGS_DEFS_OPTION = -z nodefs +endif + +# +# For a TCOV build we add in the TCOV_OPTION +# +ifdef TCOV_BUILD + TCOV_OPTION = -xprofile=tcov + LDFLAGS_COMMON += $(TCOV_OPTION) -Kpic + CFLAGS_COMMON += $(TCOV_OPTION) + CXXFLAGS_COMMON += $(TCOV_OPTION) + EXTRA_LIBS += $(TCOV_OPTION) + LDNOMAP=true +endif + +# +# Solaris only uses native threads. +# +THREADS_FLAG= native +THREADS_DIR= threads + +# +# Support for Quantify. +# +ifdef QUANTIFY + QUANTIFY_CMD = quantify + QUANTIFY_OPTIONS = -cache-dir=/tmp/quantify -always-use-cache-dir=yes + LINK_PRE_CMD = $(QUANTIFY_CMD) $(QUANTIFY_OPTIONS) + ifdef LIBRARY + CFLAGS_COMMON += -K PIC + endif +endif + +# +# Support for Purify. +# +ifdef PURIFY + PURIFY_CMD = /net/suntools.eng/export/tools/sparc/bin/purify + PURIFY_OPTIONS = -cache-dir=/tmp/quantify -always-use-cache-dir=yes + LINK_PRE_CMD = $(PURIFY_CMD) $(PURIFY_OPTIONS) + ifdef LIBRARY + CFLAGS_COMMON += -K PIC + endif +endif + +# +# Different "levels" of optimization. +# +ifeq ($(CC_VERSION),gcc) + + CC_OPT/NONE = + CC_OPT/LOWER = -O2 + CC_OPT/HIGHER = -O3 + CC_OPT/HIGHEST = -O3 + + CXX_OPT/NONE = + CXX_OPT/LOWER = -O2 + CXX_OPT/HIGHER = -O3 + CXX_OPT/HIGHEST = -O3 + + CFLAGS_REQUIRED_i586 += -fno-omit-frame-pointer + CFLAGS_REQUIRED_amd64 += -fno-omit-frame-pointer + + # Automatic precompiled header option to use (if COMPILE_APPROACH=batch) + # (See Rules.gmk) May need to wait for gcc 5? + AUTOMATIC_PCH_OPTION = + +else + + # Highest could be -xO5, but indications are that -xO5 should be reserved + # for a per-file use, on sources with known performance impacts. + OPT_LEVEL/LOWER = 2 + OPT_LEVEL/HIGHER = 4 + OPT_LEVEL/HIGHEST = 4 + + CC_OPT/NONE = + CC_OPT/LOWER = $(OPT_LEVEL/LOWER:%=-xO%) + CC_OPT/HIGHER = $(OPT_LEVEL/HIGHER:%=-xO%) + CC_OPT/HIGHEST = $(OPT_LEVEL/HIGHEST:%=-xO%) + + CXX_OPT/NONE = + CXX_OPT/LOWER = $(OPT_LEVEL/LOWER:%=-xO%) + CXX_OPT/HIGHER = $(OPT_LEVEL/HIGHER:%=-xO%) + CXX_OPT/HIGHEST = $(OPT_LEVEL/HIGHEST:%=-xO%) + + # We need stack frames at all times + USE_XKEEPFRAME_OPTION = false + ifeq ($(USE_XKEEPFRAME_OPTION),true) + + # Unknown spelling on this option at this time (Maybe in SS13?) + CC_XKEEPFRAME_OPTIONS = -xkeepframe + CXX_XKEEPFRAME_OPTIONS = -xkeepframe + + else + + # On X86, make sure tail call optimization is off + # The z and y are the tail call optimizations. + ifeq ($(ARCH_FAMILY), i586) + CC_NEWER_THAN_58 := \ + $(shell $(EXPR) $(CC_MAJORVER) \> 5 \| \ + \( $(CC_MAJORVER) = 5 \& $(CC_MINORVER) \> 8 \) ) + ifeq ($(CC_NEWER_THAN_58),1) + # Somehow, tail call optimization is creeping in. + # Make sure it is off. + # WARNING: These may cause compiler warnings about duplicate -O options + CC_XKEEPFRAME_OPTIONS += -Wu,-O$(OPT_LEVEL/$(OPTIMIZATION_LEVEL))~yz + CXX_XKEEPFRAME_OPTIONS += -Qoption ube -O$(OPT_LEVEL/$(OPTIMIZATION_LEVEL))~yz + endif + endif + + # On i586 we need to tell the code generator to ALWAYS use a + # frame pointer. + ifeq ($(ARCH_FAMILY), i586) + # Note that in 5.7, this is done with -xregs=no%frameptr + ifeq ($(CC_VER), 5.5) + # It's not exactly clear when this optimization kicks in, the + # current assumption is -xO4 or greater and for C++ with + # the -features=no%except option and -xO4 and greater. + # Bottom line is, we ALWAYS want a frame pointer! + CC_XKEEPFRAME_OPTIONS += -Wu,-Z~B + CXX_XKEEPFRAME_OPTIONS += -Qoption ube -Z~B + endif + + CC_NEWER_THAN_56 := \ + $(shell $(EXPR) $(CC_MAJORVER) \> 5 \| \ + \( $(CC_MAJORVER) = 5 \& $(CC_MINORVER) \> 6 \) ) + ifeq ($(CC_NEWER_THAN_56),1) + # Do NOT use frame pointer register as a general purpose opt register + CC_OPT/NONE += -xregs=no%frameptr + CXX_OPT/NONE += -xregs=no%frameptr + CC_XKEEPFRAME_OPTIONS += -xregs=no%frameptr + CXX_XKEEPFRAME_OPTIONS += -xregs=no%frameptr + endif + endif + + # Optimizer for sparc needs to be told not to do certain things + # related to frames or save instructions. + ifeq ($(ARCH_FAMILY), sparc) + # Do not use save instructions instead of add instructions + # This was an optimization starting in SC5.0 that made it hard for us to + # find the "save" instruction (which got turned into an "add") + CC_XKEEPFRAME_OPTIONS += -Wc,-Qrm-s + CXX_XKEEPFRAME_OPTIONS += -Qoption cg -Qrm-s + # Don't allow tail call code optimization. Started in SC5.0. + # We don't like code of this form: + # save + # <code> + # call foo + # restore + # because we can't tell if the method will have a stack frame + # and register windows or not. + CC_XKEEPFRAME_OPTIONS += -Wc,-Qiselect-T0 + CXX_XKEEPFRAME_OPTIONS += -Qoption cg -Qiselect-T0 + endif + + endif + + # Extra options used with HIGHEST + # + # WARNING: Use of OPTIMIZATION_LEVEL=HIGHEST in your Makefile needs to be + # done with care, there are some assumptions below that need to + # be understood about the use of pointers, and IEEE behavior. + # + # Use non-standard floating point mode (not IEEE 754) + CC_HIGHEST_EXTRAS += -fns + # Do some simplification of floating point arithmetic (not IEEE 754) + CC_HIGHEST_EXTRAS += -fsimple + # Use single precision floating point with 'float' + CC_HIGHEST_EXTRAS += -fsingle + # Assume memory references via basic pointer types do not alias + # (Source with excessing pointer casting and data access with mixed + # pointer types are not recommended) + CC_HIGHEST_EXTRAS += -xalias_level=basic + # Use intrinsic or inline versions for math/std functions + # (If you expect perfect errno behavior, do not use this) + CC_HIGHEST_EXTRAS += -xbuiltin=%all + # Loop data dependency optimizations (need -xO3 or higher) + CC_HIGHEST_EXTRAS += -xdepend + # Pointer parameters to functions do not overlap + # (Similar to -xalias_level=basic usage, but less obvious sometimes. + # If you pass in multiple pointers to the same data, do not use this) + CC_HIGHEST_EXTRAS += -xrestrict + # Inline some library routines + # (If you expect perfect errno behavior, do not use this) + CC_HIGHEST_EXTRAS += -xlibmil + # Use optimized math routines + # (If you expect perfect errno behavior, do not use this) + # Can cause undefined external on Solaris 8 X86 on __sincos, removing for now + # CC_HIGHEST_EXTRAS += -xlibmopt + ifeq ($(ARCH_FAMILY), sparc) + # Assume at most 8byte alignment, raise SIGBUS on error + ### Presents an ABI issue with customer JNI libs? + ####CC_HIGHEST_EXTRAS += -xmemalign=8s + # Automatic prefetch instructions, explicit prefetch macros + CC_HIGHEST_EXTRAS += -xprefetch=auto,explicit + # Pick ultra as the chip to optimize to + CC_HIGHEST_EXTRAS += -xchip=ultra + endif + ifeq ($(ARCH), i586) + # Pick pentium as the chip to optimize to + CC_HIGHEST_EXTRAS += -xchip=pentium + endif + ifdef LIBRARY + # The Solaris CBE (Common Build Environment) requires that the use + # of appl registers be disabled when compiling a public library (or + # a library that's loaded by a public library) on sparc. + CFLAGS_REQUIRED_sparc += -xregs=no%appl + CFLAGS_REQUIRED_sparcv9 += -xregs=no%appl + endif + CC_NEWER_THAN_56 := \ + $(shell $(EXPR) $(CC_MAJORVER) \> 5 \| \ + \( $(CC_MAJORVER) = 5 \& $(CC_MINORVER) \> 6 \) ) + ifeq ($(CC_NEWER_THAN_56),1) + # Presents an ABI issue with customer JNI libs? We must be able to + # to handle 4byte aligned objects? (rare occurance, but possible?) + CFLAGS_REQUIRED_sparc += -xmemalign=4s + endif + # Just incase someone trys to use the SOS9 compilers + ifeq ($(CC_VER), 5.6) + # We MUST allow data alignment of 4 for sparc (sparcv9 is ok at 8s) + CFLAGS_REQUIRED_sparc += -xmemalign=4s + endif + # Automatic precompiled header option to use (if COMPILE_APPROACH=batch) + # (See Rules.gmk) The SS11 -xpch=auto* options appear to be broken. + AUTOMATIC_PCH_OPTION = + + # Add in keep frame options + CC_OPT/LOWER += $(CC_XKEEPFRAME_OPTIONS) + CC_OPT/HIGHER += $(CC_XKEEPFRAME_OPTIONS) + CC_OPT/HIGHEST += $(CC_XKEEPFRAME_OPTIONS) + CXX_OPT/LOWER += $(CXX_XKEEPFRAME_OPTIONS) + CXX_OPT/HIGHER += $(CXX_XKEEPFRAME_OPTIONS) + CXX_OPT/HIGHEST += $(CXX_XKEEPFRAME_OPTIONS) + + # Add in highest optimization settings + CC_OPT/HIGHEST += $(CC_HIGHEST_EXTRAS) + CXX_OPT/HIGHEST += $(CC_HIGHEST_EXTRAS) + +endif + +# Default optimization settings based on level. +CC_OPT = $(CC_OPT/$(OPTIMIZATION_LEVEL)) +CXX_OPT = $(CXX_OPT/$(OPTIMIZATION_LEVEL)) + +# Flags required all the time +CFLAGS_REQUIRED = $(CFLAGS_REQUIRED_$(ARCH)) + +# +# Path and option to link against the VM, if you have to. Note that +# there are libraries that link against only -ljava, but they do get +# -L to the -ljvm, this is because -ljava depends on -ljvm, whereas +# the library itself should not. +# +VM_NAME = server +JVMLIB = -L$(LIBDIR)/$(LIBARCH)/server -L$(LIBDIR)/$(LIBARCH)/client -ljvm +JAVALIB = -ljava $(JVMLIB) + +# Part of INCREMENTAL_BUILD mechanism. +# Compiler emits things like: path/file.o: file.h +# We want something like: relative_path/file.o relative_path/file.d: file.h +# In addition on Solaris, any include file starting with / is deleted, +# this gets rid of things like /usr/include files, which never change. +CC_DEPEND = -xM1 +CC_DEPEND_FILTER = $(SED) -e '/:[ ]*[/]/d' -e 's!$*\.$(OBJECT_SUFFIX)!$(dir $@)& $(dir $@)$*.$(DEPEND_SUFFIX)!g' | $(SORT) -u + +# Location of openwin libraries (do we really need this anymore?) +OPENWIN_HOME = /usr/openwin +OPENWIN_LIB = $(OPENWIN_HOME)/lib$(ISA_DIR) + +# Runtime graphics library search paths... +OPENWIN_RUNTIME_LIB = /usr/openwin/lib$(ISA_DIR) +AWT_RUNPATH = -R/usr/dt/lib$(ISA_DIR) -R$(OPENWIN_RUNTIME_LIB) + +# C++ Runtime library (libCrun.so), use instead of -lCrun. +# Originally used instead of -lCrun to guarantee use of the system +# .so version and not the .a or .so that came with the compilers. +# With the newer compilers this could probably change back to -lCrun but +# in general this is ok to continue to do. +LIBCXX = /usr/lib$(ISA_DIR)/libCrun.so.1 + +# JDK now requires Solaris 10, so pick up libm.so.2 +LIBM = /usr/lib$(ISA_DIR)/libm.so.2 + +# Socket library +LIBSOCKET = -lsocket + +# Network Services library +LIBNSL = -lnsl + +# service configuration facility library +LIBSCF = -lscf + +# Dynamic Loading library +LIBDL = -ldl + +# GLOBAL_KPIC: If set means all libraries are PIC, position independent code +# EXCEPT for select compiles +# If a .o file is compiled non-PIC then it should be forced +# into the RW data segment with a mapfile option. This is done +# with object files which generated from .s files. +# The -ztext enforces that no relocations remain in the text segment +# so that it remains purely read-only for optimum system performance. +# Some libraries may use a smaller size (13bit -Kpic) on sparc instead of +# (32 bit -KPIC) and will override GLOBAL_KPIC appropriately. +# +PIC_CODE_LARGE = -KPIC +PIC_CODE_SMALL = -Kpic +ifndef TCOV_BUILD + GLOBAL_KPIC = $(PIC_CODE_LARGE) + CXXFLAGS_COMMON += $(GLOBAL_KPIC) + CFLAGS_COMMON += $(GLOBAL_KPIC) + LDFLAGS_COMMON += -ztext +endif # TCOV_BUILD + +# If your platform has DPS, it will have Type1 fonts too, in which case +# it is best to enable DPS support until such time as 2D's rasteriser +# can fully handle Type1 fonts in all cases. Default is "yes". +# HAVE_DPS should only be "no" if the platform has no DPS headers or libs +# DPS (Displayable PostScript) is available on Solaris machines + +HAVE_DPS = yes + +# +# Japanese manpages +# +JA_SOURCE_ENCODING = eucJP +JA_TARGET_ENCODINGS = eucJP UTF-8 PCK + +# Settings for the JDI - Serviceability Agent binding. +HOTSPOT_SALIB_PATH = $(HOTSPOT_IMPORT_PATH)/jre/lib/$(LIBARCH) +SALIB_NAME = $(LIB_PREFIX)saproc.$(LIBRARY_SUFFIX) +SA_DEBUGINFO_NAME = $(LIB_PREFIX)saproc.debuginfo +INCLUDE_SA=true +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jdk/makefiles/common/Defs-windows.gmk Wed Apr 11 14:09:48 2012 -0700 @@ -0,0 +1,418 @@ +# +# Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# + +# +# Makefile to specify compiler flags for programs and libraries +# targeted to Windows builds. Should not contain any rules. +# +# WARNING: This file is shared with other workspaces. +# So when it includes other files, it must use JDK_TOPDIR. +# + +# Get shared JDK settings +include $(JDK_MAKE_SHARED_DIR)/Defs.gmk + +# CC compiler object code output directive flag value +CC_OBJECT_OUTPUT_FLAG = -Fo + +# The suffix applied to the library name for FDLIBM +FDDLIBM_SUFFIX = lib +# The suffix applied to scripts (.bat for windows, nothing for unix) +SCRIPT_SUFFIX = .bat + +# LIB_LOCATION, which for windows identifies where .exe files go, may be +# set by each GNUmakefile. The default is BINDIR. +ifndef LIB_LOCATION + LIB_LOCATION = $(BINDIR) +endif # LIB_LOCATION + +ifndef PLATFORM_SRC + PLATFORM_SRC = $(BUILDDIR)/../src/windows +endif # PLATFORM_SRC + +# Platform specific closed sources +ifndef OPENJDK + ifndef CLOSED_PLATFORM_SRC + CLOSED_PLATFORM_SRC = $(BUILDDIR)/../src/closed/windows + endif +endif + +# for backwards compatability, the old "win32" is used here instead of +# the more proper "windows" +PLATFORM_INCLUDE_NAME = win32 +PLATFORM_INCLUDE = $(INCLUDEDIR)/$(PLATFORM_INCLUDE_NAME) + +# The following DLL's are considered MS runtime libraries and should +# not to be REBASEd, see deploy/make/common/Release.gmk. +# msvcr*.dll: Microsoft runtimes +ifeq ($(COMPILER_VERSION), VS2010) + MSVCRNN_DLL = msvcr100.dll + MSVCPNN_DLL = msvcp100.dll +endif + +EXTRA_LFLAGS += /LIBPATH:$(DXSDK_LIB_PATH) + +# C Compiler flag definitions + +# +# Default optimization +# + +ifndef OPTIMIZATION_LEVEL + ifeq ($(PRODUCT), java) + OPTIMIZATION_LEVEL = HIGHER + else + OPTIMIZATION_LEVEL = LOWER + endif +endif +ifndef FASTDEBUG_OPTIMIZATION_LEVEL + FASTDEBUG_OPTIMIZATION_LEVEL = LOWER +endif + +ifeq ($(CC_VERSION),msvc) + # Visual Studio compiler option definitions: + # -O1 Favors reduced size over speed (-Og -Os -Oy -Ob2 -Gs -GF -Gy) + # -O2 Favors speed over reduced size (-Og -Oi -Ot -Oy -Ob2 -Gs -GF -Gy) + # -Ob2 More aggressive inlining + # -Og Global optimizations + # -Oi Replace some functions with intrinsic or special forms + # -fp:precise (should be the default) + # Improve floating point calculations (disables some optimizations) + # -Os Favor small code + # -Ot Favor faster code + # -Oy Frame pointer omission + # -G6 Used to be -GB? + # -GF Pool strings in read-only memory + # -Gf Pool strings in read-write memory (the default) + # -Gs Controls stack probess + # -GS Adds buffer overflow checks on stacks (the default) + # -EHsc Enables exception handling + # -Gy Function level linking only + # + + CC_OPT/NONE = -Od + CC_OPT/LOWER = -O2 + CC_OPT/HIGHER = -O3 + CC_OPT/HIGHEST = -O3 + + ifeq ($(COMPILER_VERSION), VS2010) + # Automatic precompiled header option to use (if COMPILE_APPROACH=batch) + AUTOMATIC_PCH_OPTION = + GX_OPTION = -EHsc + GZ_OPTION = -RTC1 + ifeq ($(ARCH_DATA_MODEL), 32) + CC_OPT/HIGHEST = -O2 + CC_OPT/HIGHER = -O1 + CC_OPT/LOWER = -O1 + else + CC_OPT/HIGHEST = -O2 + CC_OPT/HIGHER = -O1 + CC_OPT/LOWER = -O1 + endif + endif + +else # CC_VERSION + # GCC not supported, but left for historical reference... + CC_OPT/NONE = + CC_OPT/LOWER = -O2 + CC_OPT/HIGHER = -O2 + CC_OPT/HIGHEST = -O3 + +endif + +CC_OPT = $(CC_OPT/$(OPTIMIZATION_LEVEL)) + +# Select the runtime support library carefully, need to be consistent +# +# Visual Studio Runtime compiler option definitions: +# -MD Use dynamic multi-threaded runtime library +# -MDd Use debug version (don't use, doesn't mix with -MD DLL's) +# -MT Use static multi-threaded runtime library (-ML is going away) +# -MTd Use static debug version (better than -MDd, no runtime issues) +# -D_DEBUG Change use of malloc/free/etc to use special debug ones (-MTd) +# +# NOTE: We also will use /D _STATIC_CPPLIB so we don't need msvcpnn.dll +# +# If MS_RUNTIME_STATIC is requested we may have a problem, it is no longer +# supported by VS2010 +ifneq ($(MS_RUNTIME_STATIC),true) + MS_RUNTIME_OPTION=-MD +endif +# The _DEBUG macro option (changes things like malloc to use debug version) +MS_RUNTIME_DEBUG_OPTION= +MS_RC_DEBUG_OPTION= +# Externally set environment variable can force any build to use the debug vers +ifeq ($(MFC_DEBUG), true) + ifeq ($(MS_RUNTIME_STATIC),true) + MS_RUNTIME_OPTION=-MTd + else + # This MS debugging flag forces a dependence on the debug + # version of the runtime library (MSVCR*D.DLL), as does -MDd. + # We cannot re-distribute this debug runtime. + MS_RUNTIME_OPTION=-MDd + endif + MS_RUNTIME_DEBUG_OPTION= -D_DEBUG + MS_RC_DEBUG_OPTION= -d _DEBUG +endif + +# Always add _STATIC_CPPLIB definition +STATIC_CPPLIB_OPTION = /D _STATIC_CPPLIB + +# Silence the warning about using _STATIC_CPPLIB +ifneq ($(SHOW_ALL_WARNINGS),true) + # Needed with VS2010 to turn off the deprecated warning. + STATIC_CPPLIB_OPTION += /D _DISABLE_DEPRECATE_STATIC_CPPLIB +endif + +MS_RUNTIME_OPTION += $(STATIC_CPPLIB_OPTION) + +ifeq ($(CC_VERSION),msvc) + # Visual Studio compiler option definitions: + # -Zi Cause *.pdb file to be created, full debug information + # -Z7 Full debug inside the .obj, no .pdb + # -Zd Basic debug, no local variables? In the .obj + # -Zl Don't add runtime library name to obj file? + # -Od Turns off optimization and speeds compilation + # -YX -Fp/.../foobar.pch Use precompiled headers (try someday?) + # -nologo Don't print out startup message + # /D _STATIC_CPPLIB + # Use static link for the C++ runtime (so msvcpnn.dll not needed) + # + CFLAGS_COMMON += -Zi -nologo + CFLAGS_OPT = $(CC_OPT) + CFLAGS_DBG = -Od $(MS_RUNTIME_DEBUG_OPTION) + + CFLAGS_VS2010 += -Zc:wchar_t- + + # All builds get the same runtime setting + CFLAGS_COMMON += $(MS_RUNTIME_OPTION) $(CFLAGS_$(COMPILER_VERSION)) + + LDEBUG = /debug + + ifeq ($(VTUNE_SUPPORT), true) + OTHER_CFLAGS = -Z7 -Ox + LDEBUG += /pdb:NONE + endif + + # VS2010, always need safe exception handlers, not needed on 64bit + ifeq ($(ARCH_DATA_MODEL), 32) + LFLAGS_VS2010 += -SAFESEH + endif + + # LFLAGS are the flags given to $(LINK) and used to build the actual DLL file + BASELFLAGS = -nologo /opt:REF /incremental:no + + LFLAGS = $(BASELFLAGS) $(LDEBUG) $(EXTRA_LFLAGS) $(LFLAGS_$(COMPILER_VERSION)) + LDDFLAGS += $(LFLAGS_$(COMPILER_VERSION)) + +endif + +# +# Preprocessor macro definitions +# +CPPFLAGS_COMMON = -DWIN32 -DIAL -D_LITTLE_ENDIAN +ifeq ($(ARCH), amd64) + CPPFLAGS_COMMON += -D_AMD64_ -Damd64 +else + CPPFLAGS_COMMON += -D_X86_ -Dx86 +endif +CPPFLAGS_COMMON += -DWIN32_LEAN_AND_MEAN + +# +# Output options (use specific filenames to avoid parallel compile errors) +# +CFLAGS_COMMON += -Fd$(OBJDIR)/$(basename $(@F)).pdb -Fm$(OBJDIR)/$(basename $(@F)).map + +# +# Use -wdNNNN to disable warning NNNN. +# C4800 is a warning about bool performance casts (can't make go away) +# +COMPILER_WARNINGS_TO_IGNORE = 4800 +CFLAGS_COMMON += $(COMPILER_WARNINGS_TO_IGNORE:%=-wd%) + +# +# Treat compiler warnings as errors, if requested +# +CFLAGS_COMMON += -W$(COMPILER_WARNING_LEVEL) +ifeq ($(COMPILER_WARNINGS_FATAL),true) + CFLAGS_COMMON += -WX +endif + +# Turn off some warnings by default, enable them all if asked. +ifneq ($(SHOW_ALL_WARNINGS),true) + # The -D _CRT_SECURE_NO_DEPRECATE turns off security/deprecated warnings on + # the standard C library functions like strcpy. + CFLAGS_COMMON += -D _CRT_SECURE_NO_DEPRECATE + # The -D _CRT_NONSTDC_NO_DEPRECATE turns off deprecation warnings about using + # non-standard C POSIX functions. + CFLAGS_COMMON += -D _CRT_NONSTDC_NO_DEPRECATE +endif + +CPPFLAGS_OPT = -DNDEBUG +CPPFLAGS_DBG = -DDEBUG -DLOGGING + +CXXFLAGS_COMMON = $(CFLAGS_COMMON) +CXXFLAGS_OPT = $(CFLAGS_OPT) +CXXFLAGS_DBG = $(CFLAGS_DBG) + +ifneq ($(LIBRARY),fdlibm) + EXTRA_LIBS += advapi32.lib +endif + +# +# Path and option to link against the VM, if you have to. +# +JVMLIB = $(LIBDIR)/jvm.lib +JAVALIB = $(LIBDIR)/java.lib + +ifeq ($(CC_VERSION), msvc) + CC_DEPEND = -FD + CC_DEPEND_FILTER = +else # CC_VERSION +# not supported, but left for historical reference... + CC_DEPEND = -MM + CC_DEPEND_FILTER = $(SED) -e 's!$*\.$(OBJECT_SUFFIX)!$(dir $@)&!g' +endif # CC_VERSION + +LIBRARY_SUFFIX = dll +LIB_SUFFIX = lib + +# Settings for the JDI - Serviceability Agent binding. +HOTSPOT_SALIB_PATH = $(HOTSPOT_IMPORT_PATH)/jre/bin +SALIB_NAME = $(LIB_PREFIX)sawindbg.$(LIBRARY_SUFFIX) +SAMAP_NAME = $(LIB_PREFIX)sawindbg.map +SAPDB_NAME = $(LIB_PREFIX)sawindbg.pdb + +ifeq ($(ARCH), ia64) + # SA will never be supported here. + INCLUDE_SA = false +else + INCLUDE_SA = true +endif + +# Settings for the VERSIONINFO tap on windows. +VERSIONINFO_RESOURCE = $(BUILDDIR)/../src/windows/resource/version.rc + +ifneq ($(JDK_BUILD_NUMBER),) + COOKED_BUILD_NUMBER = $(shell $(ECHO) $(JDK_BUILD_NUMBER) | $(SED) -e 's/^b//' -e 's/^0//') +else + COOKED_BUILD_NUMBER = 0 +endif + +# If the update version contains non-numeric characters, we need +# to massage it into a numeric format. +# We use the following formula: +# JDK_UPDATE_VER = JDK_UPDATE_VERSION * 10 + EXCEPTION_VERSION +# +# Here are some examples: +# 1.5.0 b01 -> 5,0,0,1 +# 1.5.0_10 b01 -> 5,0,100,1 +# 1.4.2 b01 -> 4,2,0,1 +# 1.4.2_02 b01 -> 4,2,20,1 +# 1.4.2_02a b01 -> 4,2,21,1 +# 1.4.2_02b b01 -> 4,2,22,1 +ifdef JDK_UPDATE_VERSION + VTMP := $(shell $(ECHO) $(JDK_UPDATE_VERSION) | $(TR) "abcde" "12345") + CAB_CHAR1 := $(shell $(ECHO) $(VTMP) | $(NAWK) '{print substr($$1, 1, 1);}') + CAB_CHAR2 := $(shell $(ECHO) $(VTMP) | $(NAWK) '{print substr($$1, 2, 1);}') + CAB_CHAR3 := $(shell $(ECHO) $(VTMP) | $(NAWK) '{print substr($$1, 3, 1);}') + JDK_UPDATE_META_TAG := U$(MARKETING_NUMBER) + ifeq ($(CAB_CHAR3),) + CAB_CHAR3 := 0 + endif + ifeq ($(CAB_CHAR1), 0) + JDK_UPDATE_VER := $(CAB_CHAR2)$(CAB_CHAR3) + else + JDK_UPDATE_VER := $(CAB_CHAR1)$(CAB_CHAR2)$(CAB_CHAR3) + endif +else + JDK_UPDATE_VER := 0 +endif + +#RC_FLAGS = /l 0x409 /r + +#ifeq ($(VARIANT), OPT) +# RC_FLAGS += -d NDEBUG +#else +# RC_FLAGS += $(MS_RC_DEBUG_OPTION) +#endif + +# Values for the RC variables defined in RC_FLAGS +#JDK_RC_BUILD_ID = $(FULL_VERSION) +#JDK_RC_COMPANY = $(COMPANY_NAME) +#JDK_RC_COMPONENT = $(PRODUCT_NAME) $(JDK_RC_PLATFORM_NAME) binary +#JDK_RC_VER = \ +# $(JDK_MINOR_VERSION).$(JDK_MICRO_VERSION).$(JDK_UPDATE_VER).$(COOKED_BUILD_NUMBER) +#JDK_RC_COPYRIGHT = Copyright \xA9 $(COPYRIGHT_YEAR) +#JDK_RC_NAME = \ +# $(PRODUCT_NAME) $(JDK_RC_PLATFORM_NAME) $(JDK_MINOR_VERSION) $(JDK_UPDATE_META_TAG) +#JDK_RC_FVER = \ +# $(JDK_MINOR_VERSION),$(JDK_MICRO_VERSION),$(JDK_UPDATE_VER),$(COOKED_BUILD_NUMBER) + +# JDK name required here +#RC_FLAGS += -d "JDK_BUILD_ID=$(JDK_RC_BUILD_ID)" \ +# -d "JDK_COMPANY=$(JDK_RC_COMPANY)" \ +# -d "JDK_COMPONENT=$(JDK_RC_COMPONENT)" \ +# -d "JDK_VER=$(JDK_RC_VER)" \ +# -d "JDK_COPYRIGHT=$(JDK_RC_COPYRIGHT)" \ +# -d "JDK_NAME=$(JDK_RC_NAME)" \ +# -d "JDK_FVER=$(JDK_RC_FVER)" + +# Enable 7-Zip LZMA file (de)compression for Java Kernel if it is available +ifeq ($(ARCH_DATA_MODEL), 32) + ifneq ($(KERNEL), off) + # This is a hack to use until 7-Zip (and UPX) bundles can be put + # under /java/devtools. + ifndef DEPLOY_TOPDIR + DEPLOY_TOPDIR=$(JDK_TOPDIR)/../deploy + endif + # Uncomment this block to cause build failure if above assumption false + #DCHK = $(shell if [ ! -d $(DEPLOY_TOPDIR) ] ; then \ + # $(ECHO) deploy_not_a_peer_of_j2se ; \ + #fi ) + #ifeq ($(DCHK), deploy_not_a_peer_of_j2se) + # If a build failure points to control coming here it means + # it means deploy is not in the same directory + # as j2se. Java Kernel can't tolerate that for the time being. + #endif + EC_TMP = $(shell if [ -d $(DEPLOY_TOPDIR)/make/lzma ] ; then \ + $(ECHO) true ; \ + else \ + $(ECHO) false ; \ + fi ) + ifeq ($(EC_TMP), true) + EXTRA_COMP_INSTALL_PATH = lib\\\\deploy\\\\lzma.dll + # Crazy but true: deploy/make/plugin/jinstall/Makefile.jkernel does + # not include deploy/make/common/Defs-windows.gmk, either directly + # or indirectly. But it does include this file, so redundantly declare + # these variables that are in deploy/make/common/Defs-windows.gmk for + # the sake of the Java Kernel part of the deploy build. Whew! + EXTRA_COMP_LIB_NAME = lzma.dll + EXTRA_COMP_PATH = $(OUTPUTDIR)/tmp/deploy/lzma/win32/obj + EXTRA_COMP_CMD_PATH = $(EXTRA_COMP_PATH)/lzma.exe + EXTRA_COMP_LIB_PATH = $(EXTRA_COMP_PATH)/$(EXTRA_COMP_LIB_NAME) + endif + endif +endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jdk/makefiles/common/Defs.gmk Wed Apr 11 14:09:48 2012 -0700 @@ -0,0 +1,577 @@ +# +# Copyright (c) 1995, 2011, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# + +# +# Common variables used by all the Java makefiles. This file should +# not contain rules. +# + +# WARNING: This file is shared with other workspaces. +# So when it includes other files, it must use JDK_TOPDIR. +# + +# Check for strange explicit settings (change to empty or true) +ifdef OPENJDK + ifneq ($(OPENJDK),true) + x:=$(error "OPENJDK (if defined) can only be set to true") + endif +endif + +# +# On Solaris, the 'make' utility from Sun will not work with these makefiles. +# This little rule is only understood by Sun's make, and is harmless +# when seen by the GNU make tool. If using Sun's make, this causes the +# make command to fail. +# +SUN_MAKE_TEST:sh = echo "ERROR: PLEASE USE GNU VERSION OF MAKE"; exit 33 + +include $(SPEC) +include $(JDK_MAKE_SHARED_DIR)/Platform.gmk + +# Historically PLATFORM_SRC used to be src/$(PLATFORM), but we switched it to +# src/solaris so if you want to build on Linux you didn't need a src/linux +# directory. In an ideal world it would be called src/genunix but we are not +# there yet. +# +ifndef SHARE_SRC + SHARE_SRC = $(BUILDDIR)/../src/share +endif + +# Files that cannot be included in the OpenJDK distribution are +# collected under a parent directory which contains just those files. +ifndef CLOSED_SRC + CLOSED_SRC = $(BUILDDIR)/../src/closed +endif + +# If CLOSE_SRC_INCLUDED isn't set to true, check if there's any +# closed directory. +ifneq ($(CLOSED_SRC_INCLUDED), true) + CLOSED_SRC_INCLUDED := $(shell \ + if [ -d $(CLOSED_SRC) ] ; then \ + echo true; \ + else \ + echo false; \ + fi) +endif + +# Set OPENJDK based on CLOSED_SRC_INCLUDED +ifeq ($(CLOSED_SRC_INCLUDED), false) + OPENJDK = true +endif + +# Define where closed directories are +ifdef OPENJDK + CLOSED_SRC = + CLOSED_SHARE_SRC = +else + ifndef CLOSED_SHARE_SRC + CLOSED_SHARE_SRC = $(CLOSED_SRC)/share + endif +endif + +# +# Get platform definitions +# + +include $(JDK_TOPDIR)/makefiles/common/Defs-$(PLATFORM).gmk + +# +# SE-Embedded support, if enabled +# + +include $(JDK_TOPDIR)/makefiles/common/Defs-embedded.gmk + +# +# Cross-compilation Settings +# +ifdef CROSS_COMPILE_ARCH + # Can't run the tools we just built + USE_ONLY_BOOTDIR_TOOLS = true + + # When cross-compiling CC generates code for the target, but + # some parts of the build generate C code that has to be compiled + # and executed on the build host - HOST_CC is the 'local' compiler. + # For linux the default is /usr/bin/gcc; other platforms need to + # set it explicitly + ifeq ($(PLATFORM), linux) + ifndef HOST_CC + HOST_CC = $(USRBIN_PATH)gcc + endif + endif +else + # Must set HOST_CC if not already set + ifndef HOST_CC + HOST_CC = $(CC) + endif +endif + +# Reset the VM name for client-only builds +ifeq ($(JVM_VARIANT),client) + VM_NAME = client +endif + +# +# Freetype logic is applicable to OpenJDK only +# +ifdef OPENJDK + +ifeq ($(PLATFORM), windows) + DEVTOOLS_FT_DIR=$(JDK_DEVTOOLS_DIR)/win32/freetype-$(ARCH) +endif +ifeq ($(PLATFORM), linux) + DEVTOOLS_FT_DIR=$(JDK_DEVTOOLS_DIR)/$(PLATFORM)/freetype-$(ARCH) +endif +ifeq ($(PLATFORM), solaris) + # historically for Solaris we have slightly different devtools + # naming conventions + DEVTOOLS_FT_DIR=$(JDK_DEVTOOLS_DIR)/$(ARCH_FAMILY)/freetype-$(ARCH) +endif + +DEVTOOLS_FT_DIR_EXISTS = $(shell \ + if [ -f $(DEVTOOLS_FT_DIR)/include/ft2build.h ] ; then \ + echo true; \ + else \ + echo false; \ + fi) + + ifdef ALT_FREETYPE_LIB_PATH + FREETYPE_LIB_PATH = $(ALT_FREETYPE_LIB_PATH) + ifeq ($(PLATFORM), macosx) + USING_SYSTEM_FT_LIB=true + endif + else + ifeq ($(DEVTOOLS_FT_DIR_EXISTS), true) + FREETYPE_LIB_PATH = $(DEVTOOLS_FT_DIR)/lib + else + ifeq ($(PLATFORM), macosx) + FREETYPE_LIB_PATH = /usr/X11R6/lib + else + FREETYPE_LIB_PATH = /usr/lib + endif + USING_SYSTEM_FT_LIB=true + endif + endif + + ifdef ALT_FREETYPE_HEADERS_PATH + FREETYPE_HEADERS_PATH = $(ALT_FREETYPE_HEADERS_PATH) + else + ifeq ($(DEVTOOLS_FT_DIR_EXISTS), true) + FREETYPE_HEADERS_PATH = $(DEVTOOLS_FT_DIR)/include + else + ifeq ($(PLATFORM), macosx) + FREETYPE_HEADERS_PATH = /usr/X11R6/include + else + FREETYPE_HEADERS_PATH = /usr/include + endif + endif + endif +endif + +# +# zlib version +# +ZLIB_VERSION = 1.2.5 + + +# +# Localizations for the different parts of the product beyond English +# + +JRE_LOCALES = de es fr it ja ko pt_BR sv zh_CN zh_TW zh_HK +PLUGIN_LOCALES = de es fr it ja ko pt_BR sv zh_CN zh_TW zh_HK +JDK_LOCALES = ja zh_CN + +# +# A list of locales we support but don't have resource files. +# This is defined to optimize the search of resource bundles. +# +JRE_NONEXIST_LOCALES = en en_US de_DE es_ES fr_FR it_IT ja_JP ko_KR sv_SE zh + +# +# For now, most libraries except libjava and libjvm itself link against libjvm +# and libjava, the latter for its exported common utilities. libjava only +# links against libjvm. Programs' makefiles take their own responsibility for +# adding other libs. +# +# The makefiles for these packages do not link against libjvm and libjava. +# This list will eventually go away and each Programs' makefiles +# will have to explicitly declare that they want to link to libjava/libjvm +# +NO_JAVALIB_PKGS = \ + sun.security.mscapi \ + sun.security.krb5 \ + sun.security.pkcs11 \ + sun.security.jgss \ + sun.security.jgss.wrapper \ + sun.security.ec \ + sun.security.smartcardio \ + com.sun.security.auth.module + +ifdef PACKAGE +# put JAVALIB first, but do not lose any platform specific values.... + ifeq (,$(findstring $(PACKAGE),$(NO_JAVALIB_PKGS))) + LDLIBS_COMMON = $(JAVALIB) + endif +endif # PACKAGE + +# +# Libraries that must appear ahead of libc.so on the link command line +# +ifdef PROGRAM + + ifeq ($(PLATFORM), solaris) + LDLIBS_COMMON = -lthread -ldl + endif + + ifeq ($(PLATFORM), linux) + LDLIBS_COMMON = -ldl + endif + + ifeq ($(PLATFORM), macosx) + LDLIBS_COMMON = -pthread + endif + +endif # PROGRAM + +LDLIBS_COMMON += $(EXTRA_LIBS) + +# for generated binaries +BINDIR = $(OUTPUTDIR)/bin$(ISA_DIR) +# for generated libraries +LIBDIR = $(OUTPUTDIR)/lib +ABS_LIBDIR = $(ABS_OUTPUTDIR)/lib +# Optional place to save the windows .lib files +LIBFILES_DIR = $(OUTPUTDIR)/libfiles +# for ext jre files +EXTDIR = $(LIBDIR)/ext +# for generated include files +INCLUDEDIR = $(OUTPUTDIR)/include +# for generated class files +CLASSBINDIR = $(OUTPUTDIR)/classes +DEMOCLASSDIR = $(OUTPUTDIR)/democlasses +# for generated tool class files +BUILDTOOLCLASSDIR = $(OUTPUTDIR)/btclasses +# for build tool jar files +BUILDTOOLJARDIR = $(OUTPUTDIR)/btjars +ABS_BUILDTOOLJARDIR = $(ABS_OUTPUTDIR)/btjars +# for generated tool class files +BUILDTOOLBINDIR = $(OUTPUTDIR)/btbins +# for generated java source files +GENSRCDIR = $(OUTPUTDIR)/gensrc +# for generated C source files (not javah) +GENNATIVESRCDIR = $(OUTPUTDIR)/gennativesrc +# for imported source files +IMPORTSRCDIR = $(OUTPUTDIR)/impsrc +# for imported documents +IMPORTDOCDIR = $(OUTPUTDIR)/impdoc +# for generated demo +DEMODIR = $(OUTPUTDIR)/demo +NEWDEMODIR = $(OUTPUTDIR)/newdemo +# for sample code +SAMPLEDIR = $(OUTPUTDIR)/sample +# for generated documentation +DOCSDIR = $(OUTPUTDIR)/docs$(DOCSDIRSUFFIX) +DOCSDIRSUFFIX = + +# The MESSAGE, WARNING and ERROR files are used to store sanityck and +# warnings and errors. +ifndef ERROR_FILE + ERROR_FILE = $(OUTPUTDIR)/sanityCheckErrors.txt +endif +ifndef WARNING_FILE + WARNING_FILE = $(OUTPUTDIR)/sanityCheckWarnings.txt +endif +ifndef MESSAGE_FILE + MESSAGE_FILE = $(OUTPUTDIR)/sanityCheckMessages.txt +endif + +#where the demo source can be found +DEMOSRCDIR = $(SHARE_SRC)/demo + +#where the sample source can be found +SAMPLESRCDIR = $(SHARE_SRC)/sample + +# An attempt is made to generate unique enough directories for the +# generated files to not have name collisisons. Most build units +# defines PRODUCT (except Release.gmk), but then they may or may +# not define PACKAGE, PROGRAM, and LIBRARY. This code attempts to +# generate a unique OBJDIR/CLASSHDRDIR for each build unit based +# on which of those values are set within each build unit. + +UNIQUE_LOCATION_STRING = tmp + +ifneq ($(PRODUCT),) + UNIQUE_LOCATION_STRING += /$(PRODUCT) +endif + +ifneq ($(PACKAGE),) + UNIQUE_LOCATION_STRING += /$(PACKAGE) +endif + +ifneq ($(PROGRAM),) + UNIQUE_LOCATION_STRING += /$(PROGRAM) +endif + +ifneq ($(LIBRARY),) + ifneq ($(LIBRARY_OUTPUT),) + UNIQUE_LOCATION_STRING += /$(LIBRARY_OUTPUT) + else + UNIQUE_LOCATION_STRING += /$(LIBRARY) + endif +endif + +# the use of += above makes a space separated list which we need to +# remove for filespecs. +# +NULLSTRING := +ONESPACE := $(NULLSTRING) # space before this comment is required. +UNIQUE_PATH = $(subst $(ONESPACE),,$(UNIQUE_LOCATION_STRING)) + +# TEMPDIR is a unique general purpose directory +# need to use 'override' because GNU Make on Linux exports the wrong +# value. +TEMPDIR ?= $(OUTPUTDIR)/$(UNIQUE_PATH) +ABS_TEMPDIR ?= $(ABS_OUTPUTDIR)/$(UNIQUE_PATH) + +# This must be created right away for pattern rules in Sanity.gmk to work. +dummy1:=$(shell $(MKDIR) -p $(TEMPDIR)) +dummy2:=$(shell $(MKDIR) -p $(TEMP_DISK)) + +# OBJDIRNAME is the name of the directory where the object code is to +# be placed. It's name depends on whether the data model architecture +# is 32-bit or not. +ifneq ($(ARCH_DATA_MODEL), 32) + OBJDIRNAME = obj$(ARCH_DATA_MODEL)$(OBJDIRNAME_SUFFIX) +else + OBJDIRNAME = obj$(OBJDIRNAME_SUFFIX) +endif +OBJDIR = $(TEMPDIR)/$(OBJDIRNAME) + +# CLASSHDRDIR is where the generated C Class Header files go. +CLASSHDRDIR = $(TEMPDIR)/CClassHeaders + +# +# CLASSDESTDIR can be used to specify the directory where generated classes +# are to be placed. The default is CLASSBINDIR. +# +ifndef CLASSDESTDIR +CLASSDESTDIR = $(CLASSBINDIR) +endif + +INCLUDES = -I. -I$(CLASSHDRDIR) \ + $(patsubst %,-I%,$(subst $(CLASSPATH_SEPARATOR), ,$(VPATH.h))) $(OTHER_INCLUDES) +OTHER_CPPFLAGS += $(INCLUDES) + +# +# vpaths. These are the default locations searched for source files. +# GNUmakefiles of individual areas often override the default settings. +# There are no longer default vpath entries for C and assembler files +# so we can ensure that libraries don't get their hands on JVM files. +# +# We define an intermediate variable for Java files because +# we use its value later to help define $SOURCEPATH + +ifeq ($(PLATFORM), macosx) + VPATH0.java = $(subst $(ONESPACE),:,$(GENSRCDIR) $(call JavaSrcDirList,,classes)) +else + VPATH0.java = $(GENSRCDIR)$(CLASSPATH_SEPARATOR)$(PLATFORM_SRC)/classes$(CLASSPATH_SEPARATOR)$(SHARE_SRC)/classes +endif + +ifdef OPENJDK + VPATH.java = $(VPATH0.java) +else + # + # If filenames are duplicated between open/closed workspaces, prefer + # the closed files. + # + # Source ordering is important: some targets depend on closed files + # replacing open ones, and thus the closed file sources must be found + # before the open ones. + # + # Don't reorder without consulting the teams that depend on this behavior. + # + VPATH.java = $(CLOSED_PLATFORM_SRC)/classes$(CLASSPATH_SEPARATOR)$(CLOSED_SHARE_SRC)/classes$(CLASSPATH_SEPARATOR)$(VPATH0.java) +endif +vpath %.java $(VPATH.java) +vpath %.class $(CLASSBINDIR) +vpath %.$(OBJECT_SUFFIX) $(OBJDIR) + +# +# VPATH.h is used elsewhere to generate include flags. By default, +# anyone has access to the include files that the JVM area exports, +# namely jni.h, jvm.h, and jni_utils.h, plus their platform-specific +# relatives. +# +VPATH0.h = $(PLATFORM_SRC)/javavm/export$(CLASSPATH_SEPARATOR)$(SHARE_SRC)/javavm/export +ifdef OPENJDK + VPATH.h = $(VPATH0.h) +else + VPATH.h = $(CLOSED_SHARE_SRC)/javavm/export$(CLASSPATH_SEPARATOR)$(VPATH0.h) +endif +vpath %.h $(VPATH.h) + +# +# Used in two ways: helps link against libjava.so. Also if overridden +# determines where your shared library is installed. +# +ifndef LIB_LOCATION + LIB_LOCATION = $(LIBDIR)/$(LIBARCH) +endif + +# +# Java header and stub variables +# +CLASSHDRS = $(patsubst %,$(CLASSHDRDIR)/%.h,$(subst .,_,$(CLASSES.export))) +CLASSSTUBOBJS = classstubs.$(OBJECT_SUFFIX) +STUBPREAMBLE = $(INCLUDEDIR)/StubPreamble.h + +# +# Classpath seen by javac (different from the one seen by the VM +# running javac), and useful variables. +# +SOURCEPATH = $(VPATH.java) +PKG = $(shell $(EXPR) $(PACKAGE) : '\([a-z]*\)') +PKGDIR = $(subst .,/,$(PACKAGE)) + +# +# The java/javac/jdk variables (JAVAC_CMD, JAVA_CMD, etc.) +# +include $(JDK_MAKE_SHARED_DIR)/Defs-java.gmk + +UNIQUE_PATH_PATTERN = $(subst /,.,$(UNIQUE_PATH)) + +# Run MAKE $@ for a launcher: +# $(call make-launcher, name, mainclass, java-args, main-args) +define make-launcher +$(CD) $(BUILDDIR)/launchers && \ +$(MAKE) -f Makefile.launcher \ + PROGRAM=$(strip $1) \ + MAIN_CLASS=$(strip $2) \ + MAIN_JAVA_ARGS="$(strip $3)" \ + MAIN_ARGS="$(strip $4)" +endef + +# +# Convenient macros +# + +# Prepare $@ target, remove old one and making sure directory exists +define prep-target +mkdir -p $(@D) +rm -f $@ +endef + +# Simple install of $< file to $@ +define install-file +$(prep-target) +$(CP) $< $@ +endef + +define chmod-file +$(CHMOD) $1 $@ +endef + +define install-sym-link +$(LN) -s $1 $@ +endef + +define install-manifest-file +$(install-file) +endef + +# Cleanup rule for after debug java run (hotspot.log file is left around) +# (This could be an old leftover file in a read-only area, use the @- prefix) +HOTSPOT_LOG_NAME = hotspot.log +define java-vm-cleanup +if [ -w $(HOTSPOT_LOG_NAME) ] ; then rm -f $(HOTSPOT_LOG_NAME); fi +endef + +# Current directory +CURRENT_DIRECTORY := $(shell $(PWD)) + +# +# Create BYFILE OPT and DBG settings, if CFLAGS_OPT/foobar.o is set then it is +# used for this file, otherwise the default settings are used. +# +CFLAGS_$(VARIANT)/BYFILE = $(CFLAGS_$(VARIANT)/$(@F)) \ + $(CFLAGS_$(VARIANT)$(CFLAGS_$(VARIANT)/$(@F))) +CXXFLAGS_$(VARIANT)/BYFILE = $(CXXFLAGS_$(VARIANT)/$(@F)) \ + $(CXXFLAGS_$(VARIANT)$(CXXFLAGS_$(VARIANT)/$(@F))) + +# +# Tool flags +# +# EXTRA_CFLAGS are used to define cross-compilation options +# +ASFLAGS = $(ASFLAGS_$(VARIANT)) $(ASFLAGS_COMMON) $(OTHER_ASFLAGS) +CFLAGS = $(CFLAGS_$(VARIANT)/BYFILE) $(CFLAGS_COMMON) $(OTHER_CFLAGS) $(EXTRA_CFLAGS) +CXXFLAGS = $(CXXFLAGS_$(VARIANT)/BYFILE) $(CXXFLAGS_COMMON) $(OTHER_CXXFLAGS) $(EXTRA_CFLAGS) +CPPFLAGS = $(CPPFLAGS_$(VARIANT)) $(CPPFLAGS_COMMON) $(OTHER_CPPFLAGS) \ + $(DEFINES) $(OPTIONS:%=-D%) +LDFLAGS = $(LDFLAGS_$(VARIANT)) $(LDFLAGS_COMMON) $(OTHER_LDFLAGS) +LDLIBS = $(OTHER_LDLIBS) $(LDLIBS_$(VARIANT)) $(LDLIBS_COMMON) +LINTFLAGS = $(LINTFLAGS_$(VARIANT)) $(LINTFLAGS_COMMON) \ + $(OTHER_LINTFLAGS) + +VERSION_DEFINES = -DRELEASE='"$(RELEASE)"' + +ifdef INSANE + export INSANE +endif + +ifdef ALT_COPYRIGHT_YEAR + COPYRIGHT_YEAR = $(ALT_COPYRIGHT_YEAR) +else + COPYRIGHT_YEAR := $(shell $(DATE) '+%Y') +endif + +ifndef OPENJDK +include $(JDK_TOPDIR)/make/closed/common/Defs.gmk +endif + +# Install of imported file (JDK_IMPORT_PATH, or some other external location) +define install-importonly-file +@$(ECHO) "ASSEMBLY_IMPORT: $@" +$(prep-target) +$(CP) $< $@ +@if [ "$(PLATFORM)" = "linux" -a "$(@F)" = "libjvm.so" ] ; then \ + if [ -x /usr/sbin/selinuxenabled ] ; then \ + /usr/sbin/selinuxenabled; \ + if [ $$? = 0 ] ; then \ + $(ECHO) "/usr/bin/chcon -t textrel_shlib_t $@"; \ + /usr/bin/chcon -t textrel_shlib_t $@; \ + if [ $$? != 0 ]; then \ + echo "ERROR: Cannot chcon $@"; \ + fi; \ + fi; \ + fi; \ +fi +endef + +define install-import-file +$(install-importonly-file) +endef + +.PHONY: all build clean clobber
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jdk/makefiles/common/Demo.gmk Wed Apr 11 14:09:48 2012 -0700 @@ -0,0 +1,415 @@ +# +# Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# + +COMPILE.c = $(CC) $(CFLAGS) $(CPPFLAGS) -c +COMPILE.cc = $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c +LINK.c = $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) +LINK.cc = $(CXX) $(CXXFLAGS) $(CPPFLAGS) $(LDFLAGS) + +# JDK Demo building jar file. + +# Some names are defined with LIBRARY inside the Defs.gmk file +LIBRARY=$(DEMONAME) +OBJDIR=$(TEMPDIR)/$(DEMONAME) + +# Input: +# DEMONAME - name of the demo +# DEMO_ROOT - path to root of all demo files +# DEMO_DESTDIR - path to final demo destination directory +# +# Optional Input: +# DEMO_SRCDIR - path to source if different from DEMO_ROOT +# DEMO_PSRCDIR - path to additional platform specific source +# DEMO_PKGDIR - sub directory of sources we want +# DEMO_TOPFILES - names of top-level files relative to DEMO_ROOT +# DEMO_MAINCLASS - name of the main class for the jar manifest +# DEMO_NATIVECLASS - name of the class with native methods +# DEMO_DESCRIPTOR - name of service file for jar (relative to DEMO_SRCDIR) +# DEMO_EXTRA_SRCDIR - path to directory that holds extra sources to add +# DEMO_EXTRA_FILES - extra sources relative to DEMO_EXTRA_SRCDIR +# DEMO_OBJECTS - extra native object files needed +# DEMO_MANIFEST_ATTR - extra line to add to the jar manifest file + +# Assume the source directory is the root directory if not set +ifndef DEMO_SRCDIR + DEMO_SRCDIR = $(DEMO_ROOT) +endif +ifndef DEMO_PKGDIR + DEMO_PKGDIR = . +endif + +# Some demos have special needs +ifneq ($(DEMONAME),agent_util) + DEMO_NEEDS_AGENT_UTIL = $(findstring agent_util,$(DEMO_OBJECTS)) +endif +ifneq ($(DEMONAME),java_crw_demo) + DEMO_NEEDS_JAVA_CRW_DEMO = $(findstring java_crw_demo,$(DEMO_OBJECTS)) +endif +ifeq ($(DEMONAME),hprof) + DEMO_NEEDS_NPT = true +endif + +# Place to hold the build area (kind of a temp area) +DEMO_BUILD_AREA = $(DEMOCLASSDIR)/$(PRODUCT)/$(DEMONAME) + +# Destination "src" directory +DEMO_BUILD_SRCDIR = $(DEMO_BUILD_AREA)/src + +ifndef DEMO_SKIP_SRCZIP + DEMO_BUILD_SRCZIP = $(DEMO_BUILD_AREA)/src.zip + DEMO_SOURCE_ZIP = $(DEMO_DESTDIR)/src.zip +endif + +# Place to hold the jar image we are creating +DEMO_JAR_IMAGE = $(DEMO_BUILD_AREA)/jar_image + +# The jar manifest file we will create and use +DEMO_MANIFEST = $(DEMO_BUILD_AREA)/manifest.mf + +# The list of source files or options we will supply to javac +DEMO_JAVAC_INPUT = $(DEMO_BUILD_AREA)/javac_input.txt + +# Any name of javah file +DEMO_JAVAH_FILE = $(DEMO_NATIVECLASS:%=$(DEMO_BUILD_SRCDIR)/%.h) + +# Get complete list of files for this demo +ifdef DEMO_PSRCDIR + DEMO_ALL_FILES2 := $(shell ( $(CD) $(DEMO_PSRCDIR) \ + && $(FIND) $(DEMO_PKGDIR) $(SCM_DIRS_prune) -o -type f -print ) \ + | $(SED) 's@^\./@@' ) + DEMO_ALL_FILES += $(DEMO_ALL_FILES2) +endif +ifdef DEMO_EXTRA_SRCDIR + DEMO_ALL_FILES += $(DEMO_EXTRA_FILES) +endif +DEMO_ALL_FILES1 := $(shell ( $(CD) $(DEMO_SRCDIR) \ + && $(FIND) $(DEMO_PKGDIR) $(SCM_DIRS_prune) -o -type f -print ) \ + | $(SED) 's@^\./@@' ) +DEMO_ALL_FILES += $(DEMO_ALL_FILES1) + +# Just the java sources +DEMO_JAVA_SOURCES = $(filter %.java,$(DEMO_ALL_FILES)) + +# Just the C and C++ sources +DEMO_C_SRC_FILES = $(filter %.c,$(DEMO_ALL_FILES)) +DEMO_CPP_SRC_FILES = $(filter %.cpp,$(DEMO_ALL_FILES)) + +# All the native source files +DEMO_ALL_NATIVE_SOURCES = $(DEMO_C_SRC_FILES) +DEMO_ALL_NATIVE_SOURCES += $(DEMO_CPP_SRC_FILES) +DEMO_ALL_NATIVE_SOURCES += $(filter %.h,$(DEMO_ALL_FILES)) +DEMO_ALL_NATIVE_SOURCES += $(filter %.hpp,$(DEMO_ALL_FILES)) + +# If we have java sources, then define the jar file we will create +ifndef DEMO_JAR_NAME + DEMO_JAR_NAME = $(DEMONAME).jar +endif +ifneq ($(strip $(DEMO_JAVA_SOURCES)),) + DEMO_JAR = $(DEMO_DESTDIR)/$(DEMO_JAR_NAME) +endif + +# If we have native sources, define the native library we will create +ifneq ($(strip $(DEMO_ALL_NATIVE_SOURCES)),) + # Path to native library we will create + DEMO_LIBRARY = \ + $(DEMO_DESTDIR)/lib$(ISA_DIR)/$(LIB_PREFIX)$(DEMONAME).$(LIBRARY_SUFFIX) + # C and C++ compiler flags we need to add to standard flags + DEMO_CPPFLAGS += -I$(DEMO_BUILD_SRCDIR) + # If the npt library is used we need to find the npt.h file + ifneq ($(DEMO_NEEDS_NPT),) + # The npt library is delivered as part of the JRE + DEMO_CPPFLAGS += -I$(SHARE_SRC)/npt -I$(PLATFORM_SRC)/npt + endif + # Is the shared agent_util code needed + ifneq ($(DEMO_NEEDS_AGENT_UTIL),) + DEMO_FULL_SOURCES += $(DEMO_BUILD_SRCDIR)/agent_util.c + DEMO_FULL_SOURCES += $(DEMO_BUILD_SRCDIR)/agent_util.h + endif + # Is the shared java_crw_demo code needed + ifneq ($(DEMO_NEEDS_JAVA_CRW_DEMO),) + DEMO_FULL_SOURCES += $(DEMO_BUILD_SRCDIR)/java_crw_demo.c + DEMO_FULL_SOURCES += $(DEMO_BUILD_SRCDIR)/java_crw_demo.h + endif + # All the native object files we need to build the library + DEMO_OBJECTS += $(DEMO_C_SRC_FILES:%.c=%.$(OBJECT_SUFFIX)) \ + $(DEMO_CPP_SRC_FILES:%.cpp=%.$(OBJECT_SUFFIX)) + # Linking is special depending on whether we had C++ code or on windows + DEMO_NEEDS_CPP = $(strip $(DEMO_CPP_SRC_FILES)) + CPPFLAGS += $(DEMO_CPPFLAGS) + ifeq ($(PLATFORM),windows) + # Note: This is a link with cl.exe, not link.exe, options differ quite + # bit between them. + LINK.demo = $(LINK.c) + LDLIBS.demo = $(EXTRA_LIBS) $(LFLAGS_$(COMPILER_VERSION)) + DEMO_VERSION_INFO = $(OBJDIR)/$(LIBRARY).res + LDLIBS.demo += $(DEMO_VERSION_INFO) + else + ifneq ($(DEMO_NEEDS_CPP),) + LINK.demo = $(LINK.cpp) + LDLIBS.demo = $(LIBCXX) + ifeq ($(PLATFORM),solaris) + LDLIBS.demo += -lc + endif + else + LINK.demo = $(LINK.c) + LDLIBS.demo = $(LDLIBS) + endif + endif +endif + +# Files that are considered resources (need to be in the jar file) +DEMO_RESOURCES += $(filter-out %.java,$(DEMO_ALL_FILES)) + +# All destination files (top level readme files and all sources) +# Note: We exclude the topfiles from the src tree. +DEMO_DEST_TOPFILES = $(DEMO_TOPFILES:%=$(DEMO_DESTDIR)/%) +DEMO_FILTERED_SOURCES = $(filter-out $(DEMO_TOPFILES),$(DEMO_ALL_FILES)) +DEMO_FULL_SOURCES += $(DEMO_FILTERED_SOURCES:%=$(DEMO_BUILD_SRCDIR)/%) + +# Default rule +all: build demo_info + +# Used to populate the destination directories +$(DEMO_DESTDIR)/%: $(DEMO_ROOT)/% + $(install-file) +ifneq ($(DEMO_SRCDIR),$(DEMO_ROOT)) +$(DEMO_DESTDIR)/%: $(DEMO_SRCDIR)/% + $(install-file) +endif +$(DEMO_BUILD_SRCDIR)/%: $(DEMO_SRCDIR)/% + $(install-file) +ifdef DEMO_PSRCDIR +$(DEMO_BUILD_SRCDIR)/%: $(DEMO_PSRCDIR)/% + $(install-file) +endif +ifdef DEMO_EXTRA_SRCDIR +$(DEMO_BUILD_SRCDIR)/%: $(DEMO_EXTRA_SRCDIR)/% + $(install-file) +endif +ifneq ($(DEMO_NEEDS_AGENT_UTIL),) +$(DEMO_BUILD_SRCDIR)/%: $(DEMO_SRCDIR)/../agent_util/% + $(install-file) +endif +ifneq ($(DEMO_NEEDS_JAVA_CRW_DEMO),) +$(DEMO_BUILD_SRCDIR)/%: $(DEMO_SRCDIR)/../java_crw_demo/% + $(install-file) +endif + +# Jar manifest file +MAINMANIFEST = $(JDK_TOPDIR)/make/tools/manifest.mf +$(DEMO_MANIFEST): $(MAINMANIFEST) + @$(prep-target) + $(SED) -e "s#@@RELEASE@@#$(RELEASE)#" \ + -e "s#@@COMPANY_NAME@@#$(COMPANY_NAME)#" \ + $(MAINMANIFEST) >> $@ + $(ECHO) "Main-Class: $(DEMO_MAINCLASS)" >> $@ +ifdef DEMO_MANIFEST_ATTR + $(ECHO) "$(DEMO_MANIFEST_ATTR)" >> $@ +endif + +# Populating the jar image directory +$(DEMO_JAR_IMAGE)/%: $(DEMO_SRCDIR)/% + $(install-file) +ifdef DEMO_PSRCDIR +$(DEMO_JAR_IMAGE)/%: $(DEMO_PSRCDIR)/% + $(install-file) +endif +ifdef DEMO_EXTRA_SRCDIR +$(DEMO_JAR_IMAGE)/%: $(DEMO_EXTRA_SRCDIR)/% + $(install-file) +endif +ifdef DEMO_DESCRIPTOR +$(DEMO_JAR_IMAGE)/META-INF/services/$(DEMO_DESCRIPTOR): \ + $(DEMO_SRCDIR)/$(DEMO_DESCRIPTOR) + $(install-file) +endif + +# If we are creating a jar file (we have java code) +ifdef DEMO_JAR + +# Input file for javac +$(DEMO_JAVAC_INPUT): $(DEMO_JAVA_SOURCES:%=$(DEMO_BUILD_SRCDIR)/%) + @$(prep-target) + @for i in $(DEMO_JAVA_SOURCES) ; do \ + $(ECHO) "$(DEMO_BUILD_SRCDIR)/$$i" >> $@ ; \ + done + +# Jar file creation +$(DEMO_JAR): \ + $(DEMO_JAVAC_INPUT) \ + $(DEMO_MANIFEST) \ + $(DEMO_DESCRIPTOR:%=$(DEMO_JAR_IMAGE)/META-INF/services/%) \ + $(DEMO_RESOURCES:%=$(DEMO_JAR_IMAGE)/%) + @$(prep-target) + $(MKDIR) -p $(DEMO_JAR_IMAGE) + $(JAVAC_CMD) -d $(DEMO_JAR_IMAGE) -sourcepath $(DEMO_BUILD_SRCDIR) \ + @$(DEMO_JAVAC_INPUT) + ifeq ($(DEMO_INCL_SRC),true) + $(CP) $(DEMO_JAVA_SOURCES:%=$(DEMO_BUILD_SRCDIR)/%) $(DEMO_JAR_IMAGE) + endif + ifeq ($(DEMO_ONLY_SRC),true) + $(RM) -r $(DEMO_JAR_IMAGE) + $(MKDIR) -p $(DEMO_JAR_IMAGE) + $(CP) -r $(DEMO_BUILD_SRCDIR)/* $(DEMO_JAR_IMAGE) + ifneq ($(DEMO_TOPFILES),) + $(CP) $(DEMO_ROOT)/$(DEMO_TOPFILES) $(DEMO_JAR_IMAGE) + endif + endif + $(BOOT_JAR_CMD) -cfm $@ $(DEMO_MANIFEST) \ + -C $(DEMO_JAR_IMAGE) . \ + $(BOOT_JAR_JFLAGS) + @$(java-vm-cleanup) + +endif + +ifndef DEMO_SKIP_SRCZIP + # Create a src.zip file + $(DEMO_BUILD_SRCZIP): $(DEMO_FULL_SOURCES) + @$(prep-target) + $(CD) $(DEMO_BUILD_AREA)/src && $(ZIPEXE) -q -r ../$(@F) . + + # Install the destination src.zip file and create the src tree + $(DEMO_SOURCE_ZIP): $(DEMO_BUILD_SRCZIP) + $(install-file) +endif + +ifeq ($(PLATFORM),windows) +# JDK name required here +RC_FLAGS += /D "JDK_FNAME=$(LIBRARY).dll" \ + /D "JDK_INTERNAL_NAME=$(LIBRARY)" \ + /D "JDK_FTYPE=0x2L" +endif + +# Native library building +ifdef DEMO_LIBRARY + + # Full paths to object files + DEMO_FULL_OBJECTS = $(DEMO_OBJECTS:%=$(OBJDIR)/%) + VPATH= + +# Native compile rules +$(OBJDIR)/%.$(OBJECT_SUFFIX): $(DEMO_BUILD_SRCDIR)/%.c + @$(prep-target) + $(COMPILE.c) $(CC_OBJECT_OUTPUT_FLAG)$@ $< + ifneq ($(DEMO_NEEDS_CPP),) +$(OBJDIR)/%.$(OBJECT_SUFFIX): $(DEMO_BUILD_SRCDIR)/%.cpp + @$(prep-target) + $(COMPILE.cpp) $(CC_OBJECT_OUTPUT_FLAG)$@ $< + endif + + # Actual creation of the native shared library (C++ and C are different) +$(DEMO_LIBRARY): $(DEMO_FULL_OBJECTS) + @$(prep-target) + ifeq ($(PLATFORM),windows) + $(RC) $(RC_FLAGS) $(CC_OBJECT_OUTPUT_FLAG)$(DEMO_VERSION_INFO) $(VERSIONINFO_RESOURCE) + $(LINK.demo) $(SHARED_LIBRARY_FLAG) -Fe$@ \ + $(DEMO_FULL_OBJECTS) $(LDLIBS.demo) + else + $(LINK.demo) $(SHARED_LIBRARY_FLAG) -o $@ \ + $(DEMO_FULL_OBJECTS) $(LDLIBS.demo) + endif + @$(call binary_file_verification,$@) + + # Generation of any javah include file, make sure objects are dependent on it + ifdef DEMO_NATIVECLASS +$(DEMO_JAVAH_FILE): $(DEMO_JAR) + @$(prep-target) + $(JAVAH_CMD) -d $(DEMO_BUILD_SRCDIR) -classpath $(DEMO_JAR) \ + $(DEMO_NATIVECLASS) + @$(java-vm-cleanup) +$(DEMO_FULL_OBJECTS): $(DEMO_JAVAH_FILE) + endif + +endif + +# Build involves populating the destination "src" tree, building the jar and +# native library, and creating a source bundle + +sources: $(DEMO_FULL_SOURCES) + @$(ECHO) "Created $@" + +objects: + @$(ECHO) "Created $@" + +# Why the nested make here? It only works this way, don't know why. +bundles: $(DEMO_BUILD_SRCZIP) + $(RM) -r $(DEMO_DESTDIR) + $(MKDIR) -p $(DEMO_DESTDIR) + $(MAKE) $(DEMO_LIBRARY) $(DEMO_JAR) $(DEMO_SOURCE_ZIP) $(DEMO_DEST_TOPFILES) +# Applets are special, no jar file, no src.zip, everything expanded. +ifdef DEMO_IS_APPLET + @$(ECHO) "Expanding jar file into demos area at $(DEMO_DESTDIR)" + ( $(CD) $(DEMO_DESTDIR) && \ + $(BOOT_JAR_CMD) -xfv $(DEMO_JAR_NAME) \ + $(BOOT_JAR_JFLAGS) && \ + $(RM) -r META-INF $(DEMO_JAR_NAME) && \ + $(java-vm-cleanup) ) + @( $(CD) $(DEMO_DESTDIR) && $(java-vm-cleanup) ) + @$(ECHO) "Expanding source into demos area at $(DEMO_DESTDIR)" + ( $(CD) $(DEMO_DESTDIR) && $(UNZIP) -o src.zip && $(RM) src.zip ) +endif + +build: sources bundles + +# Printing out a demo information line +define printDemoSetting +if [ "$2" != "" ] ; then $(PRINTF) "%-20s %s\n" "$1:" "$2"; fi +endef + +# Print out the demo information +demo_info: + @$(ECHO) "=========================================================" + @$(call printDemoSetting,DEMONAME,$(DEMONAME)) + @$(call printDemoSetting,DEMO_ROOT,$(DEMO_ROOT)) + @$(call printDemoSetting,DEMO_SRCDIR,$(DEMO_SRCDIR)) + @$(call printDemoSetting,DEMO_DESTDIR,$(DEMO_DESTDIR)) + @$(call printDemoSetting,DEMO_JAR,$(DEMO_JAR)) + @$(call printDemoSetting,DEMO_MANIFEST_ATTR,$(DEMO_MANIFEST_ATTR)) + @$(call printDemoSetting,DEMO_PSRCDIR,$(DEMO_PSRCDIR)) + @$(call printDemoSetting,DEMO_EXTRA_SRCDIR,$(DEMO_EXTRA_SRCDIR)) + @$(call printDemoSetting,DEMO_EXTRA_FILES,$(DEMO_EXTRA_FILES)) + @$(call printDemoSetting,DEMO_TOPFILES,$(DEMO_TOPFILES)) + @$(call printDemoSetting,DEMO_MAINCLASS,$(DEMO_MAINCLASS)) + @$(call printDemoSetting,DEMO_DESCRIPTOR,$(DEMO_DESCRIPTOR)) + @$(call printDemoSetting,DEMO_NATIVECLASS,$(DEMO_NATIVECLASS)) + @$(call printDemoSetting,DEMO_LIBRARY,$(DEMO_LIBRARY)) + @$(call printDemoSetting,DEMO_OBJECTS,$(DEMO_OBJECTS)) + @$(call printDemoSetting,DEMO_SOURCE_ZIP,$(DEMO_SOURCE_ZIP)) + @$(ECHO) "=========================================================" + +# Clean rule +clean clobber: + $(RM) -r $(DEMO_BUILD_AREA) + $(RM) -r $(DEMO_DESTDIR) + +# This should not be needed, but some versions of GNU make have a bug that +# sometimes deleted these files for some strange and unknown reason +# (GNU make version 3.78.1 has the problem, GNU make version 3.80 doesn't?) +.PRECIOUS: $(DEMO_FULL_SOURCES) $(DEMO_BUILD_SRCZIP) $(DEMO_SOURCE_ZIP) + +# List phony targets +.PHONY: all build clean clobber demo_info \ + sources bundles +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jdk/makefiles/common/Library.gmk Wed Apr 11 14:09:48 2012 -0700 @@ -0,0 +1,326 @@ +# +# Copyright (c) 1995, 2011, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# + +# +# Generic makefile for building shared libraries. +# + +# WARNING: This file is shared with other workspaces. +# So when it includes other files, it must use JDK_TOPDIR. +# + +include $(JDK_TOPDIR)/makefiles/common/Classes.gmk + +# +# It is important to define these *after* including Classes.gmk +# in order to override the values defined inthat makefile. +# + +ifeq ($(LIBRARY), fdlibm) +ifeq ($(PLATFORM),windows) +ACTUAL_LIBRARY_NAME = $(LIB_PREFIX)$(LIBRARY).$(FDDLIBM_SUFFIX) +ACTUAL_LIBRARY_DIR = $(OBJDIR) +else # PLATFORM +ACTUAL_LIBRARY_NAME = $(LIB_PREFIX)$(LIBRARY).$(ARCH).$(FDDLIBM_SUFFIX) +ACTUAL_LIBRARY_DIR = $(OBJDIR) +endif #PLATFORM +else # LIBRARY +ACTUAL_LIBRARY_NAME = $(LIB_PREFIX)$(LIBRARY).$(LIBRARY_SUFFIX) +ACTUAL_LIBRARY_DIR = $(LIB_LOCATION) +endif +ACTUAL_LIBRARY = $(ACTUAL_LIBRARY_DIR)/$(ACTUAL_LIBRARY_NAME) + +library:: $(ACTUAL_LIBRARY) + +FILES_o = $(patsubst %.c, %.$(OBJECT_SUFFIX), $(addprefix $(OBJDIR)/, $(notdir $(FILES_c)))) +FILES_o += $(patsubst %.s, %.$(OBJECT_SUFFIX), $(addprefix $(OBJDIR)/, $(notdir $(FILES_s)))) +FILES_o += $(patsubst %.cpp, %.$(OBJECT_SUFFIX), $(addprefix $(OBJDIR)/, $(notdir $(FILES_cpp)))) + +ifeq ($(PLATFORM), macosx) +FILES_o += $(patsubst %.m, %.$(OBJECT_SUFFIX), $(addprefix $(OBJDIR)/, $(notdir $(FILES_objc)))) +FILES_o += $(patsubst %.mm, %.$(OBJECT_SUFFIX), $(addprefix $(OBJDIR)/, $(notdir $(FILES_objcpp)))) + +INCREMENTAL_BUILD=false + +endif # PLATFORM + +ifeq ($(INCREMENTAL_BUILD),true) +FILES_d = $(patsubst %.c, %.$(DEPEND_SUFFIX), $(addprefix $(OBJDIR)/, $(notdir $(FILES_c)))) +FILES_d += $(patsubst %.cpp, %.$(DEPEND_SUFFIX), $(addprefix $(OBJDIR)/, $(notdir $(FILES_cpp)))) +endif # INCREMENTAL_BUILD + +ifeq ($(PLATFORM),solaris) +# List of all lint files, one for each .c file (only for C) +FILES_ln = $(patsubst %.c, %.$(LINT_SUFFIX), $(addprefix $(OBJDIR)/, $(notdir $(FILES_c)))) +endif + +LINK.cc = $(CXX) $(CXXFLAGS) $(CPPFLAGS) $(LDFLAGS) +LINK.c = $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) + +# +# C++ libraries must be linked with CC. +# +ifdef CPLUSPLUSLIBRARY +LINKER=$(LINK.cc) +else +LINKER=$(LINK.c) +endif + +$(ACTUAL_LIBRARY):: $(INIT) $(TEMPDIR) $(LIBDIR) $(BINDIR) $(EXTDIR) classheaders + @$(ECHO) Building lib:$(ACTUAL_LIBRARY) +# +# COMPILE_APPROACH: Different approaches to compile up the native object +# files as quickly as possible. +# The setting of parallel works best on Unix, batch on Windows. +# + +COMPILE_FILES_o = $(OBJDIR)/.files_compiled +$(COMPILE_FILES_o): $(FILES_d) $(FILES_o) + @$(ECHO) "$<" >> $@ +clean:: + $(RM) $(COMPILE_FILES_o) + +# +# COMPILE_APPROACH=parallel: Will trigger compilations (just compilations) to +# happen in parallel. Greatly decreases Unix build time, even on single CPU +# machines, more so on multiple CPU machines. Default is 2 compiles +# at a time, but can be adjusted with ALT_PARALLEL_COMPILE_JOBS. +# Note that each .d file will also be dependent on it's .o file, see +# Rules.gmk. +# Note this does not depend on Rules.gmk to work like batch (below) +# and this technique doesn't seem to help Windows build time nor does +# it work very well, it's possible the Windows Visual Studio compilers +# don't work well in a parallel situation, this needs investigation. +# + +ifeq ($(COMPILE_APPROACH),parallel) + +.PHONY: library_parallel_compile + +library_parallel_compile: + @$(ECHO) "Begin parallel compiles: $(shell $(PWD))" + $(MAKE) -j $(PARALLEL_COMPILE_JOBS) $(COMPILE_FILES_o) + @$(ECHO) "Done with parallel compiles: $(shell $(PWD))" + +$(ACTUAL_LIBRARY):: library_parallel_compile + +endif + +# +# COMPILE_APPROACH=batch: Will trigger compilations (just compilations) to +# happen in batch mode. Greatly decreases Windows build time. +# See logic in Rules.gmk for how compiles happen, the $(MAKE) in +# library_batch_compile below triggers the actions in Rules.gmk. +# Note that each .d file will also be dependent on it's .o file, see +# Rules.gmk. +# +ifeq ($(COMPILE_APPROACH),batch) + +.PHONY: library_batch_compile + +library_batch_compile: + @$(ECHO) "Begin BATCH compiles: $(shell $(PWD))" + $(MAKE) $(COMPILE_FILES_o) + $(MAKE) batch_compile + @$(ECHO) "Done with BATCH compiles: $(shell $(PWD))" + $(MAKE) COMPILE_APPROACH=normal $(COMPILE_FILES_o) + +$(ACTUAL_LIBRARY):: library_batch_compile + +endif + +ifeq ($(PLATFORM), windows) + +# +# Library building rules. +# + +$(LIBRARY).lib:: $(OBJDIR) + +ifeq ($(LIBRARY), fdlibm) +$(ACTUAL_LIBRARY):: $(OBJDIR)/$(LIBRARY).lib + +$(OBJDIR)/$(LIBRARY).lib:: $(OBJDIR)/$(LIBRARY).lcf + @$(prep-target) + $(AR) -NODEFAULTLIB:MSVCRT -out:$@ -nologo \ + @$(OBJDIR)/$(LIBRARY).lcf $(OTHER_LCF) $(LDLIBS_COMMON) +else # LIBRARY +# build it into $(OBJDIR) so that the other generated files get put +# there, then copy just the DLL (and MAP file) to the requested directory. +# +$(ACTUAL_LIBRARY):: $(OBJDIR)/$(LIBRARY).lcf + @$(prep-target) + @$(MKDIR) -p $(OBJDIR) + $(LD) -dll -out:$(OBJDIR)/$(@F) \ + -map:$(OBJDIR)/$(LIBRARY).map \ + $(LFLAGS) @$(OBJDIR)/$(LIBRARY).lcf \ + $(OTHER_LCF) $(LDLIBS) + $(CP) $(OBJDIR)/$(@F) $@ + @$(call binary_file_verification,$@) + $(CP) $(OBJDIR)/$(LIBRARY).map $(@D) + $(CP) $(OBJDIR)/$(LIBRARY).pdb $(@D) + +endif # LIBRARY + +$(OBJDIR)/$(LIBRARY).lcf: $(OBJDIR)/$(LIBRARY).res $(COMPILE_FILES_o) $(FILES_m) + @$(prep-target) + @$(MKDIR) -p $(TEMPDIR) + @$(ECHO) $(FILES_o) > $@ +ifndef LOCAL_RESOURCE_FILE + @$(ECHO) $(OBJDIR)/$(LIBRARY).res >> $@ +endif + @$(ECHO) Created $@ + +# JDK name required here +RC_FLAGS += /D "JDK_FNAME=$(LIBRARY).dll" \ + /D "JDK_INTERNAL_NAME=$(LIBRARY)" \ + /D "JDK_FTYPE=0x2L" + +$(OBJDIR)/$(LIBRARY).res: $(VERSIONINFO_RESOURCE) +ifndef LOCAL_RESOURCE_FILE + @$(prep-target) + $(RC) $(RC_FLAGS) $(CC_OBJECT_OUTPUT_FLAG)$(@) $(VERSIONINFO_RESOURCE) +endif + +# +# Install a .lib file if required. +# +ifeq ($(INSTALL_DOT_LIB), true) +$(ACTUAL_LIBRARY):: $(LIBDIR)/$(LIBRARY).lib + +clean:: + -$(RM) $(LIBDIR)/$(LIBRARY).lib + +$(LIBDIR)/$(LIBRARY).lib:: $(OBJDIR)/$(LIBRARY).lib + $(install-file) + +$(LIBDIR)/$(LIBRARY).dll:: $(OBJDIR)/$(LIBRARY).dll + $(install-file) + +endif # INSTALL_DOT_LIB + +else # PLATFORM + +# +# On Solaris, use mcs to write the version into the comment section of +# the shared library. On other platforms set this to false at the +# make command line. +# + +ifneq ($(PLATFORM), macosx) + ARFLAGS = -r +endif + +$(ACTUAL_LIBRARY):: $(COMPILE_FILES_o) $(FILES_m) $(FILES_reorder) + @$(prep-target) + @$(ECHO) "STATS: LIBRARY=$(LIBRARY), PRODUCT=$(PRODUCT), OPTIMIZATION_LEVEL=$(OPTIMIZATION_LEVEL)" + @$(ECHO) "Rebuilding $@ because of $?" +ifeq ($(LIBRARY), fdlibm) + $(AR) $(ARFLAGS) $@ $(FILES_o) +else # LIBRARY + $(LINKER) $(SHARED_LIBRARY_FLAG) -o $@ $(FILES_o) $(LDLIBS) + @$(call binary_file_verification,$@) +ifeq ($(WRITE_LIBVERSION),true) + $(MCS) -d -a "$(FULL_VERSION)" $@ +endif # WRITE_LIBVERSION +endif # LIBRARY + +endif # PLATFORM + +# +# Cross check all linted files against each other +# +ifeq ($(PLATFORM),solaris) +lint.errors : $(FILES_ln) + $(LINT.c) $(FILES_ln) $(LDLIBS) +endif + +# +# Class libraries with JNI native methods get a include to the package. +# +ifdef PACKAGE +vpath %.c $(PLATFORM_SRC)/native/$(PKGDIR) +vpath %.c $(SHARE_SRC)/native/$(PKGDIR) +OTHER_INCLUDES += -I$(SHARE_SRC)/native/common -I$(PLATFORM_SRC)/native/common +OTHER_INCLUDES += -I$(SHARE_SRC)/native/$(PKGDIR) \ + -I$(PLATFORM_SRC)/native/$(PKGDIR) +endif + +# +# Clean/clobber rules +# +clean:: + $(RM) -r $(ACTUAL_LIBRARY) + +clobber:: clean + +# +# INCREMENTAL_BUILD means that this workspace will be built over and over +# possibly incrementally. This means tracking the object file dependencies +# on include files so that sources get re-compiled when the include files +# change. When building from scratch and doing a one time build (like +# release engineering or nightly builds) set INCREMENTAL_BUILD=false. +# + +ifeq ($(INCREMENTAL_BUILD),true) + +# +# Workaround: gnumake sometimes says files is empty when it shouldn't +# was: files := $(foreach file, $(wildcard $(OBJDIR)/*.$(DEPEND_SUFFIX)), $(file)) +# +files := $(shell $(LS) $(OBJDIR)/*.$(DEPEND_SUFFIX) 2>/dev/null) + +# +# Only include these files if we have any. +# +ifneq ($(strip $(files)),) + +include $(files) + +endif # files + +endif # INCREMENTAL_BUILD + +# +# Default dependencies +# + +all: build + +build: library + +debug: + $(MAKE) VARIANT=DBG build + +fastdebug: + $(MAKE) VARIANT=DBG FASTDEBUG=true build + +openjdk: + $(MAKE) OPENJDK=true build + +FORCE: + +.PHONY: all build debug fastdebug +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jdk/makefiles/common/Mapfile-vers.gmk Wed Apr 11 14:09:48 2012 -0700 @@ -0,0 +1,97 @@ +# +# Copyright (c) 1998, 2005, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# + +# +# Makefile for linking with mapfiles. +# +# NOTE: Not using a mapfile will expose all your extern functions and +# extern data symbols as part of your interface, so unless your +# extern names are safe from being mistaken as names from other +# libraries, you better use a mapfile, or use a unique naming +# convention on all your extern symbols. +# +# The mapfile will establish versioning by defining the exported interface. +# +# The mapfile can also force certain .o files or elf sections into the +# the different segments of the resulting library/program image. +# +# The macro FILES_m can contain any number of mapfiles. +# + +# Always make sure 'all' is the default rule +mapfile_default_rule: all + +ifeq ($(PLATFORM), solaris) + +ifeq ($(VARIANT), OPT) + # OPT build MUST have a mapfile? + ifndef FILES_m + FILES_m = mapfile-vers + endif + + # If we are re-ordering functions in this solaris library, we need to make + # sure that -xF is added to the compile lines. This option is critical and + # enables the functions to be reordered. + ifdef FILES_reorder + CFLAGS_OPT += -xF + CXXFLAGS_OPT += -xF + endif + +INIT += $(TEMPDIR)/mapfile-vers + +$(TEMPDIR)/mapfile-vers : $(FILES_m) $(FILES_reorder) + $(prep-target) + $(CAT) $(FILES_m) > $@ + ifdef FILES_reorder + $(SED) -e 's=OUTPUTDIR=$(OUTPUTDIR)=' $(FILES_reorder) >> $@ + endif +endif # VARIANT + +ifndef LDNOMAP + LDMAPFLAGS_OPT = -M$(TEMPDIR)/mapfile-vers + LDMAPFLAGS_DBG = $(FILES_m:%=-M%) +endif + +endif # PLATFORM + +ifeq ($(PLATFORM), linux) + +ifeq ($(VARIANT), OPT) + # OPT build MUST have a mapfile? + ifndef FILES_m + FILES_m = mapfile-vers + endif +endif # VARIANT + +ifndef LDNOMAP + LDMAPFLAGS_OPT = $(FILES_m:%=-Xlinker -version-script=%) + LDMAPFLAGS_DBG = $(FILES_m:%=-Xlinker -version-script=%) +endif + +endif # PLATFORM + +LDFLAGS_OPT += $(LDMAPFLAGS_OPT) +LDFLAGS_DBG += $(LDMAPFLAGS_DBG) +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jdk/makefiles/common/Modules.gmk Wed Apr 11 14:09:48 2012 -0700 @@ -0,0 +1,479 @@ +# +# Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# + +JDK_MODULE_IMAGE_DIR = $(ABS_OUTPUTDIR)/jdk-module-image +JRE_MODULE_IMAGE_DIR = $(ABS_OUTPUTDIR)/jre-module-image + +# +# modules Target to build jdk and jre module image +# +# There is one jar file per module containing classes only. +# All module jars are currently placed under jre/lib directory. +# +# Open issues that need further investigation: +# 1. Classes in jre/lib/ext/dnsns.jar are currently put in jre/lib/jndi-dns +# module. META-INF/services file is not installed. +# 2. Signed jars +# For JDK build, signed jars are copied to the build. +# All jars in the module image are unsigned. + +MODULE_IMAGEBINDIR = bin + +# +# Targets. +# +INITIAL_MODULE_IMAGE_JRE=initial-module-image-jre +INITIAL_MODULE_IMAGE_JDK=initial-module-image-jdk +ifeq ($(PLATFORM), solaris) + ifeq ($(ARCH_DATA_MODEL), 64) + INITIAL_MODULE_IMAGE_JRE=initial-module-image-jre-sol64 + INITIAL_MODULE_IMAGE_JDK=initial-module-image-jdk-sol64 + endif +endif + +modules modules-clobber \ +initial-module-image-jre initial-module-image-jdk \ +initial-module-image-jre-sol64 initial-module-image-jdk-sol64 \ +trim-module-image-jre trim-module-image-jdk \ +process-module-image-jre process-module-image-jdk :: + @$(ECHO) ">>>Making "$@" @ `$(DATE)` ..." + +# Order is important here, trim jre after jdk image is created +modules:: gen-modules \ + $(INITIAL_MODULE_IMAGE_JRE) $(INITIAL_MODULE_IMAGE_JDK) \ + trim-module-image-jre trim-module-image-jdk \ + process-module-image-jre process-module-image-jdk + +# Don't use these +module-image-jre:: initial-module-image-jre trim-module-image-jre process-module-image-jre +module-image-jdk:: initial-module-image-jdk trim-module-image-jdk process-module-image-jdk + +# +# Paths to these files we need +JDK_MODULE_LICENSES = $(LICENSE_DOCLIST_JDK:%=$(JDK_MODULE_IMAGE_DIR)/%) +JDK_MODULE_64_LICENSES = $(LICENSE_DOCLIST_JDK:%=$(JDK_MODULE_IMAGE_DIR)/%64) +JDK_MODULE_DOCFILES = $(OTHER_DOCLIST_JDK:%=$(JDK_MODULE_IMAGE_DIR)/%) + +JRE_MODULE_LICENSES = $(LICENSE_DOCLIST_JRE:%=$(JRE_MODULE_IMAGE_DIR)/%) +JRE_MODULE_64_LICENSES = $(LICENSE_DOCLIST_JRE:%=$(JRE_MODULE_IMAGE_DIR)/%64) +JRE_MODULE_DOCFILES = $(OTHER_DOCLIST_JRE:%=$(JRE_MODULE_IMAGE_DIR)/%) +JRE_MODULE_DOCFILES += $(JRE_NAMECHANGE_DOCLIST:%=$(JRE_MODULE_IMAGE_DIR)/%$(TEXT_SUFFIX)) + +###### RULES + +# JDK files +$(JDK_MODULE_IMAGE_DIR)/%: $(SHARE_JDK_DOC_SRC)/% + $(process-doc-file) +# Removes LICENSE_VERSION or not +ifdef LICENSE_VERSION +$(JDK_MODULE_IMAGE_DIR)/%: $(SHARE_JDK_DOC_SRC)/%$(LICENSE_VERSION) + $(process-doc-file) +$(JDK_MODULE_IMAGE_DIR)/%64: $(SHARE_JDK_DOC_SRC)/%$(LICENSE_VERSION) + $(process-doc-file) +else +$(JDK_MODULE_IMAGE_DIR)/%64: $(SHARE_JDK_DOC_SRC)/% + $(process-doc-file) +endif + +# JRE files +$(JRE_MODULE_IMAGE_DIR)/%: $(SHARE_JRE_DOC_SRC)/% + $(process-doc-file) +# Add $(TEXT_SUFFIX) suffix +ifdef TEXT_SUFFIX +$(JRE_MODULE_IMAGE_DIR)/%$(TEXT_SUFFIX): $(SHARE_JRE_DOC_SRC)/% + $(process-doc-file) +endif +# Removes LICENSE_VERSION or not +ifdef LICENSE_VERSION +$(JRE_MODULE_IMAGE_DIR)/%: $(SHARE_JRE_DOC_SRC)/%$(LICENSE_VERSION) + $(process-doc-file) +$(JRE_MODULE_IMAGE_DIR)/%64: $(SHARE_JRE_DOC_SRC)/%$(LICENSE_VERSION) + $(process-doc-file) +else +$(JRE_MODULE_IMAGE_DIR)/%64: $(SHARE_JRE_DOC_SRC)/% + $(process-doc-file) +endif + +###################################################### +# JRE Image +###################################################### + +MODULES_LIST = $(MODULES_TEMPDIR)/classlist/modules.list + +# Modules in the jre/lib/security directory +POLICY_MODULES = US_export_policy local_policy + +# Modules in the modules/ext directory +EXT_MODULES = localedata security-sunec security-sunjce + +# Build PKCS#11 on all platforms except 64-bit Windows. +PKCS11 = security-sunpkcs11 +ifeq ($(ARCH_DATA_MODEL), 64) + ifeq ($(PLATFORM), windows) + PKCS11 = + endif +endif + +EXT_MODULES += $(PKCS11) + +# Build Microsoft CryptoAPI provider only on (non-64-bit) Windows platform. +ifeq ($(PLATFORM), windows) + ifneq ($(ARCH_DATA_MODEL), 64) + EXT_MODULES += security-sunmscapi + endif +endif + +# Modules for JDK only +JDK_MODULES = tools + +gen-modules: + $(CD) modules; $(MAKE) all + +initial-module-image-jre-setup: + $(RM) -r $(JRE_MODULE_IMAGE_DIR) + $(MKDIR) -p $(JRE_MODULE_IMAGE_DIR) + +# 64-bit solaris jre image contains only the 64-bit add-on files. +initial-module-image-jre-sol64:: initial-module-image-jre-setup \ + $(JRE_MODULE_LICENSES) $(JRE_MODULE_64_LICENSES) + @# Use tar instead of cp to preserve the symbolic links + for dir in bin lib ; do \ + ( $(CD) $(OUTPUTDIR) && \ + $(TAR) cf - `$(FIND) $$dir -name '$(ARCH)' -print` | \ + ($(CD) $(JRE_MODULE_IMAGE_DIR) && $(TAR) xf -) ) ; \ + done + @# Remove some files from the jre area + for t in $(NOTJRETOOLS) ; do \ + $(RM) $(JRE_MODULE_IMAGE_DIR)/bin$(ISA_DIR)/$$t ; \ + done + $(RM) `$(FIND) $(JRE_MODULE_IMAGE_DIR)/lib -name 'orb.idl'` + $(RM) `$(FIND) $(JRE_MODULE_IMAGE_DIR)/lib -name 'ir.idl'` + +# Construct an initial jre image (initial jdk jre) no trimming or stripping +initial-module-image-jre:: initial-module-image-jre-setup \ + $(JRE_LICENSES) $(JRE_MODULE_DOCFILES) \ + $(BUILDMETAINDEX_JARFILE) + @# Copy in bin directory + $(CD) $(OUTPUTDIR) && $(FIND) bin -depth | $(CPIO) -pdum $(JRE_MODULE_IMAGE_DIR) + @# CTE plugin security change require new empty directory lib/applet + $(MKDIR) -p $(JRE_MODULE_IMAGE_DIR)/lib/applet + @# Copy files but not .jar in lib directory + $(CD) $(OUTPUTDIR) && $(FIND) lib -depth | $(EGREP) -v ".jar$$" | $(CPIO) -pdum $(JRE_MODULE_IMAGE_DIR) + @# + @# copy modules to jre/lib + @# + for m in `$(NAWK) '{print $$1}' $(MODULES_LIST)` ; do \ + $(CP) $(MODULES_DIR)/$$m/lib/$$m.jar $(JRE_MODULE_IMAGE_DIR)/lib ; \ + done + $(MKDIR) -p $(JRE_MODULE_IMAGE_DIR)/lib/ext + for m in $(EXT_MODULES) ; do \ + $(MV) $(JRE_MODULE_IMAGE_DIR)/lib/$$m.jar $(JRE_MODULE_IMAGE_DIR)/lib/ext ; \ + done + for m in $(POLICY_MODULES) ; do \ + $(MV) $(JRE_MODULE_IMAGE_DIR)/lib/$$m.jar $(JRE_MODULE_IMAGE_DIR)/lib/security; \ + done + @# Remove jdk modules + for m in $(JDK_MODULES) ; do \ + $(RM) $(JRE_MODULE_IMAGE_DIR)/lib/$$m.jar ; \ + done + + @# Make sure all directories are read/execute for everyone + $(CHMOD) a+rx `$(FIND) $(JRE_MODULE_IMAGE_DIR) -type d` + @# Remove some files from the jre area + for t in $(NOTJRETOOLS) ; do \ + $(RM) $(JRE_MODULE_IMAGE_DIR)/bin$(ISA_DIR)/$$t ; \ + done + @# Remove orb.idl and ir.idl from jre + $(FIND) $(JRE_MODULE_IMAGE_DIR)/lib -name 'orb.idl' -exec $(RM) \{} \; + $(FIND) $(JRE_MODULE_IMAGE_DIR)/lib -name 'ir.idl' -exec $(RM) \{} \; + @# Generate meta-index to make boot and extension class loaders lazier + $(CD) $(JRE_MODULE_IMAGE_DIR)/lib && \ + $(BOOT_JAVA_CMD) -jar $(BUILDMETAINDEX_JARFILE) \ + -o meta-index *.jar + @$(CD) $(JRE_MODULE_IMAGE_DIR)/lib && $(java-vm-cleanup) + $(CD) $(JRE_MODULE_IMAGE_DIR)/lib/ext && \ + $(BOOT_JAVA_CMD) -jar $(BUILDMETAINDEX_JARFILE) \ + -o meta-index *.jar + @$(CD) $(JRE_MODULE_IMAGE_DIR)/lib/ext && $(java-vm-cleanup) +ifeq ($(PLATFORM), windows) + @# Remove certain *.lib files + $(CD) $(JRE_MODULE_IMAGE_DIR)/lib && \ + $(RM) java.$(LIB_SUFFIX) jvm.$(LIB_SUFFIX) \ + hpi.$(LIB_SUFFIX) awt.$(LIB_SUFFIX) jawt.$(LIB_SUFFIX) + ifeq ($(ARCH_DATA_MODEL), 32) + @# The Java Kernel JRE image ships with a special VM. It is not included + @# in the full JRE image, so remove it. Also, is it only for 32-bit windows. + $(CD) $(JRE_MODULE_IMAGE_DIR)/bin && $(RM) -r kernel + endif +endif # Windows +ifneq ($(PLATFORM), windows) + $(call copy-man-pages,$(JRE_MODULE_IMAGE_DIR),$(JRE_MAN_PAGES)) +endif # !windows + +# Trim out any extra files not for the jre shipment but wanted in the jdk jre. +# (Note the jdk WILL want the jre image before this trimming) +# Removes server VM on Windows 32bit. +# Remove certain shared libraries that should not be in the jre image +# but should be in the jdk jre image. +trim-module-image-jre:: +ifeq ($(PLATFORM), windows) + ifeq ($(ARCH_DATA_MODEL), 32) + $(RM) -r $(JRE_MODULE_IMAGE_DIR)/bin/server + endif + ifdef NOTJRE_SHARED_LIBS + for l in $(NOTJRE_SHARED_LIBS) ; do \ + $(RM) $(JRE_MODULE_IMAGE_DIR)/bin/$$l ; \ + done ; + endif +else # PLATFORM + ifdef NOTJRE_SHARED_LIBS + for l in $(NOTJRE_SHARED_LIBS) ; do \ + $(RM) $(JRE_MODULE_IMAGE_DIR)/lib/$(LIBARCH)/$$l ; \ + done ; + endif +endif # PLATFORM + +# Get list of all Elf files in the jre +JRE_MODULE_ELF_LIST=$(MODULES_TEMPDIR)/jre-elf-files.list +$(JRE_MODULE_ELF_LIST): + @$(prep-target) +ifneq ($(PLATFORM), windows) + $(RM) $@ + $(FIND) $(JRE_MODULE_IMAGE_DIR)/lib -type f -name \*.$(LIB_SUFFIX) >> $@ + $(FILE) `$(FIND) $(JRE_MODULE_IMAGE_DIR)/bin -type f -name \*$(EXE_SUFFIX)` \ + | $(EGREP) 'ELF' | $(CUT) -d':' -f1 >> $@ +endif + +# Post process the image (strips and mcs on Elf files we are shipping) +# (Note the jdk WILL want the jre image before this processing) +process-module-image-jre:: $(JRE_MODULE_ELF_LIST) +ifneq ($(POST_STRIP_PROCESS), ) + for f in `$(CAT) $(JRE_MODULE_ELF_LIST)`; do \ + $(CHMOD) u+w $${f}; \ + $(ECHO) $(POST_STRIP_PROCESS) $${f}; \ + $(POST_STRIP_PROCESS) $${f}; \ + $(CHMOD) go-w $${f}; \ + done +endif +ifneq ($(POST_MCS_PROCESS), ) + for f in `$(CAT) $(JRE_MODULE_ELF_LIST)`; do \ + $(CHMOD) u+w $${f}; \ + $(ECHO) $(POST_MCS_PROCESS) $${f}; \ + $(POST_MCS_PROCESS) $${f}; \ + $(CHMOD) go-w $${f}; \ + done +endif + $(RM) $(JRE_MODULE_ELF_LIST) + +###################################################### +# JDK Image +###################################################### +# Note: cpio ($(CPIO)) sometimes leaves directories without rx access. + +initial-module-image-jdk-setup: + $(RM) -r $(JDK_MODULE_IMAGE_DIR) + $(MKDIR) -p $(JDK_MODULE_IMAGE_DIR)/jre + ($(CD) $(JRE_MODULE_IMAGE_DIR) && $(FIND) . -depth -print \ + | $(CPIO) -pdum $(JDK_MODULE_IMAGE_DIR)/jre ) + $(RM) -rf $(JDK_MODULE_IMAGE_DIR)/jre/man + $(CHMOD) a+rx `$(FIND) $(JDK_MODULE_IMAGE_DIR) -type d` + +initial-module-image-jdk64-bindemos: + for dir in bin demo ; do \ + ( $(CD) $(OUTPUTDIR) && \ + $(TAR) cf - `$(FIND) $$dir -name '$(LIBARCH)' -print` | \ + ($(CD) $(JDK_MODULE_IMAGE_DIR) && $(TAR) xf -) ) ; \ + done + +# Solaris 64 bit image is special +initial-module-image-jdk-sol64:: initial-module-image-jdk-setup \ + initial-module-image-jdk64-bindemos \ + $(JDK_MODULE_LICENSES) $(JDK_MODULARLIZED_64_LICENSES) + +# DB files to add +ifeq ($(OPENJDK),true) + +initial-module-image-jdk-db: + +else + +# Create the list of db *.zip files to bundle with jdk +ABS_DB_PATH :=$(call FullPath,$(CLOSED_SHARE_SRC)/db) +DB_ZIP_LIST = $(shell $(LS) $(ABS_DB_PATH)/*.zip 2>/dev/null) + +initial-module-image-jdk-db: $(DB_ZIP_LIST) + $(MKDIR) -p $(JDK_MODULE_IMAGE_DIR)/db + for d in $(DB_ZIP_LIST); do \ + ($(CD) $(JDK_MODULE_IMAGE_DIR)/db && $(UNZIP) -o $$d); \ + done + +endif + +# Standard jdk image +initial-module-image-jdk:: initial-module-image-jdk-setup \ + initial-module-image-jdk-db \ + $(JDK_MODULE_LICENSES) $(JDK_MODULE_DOCFILES)