make/UpdateX11Wrappers.gmk
author rkennke
Tue, 25 Sep 2018 16:41:25 +0200
changeset 51868 92960b0e6191
parent 49241 de4b3a04feae
child 53995 ecc2bcc3beb0
child 56312 a52bcf4118eb
child 57159 0258a6f7d03f
permissions -rw-r--r--
8211061: Tests fail with assert(VM_Version::supports_sse4_1()) on ThreadRipper CPU Reviewed-by: thartmann, roland
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
12892
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
     1
#
49133
a5b237cfccef 8198844: Clean up GensrcX11Wrappers
ihse
parents: 48355
diff changeset
     2
# Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved.
12892
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
     3
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
     4
#
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
     5
# This code is free software; you can redistribute it and/or modify it
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
     6
# under the terms of the GNU General Public License version 2 only, as
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
     7
# published by the Free Software Foundation.  Oracle designates this
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
     8
# particular file as subject to the "Classpath" exception as provided
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
     9
# by Oracle in the LICENSE file that accompanied this code.
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
    10
#
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
    11
# This code is distributed in the hope that it will be useful, but WITHOUT
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
    12
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
    13
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
    14
# version 2 for more details (a copy is included in the LICENSE file that
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
    15
# accompanied this code).
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
    16
#
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
    17
# You should have received a copy of the GNU General Public License version
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
    18
# 2 along with this work; if not, write to the Free Software Foundation,
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
    19
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
    20
#
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
    21
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
    22
# or visit www.oracle.com if you need additional information or have any
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
    23
# questions.
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
    24
#
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
    25
49133
a5b237cfccef 8198844: Clean up GensrcX11Wrappers
ihse
parents: 48355
diff changeset
    26
################################################################################
a5b237cfccef 8198844: Clean up GensrcX11Wrappers
ihse
parents: 48355
diff changeset
    27
a5b237cfccef 8198844: Clean up GensrcX11Wrappers
ihse
parents: 48355
diff changeset
    28
default: all
a5b237cfccef 8198844: Clean up GensrcX11Wrappers
ihse
parents: 48355
diff changeset
    29
a5b237cfccef 8198844: Clean up GensrcX11Wrappers
ihse
parents: 48355
diff changeset
    30
include $(SPEC)
a5b237cfccef 8198844: Clean up GensrcX11Wrappers
ihse
parents: 48355
diff changeset
    31
include MakeBase.gmk
a5b237cfccef 8198844: Clean up GensrcX11Wrappers
ihse
parents: 48355
diff changeset
    32
include NativeCompilation.gmk
a5b237cfccef 8198844: Clean up GensrcX11Wrappers
ihse
parents: 48355
diff changeset
    33
include ToolsJdk.gmk
a5b237cfccef 8198844: Clean up GensrcX11Wrappers
ihse
parents: 48355
diff changeset
    34
a5b237cfccef 8198844: Clean up GensrcX11Wrappers
ihse
parents: 48355
diff changeset
    35
################################################################################
15149
64054e252871 8004151: build-infra: Generating X11 wrapper offset file is not cross compilable
erikj
parents: 15126
diff changeset
    36
# This file is responsible for extracting the x11 native struct offsets to
64054e252871 8004151: build-infra: Generating X11 wrapper offset file is not cross compilable
erikj
parents: 15126
diff changeset
    37
# the xawt Java library. The tool needs to be run on the os/arch that
64054e252871 8004151: build-infra: Generating X11 wrapper offset file is not cross compilable
erikj
parents: 15126
diff changeset
    38
# will host the final jvm, thus the tool cannot be used when cross compiling.
49133
a5b237cfccef 8198844: Clean up GensrcX11Wrappers
ihse
parents: 48355
diff changeset
    39
#
a5b237cfccef 8198844: Clean up GensrcX11Wrappers
ihse
parents: 48355
diff changeset
    40
# Two versions of the generated offset file, sizes-32.txt and sizes-64.txt are
a5b237cfccef 8198844: Clean up GensrcX11Wrappers
ihse
parents: 48355
diff changeset
    41
# committed into the source code repository. These are the ones used in
a5b237cfccef 8198844: Clean up GensrcX11Wrappers
ihse
parents: 48355
diff changeset
    42
# GensrcX11Wrappers.gmk to generate the Java code during the build.
a5b237cfccef 8198844: Clean up GensrcX11Wrappers
ihse
parents: 48355
diff changeset
    43
################################################################################
12892
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
    44
49133
a5b237cfccef 8198844: Clean up GensrcX11Wrappers
ihse
parents: 48355
diff changeset
    45
ifeq ($(COMPILE_TYPE), cross)
a5b237cfccef 8198844: Clean up GensrcX11Wrappers
ihse
parents: 48355
diff changeset
    46
  $(error It is not possible to update the x11wrappers when cross-compiling)
13702
efd6a05935b2 7197849: Update new build-infra makefiles
ohair
parents: 13164
diff changeset
    47
endif
12892
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
    48
49133
a5b237cfccef 8198844: Clean up GensrcX11Wrappers
ihse
parents: 48355
diff changeset
    49
X11WRAPPERS_OUTPUT := $(SUPPORT_OUTPUTDIR)/x11wrappers
15149
64054e252871 8004151: build-infra: Generating X11 wrapper offset file is not cross compilable
erikj
parents: 15126
diff changeset
    50
49133
a5b237cfccef 8198844: Clean up GensrcX11Wrappers
ihse
parents: 48355
diff changeset
    51
GENSRC_X11WRAPPERS_DATADIR := $(TOPDIR)/make/data/x11wrappergen
12892
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
    52
49133
a5b237cfccef 8198844: Clean up GensrcX11Wrappers
ihse
parents: 48355
diff changeset
    53
BITS := $(OPENJDK_TARGET_CPU_BITS)
15149
64054e252871 8004151: build-infra: Generating X11 wrapper offset file is not cross compilable
erikj
parents: 15126
diff changeset
    54
49133
a5b237cfccef 8198844: Clean up GensrcX11Wrappers
ihse
parents: 48355
diff changeset
    55
# Generate the C code for the program that will output the offset file.
a5b237cfccef 8198844: Clean up GensrcX11Wrappers
ihse
parents: 48355
diff changeset
    56
$(X11WRAPPERS_OUTPUT)/src/data_generator.c: $(GENSRC_X11WRAPPERS_DATADIR)/xlibtypes.txt $(BUILD_TOOLS_JDK)
a5b237cfccef 8198844: Clean up GensrcX11Wrappers
ihse
parents: 48355
diff changeset
    57
	$(call LogInfo, Generating X11 wrapper data generator source code)
a5b237cfccef 8198844: Clean up GensrcX11Wrappers
ihse
parents: 48355
diff changeset
    58
	$(call MakeDir, $(@D))
a5b237cfccef 8198844: Clean up GensrcX11Wrappers
ihse
parents: 48355
diff changeset
    59
	$(call ExecuteWithLog, $@, \
a5b237cfccef 8198844: Clean up GensrcX11Wrappers
ihse
parents: 48355
diff changeset
    60
	    $(TOOL_WRAPPERGENERATOR) gen_c_source $@ $(GENSRC_X11WRAPPERS_DATADIR)/xlibtypes.txt $(BITS))
15149
64054e252871 8004151: build-infra: Generating X11 wrapper offset file is not cross compilable
erikj
parents: 15126
diff changeset
    61
49133
a5b237cfccef 8198844: Clean up GensrcX11Wrappers
ihse
parents: 48355
diff changeset
    62
DATA_GENERATOR_INCLUDES := \
a5b237cfccef 8198844: Clean up GensrcX11Wrappers
ihse
parents: 48355
diff changeset
    63
    -I$(TOPDIR)/src/hotspot/share/include \
a5b237cfccef 8198844: Clean up GensrcX11Wrappers
ihse
parents: 48355
diff changeset
    64
    -I$(TOPDIR)/src/hotspot/os/$(HOTSPOT_TARGET_OS_TYPE)/include \
a5b237cfccef 8198844: Clean up GensrcX11Wrappers
ihse
parents: 48355
diff changeset
    65
    -I$(SUPPORT_OUTPUTDIR)/modules_include/java.base \
a5b237cfccef 8198844: Clean up GensrcX11Wrappers
ihse
parents: 48355
diff changeset
    66
    -I$(SUPPORT_OUTPUTDIR)/modules_include/java.base/$(OPENJDK_TARGET_OS_INCLUDE_SUBDIR) \
a5b237cfccef 8198844: Clean up GensrcX11Wrappers
ihse
parents: 48355
diff changeset
    67
    -I$(TOPDIR)/src/java.base/share/native/libjava \
a5b237cfccef 8198844: Clean up GensrcX11Wrappers
ihse
parents: 48355
diff changeset
    68
    -I$(TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_TYPE)/native/libjava \
