From patchwork Thu Dec 11 11:05:54 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gerd Hoffmann X-Patchwork-Id: 420028 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 917121400B7 for ; Thu, 11 Dec 2014 22:07:49 +1100 (AEDT) Received: from localhost ([::1]:50243 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xz1b1-0007cn-Nb for incoming@patchwork.ozlabs.org; Thu, 11 Dec 2014 06:07:47 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57296) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xz1ZQ-0005Ki-VQ for qemu-devel@nongnu.org; Thu, 11 Dec 2014 06:06:15 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xz1ZK-0004oJ-Qm for qemu-devel@nongnu.org; Thu, 11 Dec 2014 06:06:08 -0500 Received: from mx1.redhat.com ([209.132.183.28]:33428) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xz1ZK-0004ny-IS for qemu-devel@nongnu.org; Thu, 11 Dec 2014 06:06:02 -0500 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id sBBB61C8028353 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 11 Dec 2014 06:06:01 -0500 Received: from nilsson.home.kraxel.org (ovpn-116-68.ams2.redhat.com [10.36.116.68]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id sBBB5xOM011028; Thu, 11 Dec 2014 06:06:00 -0500 Received: by nilsson.home.kraxel.org (Postfix, from userid 500) id 48FBA82BC7; Thu, 11 Dec 2014 12:05:58 +0100 (CET) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Thu, 11 Dec 2014 12:05:54 +0100 Message-Id: <1418295956-22479-2-git-send-email-kraxel@redhat.com> In-Reply-To: <1418295956-22479-1-git-send-email-kraxel@redhat.com> References: <1418295956-22479-1-git-send-email-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: Michael Walle , Gerd Hoffmann Subject: [Qemu-devel] [RfC PATCH 1/3] configure: opengl overhaul X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Rename config option from "glx" to "opengl", glx will not be the only option for opengl in near future. Also switch over to pkg-config for opengl support detection. Signed-off-by: Gerd Hoffmann --- configure | 39 +++++++++++++++++---------------------- default-configs/lm32-softmmu.mak | 2 +- hw/display/Makefile.objs | 2 +- hw/lm32/milkymist-hw.h | 4 ++-- 4 files changed, 21 insertions(+), 26 deletions(-) diff --git a/configure b/configure index 47048f0..175dea2 100755 --- a/configure +++ b/configure @@ -309,7 +309,7 @@ rbd="" smartcard_nss="" libusb="" usb_redir="" -glx="" +opengl="" zlib="yes" lzo="" snappy="" @@ -1026,9 +1026,9 @@ for opt do ;; --enable-vhost-scsi) vhost_scsi="yes" ;; - --disable-glx) glx="no" + --disable-opengl) opengl="no" ;; - --enable-glx) glx="yes" + --enable-opengl) opengl="yes" ;; --disable-rbd) rbd="no" ;; @@ -3056,23 +3056,18 @@ fi libs_softmmu="$libs_softmmu $fdt_libs" ########################################## -# GLX probe, used by milkymist-tmu2 -if test "$glx" != "no" ; then - glx_libs="-lGL -lX11" - cat > $TMPC << EOF -#include -#include -#include -int main(void) { glBegin(0); glXQueryVersion(0,0,0); return 0; } -EOF - if compile_prog "" "-lGL -lX11" ; then - glx=yes +# opengl probe, used by milkymist-tmu2 +if test "$opengl" != "no" ; then + opengl_pkgs="gl" + if $pkg_config $opengl_pkgs; then + opengl_libs="$($pkg_config --libs $opengl_pkgs) -lX11" + opengl=yes else - if test "$glx" = "yes" ; then - feature_not_found "glx" "Install GL devel (e.g. MESA)" + if test "$opengl" = "yes" ; then + feature_not_found "opengl" "Install GL devel (e.g. MESA)" fi - glx_libs= - glx=no + opengl_libs="" + opengl=no fi fi @@ -4320,7 +4315,7 @@ echo "xfsctl support $xfs" echo "nss used $smartcard_nss" echo "libusb $libusb" echo "usb net redir $usb_redir" -echo "GLX support $glx" +echo "OpenGL support $opengl" echo "libiscsi support $libiscsi" echo "libnfs support $libnfs" echo "build guest agent $guest_agent" @@ -4682,9 +4677,9 @@ if test "$usb_redir" = "yes" ; then echo "CONFIG_USB_REDIR=y" >> $config_host_mak fi -if test "$glx" = "yes" ; then - echo "CONFIG_GLX=y" >> $config_host_mak - echo "GLX_LIBS=$glx_libs" >> $config_host_mak +if test "$opengl" = "yes" ; then + echo "CONFIG_OPENGL=y" >> $config_host_mak + echo "OPENGL_LIBS=$opengl_libs" >> $config_host_mak fi if test "$lzo" = "yes" ; then diff --git a/default-configs/lm32-softmmu.mak b/default-configs/lm32-softmmu.mak index 7df58c8..4889348 100644 --- a/default-configs/lm32-softmmu.mak +++ b/default-configs/lm32-softmmu.mak @@ -2,7 +2,7 @@ CONFIG_LM32=y CONFIG_MILKYMIST=y -CONFIG_MILKYMIST_TMU2=$(CONFIG_GLX) +CONFIG_MILKYMIST_TMU2=$(CONFIG_OPENGL) CONFIG_FRAMEBUFFER=y CONFIG_PTIMER=y CONFIG_PFLASH_CFI01=y diff --git a/hw/display/Makefile.objs b/hw/display/Makefile.objs index 7ed76a9..e18ea57 100644 --- a/hw/display/Makefile.objs +++ b/hw/display/Makefile.objs @@ -20,7 +20,7 @@ common-obj-$(CONFIG_ZAURUS) += tc6393xb.o ifeq ($(CONFIG_MILKYMIST_TMU2),y) common-obj-y += milkymist-tmu2.o -libs_softmmu += $(GLX_LIBS) +libs_softmmu += $(OPENGL_LIBS) endif obj-$(CONFIG_OMAP) += omap_dss.o diff --git a/hw/lm32/milkymist-hw.h b/hw/lm32/milkymist-hw.h index 5317ce6..8d20cac 100644 --- a/hw/lm32/milkymist-hw.h +++ b/hw/lm32/milkymist-hw.h @@ -86,7 +86,7 @@ static inline DeviceState *milkymist_pfpu_create(hwaddr base, return dev; } -#ifdef CONFIG_GLX +#ifdef CONFIG_OPENGL #include #include static const int glx_fbconfig_attr[] = { @@ -100,7 +100,7 @@ static const int glx_fbconfig_attr[] = { static inline DeviceState *milkymist_tmu2_create(hwaddr base, qemu_irq irq) { -#ifdef CONFIG_GLX +#ifdef CONFIG_OPENGL DeviceState *dev; Display *d; GLXFBConfig *configs;