blob: ba3844ef0e4d08000385abe7dc40555352d99305 [file] [log] [blame]
Kelly O'Hair38c629a2012-10-26 14:23:29 -07001#
2# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
3# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4#
5# This code is free software; you can redistribute it and/or modify it
6# under the terms of the GNU General Public License version 2 only, as
7# published by the Free Software Foundation. Oracle designates this
8# particular file as subject to the "Classpath" exception as provided
9# by Oracle in the LICENSE file that accompanied this code.
10#
11# This code is distributed in the hope that it will be useful, but WITHOUT
12# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14# version 2 for more details (a copy is included in the LICENSE file that
15# accompanied this code).
16#
17# You should have received a copy of the GNU General Public License version
18# 2 along with this work; if not, write to the Free Software Foundation,
19# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20#
21# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22# or visit www.oracle.com if you need additional information or have any
23# questions.
24#
25
26defalt: all
27
28include $(SPEC)
29include MakeBase.gmk
30include NativeCompilation.gmk
31
32# Setup the java compilers for the JDK build.
33include Setup.gmk
34
35# Build tools
36include Tools.gmk
37
38BUILD_LAUNCHERS=
39
40# When building a legacy overlay image (on solaris 64 bit), the launchers
41# need to be built with a different rpath and a different output dir.
42ifeq ($(OVERLAY_IMAGES),true)
43 ORIGIN_ROOT:=/../..
44 OUTPUT_SUBDIR:=$(OPENJDK_TARGET_CPU_ISADIR)
45else
46 ORIGIN_ROOT:=/..
47endif
48
49ifeq ($(OPENJDK_TARGET_OS), macosx)
50 ORIGIN_ARG:=$(call SET_EXECUTABLE_ORIGIN)
51else
52 ORIGIN_ARG:=$(call SET_EXECUTABLE_ORIGIN,$(ORIGIN_ROOT)/lib$(OPENJDK_TARGET_CPU_LIBDIR)/jli) \
53 $(call SET_EXECUTABLE_ORIGIN,$(ORIGIN_ROOT)/jre/lib$(OPENJDK_TARGET_CPU_LIBDIR)/jli)
54endif
55
56#
57# Applications expect to be able to link against libjawt without invoking
58# System.loadLibrary("jawt") first. This was the behaviour described in the
59# devloper documentation of JAWT and what worked with OpenJDK6.
60#
61ifneq ($(findstring $(OPENJDK_TARGET_OS), linux solaris),)
62 ORIGIN_ARG+=$(call SET_EXECUTABLE_ORIGIN,$(ORIGIN_ROOT)/lib$(OPENJDK_TARGET_CPU_LIBDIR)) \
63 $(call SET_EXECUTABLE_ORIGIN,$(ORIGIN_ROOT)/jre/lib$(OPENJDK_TARGET_CPU_LIBDIR))
64endif
65
66define SetupLauncher
67 # TODO: Fix mapfile on solaris. Won't work with ld as linker.
68 # Parameter 1 is the name of the launcher (java,javac,jar...)
69 # Parameter 2 is extra CFLAGS
70 # Parameter 3 is extra LDFLAGS
71 # Parameter 4 is extra LDFLAGS_SUFFIX_posix
72 # Parameter 5 is extra LDFLAGS_SUFFIX_windows
73 # Parameter 6 is optional Windows JLI library (full path)
74 # Parameter 7 is optional Windows resource (RC) flags
75 # Parameter 8 is optional Windows version resource file (.rc)
76 # Parameter 9 is different output dir
77 # Parameter 10 if set, link statically with c runtime on windows.
78 # Parameter 11 if set, override plist file on macosx.
79
80 $1_WINDOWS_JLI_LIB:=$(JDK_OUTPUTDIR)/objs/libjli/jli.lib
81 ifneq ($6,)
82 $1_WINDOWS_JLI_LIB:=$6
83 endif
84 $1_VERSION_INFO_RESOURCE:=$(JDK_TOPDIR)/src/windows/resource/version.rc
85 ifneq ($8,)
86 $1_VERSION_INFO_RESOURCE:=$8
87 endif
88
89 $1_LDFLAGS := $3
90 $1_LDFLAGS_SUFFIX :=
91 ifeq ($(OPENJDK_TARGET_OS), macosx)
92 $1_PLIST_FILE:=Info-cmdline.plist
93 ifneq ($(11),)
94 $1_PLIST_FILE:=$(11)
95 endif
96
97 $1_LDFLAGS += -Wl,-all_load $(JDK_OUTPUTDIR)/objs/libjli_static.a \
98 -framework Cocoa -framework Security -framework ApplicationServices \
99 -sectcreate __TEXT __info_plist $(JDK_TOPDIR)/src/macosx/lib/$$($1_PLIST_FILE)
100 $1_LDFLAGS_SUFFIX += -pthread
101 endif
102
103 ifeq ($(USE_EXTERNAL_LIBZ), true)
104 $1_LDFLAGS_SUFFIX += -lz
105 endif
106
107 $1_OUTPUT_DIR_ARG:=$9
108 ifeq (,$$($1_OUTPUT_DIR_ARG))
109 $1_OUTPUT_DIR_ARG:=$(JDK_OUTPUTDIR)/bin
110 endif
111
112 # TODO: maybe it's better to move this if-statement out of this function
113 ifeq ($1,java)
114 $1_OPTIMIZATION_ARG:=HIGH
115 $1_LDFLAGS_solaris:=-R$(OPENWIN_HOME)/lib$(OPENJDK_TARGET_CPU_ISADIR)
116 else
117 $1_OPTIMIZATION_ARG:=LOW
118 endif
119
120 $1_CFLAGS:=$(CFLAGS_JDKEXE)
121 ifeq ($(10),true)
122 $1_CFLAGS:=$(filter-out -MD,$(CFLAGS_JDKEXE))
123 endif
124
125 ifneq ($(wildcard $(JDK_TOPDIR)/makefiles/mapfiles/launchers/mapfile-$(OPENJDK_TARGET_CPU)),)
126 $1_MAPFILE:=$(JDK_TOPDIR)/makefiles/mapfiles/launchers/mapfile-$(OPENJDK_TARGET_CPU)
127 else
128 $1_MAPFILE:=
129 endif
130
131 $(call SetupNativeCompilation,BUILD_LAUNCHER_$1,\
132 SRC:=$(JDK_TOPDIR)/src/share/bin,\
133 INCLUDE_FILES:=main.c,\
134 LANG:=C,\
135 OPTIMIZATION:=$$($1_OPTIMIZATION_ARG), \
136 CFLAGS:=$$($1_CFLAGS) \
137 -I$(JDK_TOPDIR)/src/share/bin \
138 -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/bin \
139 -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS)/bin \
140 -DFULL_VERSION='"$(FULL_VERSION)"' \
141 -DJDK_MAJOR_VERSION='"$(JDK_MAJOR_VERSION)"' \
142 -DJDK_MINOR_VERSION='"$(JDK_MINOR_VERSION)"' \
143 -DLIBARCHNAME='"$(OPENJDK_TARGET_CPU_LEGACY)"' \
144 -DLAUNCHER_NAME='"$(LAUNCHER_NAME)"' \
145 -DPROGNAME='"$1"' $(DPACKAGEPATH) \
146 $2,\
147 CFLAGS_linux:=-fPIC,\
148 CFLAGS_solaris:=-KPIC -DHAVE_GETHRTIME,\
149 LDFLAGS:=$(LDFLAGS_JDKEXE) \
150 $(ORIGIN_ARG) \
151 $$($1_LDFLAGS),\
152 LDFLAGS_macosx:=$(call SET_SHARED_LIBRARY_NAME,$1),\
153 LDFLAGS_linux:=-lpthread \
154 $(call SET_SHARED_LIBRARY_NAME,$(LIBRARY_PREFIX)$(SHARED_LIBRARY_SUFFIX)),\
155 LDFLAGS_solaris:=$$($1_LDFLAGS_solaris) \
156 $(call SET_SHARED_LIBRARY_NAME,$(LIBRARY_PREFIX)$(SHARED_LIBRARY_SUFFIX)),\
157 MAPFILE := $$($1_MAPFILE), \
158 LDFLAGS_SUFFIX:=$(LDFLAGS_JDKEXE_SUFFIX) $$($1_LDFLAGS_SUFFIX),\
159 LDFLAGS_SUFFIX_posix:=$4,\
160 LDFLAGS_SUFFIX_windows:=$$($1_WINDOWS_JLI_LIB) \
161 $(JDK_OUTPUTDIR)/objs/libjava/java.lib advapi32.lib $5,\
162 LDFLAGS_SUFFIX_linux:=-L$(JDK_OUTPUTDIR)/lib$(OPENJDK_TARGET_CPU_LIBDIR)/jli -ljli $(LIBDL) -lc, \
163 LDFLAGS_SUFFIX_solaris:=-L$(JDK_OUTPUTDIR)/lib$(OPENJDK_TARGET_CPU_LIBDIR)/jli -ljli -lthread $(LIBDL) -lc, \
164 OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/$1_objs$(OUTPUT_SUBDIR),\
165 OUTPUT_DIR:=$$($1_OUTPUT_DIR_ARG)$(OUTPUT_SUBDIR),\
166 PROGRAM:=$1,\
167 DEBUG_SYMBOLS:=true,\
168 VERSIONINFO_RESOURCE:=$$($1_VERSION_INFO_RESOURCE),\
169 RC_FLAGS:=$(RC_FLAGS)\
170 -D "JDK_FNAME=$1$(EXE_SUFFIX)" \
171 -D "JDK_INTERNAL_NAME=$1" \
172 -D "JDK_FTYPE=0x1L" \
173 $7,\
174 MANIFEST:=$(JDK_TOPDIR)/src/windows/resource/java.manifest)
175
176 BUILD_LAUNCHERS += $$(BUILD_LAUNCHER_$1)
177
178 ifeq ($(OPENJDK_TARGET_OS),macosx)
179 $$(BUILD_LAUNCHER_$1) : $(JDK_OUTPUTDIR)/objs/libjli_static.a
180 endif
181
182 ifeq ($(OPENJDK_TARGET_OS),windows)
183 $$(BUILD_LAUNCHER_$1) : $(JDK_OUTPUTDIR)/objs/libjava/java.lib \
184 $$($1_WINDOWS_JLI_LIB)
185 endif
186endef
187
188##########################################################################################
189
190XLIBS:=$(X_LIBS) -lX11
191ifeq ($(OPENJDK_TARGET_OS),macosx)
192 DPACKAGEPATH:=-DPACKAGE_PATH='"$(PACKAGE_PATH)"'
193 XLIBS:=
194endif
195
196ifdef OPENJDK
197 JAVA_RC_FLAGS += -i "$(JDK_TOPDIR)/src/windows/resource/icons"
198else
199 JAVA_RC_FLAGS += -i "$(JDK_TOPDIR)/src/closed/windows/native/sun/windows"
200endif
201
202# On windows, the debuginfo files get the same name as for java.dll. Build
203# into another dir and copy selectively so debuginfo for java.dll isn't
204# overwritten.
205$(eval $(call SetupLauncher,java,\
206 -DEXPAND_CLASSPATH_WILDCARDS,,,user32.lib comctl32.lib,\
207 $(JDK_OUTPUTDIR)/objs/jli_static.lib,$(JAVA_RC_FLAGS),\
208 $(JDK_TOPDIR)/src/windows/resource/java.rc,$(JDK_OUTPUTDIR)/objs/java_objs,true))
209
210$(JDK_OUTPUTDIR)/bin$(OUTPUT_SUBDIR)/java$(EXE_SUFFIX): $(BUILD_LAUNCHER_java)
211 $(MKDIR) -p $(@D)
212 $(RM) $@
213 $(CP) $(JDK_OUTPUTDIR)/objs/java_objs$(OUTPUT_SUBDIR)/java$(EXE_SUFFIX) $@
214
215BUILD_LAUNCHERS += $(JDK_OUTPUTDIR)/bin$(OUTPUT_SUBDIR)/java$(EXE_SUFFIX)
216
217ifeq ($(OPENJDK_TARGET_OS),windows)
218 $(eval $(call SetupLauncher,javaw,\
219 -DJAVAW -DEXPAND_CLASSPATH_WILDCARDS,,,user32.lib comctl32.lib,\
220 $(JDK_OUTPUTDIR)/objs/jli_static.lib,$(JAVA_RC_FLAGS),\
221 $(JDK_TOPDIR)/src/windows/resource/java.rc,,true))
222endif
223
224
225ifndef BUILD_HEADLESS_ONLY
226$(eval $(call SetupLauncher,appletviewer,\
227 -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "sun.applet.Main"$(COMMA) }',,\
228 $(XLIBS)))
229endif
230
231$(eval $(call SetupLauncher,extcheck,\
232 -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "com.sun.tools.extcheck.Main"$(COMMA) }'))
233
234$(eval $(call SetupLauncher,idlj,\
235 -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "com.sun.tools.corba.se.idl.toJavaPortable.Compile"$(COMMA) }'))
236
237$(eval $(call SetupLauncher,jar,\
238 -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "sun.tools.jar.Main"$(COMMA) }'))
239
240$(eval $(call SetupLauncher,jarsigner,\
Erik Joelssonb197a6c2012-11-28 09:47:25 +0100241 -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "sun.security.tools.jarsigner.Main"$(COMMA) }'))
Kelly O'Hair38c629a2012-10-26 14:23:29 -0700242
243$(eval $(call SetupLauncher,javac,\
244 -DEXPAND_CLASSPATH_WILDCARDS \
245 -DNEVER_ACT_AS_SERVER_CLASS_MACHINE \
246 -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "com.sun.tools.javac.Main"$(COMMA) }'))
247
248ifeq ($(ENABLE_SJAVAC),yes)
249$(eval $(call SetupLauncher,sjavac,\
250 -DEXPAND_CLASSPATH_WILDCARDS \
251 -DNEVER_ACT_AS_SERVER_CLASS_MACHINE \
252 -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "com.sun.tools.sjavac.Main"$(COMMA) }'))
253endif
254
255$(eval $(call SetupLauncher,javadoc,\
256 -DEXPAND_CLASSPATH_WILDCARDS \
257 -DNEVER_ACT_AS_SERVER_CLASS_MACHINE \
258 -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "com.sun.tools.javadoc.Main"$(COMMA) }'))
259
260$(eval $(call SetupLauncher,javah,\
261 -DEXPAND_CLASSPATH_WILDCARDS \
262 -DNEVER_ACT_AS_SERVER_CLASS_MACHINE \
263 -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "com.sun.tools.javah.Main"$(COMMA) }'))
264
265$(eval $(call SetupLauncher,javap,\
266 -DEXPAND_CLASSPATH_WILDCARDS \
267 -DNEVER_ACT_AS_SERVER_CLASS_MACHINE \
268 -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "com.sun.tools.javap.Main"$(COMMA) }'))
269
Mandy Chungf8570502012-12-28 22:21:40 -0800270$(eval $(call SetupLauncher,jdeps,\
271 -DEXPAND_CLASSPATH_WILDCARDS \
272 -DNEVER_ACT_AS_SERVER_CLASS_MACHINE \
273 -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "com.sun.tools.jdeps.Main"$(COMMA) }'))
274
Kelly O'Hair38c629a2012-10-26 14:23:29 -0700275BUILD_LAUNCHER_jconsole_CFLAGS_windows:=-DJAVAW
276BUILD_LAUNCHER_jconsole_LDFLAGS_windows:=user32.lib
277
278$(eval $(call SetupLauncher,jconsole,\
279 -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "-J-Djconsole.showOutputViewer"$(COMMA) "sun.tools.jconsole.JConsole"$(COMMA) }' \
280 -DAPP_CLASSPATH='{ "/lib/jconsole.jar"$(COMMA) "/lib/tools.jar"$(COMMA) "/classes" }'))
281
282$(eval $(call SetupLauncher,jdb,\
283 -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "com.sun.tools.example.debug.tty.TTY"$(COMMA) }' \
284 -DAPP_CLASSPATH='{ "/lib/tools.jar"$(COMMA) "/lib/sa-jdi.jar"$(COMMA) "/classes" }'))
285
286$(eval $(call SetupLauncher,jhat,\
287 -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "com.sun.tools.hat.Main"$(COMMA) }'))
288
289$(eval $(call SetupLauncher,jinfo,\
290 -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) \
291 "-J-Dsun.jvm.hotspot.debugger.useProcDebugger"$(COMMA) \
292 "-J-Dsun.jvm.hotspot.debugger.useWindbgDebugger"$(COMMA) \
293 "sun.tools.jinfo.JInfo"$(COMMA) }' \
294 -DAPP_CLASSPATH='{ "/lib/tools.jar"$(COMMA) "/lib/sa-jdi.jar"$(COMMA) "/classes" }' \
295 ,,,,,,,,,Info-privileged.plist))
296
297$(eval $(call SetupLauncher,jmap,\
298 -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) \
299 "-J-Dsun.jvm.hotspot.debugger.useProcDebugger"$(COMMA) \
300 "-J-Dsun.jvm.hotspot.debugger.useWindbgDebugger"$(COMMA) \
301 "sun.tools.jmap.JMap"$(COMMA) }' \
302 -DAPP_CLASSPATH='{ "/lib/tools.jar"$(COMMA) "/lib/sa-jdi.jar"$(COMMA) "/classes" }' \
303 ,,,,,,,,,Info-privileged.plist))
304
305$(eval $(call SetupLauncher,jps,\
306 -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "sun.tools.jps.Jps"$(COMMA) }'))
307
308$(eval $(call SetupLauncher,jrunscript,\
309 -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "com.sun.tools.script.shell.Main"$(COMMA) }'))
310
311$(eval $(call SetupLauncher,jsadebugd,\
312 -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "sun.jvm.hotspot.jdi.SADebugServer"$(COMMA) }' \
313 -DAPP_CLASSPATH='{ "/lib/tools.jar"$(COMMA) "/lib/sa-jdi.jar"$(COMMA) "/classes" }' \
314 ,,,,,,,,,Info-privileged.plist))
315
316$(eval $(call SetupLauncher,jstack,\
317 -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) \
318 "-J-Dsun.jvm.hotspot.debugger.useProcDebugger"$(COMMA) \
319 "-J-Dsun.jvm.hotspot.debugger.useWindbgDebugger"$(COMMA) \
320 "sun.tools.jstack.JStack"$(COMMA) }' \
321 -DAPP_CLASSPATH='{ "/lib/tools.jar"$(COMMA) "/lib/sa-jdi.jar"$(COMMA) "/classes" }' \
322 ,,,,,,,,,Info-privileged.plist))
323
324$(eval $(call SetupLauncher,jstat,\
325 -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "sun.tools.jstat.Jstat"$(COMMA) }'))
326
327$(eval $(call SetupLauncher,jstatd,\
328 -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "sun.tools.jstatd.Jstatd"$(COMMA) }'))
329
330$(eval $(call SetupLauncher,keytool,\
David Katleman2e315732012-10-31 18:35:56 -0700331 -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "sun.security.tools.keytool.Main"$(COMMA) }'))
Kelly O'Hair38c629a2012-10-26 14:23:29 -0700332
333$(eval $(call SetupLauncher,native2ascii,\
334 -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "sun.tools.native2ascii.Main"$(COMMA) }'))
335
336ifndef BUILD_HEADLESS_ONLY
337$(eval $(call SetupLauncher,policytool,\
338 -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "sun.security.tools.policytool.PolicyTool"$(COMMA) }',,\
339 $(XLIBS)))
340endif
341
342$(eval $(call SetupLauncher,rmic,\
343 -DEXPAND_CLASSPATH_WILDCARDS \
344 -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "sun.rmi.rmic.Main"$(COMMA) }'))
345
346$(eval $(call SetupLauncher,schemagen,\
347 -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "com.sun.tools.internal.jxc.SchemaGenerator"$(COMMA) }'))
348
349$(eval $(call SetupLauncher,serialver,\
350 -DEXPAND_CLASSPATH_WILDCARDS \
351 -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "sun.tools.serialver.SerialVer"$(COMMA) }'))
352
353$(eval $(call SetupLauncher,xjc,\
354 -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "com.sun.tools.internal.xjc.Driver"$(COMMA) }'))
355
356$(eval $(call SetupLauncher,wsgen,\
357 -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "com.sun.tools.internal.ws.WsGen"$(COMMA) }'))
358
359$(eval $(call SetupLauncher,wsimport,\
360 -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "com.sun.tools.internal.ws.WsImport"$(COMMA) }'))
361
362$(eval $(call SetupLauncher,orbd,\
363 -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) \
364 "-J-Dcom.sun.CORBA.activation.DbDir=./orb.db"$(COMMA) \
365 "-J-Dcom.sun.CORBA.activation.Port=1049"$(COMMA) \
366 "-J-Dcom.sun.CORBA.POA.ORBServerId=1"$(COMMA) \
367 "com.sun.corba.se.impl.activation.ORBD"$(COMMA) }'))
368
369$(eval $(call SetupLauncher,servertool,\
370 -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "com.sun.corba.se.impl.activation.ServerTool"$(COMMA) }'))
371
372$(eval $(call SetupLauncher,tnameserv,\
373 -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) \
374 "-J-Dcom.sun.CORBA.activation.DbDir=./orb.db"$(COMMA) \
375 "-J-Djava.util.logging.LoggingPermission=contol"$(COMMA) \
376 "-J-Dcom.sun.CORBA.POA.ORBServerId=1"$(COMMA) \
377 "com.sun.corba.se.impl.naming.cosnaming.TransientNameServer"$(COMMA) }'))
378
379$(eval $(call SetupLauncher,pack200,\
380 -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "com.sun.java.util.jar.pack.Driver"$(COMMA) "--pack" }'))
381
382$(eval $(call SetupLauncher,rmid,\
383 -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "sun.rmi.server.Activation"$(COMMA) }'))
384
385$(eval $(call SetupLauncher,rmiregistry,\
386 -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "sun.rmi.registry.RegistryImpl"$(COMMA) }'))
387
388$(eval $(call SetupLauncher,jcmd,\
389 -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "sun.tools.jcmd.JCmd"$(COMMA) }'))
390
391ifeq ($(OPENJDK_TARGET_OS),windows)
392 $(eval $(call SetupLauncher,kinit,\
393 -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "sun.security.krb5.internal.tools.Kinit"$(COMMA) }'))
394
395 $(eval $(call SetupLauncher,klist,\
396 -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "sun.security.krb5.internal.tools.Klist"$(COMMA) }'))
397
398 $(eval $(call SetupLauncher,ktab,\
399 -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "sun.security.krb5.internal.tools.Ktab"$(COMMA) }'))
400endif
401
402##########################################################################################
403# The order of the object files on the link command line affects the size of the resulting
404# binary (at least on linux) which causes the size to differ between old and new build.
405ifeq ($(USE_EXTERNAL_LIBZ), true)
406UNPACKEXE_CFLAGS := -DSYSTEM_ZLIB
407UNPACKEXE_ZIPOBJS := -lz
408else
409UNPACKEXE_CFLAGS := -I$(JDK_TOPDIR)/src/share/native/java/util/zip/zlib-1.2.5
410UNPACKEXE_ZIPOBJS := $(JDK_OUTPUTDIR)/objs/libzip/zcrc32$(OBJ_SUFFIX) \
411 $(JDK_OUTPUTDIR)/objs/libzip/deflate$(OBJ_SUFFIX) \
412 $(JDK_OUTPUTDIR)/objs/libzip/trees$(OBJ_SUFFIX) \
413 $(JDK_OUTPUTDIR)/objs/libzip/zadler32$(OBJ_SUFFIX) \
414 $(JDK_OUTPUTDIR)/objs/libzip/compress$(OBJ_SUFFIX) \
415 $(JDK_OUTPUTDIR)/objs/libzip/zutil$(OBJ_SUFFIX) \
416 $(JDK_OUTPUTDIR)/objs/libzip/inflate$(OBJ_SUFFIX) \
417 $(JDK_OUTPUTDIR)/objs/libzip/infback$(OBJ_SUFFIX) \
418 $(JDK_OUTPUTDIR)/objs/libzip/inftrees$(OBJ_SUFFIX) \
419 $(JDK_OUTPUTDIR)/objs/libzip/inffast$(OBJ_SUFFIX)
420
421endif
422
423ifeq ($(OPENJDK_TARGET_CPU_ARCH), sparc)
424 UNPACKEXE_CFLAGS += -xregs=no%appl
425 UNPACKEXE_LDFLAGS_solaris += -xmemalign=4s
426endif
427
428UNPACKEXE_LANG:=C
429ifeq ($(OPENJDK_TARGET_OS),solaris)
430 UNPACKEXE_LANG:=C++
431endif
432# On windows, unpack200 is linked completely differently to all other
433# executables, using the compiler with the compiler arguments.
434# It's also linked incrementally, producing a .ilk file that needs to
435# be kept away.
436ifeq ($(OPENJDK_TARGET_OS),windows)
437 BUILD_UNPACKEXE_LDEXE:=$(CC)
438 EXE_OUT_OPTION_save:=$(EXE_OUT_OPTION)
439 EXE_OUT_OPTION:=-Fe
440endif
441$(eval $(call SetupNativeCompilation,BUILD_UNPACKEXE,\
442 SRC:=$(JDK_TOPDIR)/src/share/native/com/sun/java/util/jar/pack,\
443 EXCLUDE_FILES:=jni.cpp,\
444 LANG:=$(UNPACKEXE_LANG),\
445 OPTIMIZATION:=LOW, \
446 CFLAGS:=$(UNPACKEXE_CFLAGS) $(CXXFLAGS_JDKEXE)\
447 -DFULL, \
448 CFLAGS_release:=-DPRODUCT,\
449 CFLAGS_linux:=-fPIC,\
450 CFLAGS_solaris:=-KPIC, \
451 CFLAGS_macosx:=-fPIC, \
452 MAPFILE:=$(JDK_TOPDIR)/makefiles/mapfiles/libunpack/mapfile-vers-unpack200,\
453 LDFLAGS:=$(UNPACKEXE_ZIPOBJS),\
454 LDFLAGS_windows:=$(CXXFLAGS_JDKEXE),\
455 LDFLAGS_posix:=$(LDFLAGS_JDKEXE) $(LDFLAGS_CXX_JDK) \
456 $(call SET_SHARED_LIBRARY_NAME,$(LIBRARY_PREFIX)unpack$(SHARED_LIBRARY_SUFFIX)) \
457 $(call SET_SHARED_LIBRARY_ORIGIN),\
458 LDFLAGS_linux:=-lc,\
459 LDFLAGS_solaris:=$(UNPACKEXE_LDFLAGS_solaris) -lc,\
460 LDFLAGS_SUFFIX:=$(LIBCXX),\
461 OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/unpackexe$(OUTPUT_SUBDIR),\
462 OUTPUT_DIR:=$(JDK_OUTPUTDIR)/objs/unpackexe$(OUTPUT_SUBDIR),\
463 PROGRAM:=unpack200,\
464 VERSIONINFO_RESOURCE:=$(JDK_TOPDIR)/src/windows/resource/version.rc,\
465 RC_FLAGS:=$(RC_FLAGS)\
466 -D "JDK_FNAME=unpack200.exe" \
467 -D "JDK_INTERNAL_NAME=unpack200" \
468 -D "JDK_FTYPE=0x1L",\
469 MANIFEST:=$(JDK_TOPDIR)/src/windows/resource/unpack200_proto.exe.manifest))
470
471ifeq ($(OPENJDK_TARGET_OS),windows)
472 EXE_OUT_OPTION:=$(EXE_OUT_OPTION_save)
473endif
474
475ifneq ($(USE_EXTERNAL_LIBZ), true)
476
477$(BUILD_UNPACKEXE) : $(UNPACKEXE_ZIPOBJS)
478
479endif
480
481# Build into object dir and copy executable afterwards to avoid .ilk file in
482# image. The real fix would be clean up linking of unpack200 using
483# -link -incremental:no
484# like all other launchers.
485$(JDK_OUTPUTDIR)/bin$(OUTPUT_SUBDIR)/unpack200$(EXE_SUFFIX): $(BUILD_UNPACKEXE)
486 $(MKDIR) -p $(@D)
487 $(CP) '$<' '$@'
488
489BUILD_LAUNCHERS += $(JDK_OUTPUTDIR)/bin$(OUTPUT_SUBDIR)/unpack200$(EXE_SUFFIX)
490
491##########################################################################################
492
493
494BUILD_JEXEC :=
495BUILD_JEXEC_SRC :=
496BUILD_JEXEC_INC :=
497BUILD_JEXEC_DST_DIR := $(JDK_OUTPUTDIR)/lib$(OPENJDK_TARGET_CPU_LIBDIR)
498
499#
500# UNHANDLED:
501# - COMPILE_APPROACH = normal
502#
503
504#
505# jdk/make/java/Makefile
506#
507ifeq ($(OPENJDK_TARGET_OS), solaris)
508 ifeq ($(OPENJDK_TARGET_CPU_BITS), 32)
509 BUILD_JEXEC := 1
510 endif
511endif
512
513ifeq ($(OPENJDK_TARGET_OS), linux)
514 BUILD_JEXEC := 1
515endif # OPENJDK_TARGET_OS
516
517#
518# jdk/make/java/jexec/Makefile
519#
520ifeq ($(BUILD_JEXEC), 1)
521
522 ifeq ($(OPENJDK_TARGET_OS),windows)
523 else ifeq ($(OPENJDK_TARGET_OS),macosx)
524 BUILD_JEXEC_SRC := $(JDK_TOPDIR)/src/macosx/bin
525 else
526 BUILD_JEXEC_SRC := $(JDK_TOPDIR)/src/solaris/bin
527 endif
528
529 ifeq ($(OPENJDK_TARGET_OS), linux)
530 BUILD_JEXEC_DST_DIR := $(JDK_OUTPUTDIR)/lib
531 BUILD_JEXEC_INC += -I$(JDK_TOPDIR)/src/share/bin
532 endif
533endif
534
535#
536# Note that the two Makefile's seems to contradict each other,
537# and that src/macosx/bin/jexec.c seems unused
538#
539ifneq ($(BUILD_JEXEC_SRC),)
540 $(eval $(call SetupNativeCompilation,BUILD_JEXEC,\
541 SRC:=$(BUILD_JEXEC_SRC),\
542 INCLUDE_FILES:=jexec.c,\
543 LANG:=C,\
544 OPTIMIZATION := LOW, \
545 CFLAGS:=$(CFLAGS_JDKEXE)\
546 $(BUILD_JEXEC_INC), \
547 CFLAGS_linux:=-fPIC,\
548 CFLAGS_solaris:=-KPIC,\
549 LDFLAGS:=$(LDFLAGS_JDKEXE) \
550 $(call SET_SHARED_LIBRARY_NAME,$(LIBRARY_PREFIX)$(SHARED_LIBRARY_SUFFIX)), \
551 OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/jexec_obj,\
552 OUTPUT_DIR:=$(BUILD_JEXEC_DST_DIR),\
553 PROGRAM:=jexec))
554
555 BUILD_LAUNCHERS += $(BUILD_JEXEC)
556endif
557
558##########################################################################################
559
560#
561# The java-rmi.cgi script in bin/ only gets delivered in certain situations
562#
563JAVA_RMI_CGI:=$(JDK_OUTPUTDIR)/bin$(OUTPUT_SUBDIR)/java-rmi.cgi
564ifeq ($(OPENJDK_TARGET_OS), linux)
565 BUILD_LAUNCHERS += $(JAVA_RMI_CGI)
566endif
567ifeq ($(OPENJDK_TARGET_OS), solaris)
568 ifeq ($(OPENJDK_TARGET_CPU_BITS), 32)
569 BUILD_LAUNCHERS += $(JAVA_RMI_CGI)
570 endif
571endif
572
573# TODO:
574# On windows java-rmi.cgi shouldn't be bundled since Java 1.2, but has been built all
575# this time anyway. Since jdk6, it has been built from the wrong source and resulted
576# in a (almost) copy of the standard java launcher named "java-rmi.exe" ending up in
577# the final images bin dir. This weird behavior is mimicked here in the converted
578# makefiles for now. Should probably just be deleted.
579# http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6512052
580ifeq ($(OPENJDK_TARGET_OS),windows)
581 $(eval $(call SetupLauncher,java-rmi,,\
582 $(call SET_SHARED_LIBRARY_MAPFILE,$(JDK_TOPDIR)/makefiles/java/main/java/mapfile-$(OPENJDK_TARGET_CPU))))
583else
584 $(JAVA_RMI_CGI): $(JDK_TOPDIR)/src/solaris/bin/java-rmi.cgi.sh
585 $(MKDIR) -p $(@D)
586 $(CP) $< $@
587 $(CHMOD) a+x $@
588endif
589
590##########################################################################################
Ragini Prasad435bcab2013-01-18 11:33:31 -0800591# jabswitch
592
593ifndef OPENJDK
594ifeq ($(OPENJDK_TARGET_OS),windows)
595
596 $(eval $(call SetupNativeCompilation,BUILD_JABSWITCH,\
597 SRC:=$(JDK_TOPDIR)/src/closed/windows/native/sun/bridge,\
598 INCLUDE_FILES:=jabswitch.cpp,\
599 LANG:=C++,\
600 CFLAGS:=$(filter-out -Zc:wchar_t-,$(CFLAGS_JDKEXE)) -Zc:wchar_t \
601 -analyze- -Od -Gd -D_WINDOWS \
602 -D_UNICODE -DUNICODE -RTC1 -EHsc,\
603 LDFLAGS:=$(LDFLAGS_JDKEXE) \
604 Advapi32.lib Version.lib User32.lib,\
605 OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/jabswitch,\
606 OUTPUT_DIR:=$(JDK_OUTPUTDIR)/bin,\
607 PROGRAM:=jabswitch,\
608 DEBUG_SYMBOLS:=true,\
609 VERSIONINFO_RESOURCE:=$(JDK_TOPDIR)/src/closed/windows/native/sun/bridge/AccessBridgeStatusWindow.rc,\
610 RC_FLAGS:=$(RC_FLAGS),\
611 MANIFEST:=$(JDK_TOPDIR)/src/closed/windows/native/sun/bridge/jabswitch.manifest))
612
613 BUILD_LAUNCHERS += $(BUILD_JABSWITCH)
614
615endif
616endif
617
618##########################################################################################
Kelly O'Hair38c629a2012-10-26 14:23:29 -0700619
620$(BUILD_LAUNCHERS) : $(JDK_TOPDIR)/makefiles/CompileLaunchers.gmk
621
622all: $(BUILD_LAUNCHERS)
623
624.PHONY: all