diff mbox

[for-2.3] opengl: fix configure test

Message ID 1426497037-18209-1-git-send-email-kraxel@redhat.com
State New
Headers show

Commit Message

Gerd Hoffmann March 16, 2015, 9:10 a.m. UTC
Re-add the glx compile test to configure.  We can't use pkg-config to
probe for glx, and as long as milkymist-tmu2 privately uses glx (due to
opengl infrastructure in qemu not being ready yet) we must continue to
test for glx to avoid build failures.

Reported-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 configure | 19 +++++++++++++++++--
 1 file changed, 17 insertions(+), 2 deletions(-)

Comments

Max Reitz March 16, 2015, 3:55 p.m. UTC | #1
On 2015-03-16 at 05:10, Gerd Hoffmann wrote:
> Re-add the glx compile test to configure.  We can't use pkg-config to
> probe for glx, and as long as milkymist-tmu2 privately uses glx (due to
> opengl infrastructure in qemu not being ready yet) we must continue to
> test for glx to avoid build failures.
>
> Reported-by: Juan Quintela <quintela@redhat.com>
> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
> ---
>   configure | 19 +++++++++++++++++--
>   1 file changed, 17 insertions(+), 2 deletions(-)

Reviewed-by: Max Reitz <mreitz@redhat.com>
diff mbox

Patch

diff --git a/configure b/configure
index b858756..f74a6fd 100755
--- a/configure
+++ b/configure
@@ -3119,9 +3119,24 @@  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
+
 if test "$opengl" != "no" ; then
-  opengl_pkgs="gl glx"
-  if $pkg_config $opengl_pkgs x11; then
+  opengl_pkgs="gl"
+  if $pkg_config $opengl_pkgs x11 && test "$have_glx" = "yes"; then
     opengl_cflags="$($pkg_config --cflags $opengl_pkgs) $x11_cflags"
     opengl_libs="$($pkg_config --libs $opengl_pkgs) $x11_libs"
     opengl=yes