jdk/make/launcher/LauncherCommon.gmk
author ihse
Fri, 11 Sep 2015 10:06:10 +0200
changeset 32515 b6277cad1488
parent 29931 64e274ed6567
child 33406 4680f7495292
child 33653 c1ee09fe3274
child 34005 bb40b397f7c6
permissions -rw-r--r--
8064808: Disable use of broken objcopy on Solaris, remove adhoc helper tools Reviewed-by: erikj
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
25859
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
     1
#
29925
6d47adfc6b47 8077847: Better handling of Windows executable manifest version
ihse
parents: 27953
diff changeset
     2
# Copyright (c) 2011, 2015, 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 NativeCompilation.gmk
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    27
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    28
# Prepare the find cache.
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    29
$(eval $(call FillCacheFind, $(JDK_TOPDIR)/src/java.base/share/native/launcher))
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    30
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    31
# When building a legacy overlay image (on solaris 64 bit), the launchers
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    32
# need to be built with a different rpath and a different output dir.
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    33
ifeq ($(OVERLAY_IMAGES), true)
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    34
  ORIGIN_ROOT := /../..
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    35
  OUTPUT_SUBDIR := $(OPENJDK_TARGET_CPU_ISADIR)
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    36
else
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    37
  ORIGIN_ROOT := /..
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    38
endif
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    39
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    40
ifeq ($(OPENJDK_TARGET_OS), macosx)
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    41
  ORIGIN_ARG := $(call SET_EXECUTABLE_ORIGIN)
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    42
else
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    43
  ORIGIN_ARG := $(call SET_EXECUTABLE_ORIGIN,$(ORIGIN_ROOT)/lib$(OPENJDK_TARGET_CPU_LIBDIR)/jli)
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    44
endif
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    45
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    46
#
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    47
# Applications expect to be able to link against libjawt without invoking
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    48
# System.loadLibrary("jawt") first. This was the behaviour described in the
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    49
# devloper documentation of JAWT and what worked with OpenJDK6.
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    50
#
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    51
ifneq ($(findstring $(OPENJDK_TARGET_OS), linux solaris), )
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    52
  ORIGIN_ARG += $(call SET_EXECUTABLE_ORIGIN,$(ORIGIN_ROOT)/lib$(OPENJDK_TARGET_CPU_LIBDIR))
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    53
endif
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    54
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    55
LAUNCHER_SRC := $(JDK_TOPDIR)/src/java.base/share/native/launcher
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    56
LAUNCHER_CFLAGS := -I$(JDK_TOPDIR)/src/java.base/share/native/launcher \
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    57
    -I$(JDK_TOPDIR)/src/java.base/share/native/libjli \
27736
8c9bd4be4a86 8058631: Rename posix to unix in build system to match file name changes
ihse
parents: 25859
diff changeset
    58
    -I$(JDK_TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_TYPE)/native/libjli \
25859
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    59
    -I$(JDK_TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS)/native/libjli \
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    60
    #
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    61
GLOBAL_VERSION_INFO_RESOURCE := $(JDK_TOPDIR)/src/java.base/windows/native/common/version.rc
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    62
JAVA_VERSION_INFO_RESOURCE := $(JDK_TOPDIR)/src/java.base/windows/native/launcher/java.rc
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    63
MACOSX_PLIST_DIR := $(JDK_TOPDIR)/src/java.base/macosx/native/launcher
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    64
# Until the shuffle is permanent, we can't add this in configure
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    65
CFLAGS_JDKEXE := $(filter-out %javavm/export, $(CFLAGS_JDKEXE))
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    66
CFLAGS_JDKEXE += -I$(JDK_TOPDIR)/src/java.base/share/native/include \
27736
8c9bd4be4a86 8058631: Rename posix to unix in build system to match file name changes
ihse
parents: 25859
diff changeset
    67
    -I$(JDK_TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_TYPE)/native/include
25859
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    68
CXXFLAGS_JDKEXE := $(filter-out %javavm/export, $(CXXFLAGS_JDKEXE))
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    69
CXXFLAGS_JDKEXE += -I$(JDK_TOPDIR)/src/java.base/share/native/include \
27736
8c9bd4be4a86 8058631: Rename posix to unix in build system to match file name changes
ihse
parents: 25859
diff changeset
    70
    -I$(JDK_TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_TYPE)/native/include
