make/lib/Lib-jdk.hotspot.agent.gmk
author ihse
Wed, 21 Mar 2018 12:54:36 +0100
changeset 49274 9f3ce373370a
parent 49244 995a5556edfa
child 49440 396ea30afbd5
permissions -rw-r--r--
8199682: Clean up building the saproc library Reviewed-by: erikj, dholmes, sundar
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
34289
2d1821a50263 8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff changeset
     1
#
49070
d7859531621b 8198751: Refactor SetupNativeCompilation to take NAME and TYPE
ihse
parents: 47314
diff changeset
     2
# Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
34289
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
49244
995a5556edfa 8199639: Introduce SetupJdkLibrary and SetupJdkExecutable
ihse
parents: 49241
diff changeset
    26
include LibCommon.gmk
34289
2d1821a50263 8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff changeset
    27
47314
743814386712 8188814: Simplify IncludeCustomExtension
ihse
parents: 47217
diff changeset
    28
$(eval $(call IncludeCustomExtension, hotspot/lib/Lib-jdk.hotspot.agent.gmk))
34289
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
47217
72e3ae9a25eb 8187444: Forest Consolidation: Make build work
erikj
parents: 47216
diff changeset
    32
SA_TOPDIR := $(TOPDIR)/src/jdk.hotspot.agent
34289
2d1821a50263 8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff changeset
    33
49274
9f3ce373370a 8199682: Clean up building the saproc library
ihse
parents: 49244
diff changeset
    34
SA_SRC += \
9f3ce373370a 8199682: Clean up building the saproc library
ihse
parents: 49244
diff changeset
    35
    $(SA_TOPDIR)/share/native/libsaproc \
9f3ce373370a 8199682: Clean up building the saproc library
ihse
parents: 49244
diff changeset
    36
    $(SA_TOPDIR)/$(OPENJDK_TARGET_OS)/native/libsaproc \
9f3ce373370a 8199682: Clean up building the saproc library
ihse
parents: 49244
diff changeset
    37
    #
9f3ce373370a 8199682: Clean up building the saproc library
ihse
parents: 49244
diff changeset
    38
47217
72e3ae9a25eb 8187444: Forest Consolidation: Make build work
erikj
parents: 47216
diff changeset
    39
SA_MAPFILE := $(TOPDIR)/make/mapfiles/libsaproc/mapfile-$(OPENJDK_TARGET_OS)
49274
9f3ce373370a 8199682: Clean up building the saproc library
ihse
parents: 49244
diff changeset
    40
34289
2d1821a50263 8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff changeset
    41
SA_INCLUDES := \
2d1821a50263 8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff changeset
    42
    $(addprefix -I, $(SA_SRC)) \
2d1821a50263 8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff changeset
    43
    -I$(SUPPORT_OUTPUTDIR)/headers/jdk.hotspot.agent \
47217
72e3ae9a25eb 8187444: Forest Consolidation: Make build work
erikj
parents: 47216
diff changeset
    44
    -I$(TOPDIR)/src/hotspot/os/$(OPENJDK_TARGET_OS) \
34289
2d1821a50263 8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff changeset
    45
    #
2d1821a50263 8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff changeset
    46
49239
c35ec365e329 8199483: Clean up some non-standard LDFLAGS usage
ihse
parents: 49160
diff changeset
    47
ifeq ($(OPENJDK_TARGET_OS), linux)
49274
9f3ce373370a 8199682: Clean up building the saproc library
ihse
parents: 49244
diff changeset
    48
  SA_CFLAGS := -D_FILE_OFFSET_BITS=64
34289
2d1821a50263 8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff changeset
    49
2d1821a50263 8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff changeset
    50
else ifeq ($(OPENJDK_TARGET_OS), solaris)
49274
9f3ce373370a 8199682: Clean up building the saproc library
ihse
parents: 49244
diff changeset
    51
  SA_LDFLAGS := -mt
34289
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
else ifeq ($(OPENJDK_TARGET_OS), macosx)
49274
9f3ce373370a 8199682: Clean up building the saproc library
ihse
parents: 49244
diff changeset
    54
  SA_CFLAGS := -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
    55
      -mstack-alignment=16 -fPIC
