aboutsummaryrefslogtreecommitdiff
path: root/INSTALL
blob: 3add4d920eb14fe4c54a4f31ee278c0d3a128c1f (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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
The build2 toolchain requires a C++ compiler with C++11 support. GCC 4.9.0 or
later and Clang 3.5.0 or later are known to work. If you only need the build2
build system without the bpkg package manager, then the C++ compiler is all
you will need. If, however, you would also like to build bpkg, then you will
first need to obtain SQLite as well as the libodb and libodb-sqlite libraries.

In this guide we install everything that we build into /usr/local. If you
would like to use a different installation location, you will need to make
adjustments to the commands below.

Note on /usr/local: most distributions these days "cripple" this location by
either not searching /usr/local/include for headers during compilation (so we
add the -I option) or not searching /usr/local/lib for libraries either during
linking (so we add the -L option) or at runtime (which we fix with the help of
-rpath). If you know that your installation doesn't have (some of) these
issues, you can adjust the commands below accordingly. Note that even if
/usr/local/lib is searched at runtime, you may still have to run ldconfig(1)
(as root) after the installation to refresh the library cache.


1. Installing SQLite

   Skip this step if you are only interested in the build2 build system.

   To install SQLite, use your distribution's package manager and make sure
   you install both the libraries (most likely already installed) and the
   development files.

   For Debian/Ubuntu:

   $ sudo apt-get install libsqlite3-dev

   For RedHat/Fedora:

   $ sudo yum install sqlite-devel

   For FreeBSD:

   # pkg install sqlite3


2. Installing libodb and libodb-sqlite

   Again, skip this step if you are only interested in the build2 build system.

   [Currently we use pre-release versions of these libraries so they have to be
   built from source.]

   Download source packages for the two libraries from the same location as
   build2-toolchain. Then unpack, build, and install:

   $ cd libodb-X.Y.Z
   $ ./configure CPPFLAGS=-I/usr/local/include LDFLAGS=-L/usr/local/lib \
    --prefix=/usr/local
   $ make
   $ sudo make install

   $ cd libodb-sqlite-X.Y.Z
   $ ./configure CPPFLAGS=-I/usr/local/include LDFLAGS=-L/usr/local/lib \
     --prefix=/usr/local
   $ make
   $ sudo make install

   See the INSTALL file for each library for more information.


3. Bootstrapping build2

   The first step is to bootstrap the build2 build system:

   $ cd build2-toolchain-X.Y.Z
   $ cd build2/
   $ ./bootstrap
   $ ./build/b-boot config.bin.rpath=/usr/local/lib update

   For more information on this step (for example, how to specify a C++
   compiler, etc.) refer to the INSTALL file in the build2/ subdirectory.


4. Configuring, building, and installing the rest of the toolchain

   $ cd .. # back to build2-toolchain-X.Y.Z
   $ ./build2/build/b                        \
    config.cxx.poptions=-I/usr/local/include \
    config.cxx.loptions=-L/usr/local/lib     \
    config.bin.rpath=/usr/local/lib          \
    config.install.root=/usr/local configure
   $ ./build2/build/b update
   $ sudo ./build2/build/b install

   To test the installation:

   $ b --version
   $ bpkg --version