]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/tools/build/bootstrap.sh
import new upstream nautilus stable release 14.2.8
[ceph.git] / ceph / src / boost / tools / build / bootstrap.sh
1 #!/bin/sh
2 # Copyright (C) 2005, 2006 Douglas Gregor.
3 # Copyright (C) 2006 The Trustees of Indiana University
4 # Copyright (C) 2010 Bryce Lelbach
5 # Copyright 2018-2019 Rene Rivera
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; }; }
31 ;;
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
40 Usage: $0 [OPTION]...
41
42 Defaults for the options are specified in brackets.
43
44 Configuration:
45 -h, --help display this help and exit
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 ;;
62
63 intel-* )
64 TOOLSET=intel
65 ;;
66
67 clang* )
68 TOOLSET=clang
69 ;;
70
71 sun* )
72 TOOLSET=sun
73 ;;
74
75 * )
76 # Not supported by Boost.Build
77 ;;
78 esac
79 fi
80
81 case $TOOLSET in
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
92 echo "Bootstrapping the build engine with toolset $TOOLSET... "
93 pwd=`pwd`
94 (cd "$my_dir/src/engine" && ./build.sh "$TOOLSET") > bootstrap.log 2>&1
95 if [ $? -ne 0 ]; then
96 echo
97 echo "Failed to bootstrap the build engine"
98 echo "Consult 'bootstrap.log' for more details"
99 exit 1
100 fi
101 cd "$pwd"
102 B2="$my_dir/src/engine/b2"
103 cp "$B2" .
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