From 35c7641177f7a615611608c33bc25cdad9e5bf00 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Thu, 18 Sep 2003 22:28:19 +0000 Subject: [PATCH] Rewrite overcomplicated OpenGL test. --- stepmania/autoconf/m4/opengl.m4 | 22 ++++++++++++++++++++++ stepmania/configure.ac | 2 +- 2 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 stepmania/autoconf/m4/opengl.m4 diff --git a/stepmania/autoconf/m4/opengl.m4 b/stepmania/autoconf/m4/opengl.m4 new file mode 100644 index 0000000000..afb48c71a6 --- /dev/null +++ b/stepmania/autoconf/m4/opengl.m4 @@ -0,0 +1,22 @@ +AC_DEFUN(SM_OPENGL, +[ + AC_ARG_ENABLE(mesa, AC_HELP_STRING([--enable-mesa], [Use libMesaGL]), enable_mesa=$enableval, enable_mesa=no) + + GL_LIBS= + if test "$enable_mesa" = "yes"; then + AC_CHECK_LIB(MesaGL, glPushMatrix, GL_LIBS=-lMesaGL) + fi + + if test -z "$GL_LIBS"; then + AC_CHECK_LIB(GL, glPushMatrix, GL_LIBS="-lGL") + fi + + AC_SUBST(GL_LIBS) + if test -z $GL_LIBS; then + AC_MSG_ERROR(["No OpenGL libraries could be found. If you want +to search for MesaGL, pass the "--enable-mesa" flag to configure.]) + fi +]) + + + diff --git a/stepmania/configure.ac b/stepmania/configure.ac index 049d3d2231..34a179d1fa 100644 --- a/stepmania/configure.ac +++ b/stepmania/configure.ac @@ -19,7 +19,7 @@ test "$DEFAULT_CFLAGS" = "yes" && CFLAGS="" test "$DEFAULT_CXXFLAGS" = "yes" && CXXFLAGS="" test "$DEFAULT_LDFLAGS" = "yes" && LDFLAGS="" -MDL_HAVE_OPENGL +SM_OPENGL AM_PATH_SDL(1.2.6,enable_sdl=yes,enable_sdl=no) AM_CONDITIONAL(NHAVE_SDL, test x$enable_sdl = xno )