author | erikj |
Wed, 09 Jan 2013 16:13:29 +0100 | |
changeset 15135 | 3ea5d7852acc |
parent 15126 | bceb690ccf35 |
child 15149 | 64054e252871 |
permissions | -rw-r--r-- |
12892 | 1 |
# |
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 |
||
13702 | 26 |
|
27 |
# This file is responsible for extracting the x11 native struct offsets to |
|
28 |
# the xawt Java library. This is done by compiling and running a native |
|
29 |
# binary, which dumps output to a text file. The offsets differ on 32 and 64 |
|
30 |
# bit systems, so care must be taken here. |
|
31 |
||
32 |
# Note: Some of the more complex logic here is most likely not needed anymore. |
|
33 |
||
12892 | 34 |
GENSRC_X11WRAPPERS := |
35 |
GENSRC_X11WRAPPERS_TMP := $(JDK_OUTPUTDIR)/gensrc_x11wrappers |
|
14231 | 36 |
GENSRC_X11WRAPPERS_DST := $(JDK_OUTPUTDIR)/gensrc |
12892 | 37 |
|
38 |
GENSRC_SIZER_SRC := $(JDK_TOPDIR)/src/solaris/classes/sun/awt/X11/generator |
|
39 |
||
13702 | 40 |
# Normal case is to generate version according to target bits |
41 |
GENSRC_SIZES := sizes.$(OPENJDK_TARGET_CPU_BITS) |
|
12892 | 42 |
|
13702 | 43 |
ifeq ($(OPENJDK_TARGET_CPU_BITS), 64) |
44 |
ifneq ($(OPENJDK_TARGET_OS), linux) |
|
45 |
# On all 64-bit systems except Linux, generate both 32 and 64 bit versions |
|
12892 | 46 |
GENSRC_SIZES := sizes.32 sizes.64 |
13702 | 47 |
endif |
48 |
else |
|
14231 | 49 |
ifeq ($(OPENJDK_TARGET_OS), solaris) |
50 |
# As a special case, solaris 32-bit also generates the 64-bit version |
|
12892 | 51 |
GENSRC_SIZES := sizes.32 sizes.64 |
13702 | 52 |
endif |
53 |
endif |
|
12892 | 54 |
|
55 |
########################################################################################## |
|
56 |
||
15126
bceb690ccf35
8005540: build-infra: Improve incremental build speed on windows by caching find results
erikj
parents:
14233
diff
changeset
|
57 |
$(GENSRC_X11WRAPPERS_TMP)/sizer/sizer.%.c : $(GENSRC_SIZER_SRC)/xlibtypes.txt $(BUILD_TOOLS) |
14231 | 58 |
$(ECHO) "Generating X11 wrapper ($*-bit version)" |
12892 | 59 |
$(MKDIR) -p $(@D) |
60 |
$(RM) $@ |
|
61 |
$(TOOL_WRAPPERGENERATOR) $(@D) $< "sizer" $* |
|
62 |
||
63 |
$(GENSRC_X11WRAPPERS_TMP)/sizer/sizer.%.exe : $(GENSRC_X11WRAPPERS_TMP)/sizer/sizer.%.c |
|
13702 | 64 |
$(MKDIR) -p $(@D) |
65 |
$(RM) $@ $@.tmp |
|
66 |
(cd $(@D) && $(BUILD_CC) -m$* -o $@.tmp $< \ |
|
14233
18fda1299ea9
8001891: build-infra: Adding X_CFLAGS and X_LIBS to lwawt and sizer compilation
ohrstrom
parents:
14231
diff
changeset
|
67 |
$(X_CFLAGS) \ |
18fda1299ea9
8001891: build-infra: Adding X_CFLAGS and X_LIBS to lwawt and sizer compilation
ohrstrom
parents:
14231
diff
changeset
|
68 |
$(X_LIBS) \ |
13164 | 69 |
-I$(JDK_OUTPUTDIR)/include \ |
70 |
-I$(JDK_TOPDIR)/src/share/javavm/export \ |
|
13702 | 71 |
-I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/javavm/export \ |
13164 | 72 |
-I$(JDK_TOPDIR)//src/share/native/common \ |
13702 | 73 |
-I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/common \ |
12892 | 74 |
-I$(JDK_TOPDIR)/src/solaris/native/sun/awt \ |
75 |
-I$(JDK_TOPDIR)/src/share/native/sun/awt/debug \ |
|
76 |
-I$(JDK_TOPDIR)/src/share/native/sun/awt/image/cvutils -lc) |
|
13702 | 77 |
$(MV) $@.tmp $@ |
12892 | 78 |
|
13702 | 79 |
# Run the generated sizer binary to create the sizes text file |
80 |
$(GENSRC_X11WRAPPERS_TMP)/sizer/sizes.% : $(GENSRC_X11WRAPPERS_TMP)/sizer/sizer.%.exe |
|
81 |
$(MKDIR) -p $(@D) |
|
82 |
$(RM) $@ $@.tmp |
|
12892 | 83 |
$< > $@.tmp |
84 |
$(MV) $@.tmp $@ |
|
85 |
||
13702 | 86 |
ifeq ($(OPENJDK_TARGET_OS)-$(OPENJDK_TARGET_CPU), solaris-x86) |
87 |
# On solaris-x86 we also need to create the 64-bit version, but we can't run a 64-bit binary |
|
88 |
# As a workaround, copy this from a pre-generated file. |
|
89 |
$(GENSRC_X11WRAPPERS_TMP)/sizer/sizes.64 : $(JDK_TOPDIR)/src/solaris/classes/sun/awt/X11/generator/sizes.64-solaris-i386 |
|
12892 | 90 |
$(MKDIR) -p $(@D) |
13702 | 91 |
$(RM) $@ |
12892 | 92 |
$(CP) $< $@ |
93 |
endif |
|
94 |
||
15126
bceb690ccf35
8005540: build-infra: Improve incremental build speed on windows by caching find results
erikj
parents:
14233
diff
changeset
|
95 |
$(GENSRC_X11WRAPPERS_DST)/_the.generated.x11 : $(foreach S,$(GENSRC_SIZES),$(GENSRC_X11WRAPPERS_TMP)/sizer/$(S)) $(BUILD_TOOLS) |
13702 | 96 |
$(RM) $@ |
12892 | 97 |
$(MKDIR) -p $(@D)/sun/awt/X11 |
98 |
$(TOOL_WRAPPERGENERATOR) $(@D)/sun/awt/X11 $(GENSRC_SIZER_SRC)/xlibtypes.txt "gen" $(GENSRC_X11WRAPPERS_TMP)/sizer/sizes |
|
13702 | 99 |
ifeq ($(OPENJDK_TARGET_OS)-$(OPENJDK_TARGET_CPU), solaris-x86_64) |
100 |
# On solaris-x86_64, as a safety measure, compare the generated file with the checked-in version |
|
101 |
$(ECHO) COMPARING $(GENSRC_X11WRAPPERS_TMP)/sizer/sizes.64 and $(GENSRC_SIZER_SRC)/sizes.64-solaris-i386 |
|
102 |
$(DIFF) $(GENSRC_X11WRAPPERS_TMP)/sizer/sizes.64 $(GENSRC_SIZER_SRC)/sizes.64-solaris-i386 |
|
12892 | 103 |
endif |
104 |
$(TOUCH) $@ |
|
105 |
||
14231 | 106 |
GENSRC_X11WRAPPERS += $(GENSRC_X11WRAPPERS_DST)/_the.generated.x11 |