2013-10-16 18:24:46 +00:00
|
|
|
#
|
2014-06-16 14:25:11 +00:00
|
|
|
# Copyright (c) 2011, 2014, 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
|
|
|
|
|
|
|
##########################################################################################
|
2014-08-21 09:05:35 +00:00
|
|
|
# libfdlibm is statically linked with libjava below and not delivered into the
|
|
|
|
# product on its own.
|
2013-10-16 18:24:46 +00:00
|
|
|
|
|
|
|
BUILD_LIBFDLIBM_OPTIMIZATION := HIGH
|
|
|
|
|
|
|
|
ifneq ($(OPENJDK_TARGET_OS), solaris)
|
|
|
|
BUILD_LIBFDLIBM_OPTIMIZATION := NONE
|
|
|
|
endif
|
|
|
|
|
2014-08-17 14:54:13 +00:00
|
|
|
LIBFDLIBM_SRC := $(JDK_TOPDIR)/src/java.base/share/native/libfdlibm
|
|
|
|
LIBFDLIBM_CFLAGS := -I$(LIBFDLIBM_SRC)
|
|
|
|
|
2013-10-16 18:24:46 +00:00
|
|
|
ifneq ($(OPENJDK_TARGET_OS), macosx)
|
|
|
|
$(eval $(call SetupNativeCompilation,BUILD_LIBFDLIBM, \
|
|
|
|
STATIC_LIBRARY := fdlibm, \
|
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
|
|
|
LANG := C, \
|
|
|
|
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, \
|
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, \
|
2013-10-16 18:24:46 +00:00
|
|
|
DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
# On macosx the old build does partial (incremental) linking of fdlibm instead of
|
|
|
|
# a plain static library.
|
|
|
|
$(eval $(call SetupNativeCompilation,BUILD_LIBFDLIBM_MAC, \
|
|
|
|
LIBRARY := 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), \
|
2013-10-16 18:24:46 +00:00
|
|
|
LANG := C, \
|
2014-08-17 14:54:13 +00:00
|
|
|
CFLAGS := $(CFLAGS_JDKLIB) $(LIBFDLIBM_CFLAGS), \
|
2013-10-16 18:24:46 +00:00
|
|
|
LDFLAGS := -nostdlib -r -arch x86_64, \
|
2014-12-03 14:22:58 +00:00
|
|
|
OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libfdlibm, \
|
2013-10-16 18:24:46 +00:00
|
|
|
DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
|
|
|
|
|
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
|
|
|
|
|
|
|
|
##########################################################################################
|
|
|
|
|
|
|
|
BUILD_LIBVERIFY_SRC := check_code.c check_format.c
|
|
|
|
|
|
|
|
ifeq ($(OPENJDK_TARGET_OS), solaris)
|
|
|
|
ifneq ($(OPENJDK_TARGET_CPU), x86_64)
|
2013-11-14 10:19:32 +00:00
|
|
|
BUILD_LIBVERIFY_REORDER := $(JDK_TOPDIR)/make/mapfiles/libverify/reorder-$(OPENJDK_TARGET_CPU)
|
2013-10-16 18:24:46 +00:00
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
|
|
|
LIBVERIFY_OPTIMIZATION := HIGH
|
|
|
|
ifneq ($(findstring $(OPENJDK_TARGET_OS), solaris linux), )
|
|
|
|
ifeq ($(ENABLE_DEBUG_SYMBOLS), true)
|
|
|
|
LIBVERIFY_OPTIMIZATION := LOW
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
|
|
|
$(eval $(call SetupNativeCompilation,BUILD_LIBVERIFY, \
|
|
|
|
LIBRARY := verify, \
|
|
|
|
OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
|
2014-08-17 14:54:13 +00:00
|
|
|
SRC := $(JDK_TOPDIR)/src/java.base/share/native/libverify, \
|
2013-10-16 18:24:46 +00:00
|
|
|
LANG := C, \
|
|
|
|
OPTIMIZATION := $(LIBVERIFY_OPTIMIZATION), \
|
|
|
|
CFLAGS := $(CFLAGS_JDKLIB), \
|
2013-11-14 10:19:32 +00:00
|
|
|
MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libverify/mapfile-vers, \
|
2013-10-16 18:24:46 +00:00
|
|
|
LDFLAGS := $(LDFLAGS_JDKLIB) \
|
|
|
|
$(call SET_SHARED_LIBRARY_ORIGIN), \
|
2014-11-21 15:05:11 +00:00
|
|
|
LDFLAGS_SUFFIX_unix := -ljvm -lc, \
|
2013-10-16 18:24:46 +00:00
|
|
|
LDFLAGS_SUFFIX_windows := jvm.lib, \
|
2014-08-17 14:54:13 +00:00
|
|
|
VERSIONINFO_RESOURCE := $(GLOBAL_VERSION_INFO_RESOURCE), \
|
2013-10-16 18:24:46 +00:00
|
|
|
RC_FLAGS := $(RC_FLAGS) \
|
|
|
|
-D "JDK_FNAME=verify.dll" \
|
|
|
|
-D "JDK_INTERNAL_NAME=verify" \
|
|
|
|
-D "JDK_FTYPE=0x2L", \
|
|
|
|
REORDER := $(BUILD_LIBVERIFY_REORDER), \
|
2014-12-03 14:22:58 +00:00
|
|
|
OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libverify, \
|
2013-10-16 18:24:46 +00:00
|
|
|
DEBUG_SYMBOLS := true))
|
|
|
|
|
2014-12-03 14:22:58 +00:00
|
|
|
TARGETS += $(BUILD_LIBVERIFY)
|
2013-10-16 18:24:46 +00:00
|
|
|
|
|
|
|
##########################################################################################
|
|
|
|
|
2014-08-17 14:54:13 +00:00
|
|
|
LIBJAVA_SRC_DIRS := $(call FindSrcDirsForLib, java.base, java)
|
2013-10-16 18:24:46 +00:00
|
|
|
|
2014-08-17 14:54:13 +00:00
|
|
|
ifeq ($(OPENJDK_TARGET_OS), macosx)
|
|
|
|
LIBJAVA_EXCLUDE_FILES += $(JDK_TOPDIR)/src/java.base/unix/native/libjava/HostLocaleProviderAdapter_md.c
|
2013-10-16 18:24:46 +00:00
|
|
|
endif
|
|
|
|
|
2014-08-17 14:54:13 +00:00
|
|
|
LIBJAVA_CFLAGS := $(addprefix -I, $(LIBJAVA_SRC_DIRS)) \
|
|
|
|
-I$(JDK_TOPDIR)/src/java.base/share/native/libfdlibm \
|
2014-12-03 14:22:58 +00:00
|
|
|
-I$(SUPPORT_OUTPUTDIR)/headers/java.base \
|
2013-10-16 18:24:46 +00:00
|
|
|
-DARCHPROPNAME='"$(OPENJDK_TARGET_CPU_OSARCH)"'
|
|
|
|
|
|
|
|
LIBJAVA_CFLAGS += -DJDK_MAJOR_VERSION='"$(JDK_MAJOR_VERSION)"' \
|
|
|
|
-DJDK_MINOR_VERSION='"$(JDK_MINOR_VERSION)"' \
|
|
|
|
-DJDK_MICRO_VERSION='"$(JDK_MICRO_VERSION)"' \
|
|
|
|
-DJDK_BUILD_NUMBER='"$(JDK_BUILD_NUMBER)"'
|
|
|
|
|
|
|
|
ifneq (, $(JDK_UPDATE_VERSION))
|
|
|
|
LIBJAVA_CFLAGS += -DJDK_UPDATE_VERSION='"$(JDK_UPDATE_VERSION)"'
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifneq ($(OPENJDK_TARGET_OS), macosx)
|
|
|
|
LIBJAVA_EXCLUDE_FILES += java_props_macosx.c
|
|
|
|
else
|
|
|
|
BUILD_LIBJAVA_java_props_md.c_CFLAGS := -x objective-c
|
|
|
|
BUILD_LIBJAVA_java_props_macosx.c_CFLAGS := -x objective-c
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(OPENJDK_TARGET_OS), solaris)
|
|
|
|
ifneq ($(OPENJDK_TARGET_CPU), x86_64)
|
2013-11-14 10:19:32 +00:00
|
|
|
LIBJAVA_REORDER := $(JDK_TOPDIR)/make/mapfiles/libjava/reorder-$(OPENJDK_TARGET_CPU)
|
2013-10-16 18:24:46 +00:00
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
|
|
|
$(eval $(call SetupNativeCompilation,BUILD_LIBJAVA, \
|
|
|
|
LIBRARY := java, \
|
|
|
|
OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
|
|
|
|
SRC := $(LIBJAVA_SRC_DIRS), \
|
2014-02-11 09:59:34 +00:00
|
|
|
EXCLUDES := fdlibm/src zip prefs, \
|
2013-10-16 18:24:46 +00:00
|
|
|
EXCLUDE_FILES := $(LIBJAVA_EXCLUDE_FILES), \
|
|
|
|
LANG := C, \
|
|
|
|
OPTIMIZATION := HIGH, \
|
|
|
|
CFLAGS := $(CFLAGS_JDKLIB) \
|
|
|
|
$(LIBJAVA_CFLAGS), \
|
2013-11-14 10:19:32 +00:00
|
|
|
MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libjava/mapfile-vers, \
|
2013-10-16 18:24:46 +00:00
|
|
|
LDFLAGS := $(LDFLAGS_JDKLIB) \
|
|
|
|
$(call SET_SHARED_LIBRARY_ORIGIN), \
|
2014-11-21 15:05:11 +00:00
|
|
|
LDFLAGS_SUFFIX_unix := -ljvm -lverify, \
|
2013-10-16 18:24:46 +00:00
|
|
|
LDFLAGS_SUFFIX_solaris := -lsocket -lnsl -lscf $(LIBDL) $(BUILD_LIBFDLIBM) -lc, \
|
|
|
|
LDFLAGS_SUFFIX_linux := $(LIBDL) $(BUILD_LIBFDLIBM), \
|
2013-11-06 01:32:53 +00:00
|
|
|
LDFLAGS_SUFFIX_aix := $(LIBDL) $(BUILD_LIBFDLIBM) -lm,\
|
2014-12-03 14:22:58 +00:00
|
|
|
LDFLAGS_SUFFIX_macosx := -L$(SUPPORT_OUTPUTDIR)/native/$(MODULE)/ -lfdlibm \
|
2013-10-16 18:24:46 +00:00
|
|
|
-framework CoreFoundation \
|
|
|
|
-framework Foundation \
|
|
|
|
-framework Security -framework SystemConfiguration, \
|
|
|
|
LDFLAGS_SUFFIX_windows := -export:winFileHandleOpen -export:handleLseek \
|
2014-10-09 11:48:12 +00:00
|
|
|
-export:getLastErrorString \
|
2013-10-16 18:24:46 +00:00
|
|
|
jvm.lib $(BUILD_LIBFDLIBM) $(WIN_VERIFY_LIB) \
|
|
|
|
shell32.lib delayimp.lib -DELAYLOAD:shell32.dll \
|
|
|
|
advapi32.lib, \
|
2014-08-17 14:54:13 +00:00
|
|
|
VERSIONINFO_RESOURCE := $(GLOBAL_VERSION_INFO_RESOURCE), \
|
2013-10-16 18:24:46 +00:00
|
|
|
RC_FLAGS := $(RC_FLAGS) \
|
|
|
|
-D "JDK_FNAME=java.dll" \
|
|
|
|
-D "JDK_INTERNAL_NAME=java" \
|
|
|
|
-D "JDK_FTYPE=0x2L", \
|
|
|
|
REORDER := $(LIBJAVA_REORDER), \
|
2014-12-03 14:22:58 +00:00
|
|
|
OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libjava, \
|
2013-10-16 18:24:46 +00:00
|
|
|
DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
|
|
|
|
|
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)
|
2014-06-04 18:25:13 +00:00
|
|
|
LIBZIP_EXCLUDES += zlib-1.2.8
|
2013-10-16 18:24:46 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
BUILD_LIBZIP_REORDER :=
|
|
|
|
ifeq ($(OPENJDK_TARGET_OS), solaris)
|
|
|
|
ifneq ($(OPENJDK_TARGET_CPU), x86_64)
|
2013-11-14 10:19:32 +00:00
|
|
|
BUILD_LIBZIP_REORDER := $(JDK_TOPDIR)/make/mapfiles/libzip/reorder-$(OPENJDK_TARGET_CPU)
|
2013-10-16 18:24:46 +00:00
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(LIBZIP_CAN_USE_MMAP), true)
|
|
|
|
BUILD_LIBZIP_MMAP := -DUSE_MMAP
|
|
|
|
endif
|
|
|
|
|
|
|
|
$(eval $(call SetupNativeCompilation,BUILD_LIBZIP, \
|
|
|
|
LIBRARY := zip, \
|
|
|
|
OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
|
|
|
|
LANG := C, \
|
|
|
|
OPTIMIZATION := LOW, \
|
2014-08-17 14:54:13 +00:00
|
|
|
SRC := $(JDK_TOPDIR)/src/java.base/share/native/libzip, \
|
2013-10-16 18:24:46 +00:00
|
|
|
EXCLUDES := $(LIBZIP_EXCLUDES), \
|
|
|
|
CFLAGS := $(CFLAGS_JDKLIB) \
|
|
|
|
$(ZLIB_CPPFLAGS) \
|
2014-08-17 14:54:13 +00:00
|
|
|
-I$(JDK_TOPDIR)/src/java.base/share/native/libjava \
|
2014-11-21 15:05:11 +00:00
|
|
|
-I$(JDK_TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_TYPE)/native/libjava \
|
2014-12-03 14:22:58 +00:00
|
|
|
-I$(SUPPORT_OUTPUTDIR)/headers/java.base, \
|
2014-11-21 15:05:11 +00:00
|
|
|
CFLAGS_unix := $(BUILD_LIBZIP_MMAP) -UDEBUG, \
|
2013-11-14 10:19:32 +00:00
|
|
|
MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libzip/mapfile-vers, \
|
2013-10-16 18:24:46 +00:00
|
|
|
REORDER := $(BUILD_LIBZIP_REORDER), \
|
|
|
|
LDFLAGS := $(LDFLAGS_JDKLIB) \
|
|
|
|
$(call SET_SHARED_LIBRARY_ORIGIN) \
|
|
|
|
$(EXPORT_ZIP_FUNCS), \
|
|
|
|
LDFLAGS_windows := -export:ZIP_Open -export:ZIP_Close -export:ZIP_FindEntry \
|
2014-12-03 14:22:58 +00:00
|
|
|
-export:ZIP_ReadEntry -export:ZIP_GetNextEntry \
|
|
|
|
-export:ZIP_InflateFully -export:ZIP_CRC32 \
|
|
|
|
jvm.lib $(WIN_JAVA_LIB), \
|
2013-10-16 18:24:46 +00:00
|
|
|
LDFLAGS_SUFFIX_linux := -ljvm -ljava $(LIBZ), \
|
|
|
|
LDFLAGS_SUFFIX_solaris := -ljvm -ljava $(LIBZ) -lc, \
|
2013-11-08 17:17:06 +00:00
|
|
|
LDFLAGS_SUFFIX_aix := -ljvm -ljava $(LIBZ),\
|
2013-10-16 18:24:46 +00:00
|
|
|
LDFLAGS_SUFFIX_macosx := $(LIBZ) -ljava -ljvm, \
|
2014-08-17 14:54:13 +00:00
|
|
|
VERSIONINFO_RESOURCE := $(GLOBAL_VERSION_INFO_RESOURCE), \
|
2013-10-16 18:24:46 +00:00
|
|
|
RC_FLAGS := $(RC_FLAGS) \
|
|
|
|
-D "JDK_FNAME=zip.dll" \
|
|
|
|
-D "JDK_INTERNAL_NAME=zip" \
|
|
|
|
-D "JDK_FTYPE=0x2L", \
|
2014-12-03 14:22:58 +00:00
|
|
|
OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libzip, \
|
2013-10-16 18:24:46 +00:00
|
|
|
DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
|
|
|
|
|
|
|
|
|
|
|
|
$(BUILD_LIBZIP): $(BUILD_LIBJAVA)
|
|
|
|
|
2014-12-03 14:22:58 +00:00
|
|
|
TARGETS += $(BUILD_LIBZIP)
|
2014-02-11 09:59:34 +00:00
|
|
|
|
|
|
|
##########################################################################################
|
|
|
|
|
2014-08-17 14:54:13 +00:00
|
|
|
BUILD_LIBJLI_SRC_DIRS := $(JDK_TOPDIR)/src/java.base/share/native/libjli \
|
2014-11-21 15:05:11 +00:00
|
|
|
$(JDK_TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_TYPE)/native/libjli
|
2013-10-16 18:24:46 +00:00
|
|
|
|
2014-08-17 14:54:13 +00:00
|
|
|
LIBJLI_CFLAGS := $(CFLAGS_JDKLIB)
|
2013-10-16 18:24:46 +00:00
|
|
|
|
|
|
|
BUILD_LIBJLI_FILES := \
|
|
|
|
java.c \
|
|
|
|
splashscreen_stubs.c \
|
|
|
|
parse_manifest.c \
|
|
|
|
version_comp.c \
|
|
|
|
wildcard.c \
|
|
|
|
jli_util.c
|
|
|
|
|
|
|
|
ifeq ($(JVM_VARIANT_ZERO), true)
|
|
|
|
ERGO_FAMILY := zero
|
|
|
|
else
|
|
|
|
ifeq ($(OPENJDK_TARGET_CPU_ARCH), x86)
|
|
|
|
ERGO_FAMILY := i586
|
|
|
|
else
|
|
|
|
ERGO_FAMILY := $(OPENJDK_TARGET_CPU_ARCH)
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(OPENJDK_TARGET_OS), macosx)
|
2014-08-17 14:54:13 +00:00
|
|
|
BUILD_LIBJLI_SRC_DIRS += $(JDK_TOPDIR)/src/java.base/macosx/native/libjli
|
2013-10-16 18:24:46 +00:00
|
|
|
BUILD_LIBJLI_FILES += java_md_common.c java_md_macosx.c
|
|
|
|
|
|
|
|
BUILD_LIBJLI_java_md_macosx.c_CFLAGS := -x objective-c
|
|
|
|
BUILD_LIBJLI_STATIC_java_md_macosx.c_CFLAGS := -x objective-c
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(OPENJDK_TARGET_OS), windows)
|
|
|
|
BUILD_LIBJLI_FILES += java_md.c \
|
|
|
|
cmdtoargs.c
|
|
|
|
# Staticically link with c runtime on windows.
|
|
|
|
LIBJLI_CFLAGS := $(filter-out -MD, $(LIBJLI_CFLAGS))
|
|
|
|
else ifneq ($(OPENJDK_TARGET_OS), macosx)
|
|
|
|
|
|
|
|
BUILD_LIBJLI_FILES += java_md_common.c
|
|
|
|
BUILD_LIBJLI_FILES += java_md_solinux.c ergo.c
|
|
|
|
|
|
|
|
ERGO_ARCH_FILE = ergo_$(ERGO_FAMILY).c
|
|
|
|
|
|
|
|
# if the architecture specific ergo file exists then
|
|
|
|
# use it, else use the generic definitions from ergo.c
|
2014-11-21 15:05:11 +00:00
|
|
|
ifneq ($(wildcard $(JDK_TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_TYPE)/native/libjli/$(ERGO_ARCH_FILE)), )
|
2013-10-16 18:24:46 +00:00
|
|
|
BUILD_LIBJLI_FILES += $(ERGO_ARCH_FILE)
|
|
|
|
else # !ERGO_ARCH_FILE
|
|
|
|
LIBJLI_CFLAGS += -DUSE_GENERIC_ERGO
|
|
|
|
endif # ERGO_ARCH_FILE
|
|
|
|
endif #WINDOWS
|
|
|
|
|
2014-08-17 14:54:13 +00:00
|
|
|
LIBJLI_CFLAGS += $(foreach dir, $(BUILD_LIBJLI_SRC_DIRS), -I$(dir))
|
|
|
|
|
2013-10-16 18:24:46 +00:00
|
|
|
# Append defines depending on target platform
|
|
|
|
LIBJLI_CFLAGS += $(OPENJDK_TARGET_CPU_JLI_CFLAGS)
|
|
|
|
|
|
|
|
ifeq ($(OPENJDK_TARGET_OS), macosx)
|
|
|
|
LIBJLI_CFLAGS += -DPACKAGE_PATH=\"$(PACKAGE_PATH)\"
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifneq ($(USE_EXTERNAL_LIBZ), true)
|
2014-08-17 14:54:13 +00:00
|
|
|
BUILD_LIBJLI_SRC_DIRS += $(JDK_TOPDIR)/src/java.base/share/native/libzip/zlib-1.2.8
|
2013-10-16 18:24:46 +00:00
|
|
|
LIBJLI_CFLAGS += $(ZLIB_CPPFLAGS)
|
|
|
|
BUILD_LIBJLI_FILES += \
|
|
|
|
inflate.c \
|
|
|
|
inftrees.c \
|
|
|
|
inffast.c \
|
|
|
|
zadler32.c \
|
|
|
|
zcrc32.c \
|
|
|
|
zutil.c
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(OPENJDK_TARGET_OS), windows)
|
|
|
|
LIBJLI_OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE)
|
|
|
|
else
|
|
|
|
LIBJLI_OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE)/jli
|
|
|
|
endif
|
|
|
|
|
|
|
|
$(eval $(call SetupNativeCompilation,BUILD_LIBJLI, \
|
|
|
|
LIBRARY := jli, \
|
|
|
|
OUTPUT_DIR := $(LIBJLI_OUTPUT_DIR), \
|
|
|
|
SRC := $(BUILD_LIBJLI_SRC_DIRS), \
|
|
|
|
INCLUDE_FILES := $(BUILD_LIBJLI_FILES), \
|
|
|
|
LANG := C, \
|
|
|
|
OPTIMIZATION := HIGH, \
|
|
|
|
CFLAGS := $(LIBJLI_CFLAGS), \
|
2013-11-14 10:19:32 +00:00
|
|
|
MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libjli/mapfile-vers, \
|
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,/..), \
|
|
|
|
LDFLAGS_macosx := -framework Cocoa -framework Security -framework ApplicationServices, \
|
|
|
|
LDFLAGS_SUFFIX_solaris := $(LIBZ) $(LIBDL) -lc, \
|
2013-11-04 12:39:48 +00:00
|
|
|
LDFLAGS_SUFFIX_linux := $(LIBZ) $(LIBDL) -lc -lpthread, \
|
2013-11-08 17:17:06 +00:00
|
|
|
LDFLAGS_SUFFIX_aix := $(LIBZ) $(LIBDL),\
|
2013-10-16 18:24:46 +00:00
|
|
|
LDFLAGS_SUFFIX_macosx := $(LIBZ), \
|
|
|
|
LDFLAGS_SUFFIX_windows := \
|
|
|
|
-export:JLI_Launch \
|
|
|
|
-export:JLI_ManifestIterate \
|
|
|
|
-export:JLI_SetTraceLauncher \
|
|
|
|
-export:JLI_ReportErrorMessage \
|
|
|
|
-export:JLI_ReportErrorMessageSys \
|
|
|
|
-export:JLI_ReportMessage \
|
|
|
|
-export:JLI_ReportExceptionDescription \
|
|
|
|
-export:JLI_MemAlloc \
|
|
|
|
-export:JLI_CmdToArgs \
|
|
|
|
-export:JLI_GetStdArgc \
|
|
|
|
-export:JLI_GetStdArgs \
|
|
|
|
advapi32.lib \
|
|
|
|
comctl32.lib \
|
|
|
|
user32.lib, \
|
2014-08-17 14:54:13 +00:00
|
|
|
VERSIONINFO_RESOURCE := $(GLOBAL_VERSION_INFO_RESOURCE), \
|
2013-10-16 18:24:46 +00:00
|
|
|
RC_FLAGS := $(RC_FLAGS) \
|
|
|
|
-D "JDK_FNAME=jli.dll" \
|
|
|
|
-D "JDK_INTERNAL_NAME=jli" \
|
|
|
|
-D "JDK_FTYPE=0x2L", \
|
2014-12-03 14:22:58 +00:00
|
|
|
OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libjli, \
|
2013-10-16 18:24:46 +00:00
|
|
|
DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
|
|
|
|
|
2014-12-03 14:22:58 +00:00
|
|
|
TARGETS += $(BUILD_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)
|
|
|
|
$(eval $(call SetupNativeCompilation,BUILD_LIBJLI_STATIC, \
|
|
|
|
STATIC_LIBRARY := jli_static, \
|
2014-12-03 14:22:58 +00:00
|
|
|
OUTPUT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE), \
|
2013-10-16 18:24:46 +00:00
|
|
|
SRC := $(BUILD_LIBJLI_SRC_DIRS), \
|
|
|
|
INCLUDE_FILES := $(BUILD_LIBJLI_FILES), \
|
|
|
|
LANG := C, \
|
|
|
|
OPTIMIZATION := HIGH, \
|
|
|
|
CFLAGS := $(STATIC_LIBRARY_FLAGS) $(LIBJLI_CFLAGS), \
|
|
|
|
ARFLAGS := $(ARFLAGS), \
|
2014-12-03 14:22:58 +00:00
|
|
|
OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libjli_static, \
|
2013-10-16 18:24:46 +00:00
|
|
|
DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
|
|
|
|
|
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
|
|
|
|
$(eval $(call SetupNativeCompilation,BUILD_LIBJLI_STATIC, \
|
|
|
|
LIBRARY := jli_static, \
|
2014-12-03 14:22:58 +00:00
|
|
|
OUTPUT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE), \
|
2013-10-16 18:24:46 +00:00
|
|
|
SRC := $(BUILD_LIBJLI_SRC_DIRS), \
|
|
|
|
INCLUDE_FILES := $(BUILD_LIBJLI_FILES), \
|
|
|
|
LANG := C, \
|
|
|
|
OPTIMIZATION := HIGH, \
|
|
|
|
CFLAGS := $(CFLAGS_JDKLIB) $(LIBJLI_CFLAGS), \
|
|
|
|
LDFLAGS := -nostdlib -r, \
|
2014-12-03 14:22:58 +00:00
|
|
|
OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libjli_static, \
|
2013-10-16 18:24:46 +00:00
|
|
|
DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
|
|
|
|
|
2014-12-03 14:22:58 +00:00
|
|
|
$(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libjli_static.a: $(BUILD_LIBJLI_STATIC)
|
2013-10-16 18:24:46 +00:00
|
|
|
$(call install-file)
|
|
|
|
|
2014-12-03 14:22:58 +00:00
|
|
|
TARGETS += $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libjli_static.a
|
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'
|
|
|
|
$(eval $(call SetupNativeCompilation,BUILD_LIBJLI_STATIC,\
|
|
|
|
STATIC_LIBRARY:=jli_static,\
|
2014-12-03 14:22:58 +00:00
|
|
|
OUTPUT_DIR:=$(SUPPORT_OUTPUTDIR)/native/$(MODULE),\
|
2013-11-08 17:17:06 +00:00
|
|
|
SRC:=$(BUILD_LIBJLI_SRC_DIRS),\
|
|
|
|
INCLUDE_FILES:=$(BUILD_LIBJLI_FILES),\
|
|
|
|
LANG:=C,\
|
|
|
|
OPTIMIZATION:=HIGH, \
|
|
|
|
CFLAGS:=$(STATIC_LIBRARY_FLAGS) $(LIBJLI_CFLAGS),\
|
|
|
|
ARFLAGS:=$(ARFLAGS),\
|
2014-12-03 14:22:58 +00:00
|
|
|
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
|
2014-08-17 14:54:13 +00:00
|
|
|
|