From: Paolo Bonzini Date: Wed, 20 Apr 2022 15:33:43 +0000 (+0200) Subject: meson, configure: move usbfs test to meson X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=0dae95d4ad00b42814d3da451783d0b1f372ada4;p=qmiga%2Fqemu.git meson, configure: move usbfs test to meson Reviewed-by: Marc-André Lureau Signed-off-by: Paolo Bonzini --- diff --git a/configure b/configure index 313579019d..d527a9c22e 100755 --- a/configure +++ b/configure @@ -2161,31 +2161,6 @@ case "$fdt" in esac ########################################## -# check for usbfs -have_usbfs=no -if test "$linux_user" = "yes"; then - cat > $TMPC << EOF -#include - -#ifndef USBDEVFS_GET_CAPABILITIES -#error "USBDEVFS_GET_CAPABILITIES undefined" -#endif - -#ifndef USBDEVFS_DISCONNECT_CLAIM -#error "USBDEVFS_DISCONNECT_CLAIM undefined" -#endif - -int main(void) -{ - return 0; -} -EOF - if compile_prog "" ""; then - have_usbfs=yes - fi -fi - -########################################## # capstone case "$capstone" in @@ -2641,9 +2616,6 @@ fi if test "$module_upgrades" = "yes"; then echo "CONFIG_MODULE_UPGRADES=y" >> $config_host_mak fi -if test "$have_usbfs" = "yes" ; then - echo "CONFIG_USBFS=y" >> $config_host_mak -fi if test "$gio" = "yes" ; then echo "CONFIG_GIO=y" >> $config_host_mak echo "GIO_CFLAGS=$gio_cflags" >> $config_host_mak diff --git a/meson.build b/meson.build index 64161dffe7..c99b28a5ef 100644 --- a/meson.build +++ b/meson.build @@ -1940,6 +1940,19 @@ config_host_data.set('CONFIG_GETAUXVAL', cc.links(gnu_source_prefix + ''' return getauxval(AT_HWCAP) == 0; }''')) +config_host_data.set('CONFIG_USBFS', have_linux_user and cc.compiles(''' + #include + + #ifndef USBDEVFS_GET_CAPABILITIES + #error "USBDEVFS_GET_CAPABILITIES undefined" + #endif + + #ifndef USBDEVFS_DISCONNECT_CLAIM + #error "USBDEVFS_DISCONNECT_CLAIM undefined" + #endif + + int main(void) { return 0; }''')) + have_keyring = get_option('keyring') \ .require(targetos == 'linux', error_message: 'keyring is only available on Linux') \ .require(cc.compiles('''