1 #
2 # Copyright (c) 2012, 2014, 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
75 $(TOUCH) $@
76
77 GENSRC_X11WRAPPERS += $(SUPPORT_OUTPUTDIR)/gensrc/java.desktop/_the.generated.x11
78
79 ifneq ($(COMPILE_TYPE), cross)
80 # This is not a cross compile, regenerate the offset file, so that we
81 # can compare it with the version in the source code repository.
82
83 # Generate the C code for the program that will output the offset file.
84 $(GENSRC_X11WRAPPERS_TMP)/sizer.%.c: $(GENSRC_SIZER_DIR)/xlibtypes.txt $(BUILD_TOOLS_JDK)
85 $(call LogInfo, Generating X11 wrapper ($*-bit version))
86 $(call MakeDir, $(@D))
87 $(TOOL_WRAPPERGENERATOR) $(@D) $(GENSRC_SIZER_DIR)/xlibtypes.txt "sizer" $*
88
89 # use -m32/-m64 only if the compiler supports it
90 ifeq ($(COMPILER_SUPPORTS_TARGET_BITS_FLAG), true)
91 MEMORY_MODEL_FLAG="$(COMPILER_TARGET_BITS_FLAG)$*"
92 endif
93
94 SIZER_CFLAGS := \
95 -I$(TOPDIR)/src/java.base/share/native/include \
96 -I$(TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_EXPORT_DIR)/native/include \
97 -I$(TOPDIR)/src/java.base/share/native/libjava \
98 -I$(TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_TYPE)/native/libjava \
99 -I$(TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/common/awt \
100 -I$(TOPDIR)/src/java.desktop/share/native/common/awt/debug \
101 -I$(TOPDIR)/src/java.desktop/share/native/libawt/awt/image/cvutils \
102 #
103
104 # Compile the C code into an executable.
105 $(GENSRC_X11WRAPPERS_TMP)/sizer.%.exe: $(GENSRC_X11WRAPPERS_TMP)/sizer.%.c
106 $(call MakeDir, $(@D))
107 (cd $(@D) && $(CC) $(MEMORY_MODEL_FLAG) -o $@ $< \
108 $(X_CFLAGS) \
109 $(X_LIBS) \
110 $(SIZER_CFLAGS) -lc)
111
112 .PRECIOUS: $(GENSRC_X11WRAPPERS_TMP)/sizer.%.exe $(GENSRC_X11WRAPPERS_TMP)/sizer.%.c
113
114 # Run the executable create the offset file and check that it is identical
115 # to the offset file in the source code repository.
116 $(GENSRC_X11WRAPPERS_TMP)/sizes.%.verification: $(GENSRC_X11WRAPPERS_TMP)/sizer.%.exe
|
1 #
2 # Copyright (c) 2012, 2017, 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
75 $(TOUCH) $@
76
77 GENSRC_X11WRAPPERS += $(SUPPORT_OUTPUTDIR)/gensrc/java.desktop/_the.generated.x11
78
79 ifneq ($(COMPILE_TYPE), cross)
80 # This is not a cross compile, regenerate the offset file, so that we
81 # can compare it with the version in the source code repository.
82
83 # Generate the C code for the program that will output the offset file.
84 $(GENSRC_X11WRAPPERS_TMP)/sizer.%.c: $(GENSRC_SIZER_DIR)/xlibtypes.txt $(BUILD_TOOLS_JDK)
85 $(call LogInfo, Generating X11 wrapper ($*-bit version))
86 $(call MakeDir, $(@D))
87 $(TOOL_WRAPPERGENERATOR) $(@D) $(GENSRC_SIZER_DIR)/xlibtypes.txt "sizer" $*
88
89 # use -m32/-m64 only if the compiler supports it
90 ifeq ($(COMPILER_SUPPORTS_TARGET_BITS_FLAG), true)
91 MEMORY_MODEL_FLAG="$(COMPILER_TARGET_BITS_FLAG)$*"
92 endif
93
94 SIZER_CFLAGS := \
95 -I${TOPDIR}/src/hotspot/share/include \
96 -I${TOPDIR}/src/hotspot/os/$(HOTSPOT_TARGET_OS_TYPE)/include \
97 -I$(TOPDIR)/src/java.base/share/native/include \
98 -I$(TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_TYPE)/native/include \
99 -I$(TOPDIR)/src/java.base/share/native/libjava \
100 -I$(TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_TYPE)/native/libjava \
101 -I$(TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/common/awt \
102 -I$(TOPDIR)/src/java.desktop/share/native/common/awt/debug \
103 -I$(TOPDIR)/src/java.desktop/share/native/libawt/awt/image/cvutils \
104 #
105
106 # Compile the C code into an executable.
107 $(GENSRC_X11WRAPPERS_TMP)/sizer.%.exe: $(GENSRC_X11WRAPPERS_TMP)/sizer.%.c
108 $(call MakeDir, $(@D))
109 (cd $(@D) && $(CC) $(MEMORY_MODEL_FLAG) -o $@ $< \
110 $(X_CFLAGS) \
111 $(X_LIBS) \
112 $(SIZER_CFLAGS) -lc)
113
114 .PRECIOUS: $(GENSRC_X11WRAPPERS_TMP)/sizer.%.exe $(GENSRC_X11WRAPPERS_TMP)/sizer.%.c
115
116 # Run the executable create the offset file and check that it is identical
117 # to the offset file in the source code repository.
118 $(GENSRC_X11WRAPPERS_TMP)/sizes.%.verification: $(GENSRC_X11WRAPPERS_TMP)/sizer.%.exe
|