[Mesa-dev] [PATCH] build: fix --without-glut

Dan Nicholson dbn.lists at gmail.com
Wed Nov 14 07:38:16 PST 2012


On Nov 13, 2012 11:09 PM, "Ross Burton" <ross.burton at intel.com> wrote:
>
> The argument --without-glut is transformed to --with-glut=no, which the
logic
> wasn't handling at all so --without-glut didn't work.  Rewrite the logic
to
> handle the case where the value passed to --with-glut is "no".
>
> Signed-off-by: Ross Burton <ross.burton at intel.com>
> ---
>  configure.ac |   26 +++++++++++++++-----------
>  1 file changed, 15 insertions(+), 11 deletions(-)
>
> diff --git a/configure.ac b/configure.ac
> index 8b2c359..fda3e60 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -67,21 +67,25 @@ DEMO_CFLAGS="$DEMO_CFLAGS $GL_CFLAGS"
>  DEMO_LIBS="$DEMO_LIBS $GL_LIBS"
>
>  dnl Check for GLUT
> -GLUT_CFLAGS=""
> -GLUT_LIBS=-lglut
> -glut_enabled=yes
> +glut_enabled=no
>  AC_ARG_WITH([glut],
>         [AS_HELP_STRING([--with-glut=DIR],
>                         [glut install directory])],
>         [GLUT_CFLAGS="-I$withval/include"
> -        GLUT_LIBS="-L$withval/lib -lglut"])
> -AC_CHECK_HEADER([GL/glut.h],
> -               [],
> -               [glut_enabled=no])
> -AC_CHECK_LIB([glut],
> -               [glutInit],
> -               [],
> -               [glut_enabled=no])
> +        GLUT_LIBS="-L$withval/lib -lglut"],
> +       [GLUT_CFLAGS=""
> +        GLUT_LIBS="-lglut"]
> +        )
> +AS_IF([test "x$with_glut" != xno],
> +      [AC_CHECK_HEADER([GL/glut.h],
> +                       [],
> +                       [glut_enabled=no])
> +       AC_CHECK_LIB([glut],
> +                    [glutInit],
> +                    [],
> +                    [glut_enabled=no])
> +       glut_enabled=yes
> +])

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.

Dan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20121114/d0765a31/attachment.html>


More information about the mesa-dev mailing list