summaryrefslogtreecommitdiff
path: root/m4
diff options
context:
space:
mode:
authorDana Jansens <danakj@orodu.net>2003-05-25 20:42:04 +0000
committerDana Jansens <danakj@orodu.net>2003-05-25 20:42:04 +0000
commitc8dc32b67ad1ddad4802993d16067008147102e0 (patch)
tree0132bee099d0bf01458a8f3b9198345e4765fba1 /m4
parente5bb095ded1f423bc7422a30288b873e0e614a2c (diff)
omg wrong branch!
Diffstat (limited to 'm4')
-rw-r--r--m4/gl.m485
1 files changed, 52 insertions, 33 deletions
diff --git a/m4/gl.m4 b/m4/gl.m4
index 8ae3ba30..e3592712 100644
--- a/m4/gl.m4
+++ b/m4/gl.m4
@@ -1,46 +1,65 @@
-# GL_DEVEL()
+# X11_DEVEL()
#
-# Check for the presence of OpenGL development headers and libraries.
-# Sets the GL_CFLAGS and GL_LIBS variables as appropriate.
-AC_DEFUN([GL_DEVEL],
+# Check for the presence of the X Window System headers and libraries.
+# Sets the CPPFLAGS and LIBS variables as appropriate.
+AC_DEFUN([GL_OPTION],
[
AC_REQUIRE([X11_DEVEL])
+ AC_ARG_ENABLE(gl, [ --enable-gl enable support for OpenGL rendering default=no],
+ ,[enable_gl="no"])
+
# Store these
OLDLIBS=$LIBS
OLDCPPFLAGS=$CPPFLAGS
- AC_CHECK_LIB([GL], [glXGetConfig],
- ,
- [
- AC_MSG_ERROR([A valid libGL could not be found.])
- ])
-
- CPPFLAGS="$CPPFLAGS $X_CFLAGS"
- LIBS="$LIBS $X_PRE_LIBS $X_LIBS $X_EXTRA_LIBS"
-
- AC_MSG_CHECKING([if we can compile with GL])
- AC_TRY_LINK(
- [
- #include <GL/gl.h>
- ],
- [
- GLfloat f = 0.0;
- glVertex3f(f, f, f);
- ],
- [
- AC_MSG_RESULT([yes])
- ],
- [
- AC_MSG_RESULT([no])
- AC_MSG_ERROR([Could not compile against GL])
- ])
+ if test "$enable_gl" = "yes"; then
+ AC_CHECK_LIB([GL], [glXGetConfig],
+ ,
+ [
+ enable_gl="no"
+ AC_MSG_WARN([Disabling GL rendering support])
+ ])
+ fi
+
+ if test "$enable_gl" = "yes"; then
+ CPPFLAGS="$CPPFLAGS $X_CFLAGS"
+ LIBS="$LIBS $X_PRE_LIBS $X_LIBS $X_EXTRA_LIBS"
+
+ AC_MSG_CHECKING([if we can compile with GL])
+ AC_TRY_LINK(
+ [
+ #include <GL/gl.h>
+ ],
+ [
+ GLfloat f = 0.0;
+ glVertex3f(f, f, f);
+ ],
+ [
+ AC_MSG_RESULT([yes])
+ ],
+ [
+ AC_MSG_RESULT([no])
+ AC_MSG_WARN([Disabling GL rendering support])
+ enable_gl="no"
+ ])
- GL_CFLAGS=""
- GL_LIBS="-lGL"
- AC_SUBST(GL_CFLAGS)
- AC_SUBST(GL_LIBS)
+ GL_CFLAGS=""
+ GL_LIBS="-lGL"
+ AC_SUBST(GL_CFLAGS)
+ AC_SUBST(GL_LIBS)
+ fi
CPPFLAGS=$OLDCPPFLAGS
LIBS=$OLDLIBS
+
+ AC_MSG_CHECKING([if GL support is enabled])
+ if test "$enable_gl" = "yes"; then
+ AC_MSG_RESULT([yes])
+
+ AC_DEFINE(USE_GL)
+ else
+ AC_MSG_RESULT([no])
+ fi
+ AM_CONDITIONAL([USE_GL], [test "$enable_gl" = "yes"])
])