11#
2- # Copyright (c) 2011, 2024 , Oracle and/or its affiliates. All rights reserved.
2+ # Copyright (c) 2011, 2025 , Oracle and/or its affiliates. All rights reserved.
33# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44#
55# This code is free software; you can redistribute it and/or modify it
@@ -48,41 +48,44 @@ JAVA_MANIFEST := $(TOPDIR)/src/java.base/windows/native/launcher/java.manifest
4848# used as the name of the executable.
4949#
5050# Remaining parameters are named arguments. These include:
51- # MAIN_MODULE The module of the main class to launch if different from the
52- # current module
5351# MAIN_CLASS The Java main class to launch
54- # JAVA_ARGS Processed into a -DJAVA_ARGS and added to CFLAGS
55- # EXTRA_JAVA_ARGS Processed into a -DEXTRA_JAVA_ARGS and is prepended
56- # before JAVA_ARGS to CFLAGS, primarily to allow long string literal
57- # compile time defines exceeding Visual Studio 2013 limitations.
58- # CFLAGS Additional CFLAGS
59- # CFLAGS_windows Additional CFLAGS_windows
52+ # JAVA_ARGS Additional arguments to pass to Java when launching the main class
53+ # EXPAND_CLASSPATH_WILDCARDS Set to true to pass EXPAND_CLASSPATH_WILDCARDS
54+ # ENABLE_ARG_FILES Set to true to pass ENABLE_ARG_FILES
55+ # WINDOWS_JAVAW Set to true to pass JAVAW on Windows
6056# EXTRA_RCFLAGS Additional EXTRA_RCFLAGS
6157# MACOSX_PRIVILEGED On macosx, allow to access other processes
6258# OPTIMIZATION Override default optimization level (LOW)
6359# OUTPUT_DIR Override default output directory
6460# VERSION_INFO_RESOURCE Override default Windows resource file
6561# STATIC_LAUNCHER If true, will use settings for building a static launcher
62+ # LIBS Additional libraries to pass as LIBS argument to SetupJdkExecutable
6663SetupBuildLauncher = $(NamedParamsMacroTemplate)
6764define SetupBuildLauncherBody
6865 # Setup default values (unless overridden)
6966 ifeq ($$($1_OPTIMIZATION), )
7067 $1_OPTIMIZATION := LOW
7168 endif
7269
73- ifeq ($$($1_MAIN_MODULE), )
74- $1_MAIN_MODULE := $(MODULE)
75- endif
70+ $1_MAIN_MODULE := $(MODULE)
7671
7772 ifneq ($$($1_MAIN_CLASS), )
7873 $1_JAVA_ARGS += -Xms8m
7974 $1_LAUNCHER_CLASS := -m $$($1_MAIN_MODULE)/$$($1_MAIN_CLASS)
8075 endif
8176
82- ifneq ($$($1_EXTRA_JAVA_ARGS), )
83- $1_EXTRA_JAVA_ARGS_STR := '{ $$(strip $$(foreach a, \
84- $$(addprefix -J, $$($1_EXTRA_JAVA_ARGS)), "$$a"$(COMMA) )) }'
85- $1_CFLAGS += -DEXTRA_JAVA_ARGS=$$($1_EXTRA_JAVA_ARGS_STR)
77+ ifeq ($$($1_EXPAND_CLASSPATH_WILDCARDS), true)
78+ $1_CFLAGS += -DEXPAND_CLASSPATH_WILDCARDS
79+ endif
80+
81+ ifeq ($$($1_ENABLE_ARG_FILES), true)
82+ $1_CFLAGS += -DENABLE_ARG_FILES
83+ endif
84+
85+ ifeq ($(call isTargetOs, windows), true)
86+ ifeq ($$($1_WINDOWS_JAVAW), true)
87+ $1_CFLAGS += -DJAVAW
88+ endif
8689 endif
8790
8891 ifneq ($$($1_JAVA_ARGS), )
@@ -143,8 +146,8 @@ define SetupBuildLauncherBody
143146 -DLAUNCHER_NAME='"$$(LAUNCHER_NAME)"' \
144147 -DPROGNAME='"$1"' \
145148 $$($1_CFLAGS), \
146- CFLAGS_windows := $$($1_CFLAGS_windows), \
147149 EXTRA_HEADER_DIRS := java.base:libjvm, \
150+ JAVA_HEADERS := false, \
148151 DISABLED_WARNINGS_gcc := unused-function unused-variable, \
149152 DISABLED_WARNINGS_clang := unused-function, \
150153 LDFLAGS := $$($1_LDFLAGS), \
@@ -154,12 +157,6 @@ define SetupBuildLauncherBody
154157 JDK_LIBS := $$($1_JDK_LIBS), \
155158 JDK_LIBS_windows := $$($1_JDK_LIBS_windows), \
156159 LIBS := $$($1_LIBS), \
157- LIBS_unix := $(LIBZ_LIBS), \
158- LIBS_linux := $(LIBDL) -lpthread, \
159- LIBS_macosx := \
160- -framework ApplicationServices \
161- -framework Cocoa \
162- -framework Security, \
163160 LINK_TYPE := $$($1_LINK_TYPE), \
164161 OUTPUT_DIR := $$($1_OUTPUT_DIR), \
165162 OBJECT_DIR := $$($1_OBJECT_DIR), \
0 commit comments