make/altsrc.make

Tue, 08 Aug 2017 15:57:29 +0800

author
aoqi
date
Tue, 08 Aug 2017 15:57:29 +0800
changeset 6876
710a3c8b516e
parent 2863
ededdaaf8ca5
parent 0
f90c822e73f8
permissions
-rw-r--r--

merge

aoqi@0 1 #
aoqi@0 2 # Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
aoqi@0 3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
aoqi@0 4 #
aoqi@0 5 # This code is free software; you can redistribute it and/or modify it
aoqi@0 6 # under the terms of the GNU General Public License version 2 only, as
aoqi@0 7 # published by the Free Software Foundation.
aoqi@0 8 #
aoqi@0 9 # This code is distributed in the hope that it will be useful, but WITHOUT
aoqi@0 10 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
aoqi@0 11 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
aoqi@0 12 # version 2 for more details (a copy is included in the LICENSE file that
aoqi@0 13 # accompanied this code).
aoqi@0 14 #
aoqi@0 15 # You should have received a copy of the GNU General Public License version
aoqi@0 16 # 2 along with this work; if not, write to the Free Software Foundation,
aoqi@0 17 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
aoqi@0 18 #
aoqi@0 19 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
aoqi@0 20 # or visit www.oracle.com if you need additional information or have any
aoqi@0 21 # questions.
aoqi@0 22 #
aoqi@0 23 #
aoqi@0 24
aoqi@0 25 # This file defines variables and macros which are used in the makefiles to
aoqi@0 26 # allow distributions to augment or replace common hotspot code with
aoqi@0 27 # distribution-specific source files. This capability is disabled when
aoqi@0 28 # an OPENJDK build is requested, unless HS_ALT_SRC_REL has been set externally.
aoqi@0 29
aoqi@0 30 # Requires: GAMMADIR
aoqi@0 31 # Provides:
aoqi@0 32 # variables: HS_COMMON_SRC, HS_ALT_SRC, HS_COMMON_SRC_REL, and HS_ALT_SRC_REL
aoqi@0 33 # functions: altsrc-equiv, if-has-altsrc, altsrc, altsrc-replace
aoqi@0 34
aoqi@0 35 HS_COMMON_SRC_REL=src
aoqi@0 36
aoqi@0 37 ifneq ($(OPENJDK),true)
aoqi@0 38 # This needs to be changed to a more generic location, but we keep it
aoqi@0 39 # as this for now for compatibility
aoqi@0 40 HS_ALT_SRC_REL=src/closed
aoqi@0 41 else
aoqi@0 42 HS_ALT_SRC_REL=NO_SUCH_PATH
aoqi@0 43 endif
aoqi@0 44
aoqi@0 45 HS_COMMON_SRC=$(GAMMADIR)/$(HS_COMMON_SRC_REL)
aoqi@0 46 HS_ALT_SRC=$(GAMMADIR)/$(HS_ALT_SRC_REL)
aoqi@0 47
aoqi@0 48 ## altsrc-equiv
aoqi@0 49 #
aoqi@0 50 # Convert a common source path to an alternative source path
aoqi@0 51 #
aoqi@0 52 # Parameter: An absolute path into the common sources
aoqi@0 53 # Result: The matching path to the alternate-source location
aoqi@0 54 #
aoqi@0 55 altsrc-equiv=$(subst $(HS_COMMON_SRC)/,$(HS_ALT_SRC)/,$(1))
aoqi@0 56
aoqi@0 57
aoqi@0 58 ## if-has-altsrc
aoqi@0 59 #
aoqi@0 60 # Conditional macro to test for the existence of an alternate source path
aoqi@0 61 #
aoqi@0 62 # Parameter: An absolute path into the common sources
aoqi@0 63 # Parameter: Result if the alternative-source location exists
aoqi@0 64 # Parameter: Result if the alternative-source location does not exist
aoqi@0 65 # Result: expands to parameter 2 or 3 depending on existence of alternate source
aoqi@0 66 #
aoqi@0 67 if-has-altsrc=$(if $(wildcard $(call altsrc-equiv,$(1))),$(2),$(3))
aoqi@0 68
aoqi@0 69
aoqi@0 70 ## altsrc
aoqi@0 71 #
aoqi@0 72 # Converts common source path to alternate source path if the alternate
aoqi@0 73 # path exists, otherwise evaluates to nul (empty string)
aoqi@0 74 #
aoqi@0 75 # Parameter: An absolute path into the common sources
aoqi@0 76 # Result: The equivalent path to the alternate-source location, if such a
aoqi@0 77 # location exists on the filesystem. Otherwise it expands to empty.
aoqi@0 78 #
aoqi@0 79 altsrc=$(call if-has-altsrc,$(1),$(call altsrc-equiv,$(1)))
aoqi@0 80
aoqi@0 81 ## commonsrc
aoqi@0 82 #
aoqi@0 83 # Returns parameter.
aoqi@0 84 #
aoqi@0 85 commonsrc=$(1)
aoqi@0 86
aoqi@0 87
aoqi@0 88 ## altsrc-replace
aoqi@0 89 #
aoqi@0 90 # Converts a common source path to an alternate source path if the alternate
aoqi@0 91 # source path exists. Otherwise it evaluates to the input common source path.
aoqi@0 92 #
aoqi@0 93 # Parameter: An absolute path into the common sources
aoqi@0 94 # Result: A path to either the common or alternate sources
aoqi@0 95 #
aoqi@0 96 altsrc-replace=$(call if-has-altsrc,$(1),$(call altsrc-equiv,$(1)),$(1))

mercurial