+dnl ----------------------
+dnl X-Specific Graphics libraries
+dnl ----------------------
+
+if test "$with_x11" = "yes"; then
+ AC_CHECKING(for X11 graphics libraries)
+fi
+
+if test "$with_x11" = "yes" -a "$with_widgets" = "athena"; then
+ AC_CHECKING(for the Athena widgets)
+
+ dnl What in heck did the user actually want?
+ case "$with_athena" in
+ dnl This is the default, old fashioned flat Athena.
+ "xaw" | "") athena_variant=Xaw athena_3d=no ;;
+ "3d") athena_variant=Xaw3d athena_3d=yes ;;
+ "next") athena_variant=neXtaw athena_3d=yes ;;
+ "95") athena_variant=Xaw95 athena_3d=yes ;;
+ "xpm") athena_variant=XawXpm athena_3d=yes ;;
+ *) XE_DIE("Unknown Athena widget set \`$with_athena'. This should not happen.") ;;
+ esac
+
+ dnl Search for the Athena library...
+ if test "$athena_3d" = "no"; then
+ AC_CHECK_LIB($athena_variant, XawScrollbarSetThumb,
+ [
+ dnl Must not be a 3d library...
+ AC_CHECK_LIB($athena_variant, threeDClassRec,
+ AC_MSG_WARN("Could not find a non-3d Athena widget library."),
+ athena_lib=$athena_variant)
+ ],
+ AC_MSG_WARN("Could not find an Athena widget library."))
+ else
+ dnl The real configuration, need 3d library
+ AC_CHECK_LIB($athena_variant, threeDClassRec, athena_lib=$athena_variant,
+ dnl OK, couldn't find it with a proper name, try the standard Athena lib
+ dnl If that is 3d, presume the user asked for what they have installed.
+ AC_CHECK_LIB(Xaw, threeDClassRec,
+ [
+ athena_lib=Xaw;
+ AC_MSG_WARN("Assuming that libXaw is actually $athena_variant.");
+ ],
+ AC_MSG_WARN("Could not find a 3d Athena widget library that looked like $athena_variant.")))
+ fi
+
+ dnl Now we locate the Athena headers that we need.
+ if test "$athena_3d" = "no"; then
+ AC_CHECK_HEADER(X11/Xaw/ThreeD.h,
+ AC_MSG_WARN("Could not find a non-3d Athena header set."),
+ AC_CHECK_HEADER(X11/Xaw/XawInit.h,
+ athena_h_path=X11/Xaw,
+ AC_MSG_WARN("Could not find a non-3d Athena header set.")))
+ else
+ dnl The three-d Athena headers are so much more slippery.
+ dnl Curse this `Lets replace standard libraries' thing that they did. :/
+ AC_CHECK_HEADER(X11/$athena_variant/XawInit.h,
+ AC_CHECK_HEADER(X11/$athena_variant/ThreeD.h,
+ athena_h_path=X11/$athena_variant,))
+
+ dnl Is the variant specific header directory directly under include?
+ if test -z "$athena_h_path"; then
+ AC_CHECK_HEADER($athena_variant/XawInit.h,
+ AC_CHECK_HEADER($athena_variant/ThreeD.h,
+ athena_h_path=$athena_variant,))
+ fi
+
+ dnl If we couldn't find the specific variant, try the generic Athena 3d headers
+ if test -z "$athena_h_path" -a "$athena_variant" != "Xaw3d"; then
+ AC_CHECK_HEADER(X11/Xaw3d/XawInit.h,
+ AC_CHECK_HEADER(X11/Xaw3d/ThreeD.h,
+ [
+ AC_MSG_WARN("Assuming that X11/Xaw3d headers are suitable for $athena_variant.")
+ athena_h_path=X11/Xaw3d
+ ],))
+ fi
+
+ dnl Also generic 3d headers directly under include dir
+ if test -z "$athena_h_path" -a "$athena_variant" != "Xaw3d"; then
+ AC_CHECK_HEADER(Xaw3d/XawInit.h,
+ AC_CHECK_HEADER(Xaw3d/ThreeD.h,
+ [
+ AC_MSG_WARN("Assuming that Xaw3d headers are suitable for $athena_variant.")
+ athena_h_path=Xaw3d
+ ],))
+ fi
+
+ dnl If nothing yet found, see if Xaw is a 3d header set...
+ dnl We AC_MSG_WARN if we fail because I am all out of ideas...
+ if test -z "$athena_h_path"; then
+ AC_CHECK_HEADER(X11/Xaw/ThreeD.h,
+ [
+ AC_MSG_WARN("Assuming that X11/Xaw headers are suitable for $athena_variant.")
+ athena_h_path=X11/Xaw
+ ],
+ AC_MSG_WARN("Could not find a suitable 3d Athena header set."))
+ fi
+ fi
+
+ dnl Do we actually have a usable Athena widget set? Please?
+ if test -n "$athena_lib" -a -n "$athena_h_path"; then
+ have_xaw=yes
+ else
+ have_xaw=no
+ fi
+
+else
+ have_xaw=no
+fi dnl "$with_x11" = "yes" -a "$with_widgets" = "athena"
+
+if test "$with_x11" = "yes"; then