make/lib/CoreLibraries.gmk
author chegar
Thu, 17 Oct 2019 20:54:25 +0100
branchdatagramsocketimpl-branch
changeset 58679 9c3209ff7550
parent 58678 9cf78a70fa4f
parent 58481 48a73ec3a817
permissions -rw-r--r--
datagramsocketimpl-branch: merge with default
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
12317
9670c1610c53 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
     1
#
49070
d7859531621b 8198751: Refactor SetupNativeCompilation to take NAME and TYPE
ihse
parents: 48766
diff changeset
     2
# Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
12317
9670c1610c53 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
     3
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
9670c1610c53 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
     4
#
9670c1610c53 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
     5
# This code is free software; you can redistribute it and/or modify it
9670c1610c53 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
     6
# under the terms of the GNU General Public License version 2 only, as
9670c1610c53 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
     7
# published by the Free Software Foundation.  Oracle designates this
9670c1610c53 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
     8
# particular file as subject to the "Classpath" exception as provided
9670c1610c53 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
     9
# by Oracle in the LICENSE file that accompanied this code.
9670c1610c53 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
    10
#
9670c1610c53 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
    11
# This code is distributed in the hope that it will be useful, but WITHOUT
9670c1610c53 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
    12
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
9670c1610c53 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
    13
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
9670c1610c53 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
    14
# version 2 for more details (a copy is included in the LICENSE file that
9670c1610c53 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
    15
# accompanied this code).
9670c1610c53 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
    16
#
9670c1610c53 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
    17
# You should have received a copy of the GNU General Public License version
9670c1610c53 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
    18
# 2 along with this work; if not, write to the Free Software Foundation,
9670c1610c53 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
    19
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
9670c1610c53 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
    20
#
9670c1610c53 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
    21
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
9670c1610c53 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
    22
# or visit www.oracle.com if you need additional information or have any
9670c1610c53 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
    23
# questions.
9670c1610c53 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
    24
#
9670c1610c53 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
    25
35262
6ffcba13c973 8138677: IllegalAccessException Class sun.usagetracker.UsageTrackerClient$4 (module java.base) can not access a member of class java.lang.management.ManagementFactory (module java.management)
jbachorik
parents: 34014
diff changeset
    26
# Hook to include the corresponding custom file, if present.
47314
743814386712 8188814: Simplify IncludeCustomExtension
ihse
parents: 47217
diff changeset
    27
$(eval $(call IncludeCustomExtension, lib/CoreLibraries.gmk))
35262
6ffcba13c973 8138677: IllegalAccessException Class sun.usagetracker.UsageTrackerClient$4 (module java.base) can not access a member of class java.lang.management.ManagementFactory (module java.management)
jbachorik
parents: 34014
diff changeset
    28
6ffcba13c973 8138677: IllegalAccessException Class sun.usagetracker.UsageTrackerClient$4 (module java.base) can not access a member of class java.lang.management.ManagementFactory (module java.management)
jbachorik
parents: 34014
diff changeset
    29
12317
9670c1610c53 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
    30
##########################################################################################
29374
f031a666744a 8074096: Disable (most) native warnings in JDK on a per-library basis
ihse
parents: 28999
diff changeset
    31
# libfdlibm is statically linked with libjava below and not delivered into the
26191
a0ff4b39d34b 8055188: General cleanup of minor issues from source restructure
erikj
parents: 25859
diff changeset
    32
# product on its own.
12317
9670c1610c53 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
    33
42353
ac0c725825bc 8170153: PPC64/s390x/aarch64: Poor StrictMath performance due to non-optimized compilation
gromero
parents: 41475
diff changeset
    34
BUILD_LIBFDLIBM_OPTIMIZATION := NONE
ac0c725825bc 8170153: PPC64/s390x/aarch64: Poor StrictMath performance due to non-optimized compilation
gromero
parents: 41475
diff changeset
    35
53683
48ff68e2fe5c 8218431: Improved platform checking in makefiles
ihse
parents: 52724
diff changeset
    36
ifeq ($(call isTargetOs, solaris), true)
42353
ac0c725825bc 8170153: PPC64/s390x/aarch64: Poor StrictMath performance due to non-optimized compilation
gromero
parents: 41475
diff changeset
    37
  BUILD_LIBFDLIBM_OPTIMIZATION := HIGH
ac0c725825bc 8170153: PPC64/s390x/aarch64: Poor StrictMath performance due to non-optimized compilation
gromero
parents: 41475
diff changeset
    38
endif
13164
72c5d01a857d 7181504: Update of latest build-infra Makefiles
erikj
parents: 12892
diff changeset
    39
51765
e10ade04afe5 8210416: [linux] Poor StrictMath performance due to non-optimized compilation
sgehwolf
parents: 51669
diff changeset
    40
# If FDLIBM_CFLAGS is non-empty we know that we can optimize
e10ade04afe5 8210416: [linux] Poor StrictMath performance due to non-optimized compilation
sgehwolf
parents: 51669
diff changeset
    41
