[Mesa-dev] [PATCH V2] build: fix --without-glut
Ross Burton
ross.burton at intel.com
Tue Nov 20 09:05:27 PST 2012
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 | 32 +++++++++++++++++++++-----------
1 file changed, 21 insertions(+), 11 deletions(-)
diff --git a/configure.ac b/configure.ac
index 8b2c359..f32b398 100644
--- a/configure.ac
+++ b/configure.ac
@@ -67,21 +67,31 @@ 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],
+ [SAVE_CFLAGS=$CFLAGS
+ SAVE_LIBS=$LIBS
+ CFLAGS=$GLUT_CFLAGS
+ LIBS=$GLUT_LIBS
+ AC_CHECK_HEADER([GL/glut.h],
+ [],
+ [glut_enabled=no])
+ AC_CHECK_LIB([glut],
+ [glutInit],
+ [],
+ [glut_enabled=no])
+ glut_enabled=yes
+ CFLAGS=$SAVE_CFLAGS
+ LIBS=$SAVE_LIBS
+])
dnl Check for GLEW
PKG_CHECK_MODULES(GLEW, [glew >= 1.5.4])
--
1.7.10.4
More information about the mesa-dev
mailing list