45 ifeq ($(COMPILE_TYPE), cross) |
46 ifeq ($(COMPILE_TYPE), cross) |
46 $(error It is not possible to update the x11wrappers when cross-compiling) |
47 $(error It is not possible to update the x11wrappers when cross-compiling) |
47 endif |
48 endif |
48 |
49 |
49 X11WRAPPERS_OUTPUT := $(SUPPORT_OUTPUTDIR)/x11wrappers |
50 X11WRAPPERS_OUTPUT := $(SUPPORT_OUTPUTDIR)/x11wrappers |
|
51 GENERATOR_SOURCE_FILE := $(X11WRAPPERS_OUTPUT)/src/data_generator.c |
50 |
52 |
51 GENSRC_X11WRAPPERS_DATADIR := $(TOPDIR)/make/data/x11wrappergen |
53 GENSRC_X11WRAPPERS_DATADIR := $(TOPDIR)/make/data/x11wrappergen |
|
54 WRAPPER_OUTPUT_FILE := $(GENSRC_X11WRAPPERS_DATADIR)/sizes-$(BITS).txt |
52 |
55 |
53 BITS := $(OPENJDK_TARGET_CPU_BITS) |
56 BITS := $(OPENJDK_TARGET_CPU_BITS) |
54 |
57 |
55 # Generate the C code for the program that will output the offset file. |
58 # Generate the C code for the program that will output the offset file. |
56 $(X11WRAPPERS_OUTPUT)/src/data_generator.c: $(GENSRC_X11WRAPPERS_DATADIR)/xlibtypes.txt $(BUILD_TOOLS_JDK) |
59 $(eval $(call SetupExecute, gensrc_generator, \ |
57 $(call LogInfo, Generating X11 wrapper data generator source code) |
60 INFO := Generating X11 wrapper data generator source code, \ |
58 $(call MakeDir, $(@D)) |
61 DEPS := $(GENSRC_X11WRAPPERS_DATADIR)/xlibtypes.txt $(BUILD_TOOLS_JDK), \ |
59 $(call ExecuteWithLog, $@, \ |
62 OUTPUT_FILE := $(GENERATOR_SOURCE_FILE), \ |
60 $(TOOL_WRAPPERGENERATOR) gen_c_source $@ $(GENSRC_X11WRAPPERS_DATADIR)/xlibtypes.txt $(BITS)) |
63 COMMAND := $(TOOL_WRAPPERGENERATOR) gen_c_source $(GENERATOR_SOURCE_FILE) \ |
|
64 $(GENSRC_X11WRAPPERS_DATADIR)/xlibtypes.txt $(BITS), \ |
|
65 )) |
61 |
66 |
62 DATA_GENERATOR_INCLUDES := \ |
67 DATA_GENERATOR_INCLUDES := \ |
63 -I$(TOPDIR)/src/hotspot/share/include \ |
68 -I$(TOPDIR)/src/hotspot/share/include \ |
64 -I$(TOPDIR)/src/hotspot/os/$(HOTSPOT_TARGET_OS_TYPE)/include \ |
69 -I$(TOPDIR)/src/hotspot/os/$(HOTSPOT_TARGET_OS_TYPE)/include \ |
65 -I$(SUPPORT_OUTPUTDIR)/modules_include/java.base \ |
70 -I$(SUPPORT_OUTPUTDIR)/modules_include/java.base \ |
73 |
78 |
74 # Compile the generated C code into an executable. |
79 # Compile the generated C code into an executable. |
75 $(eval $(call SetupNativeCompilation, BUILD_DATA_GENERATOR, \ |
80 $(eval $(call SetupNativeCompilation, BUILD_DATA_GENERATOR, \ |
76 PROGRAM := data_generator, \ |
81 PROGRAM := data_generator, \ |
77 OUTPUT_DIR := $(X11WRAPPERS_OUTPUT)/bin, \ |
82 OUTPUT_DIR := $(X11WRAPPERS_OUTPUT)/bin, \ |
78 EXTRA_FILES := $(X11WRAPPERS_OUTPUT)/src/data_generator.c, \ |
83 EXTRA_FILES := $(GENERATOR_SOURCE_FILE), \ |
79 CFLAGS := $(X_CFLAGS) $(DATA_GENERATOR_INCLUDES) $(CFLAGS_JDKEXE), \ |
84 CFLAGS := $(X_CFLAGS) $(DATA_GENERATOR_INCLUDES) $(CFLAGS_JDKEXE), \ |
80 LDFLAGS := $(LDFLAGS_JDKEXE), \ |
85 LDFLAGS := $(LDFLAGS_JDKEXE), \ |
81 LIBS := $(X_LIBS), \ |
86 LIBS := $(X_LIBS), \ |
82 OBJECT_DIR := $(X11WRAPPERS_OUTPUT)/objs, \ |
87 OBJECT_DIR := $(X11WRAPPERS_OUTPUT)/objs, \ |
83 )) |
88 )) |
84 |
89 |
85 # Run the executable to create the data file. |
90 # Run the executable to create the data file. |
86 $(GENSRC_X11WRAPPERS_DATADIR)/sizes-$(BITS).txt: $(BUILD_DATA_GENERATOR_TARGET) |
91 $(eval $(call SetupExecute, run_wrappergen, \ |
87 $(call LogInfo, Generating X11 wrapper data files) |
92 INFO := Generating X11 wrapper data files, \ |
88 $(call MakeDir, $(@D)) |
93 DEPS := $(BUILD_DATA_GENERATOR), \ |
89 $(call ExecuteWithLog, $(X11WRAPPERS_OUTPUT)/generation, \ |
94 OUTPUT_FILE := $(WRAPPER_OUTPUT_FILE), \ |
90 $(BUILD_DATA_GENERATOR_TARGET) | $(SORT) > $@) |
95 COMMAND := $(BUILD_DATA_GENERATOR_TARGET) | $(SORT) > $(WRAPPER_OUTPUT_FILE), \ |
|
96 )) |
|
97 |
|
98 wrapper-information: $(run_wrappergen) |
91 $(ECHO) IMPORTANT: If you update the X11 wrapper data files, they most certainly |
99 $(ECHO) IMPORTANT: If you update the X11 wrapper data files, they most certainly |
92 $(ECHO) need to be updated for both 32 and 64 bit platforms. You have now |
100 $(ECHO) need to be updated for both 32 and 64 bit platforms. You have now |
93 $(ECHO) updated them for $(BITS) bit platforms only. |
101 $(ECHO) updated them for $(BITS) bit platforms only. |
94 |
102 |
95 TARGETS += $(GENSRC_X11WRAPPERS_DATADIR)/sizes-$(BITS).txt |
103 TARGETS += $(run_wrappergen) wrapper-information |
96 |
104 |
97 ################################################################################ |
105 ################################################################################ |
98 |
106 |
99 all: $(TARGETS) |
107 all: $(TARGETS) |
100 |
108 |