+echo "$ac_t""$ac_cv_have_mesa_gl" 1>&6
+ ac_have_mesa_gl=$ac_cv_have_mesa_gl
+
+
+ gl_lib_1=""
+ GL_LIBS=""
+
+
+ # Some versions of MesaGL are compiled to require -lpthread.
+ # So if the Mesa headers exist, and -lpthread exists, then always
+ # link -lpthread after the Mesa libs (be they named -lGL or -lMesaGL.)
+ #
+ if test "$ac_have_mesa_gl" = yes; then
+ echo $ac_n "checking for pthread_create in -lpthread""... $ac_c" 1>&6
+echo "configure:7541: checking for pthread_create in -lpthread" >&5
+ac_lib_var=`echo pthread'_'pthread_create | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ ac_save_LIBS="$LIBS"
+LIBS="-lpthread $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 7549 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char pthread_create();
+
+int main() {
+pthread_create()
+; return 0; }
+EOF
+if { (eval echo configure:7560: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ GL_LIBS="-lpthread"
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+ fi
+
+
+ # 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.)
+ #
+
+ if test "$ac_have_mesa_gl" = yes ; then
+
+ ac_save_CPPFLAGS="$CPPFLAGS"
+ ac_save_LDFLAGS="$LDFLAGS"
+# ac_save_LIBS="$LIBS"
+
+ if test \! -z "$includedir" ; then
+ CPPFLAGS="$CPPFLAGS -I$includedir"
+ fi
+ # note: $X_CFLAGS includes $x_includes
+ CPPFLAGS="$CPPFLAGS $X_CFLAGS"
+
+ if test \! -z "$libdir" ; then
+ LDFLAGS="$LDFLAGS -L$libdir"
+ fi
+ # note: $X_LIBS includes $x_libraries
+ LDFLAGS="$LDFLAGS $X_LIBS $X_EXTRA_LIBS"
+
+ echo $ac_n "checking for glXCreateContext in -lMesaGL""... $ac_c" 1>&6
+echo "configure:7607: checking for glXCreateContext in -lMesaGL" >&5
+ac_lib_var=`echo MesaGL'_'glXCreateContext | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ ac_save_LIBS="$LIBS"
+LIBS="-lMesaGL -lMesaGLU $GL_LIBS -lX11 -lXext -lm $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 7615 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char glXCreateContext();
+
+int main() {
+glXCreateContext()
+; return 0; }
+EOF
+if { (eval echo configure:7626: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ gl_lib_1="MesaGL"
+ GL_LIBS="-lMesaGL -lMesaGLU $GL_LIBS"
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+ CPPFLAGS="$ac_save_CPPFLAGS"
+ LDFLAGS="$ac_save_LDFLAGS"
+# LIBS="$ac_save_LIBS"
+
+ fi
+
+ if test "$gl_lib_1" = "" ; then
+
+ ac_save_CPPFLAGS="$CPPFLAGS"
+ ac_save_LDFLAGS="$LDFLAGS"
+# ac_save_LIBS="$LIBS"
+
+ if test \! -z "$includedir" ; then
+ CPPFLAGS="$CPPFLAGS -I$includedir"
+ fi
+ # note: $X_CFLAGS includes $x_includes
+ CPPFLAGS="$CPPFLAGS $X_CFLAGS"
+
+ if test \! -z "$libdir" ; then
+ LDFLAGS="$LDFLAGS -L$libdir"
+ fi
+ # note: $X_LIBS includes $x_libraries
+ LDFLAGS="$LDFLAGS $X_LIBS $X_EXTRA_LIBS"
+
+ echo $ac_n "checking for glXCreateContext in -lGL""... $ac_c" 1>&6
+echo "configure:7672: checking for glXCreateContext in -lGL" >&5
+ac_lib_var=`echo GL'_'glXCreateContext | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ ac_save_LIBS="$LIBS"
+LIBS="-lGL -lGLU $GL_LIBS -lX11 -lXext -lm $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 7680 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char glXCreateContext();
+
+int main() {
+glXCreateContext()
+; return 0; }
+EOF
+if { (eval echo configure:7691: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ gl_lib_1="GL"
+ GL_LIBS="-lGL -lGLU $GL_LIBS"
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+ CPPFLAGS="$ac_save_CPPFLAGS"
+ LDFLAGS="$ac_save_LDFLAGS"
+# LIBS="$ac_save_LIBS"
+
+ fi
+
+ if test "$gl_lib_1" = "" ; then
+ # we have headers, but no libs -- bail.
+ have_gl=no
+ ac_have_mesa_gl=no
+ gl_halfassed=yes
+ else
+ # linking works -- we can build the GL hacks.
+ cat >> confdefs.h <<\EOF
+#define HAVE_GL 1
+EOF
+
+ if test "$ac_have_mesa_gl" = yes ; then
+ cat >> confdefs.h <<\EOF
+#define HAVE_MESA_GL 1
+EOF
+
+ 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.
+ #
+ if test "$ac_have_mesa_gl" = yes; then
+
+ echo $ac_n "checking MesaGL version number""... $ac_c" 1>&6
+echo "configure:7749: checking MesaGL version number" >&5
+if eval "test \"`echo '$''{'ac_cv_mesagl_version_string'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 7754 "configure"
+#include "confdefs.h"
+#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
+#endif
+configure: MESA_MAJOR_VERSION MESA_MINOR_VERSION
+EOF
+
+ ac_save_CPPFLAGS="$CPPFLAGS"
+ if test \! -z "$includedir" ; then
+ CPPFLAGS="$CPPFLAGS -I$includedir"
+ fi
+ CPPFLAGS="$CPPFLAGS $X_CFLAGS"
+
+ # M4 sucks!!
+
+ mglv=`(eval "$ac_cpp conftest.$ac_ext") 2>&5 | sed -n \
+ 's/^configure:.*\([0-9][0-9]*\).*\([0-9][0-9]*\).*$/\1.\2/p'`
+
+
+ rm -f conftest.$ac_ext
+
+ CPPFLAGS="$ac_save_CPPFLAGS"
+
+ if test "$mglv" = ""; then
+ 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=`echo "$maj * 1000 + $min" | bc`
+ if test -z "$ac_mesagl_version"; then
+ ac_mesagl_version=unknown
+ ac_mesagl_version_string=unknown
+ fi
+ fi
+ ac_cv_mesagl_version=$ac_mesagl_version
+ ac_cv_mesagl_version_string=$ac_mesagl_version_string
+
+fi
+
+echo "$ac_t""$ac_cv_mesagl_version_string" 1>&6
+ ac_mesagl_version=$ac_cv_mesagl_version
+ ac_mesagl_version_string=$ac_cv_mesagl_version_string
+ fi
+
+
+ # Check for OpenGL 1.1 features.
+ #
+
+ ac_save_CPPFLAGS="$CPPFLAGS"
+ ac_save_LDFLAGS="$LDFLAGS"
+# ac_save_LIBS="$LIBS"
+
+ if test \! -z "$includedir" ; then
+ CPPFLAGS="$CPPFLAGS -I$includedir"
+ fi
+ # note: $X_CFLAGS includes $x_includes
+ CPPFLAGS="$CPPFLAGS $X_CFLAGS"
+
+ if test \! -z "$libdir" ; then
+ LDFLAGS="$LDFLAGS -L$libdir"
+ fi
+ # note: $X_LIBS includes $x_libraries
+ LDFLAGS="$LDFLAGS $X_LIBS $X_EXTRA_LIBS"
+
+ echo $ac_n "checking for glBindTexture in -l$gl_lib_1""... $ac_c" 1>&6
+echo "configure:7825: checking for glBindTexture in -l$gl_lib_1" >&5
+ac_lib_var=`echo $gl_lib_1'_'glBindTexture | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ ac_save_LIBS="$LIBS"
+LIBS="-l$gl_lib_1 $GL_LIBS -lX11 -lXext -lm $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 7833 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char glBindTexture();
+
+int main() {
+glBindTexture()
+; return 0; }
+EOF
+if { (eval echo configure:7844: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ cat >> confdefs.h <<\EOF
+#define HAVE_GLBINDTEXTURE 1
+EOF
+
+else
+ echo "$ac_t""no" 1>&6
+true
+fi
+
+ CPPFLAGS="$ac_save_CPPFLAGS"
+ LDFLAGS="$ac_save_LDFLAGS"
+# LIBS="$ac_save_LIBS"
+
+ fi
+
+elif test "$with_gl" != no; then
+ echo "error: must be yes or no: --with-gl=$with_gl"
+ exit 1
+fi
+
+
+###############################################################################
+#
+# Check for -lgle.
+#
+###############################################################################
+
+have_gle=no
+with_gle_req=unspecified
+gle_halfassed=no
+# Check whether --with-gle or --without-gle was given.
+if test "${with_gle+set}" = set; then
+ withval="$with_gle"
+ with_gle="$withval"; with_gle_req="$withval"
+else
+ with_gle=yes
+fi
+
+
+
+ case "$with_gle" in
+ yes) ;;
+ no) ;;
+
+ /*)
+ echo $ac_n "checking for GLE headers""... $ac_c" 1>&6
+echo "configure:7905: checking for GLE headers" >&5
+ d=$with_gle/include
+ if test -d $d; then
+ X_CFLAGS="-I$d $X_CFLAGS"
+ echo "$ac_t""$d" 1>&6
+ else
+ echo "$ac_t""not found ($d: no such directory)" 1>&6
+ fi
+
+ echo $ac_n "checking for GLE libs""... $ac_c" 1>&6
+echo "configure:7915: checking for GLE libs" >&5
+ d=$with_gle/lib
+ if test -d $d; then
+ X_LIBS="-L$d $X_LIBS"
+ echo "$ac_t""$d" 1>&6
+ else
+ echo "$ac_t""not found ($d: no such directory)" 1>&6
+ fi
+
+ # replace the directory string with "yes".
+ with_gle_req="yes"
+ with_gle=$with_gle_req
+ ;;
+
+ *)
+ echo ""
+ echo "error: argument to --with-gle must be \"yes\", \"no\", or a directory."
+ echo " If it is a directory, then \`DIR/include' will be added to"
+ echo " the -I list, and \`DIR/lib' will be added to the -L list."
+ exit 1
+ ;;
+ esac
+
+
+GLE_LIBS=""
+
+if test "$with_gle" = yes; then
+
+
+ ac_save_CPPFLAGS="$CPPFLAGS"
+ if test \! -z "$includedir" ; then
+ CPPFLAGS="$CPPFLAGS -I$includedir"
+ fi
+ CPPFLAGS="$CPPFLAGS $X_CFLAGS"
+ ac_safe=`echo "GL/gle.h" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for GL/gle.h""... $ac_c" 1>&6
+echo "configure:7951: checking for GL/gle.h" >&5
+if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 7956 "configure"
+#include "confdefs.h"
+#include <GL/gle.h>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:7961: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=yes"
+else
+ echo "$ac_err" >&5
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=no"
+fi
+rm -f conftest*
+fi
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ have_gle3=yes
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+ CPPFLAGS="$ac_save_CPPFLAGS"
+ if test "$have_gle3" = yes ; then
+ have_gle=yes;
+ else
+
+ ac_save_CPPFLAGS="$CPPFLAGS"
+ if test \! -z "$includedir" ; then
+ CPPFLAGS="$CPPFLAGS -I$includedir"
+ fi
+ CPPFLAGS="$CPPFLAGS $X_CFLAGS"
+ ac_safe=`echo "GL/gutil.h" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for GL/gutil.h""... $ac_c" 1>&6
+echo "configure:7994: checking for GL/gutil.h" >&5
+if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 7999 "configure"
+#include "confdefs.h"
+#include <GL/gutil.h>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:8004: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=yes"
+else
+ echo "$ac_err" >&5
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=no"
+fi
+rm -f conftest*
+fi
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ have_gle=yes
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+ CPPFLAGS="$ac_save_CPPFLAGS"
+ if test "$have_gle" = yes ; then
+
+ ac_save_CPPFLAGS="$CPPFLAGS"
+ if test \! -z "$includedir" ; then
+ CPPFLAGS="$CPPFLAGS -I$includedir"
+ fi
+ CPPFLAGS="$CPPFLAGS $X_CFLAGS"
+ ac_safe=`echo "GL/tube.h" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for GL/tube.h""... $ac_c" 1>&6
+echo "configure:8035: checking for GL/tube.h" >&5
+if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 8040 "configure"
+#include "confdefs.h"
+#include <GL/tube.h>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:8045: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=yes"
+else
+ echo "$ac_err" >&5
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=no"
+fi
+rm -f conftest*
+fi
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ have_gle=yes
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+ CPPFLAGS="$ac_save_CPPFLAGS"
+ fi
+ fi
+
+ if test "$have_gle" = yes ; then
+ have_gle=no
+ gle_halfassed=yes
+
+ ac_save_CPPFLAGS="$CPPFLAGS"
+ ac_save_LDFLAGS="$LDFLAGS"
+# ac_save_LIBS="$LIBS"
+
+ if test \! -z "$includedir" ; then
+ CPPFLAGS="$CPPFLAGS -I$includedir"
+ fi
+ # note: $X_CFLAGS includes $x_includes
+ CPPFLAGS="$CPPFLAGS $X_CFLAGS"
+
+ if test \! -z "$libdir" ; then
+ LDFLAGS="$LDFLAGS -L$libdir"
+ fi
+ # note: $X_LIBS includes $x_libraries
+ LDFLAGS="$LDFLAGS $X_LIBS $X_EXTRA_LIBS"
+
+ echo $ac_n "checking for gleCreateGC in -lgle""... $ac_c" 1>&6
+echo "configure:8091: checking for gleCreateGC in -lgle" >&5
+ac_lib_var=`echo gle'_'gleCreateGC | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ ac_save_LIBS="$LIBS"
+LIBS="-lgle $GL_LIBS -lX11 -lXext -lm $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 8099 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char gleCreateGC();
+
+int main() {
+gleCreateGC()
+; return 0; }
+EOF
+if { (eval echo configure:8110: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ have_gle=yes; gle_halfassed=no; GLE_LIBS="-lgle"
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+ CPPFLAGS="$ac_save_CPPFLAGS"
+ LDFLAGS="$ac_save_LDFLAGS"
+# LIBS="$ac_save_LIBS"
+
+ fi
+ if test "$have_gle" = yes ; then
+ have_gle=no
+ gle_halfassed=yes
+
+ # sometimes the libmatrix stuff is included in libgle. look there first.
+#
+# I don't get it. For some reason, this test passes on SGI, as if
+# uview_direction_d() was in libgle -- but it's not, it's in libmatrix.
+# Yet the link is succeeding. Why???
+#
+# AC_CHECK_X_LIB(gle, uview_direction_d,
+# [have_gle=yes; gle_halfassed=no],
+# [], $GL_LIBS -lX11 -lXext -lm)
+
+ # As of GLE 3 this is in libgle, and has changed name to uview_direction!
+ # *sigh*
+ if test "$have_gle3" = yes ; then
+
+ ac_save_CPPFLAGS="$CPPFLAGS"
+ ac_save_LDFLAGS="$LDFLAGS"
+# ac_save_LIBS="$LIBS"
+
+ if test \! -z "$includedir" ; then
+ CPPFLAGS="$CPPFLAGS -I$includedir"
+ fi
+ # note: $X_CFLAGS includes $x_includes
+ CPPFLAGS="$CPPFLAGS $X_CFLAGS"
+
+ if test \! -z "$libdir" ; then
+ LDFLAGS="$LDFLAGS -L$libdir"
+ fi
+ # note: $X_LIBS includes $x_libraries
+ LDFLAGS="$LDFLAGS $X_LIBS $X_EXTRA_LIBS"
+
+ echo $ac_n "checking for uview_direction in -lgle""... $ac_c" 1>&6
+echo "configure:8170: checking for uview_direction in -lgle" >&5
+ac_lib_var=`echo gle'_'uview_direction | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ ac_save_LIBS="$LIBS"
+LIBS="-lgle $GL_LIBS -lX11 -lXext -lm $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 8178 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char uview_direction();
+
+int main() {
+uview_direction()
+; return 0; }
+EOF
+if { (eval echo configure:8189: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ have_gle=yes; gle_halfassed=no
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+ CPPFLAGS="$ac_save_CPPFLAGS"
+ LDFLAGS="$ac_save_LDFLAGS"
+# LIBS="$ac_save_LIBS"
+
+ fi
+ # if it wasn't in libgle, then look in libmatrix.
+ if test "$have_gle" = no ; then
+
+ ac_save_CPPFLAGS="$CPPFLAGS"
+ ac_save_LDFLAGS="$LDFLAGS"
+# ac_save_LIBS="$LIBS"
+
+ if test \! -z "$includedir" ; then
+ CPPFLAGS="$CPPFLAGS -I$includedir"
+ fi
+ # note: $X_CFLAGS includes $x_includes
+ CPPFLAGS="$CPPFLAGS $X_CFLAGS"
+
+ if test \! -z "$libdir" ; then
+ LDFLAGS="$LDFLAGS -L$libdir"
+ fi
+ # note: $X_LIBS includes $x_libraries
+ LDFLAGS="$LDFLAGS $X_LIBS $X_EXTRA_LIBS"
+
+ echo $ac_n "checking for uview_direction_d in -lmatrix""... $ac_c" 1>&6
+echo "configure:8234: checking for uview_direction_d in -lmatrix" >&5
+ac_lib_var=`echo matrix'_'uview_direction_d | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ ac_save_LIBS="$LIBS"
+LIBS="-lmatrix $GL_LIBS -lX11 -lXext -lm $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 8242 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char uview_direction_d();
+
+int main() {
+uview_direction_d()
+; return 0; }
+EOF
+if { (eval echo configure:8253: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ have_gle=yes; gle_halfassed=no;
+ GLE_LIBS="$GLE_LIBS -lmatrix"
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+ CPPFLAGS="$ac_save_CPPFLAGS"
+ LDFLAGS="$ac_save_LDFLAGS"
+# LIBS="$ac_save_LIBS"
+
+ fi
+ fi
+
+ if test "$have_gle" = yes ; then
+ cat >> confdefs.h <<\EOF
+#define HAVE_GLE 1
+EOF
+
+ if test "$have_gle3" = yes ; then
+ cat >> confdefs.h <<\EOF
+#define HAVE_GLE3 1
+EOF
+
+ fi
+ fi
+
+elif test "$with_gle" != no; then
+ echo "error: must be yes or no: --with-gle=$with_gle"
+ exit 1
+
+fi
+
+
+
+###############################################################################
+#
+# Check for -lXpm.
+#
+###############################################################################
+
+have_xpm=no
+with_xpm_req=unspecified
+# Check whether --with-xpm or --without-xpm was given.
+if test "${with_xpm+set}" = set; then
+ withval="$with_xpm"
+ with_xpm="$withval"; with_xpm_req="$withval"
+else
+ with_xpm=yes
+fi
+
+
+
+ case "$with_xpm" in
+ yes) ;;
+ no) ;;
+
+ /*)
+ echo $ac_n "checking for XPM headers""... $ac_c" 1>&6
+echo "configure:8326: checking for XPM headers" >&5
+ d=$with_xpm/include
+ if test -d $d; then
+ X_CFLAGS="-I$d $X_CFLAGS"
+ echo "$ac_t""$d" 1>&6
+ else
+ echo "$ac_t""not found ($d: no such directory)" 1>&6
+ fi
+
+ echo $ac_n "checking for XPM libs""... $ac_c" 1>&6
+echo "configure:8336: checking for XPM libs" >&5
+ d=$with_xpm/lib
+ if test -d $d; then
+ X_LIBS="-L$d $X_LIBS"
+ echo "$ac_t""$d" 1>&6
+ else
+ echo "$ac_t""not found ($d: no such directory)" 1>&6
+ fi
+
+ # replace the directory string with "yes".
+ with_xpm_req="yes"
+ with_xpm=$with_xpm_req
+ ;;
+
+ *)
+ echo ""
+ echo "error: argument to --with-xpm must be \"yes\", \"no\", or a directory."
+ echo " If it is a directory, then \`DIR/include' will be added to"
+ echo " the -I list, and \`DIR/lib' will be added to the -L list."
+ exit 1
+ ;;
+ esac
+
+
+if test "$with_xpm" = yes; then
+
+ ac_save_CPPFLAGS="$CPPFLAGS"
+ if test \! -z "$includedir" ; then
+ CPPFLAGS="$CPPFLAGS -I$includedir"
+ fi
+ CPPFLAGS="$CPPFLAGS $X_CFLAGS"
+ ac_safe=`echo "X11/xpm.h" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for X11/xpm.h""... $ac_c" 1>&6
+echo "configure:8369: checking for X11/xpm.h" >&5
+if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 8374 "configure"
+#include "confdefs.h"
+#include <X11/xpm.h>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:8379: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=yes"
+else
+ echo "$ac_err" >&5
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=no"
+fi
+rm -f conftest*
+fi
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ have_xpm=yes
+ cat >> confdefs.h <<\EOF
+#define HAVE_XPM 1
+EOF
+
+ XPM_LIBS="-lXpm"
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+ CPPFLAGS="$ac_save_CPPFLAGS"
+elif test "$with_xpm" != no; then
+ echo "error: must be yes or no: --with-xpm=$with_xpm"
+ exit 1
+fi
+
+# See comment near $motif_requires_xpm, above.
+# Need to do this here, after both Motif and XPM have been checked for.
+#
+if test "$have_motif" = yes -a "$have_xpm" = yes ; then
+ if test "$motif_requires_xpm" = yes ; then
+ MOTIF_LIBS="$MOTIF_LIBS $XPM_LIBS"
+ fi
+fi
+
+
+###############################################################################
+#
+# Check for the XSHM server extension.
+#
+###############################################################################
+
+have_xshm=no
+with_xshm_req=unspecified
+# Check whether --with-xshm-ext or --without-xshm-ext was given.
+if test "${with_xshm_ext+set}" = set; then
+ withval="$with_xshm_ext"
+ with_xshm="$withval"; with_xshm_req="$withval"
+else
+ with_xshm=yes
+fi
+
+
+
+ case "$with_xshm" in
+ yes) ;;
+ no) ;;
+
+ /*)
+ echo $ac_n "checking for XSHM headers""... $ac_c" 1>&6
+echo "configure:8445: checking for XSHM headers" >&5
+ d=$with_xshm/include
+ if test -d $d; then
+ X_CFLAGS="-I$d $X_CFLAGS"
+ echo "$ac_t""$d" 1>&6
+ else
+ echo "$ac_t""not found ($d: no such directory)" 1>&6
+ fi
+
+ echo $ac_n "checking for XSHM libs""... $ac_c" 1>&6
+echo "configure:8455: checking for XSHM libs" >&5
+ d=$with_xshm/lib
+ if test -d $d; then
+ X_LIBS="-L$d $X_LIBS"
+ echo "$ac_t""$d" 1>&6
+ else
+ echo "$ac_t""not found ($d: no such directory)" 1>&6
+ fi
+
+ # replace the directory string with "yes".
+ with_xshm_req="yes"
+ with_xshm=$with_xshm_req
+ ;;
+
+ *)
+ echo ""
+ echo "error: argument to --with-xshm-ext must be \"yes\", \"no\", or a directory."
+ echo " If it is a directory, then \`DIR/include' will be added to"
+ echo " the -I list, and \`DIR/lib' will be added to the -L list."
+ exit 1
+ ;;
+ esac
+
+
+if test "$with_xshm" = yes; then
+
+ # first check for Xshm.h.
+
+ ac_save_CPPFLAGS="$CPPFLAGS"
+ if test \! -z "$includedir" ; then
+ CPPFLAGS="$CPPFLAGS -I$includedir"
+ fi
+ CPPFLAGS="$CPPFLAGS $X_CFLAGS"
+ ac_safe=`echo "X11/extensions/XShm.h" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for X11/extensions/XShm.h""... $ac_c" 1>&6
+echo "configure:8490: checking for X11/extensions/XShm.h" >&5
+if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 8495 "configure"
+#include "confdefs.h"
+#include <X11/extensions/XShm.h>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:8500: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=yes"
+else
+ echo "$ac_err" >&5
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=no"
+fi
+rm -f conftest*
+fi
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ have_xshm=yes
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+ CPPFLAGS="$ac_save_CPPFLAGS"
+
+ # if that succeeded, then check for sys/ipc.h.
+ if test "$have_xshm" = yes; then
+ have_xshm=no
+
+ ac_save_CPPFLAGS="$CPPFLAGS"
+ if test \! -z "$includedir" ; then
+ CPPFLAGS="$CPPFLAGS -I$includedir"
+ fi
+ CPPFLAGS="$CPPFLAGS $X_CFLAGS"
+ ac_safe=`echo "sys/ipc.h" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for sys/ipc.h""... $ac_c" 1>&6
+echo "configure:8534: checking for sys/ipc.h" >&5
+if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 8539 "configure"
+#include "confdefs.h"
+#include <sys/ipc.h>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:8544: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=yes"
+else
+ echo "$ac_err" >&5
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=no"
+fi
+rm -f conftest*
+fi
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ have_xshm=yes
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+ CPPFLAGS="$ac_save_CPPFLAGS"
+ fi
+
+ # if that succeeded, then check for sys/shm.h.
+ if test "$have_xshm" = yes; then
+ have_xshm=no
+
+ ac_save_CPPFLAGS="$CPPFLAGS"
+ if test \! -z "$includedir" ; then
+ CPPFLAGS="$CPPFLAGS -I$includedir"
+ fi
+ CPPFLAGS="$CPPFLAGS $X_CFLAGS"
+ ac_safe=`echo "sys/shm.h" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for sys/shm.h""... $ac_c" 1>&6
+echo "configure:8579: checking for sys/shm.h" >&5
+if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 8584 "configure"
+#include "confdefs.h"
+#include <sys/shm.h>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:8589: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=yes"
+else
+ echo "$ac_err" >&5
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=no"
+fi
+rm -f conftest*
+fi
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ have_xshm=yes
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+ CPPFLAGS="$ac_save_CPPFLAGS"
+ fi
+
+ # AIX is pathological, as usual: apparently it's normal for the Xshm headers
+ # to exist, but the library code to not exist. And even better, the library
+ # code is in its own library: libXextSam.a. So, if we're on AIX, and that
+ # lib doesn't exist, give up. (This lib gets added to X_EXTRA_LIBS, and
+ # that's not quite right, but close enough.)
+ #
+ case "$host" in
+ *-aix*)
+ if `uname -v` -eq 3 ; then
+ have_xshm=no
+
+ ac_save_CPPFLAGS="$CPPFLAGS"
+ ac_save_LDFLAGS="$LDFLAGS"
+# ac_save_LIBS="$LIBS"
+
+ if test \! -z "$includedir" ; then
+ CPPFLAGS="$CPPFLAGS -I$includedir"
+ fi
+ # note: $X_CFLAGS includes $x_includes
+ CPPFLAGS="$CPPFLAGS $X_CFLAGS"
+
+ if test \! -z "$libdir" ; then
+ LDFLAGS="$LDFLAGS -L$libdir"
+ fi
+ # note: $X_LIBS includes $x_libraries
+ LDFLAGS="$LDFLAGS $X_LIBS $X_EXTRA_LIBS"
+
+ echo $ac_n "checking for XShmQueryExtension in -lXextSam""... $ac_c" 1>&6
+echo "configure:8641: checking for XShmQueryExtension in -lXextSam" >&5
+ac_lib_var=`echo XextSam'_'XShmQueryExtension | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ ac_save_LIBS="$LIBS"
+LIBS="-lXextSam -lX11 -lXext -lm $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 8649 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char XShmQueryExtension();
+
+int main() {
+XShmQueryExtension()
+; return 0; }
+EOF
+if { (eval echo configure:8660: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ have_xshm=yes; X_EXTRA_LIBS="$X_EXTRA_LIBS -lXextSam"
+else
+ echo "$ac_t""no" 1>&6
+true
+fi
+
+ CPPFLAGS="$ac_save_CPPFLAGS"
+ LDFLAGS="$ac_save_LDFLAGS"
+# LIBS="$ac_save_LIBS"
+
+ fi
+ ;;
+ esac
+
+ # if that succeeded, then we've really got it.
+ if test "$have_xshm" = yes; then
+ cat >> confdefs.h <<\EOF
+#define HAVE_XSHM_EXTENSION 1
+EOF
+
+ fi
+
+elif test "$with_xshm" != no; then
+ echo "error: must be yes or no: --with-xshm-ext=$with_xshm"
+ exit 1
+fi
+
+
+###############################################################################
+#
+# Check for the DOUBLE-BUFFER server extension.
+#
+###############################################################################
+
+have_xdbe=no
+with_xdbe_req=unspecified
+# Check whether --with-xdbe-ext or --without-xdbe-ext was given.
+if test "${with_xdbe_ext+set}" = set; then
+ withval="$with_xdbe_ext"
+ with_xdbe="$withval"; with_xdbe_req="$withval"
+else
+ with_xdbe=yes
+fi
+
+
+
+ case "$with_xdbe" in
+ yes) ;;
+ no) ;;
+
+ /*)
+ echo $ac_n "checking for DOUBLE-BUFFER headers""... $ac_c" 1>&6
+echo "configure:8727: checking for DOUBLE-BUFFER headers" >&5
+ d=$with_xdbe/include
+ if test -d $d; then
+ X_CFLAGS="-I$d $X_CFLAGS"
+ echo "$ac_t""$d" 1>&6
+ else
+ echo "$ac_t""not found ($d: no such directory)" 1>&6
+ fi
+
+ echo $ac_n "checking for DOUBLE-BUFFER libs""... $ac_c" 1>&6
+echo "configure:8737: checking for DOUBLE-BUFFER libs" >&5
+ d=$with_xdbe/lib
+ if test -d $d; then
+ X_LIBS="-L$d $X_LIBS"
+ echo "$ac_t""$d" 1>&6
+ else
+ echo "$ac_t""not found ($d: no such directory)" 1>&6
+ fi
+
+ # replace the directory string with "yes".
+ with_xdbe_req="yes"
+ with_xdbe=$with_xdbe_req
+ ;;
+
+ *)
+ echo ""
+ echo "error: argument to --with-xdbe-ext must be \"yes\", \"no\", or a directory."
+ echo " If it is a directory, then \`DIR/include' will be added to"
+ echo " the -I list, and \`DIR/lib' will be added to the -L list."
+ exit 1
+ ;;
+ esac
+
+
+if test "$with_xdbe" = yes; then
+
+
+ ac_save_CPPFLAGS="$CPPFLAGS"
+ if test \! -z "$includedir" ; then
+ CPPFLAGS="$CPPFLAGS -I$includedir"
+ fi
+ CPPFLAGS="$CPPFLAGS $X_CFLAGS"
+ ac_safe=`echo "X11/extensions/Xdbe.h" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for X11/extensions/Xdbe.h""... $ac_c" 1>&6
+echo "configure:8771: checking for X11/extensions/Xdbe.h" >&5
+if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 8776 "configure"
+#include "confdefs.h"
+#include <X11/extensions/Xdbe.h>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:8781: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=yes"
+else
+ echo "$ac_err" >&5
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=no"
+fi
+rm -f conftest*
+fi
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ have_xdbe=yes
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+ CPPFLAGS="$ac_save_CPPFLAGS"
+ if test "$have_xdbe" = yes; then
+ cat >> confdefs.h <<\EOF
+#define HAVE_DOUBLE_BUFFER_EXTENSION 1
+EOF
+
+ fi
+
+elif test "$with_xdbe" != no; then
+ echo "error: must be yes or no: --with-xdbe-ext=$with_xshm"
+ exit 1
+fi
+
+
+###############################################################################
+#
+# Check for the SGI XReadDisplay server extension.
+#
+# Note: this has to be down here, rather than up with the other server
+# extension tests, so that the output of `configure --help' is in the
+# right order. Arrgh!
+#
+###############################################################################
+
+have_readdisplay=no
+with_readdisplay_req=unspecified
+# Check whether --with-readdisplay or --without-readdisplay was given.
+if test "${with_readdisplay+set}" = set; then
+ withval="$with_readdisplay"
+ with_readdisplay="$withval"; with_readdisplay_req="$withval"
+else
+ with_readdisplay=yes
+fi
+
+
+
+ case "$with_readdisplay" in
+ yes) ;;
+ no) ;;
+
+ /*)
+ echo $ac_n "checking for XReadDisplay headers""... $ac_c" 1>&6
+echo "configure:8844: checking for XReadDisplay headers" >&5
+ d=$with_readdisplay/include
+ if test -d $d; then
+ X_CFLAGS="-I$d $X_CFLAGS"
+ echo "$ac_t""$d" 1>&6
+ else
+ echo "$ac_t""not found ($d: no such directory)" 1>&6
+ fi
+
+ echo $ac_n "checking for XReadDisplay libs""... $ac_c" 1>&6
+echo "configure:8854: checking for XReadDisplay libs" >&5
+ d=$with_readdisplay/lib
+ if test -d $d; then
+ X_LIBS="-L$d $X_LIBS"
+ echo "$ac_t""$d" 1>&6
+ else
+ echo "$ac_t""not found ($d: no such directory)" 1>&6
+ fi
+
+ # replace the directory string with "yes".
+ with_readdisplay_req="yes"
+ with_readdisplay=$with_readdisplay_req
+ ;;
+
+ *)
+ echo ""
+ echo "error: argument to --with-readdisplay must be \"yes\", \"no\", or a directory."
+ echo " If it is a directory, then \`DIR/include' will be added to"
+ echo " the -I list, and \`DIR/lib' will be added to the -L list."
+ exit 1
+ ;;
+ esac
+
+
+if test "$with_readdisplay" = yes; then
+
+ ac_save_CPPFLAGS="$CPPFLAGS"
+ if test \! -z "$includedir" ; then
+ CPPFLAGS="$CPPFLAGS -I$includedir"
+ fi
+ CPPFLAGS="$CPPFLAGS $X_CFLAGS"
+ ac_safe=`echo "X11/extensions/readdisplay.h" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for X11/extensions/readdisplay.h""... $ac_c" 1>&6
+echo "configure:8887: checking for X11/extensions/readdisplay.h" >&5
+if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 8892 "configure"
+#include "confdefs.h"
+#include <X11/extensions/readdisplay.h>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:8897: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=yes"
+else
+ echo "$ac_err" >&5
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=no"
+fi
+rm -f conftest*
+fi
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ cat >> confdefs.h <<\EOF
+#define HAVE_READ_DISPLAY_EXTENSION 1
+EOF
+
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+ CPPFLAGS="$ac_save_CPPFLAGS"
+elif test "$with_readdisplay" != no; then
+ echo "error: must be yes or no: --with-readdisplay=$with_readdisplay"
+ exit 1
+fi
+
+
+###############################################################################
+#
+# Check for a program to generate random text.
+#
+# Zippy is funnier than the idiocy generally spat out by `fortune',
+# so try to find that, by invoking Emacs and asking it where its
+# libexec directory is ("yow" lives in there.)
+#
+# If that doesn't work, see if fortune, zippy, or yow are on $PATH,
+# and if so, use them.
+#
+# If that doesn't work, look in /usr/games, and if it's there, use
+# the full pathname.
+#
+###############################################################################
+
+with_zippy_req=""
+# Check whether --with-zippy or --without-zippy was given.
+if test "${with_zippy+set}" = set; then
+ withval="$with_zippy"
+ with_zippy_req="$withval"; with_zippy="$withval"
+else
+ with_zippy=yes
+fi
+
+
+if test "$with_zippy" = no || test "$with_zippy" = yes ; then
+ with_zippy=""
+ with_zippy_req=""
+fi
+
+if test -n "$with_zippy_req" ; then
+ ac_cv_zippy_program=""
+ case "$with_zippy_req" in
+ /*)
+ echo $ac_n "checking for $with_zippy_req""... $ac_c" 1>&6
+echo "configure:8964: checking for $with_zippy_req" >&5
+ if test -x "$with_zippy_req" ; then
+ echo "$ac_t""yes" 1>&6
+ else
+ echo "$ac_t""no" 1>&6
+ with_zippy=""
+ fi
+ ;;
+ *)
+ # don't cache
+ unset ac_cv_path_zip2
+ # Extract the first word of "$with_zippy_req", so it can be a program name with args.
+set dummy $with_zippy_req; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:8978: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_path_zip2'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ case "$zip2" in
+ /*)
+ ac_cv_path_zip2="$zip2" # Let the user override the test with a path.
+ ;;
+ ?:/*)
+ ac_cv_path_zip2="$zip2" # Let the user override the test with a dos path.
+ ;;
+ *)
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
+ ac_dummy="$PATH"
+ for ac_dir in $ac_dummy; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$ac_word; then
+ ac_cv_path_zip2="$ac_dir/$ac_word"
+ break
+ fi
+ done
+ IFS="$ac_save_ifs"
+ ;;
+esac
+fi
+zip2="$ac_cv_path_zip2"
+if test -n "$zip2"; then
+ echo "$ac_t""$zip2" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+ if test "$zip2" = ""; then
+ with_zippy=""
+ fi
+ ;;
+ esac
+ ac_cv_zippy_program="$with_zippy"
+
+elif test -n "$ac_cv_zippy_program"; then
+ echo "$ac_t""checking for zippy... (cached) $ac_cv_zippy_program" 1>&6
+fi
+
+if test ! -n "$ac_cv_zippy_program"; then
+
+ for ac_prog in emacs
+do
+# Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:9028: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_emacs_exe'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ if test -n "$emacs_exe"; then
+ ac_cv_prog_emacs_exe="$emacs_exe" # Let the user override the test.
+else
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
+ ac_dummy="$PATH"
+ for ac_dir in $ac_dummy; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$ac_word; then
+ ac_cv_prog_emacs_exe="$ac_prog"
+ break
+ fi
+ done
+ IFS="$ac_save_ifs"
+fi
+fi
+emacs_exe="$ac_cv_prog_emacs_exe"
+if test -n "$emacs_exe"; then
+ echo "$ac_t""$emacs_exe" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+test -n "$emacs_exe" && break
+done
+
+ for ac_prog in xemacs
+do
+# Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:9062: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_xemacs_exe'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ if test -n "$xemacs_exe"; then
+ ac_cv_prog_xemacs_exe="$xemacs_exe" # Let the user override the test.
+else
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
+ ac_dummy="$PATH"
+ for ac_dir in $ac_dummy; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$ac_word; then
+ ac_cv_prog_xemacs_exe="$ac_prog"
+ break
+ fi
+ done
+ IFS="$ac_save_ifs"
+fi
+fi
+xemacs_exe="$ac_cv_prog_xemacs_exe"
+if test -n "$xemacs_exe"; then
+ echo "$ac_t""$xemacs_exe" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+test -n "$xemacs_exe" && break
+done
+
+
+ ac_cv_zippy_program=""
+ eargs='-batch -q -nw --eval'
+
+ if test -n "$emacs_exe" ; then
+ echo $ac_n "checking for emacs yow""... $ac_c" 1>&6
+echo "configure:9097: checking for emacs yow" >&5
+ #
+ # get emacs to tell us where the libexec directory is.
+ #
+ dir=`$emacs_exe $eargs '(princ (concat exec-directory "\n"))' \
+ 2>/dev/null | tail -1`
+ dir=`echo "$dir" | sed 's@///*@/@g;s@/$@@'`
+ #
+ # try running libexec/yow and see if it exits without error.
+ #
+ if test x"$dir" != x -a -x "$dir/yow" ; then
+ if $dir/yow >&- 2>&- ; then
+ ac_cv_zippy_program="$dir/yow"
+ echo "$ac_t""$ac_cv_zippy_program" 1>&6
+ else
+ echo "$ac_t""no" 1>&6
+ fi
+ fi
+ fi
+
+ if test -z "$ac_cv_zippy_program" ; then
+ echo $ac_n "checking for xemacs yow""... $ac_c" 1>&6
+echo "configure:9119: checking for xemacs yow" >&5
+ if test -n "$xemacs_exe" ; then
+ #
+ # get xemacs to tell us where the libexec directory is.
+ #
+ dir=`$xemacs_exe $eargs '(princ (concat exec-directory "\n"))' \
+ 2>/dev/null | tail -1`
+ dir=`echo "$dir" | sed 's@///*@/@g;s@/$@@'`
+ #
+ # try running libexec/yow and see if it exits without error.
+ #
+ if test x"$dir" != x -a -x "$dir/yow" ; then
+ if $dir/yow >&- 2>&- ; then
+ ac_cv_zippy_program="$dir/yow"
+ echo "$ac_t""$ac_cv_zippy_program" 1>&6
+ else
+ #
+ # in some xemacs installations, the pathname of the yow.lines file
+ # isn't hardcoded into the yow executable, and must be passed on
+ # the command line. See if it's in libexec/../etc/.
+
+ # M4 sucks!!
+
+ dir_up=`echo "$dir" | sed 's@/[^/]*$@@'`
+
+
+ yowlines="$dir_up/etc/yow.lines"
+ if $dir/yow -f $yowlines >&- 2>&- ; then
+ ac_cv_zippy_program="$dir/yow -f $yowlines"
+ echo "$ac_t""$ac_cv_zippy_program" 1>&6
+ else
+ #
+ # In newer XEmacs releases, yow.lines is in a different place,
+ # and the easiest way to get it is by calling the new function
+ # `locate-data-file'.
+ #
+ yowlines=`$xemacs_exe $eargs \
+ '(princ (concat (locate-data-file "yow.lines") "\n"))' \
+ 2>/dev/null | tail -1`
+ if $dir/yow -f $yowlines >&- 2>&- ; then
+ ac_cv_zippy_program="$dir/yow -f $yowlines"
+ echo "$ac_t""$ac_cv_zippy_program" 1>&6
+ else
+ echo "$ac_t""no" 1>&6
+ fi
+ fi
+ fi
+ fi
+ fi
+ fi
+
+ # if that didn't work, try for some other programs...
+ if test -z "$ac_cv_zippy_program" ; then
+ fortune=''
+ for ac_prog in fortune zippy yow
+do
+# Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:9178: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_fortune'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ if test -n "$fortune"; then
+ ac_cv_prog_fortune="$fortune" # Let the user override the test.
+else
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
+ ac_dummy="$PATH"
+ for ac_dir in $ac_dummy; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$ac_word; then
+ ac_cv_prog_fortune="$ac_prog"
+ break
+ fi
+ done
+ IFS="$ac_save_ifs"
+fi
+fi
+fortune="$ac_cv_prog_fortune"
+if test -n "$fortune"; then
+ echo "$ac_t""$fortune" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+test -n "$fortune" && break
+done
+
+ # if that didn't work, try for those programs in /usr/games...
+ if test -z "$fortune" ; then
+ for ac_prog in fortune zippy yow
+do
+# Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:9214: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_path_fortune'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ case "$fortune" in
+ /*)
+ ac_cv_path_fortune="$fortune" # Let the user override the test with a path.
+ ;;
+ ?:/*)
+ ac_cv_path_fortune="$fortune" # Let the user override the test with a dos path.
+ ;;
+ *)
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
+ ac_dummy="/usr/games:/usr/local/games:$PATH"
+ for ac_dir in $ac_dummy; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$ac_word; then
+ ac_cv_path_fortune="$ac_dir/$ac_word"
+ break
+ fi
+ done
+ IFS="$ac_save_ifs"
+ ;;
+esac