ftp://netsw.org/x11/tools/desktop/xscreensaver-4.07.tar.gz
[xscreensaver] / configure.in
index e5579217d24fd979cc15e28275dd41752365ba5d..76ccf0f9f11af1584b2842d877133dac910e4e95 100644 (file)
@@ -2565,8 +2565,29 @@ if test "$with_gl" = yes; then
 #include <GL/gl.h>
 #ifndef MESA_MAJOR_VERSION
 # include <GL/xmesa.h>
-# define MESA_MAJOR_VERSION XMESA_MAJOR_VERSION
-# define MESA_MINOR_VERSION XMESA_MINOR_VERSION
+# ifdef XMESA_MAJOR_VERSION
+   /* Around Mesa 3.2, they took out the Mesa version number, so instead,
+      we have to check the XMesa version number (the number of the X protocol
+      support, which seems to be the same as the Mesa version number.)
+    */
+#  define MESA_MAJOR_VERSION XMESA_MAJOR_VERSION
+#  define MESA_MINOR_VERSION XMESA_MINOR_VERSION
+# else
+   /* Oh great.  Some time after 3.4, they took out the xmesa.h header file,
+      so we have no way of telling what version of Mesa this is at all.
+      So, we'll guess that the osmesa version (the "offscreen protocol")
+      is less than or equal to the real mesa version number.  Except that
+      if OSmesa is 3.3, assume at least Mesa 3.4, since OSmesa was 3.3 in
+      Mesa 3.4.  And Mesa 3.3 had xmesa.h.  What a complete load of shit!
+    */
+# include <GL/osmesa.h>
+#  define MESA_MAJOR_VERSION OSMESA_MAJOR_VERSION
+#  define MESA_MINOR_VERSION OSMESA_MINOR_VERSION or newer, probably?
+#  if OSMESA_MAJOR_VERSION == 3 && OSMESA_MINOR_VERSION == 3
+#   undef MESA_MINOR_VERSION
+#   define MESA_MINOR_VERSION 4 or newer, probably?
+#  endif
+# endif
 #endif
 configure: MESA_MAJOR_VERSION MESA_MINOR_VERSION
 EOF
