author | ihse |
Tue, 15 Dec 2015 11:02:49 +0100 | |
changeset 34610 | 0d0012bed22c |
parent 34312 | b687b05475c6 |
child 35226 | 4aee3c29fc2d |
permissions | -rw-r--r-- |
34289
2d1821a50263
8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff
changeset
|
1 |
# |
2d1821a50263
8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff
changeset
|
2 |
# Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. |
2d1821a50263
8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff
changeset
|
3 |
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
2d1821a50263
8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff
changeset
|
4 |
# |
2d1821a50263
8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff
changeset
|
5 |
# This code is free software; you can redistribute it and/or modify it |
2d1821a50263
8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff
changeset
|
6 |
# under the terms of the GNU General Public License version 2 only, as |
2d1821a50263
8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff
changeset
|
7 |
# published by the Free Software Foundation. Oracle designates this |
2d1821a50263
8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff
changeset
|
8 |
# particular file as subject to the "Classpath" exception as provided |
2d1821a50263
8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff
changeset
|
9 |
# by Oracle in the LICENSE file that accompanied this code. |
2d1821a50263
8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff
changeset
|
10 |
# |
2d1821a50263
8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff
changeset
|
11 |
# This code is distributed in the hope that it will be useful, but WITHOUT |
2d1821a50263
8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff
changeset
|
12 |
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
2d1821a50263
8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff
changeset
|
13 |
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
2d1821a50263
8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff
changeset
|
14 |
# version 2 for more details (a copy is included in the LICENSE file that |
2d1821a50263
8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff
changeset
|
15 |
# accompanied this code). |
2d1821a50263
8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff
changeset
|
16 |
# |
2d1821a50263
8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff
changeset
|
17 |
# You should have received a copy of the GNU General Public License version |
2d1821a50263
8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff
changeset
|
18 |
# 2 along with this work; if not, write to the Free Software Foundation, |
2d1821a50263
8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff
changeset
|
19 |
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
2d1821a50263
8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff
changeset
|
20 |
# |
2d1821a50263
8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff
changeset
|
21 |
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
2d1821a50263
8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff
changeset
|
22 |
# or visit www.oracle.com if you need additional information or have any |
2d1821a50263
8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff
changeset
|
23 |
# questions. |
2d1821a50263
8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff
changeset
|
24 |
# |
2d1821a50263
8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff
changeset
|
25 |
|
2d1821a50263
8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff
changeset
|
26 |
include NativeCompilation.gmk |
2d1821a50263
8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff
changeset
|
27 |
|
2d1821a50263
8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff
changeset
|
28 |
$(eval $(call IncludeCustomExtension, hotspot, lib/Lib-jdk.hotspot.agent.gmk)) |
2d1821a50263
8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff
changeset
|
29 |
|
2d1821a50263
8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff
changeset
|
30 |
################################################################################ |
2d1821a50263
8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff
changeset
|
31 |
|
2d1821a50263
8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff
changeset
|
32 |
SA_TOPDIR := $(HOTSPOT_TOPDIR)/agent |
2d1821a50263
8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff
changeset
|
33 |
|
2d1821a50263
8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff
changeset
|
34 |
# SA has a slightly different OS naming scheme |
2d1821a50263
8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff
changeset
|
35 |
ifeq ($(OPENJDK_TARGET_OS), windows) |
2d1821a50263
8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff
changeset
|
36 |
SA_TARGET_OS := win32 |
2d1821a50263
8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff
changeset
|
37 |
else ifeq ($(OPENJDK_TARGET_OS), macosx) |
2d1821a50263
8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff
changeset
|
38 |
SA_TARGET_OS := bsd |
2d1821a50263
8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff
changeset
|
39 |
else |
2d1821a50263
8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff
changeset
|
40 |
SA_TARGET_OS := $(OPENJDK_TARGET_OS) |
2d1821a50263
8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff
changeset
|
41 |
endif |
2d1821a50263
8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff
changeset
|
42 |
|
2d1821a50263
8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff
changeset
|
43 |
# Defaults for most platforms |
2d1821a50263
8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff
changeset
|
44 |
SA_TOOLCHAIN := TOOLCHAIN_DEFAULT |
2d1821a50263
8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff
changeset
|
45 |
SA_NAME := saproc |
2d1821a50263
8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff
changeset
|
46 |
SA_SRC += $(SA_TOPDIR)/src/share/native $(SA_TOPDIR)/src/os/$(SA_TARGET_OS) |
2d1821a50263
8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff
changeset
|
47 |
SA_MAPFILE := $(SA_TOPDIR)/src/os/$(OPENJDK_TARGET_OS)/mapfile |
2d1821a50263
8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff
changeset
|
48 |
SA_INCLUDES := \ |
2d1821a50263
8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff
changeset
|
49 |
$(addprefix -I, $(SA_SRC)) \ |
2d1821a50263
8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff
changeset
|
50 |
-I$(SUPPORT_OUTPUTDIR)/headers/jdk.hotspot.agent \ |
2d1821a50263
8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff
changeset
|
51 |
-I$(HOTSPOT_TOPDIR)/src/os/$(OPENJDK_TARGET_OS) \ |
2d1821a50263
8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff
changeset
|
52 |
# |
2d1821a50263
8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff
changeset
|
53 |
|
2d1821a50263
8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff
changeset
|
54 |
ifeq ($(OPENJDK_TARGET_CPU), x86_64) |
2d1821a50263
8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff
changeset
|
55 |
SA_MACHINE_FLAG_windows := -machine:AMD64 |
2d1821a50263
8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff
changeset
|
56 |
else ifeq ($(OPENJDK_TARGET_CPU), x86) |
2d1821a50263
8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff
changeset
|
57 |
SA_MACHINE_FLAG_linux := -march=i586 |
2d1821a50263
8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff
changeset
|
58 |
SA_MACHINE_FLAG_windows := -machine:I386 |
2d1821a50263
8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff
changeset
|
59 |
endif |
2d1821a50263
8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff
changeset
|
60 |
|
2d1821a50263
8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff
changeset
|
61 |
ifeq ($(OPENJDK_TARGET_OS), linux) |
2d1821a50263
8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff
changeset
|
62 |
SA_CFLAGS := $(CFLAGS_JDKLIB) -D_FILE_OFFSET_BITS=64 \ |
2d1821a50263
8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff
changeset
|
63 |
$(SA_MACHINE_FLAG_linux) |
2d1821a50263
8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff
changeset
|
64 |
SA_LDFLAGS := $(LDFLAGS_JDKLIB) $(SA_MACHINE_FLAG_linux) |
2d1821a50263
8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff
changeset
|
65 |
SA_LIBS := -lthread_db $(LIBDL) |
2d1821a50263
8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff
changeset
|
66 |
|
2d1821a50263
8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff
changeset
|
67 |
else ifeq ($(OPENJDK_TARGET_OS), solaris) |
2d1821a50263
8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff
changeset
|
68 |
SA_TOOLCHAIN := TOOLCHAIN_LINK_CXX |
2d1821a50263
8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff
changeset
|
69 |
SA_MAPFILE := $(SA_TOPDIR)/src/os/solaris/proc/mapfile |
2d1821a50263
8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff
changeset
|
70 |
COMMON_CFLAGS := -I$(SA_TOPDIR)/src/os/$(OPENJDK_TARGET_OS)/proc \ |
2d1821a50263
8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff
changeset
|
71 |
-DSOLARIS_11_B159_OR_LATER |
2d1821a50263
8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff
changeset
|
72 |
SA_CFLAGS := $(CFLAGS_JDKLIB) $(COMMON_CFLAGS) |
2d1821a50263
8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff
changeset
|
73 |
SA_CXXFLAGS := $(CXXFLAGS_JDKLIB) $(COMMON_CFLAGS) |
34610
0d0012bed22c
8142907: Integration of minor fixes from the build-infra project
ihse
parents:
34312
diff
changeset
|
74 |
SA_LDFLAGS := $(subst -Wl$(COMMA)-z$(COMMA)defs,, $(LDFLAGS_JDKLIB)) \ |
34289
2d1821a50263
8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff
changeset
|
75 |
-mt $(LDFLAGS_CXX_JDK) |
2d1821a50263
8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff
changeset
|
76 |
SA_LIBS := -ldl -ldemangle -lthread -lc |
2d1821a50263
8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff
changeset
|
77 |
|
2d1821a50263
8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff
changeset
|
78 |
else ifeq ($(OPENJDK_TARGET_OS), macosx) |
2d1821a50263
8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff
changeset
|
79 |
SA_EXCLUDE_FILES := BsdDebuggerLocal.c ps_proc.c salibelf.c StubDebuggerLocal.c |
2d1821a50263
8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff
changeset
|
80 |
SA_CFLAGS := $(CFLAGS_JDKLIB) \ |
2d1821a50263
8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff
changeset
|
81 |
-Damd64 -D_GNU_SOURCE -mno-omit-leaf-frame-pointer \ |
34312
b687b05475c6
8144134: Nightly tests fail with SIGSEGV in Ticks::now()
erikj
parents:
34289
diff
changeset
|
82 |
-mstack-alignment=16 -fPIC |
34289
2d1821a50263
8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff
changeset
|
83 |
SA_LDFLAGS := $(LDFLAGS_JDKLIB) |
2d1821a50263
8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff
changeset
|
84 |
SA_LIBS := -framework Foundation -framework JavaNativeFoundation \ |
2d1821a50263
8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff
changeset
|
85 |
-framework Security -framework CoreFoundation |
2d1821a50263
8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff
changeset
|
86 |
|
2d1821a50263
8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff
changeset
|
87 |
else ifeq ($(OPENJDK_TARGET_OS), windows) |
2d1821a50263
8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff
changeset
|
88 |
SA_NAME := sawindbg |
2d1821a50263
8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff
changeset
|
89 |
COMMON_CFLAGS := -D_WINDOWS -D_DEBUG -D_CONSOLE -D_MBCS -EHsc -FD |
2d1821a50263
8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff
changeset
|
90 |
SA_CFLAGS := $(subst -DWIN32_LEAN_AND_MEAN,, $(CFLAGS_JDKLIB)) \ |
2d1821a50263
8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff
changeset
|
91 |
$(COMMON_CFLAGS) |
2d1821a50263
8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff
changeset
|
92 |
SA_CXXFLAGS := $(subst -DWIN32_LEAN_AND_MEAN,, $(CXXFLAGS_JDKLIB)) \ |
2d1821a50263
8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff
changeset
|
93 |
$(COMMON_CFLAGS) |
2d1821a50263
8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff
changeset
|
94 |
SA_LDFLAGS := $(LDFLAGS_JDKLIB) \ |
2d1821a50263
8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff
changeset
|
95 |
$(SA_MACHINE_FLAG_windows) -manifest \ |
2d1821a50263
8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff
changeset
|
96 |
-subsystem:console -map |
2d1821a50263
8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff
changeset
|
97 |
SA_LIBS := dbgeng.lib |
2d1821a50263
8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff
changeset
|
98 |
ifeq ($(OPENJDK_TARGET_CPU), x86_64) |
2d1821a50263
8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff
changeset
|
99 |
SA_CXXFLAGS += -DWIN64 |
2d1821a50263
8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff
changeset
|
100 |
else |
2d1821a50263
8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff
changeset
|
101 |
SA_CXXFLAGS += -RTC1 -ZI |
2d1821a50263
8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff
changeset
|
102 |
SA_LDFLAGS += -SAFESEH |
2d1821a50263
8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff
changeset
|
103 |
endif |
2d1821a50263
8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff
changeset
|
104 |
endif |
2d1821a50263
8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff
changeset
|
105 |
|
2d1821a50263
8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff
changeset
|
106 |
################################################################################ |
2d1821a50263
8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff
changeset
|
107 |
|
2d1821a50263
8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff
changeset
|
108 |
$(eval $(call SetupNativeCompilation, BUILD_LIBSA, \ |
2d1821a50263
8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff
changeset
|
109 |
TOOLCHAIN := $(SA_TOOLCHAIN), \ |
2d1821a50263
8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff
changeset
|
110 |
OPTIMIZATION := NONE, \ |
2d1821a50263
8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff
changeset
|
111 |
DISABLED_WARNINGS_microsoft := 4267, \ |
2d1821a50263
8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff
changeset
|
112 |
DISABLED_WARNINGS_gcc := sign-compare, \ |
2d1821a50263
8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff
changeset
|
113 |
DISABLED_WARNINGS_CXX_solstudio := truncwarn unknownpragma, \ |
2d1821a50263
8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff
changeset
|
114 |
LIBRARY := $(SA_NAME), \ |
2d1821a50263
8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff
changeset
|
115 |
OUTPUT_DIR := $(call FindLibDirForModule, $(MODULE)), \ |
2d1821a50263
8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff
changeset
|
116 |
SRC := $(SA_SRC), \ |
2d1821a50263
8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff
changeset
|
117 |
EXCLUDE_FILES := test.c saproc_audit.cpp $(SA_EXCLUDE_FILES), \ |
2d1821a50263
8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff
changeset
|
118 |
CFLAGS := $(SA_INCLUDES) $(SA_CFLAGS) $(SA_CUSTOM_CFLAGS), \ |
2d1821a50263
8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff
changeset
|
119 |
CXXFLAGS := $(SA_INCLUDES) $(SA_CXXFLAGS) $(SA_CUSTOM_CXXFLAGS), \ |
2d1821a50263
8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff
changeset
|
120 |
LDFLAGS := $(SA_LDFLAGS) $(SA_CUSTOM_LDFLAGS), \ |
2d1821a50263
8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff
changeset
|
121 |
LIBS := $(SA_LIBS), \ |
2d1821a50263
8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff
changeset
|
122 |
MAPFILE := $(SA_MAPFILE), \ |
2d1821a50263
8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff
changeset
|
123 |
OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libsa, \ |
2d1821a50263
8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff
changeset
|
124 |
DEBUG_SYMBOLS := true, \ |
2d1821a50263
8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff
changeset
|
125 |
STRIP_SYMBOLS := true, \ |
2d1821a50263
8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff
changeset
|
126 |
)) |
2d1821a50263
8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff
changeset
|
127 |
|
2d1821a50263
8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff
changeset
|
128 |
TARGETS += $(BUILD_LIBSA) |
2d1821a50263
8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff
changeset
|
129 |
|
2d1821a50263
8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff
changeset
|
130 |
################################################################################ |