37 GENSRC_X11WRAPPERS := |
37 GENSRC_X11WRAPPERS := |
38 # Put temporary c-code and executable to calculate offsets here. |
38 # Put temporary c-code and executable to calculate offsets here. |
39 # Also put verification offset file here as well. |
39 # Also put verification offset file here as well. |
40 GENSRC_X11WRAPPERS_TMP := $(JDK_OUTPUTDIR)/gensrc_x11wrappers |
40 GENSRC_X11WRAPPERS_TMP := $(JDK_OUTPUTDIR)/gensrc_x11wrappers |
41 # Put the generated Java classes used to interface X11 from awt here. |
41 # Put the generated Java classes used to interface X11 from awt here. |
42 GENSRC_X11WRAPPERS_DST := $(JDK_OUTPUTDIR)/gensrc/sun/awt/X11 |
42 GENSRC_X11WRAPPERS_DST := $(JDK_OUTPUTDIR)/gensrc/java.desktop/sun/awt/X11 |
43 |
43 |
44 # The pre-calculated offset file are stored here: |
44 # The pre-calculated offset file are stored here: |
45 GENSRC_SIZER_DIR := $(JDK_TOPDIR)/make/data/x11wrappergen |
45 GENSRC_SIZER_DIR := $(JDK_TOPDIR)/make/data/x11wrappergen |
46 |
46 |
47 # Normal case is to generate only according to target bits |
47 # Normal case is to generate only according to target bits |
67 $(RM) '$@' |
67 $(RM) '$@' |
68 $(SORT) $< > $@ |
68 $(SORT) $< > $@ |
69 |
69 |
70 # Run the tool on the offset files copied from the source repository to generate several Java classes |
70 # Run the tool on the offset files copied from the source repository to generate several Java classes |
71 # used in awt. |
71 # used in awt. |
72 $(JDK_OUTPUTDIR)/gensrc/_the.generated.x11: $(GENSRC_X11_SIZES_USED) $(BUILD_TOOLS) |
72 $(JDK_OUTPUTDIR)/gensrc/_the.generated.x11: $(GENSRC_X11_SIZES_USED) $(BUILD_TOOLS_JDK) |
73 $(MKDIR) -p $(GENSRC_X11WRAPPERS_DST) |
73 $(MKDIR) -p $(GENSRC_X11WRAPPERS_DST) |
74 $(TOOL_WRAPPERGENERATOR) $(GENSRC_X11WRAPPERS_DST) $(GENSRC_SIZER_DIR)/xlibtypes.txt "gen" $(GENSRC_X11WRAPPERS_TMP)/sizes |
74 $(TOOL_WRAPPERGENERATOR) $(GENSRC_X11WRAPPERS_DST) $(GENSRC_SIZER_DIR)/xlibtypes.txt "gen" $(GENSRC_X11WRAPPERS_TMP)/sizes |
75 $(TOUCH) $@ |
75 $(TOUCH) $@ |
76 |
76 |
77 GENSRC_X11WRAPPERS += $(JDK_OUTPUTDIR)/gensrc/_the.generated.x11 |
77 GENSRC_X11WRAPPERS += $(JDK_OUTPUTDIR)/gensrc/_the.generated.x11 |
79 ifneq ($(COMPILE_TYPE), cross) |
79 ifneq ($(COMPILE_TYPE), cross) |
80 # This is not a cross compile, regenerate the offset file, so that we |
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. |
81 # can compare it with the version in the source code repository. |
82 |
82 |
83 # Generate the C code for the program that will output the offset file. |
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) |
84 $(GENSRC_X11WRAPPERS_TMP)/sizer.%.c: $(GENSRC_SIZER_DIR)/xlibtypes.txt $(BUILD_TOOLS_JDK) |
85 $(ECHO) "Generating X11 wrapper ($*-bit version)" |
85 $(ECHO) "Generating X11 wrapper ($*-bit version)" |
86 $(MKDIR) -p $(@D) |
86 $(MKDIR) -p $(@D) |
87 $(TOOL_WRAPPERGENERATOR) $(@D) $(GENSRC_SIZER_DIR)/xlibtypes.txt "sizer" $* |
87 $(TOOL_WRAPPERGENERATOR) $(@D) $(GENSRC_SIZER_DIR)/xlibtypes.txt "sizer" $* |
88 |
88 |
89 # use -m32/-m64 only if the compiler supports it |
89 # use -m32/-m64 only if the compiler supports it |
90 ifeq ($(COMPILER_SUPPORTS_TARGET_BITS_FLAG), true) |
90 ifeq ($(COMPILER_SUPPORTS_TARGET_BITS_FLAG), true) |
91 MEMORY_MODEL_FLAG="$(COMPILER_TARGET_BITS_FLAG)$*" |
91 MEMORY_MODEL_FLAG="$(COMPILER_TARGET_BITS_FLAG)$*" |
92 endif |
92 endif |
93 |
93 |
|
94 SIZER_CFLAGS := -I$(JDK_OUTPUTDIR)/include \ |
|
95 -I$(JDK_TOPDIR)/src/java.base/share/native/include \ |
|
96 -I$(JDK_TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_EXPORT_DIR)/native/include \ |
|
97 -I$(JDK_TOPDIR)/src/java.base/share/native/libjava \ |
|
98 -I$(JDK_TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_API_DIR)/native/libjava \ |
|
99 -I$(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_API_DIR)/native/common/sun/awt \ |
|
100 -I$(JDK_TOPDIR)/src/java.desktop/share/native/common/sun/awt/debug \ |
|
101 -I$(JDK_TOPDIR)/src/java.desktop/share/native/libawt/sun/awt/image/cvutils \ |
|
102 # |
|
103 |
94 # Compile the C code into an executable. |
104 # Compile the C code into an executable. |
95 $(GENSRC_X11WRAPPERS_TMP)/sizer.%.exe: $(GENSRC_X11WRAPPERS_TMP)/sizer.%.c |
105 $(GENSRC_X11WRAPPERS_TMP)/sizer.%.exe: $(GENSRC_X11WRAPPERS_TMP)/sizer.%.c |
96 $(MKDIR) -p $(@D) |
106 $(MKDIR) -p $(@D) |
97 (cd $(@D) && $(CC) $(MEMORY_MODEL_FLAG) -o $@ $< \ |
107 (cd $(@D) && $(CC) $(MEMORY_MODEL_FLAG) -o $@ $< \ |
98 $(X_CFLAGS) \ |
108 $(X_CFLAGS) \ |
99 $(X_LIBS) \ |
109 $(X_LIBS) \ |
100 -I$(JDK_OUTPUTDIR)/include \ |
110 $(SIZER_CFLAGS) -lc) |
101 -I$(JDK_TOPDIR)/src/share/javavm/export \ |
|
102 -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_EXPORT_DIR)/javavm/export \ |
|
103 -I$(JDK_TOPDIR)/src/share/native/common \ |
|
104 -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/common \ |
|
105 -I$(JDK_TOPDIR)/src/solaris/native/sun/awt \ |
|
106 -I$(JDK_TOPDIR)/src/share/native/sun/awt/debug \ |
|
107 -I$(JDK_TOPDIR)/src/share/native/sun/awt/image/cvutils -lc) |
|
108 |
111 |
109 .PRECIOUS: $(GENSRC_X11WRAPPERS_TMP)/sizer.%.exe $(GENSRC_X11WRAPPERS_TMP)/sizer.%.c |
112 .PRECIOUS: $(GENSRC_X11WRAPPERS_TMP)/sizer.%.exe $(GENSRC_X11WRAPPERS_TMP)/sizer.%.c |
110 |
113 |
111 # Run the executable create the offset file and check that it is identical |
114 # Run the executable create the offset file and check that it is identical |
112 # to the offset file in the source code repository. |
115 # to the offset file in the source code repository. |