author | alanb |
Sun, 05 Feb 2012 12:29:31 +0000 | |
changeset 11825 | 267ac03556be |
parent 5506 | 202f599c92aa |
permissions | -rw-r--r-- |
2 | 1 |
# |
5506 | 2 |
# Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved. |
2 | 3 |
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 |
# |
|
5 |
# This code is free software; you can redistribute it and/or modify it |
|
6 |
# under the terms of the GNU General Public License version 2 only, as |
|
5506 | 7 |
# published by the Free Software Foundation. Oracle designates this |
2 | 8 |
# particular file as subject to the "Classpath" exception as provided |
5506 | 9 |
# by Oracle in the LICENSE file that accompanied this code. |
2 | 10 |
# |
11 |
# This code is distributed in the hope that it will be useful, but WITHOUT |
|
12 |
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
13 |
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
14 |
# version 2 for more details (a copy is included in the LICENSE file that |
|
15 |
# accompanied this code). |
|
16 |
# |
|
17 |
# You should have received a copy of the GNU General Public License version |
|
18 |
# 2 along with this work; if not, write to the Free Software Foundation, |
|
19 |
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
20 |
# |
|
5506 | 21 |
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
22 |
# or visit www.oracle.com if you need additional information or have any |
|
23 |
# questions. |
|
2 | 24 |
# |
25 |
||
26 |
# JDK jars where component classes come from as second choice |
|
27 |
JDK_RT_JAR = $(JDK_IMPORT_PATH)/jre/lib/rt.jar |
|
28 |
JDK_TOOLS_JAR = $(JDK_IMPORT_PATH)/lib/tools.jar |
|
29 |
JDK_RESOURCES_JAR = $(JDK_IMPORT_PATH)/jre/lib/resources.jar |
|
30 |
||
31 |
# The specific packages that come from or go to rt.jar and tools.jar |
|
32 |
# IF the component deliverables are not available. |
|
33 |
IMPORT_TOOLS_PACKAGES = |
|
34 |
IMPORT_RT_PACKAGES = |
|
35 |
||
36 |
# The following will add to IMPORT_TOOLS_PACKAGES and/or IMPORT_RT_PACKAGES |
|
37 |
ifndef LANGTOOLS_DIST |
|
38 |
include $(BUILDDIR)/common/internal/Defs-langtools.gmk |
|
39 |
endif |
|
40 |
ifndef CORBA_DIST |
|
41 |
include $(BUILDDIR)/common/internal/Defs-corba.gmk |
|
42 |
endif |
|
43 |
ifndef JAXP_DIST |
|
44 |
include $(BUILDDIR)/common/internal/Defs-jaxp.gmk |
|
45 |
endif |
|
46 |
ifndef JAXWS_DIST |
|
47 |
include $(BUILDDIR)/common/internal/Defs-jaxws.gmk |
|
48 |
endif |
|
49 |
||
50 |
# Clean up these lists so empty lists are empty |
|
51 |
IMPORT_TOOLS_PACKAGES := $(strip $(IMPORT_TOOLS_PACKAGES)) |
|
52 |
IMPORT_RT_PACKAGES := $(strip $(IMPORT_RT_PACKAGES)) |
|
53 |
||
54 |
# Relative paths to import component deliverables |
|
55 |
CLASSES_JAR_FILE=lib/classes.jar |
|
56 |
SRC_ZIP_FILE=lib/src.zip |
|
57 |
BIN_ZIP_FILE=lib/bin.zip |
|
58 |
DOC_ZIP_FILE=lib/doc.zip |
|
59 |
||
60 |
################################################################# |
|
61 |
# Macros: |
|
62 |
||
63 |
# Importing component class files |
|
64 |
define import-one-classes |
|
65 |
@if [ "$($1)" != "" ] ; then \ |
|
66 |
$(ECHO) "Importing classes from component $1"; \ |
|
67 |
$(call Unjar,$2,$($1)/$(CLASSES_JAR_FILE),); \ |
|
68 |
fi |
|
69 |
endef |
|
70 |
||
71 |
# Importing optional component doc files (for man pages?) |
|
72 |
define import-one-docs |
|
73 |
@if [ "$($1)" != "" -a -f $($1)/$(DOC_ZIP_FILE) ] ; then \ |
|
74 |
$(ECHO) "Importing docs from component $1"; \ |
|
75 |
$(call Unzipper,$2,$($1)/$(DOC_ZIP_FILE)); \ |
|
76 |
fi |
|
77 |
endef |
|
78 |
||
79 |
# Importing optional component src files (for jdk src.zip and javadoc) |
|
80 |
define import-one-sources |
|
81 |
@if [ "$($1)" != "" ] ; then \ |
|
82 |
$(ECHO) "Importing sources from component $1"; \ |
|
83 |
$(call Unzipper,$2,$($1)/$(SRC_ZIP_FILE)); \ |
|
84 |
fi |
|
85 |
endef |
|
86 |
||
87 |
# Importing optional component bin files (for install image) |
|
88 |
define import-one-binaries |
|
89 |
@if [ "$($1)" != "" -a -f $($1)/$(BIN_ZIP_FILE) ] ; then \ |
|
90 |
$(ECHO) "Importing binaries from component $1"; \ |
|
91 |
$(call Unzipper,$2,$($1)/$(BIN_ZIP_FILE)); \ |
|
92 |
fi |
|
93 |
endef |
|
94 |
||
95 |
# Unzip zip file $2 into directory $1 (if $2 exists) |
|
96 |
# Warning: $2 must be absolute path not relative |
|
97 |
define Unzipper |
|
98 |
( \ |
|
99 |
$(MKDIR) -p $1; \ |
|
100 |
$(ECHO) "( $(CD) $1 && $(UNZIP) -o $2 )"; \ |
|
101 |
( $(CD) $1 && $(UNZIP) -o $2 ) \ |
|
102 |
) |
|
103 |
endef |
|
104 |
||
105 |
# Unjar directories $3 from jar file $2 into directory $1 (if $2 exists) |
|
106 |
# Warning: $2 must be absolute path not relative |
|
107 |
define Unjar |
|
108 |
( \ |
|
109 |
$(MKDIR) -p $1; \ |
|
916
867515b155b5
6728161: Add SKIP_BOOT_CYCLE feature to create boot jdk and use it during build
ohair
parents:
2
diff
changeset
|
110 |
$(ECHO) "( $(CD) $1 && $(BOOT_JAR_CMD) xfv $2 $3 $(BOOT_JAR_JFLAGS) )" ; \ |
867515b155b5
6728161: Add SKIP_BOOT_CYCLE feature to create boot jdk and use it during build
ohair
parents:
2
diff
changeset
|
111 |
( $(CD) $1 && $(BOOT_JAR_CMD) xfv $2 $3 $(BOOT_JAR_JFLAGS) ) && \ |
867515b155b5
6728161: Add SKIP_BOOT_CYCLE feature to create boot jdk and use it during build
ohair
parents:
2
diff
changeset
|
112 |
( $(CD) $1 && $(java-vm-cleanup) ) \ |
2 | 113 |
) |
114 |
endef |
|
115 |
||
116 |
# Import all component sources into directory $1 |
|
117 |
define import-component-sources |
|
118 |
$(call import-one-sources,LANGTOOLS_DIST,$1) |
|
119 |
$(call import-one-sources,CORBA_DIST,$1) |
|
120 |
$(call import-one-sources,JAXP_DIST,$1) |
|
121 |
$(call import-one-sources,JAXWS_DIST,$1) |
|
122 |
endef |
|
123 |
||
124 |
# Import all component docs into directory $1 (optional) |
|
125 |
define import-component-docs |
|
126 |
$(call import-one-docs,LANGTOOLS_DIST,$1) |
|
127 |
$(call import-one-docs,CORBA_DIST,$1) |
|
128 |
$(call import-one-docs,JAXP_DIST,$1) |
|
129 |
$(call import-one-docs,JAXWS_DIST,$1) |
|
130 |
endef |
|
131 |
||
132 |
# Import all component bins into directory $1 (optional) |
|
133 |
define import-component-binaries |
|
134 |
$(call import-one-binaries,LANGTOOLS_DIST,$1) |
|
135 |
$(call import-one-binaries,CORBA_DIST,$1) |
|
136 |
$(call import-one-binaries,JAXP_DIST,$1) |
|
137 |
$(call import-one-binaries,JAXWS_DIST,$1) |
|
138 |
if [ "$(CORBA_DIST)" = "" ] ; then \ |
|
139 |
$(MKDIR) -p $(OUTPUTDIR)/lib ; \ |
|
140 |
( $(CD) $(JDK_IMPORT_PATH) && $(CP) $(IMPORT_CORBA_BINARIES) $(ABS_OUTPUTDIR)/lib ) ; \ |
|
141 |
fi |
|
142 |
endef |
|
143 |
||
144 |
# Import all component classes into directory $1 |
|
145 |
# Here we special case classes coming from JDK when component not supplied |
|
146 |
define import-component-classes |
|
147 |
$(ECHO) "Import classes from $(JDK_IMPORT_PATH)" |
|
148 |
if [ "$(IMPORT_TOOLS_PACKAGES)" != "" ] ; then \ |
|
149 |
$(call Unjar,$1,$(JDK_RESOURCES_JAR),$(IMPORT_TOOLS_PACKAGES)); \ |
|
150 |
$(call Unjar,$1,$(JDK_TOOLS_JAR),$(IMPORT_TOOLS_PACKAGES)); \ |
|
151 |
fi |
|
152 |
if [ "$(IMPORT_RT_PACKAGES)" != "" ] ; then \ |
|
153 |
$(call Unjar,$1,$(JDK_RESOURCES_JAR),$(IMPORT_RT_PACKAGES)); \ |
|
154 |
$(call Unjar,$1,$(JDK_RT_JAR),$(IMPORT_RT_PACKAGES)); \ |
|
155 |
fi |
|
156 |
$(call import-one-classes,LANGTOOLS_DIST,$1) |
|
157 |
$(call import-one-classes,CORBA_DIST,$1) |
|
158 |
$(call import-one-classes,JAXP_DIST,$1) |
|
159 |
$(call import-one-classes,JAXWS_DIST,$1) |
|
160 |
endef |
|
161 |
||
162 |
# Clean up import files |
|
163 |
define import-component-sources-clean |
|
164 |
$(RM) -r $1 |
|
165 |
endef |
|
166 |
define import-component-docs-clean |
|
167 |
$(RM) -r $1 |
|
168 |
endef |
|
169 |
define import-component-classes-clean |
|
170 |
$(RM) -r $(IMPORT_TOOLS_PACKAGES:%=$1/%) |
|
171 |
$(RM) -r $(IMPORT_RT_PACKAGES:%=$1/%) |
|
172 |
endef |
|
173 |