|
1 # |
|
2 # Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. |
|
3 # Copyright 2012, 2013 SAP AG. All rights reserved. |
|
4 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
|
5 # |
|
6 # This code is free software; you can redistribute it and/or modify it |
|
7 # under the terms of the GNU General Public License version 2 only, as |
|
8 # published by the Free Software Foundation. |
|
9 # |
|
10 # This code is distributed in the hope that it will be useful, but WITHOUT |
|
11 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
12 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
13 # version 2 for more details (a copy is included in the LICENSE file that |
|
14 # accompanied this code). |
|
15 # |
|
16 # You should have received a copy of the GNU General Public License version |
|
17 # 2 along with this work; if not, write to the Free Software Foundation, |
|
18 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
19 # |
|
20 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
|
21 # or visit www.oracle.com if you need additional information or have any |
|
22 # questions. |
|
23 # |
|
24 # |
|
25 |
|
26 # Rules to build signal interposition library, used by vm.make |
|
27 |
|
28 # libjsig.so: signal interposition library |
|
29 JSIG = jsig |
|
30 LIBJSIG = lib$(JSIG).so |
|
31 |
|
32 LIBJSIG_DEBUGINFO = lib$(JSIG).debuginfo |
|
33 LIBJSIG_DIZ = lib$(JSIG).diz |
|
34 |
|
35 JSIGSRCDIR = $(GAMMADIR)/src/os/$(Platform_os_family)/vm |
|
36 |
|
37 DEST_JSIG = $(JDK_LIBDIR)/$(LIBJSIG) |
|
38 DEST_JSIG_DEBUGINFO = $(JDK_LIBDIR)/$(LIBJSIG_DEBUGINFO) |
|
39 DEST_JSIG_DIZ = $(JDK_LIBDIR)/$(LIBJSIG_DIZ) |
|
40 |
|
41 LIBJSIG_MAPFILE = $(MAKEFILES_DIR)/mapfile-vers-jsig |
|
42 |
|
43 # On Linux we really dont want a mapfile, as this library is small |
|
44 # and preloaded using LD_PRELOAD, making functions private will |
|
45 # cause problems with interposing. See CR: 6466665 |
|
46 # LFLAGS_JSIG += $(MAPFLAG:FILENAME=$(LIBJSIG_MAPFILE)) |
|
47 |
|
48 LFLAGS_JSIG += -D_GNU_SOURCE -D_REENTRANT $(LDFLAGS_HASH_STYLE) |
|
49 |
|
50 LFLAGS_JSIG += $(BIN_UTILS) |
|
51 |
|
52 # DEBUG_BINARIES overrides everything, use full -g debug information |
|
53 ifeq ($(DEBUG_BINARIES), true) |
|
54 JSIG_DEBUG_CFLAGS = -g |
|
55 endif |
|
56 |
|
57 $(LIBJSIG): $(JSIGSRCDIR)/jsig.c $(LIBJSIG_MAPFILE) |
|
58 @echo Making signal interposition lib... |
|
59 $(QUIETLY) $(CXX) $(SYMFLAG) $(ARCHFLAG) $(SHARED_FLAG) $(PICFLAG) \ |
|
60 $(LFLAGS_JSIG) $(JSIG_DEBUG_CFLAGS) -o $@ $< -ldl |
|
61 |
|
62 #ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1) |
|
63 # $(QUIETLY) $(OBJCOPY) --only-keep-debug $@ $(LIBJSIG_DEBUGINFO) |
|
64 # $(QUIETLY) $(OBJCOPY) --add-gnu-debuglink=$(LIBJSIG_DEBUGINFO) $@ |
|
65 # ifeq ($(STRIP_POLICY),all_strip) |
|
66 # $(QUIETLY) $(STRIP) $@ |
|
67 # else |
|
68 # ifeq ($(STRIP_POLICY),min_strip) |
|
69 # $(QUIETLY) $(STRIP) -g $@ |
|
70 # # implied else here is no stripping at all |
|
71 # endif |
|
72 # endif |
|
73 # ifeq ($(ZIP_DEBUGINFO_FILES),1) |
|
74 # $(ZIPEXE) -q -y $(LIBJSIG_DIZ) $(LIBJSIG_DEBUGINFO) |
|
75 # $(RM) $(LIBJSIG_DEBUGINFO) |
|
76 # endif |
|
77 #endif |
|
78 |
|
79 install_jsig: $(LIBJSIG) |
|
80 @echo "Copying $(LIBJSIG) to $(DEST_JSIG)" |
|
81 $(QUIETLY) test -f $(LIBJSIG_DEBUGINFO) && \ |
|
82 cp -f $(LIBJSIG_DEBUGINFO) $(DEST_JSIG_DEBUGINFO) |
|
83 $(QUIETLY) test -f $(LIBJSIG_DIZ) && \ |
|
84 cp -f $(LIBJSIG_DIZ) $(DEST_JSIG_DIZ) |
|
85 $(QUIETLY) cp -f $(LIBJSIG) $(DEST_JSIG) && echo "Done" |
|
86 |
|
87 .PHONY: install_jsig |