# fdlibm when adding those extra C flags. Currently GCC,
e10ade04afe5 8210416: [linux] Poor StrictMath performance due to non-optimized compilation
sgehwolf
parents: 51669
diff changeset
    42
# and clang only.
e10ade04afe5 8210416: [linux] Poor StrictMath performance due to non-optimized compilation
sgehwolf
parents: 51669
diff changeset
    43
ifneq ($(FDLIBM_CFLAGS), )
e10ade04afe5 8210416: [linux] Poor StrictMath performance due to non-optimized compilation
sgehwolf
parents: 51669
diff changeset
    44
  BUILD_LIBFDLIBM_OPTIMIZATION := LOW
12892
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents: 12317
diff changeset
    45
endif
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents: 12317
diff changeset
    46
47217
72e3ae9a25eb 8187444: Forest Consolidation: Make build work
erikj
parents: 47216
diff changeset
    47
LIBFDLIBM_SRC := $(TOPDIR)/src/java.base/share/native/libfdlibm
51765
e10ade04afe5 8210416: [linux] Poor StrictMath performance due to non-optimized compilation
sgehwolf
parents: 51669
diff changeset
    48
LIBFDLIBM_CFLAGS := -I$(LIBFDLIBM_SRC) $(FDLIBM_CFLAGS)
25859
3317bb8137f4 8054834: Modular Source Code
chegar
parents: 25086
diff changeset
    49
51783
4482acfef2a5 8210729: Clean up macosx static library handling
ihse
parents: 51765
diff changeset
    50
$(eval $(call SetupNativeCompilation, BUILD_LIBFDLIBM, \
4482acfef2a5 8210729: Clean up macosx static library handling
ihse
parents: 51765
diff changeset
    51
    NAME := fdlibm, \
4482acfef2a5 8210729: Clean up macosx static library handling
ihse
parents: 51765
diff changeset
    52
    TYPE := STATIC_LIBRARY, \
4482acfef2a5 8210729: Clean up macosx static library handling
ihse
parents: 51765
diff changeset
    53
    OUTPUT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE), \
4482acfef2a5 8210729: Clean up macosx static library handling
ihse
parents: 51765
diff changeset
    54
    SRC := $(LIBFDLIBM_SRC), \
4482acfef2a5 8210729: Clean up macosx static library handling
ihse
parents: 51765
diff changeset
    55
    OPTIMIZATION := $(BUILD_LIBFDLIBM_OPTIMIZATION), \
4482acfef2a5 8210729: Clean up macosx static library handling
ihse
parents: 51765
diff changeset
    56
    CFLAGS := $(CFLAGS_JDKLIB) $(LIBFDLIBM_CFLAGS), \
4482acfef2a5 8210729: Clean up macosx static library handling
ihse
parents: 51765
diff changeset
    57
    CFLAGS_windows_debug := -DLOGGING, \
4482acfef2a5 8210729: Clean up macosx static library handling
ihse
parents: 51765
diff changeset
    58
    CFLAGS_aix := -qfloat=nomaf, \
4482acfef2a5 8210729: Clean up macosx static library handling
ihse
parents: 51765
diff changeset
    59
    DISABLED_WARNINGS_gcc := sign-compare misleading-indentation array-bounds, \
51853
ec62d6cab037 8211029: Have a common set of enabled warnings for all native libraries
ihse
parents: 51825
diff changeset
    60
    DISABLED_WARNINGS_clang := sign-compare, \
51783
4482acfef2a5 8210729: Clean up macosx static library handling
ihse
parents: 51765
diff changeset
    61
    DISABLED_WARNINGS_microsoft := 4146 4244 4018, \
4482acfef2a5 8210729: Clean up macosx static library handling
ihse
parents: 51765
diff changeset
    62
    ARFLAGS := $(ARFLAGS), \
4482acfef2a5 8210729: Clean up macosx static library handling
ihse
parents: 51765
diff changeset
    63
    OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libfdlibm, \
4482acfef2a5 8210729: Clean up macosx static library handling
ihse
parents: 51765
diff changeset
    64
))
20890
9d7cc1b4291b 8025715: Split CompileNativeLibraries.gmk
ihse
parents: 20547
diff changeset
    65
12317
9670c1610c53 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
    66
##########################################################################################
9670c1610c53 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
    67
20547
453837141fac 8001931: The new build system whitespace cleanup
ihse
parents: 20203
diff changeset
    68
LIBVERIFY_OPTIMIZATION := HIGH
53683
48ff68e2fe5c 8218431: Improved platform checking in makefiles
ihse
parents: 52724
diff changeset
    69
ifeq ($(call isTargetOs, solaris linux), true)
35276
50b3cdcef339 8145596: Enable debug symbols for all libraries
ihse
parents: 35262
diff changeset
    70
  ifeq ($(COMPILE_WITH_DEBUG_SYMBOLS), true)
20547
453837141fac 8001931: The new build system whitespace cleanup
ihse
parents: 20203
diff changeset
    71
    LIBVERIFY_OPTIMIZATION := LOW
453837141fac 8001931: The new build system whitespace cleanup
ihse
parents: 20203
diff changeset
    72
  endif
