+# Check for the DPMS server extension header.
+#
+have_dpms=no
+with_dpms_req=unspecified
+AC_ARG_WITH(dpms-ext,
+[ --with-dpms-ext Include support for the DPMS server extension,
+ if possible (this is the default).
+ --without-dpms-ext Do not compile in support for this extension.],
+ [with_dpms="$withval"; with_dpms_req="$withval"],[with_dpms=yes])
+if test $with_dpms = yes; then
+
+ # first check for dpms.h
+ AC_CHECK_X_HEADER(X11/extensions/dpms.h, [have_dpms=yes])
+
+ # if that succeeded, then check for the -lXdpms
+ if test $have_dpms = yes; then
+ have_dpms=no
+ AC_CHECK_X_LIB(Xdpms, DPMSInfo,
+ [have_dpms=yes; SAVER_LIBS="$SAVER_LIBS -lXdpms"], [],
+ -lXext -lX11)
+ fi