25859
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    71
JAVA_MANIFEST := $(JDK_TOPDIR)/src/java.base/windows/native/launcher/java.manifest
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    72
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    73
define SetupLauncher
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    74
  # TODO: Fix mapfile on solaris. Won't work with ld as linker.
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    75
  # Parameter 1 is the name of the launcher (java, javac, jar...)
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    76
  # Parameter 2 is extra CFLAGS
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    77
  # Parameter 3 is extra LDFLAGS
27736
8c9bd4be4a86 8058631: Rename posix to unix in build system to match file name changes
ihse
parents: 25859
diff changeset
    78
  # Parameter 4 is extra LDFLAGS_SUFFIX_unix
25859
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    79
  # Parameter 5 is extra LDFLAGS_SUFFIX_windows
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    80
  # Parameter 6 is optional Windows JLI library (full path)
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    81
  # Parameter 7 is optional Windows resource (RC) flags
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    82
  # Parameter 8 is optional Windows version resource file (.rc)
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    83
  # Parameter 9 is different output dir
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    84
  # Parameter 10 if set, link statically with c runtime on windows.
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    85
  # Parameter 11 if set, override plist file on macosx.
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    86
  $(call LogSetupMacroEntry,SetupLauncher($1),$2,$3,$4,$5,$6,$7,$8,$9,$(10),$(11))
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    87
  $(if $(13),$(error Internal makefile error: Too many arguments to SetupLauncher, please update CompileLaunchers.gmk))
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    88
27565
729f9700483a 8049367: Modular Run-Time Images
chegar
parents: 25859
diff changeset
    89
  $1_WINDOWS_JLI_LIB := $(SUPPORT_OUTPUTDIR)/native/java.base/libjli/jli.lib
25859
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    90
  ifneq ($6, )
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    91
    $1_WINDOWS_JLI_LIB := $6
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    92
  endif
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    93
  $1_VERSION_INFO_RESOURCE := $(GLOBAL_VERSION_INFO_RESOURCE)
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    94
  ifneq ($8, )
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    95
    $1_VERSION_INFO_RESOURCE := $8
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    96
  endif
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    97
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    98
  $1_LDFLAGS := $3
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    99
  $1_LDFLAGS_SUFFIX :=
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   100
  ifeq ($(OPENJDK_TARGET_OS), macosx)
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   101
    $1_PLIST_FILE := Info-cmdline.plist
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   102
    ifneq ($(11), )
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   103
      $1_PLIST_FILE := $(11)
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   104
      ifneq ($$(findstring privileged, $$($1_PLIST_FILE)), )
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   105
        $1_CODESIGN := true
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   106
      endif
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   107
    endif
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   108
27565
729f9700483a 8049367: Modular Run-Time Images
chegar
parents: 25859
diff changeset
   109
    $1_LDFLAGS += -Wl,-all_load $(SUPPORT_OUTPUTDIR)/native/java.base/libjli_static.a \
25859
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   110
        -framework Cocoa -framework Security -framework ApplicationServices \
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   111
        -sectcreate __TEXT __info_plist $(MACOSX_PLIST_DIR)/$$($1_PLIST_FILE)
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   112
        $1_LDFLAGS_SUFFIX += -pthread
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   113
  endif
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   114
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   115
  ifeq ($(OPENJDK_TARGET_OS), aix)
27953
03e0e3891572 8066589: Make importing sa-jdi.jar optional on its existance
simonis
parents: 27799
diff changeset
   116
    $1_LDFLAGS_SUFFIX += -L$(SUPPORT_OUTPUTDIR)/native/java.base -ljli_static
25859
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   117
  endif
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   118
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   119
  ifeq ($(USE_EXTERNAL_LIBZ), true)
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   120
    $1_LDFLAGS_SUFFIX += -lz
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   121
  endif
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   122
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   123
  $1_OUTPUT_DIR_ARG := $9
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   124
  ifeq (, $$($1_OUTPUT_DIR_ARG))
27565
729f9700483a 8049367: Modular Run-Time Images
chegar
parents: 25859
diff changeset
   125
    $1_OUTPUT_DIR_ARG := $(SUPPORT_OUTPUTDIR)/modules_cmds/$(MODULE)