13702
efd6a05935b2 7197849: Update new build-infra makefiles
ohair
parents: 13164
diff changeset
    73
endif
efd6a05935b2 7197849: Update new build-infra makefiles
ohair
parents: 13164
diff changeset
    74
49244
995a5556edfa 8199639: Introduce SetupJdkLibrary and SetupJdkExecutable
ihse
parents: 49241
diff changeset
    75
$(eval $(call SetupJdkLibrary, BUILD_LIBVERIFY, \
49070
d7859531621b 8198751: Refactor SetupNativeCompilation to take NAME and TYPE
ihse
parents: 48766
diff changeset
    76
    NAME := verify, \
20547
453837141fac 8001931: The new build system whitespace cleanup
ihse
parents: 20203
diff changeset
    77
    OPTIMIZATION := $(LIBVERIFY_OPTIMIZATION), \
453837141fac 8001931: The new build system whitespace cleanup
ihse
parents: 20203
diff changeset
    78
    CFLAGS := $(CFLAGS_JDKLIB), \
453837141fac 8001931: The new build system whitespace cleanup
ihse
parents: 20203
diff changeset
    79
    LDFLAGS := $(LDFLAGS_JDKLIB) \
453837141fac 8001931: The new build system whitespace cleanup
ihse
parents: 20203
diff changeset
    80
        $(call SET_SHARED_LIBRARY_ORIGIN), \
49241
de4b3a04feae 8199606: Set -lc as global LIBS on solstudio
ihse
parents: 49070
diff changeset
    81
    LIBS_unix := -ljvm, \
33406
4680f7495292 8140661: Rename LDFLAGS_SUFFIX to LIBS
ihse
parents: 32846
diff changeset
    82
    LIBS_windows := jvm.lib, \
35276
50b3cdcef339 8145596: Enable debug symbols for all libraries
ihse
parents: 35262
diff changeset
    83
))
13164
72c5d01a857d 7181504: Update of latest build-infra Makefiles
erikj
parents: 12892
diff changeset
    84
27565
729f9700483a 8049367: Modular Run-Time Images
chegar
parents: 27186
diff changeset
    85
TARGETS += $(BUILD_LIBVERIFY)
12317
9670c1610c53 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
    86
9670c1610c53 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
    87
##########################################################################################
9670c1610c53 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
    88
50471
f0aeede1b855 8204572: SetupJdkLibrary should setup SRC and -I flags automatically
ihse
parents: 50469
diff changeset
    89
LIBJAVA_CFLAGS := -DARCHPROPNAME='"$(OPENJDK_TARGET_CPU_OSARCH)"'
13164
72c5d01a857d 7181504: Update of latest build-infra Makefiles
erikj
parents: 12892
diff changeset
    90
53683
48ff68e2fe5c 8218431: Improved platform checking in makefiles
ihse
parents: 52724
diff changeset
    91
ifeq ($(call isTargetOs, macosx), true)
20547
453837141fac 8001931: The new build system whitespace cleanup
ihse
parents: 20203
diff changeset
    92
  BUILD_LIBJAVA_java_props_md.c_CFLAGS := -x objective-c
453837141fac 8001931: The new build system whitespace cleanup
ihse
parents: 20203
diff changeset
    93
  BUILD_LIBJAVA_java_props_macosx.c_CFLAGS := -x objective-c
13164
72c5d01a857d 7181504: Update of latest build-infra Makefiles
erikj
parents: 12892
diff changeset
    94
endif
72c5d01a857d 7181504: Update of latest build-infra Makefiles
erikj
parents: 12892
diff changeset
    95
49244
995a5556edfa 8199639: Introduce SetupJdkLibrary and SetupJdkExecutable
ihse
parents: 49241
diff changeset
    96
