mirror of
https://git.proxmox.com/git/mirror_lxc
synced 2025-04-28 16:52:32 +00:00
build: use cc.links() to check for static libcap
Fixes: #4144 Signed-off-by: Christian Brauner (Microsoft) <christian.brauner@ubuntu.com>
This commit is contained in:
parent
f5420c9d3f
commit
de4543d8f8
11
meson.build
11
meson.build
@ -382,7 +382,16 @@ if want_capabilities
|
||||
# Compat with Ubuntu 14.04 which ships libcap w/o .pc file
|
||||
libcap_static = cc.find_library('cap', required: false, static: true)
|
||||
endif
|
||||
srcconf.set10('HAVE_STATIC_LIBCAP', libcap_static.found())
|
||||
|
||||
code = '''
|
||||
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)
|
||||
endif
|
||||
else
|
||||
srcconf.set10('HAVE_LIBCAP', false)
|
||||
srcconf.set10('HAVE_STATIC_LIBCAP', false)
|
||||
|
Loading…
Reference in New Issue
Block a user