@@ -2582,7 +2603,7 @@ EOF
          # M4 sucks!!
          changequote(X,Y)
           mglv=`echo "$mglv" | sed -n \
-             's/^configure:.*\([0-9][0-9]*\).*\([0-9][0-9]*\).*$/\1.\2/p'`
+             's/^configure: *\([0-9][0-9]*\) \([0-9].*\)$/\1.\2/p'`
          changequote([,])
 
          rm -f conftest.$ac_ext
@@ -2593,9 +2614,12 @@ EOF
            ac_mesagl_version=unknown
            ac_mesagl_version_string=unknown
          else
-           ac_mesagl_version_string=$mglv
-           maj=`echo $mglv | sed -n 's/\..*//p'`
-           min=`echo $mglv | sed -n 's/.*\.//p'`
+           ac_mesagl_version_string="$mglv"
+           # M4 sucks!!
+           changequote(X,Y)
+           maj=`echo "$mglv" | sed -n 's/^\([0-9][0-9]*\)\..*$/\1/p'`
+           min=`echo "$mglv" | sed -n 's/^.*\.\([0-9][0-9]*\).*$/\1/p'`
+           changequote([,])
            ac_mesagl_version=`echo "$maj * 1000 + $min" | bc`
            if test -z "$ac_mesagl_version"; then
              ac_mesagl_version=unknown
@@ -2744,7 +2768,6 @@ if test "$have_motif" = yes -a "$have_xpm" = yes ; then
   fi
 fi
 
-
 ###############################################################################
 #
 #       Check for -lgdk_pixbuf.
@@ -3300,7 +3323,6 @@ fi
 
 if test "$have_gle" = yes; then
   GLE_EXES='$(GLE_EXES)'
-  GLE_MEN='$(GLE_MEN)'
   GLE_KLUDGE="${tab}   "
 else
   GLE_KLUDGE="-${tab}   "
@@ -3454,7 +3476,6 @@ AC_SUBST(GL_UTIL_EXES)
 AC_SUBST(GL_MEN)
 AC_SUBST(GL_KLUDGE)
 AC_SUBST(GLE_EXES)
-AC_SUBST(GLE_MEN)
 AC_SUBST(GLE_KLUDGE)
 AC_SUBST(GNOMEHELP_Y)
 AC_SUBST(GNOMEHELP_N)
@@ -3731,8 +3752,7 @@ if test "$have_xpm" = no -a "$have_gdk_pixbuf" = no || \
   echo ''
   warn2 'Some of the demos will not be as colorful as they'
   warn2 'could be.  You should consider installing Pixbuf or'
-  warn2 'XPM and re-running configure.  (Remember to delete'
-  warn2 'the config.cache file first.)  The Pixbuf library is'
+  warn2 'XPM and re-running configure.  The Pixbuf library is'
   warn2 'a part of GNOME.  The XPM library comes with most'
   warn2 'X11 installations; you can also find it at the X11'
   warn2 'archive sites, such as <http://sunsite.unc.edu/>.'
@@ -3774,13 +3794,14 @@ if test "$have_gl" = yes -a "$ac_have_mesa_gl" = yes ; then
     warn2 "Make sure you are using version $preferred_mesagl or newer."
 
   elif test \! "$ac_mesagl_version" -gt 2006; then
-    warnL "MesaGL version $mgv is being used.  MesaGL 2.6 and earlier"
-    warn2 "have a security bug.  It is strongly recommended that you"
-    warn2 "upgrade to at least version $preferred_mesagl."
+    warnL "MesaGL version number is $mgv --"
+    warn2 "MesaGL 2.6 and earlier have a security bug.  It is strongly"
+    warn2 "recommended that you upgrade to at least version $preferred_mesagl."
 
   elif test \! "$ac_mesagl_version" -gt 3003; then
-    warnL "MesaGL version $mgv is being used.  That version has some"
-    warn2 "bugs; it is recommended that you upgrade to $pgl or newer."
+    warnL "MesaGL version number is $mgv --"
+    warn2 "MesaGL 3.3 and earlier have some bugs; it is recommended"
+    warn2 "that you upgrade to $pgl or newer."
   fi
 fi
 
@@ -3804,8 +3825,7 @@ if test "$have_gl" = no ; then
   echo ''
   warn2 'Those demos which use 3D will not be built or installed.'
   warn2 'You might want to consider installing OpenGL and'
-  warn2 're-running configure.  (Remember to delete the'
-  warn2 "config.cache file first.)  If your vendor doesn't ship"
+  warn2 "re-running configure.  If your vendor doesn't ship"
   warn2 'their own implementation of OpenGL, you can get a free'
   warn2 'version at <http://www.mesa3d.org/>.  For general OpenGL'
   warn2 'info, see <http://www.opengl.org/>.'
@@ -3837,10 +3857,9 @@ if test "$have_gl" = yes -a "$have_gle" = no ; then
   echo ''
   warn2 'Some of the OpenGL (3D) demos (those that depend on GLE)'
   warn2 'will not be built or installed.  You might want to consider'
-  warn2 'installing GLE and re-running configure.  (Remember to delete'
-  warn2 'the config.cache file first.)  You can find the GLE library'
-  warn2 'at <http://www.linas.org/gle/>.  For general OpenGL info,'
-  warn2 'see <http://www.opengl.org/>.'
+  warn2 'installing GLE and re-running configure.  You can find the'
+  warn2 'GLE library at <http://www.linas.org/gle/>.  For general'
+  warn2 'OpenGL info, see <http://www.opengl.org/>.'
 
 fi
 
@@ -3957,7 +3976,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 (140+ different executables) will"
+  echo "      The various graphics demos (150+ different executables) will"
   echo "      be installed in ${HACKDIR}/."
   echo ""
   echo "      If you would prefer the demos to be installed elsewhere,"