+###############################################################################
+#
+# Check for -lgle.
+#
+###############################################################################
+
+have_gle=no
+with_gle_req=unspecified
+AC_ARG_WITH(gle,
+[ --with-gle Build those demos which depend on GLE
+ (the OpenGL "extrusion" library.)],
+ [with_gle="$withval"; with_gle_req="$withval"],[with_gle=yes])
+
+HANDLE_X_PATH_ARG(with_gle, --with-gle, GLE)
+
+GLE_LIBS=""
+
+if test "$with_gle" = yes; then
+
+ AC_CHECK_X_HEADER(GL/gutil.h, have_gle=yes, have_gle=no)
+ if test "$have_gle" = yes ; then
+ AC_CHECK_X_HEADER(GL/tube.h, have_gle=yes, have_gle=no)
+ fi
+
+# /usr/local/lib/GL/libgle.a
+# /usr/local/lib/GL/libmatrix.a
+
+ if test "$have_gle" = yes ; then
+ have_gle=no
+ AC_CHECK_X_LIB(gle, gleCreateGC,
+ [have_gle=yes; GLE_LIBS="-lgle"],
+ [], $GL_LIBS -lX11 -lXext -lm)
+ fi
+ if test "$have_gle" = yes ; then
+ have_gle=no
+ AC_CHECK_X_LIB(matrix, uview_direction_d,
+ [have_gle=yes; GLE_LIBS="$GLE_LIBS -lmatrix"],
+ [], $GL_LIBS -lX11 -lXext -lm)
+ fi
+
+ if test "$have_gle" = yes ; then
+ AC_DEFINE(HAVE_GLE)
+ fi
+
+elif test "$with_gle" != no; then
+ echo "error: must be yes or no: --with-gle=$with_gle"
+ exit 1
+
+fi
+
+
+