$(eval $(call SetupJdkLibrary, BUILD_LIBJAVA, \
49070
d7859531621b 8198751: Refactor SetupNativeCompilation to take NAME and TYPE
ihse
parents: 48766
diff changeset
    97
    NAME := java, \
20547
453837141fac 8001931: The new build system whitespace cleanup
ihse
parents: 20203
diff changeset
    98
    OPTIMIZATION := HIGH, \
453837141fac 8001931: The new build system whitespace cleanup
ihse
parents: 20203
diff changeset
    99
    CFLAGS := $(CFLAGS_JDKLIB) \
453837141fac 8001931: The new build system whitespace cleanup
ihse
parents: 20203
diff changeset
   100
        $(LIBJAVA_CFLAGS), \
33984
2333676816eb 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents: 30784
diff changeset
   101
    jdk_util.c_CFLAGS := $(VERSION_CFLAGS), \
50471
f0aeede1b855 8204572: SetupJdkLibrary should setup SRC and -I flags automatically
ihse
parents: 50469
diff changeset
   102
    EXTRA_HEADER_DIRS := libfdlibm, \
37529
868c7195632c 8154087: Fix AIX and Linux/ppc64le after the integration of the new hotspot build
simonis
parents: 37525
diff changeset
   103
    WARNINGS_AS_ERRORS_xlc := false, \
51853
ec62d6cab037 8211029: Have a common set of enabled warnings for all native libraries
ihse
parents: 51825
diff changeset
   104
    DISABLED_WARNINGS_gcc := unused-result unused-function, \
32408
97230ec16697 8134408: Disable warnings for jdk libraries triggered by SS12u4
erikj
parents: 32267
diff changeset
   105
    DISABLED_WARNINGS_solstudio := E_STATEMENT_NOT_REACHED, \
20547
453837141fac 8001931: The new build system whitespace cleanup
ihse
parents: 20203
diff changeset
   106
    LDFLAGS := $(LDFLAGS_JDKLIB) \
453837141fac 8001931: The new build system whitespace cleanup
ihse
parents: 20203
diff changeset
   107
        $(call SET_SHARED_LIBRARY_ORIGIN), \
33406
4680f7495292 8140661: Rename LDFLAGS_SUFFIX to LIBS
ihse
parents: 32846
diff changeset
   108
    LDFLAGS_macosx := -L$(SUPPORT_OUTPUTDIR)/native/$(MODULE)/, \
49440
396ea30afbd5 8200178: Remove mapfiles for JDK native libraries
ihse
parents: 49244
diff changeset
   109
    LDFLAGS_windows := -delayload:shell32.dll, \
51783
4482acfef2a5 8210729: Clean up macosx static library handling
ihse
parents: 51765
diff changeset
   110
    LIBS := $(BUILD_LIBFDLIBM_TARGET), \
58481
48a73ec3a817 8230043: Lazily load libverify
redestad
parents: 55169
diff changeset
   111
    LIBS_unix := -ljvm, \
51783
4482acfef2a5 8210729: Clean up macosx static library handling
ihse
parents: 51765
diff changeset
   112
    LIBS_linux := $(LIBDL), \
4482acfef2a5 8210729: Clean up macosx static library handling
ihse
parents: 51765
diff changeset
   113
    LIBS_solaris := -lsocket -lnsl -lscf $(LIBDL), \
4482acfef2a5 8210729: Clean up macosx static library handling
ihse
parents: 51765
diff changeset
   114
    LIBS_aix := $(LIBDL) $(LIBM),\
4482acfef2a5 8210729: Clean up macosx static library handling
ihse
parents: 51765
diff changeset
   115
    LIBS_macosx := -framework CoreFoundation \
20547
453837141fac 8001931: The new build system whitespace cleanup
ihse
parents: 20203
diff changeset
   116
        -framework Foundation \
55169
256a5cbb4439 8223804: [macos] remove obsoleted reference to security framework in launcher code
prr
parents: 54053
diff changeset
   117
        -framework SystemConfiguration, \
58481
48a73ec3a817 8230043: Lazily load libverify
redestad
parents: 55169
diff changeset
   118
    LIBS_windows := jvm.lib \
33406
4680f7495292 8140661: Rename LDFLAGS_SUFFIX to LIBS
ihse
parents: 32846
diff changeset
   119
        shell32.lib delayimp.lib \
31246
dfc58fd4feec 8066504: GetVersionEx in java.base/windows/native/libjava/java_props_md.c might not get correct Windows version 0
rriggs
parents: 30784
diff changeset
   120
        advapi32.lib version.lib, \
35276
50b3cdcef339 8145596: Enable debug symbols for all libraries
ihse
parents: 35262
diff changeset
   121
))
13164
72c5d01a857d 7181504: Update of latest build-infra Makefiles
erikj
parents: 12892
diff changeset
   122
27565
729f9700483a 8049367: Modular Run-Time Images
chegar
parents: 27186
diff changeset
   123
TARGETS += $(BUILD_LIBJAVA)
20547
453837141fac 8001931: The new build system whitespace cleanup
ihse
parents: 20203
diff changeset
   124
453837141fac 8001931: The new build system whitespace cleanup
ihse
parents: 20203
diff changeset
   125
$(BUILD_LIBJAVA): $(BUILD_LIBVERIFY)
453837141fac 8001931: The new build system whitespace cleanup
ihse
parents: 20203
diff changeset
   126
453837141fac 8001931: The new build system whitespace cleanup
ihse
parents: 20203
diff changeset
   127
$(BUILD_LIBJAVA): $(BUILD_LIBFDLIBM)
12317
9670c1610c53 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
   128
9670c1610c53 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
   129
##########################################################################################
9670c1610c53 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
   130
20547
453837141fac 8001931: The new build system whitespace cleanup
ihse
parents: 20203
diff changeset
   131
BUILD_LIBZIP_EXCLUDES :=
453837141fac 8001931: The new build system whitespace cleanup
ihse
parents: 20203
diff changeset
   132
ifeq ($(USE_EXTERNAL_LIBZ), true)
43806
36e9a4583949 8173207: Upgrade compression library
sherman
parents: 43325
diff changeset
   133
  LIBZIP_EXCLUDES += zlib
20547
453837141fac 8001931: The new build system whitespace cleanup
ihse
parents: 20203
diff changeset
   134
endif
453837141fac 8001931: The new build system whitespace cleanup
ihse
parents: 20203
diff changeset
   135
