author | chegar |
Wed, 03 Dec 2014 19:28:35 +0000 | |
changeset 27799 | 097b1d6f6894 |
parent 27565 | 729f9700483a |
parent 27736 | 8c9bd4be4a86 |
child 27944 | c6d5edd39016 |
permissions | -rw-r--r-- |
25859 | 1 |
# |
2 |
# Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved. |
|
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. Oracle designates this |
|
8 |
# particular file as subject to the "Classpath" exception as provided |
|
9 |
# by Oracle in the LICENSE file that accompanied this code. |
|
10 |
# |
|
11 |
# This code is distributed in the hope that it will be useful, but WITHOUT |
|
12 |
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
13 |
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
14 |
# version 2 for more details (a copy is included in the LICENSE file that |
|
15 |
# accompanied this code). |
|
16 |
# |
|
17 |
# You should have received a copy of the GNU General Public License version |
|
18 |
# 2 along with this work; if not, write to the Free Software Foundation, |
|
19 |
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
20 |
# |
|
21 |
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
|
22 |
# or visit www.oracle.com if you need additional information or have any |
|
23 |
# questions. |
|
24 |
# |
|
25 |
||
26 |
include LibCommon.gmk |
|
27 |
||
28 |
################################################################################ |
|
29 |
||
30 |
LIBINSTRUMENT_SRC := $(JDK_TOPDIR)/src/java.instrument/share/native/libinstrument \ |
|
27736
8c9bd4be4a86
8058631: Rename posix to unix in build system to match file name changes
ihse
parents:
25859
diff
changeset
|
31 |
$(JDK_TOPDIR)/src/java.instrument/$(OPENJDK_TARGET_OS_TYPE)/native/libinstrument \ |
25859 | 32 |
# |
33 |
LIBINSTRUMENT_CFLAGS := $(CFLAGS_JDKLIB) \ |
|
34 |
$(addprefix -I, $(LIBINSTRUMENT_SRC)) \ |
|
27565 | 35 |
-I$(SUPPORT_OUTPUTDIR)/headers/java.instrument \ |
25859 | 36 |
-I$(JDK_TOPDIR)/src/java.base/share/native/libjli \ |
37 |
-I$(JDK_TOPDIR)/src/java.base/share/native/libjava \ |
|
38 |
# |
|
39 |
||
40 |
LIBINSTRUMENT_LDFLAGS := |
|
41 |
LIBINSTRUMENT_LDFLAGS_SUFFIX := |
|
42 |
||
43 |
ifeq ($(OPENJDK_TARGET_OS), windows) |
|
27565 | 44 |
LIBINSTRUMENT_LDFLAGS += $(SUPPORT_OUTPUTDIR)/native/java.base/jli_static.lib $(WIN_JAVA_LIB) \ |
25859 | 45 |
-export:Agent_OnAttach advapi32.lib |
46 |
# Statically link the C runtime so that there are not dependencies on modules |
|
47 |
# not on the search patch when invoked from the Windows system directory |
|
48 |
# (or elsewhere). |
|
49 |
LIBINSTRUMENT_CFLAGS := $(filter-out -MD, $(LIBINSTRUMENT_CFLAGS)) |
|
50 |
# equivalent of strcasecmp is stricmp on Windows |
|
51 |
LIBINSTRUMENT_CFLAGS += -Dstrcasecmp=stricmp |
|
52 |
else |
|
53 |
LIBINSTRUMENT_LDFLAGS_SUFFIX := -ljava |
|
54 |
endif |
|
55 |
||
56 |
$(eval $(call SetupNativeCompilation,BUILD_LIBINSTRUMENT, \ |
|
57 |
LIBRARY := instrument, \ |
|
58 |
OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \ |
|
59 |
SRC := $(LIBINSTRUMENT_SRC), \ |
|
60 |
LANG := C, \ |
|
61 |
OPTIMIZATION := LOW, \ |
|
62 |
CFLAGS := $(LIBINSTRUMENT_CFLAGS) $(CFLAGS_WARNINGS_ARE_ERRORS), \ |
|
63 |
CFLAGS_debug := -DJPLIS_LOGGING, \ |
|
64 |
CFLAGS_release := -DNO_JPLIS_LOGGING, \ |
|
65 |
MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libinstrument/mapfile-vers, \ |
|
66 |
LDFLAGS := $(LDFLAGS_JDKLIB) \ |
|
67 |
$(call SET_SHARED_LIBRARY_ORIGIN) \ |
|
68 |
$(LIBINSTRUMENT_LDFLAGS), \ |
|
69 |
LDFLAGS_linux := $(call SET_SHARED_LIBRARY_ORIGIN,/jli), \ |
|
70 |
LDFLAGS_solaris := $(call SET_SHARED_LIBRARY_ORIGIN,/jli), \ |
|
27565 | 71 |
LDFLAGS_macosx := -Xlinker -all_load $(SUPPORT_OUTPUTDIR)/native/java.base/libjli_static.a \ |
25859 | 72 |
-framework Cocoa -framework Security -framework ApplicationServices, \ |
73 |
LDFLAGS_SUFFIX := $(LIBINSTRUMENT_LDFLAGS_SUFFIX), \ |
|
74 |
LDFLAGS_SUFFIX_macosx := -liconv $(LIBZ), \ |
|
27565 | 75 |
LDFLAGS_SUFFIX_solaris := $(LIBZ) -L $(call FindLibDirForModule, java.base)/jli -ljli $(LIBDL) -lc, \ |
76 |
LDFLAGS_SUFFIX_linux := $(LIBZ) -L $(call FindLibDirForModule, java.base)/jli -ljli $(LIBDL), \ |
|
77 |
LDFLAGS_SUFFIX_aix := $(LIBZ) -L$(SUPPORT_OUTPUTDIR)/native/java.base -ljli_static $(LIBDL),\ |
|
25859 | 78 |
VERSIONINFO_RESOURCE := $(GLOBAL_VERSION_INFO_RESOURCE), \ |
79 |
RC_FLAGS := $(RC_FLAGS) \ |
|
80 |
-D "JDK_FNAME=instrument.dll" \ |
|
81 |
-D "JDK_INTERNAL_NAME=instrument" \ |
|
82 |
-D "JDK_FTYPE=0x2L", \ |
|
27565 | 83 |
OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libinstrument, \ |
25859 | 84 |
DEBUG_SYMBOLS := true)) |
85 |
||
86 |
ifneq (, $(findstring $(OPENJDK_TARGET_OS), macosx windows aix)) |
|
27565 | 87 |
$(BUILD_LIBINSTRUMENT): $(SUPPORT_OUTPUTDIR)/native/java.base/$(LIBRARY_PREFIX)jli_static$(STATIC_LIBRARY_SUFFIX) |
25859 | 88 |
else |
27565 | 89 |
$(BUILD_LIBINSTRUMENT): $(call FindLib, java.base, jli, /jli) |
25859 | 90 |
endif |
91 |
$(BUILD_LIBINSTRUMENT): $(BUILD_LIBJAVA) |
|
92 |
||
27565 | 93 |
TARGETS += $(BUILD_LIBINSTRUMENT) |
25859 | 94 |
|
95 |
################################################################################ |