77 TARGETS += $(COPY_UCRT_DLLS) |
77 TARGETS += $(COPY_UCRT_DLLS) |
78 endif |
78 endif |
79 endif |
79 endif |
80 |
80 |
81 ################################################################################ |
81 ################################################################################ |
82 # |
82 # In jvm.cfg, the first listed KNOWN variant is the default. On most build |
83 # How to install jvm.cfg. |
83 # configurations, that is the server variant. |
84 # |
84 ifeq ($(OPENJDK_TARGET_OS)-$(OPENJDK_TARGET_CPU), windows-x86) |
85 ifeq ($(call check-jvm-variant, zero), true) |
85 DEFAULT_CFG_VARIANT ?= client |
86 JVMCFG_ARCH := zero |
86 endif |
87 else |
87 DEFAULT_CFG_VARIANT ?= server |
88 JVMCFG_ARCH := $(OPENJDK_TARGET_CPU_LEGACY) |
88 |
89 endif |
89 # Any variant other than server, client or minimal is represented as server in |
90 |
90 # the cfg file. |
91 ifeq ($(OPENJDK_TARGET_OS), macosx) |
91 VALID_CFG_VARIANTS := server client minimal |
92 JVMCFG_SRC := $(TOPDIR)/src/java.base/macosx/conf/$(JVMCFG_ARCH)/jvm.cfg |
92 CFG_VARIANTS := $(filter $(VALID_CFG_VARIANTS), $(JVM_VARIANTS)) \ |
93 else |
93 $(if $(filter-out $(VALID_CFG_VARIANTS), $(JVM_VARIANTS)), server) |
94 JVMCFG_SRC := $(TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_TYPE)/conf/$(JVMCFG_ARCH)/jvm.cfg |
94 |
95 # Allow override by ALT_JVMCFG_SRC if it exists |
95 # Change the order to put the default variant first if present. |
96 JVMCFG_SRC := $(if $(wildcard $(ALT_JVMCFG_SRC)),$(ALT_JVMCFG_SRC),$(JVMCFG_SRC)) |
96 ORDERED_CFG_VARIANTS := \ |
97 endif |
97 $(if $(filter $(DEFAULT_CFG_VARIANT), $(CFG_VARIANTS)), $(DEFAULT_CFG_VARIANT)) \ |
|
98 $(filter-out $(DEFAULT_CFG_VARIANT), $(CFG_VARIANTS)) |
|
99 |
98 JVMCFG := $(LIB_DST_DIR)/jvm.cfg |
100 JVMCFG := $(LIB_DST_DIR)/jvm.cfg |
99 |
101 |
100 ifeq ($(OPENJDK_TARGET_CPU_BITS), 64) |
102 define print-cfg-line |
101 COPY_JVM_CFG_FILE := true |
103 $(call LogInfo, Adding -$1 $2 to jvm.cfg) |
102 else |
104 $(PRINTF) -- "-$1 $2\n" >> $@ $(NEWLINE) |
103 # On 32-bit machines we have three potential VMs: client, server and minimal. |
105 endef |
104 # Historically we usually have both client and server and so that is what the |
106 |
105 # committed jvm.cfg expects (including platform specific ergonomics switches |
107 $(JVMCFG): $(call DependOnVariable, ORDERED_CFG_VARIANTS) |
106 # to decide whether to use client or server by default). So when we have anything |
108 $(call MakeTargetDir) |
107 # other than client and server we need to define a new jvm.cfg file. |
109 $(RM) $@ |
108 # The main problem is deciding whether to use aliases for the VMs that are not |
110 $(foreach v, $(ORDERED_CFG_VARIANTS), \ |
109 # present and the current position is that we add aliases for client and server, but |
111 $(call print-cfg-line,$v,KNOWN) \ |
110 # not for minimal. |
112 ) |
111 CLIENT_AND_SERVER := $(call check-jvm-variant, client)+$(call check-jvm-variant, server) |
113 # If either of server or client aren't present, add IGNORE lines for |
112 ifeq ($(CLIENT_AND_SERVER), true+true) |
114 # them. |
113 COPY_JVM_CFG_FILE := true |
115 $(foreach v, server client, \ |
114 else |
116 $(if $(filter $v, $(ORDERED_CFG_VARIANTS)), , \ |
115 # For zero, the default jvm.cfg file is sufficient |
117 $(call print-cfg-line,$v,IGNORE) \ |
116 ifeq ($(call check-jvm-variant, zero), true) |
118 ) \ |
117 COPY_JVM_CFG_FILE := true |
119 ) |
118 endif |
|
119 endif |
|
120 endif |
|
121 |
|
122 ifeq ($(COPY_JVM_CFG_FILE), true) |
|
123 $(JVMCFG): $(JVMCFG_SRC) |
|
124 $(call install-file) |
|
125 else |
|
126 $(JVMCFG): |
|
127 $(MKDIR) -p $(@D) |
|
128 $(RM) $(@) |
|
129 # Now check for other permutations |
|
130 ifeq ($(call check-jvm-variant, server), true) |
|
131 $(PRINTF) -- "-server KNOWN\n">>$(@) |
|
132 $(PRINTF) -- "-client ALIASED_TO -server\n">>$(@) |
|
133 ifeq ($(call check-jvm-variant, minimal), true) |
|
134 $(PRINTF) -- "-minimal KNOWN\n">>$(@) |
|
135 endif |
|
136 else |
|
137 ifeq ($(call check-jvm-variant, client), true) |
|
138 $(PRINTF) -- "-client KNOWN\n">>$(@) |
|
139 $(PRINTF) -- "-server ALIASED_TO -client\n">>$(@) |
|
140 ifeq ($(call check-jvm-variant, minimal), true) |
|
141 $(PRINTF) -- "-minimal KNOWN\n">>$(@) |
|
142 endif |
|
143 else |
|
144 ifeq ($(call check-jvm-variant, minimal), true) |
|
145 $(PRINTF) -- "-minimal KNOWN\n">>$(@) |
|
146 $(PRINTF) -- "-server ALIASED_TO -minimal\n">>$(@) |
|
147 $(PRINTF) -- "-client ALIASED_TO -minimal\n">>$(@) |
|
148 endif |
|
149 endif |
|
150 endif |
|
151 endif |
|
152 |
120 |
153 TARGETS += $(JVMCFG) |
121 TARGETS += $(JVMCFG) |
154 |
122 |
155 ################################################################################ |
123 ################################################################################ |
156 |
124 |