From http://www.jwz.org/xscreensaver/xscreensaver-5.18.tar.gz
[xscreensaver] / configure
index e1e0f546711d712d94fbc3a2de5e969fe9311eae..04b0328012e8688cc337e44ff9e817125f0dbfe6 100755 (executable)
--- a/configure
+++ b/configure
@@ -650,6 +650,9 @@ HACKDIR
 NOGNOME
 GNOME22
 GNOME24
+GLFONT_OBJS
+GLFPS_OBJS
+JWZGLES_OBJS
 GLE_KLUDGE
 GLE_EXES
 GL_KLUDGE
@@ -679,6 +682,7 @@ DEFAULT_IMAGE_DIRECTORY
 DEFAULT_IMAGES_P
 NEW_LOGIN_COMMAND_P
 NEW_LOGIN_COMMAND
+COMMENT_PAM_CHECK_ACCOUNT
 HAVE_PAM_FAIL_DELAY
 INSTALL_PAM
 NEED_SETUID
@@ -811,11 +815,9 @@ with_x
 with_hackdir
 enable_subdir
 with_configdir
-with_sgi_ext
-with_xidle_ext
-with_sgivc_ext
 with_dpms_ext
 with_xinerama_ext
+with_xinput_ext
 with_xf86vmode_ext
 with_xf86gamma_ext
 with_randr_ext
@@ -824,6 +826,7 @@ enable_locking
 enable_root_passwd
 with_pam
 with_pam_service_name
+enable_pam_check_account_type
 with_kerberos
 with_shadow
 with_passwd_helper
@@ -832,6 +835,7 @@ with_gtk
 with_motif
 with_gl
 with_gle
+with_gles
 with_pixbuf
 with_xpm
 with_jpeg
@@ -1485,6 +1489,10 @@ Screen locking options:
 
   --enable-root-passwd       Allow root passwd to unlock screen.
   --disable-root-passwd       Do not allow that.
+  --enable-pam-check-account-type
+                          Whether PAM should check the result of account
+                          modules when authenticating. Only do this if you
+                          have account configured properly on your system.
 
 Optional Packages:
   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
@@ -1500,51 +1508,36 @@ Installation options:
   --with-x-app-defaults=DIR
                           Where to install xscreensaver configuration file.
 
-Except where noted, all of the --with options below can also take a
-directory argument: for example, `--with-motif=/opt/Motif'.  That would
-cause /opt/Motif/include/ to be added to the -I list, and /opt/Motif/lib/
-to be added to the -L list, assuming those directories exist.
-
-By default, support for each of these options will be built in, if the
-relevant library routines exist.  At run time, they will then be used
-only if the X server being used supports them.  Each --with option has
-a corresponding --without option, to override building support for them
-at all.
-
-Screen blanking and idle-detection options:
-
-  --with-sgi-ext          Include support for the SGI SCREEN_SAVER extension.
-  --with-xidle-ext        Include support for the XIDLE extension.
-  --with-sgivc-ext        Include support for the SGI-VIDEO-CONTROL extension.
   --with-dpms-ext         Include support for the DPMS extension.
   --with-xinerama-ext     Include support for the XINERAMA extension.
+  --with-xinput-ext       Include support for the XInput extension.
   --with-xf86vmode-ext    Include support for XFree86 virtual screens.
   --with-xf86gamma-ext    Include support for XFree86 gamma fading.
   --with-randr-ext        Include support for the X Resize+Rotate extension.
   --with-proc-interrupts  Include support for consulting the /proc/interrupts
                           file to notice keyboard activity.
   --with-pam              Include support for PAM (Pluggable Auth Modules.)
-  --with-pam-service-name=NAME
-                          NAME is the name of the PAM service that
+  --with-pam-service-name NAME arg is the name of the PAM service that
                           xscreensaver will authenticate as.
   --with-kerberos         Include support for Kerberos authentication.
   --with-shadow           Include support for shadow password authentication.
   --with-passwd-helper    Include support for an external password
                           verification helper program.
   --with-login-manager    Put a "New Login" button on the unlock dialog that
-                          runs a login manager such as gdmflexiserver.
+                          runs a login manager like gdmflexiserver or kdmctl.
 
 User interface options:
 
   --with-gtk              Use the Gtk toolkit for the user interface.
   --with-motif            Use the Motif toolkit for the user interface
-                          (not recommended.)
+                          (no longer supported.)
 
 Graphics options:
 
   --with-gl               Build those demos which depend on OpenGL.
   --with-gle              Build those demos which depend on GLE
                           (the OpenGL "extrusion" library.)
+  --with-gles             Target OpenGL ES 1.x API instead of OpenGL 1.3.
   --with-pixbuf           Include support for the GDK-Pixbuf library in some
                           demos, which will make it possible for them to read
                           GIF, JPEG, and PNG files as well.
@@ -1554,10 +1547,10 @@ Graphics options:
   --with-xshm-ext         Include support for the Shared Memory extension.
   --with-xdbe-ext         Include support for the DOUBLE-BUFFER extension.
   --with-readdisplay      Include support for the XReadDisplay extension.
-  --with-image-directory=DIR  By default, some demos may display random images
-                          from this directory.
+  --with-image-directory  Arg is the default directory from which some demos
+                          will choose random images to display.
   --with-text-file=FILE   By default, some demos may display this file.
-  --with-browser=BROWSER   Specify the browser to show help URL.
+  --with-browser=BROWSER  Specify the web browser used to show the help URL.
   --with-setuid-hacks     Allow some demos to be installed `setuid root'
                           (which is needed in order to ping other hosts.)
 
@@ -2033,6 +2026,36 @@ echo "command line was: $0 $@"
 
 
 
+# This only ever existed in X11R4 and X11R5.
+#AH_TEMPLATE([HAVE_XIDLE_EXTENSION],
+#          [Define this if you have the XIDLE extension installed. If you
+#          have the XIDLE extension, this is recommended.  (You have this
+#          extension if the file /usr/include/X11/extensions/xidle.h
+#          exists.) Turning on this flag lets XScreenSaver work better with
+#          servers which support this extension; but it will still work
+#          with servers which do not suport it, so it's a good idea to
+#          compile in support for it if you can.])
+
+# Using this extension will crash your X server and make fading not work.
+#AH_TEMPLATE([HAVE_MIT_SAVER_EXTENSION],
+#          [Define this if you have the MIT-SCREEN-SAVER extension
+#            installed.  See the caveats about this extension, above.
+#            (It's available if /usr/include/X11/extensions/scrnsaver.h
+#            exists.)])
+
+# This only ever existed on SGI hardware.
+#AH_TEMPLATE([HAVE_SGI_SAVER_EXTENSION],
+#          [Define this if you have the SGI SCREEN_SAVER extension.  This is
+#          standard on Irix systems, and not available elsewhere.])
+
+# This only ever existed on SGI hardware.
+#AH_TEMPLATE([HAVE_SGI_VC_EXTENSION],
+#          [Define this if you have the SGI-VIDEO-CONTROL extension.  This
+#          is standard on Irix systems, and not available elsewhere.])
+
+
+
+
 
 
 
@@ -2357,6 +2380,7 @@ fi
 
 
 
+
 ###############################################################################
 #
 #       Some utility functions to make checking for X things easier.
@@ -6223,6 +6247,68 @@ $as_echo "$ac_cv_have_icmphdr" >&6; }
 _ACEOF
 
  fi
+{ $as_echo "$as_me:$LINENO: checking for getifaddrs" >&5
+$as_echo_n "checking for getifaddrs... " >&6; }
+if test "${ac_cv_have_getifaddrs+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <stdlib.h>
+                   #include <unistd.h>
+                   #include <arpa/inet.h>
+                   #include <ifaddrs.h>
+int
+main ()
+{
+struct ifaddrs *ifa;
+                   getifaddrs (&ifa);
+                   ifa->ifa_next = 0;
+                   ifa->ifa_addr->sa_family = 0;
+  ;
+  return 0;
+}
+_ACEOF
+rm -rf conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -rf conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_have_getifaddrs=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_cv_have_getifaddrs=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_getifaddrs" >&5
+$as_echo "$ac_cv_have_getifaddrs" >&6; }
+ if test "$ac_cv_have_getifaddrs" = yes ; then
+   cat >>confdefs.h <<\_ACEOF
+#define HAVE_GETIFADDRS 1
+_ACEOF
+
+ fi
 
 
 for ac_header in crypt.h sys/select.h
