qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] configure: avoid compiling qemu-keymap by default
@ 2020-08-23 13:56 Laurent Vivier
  2020-08-23 20:43 ` Paolo Bonzini
  0 siblings, 1 reply; 2+ messages in thread
From: Laurent Vivier @ 2020-08-23 13:56 UTC (permalink / raw)
  To: qemu-devel
  Cc: Marc-André Lureau, Philippe Mathieu-Daudé,
	Gerd Hoffmann, Laurent Vivier

qemu-keymap is not needed with linux-user, so disable it by default if
tools are disabled (tools are disabled by default with linux-user).

Avoid this error with statically linked binaries:

    Linking target qemu-keymap
    /usr/bin/ld: cannot find -lxkbcommon

Signed-off-by: Laurent Vivier <laurent@vivier.eu>
---
 configure | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/configure b/configure
index d9ca87fbbb52..2cab3330d010 100755
--- a/configure
+++ b/configure
@@ -3448,6 +3448,11 @@ fi
 
 ##########################################
 # xkbcommon probe
+if test -z "$xkbcommon"; then
+  if test "$want_tools" = "no"; then
+    xkbcommon=no
+  fi
+fi
 if test "$xkbcommon" != "no" ; then
   if $pkg_config xkbcommon --exists; then
     xkbcommon_cflags=$($pkg_config xkbcommon --cflags)
-- 
2.26.2



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] configure: avoid compiling qemu-keymap by default
  2020-08-23 13:56 [PATCH] configure: avoid compiling qemu-keymap by default Laurent Vivier
@ 2020-08-23 20:43 ` Paolo Bonzini
  0 siblings, 0 replies; 2+ messages in thread
From: Paolo Bonzini @ 2020-08-23 20:43 UTC (permalink / raw)
  To: laurent, qemu-devel
  Cc: Marc-André Lureau, Philippe Mathieu-Daudé, Gerd Hoffmann

[-- Attachment #1: Type: text/plain, Size: 1840 bytes --]

Hi Laurent, there are two ways to do this in Meson without having to add
more special casing in configure.

The simplest is to build qemu-keymap by default only if have_tools. This is
a one-liner adding the "build_by_default: have_tools" argument.

The second is to move the detection of xkbcommon to Meson, and putting it
under "if have_system || have_tools", that is where meson.build has the
qemu-keymap executable you do

xkbcommon = not_found
if have_system || have_tools
  xkbcommon = ...
endif
if xkbcommon.found()
  qemu_keymap = ...
endif

and CONFIG_XKBCOMMON can also be replaced by xkbcommon.found().

This is a bit more complicated but all the parts are explained in
docs/devel/build-system.rst.

Feel free to pick the simplest of the two, I just explained both just in
case. When I am back I can also explain you on IRC the way I translated the
syscall_nr.h generator.

Thanks,

Paolo

Il dom 23 ago 2020, 22:32 <no-reply@patchew.org> ha scritto:

> qemu-keymap is not needed with linux-user, so disable it by default if
> tools are disabled (tools are disabled by default with linux-user).
>
> Avoid this error with statically linked binaries:
>
>     Linking target qemu-keymap
>     /usr/bin/ld: cannot find -lxkbcommon
>
> Signed-off-by: Laurent Vivier <laurent@vivier.eu>
> ---
>  configure | 5 +++++
>  1 file changed, 5 insertions(+)
>
> diff --git a/configure b/configure
> index d9ca87fbbb52..2cab3330d010 100755
> --- a/configure
> +++ b/configure
> @@ -3448,6 +3448,11 @@ fi
>
>  ##########################################
>  # xkbcommon probe
> +if test -z "$xkbcommon"; then
> +  if test "$want_tools" = "no"; then
> +    xkbcommon=no
> +  fi
> +fi
>  if test "$xkbcommon" != "no" ; then
>    if $pkg_config xkbcommon --exists; then
>      xkbcommon_cflags=$($pkg_config xkbcommon --cflags)
> --
> 2.26.2
>
>
>
>

[-- Attachment #2: Type: text/html, Size: 2900 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-08-23 20:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-23 13:56 [PATCH] configure: avoid compiling qemu-keymap by default Laurent Vivier
2020-08-23 20:43 ` Paolo Bonzini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).