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