-###############################################################################
-#
-# Check for the MIT-SCREEN-SAVER server extension.
-#
-###############################################################################
-
-have_mit=no
-with_mit_req=unspecified
-AC_ARG_WITH(mit-ext,
-[ --with-mit-ext Include support for the MIT-SCREEN-SAVER extension.],
- [with_mit="$withval"; with_mit_req="$withval"],[with_mit=yes])
-
-HANDLE_X_PATH_ARG(with_mit, --with-mit-ext, MIT-SCREEN-SAVER)
-
-if test "$with_mit" = yes; then
- AC_CHECK_X_HEADER(X11/extensions/scrnsaver.h, [have_mit=yes],,
- [#include <X11/Xlib.h>])
-
- # Now check to see if it's really in the library; XF86Free-3.3 ships
- # scrnsaver.h, but doesn't include the code in libXext.a, the idiots!
- #
- if test "$have_mit" = yes; then
- AC_CHECK_X_LIB(Xext, XScreenSaverRegister, [true], [have_mit=no], -lm)
-
- if test "$have_mit" = no; then
- # Fuck! Looks like XF86Free-3.3 actually puts it in XExExt instead
- # of in Xext. Thank you master, may I have another.
- AC_CHECK_X_LIB(XExExt, XScreenSaverRegister,
- [have_mit=yes; SAVER_LIBS="$SAVER_LIBS -lXExExt"],
- [true], -lX11 -lXext -lm)
- fi
-
- if test "$have_mit" = no; then
- # Double fuck! Looks like some versions of XFree86 (whichever version
- # it is that comes with RedHat Linux 2.0 -- I can't find a version
- # number) put this garbage in Xss instead of Xext. Thank you master,
- # may I have another.
- AC_CHECK_X_LIB(Xss, XScreenSaverRegister,
- [have_mit=yes; SAVER_LIBS="$SAVER_LIBS -lXss"],
- [true], -lX11 -lXext -lm)
- fi
-
- if test "$have_mit" = yes; then
- AC_DEFINE(HAVE_MIT_SAVER_EXTENSION)
- fi
-
- fi
-
-elif test "$with_mit" != no; then
- echo "error: must be yes or no: --with-mit-ext=$with_mit"
- exit 1
-fi
-
-