Chris Hegarty | 3bc69d3 | 2014-08-17 15:54:13 +0100 | [diff] [blame] | 1 | # |
Magnus Ihse Bursie | 46cb086 | 2016-10-11 09:50:04 +0200 | [diff] [blame] | 2 | # Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved. |
Chris Hegarty | 3bc69d3 | 2014-08-17 15:54:13 +0100 | [diff] [blame] | 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 | |
Magnus Ihse Bursie | 5aee130 | 2015-11-05 10:54:05 +0100 | [diff] [blame] | 28 | $(eval $(call SetupBuildLauncher, pack200, \ |
Alan Bateman | db4d383 | 2016-03-17 19:04:16 +0000 | [diff] [blame] | 29 | MAIN_MODULE := java.base, \ |
Magnus Ihse Bursie | 5aee130 | 2015-11-05 10:54:05 +0100 | [diff] [blame] | 30 | MAIN_CLASS := com.sun.java.util.jar.pack.Driver, \ |
| 31 | )) |
Chris Hegarty | 3bc69d3 | 2014-08-17 15:54:13 +0100 | [diff] [blame] | 32 | |
| 33 | ################################################################################ |
| 34 | # The order of the object files on the link command line affects the size of the resulting |
| 35 | # binary (at least on linux) which causes the size to differ between old and new build. |
| 36 | |
Erik Joelsson | 72c4ec5 | 2017-09-12 19:03:56 +0200 | [diff] [blame] | 37 | UNPACKEXE_SRC := $(TOPDIR)/src/jdk.pack/share/native/common-unpack \ |
| 38 | $(TOPDIR)/src/jdk.pack/share/native/unpack200 |
| 39 | UNPACKEXE_CFLAGS := -I$(TOPDIR)/src/jdk.pack/share/native/common-unpack \ |
| 40 | -I$(TOPDIR)/src/java.base/share/native/libjava \ |
| 41 | -I$(TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_TYPE)/native/libjava |
Chris Hegarty | 3bc69d3 | 2014-08-17 15:54:13 +0100 | [diff] [blame] | 42 | |
| 43 | ifeq ($(USE_EXTERNAL_LIBZ), true) |
| 44 | UNPACKEXE_CFLAGS += -DSYSTEM_ZLIB |
Matthias Klose | b191aa4 | 2015-10-22 12:12:32 +0200 | [diff] [blame] | 45 | UNPACKEXE_LIBS := -lz |
Chris Hegarty | 3bc69d3 | 2014-08-17 15:54:13 +0100 | [diff] [blame] | 46 | else |
Erik Joelsson | 72c4ec5 | 2017-09-12 19:03:56 +0200 | [diff] [blame] | 47 | UNPACKEXE_CFLAGS += -I$(TOPDIR)/src/java.base/share/native/libzip/zlib |
Chris Hegarty | 441905c | 2014-12-03 14:22:58 +0000 | [diff] [blame] | 48 | UNPACKEXE_ZIPOBJS := $(SUPPORT_OUTPUTDIR)/native/java.base/libzip/zcrc32$(OBJ_SUFFIX) \ |
| 49 | $(SUPPORT_OUTPUTDIR)/native/java.base/libzip/deflate$(OBJ_SUFFIX) \ |
| 50 | $(SUPPORT_OUTPUTDIR)/native/java.base/libzip/trees$(OBJ_SUFFIX) \ |
| 51 | $(SUPPORT_OUTPUTDIR)/native/java.base/libzip/zadler32$(OBJ_SUFFIX) \ |
| 52 | $(SUPPORT_OUTPUTDIR)/native/java.base/libzip/compress$(OBJ_SUFFIX) \ |
| 53 | $(SUPPORT_OUTPUTDIR)/native/java.base/libzip/zutil$(OBJ_SUFFIX) \ |
| 54 | $(SUPPORT_OUTPUTDIR)/native/java.base/libzip/inflate$(OBJ_SUFFIX) \ |
| 55 | $(SUPPORT_OUTPUTDIR)/native/java.base/libzip/infback$(OBJ_SUFFIX) \ |
| 56 | $(SUPPORT_OUTPUTDIR)/native/java.base/libzip/inftrees$(OBJ_SUFFIX) \ |
| 57 | $(SUPPORT_OUTPUTDIR)/native/java.base/libzip/inffast$(OBJ_SUFFIX) |
Chris Hegarty | 3bc69d3 | 2014-08-17 15:54:13 +0100 | [diff] [blame] | 58 | |
| 59 | endif |
| 60 | |
Erik Joelsson | 72c4ec5 | 2017-09-12 19:03:56 +0200 | [diff] [blame] | 61 | UNPACK_MAPFILE_DIR := $(TOPDIR)/make/mapfiles/libunpack |
Erik Joelsson | 1aedcf6 | 2015-04-14 14:22:13 +0200 | [diff] [blame] | 62 | UNPACK_MAPFILE_PLATFORM_FILE := \ |
| 63 | $(UNPACK_MAPFILE_DIR)/mapfile-vers-unpack200-$(OPENJDK_TARGET_OS)-$(OPENJDK_TARGET_CPU_ARCH) |
| 64 | |
Chris Hegarty | 3bc69d3 | 2014-08-17 15:54:13 +0100 | [diff] [blame] | 65 | # The linker on older SuSE distros (e.g. on SLES 10) complains with: |
| 66 | # "Invalid version tag `SUNWprivate_1.1'. Only anonymous version tag is allowed in executable." |
| 67 | # if feeded with a version script which contains named tags. |
| 68 | ifeq ($(USING_BROKEN_SUSE_LD), yes) |
Erik Joelsson | 1aedcf6 | 2015-04-14 14:22:13 +0200 | [diff] [blame] | 69 | UNPACK_MAPFILE := $(UNPACK_MAPFILE_DIR)/mapfile-vers-unpack200.anonymous |
| 70 | else ifneq ($(wildcard $(UNPACK_MAPFILE_PLATFORM_FILE)), ) |
| 71 | UNPACK_MAPFILE := $(UNPACK_MAPFILE_PLATFORM_FILE) |
Chris Hegarty | 3bc69d3 | 2014-08-17 15:54:13 +0100 | [diff] [blame] | 72 | else |
Erik Joelsson | 1aedcf6 | 2015-04-14 14:22:13 +0200 | [diff] [blame] | 73 | UNPACK_MAPFILE := $(UNPACK_MAPFILE_DIR)/mapfile-vers-unpack200 |
Chris Hegarty | 3bc69d3 | 2014-08-17 15:54:13 +0100 | [diff] [blame] | 74 | endif |
| 75 | |
| 76 | $(eval $(call SetupNativeCompilation,BUILD_UNPACKEXE, \ |
| 77 | SRC := $(UNPACKEXE_SRC), \ |
Erik Joelsson | da8b135 | 2016-10-12 14:25:07 +0200 | [diff] [blame] | 78 | TOOLCHAIN := TOOLCHAIN_LINK_CXX, \ |
Chris Hegarty | 3bc69d3 | 2014-08-17 15:54:13 +0100 | [diff] [blame] | 79 | OPTIMIZATION := LOW, \ |
Erik Joelsson | c9bf298 | 2015-02-06 09:57:28 +0100 | [diff] [blame] | 80 | CFLAGS := $(UNPACKEXE_CFLAGS) $(CXXFLAGS_JDKEXE) -DFULL, \ |
Chris Hegarty | 3bc69d3 | 2014-08-17 15:54:13 +0100 | [diff] [blame] | 81 | CFLAGS_release := -DPRODUCT, \ |
| 82 | CFLAGS_linux := -fPIC, \ |
| 83 | CFLAGS_solaris := -KPIC, \ |
| 84 | CFLAGS_macosx := -fPIC, \ |
Magnus Ihse Bursie | 723a1a7 | 2015-05-08 10:37:14 +0200 | [diff] [blame] | 85 | DISABLED_WARNINGS_gcc := unused-result, \ |
Chris Hegarty | 3bc69d3 | 2014-08-17 15:54:13 +0100 | [diff] [blame] | 86 | MAPFILE := $(UNPACK_MAPFILE),\ |
Erik Joelsson | c9bf298 | 2015-02-06 09:57:28 +0100 | [diff] [blame] | 87 | LDFLAGS := $(UNPACKEXE_ZIPOBJS) \ |
| 88 | $(LDFLAGS_JDKEXE) $(LDFLAGS_CXX_JDK) \ |
Chris Hegarty | 3bc69d3 | 2014-08-17 15:54:13 +0100 | [diff] [blame] | 89 | $(call SET_SHARED_LIBRARY_ORIGIN), \ |
Magnus Ihse Bursie | 0bac07b | 2015-10-29 16:31:00 +0100 | [diff] [blame] | 90 | LIBS := $(UNPACKEXE_LIBS) $(LIBCXX), \ |
| 91 | LIBS_solaris := -lc, \ |
Magnus Ihse Bursie | 5aee130 | 2015-11-05 10:54:05 +0100 | [diff] [blame] | 92 | OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/unpackexe, \ |
Erik Joelsson | c9bf298 | 2015-02-06 09:57:28 +0100 | [diff] [blame] | 93 | OUTPUT_DIR := $(SUPPORT_OUTPUTDIR)/modules_cmds/$(MODULE), \ |
Chris Hegarty | 3bc69d3 | 2014-08-17 15:54:13 +0100 | [diff] [blame] | 94 | PROGRAM := unpack200, \ |
| 95 | VERSIONINFO_RESOURCE := $(GLOBAL_VERSION_INFO_RESOURCE), \ |
| 96 | RC_FLAGS := $(RC_FLAGS) \ |
| 97 | -D "JDK_FNAME=unpack200.exe" \ |
| 98 | -D "JDK_INTERNAL_NAME=unpack200" \ |
| 99 | -D "JDK_FTYPE=0x1L", \ |
Erik Joelsson | 72c4ec5 | 2017-09-12 19:03:56 +0200 | [diff] [blame] | 100 | MANIFEST := $(TOPDIR)/src/jdk.pack/windows/native/unpack200/unpack200_proto.exe.manifest, \ |
Magnus Ihse Bursie | e9cf247 | 2015-06-11 00:23:01 +0200 | [diff] [blame] | 101 | MANIFEST_VERSION := $(VERSION_NUMBER_FOUR_POSITIONS), \ |
Magnus Ihse Bursie | 41b53b0 | 2015-04-16 14:48:11 +0200 | [diff] [blame] | 102 | )) |
Chris Hegarty | 3bc69d3 | 2014-08-17 15:54:13 +0100 | [diff] [blame] | 103 | |
Chris Hegarty | 3bc69d3 | 2014-08-17 15:54:13 +0100 | [diff] [blame] | 104 | ifneq ($(USE_EXTERNAL_LIBZ), true) |
| 105 | |
| 106 | $(BUILD_UNPACKEXE): $(UNPACKEXE_ZIPOBJS) |
| 107 | |
| 108 | endif |
| 109 | |
Erik Joelsson | c9bf298 | 2015-02-06 09:57:28 +0100 | [diff] [blame] | 110 | TARGETS += $(BUILD_UNPACKEXE) |
Chris Hegarty | 3bc69d3 | 2014-08-17 15:54:13 +0100 | [diff] [blame] | 111 | |
| 112 | ################################################################################ |