jdk/make/launcher/Launcher-jdk.pack200.gmk
author mchung
Fri, 06 Mar 2015 09:11:42 -0800
changeset 29370 1ca08334b821
parent 29368 be944a521c76
child 29374 f031a666744a
permissions -rw-r--r--
8074430: Move policytool to jdk.policytool module Reviewed-by: alanb, weijun, erikj, ihse

#
# Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 2 only, as
# published by the Free Software Foundation.  Oracle designates this
# particular file as subject to the "Classpath" exception as provided
# by Oracle in the LICENSE file that accompanied this code.
#
# This code is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
# version 2 for more details (a copy is included in the LICENSE file that
# accompanied this code).
#
# You should have received a copy of the GNU General Public License version
# 2 along with this work; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
#
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
# or visit www.oracle.com if you need additional information or have any
# questions.
#

include LauncherCommon.gmk

$(eval $(call SetupLauncher,pack200, \
    -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "com.sun.java.util.jar.pack.Driver"$(COMMA) }'))

################################################################################
# The order of the object files on the link command line affects the size of the resulting
# binary (at least on linux) which causes the size to differ between old and new build.

UNPACKEXE_SRC := $(JDK_TOPDIR)/src/jdk.pack200/share/native/common-unpack \
    $(JDK_TOPDIR)/src/jdk.pack200/share/native/unpack200
UNPACKEXE_CFLAGS := -I$(JDK_TOPDIR)/src/jdk.pack200/share/native/common-unpack \
    -I$(JDK_TOPDIR)/src/java.base/share/native/libjava \
    -I$(JDK_TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_TYPE)/native/libjava

ifeq ($(USE_EXTERNAL_LIBZ), true)
  UNPACKEXE_CFLAGS += -DSYSTEM_ZLIB
  UNPACKEXE_ZIPOBJS := -lz
else
  UNPACKEXE_CFLAGS += -I$(JDK_TOPDIR)/src/java.base/share/native/libzip/zlib-1.2.8
  UNPACKEXE_ZIPOBJS := $(SUPPORT_OUTPUTDIR)/native/java.base/libzip/zcrc32$(OBJ_SUFFIX) \
      $(SUPPORT_OUTPUTDIR)/native/java.base/libzip/deflate$(OBJ_SUFFIX) \
      $(SUPPORT_OUTPUTDIR)/native/java.base/libzip/trees$(OBJ_SUFFIX) \
      $(SUPPORT_OUTPUTDIR)/native/java.base/libzip/zadler32$(OBJ_SUFFIX) \
      $(SUPPORT_OUTPUTDIR)/native/java.base/libzip/compress$(OBJ_SUFFIX) \
      $(SUPPORT_OUTPUTDIR)/native/java.base/libzip/zutil$(OBJ_SUFFIX) \
      $(SUPPORT_OUTPUTDIR)/native/java.base/libzip/inflate$(OBJ_SUFFIX) \
      $(SUPPORT_OUTPUTDIR)/native/java.base/libzip/infback$(OBJ_SUFFIX) \
      $(SUPPORT_OUTPUTDIR)/native/java.base/libzip/inftrees$(OBJ_SUFFIX) \
      $(SUPPORT_OUTPUTDIR)/native/java.base/libzip/inffast$(OBJ_SUFFIX)

endif

UNPACKEXE_LANG := C
ifeq ($(OPENJDK_TARGET_OS), solaris)
  UNPACKEXE_LANG := C++
endif

# The linker on older SuSE distros (e.g. on SLES 10) complains with:
# "Invalid version tag `SUNWprivate_1.1'. Only anonymous version tag is allowed in executable."
# if feeded with a version script which contains named tags.
ifeq ($(USING_BROKEN_SUSE_LD), yes)
  UNPACK_MAPFILE = $(JDK_TOPDIR)/make/mapfiles/libunpack/mapfile-vers-unpack200.anonymous
else
  UNPACK_MAPFILE = $(JDK_TOPDIR)/make/mapfiles/libunpack/mapfile-vers-unpack200
endif

$(eval $(call SetupNativeCompilation,BUILD_UNPACKEXE, \
    SRC := $(UNPACKEXE_SRC), \
    LANG := $(UNPACKEXE_LANG), \
    OPTIMIZATION := LOW, \
    CFLAGS := $(UNPACKEXE_CFLAGS) $(CXXFLAGS_JDKEXE) -DFULL, \
    CFLAGS_release := -DPRODUCT, \
    CFLAGS_linux := -fPIC, \
    CFLAGS_solaris := -KPIC, \
    CFLAGS_macosx := -fPIC, \
    MAPFILE := $(UNPACK_MAPFILE),\
    LDFLAGS := $(UNPACKEXE_ZIPOBJS) \
        $(LDFLAGS_JDKEXE) $(LDFLAGS_CXX_JDK) \
        $(call SET_SHARED_LIBRARY_NAME,$(LIBRARY_PREFIX)unpack$(SHARED_LIBRARY_SUFFIX)) \
        $(call SET_SHARED_LIBRARY_ORIGIN), \
    LDFLAGS_linux := -lc, \
    LDFLAGS_solaris := $(UNPACKEXE_LDFLAGS_solaris) -lc, \
    LDFLAGS_SUFFIX := $(LIBCXX), \
    OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/unpackexe$(OUTPUT_SUBDIR), \
    OUTPUT_DIR := $(SUPPORT_OUTPUTDIR)/modules_cmds/$(MODULE), \
    PROGRAM := unpack200, \
    VERSIONINFO_RESOURCE := $(GLOBAL_VERSION_INFO_RESOURCE), \
    RC_FLAGS := $(RC_FLAGS) \
        -D "JDK_FNAME=unpack200.exe" \
        -D "JDK_INTERNAL_NAME=unpack200" \
        -D "JDK_FTYPE=0x1L", \
    DEBUG_SYMBOLS := true, \
    MANIFEST := $(JDK_TOPDIR)/src/jdk.pack200/windows/native/unpack200/unpack200_proto.exe.manifest))

ifneq ($(USE_EXTERNAL_LIBZ), true)

  $(BUILD_UNPACKEXE): $(UNPACKEXE_ZIPOBJS)

endif

TARGETS += $(BUILD_UNPACKEXE)

################################################################################