Sun, 09 Mar 2008 13:11:51 -0700
6649270: Change by-default openjdk building in control/make/makefile to use open source tree
Summary: Change build rules to allow for openjdk builds by default when building the closed or production build.
Reviewed-by: xdono
1 #
2 # Copyright 1995-2007 Sun Microsystems, Inc. All Rights Reserved.
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
7 # published by the Free Software Foundation. Sun designates this
8 # particular file as subject to the "Classpath" exception as provided
9 # by Sun in the LICENSE file that accompanied this code.
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 #
21 # Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
22 # CA 95054 USA or visit www.sun.com if you need additional information or
23 # have any questions.
24 #
26 #
27 # Common variables used by all the Java makefiles. This file should
28 # not contain rules.
29 #
31 # Define absolute paths to TOPDIRs
32 ABS_CONTROL_TOPDIR:=$(call OptFullPath,"$(CONTROL_TOPDIR)")
33 ABS_LANGTOOLS_TOPDIR:=$(call OptFullPath,"$(LANGTOOLS_TOPDIR)")
34 ABS_CORBA_TOPDIR:=$(call OptFullPath,"$(CORBA_TOPDIR)")
35 ABS_JAXP_TOPDIR:=$(call OptFullPath,"$(JAXP_TOPDIR)")
36 ABS_JAXWS_TOPDIR:=$(call OptFullPath,"$(JAXWS_TOPDIR)")
37 ABS_JDK_TOPDIR:=$(call OptFullPath,"$(JDK_TOPDIR)")
38 ABS_HOTSPOT_TOPDIR:=$(call OptFullPath,"$(HOTSPOT_TOPDIR)")
39 ABS_INSTALL_TOPDIR:=$(call OptFullPath,"$(INSTALL_TOPDIR)")
40 ABS_SPONSORS_TOPDIR:=$(call OptFullPath,"$(SPONSORS_TOPDIR)")
41 ABS_DEPLOY_TOPDIR:=$(call OptFullPath,"$(DEPLOY_TOPDIR)")
43 # Macro to return true or false if a file exists and is readable
44 define MkExists
45 $(shell if [ -r $1 ]; then $(ECHO) true; else $(ECHO) false; fi)
46 endef
48 HOTSPOT_SRC_AVAILABLE := $(call MkExists,$(HOTSPOT_TOPDIR)/make/Makefile)
49 ifndef BUILD_HOTSPOT
50 ifdef ALT_HOTSPOT_IMPORT_PATH
51 BUILD_HOTSPOT := false
52 else
53 BUILD_HOTSPOT := $(HOTSPOT_SRC_AVAILABLE)
54 endif
55 endif
57 LANGTOOLS_SRC_AVAILABLE := $(call MkExists,$(LANGTOOLS_TOPDIR)/make/Makefile)
58 ifndef BUILD_LANGTOOLS
59 ifdef ALT_LANGTOOLS_DIST
60 BUILD_LANGTOOLS := false
61 else
62 BUILD_LANGTOOLS := $(LANGTOOLS_SRC_AVAILABLE)
63 endif
64 endif
66 CORBA_SRC_AVAILABLE := $(call MkExists,$(CORBA_TOPDIR)/make/Makefile)
67 ifndef BUILD_CORBA
68 ifdef ALT_CORBA_DIST
69 BUILD_CORBA := false
70 else
71 BUILD_CORBA := $(CORBA_SRC_AVAILABLE)
72 endif
73 endif
75 JAXP_SRC_AVAILABLE := $(call MkExists,$(JAXP_TOPDIR)/make/Makefile)
76 ifndef BUILD_JAXP
77 ifdef ALT_JAXP_DIST
78 BUILD_JAXP := false
79 else
80 BUILD_JAXP := $(JAXP_SRC_AVAILABLE)
81 endif
82 endif
84 JAXWS_SRC_AVAILABLE := $(call MkExists,$(JAXWS_TOPDIR)/make/Makefile)
85 ifndef BUILD_JAXWS
86 ifdef ALT_JAXWS_DIST
87 BUILD_JAXWS := false
88 else
89 BUILD_JAXWS := $(JAXWS_SRC_AVAILABLE)
90 endif
91 endif
93 JDK_SRC_AVAILABLE := $(call MkExists,$(JDK_TOPDIR)/make/Makefile)
94 ifndef BUILD_JDK
95 BUILD_JDK := $(JDK_SRC_AVAILABLE)
96 endif
97 ifeq ($(JDK_SRC_AVAILABLE),true)
98 JDK_CLOSED_SRC_AVAILABLE := $(call MkExists,$(JDK_TOPDIR)/src/closed)
99 ifndef OPENJDK
100 ifeq ($(JDK_CLOSED_SRC_AVAILABLE),false)
101 OPENJDK = true
102 endif
103 endif
104 endif
106 DEPLOY_SRC_AVAILABLE := $(call MkExists,$(DEPLOY_TOPDIR)/make/Makefile)
107 ifndef BUILD_DEPLOY
108 BUILD_DEPLOY := $(DEPLOY_SRC_AVAILABLE)
109 endif
111 INSTALL_SRC_AVAILABLE := $(call MkExists,$(INSTALL_TOPDIR)/make/Makefile)
112 ifndef BUILD_INSTALL
113 ifdef DEV_ONLY
114 BUILD_INSTALL := false
115 else
116 BUILD_INSTALL := $(INSTALL_SRC_AVAILABLE)
117 endif
118 endif
120 SPONSORS_SRC_AVAILABLE := $(call MkExists,$(SPONSORS_TOPDIR)/make/Makefile)
121 ifndef BUILD_SPONSORS
122 ifdef DEV_ONLY
123 BUILD_SPONSORS := false
124 else
125 BUILD_SPONSORS := $(SPONSORS_SRC_AVAILABLE)
126 endif
127 endif
130 # Do we build the source and openjdk binary plug bundles?
131 BUNDLE_RULES = $(JDK_TOPDIR)/make/closed/bundles.gmk
132 BUNDLE_RULES_AVAILABLE := $(call MkExists,$(BUNDLE_RULES))
134 # Current things we do NOT build for OPENJDK
135 ifdef OPENJDK
136 BUILD_DEPLOY = false
137 BUILD_INSTALL = false
138 BUILD_SPONSORS = false
139 BUNDLE_RULES_AVAILABLE := false
140 # These could be over-ridden on the command line or in environment
141 ifndef SKIP_FASTDEBUG_BUILD
142 SKIP_FASTDEBUG_BUILD = true
143 endif
144 ifndef SKIP_DEBUG_BUILD
145 SKIP_DEBUG_BUILD = true
146 endif
147 ifndef SKIP_COMPARE_IMAGES
148 SKIP_COMPARE_IMAGES = true
149 endif
150 SKIP_OPENJDK_BUILD = true
151 else
152 ifndef SKIP_OPENJDK_BUILD
153 SKIP_OPENJDK_BUILD = false
154 endif
155 endif
157 # Solaris 64 bit builds are not complete enough to ever do this
158 ifeq ($(PLATFORM)$(ARCH_DATA_MODEL),solaris64)
159 SKIP_OPENJDK_BUILD = true
160 endif
162 # Many reasons why we would want to skip the comparison to previous jdk
163 ifndef SKIP_COMPARE_IMAGES
164 ifeq ($(BUILD_JDK), false)
165 SKIP_COMPARE_IMAGES = true
166 endif
167 ifeq ($(BUILD_DEPLOY), false)
168 SKIP_COMPARE_IMAGES = true
169 endif
170 ifeq ($(BUILD_INSTALL), false)
171 SKIP_COMPARE_IMAGES = true
172 endif
173 ifdef DEV_ONLY
174 SKIP_COMPARE_IMAGES = true
175 endif
176 endif
178 # Select defaults if these are not set to true or false
179 ifndef SKIP_DEBUG_BUILD
180 SKIP_DEBUG_BUILD=true
181 endif
182 ifndef SKIP_FASTDEBUG_BUILD
183 SKIP_FASTDEBUG_BUILD=false
184 endif
186 # Output directory for hotspot build
187 HOTSPOT_DIR = $(ABS_OUTPUTDIR)/hotspot
189 # If we are building components
190 ifndef ALT_LANGTOOLS_DIST
191 LANGTOOLS_OUTPUTDIR = $(ABS_OUTPUTDIR)/langtools
192 ABS_LANGTOOLS_DIST = $(LANGTOOLS_OUTPUTDIR)/dist
193 endif
194 ifndef ALT_CORBA_DIST
195 CORBA_OUTPUTDIR = $(ABS_OUTPUTDIR)/corba
196 ABS_CORBA_DIST = $(CORBA_OUTPUTDIR)/dist
197 endif
198 ifndef ALT_JAXP_DIST
199 JAXP_OUTPUTDIR = $(ABS_OUTPUTDIR)/jaxp
200 ABS_JAXP_DIST = $(JAXP_OUTPUTDIR)/dist
201 endif
202 ifndef ALT_JAXWS_DIST
203 JAXWS_OUTPUTDIR = $(ABS_OUTPUTDIR)/jaxws
204 ABS_JAXWS_DIST = $(JAXWS_OUTPUTDIR)/dist
205 endif
207 # Common make arguments (supplied to all component builds)
208 COMMON_BUILD_ARGUMENTS = \
209 JDK_TOPDIR=$(ABS_JDK_TOPDIR) \
210 JDK_MAKE_SHARED_DIR=$(ABS_JDK_TOPDIR)/make/common/shared \
211 EXTERNALSANITYCONTROL=true \
212 TARGET_CLASS_VERSION=$(TARGET_CLASS_VERSION) \
213 MILESTONE=$(MILESTONE) \
214 BUILD_NUMBER=$(BUILD_NUMBER) \
215 JDK_BUILD_NUMBER=$(JDK_BUILD_NUMBER) \
216 FULL_VERSION=$(FULL_VERSION) \
217 PREVIOUS_JDK_VERSION=$(PREVIOUS_JDK_VERSION) \
218 JDK_VERSION=$(JDK_VERSION) \
219 JDK_MKTG_VERSION=$(JDK_MKTG_VERSION) \
220 JDK_MAJOR_VERSION=$(JDK_MAJOR_VERSION) \
221 JDK_MINOR_VERSION=$(JDK_MINOR_VERSION) \
222 JDK_MICRO_VERSION=$(JDK_MICRO_VERSION)
224 ifdef ARCH_DATA_MODEL
225 COMMON_BUILD_ARGUMENTS += ARCH_DATA_MODEL=$(ARCH_DATA_MODEL)
226 endif
228 ifeq ($(DEBUG_NAME), debug)
229 COMMON_BUILD_ARGUMENTS += VARIANT=DBG DEBUG_CLASSFILES=true
230 endif
232 ifeq ($(DEBUG_NAME), fastdebug)
233 COMMON_BUILD_ARGUMENTS += VARIANT=DBG FASTDEBUG=true DEBUG_CLASSFILES=true
234 endif
236 ifdef COOKED_JDK_UPDATE_VERSION
237 COMMON_BUILD_ARGUMENTS += COOKED_JDK_UPDATE_VERSION=$(COOKED_JDK_UPDATE_VERSION)
238 endif
240 ifdef COOKED_BUILD_NUMBER
241 COMMON_BUILD_ARGUMENTS += COOKED_BUILD_NUMBER=$(COOKED_BUILD_NUMBER)
242 endif
244 ifdef ANT_HOME
245 COMMON_BUILD_ARGUMENTS += ANT_HOME="$(ANT_HOME)"
246 endif
248 ifdef FINDBUGS_HOME
249 COMMON_BUILD_ARGUMENTS += FINDBUGS_HOME="$(FINDBUGS_HOME)"
250 endif