]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
1 | #!/bin/sh |
2 | # Copyright (C) 2005, 2006 Douglas Gregor. | |
3 | # Copyright (C) 2006 The Trustees of Indiana University | |
92f5a8d4 TL |
4 | # Copyright (C) 2010 Bryce Lelbach |
5 | # Copyright 2018-2019 Rene Rivera | |
7c673cae FG |
6 | # |
7 | # Distributed under the Boost Software License, Version 1.0. | |
8 | # (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) | |
9 | ||
10 | # boostinspect:notab - Tabs are required for the Makefile. | |
11 | ||
12 | B2="" | |
13 | TOOLSET="" | |
14 | B2_CONFIG="" | |
15 | ||
16 | for option | |
17 | do | |
18 | case $option in | |
19 | ||
20 | -help | --help | -h) | |
21 | want_help=yes ;; | |
22 | ||
23 | -with-toolset=* | --with-toolset=* ) | |
24 | TOOLSET=`expr "x$option" : "x-*with-toolset=\(.*\)"` | |
25 | ;; | |
26 | ||
27 | -*) | |
28 | { echo "error: unrecognized option: $option | |
29 | Try \`$0 --help' for more information." >&2 | |
30 | { (exit 1); exit 1; }; } | |
92f5a8d4 | 31 | ;; |
7c673cae FG |
32 | |
33 | esac | |
34 | done | |
35 | ||
36 | if test "x$want_help" = xyes; then | |
37 | cat <<EOF | |
38 | \`./bootstrap.sh' creates minimal Boost.Build, which can install itself. | |
39 | ||
92f5a8d4 | 40 | Usage: $0 [OPTION]... |
7c673cae FG |
41 | |
42 | Defaults for the options are specified in brackets. | |
43 | ||
44 | Configuration: | |
45 | -h, --help display this help and exit | |
7c673cae FG |
46 | --with-toolset=TOOLSET use specific Boost.Build toolset |
47 | [automatically detected] | |
48 | EOF | |
49 | fi | |
50 | test -n "$want_help" && exit 0 | |
51 | ||
52 | # TBD: Determine where the script is located | |
53 | my_dir="." | |
54 | ||
55 | # Determine the toolset, if not already decided | |
56 | if test "x$TOOLSET" = x; then | |
57 | guessed_toolset=`$my_dir/src/engine/build.sh --guess-toolset` | |
58 | case $guessed_toolset in | |
59 | acc | darwin | gcc | como | mipspro | pathscale | pgi | qcc | vacpp | xlcpp | clang ) | |
60 | TOOLSET=$guessed_toolset | |
61 | ;; | |
92f5a8d4 | 62 | |
7c673cae FG |
63 | intel-* ) |
64 | TOOLSET=intel | |
65 | ;; | |
92f5a8d4 | 66 | |
7c673cae FG |
67 | clang* ) |
68 | TOOLSET=clang | |
69 | ;; | |
70 | ||
71 | sun* ) | |
72 | TOOLSET=sun | |
73 | ;; | |
92f5a8d4 | 74 | |
7c673cae FG |
75 | * ) |
76 | # Not supported by Boost.Build | |
77 | ;; | |
78 | esac | |
79 | fi | |
80 | ||
92f5a8d4 | 81 | case $TOOLSET in |
7c673cae FG |
82 | clang*) |
83 | TOOLSET=clang | |
84 | ;; | |
85 | esac | |
86 | ||
87 | ||
88 | rm -f config.log | |
89 | ||
90 | # Build b2 | |
91 | if test "x$B2" = x; then | |
92f5a8d4 | 92 | echo "Bootstrapping the build engine with toolset $TOOLSET... " |
7c673cae FG |
93 | pwd=`pwd` |
94 | (cd "$my_dir/src/engine" && ./build.sh "$TOOLSET") > bootstrap.log 2>&1 | |
95 | if [ $? -ne 0 ]; then | |
96 | echo | |
92f5a8d4 | 97 | echo "Failed to bootstrap the build engine" |
7c673cae FG |
98 | echo "Consult 'bootstrap.log' for more details" |
99 | exit 1 | |
100 | fi | |
101 | cd "$pwd" | |
92f5a8d4 | 102 | B2="$my_dir/src/engine/b2" |
7c673cae | 103 | cp "$B2" . |
7c673cae FG |
104 | fi |
105 | ||
106 | cat << EOF | |
107 | ||
108 | Bootstrapping is done. To build and install, run: | |
109 | ||
110 | ./b2 install --prefix=<DIR> | |
111 | ||
112 | EOF |