components/golang/Makefile
author Shawn Walker-Salas <shawn.walker@oracle.com>
Wed, 30 Mar 2016 22:54:17 -0700
changeset 5715 f94135b42f59
parent 5428 3c05d530e67e
child 5780 42f59614ccbf
permissions -rw-r--r--
22992886 golang should bootstrap itself
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
5331
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
     1
#
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
     2
# CDDL HEADER START
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
     3
#
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
     4
# The contents of this file are subject to the terms of the
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
     5
# Common Development and Distribution License (the "License").
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
     6
# You may not use this file except in compliance with the License.
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
     7
#
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
     8
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
     9
# or http://www.opensolaris.org/os/licensing.
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
    10
# See the License for the specific language governing permissions
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
    11
# and limitations under the License.
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
    12
#
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
    13
# When distributing Covered Code, include this CDDL HEADER in each
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
    14
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
    15
# If applicable, add the following below this CDDL HEADER, with the
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
    16
# fields enclosed by brackets "[]" replaced with your own identifying
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
    17
# information: Portions Copyright [yyyy] [name of copyright owner]
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
    18
#
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
    19
# CDDL HEADER END
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
    20
#
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
    21
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
    22
#
5428
3c05d530e67e 22665751 golang packages confuse elfsign
Shawn Walker-Salas <shawn.walker@oracle.com>
parents: 5331
diff changeset
    23
# Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
5331
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
    24
#
5715
f94135b42f59 22992886 golang should bootstrap itself
Shawn Walker-Salas <shawn.walker@oracle.com>
parents: 5428
diff changeset
    25
BUILD_ARCH= i386
f94135b42f59 22992886 golang should bootstrap itself
Shawn Walker-Salas <shawn.walker@oracle.com>
parents: 5428
diff changeset
    26
BUILD_BITS= 64
f94135b42f59 22992886 golang should bootstrap itself
Shawn Walker-Salas <shawn.walker@oracle.com>
parents: 5428
diff changeset
    27
COMPILER= gcc
5331
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
    28
# The golang build process just doesn't work with Parfait.
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
    29
export PARFAIT_BUILD=no
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
    30
include ../../make-rules/shared-macros.mk
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
    31
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
    32
PATCH_EACH_ARCHIVE= 1
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
    33
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
    34
COMPONENT_NAME=		golang
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
    35
COMPONENT_VERSION=	1.5
5428
3c05d530e67e 22665751 golang packages confuse elfsign
Shawn Walker-Salas <shawn.walker@oracle.com>
parents: 5331
diff changeset
    36
COMPONENT_MAJOR_VERSION=	$(shell echo $(COMPONENT_VERSION) | $(GSED) -e 's/\([0-9]\+\.[0-9]\+\).*/\1/')
5331
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
    37
COMPONENT_PROJECT_URL=	https://golang.org/
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
    38
COMPONENT_ARCHIVE=	go$(COMPONENT_VERSION).src.tar.gz
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
    39
COMPONENT_ARCHIVE_URL=	https://storage.googleapis.com/golang/$(COMPONENT_ARCHIVE)
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
    40
COMPONENT_ARCHIVE_HASH=	 \
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
    41
	sha256:be81abec996d5126c05f2d36facc8e58a94d9183a56f026fc9441401d80062db
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
    42
COMPONENT_PROJECT_URL=	https://golang.org
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
    43
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
    44
ARC_CASE=		PSARC/2015/203
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
    45
TPNO=			23679
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
    46
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
    47
# Go has a number of supplementary tools and packages that are located in
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
    48
# separate archives or source repositories. Because Go currently forces a
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
    49
# recompile of all packages whenever the compiler changes, building and
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
    50
# delivering them within the same build component build process is the best
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
    51
# option for now.
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
    52
5715
f94135b42f59 22992886 golang should bootstrap itself
Shawn Walker-Salas <shawn.walker@oracle.com>
parents: 5428
diff changeset
    53
# The long-term plan for packaging Go is roughly as follows:
5331
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
    54
#
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
    55
# - when SPARC support is integrated into Go upstream, build upstream version
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
    56