a5b237cfccef 8198844: Clean up GensrcX11Wrappers
ihse
parents: 48355
diff changeset
    69
    -I$(TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/common/awt \
a5b237cfccef 8198844: Clean up GensrcX11Wrappers
ihse
parents: 48355
diff changeset
    70
    -I$(TOPDIR)/src/java.desktop/share/native/common/awt/debug \
a5b237cfccef 8198844: Clean up GensrcX11Wrappers
ihse
parents: 48355
diff changeset
    71
    -I$(TOPDIR)/src/java.desktop/share/native/libawt/awt/image/cvutils \
a5b237cfccef 8198844: Clean up GensrcX11Wrappers
ihse
parents: 48355
diff changeset
    72
    #
17046
72254abdba83 8013480: fix zero build on arm
omajid
parents: 15149
diff changeset
    73
49133
a5b237cfccef 8198844: Clean up GensrcX11Wrappers
ihse
parents: 48355
diff changeset
    74
# Compile the generated C code into an executable.
a5b237cfccef 8198844: Clean up GensrcX11Wrappers
ihse
parents: 48355
diff changeset
    75
$(eval $(call SetupNativeCompilation, BUILD_DATA_GENERATOR, \
a5b237cfccef 8198844: Clean up GensrcX11Wrappers
ihse
parents: 48355
diff changeset
    76
    PROGRAM := data_generator, \
a5b237cfccef 8198844: Clean up GensrcX11Wrappers
ihse
parents: 48355
diff changeset
    77
    OUTPUT_DIR := $(X11WRAPPERS_OUTPUT)/bin, \
a5b237cfccef 8198844: Clean up GensrcX11Wrappers
ihse
parents: 48355
diff changeset
    78
    EXTRA_FILES := $(X11WRAPPERS_OUTPUT)/src/data_generator.c, \
a5b237cfccef 8198844: Clean up GensrcX11Wrappers
ihse
parents: 48355
diff changeset
    79
    CFLAGS := $(X_CFLAGS) $(DATA_GENERATOR_INCLUDES) $(CFLAGS_JDKEXE), \
a5b237cfccef 8198844: Clean up GensrcX11Wrappers
ihse
parents: 48355
diff changeset
    80
    LDFLAGS := $(LDFLAGS_JDKEXE), \
49241
de4b3a04feae 8199606: Set -lc as global LIBS on solstudio
ihse
parents: 49133
diff changeset
    81
    LIBS := $(X_LIBS), \
49133
a5b237cfccef 8198844: Clean up GensrcX11Wrappers
ihse
parents: 48355
diff changeset
    82
    OBJECT_DIR := $(X11WRAPPERS_OUTPUT)/objs, \
a5b237cfccef 8198844: Clean up GensrcX11Wrappers
ihse
parents: 48355
diff changeset
    83
))
25859
3317bb8137f4 8054834: Modular Source Code
chegar
parents: 23010
diff changeset
    84
49133
a5b237cfccef 8198844: Clean up GensrcX11Wrappers
ihse
parents: 48355
diff changeset
    85
# Run the executable to create the data file.
a5b237cfccef 8198844: Clean up GensrcX11Wrappers
ihse
parents: 48355
diff changeset
    86
$(GENSRC_X11WRAPPERS_DATADIR)/sizes-$(BITS).txt: $(BUILD_DATA_GENERATOR_TARGET)
a5b237cfccef 8198844: Clean up GensrcX11Wrappers
ihse
parents: 48355
diff changeset
    87
	$(call LogInfo, Generating X11 wrapper data files)
35241
075bbb8f2423 8146403: Windows build can be faster
erikj
parents: 27799
diff changeset
    88
	$(call MakeDir, $(@D))
49133
a5b237cfccef 8198844: Clean up GensrcX11Wrappers
ihse
parents: 48355
diff changeset
    89
	$(call ExecuteWithLog, $(X11WRAPPERS_OUTPUT)/generation, \
a5b237cfccef 8198844: Clean up GensrcX11Wrappers
ihse
parents: 48355
diff changeset
    90
	    $(BUILD_DATA_GENERATOR_TARGET) | $(SORT) > $@)
a5b237cfccef 8198844: Clean up GensrcX11Wrappers
ihse
parents: 48355
diff changeset
    91
	$(ECHO) IMPORTANT: If you update the X11 wrapper data files, they most certainly
a5b237cfccef 8198844: Clean up GensrcX11Wrappers
ihse
parents: 48355
diff changeset
    92
	$(ECHO) need to be updated for both 32 and 64 bit platforms. You have now
a5b237cfccef 8198844: Clean up GensrcX11Wrappers
ihse
parents: 48355
diff changeset
    93
	$(ECHO) updated them for $(BITS) bit platforms only.
12892
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
    94
49133
a5b237cfccef 8198844: Clean up GensrcX11Wrappers
ihse
parents: 48355
diff changeset
    95
TARGETS += $(GENSRC_X11WRAPPERS_DATADIR)/sizes-$(BITS).txt
a5b237cfccef 8198844: Clean up GensrcX11Wrappers
ihse
parents: 48355
diff changeset
    96
a5b237cfccef 8198844: Clean up GensrcX11Wrappers
ihse
parents: 48355
diff changeset
    97
################################################################################
12892
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
    98
49133
a5b237cfccef 8198844: Clean up GensrcX11Wrappers
ihse
parents: 48355
diff changeset
    99
all: $(TARGETS)
25859
3317bb8137f4 8054834: Modular Source Code
chegar
parents: 23010
diff changeset
   100
49133
a5b237cfccef 8198844: Clean up GensrcX11Wrappers
ihse
parents: 48355
diff changeset
   101
.PHONY: all default