<p>On Nov 13, 2012 11:09 PM, "Ross Burton" <<a href="mailto:ross.burton@intel.com">ross.burton@intel.com</a>> wrote:<br>
><br>
> The argument --without-glut is transformed to --with-glut=no, which the logic<br>
> wasn't handling at all so --without-glut didn't work.  Rewrite the logic to<br>
> handle the case where the value passed to --with-glut is "no".<br>
><br>
> Signed-off-by: Ross Burton <<a href="mailto:ross.burton@intel.com">ross.burton@intel.com</a>><br>
> ---<br>
>  <a href="http://configure.ac">configure.ac</a> |   26 +++++++++++++++-----------<br>
>  1 file changed, 15 insertions(+), 11 deletions(-)<br>
><br>
> diff --git a/<a href="http://configure.ac">configure.ac</a> b/<a href="http://configure.ac">configure.ac</a><br>
> index 8b2c359..fda3e60 100644<br>
> --- a/<a href="http://configure.ac">configure.ac</a><br>
> +++ b/<a href="http://configure.ac">configure.ac</a><br>
> @@ -67,21 +67,25 @@ DEMO_CFLAGS="$DEMO_CFLAGS $GL_CFLAGS"<br>
>  DEMO_LIBS="$DEMO_LIBS $GL_LIBS"<br>
><br>
>  dnl Check for GLUT<br>
> -GLUT_CFLAGS=""<br>
> -GLUT_LIBS=-lglut<br>
> -glut_enabled=yes<br>
> +glut_enabled=no<br>
>  AC_ARG_WITH([glut],<br>
>         [AS_HELP_STRING([--with-glut=DIR],<br>
>                         [glut install directory])],<br>
>         [GLUT_CFLAGS="-I$withval/include"<br>
> -        GLUT_LIBS="-L$withval/lib -lglut"])<br>
> -AC_CHECK_HEADER([GL/glut.h],<br>
> -               [],<br>
> -               [glut_enabled=no])<br>
> -AC_CHECK_LIB([glut],<br>
> -               [glutInit],<br>
> -               [],<br>
> -               [glut_enabled=no])<br>
> +        GLUT_LIBS="-L$withval/lib -lglut"],<br>
> +       [GLUT_CFLAGS=""<br>
> +        GLUT_LIBS="-lglut"]<br>
> +        )<br>
> +AS_IF([test "x$with_glut" != xno],<br>
> +      [AC_CHECK_HEADER([GL/glut.h],<br>
> +                       [],<br>
> +                       [glut_enabled=no])<br>
> +       AC_CHECK_LIB([glut],<br>
> +                    [glutInit],<br>
> +                    [],<br>
> +                    [glut_enabled=no])<br>
> +       glut_enabled=yes<br>
> +])</p>
<p>This looks pretty good except that I think you need to temporarily add GLUT_CFLAGS to CFLAGS and GLUT_LIBS to LIBS so that the user specified prefix works for AC_CHECK*. On the other hand, at least mesa glut has a pkg-config file, so it might be easier to just require a glut with glut.pc. Not sure about the other gluts though.</p>

<p>Dan</p>