make/launcher/Launcher-jdk.pack.gmk
author rriggs
Fri, 02 Mar 2018 14:17:04 -0500
changeset 49121 10f447530d32
parent 49070 d7859531621b
child 49241 de4b3a04feae
child 56237 9ccbd02e0c2c
child 56287 593a452fcbeb
permissions -rw-r--r--
8198697: Simplify initialization of platform encoding Reviewed-by: redestad, sherman
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
25859
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
     1
#
49070
d7859531621b 8198751: Refactor SetupNativeCompilation to take NAME and TYPE
ihse
parents: 48766
diff changeset
     2
# Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
25859
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
     3
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
     4
#
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
     5
# This code is free software; you can redistribute it and/or modify it
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
     6
# under the terms of the GNU General Public License version 2 only, as
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
     7
# published by the Free Software Foundation.  Oracle designates this
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
     8
# particular file as subject to the "Classpath" exception as provided
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
     9
# by Oracle in the LICENSE file that accompanied this code.
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    10
#
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    11
# This code is distributed in the hope that it will be useful, but WITHOUT
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    12
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    13
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    14
# version 2 for more details (a copy is included in the LICENSE file that
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    15
# accompanied this code).
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    16
#
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    17
# You should have received a copy of the GNU General Public License version
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    18
# 2 along with this work; if not, write to the Free Software Foundation,
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    19
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    20
#
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    21
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    22
# or visit www.oracle.com if you need additional information or have any
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    23
# questions.
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    24
#
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    25
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    26
include LauncherCommon.gmk
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    27
33523
eb067bcd9414 8141444: Clean up building of JDK launchers
ihse
parents: 33406
diff changeset
    28
$(eval $(call SetupBuildLauncher, pack200, \
36511
9d0388c6b336 8142968: Module System implementation
alanb
parents: 35276
diff changeset
    29
    MAIN_MODULE := java.base, \
33523
eb067bcd9414 8141444: Clean up building of JDK launchers
ihse
parents: 33406
diff changeset
    30
    MAIN_CLASS := com.sun.java.util.jar.pack.Driver, \
eb067bcd9414 8141444: Clean up building of JDK launchers
ihse
parents: 33406
diff changeset
    31
))
25859
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    32
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    33
################################################################################
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    34
# The order of the object files on the link command line affects the size of the resulting
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    35
# binary (at least on linux) which causes the size to differ between old and new build.
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    36
47217
72e3ae9a25eb 8187444: Forest Consolidation: Make build work
erikj
parents: 47216
diff changeset
    37
UNPACKEXE_SRC := $(TOPDIR)/src/jdk.pack/share/native/common-unpack \
72e3ae9a25eb 8187444: Forest Consolidation: Make build work
erikj
parents: 47216
diff changeset
    38
    $(TOPDIR)/src/jdk.pack/share/native/unpack200
72e3ae9a25eb 8187444: Forest Consolidation: Make build work
erikj
parents: 47216
diff changeset
    39
UNPACKEXE_CFLAGS := -I$(TOPDIR)/src/jdk.pack/share/native/common-unpack \
72e3ae9a25eb 8187444: Forest Consolidation: Make build work
erikj
parents: 47216
diff changeset
    40
    -I$(TOPDIR)/src/java.base/share/native/libjava \
72e3ae9a25eb 8187444: Forest Consolidation: Make build work
erikj
parents: 47216
diff changeset
    41
    -I$(TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_TYPE)/native/libjava
25859
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    42
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    43
ifeq ($(USE_EXTERNAL_LIBZ), true)
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    44
  UNPACKEXE_CFLAGS += -DSYSTEM_ZLIB
33305
ed708a0e3482 8140223: fix the build with a toolchain with a linker defaulting to ld --as-needed
erikj
parents: 30434
diff changeset
    45
  UNPACKEXE_LIBS := -lz
25859
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    46
else
47217
72e3ae9a25eb 8187444: Forest Consolidation: Make build work
erikj
parents: 47216
diff changeset
    47
  UNPACKEXE_CFLAGS += -I$(TOPDIR)/src/java.base/share/native/libzip/zlib
27565
729f9700483a 8049367: Modular Run-Time Images
chegar
parents: 25859
diff changeset
    48
  UNPACKEXE_ZIPOBJS := $(SUPPORT_OUTPUTDIR)/native/java.base/libzip/zcrc32$(OBJ_SUFFIX) \