#   using system Go for x86, then build Go for SPARC using upstream version
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
    57
#   just built for x86 (cross-compilation), package both at the same time
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
    58
# - after SPARC version has been available for at least a few builds in the
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
    59
#   WOS, switch to building Go with system version for x86 and SPARC
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
    60
#
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
    61
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
    62
# Supplementary packages; these are delivered as source only for now as the
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
    63
# paths to the compiled packages are written directly into the binaries and
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
    64
# there's no way (currently) to fix that during the build process.
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
    65
SUPP_PACKAGES=		crypto image lint net sys text tools tour
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
    66
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
    67
define supp-rules
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
    68
COMPONENT_NAME_$(1)=		$(1)
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
    69
COMPONENT_VERSION_$(1)=		$(COMPONENT_VERSION)
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
    70
COMPONENT_IMPORT_SRC_$(1)=	golang.org/x
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
    71
GIT_REPO_$(1)=			https://github.com/golang/$(1).git
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
    72
TPNO_$(1)=			$(TPNO)
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
    73
endef
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
    74
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
    75
$(foreach suffix, $(SUPP_PACKAGES), $(eval $(call supp-rules,$(suffix))))
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
    76
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
    77
# Desired "revision" of Go's "community" libraries; these are arbitrary
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
    78
# revisions chosen from the last commit to the respective repository at the
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
    79
# same time that this component was updated as there is no formal release
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
    80
# process for these packages.  Whenever Go is updated, these should be as well.
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
    81
GIT_COMMIT_ID_crypto=		0c93e1ff9f91f0c63bf17b123de503d023434fdd
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
    82
GIT_COMMIT_ID_image=		baddd3465a05d84a6d8d3507547a91cb188c81ea
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
    83
GIT_COMMIT_ID_lint=		32a87160691b3c96046c0c678fe57c5bef761456
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
    84
GIT_COMMIT_ID_net=		b4e17d61b15679caf2335da776c614169a1b4643
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
    85
GIT_COMMIT_ID_sys=		d9157a9621b69ad1d8d77a1933590c416593f24f
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
    86
GIT_COMMIT_ID_text=		22af8577cc7d0b37e7fb5708399a12115bfe6900
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
    87
GIT_COMMIT_ID_tools=		ac6d9c1d842f9b6482f39f7a172e0251a0f7cbc0
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
    88
GIT_COMMIT_ID_tour=		1c790b9f8bfefe44f33fbc9aacf5a6bc06027321
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
    89
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
    90
# Resulting hash of related git commit once archived.
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
    91
COMPONENT_ARCHIVE_HASH_crypto=	\
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
    92
	sha256:6b088fa04632857c7b6244bf887f560f9fe2efa8342072f3837e9fe556c1190e
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
    93
COMPONENT_ARCHIVE_HASH_image=	\
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
    94
	sha256:96951cea9d34603209961d46010610894df6c708321e1b4781d71bdd180e75b8
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
    95
COMPONENT_ARCHIVE_HASH_lint=	\
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
    96
	sha256:1b5f8c917056dc850da9220a19f907ed323c62e1f42f5a09f3648ee73a98ae6d
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
    97
COMPONENT_ARCHIVE_HASH_net=	\
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
    98
	sha256:dca84ca46ed8eb46db12c27a3b5720acacdd6d0206304453d48056d6b9688e81
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
    99
COMPONENT_ARCHIVE_HASH_sys=	\
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
   100
	sha256:267416d3f0cda4c916192e5c2587ba2a591a593a0c8dc65df3e7f5e5c791acc7
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
   101
COMPONENT_ARCHIVE_HASH_text=	\
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
   102
	sha256:8484f1a25689f0e45c11768ed054acb7b747fe5b22c23565e744ec5c40f0e4c6
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
   103
COMPONENT_ARCHIVE_HASH_tools=	\
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
   104
	sha256:a02ef6a6c344bc6c643af00a6ba0549c7442fa0111279dca601341d16683ba56
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
   105
COMPONENT_ARCHIVE_HASH_tour=	\
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
   106
	sha256:19e6a5396b7b65cece97cb203a335a2924c6cd648709d80ef8aa3c220aab8f88
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
   107
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
   108
