On Nov 13, 2012 11:09 PM, "Ross Burton" <ross.bur...@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.bur...@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
_______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev