annotate make/sun/xawt/Makefile @ 3853:6aeed99af874

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