From: Aleksa Sarai Date: Fri, 28 Oct 2022 01:44:39 +0000 (+1100) Subject: build: only build init.lxc.static if libcap is statically linkable X-Git-Tag: v6.0.0~86^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5aff4ea371352a230ab2c5ad8edd2e0dd736ee39;p=thirdparty%2Flxc.git build: only build init.lxc.static if libcap is statically linkable 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 --- diff --git a/meson.build b/meson.build index 63a019751..8390ee1a4 100644 --- a/meson.build +++ b/meson.build @@ -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 diff --git a/src/lxc/cmd/meson.build b/src/lxc/cmd/meson.build index 6934a3809..021993ffb 100644 --- a/src/lxc/cmd/meson.build +++ b/src/lxc/cmd/meson.build @@ -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,