Merge pull request #5827 from keszybz/meson-libcap

meson: fixes to allow meson builds on Ubuntu Trusty
This commit is contained in:
Martin Pitt 2017-04-27 22:12:28 +02:00 committed by GitHub
commit b13586206b

View file

@ -246,10 +246,6 @@ foreach arg : ['-Wundef',
'-Wendif-labels',
'-Wstrict-aliasing=2',
'-Wwrite-strings',
'-Wno-unused-parameter',
'-Wno-missing-field-initializers',
'-Wno-unused-result',
'-Wno-format-signedness',
'-Werror=overflow',
'-Wdate-time',
'-Wnested-externs',
@ -268,6 +264,17 @@ foreach arg : ['-Wundef',
endif
endforeach
# "negative" arguments: gcc on purpose does not return an error for "-Wno-"
# arguments, just emits a warnings. So test for the "positive" version instead.
foreach arg : ['unused-parameter',
'missing-field-initializers',
'unused-result',
'format-signedness']
if cc.has_argument('-W' + arg)
add_project_arguments('-Wno-' + arg, language : 'c')
endif
endforeach
if cc.compiles('
#include <time.h>
#include <inttypes.h>
@ -614,13 +621,19 @@ libm = cc.find_library('m')
libdl = cc.find_library('dl')
libcrypt = cc.find_library('crypt')
libcap = dependency('libcap')
libcap = dependency('libcap', required : false)
if not libcap.found()
# Compat with Ubuntu 14.04 which ships libcap w/o .pc file
libcap = cc.find_library('cap')
endif
libmount = dependency('mount',
version : '>= 2.27')
want_seccomp = get_option('seccomp')
if want_seccomp != 'false'
libseccomp = dependency('libseccomp',
version : '>= 2.3.1',
required : want_seccomp == 'true')
if libseccomp.found()
conf.set('HAVE_SECCOMP', 1)