2
2
# Distributed under the Boost Software License, Version 1.0.
3
3
# (See accompanying file LICENSE_1_0.txt or copy at http://boost.org/LICENSE_1_0.txt)
4
4
5
+ require-b2 5.2 ;
6
+
5
7
import package ;
6
8
import path ;
7
9
import sequence ;
8
10
import set ;
9
- import ../../../tools/boost_install/boost-install ;
10
- import ../../../tools/boost_install/boost-install-dirs ;
11
+ import project ;
12
+ import regex ;
13
+
14
+ import-search /boost/boost_install ;
15
+ import boost-install ;
16
+ import boost-install-dirs ;
17
+
18
+ path-constant LIBS_ROOT : ../.. ;
11
19
12
20
# header-subdir
13
21
@@ -18,13 +26,17 @@ header-subdir ?= "" ;
18
26
19
27
# first, the 'modular' headers
20
28
21
- local modular-headers = $(BOOST_MODULARLAYOUT) ;
29
+ local modular-headers
30
+ = [ SORT [ MATCH .*libs/(.*)/include/boost : [ glob
31
+ $(LIBS_ROOT)/*/include/boost
32
+ $(LIBS_ROOT)/numeric/*/include/boost
33
+ ] ] ] ;
22
34
23
35
local skip-headers ;
24
36
25
37
for local lib in $(modular-headers)
26
38
{
27
- local header-root = $(BOOST_ROOT)/libs /$(lib)/include ;
39
+ local header-root = $(LIBS_ROOT) /$(lib)/include ;
28
40
local header-boost = $(header-root)/boost ;
29
41
30
42
local headers =
@@ -46,11 +58,17 @@ for local lib in $(modular-headers)
46
58
47
59
# then, the non-modular headers in boost/, minus the modular ones
48
60
49
- local header-root = [ path.make $(BOOST_ROOT) ] ;
61
+ local headers ;
62
+ local header-root ;
63
+
64
+ if $(BOOST_ROOT)
65
+ {
66
+ header-root = [ path.make $(BOOST_ROOT) ] ;
50
67
51
- local headers =
52
- [ path.glob-tree $(BOOST_ROOT)/boost : *.hpp *.ipp *.h *.inc ]
53
- [ path.glob-tree $(BOOST_ROOT)/boost/compatibility/cpp_c_headers : c* ] ;
68
+ headers =
69
+ [ path.glob-tree $(BOOST_ROOT)/boost : *.hpp *.ipp *.h *.inc ]
70
+ [ path.glob-tree $(BOOST_ROOT)/boost/compatibility/cpp_c_headers : c* ] ;
71
+ }
54
72
55
73
headers = [ set.difference $(headers) : $(header-root)/$(skip-headers) ] ;
56
74
@@ -64,6 +82,26 @@ install install-boost-headers
64
82
65
83
explicit install-boost-headers ;
66
84
85
+ # Boost version format: XYYYZZ
86
+
87
+ if ! [ modules.peek boostcpp : BOOST_VERSION ]
88
+ {
89
+ local boost-config = [ project.search /boost/config ] ;
90
+ ECHO "[INFO] boost-config:" $(boost-config) ;
91
+ if $(boost-config)
92
+ {
93
+ local boost-version-num = [ regex.grep
94
+ [ path.native [ path.join $(boost-config) include boost ] ]
95
+ : version.hpp : "BOOST_VERSION ([0-9]+)" : 1 ] ;
96
+ boost-version-num = [ MATCH "(.*)(...)(..)" : $(boost-version-num[2]) ] ;
97
+ boost-version-num =
98
+ [ CALC $(boost-version-num[1]) + 0 ]
99
+ [ CALC $(boost-version-num[2]) + 0 ]
100
+ [ CALC $(boost-version-num[3]) + 0 ] ;
101
+ modules.poke boostcpp : BOOST_VERSION : $(boost-version-num:J=.) ;
102
+ }
103
+ }
104
+
67
105
#
68
106
69
107
alias install-headers : install-$(modular-headers)-headers install-boost-headers ;
0 commit comments