729f9700483a 8049367: Modular Run-Time Images
chegar
parents: 25859
diff changeset
    49
      $(SUPPORT_OUTPUTDIR)/native/java.base/libzip/deflate$(OBJ_SUFFIX) \
729f9700483a 8049367: Modular Run-Time Images
chegar
parents: 25859
diff changeset
    50
      $(SUPPORT_OUTPUTDIR)/native/java.base/libzip/trees$(OBJ_SUFFIX) \
729f9700483a 8049367: Modular Run-Time Images
chegar
parents: 25859
diff changeset
    51
      $(SUPPORT_OUTPUTDIR)/native/java.base/libzip/zadler32$(OBJ_SUFFIX) \
729f9700483a 8049367: Modular Run-Time Images
chegar
parents: 25859
diff changeset
    52
      $(SUPPORT_OUTPUTDIR)/native/java.base/libzip/compress$(OBJ_SUFFIX) \
729f9700483a 8049367: Modular Run-Time Images
chegar
parents: 25859
diff changeset
    53
      $(SUPPORT_OUTPUTDIR)/native/java.base/libzip/zutil$(OBJ_SUFFIX) \
729f9700483a 8049367: Modular Run-Time Images
chegar
parents: 25859
diff changeset
    54
      $(SUPPORT_OUTPUTDIR)/native/java.base/libzip/inflate$(OBJ_SUFFIX) \
729f9700483a 8049367: Modular Run-Time Images
chegar
parents: 25859
diff changeset
    55
      $(SUPPORT_OUTPUTDIR)/native/java.base/libzip/infback$(OBJ_SUFFIX) \
729f9700483a 8049367: Modular Run-Time Images
chegar
parents: 25859
diff changeset
    56
      $(SUPPORT_OUTPUTDIR)/native/java.base/libzip/inftrees$(OBJ_SUFFIX) \
729f9700483a 8049367: Modular Run-Time Images
chegar
parents: 25859
diff changeset
    57
      $(SUPPORT_OUTPUTDIR)/native/java.base/libzip/inffast$(OBJ_SUFFIX)
25859
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    58
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    59
endif
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    60
47217
72e3ae9a25eb 8187444: Forest Consolidation: Make build work
erikj
parents: 47216
diff changeset
    61
UNPACK_MAPFILE_DIR := $(TOPDIR)/make/mapfiles/libunpack
29879
eede785c4e0d 8077419: Launcher mapfile fails linking with SS12u4
erikj
parents: 29591
diff changeset
    62
UNPACK_MAPFILE_PLATFORM_FILE := \
eede785c4e0d 8077419: Launcher mapfile fails linking with SS12u4
erikj
parents: 29591
diff changeset
    63
    $(UNPACK_MAPFILE_DIR)/mapfile-vers-unpack200-$(OPENJDK_TARGET_OS)-$(OPENJDK_TARGET_CPU_ARCH)
eede785c4e0d 8077419: Launcher mapfile fails linking with SS12u4
erikj
parents: 29591
diff changeset
    64
25859
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    65
# The linker on older SuSE distros (e.g. on SLES 10) complains with:
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    66
# "Invalid version tag `SUNWprivate_1.1'. Only anonymous version tag is allowed in executable."
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    67
# if feeded with a version script which contains named tags.
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    68
ifeq ($(USING_BROKEN_SUSE_LD), yes)
29879
eede785c4e0d 8077419: Launcher mapfile fails linking with SS12u4
erikj
parents: 29591
diff changeset
    69
  UNPACK_MAPFILE := $(UNPACK_MAPFILE_DIR)/mapfile-vers-unpack200.anonymous
eede785c4e0d 8077419: Launcher mapfile fails linking with SS12u4
erikj
parents: 29591
diff changeset
    70
else ifneq ($(wildcard $(UNPACK_MAPFILE_PLATFORM_FILE)), )
eede785c4e0d 8077419: Launcher mapfile fails linking with SS12u4
erikj
parents: 29591
diff changeset
    71
  UNPACK_MAPFILE := $(UNPACK_MAPFILE_PLATFORM_FILE)
25859
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    72
else
29879
eede785c4e0d 8077419: Launcher mapfile fails linking with SS12u4
erikj
parents: 29591
diff changeset
    73
  UNPACK_MAPFILE := $(UNPACK_MAPFILE_DIR)/mapfile-vers-unpack200
25859
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    74
endif
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    75
49070
d7859531621b 8198751: Refactor SetupNativeCompilation to take NAME and TYPE
ihse
parents: 48766
diff changeset
    76
