diff mbox series

[51/67] build-sys: add optional "pixman" feature

Message ID 20230830093843.3531473-52-marcandre.lureau@redhat.com
State New
Headers show
Series Make pixman an optional dependency | expand

Commit Message

Marc-André Lureau Aug. 30, 2023, 9:38 a.m. UTC
From: Marc-André Lureau <marcandre.lureau@redhat.com>

Set CONFIG_PIXMAN accordinly.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
 meson.build       | 6 ++++--
 Kconfig.host      | 3 +++
 meson_options.txt | 2 ++
 3 files changed, 9 insertions(+), 2 deletions(-)

Comments

Philippe Mathieu-Daudé Aug. 30, 2023, 3:48 p.m. UTC | #1
On 30/8/23 11:38, marcandre.lureau@redhat.com wrote:
> From: Marc-André Lureau <marcandre.lureau@redhat.com>
> 
> Set CONFIG_PIXMAN accordinly.
> 
> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> ---
>   meson.build       | 6 ++++--
>   Kconfig.host      | 3 +++
>   meson_options.txt | 2 ++
>   3 files changed, 9 insertions(+), 2 deletions(-)
> 
> diff --git a/meson.build b/meson.build
> index 98e68ef0b1..3bd7046099 100644
> --- a/meson.build
> +++ b/meson.build
> @@ -836,8 +836,8 @@ if 'ust' in get_option('trace_backends')
>                        method: 'pkg-config')
>   endif
>   pixman = not_found
> -if have_system or have_tools
> -  pixman = dependency('pixman-1', required: have_system, version:'>=0.21.8',
> +if not get_option('pixman').auto() or have_system or have_tools
> +  pixman = dependency('pixman-1', required: get_option('pixman'), version:'>=0.21.8',
>                         method: 'pkg-config')
>   endif
>   zlib = dependency('zlib', required: true)
> @@ -2126,6 +2126,7 @@ config_host_data.set('CONFIG_SECCOMP', seccomp.found())
>   if seccomp.found()
>     config_host_data.set('CONFIG_SECCOMP_SYSRAWRC', seccomp_has_sysrawrc)
>   endif
> +config_host_data.set('CONFIG_PIXMAN', pixman.found())
>   config_host_data.set('CONFIG_SNAPPY', snappy.found())
>   config_host_data.set('CONFIG_TPM', have_tpm)
>   config_host_data.set('CONFIG_TSAN', get_option('tsan'))
> @@ -2833,6 +2834,7 @@ have_ivshmem = config_host_data.get('CONFIG_EVENTFD')
>   host_kconfig = \
>     (get_option('fuzzing') ? ['CONFIG_FUZZ=y'] : []) + \
>     (have_tpm ? ['CONFIG_TPM=y'] : []) + \
> +  (pixman.found() ? ['CONFIG_PIXMAN=y'] : []) + \
>     (spice.found() ? ['CONFIG_SPICE=y'] : []) + \
>     (have_ivshmem ? ['CONFIG_IVSHMEM=y'] : []) + \
>     (opengl.found() ? ['CONFIG_OPENGL=y'] : []) + \
> diff --git a/Kconfig.host b/Kconfig.host
> index d763d89269..b6ac2b9316 100644
> --- a/Kconfig.host
> +++ b/Kconfig.host
> @@ -11,6 +11,9 @@ config OPENGL
>   config X11
>       bool
>   
> +config PIXMAN
> +    bool
> +
>   config SPICE
>       bool
>   
> diff --git a/meson_options.txt b/meson_options.txt
> index aaea5ddd77..89654fd77d 100644
> --- a/meson_options.txt
> +++ b/meson_options.txt
> @@ -216,6 +216,8 @@ option('l2tpv3', type : 'feature', value : 'auto',
>          description: 'l2tpv3 network backend support')
>   option('netmap', type : 'feature', value : 'auto',
>          description: 'netmap network backend support')
> +option('pixman', type : 'feature', value : 'auto',
> +       description: 'pixman support')
>   option('slirp', type: 'feature', value: 'auto',
>          description: 'libslirp user mode network backend support')
>   option('vde', type : 'feature', value : 'auto',

Apparently missing:

-- >8 --
diff --git a/scripts/meson-buildoptions.sh b/scripts/meson-buildoptions.sh
index 9da3fe299b..16957ea9f0 100644
--- a/scripts/meson-buildoptions.sh
+++ b/scripts/meson-buildoptions.sh
@@ -146,6 +146,7 @@ meson_options_help() {
    printf "%s\n" '  pa              PulseAudio sound support'
    printf "%s\n" '  parallels       parallels image format support'
    printf "%s\n" '  pipewire        PipeWire sound support'
+  printf "%s\n" '  pixman          pixman support'
    printf "%s\n" '  png             PNG support with libpng'
    printf "%s\n" '  pvrdma          Enable PVRDMA support'
    printf "%s\n" '  qcow1           qcow1 image format support'
@@ -397,6 +398,8 @@ _meson_option_parse() {
      --disable-parallels) printf "%s" -Dparallels=disabled ;;
      --enable-pipewire) printf "%s" -Dpipewire=enabled ;;
      --disable-pipewire) printf "%s" -Dpipewire=disabled ;;
+    --enable-pixman) printf "%s" -Dpixman=enabled ;;
+    --disable-pixman) printf "%s" -Dpixman=disabled ;;
      --with-pkgversion=*) quote_sh "-Dpkgversion=$2" ;;
      --enable-png) printf "%s" -Dpng=enabled ;;
      --disable-png) printf "%s" -Dpng=disabled ;;
