1 # |
1 # |
2 # Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved. |
2 # Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved. |
3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 # |
4 # |
5 # This code is free software; you can redistribute it and/or modify it |
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 |
6 # under the terms of the GNU General Public License version 2 only, as |
7 # published by the Free Software Foundation. |
7 # published by the Free Software Foundation. |
31 |
31 |
32 SAPROC_G = $(SAPROC)$(G_SUFFIX) |
32 SAPROC_G = $(SAPROC)$(G_SUFFIX) |
33 LIBSAPROC_G = lib$(SAPROC_G).so |
33 LIBSAPROC_G = lib$(SAPROC_G).so |
34 |
34 |
35 LIBSAPROC_DEBUGINFO = lib$(SAPROC).debuginfo |
35 LIBSAPROC_DEBUGINFO = lib$(SAPROC).debuginfo |
|
36 LIBSAPROC_DIZ = lib$(SAPROC).diz |
36 LIBSAPROC_G_DEBUGINFO = lib$(SAPROC_G).debuginfo |
37 LIBSAPROC_G_DEBUGINFO = lib$(SAPROC_G).debuginfo |
|
38 LIBSAPROC_G_DIZ = lib$(SAPROC_G).diz |
37 |
39 |
38 AGENT_DIR = $(GAMMADIR)/agent |
40 AGENT_DIR = $(GAMMADIR)/agent |
39 |
41 |
40 SASRCDIR = $(AGENT_DIR)/src/os/$(Platform_os_family)/proc |
42 SASRCDIR = $(AGENT_DIR)/src/os/$(Platform_os_family)/proc |
41 |
43 |
43 |
45 |
44 SAMAPFILE = $(SASRCDIR)/mapfile |
46 SAMAPFILE = $(SASRCDIR)/mapfile |
45 |
47 |
46 DEST_SAPROC = $(JDK_LIBDIR)/$(LIBSAPROC) |
48 DEST_SAPROC = $(JDK_LIBDIR)/$(LIBSAPROC) |
47 DEST_SAPROC_DEBUGINFO = $(JDK_LIBDIR)/$(LIBSAPROC_DEBUGINFO) |
49 DEST_SAPROC_DEBUGINFO = $(JDK_LIBDIR)/$(LIBSAPROC_DEBUGINFO) |
|
50 DEST_SAPROC_DIZ = $(JDK_LIBDIR)/$(LIBSAPROC_DIZ) |
48 |
51 |
49 # if $(AGENT_DIR) does not exist, we don't build SA |
52 # if $(AGENT_DIR) does not exist, we don't build SA |
50 |
53 |
51 ifneq ($(wildcard $(AGENT_DIR)),) |
54 ifneq ($(wildcard $(AGENT_DIR)),) |
52 BUILDLIBSAPROC = $(LIBSAPROC) |
55 BUILDLIBSAPROC = $(LIBSAPROC) |
103 $(SASRCFILES) \ |
106 $(SASRCFILES) \ |
104 $(SA_LFLAGS) \ |
107 $(SA_LFLAGS) \ |
105 -o $@ \ |
108 -o $@ \ |
106 -ldl -ldemangle -lthread -lc |
109 -ldl -ldemangle -lthread -lc |
107 [ -f $(LIBSAPROC_G) ] || { ln -s $@ $(LIBSAPROC_G); } |
110 [ -f $(LIBSAPROC_G) ] || { ln -s $@ $(LIBSAPROC_G); } |
108 ifneq ($(OBJCOPY),) |
111 ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1) |
109 $(QUIETLY) $(OBJCOPY) --only-keep-debug $@ $(LIBSAPROC_DEBUGINFO) |
112 $(QUIETLY) $(OBJCOPY) --only-keep-debug $@ $(LIBSAPROC_DEBUGINFO) |
110 $(QUIETLY) $(OBJCOPY) --add-gnu-debuglink=$(LIBSAPROC_DEBUGINFO) $@ |
113 $(QUIETLY) $(OBJCOPY) --add-gnu-debuglink=$(LIBSAPROC_DEBUGINFO) $@ |
111 ifeq ($(STRIP_POLICY),all_strip) |
114 ifeq ($(STRIP_POLICY),all_strip) |
112 $(QUIETLY) $(STRIP) $@ |
115 $(QUIETLY) $(STRIP) $@ |
113 else |
116 else |
115 $(QUIETLY) $(STRIP) -x $@ |
118 $(QUIETLY) $(STRIP) -x $@ |
116 # implied else here is no stripping at all |
119 # implied else here is no stripping at all |
117 endif |
120 endif |
118 endif |
121 endif |
119 [ -f $(LIBSAPROC_G_DEBUGINFO) ] || { ln -s $(LIBSAPROC_DEBUGINFO) $(LIBSAPROC_G_DEBUGINFO); } |
122 [ -f $(LIBSAPROC_G_DEBUGINFO) ] || { ln -s $(LIBSAPROC_DEBUGINFO) $(LIBSAPROC_G_DEBUGINFO); } |
|
123 ifeq ($(ZIP_DEBUGINFO_FILES),1) |
|
124 $(ZIPEXE) -q -y $(LIBSAPROC_DIZ) $(LIBSAPROC_DEBUGINFO) $(LIBSAPROC_G_DEBUGINFO) |
|
125 $(RM) $(LIBSAPROC_DEBUGINFO) $(LIBSAPROC_G_DEBUGINFO) |
|
126 [ -f $(LIBSAPROC_G_DIZ) ] || { ln -s $(LIBSAPROC_DIZ) $(LIBSAPROC_G_DIZ); } |
|
127 endif |
120 endif |
128 endif |
121 |
129 |
122 install_saproc: $(BULDLIBSAPROC) |
130 install_saproc: $(BULDLIBSAPROC) |
123 $(QUIETLY) if [ -f $(LIBSAPROC) ] ; then \ |
131 $(QUIETLY) if [ -f $(LIBSAPROC) ] ; then \ |
124 echo "Copying $(LIBSAPROC) to $(DEST_SAPROC)"; \ |
132 echo "Copying $(LIBSAPROC) to $(DEST_SAPROC)"; \ |
125 test -f $(LIBSAPROC_DEBUGINFO) && \ |
133 test -f $(LIBSAPROC_DEBUGINFO) && \ |
126 cp -f $(LIBSAPROC_DEBUGINFO) $(DEST_SAPROC_DEBUGINFO); \ |
134 cp -f $(LIBSAPROC_DEBUGINFO) $(DEST_SAPROC_DEBUGINFO); \ |
|
135 test -f $(LIBSAPROC_DIZ) && \ |
|
136 cp -f $(LIBSAPROC_DIZ) $(DEST_SAPROC_DIZ); \ |
127 cp -f $(LIBSAPROC) $(DEST_SAPROC) && echo "Done"; \ |
137 cp -f $(LIBSAPROC) $(DEST_SAPROC) && echo "Done"; \ |
128 fi |
138 fi |
129 |
139 |
130 .PHONY: install_saproc |
140 .PHONY: install_saproc |