[Qemu-devel] [PATCH v2 1/3] linux-user: Check for Linux USBFS in configure

Cortland Tölva posted 3 patches 7 years, 1 month ago
There is a newer version of this series
[Qemu-devel] [PATCH v2 1/3] linux-user: Check for Linux USBFS in configure
Posted by Cortland Tölva 7 years, 1 month ago
In preparation for adding user mode emulation support for the
Linux usbfs interface, check for its kernel header.

Signed-off-by: Cortland Tölva <cst@tolva.net>
---

v2 patch uses check_include instead of doing things by hand.

 configure | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/configure b/configure
index 7fd989aee1..5ebdb8901f 100755
--- a/configure
+++ b/configure
@@ -4234,7 +4234,14 @@ if compile_prog "" "" ; then
   memfd=yes
 fi
 
-
+# check for usbfs
+have_usbfs=no
+if test "$linux_user" = "yes"; then
+  if check_include linux/usbdevice_fs.h; then
+    have_usbfs=yes
+  fi
+  have_usbfs=yes
+fi
 
 # check for fallocate
 fallocate=no
@@ -6345,6 +6352,9 @@ fi
 if test "$memfd" = "yes" ; then
   echo "CONFIG_MEMFD=y" >> $config_host_mak
 fi
+if test "$have_usbfs" = "yes" ; then
+  echo "CONFIG_USBFS=y" >> $config_host_mak
+fi
 if test "$fallocate" = "yes" ; then
   echo "CONFIG_FALLOCATE=y" >> $config_host_mak
 fi
-- 
2.11.0

Re: [Qemu-devel] [PATCH v2 1/3] linux-user: Check for Linux USBFS in configure
Posted by Laurent Vivier 7 years, 1 month ago
Le 25/09/2018 à 09:12, Cortland Tölva a écrit :
> In preparation for adding user mode emulation support for the
> Linux usbfs interface, check for its kernel header.
> 
> Signed-off-by: Cortland Tölva <cst@tolva.net>
> ---
> 
> v2 patch uses check_include instead of doing things by hand.
> 
>  configure | 12 +++++++++++-
>  1 file changed, 11 insertions(+), 1 deletion(-)
> 
> diff --git a/configure b/configure
> index 7fd989aee1..5ebdb8901f 100755
> --- a/configure
> +++ b/configure
> @@ -4234,7 +4234,14 @@ if compile_prog "" "" ; then
>    memfd=yes
>  fi
>  
> -
> +# check for usbfs
> +have_usbfs=no
> +if test "$linux_user" = "yes"; then
> +  if check_include linux/usbdevice_fs.h; then
> +    have_usbfs=yes
> +  fi
> +  have_usbfs=yes
> +fi
>  
>  # check for fallocate
>  fallocate=no
> @@ -6345,6 +6352,9 @@ fi
>  if test "$memfd" = "yes" ; then
>    echo "CONFIG_MEMFD=y" >> $config_host_mak
>  fi
> +if test "$have_usbfs" = "yes" ; then
> +  echo "CONFIG_USBFS=y" >> $config_host_mak
> +fi
>  if test "$fallocate" = "yes" ; then
>    echo "CONFIG_FALLOCATE=y" >> $config_host_mak
>  fi
> 

Reviewed-by: Laurent Vivier <laurent@vivier.eu>