summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Dyer <cdyer@cs.cmu.edu>2012-05-13 22:23:34 -0700
committerChris Dyer <cdyer@cs.cmu.edu>2012-05-13 22:23:34 -0700
commit0f1e696690b18259acd79c3469d00a72aca00161 (patch)
tree015858b1fa99092fd4f8040cbcf1a4b08ff6c26c
parent076d48d459ecbf366b0a59ab6afe68af99bdcff2 (diff)
parent2f64af3e06a518b93f7ca2c30a9d0aeb2c947031 (diff)
Merge branch 'master' of github.com:redpony/cdec
-rw-r--r--Jamroot15
-rw-r--r--jam-files/sanity.jam12
2 files changed, 20 insertions, 7 deletions
diff --git a/Jamroot b/Jamroot
index b5b786cd..f873db68 100644
--- a/Jamroot
+++ b/Jamroot
@@ -1,10 +1,21 @@
+#cdec compilation with bjam
+#
+#--with-boost=/usr/include
+#--with-google-hash=/usr/include so that $with-google-hash/google/dense_hash_map exists
+#
+#-a forces the build to run from scratch
+#-jN parallelizes just like make
+#
+#Respects CXXFLAGS, CFLAGS, and LDFLAGS environment variables.
+
path-constant TOP : . ;
include $(TOP)/jam-files/sanity.jam ;
boost 104400 ;
external-lib z ;
-if [ test_header google/dense_hash_map ] {
- requirements += <define>HAVE_SPARSEHASH ;
+with-google-hash = [ option.get "with-google-hash" ] ;
+if [ test_header google/dense_hash_map ] || $(with-google-hash) {
+ requirements += <define>HAVE_SPARSEHASH <include>$(with-google-hash) ;
}
if [ test_header boost/serialization/map.hpp ] && [ test_library boost_serialization ] {
diff --git a/jam-files/sanity.jam b/jam-files/sanity.jam
index eeb59f6e..9c75c247 100644
--- a/jam-files/sanity.jam
+++ b/jam-files/sanity.jam
@@ -13,9 +13,15 @@ rule _shell ( cmd : extras * ) {
return [ trim-nl [ SHELL $(cmd) : $(extras) ] ] ;
}
+cxxflags = [ os.environ "CXXFLAGS" ] ;
+cflags = [ os.environ "CFLAGS" ] ;
+ldflags = [ os.environ "LDFLAGS" ] ;
+
#Run g++ with empty main and these arguments to see if it passes.
rule test_flags ( flags * ) {
- local cmd = "bash -c \"g++ "$(flags:J=" ")" -x c++ - <<<'int main() {}' -o /dev/null >/dev/null 2>/dev/null\"" ;
+ local add = $(CXXFLAGS) $(LDFLAGS) ;
+ add ?= "" ;
+ local cmd = "bash -c \"g++ $(add) "$(flags:J=" ")" -x c++ - <<<'int main() {}' -o /dev/null >/dev/null 2>/dev/null\"" ;
local ret = [ SHELL $(cmd) : exit-status ] ;
if --debug-configuration in [ modules.peek : ARGV ] {
echo $(cmd) ;
@@ -144,10 +150,6 @@ rule external-lib ( name : search-path * ) {
requirements = ;
{
- local cxxflags = [ os.environ "CXXFLAGS" ] ;
- local cflags = [ os.environ "CFLAGS" ] ;
- local ldflags = [ os.environ "LDFLAGS" ] ;
-
#Boost jam's static clang is buggy.
requirements += <cxxflags>$(cxxflags) <cflags>$(cflags) <linkflags>$(ldflags) <toolset>clang:<link>shared ;