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