summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoss Burton <ross.burton@intel.com>2015-11-11 11:39:33 +0000
committerAndreas Boll <andreas.boll.dev@gmail.com>2015-12-07 19:46:00 +0100
commit406248811eb0dfabf75ae9495b54529ec59cce66 (patch)
treef3bbc44c82c1f1571b3d4ed159824b5884d39da7
parentf941f6b60dea9bb446b97985a9afb6b1b839e81f (diff)
downloadmesa-demos-406248811eb0dfabf75ae9495b54529ec59cce66.zip
mesa-demos-406248811eb0dfabf75ae9495b54529ec59cce66.tar.xz
configure.ac: fix AC_WITH(glut) so that --without-glut works
Currently if --without-glut is used on a system that has the GLUT libraries installed, GLUT is used regardless. Change the logic so that GLUT is searched for if and only if GLUT is requested. Signed-off-by: Ross Burton <ross.burton@intel.com> Reviewed-by: Andreas Boll <andreas.boll.dev@gmail.com>
-rw-r--r--configure.ac26
1 files changed, 15 insertions, 11 deletions
diff --git a/configure.ac b/configure.ac
index c4ee12b..9445424 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
+])
dnl Check for FreeGLUT 2.6 or later
AC_EGREP_HEADER([glutInitContextProfile],