@@ -10831,7 +10917,7 @@ fi
 ###############################################################################
 #
 #       Handle the --with-configdir option
-#       Help for --with-x-app-defaults option added..
+#       Help for --with-x-app-defaults option added.
 #
 ###############################################################################
 
 #
 ###############################################################################
 
-have_sgi=no
-with_sgi_req=unspecified
+#have_sgi=no
+#with_sgi_req=unspecified
+#AC_ARG_WITH(sgi-ext,
+#[Except where noted, all of the --with options below can also take a
+#directory argument: for example, `--with-motif=/opt/Motif'.  That would
+#cause /opt/Motif/include/ to be added to the -I list, and /opt/Motif/lib/
+#to be added to the -L list, assuming those directories exist.
+#
+#By default, support for each of these options will be built in, if the
+#relevant library routines exist.  At run time, they will then be used
+#only if the X server being used supports them.  Each --with option has
+#a corresponding --without option, to override building support for them
+#at all.
+#
+#Screen blanking and idle-detection options:
+#
+#  --with-sgi-ext          Include support for the SGI SCREEN_SAVER extension.],
+#  [with_sgi="$withval"; with_sgi_req="$withval"],[with_sgi=yes])
+#
+#HANDLE_X_PATH_ARG(with_sgi, --with-sgi-ext, SGI SCREEN_SAVER)
+#
+#if test "$with_sgi" = yes; then
+#  AC_CHECK_X_HEADER(X11/extensions/XScreenSaver.h,
+#                    [have_sgi=yes
+#                     AC_DEFINE(HAVE_SGI_SAVER_EXTENSION)],,
+#                    [#include <X11/Xlib.h>])
+#
+#elif test "$with_sgi" != no; then
+#  echo "error: must be yes or no: --with-sgi-ext=$with_sgi"
+#  exit 1
+#fi
+
+
+###############################################################################
+#
+#       Check for the XIDLE server extension.
+#
+###############################################################################
+
+#have_xidle=no
+#with_xidle_req=unspecified
+#AC_ARG_WITH(xidle-ext,
+#[  --with-xidle-ext        Include support for the XIDLE extension.],
+#  [with_xidle="$withval"; with_xidle_req="$withval"],[with_xidle=yes])
+#
+#HANDLE_X_PATH_ARG(with_xidle, --with-xidle-ext, XIDLE)
+#
+#if test "$with_xidle" = yes; then
+#  AC_CHECK_X_HEADER(X11/extensions/xidle.h,
+#                    [have_xidle=yes
+#                     AC_DEFINE(HAVE_XIDLE_EXTENSION)],,
+#                    [#include <X11/Xlib.h>])
+#elif test "$with_xidle" != no; then
+#  echo "error: must be yes or no: --with-xidle-ext=$with_xidle"
+#  exit 1
+#fi
+
+
+###############################################################################
+#
+#       Check for the SGI-VIDEO-CONTROL server extension.
+#
+###############################################################################
+
+#have_sgivc=no
+#with_sgivc_req=unspecified
+#AC_ARG_WITH(sgivc-ext,
+#[  --with-sgivc-ext        Include support for the SGI-VIDEO-CONTROL extension.],
+#  [with_sgivc="$withval"; with_sgivc_req="$withval"],[with_sgivc=yes])
+#
+#HANDLE_X_PATH_ARG(with_sgivc, --with-sgivc-ext, SGI-VIDEO-CONTROL)
+#
+#if test "$with_sgivc" = yes; then
+#
+#  # first check for XSGIvc.h
+#  AC_CHECK_X_HEADER(X11/extensions/XSGIvc.h, [have_sgivc=yes],,
+#                    [#include <X11/Xlib.h>])
+#
+#  # if that succeeded, then check for the -lXsgivc
+#  if test "$have_sgivc" = yes; then
+#    have_sgivc=no
+#    AC_CHECK_X_LIB(Xsgivc, XSGIvcQueryGammaMap,
+#                  [have_sgivc=yes; SAVER_LIBS="$SAVER_LIBS -lXsgivc"], [true],
+#                  -lXext -lX11)
+#  fi
+#
+#  # if that succeeded, then we've really got it.
+#  if test "$have_sgivc" = yes; then
+#    AC_DEFINE(HAVE_SGI_VC_EXTENSION)
+#  fi
+#
+#elif test "$with_sgivc" != no; then
+#  echo "error: must be yes or no: --with-sgivc-ext=$with_sgivc"
+#  exit 1
+#fi
+
+
+###############################################################################
+#
+#       Check for the DPMS server extension.
+#
+###############################################################################
+
+have_dpms=no
+with_dpms_req=unspecified
 
-# Check whether --with-sgi-ext was given.
-if test "${with_sgi_ext+set}" = set; then
-  withval=$with_sgi_ext; with_sgi="$withval"; with_sgi_req="$withval"
+# Check whether --with-dpms-ext was given.
+if test "${with_dpms_ext+set}" = set; then
+  withval=$with_dpms_ext; with_dpms="$withval"; with_dpms_req="$withval"
 else
-  with_sgi=yes
+  with_dpms=yes
 fi
 
 
 
