2015-11-24 11:18:25 +00:00
|
|
|
#
|
2018-02-28 20:16:11 +00:00
|
|
|
# Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
|
2015-11-24 11:18:25 +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.
|
|
|
|
#
|
|
|
|
|
2018-03-15 00:20:47 +00:00
|
|
|
include LibCommon.gmk
|
2015-11-24 11:18:25 +00:00
|
|
|
|
2017-10-05 10:41:06 +00:00
|
|
|
$(eval $(call IncludeCustomExtension, hotspot/lib/Lib-jdk.hotspot.agent.gmk))
|
2015-11-24 11:18:25 +00:00
|
|
|
|
|
|
|
################################################################################
|
|
|
|
|
2016-02-12 10:07:46 +00:00
|
|
|
ifneq ($(findstring $(OPENJDK_TARGET_OS), macosx windows), )
|
|
|
|
DISABLE_MAPFILES := true
|
|
|
|
endif
|
|
|
|
|
2017-09-12 17:03:56 +00:00
|
|
|
SA_TOPDIR := $(TOPDIR)/src/jdk.hotspot.agent
|
2015-11-24 11:18:25 +00:00
|
|
|
|
|
|
|
# Defaults for most platforms
|
|
|
|
SA_TOOLCHAIN := TOOLCHAIN_DEFAULT
|
|
|
|
SA_NAME := saproc
|
2015-12-23 10:12:15 +00:00
|
|
|
SA_SRC += $(SA_TOPDIR)/share/native/libsaproc $(SA_TOPDIR)/$(OPENJDK_TARGET_OS)/native/libsaproc
|
2017-09-12 17:03:56 +00:00
|
|
|
SA_MAPFILE := $(TOPDIR)/make/mapfiles/libsaproc/mapfile-$(OPENJDK_TARGET_OS)
|
2015-11-24 11:18:25 +00:00
|
|
|
SA_INCLUDES := \
|
|
|
|
$(addprefix -I, $(SA_SRC)) \
|
|
|
|
-I$(SUPPORT_OUTPUTDIR)/headers/jdk.hotspot.agent \
|
2017-09-12 17:03:56 +00:00
|
|
|
-I$(TOPDIR)/src/hotspot/os/$(OPENJDK_TARGET_OS) \
|
2015-11-24 11:18:25 +00:00
|
|
|
#
|
|
|
|
|
|
|
|
ifeq ($(OPENJDK_TARGET_OS), linux)
|
2018-03-14 10:23:16 +00:00
|
|
|
SA_CFLAGS := $(CFLAGS_JDKLIB) -D_FILE_OFFSET_BITS=64
|
|
|
|
ifeq ($(OPENJDK_TARGET_CPU), x86)
|
|
|
|
SA_LDFLAGS := -march=i586
|
|
|
|
endif
|
|
|
|
|
2015-11-24 11:18:25 +00:00
|
|
|
SA_LIBS := -lthread_db $(LIBDL)
|
|
|
|
|
|
|
|
else ifeq ($(OPENJDK_TARGET_OS), solaris)
|
|
|
|
SA_TOOLCHAIN := TOOLCHAIN_LINK_CXX
|
2016-10-21 09:30:12 +00:00
|
|
|
SA_CFLAGS := $(CFLAGS_JDKLIB)
|
|
|
|
SA_CXXFLAGS := $(CXXFLAGS_JDKLIB)
|
2018-03-14 10:23:16 +00:00
|
|
|
SA_LDFLAGS := -mt $(LDFLAGS_CXX_JDK)
|
2018-03-14 18:12:30 +00:00
|
|
|
SA_LIBS := -ldl -ldemangle -lthread -lproc
|
2015-11-24 11:18:25 +00:00
|
|
|
|
|
|
|
else ifeq ($(OPENJDK_TARGET_OS), macosx)
|
|
|
|
SA_EXCLUDE_FILES := BsdDebuggerLocal.c ps_proc.c salibelf.c StubDebuggerLocal.c
|
|
|
|
SA_CFLAGS := $(CFLAGS_JDKLIB) \
|
|
|
|
-Damd64 -D_GNU_SOURCE -mno-omit-leaf-frame-pointer \
|
2015-11-27 09:37:44 +00:00
|
|
|
-mstack-alignment=16 -fPIC
|
2015-11-24 11:18:25 +00:00
|
|
|
SA_LIBS := -framework Foundation -framework JavaNativeFoundation \
|
2016-10-24 11:51:54 +00:00
|
|
|
-framework JavaRuntimeSupport -framework Security -framework CoreFoundation
|
2015-11-24 11:18:25 +00:00
|
|
|
|
|
|
|
else ifeq ($(OPENJDK_TARGET_OS), windows)
|
|
|
|
SA_NAME := sawindbg
|
2018-03-08 23:28:50 +00:00
|
|
|
COMMON_CFLAGS := -D_WINDOWS -D_DEBUG -D_CONSOLE -D_MBCS -EHsc
|
2015-11-24 11:18:25 +00:00
|
|
|
SA_CFLAGS := $(subst -DWIN32_LEAN_AND_MEAN,, $(CFLAGS_JDKLIB)) \
|
|
|
|
$(COMMON_CFLAGS)
|
|
|
|
SA_CXXFLAGS := $(subst -DWIN32_LEAN_AND_MEAN,, $(CXXFLAGS_JDKLIB)) \
|
|
|
|
$(COMMON_CFLAGS)
|
2018-03-14 10:23:16 +00:00
|
|
|
SA_LDFLAGS := -manifest
|
2015-11-24 11:18:25 +00:00
|
|
|
SA_LIBS := dbgeng.lib
|
|
|
|
ifeq ($(OPENJDK_TARGET_CPU), x86_64)
|
|
|
|
SA_CXXFLAGS += -DWIN64
|
|
|
|
else
|
2016-03-14 11:03:31 +00:00
|
|
|
SA_CXXFLAGS += -RTC1
|
2015-11-24 11:18:25 +00:00
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
|
|
|
################################################################################
|
|
|
|
|
2018-03-15 00:20:47 +00:00
|
|
|
$(eval $(call SetupJdkLibrary, BUILD_LIBSA, \
|
2018-02-28 20:16:11 +00:00
|
|
|
NAME := $(SA_NAME), \
|
2015-11-24 11:18:25 +00:00
|
|
|
TOOLCHAIN := $(SA_TOOLCHAIN), \
|
|
|
|
OPTIMIZATION := NONE, \
|
|
|
|
DISABLED_WARNINGS_microsoft := 4267, \
|
|
|
|
DISABLED_WARNINGS_gcc := sign-compare, \
|
|
|
|
DISABLED_WARNINGS_CXX_solstudio := truncwarn unknownpragma, \
|
|
|
|
SRC := $(SA_SRC), \
|
|
|
|
EXCLUDE_FILES := test.c saproc_audit.cpp $(SA_EXCLUDE_FILES), \
|
|
|
|
CFLAGS := $(SA_INCLUDES) $(SA_CFLAGS) $(SA_CUSTOM_CFLAGS), \
|
|
|
|
CXXFLAGS := $(SA_INCLUDES) $(SA_CXXFLAGS) $(SA_CUSTOM_CXXFLAGS), \
|
2018-03-14 10:23:16 +00:00
|
|
|
LDFLAGS := $(LDFLAGS_JDKLIB) $(SA_LDFLAGS), \
|
2015-11-24 11:18:25 +00:00
|
|
|
LIBS := $(SA_LIBS), \
|
|
|
|
MAPFILE := $(SA_MAPFILE), \
|
|
|
|
))
|
|
|
|
|
|
|
|
TARGETS += $(BUILD_LIBSA)
|
|
|
|
|
|
|
|
################################################################################
|