| 1 |
# Hamigaki Library root settings |
| 2 |
# |
| 3 |
# Copyright Takeshi Mouri 2006, 2007. |
| 4 |
# Distributed under the Boost Software License, Version 1.0. |
| 5 |
# (See accompanying file LICENSE_1_0.txt or copy at |
| 6 |
# http://www.boost.org/LICENSE_1_0.txt) |
| 7 |
|
| 8 |
import modules ; |
| 9 |
|
| 10 |
path-constant HAMIGAKI_ROOT : . ; |
| 11 |
modules.poke : HAMIGAKI_ROOT : $(HAMIGAKI_ROOT) ; |
| 12 |
|
| 13 |
module |
| 14 |
{ |
| 15 |
if ! $(HAMIGAKI_ROOT)/tools/build in $(BOOST_BUILD_PATH) |
| 16 |
{ |
| 17 |
BOOST_BUILD_PATH += $(HAMIGAKI_ROOT)/tools/build ; |
| 18 |
modules.poke .ENVIRON : BOOST_BUILD_PATH : $(BOOST_BUILD_PATH) ; |
| 19 |
} |
| 20 |
} |
| 21 |
|
| 22 |
if ! [ project.find /boost-lib : . ] |
| 23 |
{ |
| 24 |
local rule make-project ( name ) |
| 25 |
{ |
| 26 |
modules.poke $(name) : __name__ : $(name) ; |
| 27 |
module $(name) |
| 28 |
{ |
| 29 |
import project ; |
| 30 |
project.initialize $(__name__) ; |
| 31 |
project $(__name__) ; |
| 32 |
} |
| 33 |
} |
| 34 |
|
| 35 |
if [ modules.peek : BOOST_LIBPATH ] |
| 36 |
{ |
| 37 |
project.push-current [ project.current ] ; |
| 38 |
make-project boost-lib ; |
| 39 |
module boost-lib |
| 40 |
{ |
| 41 |
import boost-prebuilt ; |
| 42 |
import modules ; |
| 43 |
import os ; |
| 44 |
|
| 45 |
local boost-include = [ modules.peek : BOOST_INCLUDE ] ; |
| 46 |
if ! $(boost-include) |
| 47 |
{ |
| 48 |
boost-include = [ modules.peek : BOOST_ROOT ] ; |
| 49 |
} |
| 50 |
local boost-libpath = [ modules.peek : BOOST_LIBPATH ] ; |
| 51 |
|
| 52 |
alias headers : : : : <include>$(boost-include) ; |
| 53 |
|
| 54 |
local requirements = <search>$(boost-libpath) ; |
| 55 |
if $(NO_BOOST_STD_LIB_NAME) |
| 56 |
{ |
| 57 |
requirements += <boost-layout>system ; |
| 58 |
} |
| 59 |
|
| 60 |
boost-prebuilt boost_filesystem : $(requirements) ; |
| 61 |
boost-prebuilt boost_regex : $(requirements) ; |
| 62 |
|
| 63 |
rule create-ios-libaray ( name ) |
| 64 |
{ |
| 65 |
local NAME = $(name:U) ; |
| 66 |
|
| 67 |
local no-compression = [ modules.peek : NO_COMPRESSION ] ; |
| 68 |
local no-$(name) = [ modules.peek : NO_$(NAME) ] ; |
| 69 |
local $(name)-source = [ modules.peek : $(NAME)_SOURCE ] ; |
| 70 |
local $(name)-include = [ modules.peek : $(NAME)_INCLUDE ] ; |
| 71 |
local $(name)-binary = [ modules.peek : $(NAME)_BINARY ] ; |
| 72 |
local $(name)-libpath = [ modules.peek : $(NAME)_LIBPATH ] ; |
| 73 |
|
| 74 |
if [ os.name ] = NT && ! $($(name)-source) && ! $($(name)-include) |
| 75 |
{ |
| 76 |
no-$(name) = 1 ; |
| 77 |
modules.poke : NO_$(NAME) : 1 ; |
| 78 |
} |
| 79 |
|
| 80 |
if $(no-compression) || $(no-$(name)) |
| 81 |
{ |
| 82 |
return ; |
| 83 |
} |
| 84 |
else |
| 85 |
{ |
| 86 |
$(name)-include ?= $($(name)-source) ; |
| 87 |
if ($(name)-source) |
| 88 |
{ |
| 89 |
boost-prebuilt boost_$(name) : $(requirements) ; |
| 90 |
} |
| 91 |
else |
| 92 |
{ |
| 93 |
lib boost_$(name) |
| 94 |
: |
| 95 |
: |
| 96 |
<name>$(bzip-binary) |
| 97 |
<search>$($(name)-libpath) |
| 98 |
: |
| 99 |
: |
| 100 |
<include>$(bzip-include) |
| 101 |
; |
| 102 |
} |
| 103 |
return <library>boost_$(name) ; |
| 104 |
} |
| 105 |
} |
| 106 |
|
| 107 |
local ios-libs = ; |
| 108 |
|
| 109 |
local bz2 = [ create-ios-libaray bzip2 ] ; |
| 110 |
if $(bz2) |
| 111 |
{ |
| 112 |
ios-libs += $(bz2) ; |
| 113 |
} |
| 114 |
|
| 115 |
local z = [ create-ios-libaray zlib ] ; |
| 116 |
if $(z) |
| 117 |
{ |
| 118 |
ios-libs += $(z) ; |
| 119 |
} |
| 120 |
|
| 121 |
boost-prebuilt boost_iostreams |
| 122 |
: |
| 123 |
$(requirements) |
| 124 |
$(ios-libs) |
| 125 |
; |
| 126 |
|
| 127 |
boost-prebuilt boost_thread |
| 128 |
: |
| 129 |
$(requirements) |
| 130 |
: |
| 131 |
: |
| 132 |
<link>shared:<define>BOOST_THREAD_BUILD_DLL=1 |
| 133 |
<link>static:<define>BOOST_THREAD_BUILD_LIB=1 |
| 134 |
; |
| 135 |
|
| 136 |
boost-prebuilt boost_unit_test_framework |
| 137 |
: |
| 138 |
$(requirements) |
| 139 |
<link>static |
| 140 |
: |
| 141 |
: |
| 142 |
<define>BOOST_TEST_NO_AUTO_LINK=1 |
| 143 |
<link>shared:<define>BOOST_TEST_DYN_LINK=1 |
| 144 |
<link>shared,<toolset>msvc:<cxxflags>-wd4275 |
| 145 |
; |
| 146 |
} |
| 147 |
project.pop-current ; |
| 148 |
} |
| 149 |
else |
| 150 |
{ |
| 151 |
path-constant BOOST_ROOT : [ modules.peek : BOOST_ROOT ] ; |
| 152 |
use-project /boost : $(BOOST_ROOT) ; |
| 153 |
|
| 154 |
project.push-current [ project.current ] ; |
| 155 |
make-project boost-lib ; |
| 156 |
module boost-lib |
| 157 |
{ |
| 158 |
alias headers : /boost//headers ; |
| 159 |
alias boost_filesystem : /boost/filesystem//boost_filesystem ; |
| 160 |
alias boost_iostreams : /boost/iostreams//boost_iostreams ; |
| 161 |
alias boost_regex : /boost/regex//boost_regex ; |
| 162 |
alias boost_thread : /boost/thread//boost_thread ; |
| 163 |
alias boost_unit_test_framework : /boost/test//boost_unit_test_framework ; |
| 164 |
} |
| 165 |
project.pop-current ; |
| 166 |
} |
| 167 |
} |