hotspot/make/lib/JvmFeatures.gmk
author vlivanov
Fri, 06 May 2016 19:45:22 +0300
changeset 38245 c6c2ac29463b
parent 38097 1ca3d6f508b1
child 41674 8ff2f216109b
permissions -rw-r--r--
Merge

#
# Copyright (c) 2013, 2016, 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.
#

$(eval $(call IncludeCustomExtension, hotspot, lib/JvmFeatures.gmk))

################################################################################
# Setup CFLAGS and EXCLUDES for the libjvm compilation, depending on which
# jvm features are selected for this jvm variant.

ifeq ($(call check-jvm-feature, compiler1), true)
  JVM_CFLAGS_FEATURES += -DCOMPILER1
else
  JVM_EXCLUDE_PATTERNS += c1_
endif

ifeq ($(call check-jvm-feature, compiler2), true)
  JVM_CFLAGS_FEATURES += -DCOMPILER2
  JVM_SRC_DIRS += $(JVM_VARIANT_OUTPUTDIR)/gensrc/adfiles
else
  JVM_EXCLUDES += opto libadt
  JVM_EXCLUDE_FILES += bcEscapeAnalyzer.cpp ciTypeFlow.cpp
  JVM_EXCLUDE_PATTERNS += c2_ runtime_
endif

ifeq ($(call check-jvm-feature, zero), true)
  JVM_CFLAGS_FEATURES += -DZERO -DCC_INTERP -DZERO_LIBARCH='"$(OPENJDK_TARGET_CPU_LEGACY_LIB)"' $(LIBFFI_CFLAGS)
  JVM_LIBS_FEATURES += $(LIBFFI_LIBS)
endif

ifeq ($(call check-jvm-feature, shark), true)
  JVM_CFLAGS_FEATURES += -DSHARK $(LLVM_CFLAGS)
  JVM_LDFLAGS_FEATURES += $(LLVM_LDFLAGS)
  JVM_LIBS_FEATURES += $(LLVM_LIBS)
else
  JVM_EXCLUDES += shark
endif

ifeq ($(call check-jvm-feature, minimal), true)
  JVM_CFLAGS_FEATURES += -DMINIMAL_JVM -DVMTYPE=\"Minimal\"
endif

ifeq ($(call check-jvm-feature, dtrace), true)
  JVM_CFLAGS_FEATURES += -DDTRACE_ENABLED
endif

ifeq ($(call check-jvm-feature, static-build), true)
  JVM_CFLAGS_FEATURES += -DSTATIC_BUILD=1
endif

ifneq ($(call check-jvm-feature, jvmti), true)
  JVM_CFLAGS_FEATURES += -DINCLUDE_JVMTI=0
  JVM_EXCLUDE_FILES += jvmtiGetLoadedClasses.cpp jvmtiThreadState.cpp jvmtiExtensions.cpp \
      jvmtiImpl.cpp jvmtiManageCapabilities.cpp jvmtiRawMonitor.cpp jvmtiUtil.cpp jvmtiTrace.cpp \
      jvmtiCodeBlobEvents.cpp jvmtiEnv.cpp jvmtiRedefineClasses.cpp jvmtiEnvBase.cpp jvmtiEnvThreadState.cpp \
      jvmtiTagMap.cpp jvmtiEventController.cpp evmCompat.cpp jvmtiEnter.xsl jvmtiExport.cpp \
      jvmtiClassFileReconstituter.cpp
endif

ifneq ($(call check-jvm-feature, jvmci), true)
  JVM_CFLAGS_FEATURES += -DINCLUDE_JVMCI=0
  JVM_EXCLUDES += jvmci
  JVM_EXCLUDE_FILES += jvmciCodeInstaller_$(HOTSPOT_TARGET_CPU_ARCH).cpp
endif

ifneq ($(call check-jvm-feature, fprof), true)
  JVM_CFLAGS_FEATURES += -DINCLUDE_FPROF=0
  JVM_EXCLUDE_FILES += fprofiler.cpp
endif

ifneq ($(call check-jvm-feature, vm-structs), true)
  JVM_CFLAGS_FEATURES += -DINCLUDE_VM_STRUCTS=0
  JVM_EXCLUDE_FILES += vmStructs.cpp
endif

ifneq ($(call check-jvm-feature, jni-check), true)
  JVM_CFLAGS_FEATURES += -DINCLUDE_JNI_CHECK=0
  JVM_EXCLUDE_FILES += jniCheck.cpp
endif

ifneq ($(call check-jvm-feature, services), true)
  JVM_CFLAGS_FEATURES += -DINCLUDE_SERVICES=0
  JVM_EXCLUDE_FILES += heapDumper.cpp heapInspection.cpp \
      attachListener_$(HOTSPOT_TARGET_OS).cpp attachListener.cpp
endif

ifneq ($(call check-jvm-feature, management), true)
  JVM_CFLAGS_FEATURES += -DINCLUDE_MANAGEMENT=0
endif

ifneq ($(call check-jvm-feature, cds), true)
  JVM_CFLAGS_FEATURES += -DINCLUDE_CDS=0
  JVM_EXCLUDE_FILES += \
      classListParser.cpp \
      classLoaderExt.cpp \
      filemap.cpp \
      metaspaceShared.cpp \
      metaspaceShared_$(HOTSPOT_TARGET_CPU).cpp \
      metaspaceShared_$(HOTSPOT_TARGET_CPU_ARCH).cpp \
      sharedClassUtil.cpp \
      sharedPathsMiscInfo.cpp \
      systemDictionaryShared.cpp \
      #
endif

ifneq ($(call check-jvm-feature, all-gcs), true)
  JVM_CFLAGS_FEATURES += -DINCLUDE_ALL_GCS=0
  JVM_EXCLUDE_PATTERNS += \
      cms/ g1/ parallel/
  JVM_EXCLUDE_FILES += \
      concurrentGCThread.cpp \
      plab.cpp
  JVM_EXCLUDE_FILES += \
      g1MemoryPool.cpp \
      psMemoryPool.cpp
endif

ifneq ($(call check-jvm-feature, nmt), true)
  JVM_CFLAGS_FEATURES += -DINCLUDE_NMT=0
  JVM_EXCLUDE_FILES += \
      memBaseline.cpp memReporter.cpp mallocTracker.cpp virtualMemoryTracker.cpp nmtCommon.cpp \
      memTracker.cpp nmtDCmd.cpp mallocSiteTable.cpp
endif