Print this page
Split |
Close |
Expand all |
Collapse all |
--- old/make/sun/xawt/Makefile
+++ new/make/sun/xawt/Makefile
1 1 #
2 -# Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved.
2 +# Copyright (c) 2002, 2012, Oracle and/or its affiliates. All rights reserved.
3 3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 4 #
5 5 # This code is free software; you can redistribute it and/or modify it
6 6 # under the terms of the GNU General Public License version 2 only, as
7 7 # published by the Free Software Foundation. Oracle designates this
8 8 # particular file as subject to the "Classpath" exception as provided
9 9 # by Oracle in the LICENSE file that accompanied this code.
10 10 #
11 11 # This code is distributed in the hope that it will be useful, but WITHOUT
12 12 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 13 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 14 # version 2 for more details (a copy is included in the LICENSE file that
15 15 # accompanied this code).
16 16 #
17 17 # You should have received a copy of the GNU General Public License version
18 18 # 2 along with this work; if not, write to the Free Software Foundation,
19 19 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 20 #
21 21 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 22 # or visit www.oracle.com if you need additional information or have any
23 23 # questions.
24 24 #
25 25
26 26 BUILDDIR = ../..
27 27 PACKAGE = sun.awt.X11
28 28 LIBRARY = awt_xawt
29 29 PRODUCT = sun
30 30
31 31 include $(BUILDDIR)/common/Defs.gmk
32 32
33 33 GEN_DIR=$(GENSRCDIR)/sun/awt/X11
34 34
35 35 CLASSES_INIT += $(TEMPDIR)/.gen.wrappers $(TEMPDIR)/.gen_icons touch.wrappers
36 36
37 37 .PHONY: generated.clean
38 38
39 39 #
40 40 # Files
41 41 #
42 42 include FILES_c_unix.gmk
43 43 include FILES_export_unix.gmk
44 44 AUTO_FILES_JAVA_DIRS = sun/awt/X11
45 45 AUTO_JAVA_PRUNE = WrapperGenerator.java
46 46
47 47 LDFLAGS += -L$(OPENWIN_LIB)
48 48
49 49 # For Xrender extension.
50 50 ifeq ($(PLATFORM), solaris)
51 51 LDFLAGS += -L/usr/openwin/sfw/lib$(ISA_DIR) -R/usr/openwin/sfw/lib$(ISA_DIR)
52 52 endif
53 53
54 54 ifeq ($(PLATFORM), linux)
55 55 LDFLAGS += -lpthread
56 56 dummy := $(shell $(MKDIR) -p $(LIB_LOCATION))
57 57 endif
58 58
59 59 ifeq ($(PLATFORM), macosx)
60 60 LDFLAGS += -pthread
61 61 dummy := $(shell $(MKDIR) -p $(LIB_LOCATION))
62 62 endif
63 63
64 64 # Since this library will be living in a subdirectory below the other libraries
65 65 # we need to add an extra runpath so that libraries in the upper directory
66 66 # are found at runtime.
67 67 LD_RUNPATH_EXTRAS = ..
68 68
69 69 #
70 70 # Rules.
71 71 #
72 72 include $(BUILDDIR)/common/Mapfile-vers.gmk
73 73 include $(BUILDDIR)/common/Library.gmk
74 74
75 75 #
76 76 # Add to the ambient vpath to pick up files in subdirectories
77 77 #
78 78 vpath %.c $(SHARE_SRC)/native/sunawt/alphacomposite
79 79 vpath %.c $(PLATFORM_SRC)/native/sun/xawt
80 80 vpath %.c $(PLATFORM_SRC)/native/sun/awt
81 81 vpath %.c $(SHARE_SRC)/native/sun/awt/debug
82 82 vpath %.c $(SHARE_SRC)/native/sun/awt/image
83 83 vpath %.c $(SHARE_SRC)/native/sun/awt/image/gif
84 84 vpath %.c $(SHARE_SRC)/native/sun/awt/image/cvutils
85 85 vpath %.c $(SHARE_SRC)/native/sun/awt/shell
86 86 vpath %.c $(SHARE_SRC)/native/sun/java2d
87 87 vpath %.c $(SHARE_SRC)/native/sun/java2d/loops
88 88 vpath %.c $(SHARE_SRC)/native/sun/java2d/pipe
89 89 vpath %.c $(SHARE_SRC)/native/sun/awt/medialib
90 90 vpath %.c $(SHARE_SRC)/native/sun/awt/utility
91 91 vpath %.cpp $(SHARE_SRC)/native/sun/image
92 92 vpath %.c $(SHARE_SRC)/native/sun/font
93 93 vpath %.c $(PLATFORM_SRC)/native/sun/awt/robot_child
94 94 vpath %.c $(SHARE_SRC)/native/sun/java2d/opengl
95 95 vpath %.c $(PLATFORM_SRC)/native/sun/java2d/opengl
96 96 vpath %.c $(PLATFORM_SRC)/native/sun/java2d/x11
97 97
98 98 OTHER_LDLIBS = $(LIBM) -lawt -lXext -lX11 -lXrender $(LIBDL) \
99 99 $(LDFLAGS_COMMON) $(AWT_RUNPATH) $(OTHER_LDFLAGS) -lXtst -lXi
100 100
101 101 ifeq ($(PLATFORM), solaris)
102 102 CPPFLAGS += -DFUNCPROTO=15
103 103 dummy := $(shell $(MKDIR) -p $(LIB_LOCATION))
104 104 endif
105 105
106 106 CPPFLAGS += -I$(CUPS_HEADERS_PATH)
107 107
108 108 CPPFLAGS += -DXAWT -DXAWT_HACK \
109 109 -I$(TEMPDIR)/../../sun.awt/awt/CClassHeaders \
110 110 -I$(PLATFORM_SRC)/native/sun/awt \
111 111 -I$(PLATFORM_SRC)/native/sun/xawt \
112 112 -I$(PLATFORM_SRC)/native/sun/jdga \
113 113 -I$(SHARE_SRC)/native/sun/awt/debug \
114 114 -I$(SHARE_SRC)/native/sun/awt/image/cvutils \
115 115 -I$(SHARE_SRC)/native/sun/java2d \
116 116 -I$(SHARE_SRC)/native/sun/java2d/loops \
117 117 -I$(SHARE_SRC)/native/sun/awt/image/cvutils \
118 118 -I$(SHARE_SRC)/native/sun/awt/image \
119 119 -I$(SHARE_SRC)/native/sun/font \
120 120 -I$(PLATFORM_SRC)/native/sun/java2d \
121 121 -I$(SHARE_SRC)/native/sun/java2d/pipe \
122 122 -I$(SHARE_SRC)/native/sun/java2d/opengl \
123 123 -I$(PLATFORM_SRC)/native/sun/java2d/opengl \
124 124 -I$(PLATFORM_SRC)/native/sun/java2d/x11 \
125 125 -I$(SHARE_SRC)/native/sun/dc/path \
126 126 -I$(SHARE_SRC)/native/sun/dc/doe \
127 127 -I$(SHARE_SRC)/native/sun/awt/alphacomposite \
128 128 -I$(SHARE_SRC)/native/sun/awt/medialib \
129 129 -I$(PLATFORM_SRC)/native/sun/awt/medialib \
130 130 -I$(PLATFORM_SRC)/native/sun/font \
131 131 -I$(SHARE_SRC)/native/sun/awt \
132 132 -I$(PLATFORM_SRC)/native/sun/awt
133 133
134 134 ifeq ($(PLATFORM), linux)
135 135 ifndef CROSS_COMPILE_ARCH
136 136 # Allows for builds on Debian GNU Linux, X11 is in a different place
137 137 # This should really be handled at a higher-level so we don't have to
138 138 # work-around this when cross-compiling
139 139 CPPFLAGS += -I/usr/X11R6/include/X11/extensions \
140 140 -I/usr/include/X11/extensions \
141 141 -I$(OPENWIN_HOME)/include
142 142 else
143 143 CPPFLAGS += -I$(OPENWIN_HOME)/include/X11/extensions \
144 144 -I$(OPENWIN_HOME)/include
145 145 endif
146 146 endif
147 147
148 148 # We have some odd logic here because some Solaris 10 updates
149 149 # have a render.h file that suggests gradients are supported, but
150 150 # the Xrender.h doesn't have the corresponding type definitions.
151 151 # Earlier updates have neither. We'd like to know if there's a mismatch.
152 152 # Whilst in the C preprocessor we can tell if the render.h define's are set
153 153 # we can't tell anything about C declarations.
154 154 # A grep of Xrender.h is the only way to know this. If they are absent
155 155 # we will set a flag indicating this mismatch and the JDK source file
156 156 # will interpret it to resolve the problem.
157 157 ifeq ($(PLATFORM), solaris)
158 158 CPPFLAGS += -I$(OPENWIN_HOME)/include/X11/extensions
159 159 OS_VERSION := $(shell uname -r)
160 160 XRENDER_H := $(OPENWIN_HOME)/share/include/X11/extensions/Xrender.h
161 161 ifeq ($(OS_VERSION),5.10)
162 162 LINEARGRADIENT_CNT := $(shell $(EGREP) -c XLinearGradient $(XRENDER_H))
163 163 ifeq ($(LINEARGRADIENT_CNT),0)
164 164 CFLAGS+= -DSOLARIS10_NO_XRENDER_STRUCTS
165 165 endif
166 166 endif
167 167 endif
168 168
169 169 ifeq ($(PLATFORM), macosx)
170 170 CPPFLAGS += -DX11_PATH=\"$(X11_PATH)\" -DPACKAGE_PATH=\"$(PACKAGE_PATH)\"
171 171 endif
172 172
173 173 ifeq ($(MILESTONE), internal)
174 174 CPPFLAGS += -DINTERNAL_BUILD
175 175 endif
176 176
177 177 #
178 178 # Generation of wrappers
179 179 #
180 180 SIZER_DIR=$(GEN_DIR)/generator
181 181 SIZER = $(SIZER_DIR)/sizer
182 182 SIZER_32_C = $(SIZER).32.c
183 183 SIZER_64_C = $(SIZER).64.c
184 184 CFLAGS_32=$(CFLAGS)
185 185 CFLAGS_64=$(CFLAGS)
186 186
187 187 ifeq ($(PLATFORM), solaris)
188 188
189 189 isalist:=$(shell $(ISAINFO))
190 190
191 191 ifneq (,$(findstring sparcv9, $(isalist)))
192 192 # On sparcv9 we generate both 32 and 64-bit sizers in spite of ARCH_DATA_MODEL.
193 193 # On sparcv9 CFLAGS already contain $(XARCH_OPTION/64), so to generate 32-bit sizer we need to change this option.
194 194 CFLAGS_32=$(subst $(XARCH_OPTION/64),$(XARCH_OPTION/32),$(CFLAGS))
195 195 SIZERS = $(SIZER).32 $(SIZER).64
196 196 SIZERS_C = $(SIZER_32_C) $(SIZER_64_C)
197 197 SIZES = $(WRAPPER_GENERATOR_DIR)/sizes.32 $(WRAPPER_GENERATOR_DIR)/sizes.64
198 198 CFLAGS_64=$(CFLAGS) $(XARCH_OPTION/64)
199 199 else
200 200 ifneq (,$(findstring amd64, $(isalist)))
201 201 # On amd64 we generate both 32 and 64-bit sizers in spite of ARCH_DATA_MODEL.
202 202 # On amd64 CFLAGS already contain $(XARCH_OPTION/64), so to generate 32-bit sizer we need to change this option.
203 203 CFLAGS_32=$(subst $(XARCH_OPTION/64),$(XARCH_OPTION/32),$(CFLAGS))
204 204 SIZERS = $(SIZER).32 $(SIZER).64
205 205 SIZERS_C = $(SIZER_32_C) $(SIZER_64_C)
206 206 SIZES = $(WRAPPER_GENERATOR_DIR)/sizes.32 $(WRAPPER_GENERATOR_DIR)/sizes.64
207 207 CFLAGS_64=$(CFLAGS) $(XARCH_OPTION/64)
208 208 else # !sparcv9 : includes (32-bit) sparc, i586
209 209 SIZERS = $(SIZER).32
210 210 SIZERS_C = $(SIZER_32_C)
211 211 SIZES = $(WRAPPER_GENERATOR_DIR)/sizes.32
212 212 endif # amd64
213 213 endif # sparcv9
214 214
215 215 else # !solaris
216 216
217 217 ifeq ($(PLATFORM), macosx)
↓ open down ↓ |
205 lines elided |
↑ open up ↑ |
218 218 CFLAGS_32=-arch i386
219 219 SIZERS = $(SIZER).32 $(SIZER).64
220 220 SIZERS_C = $(SIZER_32_C) $(SIZER_64_C)
221 221 SIZES = $(WRAPPER_GENERATOR_DIR)/sizes.32 $(WRAPPER_GENERATOR_DIR)/sizes.64
222 222 CFLAGS_64=-arch x86_64
223 223 else # !macosx
224 224 ifeq ($(ARCH_DATA_MODEL), 32)
225 225 SIZERS = $(SIZER).32
226 226 SIZERS_C = $(SIZER_32_C)
227 227 SIZES = $(WRAPPER_GENERATOR_DIR)/sizes.32
228 +ifdef CROSS_COMPILE_ARCH
229 +CFLAGS_32 = -m32
230 +endif
228 231 else # !32
229 232 SIZERS = $(SIZER).64
230 233 SIZERS_C = $(SIZER_64_C)
231 234 SIZES = $(WRAPPER_GENERATOR_DIR)/sizes.64
235 +ifdef CROSS_COMPILE_ARCH
236 +CFLAGS_64 = -m64
237 +endif
232 238 endif # 32
233 239 endif # !macosx
234 240 endif # solaris
235 241
236 242 # XXX Hack for 6185483 - use hard-coded sizes.
237 243 # Add the 64-bit platforms that need to be included into 32-bit build
238 244 # and have sizes.64-$(PLATFORM)-$(LIBARCH) hardcoded in the workspace
239 245 ifeq ($(PLATFORM)-$(LIBARCH), solaris-i386)
240 246 # If you define DOHACK=true for some combination of $(PLATFORM)-$(LIBARCH),
241 247 # make sure you have sizes.64-$(PLATFORM)-$(LIBARCH) pre-generated in
242 248 # $(PLATFORM_SRC)/classes/sun/awt/X11/generator/
243 249 DOHACK=true
244 250 endif # Hack
245 251
246 252 ifeq ($(DOHACK), true)
247 253 PREDEFINED_SIZES_TMPL=$(PLATFORM_SRC)/classes/sun/awt/X11/generator/sizes.64-$(PLATFORM)-$(LIBARCH)
248 254 PREDEFINED_SIZES=$(WRAPPER_GENERATOR_DIR)/sizes.64
249 255 SIZES += $(WRAPPER_GENERATOR_DIR)/sizes.64
250 256 endif
251 257
252 258 ifeq ($(PLATFORM)-$(LIBARCH), solaris-amd64)
253 259 DOCOMPARE=true
254 260 endif
255 261 # 64 bit sizers are generated on platform-libarch (left) for use
256 262 # on platform-libarch (right) and stored under the latter name.
↓ open down ↓ |
15 lines elided |
↑ open up ↑ |
257 263 # Do compare manually stored and automatically generated pair(s)
258 264 # if DOCOMPARE=true, just after the generation.
259 265 STORED_SIZES_TMPL_solaris_amd64=$(PLATFORM_SRC)/classes/sun/awt/X11/generator/sizes.64-solaris-i386
260 266
261 267 WRAPPER_GENERATOR_JAVA=$(PLATFORM_SRC)/classes/sun/awt/X11/generator/WrapperGenerator.java
262 268 WRAPPER_GENERATOR_DIR=$(GENSRCDIR)/sun/awt/X11/generator
263 269 WRAPPER_GENERATOR_TEMPDIR=$(TEMPDIR)/sun/awt/X11/generator
264 270 WRAPPER_GENERATOR_CLASS=$(WRAPPER_GENERATOR_TEMPDIR)/WrapperGenerator.class
265 271 XLIBTYPES=$(PLATFORM_SRC)/classes/sun/awt/X11/generator/xlibtypes.txt
266 272
267 -$(SIZERS): $(SIZERS_C)
268 - $(prep-target)
269 273 ifndef CROSS_COMPILE_ARCH
270 - $(CC) $(CFLAGS_$(subst .,,$(suffix $@))) $(CPPFLAGS) -c -o $(SIZER)$(suffix $@).o $(SIZER)$(suffix $@).c
271 - $(CC) $(CFLAGS_$(subst .,,$(suffix $@))) -o $@ $(CPPFLAGS) $(SIZER)$(suffix $@).o
274 +SIZERS_CC = $(CC)
272 275 else
273 - $(HOST_CC) $(CPPFLAGS) -c -o $(SIZER)$(suffix $@).o $(SIZER)$(suffix $@).c
274 - $(HOST_CC) $(CPPFLAGS) -o $@ $(SIZER)$(suffix $@).o
276 +SIZERS_CC = $(HOST_CC)
275 277 endif
276 278
279 +$(SIZERS): $(SIZERS_C)
280 + $(prep-target)
281 +
282 + $(SIZERS_CC) $(CFLAGS_$(subst .,,$(suffix $@))) $(CPPFLAGS) -c -o $(SIZER)$(suffix $@).o $(SIZER)$(suffix $@).c
283 + $(SIZERS_CC) $(CFLAGS_$(subst .,,$(suffix $@))) -o $@ $(CPPFLAGS) $(SIZER)$(suffix $@).o
284 +
277 285 $(WRAPPER_GENERATOR_CLASS): $(WRAPPER_GENERATOR_JAVA)
278 286 $(prep-target)
279 287 $(BOOT_JAVAC_CMD) -d $(WRAPPER_GENERATOR_TEMPDIR) $(WRAPPER_GENERATOR_JAVA)
280 288
281 289 $(SIZERS_C): $(WRAPPER_GENERATOR_CLASS) $(XLIBTYPES)
282 290 $(prep-target)
283 291 $(MKDIR) -p $(WRAPPER_GENERATOR_TEMPDIR)
284 292 $(BOOT_JAVA_CMD) -cp $(WRAPPER_GENERATOR_TEMPDIR) WrapperGenerator \
285 293 $(SIZER_DIR) $(XLIBTYPES) "sizer" $(subst .,,$(suffix $(basename $@)))
286 294
287 295 $(SIZES): $(SIZERS)
288 296 @if [ "$(DOHACK)$@" = "true$(PREDEFINED_SIZES)" ]; then \
289 297 $(ECHO) COPYING $(PREDEFINED_SIZES_TMPL) into $@; \
290 298 $(CP) $(PREDEFINED_SIZES_TMPL) $@; \
291 299 $(CHMOD) +w $@;\
292 300 else \
293 301 $(ECHO) GENERATING $@; \
294 302 $(WRAPPER_GENERATOR_DIR)/sizer$(suffix $@) > $@; \
295 303 fi
296 304 @if [ "$(DOCOMPARE)$(suffix $@)" = "true.64" ]; then \
297 305 $(ECHO) COMPARING $@ and $(STORED_SIZES_TMPL_$(PLATFORM)_$(LIBARCH)); \
298 306 $(DIFF) $@ $(STORED_SIZES_TMPL_$(PLATFORM)_$(LIBARCH)); \
299 307 fi
300 308
301 309 $(TEMPDIR)/.gen.wrappers: $(SIZES) $(WRAPPER_GENERATOR_CLASS) $(XLIBTYPES)
302 310 $(BOOT_JAVA_CMD) -cp $(WRAPPER_GENERATOR_TEMPDIR) WrapperGenerator \
303 311 $(GEN_DIR) $(XLIBTYPES) "gen" $(WRAPPER_GENERATOR_DIR)/sizes
304 312
305 313 touch.wrappers: $(TEMPDIR)/.gen.wrappers
306 314 $(MKDIR) -p $(TEMPDIR)
307 315 $(TOUCH) $(TEMPDIR)/.gen.wrappers
308 316
309 317 generated.clean:
310 318 $(RM) -r $(WRAPPER_GENERATOR_TEMPDIR)
311 319 $(RM) -r $(WRAPPER_GENERATOR_DIR)
312 320 $(RM) -r $(GEN_DIR)/*.java
313 321 $(RM) -r $(TEMPDIR)/.gen_icons
314 322
315 323 ifdef OPENJDK
316 324 ICONS_PATH_PREFIX=$(PLATFORM_SRC)
317 325 else
318 326 ICONS_PATH_PREFIX=$(CLOSED_SRC)/solaris
319 327 endif
320 328
321 329 ICONS = \
322 330 $(ICONS_PATH_PREFIX)/classes/sun/awt/X11/java-icon16.png \
323 331 $(ICONS_PATH_PREFIX)/classes/sun/awt/X11/java-icon24.png \
324 332 $(ICONS_PATH_PREFIX)/classes/sun/awt/X11/java-icon32.png \
325 333 $(ICONS_PATH_PREFIX)/classes/sun/awt/X11/java-icon48.png
326 334
327 335
328 336 ICONPATH=$(PLATFORM_SRC)/classes/sun/awt/X11
329 337
330 338 ICONS += \
331 339 $(ICONPATH)/security-icon-bw16.png \
332 340 $(ICONPATH)/security-icon-interim16.png \
333 341 $(ICONPATH)/security-icon-yellow16.png \
334 342 $(ICONPATH)/security-icon-bw24.png \
335 343 $(ICONPATH)/security-icon-interim24.png \
336 344 $(ICONPATH)/security-icon-yellow24.png \
337 345 $(ICONPATH)/security-icon-bw32.png \
338 346 $(ICONPATH)/security-icon-interim32.png \
339 347 $(ICONPATH)/security-icon-yellow32.png \
340 348 $(ICONPATH)/security-icon-bw48.png \
341 349 $(ICONPATH)/security-icon-interim48.png \
342 350 $(ICONPATH)/security-icon-yellow48.png
343 351
344 352 TEMPDIR_CLASSES = $(TEMPDIR)/classes
345 353
346 354 $(TEMPDIR_CLASSES)/sun/awt/X11/ToBin.class: ToBin.java
347 355 @$(prep-target)
348 356 $(BOOT_JAVAC_CMD) -d $(TEMPDIR_CLASSES) $<
349 357
350 358 $(TEMPDIR)/.gen_icons: $(TEMPDIR_CLASSES)/sun/awt/X11/ToBin.class $(ICONS)
351 359 $(prep-target)
352 360 for i in $(ICONS); do \
353 361 filename=`basename $$i`; \
354 362 name=`$(ECHO) $$filename | $(TR) '\-.' '__'`; \
355 363 classname=$(GEN_DIR)/XAWTIcon32_$$name.java; \
356 364 $(RM) $$classname; \
357 365 $(ECHO) "package sun.awt.X11;" >> $$classname ; \
358 366 $(ECHO) "public class XAWTIcon32_$$name {" >> $$classname; \
359 367 $(ECHO) "public static int[] $$name = { " >> $$classname; \
360 368 $(CAT) $$i | \
361 369 $(BOOT_JAVA_CMD) -cp $(TEMPDIR_CLASSES) \
362 370 -Djava.awt.headless=true \
363 371 sun.awt.X11.ToBin >> $$classname; \
364 372 $(ECHO) "}; }" >> $$classname; \
365 373 classname=$(GEN_DIR)/XAWTIcon64_$$name.java; \
366 374 $(RM) $$classname; \
367 375 $(ECHO) "package sun.awt.X11;" >> $$classname ; \
368 376 $(ECHO) "public class XAWTIcon64_$$name {" >> $$classname; \
369 377 $(ECHO) "public static long[] $$name = { " >> $$classname; \
370 378 $(CAT) $$i | \
371 379 $(BOOT_JAVA_CMD) -cp $(TEMPDIR_CLASSES) \
372 380 -Djava.awt.headless=true \
373 381 sun.awt.X11.ToBin >> $$classname; \
374 382 $(ECHO) "}; }" >> $$classname; \
375 383 done
376 384 $(TOUCH) $@
377 385
378 386 clean clobber:: generated.clean
379 387
380 388 .PHONY: generated.clean robot_child
381 389
↓ open down ↓ |
95 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX