Skip to content

Commit 1fc524d

Browse files
author
duke
committed
Automatic merge of jdk:master into master
2 parents fa4a829 + 76fa974 commit 1fc524d

File tree

1 file changed

+30
-7
lines changed

1 file changed

+30
-7
lines changed

make/common/JdkNativeCompilation.gmk

Lines changed: 30 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,10 @@ ifeq ($(STATIC_LIBS), true)
8989
FindStaticLib =
9090
endif
9191

92+
# Returns the module specific java header dir if it exists.
93+
# Param 1 - module name
9294
GetJavaHeaderDir = \
93-
$(wildcard $(SUPPORT_OUTPUTDIR)/headers/$(strip $1))
95+
$(if $(strip $1),$(wildcard $(SUPPORT_OUTPUTDIR)/headers/$(strip $1)))
9496

9597
# Process a dir description such as "java.base:headers" into a set of proper absolute paths.
9698
ProcessDir = \
@@ -135,15 +137,27 @@ JDK_RCFLAGS=$(RCFLAGS) \
135137
SetupJdkLibrary = $(NamedParamsMacroTemplate)
136138
define SetupJdkLibraryBody
137139
ifeq ($$($1_OUTPUT_DIR), )
138-
$1_OUTPUT_DIR := $$(call FindLibDirForModule, $$(MODULE))
140+
ifneq ($$(MODULE), )
141+
$1_OUTPUT_DIR := $$(call FindLibDirForModule, $$(MODULE))
142+
else
143+
$$(error Must specify OUTPUT_DIR in a MODULE free context)
144+
endif
139145
endif
140146

141147
ifeq ($$($1_OBJECT_DIR), )
142-
$1_OBJECT_DIR := $$(SUPPORT_OUTPUTDIR)/native/$$(MODULE)/lib$$($1_NAME)
148+
ifneq ($$(MODULE), )
149+
$1_OBJECT_DIR := $$(SUPPORT_OUTPUTDIR)/native/$$(MODULE)/lib$$($1_NAME)
150+
else
151+
$$(error Must specify OBJECT_DIR in a MODULE free context)
152+
endif
143153
endif
144154

145155
ifeq ($$($1_SRC), )
146-
$1_SRC := $$(call FindSrcDirsForLib, $$(MODULE), $$($1_NAME))
156+
ifneq ($$(MODULE), )
157+
$1_SRC := $$(call FindSrcDirsForLib, $$(MODULE), $$($1_NAME))
158+
else
159+
$$(error Must specify SRC in a MODULE free context)
160+
endif
147161
else
148162
$1_SRC := $$(foreach dir, $$($1_SRC), $$(call ProcessDir, $$(dir)))
149163
endif
@@ -177,7 +191,8 @@ define SetupJdkLibraryBody
177191
ifneq ($$($1_HEADERS_FROM_SRC), false)
178192
$1_SRC_HEADER_FLAGS := $$(addprefix -I, $$(wildcard $$($1_SRC)))
179193
endif
180-
# Always add the java header dir
194+
195+
# Add the module specific java header dir
181196
$1_SRC_HEADER_FLAGS += $$(addprefix -I, $$(call GetJavaHeaderDir, $$(MODULE)))
182197

183198
ifneq ($$($1_EXTRA_HEADER_DIRS), )
@@ -215,11 +230,19 @@ define SetupJdkExecutableBody
215230
$1_TYPE := EXECUTABLE
216231

217232
ifeq ($$($1_OUTPUT_DIR), )
218-
$1_OUTPUT_DIR := $$(call FindExecutableDirForModule, $$(MODULE))
233+
ifneq ($$(MODULE), )
234+
$1_OUTPUT_DIR := $$(call FindExecutableDirForModule, $$(MODULE))
235+
else
236+
$$(error Must specify OUTPUT_DIR in a MODULE free context)
237+
endif
219238
endif
220239

221240
ifeq ($$($1_OBJECT_DIR), )
222-
$1_OBJECT_DIR := $$(SUPPORT_OUTPUTDIR)/native/$$(MODULE)/$$($1_NAME)
241+
ifneq ($$(MODULE), )
242+
$1_OBJECT_DIR := $$(SUPPORT_OUTPUTDIR)/native/$$(MODULE)/$$($1_NAME)
243+
else
244+
$$(error Must specify OBJECT_DIR in a MODULE free context)
245+
endif
223246
endif
224247

225248
ifeq ($$($1_VERSIONINFO_RESOURCE), )

0 commit comments

Comments
 (0)