Project

General

Profile

BuildSystem » History » Version 1

fixeria, 03/14/2023 08:14 PM

1 1 fixeria
h1. The Build System
2
3
The build system is basically a suite of tools that helps developers to "translate" source code files into executable binaries and libraries. Examples of such systems are GNU Make, GNU Autotools, CMake, QMake, and Ninja. The majority of Osmocom projects is employing "GNU Autotools":https://en.wikipedia.org/wiki/GNU_Autotools, except these very few using CMake (mostly GNU Radio related projects) and hand-written Makefiles. Thus this page will be focusing on the GNU Autotools, which is supposed to make things simple for all of us, but sometimes becomes a PITA and a source of confusion for many.
4
5
h2. GNU Autotools Essentials
6
7
GNU Autotools includes the following tools:
8
9
* "Automake":https://www.gnu.org/software/automake/ - a tool for automatically generating @Makefile.in@ files,
10
* "Autoconf":https://www.gnu.org/software/autoconf/ - a tool for generating @configure@ scripts, and
11
* "Libtool":https://www.gnu.org/software/libtool/ - a tool for building static and shared libraries.
12
13
These tools are usually available in package repositories of many Linux distributions.
14
15
h2. GNU Autotools Basic Usage
16
17
The usual sequence of commands is as follows:
18
19
<pre>
20
$ autoreconf -fi
21
$ ./configure
22
$ make
23
$ make check  # optionally
24
$ sudo make install
25
</pre>
26
27
@autoreconf@ scans the current directory for @configure.ac@ and @Makefile.am@ taking them as the input, converts @Makefile.am@ files to @Makefile.in@, and generates the @configure@ script. The @configure@ script performs dozens of checks, finds suitable compilers and linkers, scans for @Makefile.in@ files and generates the usual @Makefile@ files from them. Finally, @make@ follows the rules listed in automatically generated @Makefile@ files, and invokes compilers, linkers, and other tools on the source files.
Add picture from clipboard (Maximum size: 48.8 MB)