56
57 ################################################################################
58 # Build standard launcher.
59
60 # Setup make rules for building a standard launcher.
61 #
62 # Parameter 1 is the name of the rule. This name is used as variable prefix,
63 # and the targets generated are listed in a variable by that name. It is also
64 # used as the name of the executable.
65 #
66 # Remaining parameters are named arguments. These include:
67 # MAIN_MODULE The module of the main class to launch if different from the
68 # current module
69 # MAIN_CLASS The Java main class to launch
70 # JAVA_ARGS Processed into a -DJAVA_ARGS and added to CFLAGS
71 # EXTRA_JAVA_ARGS Processed into a -DEXTRA_JAVA_ARGS and is prepended
72 # before JAVA_ARGS to CFLAGS, primarily to allow long string literal
73 # compile time defines exceeding Visual Studio 2013 limitations.
74 # CFLAGS Additional CFLAGS
75 # CFLAGS_windows Additional CFLAGS_windows
76 # LDFLAGS_solaris Additional LDFLAGS_solaris
77 # RC_FLAGS Additional RC_FLAGS
78 # MACOSX_SIGNED On macosx, sign this binary
79 # OPTIMIZATION Override default optimization level (LOW)
80 # OUTPUT_DIR Override default output directory
81 # VERSION_INFO_RESOURCE Override default Windows resource file
82 SetupBuildLauncher = $(NamedParamsMacroTemplate)
83 define SetupBuildLauncherBody
84 # Setup default values (unless overridden)
85 ifeq ($$($1_OPTIMIZATION), )
86 $1_OPTIMIZATION := LOW
87 endif
88
89 ifeq ($$($1_MAIN_MODULE), )
90 $1_MAIN_MODULE := $(MODULE)
91 endif
92
93 $1_JAVA_ARGS += -ms8m
94 ifneq ($$($1_MAIN_CLASS), )
95 $1_LAUNCHER_CLASS := -m $$($1_MAIN_MODULE)/$$($1_MAIN_CLASS)
96 endif
97
122 $(SUPPORT_OUTPUTDIR)/modules_libs/jdk.jdwp.agent/libdt_socket.a \
123 $(SUPPORT_OUTPUTDIR)/modules_libs/jdk.jdwp.agent/libjdwp.a \
124 $(SUPPORT_OUTPUTDIR)/native/java.base/$(LIBRARY_PREFIX)fdlibm$(STATIC_LIBRARY_SUFFIX) \
125 -framework CoreFoundation \
126 -framework Foundation \
127 -framework SystemConfiguration \
128 -lstdc++ -liconv
129 endif
130 endif
131
132 ifeq ($(USE_EXTERNAL_LIBZ), true)
133 $1_LIBS += -lz
134 endif
135
136 $1_WINDOWS_JLI_LIB := $(call FindStaticLib, java.base, jli, /libjli)
137
138 $$(eval $$(call SetupJdkExecutable, BUILD_LAUNCHER_$1, \
139 NAME := $1, \
140 EXTRA_FILES := $(LAUNCHER_SRC)/main.c, \
141 OPTIMIZATION := $$($1_OPTIMIZATION), \
142 CFLAGS := $$(CFLAGS_JDKEXE) $$($1_CFLAGS) \
143 $(LAUNCHER_CFLAGS) \
144 $(VERSION_CFLAGS) \
145 -DLAUNCHER_NAME='"$(LAUNCHER_NAME)"' \
146 -DPROGNAME='"$1"' \
147 $$($1_CFLAGS), \
148 CFLAGS_linux := -fPIC, \
149 CFLAGS_solaris := -KPIC -DHAVE_GETHRTIME, \
150 CFLAGS_windows := $$($1_CFLAGS_windows), \
151 DISABLED_WARNINGS_gcc := unused-function, \
152 LDFLAGS := $$(LDFLAGS_JDKEXE) \
153 $$(call SET_EXECUTABLE_ORIGIN) \
154 $$($1_LDFLAGS), \
155 LDFLAGS_linux := $$(call SET_EXECUTABLE_ORIGIN,/../lib) \
156 -L$(call FindLibDirForModule, java.base), \
157 LDFLAGS_macosx := $$(call SET_EXECUTABLE_ORIGIN,/../lib) \
158 -L$(call FindLibDirForModule, java.base), \
159 LDFLAGS_solaris := $$(call SET_EXECUTABLE_ORIGIN,/../lib) \
160 -L$(call FindLibDirForModule, java.base), \
161 LDFLAGS_aix := -L$(SUPPORT_OUTPUTDIR)/native/java.base, \
162 LIBS := $(JDKEXE_LIBS) $$($1_LIBS), \
|
56
57 ################################################################################
58 # Build standard launcher.
59
60 # Setup make rules for building a standard launcher.
61 #
62 # Parameter 1 is the name of the rule. This name is used as variable prefix,
63 # and the targets generated are listed in a variable by that name. It is also
64 # used as the name of the executable.
65 #
66 # Remaining parameters are named arguments. These include:
67 # MAIN_MODULE The module of the main class to launch if different from the
68 # current module
69 # MAIN_CLASS The Java main class to launch
70 # JAVA_ARGS Processed into a -DJAVA_ARGS and added to CFLAGS
71 # EXTRA_JAVA_ARGS Processed into a -DEXTRA_JAVA_ARGS and is prepended
72 # before JAVA_ARGS to CFLAGS, primarily to allow long string literal
73 # compile time defines exceeding Visual Studio 2013 limitations.
74 # CFLAGS Additional CFLAGS
75 # CFLAGS_windows Additional CFLAGS_windows
76 # EXTRA_RC_FLAGS Additional EXTRA_RC_FLAGS
77 # MACOSX_SIGNED On macosx, sign this binary
78 # OPTIMIZATION Override default optimization level (LOW)
79 # OUTPUT_DIR Override default output directory
80 # VERSION_INFO_RESOURCE Override default Windows resource file
81 SetupBuildLauncher = $(NamedParamsMacroTemplate)
82 define SetupBuildLauncherBody
83 # Setup default values (unless overridden)
84 ifeq ($$($1_OPTIMIZATION), )
85 $1_OPTIMIZATION := LOW
86 endif
87
88 ifeq ($$($1_MAIN_MODULE), )
89 $1_MAIN_MODULE := $(MODULE)
90 endif
91
92 $1_JAVA_ARGS += -ms8m
93 ifneq ($$($1_MAIN_CLASS), )
94 $1_LAUNCHER_CLASS := -m $$($1_MAIN_MODULE)/$$($1_MAIN_CLASS)
95 endif
96
121 $(SUPPORT_OUTPUTDIR)/modules_libs/jdk.jdwp.agent/libdt_socket.a \
122 $(SUPPORT_OUTPUTDIR)/modules_libs/jdk.jdwp.agent/libjdwp.a \
123 $(SUPPORT_OUTPUTDIR)/native/java.base/$(LIBRARY_PREFIX)fdlibm$(STATIC_LIBRARY_SUFFIX) \
124 -framework CoreFoundation \
125 -framework Foundation \
126 -framework SystemConfiguration \
127 -lstdc++ -liconv
128 endif
129 endif
130
131 ifeq ($(USE_EXTERNAL_LIBZ), true)
132 $1_LIBS += -lz
133 endif
134
135 $1_WINDOWS_JLI_LIB := $(call FindStaticLib, java.base, jli, /libjli)
136
137 $$(eval $$(call SetupJdkExecutable, BUILD_LAUNCHER_$1, \
138 NAME := $1, \
139 EXTRA_FILES := $(LAUNCHER_SRC)/main.c, \
140 OPTIMIZATION := $$($1_OPTIMIZATION), \
141 CFLAGS := $$(CFLAGS_JDKEXE) \
142 $(LAUNCHER_CFLAGS) \
143 $(VERSION_CFLAGS) \
144 -DLAUNCHER_NAME='"$(LAUNCHER_NAME)"' \
145 -DPROGNAME='"$1"' \
146 $$($1_CFLAGS), \
147 CFLAGS_linux := -fPIC, \
148 CFLAGS_solaris := -KPIC -DHAVE_GETHRTIME, \
149 CFLAGS_windows := $$($1_CFLAGS_windows), \
150 DISABLED_WARNINGS_gcc := unused-function, \
151 LDFLAGS := $$(LDFLAGS_JDKEXE) \
152 $$(call SET_EXECUTABLE_ORIGIN) \
153 $$($1_LDFLAGS), \
154 LDFLAGS_linux := $$(call SET_EXECUTABLE_ORIGIN,/../lib) \
155 -L$(call FindLibDirForModule, java.base), \
156 LDFLAGS_macosx := $$(call SET_EXECUTABLE_ORIGIN,/../lib) \
157 -L$(call FindLibDirForModule, java.base), \
158 LDFLAGS_solaris := $$(call SET_EXECUTABLE_ORIGIN,/../lib) \
159 -L$(call FindLibDirForModule, java.base), \
160 LDFLAGS_aix := -L$(SUPPORT_OUTPUTDIR)/native/java.base, \
161 LIBS := $(JDKEXE_LIBS) $$($1_LIBS), \
|