34289
2d1821a50263 8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff changeset
    56
else ifeq ($(OPENJDK_TARGET_OS), windows)
49274
9f3ce373370a 8199682: Clean up building the saproc library
ihse
parents: 49244
diff changeset
    57
  SA_CFLAGS := -D_WINDOWS -D_DEBUG -D_CONSOLE -D_MBCS -EHsc
34289
2d1821a50263 8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff changeset
    58
  ifeq ($(OPENJDK_TARGET_CPU), x86_64)
49274
9f3ce373370a 8199682: Clean up building the saproc library
ihse
parents: 49244
diff changeset
    59
    SA_CXXFLAGS := -DWIN64
34289
2d1821a50263 8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff changeset
    60
  else
49274
9f3ce373370a 8199682: Clean up building the saproc library
ihse
parents: 49244
diff changeset
    61
    SA_CXXFLAGS := -RTC1
34289
2d1821a50263 8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff changeset
    62
  endif
2d1821a50263 8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff changeset
    63
endif
2d1821a50263 8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff changeset
    64
2d1821a50263 8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff changeset
    65
################################################################################
2d1821a50263 8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff changeset
    66
49244
995a5556edfa 8199639: Introduce SetupJdkLibrary and SetupJdkExecutable
ihse
parents: 49241
diff changeset
    67
$(eval $(call SetupJdkLibrary, BUILD_LIBSA, \
49274
9f3ce373370a 8199682: Clean up building the saproc library
ihse
parents: 49244
diff changeset
    68
    NAME := saproc, \
34289
2d1821a50263 8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff changeset
    69
    OPTIMIZATION := NONE, \
2d1821a50263 8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff changeset
    70
    DISABLED_WARNINGS_microsoft := 4267, \
2d1821a50263 8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff changeset
    71
    DISABLED_WARNINGS_gcc := sign-compare, \
2d1821a50263 8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff changeset
    72
    DISABLED_WARNINGS_CXX_solstudio := truncwarn unknownpragma, \
2d1821a50263 8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff changeset
    73
    SRC := $(SA_SRC), \
49274
9f3ce373370a 8199682: Clean up building the saproc library
ihse
parents: 49244
diff changeset
    74
    CFLAGS := $(CFLAGS_JDKLIB) $(SA_INCLUDES) $(SA_CFLAGS) $(SA_CUSTOM_CFLAGS), \
9f3ce373370a 8199682: Clean up building the saproc library
ihse
parents: 49244
diff changeset
    75
    CXXFLAGS := $(CXXFLAGS_JDKLIB) $(SA_INCLUDES) $(SA_CFLAGS) $(SA_CXXFLAGS), \
49239
c35ec365e329 8199483: Clean up some non-standard LDFLAGS usage
ihse
parents: 49160
diff changeset
    76
    LDFLAGS := $(LDFLAGS_JDKLIB) $(SA_LDFLAGS), \
49274
9f3ce373370a 8199682: Clean up building the saproc library
ihse
parents: 49244
diff changeset
    77
    LIBS_linux := -lthread_db $(LIBDL), \
9f3ce373370a 8199682: Clean up building the saproc library
ihse
parents: 49244
diff changeset
    78
    LIBS_solaris := -ldl -ldemangle -lthread -lproc, \
9f3ce373370a 8199682: Clean up building the saproc library
ihse
parents: 49244
diff changeset
    79
    LIBS_macosx := -framework Foundation -framework JavaNativeFoundation \
9f3ce373370a 8199682: Clean up building the saproc library
ihse
parents: 49244
diff changeset
    80
        -framework JavaRuntimeSupport -framework Security -framework CoreFoundation, \
9f3ce373370a 8199682: Clean up building the saproc library
ihse
parents: 49244
diff changeset
    81
    LIBS_windows := dbgeng.lib, \
34289
2d1821a50263 8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff changeset
    82
    MAPFILE := $(SA_MAPFILE), \
2d1821a50263 8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff changeset
    83
))
2d1821a50263 8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff changeset
    84
2d1821a50263 8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff changeset
    85
TARGETS += $(BUILD_LIBSA)
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
################################################################################