qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Gerd Hoffmann <kraxel@redhat.com>
To: qemu-devel@nongnu.org
Cc: Michael Walle <michael@walle.cc>,
	Gerd Hoffmann <kraxel@redhat.com>,
	OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
Subject: [Qemu-devel] [PULL 4/6] ui/opengl: Reduce build required libraries for opengl
Date: Tue,  3 Nov 2015 11:01:29 +0100	[thread overview]
Message-ID: <1446544891-3600-5-git-send-email-kraxel@redhat.com> (raw)
In-Reply-To: <1446544891-3600-1-git-send-email-kraxel@redhat.com>

From: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>

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 <hirofumi@mail.parknet.co.jp>

[ lm32 tested by kraxel ]

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 configure                   | 20 +++-----------------
 hw/display/milkymist-tmu2.c |  4 ++--
 hw/lm32/milkymist-hw.h      |  3 ++-
 3 files changed, 7 insertions(+), 20 deletions(-)

diff --git a/configure b/configure
index 7a1d08d..b4a3488 100755
--- a/configure
+++ b/configure
@@ -3286,25 +3286,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 <X11/Xlib.h>
-#include <GL/gl.h>
-#include <GL/glx.h>
-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 --git a/hw/display/milkymist-tmu2.c b/hw/display/milkymist-tmu2.c
index 3e1d0b9..e2de281 100644
--- a/hw/display/milkymist-tmu2.c
+++ b/hw/display/milkymist-tmu2.c
@@ -30,8 +30,8 @@
 #include "qemu/error-report.h"
 
 #include <X11/Xlib.h>
-#include <GL/gl.h>
-#include <GL/glx.h>
+#include <epoxy/gl.h>
+#include <epoxy/glx.h>
 
 enum {
     R_CTL = 0,
diff --git a/hw/lm32/milkymist-hw.h b/hw/lm32/milkymist-hw.h
index 8d20cac..c8dfb4d 100644
--- a/hw/lm32/milkymist-hw.h
+++ b/hw/lm32/milkymist-hw.h
@@ -88,7 +88,8 @@ static inline DeviceState *milkymist_pfpu_create(hwaddr base,
 
 #ifdef CONFIG_OPENGL
 #include <X11/Xlib.h>
-#include <GL/glx.h>
+#include <epoxy/gl.h>
+#include <epoxy/glx.h>
 static const int glx_fbconfig_attr[] = {
     GLX_GREEN_SIZE, 5,
     GLX_GREEN_SIZE, 6,
-- 
1.8.3.1

  parent reply	other threads:[~2015-11-03 10:01 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-03 10:01 [Qemu-devel] [PULL 0/6] ui patch queue Gerd Hoffmann
2015-11-03 10:01 ` [Qemu-devel] [PULL 1/6] ui/curses: Fix monitor color with -curses when 256 colors Gerd Hoffmann
2015-11-03 10:01 ` [Qemu-devel] [PULL 2/6] ui/curses: Support line graphics chars on -curses mode Gerd Hoffmann
2015-11-03 10:01 ` [Qemu-devel] [PULL 3/6] ui/curses: Fix pageup/pagedown on -curses Gerd Hoffmann
2015-11-03 10:01 ` Gerd Hoffmann [this message]
2015-11-03 10:01 ` [Qemu-devel] [PULL 5/6] vnc: allow fall back to RAW encoding Gerd Hoffmann
2015-11-03 10:01 ` [Qemu-devel] [PULL 6/6] vnc: fix bug: vnc server can't start when 'to' is specified Gerd Hoffmann
2015-11-05  8:21   ` Markus Armbruster
2015-11-03 11:17 ` [Qemu-devel] [PULL 0/6] ui patch queue Peter Maydell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1446544891-3600-5-git-send-email-kraxel@redhat.com \
    --to=kraxel@redhat.com \
    --cc=hirofumi@mail.parknet.co.jp \
    --cc=michael@walle.cc \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).