make/lib/Lib-java.base.gmk
author anazarov
Thu, 05 Apr 2018 17:04:16 -0700
changeset 49538 707553fcca04
parent 49445 b85603908ae4
child 49561 a0f22265e29c
permissions -rw-r--r--
8196750: [Testbug] tools/launcher tests need to tolerate unrelated warnings Reviewed-by: ksrini, dholmes
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
25859
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
     1
#
49252
6628683fde28 8199668: make/lib cleanup
ihse
parents: 47336
diff changeset
     2
# Copyright (c) 2011, 2018, 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 LibCommon.gmk
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    27
47336
6694369ed3f9 8189229: Remove references to $(TOPDIR)/src/*/$(MODULE)
ihse
parents: 47217
diff changeset
    28
# Hook to include the corresponding custom file, if present.
6694369ed3f9 8189229: Remove references to $(TOPDIR)/src/*/$(MODULE)
ihse
parents: 47217
diff changeset
    29
$(eval $(call IncludeCustomExtension, lib/Lib-java.base.gmk))
6694369ed3f9 8189229: Remove references to $(TOPDIR)/src/*/$(MODULE)
ihse
parents: 47217
diff changeset
    30
26192
33b90e93e3bf 8055095: Improve "do nothing" incremental build performance after modularized source code integration
erikj
parents: 25859
diff changeset
    31
# Prepare the find cache.
47336
6694369ed3f9 8189229: Remove references to $(TOPDIR)/src/*/$(MODULE)
ihse
parents: 47217
diff changeset
    32
LIB_java.base_SRC_DIRS += $(TOPDIR)/src/java.base/*/native
6694369ed3f9 8189229: Remove references to $(TOPDIR)/src/*/$(MODULE)
ihse
parents: 47217
diff changeset
    33
6694369ed3f9 8189229: Remove references to $(TOPDIR)/src/*/$(MODULE)
ihse
parents: 47217
diff changeset
    34
$(eval $(call FillCacheFind, $(wildcard $(LIB_java.base_SRC_DIRS))))
26192
33b90e93e3bf 8055095: Improve "do nothing" incremental build performance after modularized source code integration
erikj
parents: 25859
diff changeset
    35
49252
6628683fde28 8199668: make/lib cleanup
ihse
parents: 47336
diff changeset
    36
################################################################################
6628683fde28 8199668: make/lib cleanup
ihse
parents: 47336
diff changeset
    37
# Create all the core libraries
6628683fde28 8199668: make/lib cleanup
ihse
parents: 47336
diff changeset
    38
25859
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    39
include CoreLibraries.gmk
49252
6628683fde28 8199668: make/lib cleanup
ihse
parents: 47336
diff changeset
    40
6628683fde28 8199668: make/lib cleanup
ihse
parents: 47336
diff changeset
    41
################################################################################
6628683fde28 8199668: make/lib cleanup
ihse
parents: 47336
diff changeset
    42
# Create the network library
6628683fde28 8199668: make/lib cleanup
ihse
parents: 47336
diff changeset
    43
6628683fde28 8199668: make/lib cleanup
ihse
parents: 47336
diff changeset
    44
LIBNET_SRC_DIRS := $(call FindSrcDirsForLib, java.base, net)
6628683fde28 8199668: make/lib cleanup
ihse
parents: 47336
diff changeset
    45
6628683fde28 8199668: make/lib cleanup
ihse
parents: 47336
diff changeset
    46
$(eval $(call SetupJdkLibrary, BUILD_LIBNET, \
6628683fde28 8199668: make/lib cleanup
ihse
parents: 47336
diff changeset
    47
    NAME := net, \
6628683fde28 8199668: make/lib cleanup
ihse
parents: 47336
diff changeset
    48
    SRC := $(LIBNET_SRC_DIRS), \
6628683fde28 8199668: make/lib cleanup
ihse
parents: 47336
diff changeset
    49
    OPTIMIZATION := LOW, \
6628683fde28 8199668: make/lib cleanup
ihse
parents: 47336
diff changeset
    50
    CFLAGS := $(CFLAGS_JDKLIB) -I$(SUPPORT_OUTPUTDIR)/headers/java.base \
6628683fde28 8199668: make/lib cleanup
ihse
parents: 47336
diff changeset
    51
        $(LIBJAVA_HEADER_FLAGS) $(addprefix -I, $(LIBNET_SRC_DIRS)), \
6628683fde28 8199668: make/lib cleanup
ihse
parents: 47336
diff changeset
    52
    DISABLED_WARNINGS_gcc := format-nonliteral, \
6628683fde28 8199668: make/lib cleanup
ihse
parents: 47336
diff changeset
    53
    DISABLED_WARNINGS_clang := parentheses-equality constant-logical-operand, \
6628683fde28 8199668: make/lib cleanup
ihse
parents: 47336
diff changeset
    54
    DISABLED_WARNINGS_microsoft := 4244 4047 4133 4996, \
6628683fde28 8199668: make/lib cleanup
ihse
parents: 47336
diff changeset
    55
    DISABLED_WARNINGS_solstudio := E_ARG_INCOMPATIBLE_WITH_ARG_L, \
6628683fde28 8199668: make/lib cleanup
ihse
parents: 47336
diff changeset
    56
    LDFLAGS := $(LDFLAGS_JDKLIB) \
6628683fde28 8199668: make/lib cleanup
ihse
parents: 47336
diff changeset
    57
        $(call SET_SHARED_LIBRARY_ORIGIN), \
6628683fde28 8199668: make/lib cleanup
ihse
parents: 47336
diff changeset
    58
    LDFLAGS_windows := -delayload:secur32.dll -delayload:iphlpapi.dll, \
6628683fde28 8199668: make/lib cleanup
ihse
parents: 47336
diff changeset
    59
    LIBS_unix := -ljvm -ljava, \
6628683fde28 8199668: make/lib cleanup
ihse
parents: 47336
diff changeset
    60
    LIBS_linux := $(LIBDL) -lpthread, \
6628683fde28 8199668: make/lib cleanup
ihse
parents: 47336
diff changeset
    61
    LIBS_solaris := -lnsl -lsocket $(LIBDL), \
6628683fde28 8199668: make/lib cleanup
ihse
parents: 47336
diff changeset
    62
    LIBS_aix := $(LIBDL),\
6628683fde28 8199668: make/lib cleanup
ihse
parents: 47336
diff changeset
    63
    LIBS_windows := ws2_32.lib jvm.lib secur32.lib iphlpapi.lib winhttp.lib \
6628683fde28 8199668: make/lib cleanup
ihse
parents: 47336
diff changeset
    64
        delayimp.lib $(WIN_JAVA_LIB) advapi32.lib, \
6628683fde28 8199668: make/lib cleanup
ihse
parents: 47336
diff changeset
    65
    LIBS_macosx := -framework CoreFoundation -framework CoreServices, \
6628683fde28 8199668: make/lib cleanup
ihse
parents: 47336
diff changeset
    66
))
6628683fde28 8199668: make/lib cleanup
ihse
parents: 47336
diff changeset
    67
6628683fde28 8199668: make/lib cleanup
ihse
parents: 47336
diff changeset
    68
$(BUILD_LIBNET): $(BUILD_LIBJAVA)
6628683fde28 8199668: make/lib cleanup
ihse
parents: 47336
diff changeset
    69
6628683fde28 8199668: make/lib cleanup
ihse
parents: 47336
diff changeset
    70
TARGETS += $(BUILD_LIBNET)
6628683fde28 8199668: make/lib cleanup
ihse
parents: 47336
diff changeset
    71
6628683fde28 8199668: make/lib cleanup
ihse
parents: 47336
diff changeset
    72
################################################################################
6628683fde28 8199668: make/lib cleanup
ihse
parents: 47336
diff changeset
    73
# Create the nio library
6628683fde28 8199668: make/lib cleanup
ihse
parents: 47336
diff changeset
    74
6628683fde28 8199668: make/lib cleanup
ihse
parents: 47336
diff changeset
    75
BUILD_LIBNIO_SRC := \
6628683fde28 8199668: make/lib cleanup
ihse
parents: 47336
diff changeset
    76
    $(TOPDIR)/src/java.base/share/native/libnio \
6628683fde28 8199668: make/lib cleanup
ihse
parents: 47336
diff changeset
    77
    $(TOPDIR)/src/java.base/share/native/libnio/ch \
6628683fde28 8199668: make/lib cleanup
ihse
parents: 47336
diff changeset
    78
    $(TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_TYPE)/native/libnio \
6628683fde28 8199668: make/lib cleanup
ihse
parents: 47336
diff changeset
    79
    $(sort $(wildcard \
6628683fde28 8199668: make/lib cleanup
ihse
parents: 47336
diff changeset
    80
      $(TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_TYPE)/native/libnio/ch \
6628683fde28 8199668: make/lib cleanup
ihse
parents: 47336
diff changeset
    81
      $(TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_TYPE)/native/libnio/fs \
6628683fde28 8199668: make/lib cleanup
ihse
parents: 47336
diff changeset
    82
      $(TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS)/native/libnio/ch \
6628683fde28 8199668: make/lib cleanup
ihse
parents: 47336
diff changeset
    83
      $(TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS)/native/libnio/fs)) \
6628683fde28 8199668: make/lib cleanup
ihse
parents: 47336
diff changeset
    84
    #
6628683fde28 8199668: make/lib cleanup
ihse
parents: 47336
diff changeset
    85
6628683fde28 8199668: make/lib cleanup
ihse
parents: 47336
diff changeset
    86
BUILD_LIBNIO_CFLAGS := \
6628683fde28 8199668: make/lib cleanup
ihse
parents: 47336
diff changeset
    87
    $(addprefix -I, $(BUILD_LIBNIO_SRC)) \
6628683fde28 8199668: make/lib cleanup
ihse
parents: 47336
diff changeset
    88
    -I$(SUPPORT_OUTPUTDIR)/headers/java.base \
6628683fde28 8199668: make/lib cleanup
ihse
parents: 47336
diff changeset
    89
    $(LIBJAVA_HEADER_FLAGS) \
6628683fde28 8199668: make/lib cleanup
ihse
parents: 47336
diff changeset
    90
    $(addprefix -I, $(BUILD_LIBNET_SRC))
6628683fde28 8199668: make/lib cleanup
ihse
parents: 47336
diff changeset
    91
6628683fde28 8199668: make/lib cleanup
ihse
parents: 47336
diff changeset
    92
$(eval $(call SetupJdkLibrary, BUILD_LIBNIO, \
6628683fde28 8199668: make/lib cleanup
ihse
parents: 47336
diff changeset
    93
    NAME := nio, \
6628683fde28 8199668: make/lib cleanup
ihse
parents: 47336
diff changeset
    94
    SRC := $(BUILD_LIBNIO_SRC), \
6628683fde28 8199668: make/lib cleanup
ihse
parents: 47336
diff changeset
    95
    EXCLUDE_FILES := $(BUILD_LIBNIO_EXFILES), \
6628683fde28 8199668: make/lib cleanup
ihse
parents: 47336
diff changeset
    96
    OPTIMIZATION := HIGH, \
6628683fde28 8199668: make/lib cleanup
ihse
parents: 47336
diff changeset
    97
    WARNINGS_AS_ERRORS_xlc := false, \
6628683fde28 8199668: make/lib cleanup
ihse
parents: 47336
diff changeset
    98
    CFLAGS := $(CFLAGS_JDKLIB) \
6628683fde28 8199668: make/lib cleanup
ihse
parents: 47336
diff changeset
    99
        $(BUILD_LIBNIO_CFLAGS), \
6628683fde28 8199668: make/lib cleanup
ihse
parents: 47336
diff changeset
   100
    LDFLAGS := $(LDFLAGS_JDKLIB) \
6628683fde28 8199668: make/lib cleanup
ihse
parents: 47336
diff changeset
   101
        $(call SET_SHARED_LIBRARY_ORIGIN), \
6628683fde28 8199668: make/lib cleanup
ihse
parents: 47336
diff changeset
   102
    LIBS_unix := -ljava -lnet, \
6628683fde28 8199668: make/lib cleanup
ihse
parents: 47336
diff changeset
   103
    LIBS_linux := -lpthread $(LIBDL), \
6628683fde28 8199668: make/lib cleanup
ihse
parents: 47336
diff changeset
   104
    LIBS_solaris := -ljvm -lsocket -lposix4 $(LIBDL) \
6628683fde28 8199668: make/lib cleanup
ihse
parents: 47336
diff changeset
   105
        -lsendfile, \
6628683fde28 8199668: make/lib cleanup
ihse
parents: 47336
diff changeset
   106
    LIBS_aix := $(LIBDL), \
6628683fde28 8199668: make/lib cleanup
ihse
parents: 47336
diff changeset
   107
    LIBS_macosx := \
6628683fde28 8199668: make/lib cleanup
ihse
parents: 47336
diff changeset
   108
        -framework CoreFoundation -framework CoreServices, \
6628683fde28 8199668: make/lib cleanup
ihse
parents: 47336
diff changeset
   109
    LIBS_windows := jvm.lib ws2_32.lib $(WIN_JAVA_LIB) \
6628683fde28 8199668: make/lib cleanup
ihse
parents: 47336
diff changeset
   110
        $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libnet/net.lib \
6628683fde28 8199668: make/lib cleanup
ihse
parents: 47336
diff changeset
   111
        advapi32.lib, \
6628683fde28 8199668: make/lib cleanup
ihse
parents: 47336
diff changeset
   112
))
6628683fde28 8199668: make/lib cleanup
ihse
parents: 47336
diff changeset
   113
6628683fde28 8199668: make/lib cleanup
ihse
parents: 47336
diff changeset
   114
TARGETS += $(BUILD_LIBNIO)
6628683fde28 8199668: make/lib cleanup
ihse
parents: 47336
diff changeset
   115
6628683fde28 8199668: make/lib cleanup
ihse
parents: 47336
diff changeset
   116
$(BUILD_LIBNIO): $(BUILD_LIBNET)
6628683fde28 8199668: make/lib cleanup
ihse
parents: 47336
diff changeset
   117
6628683fde28 8199668: make/lib cleanup
ihse
parents: 47336
diff changeset
   118
################################################################################
6628683fde28 8199668: make/lib cleanup
ihse
parents: 47336
diff changeset
   119
# Create the macosx security library
6628683fde28 8199668: make/lib cleanup
ihse
parents: 47336
diff changeset
   120
6628683fde28 8199668: make/lib cleanup
ihse
parents: 47336
diff changeset
   121
ifeq ($(OPENJDK_TARGET_OS), macosx)
6628683fde28 8199668: make/lib cleanup
ihse
parents: 47336
diff changeset
   122
  # JavaNativeFoundation framework not supported in static builds
6628683fde28 8199668: make/lib cleanup
ihse
parents: 47336
diff changeset
   123
  ifneq ($(STATIC_BUILD), true)
6628683fde28 8199668: make/lib cleanup
ihse
parents: 47336
diff changeset
   124
6628683fde28 8199668: make/lib cleanup
ihse
parents: 47336
diff changeset
   125
    LIBOSXSECURITY_DIRS := $(TOPDIR)/src/java.base/macosx/native/libosxsecurity
6628683fde28 8199668: make/lib cleanup
ihse
parents: 47336
diff changeset
   126
    LIBOSXSECURITY_CFLAGS := -I$(LIBOSXSECURITY_DIRS) \
6628683fde28 8199668: make/lib cleanup
ihse
parents: 47336
diff changeset
   127
        $(LIBJAVA_HEADER_FLAGS) \
6628683fde28 8199668: make/lib cleanup
ihse
parents: 47336
diff changeset
   128
        -I$(SUPPORT_OUTPUTDIR)/headers/java.base \
6628683fde28 8199668: make/lib cleanup
ihse
parents: 47336
diff changeset
   129
6628683fde28 8199668: make/lib cleanup
ihse
parents: 47336
diff changeset
   130
    $(eval $(call SetupJdkLibrary, BUILD_LIBOSXSECURITY, \
6628683fde28 8199668: make/lib cleanup
ihse
parents: 47336
diff changeset
   131
        NAME := osxsecurity, \
6628683fde28 8199668: make/lib cleanup
ihse
parents: 47336
diff changeset
   132
        SRC := $(LIBOSXSECURITY_DIRS), \
6628683fde28 8199668: make/lib cleanup
ihse
parents: 47336
diff changeset
   133
        OPTIMIZATION := LOW, \
6628683fde28 8199668: make/lib cleanup
ihse
parents: 47336
diff changeset
   134
        CFLAGS := $(CFLAGS_JDKLIB) \
6628683fde28 8199668: make/lib cleanup
ihse
parents: 47336
diff changeset
   135
            $(LIBOSXSECURITY_CFLAGS), \
6628683fde28 8199668: make/lib cleanup
ihse
parents: 47336
diff changeset
   136
        DISABLED_WARNINGS_clang := deprecated-declarations, \
6628683fde28 8199668: make/lib cleanup
ihse
parents: 47336
diff changeset
   137
        LDFLAGS := $(LDFLAGS_JDKLIB) \
6628683fde28 8199668: make/lib cleanup
ihse
parents: 47336
diff changeset
   138
            -L$(SUPPORT_OUTPUTDIR)/modules_libs/java.base \
6628683fde28 8199668: make/lib cleanup
ihse
parents: 47336
diff changeset
   139
            $(call SET_SHARED_LIBRARY_ORIGIN) \
6628683fde28 8199668: make/lib cleanup
ihse
parents: 47336
diff changeset
   140
            -fobjc-link-runtime, \
6628683fde28 8199668: make/lib cleanup
ihse
parents: 47336
diff changeset
   141
        LIBS := \
6628683fde28 8199668: make/lib cleanup
ihse
parents: 47336
diff changeset
   142
            -framework JavaNativeFoundation \
6628683fde28 8199668: make/lib cleanup
ihse
parents: 47336
diff changeset
   143
            -framework CoreServices \
6628683fde28 8199668: make/lib cleanup
ihse
parents: 47336
diff changeset
   144
            -framework Security \
6628683fde28 8199668: make/lib cleanup
ihse
parents: 47336
diff changeset
   145
            $(JDKLIB_LIBS), \
6628683fde28 8199668: make/lib cleanup
ihse
parents: 47336
diff changeset
   146
    ))
6628683fde28 8199668: make/lib cleanup
ihse
parents: 47336
diff changeset
   147
6628683fde28 8199668: make/lib cleanup
ihse
parents: 47336
diff changeset
   148
    $(BUILD_LIBOSXSECURITY): $(BUILD_LIBJAVA)
6628683fde28 8199668: make/lib cleanup
ihse
parents: 47336
diff changeset
   149
6628683fde28 8199668: make/lib cleanup
ihse
parents: 47336
diff changeset
   150
    TARGETS += $(BUILD_LIBOSXSECURITY)
6628683fde28 8199668: make/lib cleanup
ihse
parents: 47336
diff changeset
   151
6628683fde28 8199668: make/lib cleanup
ihse
parents: 47336
diff changeset
   152
  endif
6628683fde28 8199668: make/lib cleanup
ihse
parents: 47336
diff changeset
   153
endif
6628683fde28 8199668: make/lib cleanup
ihse
parents: 47336
diff changeset
   154
6628683fde28 8199668: make/lib cleanup
ihse
parents: 47336
diff changeset
   155
################################################################################
49423
fd608d605e2f 8200229: Simplify building of libjsig
ihse
parents: 49252
diff changeset
   156
# Create the jsig library
fd608d605e2f 8200229: Simplify building of libjsig
ihse
parents: 49252
diff changeset
   157
fd608d605e2f 8200229: Simplify building of libjsig
ihse
parents: 49252
diff changeset
   158
ifneq ($(OPENJDK_TARGET_OS), windows)
fd608d605e2f 8200229: Simplify building of libjsig
ihse
parents: 49252
diff changeset
   159
  ifeq ($(STATIC_BUILD), false)
fd608d605e2f 8200229: Simplify building of libjsig
ihse
parents: 49252
diff changeset
   160
fd608d605e2f 8200229: Simplify building of libjsig
ihse
parents: 49252
diff changeset
   161
    LIBJSIG_SRC_DIR := $(TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS)/native/libjsig
49445
b85603908ae4 8200409: jdk11 nightly solaris sparc build failure
erikj
parents: 49440
diff changeset
   162
    LIBJSIG_MAPFILE := $(wildcard $(TOPDIR)/make/mapfiles/libjsig/mapfile-vers-$(OPENJDK_TARGET_OS))
49440
396ea30afbd5 8200178: Remove mapfiles for JDK native libraries
ihse
parents: 49423
diff changeset
   163
396ea30afbd5 8200178: Remove mapfiles for JDK native libraries
ihse
parents: 49423
diff changeset
   164
    ifeq ($(OPENJDK_TARGET_OS), linux)
396ea30afbd5 8200178: Remove mapfiles for JDK native libraries
ihse
parents: 49423
diff changeset
   165
      # FIXME: This is probably not what we want to do, but keep it now for compatibility.
396ea30afbd5 8200178: Remove mapfiles for JDK native libraries
ihse
parents: 49423
diff changeset
   166
      LIBJSIG_CFLAGS := $(EXPORT_ALL_SYMBOLS)
396ea30afbd5 8200178: Remove mapfiles for JDK native libraries
ihse
parents: 49423
diff changeset
   167
    endif
49423
fd608d605e2f 8200229: Simplify building of libjsig
ihse
parents: 49252
diff changeset
   168
fd608d605e2f 8200229: Simplify building of libjsig
ihse
parents: 49252
diff changeset
   169
    $(eval $(call SetupJdkLibrary, BUILD_LIBJSIG, \
fd608d605e2f 8200229: Simplify building of libjsig
ihse
parents: 49252
diff changeset
   170
        NAME := jsig, \
fd608d605e2f 8200229: Simplify building of libjsig
ihse
parents: 49252
diff changeset
   171
        SRC := $(LIBJSIG_SRC_DIR), \
49440
396ea30afbd5 8200178: Remove mapfiles for JDK native libraries
ihse
parents: 49423
diff changeset
   172
        CFLAGS := $(CFLAGS_JDKLIB) $(LIBJSIG_CFLAGS), \
49423
fd608d605e2f 8200229: Simplify building of libjsig
ihse
parents: 49252
diff changeset
   173
        LDFLAGS := $(LDFLAGS_JDKLIB) \
fd608d605e2f 8200229: Simplify building of libjsig
ihse
parents: 49252
diff changeset
   174
            $(call SET_SHARED_LIBRARY_ORIGIN), \
fd608d605e2f 8200229: Simplify building of libjsig
ihse
parents: 49252
diff changeset
   175
        LIBS_linux := $(LIBDL), \
fd608d605e2f 8200229: Simplify building of libjsig
ihse
parents: 49252
diff changeset
   176
        LIBS_solaris := $(LIBDL), \
fd608d605e2f 8200229: Simplify building of libjsig
ihse
parents: 49252
diff changeset
   177
        LIBS_aix := $(LIBDL), \
49445
b85603908ae4 8200409: jdk11 nightly solaris sparc build failure
erikj
parents: 49440
diff changeset
   178
        MAPFILE := $(LIBJSIG_MAPFILE), \
49423
fd608d605e2f 8200229: Simplify building of libjsig
ihse
parents: 49252
diff changeset
   179
    ))
fd608d605e2f 8200229: Simplify building of libjsig
ihse
parents: 49252
diff changeset
   180
fd608d605e2f 8200229: Simplify building of libjsig
ihse
parents: 49252
diff changeset
   181
    TARGETS += $(BUILD_LIBJSIG)
fd608d605e2f 8200229: Simplify building of libjsig
ihse
parents: 49252
diff changeset
   182
fd608d605e2f 8200229: Simplify building of libjsig
ihse
parents: 49252
diff changeset
   183
    ############################################################################
fd608d605e2f 8200229: Simplify building of libjsig
ihse
parents: 49252
diff changeset
   184
    # Create symlinks to libjsig in each JVM variant sub dir
fd608d605e2f 8200229: Simplify building of libjsig
ihse
parents: 49252
diff changeset
   185
    LIB_OUTPUTDIR := $(call FindLibDirForModule, java.base)
fd608d605e2f 8200229: Simplify building of libjsig
ihse
parents: 49252
diff changeset
   186
fd608d605e2f 8200229: Simplify building of libjsig
ihse
parents: 49252
diff changeset
   187
    # $1 variant subdir
fd608d605e2f 8200229: Simplify building of libjsig
ihse
parents: 49252
diff changeset
   188
    define CreateSymlinks
fd608d605e2f 8200229: Simplify building of libjsig
ihse
parents: 49252
diff changeset
   189
      # Always symlink from libdir/variant/libjsig.so -> ../libjsig.so.
fd608d605e2f 8200229: Simplify building of libjsig
ihse
parents: 49252
diff changeset
   190
      $(LIB_OUTPUTDIR)/$1/$(call SHARED_LIBRARY,jsig): \
fd608d605e2f 8200229: Simplify building of libjsig
ihse
parents: 49252
diff changeset
   191
          $(LIB_OUTPUTDIR)/$(call SHARED_LIBRARY,jsig)
fd608d605e2f 8200229: Simplify building of libjsig
ihse
parents: 49252
diff changeset
   192
		$$(call MakeDir, $$(@D))
fd608d605e2f 8200229: Simplify building of libjsig
ihse
parents: 49252
diff changeset
   193
		$(RM) $$@
fd608d605e2f 8200229: Simplify building of libjsig
ihse
parents: 49252
diff changeset
   194
		$(LN) -s ../$$(@F) $$@
fd608d605e2f 8200229: Simplify building of libjsig
ihse
parents: 49252
diff changeset
   195
fd608d605e2f 8200229: Simplify building of libjsig
ihse
parents: 49252
diff changeset
   196
      TARGETS += $(LIB_OUTPUTDIR)/$1/$(call SHARED_LIBRARY,jsig)
fd608d605e2f 8200229: Simplify building of libjsig
ihse
parents: 49252
diff changeset
   197
    endef
fd608d605e2f 8200229: Simplify building of libjsig
ihse
parents: 49252
diff changeset
   198
fd608d605e2f 8200229: Simplify building of libjsig
ihse
parents: 49252
diff changeset
   199
    # The subdir is the same as the variant for client and minimal, for all
fd608d605e2f 8200229: Simplify building of libjsig
ihse
parents: 49252
diff changeset
   200
    # others it's server.
fd608d605e2f 8200229: Simplify building of libjsig
ihse
parents: 49252
diff changeset
   201
    VARIANT_SUBDIRS := $(filter client minimal, $(JVM_VARIANTS)) \
fd608d605e2f 8200229: Simplify building of libjsig
ihse
parents: 49252
diff changeset
   202
        $(if $(filter-out client minimal, $(JVM_VARIANTS)), server)
fd608d605e2f 8200229: Simplify building of libjsig
ihse
parents: 49252
diff changeset
   203
    $(foreach v, $(VARIANT_SUBDIRS), $(eval $(call CreateSymlinks,$v)))
fd608d605e2f 8200229: Simplify building of libjsig
ihse
parents: 49252
diff changeset
   204
fd608d605e2f 8200229: Simplify building of libjsig
ihse
parents: 49252
diff changeset
   205
    ############################################################################
fd608d605e2f 8200229: Simplify building of libjsig
ihse
parents: 49252
diff changeset
   206
fd608d605e2f 8200229: Simplify building of libjsig
ihse
parents: 49252
diff changeset
   207
  endif
fd608d605e2f 8200229: Simplify building of libjsig
ihse
parents: 49252
diff changeset
   208
endif
fd608d605e2f 8200229: Simplify building of libjsig
ihse
parents: 49252
diff changeset
   209
fd608d605e2f 8200229: Simplify building of libjsig
ihse
parents: 49252
diff changeset
   210
################################################################################
49252
6628683fde28 8199668: make/lib cleanup
ihse
parents: 47336
diff changeset
   211
# Create the symbols file for static builds.
33653
c1ee09fe3274 8136556: Add the ability to perform static builds of MacOSX x64 binaries
bobv
parents: 32229
diff changeset
   212
c1ee09fe3274 8136556: Add the ability to perform static builds of MacOSX x64 binaries
bobv
parents: 32229
diff changeset
   213
ifeq ($(STATIC_BUILD), true)
c1ee09fe3274 8136556: Add the ability to perform static builds of MacOSX x64 binaries
bobv
parents: 32229
diff changeset
   214
  JAVA_BASE_EXPORT_SYMBOLS_SRC := \
c1ee09fe3274 8136556: Add the ability to perform static builds of MacOSX x64 binaries
bobv
parents: 32229
diff changeset
   215
      $(SUPPORT_OUTPUTDIR)/modules_libs/java.base/jli/$(LIBRARY_PREFIX)jli.symbols \
c1ee09fe3274 8136556: Add the ability to perform static builds of MacOSX x64 binaries
bobv
parents: 32229
diff changeset
   216
      $(SUPPORT_OUTPUTDIR)/modules_libs/java.base/$(LIBRARY_PREFIX)java.symbols \
c1ee09fe3274 8136556: Add the ability to perform static builds of MacOSX x64 binaries
bobv
parents: 32229
diff changeset
   217
      $(SUPPORT_OUTPUTDIR)/modules_libs/java.base/$(LIBRARY_PREFIX)net.symbols \
c1ee09fe3274 8136556: Add the ability to perform static builds of MacOSX x64 binaries
bobv
parents: 32229
diff changeset
   218
      $(SUPPORT_OUTPUTDIR)/modules_libs/java.base/$(LIBRARY_PREFIX)nio.symbols \
c1ee09fe3274 8136556: Add the ability to perform static builds of MacOSX x64 binaries
bobv
parents: 32229
diff changeset
   219
      $(SUPPORT_OUTPUTDIR)/modules_libs/java.base/$(LIBRARY_PREFIX)verify.symbols \
c1ee09fe3274 8136556: Add the ability to perform static builds of MacOSX x64 binaries
bobv
parents: 32229
diff changeset
   220
      $(SUPPORT_OUTPUTDIR)/modules_libs/java.base/$(LIBRARY_PREFIX)zip.symbols \
c1ee09fe3274 8136556: Add the ability to perform static builds of MacOSX x64 binaries
bobv
parents: 32229
diff changeset
   221
      $(SUPPORT_OUTPUTDIR)/modules_libs/java.base/$(LIBRARY_PREFIX)jimage.symbols \
c1ee09fe3274 8136556: Add the ability to perform static builds of MacOSX x64 binaries
bobv
parents: 32229
diff changeset
   222
      $(SUPPORT_OUTPUTDIR)/modules_libs/java.base/server/$(LIBRARY_PREFIX)jvm.symbols \
c1ee09fe3274 8136556: Add the ability to perform static builds of MacOSX x64 binaries
bobv
parents: 32229
diff changeset
   223
      #
c1ee09fe3274 8136556: Add the ability to perform static builds of MacOSX x64 binaries
bobv
parents: 32229
diff changeset
   224
c1ee09fe3274 8136556: Add the ability to perform static builds of MacOSX x64 binaries
bobv
parents: 32229
diff changeset
   225
  JAVA_BASE_EXPORT_SYMBOL_FILE := $(SUPPORT_OUTPUTDIR)/modules_libs/java.base/java.base.symbols
c1ee09fe3274 8136556: Add the ability to perform static builds of MacOSX x64 binaries
bobv
parents: 32229
diff changeset
   226
c1ee09fe3274 8136556: Add the ability to perform static builds of MacOSX x64 binaries
bobv
parents: 32229
diff changeset
   227
  $(JAVA_BASE_EXPORT_SYMBOL_FILE): $(JAVA_BASE_EXPORT_SYMBOLS_SRC)
35241
075bbb8f2423 8146403: Windows build can be faster
erikj
parents: 33657
diff changeset
   228
	$(call LogInfo, Generating java.base.symbols file)
33653
c1ee09fe3274 8136556: Add the ability to perform static builds of MacOSX x64 binaries
bobv
parents: 32229
diff changeset
   229
	$(CAT) $^ > $@
c1ee09fe3274 8136556: Add the ability to perform static builds of MacOSX x64 binaries
bobv
parents: 32229
diff changeset
   230
c1ee09fe3274 8136556: Add the ability to perform static builds of MacOSX x64 binaries
bobv
parents: 32229
diff changeset
   231
  # The individual symbol files is generated when the respective lib is built
c1ee09fe3274 8136556: Add the ability to perform static builds of MacOSX x64 binaries
bobv
parents: 32229
diff changeset
   232
  $(JAVA_BASE_EXPORT_SYMBOLS_SRC): $(BUILD_LIBJLI) $(BUILD_LIBJAVA) \
33657
71caffb7dba4 8140396: BUILD_LIBJIMAGE missing as a dependency to JAVA_BASE_EXPORT_SYMBOLS_SRC
bobv
parents: 33653
diff changeset
   233
      $(BUILD_LIBNET) $(BUILD_LIBNIO) $(BUILD_LIBVERIFY) $(BUILD_LIBZIP) \
71caffb7dba4 8140396: BUILD_LIBJIMAGE missing as a dependency to JAVA_BASE_EXPORT_SYMBOLS_SRC
bobv
parents: 33653
diff changeset
   234
      $(BUILD_LIBJIMAGE)
33653
c1ee09fe3274 8136556: Add the ability to perform static builds of MacOSX x64 binaries
bobv
parents: 32229
diff changeset
   235
c1ee09fe3274 8136556: Add the ability to perform static builds of MacOSX x64 binaries
bobv
parents: 32229
diff changeset
   236
  TARGETS += $(JAVA_BASE_EXPORT_SYMBOL_FILE)
c1ee09fe3274 8136556: Add the ability to perform static builds of MacOSX x64 binaries
bobv
parents: 32229
diff changeset
   237
endif