make/lib/Lib-jdk.hotspot.agent.gmk
branchihse-jdk-library-branch
changeset 56421 92bea2b7732a
parent 56311 e05b4241302b
parent 49440 396ea30afbd5
child 56433 c3cf838aa2da
--- a/make/lib/Lib-jdk.hotspot.agent.gmk	Thu Mar 15 01:43:29 2018 +0100
+++ b/make/lib/Lib-jdk.hotspot.agent.gmk	Thu Apr 12 14:11:59 2018 +0200
@@ -29,17 +29,13 @@
 
 ################################################################################
 
-ifneq ($(findstring $(OPENJDK_TARGET_OS), macosx windows), )
-  DISABLE_MAPFILES := true
-endif
-
 SA_TOPDIR := $(TOPDIR)/src/jdk.hotspot.agent
 
-# Defaults for most platforms
-SA_TOOLCHAIN := TOOLCHAIN_DEFAULT
-SA_NAME := saproc
-SA_SRC += $(SA_TOPDIR)/share/native/libsaproc $(SA_TOPDIR)/$(OPENJDK_TARGET_OS)/native/libsaproc
-SA_MAPFILE := $(TOPDIR)/make/mapfiles/libsaproc/mapfile-$(OPENJDK_TARGET_OS)
+SA_SRC += \
+    $(SA_TOPDIR)/share/native/libsaproc \
+    $(SA_TOPDIR)/$(OPENJDK_TARGET_OS)/native/libsaproc \
+    #
+
 SA_INCLUDES := \
     $(addprefix -I, $(SA_SRC)) \
     -I$(SUPPORT_OUTPUTDIR)/headers/jdk.hotspot.agent \
@@ -47,60 +43,40 @@
     #
 
 ifeq ($(OPENJDK_TARGET_OS), linux)
-  SA_CFLAGS := $(CFLAGS_JDKLIB) -D_FILE_OFFSET_BITS=64
-  ifeq ($(OPENJDK_TARGET_CPU), x86)
-    SA_LDFLAGS := -march=i586
-  endif
-
-  SA_LIBS := -lthread_db $(LIBDL)
+  SA_CFLAGS := -D_FILE_OFFSET_BITS=64
 
 else ifeq ($(OPENJDK_TARGET_OS), solaris)
-  SA_TOOLCHAIN := TOOLCHAIN_LINK_CXX
-  SA_CFLAGS := $(CFLAGS_JDKLIB)
-  SA_CXXFLAGS := $(CXXFLAGS_JDKLIB)
-  SA_LDFLAGS := -mt $(LDFLAGS_CXX_JDK)
-  SA_LIBS := -ldl -ldemangle -lthread -lproc
+  SA_LDFLAGS := -mt
 
 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 \
+  SA_CFLAGS := -Damd64 -D_GNU_SOURCE -mno-omit-leaf-frame-pointer \
       -mstack-alignment=16 -fPIC
-  SA_LIBS := -framework Foundation -framework JavaNativeFoundation \
-      -framework JavaRuntimeSupport -framework Security -framework CoreFoundation
-
 else ifeq ($(OPENJDK_TARGET_OS), windows)
-  SA_NAME := sawindbg
-  COMMON_CFLAGS := -D_WINDOWS -D_DEBUG -D_CONSOLE -D_MBCS -EHsc
-  SA_CFLAGS := $(subst -DWIN32_LEAN_AND_MEAN,, $(CFLAGS_JDKLIB)) \
-      $(COMMON_CFLAGS)
-  SA_CXXFLAGS := $(subst -DWIN32_LEAN_AND_MEAN,, $(CXXFLAGS_JDKLIB)) \
-      $(COMMON_CFLAGS)
-  SA_LDFLAGS := -manifest
-  SA_LIBS := dbgeng.lib
+  SA_CFLAGS := -D_WINDOWS -D_DEBUG -D_CONSOLE -D_MBCS -EHsc
   ifeq ($(OPENJDK_TARGET_CPU), x86_64)
-    SA_CXXFLAGS += -DWIN64
+    SA_CXXFLAGS := -DWIN64
   else
-    SA_CXXFLAGS += -RTC1
+    SA_CXXFLAGS := -RTC1
   endif
 endif
 
 ################################################################################
 
 $(eval $(call SetupJdkLibrary, BUILD_LIBSA, \
-    NAME := $(SA_NAME), \
-    TOOLCHAIN := $(SA_TOOLCHAIN), \
+    NAME := saproc, \
     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), \
+    CFLAGS := $(CFLAGS_JDKLIB) $(SA_INCLUDES) $(SA_CFLAGS) $(SA_CUSTOM_CFLAGS), \
+    CXXFLAGS := $(CXXFLAGS_JDKLIB) $(SA_INCLUDES) $(SA_CFLAGS) $(SA_CXXFLAGS), \
     LDFLAGS := $(LDFLAGS_JDKLIB) $(SA_LDFLAGS), \
-    LIBS := $(SA_LIBS), \
-    MAPFILE := $(SA_MAPFILE), \
+    LIBS_linux := -lthread_db $(LIBDL), \
+    LIBS_solaris := -ldl -ldemangle -lthread -lproc, \
+    LIBS_macosx := -framework Foundation -framework JavaNativeFoundation \
+        -framework JavaRuntimeSupport -framework Security -framework CoreFoundation, \
+    LIBS_windows := dbgeng.lib, \
 ))
 
 TARGETS += $(BUILD_LIBSA)