2013-10-16 18:24:46 +00:00
|
|
|
#
|
2018-02-28 20:16:11 +00:00
|
|
|
# Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
|
2013-10-16 18:24:46 +00:00
|
|
|
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
|
|
#
|
|
|
|
# This code is free software; you can redistribute it and/or modify it
|
|
|
|
# under the terms of the GNU General Public License version 2 only, as
|
|
|
|
# published by the Free Software Foundation. Oracle designates this
|
|
|
|
# particular file as subject to the "Classpath" exception as provided
|
|
|
|
# by Oracle in the LICENSE file that accompanied this code.
|
|
|
|
#
|
|
|
|
# This code is distributed in the hope that it will be useful, but WITHOUT
|
|
|
|
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
|
|
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
|
|
# version 2 for more details (a copy is included in the LICENSE file that
|
|
|
|
# accompanied this code).
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU General Public License version
|
|
|
|
# 2 along with this work; if not, write to the Free Software Foundation,
|
|
|
|
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
|
|
#
|
|
|
|
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
|
|
|
# or visit www.oracle.com if you need additional information or have any
|
|
|
|
# questions.
|
|
|
|
#
|
|
|
|
|
2014-12-03 14:22:58 +00:00
|
|
|
WIN_VERIFY_LIB := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libverify/verify.lib
|
2013-10-16 18:24:46 +00:00
|
|
|
|
2015-12-11 13:02:41 +00:00
|
|
|
# Hook to include the corresponding custom file, if present.
|
2017-10-05 10:41:06 +00:00
|
|
|
$(eval $(call IncludeCustomExtension, lib/CoreLibraries.gmk))
|
2015-12-11 13:02:41 +00:00
|
|
|
|
|
|
|
|
2013-10-16 18:24:46 +00:00
|
|
|
##########################################################################################
|
2015-03-09 09:39:50 +00:00
|
|
|
# libfdlibm is statically linked with libjava below and not delivered into the
|
2014-08-21 09:05:35 +00:00
|
|
|
# product on its own.
|
2013-10-16 18:24:46 +00:00
|
|
|
|
2016-11-28 16:13:38 +00:00
|
|
|
BUILD_LIBFDLIBM_OPTIMIZATION := NONE
|
2013-10-16 18:24:46 +00:00
|
|
|
|
2016-11-28 16:13:38 +00:00
|
|
|
ifeq ($(OPENJDK_TARGET_OS), solaris)
|
|
|
|
BUILD_LIBFDLIBM_OPTIMIZATION := HIGH
|
|
|
|
endif
|
|
|
|
|
2018-09-17 08:53:56 +00:00
|
|
|
# If FDLIBM_CFLAGS is non-empty we know that we can optimize
|
|
|
|
# fdlibm when adding those extra C flags. Currently GCC,
|
|
|
|
# and clang only.
|
|
|
|
ifneq ($(FDLIBM_CFLAGS), )
|
|
|
|
BUILD_LIBFDLIBM_OPTIMIZATION := LOW
|
2013-10-16 18:24:46 +00:00
|
|
|
endif
|
|
|
|
|
2017-09-12 17:03:56 +00:00
|
|
|
LIBFDLIBM_SRC := $(TOPDIR)/src/java.base/share/native/libfdlibm
|
2018-09-17 08:53:56 +00:00
|
|
|
LIBFDLIBM_CFLAGS := -I$(LIBFDLIBM_SRC) $(FDLIBM_CFLAGS)
|
2014-08-17 14:54:13 +00:00
|
|
|
|
2013-10-16 18:24:46 +00:00
|
|
|
ifneq ($(OPENJDK_TARGET_OS), macosx)
|
2018-02-28 20:16:11 +00:00
|
|
|
$(eval $(call SetupNativeCompilation, BUILD_LIBFDLIBM, \
|
|
|
|
NAME := fdlibm, \
|
|
|
|
TYPE := STATIC_LIBRARY, \
|
2014-12-03 14:22:58 +00:00
|
|
|
OUTPUT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE), \
|
2014-08-17 14:54:13 +00:00
|
|
|
SRC := $(LIBFDLIBM_SRC), \
|
2013-10-16 18:24:46 +00:00
|
|
|
OPTIMIZATION := $(BUILD_LIBFDLIBM_OPTIMIZATION), \
|
2014-08-17 14:54:13 +00:00
|
|
|
CFLAGS := $(CFLAGS_JDKLIB) $(LIBFDLIBM_CFLAGS), \
|
2013-10-16 18:24:46 +00:00
|
|
|
CFLAGS_windows_debug := -DLOGGING, \
|
2013-11-06 01:32:53 +00:00
|
|
|
CFLAGS_aix := -qfloat=nomaf, \
|
2018-09-07 09:24:59 +00:00
|
|
|
DISABLED_WARNINGS_gcc := sign-compare misleading-indentation array-bounds, \
|
2015-03-09 09:39:50 +00:00
|
|
|
DISABLED_WARNINGS_microsoft := 4146 4244 4018, \
|
2013-10-16 18:24:46 +00:00
|
|
|
ARFLAGS := $(ARFLAGS), \
|
2014-12-03 14:22:58 +00:00
|
|
|
OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libfdlibm, \
|
2016-01-20 08:54:13 +00:00
|
|
|
))
|
2013-10-16 18:24:46 +00:00
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
# On macosx the old build does partial (incremental) linking of fdlibm instead of
|
|
|
|
# a plain static library.
|
2018-02-28 20:16:11 +00:00
|
|
|
$(eval $(call SetupNativeCompilation, BUILD_LIBFDLIBM_MAC, \
|
|
|
|
NAME := fdlibm, \
|
2014-12-03 14:22:58 +00:00
|
|
|
OUTPUT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libfdlibm, \
|
2014-08-17 14:54:13 +00:00
|
|
|
SRC := $(LIBFDLIBM_SRC), \
|
|
|
|
CFLAGS := $(CFLAGS_JDKLIB) $(LIBFDLIBM_CFLAGS), \
|
2018-02-06 18:12:05 +00:00
|
|
|
LDFLAGS := -nostdlib $(ARFLAGS), \
|
2014-12-03 14:22:58 +00:00
|
|
|
OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libfdlibm, \
|
2016-01-20 08:54:13 +00:00
|
|
|
))
|
2013-10-16 18:24:46 +00:00
|
|
|
|
2014-12-03 14:22:58 +00:00
|
|
|
BUILD_LIBFDLIBM := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/$(LIBRARY_PREFIX)fdlibm$(STATIC_LIBRARY_SUFFIX)
|
2013-10-16 18:24:46 +00:00
|
|
|
$(BUILD_LIBFDLIBM): $(BUILD_LIBFDLIBM_MAC)
|
|
|
|
$(call install-file)
|
|
|
|
|
|
|
|
endif
|
|
|
|
|
|
|
|
##########################################################################################
|
|
|
|
|
|
|
|
LIBVERIFY_OPTIMIZATION := HIGH
|
|
|
|
ifneq ($(findstring $(OPENJDK_TARGET_OS), solaris linux), )
|
2016-01-20 08:54:13 +00:00
|
|
|
ifeq ($(COMPILE_WITH_DEBUG_SYMBOLS), true)
|
2013-10-16 18:24:46 +00:00
|
|
|
LIBVERIFY_OPTIMIZATION := LOW
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
2018-03-15 00:20:47 +00:00
|
|
|
$(eval $(call SetupJdkLibrary, BUILD_LIBVERIFY, \
|
2018-02-28 20:16:11 +00:00
|
|
|
NAME := verify, \
|
2013-10-16 18:24:46 +00:00
|
|
|
OPTIMIZATION := $(LIBVERIFY_OPTIMIZATION), \
|
|
|
|
CFLAGS := $(CFLAGS_JDKLIB), \
|
2018-02-08 20:01:32 +00:00
|
|
|
DISABLED_WARNINGS_gcc := implicit-fallthrough, \
|
2015-03-09 09:39:50 +00:00
|
|
|
DISABLED_WARNINGS_microsoft := 4244 4267, \
|
2013-10-16 18:24:46 +00:00
|
|
|
LDFLAGS := $(LDFLAGS_JDKLIB) \
|
|
|
|
$(call SET_SHARED_LIBRARY_ORIGIN), \
|
2018-03-14 18:12:30 +00:00
|
|
|
LIBS_unix := -ljvm, \
|
2015-10-29 15:31:00 +00:00
|
|
|
LIBS_windows := jvm.lib, \
|
2016-01-20 08:54:13 +00:00
|
|
|
))
|
2013-10-16 18:24:46 +00:00
|
|
|
|
2014-12-03 14:22:58 +00:00
|
|
|
TARGETS += $(BUILD_LIBVERIFY)
|
2013-10-16 18:24:46 +00:00
|
|
|
|
|
|
|
##########################################################################################
|
|
|
|
|
2018-06-08 16:11:32 +00:00
|
|
|
LIBJAVA_CFLAGS := -DARCHPROPNAME='"$(OPENJDK_TARGET_CPU_OSARCH)"'
|
2013-10-16 18:24:46 +00:00
|
|
|
|
2015-01-26 09:24:25 +00:00
|
|
|
ifeq ($(OPENJDK_TARGET_OS), macosx)
|
2013-10-16 18:24:46 +00:00
|
|
|
BUILD_LIBJAVA_java_props_md.c_CFLAGS := -x objective-c
|
|
|
|
BUILD_LIBJAVA_java_props_macosx.c_CFLAGS := -x objective-c
|
|
|
|
endif
|
|
|
|
|
2018-03-15 00:20:47 +00:00
|
|
|
$(eval $(call SetupJdkLibrary, BUILD_LIBJAVA, \
|
2018-02-28 20:16:11 +00:00
|
|
|
NAME := java, \
|
2013-10-16 18:24:46 +00:00
|
|
|
OPTIMIZATION := HIGH, \
|
|
|
|
CFLAGS := $(CFLAGS_JDKLIB) \
|
|
|
|
$(LIBJAVA_CFLAGS), \
|
2015-06-10 22:23:01 +00:00
|
|
|
System.c_CFLAGS := $(VERSION_CFLAGS), \
|
|
|
|
jdk_util.c_CFLAGS := $(VERSION_CFLAGS), \
|
2018-06-08 16:11:32 +00:00
|
|
|
EXTRA_HEADER_DIRS := libfdlibm, \
|
2016-04-13 09:13:15 +00:00
|
|
|
WARNINGS_AS_ERRORS_xlc := false, \
|
8142968: Module System implementation
Initial integration of JEP 200, JEP 260, JEP 261, and JEP 282
Co-authored-by: Alex Buckley <alex.buckley@oracle.com>
Co-authored-by: Jonathan Gibbons <jonathan.gibbons@oracle.com>
Co-authored-by: Karen Kinnear <karen.kinnear@oracle.com>
Co-authored-by: Mandy Chung <mandy.chung@oracle.com>
Co-authored-by: Mark Reinhold <mark.reinhold@oracle.com>
Co-authored-by: Chris Hegarty <chris.hegarty@oracle.com>
Co-authored-by: Alexandr Scherbatiy <alexandr.scherbatiy@oracle.com>
Co-authored-by: Amy Lu <amy.lu@oracle.com>
Co-authored-by: Calvin Cheung <calvin.cheung@oracle.com>
Co-authored-by: Daniel Fuchs <daniel.fuchs@oracle.com>
Co-authored-by: Erik Joelsson <erik.joelsson@oracle.com>
Co-authored-by: Harold Seigel <harold.seigel@oracle.com>
Co-authored-by: Jaroslav Bachorik <jaroslav.bachorik@oracle.com>
Co-authored-by: Jean-Francois Denise <jean-francois.denise@oracle.com>
Co-authored-by: Jan Lahoda <jan.lahoda@oracle.com>
Co-authored-by: James Laskey <james.laskey@oracle.com>
Co-authored-by: Lois Foltan <lois.foltan@oracle.com>
Co-authored-by: Miroslav Kos <miroslav.kos@oracle.com>
Co-authored-by: Huaming Li <huaming.li@oracle.com>
Co-authored-by: Sean Mullan <sean.mullan@oracle.com>
Co-authored-by: Naoto Sato <naoto.sato@oracle.com>
Co-authored-by: Masayoshi Okutsu <masayoshi.okutsu@oracle.com>
Co-authored-by: Peter Levart <peter.levart@gmail.com>
Co-authored-by: Philip Race <philip.race@oracle.com>
Co-authored-by: Claes Redestad <claes.redestad@oracle.com>
Co-authored-by: Sergey Bylokhov <sergey.bylokhov@oracle.com>
Co-authored-by: Alexandre Iline <alexandre.iline@oracle.com>
Co-authored-by: Volker Simonis <volker.simonis@gmail.com>
Co-authored-by: Staffan Larsen <staffan.larsen@oracle.com>
Co-authored-by: Stuart Marks <stuart.marks@oracle.com>
Co-authored-by: Semyon Sadetsky <semyon.sadetsky@oracle.com>
Co-authored-by: Serguei Spitsyn <serguei.spitsyn@oracle.com>
Co-authored-by: Sundararajan Athijegannathan <sundararajan.athijegannathan@oracle.com>
Co-authored-by: Valerie Peng <valerie.peng@oracle.com>
Co-authored-by: Vincent Ryan <vincent.x.ryan@oracle.com>
Co-authored-by: Weijun Wang <weijun.wang@oracle.com>
Co-authored-by: Yuri Nesterenko <yuri.nesterenko@oracle.com>
Co-authored-by: Yekaterina Kantserova <yekaterina.kantserova@oracle.com>
Co-authored-by: Alexander Kulyakthin <alexander.kulyakhtin@oracle.com>
Co-authored-by: Felix Yang <felix.yang@oracle.com>
Co-authored-by: Andrei Eremeev <andrei.eremeev@oracle.com>
Co-authored-by: Frank Yuan <frank.yuan@oracle.com>
Co-authored-by: Sergei Pikalev <sergei.pikalev@oracle.com>
Co-authored-by: Sibabrata Sahoo <sibabrata.sahoo@oracle.com>
Co-authored-by: Tiantian Du <tiantian.du@oracle.com>
Co-authored-by: Sha Jiang <sha.jiang@oracle.com>
Reviewed-by: alanb, mchung, naoto, rriggs, psandoz, plevart, mullan, ascarpino, vinnie, prr, sherman, dfuchs, mhaupt
2016-03-17 19:04:16 +00:00
|
|
|
DISABLED_WARNINGS_gcc := unused-result, \
|
2015-08-28 08:13:30 +00:00
|
|
|
DISABLED_WARNINGS_solstudio := E_STATEMENT_NOT_REACHED, \
|
2013-10-16 18:24:46 +00:00
|
|
|
LDFLAGS := $(LDFLAGS_JDKLIB) \
|
|
|
|
$(call SET_SHARED_LIBRARY_ORIGIN), \
|
2015-10-29 15:31:00 +00:00
|
|
|
LDFLAGS_macosx := -L$(SUPPORT_OUTPUTDIR)/native/$(MODULE)/, \
|
2018-03-28 21:56:08 +00:00
|
|
|
LDFLAGS_windows := -delayload:shell32.dll, \
|
2015-10-29 15:31:00 +00:00
|
|
|
LIBS_unix := -ljvm -lverify, \
|
|
|
|
LIBS_linux := $(LIBDL) $(BUILD_LIBFDLIBM), \
|
2018-03-14 18:12:30 +00:00
|
|
|
LIBS_solaris := -lsocket -lnsl -lscf $(LIBDL) $(BUILD_LIBFDLIBM), \
|
2016-02-22 10:23:03 +00:00
|
|
|
LIBS_aix := $(LIBDL) $(BUILD_LIBFDLIBM) $(LIBM),\
|
2015-10-29 15:31:00 +00:00
|
|
|
LIBS_macosx := -lfdlibm \
|
2013-10-16 18:24:46 +00:00
|
|
|
-framework CoreFoundation \
|
|
|
|
-framework Foundation \
|
|
|
|
-framework Security -framework SystemConfiguration, \
|
2015-10-29 15:31:00 +00:00
|
|
|
LIBS_windows := jvm.lib $(BUILD_LIBFDLIBM) $(WIN_VERIFY_LIB) \
|
|
|
|
shell32.lib delayimp.lib \
|
2015-06-20 14:03:42 +00:00
|
|
|
advapi32.lib version.lib, \
|
2016-01-20 08:54:13 +00:00
|
|
|
))
|
2013-10-16 18:24:46 +00:00
|
|
|
|
2014-12-03 14:22:58 +00:00
|
|
|
TARGETS += $(BUILD_LIBJAVA)
|
2013-10-16 18:24:46 +00:00
|
|
|
|
|
|
|
$(BUILD_LIBJAVA): $(BUILD_LIBVERIFY)
|
|
|
|
|
|
|
|
$(BUILD_LIBJAVA): $(BUILD_LIBFDLIBM)
|
|
|
|
|
|
|
|
##########################################################################################
|
|
|
|
|
|
|
|
BUILD_LIBZIP_EXCLUDES :=
|
|
|
|
ifeq ($(USE_EXTERNAL_LIBZ), true)
|
2017-02-15 20:11:03 +00:00
|
|
|
LIBZIP_EXCLUDES += zlib
|
2013-10-16 18:24:46 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(LIBZIP_CAN_USE_MMAP), true)
|
|
|
|
BUILD_LIBZIP_MMAP := -DUSE_MMAP
|
|
|
|
endif
|
|
|
|
|
2018-03-15 00:20:47 +00:00
|
|
|
$(eval $(call SetupJdkLibrary, BUILD_LIBZIP, \
|
2018-02-28 20:16:11 +00:00
|
|
|
NAME := zip, \
|
2013-10-16 18:24:46 +00:00
|
|
|
OPTIMIZATION := LOW, \
|
|
|
|
EXCLUDES := $(LIBZIP_EXCLUDES), \
|
|
|
|
CFLAGS := $(CFLAGS_JDKLIB) \
|
2018-06-08 16:11:32 +00:00
|
|
|
$(LIBZ_CFLAGS), \
|
2014-11-21 15:05:11 +00:00
|
|
|
CFLAGS_unix := $(BUILD_LIBZIP_MMAP) -UDEBUG, \
|
2013-10-16 18:24:46 +00:00
|
|
|
LDFLAGS := $(LDFLAGS_JDKLIB) \
|
2015-10-29 15:31:00 +00:00
|
|
|
$(call SET_SHARED_LIBRARY_ORIGIN), \
|
2018-02-06 18:12:05 +00:00
|
|
|
LIBS_unix := -ljvm -ljava $(LIBZ_LIBS), \
|
2015-10-29 15:31:00 +00:00
|
|
|
LIBS_windows := jvm.lib $(WIN_JAVA_LIB), \
|
2016-01-20 08:54:13 +00:00
|
|
|
))
|
2013-10-16 18:24:46 +00:00
|
|
|
|
|
|
|
$(BUILD_LIBZIP): $(BUILD_LIBJAVA)
|
|
|
|
|
2014-12-03 14:22:58 +00:00
|
|
|
TARGETS += $(BUILD_LIBZIP)
|
2014-02-11 09:59:34 +00:00
|
|
|
|
|
|
|
##########################################################################################
|
|
|
|
|
2018-03-15 00:20:47 +00:00
|
|
|
$(eval $(call SetupJdkLibrary, BUILD_LIBJIMAGE, \
|
2018-02-28 20:16:11 +00:00
|
|
|
NAME := jimage, \
|
2016-09-30 07:06:21 +00:00
|
|
|
TOOLCHAIN := TOOLCHAIN_LINK_CXX, \
|
2015-09-04 13:11:43 +00:00
|
|
|
OPTIMIZATION := LOW, \
|
2018-06-08 16:11:32 +00:00
|
|
|
CFLAGS := $(CFLAGS_JDKLIB), \
|
|
|
|
CXXFLAGS := $(CXXFLAGS_JDKLIB), \
|
2015-09-04 13:11:43 +00:00
|
|
|
CFLAGS_unix := -UDEBUG, \
|
2016-10-11 10:25:54 +00:00
|
|
|
LDFLAGS := $(LDFLAGS_JDKLIB) $(LDFLAGS_CXX_JDK) \
|
2015-10-29 15:31:00 +00:00
|
|
|
$(call SET_SHARED_LIBRARY_ORIGIN), \
|
|
|
|
LIBS_unix := -ljvm -ldl $(LIBCXX), \
|
|
|
|
LIBS_macosx := -lc++, \
|
|
|
|
LIBS_windows := jvm.lib, \
|
2016-01-20 08:54:13 +00:00
|
|
|
))
|
2015-09-04 13:11:43 +00:00
|
|
|
|
|
|
|
$(BUILD_LIBJIMAGE): $(BUILD_LIBJAVA)
|
|
|
|
|
|
|
|
TARGETS += $(BUILD_LIBJIMAGE)
|
|
|
|
|
|
|
|
##########################################################################################
|
|
|
|
|
2017-10-15 20:54:03 +00:00
|
|
|
ifeq ($(call check-jvm-variant, zero), true)
|
2013-10-16 18:24:46 +00:00
|
|
|
ERGO_FAMILY := zero
|
|
|
|
else
|
|
|
|
ifeq ($(OPENJDK_TARGET_CPU_ARCH), x86)
|
|
|
|
ERGO_FAMILY := i586
|
|
|
|
else
|
|
|
|
ERGO_FAMILY := $(OPENJDK_TARGET_CPU_ARCH)
|
|
|
|
endif
|
|
|
|
endif
|
2015-01-26 09:24:25 +00:00
|
|
|
LIBJLI_ALL_ERGO := $(wildcard $(addsuffix /ergo_*.c, $(LIBJLI_SRC_DIRS)))
|
|
|
|
LIBJLI_EXCLUDE_ERGO := $(filter-out %/ergo_$(ERGO_FAMILY).c, $(LIBJLI_ALL_ERGO))
|
|
|
|
# If all specialized ergo files are excluded, use generic ergo
|
|
|
|
ifeq ($(LIBJLI_ALL_ERGO), $(LIBJLI_EXCLUDE_ERGO))
|
|
|
|
LIBJLI_CFLAGS += -DUSE_GENERIC_ERGO
|
|
|
|
endif
|
|
|
|
LIBJLI_EXCLUDE_FILES += $(notdir $(LIBJLI_EXCLUDE_ERGO))
|
2013-10-16 18:24:46 +00:00
|
|
|
|
|
|
|
ifeq ($(OPENJDK_TARGET_OS), macosx)
|
2015-04-02 18:54:33 +00:00
|
|
|
LIBJLI_EXCLUDE_FILES += java_md_solinux.c ergo.c ergo_i586.c
|
2013-10-16 18:24:46 +00:00
|
|
|
|
|
|
|
BUILD_LIBJLI_java_md_macosx.c_CFLAGS := -x objective-c
|
|
|
|
BUILD_LIBJLI_STATIC_java_md_macosx.c_CFLAGS := -x objective-c
|
2015-01-26 09:24:25 +00:00
|
|
|
|
|
|
|
LIBJLI_CFLAGS += -DPACKAGE_PATH=\"$(PACKAGE_PATH)\"
|
2013-10-16 18:24:46 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(OPENJDK_TARGET_OS), windows)
|
|
|
|
# Staticically link with c runtime on windows.
|
2018-06-08 16:11:32 +00:00
|
|
|
LIBJLI_CFLAGS_JDKLIB := $(filter-out -MD, $(CFLAGS_JDKLIB))
|
2015-01-26 09:24:25 +00:00
|
|
|
LIBJLI_OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE)
|
2015-01-15 15:52:10 +00:00
|
|
|
# Supply the name of the C runtime lib.
|
|
|
|
LIBJLI_CFLAGS += -DMSVCR_DLL_NAME='"$(notdir $(MSVCR_DLL))"'
|
|
|
|
ifneq ($(MSVCP_DLL), )
|
|
|
|
LIBJLI_CFLAGS += -DMSVCP_DLL_NAME='"$(notdir $(MSVCP_DLL))"'
|
|
|
|
endif
|
2015-01-26 09:24:25 +00:00
|
|
|
else
|
2018-06-08 16:11:32 +00:00
|
|
|
LIBJLI_CFLAGS_JDKLIB := $(CFLAGS_JDKLIB)
|
2015-01-26 09:24:25 +00:00
|
|
|
LIBJLI_OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE)/jli
|
|
|
|
endif
|
2013-10-16 18:24:46 +00:00
|
|
|
|
2018-02-06 18:12:05 +00:00
|
|
|
LIBJLI_CFLAGS += $(LIBZ_CFLAGS)
|
|
|
|
|
2013-10-16 18:24:46 +00:00
|
|
|
ifneq ($(USE_EXTERNAL_LIBZ), true)
|
2015-01-26 09:24:25 +00:00
|
|
|
LIBJLI_EXTRA_FILES += \
|
2017-09-12 17:03:56 +00:00
|
|
|
$(addprefix $(TOPDIR)/src/java.base/share/native/libzip/zlib/, \
|
2015-01-26 09:24:25 +00:00
|
|
|
inflate.c \
|
|
|
|
inftrees.c \
|
|
|
|
inffast.c \
|
|
|
|
zadler32.c \
|
|
|
|
zcrc32.c \
|
|
|
|
zutil.c \
|
|
|
|
)
|
2013-10-16 18:24:46 +00:00
|
|
|
endif
|
|
|
|
|
2018-03-15 00:20:47 +00:00
|
|
|
$(eval $(call SetupJdkLibrary, BUILD_LIBJLI, \
|
2018-02-28 20:16:11 +00:00
|
|
|
NAME := jli, \
|
2013-10-16 18:24:46 +00:00
|
|
|
OUTPUT_DIR := $(LIBJLI_OUTPUT_DIR), \
|
2015-01-26 09:24:25 +00:00
|
|
|
EXCLUDE_FILES := $(LIBJLI_EXCLUDE_FILES), \
|
|
|
|
EXTRA_FILES := $(LIBJLI_EXTRA_FILES), \
|
2013-10-16 18:24:46 +00:00
|
|
|
OPTIMIZATION := HIGH, \
|
2018-06-08 16:11:32 +00:00
|
|
|
CFLAGS := $(LIBJLI_CFLAGS_JDKLIB) $(LIBJLI_CFLAGS), \
|
2015-08-28 08:13:30 +00:00
|
|
|
DISABLED_WARNINGS_solstudio := \
|
|
|
|
E_ASM_DISABLES_OPTIMIZATION \
|
|
|
|
E_STATEMENT_NOT_REACHED, \
|
2013-10-16 18:24:46 +00:00
|
|
|
LDFLAGS := $(LDFLAGS_JDKLIB) \
|
|
|
|
$(call SET_SHARED_LIBRARY_ORIGIN), \
|
|
|
|
LDFLAGS_linux := $(call SET_SHARED_LIBRARY_ORIGIN,/..), \
|
|
|
|
LDFLAGS_solaris := $(call SET_SHARED_LIBRARY_ORIGIN,/..), \
|
2018-02-06 18:12:05 +00:00
|
|
|
LIBS_unix := $(LIBZ_LIBS), \
|
2018-03-14 18:12:30 +00:00
|
|
|
LIBS_linux := $(LIBDL) -lpthread, \
|
|
|
|
LIBS_solaris := $(LIBDL), \
|
2015-10-29 15:31:00 +00:00
|
|
|
LIBS_aix := $(LIBDL),\
|
|
|
|
LIBS_macosx := -framework Cocoa -framework Security -framework ApplicationServices, \
|
|
|
|
LIBS_windows := advapi32.lib comctl32.lib user32.lib, \
|
2016-01-20 08:54:13 +00:00
|
|
|
))
|
2013-10-16 18:24:46 +00:00
|
|
|
|
2014-12-03 14:22:58 +00:00
|
|
|
TARGETS += $(BUILD_LIBJLI)
|
2013-10-16 18:24:46 +00:00
|
|
|
|
2018-06-08 16:11:32 +00:00
|
|
|
LIBJLI_SRC_DIRS := $(call FindSrcDirsForComponent, java.base, libjli)
|
|
|
|
|
2013-10-16 18:24:46 +00:00
|
|
|
# On windows, the static library has the same suffix as the import library created by
|
|
|
|
# with the shared library, so the static library is given a different name. No harm
|
|
|
|
# in doing it for all platform to reduce complexity.
|
|
|
|
ifeq ($(OPENJDK_TARGET_OS), windows)
|
2018-02-28 20:16:11 +00:00
|
|
|
$(eval $(call SetupNativeCompilation, BUILD_LIBJLI_STATIC, \
|
|
|
|
NAME := jli_static, \
|
|
|
|
TYPE := STATIC_LIBRARY, \
|
2014-12-03 14:22:58 +00:00
|
|
|
OUTPUT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE), \
|
2015-01-26 09:24:25 +00:00
|
|
|
SRC := $(LIBJLI_SRC_DIRS), \
|
|
|
|
EXCLUDE_FILES := $(LIBJLI_EXCLUDE_FILES), \
|
|
|
|
EXTRA_FILES := $(LIBJLI_EXTRA_FILES), \
|
2013-10-16 18:24:46 +00:00
|
|
|
OPTIMIZATION := HIGH, \
|
2018-06-08 16:11:32 +00:00
|
|
|
CFLAGS := $(STATIC_LIBRARY_FLAGS) $(LIBJLI_CFLAGS_JDKLIB) $(LIBJLI_CFLAGS) \
|
|
|
|
$(addprefix -I, $(LIBJLI_SRC_DIRS)), \
|
2013-10-16 18:24:46 +00:00
|
|
|
ARFLAGS := $(ARFLAGS), \
|
2014-12-03 14:22:58 +00:00
|
|
|
OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libjli_static, \
|
2016-01-20 08:54:13 +00:00
|
|
|
))
|
2013-10-16 18:24:46 +00:00
|
|
|
|
2014-12-03 14:22:58 +00:00
|
|
|
TARGETS += $(BUILD_LIBJLI_STATIC)
|
2013-10-16 18:24:46 +00:00
|
|
|
|
|
|
|
else ifeq ($(OPENJDK_TARGET_OS), macosx)
|
|
|
|
#
|
|
|
|
# On macosx they do partial (incremental) linking of libjli_static.a
|
|
|
|
# code it here...rather than add support to NativeCompilation
|
|
|
|
# as this is first time I see it
|
2018-02-28 20:16:11 +00:00
|
|
|
$(eval $(call SetupNativeCompilation, BUILD_LIBJLI_STATIC, \
|
|
|
|
NAME := jli_static, \
|
2014-12-03 14:22:58 +00:00
|
|
|
OUTPUT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE), \
|
2015-01-26 09:24:25 +00:00
|
|
|
SRC := $(LIBJLI_SRC_DIRS), \
|
|
|
|
EXCLUDE_FILES := $(LIBJLI_EXCLUDE_FILES), \
|
|
|
|
EXTRA_FILES := $(LIBJLI_EXTRA_FILES), \
|
2013-10-16 18:24:46 +00:00
|
|
|
OPTIMIZATION := HIGH, \
|
2018-06-08 16:11:32 +00:00
|
|
|
CFLAGS := $(LIBJLI_CFLAGS_JDKLIB) $(LIBJLI_CFLAGS) \
|
|
|
|
$(addprefix -I, $(LIBJLI_SRC_DIRS)), \
|
2018-02-06 18:12:05 +00:00
|
|
|
LDFLAGS := -nostdlib $(ARFLAGS), \
|
2014-12-03 14:22:58 +00:00
|
|
|
OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libjli_static, \
|
2016-01-20 08:54:13 +00:00
|
|
|
))
|
2013-10-16 18:24:46 +00:00
|
|
|
|
2015-10-19 17:41:09 +00:00
|
|
|
ifeq ($(STATIC_BUILD), true)
|
|
|
|
TARGETS += $(BUILD_LIBJLI_STATIC)
|
|
|
|
else
|
|
|
|
$(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libjli_static.a: $(BUILD_LIBJLI_STATIC)
|
2013-10-16 18:24:46 +00:00
|
|
|
$(call install-file)
|
|
|
|
|
2015-10-19 17:41:09 +00:00
|
|
|
TARGETS += $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libjli_static.a
|
|
|
|
endif
|
2013-11-08 17:17:06 +00:00
|
|
|
|
|
|
|
else ifeq ($(OPENJDK_TARGET_OS), aix)
|
|
|
|
# AIX also requires a static libjli because the compiler doesn't support '-rpath'
|
2018-02-28 20:16:11 +00:00
|
|
|
$(eval $(call SetupNativeCompilation, BUILD_LIBJLI_STATIC, \
|
|
|
|
NAME := jli_static, \
|
|
|
|
TYPE := STATIC_LIBRARY, \
|
2015-01-26 09:24:25 +00:00
|
|
|
OUTPUT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE), \
|
|
|
|
SRC := $(LIBJLI_SRC_DIRS), \
|
|
|
|
EXCLUDE_FILES := $(LIBJLI_EXCLUDE_FILES), \
|
|
|
|
EXTRA_FILES := $(LIBJLI_EXTRA_FILES), \
|
|
|
|
OPTIMIZATION := HIGH, \
|
2018-06-11 17:09:15 +00:00
|
|
|
CFLAGS := $(STATIC_LIBRARY_FLAGS) $(LIBJLI_CFLAGS_JDKLIB) $(LIBJLI_CFLAGS) \
|
|
|
|
$(addprefix -I, $(LIBJLI_SRC_DIRS)), \
|
2015-01-26 09:24:25 +00:00
|
|
|
ARFLAGS := $(ARFLAGS), \
|
|
|
|
OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libjli_static))
|
2013-11-08 17:17:06 +00:00
|
|
|
|
2014-12-03 14:22:58 +00:00
|
|
|
TARGETS += $(BUILD_LIBJLI_STATIC)
|
2013-11-08 17:17:06 +00:00
|
|
|
|
2013-10-16 18:24:46 +00:00
|
|
|
endif
|