453837141fac 8001931: The new build system whitespace cleanup
ihse
parents: 20203
diff changeset
   136
ifeq ($(LIBZIP_CAN_USE_MMAP), true)
453837141fac 8001931: The new build system whitespace cleanup
ihse
parents: 20203
diff changeset
   137
  BUILD_LIBZIP_MMAP := -DUSE_MMAP
453837141fac 8001931: The new build system whitespace cleanup
ihse
parents: 20203
diff changeset
   138
endif
453837141fac 8001931: The new build system whitespace cleanup
ihse
parents: 20203
diff changeset
   139
49244
995a5556edfa 8199639: Introduce SetupJdkLibrary and SetupJdkExecutable
ihse
parents: 49241
diff changeset
   140
$(eval $(call SetupJdkLibrary, BUILD_LIBZIP, \
49070
d7859531621b 8198751: Refactor SetupNativeCompilation to take NAME and TYPE
ihse
parents: 48766
diff changeset
   141
    NAME := zip, \
20547
453837141fac 8001931: The new build system whitespace cleanup
ihse
parents: 20203
diff changeset
   142
    OPTIMIZATION := LOW, \
453837141fac 8001931: The new build system whitespace cleanup
ihse
parents: 20203
diff changeset
   143
    EXCLUDES := $(LIBZIP_EXCLUDES), \
453837141fac 8001931: The new build system whitespace cleanup
ihse
parents: 20203
diff changeset
   144
    CFLAGS := $(CFLAGS_JDKLIB) \
50471
f0aeede1b855 8204572: SetupJdkLibrary should setup SRC and -I flags automatically
ihse
parents: 50469
diff changeset
   145
        $(LIBZ_CFLAGS), \
27736
8c9bd4be4a86 8058631: Rename posix to unix in build system to match file name changes
ihse
parents: 27186
diff changeset
   146
    CFLAGS_unix := $(BUILD_LIBZIP_MMAP) -UDEBUG, \
51853
ec62d6cab037 8211029: Have a common set of enabled warnings for all native libraries
ihse
parents: 51825
diff changeset
   147
    DISABLED_WARNINGS_gcc := unused-function, \
20547
453837141fac 8001931: The new build system whitespace cleanup
ihse
parents: 20203
diff changeset
   148
    LDFLAGS := $(LDFLAGS_JDKLIB) \
33406
4680f7495292 8140661: Rename LDFLAGS_SUFFIX to LIBS
ihse
parents: 32846
diff changeset
   149
        $(call SET_SHARED_LIBRARY_ORIGIN), \
48751
54f355e65415 8196803: Fix build warnings in jdk libraries with Xcode 9
erikj
parents: 47687
diff changeset
   150
    LIBS_unix := -ljvm -ljava $(LIBZ_LIBS), \
33406
4680f7495292 8140661: Rename LDFLAGS_SUFFIX to LIBS
ihse
parents: 32846
diff changeset
   151
    LIBS_windows := jvm.lib $(WIN_JAVA_LIB), \
35276
50b3cdcef339 8145596: Enable debug symbols for all libraries
ihse
parents: 35262
diff changeset
   152
))
20547
453837141fac 8001931: The new build system whitespace cleanup
ihse
parents: 20203
diff changeset
   153
453837141fac 8001931: The new build system whitespace cleanup
ihse
parents: 20203
diff changeset
   154
$(BUILD_LIBZIP): $(BUILD_LIBJAVA)
453837141fac 8001931: The new build system whitespace cleanup
ihse
parents: 20203
diff changeset
   155
27565
729f9700483a 8049367: Modular Run-Time Images
chegar
parents: 27186
diff changeset
   156
TARGETS += $(BUILD_LIBZIP)
20547
453837141fac 8001931: The new build system whitespace cleanup
ihse
parents: 20203
diff changeset
   157
453837141fac 8001931: The new build system whitespace cleanup
ihse
parents: 20203
diff changeset
   158
##########################################################################################
453837141fac 8001931: The new build system whitespace cleanup
ihse
parents: 20203
diff changeset
   159
49244
995a5556edfa 8199639: Introduce SetupJdkLibrary and SetupJdkExecutable
ihse
parents: 49241
diff changeset
   160