---
Philippe Mathieu-Daudé Aug. 30, 2023, 3:55 p.m. UTC | #2
On 30/8/23 17:48, Philippe Mathieu-Daudé wrote:
> On 30/8/23 11:38, marcandre.lureau@redhat.com wrote:
>> From: Marc-André Lureau <marcandre.lureau@redhat.com>
>>
>> Set CONFIG_PIXMAN accordinly.
>>
>> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
>> ---
>>   meson.build       | 6 ++++--
>>   Kconfig.host      | 3 +++
>>   meson_options.txt | 2 ++
>>   3 files changed, 9 insertions(+), 2 deletions(-)
>>
>> diff --git a/meson.build b/meson.build
>> index 98e68ef0b1..3bd7046099 100644
>> --- a/meson.build
>> +++ b/meson.build
>> @@ -836,8 +836,8 @@ if 'ust' in get_option('trace_backends')
>>                        method: 'pkg-config')
>>   endif
>>   pixman = not_found
>> -if have_system or have_tools
>> -  pixman = dependency('pixman-1', required: have_system, 
>> version:'>=0.21.8',
>> +if not get_option('pixman').auto() or have_system or have_tools
>> +  pixman = dependency('pixman-1', required: get_option('pixman'), 
>> version:'>=0.21.8',
>>                         method: 'pkg-config')


>> diff --git a/meson_options.txt b/meson_options.txt
>> index aaea5ddd77..89654fd77d 100644
>> --- a/meson_options.txt
>> +++ b/meson_options.txt
>> @@ -216,6 +216,8 @@ option('l2tpv3', type : 'feature', value : 'auto',
>>          description: 'l2tpv3 network backend support')
>>   option('netmap', type : 'feature', value : 'auto',
>>          description: 'netmap network backend support')
>> +option('pixman', type : 'feature', value : 'auto',
>> +       description: 'pixman support')
>>   option('slirp', type: 'feature', value: 'auto',
>>          description: 'libslirp user mode network backend support')
>>   option('vde', type : 'feature', value : 'auto',
> 
> Apparently missing:
> 
> -- >8 --
> diff --git a/scripts/meson-buildoptions.sh b/scripts/meson-buildoptions.sh
> index 9da3fe299b..16957ea9f0 100644
> --- a/scripts/meson-buildoptions.sh
> +++ b/scripts/meson-buildoptions.sh
> @@ -146,6 +146,7 @@ meson_options_help() {
>     printf "%s\n" '  pa              PulseAudio sound support'
>     printf "%s\n" '  parallels       parallels image format support'
>     printf "%s\n" '  pipewire        PipeWire sound support'
> +  printf "%s\n" '  pixman          pixman support'
>     printf "%s\n" '  png             PNG support with libpng'
>     printf "%s\n" '  pvrdma          Enable PVRDMA support'
>     printf "%s\n" '  qcow1           qcow1 image format support'
> @@ -397,6 +398,8 @@ _meson_option_parse() {
>       --disable-parallels) printf "%s" -Dparallels=disabled ;;
>       --enable-pipewire) printf "%s" -Dpipewire=enabled ;;
>       --disable-pipewire) printf "%s" -Dpipewire=disabled ;;
> +    --enable-pixman) printf "%s" -Dpixman=enabled ;;
> +    --disable-pixman) printf "%s" -Dpixman=disabled ;;
>       --with-pkgversion=*) quote_sh "-Dpkgversion=$2" ;;
>       --enable-png) printf "%s" -Dpng=enabled ;;
>       --disable-png) printf "%s" -Dpng=disabled ;;
> ---