# Go package imports for lint are found in github directory.
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
   109
COMPONENT_IMPORT_SRC_lint=	github.com/golang
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
   110
5428
3c05d530e67e 22665751 golang packages confuse elfsign
Shawn Walker-Salas <shawn.walker@oracle.com>
parents: 5331
diff changeset
   111
# Go's "not well-formed" elf objects confuse elfsign, which then causes
3c05d530e67e 22665751 golang packages confuse elfsign
Shawn Walker-Salas <shawn.walker@oracle.com>
parents: 5331
diff changeset
   112
# problems for RE.  For now, we workaround this by adding the
3c05d530e67e 22665751 golang packages confuse elfsign
Shawn Walker-Salas <shawn.walker@oracle.com>
parents: 5331
diff changeset
   113
# 'com.oracle.elfsign=false' tag to every elf object.
3c05d530e67e 22665751 golang packages confuse elfsign
Shawn Walker-Salas <shawn.walker@oracle.com>
parents: 5331
diff changeset
   114
NO_ELFSIGN_MOG=		$(BUILD_DIR)/no-elfsign.mog
3c05d530e67e 22665751 golang packages confuse elfsign
Shawn Walker-Salas <shawn.walker@oracle.com>
parents: 5331
diff changeset
   115
5331
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
   116
# We're x86-only for now.
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
   117
ifeq ($(MACH), sparc)
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
   118
PUBLISH_STAMP=
5428
3c05d530e67e 22665751 golang packages confuse elfsign
Shawn Walker-Salas <shawn.walker@oracle.com>
parents: 5331
diff changeset
   119
else
3c05d530e67e 22665751 golang packages confuse elfsign
Shawn Walker-Salas <shawn.walker@oracle.com>
parents: 5331
diff changeset
   120
PUBLISH_STAMP= $(NO_ELFSIGN_MOG) $(BUILD_DIR)/.published-$(MACH)
5331
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
   121
endif
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
   122
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
   123
# Bake in where Go package will be installed.
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
   124
GOROOT_FINAL=		/usr/lib/golang/$(COMPONENT_MAJOR_VERSION)
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
   125
# Enable easier stack unwinding for debugging.
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
   126
GOEXPERIMENT=		framepointer
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
   127
COMPONENT_BUILD_ENV +=	GOROOT_FINAL="$(GOROOT_FINAL)"
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
   128
COMPONENT_BUILD_ENV +=	GOEXPERIMENT="$(GOEXPERIMENT)"
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
   129
COMPONENT_BUILD_ENV +=	\
5715
f94135b42f59 22992886 golang should bootstrap itself
Shawn Walker-Salas <shawn.walker@oracle.com>
parents: 5428
diff changeset
   130
	GOROOT_BOOTSTRAP="$(USRLIBDIR)/golang/1.5"
5331
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
   131
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
   132
# Install root for supplementary packages.
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
   133
SUPP_ROOT=$(PROTOUSRLIBDIR)/gocode/$(COMPONENT_MAJOR_VERSION)
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
   134
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
   135
# For convenience during installation of supplementary packages.
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
   136
COMPONENT_INSTALL_ENV += PATH="$(PROTO_DIR)$(GOROOT_FINAL)/bin:$(PATH)"
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
   137
COMPONENT_INSTALL_ENV += GOROOT="$(PROTO_DIR)$(GOROOT_FINAL)"
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
   138
COMPONENT_INSTALL_ENV += GOPATH="$(SUPP_ROOT)"
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
   139
5715
f94135b42f59 22992886 golang should bootstrap itself
Shawn Walker-Salas <shawn.walker@oracle.com>
parents: 5428
diff changeset
   140
BUILD_STYLE= justmake
f94135b42f59 22992886 golang should bootstrap itself
Shawn Walker-Salas <shawn.walker@oracle.com>
parents: 5428
diff changeset
   141
BUILD_64 += $(BUILD_DIR)/man1/go.1
f94135b42f59 22992886 golang should bootstrap itself
Shawn Walker-Salas <shawn.walker@oracle.com>
parents: 5428
diff changeset
   142
