2073N/A#
2073N/A# Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
2073N/A# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
2073N/A#
2073N/A# This code is free software; you can redistribute it and/or modify it
2073N/A# under the terms of the GNU General Public License version 2 only, as
2073N/A# published by the Free Software Foundation.
2073N/A#
2073N/A# This code is distributed in the hope that it will be useful, but WITHOUT
2073N/A# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
2073N/A# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
2073N/A# version 2 for more details (a copy is included in the LICENSE file that
2073N/A# accompanied this code).
2073N/A#
2073N/A# You should have received a copy of the GNU General Public License version
2073N/A# 2 along with this work; if not, write to the Free Software Foundation,
2073N/A# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
2073N/A#
2073N/A# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
2073N/A# or visit www.oracle.com if you need additional information or have any
2073N/A# questions.
2073N/A#
2073N/A#
2073N/A
2080N/A# This file defines variables and macros which are used in the makefiles to
2080N/A# allow distributions to augment or replace common hotspot code with
2428N/A# distribution-specific source files. This capability is disabled when
2428N/A# an OPENJDK build is requested, unless HS_ALT_SRC_REL has been set externally.
2080N/A
2080N/A# Requires: GAMMADIR
2080N/A# Provides:
2080N/A# variables: HS_COMMON_SRC, HS_ALT_SRC, HS_COMMON_SRC_REL, and HS_ALT_SRC_REL
2080N/A# functions: altsrc-equiv, if-has-altsrc, altsrc, altsrc-replace
2080N/A
2080N/AHS_COMMON_SRC_REL=src
2073N/A
2428N/Aifneq ($(OPENJDK),true)
2428N/A # This needs to be changed to a more generic location, but we keep it
2428N/A # as this for now for compatibility
2428N/A HS_ALT_SRC_REL=src/closed
2428N/Aelse
2428N/A HS_ALT_SRC_REL=NO_SUCH_PATH
2428N/Aendif
2080N/A
2080N/AHS_COMMON_SRC=$(GAMMADIR)/$(HS_COMMON_SRC_REL)
2080N/AHS_ALT_SRC=$(GAMMADIR)/$(HS_ALT_SRC_REL)
2080N/A
2080N/A## altsrc-equiv
2080N/A#
2080N/A# Convert a common source path to an alternative source path
2080N/A#
2080N/A# Parameter: An absolute path into the common sources
2080N/A# Result: The matching path to the alternate-source location
2080N/A#
2080N/Aaltsrc-equiv=$(subst $(HS_COMMON_SRC)/,$(HS_ALT_SRC)/,$(1))
2080N/A
2073N/A
2080N/A## if-has-altsrc
2080N/A#
2080N/A# Conditional macro to test for the existence of an alternate source path
2080N/A#
2080N/A# Parameter: An absolute path into the common sources
2080N/A# Parameter: Result if the alternative-source location exists
2080N/A# Parameter: Result if the alternative-source location does not exist
2080N/A# Result: expands to parameter 2 or 3 depending on existence of alternate source
2080N/A#
2080N/Aif-has-altsrc=$(if $(wildcard $(call altsrc-equiv,$(1))),$(2),$(3))
2073N/A
2073N/A
2080N/A## altsrc
2080N/A#
2080N/A# Converts common source path to alternate source path if the alternate
2080N/A# path exists, otherwise evaluates to nul (empty string)
2080N/A#
2080N/A# Parameter: An absolute path into the common sources
2080N/A# Result: The equivalent path to the alternate-source location, if such a
2080N/A# location exists on the filesystem. Otherwise it expands to empty.
2080N/A#
2080N/Aaltsrc=$(call if-has-altsrc,$(1),$(call altsrc-equiv,$(1)))
2073N/A
2080N/A## commonsrc
2080N/A#
2080N/A# Returns parameter.
2080N/A#
2080N/Acommonsrc=$(1)
2080N/A
2073N/A
2080N/A## altsrc-replace
2080N/A#
2080N/A# Converts a common source path to an alternate source path if the alternate
2080N/A# source path exists. Otherwise it evaluates to the input common source path.
2080N/A#
2080N/A# Parameter: An absolute path into the common sources
2080N/A# Result: A path to either the common or alternate sources
2080N/A#
2080N/Aaltsrc-replace=$(call if-has-altsrc,$(1),$(call altsrc-equiv,$(1)),$(1))