blob: b98b5f0b64c48bc121a91e0452dcf685cd1a1c29 [file] [log] [blame]
#
# Copyright (c) 2010-2012 Nest Labs, Inc.
# All rights reserved.
#
# This document is the property of Nest. It is considered
# confidential and proprietary information.
#
# This document may not be reproduced or transmitted in any form,
# in whole or in part, without the express written permission of
# Nest.
#
# Description:
# This file is the makefile for Boost, a collection of open
# source libraries that extend the functionality of the C++ standard
# library.
#
BuildConfigSpecialized := No
BuildProductSpecialized := Yes
include pre.mak
PackageName := boost
PackageExtension := tar.bz2
PackageSeparator := _
PackagePatchArgs := -p1
PackageArchive := $(PackageName).$(PackageExtension)
PackageSourceDir := $(PackageName)$(PackageSeparator)$(PackageVersion)
CleanPaths += $(PackageLicenseFile)
TpsDir := sw/tps
IcuDir := $(TpsDir)/icu
IcuSearchPath := $(call GenerateResultPaths,$(IcuDir),usr)
# For the short-term, we are always building with GCC even though the
# actual tool chain may be some repackaged version of GCC. So, just
# specify that.
BoostToolset := gcc
# We do not want versioned headers and libraries, so specify the
# 'system' layout. Also, we do not want all the various combinations
# of shared/static, release/debug, stripped/unstripped and
# non-threaded/threaded libraries, so just specify 'minimal'.
BoostJamConfig += --layout=system \
--build-type=minimal \
-sICU_PATH=$(IcuSearchPath)
BoostLibraries = date_time \
filesystem \
regex \
system \
test \
thread
BoostLibrariesList = $(subst $(Space),$(Comma),$(strip $(BoostLibraries)))
BoostConfigure = $(call GenerateBuildPaths,bootstrap.sh)
BoostProjectConfig = $(call GenerateBuildPaths,project-config.jam)
all: $(PackageDefaultGoal)
# Generate the package license contents.
$(PackageSourceDir)/LICENSE_1_0.txt: source
$(PackageLicenseFile): $(PackageSourceDir)/LICENSE_1_0.txt
$(copy-result)
# Extract the source from the archive and apply patches, if any.
$(PackageSourceDir): $(PackageArchive) $(PackagePatchPaths)
$(expand-and-patch-package)
# Prepare the sources.
.PHONY: source
source: | $(PackageSourceDir)
# Patch the sources, if necessary.
.PHONY: patch
patch: source
# Generate the package build makefile.
$(BoostConfigure): | $(PackageSourceDir) $(BuildDirectory)
$(call create-links,$(CURDIR)/$(PackageSourceDir),$(BuildDirectory))
# Generate the build-specific makefile and user configuration. We have
# to post-process the generated user configuration since Boost's
# adominable build system has no other way to override the actual C++
# compiler executable used (see http://goodliffe.blogspot.com/2008/05/
# cross-compiling-boost.html and boost/docs/html/bbv2/
# tasks.html#bbv2.tasks.crosscompile).
$(BoostProjectConfig): $(BoostConfigure)
$(Verbose)cd $(BuildDirectory) && \
./bootstrap.sh \
--prefix=$(ResultDirectory) \
--with-toolset=$(BoostToolset) \
--with-icu=$(IcuSearchPath) \
--with-libraries=$(BoostLibrariesList)
$(Verbose)$(SED) -e "s#^\([[:space:]]*using\)[[:space:]]\{1,\}\($(BoostToolset)\)[[:space:]]\{1,\};#\1 \2 : $(TargetProcArch) : $(CXX) $(CPPOPTFLAGS) ;#g" \
< $(@) > $(@).N || $(RM) -f $(@)
$(Verbose)mv -f $(@) $(@).O
$(Verbose)mv -f $(@).N $(@)
# Configure the source for building.
.PHONY: configure
configure: source $(BoostProjectConfig)
# Build the source.
.PHONY: build
build: configure
$(Verbose)cd $(BuildDirectory) && \
./bjam $(BoostJamConfig)
# Stage the build to a temporary installation area.
.PHONY: stage
stage: build | $(ResultDirectory)
$(Verbose)cd $(BuildDirectory) && \
./bjam $(BoostJamConfig) \
install --prefix=$(ResultDirectory)
clean:
$(Verbose)$(RM) $(RMFLAGS) -r $(PackageSourceDir)
$(Verbose)$(RM) $(RMFLAGS) -r $(BuildDirectory)
$(Verbose)$(RM) $(RMFLAGS) -r $(ResultDirectory)
include post.mak