From nobody Mon Feb 9 20:12:40 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1651131029388262.1226434220024; Thu, 28 Apr 2022 00:30:29 -0700 (PDT) Received: from localhost ([::1]:40296 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1njybc-0007R0-A9 for importer@patchew.org; Thu, 28 Apr 2022 03:30:28 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51144) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1njy29-0000Px-0P for qemu-devel@nongnu.org; Thu, 28 Apr 2022 02:53:50 -0400 Received: from mail-ej1-x630.google.com ([2a00:1450:4864:20::630]:39870) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1njy26-00056P-Vd for qemu-devel@nongnu.org; Thu, 28 Apr 2022 02:53:48 -0400 Received: by mail-ej1-x630.google.com with SMTP id bv19so7613412ejb.6 for ; Wed, 27 Apr 2022 23:53:46 -0700 (PDT) Received: from avogadro.lan ([2001:b07:6468:f312:1c09:f536:3de6:228c]) by smtp.gmail.com with ESMTPSA id jo11-20020a170906f6cb00b006f3955761c4sm5406804ejb.158.2022.04.27.23.53.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Apr 2022 23:53:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=TeT39VMliTZNbtF1FqxWT5EpnJe1Ps12IRTnmykQBlI=; b=qk8mMQzU7zP7U4IGe92F80cYEb3GXFrBLQt2PBAJwFBzJruag5n9sdyMzo20+Rg7zH GCdbAw1DRMNmuyEi5Jq//ep0rB6BTv9hJ8HpXdffSLuJ9C81wb+p2er9q7BE96Muf8bs rKAtblmXlx2L3JT9Uhyfjw79wtTOMpQ0axdt9ggjGhS6KZBDeojBJXyTZjSHrg1Cn6Mh s2OfGkS/23YHaEyBZsdgZSMy7pqgUXFMGrADww4V9D9klCHeZ/gWu7ibkClhvBt3oozv puaeckRpl4WmGwhAkac0RopqxNf8ifU7ZWAGkclQqrsxU+ZqTpfIUDoCdIzLb47MOz6A PHNg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=TeT39VMliTZNbtF1FqxWT5EpnJe1Ps12IRTnmykQBlI=; b=8IKgEt/APe0tsT9xR8z7IyXnh1Jbd3L/K3NZPZ5qs/YTXY/jvdnkZ/Xc0Kh+K2287q TYqdVDmcgMxkzqv4Y3+0UFqZqHE4LGcaeTGMRdZt6/ZMaYEUX1rYHb1b6YLXqOPGjJoK DZueT0RX8TchK0AToCdkyxGGWiMznAVCjovz1Sm+s97/Z//8AaOBUPcg48o8BYoyjtiP CPEJ0UwFdJBIA0xi8hUxHS1mJuZxiweqoumruPBYwfOJwEV25k4PzUwU9Y0nIka/Nr5d gdMHWJmz6OPyHvBxSye8tbB4KrBuGay85PaCtMiyzgFYe0yFCSzTAryY+gFzO/NZXYZm wIag== X-Gm-Message-State: AOAM530uOQSOxAyroEaepEogdboAcnQMlRRX/pIeitKBKPRqTXl4K4vo GeO/XCpiO3tyw6yRek3apNmG5z4N1Cc6BA== X-Google-Smtp-Source: ABdhPJyS/G32iPPcajXwv0Z+3ANfH4aTbsTBrcqvAfMStY/FPZDT/GuXF+oQqaEvreg0P3IzjJkgIg== X-Received: by 2002:a17:907:a413:b0:6f3:a9e5:d076 with SMTP id sg19-20020a170907a41300b006f3a9e5d076mr13295961ejc.183.1651128825551; Wed, 27 Apr 2022 23:53:45 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 11/18] configure, meson: move OpenGL check to meson Date: Thu, 28 Apr 2022 08:53:28 +0200 Message-Id: <20220428065335.189795-12-pbonzini@redhat.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220428065335.189795-1-pbonzini@redhat.com> References: <20220428065335.189795-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::630; envelope-from=paolo.bonzini@gmail.com; helo=mail-ej1-x630.google.com X-Spam_score_int: -4 X-Spam_score: -0.5 X-Spam_bar: / X-Spam_report: (-0.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, PP_MIME_FAKE_ASCII_TEXT=0.999, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1651131030137100001 Reviewed-by: Marc-Andr=C3=A9 Lureau Signed-off-by: Paolo Bonzini --- configure | 40 ----------------------------------- meson.build | 16 +++++++++----- meson_options.txt | 2 ++ scripts/meson-buildoptions.sh | 3 +++ ui/meson.build | 17 ++++++++------- 5 files changed, 25 insertions(+), 53 deletions(-) diff --git a/configure b/configure index d704029284..1aefbc2f68 100755 --- a/configure +++ b/configure @@ -321,7 +321,6 @@ bsd_user=3D"" pkgversion=3D"" pie=3D"" trace_file=3D"trace" -opengl=3D"$default_feature" coroutine=3D"" tls_priority=3D"NORMAL" plugins=3D"$default_feature" @@ -960,10 +959,6 @@ for opt do ;; --enable-vhost-user-fs) vhost_user_fs=3D"yes" ;; - --disable-opengl) opengl=3D"no" - ;; - --enable-opengl) opengl=3D"yes" - ;; --disable-zlib-test) ;; --disable-virtio-blk-data-plane|--enable-virtio-blk-data-plane) @@ -1258,7 +1253,6 @@ cat << EOF vhost-kernel vhost kernel backend support vhost-user vhost-user backend support vhost-vdpa vhost-vdpa kernel backend support - opengl opengl support gio libgio support =20 NOTE: The object files are built at the place where configure is launched @@ -2278,34 +2272,6 @@ case "$fdt" in esac =20 ########################################## -# opengl probe (for sdl2, gtk) - -if test "$opengl" !=3D "no" ; then - epoxy=3Dno - if $pkg_config epoxy; then - cat > $TMPC << EOF -#include -int main(void) { return 0; } -EOF - if compile_prog "" "" ; then - epoxy=3Dyes - fi - fi - - if test "$epoxy" =3D "yes" ; then - opengl_cflags=3D"$($pkg_config --cflags epoxy)" - opengl_libs=3D"$($pkg_config --libs epoxy)" - opengl=3Dyes - else - if test "$opengl" =3D "yes" ; then - feature_not_found "opengl" "Please install epoxy with EGL" - fi - opengl_cflags=3D"" - opengl_libs=3D"" - opengl=3Dno - fi -fi - # check for usbfs have_usbfs=3Dno if test "$linux_user" =3D "yes"; then @@ -2874,12 +2840,6 @@ if test "$vhost_user_fs" =3D "yes" ; then echo "CONFIG_VHOST_USER_FS=3Dy" >> $config_host_mak fi =20 -if test "$opengl" =3D "yes" ; then - echo "CONFIG_OPENGL=3Dy" >> $config_host_mak - echo "OPENGL_CFLAGS=3D$opengl_cflags" >> $config_host_mak - echo "OPENGL_LIBS=3D$opengl_libs" >> $config_host_mak -fi - # XXX: suppress that if [ "$bsd" =3D "yes" ] ; then echo "CONFIG_BSD=3Dy" >> $config_host_mak diff --git a/meson.build b/meson.build index 9beca38ebb..83b7347c5f 100644 --- a/meson.build +++ b/meson.build @@ -1000,9 +1000,14 @@ if not get_option('coreaudio').auto() or (targetos = =3D=3D 'darwin' and have_system) endif =20 opengl =3D not_found -if 'CONFIG_OPENGL' in config_host - opengl =3D declare_dependency(compile_args: config_host['OPENGL_CFLAGS']= .split(), - link_args: config_host['OPENGL_LIBS'].split(= )) +if not get_option('opengl').auto() or have_system or have_vhost_user_gpu + epoxy =3D dependency('epoxy', method: 'pkg-config', + required: get_option('opengl'), kwargs: static_kwarg= s) + if cc.has_header('epoxy/egl.h', dependencies: epoxy) + opengl =3D epoxy + elif get_option('opengl').enabled() + error('epoxy/egl.h not found') + endif endif gbm =3D not_found if (have_system or have_tools) and (virgl.found() or opengl.found()) @@ -1546,6 +1551,7 @@ config_host_data.set('CONFIG_LINUX_AIO', libaio.found= ()) config_host_data.set('CONFIG_LINUX_IO_URING', linux_io_uring.found()) config_host_data.set('CONFIG_LIBPMEM', libpmem.found()) config_host_data.set('CONFIG_NUMA', numa.found()) +config_host_data.set('CONFIG_OPENGL', opengl.found()) config_host_data.set('CONFIG_PROFILER', get_option('profiler')) config_host_data.set('CONFIG_RBD', rbd.found()) config_host_data.set('CONFIG_SDL', sdl.found()) @@ -2093,7 +2099,7 @@ host_kconfig =3D \ (have_tpm ? ['CONFIG_TPM=3Dy'] : []) + \ (spice.found() ? ['CONFIG_SPICE=3Dy'] : []) + \ (have_ivshmem ? ['CONFIG_IVSHMEM=3Dy'] : []) + \ - ('CONFIG_OPENGL' in config_host ? ['CONFIG_OPENGL=3Dy'] : []) + \ + (opengl.found() ? ['CONFIG_OPENGL=3Dy'] : []) + \ (x11.found() ? ['CONFIG_X11=3Dy'] : []) + \ ('CONFIG_VHOST_USER' in config_host ? ['CONFIG_VHOST_USER=3Dy'] : []) + \ ('CONFIG_VHOST_VDPA' in config_host ? ['CONFIG_VHOST_VDPA=3Dy'] : []) + \ @@ -3708,7 +3714,7 @@ summary_info +=3D {'smartcard support': cacard} summary_info +=3D {'U2F support': u2f} summary_info +=3D {'libusb': libusb} summary_info +=3D {'usb net redir': usbredir} -summary_info +=3D {'OpenGL support': config_host.has_key('CONFIG_OPENGL= ')} +summary_info +=3D {'OpenGL support (epoxy)': opengl} summary_info +=3D {'GBM': gbm} summary_info +=3D {'libiscsi support': libiscsi} summary_info +=3D {'libnfs support': libnfs} diff --git a/meson_options.txt b/meson_options.txt index d85734f8e6..dbcf9722bb 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -149,6 +149,8 @@ option('lzo', type : 'feature', value : 'auto', description: 'lzo compression support') option('rbd', type : 'feature', value : 'auto', description: 'Ceph block device driver') +option('opengl', type : 'feature', value : 'auto', + description: 'OpenGL support') option('gtk', type : 'feature', value : 'auto', description: 'GTK+ user interface') option('sdl', type : 'feature', value : 'auto', diff --git a/scripts/meson-buildoptions.sh b/scripts/meson-buildoptions.sh index ef0dcd4a77..203f33ae18 100644 --- a/scripts/meson-buildoptions.sh +++ b/scripts/meson-buildoptions.sh @@ -91,6 +91,7 @@ meson_options_help() { printf "%s\n" ' nettle nettle cryptography support' printf "%s\n" ' numa libnuma support' printf "%s\n" ' nvmm NVMM acceleration support' + printf "%s\n" ' opengl OpenGL support' printf "%s\n" ' oss OSS sound support' printf "%s\n" ' pa PulseAudio sound support' printf "%s\n" ' parallels parallels image format support' @@ -271,6 +272,8 @@ _meson_option_parse() { --disable-numa) printf "%s" -Dnuma=3Ddisabled ;; --enable-nvmm) printf "%s" -Dnvmm=3Denabled ;; --disable-nvmm) printf "%s" -Dnvmm=3Ddisabled ;; + --enable-opengl) printf "%s" -Dopengl=3Denabled ;; + --disable-opengl) printf "%s" -Dopengl=3Ddisabled ;; --enable-oss) printf "%s" -Doss=3Denabled ;; --disable-oss) printf "%s" -Doss=3Ddisabled ;; --enable-pa) printf "%s" -Dpa=3Denabled ;; diff --git a/ui/meson.build b/ui/meson.build index 64286ba150..b21d3d1534 100644 --- a/ui/meson.build +++ b/ui/meson.build @@ -1,5 +1,6 @@ softmmu_ss.add(pixman) specific_ss.add(when: ['CONFIG_SOFTMMU'], if_true: pixman) # for the inc= lude path +specific_ss.add(when: ['CONFIG_SOFTMMU'], if_true: opengl) # for the inc= lude path =20 softmmu_ss.add(files( 'clipboard.c', @@ -43,7 +44,6 @@ vnc_ss.add(zlib, png, jpeg, gnutls) vnc_ss.add(when: sasl, if_true: files('vnc-auth-sasl.c')) softmmu_ss.add_all(when: vnc, if_true: vnc_ss) softmmu_ss.add(when: vnc, if_false: files('vnc-stubs.c')) -specific_ss.add(when: ['CONFIG_SOFTMMU'], if_true: opengl) =20 ui_modules =3D {} =20 @@ -53,17 +53,18 @@ if curses.found() ui_modules +=3D {'curses' : curses_ss} endif =20 -if config_host.has_key('CONFIG_OPENGL') +softmmu_ss.add(opengl) +if opengl.found() opengl_ss =3D ss.source_set() opengl_ss.add(gbm) - opengl_ss.add(when: [opengl, pixman, 'CONFIG_OPENGL'], + opengl_ss.add(when: [opengl, pixman], if_true: files('shader.c', 'console-gl.c', 'egl-helpers.c',= 'egl-context.c')) ui_modules +=3D {'opengl' : opengl_ss} endif =20 -if config_host.has_key('CONFIG_OPENGL') and gbm.found() +if opengl.found() and gbm.found() egl_headless_ss =3D ss.source_set() - egl_headless_ss.add(when: [opengl, gbm, pixman, 'CONFIG_OPENGL'], + egl_headless_ss.add(when: [opengl, gbm, pixman], if_true: files('egl-headless.c')) ui_modules +=3D {'egl-headless' : egl_headless_ss} endif @@ -98,8 +99,8 @@ if gtk.found() gtk_ss =3D ss.source_set() gtk_ss.add(gtk, vte, pixman, files('gtk.c', 'gtk-clipboard.c')) gtk_ss.add(when: x11, if_true: files('x_keymap.c')) - gtk_ss.add(when: [opengl, 'CONFIG_OPENGL'], if_true: files('gtk-gl-area.= c')) - gtk_ss.add(when: [x11, opengl, 'CONFIG_OPENGL'], if_true: files('gtk-egl= .c')) + gtk_ss.add(when: opengl, if_true: files('gtk-gl-area.c')) + gtk_ss.add(when: [x11, opengl], if_true: files('gtk-egl.c')) ui_modules +=3D {'gtk' : gtk_ss} endif =20 @@ -112,7 +113,7 @@ if sdl.found() 'sdl2-input.c', 'sdl2.c', )) - sdl_ss.add(when: [opengl, 'CONFIG_OPENGL'], if_true: files('sdl2-gl.c')) + sdl_ss.add(when: opengl, if_true: files('sdl2-gl.c')) sdl_ss.add(when: x11, if_true: files('x_keymap.c')) ui_modules +=3D {'sdl' : sdl_ss} endif --=20 2.35.1