25859
|
1 |
#
|
|
2 |
# Copyright (c) 2011, 2014, 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 |
|
|
26 |
include LauncherCommon.gmk
|
|
27 |
|
|
28 |
ifndef BUILD_HEADLESS_ONLY
|
|
29 |
$(eval $(call SetupLauncher,policytool, \
|
|
30 |
-DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "sun.security.tools.policytool.PolicyTool"$(COMMA) }',, \
|
|
31 |
$(XLIBS)))
|
|
32 |
endif
|
|
33 |
|
|
34 |
$(eval $(call SetupLauncher,pack200, \
|
|
35 |
-DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "com.sun.java.util.jar.pack.Driver"$(COMMA) }'))
|
|
36 |
|
|
37 |
################################################################################
|
|
38 |
# The order of the object files on the link command line affects the size of the resulting
|
|
39 |
# binary (at least on linux) which causes the size to differ between old and new build.
|
|
40 |
|
|
41 |
UNPACKEXE_SRC := $(JDK_TOPDIR)/src/jdk.runtime/share/native/common-unpack \
|
|
42 |
$(JDK_TOPDIR)/src/jdk.runtime/share/native/unpack200
|
|
43 |
UNPACKEXE_CFLAGS := -I$(JDK_TOPDIR)/src/jdk.runtime/share/native/common-unpack \
|
|
44 |
-I$(JDK_TOPDIR)/src/java.base/share/native/libjava \
|
|
45 |
-I$(JDK_TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_API_DIR)/native/libjava
|
|
46 |
|
|
47 |
ifeq ($(USE_EXTERNAL_LIBZ), true)
|
|
48 |
UNPACKEXE_CFLAGS += -DSYSTEM_ZLIB
|
|
49 |
UNPACKEXE_ZIPOBJS := -lz
|
|
50 |
else
|
|
51 |
UNPACKEXE_CFLAGS += -I$(JDK_TOPDIR)/src/java.base/share/native/libzip/zlib-1.2.8
|
|
52 |
UNPACKEXE_ZIPOBJS := $(JDK_OUTPUTDIR)/objs/libzip/zcrc32$(OBJ_SUFFIX) \
|
|
53 |
$(JDK_OUTPUTDIR)/objs/libzip/deflate$(OBJ_SUFFIX) \
|
|
54 |
$(JDK_OUTPUTDIR)/objs/libzip/trees$(OBJ_SUFFIX) \
|
|
55 |
$(JDK_OUTPUTDIR)/objs/libzip/zadler32$(OBJ_SUFFIX) \
|
|
56 |
$(JDK_OUTPUTDIR)/objs/libzip/compress$(OBJ_SUFFIX) \
|
|
57 |
$(JDK_OUTPUTDIR)/objs/libzip/zutil$(OBJ_SUFFIX) \
|
|
58 |
$(JDK_OUTPUTDIR)/objs/libzip/inflate$(OBJ_SUFFIX) \
|
|
59 |
$(JDK_OUTPUTDIR)/objs/libzip/infback$(OBJ_SUFFIX) \
|
|
60 |
$(JDK_OUTPUTDIR)/objs/libzip/inftrees$(OBJ_SUFFIX) \
|
|
61 |
$(JDK_OUTPUTDIR)/objs/libzip/inffast$(OBJ_SUFFIX)
|
|
62 |
|
|
63 |
endif
|
|
64 |
|
|
65 |
UNPACKEXE_LANG := C
|
|
66 |
ifeq ($(OPENJDK_TARGET_OS), solaris)
|
|
67 |
UNPACKEXE_LANG := C++
|
|
68 |
endif
|
|
69 |
UNPACKEXE_DEBUG_SYMBOLS := true
|
|
70 |
# On windows, unpack200 is linked completely differently to all other
|
|
71 |
# executables, using the compiler with the compiler arguments.
|
|
72 |
# It's also linked incrementally, producing a .ilk file that needs to
|
|
73 |
# be kept away.
|
|
74 |
ifeq ($(OPENJDK_TARGET_OS), windows)
|
|
75 |
BUILD_UNPACKEXE_LDEXE := $(CC)
|
|
76 |
EXE_OUT_OPTION_save := $(EXE_OUT_OPTION)
|
|
77 |
EXE_OUT_OPTION := -Fe
|
|
78 |
# With the current way unpack200 is built, debug symbols aren't supported
|
|
79 |
# anyway.
|
|
80 |
UNPACKEXE_DEBUG_SYMBOLS :=
|
|
81 |
endif
|
|
82 |
|
|
83 |
# The linker on older SuSE distros (e.g. on SLES 10) complains with:
|
|
84 |
# "Invalid version tag `SUNWprivate_1.1'. Only anonymous version tag is allowed in executable."
|
|
85 |
# if feeded with a version script which contains named tags.
|
|
86 |
ifeq ($(USING_BROKEN_SUSE_LD), yes)
|
|
87 |
UNPACK_MAPFILE = $(JDK_TOPDIR)/make/mapfiles/libunpack/mapfile-vers-unpack200.anonymous
|
|
88 |
else
|
|
89 |
UNPACK_MAPFILE = $(JDK_TOPDIR)/make/mapfiles/libunpack/mapfile-vers-unpack200
|
|
90 |
endif
|
|
91 |
|
|
92 |
$(eval $(call SetupNativeCompilation,BUILD_UNPACKEXE, \
|
|
93 |
SRC := $(UNPACKEXE_SRC), \
|
|
94 |
LANG := $(UNPACKEXE_LANG), \
|
|
95 |
OPTIMIZATION := LOW, \
|
|
96 |
CFLAGS := $(UNPACKEXE_CFLAGS) $(CXXFLAGS_JDKEXE) \
|
|
97 |
-DFULL, \
|
|
98 |
CFLAGS_release := -DPRODUCT, \
|
|
99 |
CFLAGS_linux := -fPIC, \
|
|
100 |
CFLAGS_solaris := -KPIC, \
|
|
101 |
CFLAGS_macosx := -fPIC, \
|
|
102 |
MAPFILE := $(UNPACK_MAPFILE),\
|
|
103 |
LDFLAGS := $(UNPACKEXE_ZIPOBJS), \
|
|
104 |
LDFLAGS_windows := $(CXXFLAGS_JDKEXE), \
|
|
105 |
LDFLAGS_posix := $(LDFLAGS_JDKEXE) $(LDFLAGS_CXX_JDK) \
|
|
106 |
$(call SET_SHARED_LIBRARY_NAME,$(LIBRARY_PREFIX)unpack$(SHARED_LIBRARY_SUFFIX)) \
|
|
107 |
$(call SET_SHARED_LIBRARY_ORIGIN), \
|
|
108 |
LDFLAGS_linux := -lc, \
|
|
109 |
LDFLAGS_solaris := $(UNPACKEXE_LDFLAGS_solaris) -lc, \
|
|
110 |
LDFLAGS_SUFFIX := $(LIBCXX), \
|
|
111 |
OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/unpackexe$(OUTPUT_SUBDIR), \
|
|
112 |
OUTPUT_DIR := $(JDK_OUTPUTDIR)/objs/unpackexe$(OUTPUT_SUBDIR), \
|
|
113 |
PROGRAM := unpack200, \
|
|
114 |
VERSIONINFO_RESOURCE := $(GLOBAL_VERSION_INFO_RESOURCE), \
|
|
115 |
RC_FLAGS := $(RC_FLAGS) \
|
|
116 |
-D "JDK_FNAME=unpack200.exe" \
|
|
117 |
-D "JDK_INTERNAL_NAME=unpack200" \
|
|
118 |
-D "JDK_FTYPE=0x1L", \
|
|
119 |
DEBUG_SYMBOLS := $(UNPACKEXE_DEBUG_SYMBOLS), \
|
|
120 |
MANIFEST := $(JDK_TOPDIR)/src/jdk.runtime/windows/native/unpack200/unpack200_proto.exe.manifest))
|
|
121 |
|
|
122 |
ifeq ($(OPENJDK_TARGET_OS), windows)
|
|
123 |
EXE_OUT_OPTION := $(EXE_OUT_OPTION_save)
|
|
124 |
endif
|
|
125 |
|
|
126 |
ifneq ($(USE_EXTERNAL_LIBZ), true)
|
|
127 |
|
|
128 |
$(BUILD_UNPACKEXE): $(UNPACKEXE_ZIPOBJS)
|
|
129 |
|
|
130 |
endif
|
|
131 |
|
|
132 |
# Build into object dir and copy executable afterwards to avoid .ilk file in
|
|
133 |
# image. The real fix would be clean up linking of unpack200 using
|
|
134 |
# -link -incremental:no
|
|
135 |
# like all other launchers.
|
|
136 |
$(JDK_OUTPUTDIR)/bin$(OUTPUT_SUBDIR)/unpack200$(EXE_SUFFIX): $(BUILD_UNPACKEXE)
|
|
137 |
$(call install-file)
|
|
138 |
|
|
139 |
LAUNCHERS += $(JDK_OUTPUTDIR)/bin$(OUTPUT_SUBDIR)/unpack200$(EXE_SUFFIX)
|
|
140 |
|
|
141 |
################################################################################
|
|
142 |
|
|
143 |
jdk.runtime: $(LAUNCHERS)
|
|
144 |
|
|
145 |
all: jdk.runtime
|
|
146 |
|
|
147 |
.PHONY: all jdk.runtime
|