blob: 0eaf16581da588f84acf1e789cc60403d7db0b57 [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.
#
include pre.mak
PackageName := boost
PackageExtension := tar.bz2
PackageSeparator := _
PackagePatchArgs := -p1
PackageArchive := $(PackageName).$(PackageExtension)
PackageSourceDir := $(PackageName)$(PackageSeparator)$(PackageVersion)
CleanPaths += $(PackageLicenseFile)
# 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=$(IcuPrefixPath) \
link=shared \
$(if $(LinuxIncludePath), cxxflags="$(call ToolGenerateIncludeArgument,$(LinuxIncludePath))") \
$(if $(PythonIncludePath), cxxflags="$(call ToolGenerateIncludeArgument,$(PythonIncludePath))") \
$(NULL)
# If ForceLibStdCPP is set, tell boost to use libstdc++ instead of
# the compiler default
ifeq ($(call IsYes,$(ForceLibStdCPP)),Y)
BoostJamConfig += dll-path=$(BoostLibraryPath) cxxflags="-stdlib=libstdc++" linkflags="-stdlib=libstdc++"
endif
BoostLibraries = filesystem \
system \
signals
ifeq ($(BUILD_FEATURE_BOOST_PYTHON),1)
BoostLibraries += \
python
endif
BoostLibrariesList = $(subst $(Space),$(Comma),$(strip $(BoostLibraries)))
BoostProjectConfig = $(call GenerateBuildPaths,project-config.jam)
SOURCEDIRS = $(PackageSourceDir)
$(PackageSourceDir)_RULE_TARGET = $(BuildDirectory)/configure
all: $(PackageDefaultGoal)
# Generate the package license contents.
$(PackageSourceDir)/LICENSE_1_0.txt: $(BuildDirectory)/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.
$(BuildDirectory)/source: $(PackageSourceDir) | $(BuildDirectory)
$(Verbose)touch $(BuildDirectory)/source
# Generate the package build makefile.
# 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).
# Configure the source for building.
.PHONY: configure
configure: $(BuildDirectory)/configure
$(BuildDirectory)/configure: $(BuildDirectory)/source | $(PackageSourceDir) $(BuildDirectory)
$(call create-links,$(CURDIR)/$(PackageSourceDir),$(BuildDirectory))
$(Verbose)cd $(BuildDirectory) && \
./bootstrap.sh \
--prefix=$(ResultDirectory) \
--with-toolset=$(BoostToolset) \
--with-icu=$(IcuPrefixPath) \
--with-libraries=$(BoostLibrariesList) \
--with-python-root=$(PythonResultsPath)
$(Verbose)$(SED) -e "s#^\([[:space:]]*using\)[[:space:]]\{1,\}\($(BoostToolset)\)[[:space:]]\{1,\};#\1 \2 : $(TargetProcArch) : $(CXX) $(CPPOPTFLAGS) ;#g" \
< $(BoostProjectConfig) > $(BoostProjectConfig).N || $(RM) -f $(BoostProjectConfig)
$(Verbose)mv -f $(BoostProjectConfig) $(BoostProjectConfig).O
$(Verbose)mv -f $(BoostProjectConfig).N $(BoostProjectConfig)
$(Verbose)touch $(BuildDirectory)/configure
# Build the source.
$(BuildDirectory)/build: $(BuildDirectory)/configure
$(Verbose)cd $(BuildDirectory) && \
./bjam $(JOBSFLAG) $(BoostJamConfig)
$(Verbose)touch $(BuildDirectory)/build
# Stage the build to a temporary installation area.
$(BuildDirectory)/stage: $(BuildDirectory)/build | $(ResultDirectory)
$(Verbose)cd $(BuildDirectory) && \
INSTALL="$(INSTALL) $(INSTALLFLAGS)" && \
./bjam $(JOBSFLAG) $(BoostJamConfig) \
install --prefix=$(ResultDirectory)
$(Verbose)touch $(BuildDirectory)/stage
.PHONY: stage
stage: $(BuildDirectory)/stage
clean:
$(Verbose)$(RM) $(RMFLAGS) -r $(PackageSourceDir)
$(Verbose)$(RM) $(RMFLAGS) -r $(BuildDirectory)
$(Verbose)$(RM) $(RMFLAGS) -r $(ResultDirectory)
$(Verbose)$(RM) $(RMFLAGS) -r $(PackageSourceDir).mk.d
include post.mak