$(eval $(call SetupNativeCompilation, BUILD_UNPACKEXE, \
d7859531621b 8198751: Refactor SetupNativeCompilation to take NAME and TYPE
ihse
parents: 48766
diff changeset
    77
    NAME := unpack200, \
d7859531621b 8198751: Refactor SetupNativeCompilation to take NAME and TYPE
ihse
parents: 48766
diff changeset
    78
    TYPE := EXECUTABLE, \
25859
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    79
    SRC := $(UNPACKEXE_SRC), \
41479
bf50b06f27b5 8167479: arm 32/64 slowdebug fails to build on unpack200
erikj
parents: 41472
diff changeset
    80
    TOOLCHAIN := TOOLCHAIN_LINK_CXX, \
25859
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    81
    OPTIMIZATION := LOW, \
28846
b96683be2713 8071329: Stop exporting INCLUDE and LIB when building on windows
erikj
parents: 27799
diff changeset
    82
    CFLAGS := $(UNPACKEXE_CFLAGS) $(CXXFLAGS_JDKEXE) -DFULL, \
25859
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    83
    CFLAGS_release := -DPRODUCT, \
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    84
    CFLAGS_linux := -fPIC, \
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    85
    CFLAGS_solaris := -KPIC, \
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    86
    CFLAGS_macosx := -fPIC, \
48766
2c4d1993b5f9 8196985: Disable new warnings from GCC 7.3 in jdk libraries
erikj
parents: 47217
diff changeset
    87
    DISABLED_WARNINGS_gcc := unused-result implicit-fallthrough, \
25859
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    88
    MAPFILE := $(UNPACK_MAPFILE),\
28846
b96683be2713 8071329: Stop exporting INCLUDE and LIB when building on windows
erikj
parents: 27799
diff changeset
    89
    LDFLAGS := $(UNPACKEXE_ZIPOBJS) \
b96683be2713 8071329: Stop exporting INCLUDE and LIB when building on windows
erikj
parents: 27799
diff changeset
    90
        $(LDFLAGS_JDKEXE) $(LDFLAGS_CXX_JDK) \
25859
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    91
        $(call SET_SHARED_LIBRARY_ORIGIN), \
33406
4680f7495292 8140661: Rename LDFLAGS_SUFFIX to LIBS
ihse
parents: 33305
diff changeset
    92
    LIBS := $(UNPACKEXE_LIBS) $(LIBCXX), \
4680f7495292 8140661: Rename LDFLAGS_SUFFIX to LIBS
ihse
parents: 33305
diff changeset
    93
    LIBS_solaris :=  -lc, \
33523
eb067bcd9414 8141444: Clean up building of JDK launchers
ihse
parents: 33406
diff changeset
    94
    OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/unpackexe, \
28846
b96683be2713 8071329: Stop exporting INCLUDE and LIB when building on windows
erikj
parents: 27799
diff changeset
    95
    OUTPUT_DIR := $(SUPPORT_OUTPUTDIR)/modules_cmds/$(MODULE), \
25859
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    96
    VERSIONINFO_RESOURCE := $(GLOBAL_VERSION_INFO_RESOURCE), \
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    97
    RC_FLAGS := $(RC_FLAGS) \
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    98
        -D "JDK_FNAME=unpack200.exe" \
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    99
        -D "JDK_INTERNAL_NAME=unpack200" \
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   100
        -D "JDK_FTYPE=0x1L", \
47217
72e3ae9a25eb 8187444: Forest Consolidation: Make build work
erikj
parents: 47216
diff changeset
   101
    MANIFEST := $(TOPDIR)/src/jdk.pack/windows/native/unpack200/unpack200_proto.exe.manifest, \
33984
2333676816eb 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents: 30434
diff changeset
   102
    MANIFEST_VERSION := $(VERSION_NUMBER_FOUR_POSITIONS), \
29925
6d47adfc6b47 8077847: Better handling of Windows executable manifest version
ihse
parents: 29879
diff changeset
   103
))
25859
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   104
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   105
ifneq ($(USE_EXTERNAL_LIBZ), true)
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   106
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   107
  $(BUILD_UNPACKEXE): $(UNPACKEXE_ZIPOBJS)
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   108
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   109
endif
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   110
28846
b96683be2713 8071329: Stop exporting INCLUDE and LIB when building on windows
erikj
parents: 27799
diff changeset
   111
TARGETS += $(BUILD_UNPACKEXE)
25859
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   112
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   113
################################################################################