make/hotspot/lib/CompileDtraceLibraries.gmk
author ihse
Mon, 09 Apr 2018 19:23:01 +0200
changeset 49553 58cffb6ec13c
parent 49241 make/hotspot/lib/CompileDtracePostJvm.gmk@de4b3a04feae
child 51727 49b885c1711a
child 56723 d927981eeb64
child 56726 3a9b7a1f9197
permissions -rw-r--r--
8201236: Straighten out dtrace build logic Reviewed-by: erikj

#
# Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 2 only, as
# published by the Free Software Foundation.  Oracle designates this
# particular file as subject to the "Classpath" exception as provided
# by Oracle in the LICENSE file that accompanied this code.
#
# This code is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
# version 2 for more details (a copy is included in the LICENSE file that
# accompanied this code).
#
# You should have received a copy of the GNU General Public License version
# 2 along with this work; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
#
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
# or visit www.oracle.com if you need additional information or have any
# questions.
#

ifeq ($(call check-jvm-feature, dtrace), true)
  ifeq ($(OPENJDK_TARGET_OS), solaris)

    ############################################################################
    # Build the stand-alone dtrace libraries.

    LIBJVM_DTRACE_OUTPUTDIR := $(JVM_VARIANT_OUTPUTDIR)/libjvm_dtrace
    $(eval $(call SetupNativeCompilation, BUILD_LIBJVM_DTRACE, \
        NAME := jvm_dtrace, \
        OUTPUT_DIR := $(JVM_LIB_OUTPUTDIR), \
        SRC := $(TOPDIR)/src/java.base/solaris/native/libjvm_dtrace, \
        CFLAGS := -m64 -G -mt -KPIC, \
        LDFLAGS := -m64 -mt -xnolib $(SHARED_LIBRARY_FLAGS), \
        LIBS := $(LIBDL) -lthread -ldoor, \
        MAPFILE := $(TOPDIR)/make/mapfiles/libjvm_dtrace/mapfile-vers, \
        OBJECT_DIR := $(LIBJVM_DTRACE_OUTPUTDIR)/objs, \
    ))

    # Note that libjvm_db.c has tests for COMPILER2, but this was never set by
    # the old build.
    LIBJVM_DB_OUTPUTDIR := $(JVM_VARIANT_OUTPUTDIR)/libjvm_db
    $(eval $(call SetupNativeCompilation, BUILD_LIBJVM_DB, \
        NAME := jvm_db, \
        OUTPUT_DIR := $(JVM_LIB_OUTPUTDIR), \
        SRC := $(TOPDIR)/src/java.base/solaris/native/libjvm_db, \
        CFLAGS := -I$(DTRACE_GENSRC_DIR) -m64 -G -mt -KPIC, \
        LDFLAGS := -m64 -mt -xnolib $(SHARED_LIBRARY_FLAGS), \
        MAPFILE := $(TOPDIR)/make/mapfiles/libjvm_db/mapfile-vers, \
        OBJECT_DIR := $(LIBJVM_DB_OUTPUTDIR)/objs, \
    ))

    TARGETS += $(BUILD_LIBJVM_DTRACE) $(BUILD_LIBJVM_DB)

  endif
endif