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