On Tue, Jan 12, 2021 at 07:12:27PM +0100, Manuel Bouyer wrote:
> From: Manuel Bouyer <bou...@netbsd.org>
> 
> On NetBSD use the system-provided headers for ioctl and related definitions,
> they are up to date and have more chances to match the kernel's idea of
> the ioctls and structures.
> Remove now-unused NetBSD/evtchn.h and NetBSD/privcmd.h.
> Don't fail install if xen/sys/*.h are not present.
> 
> Signed-off-by: Manuel Bouyer <bou...@netbsd.org>
> ---
>  tools/debugger/gdbsx/xg/xg_main.c      |   4 +
>  tools/include/Makefile                 |   2 +-
>  tools/include/xen-sys/NetBSD/evtchn.h  |  86 --------------------
>  tools/include/xen-sys/NetBSD/privcmd.h | 106 -------------------------
>  tools/libs/call/private.h              |   4 +
>  tools/libs/ctrl/xc_private.h           |   4 +
>  tools/libs/foreignmemory/private.h     |   6 ++
>  7 files changed, 19 insertions(+), 193 deletions(-)
>  delete mode 100644 tools/include/xen-sys/NetBSD/evtchn.h
>  delete mode 100644 tools/include/xen-sys/NetBSD/privcmd.h
> 
> diff --git a/tools/debugger/gdbsx/xg/xg_main.c 
> b/tools/debugger/gdbsx/xg/xg_main.c
> index a4e8653168..ce95648e7e 100644
> --- a/tools/debugger/gdbsx/xg/xg_main.c
> +++ b/tools/debugger/gdbsx/xg/xg_main.c
> @@ -49,7 +49,11 @@
>  #include "xg_public.h"
>  #include <xen/version.h>
>  #include <xen/domctl.h>
> +#ifdef __NetBSD__
> +#include <xen/xenio.h>
> +#else
>  #include <xen/sys/privcmd.h>
> +#endif
>  #include <xen/foreign/x86_32.h>
>  #include <xen/foreign/x86_64.h>
>  
> diff --git a/tools/include/Makefile b/tools/include/Makefile
> index 4d4ec5f974..5e90179e66 100644
> --- a/tools/include/Makefile
> +++ b/tools/include/Makefile
> @@ -68,7 +68,7 @@ install: all
>       $(INSTALL_DATA) xen/foreign/*.h $(DESTDIR)$(includedir)/xen/foreign
>       $(INSTALL_DATA) xen/hvm/*.h $(DESTDIR)$(includedir)/xen/hvm
>       $(INSTALL_DATA) xen/io/*.h $(DESTDIR)$(includedir)/xen/io
> -     $(INSTALL_DATA) xen/sys/*.h $(DESTDIR)$(includedir)/xen/sys
> +     $(INSTALL_DATA) xen/sys/*.h $(DESTDIR)$(includedir)/xen/sys || true

This will mask real error on non-NetBSD OSes. My make-foo is very bad,
but maybe you could do something like:

if [ "$(XEN_OS)" != "NetBSD" ]; then \
        $(INSTALL_DATA) xen/sys/*.h $(DESTDIR)$(includedir)/xen/sys; \
fi

Or maybe check whether the directory is not empty before attempting
the install?

Thanks, Roger.

Reply via email to