$(eval $(call SetupJdkLibrary, BUILD_LIBJIMAGE, \
49070
d7859531621b 8198751: Refactor SetupNativeCompilation to take NAME and TYPE
ihse
parents: 48766
diff changeset
   161
    NAME := jimage, \
41217
c3bdba3a880a 8160630: libjimage.so and others should link statically to libgcc
erikj
parents: 38783
diff changeset
   162
    TOOLCHAIN := TOOLCHAIN_LINK_CXX, \
32641
ac2c73b45253 8087181: Move native jimage code to its own library (maybe libjimage)
jlaskey
parents: 32267
diff changeset
   163
    OPTIMIZATION := LOW, \
50471
f0aeede1b855 8204572: SetupJdkLibrary should setup SRC and -I flags automatically
ihse
parents: 50469
diff changeset
   164
    CFLAGS := $(CFLAGS_JDKLIB), \
f0aeede1b855 8204572: SetupJdkLibrary should setup SRC and -I flags automatically
ihse
parents: 50469
diff changeset
   165
    CXXFLAGS := $(CXXFLAGS_JDKLIB), \
32641
ac2c73b45253 8087181: Move native jimage code to its own library (maybe libjimage)
jlaskey
parents: 32267
diff changeset
   166
    CFLAGS_unix := -UDEBUG, \
41475
e5ebda6a1a83 8167387: libjimage.so has a bad runpath
erikj
parents: 41368
diff changeset
   167
    LDFLAGS := $(LDFLAGS_JDKLIB) $(LDFLAGS_CXX_JDK) \
33406
4680f7495292 8140661: Rename LDFLAGS_SUFFIX to LIBS
ihse
parents: 32846
diff changeset
   168
        $(call SET_SHARED_LIBRARY_ORIGIN), \
4680f7495292 8140661: Rename LDFLAGS_SUFFIX to LIBS
ihse
parents: 32846
diff changeset
   169
    LIBS_unix := -ljvm -ldl $(LIBCXX), \
4680f7495292 8140661: Rename LDFLAGS_SUFFIX to LIBS
ihse
parents: 32846
diff changeset
   170
    LIBS_macosx := -lc++, \
4680f7495292 8140661: Rename LDFLAGS_SUFFIX to LIBS
ihse
parents: 32846
diff changeset
   171
    LIBS_windows := jvm.lib, \
35276
50b3cdcef339 8145596: Enable debug symbols for all libraries
ihse
parents: 35262
diff changeset
   172
))
32641
ac2c73b45253 8087181: Move native jimage code to its own library (maybe libjimage)
jlaskey
parents: 32267
diff changeset
   173
ac2c73b45253 8087181: Move native jimage code to its own library (maybe libjimage)
jlaskey
parents: 32267
diff changeset
   174
$(BUILD_LIBJIMAGE): $(BUILD_LIBJAVA)
ac2c73b45253 8087181: Move native jimage code to its own library (maybe libjimage)
jlaskey
parents: 32267
diff changeset
   175
ac2c73b45253 8087181: Move native jimage code to its own library (maybe libjimage)
jlaskey
parents: 32267
diff changeset
   176
TARGETS += $(BUILD_LIBJIMAGE)
ac2c73b45253 8087181: Move native jimage code to its own library (maybe libjimage)
jlaskey
parents: 32267
diff changeset
   177
ac2c73b45253 8087181: Move native jimage code to its own library (maybe libjimage)
jlaskey
parents: 32267
diff changeset
   178
##########################################################################################
ac2c73b45253 8087181: Move native jimage code to its own library (maybe libjimage)
jlaskey
parents: 32267
diff changeset
   179
53683
48ff68e2fe5c 8218431: Improved platform checking in makefiles
ihse
parents: 52724
diff changeset
   180
ifeq ($(call isTargetOs, macosx), true)
51825
e3632b4706c4 8210931: JLI and launchers normalization and cleanup
ihse
parents: 51811
diff changeset
   181
  LIBJLI_EXCLUDE_FILES += java_md_solinux.c
20547
453837141fac 8001931: The new build system whitespace cleanup
ihse
parents: 20203
diff changeset
   182
endif
453837141fac 8001931: The new build system whitespace cleanup
ihse
parents: 20203
diff changeset
   183
53683
48ff68e2fe5c 8218431: Improved platform checking in makefiles
ihse
parents: 52724
diff changeset
   184
ifeq ($(call isTargetOs, windows), true)
28984
12031ba2dc38 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 27799
diff changeset
   185
  # Supply the name of the C runtime lib.
12031ba2dc38 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 27799
diff changeset
   186
  LIBJLI_CFLAGS += -DMSVCR_DLL_NAME='"$(notdir $(MSVCR_DLL))"'
12031ba2dc38 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 27799
diff changeset
   187
  ifneq ($(MSVCP_DLL), )
12031ba2dc38 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 27799
diff changeset
   188
    LIBJLI_CFLAGS += -DMSVCP_DLL_NAME='"$(notdir $(MSVCP_DLL))"'
12031ba2dc38 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 27799
diff changeset
   189
  endif
20547
453837141fac 8001931: The new build system whitespace cleanup
ihse
parents: 20203
diff changeset
   190
endif
453837141fac 8001931: The new build system whitespace cleanup
ihse
parents: 20203
diff changeset
   191
48751
54f355e65415 8196803: Fix build warnings in jdk libraries with Xcode 9
erikj
parents: 47687
diff changeset
   192
LIBJLI_CFLAGS += $(LIBZ_CFLAGS)
54f355e65415 8196803: Fix build warnings in jdk libraries with Xcode 9
erikj
parents: 47687
diff changeset
   193
28658
344426303820 8055190: Cleanup include and exclude of core-libs native libraries after source code restructure
erikj
parents: 27799
diff changeset
   194
ifneq ($(USE_EXTERNAL_LIBZ), true)
344426303820 8055190: Cleanup include and exclude of core-libs native libraries after source code restructure
erikj
parents: 27799
diff changeset
   195
  LIBJLI_EXTRA_FILES += \
