jdk/make/launcher/LauncherCommon.gmk
author ihse
Thu, 29 Oct 2015 16:31:00 +0100
changeset 33406 4680f7495292
parent 32515 b6277cad1488
child 33661 ad7c7378a002
child 33523 eb067bcd9414
child 34012 b8b34f35e2ee
permissions -rw-r--r--
8140661: Rename LDFLAGS_SUFFIX to LIBS 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
33406
4680f7495292 8140661: Rename LDFLAGS_SUFFIX to LIBS
ihse
parents: 32515
diff changeset
    78
  # Parameter 4 is extra LIBS_unix
4680f7495292 8140661: Rename LDFLAGS_SUFFIX to LIBS
ihse
parents: 32515
diff changeset
    79
  # Parameter 5 is extra LIBS_windows
25859
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
33406
4680f7495292 8140661: Rename LDFLAGS_SUFFIX to LIBS
ihse
parents: 32515
diff changeset
    99
  $1_LIBS :=
25859
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
        -sectcreate __TEXT __info_plist $(MACOSX_PLIST_DIR)/$$($1_PLIST_FILE)
33406
4680f7495292 8140661: Rename LDFLAGS_SUFFIX to LIBS
ihse
parents: 32515
diff changeset
   111
    $1_LIBS += -framework Cocoa -framework Security \
4680f7495292 8140661: Rename LDFLAGS_SUFFIX to LIBS
ihse
parents: 32515
diff changeset
   112
        -framework ApplicationServices
25859
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)
33406
4680f7495292 8140661: Rename LDFLAGS_SUFFIX to LIBS
ihse
parents: 32515
diff changeset
   116
    $1_LDFLAGS += -L$(SUPPORT_OUTPUTDIR)/native/java.base
4680f7495292 8140661: Rename LDFLAGS_SUFFIX to LIBS
ihse
parents: 32515
diff changeset
   117
    $1_LIBS += -ljli_static
25859
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   118
  endif
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   119
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   120
  ifeq ($(USE_EXTERNAL_LIBZ), true)
33406
4680f7495292 8140661: Rename LDFLAGS_SUFFIX to LIBS
ihse
parents: 32515
diff changeset
   121
    $1_LIBS += -lz
25859
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   122
  endif
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   123
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   124
  $1_OUTPUT_DIR_ARG := $9
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   125
  ifeq (, $$($1_OUTPUT_DIR_ARG))
27565
729f9700483a 8049367: Modular Run-Time Images
chegar
parents: 25859
diff changeset
   126
    $1_OUTPUT_DIR_ARG := $(SUPPORT_OUTPUTDIR)/modules_cmds/$(MODULE)
25859
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   127
  endif
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   128
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   129
  # TODO: maybe it's better to move this if-statement out of this function
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   130
  ifeq ($1, java)
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   131
    $1_OPTIMIZATION_ARG := HIGH
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   132
    $1_LDFLAGS_solaris := -R$(OPENWIN_HOME)/lib$(OPENJDK_TARGET_CPU_ISADIR)
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   133
  else
33406
4680f7495292 8140661: Rename LDFLAGS_SUFFIX to LIBS
ihse
parents: 32515
diff changeset
   134
    $1_OPTIMIZATION_ARG := LOW
25859
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   135
  endif
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   136
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   137
  $1_CFLAGS := $(CFLAGS_JDKEXE)
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   138
  ifeq ($(10), true)
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   139
    $1_CFLAGS := $(filter-out -MD, $(CFLAGS_JDKEXE))
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   140
  endif
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   141
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   142
  # The linker on older SuSE distros (e.g. on SLES 10) complains with:
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   143
  # "Invalid version tag `SUNWprivate_1.1'. Only anonymous version tag is allowed in executable."
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   144
  # if feeded with a version script which contains named tags.
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   145
  ifeq ($(USING_BROKEN_SUSE_LD),yes)
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   146
    ifneq ($(wildcard $(JDK_TOPDIR)/make/mapfiles/launchers/mapfile-$(OPENJDK_TARGET_CPU).anonymous), )
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   147
      $1_MAPFILE := $(JDK_TOPDIR)/make/mapfiles/launchers/mapfile-$(OPENJDK_TARGET_CPU).anonymous
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   148
    else
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   149
      $1_MAPFILE :=
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   150
    endif
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   151
  else
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   152
    ifneq ($(wildcard $(JDK_TOPDIR)/make/mapfiles/launchers/mapfile-$(OPENJDK_TARGET_CPU)), )
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   153
      $1_MAPFILE := $(JDK_TOPDIR)/make/mapfiles/launchers/mapfile-$(OPENJDK_TARGET_CPU)
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   154
    else
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   155
      $1_MAPFILE :=
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   156
    endif
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   157
  endif
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   158
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   159
  $(call SetupNativeCompilation,BUILD_LAUNCHER_$1, \
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   160
      SRC := $(LAUNCHER_SRC), \
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   161
      INCLUDE_FILES := main.c, \
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   162
      OPTIMIZATION := $$($1_OPTIMIZATION_ARG), \
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   163
      CFLAGS := $$($1_CFLAGS) \
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   164
          $(LAUNCHER_CFLAGS) \
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   165
          -DFULL_VERSION='"$(FULL_VERSION)"' \
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   166
          -DJDK_MAJOR_VERSION='"$(JDK_MAJOR_VERSION)"' \
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   167
          -DJDK_MINOR_VERSION='"$(JDK_MINOR_VERSION)"' \
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   168
          -DLAUNCHER_NAME='"$(LAUNCHER_NAME)"' \
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   169
          -DPROGNAME='"$1"' $(DPACKAGEPATH) \
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   170
          $2, \
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   171
      CFLAGS_linux := -fPIC, \
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   172
      CFLAGS_solaris := -KPIC -DHAVE_GETHRTIME, \
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   173
      LDFLAGS := $(LDFLAGS_JDKEXE) \
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   174
          $(ORIGIN_ARG) \
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   175
          $$($1_LDFLAGS), \
33406
4680f7495292 8140661: Rename LDFLAGS_SUFFIX to LIBS
ihse
parents: 32515
diff changeset
   176
      LDFLAGS_linux := \
4680f7495292 8140661: Rename LDFLAGS_SUFFIX to LIBS
ihse
parents: 32515
diff changeset
   177
          $(call SET_SHARED_LIBRARY_NAME,$(LIBRARY_PREFIX)$(SHARED_LIBRARY_SUFFIX)) \
4680f7495292 8140661: Rename LDFLAGS_SUFFIX to LIBS
ihse
parents: 32515
diff changeset
   178
          -L$(SUPPORT_OUTPUTDIR)/modules_libs/java.base$(OPENJDK_TARGET_CPU_LIBDIR)/jli, \
25859
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   179
      LDFLAGS_macosx := $(call SET_SHARED_LIBRARY_NAME,$1), \
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   180
      LDFLAGS_solaris := $$($1_LDFLAGS_solaris) \
33406
4680f7495292 8140661: Rename LDFLAGS_SUFFIX to LIBS
ihse
parents: 32515
diff changeset
   181
          $(call SET_SHARED_LIBRARY_NAME,$(LIBRARY_PREFIX)$(SHARED_LIBRARY_SUFFIX)) \
4680f7495292 8140661: Rename LDFLAGS_SUFFIX to LIBS
ihse
parents: 32515
diff changeset
   182
          -L$(SUPPORT_OUTPUTDIR)/modules_libs/java.base$(OPENJDK_TARGET_CPU_LIBDIR)/jli, \
25859
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   183
      MAPFILE := $$($1_MAPFILE), \
33406
4680f7495292 8140661: Rename LDFLAGS_SUFFIX to LIBS
ihse
parents: 32515
diff changeset
   184
      LIBS := $(JDKEXE_LIBS) $$($1_LIBS), \
4680f7495292 8140661: Rename LDFLAGS_SUFFIX to LIBS
ihse
parents: 32515
diff changeset
   185
      LIBS_unix := $4, \
4680f7495292 8140661: Rename LDFLAGS_SUFFIX to LIBS
ihse
parents: 32515
diff changeset
   186
      LIBS_linux := -lpthread -ljli $(LIBDL) -lc, \
4680f7495292 8140661: Rename LDFLAGS_SUFFIX to LIBS
ihse
parents: 32515
diff changeset
   187
      LIBS_solaris := -ljli -lthread $(LIBDL) -lc, \
4680f7495292 8140661: Rename LDFLAGS_SUFFIX to LIBS
ihse
parents: 32515
diff changeset
   188
      LIBS_windows := $$($1_WINDOWS_JLI_LIB) \
27565
729f9700483a 8049367: Modular Run-Time Images
chegar
parents: 25859
diff changeset
   189
          $(SUPPORT_OUTPUTDIR)/native/java.base/libjava/java.lib advapi32.lib $5, \
729f9700483a 8049367: Modular Run-Time Images
chegar
parents: 25859
diff changeset
   190
      OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/$1_objs$(OUTPUT_SUBDIR), \
25859
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   191
      OUTPUT_DIR := $$($1_OUTPUT_DIR_ARG)$(OUTPUT_SUBDIR), \
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   192
      PROGRAM := $1, \
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   193
      DEBUG_SYMBOLS := true, \
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   194
      VERSIONINFO_RESOURCE := $$($1_VERSION_INFO_RESOURCE), \
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   195
      RC_FLAGS := $(RC_FLAGS) \
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   196
          -D "JDK_FNAME=$1$(EXE_SUFFIX)" \
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   197
          -D "JDK_INTERNAL_NAME=$1" \
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   198
          -D "JDK_FTYPE=0x1L" \
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   199
          $7, \
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   200
      MANIFEST := $(JAVA_MANIFEST), \
29925
6d47adfc6b47 8077847: Better handling of Windows executable manifest version
ihse
parents: 27953
diff changeset
   201
      MANIFEST_VERSION := $(JDK_VERSION_FOR_MANIFEST), \
6d47adfc6b47 8077847: Better handling of Windows executable manifest version
ihse
parents: 27953
diff changeset
   202
      CODESIGN := $$($1_CODESIGN), \
6d47adfc6b47 8077847: Better handling of Windows executable manifest version
ihse
parents: 27953
diff changeset
   203
  )