Many files fail to build when using --disable-pixman here:

[39/51] Compiling C object libcommon.fa.p/ui_curses.c.o
FAILED: libcommon.fa.p/ui_curses.c.o
In file included from ../../ui/curses.c:37:
In file included from include/ui/console.h:4:
include/ui/qemu-pixman.h:12:10: fatal error: 'pixman.h' file not found
#include <pixman.h>
          ^~~~~~~~~~

Full list:

$ ninja libcommon.fa -k 0 2>&1 | grep -F FAILED
FAILED: libcommon.fa.p/ui_input-legacy.c.o
FAILED: libcommon.fa.p/ui_cursor.c.o
FAILED: libcommon.fa.p/ui_qemu-pixman.c.o
FAILED: libcommon.fa.p/ui_kbd-state.c.o
FAILED: libcommon.fa.p/ui_input.c.o
FAILED: libcommon.fa.p/ui_ui-qmp-cmds.c.o
FAILED: libcommon.fa.p/ui_console.c.o
FAILED: libcommon.fa.p/ui_vdagent.c.o
FAILED: libcommon.fa.p/ui_console-vc.c.o
FAILED: libcommon.fa.p/ui_ui-hmp-cmds.c.o
FAILED: libcommon.fa.p/ui_util.c.o
FAILED: libcommon.fa.p/ui_vnc-enc-zlib.c.o
FAILED: libcommon.fa.p/ui_vnc-enc-hextile.c.o
FAILED: libcommon.fa.p/ui_vnc-auth-vencrypt.c.o
FAILED: libcommon.fa.p/ui_vnc.c.o
FAILED: libcommon.fa.p/ui_vnc-enc-tight.c.o
FAILED: libcommon.fa.p/ui_vnc-ws.c.o
FAILED: libcommon.fa.p/ui_vnc-jobs.c.o
FAILED: libcommon.fa.p/ui_vnc-clipboard.c.o
FAILED: libcommon.fa.p/ui_vnc-enc-zrle.c.o
FAILED: libcommon.fa.p/ui_vnc-auth-sasl.c.o
FAILED: libcommon.fa.p/ui_cocoa.m.o
FAILED: libcommon.fa.p/hw_char_escc.c.o
FAILED: libcommon.fa.p/hw_core_sysbus-fdt.c.o
FAILED: libcommon.fa.p/hw_display_ramfb.c.o
FAILED: libcommon.fa.p/hw_display_g364fb.c.o
FAILED: libcommon.fa.p/hw_display_ramfb-standalone.c.o
FAILED: libcommon.fa.p/hw_display_jazz_led.c.o
FAILED: libcommon.fa.p/hw_display_cirrus_vga_isa.c.o
FAILED: libcommon.fa.p/hw_display_cirrus_vga.c.o
FAILED: libcommon.fa.p/hw_display_pl110.c.o
FAILED: libcommon.fa.p/hw_display_ssd0303.c.o
FAILED: libcommon.fa.p/hw_display_ssd0323.c.o
FAILED: libcommon.fa.p/hw_display_blizzard.c.o
FAILED: libcommon.fa.p/hw_display_framebuffer.c.o
FAILED: libcommon.fa.p/hw_display_vga-mmio.c.o
FAILED: libcommon.fa.p/hw_display_exynos4210_fimd.c.o
FAILED: libcommon.fa.p/hw_display_bochs-display.c.o
FAILED: libcommon.fa.p/hw_display_vga-pci.c.o
FAILED: libcommon.fa.p/hw_display_vga-isa.c.o
FAILED: libcommon.fa.p/hw_display_vmware_vga.c.o
FAILED: libcommon.fa.p/hw_display_omap_dss.c.o
FAILED: libcommon.fa.p/hw_display_bcm2835_fb.c.o
FAILED: libcommon.fa.p/hw_display_tc6393xb.c.o
FAILED: libcommon.fa.p/hw_display_pxa2xx_lcd.c.o
FAILED: libcommon.fa.p/hw_display_cg3.c.o
FAILED: libcommon.fa.p/hw_display_tcx.c.o
FAILED: libcommon.fa.p/hw_display_sm501.c.o
FAILED: libcommon.fa.p/hw_display_macfb.c.o
FAILED: libcommon.fa.p/hw_display_next-fb.c.o
FAILED: libcommon.fa.p/hw_display_vga.c.o
FAILED: libcommon.fa.p/hw_display_xlnx_dp.c.o
FAILED: libcommon.fa.p/hw_display_omap_lcdc.c.o
FAILED: libcommon.fa.p/hw_display_artist.c.o
FAILED: libcommon.fa.p/hw_dma_xlnx_dpdma.c.o
FAILED: libcommon.fa.p/hw_input_hid.c.o
FAILED: libcommon.fa.p/hw_input_ads7846.c.o
FAILED: libcommon.fa.p/hw_input_adb-mouse.c.o
FAILED: libcommon.fa.p/hw_input_lm832x.c.o
FAILED: libcommon.fa.p/hw_input_ps2.c.o
FAILED: libcommon.fa.p/hw_input_stellaris_input.c.o
FAILED: libcommon.fa.p/hw_input_tsc2005.c.o
FAILED: libcommon.fa.p/hw_input_pxa2xx_keypad.c.o
FAILED: libcommon.fa.p/hw_input_virtio-input-hid.c.o
FAILED: libcommon.fa.p/hw_input_tsc210x.c.o
FAILED: libcommon.fa.p/hw_misc_applesmc.c.o
FAILED: libcommon.fa.p/hw_misc_bcm2835_property.c.o
FAILED: libcommon.fa.p/hw_usb_dev-hid.c.o
FAILED: libcommon.fa.p/hw_usb_dev-wacom.c.o
FAILED: libcommon.fa.p/hw_arm_bcm2835_peripherals.c.o
FAILED: libcommon.fa.p/chardev_msmouse.c.o
FAILED: libcommon.fa.p/chardev_wctablet.c.o
FAILED: libcommon.fa.p/softmmu_vl.c.o
FAILED: libcommon.fa.p/ui_curses.c.o
FAILED: libcommon.fa.p/ui_sdl2-2d.c.o
FAILED: libcommon.fa.p/ui_sdl2-input.c.o
FAILED: libcommon.fa.p/ui_sdl2.c.o
FAILED: libcommon.fa.p/hw_display_virtio-gpu-base.c.o
FAILED: libcommon.fa.p/hw_display_virtio-gpu.c.o
FAILED: libcommon.fa.p/hw_display_virtio-gpu-udmabuf-stubs.c.o
FAILED: libcommon.fa.p/hw_display_virtio-gpu-pci.c.o
FAILED: libcommon.fa.p/hw_display_virtio-vga.c.o
FAILED: libcommon.fa.p/hw_s390x_virtio-ccw-gpu.c.o
Daniel P. Berrangé Sept. 1, 2023, 5:25 p.m. UTC | #3
On Wed, Aug 30, 2023 at 05:55:26PM +0200, Philippe Mathieu-Daudé wrote:
> On 30/8/23 17:48, Philippe Mathieu-Daudé wrote:
> > On 30/8/23 11:38, marcandre.lureau@redhat.com wrote:
> > > From: Marc-André Lureau <marcandre.lureau@redhat.com>
> > > 
> > > Set CONFIG_PIXMAN accordinly.
> > > 
> > > Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> > > ---
> > >   meson.build       | 6 ++++--
> > >   Kconfig.host      | 3 +++
> > >   meson_options.txt | 2 ++
> > >   3 files changed, 9 insertions(+), 2 deletions(-)
> > > 
> > > diff --git a/meson.build b/meson.build
> > > index 98e68ef0b1..3bd7046099 100644
> > > --- a/meson.build
> > > +++ b/meson.build
> > > @@ -836,8 +836,8 @@ if 'ust' in get_option('trace_backends')
> > >                        method: 'pkg-config')
> > >   endif
> > >   pixman = not_found
> > > -if have_system or have_tools
> > > -  pixman = dependency('pixman-1', required: have_system,
> > > version:'>=0.21.8',
> > > +if not get_option('pixman').auto() or have_system or have_tools
> > > +  pixman = dependency('pixman-1', required: get_option('pixman'),
> > > version:'>=0.21.8',
> > >                         method: 'pkg-config')
> 
> 
> > > diff --git a/meson_options.txt b/meson_options.txt
> > > index aaea5ddd77..89654fd77d 100644
> > > --- a/meson_options.txt
> > > +++ b/meson_options.txt
> > > @@ -216,6 +216,8 @@ option('l2tpv3', type : 'feature', value : 'auto',
> > >          description: 'l2tpv3 network backend support')
> > >   option('netmap', type : 'feature', value : 'auto',
> > >          description: 'netmap network backend support')
> > > +option('pixman', type : 'feature', value : 'auto',
> > > +       description: 'pixman support')
> > >   option('slirp', type: 'feature', value: 'auto',
> > >          description: 'libslirp user mode network backend support')
> > >   option('vde', type : 'feature', value : 'auto',
> > 
> > Apparently missing:
> > 
> > -- >8 --
> > diff --git a/scripts/meson-buildoptions.sh b/scripts/meson-buildoptions.sh
> > index 9da3fe299b..16957ea9f0 100644
> > --- a/scripts/meson-buildoptions.sh
> > +++ b/scripts/meson-buildoptions.sh
> > @@ -146,6 +146,7 @@ meson_options_help() {
> >     printf "%s\n" '  pa              PulseAudio sound support'
> >     printf "%s\n" '  parallels       parallels image format support'
> >     printf "%s\n" '  pipewire        PipeWire sound support'
> > +  printf "%s\n" '  pixman          pixman support'
> >     printf "%s\n" '  png             PNG support with libpng'
> >     printf "%s\n" '  pvrdma          Enable PVRDMA support'
> >     printf "%s\n" '  qcow1           qcow1 image format support'
> > @@ -397,6 +398,8 @@ _meson_option_parse() {
> >       --disable-parallels) printf "%s" -Dparallels=disabled ;;
> >       --enable-pipewire) printf "%s" -Dpipewire=enabled ;;
> >       --disable-pipewire) printf "%s" -Dpipewire=disabled ;;
> > +    --enable-pixman) printf "%s" -Dpixman=enabled ;;
> > +    --disable-pixman) printf "%s" -Dpixman=disabled ;;
> >       --with-pkgversion=*) quote_sh "-Dpkgversion=$2" ;;
> >       --enable-png) printf "%s" -Dpng=enabled ;;
> >       --disable-png) printf "%s" -Dpng=disabled ;;
> > ---
> 
> Many files fail to build when using --disable-pixman here:

