]> git.ipfire.org Git - thirdparty/lxc.git/commit
meson: introduce IN_LIBLXC preprocessor macro
authorAlexander Mikhalitsyn <aleksandr.mikhalitsyn@canonical.com>
Sat, 17 Feb 2024 15:47:41 +0000 (16:47 +0100)
committerAlexander Mikhalitsyn <aleksandr.mikhalitsyn@canonical.com>
Sat, 17 Feb 2024 15:47:41 +0000 (16:47 +0100)
commitf14656ebf62ab0dbb836431e2781cfd363f4e4aa
tree6e5ea64250f0927a1fa832647ca1aeb4da4d8e8f
parent672b2172de2277e950e05d2abe0b1115fa6c3f53
meson: introduce IN_LIBLXC preprocessor macro

The purpose of it is to tell us if we are compiling
liblxc or lxc test/tool/command.

This thing is needed to exclude unnecessary functions
from being compiled-in in the resulting executables
like lxc-start, lxc-attach, etc.

The problem is that lxc tools (lxc-start, lxc-stop, etc)
depend not only on the liblxc as a shared library, but also
require some non-exported symbols or helpers from liblxc
internals. So, we have to link these executables with some liblxc
object files directly which results in the dependency hell,
because linking one .c file from liblxc may end up having to
link with another one (what contains some dependency) and so on.
By using IN_LIBLXC in the liblxc internals we can selectively
omit some functions from being compiled in such cases.

Signed-off-by: Alexander Mikhalitsyn <aleksandr.mikhalitsyn@canonical.com>
src/lxc/meson.build
src/lxc/state.c
src/lxc/utils.c