From patchwork Mon Oct 26 17:45:48 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: OGAWA Hirofumi X-Patchwork-Id: 536124 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 D5065141333 for ; Tue, 27 Oct 2015 04:46:15 +1100 (AEDT) Received: from localhost ([::1]:54349 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZqlqX-0000S1-O5 for incoming@patchwork.ozlabs.org; Mon, 26 Oct 2015 13:46:13 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40620) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZqlqF-000082-0w for qemu-devel@nongnu.org; Mon, 26 Oct 2015 13:45:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZqlqB-0003iR-ME for qemu-devel@nongnu.org; Mon, 26 Oct 2015 13:45:54 -0400 Received: from mail.parknet.co.jp ([210.171.160.6]:50315) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZqlqB-0003iJ-1S for qemu-devel@nongnu.org; Mon, 26 Oct 2015 13:45:51 -0400 Received: from ibmpc.myhome.or.jp (unknown [210.171.168.39]) by mail.parknet.co.jp (Postfix) with ESMTP id 4C2341E0049; Tue, 27 Oct 2015 02:45:50 +0900 (JST) Received: from devron.myhome.or.jp (root@devron.myhome.or.jp [192.168.0.3]) by ibmpc.myhome.or.jp (8.14.9/8.14.9/Debian-4) with ESMTP id t9QHjnSJ007587 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 27 Oct 2015 02:45:50 +0900 Received: from devron.myhome.or.jp (hirofumi@localhost [127.0.0.1]) by devron.myhome.or.jp (8.14.9/8.14.9/Debian-4) with ESMTP id t9QHjmFn006407 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 27 Oct 2015 02:45:48 +0900 Received: (from hirofumi@localhost) by devron.myhome.or.jp (8.14.9/8.14.9/Submit) id t9QHjmYf006406; Tue, 27 Oct 2015 02:45:48 +0900 From: OGAWA Hirofumi To: Gerd Hoffmann References: <87lhaso56w.fsf@mail.parknet.co.jp> <1445854583.4397.16.camel@redhat.com> <87io5t9ann.fsf@mail.parknet.co.jp> <1445861779.4397.24.camel@redhat.com> <87eggh8qz1.fsf@mail.parknet.co.jp> Date: Tue, 27 Oct 2015 02:45:48 +0900 In-Reply-To: <87eggh8qz1.fsf@mail.parknet.co.jp> (OGAWA Hirofumi's message of "Tue, 27 Oct 2015 02:44:18 +0900") Message-ID: <87a8r58qwj.fsf_-_@mail.parknet.co.jp> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 210.171.160.6 Cc: Paolo Bonzini , qemu-devel@nongnu.org Subject: [Qemu-devel] [PATCH v2] ui/opengl: Reduce build required libraries for opengl 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 We now use epoxy to load opengl libraries. This means we don't need to link opengl libraries directly if interfaces handled by epoxy. With this, we just need epoxy headers and epoxy's *.so to build. Tested with epoxy-1.3.1. - sdl2/gtk/console egl stuff doesn't require other than epoxy - milkymist-tmu2 glx stuff doesn't require other than epoxy (lm32 test is limited, because can't find mmone-bios.bin, so just test to load libGL with "./lm32-softmmu/qemu-system-lm32 -M milkymist,accel=qtest") Signed-off-by: OGAWA Hirofumi --- configure | 20 +++----------------- hw/display/milkymist-tmu2.c | 4 ++-- hw/lm32/milkymist-hw.h | 3 ++- 3 files changed, 7 insertions(+), 20 deletions(-) diff -puN configure~use-epoxy configure --- qemu/configure~use-epoxy 2015-10-27 02:20:09.394052857 +0900 +++ qemu-hirofumi/configure 2015-10-27 02:39:16.479498430 +0900 @@ -3149,25 +3149,11 @@ fi libs_softmmu="$libs_softmmu $fdt_libs" ########################################## -# opengl probe (for sdl2, milkymist-tmu2) - -# GLX probe, used by milkymist-tmu2 -# this is temporary, code will be switched to egl mid-term. -cat > $TMPC << EOF -#include -#include -#include -int main(void) { glBegin(0); glXQueryVersion(0,0,0); return 0; } -EOF -if compile_prog "" "-lGL -lX11" ; then - have_glx=yes -else - have_glx=no -fi +# opengl probe (for sdl2, gtk, milkymist-tmu2) if test "$opengl" != "no" ; then - opengl_pkgs="gl glesv2 epoxy egl" - if $pkg_config $opengl_pkgs x11 && test "$have_glx" = "yes"; then + opengl_pkgs="epoxy" + if $pkg_config $opengl_pkgs x11; then opengl_cflags="$($pkg_config --cflags $opengl_pkgs) $x11_cflags" opengl_libs="$($pkg_config --libs $opengl_pkgs) $x11_libs" opengl=yes diff -puN hw/lm32/milkymist-hw.h~use-epoxy hw/lm32/milkymist-hw.h --- qemu/hw/lm32/milkymist-hw.h~use-epoxy 2015-10-27 02:20:09.398052849 +0900 +++ qemu-hirofumi/hw/lm32/milkymist-hw.h 2015-10-27 02:20:09.406052831 +0900 @@ -88,7 +88,8 @@ static inline DeviceState *milkymist_pfp #ifdef CONFIG_OPENGL #include -#include +#include +#include static const int glx_fbconfig_attr[] = { GLX_GREEN_SIZE, 5, GLX_GREEN_SIZE, 6, diff -puN hw/display/milkymist-tmu2.c~use-epoxy hw/display/milkymist-tmu2.c --- qemu/hw/display/milkymist-tmu2.c~use-epoxy 2015-10-27 02:20:09.398052849 +0900 +++ qemu-hirofumi/hw/display/milkymist-tmu2.c 2015-10-27 02:20:09.406052831 +0900 @@ -30,8 +30,8 @@ #include "qemu/error-report.h" #include -#include -#include +#include +#include enum { R_CTL = 0,