47217
72e3ae9a25eb 8187444: Forest Consolidation: Make build work
erikj
parents: 47216
diff changeset
   196
      $(addprefix $(TOPDIR)/src/java.base/share/native/libzip/zlib/, \
28658
344426303820 8055190: Cleanup include and exclude of core-libs native libraries after source code restructure
erikj
parents: 27799
diff changeset
   197
          inflate.c \
344426303820 8055190: Cleanup include and exclude of core-libs native libraries after source code restructure
erikj
parents: 27799
diff changeset
   198
          inftrees.c \
344426303820 8055190: Cleanup include and exclude of core-libs native libraries after source code restructure
erikj
parents: 27799
diff changeset
   199
          inffast.c \
344426303820 8055190: Cleanup include and exclude of core-libs native libraries after source code restructure
erikj
parents: 27799
diff changeset
   200
          zadler32.c \
344426303820 8055190: Cleanup include and exclude of core-libs native libraries after source code restructure
erikj
parents: 27799
diff changeset
   201
          zcrc32.c \
344426303820 8055190: Cleanup include and exclude of core-libs native libraries after source code restructure
erikj
parents: 27799
diff changeset
   202
          zutil.c \
344426303820 8055190: Cleanup include and exclude of core-libs native libraries after source code restructure
erikj
parents: 27799
diff changeset
   203
      )
344426303820 8055190: Cleanup include and exclude of core-libs native libraries after source code restructure
erikj
parents: 27799
diff changeset
   204
endif
344426303820 8055190: Cleanup include and exclude of core-libs native libraries after source code restructure
erikj
parents: 27799
diff changeset
   205
49244
995a5556edfa 8199639: Introduce SetupJdkLibrary and SetupJdkExecutable
ihse
parents: 49241
diff changeset
   206
$(eval $(call SetupJdkLibrary, BUILD_LIBJLI, \
49070
d7859531621b 8198751: Refactor SetupNativeCompilation to take NAME and TYPE
ihse
parents: 48766
diff changeset
   207
    NAME := jli, \
51825
e3632b4706c4 8210931: JLI and launchers normalization and cleanup
ihse
parents: 51811
diff changeset
   208
    OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
28658
344426303820 8055190: Cleanup include and exclude of core-libs native libraries after source code restructure
erikj
parents: 27799
diff changeset
   209
    EXCLUDE_FILES := $(LIBJLI_EXCLUDE_FILES), \
344426303820 8055190: Cleanup include and exclude of core-libs native libraries after source code restructure
erikj
parents: 27799
diff changeset
   210
    EXTRA_FILES := $(LIBJLI_EXTRA_FILES), \
20547
453837141fac 8001931: The new build system whitespace cleanup
ihse
parents: 20203
diff changeset
   211
    OPTIMIZATION := HIGH, \
51808
3f32076a43a6 8210919: Remove statically linked libjli on Windows
ihse
parents: 51783
diff changeset
   212
    CFLAGS := $(CFLAGS_JDKLIB) $(LIBJLI_CFLAGS), \
51853
ec62d6cab037 8211029: Have a common set of enabled warnings for all native libraries
ihse
parents: 51825
diff changeset
   213
    DISABLED_WARNINGS_gcc := unused-function, \
ec62d6cab037 8211029: Have a common set of enabled warnings for all native libraries
ihse
parents: 51825
diff changeset
   214
    DISABLED_WARNINGS_clang := sometimes-uninitialized format-nonliteral, \
32408
97230ec16697 8134408: Disable warnings for jdk libraries triggered by SS12u4
erikj
parents: 32267
diff changeset
   215
    DISABLED_WARNINGS_solstudio := \
97230ec16697 8134408: Disable warnings for jdk libraries triggered by SS12u4
erikj
parents: 32267
diff changeset
   216
        E_ASM_DISABLES_OPTIMIZATION \
97230ec16697 8134408: Disable warnings for jdk libraries triggered by SS12u4
erikj
parents: 32267
diff changeset
   217
        E_STATEMENT_NOT_REACHED, \
20547
453837141fac 8001931: The new build system whitespace cleanup
ihse
parents: 20203
diff changeset
   218
    LDFLAGS := $(LDFLAGS_JDKLIB) \
453837141fac 8001931: The new build system whitespace cleanup
ihse
parents: 20203
diff changeset
   219
        $(call SET_SHARED_LIBRARY_ORIGIN), \
48751
54f355e65415 8196803: Fix build warnings in jdk libraries with Xcode 9
erikj
parents: 47687
diff changeset
   220
    LIBS_unix := $(LIBZ_LIBS), \
49241
de4b3a04feae 8199606: Set -lc as global LIBS on solstudio
ihse
parents: 49070
diff changeset
   221
    LIBS_linux := $(LIBDL) -lpthread, \
de4b3a04feae 8199606: Set -lc as global LIBS on solstudio
ihse
parents: 49070
diff changeset
   222
    LIBS_solaris := $(LIBDL), \
33406
4680f7495292 8140661: Rename LDFLAGS_SUFFIX to LIBS
ihse
parents: 32846
diff changeset
   223
    LIBS_aix := $(LIBDL),\
4680f7495292 8140661: Rename LDFLAGS_SUFFIX to LIBS
ihse
parents: 32846
diff changeset
   224
    LIBS_macosx := -framework Cocoa -framework Security -framework ApplicationServices, \
4680f7495292 8140661: Rename LDFLAGS_SUFFIX to LIBS
ihse
parents: 32846
diff changeset
   225
    LIBS_windows := advapi32.lib comctl32.lib user32.lib, \
35276
50b3cdcef339 8145596: Enable debug symbols for all libraries
ihse
parents: 35262
diff changeset
   226
))
20547
453837141fac 8001931: The new build system whitespace cleanup
ihse
parents: 20203
diff changeset
   227
