blob: 03938bbfc1bcdda1f778d67aae3f00f3fd31a1ad [file] [log] [blame]
Erik Joelssonf558e392012-06-07 20:40:50 -07001#
2# Copyright (c) 2012, Oracle and/or its affiliates. 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. Oracle designates this
8# particular file as subject to the "Classpath" exception as provided
9# by Oracle 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 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.
24#
25
26GENSRC_X11WRAPPERS :=
27GENSRC_X11WRAPPERS_TMP := $(JDK_OUTPUTDIR)/gensrc_x11wrappers
28
29GENSRC_SIZER_SRC := $(JDK_TOPDIR)/src/solaris/classes/sun/awt/X11/generator
30
31GENSRC_SIZES :=
32
33ifeq ($(PLATFORM)-$(LIBARCH), solaris-i386)
34GENSRC_SIZES := sizes.32 sizes.64
35else ifeq ($(PLATFORM), solaris)
36isalist:=$(shell $(ISAINFO))
37ifneq (,$(findstring sparcv9, $(isalist)))
38# On sparcv9 we generate both 32 and 64-bit sizers in spite of ARCH_DATA_MODEL.
39GENSRC_SIZES := sizes.32 sizes.64
40else
41ifneq (,$(findstring amd64, $(isalist)))
42# On amd64 we generate both 32 and 64-bit sizers in spite of ARCH_DATA_MODEL.
43GENSRC_SIZES := sizes.32 sizes.64
44else # !sparcv9 : includes (32-bit) sparc, i586
45GENSRC_SIZES := sizes.32
46endif # amd64
47endif # sparcv9
48else # !solaris
49ifeq ($(PLATFORM), macosx)
50GENSRC_SIZES := sizes.32 sizes.64
51else # !macosx
52GENSRC_SIZES := sizes.$(ARCH_DATA_MODEL)
53endif # !macosx
54endif # solaris
55
56
57##########################################################################################
58
59$(GENSRC_X11WRAPPERS_TMP)/sizer/sizer.%.c : $(GENSRC_SIZER_SRC)/xlibtypes.txt
60 $(MKDIR) -p $(@D)
61 $(RM) $@
62 $(TOOL_WRAPPERGENERATOR) $(@D) $< "sizer" $*
63
64$(GENSRC_X11WRAPPERS_TMP)/sizer/sizer.%.exe : $(GENSRC_X11WRAPPERS_TMP)/sizer/sizer.%.c
65 (cd $(@D) && $(CC) -m$* -o $@ $< $(CFLAGS_JDKLIB) \
66 -I$(JDK_TOPDIR)/src/solaris/native/sun/awt \
67 -I$(JDK_TOPDIR)/src/share/native/sun/awt/debug \
68 -I$(JDK_TOPDIR)/src/share/native/sun/awt/image/cvutils -lc)
69
70ifeq ($(PLATFORM)-$(LIBARCH), solaris-i386)
71
72$(GENSRC_X11WRAPPERS_TMP)/sizer/sizes.32 : $(GENSRC_X11WRAPPERS_TMP)/sizer/sizer.32.exe
73 $< > $@.tmp
74 $(MV) $@.tmp $@
75
76$(GENSRC_X11WRAPPERS_TMP)/sizer/sizes.64 : $(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)/classes/sun/awt/X11/generator/sizes.64-$(PLATFORM)-$(LIBARCH)
77 $(MKDIR) -p $(@D)
78 $(CP) $< $@
79else
80
81$(GENSRC_X11WRAPPERS_TMP)/sizer/sizes.% : $(GENSRC_X11WRAPPERS_TMP)/sizer/sizer.%.exe
82 $< > $@.tmp
83 $(MV) $@.tmp $@
84
85endif
86
87$(GENSRC_X11WRAPPERS_TMP)/classes/_the.classes : $(foreach S,$(GENSRC_SIZES),$(GENSRC_X11WRAPPERS_TMP)/sizer/$(S))
88 $(MKDIR) -p $(@D)/sun/awt/X11
89 $(RM) $(@D)/sun/awt/X11/*
90 $(TOOL_WRAPPERGENERATOR) $(@D)/sun/awt/X11 $(GENSRC_SIZER_SRC)/xlibtypes.txt "gen" $(GENSRC_X11WRAPPERS_TMP)/sizer/sizes
91ifeq ($(PLATFORM)-$(LIBARCH), solaris-amd64)
92 $(ECHO) COMPARING $@ and $(GENSRC_SIZER_SRC)/sizes.64-$(PLATFORM)-i386
93 $(DIFF) $(GENSRC_X11WRAPPERS_TMP)/sizes.64 $(GENSRC_SIZER_SRC)/sizes.64-$(PLATFORM)-i386
94endif
95 $(TOUCH) $@
96
97GENSRC_X11WRAPPERS += $(GENSRC_X11WRAPPERS_TMP)/classes/_the.classes