X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?p=xscreensaver;a=blobdiff_plain;f=configure.in;h=6c9c4d0d3fe8589fd50084698a8a687c8a8ee84f;hp=07fb76e98386a52397f77d74e19dbd82837f5870;hb=5832fe184606766fef23369159306c0a5799aeb0;hpb=af290bcdf2d1c61efc8aaaff653745c900cbe98c diff --git a/configure.in b/configure.in index 07fb76e9..6c9c4d0d 100644 --- a/configure.in +++ b/configure.in @@ -1809,8 +1809,6 @@ if test "$with_gl" = yes; then # if test "$have_gl" = yes ; then - AC_DEFINE(HAVE_GL) - # We need to know whether it's MesaGL so that we know which libraries # to link against. # @@ -1820,16 +1818,46 @@ if test "$with_gl" = yes; then ]) ac_have_mesa_gl=$ac_cv_have_mesa_gl - if test "$ac_have_mesa_gl" = no ; then - gl_lib_1="GL" - GL_LIBS="-lGL -lGLU" + + # If we have Mesa headers, check to see if we can link against -lMesaGL. + # If we don't have Mesa headers, or we don't have -lMesaGL, try -lGL. + # Else, warn that GL is busted. (We have the headers, but no libs.) + # + gl_lib_1="" + GL_LIBS="" + + if test "$ac_have_mesa_gl" = yes ; then + AC_CHECK_X_LIB(MesaGL, glXCreateContext, + [gl_lib_1="MesaGL" + GL_LIBS="-lMesaGL -lMesaGLU"], + [], -lMesaGLU -lX11 -lXext -lm) + fi + + if test "$gl_lib_1" = "" ; then + AC_CHECK_X_LIB(GL, glXCreateContext, + [gl_lib_1="GL" + GL_LIBS="-lGL -lGLU"], + [], -lGLU -lX11 -lXext -lm) + fi + + if test "$gl_lib_1" = "" ; then + # we have headers, but no libs -- bail. + have_gl=no + ac_have_mesa_gl=no else - AC_DEFINE(HAVE_MESA_GL) - gl_lib_1="MesaGL" - GL_LIBS="-lMesaGL -lMesaGLU" + # linking works -- we can build the GL hacks. + AC_DEFINE(HAVE_GL) + if test "$ac_have_mesa_gl" = yes ; then + AC_DEFINE(HAVE_MESA_GL) + fi fi + fi + # Now that we know we have GL headers and libs, do some more GL testing. + # + + if test "$have_gl" = yes ; then # If it's MesaGL, we'd like to issue a warning if the version number # is less than or equal to 2.6, because that version had a security bug. # @@ -2749,7 +2777,7 @@ if test "$do_dir_warning" = yes; then echo ' "xscreensaver-demo", and "xscreensaver-command" executables' echo " will be installed in ${bindir}." echo "" - echo " The various graphics demos (90+ different executables) will" + echo " The various graphics demos (100+ different executables) will" echo " also be installed in ${HACKDIR}." echo "" echo " If you would prefer the demos to be installed elsewhere"