INSTALL_64 := build $(INSTALL_64)
f94135b42f59 22992886 golang should bootstrap itself
Shawn Walker-Salas <shawn.walker@oracle.com>
parents: 5428
diff changeset
   143
include $(WS_MAKE_RULES)/common.mk
5331
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
   144
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
   145
# Simplify source copying for install by eliding patch detritus.
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
   146
GPATCH_BACKUP=
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
   147
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
   148
# Enable local transforms.
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
   149
PKG_OPTIONS += -I $(COMPONENT_DIR)
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
   150
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
   151
# Avoid some of the default transforms:
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
   152
# - facet.devel serves no useful purpose for a development package
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
   153
# - facet.doc wrongly assumes all things in a doc directory are documentation;
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
   154
#   in Go's case, some are binaries
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
   155
#
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
   156
# This requires completely redefining PUBLISH_TRANSFORMS for now.
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
   157
PUBLISH_TRANSFORMS=	$(LICENSE_TRANSFORMS)
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
   158
PUBLISH_TRANSFORMS +=	$(WS_TOP)/transforms/variant-cleanup
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
   159
PUBLISH_TRANSFORMS +=	$(WS_TOP)/transforms/defaults
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
   160
PUBLISH_TRANSFORMS +=	$(WS_TOP)/transforms/actuators
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
   161
PUBLISH_TRANSFORMS +=	$(WS_TOP)/transforms/locale
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
   162
PUBLISH_TRANSFORMS +=	$(PKGMOGRIFY_TRANSFORMS)
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
   163
PUBLISH_TRANSFORMS +=	$(WS_TOP)/transforms/incorporate
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
   164
PUBLISH_TRANSFORMS +=	$(WS_TOP)/transforms/publish-cleanup
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
   165
ifeq ($(BUILD_TYPE),evaluation)
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
   166
	PUBLISH_TRANSFORMS += $(WS_TOP)/transforms/evaluation
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
   167
endif
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
   168
5428
3c05d530e67e 22665751 golang packages confuse elfsign
Shawn Walker-Salas <shawn.walker@oracle.com>
parents: 5331
diff changeset
   169
$(NO_ELFSIGN_MOG): install
3c05d530e67e 22665751 golang packages confuse elfsign
Shawn Walker-Salas <shawn.walker@oracle.com>
parents: 5331
diff changeset
   170
	cd $(PROTO_DIR); \
3c05d530e67e 22665751 golang packages confuse elfsign
Shawn Walker-Salas <shawn.walker@oracle.com>
parents: 5331
diff changeset
   171
	find . -type f -exec elffile {} + | grep 'ELF [36]' | \
3c05d530e67e 22665751 golang packages confuse elfsign
Shawn Walker-Salas <shawn.walker@oracle.com>
parents: 5331
diff changeset
   172
	    $(GSED) -e 's/^..\(.*\):.*$$/<transform file path=\1$$ -> \\\
3c05d530e67e 22665751 golang packages confuse elfsign
Shawn Walker-Salas <shawn.walker@oracle.com>
parents: 5331
diff changeset
   173
	        default com.oracle.elfsign false>/' > $@
3c05d530e67e 22665751 golang packages confuse elfsign
Shawn Walker-Salas <shawn.walker@oracle.com>
parents: 5331
diff changeset
   174
3c05d530e67e 22665751 golang packages confuse elfsign
Shawn Walker-Salas <shawn.walker@oracle.com>
parents: 5331
diff changeset
   175
PUBLISH_TRANSFORMS +=	$(NO_ELFSIGN_MOG)
3c05d530e67e 22665751 golang packages confuse elfsign
Shawn Walker-Salas <shawn.walker@oracle.com>
parents: 5331
diff changeset
   176
5331
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
   177
# Building go from the source repository version requires that we set an
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
   178
# effective version and add some sort of unique identifier (in the case of
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
   179
# pre-release versions), so we use 'devel' + archive hash + date similar to how
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
   180
# Go internally determines one normally from git revision info.  Uncomment the
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
   181
# block below when building from the upstream source repository:
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
   182
#COMPONENT_POST_UNPACK_ACTION= \
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
   183
