aboutsummaryrefslogtreecommitdiff
path: root/BOOTSTRAP-UNIX.cli
blob: 864db7d433bac0545c1d3195aedcde06e19ee630 (plain)
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
// file      : BOOTSTRAP-UNIX.cli
// copyright : Copyright (c) 2014-2016 Code Synthesis Ltd
// license   : MIT; see accompanying LICENSE file

"
The following instructions are for bootstrapping \c{build2} on UNIX-like
operating systems (GNU/Linux, FreeBSD, etc). For Mac OS X first see
\l{#BOOTSTRAP-MACOSX Bootstrapping on Mac OS X}. These instructions should
also be used for UNIX emulation layers on Windows (for example, MSYS2 or
Cygwin) where you already have a UNIX shell with standard utilitis.

\dl|

\li|1. Create Build Directory\n

Note that you will want to keep this directory around in order to upgrade to
new toolchain versions in the future. In this guide we will use
\c{~/build2-build/} as the build directory and \c{/usr/local/} as the
installation directory but you can use other paths.

\
$ cd
$ mkdir build2-build
$ cd build2-build
\

|

\li|\n2. Download, Verify, and Unpack\n

Download \c{build2-toolchain-X.Y.Z.tar.xz} (or its \c{.tar.gz} variant if you
don't have \cb{xz(1)}) as well as its \c{.sha256} checksum from
\l{https://download.build2.org}, into \c{~/build2-build/} (build directory).

Verify the archive checksum matches:

\
# Linux, MSYS, Cygwin:
#
$ sha256sum -c build2-toolchain-X.Y.Z.tar.xz.sha256

# Mac OS X:
#
$ shasum -a 256 -c build2-toolchain-X.Y.Z.tar.xz.sha256

# FreeBSD:
#
$ sha256 -r build2-toolchain-X.Y.Z.tar.xz
$ cat build2-toolchain-X.Y.Z.tar.xz.sha256
\

Unpack the archive and change to its directory:

\
> tar xf build2-toolchain-X.Y.Z.tar.xz
> cd build2-toolchain-X.Y.Z
\

||

Next you can either perform the rest of the steps manually or, if you are
happy with using the defaults, run the \c{build.sh} shell script. It performs
(and echoes) the same set of steps as outline below but only allows you to
customization the compiler and installation directory (run \c{build.sh -h} for
usage) and you can also specify an alternative package repository with the
\c{BUILD2_REPO} environment variable.

For example, this command will use \c{g++-5} and install the toolchain into
\c{/usr/local/}.

\
$ build.sh g++-5
\

While this will use Clang and install into \c{/opt/build2}:

\
$ build.sh --install-dir /opt/build2 --sudo sudo clang++
\
"