+ fi
+fi
+
+
+###############################################################################
+#
+# Checking whether Motif is really Lesstif.
+#
+###############################################################################
+
+have_lesstif=no
+if test "$have_motif" = yes ; then
+ echo $ac_n "checking whether Motif is really LessTif""... $ac_c" 1>&6
+echo "configure:6358: checking whether Motif is really LessTif" >&5
+if eval "test \"`echo '$''{'ac_cv_have_lesstif'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+
+ ac_save_CPPFLAGS="$CPPFLAGS"
+ if test \! -z "$includedir" ; then
+ CPPFLAGS="$CPPFLAGS -I$includedir"
+ fi
+ CPPFLAGS="$CPPFLAGS $X_CFLAGS"
+ cat > conftest.$ac_ext <<EOF
+#line 6369 "configure"
+#include "confdefs.h"
+#include <Xm/Xm.h>
+int main() {
+long vers = LesstifVersion;
+; return 0; }
+EOF
+if { (eval echo configure:6376: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ ac_cv_have_lesstif=yes
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ ac_cv_have_lesstif=no
+fi
+rm -f conftest*
+ CPPFLAGS="$ac_save_CPPFLAGS"
+fi
+
+echo "$ac_t""$ac_cv_have_lesstif" 1>&6
+ have_lesstif=$ac_cv_have_lesstif
+fi
+
+
+lesstif_version=unknown
+lesstif_version_string=unknown
+
+if test "$have_lesstif" = yes ; then
+ ltv=unknown
+ echo unknown > conftest-lt
+ echo $ac_n "checking LessTif version number""... $ac_c" 1>&6
+echo "configure:6401: checking LessTif version number" >&5
+if eval "test \"`echo '$''{'ac_cv_lesstif_version_string'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+
+ ac_save_CPPFLAGS="$CPPFLAGS"
+ if test \! -z "$includedir" ; then
+ CPPFLAGS="$CPPFLAGS -I$includedir"
+ fi
+ CPPFLAGS="$CPPFLAGS $X_CFLAGS"
+ if test "$cross_compiling" = yes; then
+ ac_cv_lesstif_version=unknown
+ ac_cv_lesstif_version_string=unknown
+else
+ cat > conftest.$ac_ext <<EOF
+#line 6416 "configure"
+#include "confdefs.h"
+#include <stdio.h>
+ #include <Xm/Xm.h>
+ int main() {
+ FILE *f = fopen("conftest-lt", "w");
+ if (!f) exit(1);
+ fprintf(f, "%d %d.%d\n", LesstifVersion,
+ LESSTIF_VERSION, LESSTIF_REVISION);
+ fclose(f);
+ exit(0);
+ }
+EOF
+if { (eval echo configure:6429: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+then
+ ltv=`cat conftest-lt`
+ ac_cv_lesstif_version=`echo $ltv | sed 's/ .*//'`
+ ac_cv_lesstif_version_string=`echo $ltv | sed 's/.* //'`
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -fr conftest*
+ ac_cv_lesstif_version=unknown
+ ac_cv_lesstif_version_string=unknown
+fi
+rm -fr conftest*
+fi
+
+ CPPFLAGS="$ac_save_CPPFLAGS"
+fi
+
+echo "$ac_t""$ac_cv_lesstif_version_string" 1>&6
+ rm -f conftest-lt
+ lesstif_version=$ac_cv_lesstif_version
+ lesstif_version_string=$ac_cv_lesstif_version_string
+
+fi
+
+
+if test "$have_motif" = yes ; then
+ mtv=unknown
+ echo unknown > conftest-mt
+ echo $ac_n "checking Motif version number""... $ac_c" 1>&6
+echo "configure:6459: checking Motif version number" >&5
+if eval "test \"`echo '$''{'ac_cv_motif_version_string'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+
+ ac_save_CPPFLAGS="$CPPFLAGS"
+ if test \! -z "$includedir" ; then
+ CPPFLAGS="$CPPFLAGS -I$includedir"
+ fi
+ CPPFLAGS="$CPPFLAGS $X_CFLAGS"
+ if test "$cross_compiling" = yes; then
+ ac_cv_motif_version=unknown
+ ac_cv_motif_version_string=unknown
+else
+ cat > conftest.$ac_ext <<EOF
+#line 6474 "configure"
+#include "confdefs.h"
+#include <stdio.h>
+ #include <Xm/Xm.h>
+ int main() {
+ FILE *f = fopen("conftest-mt", "w");
+ if (!f) exit(1);
+ fprintf(f, "%d %d.%d\n", XmVersion,
+ XmVERSION, XmREVISION);
+ fclose(f);
+ exit(0);
+ }
+EOF
+if { (eval echo configure:6487: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+then
+ mtv=`cat conftest-mt`
+ ac_cv_motif_version=`echo $mtv | sed 's/ .*//'`
+ ac_cv_motif_version_string=`echo $mtv | sed 's/.* //'`
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -fr conftest*
+ ac_cv_motif_version=unknown
+ ac_cv_motif_version_string=unknown
+fi
+rm -fr conftest*
+fi
+
+ CPPFLAGS="$ac_save_CPPFLAGS"
+fi
+
+echo "$ac_t""$ac_cv_motif_version_string" 1>&6
+ rm -f conftest-mt
+ motif_version=$ac_cv_motif_version
+ motif_version_string=$ac_cv_motif_version_string
+
+fi
+
+
+###############################################################################
+#
+# Checking whether Motif requires -lXpm.
+#
+# If this is Motif 2.x, and we have XPM, then link against XPM as well.
+# The deal is, Motif 2.x requires XPM -- but it's a compilation option
+# of the library whether to build the XPM code into libXm, or whether
+# to rely on an external libXm. So the only way to tell whether XPM is
+# a link-time requirement is to examine libXm.a, which is very
+# difficult to do in an autoconf script. So... if it's Motif 2.x, we
+# always link against XPM if the XPM lib exists (and this will be a
+# no-op if libXm happens to already have the XPM code in it.)
+#
+###############################################################################
+
+motif_requires_xpm=no
+if test "$have_motif" = yes ; then
+ echo $ac_n "checking whether Motif requires XPM""... $ac_c" 1>&6
+echo "configure:6531: checking whether Motif requires XPM" >&5
+ if test "$motif_version" = "unknown" || test "$motif_version" -ge 2000
+ then
+ motif_requires_xpm=yes
+ echo "$ac_t""maybe" 1>&6
+ else
+ echo "$ac_t""no" 1>&6
+ fi
+fi
+
+
+###############################################################################
+#
+# Checking whether Motif requires -lXp.
+#
+# Some versions of Motif (2.1.0, at least) require -lXp, the "X Printing
+# Extension". Why this extension isn't in -lXext with all the others,
+# I have no idea.
+#
+###############################################################################
+
+have_xp_ext=no
+if test "$have_motif" = yes ; then
+ have_xp_ext=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 XpQueryExtension in -lXp""... $ac_c" 1>&6
+echo "configure:6573: checking for XpQueryExtension in -lXp" >&5
+ac_lib_var=`echo Xp'_'XpQueryExtension | 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="-lXp -lX11 -lXext -lm $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 6581 "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 XpQueryExtension();
+
+int main() {
+XpQueryExtension()
+; return 0; }
+EOF
+if { (eval echo configure:6592: \"$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_xp_ext=yes; MOTIF_LIBS="$MOTIF_LIBS -lXp"
+else
+ echo "$ac_t""no" 1>&6
+true
+fi
+
+ CPPFLAGS="$ac_save_CPPFLAGS"
+ LDFLAGS="$ac_save_LDFLAGS"
+# LIBS="$ac_save_LIBS"
+
+fi
+
+
+###############################################################################
+#
+# Checking whether Motif requires -lXintl (for _Xsetlocale.)
+#
+###############################################################################
+
+have_xintl=no
+if test "$have_motif" = 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 _Xsetlocale in -lXintl""... $ac_c" 1>&6
+echo "configure:6646: checking for _Xsetlocale in -lXintl" >&5
+ac_lib_var=`echo Xintl'_'_Xsetlocale | 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="-lXintl -lX11 -lXext -lm $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 6654 "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 _Xsetlocale();
+
+int main() {
+_Xsetlocale()
+; return 0; }
+EOF
+if { (eval echo configure:6665: \"$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_xintl=yes
+else
+ echo "$ac_t""no" 1>&6
+have_xintl=no
+fi
+
+ CPPFLAGS="$ac_save_CPPFLAGS"
+ LDFLAGS="$ac_save_LDFLAGS"
+# LIBS="$ac_save_LIBS"
+
+ if test "$have_xintl" = yes; then
+ MOTIF_LIBS="$MOTIF_LIBS -lXintl"
+ fi
+fi
+
+
+###############################################################################
+#
+# Check for -lGL or -lMesaGL.
+#
+###############################################################################
+
+have_gl=no
+ac_have_mesa_gl=no
+with_gl_req=unspecified
+gl_halfassed=no
+# Check whether --with-gl or --without-gl was given.
+if test "${with_gl+set}" = set; then
+ withval="$with_gl"
+ with_gl="$withval"; with_gl_req="$withval"
+else
+ with_gl=yes
+fi
+
+
+
+ case "$with_gl" in
+ yes) ;;
+ no) ;;
+
+ /*)
+ echo $ac_n "checking for GL headers""... $ac_c" 1>&6
+echo "configure:6722: checking for GL headers" >&5
+ d=$with_gl/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 GL libs""... $ac_c" 1>&6
+echo "configure:6732: checking for GL libs" >&5
+ d=$with_gl/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_gl_req="yes"
+ with_gl=$with_gl_req
+ ;;
+
+ *)
+ echo ""
+ echo "error: argument to --with-gl 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
+
+
+ac_mesagl_version=unknown
+ac_mesagl_version_string=unknown
+
+if test "$with_gl" = yes; then
+
+ ac_save_CPPFLAGS="$CPPFLAGS"
+ if test \! -z "$includedir" ; then
+ CPPFLAGS="$CPPFLAGS -I$includedir"
+ fi
+ CPPFLAGS="$CPPFLAGS $X_CFLAGS"
+ ac_safe=`echo "GL/gl.h" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for GL/gl.h""... $ac_c" 1>&6
+echo "configure:6768: checking for GL/gl.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 6773 "configure"
+#include "confdefs.h"
+#include <GL/gl.h>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:6778: \"$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_gl=yes
+else
+ echo "$ac_t""no" 1>&6
+fi