Debian Codegraph @

docs/building.rst

raw
1 ..
2 SPDX-License-Identifier: CC-BY-SA-4.0
3 SPDX-FileCopyrightText: 2025 Bartosz Golaszewski <[email protected]>
4
5 ..
6 This file is part of libgpiod.
7
8 Downloading, building & installing
9 ==================================
10
11 Downloading
12 -----------
13
14 Libgpiod is packaged by several linux distributions. You should typically be
15 able to install it using your package manager. If you want to build libgpiod
16 from sources, the upstream git repository for libgpiod is hosted at
17 `kernel.org <https://git.kernel.org/pub/scm/libs/libgpiod/libgpiod.git/>`_.
18 together with
19 `release tarballs <https://mirrors.edge.kernel.org/pub/software/libs/libgpiod/>`_.
20
21 Building
22 --------
23
24 This is a pretty standard autotools project. The core C library does not have
25 any external dependencies other than the standard C library with GNU extensions.
26
27 The build system requires the following packages to be installed on the host
28 system for the basic build:
29
30 * ``autotools``
31 * ``autoconf-archive``
32 * ``libtool``
33 * ``pkg-config``
34
35 .. note::
36 Development files for additional libraries may be required depending on
37 selected options. The configure script will report any missing additional
38 required dependencies.
39
40 To build the project (including command-line utilities) run:
41
42 .. code-block:: none
43
44 ./autogen.sh --enable-tools=yes
45 make
46
47 .. note::
48 The command-line tools optionally depend on libedit for the interactive
49 feature.
50
51 The autogen script will execute ``./configure`` and pass all the command-line
52 arguments to it.
53
54 .. note::
55 If building from release tarballs, the configure script is already provided
56 and there's no need to invoke autogen.sh.
57
58 For all configure features, see: ``./configure --help``.
59
60 Installing
61 ----------
62
63 To install the project run:
64
65 .. code-block:: none
66
67 make install
68
69 .. note::
70 The above may require superuser privileges.
71
72 This will install libgpiod under the default system paths. If you want to
73 install it under non-standard path, pass the ``--prefix=<install path>``
74 option to ``configure``.