mirror of https://github.com/xemu-project/xemu.git
cap_ng: convert to meson
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
69202b406e
commit
727c8bb809
|
@ -330,7 +330,7 @@ xen_ctrl_version="$default_feature"
|
||||||
xen_pci_passthrough="auto"
|
xen_pci_passthrough="auto"
|
||||||
linux_aio="$default_feature"
|
linux_aio="$default_feature"
|
||||||
linux_io_uring="$default_feature"
|
linux_io_uring="$default_feature"
|
||||||
cap_ng="$default_feature"
|
cap_ng="auto"
|
||||||
attr="$default_feature"
|
attr="$default_feature"
|
||||||
libattr="$default_feature"
|
libattr="$default_feature"
|
||||||
xfs="$default_feature"
|
xfs="$default_feature"
|
||||||
|
@ -1122,9 +1122,9 @@ for opt do
|
||||||
;;
|
;;
|
||||||
--enable-tcg-interpreter) tcg_interpreter="yes"
|
--enable-tcg-interpreter) tcg_interpreter="yes"
|
||||||
;;
|
;;
|
||||||
--disable-cap-ng) cap_ng="no"
|
--disable-cap-ng) cap_ng="disabled"
|
||||||
;;
|
;;
|
||||||
--enable-cap-ng) cap_ng="yes"
|
--enable-cap-ng) cap_ng="enabled"
|
||||||
;;
|
;;
|
||||||
--disable-tcg) tcg="disabled"
|
--disable-tcg) tcg="disabled"
|
||||||
;;
|
;;
|
||||||
|
@ -3192,28 +3192,6 @@ EOF
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
##########################################
|
|
||||||
# libcap-ng library probe
|
|
||||||
if test "$cap_ng" != "no" ; then
|
|
||||||
cap_libs="-lcap-ng"
|
|
||||||
cat > $TMPC << EOF
|
|
||||||
#include <cap-ng.h>
|
|
||||||
int main(void)
|
|
||||||
{
|
|
||||||
capng_capability_to_name(CAPNG_EFFECTIVE);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
EOF
|
|
||||||
if compile_prog "" "$cap_libs" ; then
|
|
||||||
cap_ng=yes
|
|
||||||
else
|
|
||||||
if test "$cap_ng" = "yes" ; then
|
|
||||||
feature_not_found "cap_ng" "Install libcap-ng devel"
|
|
||||||
fi
|
|
||||||
cap_ng=no
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
##########################################
|
##########################################
|
||||||
# Sound support libraries probe
|
# Sound support libraries probe
|
||||||
|
|
||||||
|
@ -5702,10 +5680,6 @@ fi
|
||||||
if test "$gprof" = "yes" ; then
|
if test "$gprof" = "yes" ; then
|
||||||
echo "CONFIG_GPROF=y" >> $config_host_mak
|
echo "CONFIG_GPROF=y" >> $config_host_mak
|
||||||
fi
|
fi
|
||||||
if test "$cap_ng" = "yes" ; then
|
|
||||||
echo "CONFIG_LIBCAP_NG=y" >> $config_host_mak
|
|
||||||
echo "LIBCAP_NG_LIBS=$cap_libs" >> $config_host_mak
|
|
||||||
fi
|
|
||||||
echo "CONFIG_AUDIO_DRIVERS=$audio_drv_list" >> $config_host_mak
|
echo "CONFIG_AUDIO_DRIVERS=$audio_drv_list" >> $config_host_mak
|
||||||
for drv in $audio_drv_list; do
|
for drv in $audio_drv_list; do
|
||||||
def=CONFIG_AUDIO_$(echo $drv | LC_ALL=C tr '[a-z]' '[A-Z]')
|
def=CONFIG_AUDIO_$(echo $drv | LC_ALL=C tr '[a-z]' '[A-Z]')
|
||||||
|
@ -6603,7 +6577,7 @@ NINJA=$ninja $meson setup \
|
||||||
-Dcurl=$curl -Dglusterfs=$glusterfs -Dbzip2=$bzip2 -Dlibiscsi=$libiscsi \
|
-Dcurl=$curl -Dglusterfs=$glusterfs -Dbzip2=$bzip2 -Dlibiscsi=$libiscsi \
|
||||||
-Dlibnfs=$libnfs -Diconv=$iconv -Dcurses=$curses -Dlibudev=$libudev\
|
-Dlibnfs=$libnfs -Diconv=$iconv -Dcurses=$curses -Dlibudev=$libudev\
|
||||||
-Drbd=$rbd -Dlzo=$lzo -Dsnappy=$snappy -Dlzfse=$lzfse \
|
-Drbd=$rbd -Dlzo=$lzo -Dsnappy=$snappy -Dlzfse=$lzfse \
|
||||||
-Dzstd=$zstd -Dseccomp=$seccomp -Dvirtfs=$virtfs \
|
-Dzstd=$zstd -Dseccomp=$seccomp -Dvirtfs=$virtfs -Dcap_ng=$cap_ng \
|
||||||
-Ddocs=$docs -Dsphinx_build=$sphinx_build -Dinstall_blobs=$blobs \
|
-Ddocs=$docs -Dsphinx_build=$sphinx_build -Dinstall_blobs=$blobs \
|
||||||
-Dvhost_user_blk_server=$vhost_user_blk_server \
|
-Dvhost_user_blk_server=$vhost_user_blk_server \
|
||||||
-Dfuse=$fuse -Dfuse_lseek=$fuse_lseek \
|
-Dfuse=$fuse -Dfuse_lseek=$fuse_lseek \
|
||||||
|
|
25
meson.build
25
meson.build
|
@ -338,10 +338,28 @@ if not get_option('seccomp').auto() or have_system or have_tools
|
||||||
required: get_option('seccomp'),
|
required: get_option('seccomp'),
|
||||||
method: 'pkg-config', static: enable_static)
|
method: 'pkg-config', static: enable_static)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
libcap_ng = not_found
|
libcap_ng = not_found
|
||||||
if 'CONFIG_LIBCAP_NG' in config_host
|
if not get_option('cap_ng').auto() or have_system or have_tools
|
||||||
libcap_ng = declare_dependency(link_args: config_host['LIBCAP_NG_LIBS'].split())
|
libcap_ng = cc.find_library('cap-ng', has_headers: ['cap-ng.h'],
|
||||||
|
required: get_option('cap_ng'),
|
||||||
|
static: enable_static)
|
||||||
endif
|
endif
|
||||||
|
if libcap_ng.found() and not cc.links('''
|
||||||
|
#include <cap-ng.h>
|
||||||
|
int main(void)
|
||||||
|
{
|
||||||
|
capng_capability_to_name(CAPNG_EFFECTIVE);
|
||||||
|
return 0;
|
||||||
|
}''', dependencies: libcap_ng)
|
||||||
|
libcap_ng = not_found
|
||||||
|
if get_option('cap_ng').enabled()
|
||||||
|
error('could not link libcap-ng')
|
||||||
|
else
|
||||||
|
warning('could not link libcap-ng, disabling')
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
if get_option('xkbcommon').auto() and not have_system and not have_tools
|
if get_option('xkbcommon').auto() and not have_system and not have_tools
|
||||||
xkbcommon = not_found
|
xkbcommon = not_found
|
||||||
else
|
else
|
||||||
|
@ -1013,6 +1031,7 @@ if glusterfs.found()
|
||||||
config_host_data.set('CONFIG_GLUSTERFS_FTRUNCATE_HAS_STAT', glusterfs_ftruncate_has_stat)
|
config_host_data.set('CONFIG_GLUSTERFS_FTRUNCATE_HAS_STAT', glusterfs_ftruncate_has_stat)
|
||||||
config_host_data.set('CONFIG_GLUSTERFS_IOCB_HAS_STAT', glusterfs_iocb_has_stat)
|
config_host_data.set('CONFIG_GLUSTERFS_IOCB_HAS_STAT', glusterfs_iocb_has_stat)
|
||||||
endif
|
endif
|
||||||
|
config_host_data.set('CONFIG_LIBCAP_NG', libcap_ng.found())
|
||||||
config_host_data.set('CONFIG_LIBISCSI', libiscsi.found())
|
config_host_data.set('CONFIG_LIBISCSI', libiscsi.found())
|
||||||
config_host_data.set('CONFIG_LIBNFS', libnfs.found())
|
config_host_data.set('CONFIG_LIBNFS', libnfs.found())
|
||||||
config_host_data.set('CONFIG_RBD', rbd.found())
|
config_host_data.set('CONFIG_RBD', rbd.found())
|
||||||
|
@ -2354,7 +2373,7 @@ summary_info += {'fdatasync': config_host.has_key('CONFIG_FDATASYNC')}
|
||||||
summary_info += {'madvise': config_host.has_key('CONFIG_MADVISE')}
|
summary_info += {'madvise': config_host.has_key('CONFIG_MADVISE')}
|
||||||
summary_info += {'posix_madvise': config_host.has_key('CONFIG_POSIX_MADVISE')}
|
summary_info += {'posix_madvise': config_host.has_key('CONFIG_POSIX_MADVISE')}
|
||||||
summary_info += {'posix_memalign': config_host.has_key('CONFIG_POSIX_MEMALIGN')}
|
summary_info += {'posix_memalign': config_host.has_key('CONFIG_POSIX_MEMALIGN')}
|
||||||
summary_info += {'libcap-ng support': config_host.has_key('CONFIG_LIBCAP_NG')}
|
summary_info += {'libcap-ng support': libcap_ng.found()}
|
||||||
summary_info += {'vhost-kernel support': config_host.has_key('CONFIG_VHOST_KERNEL')}
|
summary_info += {'vhost-kernel support': config_host.has_key('CONFIG_VHOST_KERNEL')}
|
||||||
summary_info += {'vhost-net support': config_host.has_key('CONFIG_VHOST_NET')}
|
summary_info += {'vhost-net support': config_host.has_key('CONFIG_VHOST_NET')}
|
||||||
summary_info += {'vhost-crypto support': config_host.has_key('CONFIG_VHOST_CRYPTO')}
|
summary_info += {'vhost-crypto support': config_host.has_key('CONFIG_VHOST_CRYPTO')}
|
||||||
|
|
|
@ -44,6 +44,8 @@ option('brlapi', type : 'feature', value : 'auto',
|
||||||
description: 'brlapi character device driver')
|
description: 'brlapi character device driver')
|
||||||
option('bzip2', type : 'feature', value : 'auto',
|
option('bzip2', type : 'feature', value : 'auto',
|
||||||
description: 'bzip2 support for DMG images')
|
description: 'bzip2 support for DMG images')
|
||||||
|
option('cap_ng', type : 'feature', value : 'auto',
|
||||||
|
description: 'cap_ng support')
|
||||||
option('cocoa', type : 'feature', value : 'auto',
|
option('cocoa', type : 'feature', value : 'auto',
|
||||||
description: 'Cocoa user interface (macOS only)')
|
description: 'Cocoa user interface (macOS only)')
|
||||||
option('curl', type : 'feature', value : 'auto',
|
option('curl', type : 'feature', value : 'auto',
|
||||||
|
|
|
@ -1,14 +1,14 @@
|
||||||
have_virtiofsd = (targetos == 'linux' and
|
have_virtiofsd = (targetos == 'linux' and
|
||||||
have_tools and
|
have_tools and
|
||||||
seccomp.found() and
|
seccomp.found() and
|
||||||
'CONFIG_LIBCAP_NG' in config_host and
|
libcap_ng.found() and
|
||||||
'CONFIG_VHOST_USER' in config_host)
|
'CONFIG_VHOST_USER' in config_host)
|
||||||
|
|
||||||
if get_option('virtiofsd').enabled()
|
if get_option('virtiofsd').enabled()
|
||||||
if not have_virtiofsd
|
if not have_virtiofsd
|
||||||
if targetos != 'linux'
|
if targetos != 'linux'
|
||||||
error('virtiofsd requires Linux')
|
error('virtiofsd requires Linux')
|
||||||
elif not seccomp.found() or 'CONFIG_LIBCAP_NG' not in config_host
|
elif not seccomp.found() or not libcap_ng.found()
|
||||||
error('virtiofsd requires libcap-ng-devel and seccomp-devel')
|
error('virtiofsd requires libcap-ng-devel and seccomp-devel')
|
||||||
elif not have_tools or 'CONFIG_VHOST_USER' not in config_host
|
elif not have_tools or 'CONFIG_VHOST_USER' not in config_host
|
||||||
error('virtiofsd needs tools and vhost-user support')
|
error('virtiofsd needs tools and vhost-user support')
|
||||||
|
|
Loading…
Reference in New Issue