Patchwork [1/2] configure: proper OpenGL/GLX probe

login
register
mail settings
Submitter Michael Walle
Date Nov. 30, 2012, 10:24 p.m.
Message ID <1354314252-9016-1-git-send-email-michael@walle.cc>
Download mbox | patch
Permalink /patch/203062/
State New
Headers show

Comments

Michael Walle - Nov. 30, 2012, 10:24 p.m.
Probe for GL and GLX symbols and X11 library. This fixes a build error
where the header files are available but the libraries are not.

Signed-off-by: Michael Walle <michael@walle.cc>
---
 configure |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
Michael Walle - Dec. 9, 2012, 10:21 p.m.
Am Freitag 30 November 2012, 23:24:11 schrieben Sie:
> Probe for GL and GLX symbols and X11 library. This fixes a build error
> where the header files are available but the libraries are not.
> 
> Signed-off-by: Michael Walle <michael@walle.cc>
> ---
>  configure |    6 +++---
>  1 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/configure b/configure
> index 994f731..fedde51 100755
> --- a/configure
> +++ b/configure
> @@ -2323,14 +2323,14 @@ fi
>  ##########################################
>  # opengl probe, used by milkymist-tmu2
>  if test "$opengl" != "no" ; then
> -  opengl_libs="-lGL"
> +  opengl_libs="-lGL -lX11"
>    cat > $TMPC << EOF
>  #include <X11/Xlib.h>
>  #include <GL/gl.h>
>  #include <GL/glx.h>
> -int main(void) { return GL_VERSION != 0; }
> +int main(void) { glBegin(0); glXQueryVersion(0,0,0); return 0; }
>  EOF
> -  if compile_prog "" "-lGL" ; then
> +  if compile_prog "" "-lGL -lX11" ; then
>      opengl=yes
>    else
>      if test "$opengl" = "yes" ; then

ping, could anyone pick these? blue?

malc, can you ack these patches?

Patch

diff --git a/configure b/configure
index 994f731..fedde51 100755
--- a/configure
+++ b/configure
@@ -2323,14 +2323,14 @@  fi
 ##########################################
 # opengl probe, used by milkymist-tmu2
 if test "$opengl" != "no" ; then
-  opengl_libs="-lGL"
+  opengl_libs="-lGL -lX11"
   cat > $TMPC << EOF
 #include <X11/Xlib.h>
 #include <GL/gl.h>
 #include <GL/glx.h>
-int main(void) { return GL_VERSION != 0; }
+int main(void) { glBegin(0); glXQueryVersion(0,0,0); return 0; }
 EOF
-  if compile_prog "" "-lGL" ; then
+  if compile_prog "" "-lGL -lX11" ; then
     opengl=yes
   else
     if test "$opengl" = "yes" ; then