]> git.proxmox.com Git - mirror_lxc.git/commitdiff
build: only build init.lxc.static if libcap is statically linkable
authorAleksa Sarai <cyphar@cyphar.com>
Fri, 28 Oct 2022 01:44:39 +0000 (12:44 +1100)
committerAleksa Sarai <cyphar@cyphar.com>
Sun, 30 Oct 2022 13:07:55 +0000 (00:07 +1100)
Without setting this, the default build will fail if you don't have the
static libcap library installed (on openSUSE this is packaged separately
to libcap-devel).

Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
meson.build
src/lxc/cmd/meson.build

index 63a0197510352590bf708d859aff11cf54a4c1d7..8390ee1a40b1d3151bd067759e7558f7fb5705f6 100644 (file)
@@ -468,12 +468,13 @@ int main(int argc, char *argv[]) { return 0; };
 '''
     if libcap_static.found()
         libcap_static_linkable = cc.links(code, args: '-static', dependencies: libcap_static)
-        srcconf.set10('HAVE_STATIC_LIBCAP', libcap_static_linkable)
     else
-        srcconf.set10('HAVE_STATIC_LIBCAP', false)
+        libcap_static_linkable = false
     endif
+    srcconf.set10('HAVE_STATIC_LIBCAP', libcap_static_linkable)
 else
     libcap_static = []
+    libcap_static_linkable = false
     srcconf.set10('HAVE_LIBCAP', false)
     srcconf.set10('HAVE_STATIC_LIBCAP', false)
 endif
index 6934a3809d5d1f9e6f1f74b596533cfb5e76b7f9..021993ffb426453a38ea15b20d7116989ca2ea46 100644 (file)
@@ -62,7 +62,7 @@ cmd_lxc_update_config = configure_file(
     output: 'lxc-update-config')
 install_data(join_paths(project_build_root, 'src/lxc/cmd/lxc-update-config'), install_dir: bindir)
 
-if sanitize == 'none'
+if sanitize == 'none' and libcap_static_linkable
     cmd_programs += executable(
         'init.lxc.static',
         cmd_lxc_init_sources,