-   case "$with_sgi" in
+   case "$with_dpms" in
     yes) ;;
     no)  ;;
 
     /*)
-     { $as_echo "$as_me:$LINENO: checking for SGI SCREEN_SAVER headers" >&5
-$as_echo_n "checking for SGI SCREEN_SAVER headers... " >&6; }
-     d=$with_sgi/include
+     { $as_echo "$as_me:$LINENO: checking for DPMS headers" >&5
+$as_echo_n "checking for DPMS headers... " >&6; }
+     d=$with_dpms/include
      if test -d $d; then
        X_CFLAGS="-I$d $X_CFLAGS"
        { $as_echo "$as_me:$LINENO: result: $d" >&5
@@ -10900,9 +11089,9 @@ $as_echo "$d" >&6; }
 $as_echo "not found ($d: no such directory)" >&6; }
      fi
 
-     { $as_echo "$as_me:$LINENO: checking for SGI SCREEN_SAVER libs" >&5
-$as_echo_n "checking for SGI SCREEN_SAVER libs... " >&6; }
-     d=$with_sgi/lib
+     { $as_echo "$as_me:$LINENO: checking for DPMS libs" >&5
+$as_echo_n "checking for DPMS libs... " >&6; }
+     d=$with_dpms/lib
      if test -d $d; then
        X_LIBS="-L$d $X_LIBS"
        { $as_echo "$as_me:$LINENO: result: $d" >&5
@@ -10913,13 +11102,13 @@ $as_echo "not found ($d: no such directory)" >&6; }
      fi
 
      # replace the directory string with "yes".
-     with_sgi_req="yes"
-     with_sgi=$with_sgi_req
+     with_dpms_req="yes"
+     with_dpms=$with_dpms_req
      ;;
 
     *)
      echo ""
-     echo "error: argument to --with-sgi-ext must be \"yes\", \"no\", or a directory."
+     echo "error: argument to --with-dpms-ext 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
@@ -10927,7 +11116,9 @@ $as_echo "not found ($d: no such directory)" >&6; }
    esac
 
 
-if test "$with_sgi" = yes; then
+if test "$with_dpms" = yes; then
+
+  # first check for dpms.h
 
   ac_save_CPPFLAGS="$CPPFLAGS"
   if test \! -z "$includedir" ; then
@@ -10935,9 +11126,9 @@ if test "$with_sgi" = yes; then
   fi
   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
   CPPFLAGS=`eval eval eval eval eval eval eval eval eval echo $CPPFLAGS`
-  { $as_echo "$as_me:$LINENO: checking for X11/extensions/XScreenSaver.h" >&5
-$as_echo_n "checking for X11/extensions/XScreenSaver.h... " >&6; }
-if test "${ac_cv_header_X11_extensions_XScreenSaver_h+set}" = set; then
+  { $as_echo "$as_me:$LINENO: checking for X11/extensions/dpms.h" >&5
+$as_echo_n "checking for X11/extensions/dpms.h... " >&6; }
+if test "${ac_cv_header_X11_extensions_dpms_h+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -10947,8 +11138,9 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 #include <X11/Xlib.h>
+                    #include <X11/Xmd.h>
 
-#include <X11/extensions/XScreenSaver.h>
+#include <X11/extensions/dpms.h>
 _ACEOF
 rm -rf conftest.$ac_objext
 if { (ac_try="$ac_compile"
@@ -10968,129 +11160,87 @@ $as_echo "$ac_try_echo") >&5
         test -z "$ac_c_werror_flag" ||
         test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
-  ac_cv_header_X11_extensions_XScreenSaver_h=yes
+  ac_cv_header_X11_extensions_dpms_h=yes
 else
   $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-       ac_cv_header_X11_extensions_XScreenSaver_h=no
+       ac_cv_header_X11_extensions_dpms_h=no
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_X11_extensions_XScreenSaver_h" >&5
-$as_echo "$ac_cv_header_X11_extensions_XScreenSaver_h" >&6; }
-if test "x$ac_cv_header_X11_extensions_XScreenSaver_h" = x""yes; then
-  have_sgi=yes
-                     cat >>confdefs.h <<\_ACEOF
-#define HAVE_SGI_SAVER_EXTENSION 1
-_ACEOF
-
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_X11_extensions_dpms_h" >&5
+$as_echo "$ac_cv_header_X11_extensions_dpms_h" >&6; }
+if test "x$ac_cv_header_X11_extensions_dpms_h" = x""yes; then
+  have_dpms=yes
 fi
 
 
   CPPFLAGS="$ac_save_CPPFLAGS"
 
-elif test "$with_sgi" != no; then
-  echo "error: must be yes or no: --with-sgi-ext=$with_sgi"
-  exit 1
-fi
-
-
-###############################################################################
-#
-#       Check for the XIDLE server extension.
-#
-###############################################################################
-
-have_xidle=no
-with_xidle_req=unspecified
-
-# Check whether --with-xidle-ext was given.
-if test "${with_xidle_ext+set}" = set; then
-  withval=$with_xidle_ext; with_xidle="$withval"; with_xidle_req="$withval"
-else
-  with_xidle=yes
-fi
-
-
-
-   case "$with_xidle" in
-    yes) ;;
-    no)  ;;
-
-    /*)
-     { $as_echo "$as_me:$LINENO: checking for XIDLE headers" >&5
-$as_echo_n "checking for XIDLE headers... " >&6; }
-     d=$with_xidle/include
-     if test -d $d; then
-       X_CFLAGS="-I$d $X_CFLAGS"
-       { $as_echo "$as_me:$LINENO: result: $d" >&5
-$as_echo "$d" >&6; }
-     else
-       { $as_echo "$as_me:$LINENO: result: not found ($d: no such directory)" >&5
-$as_echo "not found ($d: no such directory)" >&6; }
-     fi
-
-     { $as_echo "$as_me:$LINENO: checking for XIDLE libs" >&5
-$as_echo_n "checking for XIDLE libs... " >&6; }
-     d=$with_xidle/lib
-     if test -d $d; then
-       X_LIBS="-L$d $X_LIBS"
-       { $as_echo "$as_me:$LINENO: result: $d" >&5
-$as_echo "$d" >&6; }
-     else
-       { $as_echo "$as_me:$LINENO: result: not found ($d: no such directory)" >&5
-$as_echo "not found ($d: no such directory)" >&6; }
-     fi
-
-     # replace the directory string with "yes".
-     with_xidle_req="yes"
-     with_xidle=$with_xidle_req
-     ;;
-
-    *)
-     echo ""
-     echo "error: argument to --with-xidle-ext 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
-
+  # if that succeeded, then check for the DPMS code in the libraries
+  if test "$have_dpms" = yes; then
 
-if test "$with_xidle" = yes; then
+    # first look in -lXext (this is where it is with XFree86 4.0)
+    have_dpms=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"
+
   CPPFLAGS=`eval eval eval eval eval eval eval eval eval echo $CPPFLAGS`
-  { $as_echo "$as_me:$LINENO: checking for X11/extensions/xidle.h" >&5
-$as_echo_n "checking for X11/extensions/xidle.h... " >&6; }
-if test "${ac_cv_header_X11_extensions_xidle_h+set}" = set; then
+  LDFLAGS=`eval eval eval eval eval eval eval eval eval echo $LDFLAGS`
+  { $as_echo "$as_me:$LINENO: checking for DPMSInfo in -lXext" >&5
+$as_echo_n "checking for DPMSInfo in -lXext... " >&6; }
+if test "${ac_cv_lib_Xext_DPMSInfo+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
-  cat >conftest.$ac_ext <<_ACEOF
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lXext -lXext -lX11 $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include <X11/Xlib.h>
 
-#include <X11/extensions/xidle.h>
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char DPMSInfo ();
+int
+main ()
+{
+return DPMSInfo ();
+  ;
+  return 0;
+}
 _ACEOF
-rm -rf conftest.$ac_objext
-if { (ac_try="$ac_compile"
+rm -rf conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
 case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
 $as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -rf conftest.er1
@@ -11099,162 +11249,38 @@ $as_echo "$ac_try_echo") >&5
   (exit $ac_status); } && {
         test -z "$ac_c_werror_flag" ||
         test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_cv_header_X11_extensions_xidle_h=yes
+       } && test -s conftest$ac_exeext && {
+        test "$cross_compiling" = yes ||
+        $as_test_x conftest$ac_exeext
+       }; then
+  ac_cv_lib_Xext_DPMSInfo=yes
 else
   $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-       ac_cv_header_X11_extensions_xidle_h=no
+       ac_cv_lib_Xext_DPMSInfo=no
 fi
 
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_X11_extensions_xidle_h" >&5
-$as_echo "$ac_cv_header_X11_extensions_xidle_h" >&6; }
-if test "x$ac_cv_header_X11_extensions_xidle_h" = x""yes; then
-  have_xidle=yes
-                     cat >>confdefs.h <<\_ACEOF
-#define HAVE_XIDLE_EXTENSION 1
-_ACEOF
-
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_Xext_DPMSInfo" >&5
+$as_echo "$ac_cv_lib_Xext_DPMSInfo" >&6; }
+if test "x$ac_cv_lib_Xext_DPMSInfo" = x""yes; then
+  have_dpms=yes
+else
+  true
 fi
 
-
   CPPFLAGS="$ac_save_CPPFLAGS"
-elif test "$with_xidle" != no; then
-  echo "error: must be yes or no: --with-xidle-ext=$with_xidle"
-  exit 1
-fi
+  LDFLAGS="$ac_save_LDFLAGS"
+#  LIBS="$ac_save_LIBS"
 
 
-###############################################################################
-#
-#       Check for the SGI-VIDEO-CONTROL server extension.
-#
-###############################################################################
-
-have_sgivc=no
-with_sgivc_req=unspecified
-
-# Check whether --with-sgivc-ext was given.
-if test "${with_sgivc_ext+set}" = set; then
-  withval=$with_sgivc_ext; with_sgivc="$withval"; with_sgivc_req="$withval"
-else
-  with_sgivc=yes
-fi
-
-
-
-   case "$with_sgivc" in
-    yes) ;;
-    no)  ;;
-
-    /*)
-     { $as_echo "$as_me:$LINENO: checking for SGI-VIDEO-CONTROL headers" >&5
-$as_echo_n "checking for SGI-VIDEO-CONTROL headers... " >&6; }
-     d=$with_sgivc/include
-     if test -d $d; then
-       X_CFLAGS="-I$d $X_CFLAGS"
-       { $as_echo "$as_me:$LINENO: result: $d" >&5
-$as_echo "$d" >&6; }
-     else
-       { $as_echo "$as_me:$LINENO: result: not found ($d: no such directory)" >&5
-$as_echo "not found ($d: no such directory)" >&6; }
-     fi
-
-     { $as_echo "$as_me:$LINENO: checking for SGI-VIDEO-CONTROL libs" >&5
-$as_echo_n "checking for SGI-VIDEO-CONTROL libs... " >&6; }
-     d=$with_sgivc/lib
-     if test -d $d; then
-       X_LIBS="-L$d $X_LIBS"
-       { $as_echo "$as_me:$LINENO: result: $d" >&5
-$as_echo "$d" >&6; }
-     else
-       { $as_echo "$as_me:$LINENO: result: not found ($d: no such directory)" >&5
-$as_echo "not found ($d: no such directory)" >&6; }
-     fi
-
-     # replace the directory string with "yes".
-     with_sgivc_req="yes"
-     with_sgivc=$with_sgivc_req
-     ;;
-
-    *)
-     echo ""
-     echo "error: argument to --with-sgivc-ext 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
-
-
-if test "$with_sgivc" = yes; then
-
-  # first check for XSGIvc.h
-
-  ac_save_CPPFLAGS="$CPPFLAGS"
-  if test \! -z "$includedir" ; then
-    CPPFLAGS="$CPPFLAGS -I$includedir"
-  fi
-  CPPFLAGS="$CPPFLAGS $X_CFLAGS"
-  CPPFLAGS=`eval eval eval eval eval eval eval eval eval echo $CPPFLAGS`
-  { $as_echo "$as_me:$LINENO: checking for X11/extensions/XSGIvc.h" >&5
-$as_echo_n "checking for X11/extensions/XSGIvc.h... " >&6; }
-if test "${ac_cv_header_X11_extensions_XSGIvc_h+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <X11/Xlib.h>
-
-#include <X11/extensions/XSGIvc.h>
-_ACEOF
-rm -rf conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -rf conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_cv_header_X11_extensions_XSGIvc_h=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-       ac_cv_header_X11_extensions_XSGIvc_h=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_X11_extensions_XSGIvc_h" >&5
-$as_echo "$ac_cv_header_X11_extensions_XSGIvc_h" >&6; }
-if test "x$ac_cv_header_X11_extensions_XSGIvc_h" = x""yes; then
-  have_sgivc=yes
-fi
-
-
-  CPPFLAGS="$ac_save_CPPFLAGS"
-
-  # if that succeeded, then check for the -lXsgivc
-  if test "$have_sgivc" = yes; then
-    have_sgivc=no
+    # if that failed, look in -lXdpms (this is where it was in XFree86 3.x)
+    if test "$have_dpms" = no; then
 
   ac_save_CPPFLAGS="$CPPFLAGS"
   ac_save_LDFLAGS="$LDFLAGS"
 
   CPPFLAGS=`eval eval eval eval eval eval eval eval eval echo $CPPFLAGS`
   LDFLAGS=`eval eval eval eval eval eval eval eval eval echo $LDFLAGS`
-  { $as_echo "$as_me:$LINENO: checking for XSGIvcQueryGammaMap in -lXsgivc" >&5
-$as_echo_n "checking for XSGIvcQueryGammaMap in -lXsgivc... " >&6; }
-if test "${ac_cv_lib_Xsgivc_XSGIvcQueryGammaMap+set}" = set; then
+  { $as_echo "$as_me:$LINENO: checking for DPMSInfo in -lXdpms" >&5
+$as_echo_n "checking for DPMSInfo in -lXdpms... " >&6; }
+if test "${ac_cv_lib_Xdpms_DPMSInfo+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
-LIBS="-lXsgivc -lXext -lX11 $LIBS"
+LIBS="-lXdpms -lXext -lX11 $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -11294,11 +11320,11 @@ cat >>conftest.$ac_ext <<_ACEOF
 #ifdef __cplusplus
 extern "C"
 #endif
-char XSGIvcQueryGammaMap ();
+char DPMSInfo ();
 int
 main ()
 {
-return XSGIvcQueryGammaMap ();
+return DPMSInfo ();
   ;
   return 0;
 }
@@ -11324,12 +11350,12 @@ $as_echo "$ac_try_echo") >&5
         test "$cross_compiling" = yes ||
         $as_test_x conftest$ac_exeext
        }; then
-  ac_cv_lib_Xsgivc_XSGIvcQueryGammaMap=yes
+  ac_cv_lib_Xdpms_DPMSInfo=yes
 else
   $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-       ac_cv_lib_Xsgivc_XSGIvcQueryGammaMap=no
+       ac_cv_lib_Xdpms_DPMSInfo=no
 fi
 
 rm -rf conftest.dSYM
@@ -11337,10 +11363,10 @@ rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_Xsgivc_XSGIvcQueryGammaMap" >&5
-$as_echo "$ac_cv_lib_Xsgivc_XSGIvcQueryGammaMap" >&6; }
-if test "x$ac_cv_lib_Xsgivc_XSGIvcQueryGammaMap" = x""yes; then
-  have_sgivc=yes; SAVER_LIBS="$SAVER_LIBS -lXsgivc"
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_Xdpms_DPMSInfo" >&5
+$as_echo "$ac_cv_lib_Xdpms_DPMSInfo" >&6; }
+if test "x$ac_cv_lib_Xdpms_DPMSInfo" = x""yes; then
+  have_dpms=yes; XDPMS_LIBS="-lXdpms"
 else
   true
 fi
   LDFLAGS="$ac_save_LDFLAGS"
 #  LIBS="$ac_save_LIBS"
 
+    fi
   fi
 
+
   # if that succeeded, then we've really got it.
-  if test "$have_sgivc" = yes; then
+  if test "$have_dpms" = yes; then
     cat >>confdefs.h <<\_ACEOF
-#define HAVE_SGI_VC_EXTENSION 1
+#define HAVE_DPMS_EXTENSION 1
 _ACEOF
 
   fi
 
-elif test "$with_sgivc" != no; then
-  echo "error: must be yes or no: --with-sgivc-ext=$with_sgivc"
+elif test "$with_dpms" != no; then
+  echo "error: must be yes or no: --with-dpms-ext=$with_dpms"
   exit 1
 fi
 
 
 ###############################################################################
 #
-#       Check for the DPMS server extension.
+#       Check for the XINERAMA server extension.
 #
 ###############################################################################
 
-have_dpms=no
-with_dpms_req=unspecified
+have_xinerama=no
+with_xinerama_req=unspecified
 
-# Check whether --with-dpms-ext was given.
-if test "${with_dpms_ext+set}" = set; then
-  withval=$with_dpms_ext; with_dpms="$withval"; with_dpms_req="$withval"
+# Check whether --with-xinerama-ext was given.
+if test "${with_xinerama_ext+set}" = set; then
+  withval=$with_xinerama_ext; with_xinerama="$withval"; with_xinerama_req="$withval"
 else
-  with_dpms=yes
+  with_xinerama=yes
 fi
 
 
 
-   case "$with_dpms" in
+   case "$with_xinerama" in
     yes) ;;
     no)  ;;
 
     /*)
-     { $as_echo "$as_me:$LINENO: checking for DPMS headers" >&5
-$as_echo_n "checking for DPMS headers... " >&6; }
-     d=$with_dpms/include
+     { $as_echo "$as_me:$LINENO: checking for XINERAMA headers" >&5
+$as_echo_n "checking for XINERAMA headers... " >&6; }
+     d=$with_xinerama/include
      if test -d $d; then
        X_CFLAGS="-I$d $X_CFLAGS"
        { $as_echo "$as_me:$LINENO: result: $d" >&5
@@ -11400,9 +11428,9 @@ $as_echo "$d" >&6; }
 $as_echo "not found ($d: no such directory)" >&6; }
      fi
 
-     { $as_echo "$as_me:$LINENO: checking for DPMS libs" >&5
-$as_echo_n "checking for DPMS libs... " >&6; }
-     d=$with_dpms/lib
+     { $as_echo "$as_me:$LINENO: checking for XINERAMA libs" >&5
+$as_echo_n "checking for XINERAMA libs... " >&6; }
+     d=$with_xinerama/lib
      if test -d $d; then
        X_LIBS="-L$d $X_LIBS"
        { $as_echo "$as_me:$LINENO: result: $d" >&5
@@ -11413,13 +11441,13 @@ $as_echo "not found ($d: no such directory)" >&6; }
      fi
 
      # replace the directory string with "yes".
-     with_dpms_req="yes"
-     with_dpms=$with_dpms_req
+     with_xinerama_req="yes"
+     with_xinerama=$with_xinerama_req
      ;;
 
     *)
      echo ""
-     echo "error: argument to --with-dpms-ext must be \"yes\", \"no\", or a directory."
+     echo "error: argument to --with-xinerama-ext 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
@@ -11427,9 +11455,9 @@ $as_echo "not found ($d: no such directory)" >&6; }
    esac
 
 
-if test "$with_dpms" = yes; then
+if test "$with_xinerama" = yes; then
 
-  # first check for dpms.h
+  # first check for Xinerama.h
 
   ac_save_CPPFLAGS="$CPPFLAGS"
   if test \! -z "$includedir" ; then
@@ -11437,9 +11465,9 @@ if test "$with_dpms" = yes; then
   fi
   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
   CPPFLAGS=`eval eval eval eval eval eval eval eval eval echo $CPPFLAGS`
-  { $as_echo "$as_me:$LINENO: checking for X11/extensions/dpms.h" >&5
-$as_echo_n "checking for X11/extensions/dpms.h... " >&6; }
-if test "${ac_cv_header_X11_extensions_dpms_h+set}" = set; then
+  { $as_echo "$as_me:$LINENO: checking for X11/extensions/Xinerama.h" >&5
+$as_echo_n "checking for X11/extensions/Xinerama.h... " >&6; }
+if test "${ac_cv_header_X11_extensions_Xinerama_h+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -11449,9 +11477,8 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 #include <X11/Xlib.h>
-                    #include <X11/Xmd.h>
 
-#include <X11/extensions/dpms.h>
+#include <X11/extensions/Xinerama.h>
 _ACEOF
 rm -rf conftest.$ac_objext
 if { (ac_try="$ac_compile"
@@ -11471,30 +11498,30 @@ $as_echo "$ac_try_echo") >&5
         test -z "$ac_c_werror_flag" ||
         test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
-  ac_cv_header_X11_extensions_dpms_h=yes
+  ac_cv_header_X11_extensions_Xinerama_h=yes
 else
   $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-       ac_cv_header_X11_extensions_dpms_h=no
+       ac_cv_header_X11_extensions_Xinerama_h=no
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_X11_extensions_dpms_h" >&5
-$as_echo "$ac_cv_header_X11_extensions_dpms_h" >&6; }
-if test "x$ac_cv_header_X11_extensions_dpms_h" = x""yes; then
-  have_dpms=yes
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_X11_extensions_Xinerama_h" >&5
+$as_echo "$ac_cv_header_X11_extensions_Xinerama_h" >&6; }
+if test "x$ac_cv_header_X11_extensions_Xinerama_h" = x""yes; then
+  have_xinerama=yes
 fi
 
 
   CPPFLAGS="$ac_save_CPPFLAGS"
 
-  # if that succeeded, then check for the DPMS code in the libraries
-  if test "$have_dpms" = yes; then
+  # if that succeeded, then check for the XINERAMA code in the libraries
+  if test "$have_xinerama" = yes; then
 
-    # first look in -lXext (this is where it is with XFree86 4.0)
-    have_dpms=no
+    # first look in -lXext
+    have_xinerama=no
 
   ac_save_CPPFLAGS="$CPPFLAGS"
   ac_save_LDFLAGS="$LDFLAGS"
@@ -11514,9 +11541,9 @@ fi
 
   CPPFLAGS=`eval eval eval eval eval eval eval eval eval echo $CPPFLAGS`
   LDFLAGS=`eval eval eval eval eval eval eval eval eval echo $LDFLAGS`
-  { $as_echo "$as_me:$LINENO: checking for DPMSInfo in -lXext" >&5
-$as_echo_n "checking for DPMSInfo in -lXext... " >&6; }
-if test "${ac_cv_lib_Xext_DPMSInfo+set}" = set; then
+  { $as_echo "$as_me:$LINENO: checking for XineramaQueryScreens in -lXext" >&5
+$as_echo_n "checking for XineramaQueryScreens in -lXext... " >&6; }
+if test "${ac_cv_lib_Xext_XineramaQueryScreens+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -11534,11 +11561,11 @@ cat >>conftest.$ac_ext <<_ACEOF
 #ifdef __cplusplus
 extern "C"
 #endif
-char DPMSInfo ();
+char XineramaQueryScreens ();
 int
 main ()
 {
-return DPMSInfo ();
+return XineramaQueryScreens ();
   ;
   return 0;
 }
@@ -11564,12 +11591,12 @@ $as_echo "$ac_try_echo") >&5
         test "$cross_compiling" = yes ||
         $as_test_x conftest$ac_exeext
        }; then
-  ac_cv_lib_Xext_DPMSInfo=yes
+  ac_cv_lib_Xext_XineramaQueryScreens=yes
 else
   $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-       ac_cv_lib_Xext_DPMSInfo=no
+       ac_cv_lib_Xext_XineramaQueryScreens=no
 fi
 
 rm -rf conftest.dSYM
@@ -11577,10 +11604,10 @@ rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_Xext_DPMSInfo" >&5
-$as_echo "$ac_cv_lib_Xext_DPMSInfo" >&6; }
-if test "x$ac_cv_lib_Xext_DPMSInfo" = x""yes; then
-  have_dpms=yes
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_Xext_XineramaQueryScreens" >&5
+$as_echo "$ac_cv_lib_Xext_XineramaQueryScreens" >&6; }
+if test "x$ac_cv_lib_Xext_XineramaQueryScreens" = x""yes; then
+  have_xinerama=yes
 else
   true
 fi
@@ -11590,8 +11617,8 @@ fi
 #  LIBS="$ac_save_LIBS"
 
 
-    # if that failed, look in -lXdpms (this is where it was in XFree86 3.x)
-    if test "$have_dpms" = no; then
+    # if that failed, look in -lXinerama (this is where it is in XFree86 4.1.)
+    if test "$have_xinerama" = no; then
 
   ac_save_CPPFLAGS="$CPPFLAGS"
   ac_save_LDFLAGS="$LDFLAGS"
 
   CPPFLAGS=`eval eval eval eval eval eval eval eval eval echo $CPPFLAGS`
   LDFLAGS=`eval eval eval eval eval eval eval eval eval echo $LDFLAGS`
-  { $as_echo "$as_me:$LINENO: checking for DPMSInfo in -lXdpms" >&5
-$as_echo_n "checking for DPMSInfo in -lXdpms... " >&6; }
-if test "${ac_cv_lib_Xdpms_DPMSInfo+set}" = set; then
+  { $as_echo "$as_me:$LINENO: checking for XineramaQueryScreens in -lXinerama" >&5
+$as_echo_n "checking for XineramaQueryScreens in -lXinerama... " >&6; }
+if test "${ac_cv_lib_Xinerama_XineramaQueryScreens+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
-LIBS="-lXdpms -lXext -lX11 $LIBS"
+LIBS="-lXinerama -lXext -lX11 $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -11631,11 +11658,11 @@ cat >>conftest.$ac_ext <<_ACEOF
 #ifdef __cplusplus
 extern "C"
 #endif
-char DPMSInfo ();
+char XineramaQueryScreens ();
 int
 main ()
 {
-return DPMSInfo ();
+return XineramaQueryScreens ();
   ;
   return 0;
 }
@@ -11661,12 +11688,12 @@ $as_echo "$ac_try_echo") >&5
         test "$cross_compiling" = yes ||
         $as_test_x conftest$ac_exeext
        }; then
-  ac_cv_lib_Xdpms_DPMSInfo=yes
+  ac_cv_lib_Xinerama_XineramaQueryScreens=yes
 else
   $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-       ac_cv_lib_Xdpms_DPMSInfo=no
+       ac_cv_lib_Xinerama_XineramaQueryScreens=no
 fi
 
 rm -rf conftest.dSYM
@@ -11674,10 +11701,10 @@ rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_Xdpms_DPMSInfo" >&5
-$as_echo "$ac_cv_lib_Xdpms_DPMSInfo" >&6; }
-if test "x$ac_cv_lib_Xdpms_DPMSInfo" = x""yes; then
-  have_dpms=yes; XDPMS_LIBS="-lXdpms"
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_Xinerama_XineramaQueryScreens" >&5
+$as_echo "$ac_cv_lib_Xinerama_XineramaQueryScreens" >&6; }
+if test "x$ac_cv_lib_Xinerama_XineramaQueryScreens" = x""yes; then
+  have_xinerama=yes; XINERAMA_LIBS="-lXinerama"
 else
   true
 fi
     fi
   fi
 
-
   # if that succeeded, then we've really got it.
-  if test "$have_dpms" = yes; then
+  if test "$have_xinerama" = yes; then
     cat >>confdefs.h <<\_ACEOF
-#define HAVE_DPMS_EXTENSION 1
+#define HAVE_XINERAMA 1
 _ACEOF
 
   fi
 
-elif test "$with_dpms" != no; then
-  echo "error: must be yes or no: --with-dpms-ext=$with_dpms"
+elif test "$with_xinerama" != no; then
+  echo "error: must be yes or no: --with-xinerama-ext=$with_xinerama"
   exit 1
 fi
 
 
 ###############################################################################
 #
-#       Check for the XINERAMA server extension.
+#       Check for the XINPUT server extension.
 #
 ###############################################################################
 
-have_xinerama=no
-with_xinerama_req=unspecified
+have_xinput=no
+with_xinput_req=unspecified
 
-# Check whether --with-xinerama-ext was given.
-if test "${with_xinerama_ext+set}" = set; then
-  withval=$with_xinerama_ext; with_xinerama="$withval"; with_xinerama_req="$withval"
+# Check whether --with-xinput-ext was given.
+if test "${with_xinput_ext+set}" = set; then
+  withval=$with_xinput_ext; with_xinput="$withval"; with_xinput_req="$withval"
 else
-  with_xinerama=yes
+  with_xinput=yes
 fi
 
 
 
-   case "$with_xinerama" in
+   case "$with_xinput" in
     yes) ;;
     no)  ;;
 
     /*)
-     { $as_echo "$as_me:$LINENO: checking for XINERAMA headers" >&5
-$as_echo_n "checking for XINERAMA headers... " >&6; }
-     d=$with_xinerama/include
+     { $as_echo "$as_me:$LINENO: checking for XINPUT headers" >&5
+$as_echo_n "checking for XINPUT headers... " >&6; }
+     d=$with_xinput/include
      if test -d $d; then
        X_CFLAGS="-I$d $X_CFLAGS"
        { $as_echo "$as_me:$LINENO: result: $d" >&5
@@ -11739,9 +11765,9 @@ $as_echo "$d" >&6; }
 $as_echo "not found ($d: no such directory)" >&6; }
      fi
 
-     { $as_echo "$as_me:$LINENO: checking for XINERAMA libs" >&5
-$as_echo_n "checking for XINERAMA libs... " >&6; }
-     d=$with_xinerama/lib
+     { $as_echo "$as_me:$LINENO: checking for XINPUT libs" >&5
+$as_echo_n "checking for XINPUT libs... " >&6; }
+     d=$with_xinput/lib
      if test -d $d; then
        X_LIBS="-L$d $X_LIBS"
        { $as_echo "$as_me:$LINENO: result: $d" >&5
@@ -11752,13 +11778,13 @@ $as_echo "not found ($d: no such directory)" >&6; }
      fi
 
      # replace the directory string with "yes".
-     with_xinerama_req="yes"
-     with_xinerama=$with_xinerama_req
+     with_xinput_req="yes"
+     with_xinput=$with_xinput_req
      ;;
 
     *)
      echo ""
-     echo "error: argument to --with-xinerama-ext must be \"yes\", \"no\", or a directory."
+     echo "error: argument to --with-xinput-ext 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
@@ -11766,130 +11792,40 @@ $as_echo "not found ($d: no such directory)" >&6; }
    esac
 
 
-if test "$with_xinerama" = yes; then
-
-  # first check for Xinerama.h
-
-  ac_save_CPPFLAGS="$CPPFLAGS"
-  if test \! -z "$includedir" ; then
-    CPPFLAGS="$CPPFLAGS -I$includedir"
-  fi
-  CPPFLAGS="$CPPFLAGS $X_CFLAGS"
-  CPPFLAGS=`eval eval eval eval eval eval eval eval eval echo $CPPFLAGS`
-  { $as_echo "$as_me:$LINENO: checking for X11/extensions/Xinerama.h" >&5
-$as_echo_n "checking for X11/extensions/Xinerama.h... " >&6; }
-if test "${ac_cv_header_X11_extensions_Xinerama_h+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <X11/Xlib.h>
-
-#include <X11/extensions/Xinerama.h>
-_ACEOF
-rm -rf conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -rf conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_cv_header_X11_extensions_Xinerama_h=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-       ac_cv_header_X11_extensions_Xinerama_h=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_X11_extensions_Xinerama_h" >&5
-$as_echo "$ac_cv_header_X11_extensions_Xinerama_h" >&6; }
-if test "x$ac_cv_header_X11_extensions_Xinerama_h" = x""yes; then
-  have_xinerama=yes
-fi
-
-
-  CPPFLAGS="$ac_save_CPPFLAGS"
-
-  # if that succeeded, then check for the XINERAMA code in the libraries
-  if test "$have_xinerama" = yes; then
+if test "$with_xinput" = yes; then
 
-    # first look in -lXext
-    have_xinerama=no
+  # first check for Xinput.h
 
   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"
-
-  CPPFLAGS=`eval eval eval eval eval eval eval eval eval echo $CPPFLAGS`
-  LDFLAGS=`eval eval eval eval eval eval eval eval eval echo $LDFLAGS`
-  { $as_echo "$as_me:$LINENO: checking for XineramaQueryScreens in -lXext" >&5
-$as_echo_n "checking for XineramaQueryScreens in -lXext... " >&6; }
-if test "${ac_cv_lib_Xext_XineramaQueryScreens+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lXext -lXext -lX11 $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char XineramaQueryScreens ();
-int
-main ()
-{
-return XineramaQueryScreens ();
-  ;
-  return 0;
-}
+  fi
+  CPPFLAGS="$CPPFLAGS $X_CFLAGS"
+  CPPFLAGS=`eval eval eval eval eval eval eval eval eval echo $CPPFLAGS`
+  { $as_echo "$as_me:$LINENO: checking for X11/extensions/XInput.h" >&5
+$as_echo_n "checking for X11/extensions/XInput.h... " >&6; }
+if test "${ac_cv_header_X11_extensions_XInput_h+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
 _ACEOF
-rm -rf conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <X11/Xlib.h>
+
+#include <X11/extensions/XInput.h>
+_ACEOF
+rm -rf conftest.$ac_objext
+if { (ac_try="$ac_compile"
 case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
 $as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -rf conftest.er1
@@ -11898,38 +11834,29 @@ $as_echo "$ac_try_echo") >&5
   (exit $ac_status); } && {
         test -z "$ac_c_werror_flag" ||
         test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-        test "$cross_compiling" = yes ||
-        $as_test_x conftest$ac_exeext
-       }; then
-  ac_cv_lib_Xext_XineramaQueryScreens=yes
+       } && test -s conftest.$ac_objext; then
+  ac_cv_header_X11_extensions_XInput_h=yes
 else
   $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-       ac_cv_lib_Xext_XineramaQueryScreens=no
+       ac_cv_header_X11_extensions_XInput_h=no
 fi
 
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_Xext_XineramaQueryScreens" >&5
-$as_echo "$ac_cv_lib_Xext_XineramaQueryScreens" >&6; }
-if test "x$ac_cv_lib_Xext_XineramaQueryScreens" = x""yes; then
-  have_xinerama=yes
-else
-  true
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_X11_extensions_XInput_h" >&5
+$as_echo "$ac_cv_header_X11_extensions_XInput_h" >&6; }
+if test "x$ac_cv_header_X11_extensions_XInput_h" = x""yes; then
+  have_xinput=yes
 fi
 
-  CPPFLAGS="$ac_save_CPPFLAGS"
-  LDFLAGS="$ac_save_LDFLAGS"
-#  LIBS="$ac_save_LIBS"
 
+  CPPFLAGS="$ac_save_CPPFLAGS"
 
-    # if that failed, look in -lXinerama (this is where it is in XFree86 4.1.)
-    if test "$have_xinerama" = no; then
+  # if that succeeded, then check for libXi
+  if test "$have_xinput" = yes; then
+    have_xinput=no
 
   ac_save_CPPFLAGS="$CPPFLAGS"
   ac_save_LDFLAGS="$LDFLAGS"
 
   CPPFLAGS=`eval eval eval eval eval eval eval eval eval echo $CPPFLAGS`
   LDFLAGS=`eval eval eval eval eval eval eval eval eval echo $LDFLAGS`
-  { $as_echo "$as_me:$LINENO: checking for XineramaQueryScreens in -lXinerama" >&5
-$as_echo_n "checking for XineramaQueryScreens in -lXinerama... " >&6; }
-if test "${ac_cv_lib_Xinerama_XineramaQueryScreens+set}" = set; then
+  { $as_echo "$as_me:$LINENO: checking for XListInputDevices in -lXi" >&5
+$as_echo_n "checking for XListInputDevices in -lXi... " >&6; }
+if test "${ac_cv_lib_Xi_XListInputDevices+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
-LIBS="-lXinerama -lXext -lX11 $LIBS"
+LIBS="-lXi -lXext -lX11 $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -11969,11 +11896,11 @@ cat >>conftest.$ac_ext <<_ACEOF
 #ifdef __cplusplus
 extern "C"
 #endif
-char XineramaQueryScreens ();
+char XListInputDevices ();
 int
 main ()
 {
-return XineramaQueryScreens ();
+return XListInputDevices ();
   ;
   return 0;
 }
@@ -11999,12 +11926,12 @@ $as_echo "$ac_try_echo") >&5
         test "$cross_compiling" = yes ||
         $as_test_x conftest$ac_exeext
        }; then
-  ac_cv_lib_Xinerama_XineramaQueryScreens=yes
+  ac_cv_lib_Xi_XListInputDevices=yes
 else
   $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-       ac_cv_lib_Xinerama_XineramaQueryScreens=no
+       ac_cv_lib_Xi_XListInputDevices=no
 fi
 
 rm -rf conftest.dSYM
@@ -12012,10 +11939,10 @@ rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_Xinerama_XineramaQueryScreens" >&5
-$as_echo "$ac_cv_lib_Xinerama_XineramaQueryScreens" >&6; }
-if test "x$ac_cv_lib_Xinerama_XineramaQueryScreens" = x""yes; then
-  have_xinerama=yes; XINERAMA_LIBS="-lXinerama"
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_Xi_XListInputDevices" >&5
+$as_echo "$ac_cv_lib_Xi_XListInputDevices" >&6; }
+if test "x$ac_cv_lib_Xi_XListInputDevices" = x""yes; then
+  have_xinput=yes; SAVER_LIBS="$SAVER_LIBS -lXi"
 else
   true
 fi
   LDFLAGS="$ac_save_LDFLAGS"
 #  LIBS="$ac_save_LIBS"
 
-    fi
   fi
 
   # if that succeeded, then we've really got it.
-  if test "$have_xinerama" = yes; then
+  if test "$have_xinput" = yes; then
     cat >>confdefs.h <<\_ACEOF
-#define HAVE_XINERAMA 1
+#define HAVE_XINPUT 1
 _ACEOF
 
   fi
 
-elif test "$with_xinerama" != no; then
-  echo "error: must be yes or no: --with-xinerama-ext=$with_xinerama"
+elif test "$with_xinput" != no; then
+  echo "error: must be yes or no: --with-xinput-ext=$with_xinput"
   exit 1
 fi
 
@@ -13452,6 +13378,24 @@ else
 fi
 
 
+# Check whether --enable-pam-check-account-type was given.
+if test "${enable_pam_check_account_type+set}" = set; then
+  enableval=$enable_pam_check_account_type; enable_pam_check_account_type="$enableval"
+else
+  enable_pam_check_account_type=no
+fi
+
+if test "$enable_pam_check_account_type" = yes ; then
+  cat >>confdefs.h <<\_ACEOF
+#define PAM_CHECK_ACCOUNT_TYPE 1
+_ACEOF
+
+  true
+elif test "$enable_pam_check_account_type" != no ; then
+  echo "error: must be yes or no: --enable-pam-check-account-type=$enable_pam_check_account_type"
+  exit 1
+fi
+
 
    case "$with_pam" in
     yes) ;;
@@ -15606,16 +15550,16 @@ esac
 #
 ###############################################################################
 
-have_login_manager=no
 with_login_manager_req=unspecified
-default_login_manager='gdmflexiserver -ls'
+default_login_manager_1='gdmflexiserver -ls'
+default_login_manager_2='kdmctl reserve'
 
 
 # Check whether --with-login-manager was given.
 if test "${with_login_manager+set}" = set; then
   withval=$with_login_manager; with_login_manager="$withval"; with_login_manager_req="$withval"
 else
-  with_login_manager=no
+  with_login_manager=yes
 fi
 
 # no HANDLE_X_PATH_ARG for this one
@@ -15625,36 +15569,61 @@ if test "$enable_locking" = no ; then
   with_login_manager=no
 fi
 
-if test -n "$with_login_manager_req" ; then
-  ac_cv_login_manager_program=""
+case "$with_login_manager_req" in
+  no)
+    with_login_manager=""
+  ;;
 
- if test "$with_login_manager_req" = "yes" ; then
-   with_login_manager_req=$default_login_manager
- fi
+  yes|unspecified)
+    # Try both defaults, use the one that exists.
 
-  case "$with_login_manager_req" in
-    no)
-      with_login_manager=""
-    ;;
-    /*)
-      # absolute path
-      set dummy $with_login_manager_req ; login_manager_tmp=$2
-      { $as_echo "$as_me:$LINENO: checking for $login_manager_tmp" >&5
-$as_echo_n "checking for $login_manager_tmp... " >&6; }
-      if test -x "$login_manager_tmp" ; then
-        { $as_echo "$as_me:$LINENO: result: yes" >&5
-$as_echo "yes" >&6; }
-      else
-        { $as_echo "$as_me:$LINENO: result: no" >&5
+    set dummy $default_login_manager_1 ; login_manager_tmp=$2
+    unset ac_cv_path_login_manager_tmp  # don't cache
+    # Extract the first word of "$login_manager_tmp", so it can be a program name with args.
+set dummy $login_manager_tmp; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_login_manager_tmp+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  case $login_manager_tmp in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_login_manager_tmp="$login_manager_tmp" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_login_manager_tmp="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+login_manager_tmp=$ac_cv_path_login_manager_tmp
+if test -n "$login_manager_tmp"; then
+  { $as_echo "$as_me:$LINENO: result: $login_manager_tmp" >&5
+$as_echo "$login_manager_tmp" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
 $as_echo "no" >&6; }
-        with_login_manager=""
-      fi
-    ;;
-    *)
-      # relative path
-      set dummy $with_login_manager_req ; login_manager_tmp=$2
-      # don't cache
-      unset ac_cv_path_login_manager_tmp
+fi
+
+
+    if test ! -z "$login_manager_tmp" ; then
+      with_login_manager="$default_login_manager_1"
+    else
+      set dummy $default_login_manager_2 ; login_manager_tmp=$2
+      unset ac_cv_path_login_manager_tmp  # don't cache
       # Extract the first word of "$login_manager_tmp", so it can be a program name with args.
 set dummy $login_manager_tmp; ac_word=$2
 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
@@ -15695,30 +15664,98 @@ $as_echo "no" >&6; }
 fi
 
 
-      if test -z "$login_manager_tmp" ; then
-        with_login_manager=""
+      if test -z "$login_manager_tmp" ; then
+        with_login_manager="$default_login_manager_2"
       else
-        with_login_manager="$login_manager_tmp"
+        with_login_manager=""
       fi
-    ;;
-  esac
-  ac_cv_login_manager_program="$with_login_manager"
+    fi
+  ;;
+
+  /*)
+    # absolute path specified on cmd line
+    set dummy $with_login_manager_req ; login_manager_tmp=$2
+    { $as_echo "$as_me:$LINENO: checking for $login_manager_tmp" >&5
+$as_echo_n "checking for $login_manager_tmp... " >&6; }
+    if test -x "$login_manager_tmp" ; then
+      { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+    else
+      { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+      with_login_manager=""
+    fi
+  ;;
+
+  *)
+    # relative path specified on cmd line
+    set dummy $with_login_manager_req ; login_manager_tmp=$2
+    unset ac_cv_path_login_manager_tmp    # don't cache
+    # Extract the first word of "$login_manager_tmp", so it can be a program name with args.
+set dummy $login_manager_tmp; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_login_manager_tmp+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  case $login_manager_tmp in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_login_manager_tmp="$login_manager_tmp" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_login_manager_tmp="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
 
-elif test -n "$ac_cv_login_manager_program"; then
-  { $as_echo "$as_me:$LINENO: result: checking for login_manager... (cached) $ac_cv_login_manager_program" >&5
-$as_echo "checking for login_manager... (cached) $ac_cv_login_manager_program" >&6; }
+  ;;
+esac
+fi
+login_manager_tmp=$ac_cv_path_login_manager_tmp
+if test -n "$login_manager_tmp"; then
+  { $as_echo "$as_me:$LINENO: result: $login_manager_tmp" >&5
+$as_echo "$login_manager_tmp" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
+
+    if test -z "$login_manager_tmp" ; then
+      with_login_manager=""
+    else
+      with_login_manager="$login_manager_tmp"
+    fi
+  ;;
+esac
+ac_cv_login_manager_program="$with_login_manager"
+
 NEW_LOGIN_COMMAND_P=''
 NEW_LOGIN_COMMAND="$ac_cv_login_manager_program"
 
+{ $as_echo "$as_me:$LINENO: checking for login manager" >&5
+$as_echo_n "checking for login manager... " >&6; }
 if test -z "$NEW_LOGIN_COMMAND" ; then
-  NEW_LOGIN_COMMAND="$default_login_manager"
+  NEW_LOGIN_COMMAND="$default_login_manager_1"
   NEW_LOGIN_COMMAND_P='! '
+  { $as_echo "$as_me:$LINENO: result: $NEW_LOGIN_COMMAND (disabled)" >&5
+$as_echo "$NEW_LOGIN_COMMAND (disabled)" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: $NEW_LOGIN_COMMAND" >&5
+$as_echo "$NEW_LOGIN_COMMAND" >&6; }
 fi
 
 
-
 ###############################################################################
 #
 #       Check for -lgtk (and Gnome stuff)
@@ -17115,6 +17152,16 @@ $as_echo "adding \"$osx_crud\" to GL_LIBS" >&6; }
 $as_echo "adding \"$osx_crud\" to GL_LIBS" >&6; }
       GL_LIBS="$GL_LIBS $osx_crud"
       unset osx_crud
+
+      # New lossage in 10.6.8: we can't allow -L/opt/local/lib to be in the
+      # link line, or at runtime XQueryExtension gets a segv due to some kind
+      # of library version skew.  Libs must come from /usr/X11/lib even if
+      # $prefix and/or $exec_prefix are set to /opt/local/.
+      #
+      { $as_echo "$as_me:$LINENO: result: omitting \"$libdir\" from LDFLAGS" >&5
+$as_echo "omitting \"$libdir\" from LDFLAGS" >&6; }
+      libdir=''
+
     fi
 
 
@@ -17428,7 +17475,7 @@ if test "${ac_cv_mesagl_version_string+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 17435 "configure"
+#line 17482 "configure"
 #include "confdefs.h"
 #include <GL/gl.h>
 #ifndef MESA_MAJOR_VERSION
@@ -18197,6 +18244,96 @@ elif test "$with_gle" != no; then
 fi
 
 
+###############################################################################
+#
+#       Handle --with-gles
+#
+###############################################################################
+
+with_gles_req=unspecified
+
+# Check whether --with-gles was given.
+if test "${with_gles+set}" = set; then
+  withval=$with_gles; with_gles="$withval"; with_gles_req="$withval"
+else
+  with_gles=no
+fi
+
+
+
+   case "$with_gles" in
+    yes) ;;
+    no)  ;;
+
+    /*)
+     { $as_echo "$as_me:$LINENO: checking for JWZGLES headers" >&5
+$as_echo_n "checking for JWZGLES headers... " >&6; }
+     d=$with_gles/include
+     if test -d $d; then
+       X_CFLAGS="-I$d $X_CFLAGS"
+       { $as_echo "$as_me:$LINENO: result: $d" >&5
+$as_echo "$d" >&6; }
+     else
+       { $as_echo "$as_me:$LINENO: result: not found ($d: no such directory)" >&5
+$as_echo "not found ($d: no such directory)" >&6; }
+     fi
+
+     { $as_echo "$as_me:$LINENO: checking for JWZGLES libs" >&5
+$as_echo_n "checking for JWZGLES libs... " >&6; }
+     d=$with_gles/lib
+     if test -d $d; then
+       X_LIBS="-L$d $X_LIBS"
+       { $as_echo "$as_me:$LINENO: result: $d" >&5
+$as_echo "$d" >&6; }
+     else
+       { $as_echo "$as_me:$LINENO: result: not found ($d: no such directory)" >&5
+$as_echo "not found ($d: no such directory)" >&6; }
+     fi
+
+     # replace the directory string with "yes".
+     with_gles_req="yes"
+     with_gles=$with_gles_req
+     ;;
+
+    *)
+     echo ""
+     echo "error: argument to --with-gles 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
+
+
+if test "$with_gles" = yes; then
+  have_gles=yes
+  cat >>confdefs.h <<\_ACEOF
+#define HAVE_JWZGLES 1
+_ACEOF
+
+  JWZGLES_OBJS="jwzgles.o"
+  { $as_echo "$as_me:$LINENO: result: using OpenGL ES compatiblity shim" >&5
+$as_echo "using OpenGL ES compatiblity shim" >&6; }
+elif test "$with_gles" != no; then
+  echo "error: must be yes or no: --with-gles=$with_xpm"
+  exit 1
+fi
+
+# May want to phase out glBitmap even in a non-GLES world.
+#
+if test "$have_gles" = yes; then
+  GLFPS_OBJS="fps-gl.o glxfonts.o texfont.o"
+  GLFONT_OBJS=""
+else
+  cat >>confdefs.h <<\_ACEOF
+#define HAVE_GLBITMAP 1
+_ACEOF
+
+  GLFPS_OBJS="fps-gl.o glxfonts.o"
+  GLFONT_OBJS="texfont.o"
+fi
+
+
 ###############################################################################
 #
 #       Check for -lgdk_pixbuf.
@@ -20815,11 +20952,14 @@ $as_echo "no" >&6; }
       "/usr/share/doc/xserver-common/copyright"           \
       "/usr/share/doc/xserver-xorg-core/copyright" \
       "/usr/X11R6/README"                         \
+      "/usr/share/doc/libX11*/COPYING"            \
+      "/usr/X11/share/X11/doc/README*"            \
       "/usr/share/doc/debian/debian-manifesto"     \
     ; do
       if test -z "$with_textfile"; then
         { $as_echo "$as_me:$LINENO: checking for text file $f" >&5
 $as_echo_n "checking for text file $f... " >&6; }