25859
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   126
  endif
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   127
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   128
  # TODO: maybe it's better to move this if-statement out of this function
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   129
  ifeq ($1, java)
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   130
    $1_OPTIMIZATION_ARG := HIGH
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   131
    $1_LDFLAGS_solaris := -R$(OPENWIN_HOME)/lib$(OPENJDK_TARGET_CPU_ISADIR)
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   132
  else
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   133
  $1_OPTIMIZATION_ARG := LOW
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   134
  endif
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   135
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   136
  $1_CFLAGS := $(CFLAGS_JDKEXE)
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   137
  ifeq ($(10), true)
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   138
    $1_CFLAGS := $(filter-out -MD, $(CFLAGS_JDKEXE))
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   139
  endif
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   140
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   141
  # The linker on older SuSE distros (e.g. on SLES 10) complains with:
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   142
  # "Invalid version tag `SUNWprivate_1.1'. Only anonymous version tag is allowed in executable."
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   143
  # if feeded with a version script which contains named tags.
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   144
  ifeq ($(USING_BROKEN_SUSE_LD),yes)
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   145
    ifneq ($(wildcard $(JDK_TOPDIR)/make/mapfiles/launchers/mapfile-$(OPENJDK_TARGET_CPU).anonymous), )
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   146
      $1_MAPFILE := $(JDK_TOPDIR)/make/mapfiles/launchers/mapfile-$(OPENJDK_TARGET_CPU).anonymous
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   147
    else
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   148
      $1_MAPFILE :=
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   149
    endif
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   150
  else
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   151
    ifneq ($(wildcard $(JDK_TOPDIR)/make/mapfiles/launchers/mapfile-$(OPENJDK_TARGET_CPU)), )
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   152
      $1_MAPFILE := $(JDK_TOPDIR)/make/mapfiles/launchers/mapfile-$(OPENJDK_TARGET_CPU)
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   153
    else
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   154
      $1_MAPFILE :=
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   155
    endif
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   156
  endif
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   157
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   158
  $(call SetupNativeCompilation,BUILD_LAUNCHER_$1, \
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   159
      SRC := $(LAUNCHER_SRC), \
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   160
      INCLUDE_FILES := main.c, \
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   161
      OPTIMIZATION := $$($1_OPTIMIZATION_ARG), \
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   162
      CFLAGS := $$($1_CFLAGS) \
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   163
          $(LAUNCHER_CFLAGS) \
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   164
          -DFULL_VERSION='"$(FULL_VERSION)"' \
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   165
          -DJDK_MAJOR_VERSION='"$(JDK_MAJOR_VERSION)"' \
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   166
          -DJDK_MINOR_VERSION='"$(JDK_MINOR_VERSION)"' \
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   167
          -DLAUNCHER_NAME='"$(LAUNCHER_NAME)"' \
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   168
          -DPROGNAME='"$1"' $(DPACKAGEPATH) \
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   169
          $2, \
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   170
      CFLAGS_linux := -fPIC, \
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   171
      CFLAGS_solaris := -KPIC -DHAVE_GETHRTIME, \
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   172
      LDFLAGS := $(LDFLAGS_JDKEXE) \
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   173
          $(ORIGIN_ARG) \
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   174
          $$($1_LDFLAGS), \
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   175
      LDFLAGS_macosx := $(call SET_SHARED_LIBRARY_NAME,$1), \
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   176
      LDFLAGS_linux := -lpthread \
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   177
          $(call SET_SHARED_LIBRARY_NAME,$(LIBRARY_PREFIX)$(SHARED_LIBRARY_SUFFIX)), \
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   178
      LDFLAGS_solaris := $$($1_LDFLAGS_solaris) \
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   179
          $(call SET_SHARED_LIBRARY_NAME,$(LIBRARY_PREFIX)$(SHARED_LIBRARY_SUFFIX)), \
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   180
      MAPFILE := $$($1_MAPFILE), \
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   181
      LDFLAGS_SUFFIX := $(LDFLAGS_JDKEXE_SUFFIX) $$($1_LDFLAGS_SUFFIX), \
27736
8c9bd4be4a86 8058631: Rename posix to unix in build system to match file name changes
ihse
parents: 25859
diff changeset
   182
      LDFLAGS_SUFFIX_unix := $4, \
25859
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   183
      LDFLAGS_SUFFIX_windows := $$($1_WINDOWS_JLI_LIB) \
27565
729f9700483a 8049367: Modular Run-Time Images
chegar
parents: 25859
diff changeset
   184
          $(SUPPORT_OUTPUTDIR)/native/java.base/libjava/java.lib advapi32.lib $5, \
729f9700483a 8049367: Modular Run-Time Images
chegar
parents: 25859
diff changeset
   185
      LDFLAGS_SUFFIX_linux := -L$(SUPPORT_OUTPUTDIR)/modules_libs/java.base$(OPENJDK_TARGET_CPU_LIBDIR)/jli -ljli $(LIBDL) -lc, \
729f9700483a 8049367: Modular Run-Time Images
chegar
parents: 25859
diff changeset
   186
      LDFLAGS_SUFFIX_solaris := -L$(SUPPORT_OUTPUTDIR)/modules_libs/java.base$(OPENJDK_TARGET_CPU_LIBDIR)/jli -ljli -lthread $(LIBDL) -lc, \
729f9700483a 8049367: Modular Run-Time Images
chegar
parents: 25859
diff changeset
   187
      OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/$1_objs$(OUTPUT_SUBDIR), \
25859
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   188
      OUTPUT_DIR := $$($1_OUTPUT_DIR_ARG)$(OUTPUT_SUBDIR), \
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   189
      PROGRAM := $1, \
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   190
      DEBUG_SYMBOLS := true, \
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   191
      VERSIONINFO_RESOURCE := $$($1_VERSION_INFO_RESOURCE), \
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   192
      RC_FLAGS := $(RC_FLAGS) \
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   193
          -D "JDK_FNAME=$1$(EXE_SUFFIX)" \
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   194
          -D "JDK_INTERNAL_NAME=$1" \
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   195
          -D "JDK_FTYPE=0x1L" \
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   196
          $7, \
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   197
      MANIFEST := $(JAVA_MANIFEST), \
29925
6d47adfc6b47 8077847: Better handling of Windows executable manifest version
ihse
parents: 27953
diff changeset
   198
      MANIFEST_VERSION := $(JDK_VERSION_FOR_MANIFEST), \
6d47adfc6b47 8077847: Better handling of Windows executable manifest version
ihse
parents: 27953
diff changeset
   199
      CODESIGN := $$($1_CODESIGN), \
6d47adfc6b47 8077847: Better handling of Windows executable manifest version
ihse
parents: 27953
diff changeset
   200
  )