#	$(MV) go-master $(COMPONENT_SRC) && \
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
   184
#	$(TOUCH) $(COMPONENT_SRC)/VERSION && \
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
   185
#	echo "devel $(shell digest -a md5 $(COMPONENT_ARCHIVE)) \
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
   186
#		$(shell date -u +'%a %b %e %T %Z %Y')" > \
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
   187
#		$(COMPONENT_SRC)/VERSION
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
   188
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
   189
# We have to fiddle with the package archives to get them into the same source
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
   190
# directory so that we can use the standard build targets.  We're effectively
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
   191
# building multiple components using a single target.
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
   192
COMPONENT_POST_UNPACK_ACTION= \
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
   193
	$(MV) go $(COMPONENT_SRC)
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
   194
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
   195
# Fixup compressed data affected by patches.
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
   196
COMPONENT_PREP_ACTION= \
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
   197
	cd $(COMPONENT_SRC) && \
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
   198
	bzip2 -c src/compress/testdata/Mark.Twain-Tom.Sawyer.txt > \
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
   199
		src/compress/bzip2/testdata/Mark.Twain-Tom.Sawyer.txt.bz2
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
   200
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
   201
# Go doesn't have a standard Makefile-based build process, so override the
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
   202
# default.
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
   203
COMPONENT_BUILD_ACTION=	\
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
   204
	cd $(@D)/src; $(ENV) $(COMPONENT_BUILD_ENV) ./make.bash
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
   205
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
   206
COMPONENT_TARGET_DIR= \
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
   207
	$(PROTOUSRLIBDIR)/$(COMPONENT_NAME)/$(COMPONENT_MAJOR_VERSION)
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
   208
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
   209
# We can't do any ASLR'ing as the Go 6l linker has no understanding of the
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
   210
# -z aslr=... option. So just override where needed in the .p5m files.
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
   211
ASLR_MODE = $(ASLR_DISABLE)
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
   212
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
   213
# Make sure the source code and object files have identical timestamps so
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
   214
# the Go compiler doesn't try to rebuild them.
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
   215
PKG_MACROS += TIMESTAMP=$(shell date +"%Y%m%dT%H%M%SZ")
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
   216
# Extra macros for packaging convenience.
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
   217
PKG_MACROS += COMPONENT_MAJOR_VERSION=$(COMPONENT_MAJOR_VERSION)
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
   218
# COMPONENT_MAJOR_VERSION suitable for use in regular expressions.
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
   219
PKG_MACROS += COMPONENT_RE_MAJOR_VERSION=$(subst .,\\.,$(COMPONENT_MAJOR_VERSION))
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
   220
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
   221
COMPONENT_TEST_ENV +=	PATH="$(@D)/bin:$(PATH)"
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
   222
COMPONENT_TEST_ENV +=	GOROOT="$(@D)"
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
   223
COMPONENT_TEST_DIR=	$(@D)/src
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
   224
COMPONENT_TEST_CMD=	./run.bash
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
   225
COMPONENT_TEST_TARGETS=
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
   226
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
   227
# Go's test suite does not have deterministic output or order, and as such,
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
   228
# success can only be determined by exit code, not by output comparison.
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
   229
COMPONENT_TEST_CREATE_TRANSFORMS=
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
   230
COMPONENT_TEST_PERFORM_TRANSFORM=
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
   231
COMPONENT_TEST_COMPARE=
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
   232
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
   233
XML2ROFF= $(USRSHAREDIR)/xml/xsolbook/python/xml2roff.py
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
   234
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
   235
$(BUILD_DIR)/man1/go.1:
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
   236
	$(XML2ROFF) $(COMPONENT_DIR)/docs/go.1 -o $(BUILD_DIR)
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
   237
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
   238
