Makefile revision 5426
1N/A# The contents of this file are subject to the terms of the 1N/A# Common Development and Distribution License (the "License"). 1N/A# You may not use this file except in compliance with the License. 1N/A# See the License for the specific language governing permissions 1N/A# and limitations under the License. 1N/A# When distributing Covered Code, include this CDDL HEADER in each # If applicable, add the following below this CDDL HEADER, with the # fields enclosed by brackets "[]" replaced with your own identifying # information: Portions Copyright [yyyy] [name of copyright owner] # Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved. # The golang build process just doesn't work with Parfait. # Go has a number of supplementary tools and packages that are located in # separate archives or source repositories. Because Go currently forces a # recompile of all packages whenever the compiler changes, building and # delivering them within the same build component build process is the best # This version is Go is not actually packaged; it is only used to bootstrap the # actual version of the Go that will be packaged. The long-term plan is # - verify 1.5 produces "correct" result for bootstrapping 1.5 (upstream # still uses 1.4 officially) # - after 1.5 has been available for at least a few builds in the WOS, switch # to building Go with system version of Go # - when SPARC support is integrated into Go upstream, build upstream version # using system Go for x86, then build Go for SPARC using upstream version # just built for x86 (cross-compilation), package both at the same time # - after SPARC version has been available for at least a few builds in the # WOS, switch to building Go with system version for x86 and SPARC # Supplementary packages; these are delivered as source only for now as the # paths to the compiled packages are written directly into the binaries and # there's no way (currently) to fix that during the build process. # Desired "revision" of Go's "community" libraries; these are arbitrary # revisions chosen from the last commit to the respective repository at the # same time that this component was updated as there is no formal release # process for these packages. Whenever Go is updated, these should be as well. # Resulting hash of related git commit once archived. # Go package imports for lint are found in github directory. # Go's "not well-formed" elf objects confuse elfsign, which then causes # problems for RE. For now, we workaround this by adding the # We're x86-only for now. # Bake in where Go package will be installed. # Enable easier stack unwinding for debugging. # Install root for supplementary packages. # For convenience during installation of supplementary packages. # Simplify source copying for install by eliding patch detritus. # Enable local transforms. # Avoid some of the default transforms: # - facet.devel serves no useful purpose for a development package # - facet.doc wrongly assumes all things in a doc directory are documentation; # in Go's case, some are binaries # This requires completely redefining PUBLISH_TRANSFORMS for now. $(GSED) -e
's/^..\(.*\):.*$$/<transform file path=\1$$ -> \\\ # Building go from the source repository version requires that we set an # effective version and add some sort of unique identifier (in the case of # pre-release versions), so we use 'devel' + archive hash + date similar to how # Go internally determines one normally from git revision info. Uncomment the # block below when building from the upstream source repository: #COMPONENT_POST_UNPACK_ACTION= \ # $(MV) go-master $(COMPONENT_SRC) && \ # $(TOUCH) $(COMPONENT_SRC)/VERSION && \ # echo "devel $(shell digest -a md5 $(COMPONENT_ARCHIVE)) \ # $(shell date -u +'%a %b %e %T %Z %Y')" > \ # $(COMPONENT_SRC)/VERSION # We have to fiddle with the package archives to get them into the same source # directory so that we can use the standard build targets. We're effectively # building multiple components using a single target. # Fixup compressed data affected by patches. # Build the bootstrap compiler before attempting to build Go 1.5+. For the # bootstrap compiler ensure GOROOT_FINAL is unset as it will be executed out of # the build area, and ensure GOROOT_BOOTSTRAP is also not set. GOEXPERIMENT # must also be unset as it is 1.5+ only. # Go doesn't have a standard Makefile-based build process, so override the # We can't do any ASLR'ing as the Go 6l linker has no understanding of the # -z aslr=... option. So just override where needed in the .p5m files. # Make sure the source code and object files have identical timestamps so # the Go compiler doesn't try to rebuild them. # Extra macros for packaging convenience. # COMPONENT_MAJOR_VERSION suitable for use in regular expressions. # Go's test suite does not have deterministic output or order, and as such, # success can only be determined by exit code, not by output comparison. # Magic to deliver supplemental package source into proto area. # XXX For now, the install of supplementary packages is intentionally disabled # as the result cannot be used as expected due to an unknown issue with the Go # Install supplementary packages (this cannot be done one-by-one); install # tools/go/types first to avoid quirk with trimpath and dependencies. This is # technically a build and install, but go's build command won't "install" # results, it only verifies a target can be built and dumps it into a temporary # The -trimpath option used here ensures that the paths recorded in the # pre-built packages are relative to the $(SUPP_ROOT) so that when a devleoper # sets their GOPATH to that directory, things work as expected. #COMPONENT_POST_INSTALL_ACTION += \ # ($(ENV) $(COMPONENT_INSTALL_ENV) go install \ # -asmflags -trimpath=$(SUPP_ROOT) -gcflags -trimpath=$(SUPP_ROOT) \ # $(ENV) $(COMPONENT_INSTALL_ENV) go install \ # -asmflags -trimpath=$(SUPP_ROOT) -gcflags -trimpath=$(SUPP_ROOT) \ # $(ENV) $(COMPONENT_INSTALL_ENV) go install \ # -asmflags -trimpath=$(SUPP_ROOT) -gcflags -trimpath=$(SUPP_ROOT) \ # Go's test suite is currently designed to be run from the build area. # Required to build man pages. # There's a single test script which requires perl.