25859
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   201
27565
729f9700483a 8049367: Modular Run-Time Images
chegar
parents: 25859
diff changeset
   202
  TARGETS += $$(BUILD_LAUNCHER_$1)
25859
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   203
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   204
  ifneq (,$(filter $(OPENJDK_TARGET_OS), macosx aix))
27565
729f9700483a 8049367: Modular Run-Time Images
chegar
parents: 25859
diff changeset
   205
    $$(BUILD_LAUNCHER_$1): $(SUPPORT_OUTPUTDIR)/native/java.base/libjli_static.a
25859
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   206
  endif
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   207
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   208
  ifeq ($(OPENJDK_TARGET_OS), windows)
27565
729f9700483a 8049367: Modular Run-Time Images
chegar
parents: 25859
diff changeset
   209
    $$(BUILD_LAUNCHER_$1): $(SUPPORT_OUTPUTDIR)/native/java.base/libjava/java.lib \
25859
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   210
        $$($1_WINDOWS_JLI_LIB)
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   211
  endif
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   212
endef
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   213
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   214
##########################################################################################
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   215
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   216
XLIBS := $(X_LIBS) -lX11
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   217
ifeq ($(OPENJDK_TARGET_OS), macosx)
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   218
  DPACKAGEPATH := -DPACKAGE_PATH='"$(PACKAGE_PATH)"'
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   219
  XLIBS :=
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   220
endif
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   221
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   222
JAVA_RC_FLAGS += -i $(JDK_TOPDIR)/src/java.base/windows/native/common
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   223
ifdef OPENJDK
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   224
  JAVA_RC_FLAGS += -i "$(JDK_TOPDIR)/src/java.base/windows/native/launcher/icons"
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   225
else
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   226
  JAVA_RC_FLAGS += -i "$(JDK_TOPDIR)/src/closed/java.base/windows/native/launcher/icons"
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   227
endif