diff --git a/.gitignore b/.gitignore
index ce091a630..201d335a1 100644
--- a/.gitignore
+++ b/.gitignore
@@ -12,6 +12,9 @@ config.h
config.log
config.status
configure
+jam-files/bjam
+jam-files/engine/bootstrap
+jam-files/engine/bin.*
lm/.deps/
lm/.libs/
util/.deps/
@@ -58,6 +61,18 @@ scripts/training/phrase-extract/consolidate
scripts/training/phrase-extract/consolidate-direct
scripts/training/phrase-extract/consolidate-reverse
scripts/training/phrase-extract/extract
+scripts/training/phrase-extract/extract-ghkm/config.guess
+scripts/training/phrase-extract/extract-ghkm/config.h.in
+scripts/training/phrase-extract/extract-ghkm/config.sub
+scripts/training/phrase-extract/extract-ghkm/depcomp
+scripts/training/phrase-extract/extract-ghkm/install-sh
+scripts/training/phrase-extract/extract-ghkm/m4/libtool.m4
+scripts/training/phrase-extract/extract-ghkm/m4/ltoptions.m4
+scripts/training/phrase-extract/extract-ghkm/m4/ltsugar.m4
+scripts/training/phrase-extract/extract-ghkm/m4/ltversion.m4
+scripts/training/phrase-extract/extract-ghkm/m4/lt~obsolete.m4
+scripts/training/phrase-extract/extract-ghkm/missing
+scripts/training/phrase-extract/extract-ghkm/tools/extract-ghkm
scripts/training/phrase-extract/extract-lex
scripts/training/phrase-extract/extract-rules
scripts/training/phrase-extract/relax-parse
@@ -71,3 +86,5 @@ m4/ltoptions.m4
m4/ltsugar.m4
m4/ltversion.m4
m4/lt~obsolete.m4
+dist
+bin
diff --git a/CreateOnDisk/src/Jamfile b/CreateOnDisk/src/Jamfile
new file mode 100644
index 000000000..093dc0122
--- /dev/null
+++ b/CreateOnDisk/src/Jamfile
@@ -0,0 +1 @@
+exe CreateOnDisk : Main.cpp ../../moses/src//moses ../../OnDiskPt/src//OnDiskPt ;
diff --git a/Jamroot b/Jamroot
new file mode 100644
index 000000000..81aaabbe0
--- /dev/null
+++ b/Jamroot
@@ -0,0 +1,90 @@
+#MOSES BUILD OPTIONS
+#
+#Language models
+#--with-irstlm=/path/to/irstlm
+#--with-srilm=/path/to/srilm
+#--with-randlm=/path/to/randlm
+#KenLM is always compiled.
+#
+#--with-xmlrpc-c=/path/to/xmlrpc-c for libxmlrpc-c (used by server)
+#Note that, like language models, this is the --prefix where the library was
+#installed, not some executable within the library.
+#
+#--notrace compiles without TRACE macros
+#
+#--install=/path/to/install sets the install directory (default dist)
+#
+#By default, the build is multi-threaded, optimized, and statically linked.
+#
+#Compilation modes:
+#threading=single compiles single-threaded
+#variant=debug for debugging (or just "debug")
+#variant=profile for profiling
+#link=shared for dynamic linking
+#debug-symbols=off to disable debugging symbols
+#
+#-a to build from scratch
+#-j$NCPUS to compile in parallel
+#clean to clean
+
+#Other compilers might work, but this stops bjam from whining.
+using gcc ;
+
+path-constant TOP : . ;
+
+import option ;
+import boost ;
+boost.use-project ;
+#If boost static libraries are not installed, use dynamic linking.
+if [ SHELL $(TOP)"/jam-files/test.sh -static -lboost_program_options" ] != 0 {
+ force-boost-link = "shared" ;
+}
+#Convenience rule for boost libraries. Defines library boost_$(name).
+rule boost_lib ( name ) {
+ alias boost_$(name) : /boost//$(name) : $(force-boost-link) ;
+}
+boost_lib thread ;
+boost_lib program_options ;
+boost_lib unit_test_framework ;
+
+#Dynamic libz if we have to.
+if [ SHELL $(TOP)"/jam-files/test.sh -static -lz" ] != 0 {
+ lib z : : shared ;
+} else {
+ lib z ;
+}
+
+trace = [ option.get "notrace" : TRACE_ENABLE=1 ] ;
+
+project : default-build
+ multi
+ on
+ on
+ release
+ static
+ ;
+
+project : requirements
+ multi:WITH_THREADS
+ multi:boost_thread
+ _FILE_OFFSET_BITS=64 _LARGE_FILES
+ $(trace)
+ ;
+
+#Add directories here if you want their incidental targets too (i.e. tests).
+build-project lm ;
+build-project util ;
+#Trigger instllation into legacy paths.
+build-project moses-cmd/src ;
+build-project moses-chart-cmd/src ;
+
+install-location = [ option.get "install" : $(TOP)/dist ] ;
+install dist :
+ lm//query
+ lm//build_binary
+ moses-chart-cmd/src//moses_chart
+ moses-cmd/src//programs
+ CreateOnDisk/src//CreateOnDisk
+ mert//programs
+ server//mosesserver
+ : $(install-location) EXE on shared:$(install-location) shared:LIB ;
diff --git a/OnDiskPt/OnDiskPt.xcodeproj/project.pbxproj b/OnDiskPt/OnDiskPt.xcodeproj/project.pbxproj
index 50f2ff1d1..26055d688 100644
--- a/OnDiskPt/OnDiskPt.xcodeproj/project.pbxproj
+++ b/OnDiskPt/OnDiskPt.xcodeproj/project.pbxproj
@@ -197,6 +197,7 @@
HEADER_SEARCH_PATHS = (
/opt/local/include,
../kenlm,
+ ../,
);
INSTALL_PATH = /usr/local/lib;
PRODUCT_NAME = OnDiskPt;
@@ -212,6 +213,7 @@
HEADER_SEARCH_PATHS = (
/opt/local/include,
../kenlm,
+ ../,
);
INSTALL_PATH = /usr/local/lib;
PRODUCT_NAME = OnDiskPt;
diff --git a/OnDiskPt/src/Jamfile b/OnDiskPt/src/Jamfile
new file mode 100644
index 000000000..0787ee869
--- /dev/null
+++ b/OnDiskPt/src/Jamfile
@@ -0,0 +1 @@
+lib OnDiskPt : OnDiskWrapper.cpp SourcePhrase.cpp TargetPhrase.cpp Word.cpp Phrase.cpp PhraseNode.cpp TargetPhraseCollection.cpp Vocab.cpp ../../moses/src//moses ;
diff --git a/OnDiskPt/src/OnDiskWrapper.cpp b/OnDiskPt/src/OnDiskWrapper.cpp
index 276f41024..79b0563a8 100644
--- a/OnDiskPt/src/OnDiskWrapper.cpp
+++ b/OnDiskPt/src/OnDiskWrapper.cpp
@@ -21,7 +21,7 @@
#include
#endif
#include
-#include
+#include "util/check.hh"
#include
#include "OnDiskWrapper.h"
@@ -56,19 +56,19 @@ bool OnDiskWrapper::BeginLoad(const std::string &filePath)
bool OnDiskWrapper::OpenForLoad(const std::string &filePath)
{
m_fileSource.open((filePath + "/Source.dat").c_str(), ios::in | ios::binary);
- assert(m_fileSource.is_open());
+ CHECK(m_fileSource.is_open());
m_fileTargetInd.open((filePath + "/TargetInd.dat").c_str(), ios::in | ios::binary);
- assert(m_fileTargetInd.is_open());
+ CHECK(m_fileTargetInd.is_open());
m_fileTargetColl.open((filePath + "/TargetColl.dat").c_str(), ios::in | ios::binary);
- assert(m_fileTargetColl.is_open());
+ CHECK(m_fileTargetColl.is_open());
m_fileVocab.open((filePath + "/Vocab.dat").c_str(), ios::in);
- assert(m_fileVocab.is_open());
+ CHECK(m_fileVocab.is_open());
m_fileMisc.open((filePath + "/Misc.dat").c_str(), ios::in);
- assert(m_fileMisc.is_open());
+ CHECK(m_fileMisc.is_open());
// set up root node
LoadMisc();
@@ -86,7 +86,7 @@ bool OnDiskWrapper::LoadMisc()
while(m_fileMisc.getline(line, 100000)) {
vector tokens;
Moses::Tokenize(tokens, line);
- assert(tokens.size() == 2);
+ CHECK(tokens.size() == 2);
const string &key = tokens[0];
m_miscInfo[key] = Moses::Scan(tokens[1]);
}
@@ -109,33 +109,33 @@ bool OnDiskWrapper::BeginSave(const std::string &filePath
#endif
m_fileSource.open((filePath + "/Source.dat").c_str(), ios::out | ios::in | ios::binary | ios::ate | ios::trunc);
- assert(m_fileSource.is_open());
+ CHECK(m_fileSource.is_open());
m_fileTargetInd.open((filePath + "/TargetInd.dat").c_str(), ios::out | ios::binary | ios::ate | ios::trunc);
- assert(m_fileTargetInd.is_open());
+ CHECK(m_fileTargetInd.is_open());
m_fileTargetColl.open((filePath + "/TargetColl.dat").c_str(), ios::out | ios::binary | ios::ate | ios::trunc);
- assert(m_fileTargetColl.is_open());
+ CHECK(m_fileTargetColl.is_open());
m_fileVocab.open((filePath + "/Vocab.dat").c_str(), ios::out | ios::ate | ios::trunc);
- assert(m_fileVocab.is_open());
+ CHECK(m_fileVocab.is_open());
m_fileMisc.open((filePath + "/Misc.dat").c_str(), ios::out | ios::ate | ios::trunc);
- assert(m_fileMisc.is_open());
+ CHECK(m_fileMisc.is_open());
// offset by 1. 0 offset is reserved
char c = 0xff;
m_fileSource.write(&c, 1);
- assert(1 == m_fileSource.tellp());
+ CHECK(1 == m_fileSource.tellp());
m_fileTargetInd.write(&c, 1);
- assert(1 == m_fileTargetInd.tellp());
+ CHECK(1 == m_fileTargetInd.tellp());
m_fileTargetColl.write(&c, 1);
- assert(1 == m_fileTargetColl.tellp());
+ CHECK(1 == m_fileTargetColl.tellp());
// set up root node
- assert(GetNumCounts() == 1);
+ CHECK(GetNumCounts() == 1);
vector counts(GetNumCounts());
counts[0] = DEFAULT_COUNT;
m_rootSourceNode = new PhraseNode();
@@ -147,7 +147,7 @@ bool OnDiskWrapper::BeginSave(const std::string &filePath
void OnDiskWrapper::EndSave()
{
bool ret = m_rootSourceNode->Saved();
- assert(ret);
+ CHECK(ret);
GetVocab().Save(*this);
@@ -184,7 +184,7 @@ UINT64 OnDiskWrapper::GetMisc(const std::string &key) const
{
std::map::const_iterator iter;
iter = m_miscInfo.find(key);
- assert(iter != m_miscInfo.end());
+ CHECK(iter != m_miscInfo.end());
return iter->second;
}
@@ -205,7 +205,7 @@ Word *OnDiskWrapper::ConvertFromMoses(Moses::FactorDirection /* direction */
size_t factorType = factorsVec[ind];
const Moses::Factor *factor = origWord.GetFactor(factorType);
- assert(factor);
+ CHECK(factor);
string str = factor->GetString();
if (isNonTerminal) {
diff --git a/OnDiskPt/src/Phrase.cpp b/OnDiskPt/src/Phrase.cpp
index 1b7fb54e3..ce6dc208c 100644
--- a/OnDiskPt/src/Phrase.cpp
+++ b/OnDiskPt/src/Phrase.cpp
@@ -18,7 +18,7 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
***********************************************************************/
#include
-#include
+#include "util/check.hh"
#include "../../moses/src/Util.h"
#include "Phrase.h"
@@ -49,7 +49,7 @@ void Phrase::AddWord(Word *word)
void Phrase::AddWord(Word *word, size_t pos)
{
- assert(pos < m_words.size());
+ CHECK(pos < m_words.size());
m_words.insert(m_words.begin() + pos + 1, word);
}
@@ -73,7 +73,7 @@ int Phrase::Compare(const Phrase &compare) const
}
if (ret == 0) {
- assert(compare.GetSize() >= GetSize());
+ CHECK(compare.GetSize() >= GetSize());
ret = (compare.GetSize() > GetSize()) ? 1 : 0;
}
return ret;
diff --git a/OnDiskPt/src/PhraseNode.cpp b/OnDiskPt/src/PhraseNode.cpp
index 8d3849ee5..a479294e5 100644
--- a/OnDiskPt/src/PhraseNode.cpp
+++ b/OnDiskPt/src/PhraseNode.cpp
@@ -17,7 +17,7 @@
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
***********************************************************************/
-#include
+#include "util/check.hh"
#include "PhraseNode.h"
#include "OnDiskWrapper.h"
#include "TargetPhraseCollection.h"
@@ -55,7 +55,7 @@ PhraseNode::PhraseNode(UINT64 filePos, OnDiskWrapper &onDiskWrapper)
std::fstream &file = onDiskWrapper.GetFileSource();
file.seekg(filePos);
- assert(filePos == file.tellg());
+ CHECK(filePos == file.tellg());
file.read((char*) &m_numChildrenLoad, sizeof(UINT64));
@@ -64,11 +64,11 @@ PhraseNode::PhraseNode(UINT64 filePos, OnDiskWrapper &onDiskWrapper)
// go to start of node again
file.seekg(filePos);
- assert(filePos == file.tellg());
+ CHECK(filePos == file.tellg());
// read everything into memory
file.read(m_memLoad, memAlloc);
- assert(filePos + memAlloc == file.tellg());
+ CHECK(filePos + memAlloc == file.tellg());
// get value
m_value = ((UINT64*)m_memLoad)[1];
@@ -76,7 +76,7 @@ PhraseNode::PhraseNode(UINT64 filePos, OnDiskWrapper &onDiskWrapper)
// get counts
float *memFloat = (float*) (m_memLoad + sizeof(UINT64) * 2);
- assert(countSize == 1);
+ CHECK(countSize == 1);
m_counts[0] = memFloat[0];
m_memLoadLast = m_memLoad + memAlloc;
@@ -85,7 +85,7 @@ PhraseNode::PhraseNode(UINT64 filePos, OnDiskWrapper &onDiskWrapper)
PhraseNode::~PhraseNode()
{
free(m_memLoad);
- //assert(m_saved);
+ //CHECK(m_saved);
}
float PhraseNode::GetCount(size_t ind) const
@@ -95,7 +95,7 @@ float PhraseNode::GetCount(size_t ind) const
void PhraseNode::Save(OnDiskWrapper &onDiskWrapper, size_t pos, size_t tableLimit)
{
- assert(!m_saved);
+ CHECK(!m_saved);
// save this node
m_targetPhraseColl.Sort(tableLimit);
@@ -116,7 +116,7 @@ void PhraseNode::Save(OnDiskWrapper &onDiskWrapper, size_t pos, size_t tableLimi
// count info
float *memFloat = (float*) (mem + memUsed);
- assert(numCounts == 1);
+ CHECK(numCounts == 1);
memFloat[0] = (m_counts.size() == 0) ? DEFAULT_COUNT : m_counts[0]; // if count = 0, put in very large num to make sure its still used. HACK
memUsed += sizeof(float) * numCounts;
@@ -142,7 +142,7 @@ void PhraseNode::Save(OnDiskWrapper &onDiskWrapper, size_t pos, size_t tableLimi
// save this node
//Moses::DebugMem(mem, memAlloc);
- assert(memUsed == memAlloc);
+ CHECK(memUsed == memAlloc);
std::fstream &file = onDiskWrapper.GetFileSource();
m_filePos = file.tellp();
@@ -150,7 +150,7 @@ void PhraseNode::Save(OnDiskWrapper &onDiskWrapper, size_t pos, size_t tableLimi
file.write(mem, memUsed);
UINT64 endPos = file.tellp();
- assert(m_filePos + memUsed == endPos);
+ CHECK(m_filePos + memUsed == endPos);
free(mem);
@@ -234,7 +234,7 @@ void PhraseNode::GetChild(Word &wordFound, UINT64 &childFilePos, size_t ind, OnD
+ childSize * ind;
size_t memRead = ReadChild(wordFound, childFilePos, currMem, numFactors);
- assert(memRead == childSize);
+ CHECK(memRead == childSize);
}
size_t PhraseNode::ReadChild(Word &wordFound, UINT64 &childFilePos, const char *mem, size_t numFactors) const
diff --git a/OnDiskPt/src/SourcePhrase.cpp b/OnDiskPt/src/SourcePhrase.cpp
index 7c95e5ec4..595748c70 100644
--- a/OnDiskPt/src/SourcePhrase.cpp
+++ b/OnDiskPt/src/SourcePhrase.cpp
@@ -17,7 +17,7 @@
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
***********************************************************************/
-#include
+#include "util/check.hh"
#include "SourcePhrase.h"
namespace OnDiskPt
diff --git a/OnDiskPt/src/TargetPhrase.cpp b/OnDiskPt/src/TargetPhrase.cpp
index 2b62255e4..7480368e0 100644
--- a/OnDiskPt/src/TargetPhrase.cpp
+++ b/OnDiskPt/src/TargetPhrase.cpp
@@ -57,13 +57,13 @@ void TargetPhrase::Create1AlignFromString(const std::string &align1Str)
{
vector alignPoints;
Moses::Tokenize(alignPoints, align1Str, "-");
- assert(alignPoints.size() == 2);
+ CHECK(alignPoints.size() == 2);
m_align.push_back(pair(alignPoints[0], alignPoints[1]) );
}
void TargetPhrase::SetScore(float score, size_t ind)
{
- assert(ind < m_scores.size());
+ CHECK(ind < m_scores.size());
m_scores[ind] = score;
}
@@ -101,7 +101,7 @@ char *TargetPhrase::WriteToMemory(OnDiskWrapper &onDiskWrapper, size_t &memUsed)
memUsed += word.WriteToMemory((char*) currPtr);
}
- assert(memUsed == memNeeded);
+ CHECK(memUsed == memNeeded);
return (char *) mem;
}
@@ -119,7 +119,7 @@ void TargetPhrase::Save(OnDiskWrapper &onDiskWrapper)
file.write(mem, memUsed);
UINT64 endPos = file.tellp();
- assert(startPos + memUsed == endPos);
+ CHECK(startPos + memUsed == endPos);
m_filePos = startPos;
free(mem);
@@ -151,7 +151,7 @@ char *TargetPhrase::WriteOtherInfoToMemory(OnDiskWrapper &onDiskWrapper, size_t
memUsed += WriteScoresToMemory(mem + memUsed);
//DebugMem(mem, memNeeded);
- assert(memNeeded == memUsed);
+ CHECK(memNeeded == memUsed);
return mem;
}
@@ -203,7 +203,7 @@ Moses::TargetPhrase *TargetPhrase::ConvertToMoses(const std::vector 0); // last word is lhs
+ CHECK(phraseSize > 0); // last word is lhs
--phraseSize;
for (size_t pos = 0; pos < phraseSize; ++pos) {
@@ -232,18 +232,18 @@ Moses::TargetPhrase *TargetPhrase::ConvertToMoses(const std::vector 0);
+ CHECK(m_scores.size() > 0);
UINT64 bytesRead = 0;
diff --git a/OnDiskPt/src/TargetPhraseCollection.cpp b/OnDiskPt/src/TargetPhraseCollection.cpp
index 910af9ea9..bb9c74364 100644
--- a/OnDiskPt/src/TargetPhraseCollection.cpp
+++ b/OnDiskPt/src/TargetPhraseCollection.cpp
@@ -107,7 +107,7 @@ void TargetPhraseCollection::Save(OnDiskWrapper &onDiskWrapper)
free(mem);
UINT64 endPos = file.tellp();
- assert(startPos + memUsed == endPos);
+ CHECK(startPos + memUsed == endPos);
m_filePos = startPos;
diff --git a/OnDiskPt/src/Vocab.cpp b/OnDiskPt/src/Vocab.cpp
index dd641cbfb..9c0470b32 100644
--- a/OnDiskPt/src/Vocab.cpp
+++ b/OnDiskPt/src/Vocab.cpp
@@ -36,7 +36,7 @@ bool Vocab::Load(OnDiskWrapper &onDiskWrapper)
while(getline(file, line)) {
vector tokens;
Moses::Tokenize(tokens, line);
- assert(tokens.size() == 2);
+ CHECK(tokens.size() == 2);
const string &key = tokens[0];
m_vocabColl[key] = Moses::Scan(tokens[1]);
}
diff --git a/OnDiskPt/src/Word.cpp b/OnDiskPt/src/Word.cpp
index d1aeaf6f9..972f74584 100644
--- a/OnDiskPt/src/Word.cpp
+++ b/OnDiskPt/src/Word.cpp
@@ -93,7 +93,7 @@ size_t Word::ReadFromFile(std::fstream &file, size_t numFactors)
file.read(mem, memAlloc);
size_t memUsed = ReadFromMemory(mem, numFactors);
- assert(memAlloc == memUsed);
+ CHECK(memAlloc == memUsed);
free(mem);
return memUsed;
diff --git a/bjam b/bjam
new file mode 100755
index 000000000..d0a49c3f7
--- /dev/null
+++ b/bjam
@@ -0,0 +1,21 @@
+#!/bin/bash
+set -e
+if
+ which bjam >/dev/null 2>/dev/null && #Have a bjam in path
+ ! grep UFIHGUFIHBDJKNCFZXAEVA "$(which bjam)" >/dev/null && #bjam in path isn't this script
+ bjam --help >/dev/null 2>/dev/null #bjam in path isn't broken (i.e. has boost-build)
+then
+ #Delegate to system bjam
+ exec bjam "$@"
+fi
+
+top="$(dirname "$0")"
+if [ ! -x "$top"/jam-files/bjam ]; then
+ pushd "$top/jam-files/engine"
+ ./build.sh
+ cp -f bin.*/bjam ../bjam
+ popd
+fi
+
+export BOOST_BUILD_PATH="$top"/jam-files/boost-build
+exec "$top"/jam-files/bjam "$@"
diff --git a/boost.jam b/boost.jam
new file mode 100644
index 000000000..388ac4d15
--- /dev/null
+++ b/boost.jam
@@ -0,0 +1,321 @@
+# $Id: boost.jam 63913 2010-07-12 07:37:43Z vladimir_prus $
+# Copyright 2008 Roland Schwarz
+# Distributed under the Boost Software License, Version 1.0.
+# (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
+
+# Boost library support module.
+#
+# This module allows to use the boost library from boost-build projects.
+# The location of a boost source tree or the path to a pre-built
+# version of the library can be configured from either site-config.jam
+# or user-config.jam. If no location is configured the module looks for
+# a BOOST_ROOT environment variable, which should point to a boost source
+# tree. As a last resort it tries to use pre-built libraries from the standard
+# search path of the compiler.
+#
+# If the location to a source tree is known, the module can be configured
+# from the *-config.jam files:
+#
+# using boost : 1.35 : /path-to-boost-root ;
+#
+# If the location to a pre-built version is known:
+#
+# using boost : 1.34
+# : /usr/local/include/boost_1_34
+# /usr/local/lib
+# ;
+#
+# It is legal to configure more than one boost library version in the config
+# files. The version identifier is used to disambiguate between them.
+# The first configured version becomes the default.
+#
+# To use a boost library you need to put a 'use' statement into your
+# Jamfile:
+#
+# import boost ;
+#
+# boost.use-project 1.35 ;
+#
+# If you don't care about a specific version you just can omit the version
+# part, in which case the default is picked up:
+#
+# boost.use-project ;
+#
+# The library can be referenced with the project identifier '/boost'. To
+# reference the program_options you would specify:
+#
+# exe myexe : mysrc.cpp : /boost//program_options ;
+#
+# Note that the requirements are automatically transformed into suitable
+# tags to find the correct pre-built library.
+#
+
+import modules ;
+import errors ;
+import project ;
+import string ;
+import toolset ;
+import property-set ;
+import regex ;
+import common ;
+import option ;
+import numbers ;
+
+.boost.auto_config = [ property-set.create system ] ;
+
+if [ MATCH (--debug-configuration) : [ modules.peek : ARGV ] ]
+{
+ .debug-configuration = true ;
+}
+
+# Configuration of the boost library to use.
+#
+# This can either be a boost source tree or
+# pre-built libraries. The 'version' parameter must be a valid boost
+# version number, e.g. 1.35, if specifying a pre-built version with
+# versioned layout. It may be a symbolic name, e.g. 'trunk' if specifying
+# a source tree. The options are specified as named parameters (like
+# properties). The following paramters are available:
+#
+# /path-to-boost-root: Specify a source tree.
+#
+# /path-to-include: The include directory to search.
+#
+# /path-to-library: The library directory to search.
+#
+# system or versioned.
+#
+# my_build_id: The custom build id to use.
+#
+rule init
+(
+ version # Version identifier.
+ : options * # Set the option properties.
+)
+{
+ if $(.boost.$(version)) {
+ errors.user-error
+ "Boost " $(version) "already configured." ;
+ }
+ else {
+ if $(.debug-configuration) {
+ if ! $(.boost_default) {
+ echo notice: configuring default boost library $(version) ;
+ }
+ echo notice: configuring boost library $(version) ;
+ }
+ .boost_default ?= $(version) ; # the first configured is default
+ .boost.$(version) = [ property-set.create $(options) ] ;
+ }
+}
+
+# Use a certain version of the library.
+#
+# The use-project rule causes the module to define a boost project of
+# searchable pre-built boost libraries, or references a source tree
+# of the boost library. If the 'version' parameter is omitted either
+# the configured default (first in config files) is used or an auto
+# configuration will be attempted.
+#
+rule use-project
+(
+ version ? # The version of the library to use.
+)
+{
+ project.push-current [ project.current ] ;
+ version ?= $(.boost_default) ;
+ version ?= auto_config ;
+
+ if $(.initialized) {
+ if $(.initialized) != $(version) {
+ errors.user-error
+ "Attempt to use" $(__name__) "with different parameters" ;
+ }
+ }
+ else {
+ if $(.boost.$(version)) {
+ local opt = $(.boost.$(version)) ;
+ local root = [ $(opt).get ] ;
+ local inc = [ $(opt).get ] ;
+ local lib = [ $(opt).get ] ;
+
+ if $(.debug-configuration) {
+ echo notice: using boost library $(version) [ $(opt).raw ] ;
+ }
+
+ .layout = [ $(opt).get ] ;
+ .layout ?= versioned ;
+ .build_id = [ $(opt).get ] ;
+ .version_tag = [ regex.replace $(version) "[*\\/:.\"\' ]" "_" ] ;
+ .initialized = $(version) ;
+
+ if ( $(root) && $(inc) )
+ || ( $(root) && $(lib) )
+ || ( $(lib) && ! $(inc) )
+ || ( ! $(lib) && $(inc) ) {
+ errors.user-error
+ "Ambiguous parameters,"
+ "use either or with ." ;
+ }
+ else if ! $(root) && ! $(inc) {
+ root = [ modules.peek : BOOST_ROOT ] ;
+ }
+
+ local prj = [ project.current ] ;
+ local mod = [ $(prj).project-module ] ;
+
+ if $(root) {
+ modules.call-in $(mod) : use-project boost : $(root) ;
+ }
+ else {
+ project.initialize $(__name__) ;
+ # It is possible to overide the setup of the searched
+ # libraries per version. The (unlikely) tag 0.0.1 is
+ # meant as an example template only.
+ switch $(version) {
+ case 0.0.1 : boost_0_0_1 $(inc) $(lib) ;
+ case * : boost_std $(inc) $(lib) ;
+ }
+ }
+ }
+ else {
+ errors.user-error
+ "Reference to unconfigured boost version." ;
+ }
+ }
+ project.pop-current ;
+}
+
+rule boost_std ( inc ? lib ? )
+{
+# The default definitions for pre-built libraries.
+
+ project boost
+ : usage-requirements $(inc) BOOST_ALL_NO_LIB
+ : requirements @tag_std $(lib)
+ ;
+
+ alias headers ;
+ lib date_time : : : :
+ shared:BOOST_DATE_TIME_DYN_LINK ;
+ lib filesystem : : : :
+ shared:BOOST_FILE_SYSTEM_DYN_LINK ;
+ lib graph : : : :
+ shared:BOOST_GRAPH_DYN_LINK ;
+ lib graph_parallel : : : :
+ shared:BOOST_GRAPH_DYN_LINK ;
+ lib iostreams : : : :
+ shared:BOOST_IOSTREAMS_DYN_LINK ;
+ lib math_tr1 : : : :
+ shared:BOOST_MATH_TR1_DYN_LINK ;
+ lib math_tr1f : : : :
+ shared:BOOST_MATH_TR1_DYN_LINK ;
+ lib math_tr1l : : : :
+ shared:BOOST_MATH_TR1_DYN_LINK ;
+ lib math_c99 : : : :
+ shared:BOOST_MATH_TR1_DYN_LINK ;
+ lib math_c99f : : : :
+ shared:BOOST_MATH_TR1_DYN_LINK ;
+ lib math_c99l : : : :
+ shared:BOOST_MATH_TR1_DYN_LINK ;
+ lib mpi : : : :
+ shared:BOOST_MPI_DYN_LINK ;
+ lib program_options : : : :
+ shared:BOOST_PROGRAM_OPTIONS_DYN_LINK ;
+ lib python : : : :
+ shared:BOOST_PYTHON_DYN_LINK ;
+ lib random : : : :
+ shared:BOOST_RANDOM_DYN_LINK ;
+ lib regex : : : :
+ shared:BOOST_REGEX_DYN_LINK ;
+ lib serialization : : : :
+ shared:BOOST_SERIALIZATION_DYN_LINK ;
+ lib wserialization : : : :
+ shared:BOOST_SERIALIZATION_DYN_LINK ;
+ lib signals : : : :
+ shared:BOOST_SIGNALS_DYN_LINK ;
+ lib system : : : :
+ shared:BOOST_SYSTEM_DYN_LINK ;
+ lib unit_test_framework : : : :
+ shared:BOOST_TEST_DYN_LINK ;
+ lib prg_exec_monitor : : : :
+ shared:BOOST_TEST_DYN_LINK ;
+ lib test_exec_monitor : : : :
+ shared:BOOST_TEST_DYN_LINK ;
+ lib thread : : : :
+ shared:BOOST_THREAD_DYN_DLL ;
+ lib wave : : : :
+ shared:BOOST_WAVE_DYN_LINK ;
+}
+
+rule boost_0_0_1 ( inc ? lib ? )
+{
+ echo "You are trying to use an example placeholder for boost libs." ;
+ # Copy this template to another place (in the file boost.jam)
+ # and define a project and libraries modelled after the
+ # boost_std rule. Please note that it is also possible to have
+ # a per version taging rule in case they are different between
+ # versions.
+}
+
+rule tag_std ( name : type ? : property-set )
+{
+ name = boost_$(name) ;
+ if ( [ $(property-set).get ] in static ) &&
+ ( [ $(property-set).get ] in windows )
+ {
+ name = lib$(name) ;
+ }
+
+ local result ;
+ if $(.layout) = system
+ {
+ local version = [ MATCH ^([0-9]+)_([0-9]+) : $(.version_tag) ] ;
+ if $(version[1]) = "1" && [ numbers.less $(version[2]) 39 ]
+ {
+ result = [ tag_tagged $(name) : $(type) : $(property-set) ] ;
+ }
+ else
+ {
+ result = [ tag_system $(name) : $(type) : $(property-set) ] ;
+ }
+ }
+ else if $(.layout) = tagged
+ {
+ result = [ tag_tagged $(name) : $(type) : $(property-set) ] ;
+ }
+ else if $(.layout) = versioned
+ {
+ result = [ tag_versioned $(name) : $(type) : $(property-set) ] ;
+ }
+ else
+ {
+ errors.error "Missing layout" ;
+ }
+
+ return $(result) ;
+}
+
+rule tag_system ( name : type ? : property-set )
+{
+ return [ common.format-name
+
+ -$(.build_id)
+ : $(name) : $(type) : $(property-set) ] ;
+}
+
+rule tag_tagged ( name : type ? : property-set )
+{
+ return [ common.format-name
+
+ -$(.build_id)
+ : $(name) : $(type) : $(property-set) ] ;
+}
+
+rule tag_versioned ( name : type ? : property-set )
+{
+ return [ common.format-name
+ -$(.version_tag)
+ -$(.build_id)
+ : $(name) : $(type) : $(property-set) ] ;
+}
diff --git a/config.h.in b/config.h.in
index 444a2e218..185b696bf 100644
--- a/config.h.in
+++ b/config.h.in
@@ -100,9 +100,6 @@
/* Define to the one symbol short name of this package. */
#undef PACKAGE_TARNAME
-/* Define to the home page for this package. */
-#undef PACKAGE_URL
-
/* Define to the version of this package. */
#undef PACKAGE_VERSION
diff --git a/jam-files/LICENSE_1_0.txt b/jam-files/LICENSE_1_0.txt
new file mode 100644
index 000000000..36b7cd93c
--- /dev/null
+++ b/jam-files/LICENSE_1_0.txt
@@ -0,0 +1,23 @@
+Boost Software License - Version 1.0 - August 17th, 2003
+
+Permission is hereby granted, free of charge, to any person or organization
+obtaining a copy of the software and accompanying documentation covered by
+this license (the "Software") to use, reproduce, display, distribute,
+execute, and transmit the Software, and to prepare derivative works of the
+Software, and to permit third-parties to whom the Software is furnished to
+do so, all subject to the following:
+
+The copyright notices in the Software and this entire statement, including
+the above license grant, this restriction and the following disclaimer,
+must be included in all copies of the Software, in whole or in part, and
+all derivative works of the Software, unless such copies or derivative
+works are solely in the form of machine-executable object code generated by
+a source language processor.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
+SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
+FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
+ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+DEALINGS IN THE SOFTWARE.
diff --git a/jam-files/boost-build/boost-build.jam b/jam-files/boost-build/boost-build.jam
new file mode 100644
index 000000000..73db0497b
--- /dev/null
+++ b/jam-files/boost-build/boost-build.jam
@@ -0,0 +1,8 @@
+# Copyright 2001, 2002 Dave Abrahams
+# Copyright 2002 Rene Rivera
+# Copyright 2003 Vladimir Prus
+# Distributed under the Boost Software License, Version 1.0.
+# (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
+
+
+boost-build kernel ;
diff --git a/jam-files/boost-build/bootstrap.jam b/jam-files/boost-build/bootstrap.jam
new file mode 100644
index 000000000..af3e8bf50
--- /dev/null
+++ b/jam-files/boost-build/bootstrap.jam
@@ -0,0 +1,18 @@
+# Copyright (c) 2003 Vladimir Prus.
+#
+# Use, modification and distribution is subject to the Boost Software
+# License Version 1.0. (See accompanying file LICENSE_1_0.txt or
+# http://www.boost.org/LICENSE_1_0.txt)
+
+# This file handles initial phase of Boost.Build loading.
+# Boost.Jam has already figured out where Boost.Build is
+# and loads this file, which is responsible for initialization
+# of basic facilities such a module system and loading the
+# main Boost.Build module, build-system.jam.
+#
+# Exact operation of this module is not interesting, it makes
+# sense to look at build-system.jam right away.
+
+# Load the kernel/bootstrap.jam, which does all the work.
+.bootstrap-file = $(.bootstrap-file:D)/kernel/bootstrap.jam ;
+include $(.bootstrap-file) ;
\ No newline at end of file
diff --git a/jam-files/boost-build/build-system.jam b/jam-files/boost-build/build-system.jam
new file mode 100644
index 000000000..9f9c884cc
--- /dev/null
+++ b/jam-files/boost-build/build-system.jam
@@ -0,0 +1,1008 @@
+# Copyright 2003, 2005, 2007 Dave Abrahams
+# Copyright 2006, 2007 Rene Rivera
+# Copyright 2003, 2004, 2005, 2006 Vladimir Prus
+# Distributed under the Boost Software License, Version 1.0.
+# (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
+
+# This file is part of Boost Build version 2. You can think of it as forming the
+# main() routine. It is invoked by the bootstrapping code in bootstrap.jam.
+
+import build-request ;
+import builtin ;
+import "class" : new ;
+import errors ;
+import feature ;
+import make ;
+import modules ;
+import os ;
+import path ;
+import project ;
+import property-set ;
+import regex ;
+import sequence ;
+import targets ;
+import toolset ;
+import utility ;
+import version ;
+import virtual-target ;
+import generators ;
+import configure ;
+
+################################################################################
+#
+# Module global data.
+#
+################################################################################
+
+# Shortcut used in this module for accessing used command-line parameters.
+.argv = [ modules.peek : ARGV ] ;
+
+# Flag indicating we should display additional debugging information related to
+# locating and loading Boost Build configuration files.
+.debug-config = [ MATCH ^(--debug-configuration)$ : $(.argv) ] ;
+
+# Legacy option doing too many things, some of which are not even documented.
+# Should be phased out.
+# * Disables loading site and user configuration files.
+# * Disables auto-configuration for toolsets specified explicitly on the
+# command-line.
+# * Causes --toolset command-line options to be ignored.
+# * Prevents the default toolset from being used even if no toolset has been
+# configured at all.
+.legacy-ignore-config = [ MATCH ^(--ignore-config)$ : $(.argv) ] ;
+
+# The cleaning is tricky. Say, if user says 'bjam --clean foo' where 'foo' is a
+# directory, then we want to clean targets which are in 'foo' as well as those
+# in any children Jamfiles under foo but not in any unrelated Jamfiles. To
+# achieve this we collect a list of projects under which cleaning is allowed.
+.project-targets = ;
+
+# Virtual targets obtained when building main targets references on the command
+# line. When running 'bjam --clean main_target' we want to clean only files
+# belonging to that main target so we need to record which targets are produced
+# for it.
+.results-of-main-targets = ;
+
+# Was an XML dump requested?
+.out-xml = [ MATCH ^--out-xml=(.*)$ : $(.argv) ] ;
+
+# Default toolset & version to be used in case no other toolset has been used
+# explicitly by either the loaded configuration files, the loaded project build
+# scripts or an explicit toolset request on the command line. If not specified,
+# an arbitrary default will be used based on the current host OS. This value,
+# while not strictly necessary, has been added to allow testing Boost-Build's
+# default toolset usage functionality.
+.default-toolset = ;
+.default-toolset-version = ;
+
+
+################################################################################
+#
+# Public rules.
+#
+################################################################################
+
+# Returns the property set with the free features from the currently processed
+# build request.
+#
+rule command-line-free-features ( )
+{
+ return $(.command-line-free-features) ;
+}
+
+
+# Returns the location of the build system. The primary use case is building
+# Boost where it is sometimes needed to get the location of other components
+# (e.g. BoostBook files) and it is convenient to use locations relative to the
+# Boost Build path.
+#
+rule location ( )
+{
+ local r = [ modules.binding build-system ] ;
+ return $(r:P) ;
+}
+
+
+# Sets the default toolset & version to be used in case no other toolset has
+# been used explicitly by either the loaded configuration files, the loaded
+# project build scripts or an explicit toolset request on the command line. For
+# more detailed information see the comment related to used global variables.
+#
+rule set-default-toolset ( toolset : version ? )
+{
+ .default-toolset = $(toolset) ;
+ .default-toolset-version = $(version) ;
+}
+
+rule set-pre-build-hook ( function )
+{
+ .pre-build-hook = $(function) ;
+}
+
+rule set-post-build-hook ( function )
+{
+ .post-build-hook = $(function) ;
+}
+
+################################################################################
+#
+# Local rules.
+#
+################################################################################
+
+# Returns actual Jam targets to be used for executing a clean request.
+#
+local rule actual-clean-targets ( )
+{
+ # Construct a list of projects explicitly detected as targets on this build
+ # system run. These are the projects under which cleaning is allowed.
+ for local t in $(targets)
+ {
+ if [ class.is-a $(t) : project-target ]
+ {
+ .project-targets += [ $(t).project-module ] ;
+ }
+ }
+
+ # Construct a list of targets explicitly detected on this build system run
+ # as a result of building main targets.
+ local targets-to-clean ;
+ for local t in $(.results-of-main-targets)
+ {
+ # Do not include roots or sources.
+ targets-to-clean += [ virtual-target.traverse $(t) ] ;
+ }
+ targets-to-clean = [ sequence.unique $(targets-to-clean) ] ;
+
+ local to-clean ;
+ for local t in [ virtual-target.all-targets ]
+ {
+ local p = [ $(t).project ] ;
+
+ # Remove only derived targets.
+ if [ $(t).action ]
+ {
+ if $(t) in $(targets-to-clean) ||
+ [ should-clean-project [ $(p).project-module ] ] = true
+ {
+ to-clean += $(t) ;
+ }
+ }
+ }
+
+ local to-clean-actual ;
+ for local t in $(to-clean)
+ {
+ to-clean-actual += [ $(t).actualize ] ;
+ }
+ return $(to-clean-actual) ;
+}
+
+
+# Given a target id, try to find and return the corresponding target. This is
+# only invoked when there is no Jamfile in ".". This code somewhat duplicates
+# code in project-target.find but we can not reuse that code without a
+# project-targets instance.
+#
+local rule find-target ( target-id )
+{
+ local split = [ MATCH (.*)//(.*) : $(target-id) ] ;
+
+ local pm ;
+ if $(split)
+ {
+ pm = [ project.find $(split[1]) : "." ] ;
+ }
+ else
+ {
+ pm = [ project.find $(target-id) : "." ] ;
+ }
+
+ local result ;
+ if $(pm)
+ {
+ result = [ project.target $(pm) ] ;
+ }
+
+ if $(split)
+ {
+ result = [ $(result).find $(split[2]) ] ;
+ }
+
+ return $(result) ;
+}
+
+
+# Initializes a new configuration module.
+#
+local rule initialize-config-module ( module-name : location ? )
+{
+ project.initialize $(module-name) : $(location) ;
+ if USER_MODULE in [ RULENAMES ]
+ {
+ USER_MODULE $(module-name) ;
+ }
+}
+
+
+# Helper rule used to load configuration files. Loads the first configuration
+# file with the given 'filename' at 'path' into module with name 'module-name'.
+# Not finding the requested file may or may not be treated as an error depending
+# on the must-find parameter. Returns a normalized path to the loaded
+# configuration file or nothing if no file was loaded.
+#
+local rule load-config ( module-name : filename : path + : must-find ? )
+{
+ if $(.debug-config)
+ {
+ ECHO "notice: Searching" "$(path)" "for" "$(module-name)"
+ "configuration file" "$(filename)" "." ;
+ }
+ local where = [ GLOB $(path) : $(filename) ] ;
+ if $(where)
+ {
+ where = [ NORMALIZE_PATH $(where[1]) ] ;
+ if $(.debug-config)
+ {
+ ECHO "notice: Loading" "$(module-name)" "configuration file"
+ "$(filename)" "from" $(where) "." ;
+ }
+
+ # Set source location so that path-constant in config files
+ # with relative paths work. This is of most importance
+ # for project-config.jam, but may be used in other
+ # config files as well.
+ local attributes = [ project.attributes $(module-name) ] ;
+ $(attributes).set source-location : $(where:D) : exact ;
+ modules.load $(module-name) : $(filename) : $(path) ;
+ project.load-used-projects $(module-name) ;
+ }
+ else
+ {
+ if $(must-find)
+ {
+ errors.user-error "Configuration file" "$(filename)" "not found in"
+ "$(path)" "." ;
+ }
+ if $(.debug-config)
+ {
+ ECHO "notice:" "Configuration file" "$(filename)" "not found in"
+ "$(path)" "." ;
+ }
+ }
+ return $(where) ;
+}
+
+
+# Loads all the configuration files used by Boost Build in the following order:
+#
+# -- test-config --
+# Loaded only if specified on the command-line using the --test-config
+# command-line parameter. It is ok for this file not to exist even if specified.
+# If this configuration file is loaded, regular site and user configuration
+# files will not be. If a relative path is specified, file is searched for in
+# the current folder.
+#
+# -- site-config --
+# Always named site-config.jam. Will only be found if located on the system
+# root path (Windows), /etc (non-Windows), user's home folder or the Boost Build
+# path, in that order. Not loaded in case the test-config configuration file is
+# loaded or either the --ignore-site-config or the --ignore-config command-line
+# option is specified.
+#
+# -- user-config --
+# Named user-config.jam by default or may be named explicitly using the
+# --user-config command-line option or the BOOST_BUILD_USER_CONFIG environment
+# variable. If named explicitly the file is looked for from the current working
+# directory and if the default one is used then it is searched for in the
+# user's home directory and the Boost Build path, in that order. Not loaded in
+# case either the test-config configuration file is loaded, --ignore-config
+# command-line option is specified or an empty file name is explicitly
+# specified. If the file name has been given explicitly then the file must
+# exist.
+#
+# Test configurations have been added primarily for use by Boost Build's
+# internal unit testing system but may be used freely in other places as well.
+#
+local rule load-configuration-files
+{
+ # Flag indicating that site configuration should not be loaded.
+ local ignore-site-config =
+ [ MATCH ^(--ignore-site-config)$ : $(.argv) ] ;
+
+ if $(.legacy-ignore-config) && $(.debug-config)
+ {
+ ECHO "notice: Regular site and user configuration files will be ignored" ;
+ ECHO "notice: due to the --ignore-config command-line option." ;
+ }
+
+ initialize-config-module test-config ;
+ local test-config = [ MATCH ^--test-config=(.*)$ : $(.argv) ] ;
+ local uq = [ MATCH \"(.*)\" : $(test-config) ] ;
+ if $(uq)
+ {
+ test-config = $(uq) ;
+ }
+ if $(test-config)
+ {
+ local where =
+ [ load-config test-config : $(test-config:BS) : $(test-config:D) ] ;
+ if $(where)
+ {
+ if $(.debug-config) && ! $(.legacy-ignore-config)
+ {
+ ECHO "notice: Regular site and user configuration files will" ;
+ ECHO "notice: be ignored due to the test configuration being"
+ "loaded." ;
+ }
+ }
+ else
+ {
+ test-config = ;
+ }
+ }
+
+ local user-path = [ os.home-directories ] [ os.environ BOOST_BUILD_PATH ] ;
+ local site-path = /etc $(user-path) ;
+ if [ os.name ] in NT CYGWIN
+ {
+ site-path = [ modules.peek : SystemRoot ] $(user-path) ;
+ }
+
+ if $(ignore-site-config) && !$(.legacy-ignore-config)
+ {
+ ECHO "notice: Site configuration files will be ignored due to the" ;
+ ECHO "notice: --ignore-site-config command-line option." ;
+ }
+
+ initialize-config-module site-config ;
+ if ! $(test-config) && ! $(ignore-site-config) && ! $(.legacy-ignore-config)
+ {
+ load-config site-config : site-config.jam : $(site-path) ;
+ }
+
+ initialize-config-module user-config ;
+ if ! $(test-config) && ! $(.legacy-ignore-config)
+ {
+ local user-config = [ MATCH ^--user-config=(.*)$ : $(.argv) ] ;
+ user-config = $(user-config[-1]) ;
+ user-config ?= [ os.environ BOOST_BUILD_USER_CONFIG ] ;
+ # Special handling for the case when the OS does not strip the quotes
+ # around the file name, as is the case when using Cygwin bash.
+ user-config = [ utility.unquote $(user-config) ] ;
+ local explicitly-requested = $(user-config) ;
+ user-config ?= user-config.jam ;
+
+ if $(user-config)
+ {
+ if $(explicitly-requested)
+ {
+ # Treat explicitly entered user paths as native OS path
+ # references and, if non-absolute, root them at the current
+ # working directory.
+ user-config = [ path.make $(user-config) ] ;
+ user-config = [ path.root $(user-config) [ path.pwd ] ] ;
+ user-config = [ path.native $(user-config) ] ;
+
+ if $(.debug-config)
+ {
+ ECHO "notice: Loading explicitly specified user"
+ "configuration file:" ;
+ ECHO " $(user-config)" ;
+ }
+
+ load-config user-config : $(user-config:BS) : $(user-config:D)
+ : must-exist ;
+ }
+ else
+ {
+ load-config user-config : $(user-config) : $(user-path) ;
+ }
+ }
+ else if $(.debug-config)
+ {
+ ECHO "notice: User configuration file loading explicitly disabled." ;
+ }
+ }
+
+ # We look for project-config.jam from "." upward.
+ # I am not sure this is 100% right decision, we might as well check for
+ # it only alonside the Jamroot file. However:
+ #
+ # - We need to load project-root.jam before Jamroot
+ # - We probably would need to load project-root.jam even if there's no
+ # Jamroot - e.g. to implement automake-style out-of-tree builds.
+ local file = [ path.glob "." : project-config.jam ] ;
+ if ! $(file)
+ {
+ file = [ path.glob-in-parents "." : project-config.jam ] ;
+ }
+ if $(file)
+ {
+ initialize-config-module project-config : $(file:D) ;
+ load-config project-config : project-config.jam : $(file:D) ;
+ }
+}
+
+
+# Autoconfigure toolsets based on any instances of --toolset=xx,yy,...zz or
+# toolset=xx,yy,...zz in the command line. May return additional properties to
+# be processed as if they had been specified by the user.
+#
+local rule process-explicit-toolset-requests
+{
+ local extra-properties ;
+
+ local option-toolsets = [ regex.split-list [ MATCH ^--toolset=(.*)$ : $(.argv) ] : "," ] ;
+ local feature-toolsets = [ regex.split-list [ MATCH ^toolset=(.*)$ : $(.argv) ] : "," ] ;
+
+ for local t in $(option-toolsets) $(feature-toolsets)
+ {
+ # Parse toolset-version/properties.
+ local (t-v,t,v) = [ MATCH (([^-/]+)-?([^/]+)?)/?.* : $(t) ] ;
+ local toolset-version = $((t-v,t,v)[1]) ;
+ local toolset = $((t-v,t,v)[2]) ;
+ local version = $((t-v,t,v)[3]) ;
+
+ if $(.debug-config)
+ {
+ ECHO notice: [cmdline-cfg] Detected command-line request for
+ $(toolset-version): "toolset=" $(toolset) "version="
+ $(version) ;
+ }
+
+ # If the toolset is not known, configure it now.
+ local known ;
+ if $(toolset) in [ feature.values ]
+ {
+ known = true ;
+ }
+ if $(known) && $(version) && ! [ feature.is-subvalue toolset
+ : $(toolset) : version : $(version) ]
+ {
+ known = ;
+ }
+ # TODO: we should do 'using $(toolset)' in case no version has been
+ # specified and there are no versions defined for the given toolset to
+ # allow the toolset to configure its default version. For this we need
+ # to know how to detect whether a given toolset has any versions
+ # defined. An alternative would be to do this whenever version is not
+ # specified but that would require that toolsets correctly handle the
+ # case when their default version is configured multiple times which
+ # should be checked for all existing toolsets first.
+
+ if ! $(known)
+ {
+ if $(.debug-config)
+ {
+ ECHO "notice: [cmdline-cfg] toolset $(toolset-version) not"
+ "previously configured; attempting to auto-configure now" ;
+ }
+ toolset.using $(toolset) : $(version) ;
+ }
+ else
+ {
+ if $(.debug-config)
+ {
+ ECHO notice: [cmdline-cfg] toolset $(toolset-version) already
+ configured ;
+ }
+ }
+
+ # Make sure we get an appropriate property into the build request in
+ # case toolset has been specified using the "--toolset=..." command-line
+ # option form.
+ if ! $(t) in $(.argv) && ! $(t) in $(feature-toolsets)
+ {
+ if $(.debug-config)
+ {
+ ECHO notice: [cmdline-cfg] adding toolset=$(t) to the build
+ request. ;
+ }
+ extra-properties += toolset=$(t) ;
+ }
+ }
+
+ return $(extra-properties) ;
+}
+
+
+# Returns 'true' if the given 'project' is equal to or is a (possibly indirect)
+# child to any of the projects requested to be cleaned in this build system run.
+# Returns 'false' otherwise. Expects the .project-targets list to have already
+# been constructed.
+#
+local rule should-clean-project ( project )
+{
+ if ! $(.should-clean-project.$(project))
+ {
+ local r = false ;
+ if $(project) in $(.project-targets)
+ {
+ r = true ;
+ }
+ else
+ {
+ local parent = [ project.attribute $(project) parent-module ] ;
+ if $(parent) && $(parent) != user-config
+ {
+ r = [ should-clean-project $(parent) ] ;
+ }
+ }
+ .should-clean-project.$(project) = $(r) ;
+ }
+
+ return $(.should-clean-project.$(project)) ;
+}
+
+
+################################################################################
+#
+# main()
+# ------
+#
+################################################################################
+
+{
+ if --version in $(.argv)
+ {
+ version.print ;
+ EXIT ;
+ }
+
+ version.verify-engine-version ;
+
+ load-configuration-files ;
+
+ local extra-properties ;
+ # Note that this causes --toolset options to be ignored if --ignore-config
+ # is specified.
+ if ! $(.legacy-ignore-config)
+ {
+ extra-properties = [ process-explicit-toolset-requests ] ;
+ }
+
+
+ # We always load project in "." so that 'use-project' directives have any
+ # chance of being seen. Otherwise, we would not be able to refer to
+ # subprojects using target ids.
+ local current-project ;
+ if [ project.find "." : "." ]
+ {
+ current-project = [ project.target [ project.load "." ] ] ;
+ }
+
+
+ # In case there are no toolsets currently defined makes the build run using
+ # the default toolset.
+ if ! $(.legacy-ignore-config) && ! [ feature.values ]
+ {
+ local default-toolset = $(.default-toolset) ;
+ local default-toolset-version = ;
+ if $(default-toolset)
+ {
+ default-toolset-version = $(.default-toolset-version) ;
+ }
+ else
+ {
+ default-toolset = gcc ;
+ if [ os.name ] = NT
+ {
+ default-toolset = msvc ;
+ }
+ else if [ os.name ] = MACOSX
+ {
+ default-toolset = darwin ;
+ }
+ }
+
+ ECHO "warning: No toolsets are configured." ;
+ ECHO "warning: Configuring default toolset" \"$(default-toolset)\". ;
+ ECHO "warning: If the default is wrong, your build may not work correctly." ;
+ ECHO "warning: Use the \"toolset=xxxxx\" option to override our guess." ;
+ ECHO "warning: For more configuration options, please consult" ;
+ ECHO "warning: http://boost.org/boost-build2/doc/html/bbv2/advanced/configuration.html" ;
+
+ toolset.using $(default-toolset) : $(default-toolset-version) ;
+ }
+
+
+ # Parse command line for targets and properties. Note that this requires
+ # that all project files already be loaded.
+ local build-request = [ build-request.from-command-line $(.argv)
+ $(extra-properties) ] ;
+ local target-ids = [ $(build-request).get-at 1 ] ;
+ local properties = [ $(build-request).get-at 2 ] ;
+
+
+ # Expand properties specified on the command line into multiple property
+ # sets consisting of all legal property combinations. Each expanded property
+ # set will be used for a single build run. E.g. if multiple toolsets are
+ # specified then requested targets will be built with each of them.
+ if $(properties)
+ {
+ expanded = [ build-request.expand-no-defaults $(properties) ] ;
+ local xexpanded ;
+ for local e in $(expanded)
+ {
+ xexpanded += [ property-set.create [ feature.split $(e) ] ] ;
+ }
+ expanded = $(xexpanded) ;
+ }
+ else
+ {
+ expanded = [ property-set.empty ] ;
+ }
+
+
+ # Check that we actually found something to build.
+ if ! $(current-project) && ! $(target-ids)
+ {
+ errors.user-error "error: no Jamfile in current directory found, and no"
+ "target references specified." ;
+ EXIT ;
+ }
+
+
+ # Flags indicating that this build system run has been started in order to
+ # clean existing instead of create new targets. Note that these are not the
+ # final flag values as they may get changed later on due to some special
+ # targets being specified on the command line.
+ local clean ; if "--clean" in $(.argv) { clean = true ; }
+ local cleanall ; if "--clean-all" in $(.argv) { cleanall = true ; }
+
+
+ # List of explicitly requested files to build. Any target references read
+ # from the command line parameter not recognized as one of the targets
+ # defined in the loaded Jamfiles will be interpreted as an explicitly
+ # requested file to build. If any such files are explicitly requested then
+ # only those files and the targets they depend on will be built and they
+ # will be searched for among targets that would have been built had there
+ # been no explicitly requested files.
+ local explicitly-requested-files
+
+
+ # List of Boost Build meta-targets, virtual-targets and actual Jam targets
+ # constructed in this build system run.
+ local targets ;
+ local virtual-targets ;
+ local actual-targets ;
+
+
+ # Process each target specified on the command-line and convert it into
+ # internal Boost Build target objects. Detect special clean target. If no
+ # main Boost Build targets were explictly requested use the current project
+ # as the target.
+ for local id in $(target-ids)
+ {
+ if $(id) = clean
+ {
+ clean = true ;
+ }
+ else
+ {
+ local t ;
+ if $(current-project)
+ {
+ t = [ $(current-project).find $(id) : no-error ] ;
+ }
+ else
+ {
+ t = [ find-target $(id) ] ;
+ }
+
+ if ! $(t)
+ {
+ ECHO "notice: could not find main target" $(id) ;
+ ECHO "notice: assuming it is a name of file to create." ;
+ explicitly-requested-files += $(id) ;
+ }
+ else
+ {
+ targets += $(t) ;
+ }
+ }
+ }
+ if ! $(targets)
+ {
+ targets += [ project.target [ project.module-name "." ] ] ;
+ }
+
+ if [ option.get dump-generators : : true ]
+ {
+ generators.dump ;
+ }
+
+ # We wish to put config.log in the build directory corresponding
+ # to Jamroot, so that the location does not differ depending on
+ # directory where we do build. The amount of indirection necessary
+ # here is scary.
+ local first-project = [ $(targets[0]).project ] ;
+ local first-project-root-location = [ $(first-project).get project-root ] ;
+ local first-project-root-module = [ project.load $(first-project-root-location) ] ;
+ local first-project-root = [ project.target $(first-project-root-module) ] ;
+ local first-build-build-dir = [ $(first-project-root).build-dir ] ;
+ configure.set-log-file $(first-build-build-dir)/config.log ;
+
+ # Now that we have a set of targets to build and a set of property sets to
+ # build the targets with, we can start the main build process by using each
+ # property set to generate virtual targets from all of our listed targets
+ # and any of their dependants.
+ for local p in $(expanded)
+ {
+ .command-line-free-features = [ property-set.create [ $(p).free ] ] ;
+ for local t in $(targets)
+ {
+ local g = [ $(t).generate $(p) ] ;
+ if ! [ class.is-a $(t) : project-target ]
+ {
+ .results-of-main-targets += $(g[2-]) ;
+ }
+ virtual-targets += $(g[2-]) ;
+ }
+ }
+
+
+ # Convert collected virtual targets into actual raw Jam targets.
+ for t in $(virtual-targets)
+ {
+ actual-targets += [ $(t).actualize ] ;
+ }
+
+
+ # If XML data output has been requested prepare additional rules and targets
+ # so we can hook into Jam to collect build data while its building and have
+ # it trigger the final XML report generation after all the planned targets
+ # have been built.
+ if $(.out-xml)
+ {
+ # Get a qualified virtual target name.
+ rule full-target-name ( target )
+ {
+ local name = [ $(target).name ] ;
+ local project = [ $(target).project ] ;
+ local project-path = [ $(project).get location ] ;
+ return $(project-path)//$(name) ;
+ }
+
+ # Generate an XML file containing build statistics for each constituent.
+ #
+ rule out-xml ( xml-file : constituents * )
+ {
+ # Prepare valid XML header and footer with some basic info.
+ local nl = "
+" ;
+ local os = [ modules.peek : OS OSPLAT JAMUNAME ] "" ;
+ local timestamp = [ modules.peek : JAMDATE ] ;
+ local cwd = [ PWD ] ;
+ local command = $(.argv) ;
+ local bb-version = [ version.boost-build ] ;
+ .header on $(xml-file) =
+ ""
+ "$(nl)"
+ "$(nl) "
+ "$(nl) "
+ "$(nl) "
+ "$(nl) "
+ ;
+ .footer on $(xml-file) =
+ "$(nl)" ;
+
+ # Generate the target dependency graph.
+ .contents on $(xml-file) +=
+ "$(nl) " ;
+ for local t in [ virtual-target.all-targets ]
+ {
+ local action = [ $(t).action ] ;
+ if $(action)
+ # If a target has no action, it has no dependencies.
+ {
+ local name = [ full-target-name $(t) ] ;
+ local sources = [ $(action).sources ] ;
+ local dependencies ;
+ for local s in $(sources)
+ {
+ dependencies += [ full-target-name $(s) ] ;
+ }
+
+ local path = [ $(t).path ] ;
+ local jam-target = [ $(t).actual-name ] ;
+
+ .contents on $(xml-file) +=
+ "$(nl) "
+ "$(nl) "
+ "$(nl) "
+ "$(nl) "
+ "$(nl) "
+ "$(nl) "
+ "$(nl) "
+ "$(nl) "
+ ;
+ }
+ }
+ .contents on $(xml-file) +=
+ "$(nl) " ;
+
+ # Build $(xml-file) after $(constituents). Do so even if a
+ # constituent action fails and regenerate the xml on every bjam run.
+ INCLUDES $(xml-file) : $(constituents) ;
+ ALWAYS $(xml-file) ;
+ __ACTION_RULE__ on $(xml-file) = build-system.out-xml.generate-action ;
+ out-xml.generate $(xml-file) ;
+ }
+
+ # The actual build actions are here; if we did this work in the actions
+ # clause we would have to form a valid command line containing the
+ # result of @(...) below (the name of the XML file).
+ #
+ rule out-xml.generate-action ( args * : xml-file
+ : command status start end user system : output ? )
+ {
+ local contents =
+ [ on $(xml-file) return $(.header) $(.contents) $(.footer) ] ;
+ local f = @($(xml-file):E=$(contents)) ;
+ }
+
+ # Nothing to do here; the *real* actions happen in
+ # out-xml.generate-action.
+ actions quietly out-xml.generate { }
+
+ # Define the out-xml file target, which depends on all the targets so
+ # that it runs the collection after the targets have run.
+ out-xml $(.out-xml) : $(actual-targets) ;
+
+ # Set up a global __ACTION_RULE__ that records all the available
+ # statistics about each actual target in a variable "on" the --out-xml
+ # target.
+ #
+ rule out-xml.collect ( xml-file : target : command status start end user
+ system : output ? )
+ {
+ local nl = "
+" ;
+ # Open the action with some basic info.
+ .contents on $(xml-file) +=
+ "$(nl) " ;
+
+ # If we have an action object we can print out more detailed info.
+ local action = [ on $(target) return $(.action) ] ;
+ if $(action)
+ {
+ local action-name = [ $(action).action-name ] ;
+ local action-sources = [ $(action).sources ] ;
+ local action-props = [ $(action).properties ] ;
+
+ # The qualified name of the action which we created the target.
+ .contents on $(xml-file) +=
+ "$(nl) " ;
+
+ # The sources that made up the target.
+ .contents on $(xml-file) +=
+ "$(nl) " ;
+ for local source in $(action-sources)
+ {
+ local source-actual = [ $(source).actual-name ] ;
+ .contents on $(xml-file) +=
+ "$(nl) " ;
+ }
+ .contents on $(xml-file) +=
+ "$(nl) " ;
+
+ # The properties that define the conditions under which the
+ # target was built.
+ .contents on $(xml-file) +=
+ "$(nl) " ;
+ for local prop in [ $(action-props).raw ]
+ {
+ local prop-name = [ MATCH ^<(.*)>$ : $(prop:G) ] ;
+ .contents on $(xml-file) +=
+ "$(nl) " ;
+ }
+ .contents on $(xml-file) +=
+ "$(nl) " ;
+ }
+
+ local locate = [ on $(target) return $(LOCATE) ] ;
+ locate ?= "" ;
+ .contents on $(xml-file) +=
+ "$(nl) "
+ "$(nl) "
+ "$(nl) "
+ "$(nl) " ;
+ .contents on $(xml-file) +=
+ "$(nl) " ;
+ }
+
+ # When no __ACTION_RULE__ is set "on" a target, the search falls back to
+ # the global module.
+ module
+ {
+ __ACTION_RULE__ = build-system.out-xml.collect
+ [ modules.peek build-system : .out-xml ] ;
+ }
+
+ IMPORT
+ build-system :
+ out-xml.collect
+ out-xml.generate-action
+ : :
+ build-system.out-xml.collect
+ build-system.out-xml.generate-action
+ ;
+ }
+
+ local j = [ option.get jobs ] ;
+ if $(j)
+ {
+ modules.poke : PARALLELISM : $(j) ;
+ }
+
+ local k = [ option.get keep-going : true : true ] ;
+ if $(k) in "on" "yes" "true"
+ {
+ modules.poke : KEEP_GOING : 1 ;
+ }
+ else if $(k) in "off" "no" "false"
+ {
+ modules.poke : KEEP_GOING : 0 ;
+ }
+ else
+ {
+ ECHO "error: Invalid value for the --keep-going option" ;
+ EXIT ;
+ }
+
+ # The 'all' pseudo target is not strictly needed expect in the case when we
+ # use it below but people often assume they always have this target
+ # available and do not declare it themselves before use which may cause
+ # build failures with an error message about not being able to build the
+ # 'all' target.
+ NOTFILE all ;
+
+ # And now that all the actual raw Jam targets and all the dependencies
+ # between them have been prepared all that is left is to tell Jam to update
+ # those targets.
+ if $(explicitly-requested-files)
+ {
+ # Note that this case can not be joined with the regular one when only
+ # exact Boost Build targets are requested as here we do not build those
+ # requested targets but only use them to construct the dependency tree
+ # needed to build the explicitly requested files.
+ UPDATE $(explicitly-requested-files:G=e) $(.out-xml) ;
+ }
+ else if $(cleanall)
+ {
+ UPDATE clean-all ;
+ }
+ else if $(clean)
+ {
+ common.Clean clean : [ actual-clean-targets ] ;
+ UPDATE clean ;
+ }
+ else
+ {
+ configure.print-configure-checks-summary ;
+
+ if $(.pre-build-hook)
+ {
+ $(.pre-build-hook) ;
+ }
+
+ DEPENDS all : $(actual-targets) ;
+ if UPDATE_NOW in [ RULENAMES ]
+ {
+ local ok = [ UPDATE_NOW all $(.out-xml) ] ;
+ if $(.post-build-hook)
+ {
+ $(.post-build-hook) $(ok) ;
+ }
+ # Prevent automatic update of the 'all' target, now that
+ # we have explicitly updated what we wanted.
+ UPDATE ;
+ }
+ else
+ {
+ UPDATE all $(.out-xml) ;
+ }
+ }
+}
diff --git a/jam-files/boost-build/build/ac.jam b/jam-files/boost-build/build/ac.jam
new file mode 100644
index 000000000..6768f358c
--- /dev/null
+++ b/jam-files/boost-build/build/ac.jam
@@ -0,0 +1,198 @@
+# Copyright (c) 2010 Vladimir Prus.
+#
+# Use, modification and distribution is subject to the Boost Software
+# License Version 1.0. (See accompanying file LICENSE_1_0.txt or
+# http://www.boost.org/LICENSE_1_0.txt)
+
+import property-set ;
+import path ;
+import modules ;
+import "class" ;
+import errors ;
+import configure ;
+
+rule find-include-path ( variable : properties : header
+ : provided-path ? )
+{
+ # FIXME: document which properties affect this function by
+ # default.
+ local target-os = [ $(properties).get ] ;
+ properties = [ property-set.create $(toolset) ] ;
+ if $($(variable)-$(properties))
+ {
+ return $($(variable)-$(properties)) ;
+ }
+ else
+ {
+ provided-path ?= [ modules.peek : $(variable) ] ;
+ includes = $(provided-path) ;
+ includes += [ $(properties).get ] ;
+ if [ $(properties).get ] != windows
+ {
+ # FIXME: use sysroot
+ includes += /usr/include ;
+ }
+
+ local result ;
+ while ! $(result) && $(includes)
+ {
+ local f = [ path.root $(header) $(includes[1]) ] ;
+ ECHO "Checking " $(f) ;
+ if [ path.exists $(f) ]
+ {
+ result = $(includes[1]) ;
+ }
+ else if $(provided-path)
+ {
+ errors.user-error "Could not find header" $(header)
+ : "in the user-specified directory" $(provided-path) ;
+ }
+ includes = $(includes[2-]) ;
+ }
+ $(variable)-$(properties) = $(result) ;
+ return $(result) ;
+ }
+}
+
+rule find-library ( variable : properties : names + : provided-path ? )
+{
+ local target-os = [ $(properties).get ] ;
+ properties = [ property-set.create $(toolset) ] ;
+ if $($(variable)-$(properties))
+ {
+ return $($(variable)-$(properties)) ;
+ }
+ else
+ {
+ provided-path ?= [ modules.peek : $(variable) ] ;
+ paths = $(provided-path) ;
+ paths += [ $(properties).get ] ;
+ if [ $(properties).get ] != windows
+ {
+ paths += /usr/lib /usr/lib32 /usr/lib64 ;
+ }
+
+ local result ;
+ while ! $(result) && $(paths)
+ {
+ while ! $(result) && $(names)
+ {
+ local f ;
+ if $(target-os) = windows
+ {
+ f = $(paths[1])/$(names[1]).lib ;
+ if [ path.exists $(f) ]
+ {
+ result = $(f) ;
+ }
+ }
+ else
+ {
+ # FIXME: check for .a as well, depending on
+ # the 'link' feature.
+ f = $(paths[1])/lib$(names[1]).so ;
+ ECHO "CHECKING $(f) " ;
+ if [ path.exists $(f) ]
+ {
+ result = $(f) ;
+ }
+ }
+ if ! $(result) && $(provided-path)
+ {
+ errors.user-error "Could not find either of: " $(names)
+ : "in the user-specified directory" $(provided-path) ;
+
+ }
+ names = $(names[2-]) ;
+ }
+ paths = $(paths[2-]) ;
+ }
+ $(variable)-$(properties) = $(result) ;
+ return $(result) ;
+ }
+}
+
+class ac-library : basic-target
+{
+ import errors ;
+ import indirect ;
+ import virtual-target ;
+ import ac ;
+ import configure ;
+
+ rule __init__ ( name : project : * : * )
+ {
+ basic-target.__init__ $(name) : $(project) : $(sources)
+ : $(requirements) ;
+
+ reconfigure $(3) : $(4) : $(5) : $(6) : $(7) : $(8) : $(9) ;
+ }
+
+ rule set-header ( header )
+ {
+ self.header = $(header) ;
+ }
+
+ rule set-default-names ( names + )
+ {
+ self.default-names = $(names) ;
+ }
+
+ rule reconfigure ( * : * )
+ {
+ ECHO "XXX" $(1) ;
+ if ! $(1)
+ {
+ # This is 'using xxx ;'. Nothing to configure, really.
+ }
+ else
+ {
+ for i in 1 2 3 4 5 6 7 8 9
+ {
+ # FIXME: this naming is inconsistent with XXX_INCLUDE/XXX_LIBRARY
+ if ! ( $($(i)[1]) in root include-path library-path library-name condition )
+ {
+ errors.user-error "Invalid named parameter" $($(i)[1]) ;
+ }
+ local name = $($(i)[1]) ;
+ local value = $($(i)[2-]) ;
+ if $($(name)) && $($(name)) != $(value)
+ {
+ errors.user-error "Attempt to change value of '$(name)'" ;
+ }
+ $(name) = $(value) ;
+ }
+
+ include-path ?= $(root)/include ;
+ library-path ?= $(root)/lib ;
+ }
+ }
+
+ rule construct ( name : sources * : property-set )
+ {
+ # FIXME: log results.
+ local libnames = $(library-name) ;
+ if ! $(libnames) && ! $(include-path) && ! $(library-path)
+ {
+ libnames = [ modules.peek : $(name:U)_NAME ] ;
+ # Backward compatibility only.
+ libnames ?= [ modules.peek : $(name:U)_BINARY ] ;
+ }
+ libnames ?= $(self.default-names) ;
+
+ local includes = [
+ ac.find-include-path $(name:U)_INCLUDE : $(property-set) : $(self.header) : $(include-path) ] ;
+ local library = [ ac.find-library $(name:U)_LIBRARY : $(property-set) : $(libnames) : $(library-path) ] ;
+ if $(includes) && $(library)
+ {
+ library = [ virtual-target.from-file $(library) : . : $(self.project) ] ;
+ configure.log-library-search-result $(name) : "found" ;
+ return [ property-set.create $(includes)