-
Notifications
You must be signed in to change notification settings - Fork 437
Compilation
fwupd uses the Meson build system for compilation. All building is done in a temporary directory as a non-root user, and autotools is not required.
The fwupd development environment is utilized to perform builds and run a development fwupd release without conflicting with the system fwupd package. It is further described in the fwupd building documentation.
The same helper script ./contrib/setup
that is used to configure the fwupd development environment on your machine is used when you will compile outside of that environment. However it is suggested for most users to use the fwupd development environment.
Running this script interactively will prompt you to set up missing build dependencies as well as set up your environment so that any commits you use are adjusted for fwupd project style as described in https://github.com/fwupd/fwupd/blob/master/CONTRIBUTING.md
Any missing build time dependencies will be mentioned while running meson
.
# meson setup build
The default compilation options are documented in meson_options.txt
in the root of the build tree.
If you would like to override any option. you can do so when generating the build rules.
For example to disable the DELL plugin on meson 0.44.0+ you would run meson like this:
# meson setup build -Dplugin_dell=false
It is known that using -Wl,-Bsymbolic-functions
will cause runtime failures. Be sure to remove this from your LDFLAGS
before compiling. See https://github.com/hughsie/fwupd/issues/1077 for an example.
Compilation is executed by one command:
# ninja -C build
# sudo ninja -C build install
# sudo ldconfig
If you didn't use the contrib/setup
script, then by default everything is placed into /usr/local
and most systems won't know how to manage dbus services from /usr/local
.
You can either re-run that script or manually create /etc/dbus-1/system-local.conf
with following contents:
<busconfig>
<includedir>/usr/local/share/dbus-1/system.d</includedir>
</busconfig>
Reload dbus daemon
# systemctl reload dbus.service
Some Linux distributions don't configure /usr/local/lib
or /usr/local/lib64
to the library search path.
To fix add the library path to a conffile in /etc/ld.so.conf.d/
and run sudo ldconfig
.
./contrib/setup
will also prompt to set this up for you.
Some plugins have additional runtime dependencies. Notable:
- UEFI plugin requires
udisks2
for some disk configurations - Modem manager plugin requires
modemmanager
to be useful
Scripts for generating distribution packages are available in the contrib for popular distributions.