I guess meson.build ought to (temporarily) report an
eror if pixman is missing and/or explicitly disabled,
which is then removed in the next patch that actually
makes it work.


With regards,
Daniel
diff mbox series

Patch

diff --git a/meson.build b/meson.build
index 98e68ef0b1..3bd7046099 100644
--- a/meson.build
+++ b/meson.build
@@ -836,8 +836,8 @@  if 'ust' in get_option('trace_backends')
                      method: 'pkg-config')
 endif
 pixman = not_found
-if have_system or have_tools
-  pixman = dependency('pixman-1', required: have_system, version:'>=0.21.8',
+if not get_option('pixman').auto() or have_system or have_tools
+  pixman = dependency('pixman-1', required: get_option('pixman'), version:'>=0.21.8',
                       method: 'pkg-config')
 endif
 zlib = dependency('zlib', required: true)
@@ -2126,6 +2126,7 @@  config_host_data.set('CONFIG_SECCOMP', seccomp.found())
 if seccomp.found()
   config_host_data.set('CONFIG_SECCOMP_SYSRAWRC', seccomp_has_sysrawrc)
 endif
+config_host_data.set('CONFIG_PIXMAN', pixman.found())
 config_host_data.set('CONFIG_SNAPPY', snappy.found())
 config_host_data.set('CONFIG_TPM', have_tpm)
 config_host_data.set('CONFIG_TSAN', get_option('tsan'))
@@ -2833,6 +2834,7 @@  have_ivshmem = config_host_data.get('CONFIG_EVENTFD')
 host_kconfig = \
   (get_option('fuzzing') ? ['CONFIG_FUZZ=y'] : []) + \
   (have_tpm ? ['CONFIG_TPM=y'] : []) + \
+  (pixman.found() ? ['CONFIG_PIXMAN=y'] : []) + \
   (spice.found() ? ['CONFIG_SPICE=y'] : []) + \
   (have_ivshmem ? ['CONFIG_IVSHMEM=y'] : []) + \
   (opengl.found() ? ['CONFIG_OPENGL=y'] : []) + \
diff --git a/Kconfig.host b/Kconfig.host
index d763d89269..b6ac2b9316 100644
--- a/Kconfig.host
+++ b/Kconfig.host
@@ -11,6 +11,9 @@  config OPENGL
 config X11
     bool
 
+config PIXMAN
+    bool
+
 config SPICE
     bool
 
diff --git a/meson_options.txt b/meson_options.txt
index aaea5ddd77..89654fd77d 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -216,6 +216,8 @@  option('l2tpv3', type : 'feature', value : 'auto',
        description: 'l2tpv3 network backend support')
 option('netmap', type : 'feature', value : 'auto',
        description: 'netmap network backend support')
+option('pixman', type : 'feature', value : 'auto',
+       description: 'pixman support')
 option('slirp', type: 'feature', value: 'auto',
        description: 'libslirp user mode network backend support')
 option('vde', type : 'feature', value : 'auto',