27565
729f9700483a 8049367: Modular Run-Time Images
chegar
parents: 27186
diff changeset
   228
TARGETS += $(BUILD_LIBJLI)
20547
453837141fac 8001931: The new build system whitespace cleanup
ihse
parents: 20203
diff changeset
   229
50471
f0aeede1b855 8204572: SetupJdkLibrary should setup SRC and -I flags automatically
ihse
parents: 50469
diff changeset
   230
LIBJLI_SRC_DIRS := $(call FindSrcDirsForComponent, java.base, libjli)
f0aeede1b855 8204572: SetupJdkLibrary should setup SRC and -I flags automatically
ihse
parents: 50469
diff changeset
   231
53683
48ff68e2fe5c 8218431: Improved platform checking in makefiles
ihse
parents: 52724
diff changeset
   232
ifeq ($(call isTargetOs, aix), true)
22595
aaa6b141196c 8028066: PPC64: 8025715 changes broke AIX build after sync
simonis
parents: 22594
diff changeset
   233
  # AIX also requires a static libjli because the compiler doesn't support '-rpath'
49070
d7859531621b 8198751: Refactor SetupNativeCompilation to take NAME and TYPE
ihse
parents: 48766
diff changeset
   234
  $(eval $(call SetupNativeCompilation, BUILD_LIBJLI_STATIC, \
d7859531621b 8198751: Refactor SetupNativeCompilation to take NAME and TYPE
ihse
parents: 48766
diff changeset
   235
      NAME := jli_static, \
d7859531621b 8198751: Refactor SetupNativeCompilation to take NAME and TYPE
ihse
parents: 48766
diff changeset
   236
      TYPE := STATIC_LIBRARY, \
28658
344426303820 8055190: Cleanup include and exclude of core-libs native libraries after source code restructure
erikj
parents: 27799
diff changeset
   237
      OUTPUT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE), \
344426303820 8055190: Cleanup include and exclude of core-libs native libraries after source code restructure
erikj
parents: 27799
diff changeset
   238
      SRC := $(LIBJLI_SRC_DIRS), \
344426303820 8055190: Cleanup include and exclude of core-libs native libraries after source code restructure
erikj
parents: 27799
diff changeset
   239
      EXCLUDE_FILES := $(LIBJLI_EXCLUDE_FILES), \
344426303820 8055190: Cleanup include and exclude of core-libs native libraries after source code restructure
erikj
parents: 27799
diff changeset
   240
      EXTRA_FILES := $(LIBJLI_EXTRA_FILES), \
344426303820 8055190: Cleanup include and exclude of core-libs native libraries after source code restructure
erikj
parents: 27799
diff changeset
   241
      OPTIMIZATION := HIGH, \
51896
e9d38b28380e 8211097: aix: fix build after JDK-8210919
mdoerr
parents: 51853
diff changeset
   242
      CFLAGS := $(STATIC_LIBRARY_FLAGS) $(CFLAGS_JDKLIB) $(LIBJLI_CFLAGS) \
50506
54fcaffa8fac 8204684: [AIX] Build of libjli_static broken after change 8204572 (SetupJdkLibrary)
simonis
parents: 50471
diff changeset
   243
          $(addprefix -I, $(LIBJLI_SRC_DIRS)), \
28658
344426303820 8055190: Cleanup include and exclude of core-libs native libraries after source code restructure
erikj
parents: 27799
diff changeset
   244
      ARFLAGS := $(ARFLAGS), \
344426303820 8055190: Cleanup include and exclude of core-libs native libraries after source code restructure
erikj
parents: 27799
diff changeset
   245
      OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libjli_static))
22595
aaa6b141196c 8028066: PPC64: 8025715 changes broke AIX build after sync
simonis
parents: 22594
diff changeset
   246
27565
729f9700483a 8049367: Modular Run-Time Images
chegar
parents: 27186
diff changeset
   247
  TARGETS += $(BUILD_LIBJLI_STATIC)
22595
aaa6b141196c 8028066: PPC64: 8025715 changes broke AIX build after sync
simonis
parents: 22594
diff changeset
   248
20547
453837141fac 8001931: The new build system whitespace cleanup
ihse
parents: 20203
diff changeset
   249
endif