Mercurial > hg > graal-jvmci-8
annotate make/bsd/makefiles/saproc.make @ 22672:1bbd4a7c274b
Rename jdk.internal.jvmci to jdk.vm.ci
author | Tom Rodriguez <tom.rodriguez@oracle.com> |
---|---|
date | Thu, 08 Oct 2015 17:28:41 -0700 |
parents | a241f629dbfb |
children | dd9cc155639c |
rev | line source |
---|---|
3960 | 1 # |
22665
d92c9f043d02
import make/bsd/makefiles/saproc.make from graal-jvmci-9
Andreas Woess <andreas.woess@oracle.com>
parents:
18125
diff
changeset
|
2 # Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved. |
3960 | 3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 # | |
5 # This code is free software; you can redistribute it and/or modify it | |
6 # under the terms of the GNU General Public License version 2 only, as | |
7 # published by the Free Software Foundation. | |
8 # | |
9 # This code is distributed in the hope that it will be useful, but WITHOUT | |
10 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
11 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
12 # version 2 for more details (a copy is included in the LICENSE file that | |
13 # accompanied this code). | |
14 # | |
15 # You should have received a copy of the GNU General Public License version | |
16 # 2 along with this work; if not, write to the Free Software Foundation, | |
17 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. | |
18 # | |
19 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA | |
20 # or visit www.oracle.com if you need additional information or have any | |
21 # questions. | |
22665
d92c9f043d02
import make/bsd/makefiles/saproc.make from graal-jvmci-9
Andreas Woess <andreas.woess@oracle.com>
parents:
18125
diff
changeset
|
22 # |
3960 | 23 # |
24 | |
25 # Rules to build serviceability agent library, used by vm.make | |
26 | |
8750 | 27 # libsaproc.so(dylib): serviceability agent |
3960 | 28 SAPROC = saproc |
29 | |
30 ifeq ($(OS_VENDOR), Darwin) | |
12859
f509b8f4699b
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
8750
diff
changeset
|
31 LIBSAPROC = lib$(SAPROC).dylib |
f509b8f4699b
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
8750
diff
changeset
|
32 |
f509b8f4699b
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
8750
diff
changeset
|
33 LIBSAPROC_DEBUGINFO = lib$(SAPROC).dylib.dSYM |
f509b8f4699b
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
8750
diff
changeset
|
34 LIBSAPROC_DIZ = lib$(SAPROC).diz |
3960 | 35 else |
12859
f509b8f4699b
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
8750
diff
changeset
|
36 LIBSAPROC = lib$(SAPROC).so |
f509b8f4699b
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
8750
diff
changeset
|
37 |
f509b8f4699b
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
8750
diff
changeset
|
38 LIBSAPROC_DEBUGINFO = lib$(SAPROC).debuginfo |
f509b8f4699b
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
8750
diff
changeset
|
39 LIBSAPROC_DIZ = lib$(SAPROC).diz |
3960 | 40 endif |
41 | |
42 AGENT_DIR = $(GAMMADIR)/agent | |
43 | |
44 SASRCDIR = $(AGENT_DIR)/src/os/$(Platform_os_family) | |
45 | |
8750 | 46 BSD_NON_STUB_SASRCFILES = $(SASRCDIR)/salibelf.c \ |
6782 | 47 $(SASRCDIR)/symtab.c \ |
48 $(SASRCDIR)/libproc_impl.c \ | |
49 $(SASRCDIR)/ps_proc.c \ | |
50 $(SASRCDIR)/ps_core.c \ | |
51 $(SASRCDIR)/BsdDebuggerLocal.c \ | |
52 $(AGENT_DIR)/src/share/native/sadis.c | |
4006 | 53 |
8750 | 54 DARWIN_NON_STUB_SASRCFILES = $(SASRCDIR)/symtab.c \ |
55 $(SASRCDIR)/libproc_impl.c \ | |
56 $(SASRCDIR)/ps_core.c \ | |
57 $(SASRCDIR)/MacosxDebuggerLocal.m \ | |
58 $(AGENT_DIR)/src/share/native/sadis.c | |
59 | |
4006 | 60 ifeq ($(OS_VENDOR), FreeBSD) |
8750 | 61 SASRCFILES = $(BSD_NON_STUB_SASRCFILES) |
4006 | 62 SALIBS = -lutil -lthread_db |
63 SAARCH = $(ARCHFLAG) | |
64 else | |
65 ifeq ($(OS_VENDOR), Darwin) | |
8750 | 66 SASRCFILES = $(DARWIN_NON_STUB_SASRCFILES) |
22665
d92c9f043d02
import make/bsd/makefiles/saproc.make from graal-jvmci-9
Andreas Woess <andreas.woess@oracle.com>
parents:
18125
diff
changeset
|
67 SALIBS = -g \ |
d92c9f043d02
import make/bsd/makefiles/saproc.make from graal-jvmci-9
Andreas Woess <andreas.woess@oracle.com>
parents:
18125
diff
changeset
|
68 -framework Foundation \ |
d92c9f043d02
import make/bsd/makefiles/saproc.make from graal-jvmci-9
Andreas Woess <andreas.woess@oracle.com>
parents:
18125
diff
changeset
|
69 -framework JavaNativeFoundation \ |
d92c9f043d02
import make/bsd/makefiles/saproc.make from graal-jvmci-9
Andreas Woess <andreas.woess@oracle.com>
parents:
18125
diff
changeset
|
70 -framework Security \ |
d92c9f043d02
import make/bsd/makefiles/saproc.make from graal-jvmci-9
Andreas Woess <andreas.woess@oracle.com>
parents:
18125
diff
changeset
|
71 -framework CoreFoundation |
4006 | 72 #objc compiler blows up on -march=i586, perhaps it should not be included in the macosx intel 32-bit C++ compiles? |
73 SAARCH = $(subst -march=i586,,$(ARCHFLAG)) | |
22665
d92c9f043d02
import make/bsd/makefiles/saproc.make from graal-jvmci-9
Andreas Woess <andreas.woess@oracle.com>
parents:
18125
diff
changeset
|
74 |
d92c9f043d02
import make/bsd/makefiles/saproc.make from graal-jvmci-9
Andreas Woess <andreas.woess@oracle.com>
parents:
18125
diff
changeset
|
75 # This is needed to locate JavaNativeFoundation.framework |
d92c9f043d02
import make/bsd/makefiles/saproc.make from graal-jvmci-9
Andreas Woess <andreas.woess@oracle.com>
parents:
18125
diff
changeset
|
76 ifeq ($(SYSROOT_CFLAGS),) |
d92c9f043d02
import make/bsd/makefiles/saproc.make from graal-jvmci-9
Andreas Woess <andreas.woess@oracle.com>
parents:
18125
diff
changeset
|
77 # this will happen when building without spec.gmk, set SDKROOT to a valid SDK |
d92c9f043d02
import make/bsd/makefiles/saproc.make from graal-jvmci-9
Andreas Woess <andreas.woess@oracle.com>
parents:
18125
diff
changeset
|
78 # path if your system does not have headers installed in the system frameworks |
22666
a241f629dbfb
use xcodebuild to get SDKROOT
Andreas Woess <andreas.woess@oracle.com>
parents:
22665
diff
changeset
|
79 ifeq ($(SDKROOT),) |
a241f629dbfb
use xcodebuild to get SDKROOT
Andreas Woess <andreas.woess@oracle.com>
parents:
22665
diff
changeset
|
80 SDKROOT = `xcodebuild -sdk macosx -version|grep '^Path: '|sed 's/Path: //'` |
a241f629dbfb
use xcodebuild to get SDKROOT
Andreas Woess <andreas.woess@oracle.com>
parents:
22665
diff
changeset
|
81 endif |
22665
d92c9f043d02
import make/bsd/makefiles/saproc.make from graal-jvmci-9
Andreas Woess <andreas.woess@oracle.com>
parents:
18125
diff
changeset
|
82 SA_SYSROOT_FLAGS = -F"$(SDKROOT)/System/Library/Frameworks/JavaVM.framework/Frameworks" |
d92c9f043d02
import make/bsd/makefiles/saproc.make from graal-jvmci-9
Andreas Woess <andreas.woess@oracle.com>
parents:
18125
diff
changeset
|
83 else |
d92c9f043d02
import make/bsd/makefiles/saproc.make from graal-jvmci-9
Andreas Woess <andreas.woess@oracle.com>
parents:
18125
diff
changeset
|
84 # Just use SYSROOT_CFLAGS |
d92c9f043d02
import make/bsd/makefiles/saproc.make from graal-jvmci-9
Andreas Woess <andreas.woess@oracle.com>
parents:
18125
diff
changeset
|
85 SA_SYSROOT_FLAGS=$(SYSROOT_CFLAGS) |
d92c9f043d02
import make/bsd/makefiles/saproc.make from graal-jvmci-9
Andreas Woess <andreas.woess@oracle.com>
parents:
18125
diff
changeset
|
86 endif |
4006 | 87 else |
88 SASRCFILES = $(SASRCDIR)/StubDebuggerLocal.c | |
22665
d92c9f043d02
import make/bsd/makefiles/saproc.make from graal-jvmci-9
Andreas Woess <andreas.woess@oracle.com>
parents:
18125
diff
changeset
|
89 SALIBS = |
4006 | 90 SAARCH = $(ARCHFLAG) |
91 endif | |
92 endif | |
3960 | 93 |
94 SAMAPFILE = $(SASRCDIR)/mapfile | |
95 | |
12859
f509b8f4699b
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
8750
diff
changeset
|
96 DEST_SAPROC = $(JDK_LIBDIR)/$(LIBSAPROC) |
f509b8f4699b
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
8750
diff
changeset
|
97 DEST_SAPROC_DEBUGINFO = $(JDK_LIBDIR)/$(LIBSAPROC_DEBUGINFO) |
f509b8f4699b
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
8750
diff
changeset
|
98 DEST_SAPROC_DIZ = $(JDK_LIBDIR)/$(LIBSAPROC_DIZ) |
3960 | 99 |
100 # DEBUG_BINARIES overrides everything, use full -g debug information | |
101 ifeq ($(DEBUG_BINARIES), true) | |
102 SA_DEBUG_CFLAGS = -g | |
103 endif | |
104 | |
105 # if $(AGENT_DIR) does not exist, we don't build SA | |
106 # also, we don't build SA on Itanium, PPC, ARM or zero. | |
107 | |
108 ifneq ($(wildcard $(AGENT_DIR)),) | |
109 ifneq ($(filter-out ia64 arm ppc zero,$(SRCARCH)),) | |
110 BUILDLIBSAPROC = $(LIBSAPROC) | |
111 endif | |
112 endif | |
113 | |
114 | |
115 ifneq ($(OS_VENDOR), Darwin) | |
116 SA_LFLAGS = $(MAPFLAG:FILENAME=$(SAMAPFILE)) | |
117 endif | |
118 SA_LFLAGS += $(LDFLAGS_HASH_STYLE) | |
119 | |
22665
d92c9f043d02
import make/bsd/makefiles/saproc.make from graal-jvmci-9
Andreas Woess <andreas.woess@oracle.com>
parents:
18125
diff
changeset
|
120 BOOT_JAVA_INCLUDES = -I$(BOOT_JAVA_HOME)/include \ |
d92c9f043d02
import make/bsd/makefiles/saproc.make from graal-jvmci-9
Andreas Woess <andreas.woess@oracle.com>
parents:
18125
diff
changeset
|
121 -I$(BOOT_JAVA_HOME)/include/$(shell uname -s | tr "[:upper:]" "[:lower:]") |
4006 | 122 |
3960 | 123 $(LIBSAPROC): $(SASRCFILES) $(SAMAPFILE) |
124 $(QUIETLY) if [ "$(BOOT_JAVA_HOME)" = "" ]; then \ | |
125 echo "ALT_BOOTDIR, BOOTDIR or JAVA_HOME needs to be defined to build SA"; \ | |
126 exit 1; \ | |
127 fi | |
22665
d92c9f043d02
import make/bsd/makefiles/saproc.make from graal-jvmci-9
Andreas Woess <andreas.woess@oracle.com>
parents:
18125
diff
changeset
|
128 @echo $(LOG_INFO) Making SA debugger back-end... |
3960 | 129 $(QUIETLY) $(CC) -D$(BUILDARCH) -D_GNU_SOURCE \ |
22665
d92c9f043d02
import make/bsd/makefiles/saproc.make from graal-jvmci-9
Andreas Woess <andreas.woess@oracle.com>
parents:
18125
diff
changeset
|
130 $(SA_SYSROOT_FLAGS) \ |
8750 | 131 $(SYMFLAG) $(SAARCH) $(SHARED_FLAG) $(PICFLAG) \ |
3960 | 132 -I$(SASRCDIR) \ |
133 -I$(GENERATED) \ | |
4006 | 134 $(BOOT_JAVA_INCLUDES) \ |
3960 | 135 $(SASRCFILES) \ |
136 $(SA_LFLAGS) \ | |
137 $(SA_DEBUG_CFLAGS) \ | |
138 -o $@ \ | |
139 $(SALIBS) | |
12859
f509b8f4699b
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
8750
diff
changeset
|
140 ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1) |
f509b8f4699b
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
8750
diff
changeset
|
141 ifeq ($(OS_VENDOR), Darwin) |
f509b8f4699b
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
8750
diff
changeset
|
142 $(DSYMUTIL) $@ |
f509b8f4699b
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
8750
diff
changeset
|
143 ifeq ($(ZIP_DEBUGINFO_FILES),1) |
f509b8f4699b
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
8750
diff
changeset
|
144 $(ZIPEXE) -q -r -y $(LIBSAPROC_DIZ) $(LIBSAPROC_DEBUGINFO) |
f509b8f4699b
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
8750
diff
changeset
|
145 $(RM) -r $(LIBSAPROC_DEBUGINFO) |
f509b8f4699b
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
8750
diff
changeset
|
146 endif |
f509b8f4699b
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
8750
diff
changeset
|
147 else |
f509b8f4699b
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
8750
diff
changeset
|
148 $(QUIETLY) $(OBJCOPY) --only-keep-debug $@ $(LIBSAPROC_DEBUGINFO) |
f509b8f4699b
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
8750
diff
changeset
|
149 $(QUIETLY) $(OBJCOPY) --add-gnu-debuglink=$(LIBSAPROC_DEBUGINFO) $@ |
f509b8f4699b
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
8750
diff
changeset
|
150 ifeq ($(STRIP_POLICY),all_strip) |
f509b8f4699b
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
8750
diff
changeset
|
151 $(QUIETLY) $(STRIP) $@ |
f509b8f4699b
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
8750
diff
changeset
|
152 else |
f509b8f4699b
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
8750
diff
changeset
|
153 ifeq ($(STRIP_POLICY),min_strip) |
f509b8f4699b
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
8750
diff
changeset
|
154 $(QUIETLY) $(STRIP) -g $@ |
f509b8f4699b
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
8750
diff
changeset
|
155 # implied else here is no stripping at all |
f509b8f4699b
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
8750
diff
changeset
|
156 endif |
f509b8f4699b
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
8750
diff
changeset
|
157 endif |
f509b8f4699b
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
8750
diff
changeset
|
158 ifeq ($(ZIP_DEBUGINFO_FILES),1) |
f509b8f4699b
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
8750
diff
changeset
|
159 $(ZIPEXE) -q -y $(LIBSAPROC_DIZ) $(LIBSAPROC_DEBUGINFO) |
f509b8f4699b
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
8750
diff
changeset
|
160 $(RM) $(LIBSAPROC_DEBUGINFO) |
f509b8f4699b
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
8750
diff
changeset
|
161 endif |
f509b8f4699b
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
8750
diff
changeset
|
162 endif |
f509b8f4699b
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
8750
diff
changeset
|
163 endif |
3960 | 164 |
165 install_saproc: $(BUILDLIBSAPROC) | |
12859
f509b8f4699b
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
8750
diff
changeset
|
166 @echo "Copying $(LIBSAPROC) to $(DEST_SAPROC)" |
f509b8f4699b
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
8750
diff
changeset
|
167 ifeq ($(OS_VENDOR), Darwin) |
18125
2a69cbe850a8
Reduce diff with upstream
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
14909
diff
changeset
|
168 $(QUIETLY) test ! -d $(LIBSAPROC_DEBUGINFO) || \ |
22665
d92c9f043d02
import make/bsd/makefiles/saproc.make from graal-jvmci-9
Andreas Woess <andreas.woess@oracle.com>
parents:
18125
diff
changeset
|
169 $(CP) -f -r $(LIBSAPROC_DEBUGINFO) $(DEST_SAPROC_DEBUGINFO) |
12859
f509b8f4699b
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
8750
diff
changeset
|
170 else |
22665
d92c9f043d02
import make/bsd/makefiles/saproc.make from graal-jvmci-9
Andreas Woess <andreas.woess@oracle.com>
parents:
18125
diff
changeset
|
171 $(QUIETLY) test ! -f $(LIBSAPROC_DEBUGINFO) || \ |
d92c9f043d02
import make/bsd/makefiles/saproc.make from graal-jvmci-9
Andreas Woess <andreas.woess@oracle.com>
parents:
18125
diff
changeset
|
172 $(CP) -f $(LIBSAPROC_DEBUGINFO) $(DEST_SAPROC_DEBUGINFO) |
12859
f509b8f4699b
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
8750
diff
changeset
|
173 endif |
14331
67d6392ed21e
8033714: hotspot 'install_jvm' bld target broken with ZIP_DEBUGINFO_FILES=0
dcubed
parents:
12859
diff
changeset
|
174 $(QUIETLY) test ! -f $(LIBSAPROC_DIZ) || \ |
22665
d92c9f043d02
import make/bsd/makefiles/saproc.make from graal-jvmci-9
Andreas Woess <andreas.woess@oracle.com>
parents:
18125
diff
changeset
|
175 $(CP) -f $(LIBSAPROC_DIZ) $(DEST_SAPROC_DIZ) |
d92c9f043d02
import make/bsd/makefiles/saproc.make from graal-jvmci-9
Andreas Woess <andreas.woess@oracle.com>
parents:
18125
diff
changeset
|
176 $(QUIETLY) $(CP) -f $(LIBSAPROC) $(DEST_SAPROC) && echo "Done" |
3960 | 177 |
178 .PHONY: install_saproc |