+       f=`/bin/ls $f 2>&- | head -1`
         if test -f "$f" ; then
           { $as_echo "$as_me:$LINENO: result: yes" >&5
 $as_echo "yes" >&6; }
@@ -21005,6 +21145,11 @@ if test "$have_pam" = yes; then
   PASSWD_OBJS="$PASSWD_OBJS \$(PAM_OBJS)"
   INSTALL_PAM="install-pam"
 fi
+if test "$enable_pam_check_account_type" = yes; then
+  COMMENT_PAM_CHECK_ACCOUNT=""
+else
+  COMMENT_PAM_CHECK_ACCOUNT="#"
+fi
 if test "$have_passwd_helper" = yes; then
   PASSWD_SRCS="$PASSWD_SRCS \$(PWHELPER_SRCS)"
   PASSWD_OBJS="$PASSWD_OBJS \$(PWHELPER_OBJS)"
@@ -21191,6 +21336,10 @@ INCLUDES=`echo "$INCLUDES" | sed 's@ -I${prefix}/include@@g;'`
 
 
 
+
+
+
+
 
 
 
@@ -21204,7 +21353,7 @@ APPDEFAULTS=$ac_x_app_defaults
 
 
 
-ac_config_files="$ac_config_files Makefile utils/Makefile driver/Makefile hacks/Makefile hacks/glx/Makefile po/Makefile.in driver/XScreenSaver.ad"
+ac_config_files="$ac_config_files Makefile utils/Makefile driver/Makefile driver/xscreensaver.pam hacks/Makefile hacks/glx/Makefile po/Makefile.in driver/XScreenSaver.ad"
 
 cat >confcache <<\_ACEOF
 # This file is a shell script that caches the results of configure
@@ -21823,6 +21972,7 @@ do
     "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
     "utils/Makefile") CONFIG_FILES="$CONFIG_FILES utils/Makefile" ;;
     "driver/Makefile") CONFIG_FILES="$CONFIG_FILES driver/Makefile" ;;
+    "driver/xscreensaver.pam") CONFIG_FILES="$CONFIG_FILES driver/xscreensaver.pam" ;;
     "hacks/Makefile") CONFIG_FILES="$CONFIG_FILES hacks/Makefile" ;;
     "hacks/glx/Makefile") CONFIG_FILES="$CONFIG_FILES hacks/glx/Makefile" ;;
     "po/Makefile.in") CONFIG_FILES="$CONFIG_FILES po/Makefile.in" ;;