25859
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   204
27565
729f9700483a 8049367: Modular Run-Time Images
chegar
parents: 25859
diff changeset
   205
  TARGETS += $$(BUILD_LAUNCHER_$1)
25859
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   206
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   207
  ifneq (,$(filter $(OPENJDK_TARGET_OS), macosx aix))
27565
729f9700483a 8049367: Modular Run-Time Images
chegar
parents: 25859
diff changeset
   208
    $$(BUILD_LAUNCHER_$1): $(SUPPORT_OUTPUTDIR)/native/java.base/libjli_static.a
25859
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   209
  endif
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   210
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   211
  ifeq ($(OPENJDK_TARGET_OS), windows)
27565
729f9700483a 8049367: Modular Run-Time Images
chegar
parents: 25859
diff changeset
   212
    $$(BUILD_LAUNCHER_$1): $(SUPPORT_OUTPUTDIR)/native/java.base/libjava/java.lib \
25859
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   213
        $$($1_WINDOWS_JLI_LIB)
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   214
  endif
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   215
endef
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   216
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   217
##########################################################################################
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   218
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   219
XLIBS := $(X_LIBS) -lX11
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   220
ifeq ($(OPENJDK_TARGET_OS), macosx)
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   221
  DPACKAGEPATH := -DPACKAGE_PATH='"$(PACKAGE_PATH)"'
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   222
  XLIBS :=
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   223
endif
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   224
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   225
JAVA_RC_FLAGS += -i $(JDK_TOPDIR)/src/java.base/windows/native/common
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   226
ifdef OPENJDK
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   227
  JAVA_RC_FLAGS += -i "$(JDK_TOPDIR)/src/java.base/windows/native/launcher/icons"
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   228
else
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   229
  JAVA_RC_FLAGS += -i "$(JDK_TOPDIR)/src/closed/java.base/windows/native/launcher/icons"
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   230
endif