2
|
1 |
#
|
133
|
2 |
# Copyright 2002-2008 Sun Microsystems, Inc. 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
|
|
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 |
#
|
|
25 |
|
|
26 |
BUILDDIR = ../..
|
|
27 |
PACKAGE = sun.awt.X11
|
|
28 |
LIBRARY = mawt
|
|
29 |
LIBRARY_OUTPUT = xawt
|
|
30 |
LIB_LOCATION = $(LIBDIR)/$(LIBARCH)/xawt
|
|
31 |
PRODUCT = sun
|
|
32 |
|
|
33 |
include $(BUILDDIR)/common/Defs.gmk
|
|
34 |
|
|
35 |
GEN_DIR=$(GENSRCDIR)/sun/awt/X11
|
|
36 |
|
|
37 |
CLASSES_INIT += $(TEMPDIR)/.gen.wrappers $(TEMPDIR)/.gen_icons touch.wrappers
|
|
38 |
|
|
39 |
.PHONY: generated.clean
|
|
40 |
|
|
41 |
#
|
|
42 |
# Files
|
|
43 |
#
|
|
44 |
include FILES_c_unix.gmk
|
|
45 |
include FILES_export_unix.gmk
|
|
46 |
AUTO_FILES_JAVA_DIRS = sun/awt/X11
|
|
47 |
AUTO_JAVA_PRUNE = WrapperGenerator.java
|
|
48 |
|
|
49 |
LDFLAGS += -L$(OPENWIN_LIB)
|
|
50 |
|
|
51 |
ifeq ($(PLATFORM), linux)
|
|
52 |
LDFLAGS += -lpthread
|
|
53 |
dummy := $(shell $(MKDIR) -p $(LIB_LOCATION))
|
|
54 |
endif
|
|
55 |
|
|
56 |
# Since this library will be living in a subdirectory below the other libraries
|
|
57 |
# we need to add an extra runpath so that libraries in the upper directory
|
|
58 |
# are found at runtime.
|
|
59 |
LD_RUNPATH_EXTRAS = ..
|
|
60 |
|
|
61 |
#
|
|
62 |
# Rules.
|
|
63 |
#
|
|
64 |
include $(BUILDDIR)/common/Mapfile-vers.gmk
|
|
65 |
include $(BUILDDIR)/common/Library.gmk
|
|
66 |
|
|
67 |
#
|
|
68 |
# Add to the ambient vpath to pick up files in subdirectories
|
|
69 |
#
|
|
70 |
vpath %.c $(SHARE_SRC)/native/sunawt/alphacomposite
|
|
71 |
vpath %.c $(PLATFORM_SRC)/native/sun/xawt
|
|
72 |
vpath %.c $(PLATFORM_SRC)/native/sun/awt
|
|
73 |
vpath %.c $(SHARE_SRC)/native/sun/awt/debug
|
|
74 |
vpath %.c $(SHARE_SRC)/native/sun/awt/image
|
|
75 |
vpath %.c $(SHARE_SRC)/native/sun/awt/image/gif
|
|
76 |
vpath %.c $(SHARE_SRC)/native/sun/awt/image/cvutils
|
|
77 |
vpath %.c $(SHARE_SRC)/native/sun/awt/shell
|
|
78 |
vpath %.c $(SHARE_SRC)/native/sun/java2d
|
|
79 |
vpath %.c $(SHARE_SRC)/native/sun/java2d/loops
|
|
80 |
vpath %.c $(SHARE_SRC)/native/sun/java2d/pipe
|
|
81 |
vpath %.c $(SHARE_SRC)/native/sun/awt/medialib
|
|
82 |
vpath %.cpp $(SHARE_SRC)/native/sun/image
|
|
83 |
vpath %.c $(SHARE_SRC)/native/sun/font
|
|
84 |
vpath %.c $(PLATFORM_SRC)/native/sun/awt/robot_child
|
|
85 |
vpath %.c $(SHARE_SRC)/native/sun/java2d/opengl
|
|
86 |
vpath %.c $(PLATFORM_SRC)/native/sun/java2d/opengl
|
|
87 |
vpath %.c $(PLATFORM_SRC)/native/sun/java2d/x11
|
|
88 |
|
|
89 |
OTHER_LDLIBS = $(LIBM) -lawt -lXext -lX11 -ldl \
|
|
90 |
$(LDFLAGS_COMMON) $(AWT_RUNPATH) $(OTHER_LDFLAGS) -lXtst -lXi
|
|
91 |
|
|
92 |
ifeq ($(PLATFORM), solaris)
|
|
93 |
CPPFLAGS += -DFUNCPROTO=15
|
|
94 |
dummy := $(shell $(MKDIR) -p $(LIB_LOCATION))
|
|
95 |
endif
|
|
96 |
|
|
97 |
CPPFLAGS += -I$(CUPS_HEADERS_PATH)
|
|
98 |
|
|
99 |
CPPFLAGS += -DXAWT -DXAWT_HACK \
|
|
100 |
-I$(TEMPDIR)/../../sun.awt/awt/CClassHeaders \
|
|
101 |
-I$(PLATFORM_SRC)/native/sun/awt \
|
|
102 |
-I$(PLATFORM_SRC)/native/sun/xawt \
|
|
103 |
-I$(PLATFORM_SRC)/native/sun/jdga \
|
|
104 |
-I$(SHARE_SRC)/native/sun/awt/debug \
|
|
105 |
-I$(SHARE_SRC)/native/sun/awt/image/cvutils \
|
|
106 |
-I$(SHARE_SRC)/native/sun/java2d \
|
|
107 |
-I$(SHARE_SRC)/native/sun/java2d/loops \
|
|
108 |
-I$(SHARE_SRC)/native/sun/awt/image/cvutils \
|
|
109 |
-I$(SHARE_SRC)/native/sun/awt/image \
|
|
110 |
-I$(SHARE_SRC)/native/sun/font \
|
|
111 |
-I$(PLATFORM_SRC)/native/sun/java2d \
|
|
112 |
-I$(SHARE_SRC)/native/sun/java2d/pipe \
|
|
113 |
-I$(SHARE_SRC)/native/sun/java2d/opengl \
|
|
114 |
-I$(PLATFORM_SRC)/native/sun/java2d/opengl \
|
|
115 |
-I$(PLATFORM_SRC)/native/sun/java2d/x11 \
|
|
116 |
-I$(SHARE_SRC)/native/sun/dc/path \
|
|
117 |
-I$(SHARE_SRC)/native/sun/dc/doe \
|
|
118 |
-I$(SHARE_SRC)/native/sun/awt/alphacomposite \
|
|
119 |
-I$(SHARE_SRC)/native/sun/awt/medialib \
|
|
120 |
-I$(PLATFORM_SRC)/native/sun/awt/medialib \
|
|
121 |
-I$(PLATFORM_SRC)/native/sun/font \
|
|
122 |
-I$(SHARE_SRC)/native/sun/awt \
|
|
123 |
-I$(PLATFORM_SRC)/native/sun/awt
|
|
124 |
|
|
125 |
ifeq ($(PLATFORM), linux)
|
|
126 |
# Allows for builds on Debian GNU Linux, X11 is in a different place
|
|
127 |
CPPFLAGS += -I/usr/X11R6/include/X11/extensions \
|
|
128 |
-I/usr/include/X11/extensions \
|
|
129 |
-I$(OPENWIN_HOME)/include
|
|
130 |
endif
|
|
131 |
|
|
132 |
ifeq ($(PLATFORM), solaris)
|
|
133 |
CPPFLAGS += -I$(OPENWIN_HOME)/include/X11/extensions
|
|
134 |
endif
|
|
135 |
|
|
136 |
ifeq ($(MILESTONE), internal)
|
|
137 |
CPPFLAGS += -DINTERNAL_BUILD
|
|
138 |
endif
|
|
139 |
|
|
140 |
#
|
|
141 |
# Generation of wrappers
|
|
142 |
#
|
|
143 |
SIZER_DIR=$(GEN_DIR)/generator
|
|
144 |
SIZER = $(SIZER_DIR)/sizer
|
|
145 |
SIZER_32_C = $(SIZER).32.c
|
|
146 |
SIZER_64_C = $(SIZER).64.c
|
|
147 |
CFLAGS_32=$(CFLAGS)
|
|
148 |
CFLAGS_64=$(CFLAGS)
|
|
149 |
|
|
150 |
ifeq ($(PLATFORM), solaris)
|
|
151 |
|
|
152 |
isalist:=$(shell $(ISAINFO))
|
|
153 |
|
|
154 |
ifneq (,$(findstring sparcv9, $(isalist)))
|
|
155 |
# On sparcv9 we generate both 32 and 64-bit sizers in spite of ARCH_DATA_MODEL.
|
|
156 |
# On sparcv9 CFLAGS already contain $(XARCH_OPTION/64), so to generate 32-bit sizer we need to change this option.
|
|
157 |
CFLAGS_32=$(subst $(XARCH_OPTION/64),$(XARCH_OPTION/32),$(CFLAGS))
|
|
158 |
SIZERS = $(SIZER).32 $(SIZER).64
|
|
159 |
SIZERS_C = $(SIZER_32_C) $(SIZER_64_C)
|
|
160 |
SIZES = $(WRAPPER_GENERATOR_DIR)/sizes.32 $(WRAPPER_GENERATOR_DIR)/sizes.64
|
|
161 |
CFLAGS_64=$(CFLAGS) $(XARCH_OPTION/64)
|
|
162 |
else
|
|
163 |
ifneq (,$(findstring amd64, $(isalist)))
|
|
164 |
# On amd64 we generate both 32 and 64-bit sizers in spite of ARCH_DATA_MODEL.
|
|
165 |
# On amd64 CFLAGS already contain $(XARCH_OPTION/64), so to generate 32-bit sizer we need to change this option.
|
|
166 |
CFLAGS_32=$(subst $(XARCH_OPTION/64),$(XARCH_OPTION/32),$(CFLAGS))
|
|
167 |
SIZERS = $(SIZER).32 $(SIZER).64
|
|
168 |
SIZERS_C = $(SIZER_32_C) $(SIZER_64_C)
|
|
169 |
SIZES = $(WRAPPER_GENERATOR_DIR)/sizes.32 $(WRAPPER_GENERATOR_DIR)/sizes.64
|
|
170 |
CFLAGS_64=$(CFLAGS) $(XARCH_OPTION/64)
|
|
171 |
else # !sparcv9 : includes (32-bit) sparc, i586
|
|
172 |
SIZERS = $(SIZER).32
|
|
173 |
SIZERS_C = $(SIZER_32_C)
|
|
174 |
SIZES = $(WRAPPER_GENERATOR_DIR)/sizes.32
|
|
175 |
endif # amd64
|
|
176 |
endif # sparcv9
|
|
177 |
|
|
178 |
else # !solaris
|
|
179 |
|
|
180 |
ifeq ($(ARCH_DATA_MODEL), 32)
|
|
181 |
SIZERS = $(SIZER).32
|
|
182 |
SIZERS_C = $(SIZER_32_C)
|
|
183 |
SIZES = $(WRAPPER_GENERATOR_DIR)/sizes.32
|
|
184 |
else # !32
|
|
185 |
SIZERS = $(SIZER).64
|
|
186 |
SIZERS_C = $(SIZER_64_C)
|
|
187 |
SIZES = $(WRAPPER_GENERATOR_DIR)/sizes.64
|
|
188 |
endif # 32
|
|
189 |
|
|
190 |
endif # solaris
|
|
191 |
|
|
192 |
# XXX Hack for 6185483 - use hard-coded sizes.
|
|
193 |
# Add the 64-bit platforms that need to be included into 32-bit build
|
|
194 |
# and have sizes.64-$(PLATFORM)-$(LIBARCH) hardcoded in the workspace
|
|
195 |
ifeq ($(PLATFORM)-$(LIBARCH), solaris-i386)
|
|
196 |
# If you define DOHACK=true for some combination of $(PLATFORM)-$(LIBARCH),
|
|
197 |
# make sure you have sizes.64-$(PLATFORM)-$(LIBARCH) pre-generated in
|
|
198 |
# $(PLATFORM_SRC)/classes/sun/awt/X11/generator/
|
|
199 |
DOHACK=true
|
|
200 |
endif # Hack
|
|
201 |
|
|
202 |
ifeq ($(DOHACK), true)
|
|
203 |
PREDEFINED_SIZES_TMPL=$(PLATFORM_SRC)/classes/sun/awt/X11/generator/sizes.64-$(PLATFORM)-$(LIBARCH)
|
|
204 |
PREDEFINED_SIZES=$(WRAPPER_GENERATOR_DIR)/sizes.64
|
|
205 |
SIZES += $(WRAPPER_GENERATOR_DIR)/sizes.64
|
|
206 |
endif
|
|
207 |
|
|
208 |
ifeq ($(PLATFORM)-$(LIBARCH), solaris-amd64)
|
|
209 |
DOCOMPARE=true
|
|
210 |
endif
|
|
211 |
# 64 bit sizers are generated on platform-libarch (left) for use
|
|
212 |
# on platform-libarch (right) and stored under the latter name.
|
|
213 |
# Do compare manually stored and automatically generated pair(s)
|
|
214 |
# if DOCOMPARE=true, just after the generation.
|
|
215 |
STORED_SIZES_TMPL_solaris_amd64=$(PLATFORM_SRC)/classes/sun/awt/X11/generator/sizes.64-solaris-i386
|
|
216 |
|
|
217 |
WRAPPER_GENERATOR_JAVA=$(PLATFORM_SRC)/classes/sun/awt/X11/generator/WrapperGenerator.java
|
|
218 |
WRAPPER_GENERATOR_DIR=$(GENSRCDIR)/sun/awt/X11/generator
|
|
219 |
WRAPPER_GENERATOR_TEMPDIR=$(TEMPDIR)/sun/awt/X11/generator
|
|
220 |
WRAPPER_GENERATOR_CLASS=$(WRAPPER_GENERATOR_TEMPDIR)/WrapperGenerator.class
|
|
221 |
XLIBTYPES=$(PLATFORM_SRC)/classes/sun/awt/X11/generator/xlibtypes.txt
|
|
222 |
|
|
223 |
$(SIZERS): $(SIZERS_C)
|
|
224 |
$(prep-target)
|
|
225 |
$(CC) $(CFLAGS_$(subst .,,$(suffix $@))) $(CPPFLAGS) -o $@ $(SIZER)$(suffix $@).c
|
|
226 |
|
|
227 |
$(WRAPPER_GENERATOR_CLASS): $(WRAPPER_GENERATOR_JAVA)
|
|
228 |
$(prep-target)
|
|
229 |
$(BOOT_JAVAC_CMD) -d $(WRAPPER_GENERATOR_TEMPDIR) $(WRAPPER_GENERATOR_JAVA)
|
|
230 |
|
|
231 |
$(SIZERS_C): $(WRAPPER_GENERATOR_CLASS) $(XLIBTYPES)
|
|
232 |
$(prep-target)
|
|
233 |
$(MKDIR) -p $(WRAPPER_GENERATOR_TEMPDIR)
|
|
234 |
$(BOOT_JAVA_CMD) -cp $(WRAPPER_GENERATOR_TEMPDIR) WrapperGenerator \
|
|
235 |
$(SIZER_DIR) $(XLIBTYPES) "sizer" $(subst .,,$(suffix $(basename $@)))
|
|
236 |
|
|
237 |
$(SIZES): $(SIZERS)
|
|
238 |
@if [ "$(DOHACK)$@" = "true$(PREDEFINED_SIZES)" ]; then \
|
|
239 |
$(ECHO) COPYING $(PREDEFINED_SIZES_TMPL) into $@; \
|
|
240 |
$(CP) $(PREDEFINED_SIZES_TMPL) $@; \
|
|
241 |
$(CHMOD) +w $@;\
|
|
242 |
else \
|
|
243 |
$(ECHO) GENERATING $@; \
|
|
244 |
$(WRAPPER_GENERATOR_DIR)/sizer$(suffix $@) > $@; \
|
|
245 |
fi
|
|
246 |
@if [ "$(DOCOMPARE)$(suffix $@)" = "true.64" ]; then \
|
|
247 |
$(ECHO) COMPARING $@ and $(STORED_SIZES_TMPL_$(PLATFORM)_$(LIBARCH)); \
|
|
248 |
$(DIFF) $@ $(STORED_SIZES_TMPL_$(PLATFORM)_$(LIBARCH)); \
|
133
|
249 |
fi
|
2
|
250 |
|
|
251 |
$(TEMPDIR)/.gen.wrappers: $(SIZES) $(WRAPPER_GENERATOR_CLASS) $(XLIBTYPES)
|
|
252 |
$(BOOT_JAVA_CMD) -cp $(WRAPPER_GENERATOR_TEMPDIR) WrapperGenerator \
|
|
253 |
$(GEN_DIR) $(XLIBTYPES) "gen" $(WRAPPER_GENERATOR_DIR)/sizes
|
|
254 |
|
|
255 |
touch.wrappers: $(TEMPDIR)/.gen.wrappers
|
|
256 |
$(MKDIR) -p $(TEMPDIR)
|
|
257 |
$(TOUCH) $(TEMPDIR)/.gen.wrappers
|
|
258 |
|
133
|
259 |
generated.clean:
|
2
|
260 |
$(RM) -r $(WRAPPER_GENERATOR_TEMPDIR)
|
|
261 |
$(RM) -r $(WRAPPER_GENERATOR_DIR)
|
|
262 |
$(RM) -r $(GEN_DIR)/*.java
|
133
|
263 |
$(RM) -r $(TEMPDIR)/.gen_icons
|
2
|
264 |
|
|
265 |
ifdef OPENJDK
|
|
266 |
ICONS_PATH_PREFIX=$(PLATFORM_SRC)
|
|
267 |
else
|
|
268 |
ICONS_PATH_PREFIX=$(CLOSED_SRC)/solaris
|
|
269 |
endif
|
|
270 |
|
|
271 |
ICONS = \
|
|
272 |
$(ICONS_PATH_PREFIX)/classes/sun/awt/X11/java-icon16.png \
|
|
273 |
$(ICONS_PATH_PREFIX)/classes/sun/awt/X11/java-icon24.png \
|
|
274 |
$(ICONS_PATH_PREFIX)/classes/sun/awt/X11/java-icon32.png \
|
|
275 |
$(ICONS_PATH_PREFIX)/classes/sun/awt/X11/java-icon48.png
|
|
276 |
|
|
277 |
TEMPDIR_CLASSES = $(TEMPDIR)/classes
|
|
278 |
|
|
279 |
$(TEMPDIR_CLASSES)/sun/awt/X11/ToBin.class: ToBin.java
|
|
280 |
@$(prep-target)
|
|
281 |
$(BOOT_JAVAC_CMD) -d $(TEMPDIR_CLASSES) $<
|
|
282 |
|
|
283 |
$(TEMPDIR)/.gen_icons: $(TEMPDIR_CLASSES)/sun/awt/X11/ToBin.class $(ICONS)
|
|
284 |
$(prep-target)
|
|
285 |
for i in $(ICONS); do \
|
|
286 |
filename=`basename $$i`; \
|
|
287 |
name=`$(ECHO) $$filename | $(TR) '\-.' '__'`; \
|
|
288 |
classname=$(GEN_DIR)/XAWTIcon32_$$name.java; \
|
|
289 |
$(RM) $$classname; \
|
|
290 |
$(ECHO) "package sun.awt.X11;" >> $$classname ; \
|
|
291 |
$(ECHO) "public class XAWTIcon32_$$name {" >> $$classname; \
|
|
292 |
$(ECHO) "public static int[] $$name = { " >> $$classname; \
|
|
293 |
$(CAT) $$i | \
|
|
294 |
$(BOOT_JAVA_CMD) -cp $(TEMPDIR_CLASSES) \
|
|
295 |
-Djava.awt.headless=true \
|
|
296 |
sun.awt.X11.ToBin >> $$classname; \
|
|
297 |
$(ECHO) "}; }" >> $$classname; \
|
|
298 |
classname=$(GEN_DIR)/XAWTIcon64_$$name.java; \
|
|
299 |
$(RM) $$classname; \
|
|
300 |
$(ECHO) "package sun.awt.X11;" >> $$classname ; \
|
|
301 |
$(ECHO) "public class XAWTIcon64_$$name {" >> $$classname; \
|
|
302 |
$(ECHO) "public static long[] $$name = { " >> $$classname; \
|
|
303 |
$(CAT) $$i | \
|
|
304 |
$(BOOT_JAVA_CMD) -cp $(TEMPDIR_CLASSES) \
|
|
305 |
-Djava.awt.headless=true \
|
|
306 |
sun.awt.X11.ToBin >> $$classname; \
|
|
307 |
$(ECHO) "}; }" >> $$classname; \
|
|
308 |
done
|
|
309 |
$(TOUCH) $@
|
|
310 |
|
|
311 |
clean clobber:: generated.clean
|
|
312 |
|
|
313 |
.PHONY: generated.clean robot_child
|
|
314 |
|