diff --git a/desmume/configure.ac b/desmume/configure.ac index fc6d6660b..cd1711fdb 100644 --- a/desmume/configure.ac +++ b/desmume/configure.ac @@ -67,8 +67,13 @@ else fi dnl - Check for the OpenGL includes -AC_CHECK_HEADERS([GL/gl.h]) -AC_CHECK_HEADERS([GL/glu.h]) +AC_CHECK_HEADERS([GL/gl.h], + [AC_CHECK_HEADERS([GL/glu.h], [have_gl_h=yes], [have_gl_h=no])], + [have_gl_h=no]) +if test "have_gl_h" = "no" ; then + AC_MSG_WARN([Building without GL support because of missing headers.]) +fi +AM_CONDITIONAL([HAVE_GL], [test "${have_gl_h}" = "yes"]) dnl - if --enable-osmesa is used, check for it AC_ARG_ENABLE([osmesa], diff --git a/desmume/src/Makefile.am b/desmume/src/Makefile.am index afc03c3e9..b80e9e117 100644 --- a/desmume/src/Makefile.am +++ b/desmume/src/Makefile.am @@ -28,7 +28,7 @@ libdesmume_a_SOURCES = \ wifi.cpp wifi.h \ mic.h \ MMU.cpp MMU.h MMU_timing.h NDSSystem.cpp NDSSystem.h registers.h \ - OGLRender.cpp OGLRender.h \ + OGLRender.h \ ROMReader.cpp ROMReader.h \ render3D.cpp render3D.h \ rtc.cpp rtc.h \ @@ -56,6 +56,10 @@ libdesmume_a_SOURCES = \ version.cpp version.h \ desmume_config.cpp desmume_config.h +if HAVE_GL +libdesmume_a_SOURCES += OGLRender.cpp +endif + if HAVE_OPENAL libdesmume_a_SOURCES += mic_openal.cpp else