define COMPONENT_INSTALL_ACTION=
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
   239
	($(MKDIR) $(COMPONENT_TARGET_DIR)/src); \
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
   240
	(cd $(SOURCE_DIR) && \
5715
f94135b42f59 22992886 golang should bootstrap itself
Shawn Walker-Salas <shawn.walker@oracle.com>
parents: 5428
diff changeset
   241
	$(GNUBIN)/find . -maxdepth 1 -print \
f94135b42f59 22992886 golang should bootstrap itself
Shawn Walker-Salas <shawn.walker@oracle.com>
parents: 5428
diff changeset
   242
	  -exec $(GNUBIN)/cp -r \
5331
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
   243
	  --parents {} $(COMPONENT_TARGET_DIR) \;); \
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
   244
	(cd $(BUILD_DIR_64) && \
5715
f94135b42f59 22992886 golang should bootstrap itself
Shawn Walker-Salas <shawn.walker@oracle.com>
parents: 5428
diff changeset
   245
	$(GNUBIN)/find src -type f \
f94135b42f59 22992886 golang should bootstrap itself
Shawn Walker-Salas <shawn.walker@oracle.com>
parents: 5428
diff changeset
   246
		-exec $(GNUBIN)/cp --parents {} $(COMPONENT_TARGET_DIR) \;); \
5331
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
   247
	(cd $(BUILD_DIR_64) && $(CP) -r bin $(COMPONENT_TARGET_DIR)/); \
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
   248
	(cd $(BUILD_DIR_64) && $(CP) -r pkg $(COMPONENT_TARGET_DIR)/); \
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
   249
	($(MKDIR) $(PROTOUSRSHAREMAN1DIR)); \
5428
3c05d530e67e 22665751 golang packages confuse elfsign
Shawn Walker-Salas <shawn.walker@oracle.com>
parents: 5331
diff changeset
   250
	($(CP) $(BUILD_DIR)/man1/go.1 $(PROTOUSRSHAREMAN1DIR)/); \
3c05d530e67e 22665751 golang packages confuse elfsign
Shawn Walker-Salas <shawn.walker@oracle.com>
parents: 5331
diff changeset
   251
	($(RM) $(NO_ELFSIGN_MOG))
5331
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
   252
endef
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
   253
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
   254
#
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
   255
# Magic to deliver supplemental package source into proto area.
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
   256
#
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
   257
define install-rules
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
   258
$(MANIFEST_BASE)-$(1)-15.mogrified: PKG_PROTO_DIRS= $(MANGLED_DIR) $(PROTO_DIR) $(@D) $(COMPONENT_DIR) $(COMPONENT_SRC_$(1))
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
   259
5715
f94135b42f59 22992886 golang should bootstrap itself
Shawn Walker-Salas <shawn.walker@oracle.com>
parents: 5428
diff changeset
   260
BUILD_64 += $$(UNPACK_STAMP_$(1))
5331
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
   261
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
   262
