-
Notifications
You must be signed in to change notification settings - Fork 26
/
boost-build.jam
57 lines (53 loc) · 1.46 KB
/
boost-build.jam
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# Copyright Rene Rivera 2014-2015
# Distributed under the Boost Software License, Version 1.0.
# See http://www.boost.org/LICENSE_1_0.txt
rule get-dir-option ( option )
{
local path
= [ MATCH $(option)=(.*) : $(ARGV) ] ;
local is-rooted
= [ MATCH "^([/]+)" : $(path) ] [ MATCH "^(.:\\[^\\])" : $(path) ] ;
if ! $(is-rooted)
{
local pwd = [ PWD ] ;
path = $(pwd)/$(path) ;
}
# ECHO @@@ $(option) ==> $(path) ;
return $(path) ;
}
BOOST_ROOT ?= [ get-dir-option --boost-root ] ;
BOOST_BUILD ?= [ get-dir-option --boost-build ] ;
BOOST_BUILD ?= $(BOOST_ROOT)/tools/build/src ;
INSTALL_PREFIX ?= $(PREFIX) ;
INSTALL_PREFIX ?= [ get-dir-option --prefix ] ;
INSTALL_PREFIX ?= $(.boost-build-file:D)/stage ;
INSTALL_PREFIX_EXEC ?= $(EPREFIX) ;
INSTALL_PREFIX_EXEC ?= [ get-dir-option --exec-prefix ] ;
INSTALL_PREFIX_EXEC ?= $(INSTALL_PREFIX)/bin ;
local error ;
local help ;
if ( --help in $(ARGV) ) || ( -h in $(ARGV) )
{
help = YES ;
}
if ! $(error) && ! $(help) && ! $(BOOST_ROOT)
{
error = "Boost root not specified or found." ;
}
if ! $(error) && ! $(help) && ! $(BOOST_BUILD)
{
error = "Boost Build not specified or found." ;
}
if $(error) || $(help)
{
EXIT
"\nERROR: $(error)\n"
"\nUsage:"
"b2"
"--boost-root=<BOOST_ROOT>"
"[ --boost-build=<BOOST_BUILD> ]"
"[ --prefix=<PREFIX> ]"
"[ --exec-prefix=<EPREFIX> ]"
"\n" ;
}
boost-build $(BOOST_BUILD) ;