COMPONENT_POST_INSTALL_ACTION += \
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
   263
	($(MKDIR) \
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
   264
		$(SUPP_ROOT)/src/$$(COMPONENT_IMPORT_SRC_$(1))/$$(COMPONENT_NAME_$(1)); \
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
   265
	$(CP) -r $$(COMPONENT_SRC_$(1))/* \
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
   266
		$(SUPP_ROOT)/src/$$(COMPONENT_IMPORT_SRC_$(1))/$$(COMPONENT_NAME_$(1)));
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
   267
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
   268
endef
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
   269
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
   270
$(foreach suffix,$(SUPP_PACKAGES), $(eval $(call install-rules,$(suffix))))
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
   271
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
   272
# XXX For now, the install of supplementary packages is intentionally disabled
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
   273
# as the result cannot be used as expected due to an unknown issue with the Go
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
   274
# compilers.
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
   275
#
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
   276
# Install supplementary packages (this cannot be done one-by-one); install
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
   277
# tools/go/types first to avoid quirk with trimpath and dependencies.  This is
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
   278
# technically a build and install, but go's build command won't "install"
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
   279
# results, it only verifies a target can be built and dumps it into a temporary
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
   280
# directory.
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
   281
#
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
   282
# The -trimpath option used here ensures that the paths recorded in the
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
   283
# pre-built packages are relative to the $(SUPP_ROOT) so that when a devleoper
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
   284
# sets their GOPATH to that directory, things work as expected.
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
   285
#COMPONENT_POST_INSTALL_ACTION += \
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
   286
#	($(ENV) $(COMPONENT_INSTALL_ENV) go install \
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
   287
#		-asmflags -trimpath=$(SUPP_ROOT) -gcflags -trimpath=$(SUPP_ROOT) \
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
   288
#		"golang.org/x/tools/go/types"; \
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
   289
#	$(ENV) $(COMPONENT_INSTALL_ENV) go install \
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
   290
#		-asmflags -trimpath=$(SUPP_ROOT) -gcflags -trimpath=$(SUPP_ROOT) \
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
   291
#		"golang.org/x/..."; \
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
   292
#	$(ENV) $(COMPONENT_INSTALL_ENV) go install \
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
   293
#		-asmflags -trimpath=$(SUPP_ROOT) -gcflags -trimpath=$(SUPP_ROOT) \
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
   294
#		"github.com/golang/...");
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
   295
5715
f94135b42f59 22992886 golang should bootstrap itself
Shawn Walker-Salas <shawn.walker@oracle.com>
parents: 5428
diff changeset
   296
# Go's test suite is currently designed to be run from the build area.
5331
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
   297
5715
f94135b42f59 22992886 golang should bootstrap itself
Shawn Walker-Salas <shawn.walker@oracle.com>
parents: 5428
diff changeset
   298
# Used during the build.
f94135b42f59 22992886 golang should bootstrap itself
Shawn Walker-Salas <shawn.walker@oracle.com>
parents: 5428
diff changeset
   299
REQUIRED_PACKAGES += developer/gcc
f94135b42f59 22992886 golang should bootstrap itself
Shawn Walker-Salas <shawn.walker@oracle.com>
parents: 5428
diff changeset
   300
ifneq ($(MACH), sparc)
f94135b42f59 22992886 golang should bootstrap itself
Shawn Walker-Salas <shawn.walker@oracle.com>
parents: 5428
diff changeset
   301
# Go 1.5 now bootstraps itself using 1.5; 1.6 will bootstrap using 1.5 as well.
f94135b42f59 22992886 golang should bootstrap itself
Shawn Walker-Salas <shawn.walker@oracle.com>
parents: 5428
diff changeset
   302
REQUIRED_PACKAGES += developer/golang-15
f94135b42f59 22992886 golang should bootstrap itself
Shawn Walker-Salas <shawn.walker@oracle.com>
parents: 5428
diff changeset
   303
endif
5428
3c05d530e67e 22665751 golang packages confuse elfsign
Shawn Walker-Salas <shawn.walker@oracle.com>
parents: 5331
diff changeset
   304
# Used in this Makefile.
3c05d530e67e 22665751 golang packages confuse elfsign
Shawn Walker-Salas <shawn.walker@oracle.com>
parents: 5331
diff changeset
   305
REQUIRED_PACKAGES += file/gnu-findutils
3c05d530e67e 22665751 golang packages confuse elfsign
Shawn Walker-Salas <shawn.walker@oracle.com>
parents: 5331
diff changeset
   306
REQUIRED_PACKAGES += text/gnu-sed
5331
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
   307
# Required to build man pages.
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
   308
REQUIRED_PACKAGES += developer/documentation-tool/xml2roff
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
   309
# There's a single test script which requires perl.
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
   310
REQUIRED_PACKAGES += runtime/perl-520
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
   311
REQUIRED_PACKAGES += system/header
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
   312
REQUIRED_PACKAGES += system/library
5715
f94135b42f59 22992886 golang should bootstrap itself
Shawn Walker-Salas <shawn.walker@oracle.com>
parents: 5428
diff changeset
   313
# Used for cgo support at runtime; we don't add a package dependency since cgo
f94135b42f59 22992886 golang should bootstrap itself
Shawn Walker-Salas <shawn.walker@oracle.com>
parents: 5428
diff changeset
   314
# support is optional.
f94135b42f59 22992886 golang should bootstrap itself
Shawn Walker-Salas <shawn.walker@oracle.com>
parents: 5428
diff changeset
   315
REQUIRED_PACKAGES += system/library/gcc/gcc-c-runtime
5331
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
   316
REQUIRED_PACKAGES += system/linker