From http://www.jwz.org/xscreensaver/xscreensaver-5.24.tar.gz
[xscreensaver] / configure
index af5ae0269ad3370f544e759c5440da345d81f879..6c43d483b662962e849febd4316f1f2276331d9b 100755 (executable)
--- a/configure
+++ b/configure
 #! /bin/sh
 #! /bin/sh
-
 # Guess values for system-dependent variables and create Makefiles.
 # Guess values for system-dependent variables and create Makefiles.
-# Generated automatically using autoconf version 2.13 
-# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
+# Generated by GNU Autoconf 2.69.
+#
+#
+# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
+#
 #
 # This configure script is free software; the Free Software Foundation
 # gives unlimited permission to copy, distribute and modify it.
 #
 # This configure script is free software; the Free Software Foundation
 # gives unlimited permission to copy, distribute and modify it.
+## -------------------- ##
+## M4sh Initialization. ##
+## -------------------- ##
+
+# Be more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
+  emulate sh
+  NULLCMD=:
+  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '${1+"$@"}'='"$@"'
+  setopt NO_GLOB_SUBST
+else
+  case `(set -o) 2>/dev/null` in #(
+  *posix*) :
+    set -o posix ;; #(
+  *) :
+     ;;
+esac
+fi
 
 
-# Defaults:
-ac_help=
-ac_default_prefix=/usr/local
-# Any additions from configure.in:
-ac_help="$ac_help"
-ac_help="$ac_help
-Installation options:
 
 
-  --with-hackdir=DIR      Where to install the hundreds of demo executables.
-                          Default: \`PREFIX/lib/xscreensaver/'"
-ac_help="$ac_help
-"
-ac_help="$ac_help
-  --with-configdir=DIR    Where to install the data files that describe each
-                          of the display modes to the GUI.
-                          Default: \`GNOMEPREFIX/control-center/screensavers/'
-                          or \`PREFIX/lib/xscreensaver/config/', depending on
-                          whether GNOME is available.
-"
-ac_help="$ac_help
-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."
-ac_help="$ac_help
-  --with-mit-ext          Include support for the MIT-SCREEN-SAVER extension."
-ac_help="$ac_help
-  --with-xidle-ext        Include support for the XIDLE extension."
-ac_help="$ac_help
-  --with-sgivc-ext        Include support for the SGI-VIDEO-CONTROL extension."
-ac_help="$ac_help
-  --with-dpms-ext         Include support for the DPMS extension."
-ac_help="$ac_help
-  --with-xinerama-ext     Include support for the XINERAMA extension."
-ac_help="$ac_help
-  --with-xf86vmode-ext    Include support for XFree86 virtual screens."
-ac_help="$ac_help
-  --with-xf86gamma-ext    Include support for XFree86 gamma fading."
-ac_help="$ac_help
-  --with-proc-interrupts  Include support for consulting the /proc/interrupts
-                          file to notice keyboard activity."
-ac_help="$ac_help
+as_nl='
+'
+export as_nl
+# Printing a long string crashes Solaris 7 /usr/bin/printf.
+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
+# Prefer a ksh shell builtin over an external printf program on Solaris,
+# but without wasting forks for bash or zsh.
+if test -z "$BASH_VERSION$ZSH_VERSION" \
+    && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
+  as_echo='print -r --'
+  as_echo_n='print -rn --'
+elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
+  as_echo='printf %s\n'
+  as_echo_n='printf %s'
+else
+  if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
+    as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
+    as_echo_n='/usr/ucb/echo -n'
+  else
+    as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
+    as_echo_n_body='eval
+      arg=$1;
+      case $arg in #(
+      *"$as_nl"*)
+       expr "X$arg" : "X\\(.*\\)$as_nl";
+       arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
+      esac;
+      expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
+    '
+    export as_echo_n_body
+    as_echo_n='sh -c $as_echo_n_body as_echo'
+  fi
+  export as_echo_body
+  as_echo='sh -c $as_echo_body as_echo'
+fi
 
 
-Screen locking options:
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+  PATH_SEPARATOR=:
+  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
+    (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
+      PATH_SEPARATOR=';'
+  }
+fi
 
 
-  --enable-locking        Compile in support for locking the display.
-  --disable-locking       Do not allow locking at all.
-"
-ac_help="$ac_help
-  --with-pam              Include support for PAM (Pluggable Auth Modules.)"
-ac_help="$ac_help
-  --with-kerberos         Include support for Kerberos authentication."
-ac_help="$ac_help
-  --with-shadow           Include support for shadow password authentication."
-ac_help="$ac_help
 
 
-User interface options:
+# IFS
+# We need space, tab and new line, in precisely that order.  Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+IFS=" ""       $as_nl"
 
 
-  --with-motif            Use the Motif toolkit for the user interface."
-ac_help="$ac_help
-  --with-gtk              Use the Gtk toolkit for the user interface."
-ac_help="$ac_help
-  --with-gnome            Include support for the Gnome Control Center."
-ac_help="$ac_help
-  --with-xml              The XML toolkit is needed for some parts of
-                          the Gtk interface."
-ac_help="$ac_help
+# Find who we are.  Look in the path if we contain no directory separator.
+as_myself=
+case $0 in #((
+  *[\\/]* ) as_myself=$0 ;;
+  *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+  done
+IFS=$as_save_IFS
 
 
-Graphics options:
+     ;;
+esac
+# We did not find ourselves, most probably we were run as `sh COMMAND'
+# in which case we are not to be found in the path.
+if test "x$as_myself" = x; then
+  as_myself=$0
+fi
+if test ! -f "$as_myself"; then
+  $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+  exit 1
+fi
 
 
-  --with-gl               Build those demos which depend on OpenGL."
-ac_help="$ac_help
-  --with-gle              Build those demos which depend on GLE
-                          (the OpenGL "extrusion" library.)"
-ac_help="$ac_help
-  --with-xpm              Include support for XPM files in some demos."
-ac_help="$ac_help
-  --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."
-ac_help="$ac_help
-  --with-jpeg             Include support for the JPEG library in some demos,
-                          which will make it possible for them to read JPEG
-                          files as well."
-ac_help="$ac_help
-  --with-xshm-ext         Include support for the Shared Memory extension."
-ac_help="$ac_help
-  --with-xdbe-ext         Include support for the DOUBLE-BUFFER extension."
-ac_help="$ac_help
-  --with-readdisplay      Include support for the XReadDisplay extension."
-ac_help="$ac_help
-
-  --with-fortune=PROGRAM  Some demos are able to run an external program and
-                          display its text; this names the program to use by
-                          default (though it can be overridden with X
-                          resources.)  Default is \"/usr/games/fortune\"."
-ac_help="$ac_help
-  --with-setuid-hacks     Allow some demos to be installed \`setuid root'
-                          (which is needed in order to ping other hosts.)
+# Unset variables that we do not need and which cause bugs (e.g. in
+# pre-3.0 UWIN ksh).  But do not cause bugs in bash 2.01; the "|| exit 1"
+# suppresses any "Segmentation fault" message there.  '((' could
+# trigger a bug in pdksh 5.2.14.
+for as_var in BASH_ENV ENV MAIL MAILPATH
+do eval test x\${$as_var+set} = xset \
+  && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
+done
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+LC_ALL=C
+export LC_ALL
+LANGUAGE=C
+export LANGUAGE
+
+# CDPATH.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+# Use a proper internal environment variable to ensure we don't fall
+  # into an infinite loop, continuously re-executing ourselves.
+  if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then
+    _as_can_reexec=no; export _as_can_reexec;
+    # We cannot yet assume a decent shell, so we have to provide a
+# neutralization value for shells without unset; and this also
+# works around shells that cannot unset nonexistent variables.
+# Preserve -v and -x to the replacement shell.
+BASH_ENV=/dev/null
+ENV=/dev/null
+(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
+case $- in # ((((
+  *v*x* | *x*v* ) as_opts=-vx ;;
+  *v* ) as_opts=-v ;;
+  *x* ) as_opts=-x ;;
+  * ) as_opts= ;;
+esac
+exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
+# Admittedly, this is quite paranoid, since all the known shells bail
+# out after a failed `exec'.
+$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
+as_fn_exit 255
+  fi
+  # We don't want this to propagate to other subprocesses.
+          { _as_can_reexec=; unset _as_can_reexec;}
+if test "x$CONFIG_SHELL" = x; then
+  as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then :
+  emulate sh
+  NULLCMD=:
+  # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '\${1+\"\$@\"}'='\"\$@\"'
+  setopt NO_GLOB_SUBST
+else
+  case \`(set -o) 2>/dev/null\` in #(
+  *posix*) :
+    set -o posix ;; #(
+  *) :
+     ;;
+esac
+fi
 "
 "
+  as_required="as_fn_return () { (exit \$1); }
+as_fn_success () { as_fn_return 0; }
+as_fn_failure () { as_fn_return 1; }
+as_fn_ret_success () { return 0; }
+as_fn_ret_failure () { return 1; }
+
+exitcode=0
+as_fn_success || { exitcode=1; echo as_fn_success failed.; }
+as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; }
+as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; }
+as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; }
+if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then :
+
+else
+  exitcode=1; echo positional parameters were not saved.
+fi
+test x\$exitcode = x0 || exit 1
+test -x / || exit 1"
+  as_suggested="  as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO
+  as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO
+  eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" &&
+  test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1
+test \$(( 1 + 1 )) = 2 || exit 1"
+  if (eval "$as_required") 2>/dev/null; then :
+  as_have_required=yes
+else
+  as_have_required=no
+fi
+  if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then :
+
+else
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+as_found=false
+for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  as_found=:
+  case $as_dir in #(
+        /*)
+          for as_base in sh bash ksh sh5; do
+            # Try only shells that exist, to save several forks.
+            as_shell=$as_dir/$as_base
+            if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
+                   { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then :
+  CONFIG_SHELL=$as_shell as_have_required=yes
+                  if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then :
+  break 2
+fi
+fi
+          done;;
+       esac
+  as_found=false
+done
+$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } &&
+             { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then :
+  CONFIG_SHELL=$SHELL as_have_required=yes
+fi; }
+IFS=$as_save_IFS
+
+
+      if test "x$CONFIG_SHELL" != x; then :
+  export CONFIG_SHELL
+             # We cannot yet assume a decent shell, so we have to provide a
+# neutralization value for shells without unset; and this also
+# works around shells that cannot unset nonexistent variables.
+# Preserve -v and -x to the replacement shell.
+BASH_ENV=/dev/null
+ENV=/dev/null
+(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
+case $- in # ((((
+  *v*x* | *x*v* ) as_opts=-vx ;;
+  *v* ) as_opts=-v ;;
+  *x* ) as_opts=-x ;;
+  * ) as_opts= ;;
+esac
+exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
+# Admittedly, this is quite paranoid, since all the known shells bail
+# out after a failed `exec'.
+$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
+exit 255
+fi
+
+    if test x$as_have_required = xno; then :
+  $as_echo "$0: This script requires a shell more modern than all"
+  $as_echo "$0: the shells that I found on your system."
+  if test x${ZSH_VERSION+set} = xset ; then
+    $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should"
+    $as_echo "$0: be upgraded to zsh 4.3.4 or later."
+  else
+    $as_echo "$0: Please tell bug-autoconf@gnu.org about your system,
+$0: including any error possibly output before this
+$0: message. Then install a modern shell, or manually run
+$0: the script under such a shell if you do have one."
+  fi
+  exit 1
+fi
+fi
+fi
+SHELL=${CONFIG_SHELL-/bin/sh}
+export SHELL
+# Unset more variables known to interfere with behavior of common tools.
+CLICOLOR_FORCE= GREP_OPTIONS=
+unset CLICOLOR_FORCE GREP_OPTIONS
+
+## --------------------- ##
+## M4sh Shell Functions. ##
+## --------------------- ##
+# as_fn_unset VAR
+# ---------------
+# Portably unset VAR.
+as_fn_unset ()
+{
+  { eval $1=; unset $1;}
+}
+as_unset=as_fn_unset
+
+# as_fn_set_status STATUS
+# -----------------------
+# Set $? to STATUS, without forking.
+as_fn_set_status ()
+{
+  return $1
+} # as_fn_set_status
+
+# as_fn_exit STATUS
+# -----------------
+# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
+as_fn_exit ()
+{
+  set +e
+  as_fn_set_status $1
+  exit $1
+} # as_fn_exit
+
+# as_fn_mkdir_p
+# -------------
+# Create "$as_dir" as a directory, including parents if necessary.
+as_fn_mkdir_p ()
+{
+
+  case $as_dir in #(
+  -*) as_dir=./$as_dir;;
+  esac
+  test -d "$as_dir" || eval $as_mkdir_p || {
+    as_dirs=
+    while :; do
+      case $as_dir in #(
+      *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
+      *) as_qdir=$as_dir;;
+      esac
+      as_dirs="'$as_qdir' $as_dirs"
+      as_dir=`$as_dirname -- "$as_dir" ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+        X"$as_dir" : 'X\(//\)[^/]' \| \
+        X"$as_dir" : 'X\(//\)$' \| \
+        X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_dir" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)[^/].*/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`
+      test -d "$as_dir" && break
+    done
+    test -z "$as_dirs" || eval "mkdir $as_dirs"
+  } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
+
+
+} # as_fn_mkdir_p
+
+# as_fn_executable_p FILE
+# -----------------------
+# Test if FILE is an executable regular file.
+as_fn_executable_p ()
+{
+  test -f "$1" && test -x "$1"
+} # as_fn_executable_p
+# as_fn_append VAR VALUE
+# ----------------------
+# Append the text in VALUE to the end of the definition contained in VAR. Take
+# advantage of any shell optimizations that allow amortized linear growth over
+# repeated appends, instead of the typical quadratic growth present in naive
+# implementations.
+if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
+  eval 'as_fn_append ()
+  {
+    eval $1+=\$2
+  }'
+else
+  as_fn_append ()
+  {
+    eval $1=\$$1\$2
+  }
+fi # as_fn_append
+
+# as_fn_arith ARG...
+# ------------------
+# Perform arithmetic evaluation on the ARGs, and store the result in the
+# global $as_val. Take advantage of shells that can avoid forks. The arguments
+# must be portable across $(()) and expr.
+if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
+  eval 'as_fn_arith ()
+  {
+    as_val=$(( $* ))
+  }'
+else
+  as_fn_arith ()
+  {
+    as_val=`expr "$@" || test $? -eq 1`
+  }
+fi # as_fn_arith
+
+
+# as_fn_error STATUS ERROR [LINENO LOG_FD]
+# ----------------------------------------
+# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
+# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
+# script with STATUS, using 1 if that was 0.
+as_fn_error ()
+{
+  as_status=$1; test $as_status -eq 0 && as_status=1
+  if test "$4"; then
+    as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+    $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
+  fi
+  $as_echo "$as_me: error: $2" >&2
+  as_fn_exit $as_status
+} # as_fn_error
+
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; then
+  as_expr=expr
+else
+  as_expr=false
+fi
+
+if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
+  as_basename=basename
+else
+  as_basename=false
+fi
+
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+  as_dirname=dirname
+else
+  as_dirname=false
+fi
+
+as_me=`$as_basename -- "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+        X"$0" : 'X\(//\)$' \| \
+        X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X/"$0" |
+    sed '/^.*\/\([^/][^/]*\)\/*$/{
+           s//\1/
+           q
+         }
+         /^X\/\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\/\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`
+
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+
+  as_lineno_1=$LINENO as_lineno_1a=$LINENO
+  as_lineno_2=$LINENO as_lineno_2a=$LINENO
+  eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" &&
+  test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || {
+  # Blame Lee E. McMahon (1931-1989) for sed's syntax.  :-)
+  sed -n '
+    p
+    /[$]LINENO/=
+  ' <$as_myself |
+    sed '
+      s/[$]LINENO.*/&-/
+      t lineno
+      b
+      :lineno
+      N
+      :loop
+      s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
+      t loop
+      s/-\n.*//
+    ' >$as_me.lineno &&
+  chmod +x "$as_me.lineno" ||
+    { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; }
+
+  # If we had to re-execute with $CONFIG_SHELL, we're ensured to have
+  # already done that, so ensure we don't try to do so again and fall
+  # in an infinite loop.  This has already happened in practice.
+  _as_can_reexec=no; export _as_can_reexec
+  # Don't try to exec as it changes $[0], causing all sort of problems
+  # (the dirname of $[0] is not the place where we might find the
+  # original and so on.  Autoconf is especially sensitive to this).
+  . "./$as_me.lineno"
+  # Exit status is that of the last command.
+  exit
+}
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in #(((((
+-n*)
+  case `echo 'xy\c'` in
+  *c*) ECHO_T='        ';;     # ECHO_T is single tab character.
+  xy)  ECHO_C='\c';;
+  *)   echo `echo ksh88 bug on AIX 6.1` > /dev/null
+       ECHO_T='        ';;
+  esac;;
+*)
+  ECHO_N='-n';;
+esac
+
+rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+  rm -f conf$$.dir/conf$$.file
+else
+  rm -f conf$$.dir
+  mkdir conf$$.dir 2>/dev/null
+fi
+if (echo >conf$$.file) 2>/dev/null; then
+  if ln -s conf$$.file conf$$ 2>/dev/null; then
+    as_ln_s='ln -s'
+    # ... but there are two gotchas:
+    # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+    # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+    # In both cases, we have to default to `cp -pR'.
+    ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+      as_ln_s='cp -pR'
+  elif ln conf$$.file conf$$ 2>/dev/null; then
+    as_ln_s=ln
+  else
+    as_ln_s='cp -pR'
+  fi
+else
+  as_ln_s='cp -pR'
+fi
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
+
+if mkdir -p . 2>/dev/null; then
+  as_mkdir_p='mkdir -p "$as_dir"'
+else
+  test -d ./-p && rmdir ./-p
+  as_mkdir_p=false
+fi
+
+as_test_x='test -x'
+as_executable_p=as_fn_executable_p
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+
+
+test -n "$DJDIR" || exec 7<&0 </dev/null
+exec 6>&1
+
+# Name of the host.
+# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status,
+# so uname gets run too.
+ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
+
+#
+# Initializations.
+#
+ac_default_prefix=/usr/local
+ac_clean_files=
+ac_config_libobj_dir=.
+LIBOBJS=
+cross_compiling=no
+subdirs=
+MFLAGS=
+MAKEFLAGS=
+
+# Identity of this package.
+PACKAGE_NAME=
+PACKAGE_TARNAME=
+PACKAGE_VERSION=
+PACKAGE_STRING=
+PACKAGE_BUGREPORT=
+PACKAGE_URL=
+
+ac_unique_file="driver/subprocs.c"
+# Factoring default headers for most tests.
+ac_includes_default="\
+#include <stdio.h>
+#ifdef HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_STAT_H
+# include <sys/stat.h>
+#endif
+#ifdef STDC_HEADERS
+# include <stdlib.h>
+# include <stddef.h>
+#else
+# ifdef HAVE_STDLIB_H
+#  include <stdlib.h>
+# endif
+#endif
+#ifdef HAVE_STRING_H
+# if !defined STDC_HEADERS && defined HAVE_MEMORY_H
+#  include <memory.h>
+# endif
+# include <string.h>
+#endif
+#ifdef HAVE_STRINGS_H
+# include <strings.h>
+#endif
+#ifdef HAVE_INTTYPES_H
+# include <inttypes.h>
+#endif
+#ifdef HAVE_STDINT_H
+# include <stdint.h>
+#endif
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif"
+
+ac_header_list=
+ac_subst_vars='LTLIBOBJS
+LIBOBJS
+DEPEND_DEFINES
+DEPEND_FLAGS
+DEPEND
+APPDEFAULTS
+GTK_EXTRA_OBJS
+HACK_CONF_DIR
+PO_DATADIR
+GTK_DATADIR
+HACKDIR_FULL
+HACKDIR
+NOGNOME
+GNOME22
+GNOME24
+GLFONT_OBJS
+GLFPS_OBJS
+JWZGLES_OBJS
+GLE_KLUDGE
+GLE_EXES
+GL_KLUDGE
+GL_MEN
+GL_UTIL_EXES
+SUID_EXES
+RETIRED_GL_EXES
+GL_EXES
+JPEG_EXES
+LOCK_OBJS
+LOCK_SRCS
+SAVER_GL_LIBS
+SAVER_GL_OBJS
+SAVER_GL_SRCS
+XMU_LIBS
+XMU_OBJS
+XMU_SRCS
+PASSWD_OBJS
+PASSWD_SRCS
+MEN_OSX
+SCRIPTS_OSX
+EXES_OSX
+OBJCC
+WITH_BROWSER
+DEFAULT_TEXT_FILE
+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
+INSTALL_DIRS
+SETUID_HACKS
+INSTALL_SETUID
+PASSWD_LIBS
+XINERAMA_LIBS
+XDPMS_LIBS
+GLE_LIBS
+GL_LIBS
+PTY_LIBS
+XPM_LIBS
+HACK_LIBS
+JPEG_LIBS
+XML_LIBS
+GTK_LIBS
+MOTIF_LIBS
+SAVER_LIBS
+ALL_DEMO_PROGRAMS
+PREFERRED_DEMO_PROGRAM
+INCLUDES
+gnome_url_show_program
+gnome_open_program
+pkg_config
+login_manager_tmp
+MKINSTALLDIRS
+POSUB
+POFILES
+INTLOBJS
+INTLLIBS
+INTLDEPS
+INSTOBJEXT
+GMOFILES
+DATADIRNAME
+CATOBJEXT
+CATALOGS
+XGETTEXT
+GMSGFMT
+MSGFMT
+USE_NLS
+ALLOCA
+RANLIB
+GETTEXT_PACKAGE
+INTLTOOL_PERL
+INTLTOOL_UPDATE
+INTLTOOL_MERGE
+INTLTOOL_EXTRACT
+INTLTOOL_CAVES_RULE
+INTLTOOL_XML_RULE
+INTLTOOL_UI_RULE
+INTLTOOL_SOUNDLIST_RULE
+INTLTOOL_SHEET_RULE
+INTLTOOL_SERVER_RULE
+INTLTOOL_PONG_RULE
+INTLTOOL_OAF_RULE
+INTLTOOL_KEYS_RULE
+INTLTOOL_DIRECTORY_RULE
+INTLTOOL_DESKTOP_RULE
+X_EXTRA_LIBS
+X_LIBS
+X_PRE_LIBS
+X_CFLAGS
+XMKMF
+PERL
+EGREP
+GREP
+SET_MAKE
+INSTALL_DATA
+INSTALL_SCRIPT
+INSTALL_PROGRAM
+CPP
+OBJEXT
+EXEEXT
+ac_ct_CC
+CPPFLAGS
+LDFLAGS
+CFLAGS
+CC
+host_os
+host_vendor
+host_cpu
+host
+build_os
+build_vendor
+build_cpu
+build
+target_alias
+host_alias
+build_alias
+LIBS
+ECHO_T
+ECHO_N
+ECHO_C
+DEFS
+mandir
+localedir
+libdir
+psdir
+pdfdir
+dvidir
+htmldir
+infodir
+docdir
+oldincludedir
+includedir
+localstatedir
+sharedstatedir
+sysconfdir
+datadir
+datarootdir
+libexecdir
+sbindir
+bindir
+program_transform_name
+prefix
+exec_prefix
+PACKAGE_URL
+PACKAGE_BUGREPORT
+PACKAGE_STRING
+PACKAGE_VERSION
+PACKAGE_TARNAME
+PACKAGE_NAME
+PATH_SEPARATOR
+SHELL'
+ac_subst_files=''
+ac_user_opts='
+enable_option_checking
+with_x_app_defaults
+enable_largefile
+with_x
+with_hackdir
+enable_subdir
+with_configdir
+with_dpms_ext
+with_xinerama_ext
+with_xinput_ext
+with_xf86vmode_ext
+with_xf86gamma_ext
+with_randr_ext
+with_proc_interrupts
+enable_locking
+enable_root_passwd
+with_pam
+with_pam_service_name
+enable_pam_check_account_type
+with_kerberos
+with_shadow
+with_passwd_helper
+with_login_manager
+with_gtk
+with_motif
+with_gl
+with_gle
+with_gles
+with_pixbuf
+with_xpm
+with_jpeg
+with_xshm_ext
+with_xdbe_ext
+with_readdisplay
+with_image_directory
+with_text_file
+with_browser
+with_setuid_hacks
+'
+      ac_precious_vars='build_alias
+host_alias
+target_alias
+CC
+CFLAGS
+LDFLAGS
+LIBS
+CPPFLAGS
+CPP
+XMKMF'
+
 
 # Initialize some variables set by options.
 
 # Initialize some variables set by options.
+ac_init_help=
+ac_init_version=false
+ac_unrecognized_opts=
+ac_unrecognized_sep=
 # The variables have the same names as the options, with
 # dashes changed to underlines.
 # The variables have the same names as the options, with
 # dashes changed to underlines.
-build=NONE
-cache_file=./config.cache
+cache_file=/dev/null
 exec_prefix=NONE
 exec_prefix=NONE
-host=NONE
 no_create=
 no_create=
-nonopt=NONE
 no_recursion=
 prefix=NONE
 program_prefix=NONE
 no_recursion=
 prefix=NONE
 program_prefix=NONE
@@ -135,94 +864,132 @@ program_transform_name=s,x,x,
 silent=
 site=
 srcdir=
 silent=
 site=
 srcdir=
-target=NONE
 verbose=
 x_includes=NONE
 x_libraries=NONE
 verbose=
 x_includes=NONE
 x_libraries=NONE
+
+# Installation directory options.
+# These are left unexpanded so users can "make install exec_prefix=/foo"
+# and all the variables that are supposed to be based on exec_prefix
+# by default will actually change.
+# Use braces instead of parens because sh, perl, etc. also accept them.
+# (The list follows the same order as the GNU Coding Standards.)
 bindir='${exec_prefix}/bin'
 sbindir='${exec_prefix}/sbin'
 libexecdir='${exec_prefix}/libexec'
 bindir='${exec_prefix}/bin'
 sbindir='${exec_prefix}/sbin'
 libexecdir='${exec_prefix}/libexec'
-datadir='${prefix}/share'
+datarootdir='${prefix}/share'
+datadir='${datarootdir}'
 sysconfdir='${prefix}/etc'
 sharedstatedir='${prefix}/com'
 localstatedir='${prefix}/var'
 sysconfdir='${prefix}/etc'
 sharedstatedir='${prefix}/com'
 localstatedir='${prefix}/var'
-libdir='${exec_prefix}/lib'
 includedir='${prefix}/include'
 oldincludedir='/usr/include'
 includedir='${prefix}/include'
 oldincludedir='/usr/include'
-infodir='${prefix}/info'
-mandir='${prefix}/man'
-
-# Initialize some other variables.
-subdirs=
-MFLAGS= MAKEFLAGS=
-SHELL=${CONFIG_SHELL-/bin/sh}
-# Maximum number of lines to put in a shell here document.
-ac_max_here_lines=12
+docdir='${datarootdir}/doc/${PACKAGE}'
+infodir='${datarootdir}/info'
+htmldir='${docdir}'
+dvidir='${docdir}'
+pdfdir='${docdir}'
+psdir='${docdir}'
+libdir='${exec_prefix}/lib'
+localedir='${datarootdir}/locale'
+mandir='${datarootdir}/man'
 
 ac_prev=
 
 ac_prev=
+ac_dashdash=
 for ac_option
 do
 for ac_option
 do
-
   # If the previous option needs an argument, assign it.
   if test -n "$ac_prev"; then
   # If the previous option needs an argument, assign it.
   if test -n "$ac_prev"; then
-    eval "$ac_prev=\$ac_option"
+    eval $ac_prev=\$ac_option
     ac_prev=
     continue
   fi
 
     ac_prev=
     continue
   fi
 
-  case "$ac_option" in
-  -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
-  *) ac_optarg= ;;
+  case $ac_option in
+  *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
+  *=)   ac_optarg= ;;
+  *)    ac_optarg=yes ;;
   esac
 
   # Accept the important Cygnus configure options, so we can diagnose typos.
 
   esac
 
   # Accept the important Cygnus configure options, so we can diagnose typos.
 
-  case "$ac_option" in
+  case $ac_dashdash$ac_option in
+  --)
+    ac_dashdash=yes ;;
 
   -bindir | --bindir | --bindi | --bind | --bin | --bi)
     ac_prev=bindir ;;
   -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
 
   -bindir | --bindir | --bindi | --bind | --bin | --bi)
     ac_prev=bindir ;;
   -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
-    bindir="$ac_optarg" ;;
+    bindir=$ac_optarg ;;
 
   -build | --build | --buil | --bui | --bu)
 
   -build | --build | --buil | --bui | --bu)
-    ac_prev=build ;;
+    ac_prev=build_alias ;;
   -build=* | --build=* | --buil=* | --bui=* | --bu=*)
   -build=* | --build=* | --buil=* | --bui=* | --bu=*)
-    build="$ac_optarg" ;;
+    build_alias=$ac_optarg ;;
 
   -cache-file | --cache-file | --cache-fil | --cache-fi \
   | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
     ac_prev=cache_file ;;
   -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
   | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
 
   -cache-file | --cache-file | --cache-fil | --cache-fi \
   | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
     ac_prev=cache_file ;;
   -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
   | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
-    cache_file="$ac_optarg" ;;
+    cache_file=$ac_optarg ;;
 
 
-  -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
+  --config-cache | -C)
+    cache_file=config.cache ;;
+
+  -datadir | --datadir | --datadi | --datad)
     ac_prev=datadir ;;
     ac_prev=datadir ;;
-  -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
-  | --da=*)
-    datadir="$ac_optarg" ;;
+  -datadir=* | --datadir=* | --datadi=* | --datad=*)
+    datadir=$ac_optarg ;;
+
+  -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
+  | --dataroo | --dataro | --datar)
+    ac_prev=datarootdir ;;
+  -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
+  | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
+    datarootdir=$ac_optarg ;;
 
   -disable-* | --disable-*)
 
   -disable-* | --disable-*)
-    ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
+    ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
     # Reject names that are not valid shell variable names.
     # Reject names that are not valid shell variable names.
-    if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
-      { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
-    fi
-    ac_feature=`echo $ac_feature| sed 's/-/_/g'`
-    eval "enable_${ac_feature}=no" ;;
+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+      as_fn_error $? "invalid feature name: $ac_useropt"
+    ac_useropt_orig=$ac_useropt
+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    case $ac_user_opts in
+      *"
+"enable_$ac_useropt"
+"*) ;;
+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig"
+        ac_unrecognized_sep=', ';;
+    esac
+    eval enable_$ac_useropt=no ;;
+
+  -docdir | --docdir | --docdi | --doc | --do)
+    ac_prev=docdir ;;
+  -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*)
+    docdir=$ac_optarg ;;
+
+  -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)
+    ac_prev=dvidir ;;
+  -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*)
+    dvidir=$ac_optarg ;;
 
   -enable-* | --enable-*)
 
   -enable-* | --enable-*)
-    ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
+    ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
     # Reject names that are not valid shell variable names.
     # Reject names that are not valid shell variable names.
-    if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
-      { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
-    fi
-    ac_feature=`echo $ac_feature| sed 's/-/_/g'`
-    case "$ac_option" in
-      *=*) ;;
-      *) ac_optarg=yes ;;
+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+      as_fn_error $? "invalid feature name: $ac_useropt"
+    ac_useropt_orig=$ac_useropt
+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    case $ac_user_opts in
+      *"
+"enable_$ac_useropt"
+"*) ;;
+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig"
+        ac_unrecognized_sep=', ';;
     esac
     esac
-    eval "enable_${ac_feature}='$ac_optarg'" ;;
+    eval enable_$ac_useropt=\$ac_optarg ;;
 
   -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
   | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
 
   -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
   | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
@@ -231,107 +998,77 @@ do
   -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
   | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
   | --exec=* | --exe=* | --ex=*)
   -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
   | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
   | --exec=* | --exe=* | --ex=*)
-    exec_prefix="$ac_optarg" ;;
+    exec_prefix=$ac_optarg ;;
 
   -gas | --gas | --ga | --g)
     # Obsolete; use --with-gas.
     with_gas=yes ;;
 
 
   -gas | --gas | --ga | --g)
     # Obsolete; use --with-gas.
     with_gas=yes ;;
 
-  -help | --help | --hel | --he)
-    # Omit some internal or obsolete options to make the list less imposing.
-    # This message is too long to be a string in the A/UX 3.1 sh.
-    cat << EOF
-Usage: configure [options] [host]
-Options: [defaults in brackets after descriptions]
-
-Configuration:
-
-  --cache-file=FILE       cache test results in FILE
-  --help                  print this message
-  --no-create             do not create output files
-  --quiet, --silent       do not print \`checking...' messages
-  --version               print the version of autoconf that created configure
-
-Directory and file names:
-
-  --prefix=PREFIX         install architecture-independent files in PREFIX
-                          [$ac_default_prefix]
-  --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
-                          [same as prefix]
-  --bindir=DIR            user executables in DIR [EPREFIX/bin]
-  --libdir=DIR            object code libraries in DIR [EPREFIX/lib]
-  --includedir=DIR        C header files in DIR [PREFIX/include]
-  --x-includes=DIR        X include files are in DIR
-  --x-libraries=DIR       X library files are in DIR
-  --mandir=DIR            man documentation in DIR [PREFIX/man]
-  --srcdir=DIR            find the sources in DIR [configure dir or ..]
-  --program-prefix=PREFIX prepend PREFIX to installed program names
-  --program-suffix=SUFFIX append SUFFIX to installed program names
-  --program-transform-name=PROGRAM
-                          run sed PROGRAM on installed program names
-EOF
-    cat << EOF
-
-Host type:
-
-  --build=BUILD           configure for building on BUILD [BUILD=HOST]
-  --host=HOST             configure for HOST [guessed]
-  --target=TARGET         configure for TARGET [TARGET=HOST]
-EOF
-    if test -n "$ac_help"; then
-      echo "$ac_help"
-    fi
-    exit 0 ;;
+  -help | --help | --hel | --he | -h)
+    ac_init_help=long ;;
+  -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
+    ac_init_help=recursive ;;
+  -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
+    ac_init_help=short ;;
 
   -host | --host | --hos | --ho)
 
   -host | --host | --hos | --ho)
-    ac_prev=host ;;
+    ac_prev=host_alias ;;
   -host=* | --host=* | --hos=* | --ho=*)
   -host=* | --host=* | --hos=* | --ho=*)
-    host="$ac_optarg" ;;
+    host_alias=$ac_optarg ;;
+
+  -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht)
+    ac_prev=htmldir ;;
+  -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \
+  | --ht=*)
+    htmldir=$ac_optarg ;;
 
   -includedir | --includedir | --includedi | --included | --include \
   | --includ | --inclu | --incl | --inc)
     ac_prev=includedir ;;
   -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
   | --includ=* | --inclu=* | --incl=* | --inc=*)
 
   -includedir | --includedir | --includedi | --included | --include \
   | --includ | --inclu | --incl | --inc)
     ac_prev=includedir ;;
   -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
   | --includ=* | --inclu=* | --incl=* | --inc=*)
-    includedir="$ac_optarg" ;;
+    includedir=$ac_optarg ;;
 
   -infodir | --infodir | --infodi | --infod | --info | --inf)
     ac_prev=infodir ;;
   -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
 
   -infodir | --infodir | --infodi | --infod | --info | --inf)
     ac_prev=infodir ;;
   -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
-    infodir="$ac_optarg" ;;
+    infodir=$ac_optarg ;;
 
   -libdir | --libdir | --libdi | --libd)
     ac_prev=libdir ;;
   -libdir=* | --libdir=* | --libdi=* | --libd=*)
 
   -libdir | --libdir | --libdi | --libd)
     ac_prev=libdir ;;
   -libdir=* | --libdir=* | --libdi=* | --libd=*)
-    libdir="$ac_optarg" ;;
+    libdir=$ac_optarg ;;
 
   -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
   | --libexe | --libex | --libe)
     ac_prev=libexecdir ;;
   -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
   | --libexe=* | --libex=* | --libe=*)
 
   -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
   | --libexe | --libex | --libe)
     ac_prev=libexecdir ;;
   -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
   | --libexe=* | --libex=* | --libe=*)
-    libexecdir="$ac_optarg" ;;
+    libexecdir=$ac_optarg ;;
+
+  -localedir | --localedir | --localedi | --localed | --locale)
+    ac_prev=localedir ;;
+  -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*)
+    localedir=$ac_optarg ;;
 
   -localstatedir | --localstatedir | --localstatedi | --localstated \
 
   -localstatedir | --localstatedir | --localstatedi | --localstated \
-  | --localstate | --localstat | --localsta | --localst \
-  | --locals | --local | --loca | --loc | --lo)
+  | --localstate | --localstat | --localsta | --localst | --locals)
     ac_prev=localstatedir ;;
   -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
     ac_prev=localstatedir ;;
   -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
-  | --localstate=* | --localstat=* | --localsta=* | --localst=* \
-  | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
-    localstatedir="$ac_optarg" ;;
+  | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*)
+    localstatedir=$ac_optarg ;;
 
   -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
     ac_prev=mandir ;;
   -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
 
   -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
     ac_prev=mandir ;;
   -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
-    mandir="$ac_optarg" ;;
+    mandir=$ac_optarg ;;
 
   -nfp | --nfp | --nf)
     # Obsolete; use --without-fp.
     with_fp=no ;;
 
   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
 
   -nfp | --nfp | --nf)
     # Obsolete; use --without-fp.
     with_fp=no ;;
 
   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
-  | --no-cr | --no-c)
+  | --no-cr | --no-c | -n)
     no_create=yes ;;
 
   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
     no_create=yes ;;
 
   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
@@ -345,26 +1082,26 @@ EOF
   -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
   | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
   | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
   -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
   | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
   | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
-    oldincludedir="$ac_optarg" ;;
+    oldincludedir=$ac_optarg ;;
 
   -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
     ac_prev=prefix ;;
   -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
 
   -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
     ac_prev=prefix ;;
   -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
-    prefix="$ac_optarg" ;;
+    prefix=$ac_optarg ;;
 
   -program-prefix | --program-prefix | --program-prefi | --program-pref \
   | --program-pre | --program-pr | --program-p)
     ac_prev=program_prefix ;;
   -program-prefix=* | --program-prefix=* | --program-prefi=* \
   | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
 
   -program-prefix | --program-prefix | --program-prefi | --program-pref \
   | --program-pre | --program-pr | --program-p)
     ac_prev=program_prefix ;;
   -program-prefix=* | --program-prefix=* | --program-prefi=* \
   | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
-    program_prefix="$ac_optarg" ;;
+    program_prefix=$ac_optarg ;;
 
   -program-suffix | --program-suffix | --program-suffi | --program-suff \
   | --program-suf | --program-su | --program-s)
     ac_prev=program_suffix ;;
   -program-suffix=* | --program-suffix=* | --program-suffi=* \
   | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
 
   -program-suffix | --program-suffix | --program-suffi | --program-suff \
   | --program-suf | --program-su | --program-s)
     ac_prev=program_suffix ;;
   -program-suffix=* | --program-suffix=* | --program-suffi=* \
   | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
-    program_suffix="$ac_optarg" ;;
+    program_suffix=$ac_optarg ;;
 
   -program-transform-name | --program-transform-name \
   | --program-transform-nam | --program-transform-na \
 
   -program-transform-name | --program-transform-name \
   | --program-transform-nam | --program-transform-na \
@@ -381,7 +1118,17 @@ EOF
   | --program-transfo=* | --program-transf=* \
   | --program-trans=* | --program-tran=* \
   | --progr-tra=* | --program-tr=* | --program-t=*)
   | --program-transfo=* | --program-transf=* \
   | --program-trans=* | --program-tran=* \
   | --progr-tra=* | --program-tr=* | --program-t=*)
-    program_transform_name="$ac_optarg" ;;
+    program_transform_name=$ac_optarg ;;
+
+  -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd)
+    ac_prev=pdfdir ;;
+  -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*)
+    pdfdir=$ac_optarg ;;
+
+  -psdir | --psdir | --psdi | --psd | --ps)
+    ac_prev=psdir ;;
+  -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)
+    psdir=$ac_optarg ;;
 
   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
   | -silent | --silent | --silen | --sile | --sil)
 
   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
   | -silent | --silent | --silen | --sile | --sil)
@@ -391,7 +1138,7 @@ EOF
     ac_prev=sbindir ;;
   -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
   | --sbi=* | --sb=*)
     ac_prev=sbindir ;;
   -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
   | --sbi=* | --sb=*)
-    sbindir="$ac_optarg" ;;
+    sbindir=$ac_optarg ;;
 
   -sharedstatedir | --sharedstatedir | --sharedstatedi \
   | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
 
   -sharedstatedir | --sharedstatedir | --sharedstatedi \
   | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
@@ -402,58 +1149,67 @@ EOF
   | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
   | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
   | --sha=* | --sh=*)
   | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
   | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
   | --sha=* | --sh=*)
-    sharedstatedir="$ac_optarg" ;;
+    sharedstatedir=$ac_optarg ;;
 
   -site | --site | --sit)
     ac_prev=site ;;
   -site=* | --site=* | --sit=*)
 
   -site | --site | --sit)
     ac_prev=site ;;
   -site=* | --site=* | --sit=*)
-    site="$ac_optarg" ;;
+    site=$ac_optarg ;;
 
   -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
     ac_prev=srcdir ;;
   -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
 
   -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
     ac_prev=srcdir ;;
   -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
-    srcdir="$ac_optarg" ;;
+    srcdir=$ac_optarg ;;
 
   -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
   | --syscon | --sysco | --sysc | --sys | --sy)
     ac_prev=sysconfdir ;;
   -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
   | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
 
   -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
   | --syscon | --sysco | --sysc | --sys | --sy)
     ac_prev=sysconfdir ;;
   -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
   | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
-    sysconfdir="$ac_optarg" ;;
+    sysconfdir=$ac_optarg ;;
 
   -target | --target | --targe | --targ | --tar | --ta | --t)
 
   -target | --target | --targe | --targ | --tar | --ta | --t)
-    ac_prev=target ;;
+    ac_prev=target_alias ;;
   -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
   -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
-    target="$ac_optarg" ;;
+    target_alias=$ac_optarg ;;
 
   -v | -verbose | --verbose | --verbos | --verbo | --verb)
     verbose=yes ;;
 
 
   -v | -verbose | --verbose | --verbos | --verbo | --verb)
     verbose=yes ;;
 
-  -version | --version | --versio | --versi | --vers)
-    echo "configure generated by autoconf version 2.13"
-    exit 0 ;;
+  -version | --version | --versio | --versi | --vers | -V)
+    ac_init_version=: ;;
 
   -with-* | --with-*)
 
   -with-* | --with-*)
-    ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
+    ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
     # Reject names that are not valid shell variable names.
     # Reject names that are not valid shell variable names.
-    if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
-      { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
-    fi
-    ac_package=`echo $ac_package| sed 's/-/_/g'`
-    case "$ac_option" in
-      *=*) ;;
-      *) ac_optarg=yes ;;
+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+      as_fn_error $? "invalid package name: $ac_useropt"
+    ac_useropt_orig=$ac_useropt
+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    case $ac_user_opts in
+      *"
+"with_$ac_useropt"
+"*) ;;
+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig"
+        ac_unrecognized_sep=', ';;
     esac
     esac
-    eval "with_${ac_package}='$ac_optarg'" ;;
+    eval with_$ac_useropt=\$ac_optarg ;;
 
   -without-* | --without-*)
 
   -without-* | --without-*)
-    ac_package=`echo $ac_option|sed -e 's/-*without-//'`
+    ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'`
     # Reject names that are not valid shell variable names.
     # Reject names that are not valid shell variable names.
-    if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
-      { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
-    fi
-    ac_package=`echo $ac_package| sed 's/-/_/g'`
-    eval "with_${ac_package}=no" ;;
+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+      as_fn_error $? "invalid package name: $ac_useropt"
+    ac_useropt_orig=$ac_useropt
+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    case $ac_user_opts in
+      *"
+"with_$ac_useropt"
+"*) ;;
+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig"
+        ac_unrecognized_sep=', ';;
+    esac
+    eval with_$ac_useropt=no ;;
 
   --x)
     # Obsolete; use --with-x.
 
   --x)
     # Obsolete; use --with-x.
     ac_prev=x_includes ;;
   -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
   | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
     ac_prev=x_includes ;;
   -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
   | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
-    x_includes="$ac_optarg" ;;
+    x_includes=$ac_optarg ;;
 
   -x-libraries | --x-libraries | --x-librarie | --x-librari \
   | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
     ac_prev=x_libraries ;;
   -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
   | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
 
   -x-libraries | --x-libraries | --x-librarie | --x-librari \
   | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
     ac_prev=x_libraries ;;
   -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
   | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
-    x_libraries="$ac_optarg" ;;
+    x_libraries=$ac_optarg ;;
 
 
-  -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
+  -*) as_fn_error $? "unrecognized option: \`$ac_option'
+Try \`$0 --help' for more information"
     ;;
 
     ;;
 
+  *=*)
+    ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
+    # Reject names that are not valid shell variable names.
+    case $ac_envvar in #(
+      '' | [0-9]* | *[!_$as_cr_alnum]* )
+      as_fn_error $? "invalid variable name: \`$ac_envvar'" ;;
+    esac
+    eval $ac_envvar=\$ac_optarg
+    export $ac_envvar ;;
+
   *)
   *)
-    if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
-      echo "configure: warning: $ac_option: invalid host type" 1>&2
-    fi
-    if test "x$nonopt" != xNONE; then
-      { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
-    fi
-    nonopt="$ac_option"
+    # FIXME: should be removed in autoconf 3.0.
+    $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2
+    expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
+      $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2
+    : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}"
     ;;
 
   esac
 done
 
 if test -n "$ac_prev"; then
     ;;
 
   esac
 done
 
 if test -n "$ac_prev"; then
-  { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
+  ac_option=--`echo $ac_prev | sed 's/_/-/g'`
+  as_fn_error $? "missing argument to $ac_option"
 fi
 
 fi
 
-trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
-
-# File descriptor usage:
-# 0 standard input
-# 1 file creation
-# 2 errors and warnings
-# 3 some systems may open it to /dev/tty
-# 4 used on the Kubota Titan
-# 6 checking for... messages and results
-# 5 compiler messages saved in config.log
-if test "$silent" = yes; then
-  exec 6>/dev/null
-else
-  exec 6>&1
+if test -n "$ac_unrecognized_opts"; then
+  case $enable_option_checking in
+    no) ;;
+    fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;;
+    *)     $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;;
+  esac
 fi
 fi
-exec 5>./config.log
 
 
-echo "\
-This file contains any messages produced by compilers while
-running configure, to aid debugging if configure makes a mistake.
-" 1>&5
-
-# Strip out --no-create and --no-recursion so they do not pile up.
-# Also quote any args containing shell metacharacters.
-ac_configure_args=
-for ac_arg
+# Check all directory arguments for consistency.
+for ac_var in  exec_prefix prefix bindir sbindir libexecdir datarootdir \
+               datadir sysconfdir sharedstatedir localstatedir includedir \
+               oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
+               libdir localedir mandir
 do
 do
-  case "$ac_arg" in
-  -no-create | --no-create | --no-creat | --no-crea | --no-cre \
-  | --no-cr | --no-c) ;;
-  -no-recursion | --no-recursion | --no-recursio | --no-recursi \
-  | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
-  *" "*|*"     "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
-  ac_configure_args="$ac_configure_args '$ac_arg'" ;;
-  *) ac_configure_args="$ac_configure_args $ac_arg" ;;
+  eval ac_val=\$$ac_var
+  # Remove trailing slashes.
+  case $ac_val in
+    */ )
+      ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'`
+      eval $ac_var=\$ac_val;;
+  esac
+  # Be sure to have absolute directory names.
+  case $ac_val in
+    [\\/$]* | ?:[\\/]* )  continue;;
+    NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
   esac
   esac
+  as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val"
 done
 
 done
 
-# NLS nuisances.
-# Only set these to C if already set.  These must not be set unconditionally
-# because not all systems understand e.g. LANG=C (notably SCO).
-# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
-# Non-C LC_CTYPE values break the ctype check.
-if test "${LANG+set}"   = set; then LANG=C;   export LANG;   fi
-if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
-if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
-if test "${LC_CTYPE+set}"    = set; then LC_CTYPE=C;    export LC_CTYPE;    fi
+# There might be people who depend on the old broken behavior: `$host'
+# used to hold the argument of --host etc.
+# FIXME: To remove some day.
+build=$build_alias
+host=$host_alias
+target=$target_alias
+
+# FIXME: To remove some day.
+if test "x$host_alias" != x; then
+  if test "x$build_alias" = x; then
+    cross_compiling=maybe
+  elif test "x$build_alias" != "x$host_alias"; then
+    cross_compiling=yes
+  fi
+fi
 
 
-# confdefs.h avoids OS command line length limits that DEFS can exceed.
-rm -rf conftest* confdefs.h
-# AIX cpp loses on an empty file, so make sure it contains at least a newline.
-echo > confdefs.h
+ac_tool_prefix=
+test -n "$host_alias" && ac_tool_prefix=$host_alias-
+
+test "$silent" = yes && exec 6>/dev/null
+
+
+ac_pwd=`pwd` && test -n "$ac_pwd" &&
+ac_ls_di=`ls -di .` &&
+ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
+  as_fn_error $? "working directory cannot be determined"
+test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
+  as_fn_error $? "pwd does not report name of working directory"
 
 
-# A filename unique to this package, relative to the directory that
-# configure is in, which we can look for to find out if srcdir is correct.
-ac_unique_file=driver/subprocs.c
 
 # Find the source files, if location was not specified.
 if test -z "$srcdir"; then
   ac_srcdir_defaulted=yes
 
 # Find the source files, if location was not specified.
 if test -z "$srcdir"; then
   ac_srcdir_defaulted=yes
-  # Try the directory containing this script, then its parent.
-  ac_prog=$0
-  ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
-  test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
+  # Try the directory containing this script, then the parent directory.
+  ac_confdir=`$as_dirname -- "$as_myself" ||
+$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+        X"$as_myself" : 'X\(//\)[^/]' \| \
+        X"$as_myself" : 'X\(//\)$' \| \
+        X"$as_myself" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_myself" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)[^/].*/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`
   srcdir=$ac_confdir
   srcdir=$ac_confdir
-  if test ! -r $srcdir/$ac_unique_file; then
+  if test ! -r "$srcdir/$ac_unique_file"; then
     srcdir=..
   fi
 else
   ac_srcdir_defaulted=no
 fi
     srcdir=..
   fi
 else
   ac_srcdir_defaulted=no
 fi
-if test ! -r $srcdir/$ac_unique_file; then
-  if test "$ac_srcdir_defaulted" = yes; then
-    { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
-  else
-    { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
-  fi
-fi
-srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
-
-# Prefer explicitly selected file to automatically selected ones.
-if test -z "$CONFIG_SITE"; then
-  if test "x$prefix" != xNONE; then
-    CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
-  else
-    CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
-  fi
-fi
-for ac_site_file in $CONFIG_SITE; do
-  if test -r "$ac_site_file"; then
-    echo "loading site script $ac_site_file"
-    . "$ac_site_file"
-  fi
-done
-
-if test -r "$cache_file"; then
-  echo "loading cache $cache_file"
-  . $cache_file
-else
-  echo "creating cache $cache_file"
-  > $cache_file
-fi
-
-ac_ext=c
-# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cc_cross
-
-ac_exeext=
-ac_objext=o
-if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
-  # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
-  if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
-    ac_n= ac_c='
-' ac_t='       '
-  else
-    ac_n=-n ac_c= ac_t=
-  fi
-else
-  ac_n= ac_c='\c' ac_t=
-fi
-
-
-
-
-echo "current directory: `pwd`"
-echo "command line was: $0 $@"
-
-
-# After checking to see that --srcdir is correct (which AC_INIT does)
-# check for some random other files that come later in the tar file,
-# to make sure everything is here.
-#
-for d in driver utils hacks hacks/glx ; do
-  f=$srcdir/$d/Makefile.in
-  if test \! -r $f ; then
-    echo ""
-    echo "ERROR: The package is incomplete: $f does not exist."
-    echo "       This probably means that your download was truncated."
-    echo ""
-    exit 1
-  fi
+if test ! -r "$srcdir/$ac_unique_file"; then
+  test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
+  as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir"
+fi
+ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
+ac_abs_confdir=`(
+       cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg"
+       pwd)`
+# When building in place, set srcdir=.
+if test "$ac_abs_confdir" = "$ac_pwd"; then
+  srcdir=.
+fi
+# Remove unnecessary trailing slashes from srcdir.
+# Double slashes in file names in object file debugging info
+# mess up M-x gdb in Emacs.
+case $srcdir in
+*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;;
+esac
+for ac_var in $ac_precious_vars; do
+  eval ac_env_${ac_var}_set=\${${ac_var}+set}
+  eval ac_env_${ac_var}_value=\$${ac_var}
+  eval ac_cv_env_${ac_var}_set=\${${ac_var}+set}
+  eval ac_cv_env_${ac_var}_value=\$${ac_var}
 done
 
 done
 
-
-###############################################################################
 #
 #
-#       Function to figure out how to run the compiler.
+# Report the --help message.
 #
 #
-###############################################################################
+if test "$ac_init_help" = "long"; then
+  # Omit some internal or obsolete options to make the list less imposing.
+  # This message is too long to be a string in the A/UX 3.1 sh.
+  cat <<_ACEOF
+\`configure' configures this package to adapt to many kinds of systems.
 
 
+Usage: $0 [OPTION]... [VAR=VALUE]...
 
 
+To assign environment variables (e.g., CC, CFLAGS...), specify them as
+VAR=VALUE.  See below for descriptions of some of the useful variables.
 
 
+Defaults for the options are specified in brackets.
 
 
-###############################################################################
-#
-#       Functions to figure out how to disable // comments in ANSI C code.
-#
-#       (With recent gcc, this is done with "-std=c89".  With older gcc, this
-#       is done by passing "-lang-c89" to cpp, by passing "-Wp,-lang-c89" to
-#       gcc.  Old gcc doesn't support -std, and new gcc doesn't support -lang.
-#       so much for compatibility!)
-#
-###############################################################################
 
 
+Configuration:
 
 
+  -h, --help              display this help and exit
+      --help=short        display options specific to this package
+      --help=recursive    display the short help of all the included packages
+  -V, --version           display version information and exit
+  -q, --quiet, --silent   do not print \`checking ...' messages
+      --cache-file=FILE   cache test results in FILE [disabled]
+  -C, --config-cache      alias for \`--cache-file=config.cache'
+  -n, --no-create         do not create output files
+      --srcdir=DIR        find the sources in DIR [configure dir or \`..']
+
+Installation directories:
+  --prefix=PREFIX         install architecture-independent files in PREFIX
+                          [$ac_default_prefix]
+  --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
+                          [PREFIX]
 
 
+By default, \`make install' will install all the files in
+\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc.  You can specify
+an installation prefix other than \`$ac_default_prefix' using \`--prefix',
+for instance \`--prefix=\$HOME'.
 
 
+For better control, use the options below.
 
 
+Fine tuning of the installation directories:
+  --bindir=DIR            user executables [EPREFIX/bin]
+  --libexecdir=DIR        program executables [EPREFIX/libexec]
+  --libdir=DIR            object code libraries [EPREFIX/lib]
+  --includedir=DIR        C header files [PREFIX/include]
+  --x-includes=DIR        X include files are in DIR
+  --x-libraries=DIR       X library files are in DIR
+  --datarootdir=DIR       read-only arch.-independent data root [PREFIX/share]
+  --datadir=DIR           read-only architecture-independent data [DATAROOTDIR]
+  --localedir=DIR         locale-dependent data [DATAROOTDIR/locale]
+  --mandir=DIR            man documentation [DATAROOTDIR/man]
+  --docdir=DIR            documentation root [DATAROOTDIR/doc/PACKAGE]
+  --htmldir=DIR           html documentation [DOCDIR]
+  --dvidir=DIR            dvi documentation [DOCDIR]
+  --pdfdir=DIR            pdf documentation [DOCDIR]
+  --psdir=DIR             ps documentation [DOCDIR]
+_ACEOF
 
 
-###############################################################################
-#
-#       Function to figure out how to create directory trees.
-#
-###############################################################################
+  cat <<\_ACEOF
 
 
+X features:
+  --x-includes=DIR    X include files are in DIR
+  --x-libraries=DIR   X library files are in DIR
 
 
+System types:
+  --build=BUILD     configure for building on BUILD [guessed]
+  --host=HOST       cross-compile to build programs to run on HOST [BUILD]
+_ACEOF
+fi
 
 
+if test -n "$ac_init_help"; then
 
 
-###############################################################################
-#
-#       Function to check whether gettimeofday() exists, and how to call it.
-#      This may define HAVE_GETTIMEOFDAY and GETTIMEOFDAY_TWO_ARGS.
-#
-###############################################################################
+  cat <<\_ACEOF
 
 
+Optional Features:
+  --disable-option-checking  ignore unrecognized --enable/--with options
+  --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
+  --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
+  --disable-largefile     omit support for large files
 
 
+Screen locking options:
+  --enable-locking        Compile in support for locking the display.
+  --disable-locking       Do not allow locking at all.
 
 
+  --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.
 
 
-###############################################################################
-#
-#       Function to find perl5 (defines PERL and PERL_VERSION.)
-#
-###############################################################################
+Optional Packages:
+  --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
+  --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
 
 
-# M4 sucks!!  perl sucks too!!
 
 
-perl_version_cmd='print $]'
+Installation options:
+  --with-hackdir=DIR      Where to install the hundreds of demo executables.
+                          Default: `PREFIX/libexec/xscreensaver/'
+  --with-configdir=DIR    Where to install the data files that describe each
+                          of the display modes to the GUI.
+                          Default: `PREFIX/share/xscreensaver/config/'
+  --with-x-app-defaults=DIR
+                          Where to install xscreensaver configuration file.
+
+  --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 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 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
+                          (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.
+  --with-xpm              Include support for XPM files in some demos.
+                          (Not needed if Pixbuf is used.)
+  --with-jpeg             Include support for the JPEG library.
+  --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  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 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.)
 
 
-###############################################################################
-#
-#       Function to demand "bc".  Losers.
-#
-###############################################################################
 
 
+Some influential environment variables:
+  CC          C compiler command
+  CFLAGS      C compiler flags
+  LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
+              nonstandard directory <lib dir>
+  LIBS        libraries to pass to the linker, e.g. -l<library>
+  CPPFLAGS    (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if
+              you have headers in a nonstandard directory <include dir>
+  CPP         C preprocessor
+  XMKMF       Path to xmkmf, Makefile generator for X Window System
+
+Use these variables to override the choices made by `configure' or to help
+it to find libraries and programs with nonstandard names/locations.
+
+Report bugs to the package provider.
+_ACEOF
+ac_status=$?
+fi
+
+if test "$ac_init_help" = "recursive"; then
+  # If there are subdirs, report their specific --help.
+  for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
+    test -d "$ac_dir" ||
+      { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } ||
+      continue
+    ac_builddir=.
+
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+  ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
+  # A ".." for each directory in $ac_dir_suffix.
+  ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
+  case $ac_top_builddir_sub in
+  "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+  *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+  esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
+
+case $srcdir in
+  .)  # We are building in place.
+    ac_srcdir=.
+    ac_top_srcdir=$ac_top_builddir_sub
+    ac_abs_top_srcdir=$ac_pwd ;;
+  [\\/]* | ?:[\\/]* )  # Absolute name.
+    ac_srcdir=$srcdir$ac_dir_suffix;
+    ac_top_srcdir=$srcdir
+    ac_abs_top_srcdir=$srcdir ;;
+  *) # Relative name.
+    ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+    ac_top_srcdir=$ac_top_build_prefix$srcdir
+    ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
+esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+
+    cd "$ac_dir" || { ac_status=$?; continue; }
+    # Check for guested configure.
+    if test -f "$ac_srcdir/configure.gnu"; then
+      echo &&
+      $SHELL "$ac_srcdir/configure.gnu" --help=recursive
+    elif test -f "$ac_srcdir/configure"; then
+      echo &&
+      $SHELL "$ac_srcdir/configure" --help=recursive
+    else
+      $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
+    fi || ac_status=$?
+    cd "$ac_pwd" || { ac_status=$?; break; }
+  done
+fi
 
 
+test -n "$ac_init_help" && exit $ac_status
+if $ac_init_version; then
+  cat <<\_ACEOF
+configure
+generated by GNU Autoconf 2.69
+
+Copyright (C) 2012 Free Software Foundation, Inc.
+This configure script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it.
+_ACEOF
+  exit
+fi
+
+## ------------------------ ##
+## Autoconf initialization. ##
+## ------------------------ ##
+
+# ac_fn_c_try_compile LINENO
+# --------------------------
+# Try to compile conftest.$ac_ext, and return whether this succeeded.
+ac_fn_c_try_compile ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  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:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_compile") 2>conftest.err
+  ac_status=$?
+  if test -s conftest.err; then
+    grep -v '^ *+' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+    mv -f conftest.er1 conftest.err
+  fi
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then :
+  ac_retval=0
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_retval=1
+fi
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+  as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_compile
+
+# ac_fn_c_try_run LINENO
+# ----------------------
+# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes
+# that executables *can* be run.
+ac_fn_c_try_run ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  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:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && { ac_try='./conftest$ac_exeext'
+  { { case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+  ac_retval=0
+else
+  $as_echo "$as_me: program exited with status $ac_status" >&5
+       $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_retval=$ac_status
+fi
+  rm -rf conftest.dSYM conftest_ipa8_conftest.oo
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+  as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_run
+
+# ac_fn_c_try_cpp LINENO
+# ----------------------
+# Try to preprocess conftest.$ac_ext, and return whether this succeeded.
+ac_fn_c_try_cpp ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  if { { ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err
+  ac_status=$?
+  if test -s conftest.err; then
+    grep -v '^ *+' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+    mv -f conftest.er1 conftest.err
+  fi
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } > conftest.i && {
+        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       }; then :
+  ac_retval=0
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+    ac_retval=1
+fi
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+  as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_cpp
+
+# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES
+# -------------------------------------------------------
+# Tests whether HEADER exists, giving a warning if it cannot be compiled using
+# the include files in INCLUDES and setting the cache variable VAR
+# accordingly.
+ac_fn_c_check_header_mongrel ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  if eval \${$3+:} false; then :
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval \${$3+:} false; then :
+  $as_echo_n "(cached) " >&6
+fi
+eval ac_res=\$$3
+              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+else
+  # Is the header compilable?
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5
+$as_echo_n "checking $2 usability... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$4
+#include <$2>
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_header_compiler=yes
+else
+  ac_header_compiler=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5
+$as_echo "$ac_header_compiler" >&6; }
+
+# Is the header present?
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5
+$as_echo_n "checking $2 presence... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <$2>
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+  ac_header_preproc=yes
+else
+  ac_header_preproc=no
+fi
+rm -rf conftest.err conftest.i conftest.$ac_ext
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5
+$as_echo "$ac_header_preproc" >&6; }
+
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #((
+  yes:no: )
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5
+$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
+    ;;
+  no:yes:* )
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5
+$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;}
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2:     check for missing prerequisite headers?" >&5
+$as_echo "$as_me: WARNING: $2:     check for missing prerequisite headers?" >&2;}
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5
+$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;}
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2:     section \"Present But Cannot Be Compiled\"" >&5
+$as_echo "$as_me: WARNING: $2:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
+    ;;
+esac
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval \${$3+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  eval "$3=\$ac_header_compiler"
+fi
+eval ac_res=\$$3
+              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+fi
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_c_check_header_mongrel
+
+# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES
+# -------------------------------------------------------
+# Tests whether HEADER exists and can be compiled using the include files in
+# INCLUDES, setting the cache variable VAR accordingly.
+ac_fn_c_check_header_compile ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval \${$3+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$4
+#include <$2>
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  eval "$3=yes"
+else
+  eval "$3=no"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+eval ac_res=\$$3
+              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_c_check_header_compile
+
+# ac_fn_c_check_type LINENO TYPE VAR INCLUDES
+# -------------------------------------------
+# Tests whether TYPE exists after having included INCLUDES, setting cache
+# variable VAR accordingly.
+ac_fn_c_check_type ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval \${$3+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  eval "$3=no"
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$4
+int
+main ()
+{
+if (sizeof ($2))
+        return 0;
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$4
+int
+main ()
+{
+if (sizeof (($2)))
+           return 0;
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
 
 
-###############################################################################
-#
-#       Functions to check how to do ICMP PING requests.
-#
-###############################################################################
+else
+  eval "$3=yes"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+eval ac_res=\$$3
+              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
 
 
+} # ac_fn_c_check_type
 
 
+# ac_fn_c_try_link LINENO
+# -----------------------
+# Try to link conftest.$ac_ext, and return whether this succeeded.
+ac_fn_c_try_link ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  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:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_link") 2>conftest.err
+  ac_status=$?
+  if test -s conftest.err; then
+    grep -v '^ *+' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+    mv -f conftest.er1 conftest.err
+  fi
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+        test "$cross_compiling" = yes ||
+        test -x conftest$ac_exeext
+       }; then :
+  ac_retval=0
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_retval=1
+fi
+  # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information
+  # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would
+  # interfere with the next link command; also delete a directory that is
+  # left behind by Apple's compiler.  We do this before executing the actions.
+  rm -rf conftest.dSYM conftest_ipa8_conftest.oo
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+  as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_link
+
+# ac_fn_c_check_func LINENO FUNC VAR
+# ----------------------------------
+# Tests whether FUNC exists, setting the cache variable VAR accordingly
+ac_fn_c_check_func ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval \${$3+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+/* Define $2 to an innocuous variant, in case <limits.h> declares $2.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define $2 innocuous_$2
 
 
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char $2 (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
 
 
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
 
 
+#undef $2
 
 
-###############################################################################
-#
-#       Functions to check for various X11 crap.
-#
-###############################################################################
+/* 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 $2 ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined __stub_$2 || defined __stub___$2
+choke me
+#endif
 
 
-# Try and find the app-defaults directory.
-# It sucks that autoconf doesn't do this already...
-#
+int
+main ()
+{
+return $2 ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  eval "$3=yes"
+else
+  eval "$3=no"
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+fi
+eval ac_res=\$$3
+              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
 
 
+} # ac_fn_c_check_func
+cat >config.log <<_ACEOF
+This file contains any messages produced by compilers while
+running configure, to aid debugging if configure makes a mistake.
 
 
+It was created by $as_me, which was
+generated by GNU Autoconf 2.69.  Invocation command line was
 
 
+  $ $0 $@
 
 
+_ACEOF
+exec 5>>config.log
+{
+cat <<_ASUNAME
+## --------- ##
+## Platform. ##
+## --------- ##
 
 
+hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
+uname -m = `(uname -m) 2>/dev/null || echo unknown`
+uname -r = `(uname -r) 2>/dev/null || echo unknown`
+uname -s = `(uname -s) 2>/dev/null || echo unknown`
+uname -v = `(uname -v) 2>/dev/null || echo unknown`
 
 
+/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
+/bin/uname -X     = `(/bin/uname -X) 2>/dev/null     || echo unknown`
 
 
+/bin/arch              = `(/bin/arch) 2>/dev/null              || echo unknown`
+/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null       || echo unknown`
+/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
+/usr/bin/hostinfo      = `(/usr/bin/hostinfo) 2>/dev/null      || echo unknown`
+/bin/machine           = `(/bin/machine) 2>/dev/null           || echo unknown`
+/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null       || echo unknown`
+/bin/universe          = `(/bin/universe) 2>/dev/null          || echo unknown`
 
 
+_ASUNAME
 
 
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    $as_echo "PATH: $as_dir"
+  done
+IFS=$as_save_IFS
 
 
-# Random special-cases for X on certain pathological OSes.
-# You know who you are.
-#
+} >&5
 
 
+cat >&5 <<_ACEOF
 
 
 
 
+## ----------- ##
+## Core tests. ##
+## ----------- ##
 
 
-###############################################################################
-#
-#       Some utility functions to make checking for X things easier.
-#
-###############################################################################
+_ACEOF
 
 
-# Like AC_CHECK_HEADER, but it uses the already-computed -I directories.
-#
 
 
+# Keep a trace of the command line.
+# Strip out --no-create and --no-recursion so they do not pile up.
+# Strip out --silent because we don't want to record it for future runs.
+# Also quote any args containing shell meta-characters.
+# Make two passes to allow for proper duplicate-argument suppression.
+ac_configure_args=
+ac_configure_args0=
+ac_configure_args1=
+ac_must_keep_next=false
+for ac_pass in 1 2
+do
+  for ac_arg
+  do
+    case $ac_arg in
+    -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;
+    -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+    | -silent | --silent | --silen | --sile | --sil)
+      continue ;;
+    *\'*)
+      ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
+    esac
+    case $ac_pass in
+    1) as_fn_append ac_configure_args0 " '$ac_arg'" ;;
+    2)
+      as_fn_append ac_configure_args1 " '$ac_arg'"
+      if test $ac_must_keep_next = true; then
+       ac_must_keep_next=false # Got value, back to normal.
+      else
+       case $ac_arg in
+         *=* | --config-cache | -C | -disable-* | --disable-* \
+         | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
+         | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
+         | -with-* | --with-* | -without-* | --without-* | --x)
+           case "$ac_configure_args0 " in
+             "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
+           esac
+           ;;
+         -* ) ac_must_keep_next=true ;;
+       esac
+      fi
+      as_fn_append ac_configure_args " '$ac_arg'"
+      ;;
+    esac
+  done
+done
+{ ac_configure_args0=; unset ac_configure_args0;}
+{ ac_configure_args1=; unset ac_configure_args1;}
+
+# When interrupted or exit'd, cleanup temporary files, and complete
+# config.log.  We remove comments because anyway the quotes in there
+# would cause problems or look ugly.
+# WARNING: Use '\'' to represent an apostrophe within the trap.
+# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.
+trap 'exit_status=$?
+  # Save into config.log some information that might help in debugging.
+  {
+    echo
+
+    $as_echo "## ---------------- ##
+## Cache variables. ##
+## ---------------- ##"
+    echo
+    # The following way of writing the cache mishandles newlines in values,
+(
+  for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do
+    eval ac_val=\$$ac_var
+    case $ac_val in #(
+    *${as_nl}*)
+      case $ac_var in #(
+      *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
+      esac
+      case $ac_var in #(
+      _ | IFS | as_nl) ;; #(
+      BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
+      *) { eval $ac_var=; unset $ac_var;} ;;
+      esac ;;
+    esac
+  done
+  (set) 2>&1 |
+    case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #(
+    *${as_nl}ac_space=\ *)
+      sed -n \
+       "s/'\''/'\''\\\\'\'''\''/g;
+         s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p"
+      ;; #(
+    *)
+      sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+      ;;
+    esac |
+    sort
+)
+    echo
+
+    $as_echo "## ----------------- ##
+## Output variables. ##
+## ----------------- ##"
+    echo
+    for ac_var in $ac_subst_vars
+    do
+      eval ac_val=\$$ac_var
+      case $ac_val in
+      *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+      esac
+      $as_echo "$ac_var='\''$ac_val'\''"
+    done | sort
+    echo
+
+    if test -n "$ac_subst_files"; then
+      $as_echo "## ------------------- ##
+## File substitutions. ##
+## ------------------- ##"
+      echo
+      for ac_var in $ac_subst_files
+      do
+       eval ac_val=\$$ac_var
+       case $ac_val in
+       *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+       esac
+       $as_echo "$ac_var='\''$ac_val'\''"
+      done | sort
+      echo
+    fi
 
 
-# Like AC_EGREP_HEADER, but it uses the already-computed -I directories.
-#
+    if test -s confdefs.h; then
+      $as_echo "## ----------- ##
+## confdefs.h. ##
+## ----------- ##"
+      echo
+      cat confdefs.h
+      echo
+    fi
+    test "$ac_signal" != 0 &&
+      $as_echo "$as_me: caught signal $ac_signal"
+    $as_echo "$as_me: exit $exit_status"
+  } >&5
+  rm -f core *.core core.conftest.* &&
+    rm -f -r conftest* confdefs* conf$$* $ac_clean_files &&
+    exit $exit_status
+' 0
+for ac_signal in 1 2 13 15; do
+  trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal
+done
+ac_signal=0
 
 
+# confdefs.h avoids OS command line length limits that DEFS can exceed.
+rm -f -r conftest* confdefs.h
 
 
-# Like AC_TRY_COMPILE, but it uses the already-computed -I directories.
-#
+$as_echo "/* confdefs.h */" > confdefs.h
 
 
+# Predefined preprocessor variables.
 
 
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_NAME "$PACKAGE_NAME"
+_ACEOF
 
 
-# Like AC_CHECK_LIB, but it uses the already-computed -I and -L directories.
-# Use this sparingly; it probably doesn't work very well on X programs.
-#
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_TARNAME "$PACKAGE_TARNAME"
+_ACEOF
 
 
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_VERSION "$PACKAGE_VERSION"
+_ACEOF
 
 
-# Like AC_TRY_RUN, but it uses the already-computed -I directories.
-# (But not the -L directories!)
-#
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_STRING "$PACKAGE_STRING"
+_ACEOF
 
 
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
+_ACEOF
 
 
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_URL "$PACKAGE_URL"
+_ACEOF
 
 
 
 
-# Usage: HANDLE_X_PATH_ARG([variable_name],
-#                          [--command-line-option],
-#                          [descriptive string])
-#
-# All of the --with options take three forms:
-#
-#   --with-foo (or --with-foo=yes)
-#   --without-foo (or --with-foo=no)
-#   --with-foo=/DIR
-#
-# This function, HANDLE_X_PATH_ARG, deals with the /DIR case.  When it sees
-# a directory (string beginning with a slash) it checks to see whether
-# /DIR/include and /DIR/lib exist, and adds them to $X_CFLAGS and $X_LIBS
-# as appropriate.
-#
+# Let the site file select an alternate cache file if it wants to.
+# Prefer an explicitly selected file to automatically selected ones.
+ac_site_file1=NONE
+ac_site_file2=NONE
+if test -n "$CONFIG_SITE"; then
+  # We do not want a PATH search for config.site.
+  case $CONFIG_SITE in #((
+    -*)  ac_site_file1=./$CONFIG_SITE;;
+    */*) ac_site_file1=$CONFIG_SITE;;
+    *)   ac_site_file1=./$CONFIG_SITE;;
+  esac
+elif test "x$prefix" != xNONE; then
+  ac_site_file1=$prefix/share/config.site
+  ac_site_file2=$prefix/etc/config.site
+else
+  ac_site_file1=$ac_default_prefix/share/config.site
+  ac_site_file2=$ac_default_prefix/etc/config.site
+fi
+for ac_site_file in "$ac_site_file1" "$ac_site_file2"
+do
+  test "x$ac_site_file" = xNONE && continue
+  if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5
+$as_echo "$as_me: loading site script $ac_site_file" >&6;}
+    sed 's/^/| /' "$ac_site_file" >&5
+    . "$ac_site_file" \
+      || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "failed to load site script $ac_site_file
+See \`config.log' for more details" "$LINENO" 5; }
+  fi
+done
+
+if test -r "$cache_file"; then
+  # Some versions of bash will fail to source /dev/null (special files
+  # actually), so we avoid doing that.  DJGPP emulates it as a regular file.
+  if test /dev/null != "$cache_file" && test -f "$cache_file"; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5
+$as_echo "$as_me: loading cache $cache_file" >&6;}
+    case $cache_file in
+      [\\/]* | ?:[\\/]* ) . "$cache_file";;
+      *)                      . "./$cache_file";;
+    esac
+  fi
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5
+$as_echo "$as_me: creating cache $cache_file" >&6;}
+  >$cache_file
+fi
+
+as_fn_append ac_header_list " stdlib.h"
+as_fn_append ac_header_list " unistd.h"
+as_fn_append ac_header_list " sys/param.h"
+# Check that the precious variables saved in the cache have kept the same
+# value.
+ac_cache_corrupted=false
+for ac_var in $ac_precious_vars; do
+  eval ac_old_set=\$ac_cv_env_${ac_var}_set
+  eval ac_new_set=\$ac_env_${ac_var}_set
+  eval ac_old_val=\$ac_cv_env_${ac_var}_value
+  eval ac_new_val=\$ac_env_${ac_var}_value
+  case $ac_old_set,$ac_new_set in
+    set,)
+      { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
+$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
+      ac_cache_corrupted=: ;;
+    ,set)
+      { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5
+$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
+      ac_cache_corrupted=: ;;
+    ,);;
+    *)
+      if test "x$ac_old_val" != "x$ac_new_val"; then
+       # differences in whitespace do not lead to failure.
+       ac_old_val_w=`echo x $ac_old_val`
+       ac_new_val_w=`echo x $ac_new_val`
+       if test "$ac_old_val_w" != "$ac_new_val_w"; then
+         { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5
+$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
+         ac_cache_corrupted=:
+       else
+         { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5
+$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;}
+         eval $ac_var=\$ac_old_val
+       fi
+       { $as_echo "$as_me:${as_lineno-$LINENO}:   former value:  \`$ac_old_val'" >&5
+$as_echo "$as_me:   former value:  \`$ac_old_val'" >&2;}
+       { $as_echo "$as_me:${as_lineno-$LINENO}:   current value: \`$ac_new_val'" >&5
+$as_echo "$as_me:   current value: \`$ac_new_val'" >&2;}
+      fi;;
+  esac
+  # Pass precious variables to config.status.
+  if test "$ac_new_set" = set; then
+    case $ac_new_val in
+    *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
+    *) ac_arg=$ac_var=$ac_new_val ;;
+    esac
+    case " $ac_configure_args " in
+      *" '$ac_arg' "*) ;; # Avoid dups.  Use of quotes ensures accuracy.
+      *) as_fn_append ac_configure_args " '$ac_arg'" ;;
+    esac
+  fi
+done
+if $ac_cache_corrupted; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+  { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5
+$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;}
+  as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5
+fi
+## -------------------- ##
+## Main body of script. ##
+## -------------------- ##
 
 
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 
 
 
+ac_config_headers="$ac_config_headers config.h"
+
+
+echo "current directory: `pwd`"
+echo "command line was: $0 $@"
 
 
-###############################################################################
 ###############################################################################
 #
 ###############################################################################
 #
-#       End of function definitions.  Now start actually executing stuff.
+#       Autoheader stuff
 #
 ###############################################################################
 #
 ###############################################################################
-###############################################################################
 
 
-# random compiler setup
-ac_aux_dir=
-for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
-  if test -f $ac_dir/install-sh; then
-    ac_aux_dir=$ac_dir
-    ac_install_sh="$ac_aux_dir/install-sh -c"
-    break
-  elif test -f $ac_dir/install.sh; then
-    ac_aux_dir=$ac_dir
-    ac_install_sh="$ac_aux_dir/install.sh -c"
-    break
-  fi
-done
-if test -z "$ac_aux_dir"; then
-  { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; }
-fi
-ac_config_guess=$ac_aux_dir/config.guess
-ac_config_sub=$ac_aux_dir/config.sub
-ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
 
 
 
 
-# Make sure we can run config.sub.
-if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then :
-else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
-fi
-
-echo $ac_n "checking host system type""... $ac_c" 1>&6
-echo "configure:843: checking host system type" >&5
-
-host_alias=$host
-case "$host_alias" in
-NONE)
-  case $nonopt in
-  NONE)
-    if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then :
-    else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; }
-    fi ;;
-  *) host_alias=$nonopt ;;
-  esac ;;
-esac
 
 
-host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias`
-host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
-host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
-host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
-echo "$ac_t""$host" 1>&6
 
 
-# Extract the first word of "gcc", so it can be a program name with args.
-set dummy gcc; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:866: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  if test -n "$CC"; then
-  ac_cv_prog_CC="$CC" # Let the user override the test.
-else
-  IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS=":"
-  ac_dummy="$PATH"
-  for ac_dir in $ac_dummy; do
-    test -z "$ac_dir" && ac_dir=.
-    if test -f $ac_dir/$ac_word; then
-      ac_cv_prog_CC="gcc"
-      break
-    fi
-  done
-  IFS="$ac_save_ifs"
-fi
-fi
-CC="$ac_cv_prog_CC"
-if test -n "$CC"; then
-  echo "$ac_t""$CC" 1>&6
-else
-  echo "$ac_t""no" 1>&6
-fi
 
 
-if test -z "$CC"; then
-  # Extract the first word of "cc", so it can be a program name with args.
-set dummy cc; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:896: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  if test -n "$CC"; then
-  ac_cv_prog_CC="$CC" # Let the user override the test.
-else
-  IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS=":"
-  ac_prog_rejected=no
-  ac_dummy="$PATH"
-  for ac_dir in $ac_dummy; do
-    test -z "$ac_dir" && ac_dir=.
-    if test -f $ac_dir/$ac_word; then
-      if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
-        ac_prog_rejected=yes
-       continue
-      fi
-      ac_cv_prog_CC="cc"
-      break
-    fi
-  done
-  IFS="$ac_save_ifs"
-if test $ac_prog_rejected = yes; then
-  # We found a bogon in the path, so make sure we never use it.
-  set dummy $ac_cv_prog_CC
-  shift
-  if test $# -gt 0; then
-    # We chose a different compiler from the bogus one.
-    # However, it has the same basename, so the bogon will be chosen
-    # first if we set CC to just the basename; use the full file name.
-    shift
-    set dummy "$ac_dir/$ac_word" "$@"
-    shift
-    ac_cv_prog_CC="$@"
-  fi
-fi
-fi
-fi
-CC="$ac_cv_prog_CC"
-if test -n "$CC"; then
-  echo "$ac_t""$CC" 1>&6
-else
-  echo "$ac_t""no" 1>&6
-fi
 
 
-  if test -z "$CC"; then
-    case "`uname -s`" in
-    *win32* | *WIN32*)
-      # Extract the first word of "cl", so it can be a program name with args.
-set dummy cl; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:947: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  if test -n "$CC"; then
-  ac_cv_prog_CC="$CC" # Let the user override the test.
-else
-  IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS=":"
-  ac_dummy="$PATH"
-  for ac_dir in $ac_dummy; do
-    test -z "$ac_dir" && ac_dir=.
-    if test -f $ac_dir/$ac_word; then
-      ac_cv_prog_CC="cl"
-      break
-    fi
-  done
-  IFS="$ac_save_ifs"
-fi
-fi
-CC="$ac_cv_prog_CC"
-if test -n "$CC"; then
-  echo "$ac_t""$CC" 1>&6
-else
-  echo "$ac_t""no" 1>&6
-fi
- ;;
-    esac
-  fi
-  test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
-fi
+# 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.])
 
 
-echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:979: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+# 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.)])
 
 
-ac_ext=c
-# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cc_cross
+# 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.])
 
 
-cat > conftest.$ac_ext << EOF
+# 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.])
 
 
-#line 990 "configure"
-#include "confdefs.h"
 
 
-main(){return(0);}
-EOF
-if { (eval echo configure:995: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  ac_cv_prog_cc_works=yes
-  # If we can't run a trivial program, we are probably using a cross compiler.
-  if (./conftest; exit) 2>/dev/null; then
-    ac_cv_prog_cc_cross=no
-  else
-    ac_cv_prog_cc_cross=yes
-  fi
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  ac_cv_prog_cc_works=no
-fi
-rm -fr conftest*
-ac_ext=c
-# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cc_cross
 
 
-echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
-if test $ac_cv_prog_cc_works = no; then
-  { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
-fi
-echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:1021: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
-echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
-cross_compiling=$ac_cv_prog_cc_cross
 
 
-echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
-echo "configure:1026: checking whether we are using GNU C" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  cat > conftest.c <<EOF
-#ifdef __GNUC__
-  yes;
-#endif
-EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1035: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
-  ac_cv_prog_gcc=yes
-else
-  ac_cv_prog_gcc=no
-fi
-fi
 
 
-echo "$ac_t""$ac_cv_prog_gcc" 1>&6
 
 
-if test $ac_cv_prog_gcc = yes; then
-  GCC=yes
-else
-  GCC=
-fi
 
 
-ac_test_CFLAGS="${CFLAGS+set}"
-ac_save_CFLAGS="$CFLAGS"
-CFLAGS=
-echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:1054: checking whether ${CC-cc} accepts -g" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  echo 'void f(){}' > conftest.c
-if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
-  ac_cv_prog_cc_g=yes
-else
-  ac_cv_prog_cc_g=no
-fi
-rm -f conftest*
 
 
-fi
 
 
-echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
-if test "$ac_test_CFLAGS" = set; then
-  CFLAGS="$ac_save_CFLAGS"
-elif test $ac_cv_prog_cc_g = yes; then
-  if test "$GCC" = yes; then
-    CFLAGS="-g -O2"
-  else
-    CFLAGS="-g"
-  fi
-else
-  if test "$GCC" = yes; then
-    CFLAGS="-O2"
-  else
-    CFLAGS=
-  fi
-fi
 
 
 
 
-  if test -z "$GCC"; then
-    echo $ac_n "checking how to request ANSI compilation""... $ac_c" 1>&6
-echo "configure:1088: checking how to request ANSI compilation" >&5
-    case "$host" in
-      *-hpux* )
-        echo "$ac_t""HPUX: adding -Ae" 1>&6
-        CC="$CC -Ae"
-      ;;
-      *-aix* )
-        echo "$ac_t""AIX: adding -qlanglvl=ansi -qhalt=e" 1>&6
-        CC="$CC -qlanglvl=ansi -qhalt=e"
-      ;;
 
 
-      *-dec-* )
-        echo "$ac_t""DEC: adding -std1 -ieee" 1>&6
-        CC="$CC -std1"
-      ;;
 
 
-      *)
-        echo "$ac_t""no idea" 1>&6
-      ;;
-    esac
-  fi
 
 
-  echo $ac_n "checking whether the compiler works on ANSI C""... $ac_c" 1>&6
-echo "configure:1111: checking whether the compiler works on ANSI C" >&5
-  if test "$cross_compiling" = yes; then
-  { echo "configure: error: Couldn't build even a trivial ANSI C program: check CC." 1>&2; exit 1; }
-else
-  cat > conftest.$ac_ext <<EOF
-#line 1116 "configure"
-#include "confdefs.h"
- main(int ac, char **av) { return 0; } 
-EOF
-if { (eval echo configure:1120: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
-then
-  echo "$ac_t""yes" 1>&6
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -fr conftest*
-  echo "$ac_t""no" 1>&6
-     { echo "configure: error: Couldn't build even a trivial ANSI C program: check CC." 1>&2; exit 1; }
-fi
-rm -fr conftest*
-fi
 
 
 
 
-  if test -n "$GCC"; then
-    echo "$ac_t""Turning on gcc compiler warnings." 1>&6
-    CC="$CC -Wall -Wstrict-prototypes -Wnested-externs -Wno-format"
-  else
-    case "$host" in
-      *-irix5* |*-irix6.0-3* )
-        echo "$ac_t""Turning on SGI compiler warnings." 1>&6
-        CC="$CC -fullwarn -use_readonly_const -rdata_shared -g3"
-      ;;
-#     *-dec-osf* )
-#       if test -z "$GCC"; then
-#         AC_MSG_RESULT(Turning on DEC C compiler warnings.)
-#         CC="$CC -migrate -w0 -verbose -warnprotos"
-#       fi
-#     ;;
-    esac
-  fi
 
 
-if test -n "$GCC"; then
-   if test -n "$GCC"; then
-   echo $ac_n "checking whether gcc accepts -std""... $ac_c" 1>&6
-echo "configure:1155: checking whether gcc accepts -std" >&5
-if eval "test \"`echo '$''{'ac_cv_gcc_accepts_std'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  if ( gcc -E -std=c89 - </dev/null 2>&1 >/dev/null | \
-          grep unrecognized >/dev/null ); then
-       ac_cv_gcc_accepts_std=no
-     else
-       ac_cv_gcc_accepts_std=yes
-     fi
-fi
 
 
-echo "$ac_t""$ac_cv_gcc_accepts_std" 1>&6
-   ac_gcc_accepts_std="$ac_cv_gcc_accepts_std"
-  fi
 
 
-   echo "$ac_t""Disabling C++ comments in ANSI C code." 1>&6
-   #
-   # The reason that // comments are banned from xscreensaver is that gcc is
-   # basically the only compiler in the world that supports them in C code.
-   # All other vendors support them only in their C++ compilers, not in their
-   # ANSI C compilers.  This means that it's a portability problem: every time
-   # these comments have snuck into the xscreensaver source code, I've gotten
-   # complaints about it the next day.  So we turn off support for them in gcc
-   # as well to prevent them from accidentially slipping in.
-   #
-   if test "$ac_gcc_accepts_std" = yes ; then
-     #
-     # -std=c89 defines __STRICT_ANSI__, which we don't want.
-     # (That appears to be the only additional preprocessor symbol
-     # it defines, in addition to the syntax changes it makes.)
-     #
-     # -std=gnu89 is no good, because // comments were a GNU extension
-     # before they were in the ANSI C 99 spec...  (gcc 2.96 permits //
-     # with -std=gnu89 but not with -std=c89.)
-     #
-     CC="$CC -std=c89 -U__STRICT_ANSI__"
-   else
-     # The old way:
-     CC="$CC -Wp,-lang-c89"
-   fi
-  fi
 
 
-echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:1199: checking how to run the C preprocessor" >&5
-# On Suns, sometimes $CPP names a directory.
-if test -n "$CPP" && test -d "$CPP"; then
-  CPP=
-fi
-if test -z "$CPP"; then
-if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-    # This must be in double quotes, not single quotes, because CPP may get
-  # substituted into the Makefile and "${CC-cc}" will confuse make.
-  CPP="${CC-cc} -E"
-  # On the NeXT, cc -E runs the code through the compiler's parser,
-  # not just through cpp.
-  cat > conftest.$ac_ext <<EOF
-#line 1214 "configure"
-#include "confdefs.h"
-#include <assert.h>
-Syntax Error
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1220: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
-  :
-else
-  echo "$ac_err" >&5
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  CPP="${CC-cc} -E -traditional-cpp"
-  cat > conftest.$ac_ext <<EOF
-#line 1231 "configure"
-#include "confdefs.h"
-#include <assert.h>
-Syntax Error
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1237: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
-  :
-else
-  echo "$ac_err" >&5
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  CPP="${CC-cc} -nologo -E"
-  cat > conftest.$ac_ext <<EOF
-#line 1248 "configure"
-#include "confdefs.h"
-#include <assert.h>
-Syntax Error
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1254: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
-  :
-else
-  echo "$ac_err" >&5
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  CPP=/lib/cpp
-fi
-rm -f conftest*
-fi
-rm -f conftest*
-fi
-rm -f conftest*
-  ac_cv_prog_CPP="$CPP"
-fi
-  CPP="$ac_cv_prog_CPP"
-else
-  ac_cv_prog_CPP="$CPP"
-fi
-echo "$ac_t""$CPP" 1>&6
 
 
-echo $ac_n "checking for working const""... $ac_c" 1>&6
-echo "configure:1279: checking for working const" >&5
-if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  cat > conftest.$ac_ext <<EOF
-#line 1284 "configure"
-#include "confdefs.h"
 
 
-int main() {
-
-/* Ultrix mips cc rejects this.  */
-typedef int charset[2]; const charset x;
-/* SunOS 4.1.1 cc rejects this.  */
-char const *const *ccp;
-char **p;
-/* NEC SVR4.0.2 mips cc rejects this.  */
-struct point {int x, y;};
-static struct point const zero = {0,0};
-/* AIX XL C 1.02.0.0 rejects this.
-   It does not let you subtract one const X* pointer from another in an arm
-   of an if-expression whose if-part is not a constant expression */
-const char *g = "string";
-ccp = &g + (g ? g-g : 0);
-/* HPUX 7.0 cc rejects these. */
-++ccp;
-p = (char**) ccp;
-ccp = (char const *const *) p;
-{ /* SCO 3.2v4 cc rejects this.  */
-  char *t;
-  char const *s = 0 ? (char *) 0 : (char const *) 0;
-
-  *t++ = 0;
-}
-{ /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
-  int x[] = {25, 17};
-  const int *foo = &x[0];
-  ++foo;
-}
-{ /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
-  typedef const int *iptr;
-  iptr p = 0;
-  ++p;
-}
-{ /* AIX XL C 1.02.0.0 rejects this saying
-     "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
-  struct s { int j; const int *ap[3]; };
-  struct s *b; b->j = 5;
-}
-{ /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
-  const int foo = 10;
-}
-
-; return 0; }
-EOF
-if { (eval echo configure:1333: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
-  rm -rf conftest*
-  ac_cv_c_const=yes
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  ac_cv_c_const=no
-fi
-rm -f conftest*
-fi
 
 
-echo "$ac_t""$ac_cv_c_const" 1>&6
-if test $ac_cv_c_const = no; then
-  cat >> confdefs.h <<\EOF
-#define const 
-EOF
 
 
-fi
 
 
-echo $ac_n "checking for inline""... $ac_c" 1>&6
-echo "configure:1354: checking for inline" >&5
-if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  ac_cv_c_inline=no
-for ac_kw in inline __inline__ __inline; do
-  cat > conftest.$ac_ext <<EOF
-#line 1361 "configure"
-#include "confdefs.h"
 
 
-int main() {
-} $ac_kw foo() {
-; return 0; }
-EOF
-if { (eval echo configure:1368: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
-  rm -rf conftest*
-  ac_cv_c_inline=$ac_kw; break
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-fi
-rm -f conftest*
-done
 
 
-fi
 
 
-echo "$ac_t""$ac_cv_c_inline" 1>&6
-case "$ac_cv_c_inline" in
-  inline | yes) ;;
-  no) cat >> confdefs.h <<\EOF
-#define inline 
-EOF
- ;;
-  *)  cat >> confdefs.h <<EOF
-#define inline $ac_cv_c_inline
-EOF
- ;;
-esac
 
 
-echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6
-echo "configure:1394: checking for Cygwin environment" >&5
-if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  cat > conftest.$ac_ext <<EOF
-#line 1399 "configure"
-#include "confdefs.h"
 
 
-int main() {
 
 
-#ifndef __CYGWIN__
-#define __CYGWIN__ __CYGWIN32__
-#endif
-return __CYGWIN__;
-; return 0; }
-EOF
-if { (eval echo configure:1410: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
-  rm -rf conftest*
-  ac_cv_cygwin=yes
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  ac_cv_cygwin=no
-fi
-rm -f conftest*
-rm -f conftest*
-fi
 
 
-echo "$ac_t""$ac_cv_cygwin" 1>&6
-CYGWIN=
-test "$ac_cv_cygwin" = yes && CYGWIN=yes
-echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6
-echo "configure:1427: checking for mingw32 environment" >&5
-if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  cat > conftest.$ac_ext <<EOF
-#line 1432 "configure"
-#include "confdefs.h"
 
 
-int main() {
-return __MINGW32__;
-; return 0; }
-EOF
-if { (eval echo configure:1439: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
-  rm -rf conftest*
-  ac_cv_mingw32=yes
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  ac_cv_mingw32=no
-fi
-rm -f conftest*
-rm -f conftest*
-fi
 
 
-echo "$ac_t""$ac_cv_mingw32" 1>&6
-MINGW32=
-test "$ac_cv_mingw32" = yes && MINGW32=yes
 
 
 
 
-echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
-echo "configure:1458: checking for executable suffix" >&5
-if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  if test "$CYGWIN" = yes || test "$MINGW32" = yes; then
-  ac_cv_exeext=.exe
-else
-  rm -f conftest*
-  echo 'int main () { return 0; }' > conftest.$ac_ext
-  ac_cv_exeext=
-  if { (eval echo configure:1468: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
-    for file in conftest.*; do
-      case $file in
-      *.c | *.o | *.obj) ;;
-      *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;;
-      esac
-    done
-  else
-    { echo "configure: error: installation or configuration problem: compiler cannot create executables." 1>&2; exit 1; }
-  fi
-  rm -f conftest*
-  test x"${ac_cv_exeext}" = x && ac_cv_exeext=no
-fi
-fi
 
 
-EXEEXT=""
-test x"${ac_cv_exeext}" != xno && EXEEXT=${ac_cv_exeext}
-echo "$ac_t""${ac_cv_exeext}" 1>&6
-ac_exeext=$EXEEXT
 
 
-ac_bc_result=`echo 6+9 | bc 2>/dev/null`
-  echo $ac_n "checking for bc""... $ac_c" 1>&6
-echo "configure:1490: checking for bc" >&5
-  if test "$ac_bc_result" = "15" ; then
-    echo "$ac_t""yes" 1>&6
-  else
-    echo "$ac_t""no" 1>&6
-    echo ''
-    { echo "configure: error: Your system doesn't have \"bc\", which has been a standard
-                  part of Unix since the 1970s.  Come back when your vendor
-                  has grown a clue." 1>&2; exit 1; }
-  fi
 
 
-# stuff for Makefiles
-# Find a good install program.  We prefer a C program (faster),
-# so one script is as good as another.  But avoid the broken or
-# incompatible versions:
-# SysV /etc/install, /usr/sbin/install
-# SunOS /usr/etc/install
-# IRIX /sbin/install
-# AIX /bin/install
-# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
-# AFS /usr/afsws/bin/install, which mishandles nonexistent args
-# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
-# ./install, which can be erroneously created by make from ./install.sh.
-echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
-echo "configure:1515: checking for a BSD compatible install" >&5
-if test -z "$INSTALL"; then
-if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-    IFS="${IFS=        }"; ac_save_IFS="$IFS"; IFS=":"
-  for ac_dir in $PATH; do
-    # Account for people who put trailing slashes in PATH elements.
-    case "$ac_dir/" in
-    /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
-    *)
-      # OSF1 and SCO ODT 3.0 have their own names for install.
-      # Don't use installbsd from OSF since it installs stuff as root
-      # by default.
-      for ac_prog in ginstall scoinst install; do
-        if test -f $ac_dir/$ac_prog; then
-         if test $ac_prog = install &&
-            grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
-           # AIX install.  It has an incompatible calling convention.
-           :
-         else
-           ac_cv_path_install="$ac_dir/$ac_prog -c"
-           break 2
-         fi
-       fi
-      done
-      ;;
-    esac
-  done
-  IFS="$ac_save_IFS"
 
 
-fi
-  if test "${ac_cv_path_install+set}" = set; then
-    INSTALL="$ac_cv_path_install"
-  else
-    # As a last resort, use the slow shell script.  We don't cache a
-    # path for INSTALL within a source directory, because that will
-    # break other packages using the cache if that directory is
-    # removed, or if the path is relative.
-    INSTALL="$ac_install_sh"
-  fi
-fi
-echo "$ac_t""$INSTALL" 1>&6
 
 
-# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
-# It thinks the first close brace ends the variable substitution.
-test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
 
 
-test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
 
 
-test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
 
 
-echo $ac_n "checking whether \"\${INSTALL} -d\" creates intermediate directories""... $ac_c" 1>&6
-echo "configure:1568: checking whether \"\${INSTALL} -d\" creates intermediate directories" >&5
-if eval "test \"`echo '$''{'ac_cv_install_d_creates_dirs'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  ac_cv_install_d_creates_dirs=no
-     rm -rf conftestdir
-     if mkdir conftestdir; then
-       cd conftestdir >&-
-       ${INSTALL} -d `pwd`/dir1/dir2 >&- 2>&-
-       if test -d dir1/dir2/. ; then
-         ac_cv_install_d_creates_dirs=yes
-       fi
-       cd .. >&-
-       rm -rf conftestdir
-     fi
-    
-fi
 
 
-echo "$ac_t""$ac_cv_install_d_creates_dirs" 1>&6
 
 
-  if test "$ac_cv_install_d_creates_dirs" = no ; then
-    echo $ac_n "checking whether \"mkdir -p\" creates intermediate directories""... $ac_c" 1>&6
-echo "configure:1590: checking whether \"mkdir -p\" creates intermediate directories" >&5
-if eval "test \"`echo '$''{'ac_cv_mkdir_p_creates_dirs'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  ac_cv_mkdir_p_creates_dirs=no
-       rm -rf conftestdir
-       if mkdir conftestdir; then
-         cd conftestdir >&-
-         mkdir -p dir1/dir2 >&- 2>&-
-         if test -d dir1/dir2/. ; then
-           ac_cv_mkdir_p_creates_dirs=yes
-         fi
-         cd .. >&-
-         rm -rf conftestdir
-       fi
-      
-fi
 
 
-echo "$ac_t""$ac_cv_mkdir_p_creates_dirs" 1>&6
-  fi
 
 
-  if test "$ac_cv_install_d_creates_dirs" = yes ; then
-    INSTALL_DIRS='${INSTALL} -d'
-  elif test "$ac_cv_mkdir_p_creates_dirs" = yes ; then
-    INSTALL_DIRS='mkdir -p'
-  else
-    # any other ideas?
-    INSTALL_DIRS='${INSTALL} -d'
-  fi
 
 
-echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
-echo "configure:1621: checking whether ${MAKE-make} sets \${MAKE}" >&5
-set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  cat > conftestmake <<\EOF
-all:
-       @echo 'ac_maketemp="${MAKE}"'
-EOF
-# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
-eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=`
-if test -n "$ac_maketemp"; then
-  eval ac_cv_prog_make_${ac_make}_set=yes
-else
-  eval ac_cv_prog_make_${ac_make}_set=no
-fi
-rm -f conftestmake
-fi
-if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-  SET_MAKE=
-else
-  echo "$ac_t""no" 1>&6
-  SET_MAKE="MAKE=${MAKE-make}"
-fi
 
 
 
 
-# By default, autoconf sets INSTALL_SCRIPT to '${INSTALL_PROGRAM}'.
-# That's wrong: it should be set to '${INSTALL}', so that one can
-# implement the "install-strip" target properly (strip executables,
-# but do not try to strip scripts.)
-#
-INSTALL_SCRIPT='${INSTALL}'
 
 
-# random libc stuff
-echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:1657: checking for ANSI C header files" >&5
-if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  cat > conftest.$ac_ext <<EOF
-#line 1662 "configure"
-#include "confdefs.h"
-#include <stdlib.h>
-#include <stdarg.h>
-#include <string.h>
-#include <float.h>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1670: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
-  rm -rf conftest*
-  ac_cv_header_stdc=yes
-else
-  echo "$ac_err" >&5
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  ac_cv_header_stdc=no
-fi
-rm -f conftest*
 
 
-if test $ac_cv_header_stdc = yes; then
-  # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
-cat > conftest.$ac_ext <<EOF
-#line 1687 "configure"
-#include "confdefs.h"
-#include <string.h>
-EOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  egrep "memchr" >/dev/null 2>&1; then
-  :
-else
-  rm -rf conftest*
-  ac_cv_header_stdc=no
-fi
-rm -f conftest*
 
 
-fi
 
 
-if test $ac_cv_header_stdc = yes; then
-  # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
-cat > conftest.$ac_ext <<EOF
-#line 1705 "configure"
-#include "confdefs.h"
-#include <stdlib.h>
-EOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  egrep "free" >/dev/null 2>&1; then
-  :
-else
-  rm -rf conftest*
-  ac_cv_header_stdc=no
-fi
-rm -f conftest*
 
 
-fi
 
 
-if test $ac_cv_header_stdc = yes; then
-  # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
-if test "$cross_compiling" = yes; then
-  :
-else
-  cat > conftest.$ac_ext <<EOF
-#line 1726 "configure"
-#include "confdefs.h"
-#include <ctype.h>
-#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
-#define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
-#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
-int main () { int i; for (i = 0; i < 256; i++)
-if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
-exit (0); }
 
 
-EOF
-if { (eval echo configure:1737: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
-then
-  :
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -fr conftest*
-  ac_cv_header_stdc=no
-fi
-rm -fr conftest*
-fi
 
 
-fi
-fi
 
 
-echo "$ac_t""$ac_cv_header_stdc" 1>&6
-if test $ac_cv_header_stdc = yes; then
-  cat >> confdefs.h <<\EOF
-#define STDC_HEADERS 1
-EOF
 
 
-fi
 
 
-for ac_hdr in unistd.h
-do
-ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:1764: checking for $ac_hdr" >&5
-if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  cat > conftest.$ac_ext <<EOF
-#line 1769 "configure"
-#include "confdefs.h"
-#include <$ac_hdr>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1774: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
-  rm -rf conftest*
-  eval "ac_cv_header_$ac_safe=yes"
-else
-  echo "$ac_err" >&5
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_header_$ac_safe=no"
-fi
-rm -f conftest*
-fi
-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
-  cat >> confdefs.h <<EOF
-#define $ac_tr_hdr 1
-EOF
-else
-  echo "$ac_t""no" 1>&6
-fi
-done
 
 
-echo $ac_n "checking for mode_t""... $ac_c" 1>&6
-echo "configure:1801: checking for mode_t" >&5
-if eval "test \"`echo '$''{'ac_cv_type_mode_t'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  cat > conftest.$ac_ext <<EOF
-#line 1806 "configure"
-#include "confdefs.h"
-#include <sys/types.h>
-#if STDC_HEADERS
-#include <stdlib.h>
-#include <stddef.h>
-#endif
-EOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  egrep "(^|[^a-zA-Z_0-9])mode_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
-  rm -rf conftest*
-  ac_cv_type_mode_t=yes
-else
-  rm -rf conftest*
-  ac_cv_type_mode_t=no
-fi
-rm -f conftest*
 
 
-fi
-echo "$ac_t""$ac_cv_type_mode_t" 1>&6
-if test $ac_cv_type_mode_t = no; then
-  cat >> confdefs.h <<\EOF
-#define mode_t int
-EOF
 
 
-fi
 
 
-echo $ac_n "checking for pid_t""... $ac_c" 1>&6
-echo "configure:1834: checking for pid_t" >&5
-if eval "test \"`echo '$''{'ac_cv_type_pid_t'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  cat > conftest.$ac_ext <<EOF
-#line 1839 "configure"
-#include "confdefs.h"
-#include <sys/types.h>
-#if STDC_HEADERS
-#include <stdlib.h>
-#include <stddef.h>
-#endif
-EOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  egrep "(^|[^a-zA-Z_0-9])pid_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
-  rm -rf conftest*
-  ac_cv_type_pid_t=yes
-else
-  rm -rf conftest*
-  ac_cv_type_pid_t=no
-fi
-rm -f conftest*
 
 
-fi
-echo "$ac_t""$ac_cv_type_pid_t" 1>&6
-if test $ac_cv_type_pid_t = no; then
-  cat >> confdefs.h <<\EOF
-#define pid_t int
-EOF
 
 
-fi
 
 
-echo $ac_n "checking for size_t""... $ac_c" 1>&6
-echo "configure:1867: checking for size_t" >&5
-if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  cat > conftest.$ac_ext <<EOF
-#line 1872 "configure"
-#include "confdefs.h"
-#include <sys/types.h>
-#if STDC_HEADERS
-#include <stdlib.h>
-#include <stddef.h>
-#endif
-EOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  egrep "(^|[^a-zA-Z_0-9])size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
-  rm -rf conftest*
-  ac_cv_type_size_t=yes
-else
-  rm -rf conftest*
-  ac_cv_type_size_t=no
-fi
-rm -f conftest*
 
 
-fi
-echo "$ac_t""$ac_cv_type_size_t" 1>&6
-if test $ac_cv_type_size_t = no; then
-  cat >> confdefs.h <<\EOF
-#define size_t unsigned
-EOF
 
 
-fi
 
 
-echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
-echo "configure:1900: checking return type of signal handlers" >&5
-if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  cat > conftest.$ac_ext <<EOF
-#line 1905 "configure"
-#include "confdefs.h"
-#include <sys/types.h>
-#include <signal.h>
-#ifdef signal
-#undef signal
-#endif
-#ifdef __cplusplus
-extern "C" void (*signal (int, void (*)(int)))(int);
-#else
-void (*signal ()) ();
-#endif
 
 
-int main() {
-int i;
-; return 0; }
-EOF
-if { (eval echo configure:1922: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
-  rm -rf conftest*
-  ac_cv_type_signal=void
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  ac_cv_type_signal=int
-fi
-rm -f conftest*
-fi
 
 
-echo "$ac_t""$ac_cv_type_signal" 1>&6
-cat >> confdefs.h <<EOF
-#define RETSIGTYPE $ac_cv_type_signal
-EOF
 
 
 
 
-echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
-echo "configure:1941: checking whether time.h and sys/time.h may both be included" >&5
-if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  cat > conftest.$ac_ext <<EOF
-#line 1946 "configure"
-#include "confdefs.h"
-#include <sys/types.h>
-#include <sys/time.h>
-#include <time.h>
-int main() {
-struct tm *tp;
-; return 0; }
-EOF
-if { (eval echo configure:1955: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
-  rm -rf conftest*
-  ac_cv_header_time=yes
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  ac_cv_header_time=no
-fi
-rm -f conftest*
-fi
 
 
-echo "$ac_t""$ac_cv_header_time" 1>&6
-if test $ac_cv_header_time = yes; then
-  cat >> confdefs.h <<\EOF
-#define TIME_WITH_SYS_TIME 1
-EOF
 
 
-fi
 
 
-echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6
-echo "configure:1976: checking for sys/wait.h that is POSIX.1 compatible" >&5
-if eval "test \"`echo '$''{'ac_cv_header_sys_wait_h'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  cat > conftest.$ac_ext <<EOF
-#line 1981 "configure"
-#include "confdefs.h"
-#include <sys/types.h>
-#include <sys/wait.h>
-#ifndef WEXITSTATUS
-#define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
-#endif
-#ifndef WIFEXITED
-#define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
-#endif
-int main() {
-int s;
-wait (&s);
-s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
-; return 0; }
-EOF
-if { (eval echo configure:1997: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
-  rm -rf conftest*
-  ac_cv_header_sys_wait_h=yes
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  ac_cv_header_sys_wait_h=no
-fi
-rm -f conftest*
-fi
 
 
-echo "$ac_t""$ac_cv_header_sys_wait_h" 1>&6
-if test $ac_cv_header_sys_wait_h = yes; then
-  cat >> confdefs.h <<\EOF
-#define HAVE_SYS_WAIT_H 1
-EOF
 
 
-fi
 
 
-ac_header_dirent=no
-for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h
-do
-ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6
-echo "configure:2022: checking for $ac_hdr that defines DIR" >&5
-if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  cat > conftest.$ac_ext <<EOF
-#line 2027 "configure"
-#include "confdefs.h"
-#include <sys/types.h>
-#include <$ac_hdr>
-int main() {
-DIR *dirp = 0;
-; return 0; }
-EOF
-if { (eval echo configure:2035: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
-  rm -rf conftest*
-  eval "ac_cv_header_dirent_$ac_safe=yes"
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_header_dirent_$ac_safe=no"
-fi
-rm -f conftest*
-fi
-if eval "test \"`echo '$ac_cv_header_dirent_'$ac_safe`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
-  cat >> confdefs.h <<EOF
-#define $ac_tr_hdr 1
-EOF
- ac_header_dirent=$ac_hdr; break
-else
-  echo "$ac_t""no" 1>&6
-fi
-done
-# Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
-if test $ac_header_dirent = dirent.h; then
-echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6
-echo "configure:2060: checking for opendir in -ldir" >&5
-ac_lib_var=`echo dir'_'opendir | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  ac_save_LIBS="$LIBS"
-LIBS="-ldir  $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 2068 "configure"
-#include "confdefs.h"
-/* Override any gcc2 internal prototype to avoid an error.  */
-/* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char opendir();
-
-int main() {
-opendir()
-; return 0; }
-EOF
-if { (eval echo configure:2079: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=yes"
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=no"
-fi
-rm -f conftest*
-LIBS="$ac_save_LIBS"
 
 
-fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-  LIBS="$LIBS -ldir"
-else
-  echo "$ac_t""no" 1>&6
-fi
 
 
-else
-echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6
-echo "configure:2101: checking for opendir in -lx" >&5
-ac_lib_var=`echo x'_'opendir | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  ac_save_LIBS="$LIBS"
-LIBS="-lx  $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 2109 "configure"
-#include "confdefs.h"
-/* Override any gcc2 internal prototype to avoid an error.  */
-/* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char opendir();
-
-int main() {
-opendir()
-; return 0; }
-EOF
-if { (eval echo configure:2120: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=yes"
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=no"
-fi
-rm -f conftest*
-LIBS="$ac_save_LIBS"
 
 
-fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-  LIBS="$LIBS -lx"
-else
-  echo "$ac_t""no" 1>&6
-fi
 
 
-fi
 
 
-echo $ac_n "checking how to call gettimeofday""... $ac_c" 1>&6
-echo "configure:2143: checking how to call gettimeofday" >&5
-  if eval "test \"`echo '$''{'ac_cv_gettimeofday_args'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  cat > conftest.$ac_ext <<EOF
-#line 2148 "configure"
-#include "confdefs.h"
-#include <stdlib.h>
-                    #include <sys/time.h>
-int main() {
-struct timeval tv; struct timezone tzp;
-                    gettimeofday(&tv, &tzp);
-; return 0; }
-EOF
-if { (eval echo configure:2157: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
-  rm -rf conftest*
-  ac_gettimeofday_args=2
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  cat > conftest.$ac_ext <<EOF
-#line 2165 "configure"
-#include "confdefs.h"
-#include <stdlib.h>
-                                    #include <sys/time.h>
-int main() {
-struct timeval tv; gettimeofday(&tv);
-; return 0; }
-EOF
-if { (eval echo configure:2173: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
-  rm -rf conftest*
-  ac_gettimeofday_args=1
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  ac_gettimeofday_args=0
-fi
-rm -f conftest*
-fi
-rm -f conftest*
-    ac_cv_gettimeofday_args=$ac_gettimeofday_args
-fi
 
 
-  ac_gettimeofday_args=$ac_cv_gettimeofday_args
-  if test "$ac_gettimeofday_args" = 1 ; then
-    cat >> confdefs.h <<\EOF
-#define HAVE_GETTIMEOFDAY 1
-EOF
 
 
-    echo "$ac_t""one argument" 1>&6
-  elif test "$ac_gettimeofday_args" = 2 ; then
-    cat >> confdefs.h <<\EOF
-#define HAVE_GETTIMEOFDAY 1
-EOF
 
 
-    cat >> confdefs.h <<\EOF
-#define GETTIMEOFDAY_TWO_ARGS 1
-EOF
 
 
-    echo "$ac_t""two arguments" 1>&6
-  else
-    echo "$ac_t""unknown" 1>&6
-  fi
 
 
-for ac_func in select fcntl uname nice setpriority getcwd getwd putenv sbrk
-do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2212: checking for $ac_func" >&5
-if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  cat > conftest.$ac_ext <<EOF
-#line 2217 "configure"
-#include "confdefs.h"
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char $ac_func(); below.  */
-#include <assert.h>
-/* Override any gcc2 internal prototype to avoid an error.  */
-/* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char $ac_func();
 
 
-int main() {
 
 
-/* The GNU C library defines this for functions which it implements
-    to always fail with ENOSYS.  Some functions are actually named
-    something starting with __ and the normal name is an alias.  */
-#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
-choke me
-#else
-$ac_func();
-#endif
 
 
-; return 0; }
-EOF
-if { (eval echo configure:2240: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  eval "ac_cv_func_$ac_func=yes"
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
-fi
 
 
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
-  cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
-EOF
-else
-  echo "$ac_t""no" 1>&6
-fi
-done
 
 
 
 
-for ac_func in sigaction syslog realpath setrlimit
-do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2268: checking for $ac_func" >&5
-if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  cat > conftest.$ac_ext <<EOF
-#line 2273 "configure"
-#include "confdefs.h"
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char $ac_func(); below.  */
-#include <assert.h>
-/* Override any gcc2 internal prototype to avoid an error.  */
-/* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char $ac_func();
 
 
-int main() {
 
 
-/* The GNU C library defines this for functions which it implements
-    to always fail with ENOSYS.  Some functions are actually named
-    something starting with __ and the normal name is an alias.  */
-#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
-choke me
-#else
-$ac_func();
-#endif
 
 
-; return 0; }
-EOF
-if { (eval echo configure:2296: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  eval "ac_cv_func_$ac_func=yes"
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
-fi
 
 
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
-  cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
-EOF
-else
-  echo "$ac_t""no" 1>&6
-fi
-done
 
 
-echo $ac_n "checking for struct icmp""... $ac_c" 1>&6
-echo "configure:2321: checking for struct icmp" >&5
-if eval "test \"`echo '$''{'ac_cv_have_icmp'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  cat > conftest.$ac_ext <<EOF
-#line 2326 "configure"
-#include "confdefs.h"
-#include <stdlib.h>
-                   #include <stdio.h>
-                   #include <math.h>
-                   #include <unistd.h>
-                   #include <limits.h>
-                   #include <signal.h>
-                   #include <fcntl.h>
-                   #include <sys/types.h>
+
+
+
+
+
+
+
+
+
+# After checking to see that --srcdir is correct (which AC_INIT does)
+# check for some random other files that come later in the tar file,
+# to make sure everything is here.
+#
+for d in driver utils hacks hacks/glx ; do
+  f=$srcdir/$d/Makefile.in
+  if test \! -r $f ; then
+    echo ""
+    echo "ERROR: The package is incomplete: $f does not exist."
+    echo "       This probably means that your download was truncated."
+    echo ""
+    exit 1
+  fi
+done
+
+###############################################################################
+#
+#       Function to figure out how to run the compiler.
+#
+###############################################################################
+
+
+
+
+###############################################################################
+#
+#       Check for availability of various gcc command-line options.
+#
+###############################################################################
+
+
+
+
+
+
+
+# Need to disable Objective C extensions in ANSI C on MacOS X to work
+# around an Apple-specific gcc bug.
+#
+
+
+###############################################################################
+#
+#       Function to figure out how to disable // comments in ANSI C code.
+#
+#       (With recent gcc, this is done with "-std=c89".  With older gcc, this
+#       is done by passing "-lang-c89" to cpp, by passing "-Wp,-lang-c89" to
+#       gcc.  Old gcc doesn't support -std, and new gcc doesn't support -lang.
+#       so much for compatibility!)
+#
+#       UPDATE: apparently there is NO WAY to tell gcc 3.2.2 to require that
+#       declarations preceed statements, without resorting to "-pedantic".
+#       This means that there is no way to get gcc3 to issue warnings that
+#       ensure that your code complies with the ANSI/ISO C89 standard, without
+#       also drowning in totally useless warnings.  Thank you master may I
+#       have another.
+#
+#       So, I give up, let's just use -pedantic.
+#
+###############################################################################
+
+
+
+
+
+
+###############################################################################
+#
+#       Function to figure out how to create directory trees.
+#
+###############################################################################
+
+
+
+
+###############################################################################
+#
+#       Function to check whether gettimeofday() exists, and how to call it.
+#      This may define HAVE_GETTIMEOFDAY and GETTIMEOFDAY_TWO_ARGS.
+#
+###############################################################################
+
+
+
+
+###############################################################################
+#
+#       Function to find perl5 (defines PERL and PERL_VERSION.)
+#
+###############################################################################
+
+# M4 sucks!!  perl sucks too!!
+
+perl_version_cmd='print $]'
+
+
+
+
+
+###############################################################################
+#
+#       Function to demand "bc".  Losers.
+#
+###############################################################################
+
+
+
+###############################################################################
+#
+#       Functions to check how to do ICMP PING requests.
+#
+###############################################################################
+
+
+
+
+
+
+###############################################################################
+#
+#       Functions to check for various X11 crap.
+#
+###############################################################################
+
+# Try and find the app-defaults directory.
+# It sucks that autoconf doesn't do this already...
+#
+
+
+###############################################################################
+#
+#       Handle the --with-x-app-defaults option HERE
+#
+###############################################################################
+
+
+# Check whether --with-x-app-defaults was given.
+if test "${with_x_app_defaults+set}" = set; then :
+  withval=$with_x_app_defaults; ac_cv_x_app_defaults="$withval"
+else
+  eval ac_x_app_defaults="$withval"
+fi
+
+
+
+
+
+
+
+
+
+
+
+# Random special-cases for X on certain pathological OSes.
+# You know who you are.
+#
+
+
+
+
+
+###############################################################################
+#
+#       Some utility functions to make checking for X things easier.
+#
+###############################################################################
+
+# Like AC_CHECK_HEADER, but it uses the already-computed -I directories.
+#
+
+
+# Like AC_EGREP_HEADER, but it uses the already-computed -I directories.
+#
+
+
+# Like AC_TRY_COMPILE, but it uses the already-computed -I directories.
+#
+
+
+
+# Like AC_CHECK_LIB, but it uses the already-computed -I and -L directories.
+# Use this sparingly; it probably doesn't work very well on X programs.
+#
+
+
+# Like AC_TRY_RUN, but it uses the already-computed -I directories.
+# (But not the -L directories!)
+#
+
+
+
+
+# Usage: HANDLE_X_PATH_ARG([variable_name],
+#                          [--command-line-option],
+#                          [descriptive string])
+#
+# All of the --with options take three forms:
+#
+#   --with-foo (or --with-foo=yes)
+#   --without-foo (or --with-foo=no)
+#   --with-foo=/DIR
+#
+# This function, HANDLE_X_PATH_ARG, deals with the /DIR case.  When it sees
+# a directory (string beginning with a slash) it checks to see whether
+# /DIR/include and /DIR/lib exist, and adds them to $X_CFLAGS and $X_LIBS
+# as appropriate.
+#
+
+
+
+
+###############################################################################
+###############################################################################
+#
+#       End of function definitions.  Now start actually executing stuff.
+#
+###############################################################################
+###############################################################################
+
+# WTF!  autoconf emits this *way* too late.  Do it earlier.
+test "x$prefix" = xNONE && prefix=$ac_default_prefix
+test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
+
+
+# random compiler setup
+ac_aux_dir=
+for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do
+  if test -f "$ac_dir/install-sh"; then
+    ac_aux_dir=$ac_dir
+    ac_install_sh="$ac_aux_dir/install-sh -c"
+    break
+  elif test -f "$ac_dir/install.sh"; then
+    ac_aux_dir=$ac_dir
+    ac_install_sh="$ac_aux_dir/install.sh -c"
+    break
+  elif test -f "$ac_dir/shtool"; then
+    ac_aux_dir=$ac_dir
+    ac_install_sh="$ac_aux_dir/shtool install -c"
+    break
+  fi
+done
+if test -z "$ac_aux_dir"; then
+  as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5
+fi
+
+# These three variables are undocumented and unsupported,
+# and are intended to be withdrawn in a future Autoconf release.
+# They can cause serious problems if a builder's source tree is in a directory
+# whose full name contains unusual characters.
+ac_config_guess="$SHELL $ac_aux_dir/config.guess"  # Please don't use this var.
+ac_config_sub="$SHELL $ac_aux_dir/config.sub"  # Please don't use this var.
+ac_configure="$SHELL $ac_aux_dir/configure"  # Please don't use this var.
+
+
+# Make sure we can run config.sub.
+$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
+  as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5
+$as_echo_n "checking build system type... " >&6; }
+if ${ac_cv_build+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_build_alias=$build_alias
+test "x$ac_build_alias" = x &&
+  ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`
+test "x$ac_build_alias" = x &&
+  as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5
+ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
+  as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5
+$as_echo "$ac_cv_build" >&6; }
+case $ac_cv_build in
+*-*-*) ;;
+*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;;
+esac
+build=$ac_cv_build
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_build
+shift
+build_cpu=$1
+build_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+build_os=$*
+IFS=$ac_save_IFS
+case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5
+$as_echo_n "checking host system type... " >&6; }
+if ${ac_cv_host+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test "x$host_alias" = x; then
+  ac_cv_host=$ac_cv_build
+else
+  ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` ||
+    as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5
+$as_echo "$ac_cv_host" >&6; }
+case $ac_cv_host in
+*-*-*) ;;
+*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;;
+esac
+host=$ac_cv_host
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_host
+shift
+host_cpu=$1
+host_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+host_os=$*
+IFS=$ac_save_IFS
+case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}gcc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_CC="${ac_tool_prefix}gcc"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_CC"; then
+  ac_ct_CC=$CC
+  # Extract the first word of "gcc", so it can be a program name with args.
+set dummy gcc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_CC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_CC"; then
+  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_CC="gcc"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_CC" = x; then
+    CC=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    CC=$ac_ct_CC
+  fi
+else
+  CC="$ac_cv_prog_CC"
+fi
+
+if test -z "$CC"; then
+          if test -n "$ac_tool_prefix"; then
+    # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}cc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_CC="${ac_tool_prefix}cc"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  fi
+fi
+if test -z "$CC"; then
+  # Extract the first word of "cc", so it can be a program name with args.
+set dummy cc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+  ac_prog_rejected=no
+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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
+       ac_prog_rejected=yes
+       continue
+     fi
+    ac_cv_prog_CC="cc"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+if test $ac_prog_rejected = yes; then
+  # We found a bogon in the path, so make sure we never use it.
+  set dummy $ac_cv_prog_CC
+  shift
+  if test $# != 0; then
+    # We chose a different compiler from the bogus one.
+    # However, it has the same basename, so the bogon will be chosen
+    # first if we set CC to just the basename; use the full file name.
+    shift
+    ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
+  fi
+fi
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$CC"; then
+  if test -n "$ac_tool_prefix"; then
+  for ac_prog in cl.exe
+  do
+    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+    test -n "$CC" && break
+  done
+fi
+if test -z "$CC"; then
+  ac_ct_CC=$CC
+  for ac_prog in cl.exe
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_CC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_CC"; then
+  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_CC="$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -n "$ac_ct_CC" && break
+done
+
+  if test "x$ac_ct_CC" = x; then
+    CC=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    CC=$ac_ct_CC
+  fi
+fi
+
+fi
+
+
+test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "no acceptable C compiler found in \$PATH
+See \`config.log' for more details" "$LINENO" 5; }
+
+# Provide some information about the compiler.
+$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
+set X $ac_compile
+ac_compiler=$2
+for ac_option in --version -v -V -qversion; do
+  { { ac_try="$ac_compiler $ac_option >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_compiler $ac_option >&5") 2>conftest.err
+  ac_status=$?
+  if test -s conftest.err; then
+    sed '10a\
+... rest of stderr output deleted ...
+         10q' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+  fi
+  rm -rf conftest.er1 conftest.err
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }
+done
+
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out"
+# Try to create an executable without -o first, disregard a.out.
+# It will help us diagnose broken compilers, and finding out an intuition
+# of exeext.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5
+$as_echo_n "checking whether the C compiler works... " >&6; }
+ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
+
+# The possible output files:
+ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*"
+
+ac_rmfiles=
+for ac_file in $ac_files
+do
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
+    * ) ac_rmfiles="$ac_rmfiles $ac_file";;
+  esac
+done
+rm -f $ac_rmfiles
+
+if { { ac_try="$ac_link_default"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_link_default") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then :
+  # Autoconf-2.13 could set the ac_cv_exeext variable to `no'.
+# So ignore a value of `no', otherwise this would lead to `EXEEXT = no'
+# in a Makefile.  We should not override ac_cv_exeext if it was cached,
+# so that the user can short-circuit this test for compilers unknown to
+# Autoconf.
+for ac_file in $ac_files ''
+do
+  test -f "$ac_file" || continue
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj )
+       ;;
+    [ab].out )
+       # We found the default executable, but exeext='' is most
+       # certainly right.
+       break;;
+    *.* )
+       if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no;
+       then :; else
+          ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+       fi
+       # We set ac_cv_exeext here because the later test for it is not
+       # safe: cross compilers may not add the suffix if given an `-o'
+       # argument, so we may need to know it at that point already.
+       # Even if this section looks crufty: it has the advantage of
+       # actually working.
+       break;;
+    * )
+       break;;
+  esac
+done
+test "$ac_cv_exeext" = no && ac_cv_exeext=
+
+else
+  ac_file=''
+fi
+if test -z "$ac_file"; then :
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+$as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error 77 "C compiler cannot create executables
+See \`config.log' for more details" "$LINENO" 5; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5
+$as_echo_n "checking for C compiler default output file name... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5
+$as_echo "$ac_file" >&6; }
+ac_exeext=$ac_cv_exeext
+
+rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out
+ac_clean_files=$ac_clean_files_save
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5
+$as_echo_n "checking for suffix of executables... " >&6; }
+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:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then :
+  # If both `conftest.exe' and `conftest' are `present' (well, observable)
+# catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will
+# work properly (i.e., refer to `conftest.exe'), while it won't with
+# `rm'.
+for ac_file in conftest.exe conftest conftest.*; do
+  test -f "$ac_file" || continue
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
+    *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+         break;;
+    * ) break;;
+  esac
+done
+else
+  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details" "$LINENO" 5; }
+fi
+rm -rf conftest conftest$ac_cv_exeext
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5
+$as_echo "$ac_cv_exeext" >&6; }
+
+rm -rf conftest.$ac_ext
+EXEEXT=$ac_cv_exeext
+ac_exeext=$EXEEXT
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stdio.h>
+int
+main ()
+{
+FILE *f = fopen ("conftest.out", "w");
+ return ferror (f) || fclose (f) != 0;
+
+  ;
+  return 0;
+}
+_ACEOF
+ac_clean_files="$ac_clean_files conftest.out"
+# Check that the compiler produces executables we can run.  If not, either
+# the compiler is broken, or we cross compile.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5
+$as_echo_n "checking whether we are cross compiling... " >&6; }
+if test "$cross_compiling" != yes; then
+  { { 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:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }
+  if { ac_try='./conftest$ac_cv_exeext'
+  { { case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then
+    cross_compiling=no
+  else
+    if test "$cross_compiling" = maybe; then
+       cross_compiling=yes
+    else
+       { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot run C compiled programs.
+If you meant to cross compile, use \`--host'.
+See \`config.log' for more details" "$LINENO" 5; }
+    fi
+  fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5
+$as_echo "$cross_compiling" >&6; }
+
+rm -rf conftest.$ac_ext conftest$ac_cv_exeext conftest.out
+ac_clean_files=$ac_clean_files_save
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5
+$as_echo_n "checking for suffix of object files... " >&6; }
+if ${ac_cv_objext+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -rf conftest.o conftest.obj
+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:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_compile") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then :
+  for ac_file in conftest.o conftest.obj conftest.*; do
+  test -f "$ac_file" || continue;
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;;
+    *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
+       break;;
+  esac
+done
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot compute suffix of object files: cannot compile
+See \`config.log' for more details" "$LINENO" 5; }
+fi
+rm -rf conftest.$ac_cv_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5
+$as_echo "$ac_cv_objext" >&6; }
+OBJEXT=$ac_cv_objext
+ac_objext=$OBJEXT
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5
+$as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
+if ${ac_cv_c_compiler_gnu+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+#ifndef __GNUC__
+       choke me
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_compiler_gnu=yes
+else
+  ac_compiler_gnu=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_c_compiler_gnu=$ac_compiler_gnu
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5
+$as_echo "$ac_cv_c_compiler_gnu" >&6; }
+if test $ac_compiler_gnu = yes; then
+  GCC=yes
+else
+  GCC=
+fi
+ac_test_CFLAGS=${CFLAGS+set}
+ac_save_CFLAGS=$CFLAGS
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
+$as_echo_n "checking whether $CC accepts -g... " >&6; }
+if ${ac_cv_prog_cc_g+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_save_c_werror_flag=$ac_c_werror_flag
+   ac_c_werror_flag=yes
+   ac_cv_prog_cc_g=no
+   CFLAGS="-g"
+   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_prog_cc_g=yes
+else
+  CFLAGS=""
+      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+else
+  ac_c_werror_flag=$ac_save_c_werror_flag
+        CFLAGS="-g"
+        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_prog_cc_g=yes
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+   ac_c_werror_flag=$ac_save_c_werror_flag
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5
+$as_echo "$ac_cv_prog_cc_g" >&6; }
+if test "$ac_test_CFLAGS" = set; then
+  CFLAGS=$ac_save_CFLAGS
+elif test $ac_cv_prog_cc_g = yes; then
+  if test "$GCC" = yes; then
+    CFLAGS="-g -O2"
+  else
+    CFLAGS="-g"
+  fi
+else
+  if test "$GCC" = yes; then
+    CFLAGS="-O2"
+  else
+    CFLAGS=
+  fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5
+$as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
+if ${ac_cv_prog_cc_c89+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_cv_prog_cc_c89=no
+ac_save_CC=$CC
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stdarg.h>
+#include <stdio.h>
+struct stat;
+/* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
+struct buf { int x; };
+FILE * (*rcsopen) (struct buf *, struct stat *, int);
+static char *e (p, i)
+     char **p;
+     int i;
+{
+  return p[i];
+}
+static char *f (char * (*g) (char **, int), char **p, ...)
+{
+  char *s;
+  va_list v;
+  va_start (v,p);
+  s = g (p, va_arg (v,int));
+  va_end (v);
+  return s;
+}
+
+/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default.  It has
+   function prototypes and stuff, but not '\xHH' hex character constants.
+   These don't provoke an error unfortunately, instead are silently treated
+   as 'x'.  The following induces an error, until -std is added to get
+   proper ANSI mode.  Curiously '\x00'!='x' always comes out true, for an
+   array size at least.  It's necessary to write '\x00'==0 to get something
+   that's true only with -std.  */
+int osf4_cc_array ['\x00' == 0 ? 1 : -1];
+
+/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
+   inside strings and character constants.  */
+#define FOO(x) 'x'
+int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
+
+int test (int i, double x);
+struct s1 {int (*f) (int a);};
+struct s2 {int (*f) (double a);};
+int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
+int argc;
+char **argv;
+int
+main ()
+{
+return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
+  ;
+  return 0;
+}
+_ACEOF
+for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
+       -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+do
+  CC="$ac_save_CC $ac_arg"
+  if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_prog_cc_c89=$ac_arg
+fi
+rm -f core conftest.err conftest.$ac_objext
+  test "x$ac_cv_prog_cc_c89" != "xno" && break
+done
+rm -rf conftest.$ac_ext
+CC=$ac_save_CC
+
+fi
+# AC_CACHE_VAL
+case "x$ac_cv_prog_cc_c89" in
+  x)
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
+$as_echo "none needed" >&6; } ;;
+  xno)
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
+$as_echo "unsupported" >&6; } ;;
+  *)
+    CC="$CC $ac_cv_prog_cc_c89"
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5
+$as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
+esac
+if test "x$ac_cv_prog_cc_c89" != xno; then :
+
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+
+
+  if test -z "$GCC"; then
+    # not using GCC
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to request ANSI compilation" >&5
+$as_echo_n "checking how to request ANSI compilation... " >&6; }
+    case "$host" in
+      *-hpux* )
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: HPUX: adding -Ae" >&5
+$as_echo "HPUX: adding -Ae" >&6; }
+        CC="$CC -Ae"
+      ;;
+      *-aix* )
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: AIX: adding -qlanglvl=ansi -qhalt=e" >&5
+$as_echo "AIX: adding -qlanglvl=ansi -qhalt=e" >&6; }
+        CC="$CC -qlanglvl=ansi -qhalt=e"
+      ;;
+      *-dec-* )
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: DEC: adding -std1 -ieee" >&5
+$as_echo "DEC: adding -std1 -ieee" >&6; }
+        CC="$CC -std1"
+      ;;
+      *)
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: no idea" >&5
+$as_echo "no idea" >&6; }
+      ;;
+    esac
+  else
+    # using GCC
+    case "$host" in
+      *-solaris*)
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: Solaris: adding -D__EXTENSIONS__" >&5
+$as_echo "Solaris: adding -D__EXTENSIONS__" >&6; }
+        CC="$CC -D__EXTENSIONS__"
+      ;;
+    esac
+  fi
+
+  OBJCC="$CC"
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler works on ANSI C" >&5
+$as_echo_n "checking whether the compiler works on ANSI C... " >&6; }
+  if test "$cross_compiling" = yes; then :
+  as_fn_error $? "Couldn't build even a trivial ANSI C program: check CC." "$LINENO" 5
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+ main(int ac, char **av) { return 0; }
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+     as_fn_error $? "Couldn't build even a trivial ANSI C program: check CC." "$LINENO" 5
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+
+  if test -n "$GCC"; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: Turning on gcc compiler warnings." >&5
+$as_echo "Turning on gcc compiler warnings." >&6; }
+    CC="$CC -pedantic -Wall -Wstrict-prototypes -Wnested-externs -Wmissing-prototypes"
+    OBJCC="$OBJCC -Wall"
+    # As of gcc 3.4, we have "-Wdeclaration-after-statement"
+    # and so perhaps now we can do without -pedantic?
+  else
+    case "$host" in
+      *-irix5* |*-irix6.0-3* )
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: Turning on SGI compiler warnings." >&5
+$as_echo "Turning on SGI compiler warnings." >&6; }
+        CC="$CC -fullwarn -use_readonly_const -rdata_shared -g3"
+      ;;
+#     *-dec-osf* )
+#       if test -z "$GCC"; then
+#         AC_MSG_RESULT(Turning on DEC C compiler warnings.)
+#         CC="$CC -migrate -w0 -verbose -warnprotos"
+#       fi
+#     ;;
+    esac
+  fi
+
+if test -n "$GCC"; then
+   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether gcc accepts -Wno-overlength-strings" >&5
+$as_echo_n "checking whether gcc accepts -Wno-overlength-strings... " >&6; }
+if ${ac_cv_gcc_accepts_no_overlength+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  rm -rf conftest.$ac_ext
+     touch conftest.$ac_ext
+     if ( ( gcc -c -Wno-overlength-strings conftest.$ac_ext -o/dev/null >/dev/null ) 2>&1 | \
+          grep unrecognized >/dev/null ); then
+       ac_cv_gcc_accepts_no_overlength=no
+     else
+       ac_cv_gcc_accepts_no_overlength=yes
+       CC="$CC -Wno-overlength-strings"
+     fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_gcc_accepts_no_overlength" >&5
+$as_echo "$ac_cv_gcc_accepts_no_overlength" >&6; }
+   ac_gcc_accepts_no_overlength="$ac_cv_gcc_accepts_no_overlength"
+  fi
+
+if test -n "$GCC"; then
+   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether gcc accepts -Wdeclaration-after-statement" >&5
+$as_echo_n "checking whether gcc accepts -Wdeclaration-after-statement... " >&6; }
+if ${ac_cv_gcc_accepts_no_decl_after+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  rm -rf conftest.$ac_ext
+     touch conftest.$ac_ext
+     if ( ( gcc -c -Wdeclaration-after-statement conftest.$ac_ext -o/dev/null >/dev/null ) 2>&1 | \
+          grep unrecognized >/dev/null ); then
+       ac_cv_gcc_accepts_no_decl_after=no
+     else
+       ac_cv_gcc_accepts_no_decl_after=yes
+       CC="$CC -Wdeclaration-after-statement"
+     fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_gcc_accepts_no_decl_after" >&5
+$as_echo "$ac_cv_gcc_accepts_no_decl_after" >&6; }
+   ac_gcc_accepts_no_decl_after="$ac_cv_gcc_accepts_no_decl_after"
+  fi
+
+if test -n "$GCC"; then
+   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether gcc accepts -no-cpp-precomp" >&5
+$as_echo_n "checking whether gcc accepts -no-cpp-precomp... " >&6; }
+if ${ac_cv_gcc_accepts_no_cpp_precomp+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  rm -rf conftest.$ac_ext
+     touch conftest.$ac_ext
+     if ( ( gcc -c -no-cpp-precomp conftest.$ac_ext -o/dev/null >/dev/null ) 2>&1 | \
+          grep unrecognized >/dev/null ); then
+       ac_cv_gcc_accepts_no_cpp_precomp=no
+     else
+       ac_cv_gcc_accepts_no_cpp_precomp=yes
+       CC="$CC -no-cpp-precomp"
+     fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_gcc_accepts_no_cpp_precomp" >&5
+$as_echo "$ac_cv_gcc_accepts_no_cpp_precomp" >&6; }
+   ac_gcc_accepts_no_cpp_precomp="$ac_cv_gcc_accepts_no_cpp_precomp"
+  fi
+
+if test -n "$GCC"; then
+
+  case "$host" in
+    *-darwin* )
+      # Fucking Apple let // comments sneak into OpenGL headers, so
+      # we *must* allow // comments when compiling on Mac OS 10.6!  FUCK!
+    ;;
+   *)
+     if test -n "$GCC"; then
+   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether gcc accepts -std=c89" >&5
+$as_echo_n "checking whether gcc accepts -std=c89... " >&6; }
+if ${ac_cv_gcc_accepts_std+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  rm -rf conftest.$ac_ext
+     touch conftest.$ac_ext
+     if ( ( gcc -c -std=c89 conftest.$ac_ext -o/dev/null >/dev/null ) 2>&1 | \
+          grep unrecognized >/dev/null ); then
+       ac_cv_gcc_accepts_std=no
+     else
+       ac_cv_gcc_accepts_std=yes
+       CC="$CC -std=c89"
+     fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_gcc_accepts_std" >&5
+$as_echo "$ac_cv_gcc_accepts_std" >&6; }
+   ac_gcc_accepts_std="$ac_cv_gcc_accepts_std"
+  fi
+
+   ;;
+  esac
+
+   { $as_echo "$as_me:${as_lineno-$LINENO}: result: Disabling C++ comments in ANSI C code." >&5
+$as_echo "Disabling C++ comments in ANSI C code." >&6; }
+   #
+   # The reason that // comments are banned from xscreensaver is that gcc is
+   # basically the only compiler in the world that supports them in C code.
+   # All other vendors support them only in their C++ compilers, not in their
+   # ANSI C compilers.  This means that it's a portability problem: every time
+   # these comments have snuck into the xscreensaver source code, I've gotten
+   # complaints about it the next day.  So we turn off support for them in gcc
+   # as well to prevent them from accidentially slipping in.
+   #
+   if test "$ac_gcc_accepts_std" = yes ; then
+     #
+     # -std=c89 defines __STRICT_ANSI__, which we don't want.
+     # (That appears to be the only additional preprocessor symbol
+     # it defines, in addition to the syntax changes it makes.)
+     #
+     # -std=gnu89 is no good, because // comments were a GNU extension
+     # before they were in the ANSI C 99 spec...  (gcc 2.96 permits //
+     # with -std=gnu89 but not with -std=c89.)
+     #
+     # $CC already contains "-std=c89" via AC_GCC_ACCEPTS_STD
+     CC="$CC -U__STRICT_ANSI__"
+#   else
+#     # The old way:
+#     CC="$CC -Wp,-lang-c89"
+   fi
+  fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5
+$as_echo_n "checking how to run the C preprocessor... " >&6; }
+# On Suns, sometimes $CPP names a directory.
+if test -n "$CPP" && test -d "$CPP"; then
+  CPP=
+fi
+if test -z "$CPP"; then
+  if ${ac_cv_prog_CPP+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+      # Double quotes because CPP needs to be expanded
+    for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
+    do
+      ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+  # Use a header file that comes with gcc, so configuring glibc
+  # with a fresh cross-compiler works.
+  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+  # <limits.h> exists even on freestanding compilers.
+  # On the NeXT, cc -E runs the code through the compiler's parser,
+  # not just through cpp. "Syntax error" is here to catch this case.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+                    Syntax error
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+
+else
+  # Broken: fails on valid input.
+continue
+fi
+rm -rf conftest.err conftest.i conftest.$ac_ext
+
+  # OK, works on sane cases.  Now check whether nonexistent headers
+  # can be detected and how.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <ac_nonexistent.h>
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+  # Broken: success on invalid input.
+continue
+else
+  # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -rf conftest.err conftest.i conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -rf conftest.i conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then :
+  break
+fi
+
+    done
+    ac_cv_prog_CPP=$CPP
+
+fi
+  CPP=$ac_cv_prog_CPP
+else
+  ac_cv_prog_CPP=$CPP
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5
+$as_echo "$CPP" >&6; }
+ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+  # Use a header file that comes with gcc, so configuring glibc
+  # with a fresh cross-compiler works.
+  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+  # <limits.h> exists even on freestanding compilers.
+  # On the NeXT, cc -E runs the code through the compiler's parser,
+  # not just through cpp. "Syntax error" is here to catch this case.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+                    Syntax error
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+
+else
+  # Broken: fails on valid input.
+continue
+fi
+rm -rf conftest.err conftest.i conftest.$ac_ext
+
+  # OK, works on sane cases.  Now check whether nonexistent headers
+  # can be detected and how.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <ac_nonexistent.h>
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+  # Broken: success on invalid input.
+continue
+else
+  # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -rf conftest.err conftest.i conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -rf conftest.i conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then :
+
+else
+  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details" "$LINENO" 5; }
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5
+$as_echo_n "checking for an ANSI C-conforming const... " >&6; }
+if ${ac_cv_c_const+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+#ifndef __cplusplus
+  /* Ultrix mips cc rejects this sort of thing.  */
+  typedef int charset[2];
+  const charset cs = { 0, 0 };
+  /* SunOS 4.1.1 cc rejects this.  */
+  char const *const *pcpcc;
+  char **ppc;
+  /* NEC SVR4.0.2 mips cc rejects this.  */
+  struct point {int x, y;};
+  static struct point const zero = {0,0};
+  /* AIX XL C 1.02.0.0 rejects this.
+     It does not let you subtract one const X* pointer from another in
+     an arm of an if-expression whose if-part is not a constant
+     expression */
+  const char *g = "string";
+  pcpcc = &g + (g ? g-g : 0);
+  /* HPUX 7.0 cc rejects these. */
+  ++pcpcc;
+  ppc = (char**) pcpcc;
+  pcpcc = (char const *const *) ppc;
+  { /* SCO 3.2v4 cc rejects this sort of thing.  */
+    char tx;
+    char *t = &tx;
+    char const *s = 0 ? (char *) 0 : (char const *) 0;
+
+    *t++ = 0;
+    if (s) return 0;
+  }
+  { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
+    int x[] = {25, 17};
+    const int *foo = &x[0];
+    ++foo;
+  }
+  { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
+    typedef const int *iptr;
+    iptr p = 0;
+    ++p;
+  }
+  { /* AIX XL C 1.02.0.0 rejects this sort of thing, saying
+       "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
+    struct s { int j; const int *ap[3]; } bx;
+    struct s *b = &bx; b->j = 5;
+  }
+  { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
+    const int foo = 10;
+    if (!foo) return 0;
+  }
+  return !cs[0] && !zero.x;
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_c_const=yes
+else
+  ac_cv_c_const=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5
+$as_echo "$ac_cv_c_const" >&6; }
+if test $ac_cv_c_const = no; then
+
+$as_echo "#define const /**/" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5
+$as_echo_n "checking for inline... " >&6; }
+if ${ac_cv_c_inline+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_cv_c_inline=no
+for ac_kw in inline __inline__ __inline; do
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#ifndef __cplusplus
+typedef int foo_t;
+static $ac_kw foo_t static_foo () {return 0; }
+$ac_kw foo_t foo () {return 0; }
+#endif
+
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_c_inline=$ac_kw
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+  test "$ac_cv_c_inline" != no && break
+done
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5
+$as_echo "$ac_cv_c_inline" >&6; }
+
+case $ac_cv_c_inline in
+  inline | yes) ;;
+  *)
+    case $ac_cv_c_inline in
+      no) ac_val=;;
+      *) ac_val=$ac_cv_c_inline;;
+    esac
+    cat >>confdefs.h <<_ACEOF
+#ifndef __cplusplus
+#define inline $ac_val
+#endif
+_ACEOF
+    ;;
+esac
+
+
+ac_bc_result=`echo 6+9 | bc 2>/dev/null`
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for bc" >&5
+$as_echo_n "checking for bc... " >&6; }
+  if test "$ac_bc_result" = "15" ; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+  else
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+    echo ''
+    as_fn_error $? "Your system doesn't have \"bc\", which has been a standard
+                  part of Unix since the 1970s.  Come back when your vendor
+                  has grown a clue." "$LINENO" 5
+  fi
+
+
+# stuff for Makefiles
+# Find a good install program.  We prefer a C program (faster),
+# so one script is as good as another.  But avoid the broken or
+# incompatible versions:
+# SysV /etc/install, /usr/sbin/install
+# SunOS /usr/etc/install
+# IRIX /sbin/install
+# AIX /bin/install
+# AmigaOS /C/install, which installs bootblocks on floppy discs
+# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
+# AFS /usr/afsws/bin/install, which mishandles nonexistent args
+# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
+# OS/2's system install, which has a completely different semantic
+# ./install, which can be erroneously created by make from ./install.sh.
+# Reject install programs that cannot install multiple files.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5
+$as_echo_n "checking for a BSD-compatible install... " >&6; }
+if test -z "$INSTALL"; then
+if ${ac_cv_path_install+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    # Account for people who put trailing slashes in PATH elements.
+case $as_dir/ in #((
+  ./ | .// | /[cC]/* | \
+  /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
+  ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \
+  /usr/ucb/* ) ;;
+  *)
+    # OSF1 and SCO ODT 3.0 have their own names for install.
+    # Don't use installbsd from OSF since it installs stuff as root
+    # by default.
+    for ac_prog in ginstall scoinst install; do
+      for ac_exec_ext in '' $ac_executable_extensions; do
+       if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
+         if test $ac_prog = install &&
+           grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+           # AIX install.  It has an incompatible calling convention.
+           :
+         elif test $ac_prog = install &&
+           grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+           # program-specific install script used by HP pwplus--don't use.
+           :
+         else
+           rm -rf conftest.one conftest.two conftest.dir
+           echo one > conftest.one
+           echo two > conftest.two
+           mkdir conftest.dir
+           if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" &&
+             test -s conftest.one && test -s conftest.two &&
+             test -s conftest.dir/conftest.one &&
+             test -s conftest.dir/conftest.two
+           then
+             ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
+             break 3
+           fi
+         fi
+       fi
+      done
+    done
+    ;;
+esac
+
+  done
+IFS=$as_save_IFS
+
+rm -rf conftest.one conftest.two conftest.dir
+
+fi
+  if test "${ac_cv_path_install+set}" = set; then
+    INSTALL=$ac_cv_path_install
+  else
+    # As a last resort, use the slow shell script.  Don't cache a
+    # value for INSTALL within a source directory, because that will
+    # break other packages using the cache if that directory is
+    # removed, or if the value is a relative name.
+    INSTALL=$ac_install_sh
+  fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5
+$as_echo "$INSTALL" >&6; }
+
+# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
+# It thinks the first close brace ends the variable substitution.
+test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
+
+test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
+
+test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether \"\${INSTALL} -d\" creates intermediate directories" >&5
+$as_echo_n "checking whether \"\${INSTALL} -d\" creates intermediate directories... " >&6; }
+if ${ac_cv_install_d_creates_dirs+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_cv_install_d_creates_dirs=no
+     rm -rf conftestdir
+     if mkdir conftestdir; then
+       cd conftestdir 2>/dev/null
+       ${INSTALL} -d `pwd`/dir1/dir2 >/dev/null 2>&1
+       if test -d dir1/dir2/. ; then
+         ac_cv_install_d_creates_dirs=yes
+       fi
+       cd .. 2>/dev/null
+       rm -rf conftestdir
+     fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_install_d_creates_dirs" >&5
+$as_echo "$ac_cv_install_d_creates_dirs" >&6; }
+
+  if test "$ac_cv_install_d_creates_dirs" = no ; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether \"mkdir -p\" creates intermediate directories" >&5
+$as_echo_n "checking whether \"mkdir -p\" creates intermediate directories... " >&6; }
+if ${ac_cv_mkdir_p_creates_dirs+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_cv_mkdir_p_creates_dirs=no
+       rm -rf conftestdir
+       if mkdir conftestdir; then
+         cd conftestdir 2>/dev/null
+         mkdir -p dir1/dir2 >/dev/null 2>&1
+         if test -d dir1/dir2/. ; then
+           ac_cv_mkdir_p_creates_dirs=yes
+         fi
+         cd .. 2>/dev/null
+         rm -rf conftestdir
+       fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_mkdir_p_creates_dirs" >&5
+$as_echo "$ac_cv_mkdir_p_creates_dirs" >&6; }
+  fi
+
+  if test "$ac_cv_install_d_creates_dirs" = yes ; then
+    INSTALL_DIRS='${INSTALL} -d'
+  elif test "$ac_cv_mkdir_p_creates_dirs" = yes ; then
+    INSTALL_DIRS='mkdir -p'
+  else
+    # any other ideas?
+    INSTALL_DIRS='${INSTALL} -d'
+  fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5
+$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; }
+set x ${MAKE-make}
+ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
+if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.make <<\_ACEOF
+SHELL = /bin/sh
+all:
+       @echo '@@@%%%=$(MAKE)=@@@%%%'
+_ACEOF
+# GNU make sometimes prints "make[1]: Entering ...", which would confuse us.
+case `${MAKE-make} -f conftest.make 2>/dev/null` in
+  *@@@%%%=?*=@@@%%%*)
+    eval ac_cv_prog_make_${ac_make}_set=yes;;
+  *)
+    eval ac_cv_prog_make_${ac_make}_set=no;;
+esac
+rm -rf conftest.make
+fi
+if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+  SET_MAKE=
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+  SET_MAKE="MAKE=${MAKE-make}"
+fi
+
+
+# By default, autoconf sets INSTALL_SCRIPT to '${INSTALL_PROGRAM}'.
+# That's wrong: it should be set to '${INSTALL}', so that one can
+# implement the "install-strip" target properly (strip executables,
+# but do not try to strip scripts.)
+#
+INSTALL_SCRIPT='${INSTALL}'
+
+# random libc stuff
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
+$as_echo_n "checking for grep that handles long lines and -e... " >&6; }
+if ${ac_cv_path_GREP+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -z "$GREP"; then
+  ac_path_GREP_found=false
+  # Loop through the user's path and test for each of PROGNAME-LIST
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_prog in grep ggrep; do
+    for ac_exec_ext in '' $ac_executable_extensions; do
+      ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
+      as_fn_executable_p "$ac_path_GREP" || continue
+# Check for GNU ac_path_GREP and select it if it is found.
+  # Check for GNU $ac_path_GREP
+case `"$ac_path_GREP" --version 2>&1` in
+*GNU*)
+  ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
+*)
+  ac_count=0
+  $as_echo_n 0123456789 >"conftest.in"
+  while :
+  do
+    cat "conftest.in" "conftest.in" >"conftest.tmp"
+    mv "conftest.tmp" "conftest.in"
+    cp "conftest.in" "conftest.nl"
+    $as_echo 'GREP' >> "conftest.nl"
+    "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
+    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+    as_fn_arith $ac_count + 1 && ac_count=$as_val
+    if test $ac_count -gt ${ac_path_GREP_max-0}; then
+      # Best one so far, save it but keep looking for a better one
+      ac_cv_path_GREP="$ac_path_GREP"
+      ac_path_GREP_max=$ac_count
+    fi
+    # 10*(2^10) chars as input seems more than enough
+    test $ac_count -gt 10 && break
+  done
+  rm -rf conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+      $ac_path_GREP_found && break 3
+    done
+  done
+  done
+IFS=$as_save_IFS
+  if test -z "$ac_cv_path_GREP"; then
+    as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
+  fi
+else
+  ac_cv_path_GREP=$GREP
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5
+$as_echo "$ac_cv_path_GREP" >&6; }
+ GREP="$ac_cv_path_GREP"
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5
+$as_echo_n "checking for egrep... " >&6; }
+if ${ac_cv_path_EGREP+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
+   then ac_cv_path_EGREP="$GREP -E"
+   else
+     if test -z "$EGREP"; then
+  ac_path_EGREP_found=false
+  # Loop through the user's path and test for each of PROGNAME-LIST
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_prog in egrep; do
+    for ac_exec_ext in '' $ac_executable_extensions; do
+      ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
+      as_fn_executable_p "$ac_path_EGREP" || continue
+# Check for GNU ac_path_EGREP and select it if it is found.
+  # Check for GNU $ac_path_EGREP
+case `"$ac_path_EGREP" --version 2>&1` in
+*GNU*)
+  ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
+*)
+  ac_count=0
+  $as_echo_n 0123456789 >"conftest.in"
+  while :
+  do
+    cat "conftest.in" "conftest.in" >"conftest.tmp"
+    mv "conftest.tmp" "conftest.in"
+    cp "conftest.in" "conftest.nl"
+    $as_echo 'EGREP' >> "conftest.nl"
+    "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
+    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+    as_fn_arith $ac_count + 1 && ac_count=$as_val
+    if test $ac_count -gt ${ac_path_EGREP_max-0}; then
+      # Best one so far, save it but keep looking for a better one
+      ac_cv_path_EGREP="$ac_path_EGREP"
+      ac_path_EGREP_max=$ac_count
+    fi
+    # 10*(2^10) chars as input seems more than enough
+    test $ac_count -gt 10 && break
+  done
+  rm -rf conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+      $ac_path_EGREP_found && break 3
+    done
+  done
+  done
+IFS=$as_save_IFS
+  if test -z "$ac_cv_path_EGREP"; then
+    as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
+  fi
+else
+  ac_cv_path_EGREP=$EGREP
+fi
+
+   fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5
+$as_echo "$ac_cv_path_EGREP" >&6; }
+ EGREP="$ac_cv_path_EGREP"
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
+$as_echo_n "checking for ANSI C header files... " >&6; }
+if ${ac_cv_header_stdc+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <float.h>
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_header_stdc=yes
+else
+  ac_cv_header_stdc=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+if test $ac_cv_header_stdc = yes; then
+  # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <string.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "memchr" >/dev/null 2>&1; then :
+
+else
+  ac_cv_header_stdc=no
+fi
+rm -rf conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+  # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stdlib.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "free" >/dev/null 2>&1; then :
+
+else
+  ac_cv_header_stdc=no
+fi
+rm -rf conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+  # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
+  if test "$cross_compiling" = yes; then :
+  :
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <ctype.h>
+#include <stdlib.h>
+#if ((' ' & 0x0FF) == 0x020)
+# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
+# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
+#else
+# define ISLOWER(c) \
+                  (('a' <= (c) && (c) <= 'i') \
+                    || ('j' <= (c) && (c) <= 'r') \
+                    || ('s' <= (c) && (c) <= 'z'))
+# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
+#endif
+
+#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
+int
+main ()
+{
+  int i;
+  for (i = 0; i < 256; i++)
+    if (XOR (islower (i), ISLOWER (i))
+       || toupper (i) != TOUPPER (i))
+      return 2;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+
+else
+  ac_cv_header_stdc=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5
+$as_echo "$ac_cv_header_stdc" >&6; }
+if test $ac_cv_header_stdc = yes; then
+
+$as_echo "#define STDC_HEADERS 1" >>confdefs.h
+
+fi
+
+# On IRIX 5.3, sys/types and inttypes.h are conflicting.
+for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
+                 inttypes.h stdint.h unistd.h
+do :
+  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
+"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+for ac_header in unistd.h
+do :
+  ac_fn_c_check_header_mongrel "$LINENO" "unistd.h" "ac_cv_header_unistd_h" "$ac_includes_default"
+if test "x$ac_cv_header_unistd_h" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_UNISTD_H 1
+_ACEOF
+
+fi
+
+done
+
+ac_fn_c_check_type "$LINENO" "mode_t" "ac_cv_type_mode_t" "$ac_includes_default"
+if test "x$ac_cv_type_mode_t" = xyes; then :
+
+else
+
+cat >>confdefs.h <<_ACEOF
+#define mode_t int
+_ACEOF
+
+fi
+
+ac_fn_c_check_type "$LINENO" "pid_t" "ac_cv_type_pid_t" "$ac_includes_default"
+if test "x$ac_cv_type_pid_t" = xyes; then :
+
+else
+
+cat >>confdefs.h <<_ACEOF
+#define pid_t int
+_ACEOF
+
+fi
+
+ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default"
+if test "x$ac_cv_type_size_t" = xyes; then :
+
+else
+
+cat >>confdefs.h <<_ACEOF
+#define size_t unsigned int
+_ACEOF
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking return type of signal handlers" >&5
+$as_echo_n "checking return type of signal handlers... " >&6; }
+if ${ac_cv_type_signal+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <sys/types.h>
+#include <signal.h>
+
+int
+main ()
+{
+return *(signal (0, 0)) (0) == 1;
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_type_signal=int
+else
+  ac_cv_type_signal=void
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_signal" >&5
+$as_echo "$ac_cv_type_signal" >&6; }
+
+cat >>confdefs.h <<_ACEOF
+#define RETSIGTYPE $ac_cv_type_signal
+_ACEOF
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether time.h and sys/time.h may both be included" >&5
+$as_echo_n "checking whether time.h and sys/time.h may both be included... " >&6; }
+if ${ac_cv_header_time+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <sys/types.h>
+#include <sys/time.h>
+#include <time.h>
+
+int
+main ()
+{
+if ((struct tm *) 0)
+return 0;
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_header_time=yes
+else
+  ac_cv_header_time=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_time" >&5
+$as_echo "$ac_cv_header_time" >&6; }
+if test $ac_cv_header_time = yes; then
+
+$as_echo "#define TIME_WITH_SYS_TIME 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sys/wait.h that is POSIX.1 compatible" >&5
+$as_echo_n "checking for sys/wait.h that is POSIX.1 compatible... " >&6; }
+if ${ac_cv_header_sys_wait_h+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <sys/types.h>
+#include <sys/wait.h>
+#ifndef WEXITSTATUS
+# define WEXITSTATUS(stat_val) ((unsigned int) (stat_val) >> 8)
+#endif
+#ifndef WIFEXITED
+# define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
+#endif
+
+int
+main ()
+{
+  int s;
+  wait (&s);
+  s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_header_sys_wait_h=yes
+else
+  ac_cv_header_sys_wait_h=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_sys_wait_h" >&5
+$as_echo "$ac_cv_header_sys_wait_h" >&6; }
+if test $ac_cv_header_sys_wait_h = yes; then
+
+$as_echo "#define HAVE_SYS_WAIT_H 1" >>confdefs.h
+
+fi
+
+ac_header_dirent=no
+for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do
+  as_ac_Header=`$as_echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh`
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_hdr that defines DIR" >&5
+$as_echo_n "checking for $ac_hdr that defines DIR... " >&6; }
+if eval \${$as_ac_Header+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <sys/types.h>
+#include <$ac_hdr>
+
+int
+main ()
+{
+if ((DIR *) 0)
+return 0;
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  eval "$as_ac_Header=yes"
+else
+  eval "$as_ac_Header=no"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+eval ac_res=\$$as_ac_Header
+              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_hdr" | $as_tr_cpp` 1
+_ACEOF
+
+ac_header_dirent=$ac_hdr; break
+fi
+
+done
+# Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
+if test $ac_header_dirent = dirent.h; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing opendir" >&5
+$as_echo_n "checking for library containing opendir... " >&6; }
+if ${ac_cv_search_opendir+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* 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 opendir ();
+int
+main ()
+{
+return opendir ();
+  ;
+  return 0;
+}
+_ACEOF
+for ac_lib in '' dir; do
+  if test -z "$ac_lib"; then
+    ac_res="none required"
+  else
+    ac_res=-l$ac_lib
+    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
+  fi
+  if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_search_opendir=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext
+  if ${ac_cv_search_opendir+:} false; then :
+  break
+fi
+done
+if ${ac_cv_search_opendir+:} false; then :
+
+else
+  ac_cv_search_opendir=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_opendir" >&5
+$as_echo "$ac_cv_search_opendir" >&6; }
+ac_res=$ac_cv_search_opendir
+if test "$ac_res" != no; then :
+  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+
+fi
+
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing opendir" >&5
+$as_echo_n "checking for library containing opendir... " >&6; }
+if ${ac_cv_search_opendir+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* 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 opendir ();
+int
+main ()
+{
+return opendir ();
+  ;
+  return 0;
+}
+_ACEOF
+for ac_lib in '' x; do
+  if test -z "$ac_lib"; then
+    ac_res="none required"
+  else
+    ac_res=-l$ac_lib
+    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
+  fi
+  if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_search_opendir=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext
+  if ${ac_cv_search_opendir+:} false; then :
+  break
+fi
+done
+if ${ac_cv_search_opendir+:} false; then :
+
+else
+  ac_cv_search_opendir=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_opendir" >&5
+$as_echo "$ac_cv_search_opendir" >&6; }
+ac_res=$ac_cv_search_opendir
+if test "$ac_res" != no; then :
+  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+
+fi
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to call gettimeofday" >&5
+$as_echo_n "checking how to call gettimeofday... " >&6; }
+  if ${ac_cv_gettimeofday_args+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stdlib.h>
+                    #include <sys/time.h>
+int
+main ()
+{
+struct timeval tv; struct timezone tzp;
+                    gettimeofday(&tv, &tzp);
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_gettimeofday_args=2
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stdlib.h>
+                                    #include <sys/time.h>
+int
+main ()
+{
+struct timeval tv; gettimeofday(&tv);
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_gettimeofday_args=1
+else
+  ac_gettimeofday_args=0
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+    ac_cv_gettimeofday_args=$ac_gettimeofday_args
+fi
+
+  ac_gettimeofday_args=$ac_cv_gettimeofday_args
+  if test "$ac_gettimeofday_args" = 1 ; then
+    $as_echo "#define HAVE_GETTIMEOFDAY 1" >>confdefs.h
+
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: one argument" >&5
+$as_echo "one argument" >&6; }
+  elif test "$ac_gettimeofday_args" = 2 ; then
+    $as_echo "#define HAVE_GETTIMEOFDAY 1" >>confdefs.h
+
+    $as_echo "#define GETTIMEOFDAY_TWO_ARGS 1" >>confdefs.h
+
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: two arguments" >&5
+$as_echo "two arguments" >&6; }
+  else
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: unknown" >&5
+$as_echo "unknown" >&6; }
+  fi
+
+# Check whether --enable-largefile was given.
+if test "${enable_largefile+set}" = set; then :
+  enableval=$enable_largefile;
+fi
+
+if test "$enable_largefile" != no; then
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for special C compiler options needed for large files" >&5
+$as_echo_n "checking for special C compiler options needed for large files... " >&6; }
+if ${ac_cv_sys_largefile_CC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_cv_sys_largefile_CC=no
+     if test "$GCC" != yes; then
+       ac_save_CC=$CC
+       while :; do
+        # IRIX 6.2 and later do not support large files by default,
+        # so use the C compiler's -n32 option if that helps.
+        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <sys/types.h>
+ /* Check that off_t can represent 2**63 - 1 correctly.
+    We can't simply define LARGE_OFF_T to be 9223372036854775807,
+    since some C++ compilers masquerading as C compilers
+    incorrectly reject 9223372036854775807.  */
+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+  int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
+                      && LARGE_OFF_T % 2147483647 == 1)
+                     ? 1 : -1];
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+        if ac_fn_c_try_compile "$LINENO"; then :
+  break
+fi
+rm -f core conftest.err conftest.$ac_objext
+        CC="$CC -n32"
+        if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_sys_largefile_CC=' -n32'; break
+fi
+rm -f core conftest.err conftest.$ac_objext
+        break
+       done
+       CC=$ac_save_CC
+       rm -rf conftest.$ac_ext
+    fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_CC" >&5
+$as_echo "$ac_cv_sys_largefile_CC" >&6; }
+  if test "$ac_cv_sys_largefile_CC" != no; then
+    CC=$CC$ac_cv_sys_largefile_CC
+  fi
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _FILE_OFFSET_BITS value needed for large files" >&5
+$as_echo_n "checking for _FILE_OFFSET_BITS value needed for large files... " >&6; }
+if ${ac_cv_sys_file_offset_bits+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  while :; do
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <sys/types.h>
+ /* Check that off_t can represent 2**63 - 1 correctly.
+    We can't simply define LARGE_OFF_T to be 9223372036854775807,
+    since some C++ compilers masquerading as C compilers
+    incorrectly reject 9223372036854775807.  */
+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+  int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
+                      && LARGE_OFF_T % 2147483647 == 1)
+                     ? 1 : -1];
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_sys_file_offset_bits=no; break
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#define _FILE_OFFSET_BITS 64
+#include <sys/types.h>
+ /* Check that off_t can represent 2**63 - 1 correctly.
+    We can't simply define LARGE_OFF_T to be 9223372036854775807,
+    since some C++ compilers masquerading as C compilers
+    incorrectly reject 9223372036854775807.  */
+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+  int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
+                      && LARGE_OFF_T % 2147483647 == 1)
+                     ? 1 : -1];
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_sys_file_offset_bits=64; break
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+  ac_cv_sys_file_offset_bits=unknown
+  break
+done
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_file_offset_bits" >&5
+$as_echo "$ac_cv_sys_file_offset_bits" >&6; }
+case $ac_cv_sys_file_offset_bits in #(
+  no | unknown) ;;
+  *)
+cat >>confdefs.h <<_ACEOF
+#define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits
+_ACEOF
+;;
+esac
+rm -rf conftest*
+  if test $ac_cv_sys_file_offset_bits = unknown; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _LARGE_FILES value needed for large files" >&5
+$as_echo_n "checking for _LARGE_FILES value needed for large files... " >&6; }
+if ${ac_cv_sys_large_files+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  while :; do
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <sys/types.h>
+ /* Check that off_t can represent 2**63 - 1 correctly.
+    We can't simply define LARGE_OFF_T to be 9223372036854775807,
+    since some C++ compilers masquerading as C compilers
+    incorrectly reject 9223372036854775807.  */
+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+  int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
+                      && LARGE_OFF_T % 2147483647 == 1)
+                     ? 1 : -1];
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_sys_large_files=no; break
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#define _LARGE_FILES 1
+#include <sys/types.h>
+ /* Check that off_t can represent 2**63 - 1 correctly.
+    We can't simply define LARGE_OFF_T to be 9223372036854775807,
+    since some C++ compilers masquerading as C compilers
+    incorrectly reject 9223372036854775807.  */
+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+  int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
+                      && LARGE_OFF_T % 2147483647 == 1)
+                     ? 1 : -1];
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_sys_large_files=1; break
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+  ac_cv_sys_large_files=unknown
+  break
+done
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_large_files" >&5
+$as_echo "$ac_cv_sys_large_files" >&6; }
+case $ac_cv_sys_large_files in #(
+  no | unknown) ;;
+  *)
+cat >>confdefs.h <<_ACEOF
+#define _LARGE_FILES $ac_cv_sys_large_files
+_ACEOF
+;;
+esac
+rm -rf conftest*
+  fi
+
+
+fi
+
+for ac_func in select fcntl uname nice setpriority getcwd getwd putenv sbrk
+do :
+  as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+for ac_func in sigaction syslog realpath setrlimit
+do :
+  as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+for ac_func in setlocale
+do :
+  ac_fn_c_check_func "$LINENO" "setlocale" "ac_cv_func_setlocale"
+if test "x$ac_cv_func_setlocale" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_SETLOCALE 1
+_ACEOF
+
+fi
+done
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct icmp" >&5
+$as_echo_n "checking for struct icmp... " >&6; }
+if ${ac_cv_have_icmp+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stdlib.h>
+                   #include <stdio.h>
+                   #include <math.h>
+                   #include <unistd.h>
+                   #include <limits.h>
+                   #include <signal.h>
+                   #include <fcntl.h>
+                   #include <sys/types.h>
                    #include <sys/time.h>
                    #include <sys/ipc.h>
                    #include <sys/shm.h>
                    #include <sys/time.h>
                    #include <sys/ipc.h>
                    #include <sys/shm.h>
@@ -2332,7 +5217,9 @@ else
                    #include <netinet/udp.h>
                    #include <arpa/inet.h>
                    #include <netdb.h>
                    #include <netinet/udp.h>
                    #include <arpa/inet.h>
                    #include <netdb.h>
-int main() {
+int
+main ()
+{
 struct icmp i;
                    struct sockaddr s;
                    struct sockaddr_in si;
 struct icmp i;
                    struct sockaddr s;
                    struct sockaddr_in si;
@@ -2348,1319 +5235,2300 @@ struct icmp i;
                    #else
                    ip.ip_hl = 0;
                    #endif
                    #else
                    ip.ip_hl = 0;
                    #endif
-                   
-; return 0; }
-EOF
-if { (eval echo configure:2366: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
-  rm -rf conftest*
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
   ac_cv_have_icmp=yes
 else
   ac_cv_have_icmp=yes
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  ac_cv_have_icmp=no
+  ac_cv_have_icmp=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_icmp" >&5
+$as_echo "$ac_cv_have_icmp" >&6; }
+ if test "$ac_cv_have_icmp" = yes ; then
+   $as_echo "#define HAVE_ICMP 1" >>confdefs.h
+
+ fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct icmphdr" >&5
+$as_echo_n "checking for struct icmphdr... " >&6; }
+if ${ac_cv_have_icmphdr+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stdlib.h>
+                   #include <stdio.h>
+                   #include <math.h>
+                   #include <unistd.h>
+                   #include <limits.h>
+                   #include <signal.h>
+                   #include <fcntl.h>
+                   #include <sys/types.h>
+                   #include <sys/time.h>
+                   #include <sys/ipc.h>
+                   #include <sys/shm.h>
+                   #include <sys/socket.h>
+                   #include <netinet/in_systm.h>
+                   #include <netinet/in.h>
+                   #include <netinet/ip.h>
+                   #include <netinet/ip_icmp.h>
+                   #include <netinet/udp.h>
+                   #include <arpa/inet.h>
+                   #include <netdb.h>
+int
+main ()
+{
+struct icmphdr i;
+                   struct sockaddr s;
+                   struct sockaddr_in si;
+                   struct ip ip;
+                   i.type = ICMP_ECHO;
+                   i.code = 0;
+                   i.checksum = 0;
+                   i.un.echo.id = 0;
+                   i.un.echo.sequence = 0;
+                   si.sin_family = AF_INET;
+                   ip.ip_hl = 0;
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_have_icmphdr=yes
+else
+  ac_cv_have_icmphdr=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_icmphdr" >&5
+$as_echo "$ac_cv_have_icmphdr" >&6; }
+ if test "$ac_cv_have_icmphdr" = yes ; then
+   $as_echo "#define HAVE_ICMPHDR 1" >>confdefs.h
+
+ fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for getifaddrs" >&5
+$as_echo_n "checking for getifaddrs... " >&6; }
+if ${ac_cv_have_getifaddrs+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* 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
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_have_getifaddrs=yes
+else
+  ac_cv_have_getifaddrs=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_getifaddrs" >&5
+$as_echo "$ac_cv_have_getifaddrs" >&6; }
+ if test "$ac_cv_have_getifaddrs" = yes ; then
+   $as_echo "#define HAVE_GETIFADDRS 1" >>confdefs.h
+
+ fi
+for ac_header in crypt.h sys/select.h
+do :
+  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+for ac_prog in perl5 perl
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_PERL+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $PERL in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_PERL="$PERL" # 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_path_PERL="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+PERL=$ac_cv_path_PERL
+if test -n "$PERL"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PERL" >&5
+$as_echo "$PERL" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -n "$PERL" && break
+done
+
+  if test -z "$PERL" ; then
+    PERL_VERSION=0
+  else
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking perl version" >&5
+$as_echo_n "checking perl version... " >&6; }
+if ${ac_cv_perl_version+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_cv_perl_version=`$PERL -e "$perl_version_cmd"`
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_perl_version" >&5
+$as_echo "$ac_cv_perl_version" >&6; }
+    PERL_VERSION=$ac_cv_perl_version
+  fi
+
+
+if test -z "$PERL" ; then
+  # don't let it be blank...
+  PERL=/usr/bin/perl
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for X" >&5
+$as_echo_n "checking for X... " >&6; }
+
+
+# Check whether --with-x was given.
+if test "${with_x+set}" = set; then :
+  withval=$with_x;
+fi
+
+# $have_x is `yes', `no', `disabled', or empty when we do not yet know.
+if test "x$with_x" = xno; then
+  # The user explicitly disabled X.
+  have_x=disabled
+else
+  case $x_includes,$x_libraries in #(
+    *\'*) as_fn_error $? "cannot use X directory names containing '" "$LINENO" 5;; #(
+    *,NONE | NONE,*) if ${ac_cv_have_x+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  # One or both of the vars are not set, and there is no cached value.
+ac_x_includes=no ac_x_libraries=no
+rm -f -r conftest.dir
+if mkdir conftest.dir; then
+  cd conftest.dir
+  cat >Imakefile <<'_ACEOF'
+incroot:
+       @echo incroot='${INCROOT}'
+usrlibdir:
+       @echo usrlibdir='${USRLIBDIR}'
+libdir:
+       @echo libdir='${LIBDIR}'
+_ACEOF
+  if (export CC; ${XMKMF-xmkmf}) >/dev/null 2>/dev/null && test -f Makefile; then
+    # GNU make sometimes prints "make[1]: Entering ...", which would confuse us.
+    for ac_var in incroot usrlibdir libdir; do
+      eval "ac_im_$ac_var=\`\${MAKE-make} $ac_var 2>/dev/null | sed -n 's/^$ac_var=//p'\`"
+    done
+    # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
+    for ac_extension in a so sl dylib la dll; do
+      if test ! -f "$ac_im_usrlibdir/libX11.$ac_extension" &&
+        test -f "$ac_im_libdir/libX11.$ac_extension"; then
+       ac_im_usrlibdir=$ac_im_libdir; break
+      fi
+    done
+    # Screen out bogus values from the imake configuration.  They are
+    # bogus both because they are the default anyway, and because
+    # using them would break gcc on systems where it needs fixed includes.
+    case $ac_im_incroot in
+       /usr/include) ac_x_includes= ;;
+       *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;;
+    esac
+    case $ac_im_usrlibdir in
+       /usr/lib | /usr/lib64 | /lib | /lib64) ;;
+       *) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;;
+    esac
+  fi
+  cd ..
+  rm -f -r conftest.dir
+fi
+
+# Standard set of common directories for X headers.
+# Check X11 before X11Rn because it is often a symlink to the current release.
+ac_x_header_dirs='
+/usr/X11/include
+/usr/X11R7/include
+/usr/X11R6/include
+/usr/X11R5/include
+/usr/X11R4/include
+
+/usr/include/X11
+/usr/include/X11R7
+/usr/include/X11R6
+/usr/include/X11R5
+/usr/include/X11R4
+
+/usr/local/X11/include
+/usr/local/X11R7/include
+/usr/local/X11R6/include
+/usr/local/X11R5/include
+/usr/local/X11R4/include
+
+/usr/local/include/X11
+/usr/local/include/X11R7
+/usr/local/include/X11R6
+/usr/local/include/X11R5
+/usr/local/include/X11R4
+
+/usr/X386/include
+/usr/x386/include
+/usr/XFree86/include/X11
+
+/usr/include
+/usr/local/include
+/usr/unsupported/include
+/usr/athena/include
+/usr/local/x11r5/include
+/usr/lpp/Xamples/include
+
+/usr/openwin/include
+/usr/openwin/share/include'
+
+if test "$ac_x_includes" = no; then
+  # Guess where to find include files, by looking for Xlib.h.
+  # First, try using that file with no special directory specified.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <X11/Xlib.h>
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+  # We can compile using X headers with no special include directory.
+ac_x_includes=
+else
+  for ac_dir in $ac_x_header_dirs; do
+  if test -r "$ac_dir/X11/Xlib.h"; then
+    ac_x_includes=$ac_dir
+    break
+  fi
+done
+fi
+rm -rf conftest.err conftest.i conftest.$ac_ext
+fi # $ac_x_includes = no
+
+if test "$ac_x_libraries" = no; then
+  # Check for the libraries.
+  # See if we find them without any special options.
+  # Don't add to $LIBS permanently.
+  ac_save_LIBS=$LIBS
+  LIBS="-lX11 $LIBS"
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <X11/Xlib.h>
+int
+main ()
+{
+XrmInitialize ()
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  LIBS=$ac_save_LIBS
+# We can link X programs with no special library path.
+ac_x_libraries=
+else
+  LIBS=$ac_save_LIBS
+for ac_dir in `$as_echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g`
+do
+  # Don't even attempt the hair of trying to link an X program!
+  for ac_extension in a so sl dylib la dll; do
+    if test -r "$ac_dir/libX11.$ac_extension"; then
+      ac_x_libraries=$ac_dir
+      break 2
+    fi
+  done
+done
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+fi # $ac_x_libraries = no
+
+case $ac_x_includes,$ac_x_libraries in #(
+  no,* | *,no | *\'*)
+    # Didn't find X, or a directory has "'" in its name.
+    ac_cv_have_x="have_x=no";; #(
+  *)
+    # Record where we found X for the cache.
+    ac_cv_have_x="have_x=yes\
+       ac_x_includes='$ac_x_includes'\
+       ac_x_libraries='$ac_x_libraries'"
+esac
+fi
+;; #(
+    *) have_x=yes;;
+  esac
+  eval "$ac_cv_have_x"
+fi # $with_x != no
+
+if test "$have_x" != yes; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_x" >&5
+$as_echo "$have_x" >&6; }
+  no_x=yes
+else
+  # If each of the values was on the command line, it overrides each guess.
+  test "x$x_includes" = xNONE && x_includes=$ac_x_includes
+  test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries
+  # Update the cache value to reflect the command line values.
+  ac_cv_have_x="have_x=yes\
+       ac_x_includes='$x_includes'\
+       ac_x_libraries='$x_libraries'"
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: libraries $x_libraries, headers $x_includes" >&5
+$as_echo "libraries $x_libraries, headers $x_includes" >&6; }
+fi
+
+if test "$no_x" = yes; then
+  # Not all programs may use this symbol, but it does not hurt to define it.
+
+$as_echo "#define X_DISPLAY_MISSING 1" >>confdefs.h
+
+  X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS=
+else
+  if test -n "$x_includes"; then
+    X_CFLAGS="$X_CFLAGS -I$x_includes"
+  fi
+
+  # It would also be nice to do this for all -L options, not just this one.
+  if test -n "$x_libraries"; then
+    X_LIBS="$X_LIBS -L$x_libraries"
+    # For Solaris; some versions of Sun CC require a space after -R and
+    # others require no space.  Words are not sufficient . . . .
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -R must be followed by a space" >&5
+$as_echo_n "checking whether -R must be followed by a space... " >&6; }
+    ac_xsave_LIBS=$LIBS; LIBS="$LIBS -R$x_libraries"
+    ac_xsave_c_werror_flag=$ac_c_werror_flag
+    ac_c_werror_flag=yes
+    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+       X_LIBS="$X_LIBS -R$x_libraries"
+else
+  LIBS="$ac_xsave_LIBS -R $x_libraries"
+       cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+         X_LIBS="$X_LIBS -R $x_libraries"
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: neither works" >&5
+$as_echo "neither works" >&6; }
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+    ac_c_werror_flag=$ac_xsave_c_werror_flag
+    LIBS=$ac_xsave_LIBS
+  fi
+
+  # Check for system-dependent libraries X programs must link with.
+  # Do this before checking for the system-independent R6 libraries
+  # (-lICE), since we may need -lsocket or whatever for X linking.
+
+  if test "$ISC" = yes; then
+    X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet"
+  else
+    # Martyn Johnson says this is needed for Ultrix, if the X
+    # libraries were built with DECnet support.  And Karl Berry says
+    # the Alpha needs dnet_stub (dnet does not exist).
+    ac_xsave_LIBS="$LIBS"; LIBS="$LIBS $X_LIBS -lX11"
+    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* 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 XOpenDisplay ();
+int
+main ()
+{
+return XOpenDisplay ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dnet_ntoa in -ldnet" >&5
+$as_echo_n "checking for dnet_ntoa in -ldnet... " >&6; }
+if ${ac_cv_lib_dnet_dnet_ntoa+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldnet  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* 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 dnet_ntoa ();
+int
+main ()
+{
+return dnet_ntoa ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_dnet_dnet_ntoa=yes
+else
+  ac_cv_lib_dnet_dnet_ntoa=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dnet_dnet_ntoa" >&5
+$as_echo "$ac_cv_lib_dnet_dnet_ntoa" >&6; }
+if test "x$ac_cv_lib_dnet_dnet_ntoa" = xyes; then :
+  X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"
+fi
+
+    if test $ac_cv_lib_dnet_dnet_ntoa = no; then
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dnet_ntoa in -ldnet_stub" >&5
+$as_echo_n "checking for dnet_ntoa in -ldnet_stub... " >&6; }
+if ${ac_cv_lib_dnet_stub_dnet_ntoa+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldnet_stub  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* 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 dnet_ntoa ();
+int
+main ()
+{
+return dnet_ntoa ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_dnet_stub_dnet_ntoa=yes
+else
+  ac_cv_lib_dnet_stub_dnet_ntoa=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5
+$as_echo "$ac_cv_lib_dnet_stub_dnet_ntoa" >&6; }
+if test "x$ac_cv_lib_dnet_stub_dnet_ntoa" = xyes; then :
+  X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"
+fi
+
+    fi
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+    LIBS="$ac_xsave_LIBS"
+
+    # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT,
+    # to get the SysV transport functions.
+    # Chad R. Larson says the Pyramis MIS-ES running DC/OSx (SVR4)
+    # needs -lnsl.
+    # The nsl library prevents programs from opening the X display
+    # on Irix 5.2, according to T.E. Dickey.
+    # The functions gethostbyname, getservbyname, and inet_addr are
+    # in -lbsd on LynxOS 3.0.1/i386, according to Lars Hecking.
+    ac_fn_c_check_func "$LINENO" "gethostbyname" "ac_cv_func_gethostbyname"
+if test "x$ac_cv_func_gethostbyname" = xyes; then :
+
+fi
+
+    if test $ac_cv_func_gethostbyname = no; then
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gethostbyname in -lnsl" >&5
+$as_echo_n "checking for gethostbyname in -lnsl... " >&6; }
+if ${ac_cv_lib_nsl_gethostbyname+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lnsl  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* 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 gethostbyname ();
+int
+main ()
+{
+return gethostbyname ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_nsl_gethostbyname=yes
+else
+  ac_cv_lib_nsl_gethostbyname=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nsl_gethostbyname" >&5
+$as_echo "$ac_cv_lib_nsl_gethostbyname" >&6; }
+if test "x$ac_cv_lib_nsl_gethostbyname" = xyes; then :
+  X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl"
+fi
+
+      if test $ac_cv_lib_nsl_gethostbyname = no; then
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gethostbyname in -lbsd" >&5
+$as_echo_n "checking for gethostbyname in -lbsd... " >&6; }
+if ${ac_cv_lib_bsd_gethostbyname+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lbsd  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* 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 gethostbyname ();
+int
+main ()
+{
+return gethostbyname ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_bsd_gethostbyname=yes
+else
+  ac_cv_lib_bsd_gethostbyname=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bsd_gethostbyname" >&5
+$as_echo "$ac_cv_lib_bsd_gethostbyname" >&6; }
+if test "x$ac_cv_lib_bsd_gethostbyname" = xyes; then :
+  X_EXTRA_LIBS="$X_EXTRA_LIBS -lbsd"
+fi
+
+      fi
+    fi
+
+    # lieder@skyler.mavd.honeywell.com says without -lsocket,
+    # socket/setsockopt and other routines are undefined under SCO ODT
+    # 2.0.  But -lsocket is broken on IRIX 5.2 (and is not necessary
+    # on later versions), says Simon Leinen: it contains gethostby*
+    # variants that don't use the name server (or something).  -lsocket
+    # must be given before -lnsl if both are needed.  We assume that
+    # if connect needs -lnsl, so does gethostbyname.
+    ac_fn_c_check_func "$LINENO" "connect" "ac_cv_func_connect"
+if test "x$ac_cv_func_connect" = xyes; then :
+
+fi
+
+    if test $ac_cv_func_connect = no; then
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for connect in -lsocket" >&5
+$as_echo_n "checking for connect in -lsocket... " >&6; }
+if ${ac_cv_lib_socket_connect+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lsocket $X_EXTRA_LIBS $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* 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 connect ();
+int
+main ()
+{
+return connect ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_socket_connect=yes
+else
+  ac_cv_lib_socket_connect=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_connect" >&5
+$as_echo "$ac_cv_lib_socket_connect" >&6; }
+if test "x$ac_cv_lib_socket_connect" = xyes; then :
+  X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS"
+fi
+
+    fi
+
+    # Guillermo Gomez says -lposix is necessary on A/UX.
+    ac_fn_c_check_func "$LINENO" "remove" "ac_cv_func_remove"
+if test "x$ac_cv_func_remove" = xyes; then :
+
+fi
+
+    if test $ac_cv_func_remove = no; then
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for remove in -lposix" >&5
+$as_echo_n "checking for remove in -lposix... " >&6; }
+if ${ac_cv_lib_posix_remove+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lposix  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* 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 remove ();
+int
+main ()
+{
+return remove ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_posix_remove=yes
+else
+  ac_cv_lib_posix_remove=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_posix_remove" >&5
+$as_echo "$ac_cv_lib_posix_remove" >&6; }
+if test "x$ac_cv_lib_posix_remove" = xyes; then :
+  X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix"
+fi
+
+    fi
+
+    # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
+    ac_fn_c_check_func "$LINENO" "shmat" "ac_cv_func_shmat"
+if test "x$ac_cv_func_shmat" = xyes; then :
+
+fi
+
+    if test $ac_cv_func_shmat = no; then
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shmat in -lipc" >&5
+$as_echo_n "checking for shmat in -lipc... " >&6; }
+if ${ac_cv_lib_ipc_shmat+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lipc  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* 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 shmat ();
+int
+main ()
+{
+return shmat ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_ipc_shmat=yes
+else
+  ac_cv_lib_ipc_shmat=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ipc_shmat" >&5
+$as_echo "$ac_cv_lib_ipc_shmat" >&6; }
+if test "x$ac_cv_lib_ipc_shmat" = xyes; then :
+  X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"
+fi
+
+    fi
+  fi
+
+  # Check for libraries that X11R6 Xt/Xaw programs need.
+  ac_save_LDFLAGS=$LDFLAGS
+  test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries"
+  # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
+  # check for ICE first), but we must link in the order -lSM -lICE or
+  # we get undefined symbols.  So assume we have SM if we have ICE.
+  # These have to be linked with before -lX11, unlike the other
+  # libraries we check for below, so use a different variable.
+  # John Interrante, Karl Berry
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IceConnectionNumber in -lICE" >&5
+$as_echo_n "checking for IceConnectionNumber in -lICE... " >&6; }
+if ${ac_cv_lib_ICE_IceConnectionNumber+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lICE $X_EXTRA_LIBS $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* 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 IceConnectionNumber ();
+int
+main ()
+{
+return IceConnectionNumber ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_ICE_IceConnectionNumber=yes
+else
+  ac_cv_lib_ICE_IceConnectionNumber=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5
+$as_echo "$ac_cv_lib_ICE_IceConnectionNumber" >&6; }
+if test "x$ac_cv_lib_ICE_IceConnectionNumber" = xyes; then :
+  X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE"
+fi
+
+  LDFLAGS=$ac_save_LDFLAGS
+
 fi
 fi
-rm -f conftest*
+
+
+if test "$have_x" != yes; then
+  as_fn_error $? "Couldn't find X11 headers/libs.  Try \`$0 --help'." "$LINENO" 5
+fi
+
+
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for X app-defaults directory" >&5
+$as_echo_n "checking for X app-defaults directory... " >&6; }
+if ${ac_cv_x_app_defaults+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+
+  rm -fr conftestdir
+  if mkdir conftestdir; then
+    cd conftestdir 2>/dev/null
+    # Make sure to not put "make" in the Imakefile rules, since we grep it out.
+    cat > Imakefile <<'EOF'
+acfindx:
+       @echo 'ac_x_app_defaults="${XAPPLOADDIR}"'
+EOF
+    if (xmkmf) >/dev/null 2>&1 && test -f Makefile; then
+      # GNU make sometimes prints "make[1]: Entering...", which'd confuse us.
+      eval `${MAKE-make} acfindx 2>/dev/null | grep -v make`
+    fi
+    cd .. 2>/dev/null
+    rm -fr conftestdir
+  fi
+      if test x"$ac_x_app_defaults" = x; then
+
+  # Look for the directory under a standard set of common directories.
+  # Check X11 before X11Rn because it's often a symlink to the current release.
+  for ac_dir in                                 \
+    /usr/X11/lib/app-defaults                   \
+    /usr/X11R6/lib/app-defaults                 \
+    /usr/X11R6/lib/X11/app-defaults             \
+    /usr/X11R5/lib/app-defaults                 \
+    /usr/X11R5/lib/X11/app-defaults             \
+    /usr/X11R4/lib/app-defaults                 \
+    /usr/X11R4/lib/X11/app-defaults             \
+                                                \
+    /usr/lib/X11/app-defaults                   \
+    /usr/lib/X11R6/app-defaults                 \
+    /usr/lib/X11R5/app-defaults                 \
+    /usr/lib/X11R4/app-defaults                 \
+                                                \
+    /usr/local/X11/lib/app-defaults             \
+    /usr/local/X11R6/lib/app-defaults           \
+    /usr/local/X11R5/lib/app-defaults           \
+    /usr/local/X11R4/lib/app-defaults           \
+                                                \
+    /usr/local/lib/X11/app-defaults             \
+    /usr/local/lib/X11R6/app-defaults           \
+    /usr/local/lib/X11R6/X11/app-defaults       \
+    /usr/local/lib/X11R5/app-defaults           \
+    /usr/local/lib/X11R5/X11/app-defaults       \
+    /usr/local/lib/X11R4/app-defaults           \
+    /usr/local/lib/X11R4/X11/app-defaults       \
+                                                \
+    /usr/X386/lib/X11/app-defaults              \
+    /usr/x386/lib/X11/app-defaults              \
+    /usr/XFree86/lib/X11/app-defaults           \
+                                                \
+    /usr/lib/X11/app-defaults                   \
+    /usr/local/lib/X11/app-defaults             \
+    /usr/unsupported/lib/X11/app-defaults       \
+    /usr/athena/lib/X11/app-defaults            \
+    /usr/local/x11r5/lib/X11/app-defaults       \
+    /usr/lpp/Xamples/lib/X11/app-defaults       \
+    /lib/usr/lib/X11/app-defaults               \
+                                                \
+    /usr/openwin/lib/app-defaults               \
+    /usr/openwin/lib/X11/app-defaults           \
+    /usr/openwin/share/lib/app-defaults         \
+    /usr/openwin/share/lib/X11/app-defaults     \
+                                                \
+    /X11R6/lib/app-defaults                     \
+    /X11R5/lib/app-defaults                     \
+    /X11R4/lib/app-defaults                     \
+    ; \
+  do
+    if test -d "$ac_dir"; then
+      ac_x_app_defaults=$ac_dir
+      break
+    fi
+  done
+
+      fi
+      if test x"$ac_x_app_defaults" = x; then
+        ac_cv_x_app_defaults="/usr/lib/X11/app-defaults"
+      else
+        # Record where we found app-defaults for the cache.
+        ac_cv_x_app_defaults="$ac_x_app_defaults"
+      fi
 fi
 fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_x_app_defaults" >&5
+$as_echo "$ac_cv_x_app_defaults" >&6; }
+    eval ac_x_app_defaults="$ac_cv_x_app_defaults"
+case "$host" in
+    *-hpux*)
+
+      # The following arcana was gleaned from conversations with
+      # Eric Schwartz <erics@col.hp.com>:
+      #
+      # On HPUX 10.x, the parts of X that HP considers "standard" live in
+      # /usr/{include,lib}/X11R6/.  The parts that HP doesn't consider
+      # "standard", notably, Xaw and Xmu, live in /usr/contrib/X11R6/.
+      # Yet /usr/contrib/X11R6/ comes preinstalled on all HPUX systems.
+      # Also, there are symlinks from /usr/include/ and /usr/lib/ into
+      # /usr/{include,lib}/X11R6/, so that (if you don't use Xmu at all)
+      # you don't need any -I or -L arguments.
+      #
+      # On HPUX 9.x, /usr/{include,lib}/X11R5/ and /usr/contrib/X11R5/
+      # are the same division as 10.x.  However, there are no symlinks to
+      # the X stuff from /usr/include/ and /usr/lib/, so -I and -L
+      # arguments are always necessary.
+      #
+      # However, X11R6 was available on HPUX 9.x as a patch: if that
+      # patch was installed, then all of X11R6 went in to
+      # /usr/contrib/X11R6/ (there was no /usr/{include,lib}/X11R6/.)
+      #
+      # HPUX 8.x was the same as 9.x, but was X11R4 instead (I don't know
+      # whether R5 was available as a patch; R6 undoubtedly was not.)
+      #
+      # So.  We try and use the highest numbered pair of
+      # /usr/{include,lib}/X11R?/ and /usr/contrib/X11R?/{include,lib}/
+      # that are available.  We do not mix and match different versions
+      # of X.
+      #
+      # Question I still don't know the answer to: (do you?)
+      #
+      #   * On HPUX 9.x, where /usr/include/X11R5/ was standard, and
+      #     /usr/contrib/X11R6/ could be installed as a patch, what was in
+      #     that contrib directory?  Did it contain so-called "standard"
+      #     X11R6, or did it include Xaw and Xmu as well?  If the former,
+      #     where did one find Xaw and Xmu on 9.x R6 systems?  Would this
+      #     be a situation where one had to reach into the R5 headers and
+      #     libs to find Xmu?  That is, must both R6 and R5 directories
+      #     be on the -I and -L lists in that case?
+      #
+      for version in X11R6 X11R5 X11R4 ; do
+        # if either pair of directories exists...
+        if test -d /usr/include/$version || test -d /usr/contrib/$version/include
+        then
+           # if contrib exists, use it...
+           if test -d /usr/contrib/$version/include ; then
+             X_CFLAGS="$X_CFLAGS -I/usr/contrib/$version/include"
+             X_LIBS="$X_LIBS -L/usr/contrib/$version/lib"
+           fi
+           # if the "standard" one exists, use it.
+           if test -d /usr/include/$version ; then
+             X_CFLAGS="$X_CFLAGS -I/usr/include/$version"
+             X_LIBS="$X_LIBS -L/usr/lib/$version"
+           fi
+           # since at least one of the pair exists, go no farther.
+           break
+        fi
+      done
 
 
-echo "$ac_t""$ac_cv_have_icmp" 1>&6
- if test "$ac_cv_have_icmp" = yes ; then
-   cat >> confdefs.h <<\EOF
-#define HAVE_ICMP 1
-EOF
+      # Now find Motif.  Thanks for not making xmkmf find this by
+      # default, you losers.
+      #
+      if test -d /usr/include/Motif2.1 ; then
+        X_CFLAGS="$X_CFLAGS -I/usr/include/Motif2.1"
+        X_LIBS="$X_LIBS -L/usr/lib/Motif2.1"
+      elif test -d /usr/include/Motif1.2 ; then
+        X_CFLAGS="$X_CFLAGS -I/usr/include/Motif1.2"
+        X_LIBS="$X_LIBS -L/usr/lib/Motif1.2"
+      elif test -d /usr/include/Motif1.1 ; then
+        X_CFLAGS="$X_CFLAGS -I/usr/include/Motif1.1"
+        X_LIBS="$X_LIBS -L/usr/lib/Motif1.1"
+      fi
 
 
- fi
-echo $ac_n "checking for struct icmphdr""... $ac_c" 1>&6
-echo "configure:2386: checking for struct icmphdr" >&5
-if eval "test \"`echo '$''{'ac_cv_have_icmphdr'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+      # Now let's check for the pseudo-standard locations for OpenGL and XPM.
+      #
+      if test -d /opt/graphics/OpenGL/include ; then
+        # HP-UX 10.20 puts it here
+        X_CFLAGS="-I/opt/graphics/OpenGL/include $X_CFLAGS"
+        X_LIBS="-L/opt/graphics/OpenGL/lib $X_LIBS"
+      elif test -d /opt/Mesa/lib ; then
+        X_CFLAGS="-I/opt/Mesa/include $X_CFLAGS"
+        X_LIBS="-L/opt/Mesa/lib $X_LIBS"
+      fi
+
+
+      if test -d /opt/xpm/lib/X11 ; then
+        X_CFLAGS="-I/opt/xpm/include $X_CFLAGS"
+        X_LIBS="-L/opt/xpm/lib/X11 $X_LIBS"
+      fi
+
+      # On HPUX, default to installing in /opt/xscreensaver/ instead of
+      # in /usr/local/, unless there is already an xscreensaver in
+      # /usr/local/bin/.  This can be overridden with the --prefix arg
+      # to configure.  I'm not sure this is the right thing to do, but
+      # Richard Lloyd says so...
+      #
+      if test \! -x /usr/local/bin/xscreensaver ; then
+        ac_default_prefix=/opt/xscreensaver
+      fi
+
+    ;;
+    *-solaris*)
+
+      # Thanks for not making xmkmf find this by default, pinheads.
+      # And thanks for moving things around again, too.  Is this
+      # really the standard location now?  What happened to the
+      # joke that this kind of thing went in /opt?
+      # cthomp says "answer: CDE (Common Disorganized Environment)"
+      #
+      if test -f /usr/dt/include/Xm/Xm.h ; then
+        X_CFLAGS="$X_CFLAGS -I/usr/dt/include"
+        MOTIF_LIBS="$MOTIF_LIBS -L/usr/dt/lib -R/usr/dt/lib"
+
+        # Some versions of Slowlaris Motif require -lgen.  But not all.  Why?
+        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for regcmp in -lgen" >&5
+$as_echo_n "checking for regcmp in -lgen... " >&6; }
+if ${ac_cv_lib_gen_regcmp+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
 else
-  cat > conftest.$ac_ext <<EOF
-#line 2391 "configure"
-#include "confdefs.h"
-#include <stdlib.h>
-                   #include <stdio.h>
-                   #include <math.h>
-                   #include <unistd.h>
-                   #include <limits.h>
-                   #include <signal.h>
-                   #include <fcntl.h>
-                   #include <sys/types.h>
-                   #include <sys/time.h>
-                   #include <sys/ipc.h>
-                   #include <sys/shm.h>
-                   #include <sys/socket.h>
-                   #include <netinet/in_systm.h>
-                   #include <netinet/in.h>
-                   #include <netinet/ip.h>
-                   #include <netinet/ip_icmp.h>
-                   #include <netinet/udp.h>
-                   #include <arpa/inet.h>
-                   #include <netdb.h>
-int main() {
-struct icmphdr i;
-                   struct sockaddr s;
-                   struct sockaddr_in si;
-                   struct ip ip;
-                   i.type = ICMP_ECHO;
-                   i.code = 0;
-                   i.checksum = 0;
-                   i.un.echo.id = 0;
-                   i.un.echo.sequence = 0;
-                   si.sin_family = AF_INET;
-                   ip.ip_hl = 0;
-; return 0; }
-EOF
-if { (eval echo configure:2426: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
-  rm -rf conftest*
-  ac_cv_have_icmphdr=yes
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lgen  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* 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 regcmp ();
+int
+main ()
+{
+return regcmp ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_gen_regcmp=yes
 else
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  ac_cv_have_icmphdr=no
+  ac_cv_lib_gen_regcmp=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
 fi
 fi
-rm -f conftest*
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_gen_regcmp" >&5
+$as_echo "$ac_cv_lib_gen_regcmp" >&6; }
+if test "x$ac_cv_lib_gen_regcmp" = xyes; then :
+  MOTIF_LIBS="$MOTIF_LIBS -lgen"
 fi
 
 fi
 
-echo "$ac_t""$ac_cv_have_icmphdr" 1>&6
- if test "$ac_cv_have_icmphdr" = yes ; then
-   cat >> confdefs.h <<\EOF
-#define HAVE_ICMPHDR 1
-EOF
+      fi
 
 
- fi
-for ac_hdr in crypt.h sys/select.h
-do
-ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:2449: checking for $ac_hdr" >&5
-if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  cat > conftest.$ac_ext <<EOF
-#line 2454 "configure"
-#include "confdefs.h"
-#include <$ac_hdr>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2459: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
-  rm -rf conftest*
-  eval "ac_cv_header_$ac_safe=yes"
-else
-  echo "$ac_err" >&5
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_header_$ac_safe=no"
-fi
-rm -f conftest*
-fi
-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
-  cat >> confdefs.h <<EOF
-#define $ac_tr_hdr 1
-EOF
+    ;;
+    *-darwin*)
+
+      # On MacOS X (10.x with "fink"), many things are under /sw/.
+      #
+      if test -d /sw/include ; then
+        X_CFLAGS="-I/sw/include $X_CFLAGS"
+        X_LIBS="-L/sw/lib $X_LIBS"
+      fi
+    ;;
+  esac
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for XPointer" >&5
+$as_echo_n "checking for XPointer... " >&6; }
+if ${ac_cv_xpointer+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
 else
-  echo "$ac_t""no" 1>&6
-fi
-done
 
 
-for ac_prog in perl5 perl
-do
-# Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2490: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_path_PERL'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+  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`
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <X11/Xlib.h>
+int
+main ()
+{
+XPointer foo = (XPointer) 0;
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_xpointer=yes
 else
 else
-  case "$PERL" in
-  /*)
-  ac_cv_path_PERL="$PERL" # Let the user override the test with a path.
-  ;;
-  ?:/*)                         
-  ac_cv_path_PERL="$PERL" # Let the user override the test with a dos path.
-  ;;
-  *)
-  IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS=":"
-  ac_dummy="$PATH"
-  for ac_dir in $ac_dummy; do 
-    test -z "$ac_dir" && ac_dir=.
-    if test -f $ac_dir/$ac_word; then
-      ac_cv_path_PERL="$ac_dir/$ac_word"
-      break
-    fi
-  done
-  IFS="$ac_save_ifs"
-  ;;
-esac
+  ac_cv_xpointer=no
 fi
 fi
-PERL="$ac_cv_path_PERL"
-if test -n "$PERL"; then
-  echo "$ac_t""$PERL" 1>&6
-else
-  echo "$ac_t""no" 1>&6
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+  CPPFLAGS="$ac_save_CPPFLAGS"
 fi
 fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_xpointer" >&5
+$as_echo "$ac_cv_xpointer" >&6; }
+  if test "$ac_cv_xpointer" != yes; then
+   $as_echo "#define XPointer char*" >>confdefs.h
 
 
-test -n "$PERL" && break
-done
+  fi
 
 
-  if test -z "$PERL" ; then
-    PERL_VERSION=0
-  else
-    echo $ac_n "checking perl version""... $ac_c" 1>&6
-echo "configure:2529: checking perl version" >&5
-if eval "test \"`echo '$''{'ac_cv_perl_version'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  ac_cv_perl_version=`$PERL -e "$perl_version_cmd"`
-fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether this is MacOS X" >&5
+$as_echo_n "checking whether this is MacOS X... " >&6; }
+  ac_macosx=no
+  case "$host" in
+    *-apple-darwin* )
+      ac_macosx=yes
+    ;;
+  esac
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_macosx" >&5
+$as_echo "$ac_macosx" >&6; }
 
 
-echo "$ac_t""$ac_cv_perl_version" 1>&6
-    PERL_VERSION=$ac_cv_perl_version
-  fi
 
 
-if test -z "$PERL" ; then
-  # don't let it be blank...
-  PERL=/usr/bin/perl
-fi
+###############################################################################
+#
+#       Gettext support
+#
+###############################################################################
 
 
-# If we find X, set shell vars x_includes and x_libraries to the
-# paths, otherwise set no_x=yes.
-# Uses ac_ vars as temps to allow command line to override cache and checks.
-# --without-x overrides everything else, but does not touch the cache.
-echo $ac_n "checking for X""... $ac_c" 1>&6
-echo "configure:2551: checking for X" >&5
 
 
-# Check whether --with-x or --without-x was given.
-if test "${with_x+set}" = set; then
-  withval="$with_x"
-  :
-fi
 
 
-# $have_x is `yes', `no', `disabled', or empty when we do not yet know.
-if test "x$with_x" = xno; then
-  # The user explicitly disabled X.
-  have_x=disabled
-else
-  if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then
-    # Both variables are already set.
-    have_x=yes
-  else
-if eval "test \"`echo '$''{'ac_cv_have_x'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  # One or both of the vars are not set, and there is no cached value.
-ac_x_includes=NO ac_x_libraries=NO
-rm -fr conftestdir
-if mkdir conftestdir; then
-  cd conftestdir
-  # Make sure to not put "make" in the Imakefile rules, since we grep it out.
-  cat > Imakefile <<'EOF'
-acfindx:
-       @echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"'
-EOF
-  if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
-    # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
-    eval `${MAKE-make} acfindx 2>/dev/null | grep -v make`
-    # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
-    for ac_extension in a so sl; do
-      if test ! -f $ac_im_usrlibdir/libX11.$ac_extension &&
-        test -f $ac_im_libdir/libX11.$ac_extension; then
-        ac_im_usrlibdir=$ac_im_libdir; break
-      fi
-    done
-    # Screen out bogus values from the imake configuration.  They are
-    # bogus both because they are the default anyway, and because
-    # using them would break gcc on systems where it needs fixed includes.
-    case "$ac_im_incroot" in
-       /usr/include) ;;
-       *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes="$ac_im_incroot" ;;
-    esac
-    case "$ac_im_usrlibdir" in
-       /usr/lib | /lib) ;;
-       *) test -d "$ac_im_usrlibdir" && ac_x_libraries="$ac_im_usrlibdir" ;;
-    esac
-  fi
-  cd ..
-  rm -fr conftestdir
-fi
+if test -n ""; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for intltool >= " >&5
+$as_echo_n "checking for intltool >= ... " >&6; }
 
 
-if test "$ac_x_includes" = NO; then
-  # Guess where to find include files, by looking for this one X11 .h file.
-  test -z "$x_direct_test_include" && x_direct_test_include=X11/Intrinsic.h
+    INTLTOOL_REQUIRED_VERSION_AS_INT=`echo  | awk -F. '{ printf "%d", $1 * 100 + $2; }'`
+    INTLTOOL_APPLIED_VERSION=`awk -F\" '/\\$VERSION / { printf $2; }'  < intltool-update.in`
 
 
-  # First, try using that file with no special directory specified.
-cat > conftest.$ac_ext <<EOF
-#line 2613 "configure"
-#include "confdefs.h"
-#include <$x_direct_test_include>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2618: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
-  rm -rf conftest*
-  # We can compile using X headers with no special include directory.
-ac_x_includes=
-else
-  echo "$ac_err" >&5
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  # Look for the header file in a standard set of common directories.
-# Check X11 before X11Rn because it is often a symlink to the current release.
-  for ac_dir in               \
-    /usr/X11/include          \
-    /usr/X11R6/include        \
-    /usr/X11R5/include        \
-    /usr/X11R4/include        \
-                              \
-    /usr/include/X11          \
-    /usr/include/X11R6        \
-    /usr/include/X11R5        \
-    /usr/include/X11R4        \
-                              \
-    /usr/local/X11/include    \
-    /usr/local/X11R6/include  \
-    /usr/local/X11R5/include  \
-    /usr/local/X11R4/include  \
-                              \
-    /usr/local/include/X11    \
-    /usr/local/include/X11R6  \
-    /usr/local/include/X11R5  \
-    /usr/local/include/X11R4  \
-                              \
-    /usr/X386/include         \
-    /usr/x386/include         \
-    /usr/XFree86/include/X11  \
-                              \
-    /usr/include              \
-    /usr/local/include        \
-    /usr/unsupported/include  \
-    /usr/athena/include       \
-    /usr/local/x11r5/include  \
-    /usr/lpp/Xamples/include  \
-                              \
-    /usr/openwin/include      \
-    /usr/openwin/share/include \
-    ; \
-  do
-    if test -r "$ac_dir/$x_direct_test_include"; then
-      ac_x_includes=$ac_dir
-      break
+    INTLTOOL_APPLIED_VERSION_AS_INT=`awk -F\" '/\\$VERSION / { split($2, VERSION, "."); printf "%d\n", VERSION[1] * 100 + VERSION[2];}' < intltool-update.in`
+
+
+    if test "$INTLTOOL_APPLIED_VERSION_AS_INT" -ge "$INTLTOOL_REQUIRED_VERSION_AS_INT"; then
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INTLTOOL_APPLIED_VERSION found" >&5
+$as_echo "$INTLTOOL_APPLIED_VERSION found" >&6; }
+    else
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INTLTOOL_APPLIED_VERSION found. Your intltool is too old.  You need intltool  or later." >&5
+$as_echo "$INTLTOOL_APPLIED_VERSION found. Your intltool is too old.  You need intltool  or later." >&6; }
+       exit 1
     fi
     fi
-  done
 fi
 fi
-rm -f conftest*
-fi # $ac_x_includes = NO
 
 
-if test "$ac_x_libraries" = NO; then
-  # Check for the libraries.
+  INTLTOOL_DESKTOP_RULE='%.desktop:   %.desktop.in   $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_MERGE) $(top_srcdir)/po $< $@ -d -u -c $(top_builddir)/po/.intltool-merge-cache'
+INTLTOOL_DIRECTORY_RULE='%.directory: %.directory.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_MERGE) $(top_srcdir)/po $< $@ -d -u -c $(top_builddir)/po/.intltool-merge-cache'
+     INTLTOOL_KEYS_RULE='%.keys:      %.keys.in      $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_MERGE) $(top_srcdir)/po $< $@ -k -u -c $(top_builddir)/po/.intltool-merge-cache'
+      INTLTOOL_OAF_RULE='%.oaf:       %.oaf.in       $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_MERGE) $(top_srcdir)/po $< $@ -o -p'
+     INTLTOOL_PONG_RULE='%.pong:      %.pong.in      $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_MERGE) $(top_srcdir)/po $< $@ -x -u -c $(top_builddir)/po/.intltool-merge-cache'
+   INTLTOOL_SERVER_RULE='%.server:    %.server.in    $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_MERGE) $(top_srcdir)/po $< $@ -o -u -c $(top_builddir)/po/.intltool-merge-cache'
+    INTLTOOL_SHEET_RULE='%.sheet:     %.sheet.in     $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_MERGE) $(top_srcdir)/po $< $@ -x -u -c $(top_builddir)/po/.intltool-merge-cache'
+INTLTOOL_SOUNDLIST_RULE='%.soundlist: %.soundlist.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_MERGE) $(top_srcdir)/po $< $@ -d -u -c $(top_builddir)/po/.intltool-merge-cache'
+       INTLTOOL_UI_RULE='%.ui:        %.ui.in        $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_MERGE) $(top_srcdir)/po $< $@ -x -u -c $(top_builddir)/po/.intltool-merge-cache'
+      INTLTOOL_XML_RULE='%.xml:       %.xml.in       $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_MERGE) $(top_srcdir)/po $< $@ -x -u -c $(top_builddir)/po/.intltool-merge-cache'
+    INTLTOOL_CAVES_RULE='%.caves:     %.caves.in     $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_MERGE) $(top_srcdir)/po $< $@ -d -u -c $(top_builddir)/po/.intltool-merge-cache'
+
+
+
+
+
+
+
+
+
+
+
+
+
+# Use the tools built into the package, not the ones that are installed.
+
+INTLTOOL_EXTRACT='$(top_builddir)/intltool-extract'
+INTLTOOL_MERGE='$(top_builddir)/intltool-merge'
+INTLTOOL_UPDATE='$(top_builddir)/intltool-update'
+
+
 
 
-  test -z "$x_direct_test_library" && x_direct_test_library=Xt
-  test -z "$x_direct_test_function" && x_direct_test_function=XtMalloc
 
 
-  # See if we find them without any special options.
-  # Don't add to $LIBS permanently.
-  ac_save_LIBS="$LIBS"
-  LIBS="-l$x_direct_test_library $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 2687 "configure"
-#include "confdefs.h"
 
 
-int main() {
-${x_direct_test_function}()
-; return 0; }
-EOF
-if { (eval echo configure:2694: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  LIBS="$ac_save_LIBS"
-# We can link X programs with no special library path.
-ac_x_libraries=
+# Extract the first word of "perl", so it can be a program name with args.
+set dummy perl; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_INTLTOOL_PERL+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  LIBS="$ac_save_LIBS"
-# First see if replacing the include by lib works.
-# Check X11 before X11Rn because it is often a symlink to the current release.
-for ac_dir in `echo "$ac_x_includes" | sed s/include/lib/` \
-    /usr/X11/lib          \
-    /usr/X11R6/lib        \
-    /usr/X11R5/lib        \
-    /usr/X11R4/lib        \
-                          \
-    /usr/lib/X11          \
-    /usr/lib/X11R6        \
-    /usr/lib/X11R5        \
-    /usr/lib/X11R4        \
-                          \
-    /usr/local/X11/lib    \
-    /usr/local/X11R6/lib  \
-    /usr/local/X11R5/lib  \
-    /usr/local/X11R4/lib  \
-                          \
-    /usr/local/lib/X11    \
-    /usr/local/lib/X11R6  \
-    /usr/local/lib/X11R5  \
-    /usr/local/lib/X11R4  \
-                          \
-    /usr/X386/lib         \
-    /usr/x386/lib         \
-    /usr/XFree86/lib/X11  \
-                          \
-    /usr/lib              \
-    /usr/local/lib        \
-    /usr/unsupported/lib  \
-    /usr/athena/lib       \
-    /usr/local/x11r5/lib  \
-    /usr/lpp/Xamples/lib  \
-    /lib/usr/lib/X11     \
-                          \
-    /usr/openwin/lib      \
-    /usr/openwin/share/lib \
-    ; \
+  case $INTLTOOL_PERL in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_INTLTOOL_PERL="$INTLTOOL_PERL" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
 do
 do
-  for ac_extension in a so sl; do
-    if test -r $ac_dir/lib${x_direct_test_library}.$ac_extension; then
-      ac_x_libraries=$ac_dir
-      break 2
-    fi
-  done
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_path_INTLTOOL_PERL="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
 done
 done
-fi
-rm -f conftest*
-fi # $ac_x_libraries = NO
+  done
+IFS=$as_save_IFS
 
 
-if test "$ac_x_includes" = NO || test "$ac_x_libraries" = NO; then
-  # Didn't find X anywhere.  Cache the known absence of X.
-  ac_cv_have_x="have_x=no"
-else
-  # Record where we found X for the cache.
-  ac_cv_have_x="have_x=yes \
-               ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries"
+  ;;
+esac
 fi
 fi
+INTLTOOL_PERL=$ac_cv_path_INTLTOOL_PERL
+if test -n "$INTLTOOL_PERL"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INTLTOOL_PERL" >&5
+$as_echo "$INTLTOOL_PERL" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
 fi
 fi
-  fi
-  eval "$ac_cv_have_x"
-fi # $with_x != no
 
 
-if test "$have_x" != yes; then
-  echo "$ac_t""$have_x" 1>&6
-  no_x=yes
-else
-  # If each of the values was on the command line, it overrides each guess.
-  test "x$x_includes" = xNONE && x_includes=$ac_x_includes
-  test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries
-  # Update the cache value to reflect the command line values.
-  ac_cv_have_x="have_x=yes \
-               ac_x_includes=$x_includes ac_x_libraries=$x_libraries"
-  echo "$ac_t""libraries $x_libraries, headers $x_includes" 1>&6
+
+if test -z "$INTLTOOL_PERL"; then
+   as_fn_error $? "perl not found; required for intltool" "$LINENO" 5
+fi
+if test -z "`$INTLTOOL_PERL -v | fgrep '5.' 2> /dev/null`"; then
+   as_fn_error $? "perl 5.x required for intltool" "$LINENO" 5
 fi
 
 fi
 
-if test "$no_x" = yes; then
-  # Not all programs may use this symbol, but it does not hurt to define it.
-  cat >> confdefs.h <<\EOF
-#define X_DISPLAY_MISSING 1
-EOF
+# Remove file type tags (using []) from po/POTFILES.
 
 
-  X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS=
-else
-  if test -n "$x_includes"; then
-    X_CFLAGS="$X_CFLAGS -I$x_includes"
-  fi
 
 
-  # It would also be nice to do this for all -L options, not just this one.
-  if test -n "$x_libraries"; then
-    X_LIBS="$X_LIBS -L$x_libraries"
-    # For Solaris; some versions of Sun CC require a space after -R and
-    # others require no space.  Words are not sufficient . . . .
-    case "`(uname -sr) 2>/dev/null`" in
-    "SunOS 5"*)
-      echo $ac_n "checking whether -R must be followed by a space""... $ac_c" 1>&6
-echo "configure:2800: checking whether -R must be followed by a space" >&5
-      ac_xsave_LIBS="$LIBS"; LIBS="$LIBS -R$x_libraries"
-      cat > conftest.$ac_ext <<EOF
-#line 2803 "configure"
-#include "confdefs.h"
 
 
-int main() {
 
 
-; return 0; }
-EOF
-if { (eval echo configure:2810: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  ac_R_nospace=yes
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  ac_R_nospace=no
-fi
-rm -f conftest*
-      if test $ac_R_nospace = yes; then
-       echo "$ac_t""no" 1>&6
-       X_LIBS="$X_LIBS -R$x_libraries"
-      else
-       LIBS="$ac_xsave_LIBS -R $x_libraries"
-       cat > conftest.$ac_ext <<EOF
-#line 2826 "configure"
-#include "confdefs.h"
 
 
-int main() {
 
 
-; return 0; }
-EOF
-if { (eval echo configure:2833: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  ac_R_space=yes
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  ac_R_space=no
-fi
-rm -f conftest*
-       if test $ac_R_space = yes; then
-         echo "$ac_t""yes" 1>&6
-         X_LIBS="$X_LIBS -R $x_libraries"
-       else
-         echo "$ac_t""neither works" 1>&6
-       fi
-      fi
-      LIBS="$ac_xsave_LIBS"
-    esac
-  fi
 
 
-  # Check for system-dependent libraries X programs must link with.
-  # Do this before checking for the system-independent R6 libraries
-  # (-lICE), since we may need -lsocket or whatever for X linking.
+# Manually sed perl in so people don't have to put the intltool scripts in AC_OUTPUT.
 
 
-  if test "$ISC" = yes; then
-    X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet"
-  else
-    # Martyn.Johnson@cl.cam.ac.uk says this is needed for Ultrix, if the X
-    # libraries were built with DECnet support.  And karl@cs.umb.edu says
-    # the Alpha needs dnet_stub (dnet does not exist).
-    echo $ac_n "checking for dnet_ntoa in -ldnet""... $ac_c" 1>&6
-echo "configure:2865: checking for dnet_ntoa in -ldnet" >&5
-ac_lib_var=`echo dnet'_'dnet_ntoa | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+ac_config_commands="$ac_config_commands default-1"
+
+
+
+GETTEXT_PACKAGE=xscreensaver
+
+cat >>confdefs.h <<_ACEOF
+#define GETTEXT_PACKAGE "$GETTEXT_PACKAGE"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE "$GETTEXT_PACKAGE"
+_ACEOF
+
+
+
+ALL_LINGUAS="ca da de es et fi fr hu it ja ko nb nl pl pt pt_BR ru sk sv vi wa zh_CN zh_TW"
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ranlib; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_RANLIB+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
 else
-  ac_save_LIBS="$LIBS"
-LIBS="-ldnet  $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 2873 "configure"
-#include "confdefs.h"
-/* Override any gcc2 internal prototype to avoid an error.  */
-/* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char dnet_ntoa();
-
-int main() {
-dnet_ntoa()
-; return 0; }
-EOF
-if { (eval echo configure:2884: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=yes"
+  if test -n "$RANLIB"; then
+  ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
 else
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=no"
-fi
-rm -f conftest*
-LIBS="$ac_save_LIBS"
+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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
 
 fi
 
 fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-  X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"
+fi
+RANLIB=$ac_cv_prog_RANLIB
+if test -n "$RANLIB"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5
+$as_echo "$RANLIB" >&6; }
 else
 else
-  echo "$ac_t""no" 1>&6
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
 fi
 
-    if test $ac_cv_lib_dnet_dnet_ntoa = no; then
-      echo $ac_n "checking for dnet_ntoa in -ldnet_stub""... $ac_c" 1>&6
-echo "configure:2906: checking for dnet_ntoa in -ldnet_stub" >&5
-ac_lib_var=`echo dnet_stub'_'dnet_ntoa | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+
+fi
+if test -z "$ac_cv_prog_RANLIB"; then
+  ac_ct_RANLIB=$RANLIB
+  # Extract the first word of "ranlib", so it can be a program name with args.
+set dummy ranlib; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_RANLIB+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
 else
-  ac_save_LIBS="$LIBS"
-LIBS="-ldnet_stub  $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 2914 "configure"
-#include "confdefs.h"
-/* Override any gcc2 internal prototype to avoid an error.  */
-/* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char dnet_ntoa();
-
-int main() {
-dnet_ntoa()
-; return 0; }
-EOF
-if { (eval echo configure:2925: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=yes"
+  if test -n "$ac_ct_RANLIB"; then
+  ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
 else
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=no"
-fi
-rm -f conftest*
-LIBS="$ac_save_LIBS"
+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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_RANLIB="ranlib"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
 
 fi
 
 fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-  X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"
+fi
+ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
+if test -n "$ac_ct_RANLIB"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5
+$as_echo "$ac_ct_RANLIB" >&6; }
 else
 else
-  echo "$ac_t""no" 1>&6
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
 fi
 
-    fi
+  if test "x$ac_ct_RANLIB" = x; then
+    RANLIB=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    RANLIB=$ac_ct_RANLIB
+  fi
+else
+  RANLIB="$ac_cv_prog_RANLIB"
+fi
+
+ac_fn_c_check_type "$LINENO" "off_t" "ac_cv_type_off_t" "$ac_includes_default"
+if test "x$ac_cv_type_off_t" = xyes; then :
 
 
-    # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT,
-    # to get the SysV transport functions.
-    # chad@anasazi.com says the Pyramis MIS-ES running DC/OSx (SVR4)
-    # needs -lnsl.
-    # The nsl library prevents programs from opening the X display
-    # on Irix 5.2, according to dickey@clark.net.
-    echo $ac_n "checking for gethostbyname""... $ac_c" 1>&6
-echo "configure:2954: checking for gethostbyname" >&5
-if eval "test \"`echo '$''{'ac_cv_func_gethostbyname'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
 else
 else
-  cat > conftest.$ac_ext <<EOF
-#line 2959 "configure"
-#include "confdefs.h"
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char gethostbyname(); below.  */
-#include <assert.h>
-/* Override any gcc2 internal prototype to avoid an error.  */
-/* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char gethostbyname();
 
 
-int main() {
+cat >>confdefs.h <<_ACEOF
+#define off_t long int
+_ACEOF
 
 
-/* The GNU C library defines this for functions which it implements
-    to always fail with ENOSYS.  Some functions are actually named
-    something starting with __ and the normal name is an alias.  */
-#if defined (__stub_gethostbyname) || defined (__stub___gethostbyname)
-choke me
-#else
-gethostbyname();
-#endif
+fi
 
 
-; return 0; }
-EOF
-if { (eval echo configure:2982: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  eval "ac_cv_func_gethostbyname=yes"
+# The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
+# for constant arguments.  Useless!
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for working alloca.h" >&5
+$as_echo_n "checking for working alloca.h... " >&6; }
+if ${ac_cv_working_alloca_h+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <alloca.h>
+int
+main ()
+{
+char *p = (char *) alloca (2 * sizeof (int));
+                         if (p) return 0;
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_working_alloca_h=yes
 else
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_func_gethostbyname=no"
+  ac_cv_working_alloca_h=no
 fi
 fi
-rm -f conftest*
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
 fi
 fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_working_alloca_h" >&5
+$as_echo "$ac_cv_working_alloca_h" >&6; }
+if test $ac_cv_working_alloca_h = yes; then
+
+$as_echo "#define HAVE_ALLOCA_H 1" >>confdefs.h
 
 
-if eval "test \"`echo '$ac_cv_func_'gethostbyname`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-  :
-else
-  echo "$ac_t""no" 1>&6
 fi
 
 fi
 
-    if test $ac_cv_func_gethostbyname = no; then
-      echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6
-echo "configure:3003: checking for gethostbyname in -lnsl" >&5
-ac_lib_var=`echo nsl'_'gethostbyname | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  ac_save_LIBS="$LIBS"
-LIBS="-lnsl  $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 3011 "configure"
-#include "confdefs.h"
-/* Override any gcc2 internal prototype to avoid an error.  */
-/* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char gethostbyname();
-
-int main() {
-gethostbyname()
-; return 0; }
-EOF
-if { (eval echo configure:3022: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=yes"
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for alloca" >&5
+$as_echo_n "checking for alloca... " >&6; }
+if ${ac_cv_func_alloca_works+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=no"
-fi
-rm -f conftest*
-LIBS="$ac_save_LIBS"
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#ifdef __GNUC__
+# define alloca __builtin_alloca
+#else
+# ifdef _MSC_VER
+#  include <malloc.h>
+#  define alloca _alloca
+# else
+#  ifdef HAVE_ALLOCA_H
+#   include <alloca.h>
+#  else
+#   ifdef _AIX
+ #pragma alloca
+#   else
+#    ifndef alloca /* predefined by HP cc +Olibcalls */
+void *alloca (size_t);
+#    endif
+#   endif
+#  endif
+# endif
+#endif
 
 
-fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-  X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl"
+int
+main ()
+{
+char *p = (char *) alloca (1);
+                                   if (p) return 0;
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_func_alloca_works=yes
 else
 else
-  echo "$ac_t""no" 1>&6
+  ac_cv_func_alloca_works=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
 fi
 fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_alloca_works" >&5
+$as_echo "$ac_cv_func_alloca_works" >&6; }
 
 
-    fi
+if test $ac_cv_func_alloca_works = yes; then
+
+$as_echo "#define HAVE_ALLOCA 1" >>confdefs.h
 
 
-    # lieder@skyler.mavd.honeywell.com says without -lsocket,
-    # socket/setsockopt and other routines are undefined under SCO ODT
-    # 2.0.  But -lsocket is broken on IRIX 5.2 (and is not necessary
-    # on later versions), says simon@lia.di.epfl.ch: it contains
-    # gethostby* variants that don't use the nameserver (or something).
-    # -lsocket must be given before -lnsl if both are needed.
-    # We assume that if connect needs -lnsl, so does gethostbyname.
-    echo $ac_n "checking for connect""... $ac_c" 1>&6
-echo "configure:3052: checking for connect" >&5
-if eval "test \"`echo '$''{'ac_cv_func_connect'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
 else
 else
-  cat > conftest.$ac_ext <<EOF
-#line 3057 "configure"
-#include "confdefs.h"
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char connect(); below.  */
-#include <assert.h>
-/* Override any gcc2 internal prototype to avoid an error.  */
-/* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char connect();
+  # The SVR3 libPW and SVR4 libucb both contain incompatible functions
+# that cause trouble.  Some versions do not even contain alloca or
+# contain a buggy version.  If you still want to use their alloca,
+# use ar to extract alloca.o from them instead of compiling alloca.c.
 
 
-int main() {
+ALLOCA=\${LIBOBJDIR}alloca.$ac_objext
 
 
-/* The GNU C library defines this for functions which it implements
-    to always fail with ENOSYS.  Some functions are actually named
-    something starting with __ and the normal name is an alias.  */
-#if defined (__stub_connect) || defined (__stub___connect)
-choke me
+$as_echo "#define C_ALLOCA 1" >>confdefs.h
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether \`alloca.c' needs Cray hooks" >&5
+$as_echo_n "checking whether \`alloca.c' needs Cray hooks... " >&6; }
+if ${ac_cv_os_cray+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#if defined CRAY && ! defined CRAY2
+webecray
 #else
 #else
-connect();
+wenotbecray
 #endif
 
 #endif
 
-; return 0; }
-EOF
-if { (eval echo configure:3080: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  eval "ac_cv_func_connect=yes"
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "webecray" >/dev/null 2>&1; then :
+  ac_cv_os_cray=yes
 else
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_func_connect=no"
+  ac_cv_os_cray=no
 fi
 fi
-rm -f conftest*
+rm -rf conftest*
+
 fi
 fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_os_cray" >&5
+$as_echo "$ac_cv_os_cray" >&6; }
+if test $ac_cv_os_cray = yes; then
+  for ac_func in _getb67 GETB67 getb67; do
+    as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
 
 
-if eval "test \"`echo '$ac_cv_func_'connect`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-  :
-else
-  echo "$ac_t""no" 1>&6
+cat >>confdefs.h <<_ACEOF
+#define CRAY_STACKSEG_END $ac_func
+_ACEOF
+
+    break
 fi
 
 fi
 
-    if test $ac_cv_func_connect = no; then
-      echo $ac_n "checking for connect in -lsocket""... $ac_c" 1>&6
-echo "configure:3101: checking for connect in -lsocket" >&5
-ac_lib_var=`echo socket'_'connect | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  ac_save_LIBS="$LIBS"
-LIBS="-lsocket $X_EXTRA_LIBS $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 3109 "configure"
-#include "confdefs.h"
-/* Override any gcc2 internal prototype to avoid an error.  */
-/* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char connect();
-
-int main() {
-connect()
-; return 0; }
-EOF
-if { (eval echo configure:3120: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=yes"
+  done
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking stack direction for C alloca" >&5
+$as_echo_n "checking stack direction for C alloca... " >&6; }
+if ${ac_cv_c_stack_direction+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test "$cross_compiling" = yes; then :
+  ac_cv_c_stack_direction=0
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$ac_includes_default
+int
+find_stack_direction (int *addr, int depth)
+{
+  int dir, dummy = 0;
+  if (! addr)
+    addr = &dummy;
+  *addr = addr < &dummy ? 1 : addr == &dummy ? 0 : -1;
+  dir = depth ? find_stack_direction (addr, depth - 1) : 0;
+  return dir + dummy;
+}
+
+int
+main (int argc, char **argv)
+{
+  return find_stack_direction (0, argc + !argv + 20) < 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+  ac_cv_c_stack_direction=1
 else
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=no"
+  ac_cv_c_stack_direction=-1
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
 fi
 fi
-rm -f conftest*
-LIBS="$ac_save_LIBS"
 
 fi
 
 fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-  X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS"
-else
-  echo "$ac_t""no" 1>&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_stack_direction" >&5
+$as_echo "$ac_cv_c_stack_direction" >&6; }
+cat >>confdefs.h <<_ACEOF
+#define STACK_DIRECTION $ac_cv_c_stack_direction
+_ACEOF
+
+
 fi
 
 fi
 
-    fi
 
 
-    # gomez@mi.uni-erlangen.de says -lposix is necessary on A/UX.
-    echo $ac_n "checking for remove""... $ac_c" 1>&6
-echo "configure:3144: checking for remove" >&5
-if eval "test \"`echo '$''{'ac_cv_func_remove'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  cat > conftest.$ac_ext <<EOF
-#line 3149 "configure"
-#include "confdefs.h"
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char remove(); below.  */
-#include <assert.h>
-/* Override any gcc2 internal prototype to avoid an error.  */
-/* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char remove();
 
 
-int main() {
 
 
-/* The GNU C library defines this for functions which it implements
-    to always fail with ENOSYS.  Some functions are actually named
-    something starting with __ and the normal name is an alias.  */
-#if defined (__stub_remove) || defined (__stub___remove)
-choke me
-#else
-remove();
+  for ac_header in $ac_header_list
+do :
+  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
+"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+
+
+
+
+
+
+for ac_func in getpagesize
+do :
+  ac_fn_c_check_func "$LINENO" "getpagesize" "ac_cv_func_getpagesize"
+if test "x$ac_cv_func_getpagesize" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_GETPAGESIZE 1
+_ACEOF
+
+fi
+done
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for working mmap" >&5
+$as_echo_n "checking for working mmap... " >&6; }
+if ${ac_cv_func_mmap_fixed_mapped+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test "$cross_compiling" = yes; then :
+  ac_cv_func_mmap_fixed_mapped=no
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$ac_includes_default
+/* malloc might have been renamed as rpl_malloc. */
+#undef malloc
+
+/* Thanks to Mike Haertel and Jim Avera for this test.
+   Here is a matrix of mmap possibilities:
+       mmap private not fixed
+       mmap private fixed at somewhere currently unmapped
+       mmap private fixed at somewhere already mapped
+       mmap shared not fixed
+       mmap shared fixed at somewhere currently unmapped
+       mmap shared fixed at somewhere already mapped
+   For private mappings, we should verify that changes cannot be read()
+   back from the file, nor mmap's back from the file at a different
+   address.  (There have been systems where private was not correctly
+   implemented like the infamous i386 svr4.0, and systems where the
+   VM page cache was not coherent with the file system buffer cache
+   like early versions of FreeBSD and possibly contemporary NetBSD.)
+   For shared mappings, we should conversely verify that changes get
+   propagated back to all the places they're supposed to be.
+
+   Grep wants private fixed already mapped.
+   The main things grep needs to know about mmap are:
+   * does it exist and is it safe to write into the mmap'd area
+   * how to use it (BSD variants)  */
+
+#include <fcntl.h>
+#include <sys/mman.h>
+
+#if !defined STDC_HEADERS && !defined HAVE_STDLIB_H
+char *malloc ();
 #endif
 
 #endif
 
-; return 0; }
-EOF
-if { (eval echo configure:3172: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  eval "ac_cv_func_remove=yes"
+/* This mess was copied from the GNU getpagesize.h.  */
+#ifndef HAVE_GETPAGESIZE
+# ifdef _SC_PAGESIZE
+#  define getpagesize() sysconf(_SC_PAGESIZE)
+# else /* no _SC_PAGESIZE */
+#  ifdef HAVE_SYS_PARAM_H
+#   include <sys/param.h>
+#   ifdef EXEC_PAGESIZE
+#    define getpagesize() EXEC_PAGESIZE
+#   else /* no EXEC_PAGESIZE */
+#    ifdef NBPG
+#     define getpagesize() NBPG * CLSIZE
+#     ifndef CLSIZE
+#      define CLSIZE 1
+#     endif /* no CLSIZE */
+#    else /* no NBPG */
+#     ifdef NBPC
+#      define getpagesize() NBPC
+#     else /* no NBPC */
+#      ifdef PAGESIZE
+#       define getpagesize() PAGESIZE
+#      endif /* PAGESIZE */
+#     endif /* no NBPC */
+#    endif /* no NBPG */
+#   endif /* no EXEC_PAGESIZE */
+#  else /* no HAVE_SYS_PARAM_H */
+#   define getpagesize() 8192  /* punt totally */
+#  endif /* no HAVE_SYS_PARAM_H */
+# endif /* no _SC_PAGESIZE */
+
+#endif /* no HAVE_GETPAGESIZE */
+
+int
+main ()
+{
+  char *data, *data2, *data3;
+  const char *cdata2;
+  int i, pagesize;
+  int fd, fd2;
+
+  pagesize = getpagesize ();
+
+  /* First, make a file with some known garbage in it. */
+  data = (char *) malloc (pagesize);
+  if (!data)
+    return 1;
+  for (i = 0; i < pagesize; ++i)
+    *(data + i) = rand ();
+  umask (0);
+  fd = creat ("conftest.mmap", 0600);
+  if (fd < 0)
+    return 2;
+  if (write (fd, data, pagesize) != pagesize)
+    return 3;
+  close (fd);
+
+  /* Next, check that the tail of a page is zero-filled.  File must have
+     non-zero length, otherwise we risk SIGBUS for entire page.  */
+  fd2 = open ("conftest.txt", O_RDWR | O_CREAT | O_TRUNC, 0600);
+  if (fd2 < 0)
+    return 4;
+  cdata2 = "";
+  if (write (fd2, cdata2, 1) != 1)
+    return 5;
+  data2 = (char *) mmap (0, pagesize, PROT_READ | PROT_WRITE, MAP_SHARED, fd2, 0L);
+  if (data2 == MAP_FAILED)
+    return 6;
+  for (i = 0; i < pagesize; ++i)
+    if (*(data2 + i))
+      return 7;
+  close (fd2);
+  if (munmap (data2, pagesize))
+    return 8;
+
+  /* Next, try to mmap the file at a fixed address which already has
+     something else allocated at it.  If we can, also make sure that
+     we see the same garbage.  */
+  fd = open ("conftest.mmap", O_RDWR);
+  if (fd < 0)
+    return 9;
+  if (data2 != mmap (data2, pagesize, PROT_READ | PROT_WRITE,
+                    MAP_PRIVATE | MAP_FIXED, fd, 0L))
+    return 10;
+  for (i = 0; i < pagesize; ++i)
+    if (*(data + i) != *(data2 + i))
+      return 11;
+
+  /* Finally, make sure that changes to the mapped area do not
+     percolate back to the file as seen by read().  (This is a bug on
+     some variants of i386 svr4.0.)  */
+  for (i = 0; i < pagesize; ++i)
+    *(data2 + i) = *(data2 + i) + 1;
+  data3 = (char *) malloc (pagesize);
+  if (!data3)
+    return 12;
+  if (read (fd, data3, pagesize) != pagesize)
+    return 13;
+  for (i = 0; i < pagesize; ++i)
+    if (*(data + i) != *(data3 + i))
+      return 14;
+  close (fd);
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+  ac_cv_func_mmap_fixed_mapped=yes
 else
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_func_remove=no"
+  ac_cv_func_mmap_fixed_mapped=no
 fi
 fi
-rm -f conftest*
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
 fi
 
 fi
 
-if eval "test \"`echo '$ac_cv_func_'remove`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-  :
-else
-  echo "$ac_t""no" 1>&6
 fi
 fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_mmap_fixed_mapped" >&5
+$as_echo "$ac_cv_func_mmap_fixed_mapped" >&6; }
+if test $ac_cv_func_mmap_fixed_mapped = yes; then
+
+$as_echo "#define HAVE_MMAP 1" >>confdefs.h
 
 
-    if test $ac_cv_func_remove = no; then
-      echo $ac_n "checking for remove in -lposix""... $ac_c" 1>&6
-echo "configure:3193: checking for remove in -lposix" >&5
-ac_lib_var=`echo posix'_'remove | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  ac_save_LIBS="$LIBS"
-LIBS="-lposix  $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 3201 "configure"
-#include "confdefs.h"
-/* Override any gcc2 internal prototype to avoid an error.  */
-/* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char remove();
-
-int main() {
-remove()
-; return 0; }
-EOF
-if { (eval echo configure:3212: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=yes"
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=no"
 fi
 fi
-rm -f conftest*
-LIBS="$ac_save_LIBS"
+rm -rf conftest.mmap conftest.txt
+
+
+   for ac_header in argz.h limits.h locale.h nl_types.h malloc.h string.h \
+unistd.h sys/param.h
+do :
+  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
 
 fi
 
 fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-  X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix"
+
+done
+
+   for ac_func in getcwd munmap putenv setenv setlocale strchr strcasecmp \
+strdup __argz_count __argz_stringify __argz_next
+do :
+  as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+
+   if test $ac_cv_header_locale_h = yes; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LC_MESSAGES" >&5
+$as_echo_n "checking for LC_MESSAGES... " >&6; }
+if ${am_cv_val_LC_MESSAGES+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <locale.h>
+int
+main ()
+{
+return LC_MESSAGES
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  am_cv_val_LC_MESSAGES=yes
 else
 else
-  echo "$ac_t""no" 1>&6
+  am_cv_val_LC_MESSAGES=no
 fi
 fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_val_LC_MESSAGES" >&5
+$as_echo "$am_cv_val_LC_MESSAGES" >&6; }
+    if test $am_cv_val_LC_MESSAGES = yes; then
 
 
-    fi
+$as_echo "#define HAVE_LC_MESSAGES 1" >>confdefs.h
 
 
-    # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
-    echo $ac_n "checking for shmat""... $ac_c" 1>&6
-echo "configure:3236: checking for shmat" >&5
-if eval "test \"`echo '$''{'ac_cv_func_shmat'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+    fi
+  fi
+     USE_NLS=yes
+
+
+        nls_cv_force_use_gnu_gettext="no"
+
+    nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
+    if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
+                              nls_cv_header_intl=
+      nls_cv_header_libgt=
+      CATOBJEXT=NONE
+
+      ac_fn_c_check_header_mongrel "$LINENO" "libintl.h" "ac_cv_header_libintl_h" "$ac_includes_default"
+if test "x$ac_cv_header_libintl_h" = xyes; then :
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dgettext in libc" >&5
+$as_echo_n "checking for dgettext in libc... " >&6; }
+if ${gt_cv_func_dgettext_libc+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <libintl.h>
+int
+main ()
+{
+return (int) dgettext ("","")
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  gt_cv_func_dgettext_libc=yes
 else
 else
-  cat > conftest.$ac_ext <<EOF
-#line 3241 "configure"
-#include "confdefs.h"
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char shmat(); below.  */
-#include <assert.h>
-/* Override any gcc2 internal prototype to avoid an error.  */
-/* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char shmat();
+  gt_cv_func_dgettext_libc=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_func_dgettext_libc" >&5
+$as_echo "$gt_cv_func_dgettext_libc" >&6; }
 
 
-int main() {
+         if test "$gt_cv_func_dgettext_libc" != "yes"; then
+           { $as_echo "$as_me:${as_lineno-$LINENO}: checking for bindtextdomain in -lintl" >&5
+$as_echo_n "checking for bindtextdomain in -lintl... " >&6; }
+if ${ac_cv_lib_intl_bindtextdomain+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lintl  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
 
-/* The GNU C library defines this for functions which it implements
-    to always fail with ENOSYS.  Some functions are actually named
-    something starting with __ and the normal name is an alias.  */
-#if defined (__stub_shmat) || defined (__stub___shmat)
-choke me
-#else
-shmat();
+/* 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 bindtextdomain ();
+int
+main ()
+{
+return bindtextdomain ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_intl_bindtextdomain=yes
+else
+  ac_cv_lib_intl_bindtextdomain=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_intl_bindtextdomain" >&5
+$as_echo "$ac_cv_lib_intl_bindtextdomain" >&6; }
+if test "x$ac_cv_lib_intl_bindtextdomain" = xyes; then :
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dgettext in libintl" >&5
+$as_echo_n "checking for dgettext in libintl... " >&6; }
+if ${gt_cv_func_dgettext_libintl+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dgettext in -lintl" >&5
+$as_echo_n "checking for dgettext in -lintl... " >&6; }
+if ${ac_cv_lib_intl_dgettext+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lintl  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* 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
 #endif
+char dgettext ();
+int
+main ()
+{
+return dgettext ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_intl_dgettext=yes
+else
+  ac_cv_lib_intl_dgettext=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_intl_dgettext" >&5
+$as_echo "$ac_cv_lib_intl_dgettext" >&6; }
+if test "x$ac_cv_lib_intl_dgettext" = xyes; then :
+  gt_cv_func_dgettext_libintl=yes
+else
+  gt_cv_func_dgettext_libintl=no
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_func_dgettext_libintl" >&5
+$as_echo "$gt_cv_func_dgettext_libintl" >&6; }
+fi
+
+         fi
 
 
-; return 0; }
-EOF
-if { (eval echo configure:3264: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  eval "ac_cv_func_shmat=yes"
+          if test "$gt_cv_func_dgettext_libintl" = "yes"; then
+           LIBS="$LIBS -lintl";
+          fi
+
+         if test "$gt_cv_func_dgettext_libc" = "yes" \
+           || test "$gt_cv_func_dgettext_libintl" = "yes"; then
+
+$as_echo "#define HAVE_GETTEXT 1" >>confdefs.h
+
+           # Extract the first word of "msgfmt", so it can be a program name with args.
+set dummy msgfmt; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_MSGFMT+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_func_shmat=no"
+  case "$MSGFMT" in
+  /*)
+  ac_cv_path_MSGFMT="$MSGFMT" # Let the user override the test with a path.
+  ;;
+  *)
+  IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
+  for ac_dir in $PATH; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      if test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"; then
+       ac_cv_path_MSGFMT="$ac_dir/$ac_word"
+       break
+      fi
+    fi
+  done
+  IFS="$ac_save_ifs"
+  test -z "$ac_cv_path_MSGFMT" && ac_cv_path_MSGFMT="no"
+  ;;
+esac
 fi
 fi
-rm -f conftest*
+MSGFMT="$ac_cv_path_MSGFMT"
+if test -n "$MSGFMT"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSGFMT" >&5
+$as_echo "$MSGFMT" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
 fi
 fi
+           if test "$MSGFMT" != "no"; then
+             for ac_func in dcgettext
+do :
+  ac_fn_c_check_func "$LINENO" "dcgettext" "ac_cv_func_dcgettext"
+if test "x$ac_cv_func_dcgettext" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_DCGETTEXT 1
+_ACEOF
 
 
-if eval "test \"`echo '$ac_cv_func_'shmat`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-  :
-else
-  echo "$ac_t""no" 1>&6
 fi
 fi
+done
 
 
-    if test $ac_cv_func_shmat = no; then
-      echo $ac_n "checking for shmat in -lipc""... $ac_c" 1>&6
-echo "configure:3285: checking for shmat in -lipc" >&5
-ac_lib_var=`echo ipc'_'shmat | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  ac_save_LIBS="$LIBS"
-LIBS="-lipc  $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 3293 "configure"
-#include "confdefs.h"
-/* Override any gcc2 internal prototype to avoid an error.  */
-/* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char shmat();
-
-int main() {
-shmat()
-; return 0; }
-EOF
-if { (eval echo configure:3304: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=yes"
+             # Extract the first word of "gmsgfmt", so it can be a program name with args.
+set dummy gmsgfmt; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_GMSGFMT+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=no"
-fi
-rm -f conftest*
-LIBS="$ac_save_LIBS"
+  case $GMSGFMT in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_GMSGFMT="$GMSGFMT" # 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_path_GMSGFMT="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
 
 
+  test -z "$ac_cv_path_GMSGFMT" && ac_cv_path_GMSGFMT="$MSGFMT"
+  ;;
+esac
 fi
 fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-  X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"
+GMSGFMT=$ac_cv_path_GMSGFMT
+if test -n "$GMSGFMT"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GMSGFMT" >&5
+$as_echo "$GMSGFMT" >&6; }
 else
 else
-  echo "$ac_t""no" 1>&6
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
 fi
 
-    fi
-  fi
 
 
-  # Check for libraries that X11R6 Xt/Xaw programs need.
-  ac_save_LDFLAGS="$LDFLAGS"
-  test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries"
-  # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
-  # check for ICE first), but we must link in the order -lSM -lICE or
-  # we get undefined symbols.  So assume we have SM if we have ICE.
-  # These have to be linked with before -lX11, unlike the other
-  # libraries we check for below, so use a different variable.
-  #  --interran@uluru.Stanford.EDU, kb@cs.umb.edu.
-  echo $ac_n "checking for IceConnectionNumber in -lICE""... $ac_c" 1>&6
-echo "configure:3337: checking for IceConnectionNumber in -lICE" >&5
-ac_lib_var=`echo ICE'_'IceConnectionNumber | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  ac_save_LIBS="$LIBS"
-LIBS="-lICE $X_EXTRA_LIBS $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 3345 "configure"
-#include "confdefs.h"
-/* Override any gcc2 internal prototype to avoid an error.  */
-/* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char IceConnectionNumber();
-
-int main() {
-IceConnectionNumber()
-; return 0; }
-EOF
-if { (eval echo configure:3356: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=yes"
+             # Extract the first word of "xgettext", so it can be a program name with args.
+set dummy xgettext; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_XGETTEXT+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=no"
-fi
-rm -f conftest*
-LIBS="$ac_save_LIBS"
-
+  case "$XGETTEXT" in
+  /*)
+  ac_cv_path_XGETTEXT="$XGETTEXT" # Let the user override the test with a path.
+  ;;
+  *)
+  IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
+  for ac_dir in $PATH; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      if test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"; then
+       ac_cv_path_XGETTEXT="$ac_dir/$ac_word"
+       break
+      fi
+    fi
+  done
+  IFS="$ac_save_ifs"
+  test -z "$ac_cv_path_XGETTEXT" && ac_cv_path_XGETTEXT=":"
+  ;;
+esac
 fi
 fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-  X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE"
+XGETTEXT="$ac_cv_path_XGETTEXT"
+if test -n "$XGETTEXT"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XGETTEXT" >&5
+$as_echo "$XGETTEXT" >&6; }
 else
 else
-  echo "$ac_t""no" 1>&6
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
 fi
 
-  LDFLAGS="$ac_save_LDFLAGS"
+             cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
 
-fi
+int
+main ()
+{
+extern int _nl_msg_cat_cntr;
+                            return _nl_msg_cat_cntr
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  CATOBJEXT=.gmo
+                DATADIRNAME=share
+else
+  CATOBJEXT=.mo
+                DATADIRNAME=lib
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+             INSTOBJEXT=.mo
+           fi
+         fi
 
 
+         # Added by Martin Baulig 12/15/98 for libc5 systems
+         if test "$gt_cv_func_dgettext_libc" != "yes" \
+           && test "$gt_cv_func_dgettext_libintl" = "yes"; then
+           INTLLIBS=-lintl
+           LIBS=`echo $LIBS | sed -e 's/-lintl//'`
+         fi
 
 
-if test "$have_x" != yes; then
-  { echo "configure: error: Couldn't find X11 headers/libs.  Try \`$0 --help'." 1>&2; exit 1; }
 fi
 
 
 fi
 
 
-    echo $ac_n "checking for X app-defaults directory""... $ac_c" 1>&6
-echo "configure:3387: checking for X app-defaults directory" >&5
-if eval "test \"`echo '$''{'ac_cv_x_app_defaults'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  
-  rm -fr conftestdir
-  if mkdir conftestdir; then
-    cd conftestdir >&-
-    # Make sure to not put "make" in the Imakefile rules, since we grep it out.
-    cat > Imakefile <<'EOF'
-acfindx:
-       @echo 'ac_x_app_defaults="${XAPPLOADDIR}"'
-EOF
-    if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
-      # GNU make sometimes prints "make[1]: Entering...", which'd confuse us.
-      eval `${MAKE-make} acfindx 2>/dev/null | grep -v make`
+
+      if test "$CATOBJEXT" = "NONE"; then
+                        nls_cv_use_gnu_gettext=yes
+      fi
     fi
     fi
-    cd .. >&-
-    rm -fr conftestdir
-  fi
-      if test x"$ac_x_app_defaults" = x; then
-        
-  # Look for the directory under a standard set of common directories.
-  # Check X11 before X11Rn because it's often a symlink to the current release.
-  for ac_dir in                                 \
-    /usr/X11/lib/app-defaults                   \
-    /usr/X11R6/lib/app-defaults                 \
-    /usr/X11R6/lib/X11/app-defaults             \
-    /usr/X11R5/lib/app-defaults                 \
-    /usr/X11R5/lib/X11/app-defaults             \
-    /usr/X11R4/lib/app-defaults                 \
-    /usr/X11R4/lib/X11/app-defaults             \
-                                                \
-    /usr/lib/X11/app-defaults                   \
-    /usr/lib/X11R6/app-defaults                 \
-    /usr/lib/X11R5/app-defaults                 \
-    /usr/lib/X11R4/app-defaults                 \
-                                                \
-    /usr/local/X11/lib/app-defaults             \
-    /usr/local/X11R6/lib/app-defaults           \
-    /usr/local/X11R5/lib/app-defaults           \
-    /usr/local/X11R4/lib/app-defaults           \
-                                                \
-    /usr/local/lib/X11/app-defaults             \
-    /usr/local/lib/X11R6/app-defaults           \
-    /usr/local/lib/X11R6/X11/app-defaults       \
-    /usr/local/lib/X11R5/app-defaults           \
-    /usr/local/lib/X11R5/X11/app-defaults       \
-    /usr/local/lib/X11R4/app-defaults           \
-    /usr/local/lib/X11R4/X11/app-defaults       \
-                                                \
-    /usr/X386/lib/X11/app-defaults              \
-    /usr/x386/lib/X11/app-defaults              \
-    /usr/XFree86/lib/X11/app-defaults           \
-                                                \
-    /usr/lib/X11/app-defaults                   \
-    /usr/local/lib/X11/app-defaults             \
-    /usr/unsupported/lib/X11/app-defaults       \
-    /usr/athena/lib/X11/app-defaults            \
-    /usr/local/x11r5/lib/X11/app-defaults       \
-    /usr/lpp/Xamples/lib/X11/app-defaults       \
-    /lib/usr/lib/X11/app-defaults               \
-                                                \
-    /usr/openwin/lib/app-defaults               \
-    /usr/openwin/lib/X11/app-defaults           \
-    /usr/openwin/share/lib/app-defaults         \
-    /usr/openwin/share/lib/X11/app-defaults     \
-                                                \
-    /X11R6/lib/app-defaults                     \
-    /X11R5/lib/app-defaults                     \
-    /X11R4/lib/app-defaults                     \
-    ; \
-  do
-    if test -d "$ac_dir"; then
-      ac_x_app_defaults=$ac_dir
-      break
+
+    if test "$nls_cv_use_gnu_gettext" != "yes"; then
+
+$as_echo "#define ENABLE_NLS 1" >>confdefs.h
+
+    else
+            CATOBJEXT=
     fi
     fi
-  done
 
 
-      fi
-      if test x"$ac_x_app_defaults" = x; then
-        ac_cv_x_app_defaults="/usr/lib/X11/app-defaults"
+        if test "$XGETTEXT" != ":"; then
+                  if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
+        : ;
       else
       else
-        # Record where we found app-defaults for the cache.
-        ac_cv_x_app_defaults="$ac_x_app_defaults"
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: found xgettext program is not GNU xgettext; ignore it" >&5
+$as_echo "found xgettext program is not GNU xgettext; ignore it" >&6; }
+        XGETTEXT=":"
       fi
       fi
-fi
+    fi
+
+    # We need to process the po/ directory.
+    POSUB=po
+
+    ac_config_commands="$ac_config_commands default-2"
+
+
+                for lang in $ALL_LINGUAS; do
+      GMOFILES="$GMOFILES $lang.gmo"
+      POFILES="$POFILES $lang.po"
+    done
+
+
+
+
+
 
 
-echo "$ac_t""$ac_cv_x_app_defaults" 1>&6
-    eval ac_x_app_defaults="$ac_cv_x_app_defaults"
-case "$host" in
-    *-hpux*)
 
 
-      # The following arcana was gleaned from conversations with
-      # Eric Schwartz <erics@col.hp.com>:
-      #
-      # On HPUX 10.x, the parts of X that HP considers "standard" live in
-      # /usr/{include,lib}/X11R6/.  The parts that HP doesn't consider
-      # "standard", notably, Xaw and Xmu, live in /usr/contrib/X11R6/.
-      # Yet /usr/contrib/X11R6/ comes preinstalled on all HPUX systems.
-      # Also, there are symlinks from /usr/include/ and /usr/lib/ into
-      # /usr/{include,lib}/X11R6/, so that (if you don't use Xmu at all)
-      # you don't need any -I or -L arguments.
-      #
-      # On HPUX 9.x, /usr/{include,lib}/X11R5/ and /usr/contrib/X11R5/
-      # are the same division as 10.x.  However, there are no symlinks to
-      # the X stuff from /usr/include/ and /usr/lib/, so -I and -L
-      # arguments are always necessary.
-      #
-      # However, X11R6 was available on HPUX 9.x as a patch: if that
-      # patch was installed, then all of X11R6 went in to
-      # /usr/contrib/X11R6/ (there was no /usr/{include,lib}/X11R6/.)
-      #
-      # HPUX 8.x was the same as 9.x, but was X11R4 instead (I don't know
-      # whether R5 was available as a patch; R6 undoubtedly was not.)
-      #
-      # So.  We try and use the highest numbered pair of
-      # /usr/{include,lib}/X11R?/ and /usr/contrib/X11R?/{include,lib}/
-      # that are available.  We do not mix and match different versions
-      # of X.
-      #
-      # Question I still don't know the answer to: (do you?)
-      #
-      #   * On HPUX 9.x, where /usr/include/X11R5/ was standard, and
-      #     /usr/contrib/X11R6/ could be installed as a patch, what was in
-      #     that contrib directory?  Did it contain so-called "standard"
-      #     X11R6, or did it include Xaw and Xmu as well?  If the former,
-      #     where did one find Xaw and Xmu on 9.x R6 systems?  Would this
-      #     be a situation where one had to reach into the R5 headers and
-      #     libs to find Xmu?  That is, must both R6 and R5 directories
-      #     be on the -I and -L lists in that case?
-      #
-      for version in X11R6 X11R5 X11R4 ; do
-        # if either pair of directories exists...
-        if test -d /usr/include/$version || test -d /usr/contrib/$version/include
-        then
-           # if contrib exists, use it...
-           if test -d /usr/contrib/$version/include ; then
-             X_CFLAGS="$X_CFLAGS -I/usr/contrib/$version/include"
-             X_LIBS="$X_LIBS -L/usr/contrib/$version/lib"
-           fi
-           # if the "standard" one exists, use it.
-           if test -d /usr/include/$version ; then
-             X_CFLAGS="$X_CFLAGS -I/usr/include/$version"
-             X_LIBS="$X_LIBS -L/usr/lib/$version"
-           fi
-           # since at least one of the pair exists, go no farther.
-           break
-        fi
-      done
 
 
-      # Now find Motif.  Thanks for not making xmkmf find this by
-      # default, you losers.
-      #
-      if test -d /usr/include/Motif2.1 ; then
-        X_CFLAGS="$X_CFLAGS -I/usr/include/Motif2.1"
-        X_LIBS="$X_LIBS -L/usr/lib/Motif2.1"
-      elif test -d /usr/include/Motif1.2 ; then
-        X_CFLAGS="$X_CFLAGS -I/usr/include/Motif1.2"
-        X_LIBS="$X_LIBS -L/usr/lib/Motif1.2"
-      elif test -d /usr/include/Motif1.1 ; then
-        X_CFLAGS="$X_CFLAGS -I/usr/include/Motif1.1"
-        X_LIBS="$X_LIBS -L/usr/lib/Motif1.1"
-      fi
 
 
-      # Now let's check for the pseudo-standard locations for OpenGL and XPM.
-      #
-      if test -d /opt/graphics/OpenGL/include ; then
-        # HP-UX 10.20 puts it here
-        X_CFLAGS="-I/opt/graphics/OpenGL/include $X_CFLAGS"
-        X_LIBS="-L/opt/graphics/OpenGL/lib $X_LIBS"
-      elif test -d /opt/Mesa/lib ; then
-        X_CFLAGS="-I/opt/Mesa/include $X_CFLAGS"
-        X_LIBS="-L/opt/Mesa/lib $X_LIBS"
-      fi
 
 
 
 
-      if test -d /opt/xpm/lib/X11 ; then
-        X_CFLAGS="-I/opt/xpm/include $X_CFLAGS"
-        X_LIBS="-L/opt/xpm/lib/X11 $X_LIBS"
-      fi
 
 
-      # On HPUX, default to installing in /opt/xscreensaver/ instead of
-      # in /usr/local/, unless there is already an xscreensaver in
-      # /usr/local/bin/.  This can be overridden with the --prefix arg
-      # to configure.  I'm not sure this is the right thing to do, but
-      # Richard Lloyd says so...
-      #
-      if test \! -x /usr/local/bin/xscreensaver ; then
-        ac_default_prefix=/opt/xscreensaver
-      fi
 
 
-    ;;
-    *-solaris*)
+   if test "x$CATOBJEXT" != "x"; then
+     if test "x$ALL_LINGUAS" = "x"; then
+       LINGUAS=
+     else
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking for catalogs to be installed" >&5
+$as_echo_n "checking for catalogs to be installed... " >&6; }
+       NEW_LINGUAS=
+       for lang in ${LINGUAS=$ALL_LINGUAS}; do
+         case "$ALL_LINGUAS" in
+          *$lang*) NEW_LINGUAS="$NEW_LINGUAS $lang" ;;
+         esac
+       done
+       LINGUAS=$NEW_LINGUAS
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LINGUAS" >&5
+$as_echo "$LINGUAS" >&6; }
+     fi
 
 
-      # Thanks for not making xmkmf find this by default, pinheads.
-      # And thanks for moving things around again, too.  Is this
-      # really the standard location now?  What happened to the
-      # joke that this kind of thing went in /opt?
-      # cthomp says "answer: CDE (Common Disorganized Environment)"
-      #
-      if test -f /usr/dt/include/Xm/Xm.h ; then
-        X_CFLAGS="$X_CFLAGS -I/usr/dt/include"
-        X_LIBS="$X_LIBS -L/usr/dt/lib -R:/usr/dt/lib"
+          if test -n "$LINGUAS"; then
+       for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
+     fi
+   fi
 
 
-        # Some versions of Slowlaris Motif require -lgen.  But not all.  Why?
-        echo $ac_n "checking for regcmp in -lgen""... $ac_c" 1>&6
-echo "configure:3594: checking for regcmp in -lgen" >&5
-ac_lib_var=`echo gen'_'regcmp | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  ac_save_LIBS="$LIBS"
-LIBS="-lgen  $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 3602 "configure"
-#include "confdefs.h"
-/* Override any gcc2 internal prototype to avoid an error.  */
-/* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char regcmp();
-
-int main() {
-regcmp()
-; return 0; }
-EOF
-if { (eval echo configure:3613: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=yes"
+            test -d po || mkdir po
+   if test "$CATOBJEXT" = ".cat"; then
+     ac_fn_c_check_header_mongrel "$LINENO" "linux/version.h" "ac_cv_header_linux_version_h" "$ac_includes_default"
+if test "x$ac_cv_header_linux_version_h" = xyes; then :
+  msgformat=linux
 else
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=no"
+  msgformat=xopen
 fi
 fi
-rm -f conftest*
-LIBS="$ac_save_LIBS"
 
 
-fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-  X_LIBS="$X_LIBS -lgen"
-else
-  echo "$ac_t""no" 1>&6
-fi
 
 
-      fi
-    ;;
-  esac
-echo $ac_n "checking for XPointer""... $ac_c" 1>&6
-echo "configure:3637: checking for XPointer" >&5
-if eval "test \"`echo '$''{'ac_cv_xpointer'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  
-  ac_save_CPPFLAGS="$CPPFLAGS"
-  if test \! -z "$includedir" ; then 
-    CPPFLAGS="$CPPFLAGS -I$includedir"
-  fi
-  CPPFLAGS="$CPPFLAGS $X_CFLAGS"
-  cat > conftest.$ac_ext <<EOF
-#line 3648 "configure"
-#include "confdefs.h"
-#include <X11/Xlib.h>
-int main() {
-XPointer foo = (XPointer) 0;
-; return 0; }
-EOF
-if { (eval echo configure:3655: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
-  rm -rf conftest*
-  ac_cv_xpointer=yes
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  ac_cv_xpointer=no
-fi
-rm -f conftest*
-  CPPFLAGS="$ac_save_CPPFLAGS"
-fi
 
 
-echo "$ac_t""$ac_cv_xpointer" 1>&6
-  if test "$ac_cv_xpointer" != yes; then
-   cat >> confdefs.h <<\EOF
-#define XPointer char*
-EOF
+               sed -e '/^#/d' $srcdir/po/$msgformat-msg.sed > po/po2msg.sed
+   fi
 
 
-  fi
+            MKINSTALLDIRS=
+#
+# jwz: fuck this!  it puts hardcoded pathnames into the generated Makefiles!
+#
+#   if test -n "$ac_aux_dir"; then
+#     MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs"
+#   fi
+   if test -z "$MKINSTALLDIRS"; then
+     MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
+   fi
 
 
+   # jwz: you know what, screw it.  Let's just use the version that I
+   # already computed in configure.in, instead of this version that came
+   # with the i18n crud, ok?
+   MKINSTALLDIRS="$INSTALL_DIRS"
+
+
+
+
+         test -d po || mkdir po
+   if test "x$srcdir" != "x."; then
+     if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then
+       posrcprefix="$srcdir/"
+     else
+       posrcprefix="../$srcdir/"
+     fi
+   else
+     posrcprefix="../"
+   fi
+   rm -f po/POTFILES
+   sed -e "/^#/d" -e "/^\$/d" -e "s,.*,        $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \
+       < $srcdir/po/POTFILES.in > po/POTFILES
+
+MKINSTALLDIRS="$INSTALL_DIRS"
 
 
 ###############################################################################
 
 
 ###############################################################################
@@ -3672,43 +7540,20 @@ EOF
 have_xmu=no
 
   ac_save_CPPFLAGS="$CPPFLAGS"
 have_xmu=no
 
   ac_save_CPPFLAGS="$CPPFLAGS"
-  if test \! -z "$includedir" ; then 
+  if test \! -z "$includedir" ; then
     CPPFLAGS="$CPPFLAGS -I$includedir"
   fi
   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
     CPPFLAGS="$CPPFLAGS -I$includedir"
   fi
   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
-  ac_safe=`echo "X11/Xmu/Error.h" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for X11/Xmu/Error.h""... $ac_c" 1>&6
-echo "configure:3693: checking for X11/Xmu/Error.h" >&5
-if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  cat > conftest.$ac_ext <<EOF
-#line 3698 "configure"
-#include "confdefs.h"
-#include <X11/Xmu/Error.h>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3703: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
-  rm -rf conftest*
-  eval "ac_cv_header_$ac_safe=yes"
-else
-  echo "$ac_err" >&5
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_header_$ac_safe=no"
-fi
-rm -f conftest*
-fi
-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
+  CPPFLAGS=`eval eval eval eval eval eval eval eval eval echo $CPPFLAGS`
+  ac_fn_c_check_header_compile "$LINENO" "X11/Xmu/Error.h" "ac_cv_header_X11_Xmu_Error_h" "#include <stdlib.h>
+                   #include <stdio.h>
+                   #include <X11/Intrinsic.h>
+"
+if test "x$ac_cv_header_X11_Xmu_Error_h" = xyes; then :
   have_xmu=yes
   have_xmu=yes
-else
-  echo "$ac_t""no" 1>&6
 fi
 
 fi
 
+
   CPPFLAGS="$ac_save_CPPFLAGS"
 if test "$have_xmu" = no ; then
   XMU_SRCS='$(UTILS_SRC)/xmu.c'
   CPPFLAGS="$ac_save_CPPFLAGS"
 if test "$have_xmu" = no ; then
   XMU_SRCS='$(UTILS_SRC)/xmu.c'
@@ -3718,9 +7563,7 @@ else
   XMU_SRCS=''
   XMU_OBJS=''
   XMU_LIBS='-lXmu'
   XMU_SRCS=''
   XMU_OBJS=''
   XMU_LIBS='-lXmu'
-  cat >> confdefs.h <<\EOF
-#define HAVE_XMU 1
-EOF
+  $as_echo "#define HAVE_XMU 1" >>confdefs.h
 
 fi
 
 
 fi
 
@@ -3736,10 +7579,10 @@ fi
 if test "$have_xmu" = yes ; then
   case "$host" in
     *-sunos4*)
 if test "$have_xmu" = yes ; then
   case "$host" in
     *-sunos4*)
-    echo $ac_n "checking for the SunOS 4.1.x _get_wmShellWidgetClass bug""... $ac_c" 1>&6
-echo "configure:3752: checking for the SunOS 4.1.x _get_wmShellWidgetClass bug" >&5
-if eval "test \"`echo '$''{'ac_cv_sunos_xmu_bug'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the SunOS 4.1.x _get_wmShellWidgetClass bug" >&5
+$as_echo_n "checking for the SunOS 4.1.x _get_wmShellWidgetClass bug... " >&6; }
+if ${ac_cv_sunos_xmu_bug+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
   ac_save_LDFLAGS="$LDFLAGS"
                     if test \! -z "$x_libraries" ; then
 else
   ac_save_LDFLAGS="$LDFLAGS"
                     if test \! -z "$x_libraries" ; then
@@ -3749,58 +7592,58 @@ else
                     # We're only getting away with using AC_TRY_LINK
                     # with X libraries because we know it's SunOS.
                     LDFLAGS="$LDFLAGS -lXmu -lXt -lX11 -lXext -lm"
                     # We're only getting away with using AC_TRY_LINK
                     # with X libraries because we know it's SunOS.
                     LDFLAGS="$LDFLAGS -lXmu -lXt -lX11 -lXext -lm"
-                    cat > conftest.$ac_ext <<EOF
-#line 3765 "configure"
-#include "confdefs.h"
+                    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
 
-int main() {
+int
+main ()
+{
 
 
-; return 0; }
-EOF
-if { (eval echo configure:3772: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
   ac_cv_sunos_xmu_bug=no
 else
   ac_cv_sunos_xmu_bug=no
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
   ac_cv_sunos_xmu_bug=yes
 fi
   ac_cv_sunos_xmu_bug=yes
 fi
-rm -f conftest*
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
                     LDFLAGS="$ac_save_LDFLAGS"
 fi
                     LDFLAGS="$ac_save_LDFLAGS"
 fi
-
-echo "$ac_t""$ac_cv_sunos_xmu_bug" 1>&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sunos_xmu_bug" >&5
+$as_echo "$ac_cv_sunos_xmu_bug" >&6; }
     if test "$ac_cv_sunos_xmu_bug" = yes ; then
     if test "$ac_cv_sunos_xmu_bug" = yes ; then
-      echo $ac_n "checking whether the compiler understands -static""... $ac_c" 1>&6
-echo "configure:3788: checking whether the compiler understands -static" >&5
-if eval "test \"`echo '$''{'ac_cv_ld_static'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler understands -static" >&5
+$as_echo_n "checking whether the compiler understands -static... " >&6; }
+if ${ac_cv_ld_static+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
   ac_save_LDFLAGS="$LDFLAGS"
                       LDFLAGS="$LDFLAGS -static"
 else
   ac_save_LDFLAGS="$LDFLAGS"
                       LDFLAGS="$LDFLAGS -static"
-                      cat > conftest.$ac_ext <<EOF
-#line 3795 "configure"
-#include "confdefs.h"
+                      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
 
-int main() {
+int
+main ()
+{
 
 
-; return 0; }
-EOF
-if { (eval echo configure:3802: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
   ac_cv_ld_static=yes
 else
   ac_cv_ld_static=yes
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
   ac_cv_ld_static=no
 fi
   ac_cv_ld_static=no
 fi
-rm -f conftest*
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
                     LDFLAGS="$ac_save_LDFLAGS"
 fi
                     LDFLAGS="$ac_save_LDFLAGS"
 fi
-
-echo "$ac_t""$ac_cv_ld_static" 1>&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_ld_static" >&5
+$as_echo "$ac_cv_ld_static" >&6; }
       if test "$ac_cv_ld_static" = yes ; then
         LDFLAGS="$LDFLAGS -static"
       else
       if test "$ac_cv_ld_static" = yes ; then
         LDFLAGS="$LDFLAGS -static"
       else
@@ -3820,41 +7663,36 @@ fi
 
 have_hackdir=yes
 with_hackdir_req=unspecified
 
 have_hackdir=yes
 with_hackdir_req=unspecified
-# Check whether --with-hackdir or --without-hackdir was given.
-if test "${with_hackdir+set}" = set; then
-  withval="$with_hackdir"
-  with_hackdir="$withval"; with_hackdir_req="$withval"
+
+# Check whether --with-hackdir was given.
+if test "${with_hackdir+set}" = set; then :
+  withval=$with_hackdir; with_hackdir="$withval"; with_hackdir_req="$withval"
 else
   with_hackdir=yes
 fi
 
 
 if test x"$with_hackdir" = xyes; then
 else
   with_hackdir=yes
 fi
 
 
 if test x"$with_hackdir" = xyes; then
-  HACKDIR='${exec_prefix}/lib/xscreensaver'
+  HACKDIR='${libexecdir}/xscreensaver'
 elif test x"$with_hackdir" = xno; then
   HACKDIR='${bindir}'
 else
 elif test x"$with_hackdir" = xno; then
   HACKDIR='${bindir}'
 else
-  # there must be a better way than this...
-  if test -z "`echo $with_hackdir | sed 's@^/.*@@'`" ; then
-    # absolute path
-    HACKDIR=$with_hackdir
-  else
-    # relative path
-    HACKDIR="\${exec_prefix}$with_hackdir"
-  fi
+  HACKDIR=$with_hackdir
 fi
 
 # canonicalize slashes.
 HACKDIR=`echo "${HACKDIR}" | sed 's@/$@@;s@//*@/@g'`
 
 fi
 
 # canonicalize slashes.
 HACKDIR=`echo "${HACKDIR}" | sed 's@/$@@;s@//*@/@g'`
 
+# Expand HACKDIR as HACKDIR_FULL
+HACKDIR_FULL=`eval eval eval eval eval eval eval eval eval echo $HACKDIR`
+
 # This option used to be called --enable-subdir; make sure that is no longer
 # used, since configure brain-damagedly ignores unknown --enable options.
 
 obsolete_enable=
 # This option used to be called --enable-subdir; make sure that is no longer
 # used, since configure brain-damagedly ignores unknown --enable options.
 
 obsolete_enable=
-# Check whether --enable-subdir or --disable-subdir was given.
-if test "${enable_subdir+set}" = set; then
-  enableval="$enable_subdir"
-  obsolete_enable=yes
+# Check whether --enable-subdir was given.
+if test "${enable_subdir+set}" = set; then :
+  enableval=$enable_subdir; obsolete_enable=yes
 fi
 
 if test -n "$obsolete_enable"; then
 fi
 
 if test -n "$obsolete_enable"; then
@@ -3868,23 +7706,23 @@ fi
 ###############################################################################
 #
 #       Handle the --with-configdir option
 ###############################################################################
 #
 #       Handle the --with-configdir option
+#       Help for --with-x-app-defaults option added.
 #
 ###############################################################################
 
 have_configdir=yes
 with_configdir_req=unspecified
 #
 ###############################################################################
 
 have_configdir=yes
 with_configdir_req=unspecified
-# Check whether --with-configdir or --without-configdir was given.
-if test "${with_configdir+set}" = set; then
-  withval="$with_configdir"
-  with_configdir="$withval"; with_configdir_req="$withval"
+
+# Check whether --with-configdir was given.
+if test "${with_configdir+set}" = set; then :
+  withval=$with_configdir; with_configdir="$withval"; with_configdir_req="$withval"
 else
   with_configdir=yes
 fi
 
 
 if test x"$with_configdir" = xyes; then
 else
   with_configdir=yes
 fi
 
 
 if test x"$with_configdir" = xyes; then
-  # filled in later...
-  HACK_CONF_DIR=''
+  HACK_CONF_DIR='${datadir}/xscreensaver/config'
 elif test x"$with_configdir" = xno; then
   echo "error: must be yes, or a pathname: --with-configdir=$with_configdir"
   exit 1
 elif test x"$with_configdir" = xno; then
   echo "error: must be yes, or a pathname: --with-configdir=$with_configdir"
   exit 1
 #
 ###############################################################################
 
 #
 ###############################################################################
 
-have_sgi=no
-with_sgi_req=unspecified
-# Check whether --with-sgi-ext or --without-sgi-ext was given.
-if test "${with_sgi_ext+set}" = set; then
-  withval="$with_sgi_ext"
-  with_sgi="$withval"; with_sgi_req="$withval"
+#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-dpms-ext was given.
+if test "${with_dpms_ext+set}" = set; then :
+  withval=$with_dpms_ext; with_dpms="$withval"; with_dpms_req="$withval"
 else
 else
-  with_sgi=yes
+  with_dpms=yes
 fi
 
 
 
 fi
 
 
 
-   case "$with_sgi" in
+   case "$with_dpms" in
     yes) ;;
     no)  ;;
 
     /*)
     yes) ;;
     no)  ;;
 
     /*)
-     echo $ac_n "checking for SGI SCREEN_SAVER headers""... $ac_c" 1>&6
-echo "configure:3941: checking for SGI SCREEN_SAVER headers" >&5
-     d=$with_sgi/include
+     { $as_echo "$as_me:${as_lineno-$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"
      if test -d $d; then
        X_CFLAGS="-I$d $X_CFLAGS"
-       echo "$ac_t""$d" 1>&6
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $d" >&5
+$as_echo "$d" >&6; }
      else
      else
-       echo "$ac_t""not found ($d: no such directory)" 1>&6
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found ($d: no such directory)" >&5
+$as_echo "not found ($d: no such directory)" >&6; }
      fi
 
      fi
 
-     echo $ac_n "checking for SGI SCREEN_SAVER libs""... $ac_c" 1>&6
-echo "configure:3951: checking for SGI SCREEN_SAVER libs" >&5
-     d=$with_sgi/lib
+     { $as_echo "$as_me:${as_lineno-$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"
      if test -d $d; then
        X_LIBS="-L$d $X_LIBS"
-       echo "$ac_t""$d" 1>&6
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $d" >&5
+$as_echo "$d" >&6; }
      else
      else
-       echo "$ac_t""not found ($d: no such directory)" 1>&6
+       { $as_echo "$as_me:${as_lineno-$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".
      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 ""
-     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
      ;;
    esac
      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_sgi" = yes; then
-  
+
+if test "$with_dpms" = yes; then
+
+  # first check for dpms.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`
+  ac_fn_c_check_header_compile "$LINENO" "X11/extensions/dpms.h" "ac_cv_header_X11_extensions_dpms_h" "#include <X11/Xlib.h>
+                    #include <X11/Xmd.h>
+"
+if test "x$ac_cv_header_X11_extensions_dpms_h" = xyes; then :
+  have_dpms=yes
+fi
+
+
+  CPPFLAGS="$ac_save_CPPFLAGS"
+
+  # if that succeeded, then check for the DPMS code in the libraries
+  if test "$have_dpms" = yes; then
+
+    # first look in -lXext (this is where it is with XFree86 4.0)
+    have_dpms=no
+
   ac_save_CPPFLAGS="$CPPFLAGS"
   ac_save_CPPFLAGS="$CPPFLAGS"
-  if test \! -z "$includedir" ; then 
+  ac_save_LDFLAGS="$LDFLAGS"
+#  ac_save_LIBS="$LIBS"
+
+  if test \! -z "$includedir" ; then
     CPPFLAGS="$CPPFLAGS -I$includedir"
   fi
     CPPFLAGS="$CPPFLAGS -I$includedir"
   fi
+  # note: $X_CFLAGS includes $x_includes
   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
-  ac_safe=`echo "X11/extensions/XScreenSaver.h" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for X11/extensions/XScreenSaver.h""... $ac_c" 1>&6
-echo "configure:3984: checking for X11/extensions/XScreenSaver.h" >&5
-if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+
+  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:${as_lineno-$LINENO}: checking for DPMSInfo in -lXext" >&5
+$as_echo_n "checking for DPMSInfo in -lXext... " >&6; }
+if ${ac_cv_lib_Xext_DPMSInfo+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
 else
-  cat > conftest.$ac_ext <<EOF
-#line 3989 "configure"
-#include "confdefs.h"
-#include <X11/extensions/XScreenSaver.h>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3994: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
-  rm -rf conftest*
-  eval "ac_cv_header_$ac_safe=yes"
-else
-  echo "$ac_err" >&5
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_header_$ac_safe=no"
-fi
-rm -f conftest*
-fi
-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-  have_sgi=yes
-                     cat >> confdefs.h <<\EOF
-#define HAVE_SGI_SAVER_EXTENSION 1
-EOF
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lXext -lXext -lX11 $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* 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 DPMSInfo ();
+int
+main ()
+{
+return DPMSInfo ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_Xext_DPMSInfo=yes
+else
+  ac_cv_lib_Xext_DPMSInfo=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Xext_DPMSInfo" >&5
+$as_echo "$ac_cv_lib_Xext_DPMSInfo" >&6; }
+if test "x$ac_cv_lib_Xext_DPMSInfo" = xyes; then :
+  have_dpms=yes
+else
+  true
+fi
+
+  CPPFLAGS="$ac_save_CPPFLAGS"
+  LDFLAGS="$ac_save_LDFLAGS"
+#  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
+
+  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:${as_lineno-$LINENO}: checking for DPMSInfo in -lXdpms" >&5
+$as_echo_n "checking for DPMSInfo in -lXdpms... " >&6; }
+if ${ac_cv_lib_Xdpms_DPMSInfo+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
 else
-  echo "$ac_t""no" 1>&6
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lXdpms -lXext -lX11 $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* 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 DPMSInfo ();
+int
+main ()
+{
+return DPMSInfo ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_Xdpms_DPMSInfo=yes
+else
+  ac_cv_lib_Xdpms_DPMSInfo=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Xdpms_DPMSInfo" >&5
+$as_echo "$ac_cv_lib_Xdpms_DPMSInfo" >&6; }
+if test "x$ac_cv_lib_Xdpms_DPMSInfo" = xyes; then :
+  have_dpms=yes; XDPMS_LIBS="-lXdpms"
+else
+  true
 fi
 
   CPPFLAGS="$ac_save_CPPFLAGS"
 fi
 
   CPPFLAGS="$ac_save_CPPFLAGS"
+  LDFLAGS="$ac_save_LDFLAGS"
+#  LIBS="$ac_save_LIBS"
+
+    fi
+  fi
 
 
-elif test "$with_sgi" != no; then
-  echo "error: must be yes or no: --with-sgi-ext=$with_sgi"
+
+  # if that succeeded, then we've really got it.
+  if test "$have_dpms" = yes; then
+    $as_echo "#define HAVE_DPMS_EXTENSION 1" >>confdefs.h
+
+  fi
+
+elif test "$with_dpms" != no; then
+  echo "error: must be yes or no: --with-dpms-ext=$with_dpms"
   exit 1
 fi
 
 
 ###############################################################################
 #
   exit 1
 fi
 
 
 ###############################################################################
 #
-#       Check for the MIT-SCREEN-SAVER server extension.
+#       Check for the XINERAMA server extension.
 #
 ###############################################################################
 
 #
 ###############################################################################
 
-have_mit=no
-with_mit_req=unspecified
-# Check whether --with-mit-ext or --without-mit-ext was given.
-if test "${with_mit_ext+set}" = set; then
-  withval="$with_mit_ext"
-  with_mit="$withval"; with_mit_req="$withval"
+have_xinerama=no
+with_xinerama_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"
 else
 else
-  with_mit=yes
+  with_xinerama=yes
 fi
 
 
 
 fi
 
 
 
-   case "$with_mit" in
+   case "$with_xinerama" in
     yes) ;;
     no)  ;;
 
     /*)
     yes) ;;
     no)  ;;
 
     /*)
-     echo $ac_n "checking for MIT-SCREEN-SAVER headers""... $ac_c" 1>&6
-echo "configure:4051: checking for MIT-SCREEN-SAVER headers" >&5
-     d=$with_mit/include
+     { $as_echo "$as_me:${as_lineno-$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"
      if test -d $d; then
        X_CFLAGS="-I$d $X_CFLAGS"
-       echo "$ac_t""$d" 1>&6
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $d" >&5
+$as_echo "$d" >&6; }
      else
      else
-       echo "$ac_t""not found ($d: no such directory)" 1>&6
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found ($d: no such directory)" >&5
+$as_echo "not found ($d: no such directory)" >&6; }
      fi
 
      fi
 
-     echo $ac_n "checking for MIT-SCREEN-SAVER libs""... $ac_c" 1>&6
-echo "configure:4061: checking for MIT-SCREEN-SAVER libs" >&5
-     d=$with_mit/lib
+     { $as_echo "$as_me:${as_lineno-$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"
      if test -d $d; then
        X_LIBS="-L$d $X_LIBS"
-       echo "$ac_t""$d" 1>&6
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $d" >&5
+$as_echo "$d" >&6; }
      else
      else
-       echo "$ac_t""not found ($d: no such directory)" 1>&6
+       { $as_echo "$as_me:${as_lineno-$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".
      fi
 
      # replace the directory string with "yes".
-     with_mit_req="yes"
-     with_mit=$with_mit_req
+     with_xinerama_req="yes"
+     with_xinerama=$with_xinerama_req
      ;;
 
     *)
      echo ""
      ;;
 
     *)
      echo ""
-     echo "error: argument to --with-mit-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
      ;;
    esac
      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_mit" = yes; then
-  
-  ac_save_CPPFLAGS="$CPPFLAGS"
-  if test \! -z "$includedir" ; then 
-    CPPFLAGS="$CPPFLAGS -I$includedir"
-  fi
-  CPPFLAGS="$CPPFLAGS $X_CFLAGS"
-  ac_safe=`echo "X11/extensions/scrnsaver.h" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for X11/extensions/scrnsaver.h""... $ac_c" 1>&6
-echo "configure:4094: checking for X11/extensions/scrnsaver.h" >&5
-if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  cat > conftest.$ac_ext <<EOF
-#line 4099 "configure"
-#include "confdefs.h"
-#include <X11/extensions/scrnsaver.h>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4104: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
-  rm -rf conftest*
-  eval "ac_cv_header_$ac_safe=yes"
-else
-  echo "$ac_err" >&5
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_header_$ac_safe=no"
-fi
-rm -f conftest*
-fi
-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-  have_mit=yes
-else
-  echo "$ac_t""no" 1>&6
-fi
 
 
-  CPPFLAGS="$ac_save_CPPFLAGS"
+if test "$with_xinerama" = yes; then
 
 
-  # 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_save_CPPFLAGS="$CPPFLAGS"
-  ac_save_LDFLAGS="$LDFLAGS"
-#  ac_save_LIBS="$LIBS"
+  # first check for Xinerama.h
 
 
-  if test \! -z "$includedir" ; then 
+  ac_save_CPPFLAGS="$CPPFLAGS"
+  if test \! -z "$includedir" ; then
     CPPFLAGS="$CPPFLAGS -I$includedir"
   fi
     CPPFLAGS="$CPPFLAGS -I$includedir"
   fi
-  # note: $X_CFLAGS includes $x_includes
   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
   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"
-
-  echo $ac_n "checking for XScreenSaverRegister in -lXext""... $ac_c" 1>&6
-echo "configure:4149: checking for XScreenSaverRegister in -lXext" >&5
-ac_lib_var=`echo Xext'_'XScreenSaverRegister | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  ac_save_LIBS="$LIBS"
-LIBS="-lXext -lm $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 4157 "configure"
-#include "confdefs.h"
-/* Override any gcc2 internal prototype to avoid an error.  */
-/* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char XScreenSaverRegister();
-
-int main() {
-XScreenSaverRegister()
-; return 0; }
-EOF
-if { (eval echo configure:4168: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=yes"
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=no"
+  CPPFLAGS=`eval eval eval eval eval eval eval eval eval echo $CPPFLAGS`
+  ac_fn_c_check_header_compile "$LINENO" "X11/extensions/Xinerama.h" "ac_cv_header_X11_extensions_Xinerama_h" "#include <X11/Xlib.h>
+"
+if test "x$ac_cv_header_X11_extensions_Xinerama_h" = xyes; then :
+  have_xinerama=yes
 fi
 fi
-rm -f conftest*
-LIBS="$ac_save_LIBS"
 
 
-fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-  true
-else
-  echo "$ac_t""no" 1>&6
-have_mit=no
-fi
 
   CPPFLAGS="$ac_save_CPPFLAGS"
 
   CPPFLAGS="$ac_save_CPPFLAGS"
-  LDFLAGS="$ac_save_LDFLAGS"
-#  LIBS="$ac_save_LIBS"
-  
 
 
-    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.
-      
+  # if that succeeded, then check for the XINERAMA code in the libraries
+  if test "$have_xinerama" = yes; then
+
+    # first look in -lXext
+    have_xinerama=no
+
   ac_save_CPPFLAGS="$CPPFLAGS"
   ac_save_LDFLAGS="$LDFLAGS"
 #  ac_save_LIBS="$LIBS"
 
   ac_save_CPPFLAGS="$CPPFLAGS"
   ac_save_LDFLAGS="$LDFLAGS"
 #  ac_save_LIBS="$LIBS"
 
-  if test \! -z "$includedir" ; then 
+  if test \! -z "$includedir" ; then
     CPPFLAGS="$CPPFLAGS -I$includedir"
   fi
   # note: $X_CFLAGS includes $x_includes
     CPPFLAGS="$CPPFLAGS -I$includedir"
   fi
   # note: $X_CFLAGS includes $x_includes
@@ -4199,64 +8182,63 @@ fi
   # note: $X_LIBS includes $x_libraries
   LDFLAGS="$LDFLAGS $X_LIBS $X_EXTRA_LIBS"
 
   # note: $X_LIBS includes $x_libraries
   LDFLAGS="$LDFLAGS $X_LIBS $X_EXTRA_LIBS"
 
-  echo $ac_n "checking for XScreenSaverRegister in -lXExExt""... $ac_c" 1>&6
-echo "configure:4215: checking for XScreenSaverRegister in -lXExExt" >&5
-ac_lib_var=`echo XExExt'_'XScreenSaverRegister | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+  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:${as_lineno-$LINENO}: checking for XineramaQueryScreens in -lXext" >&5
+$as_echo_n "checking for XineramaQueryScreens in -lXext... " >&6; }
+if ${ac_cv_lib_Xext_XineramaQueryScreens+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
 else
-  ac_save_LIBS="$LIBS"
-LIBS="-lXExExt -lX11 -lXext -lm $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 4223 "configure"
-#include "confdefs.h"
-/* Override any gcc2 internal prototype to avoid an error.  */
-/* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char XScreenSaverRegister();
-
-int main() {
-XScreenSaverRegister()
-; return 0; }
-EOF
-if { (eval echo configure:4234: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=yes"
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lXext -lXext -lX11 $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* 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;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_Xext_XineramaQueryScreens=yes
 else
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=no"
+  ac_cv_lib_Xext_XineramaQueryScreens=no
 fi
 fi
-rm -f conftest*
-LIBS="$ac_save_LIBS"
-
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
 fi
 fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-  have_mit=yes; SAVER_LIBS="$SAVER_LIBS -lXExExt"
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Xext_XineramaQueryScreens" >&5
+$as_echo "$ac_cv_lib_Xext_XineramaQueryScreens" >&6; }
+if test "x$ac_cv_lib_Xext_XineramaQueryScreens" = xyes; then :
+  have_xinerama=yes
 else
 else
-  echo "$ac_t""no" 1>&6
-true
+  true
 fi
 
   CPPFLAGS="$ac_save_CPPFLAGS"
   LDFLAGS="$ac_save_LDFLAGS"
 #  LIBS="$ac_save_LIBS"
 fi
 
   CPPFLAGS="$ac_save_CPPFLAGS"
   LDFLAGS="$ac_save_LDFLAGS"
 #  LIBS="$ac_save_LIBS"
-  
-    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.
-      
+
+    # 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"
 #  ac_save_LIBS="$LIBS"
 
   ac_save_CPPFLAGS="$CPPFLAGS"
   ac_save_LDFLAGS="$LDFLAGS"
 #  ac_save_LIBS="$LIBS"
 
-  if test \! -z "$includedir" ; then 
+  if test \! -z "$includedir" ; then
     CPPFLAGS="$CPPFLAGS -I$includedir"
   fi
   # note: $X_CFLAGS includes $x_includes
     CPPFLAGS="$CPPFLAGS -I$includedir"
   fi
   # note: $X_CFLAGS includes $x_includes
   # note: $X_LIBS includes $x_libraries
   LDFLAGS="$LDFLAGS $X_LIBS $X_EXTRA_LIBS"
 
   # note: $X_LIBS includes $x_libraries
   LDFLAGS="$LDFLAGS $X_LIBS $X_EXTRA_LIBS"
 
-  echo $ac_n "checking for XScreenSaverRegister in -lXss""... $ac_c" 1>&6
-echo "configure:4284: checking for XScreenSaverRegister in -lXss" >&5
-ac_lib_var=`echo Xss'_'XScreenSaverRegister | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+  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:${as_lineno-$LINENO}: checking for XineramaQueryScreens in -lXinerama" >&5
+$as_echo_n "checking for XineramaQueryScreens in -lXinerama... " >&6; }
+if ${ac_cv_lib_Xinerama_XineramaQueryScreens+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
 else
-  ac_save_LIBS="$LIBS"
-LIBS="-lXss -lX11 -lXext -lm $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 4292 "configure"
-#include "confdefs.h"
-/* Override any gcc2 internal prototype to avoid an error.  */
-/* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char XScreenSaverRegister();
-
-int main() {
-XScreenSaverRegister()
-; return 0; }
-EOF
-if { (eval echo configure:4303: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=yes"
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lXinerama -lXext -lX11 $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* 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;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_Xinerama_XineramaQueryScreens=yes
 else
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=no"
+  ac_cv_lib_Xinerama_XineramaQueryScreens=no
 fi
 fi
-rm -f conftest*
-LIBS="$ac_save_LIBS"
-
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
 fi
 fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-  have_mit=yes; SAVER_LIBS="$SAVER_LIBS -lXss"
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Xinerama_XineramaQueryScreens" >&5
+$as_echo "$ac_cv_lib_Xinerama_XineramaQueryScreens" >&6; }
+if test "x$ac_cv_lib_Xinerama_XineramaQueryScreens" = xyes; then :
+  have_xinerama=yes; XINERAMA_LIBS="-lXinerama"
 else
 else
-  echo "$ac_t""no" 1>&6
-true
+  true
 fi
 
   CPPFLAGS="$ac_save_CPPFLAGS"
   LDFLAGS="$ac_save_LDFLAGS"
 #  LIBS="$ac_save_LIBS"
 fi
 
   CPPFLAGS="$ac_save_CPPFLAGS"
   LDFLAGS="$ac_save_LDFLAGS"
 #  LIBS="$ac_save_LIBS"
-  
-    fi
-
-  if test "$have_mit" = yes; then
-    cat >> confdefs.h <<\EOF
-#define HAVE_MIT_SAVER_EXTENSION 1
-EOF
 
 
+    fi
   fi
 
   fi
 
+  # if that succeeded, then we've really got it.
+  if test "$have_xinerama" = yes; then
+    $as_echo "#define HAVE_XINERAMA 1" >>confdefs.h
+
   fi
 
   fi
 
-elif test "$with_mit" != no; then
-  echo "error: must be yes or no: --with-mit-ext=$with_mit"
+elif test "$with_xinerama" != no; then
+  echo "error: must be yes or no: --with-xinerama-ext=$with_xinerama"
   exit 1
 fi
 
 
 ###############################################################################
 #
   exit 1
 fi
 
 
 ###############################################################################
 #
-#       Check for the XIDLE server extension.
+#       Check for the XINPUT server extension.
 #
 ###############################################################################
 
 #
 ###############################################################################
 
-have_xidle=no
-with_xidle_req=unspecified
-# Check whether --with-xidle-ext or --without-xidle-ext was given.
-if test "${with_xidle_ext+set}" = set; then
-  withval="$with_xidle_ext"
-  with_xidle="$withval"; with_xidle_req="$withval"
+have_xinput=no
+with_xinput_req=unspecified
+
+# 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
 else
-  with_xidle=yes
+  with_xinput=yes
 fi
 
 
 
 fi
 
 
 
-   case "$with_xidle" in
+   case "$with_xinput" in
     yes) ;;
     no)  ;;
 
     /*)
     yes) ;;
     no)  ;;
 
     /*)
-     echo $ac_n "checking for XIDLE headers""... $ac_c" 1>&6
-echo "configure:4369: checking for XIDLE headers" >&5
-     d=$with_xidle/include
+     { $as_echo "$as_me:${as_lineno-$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"
      if test -d $d; then
        X_CFLAGS="-I$d $X_CFLAGS"
-       echo "$ac_t""$d" 1>&6
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $d" >&5
+$as_echo "$d" >&6; }
      else
      else
-       echo "$ac_t""not found ($d: no such directory)" 1>&6
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found ($d: no such directory)" >&5
+$as_echo "not found ($d: no such directory)" >&6; }
      fi
 
      fi
 
-     echo $ac_n "checking for XIDLE libs""... $ac_c" 1>&6
-echo "configure:4379: checking for XIDLE libs" >&5
-     d=$with_xidle/lib
+     { $as_echo "$as_me:${as_lineno-$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"
      if test -d $d; then
        X_LIBS="-L$d $X_LIBS"
-       echo "$ac_t""$d" 1>&6
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $d" >&5
+$as_echo "$d" >&6; }
      else
      else
-       echo "$ac_t""not found ($d: no such directory)" 1>&6
+       { $as_echo "$as_me:${as_lineno-$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".
      fi
 
      # replace the directory string with "yes".
-     with_xidle_req="yes"
-     with_xidle=$with_xidle_req
+     with_xinput_req="yes"
+     with_xinput=$with_xinput_req
      ;;
 
     *)
      echo ""
      ;;
 
     *)
      echo ""
-     echo "error: argument to --with-xidle-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
      ;;
    esac
      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_xidle" = yes; then
-  
-  ac_save_CPPFLAGS="$CPPFLAGS"
-  if test \! -z "$includedir" ; then 
-    CPPFLAGS="$CPPFLAGS -I$includedir"
-  fi
-  CPPFLAGS="$CPPFLAGS $X_CFLAGS"
-  ac_safe=`echo "X11/extensions/xidle.h" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for X11/extensions/xidle.h""... $ac_c" 1>&6
-echo "configure:4412: checking for X11/extensions/xidle.h" >&5
-if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  cat > conftest.$ac_ext <<EOF
-#line 4417 "configure"
-#include "confdefs.h"
-#include <X11/extensions/xidle.h>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4422: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
-  rm -rf conftest*
-  eval "ac_cv_header_$ac_safe=yes"
-else
-  echo "$ac_err" >&5
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_header_$ac_safe=no"
-fi
-rm -f conftest*
-fi
-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-  have_xidle=yes
-                     cat >> confdefs.h <<\EOF
-#define HAVE_XIDLE_EXTENSION 1
-EOF
-
-else
-  echo "$ac_t""no" 1>&6
-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
-
-
-###############################################################################
-#
-#       Check for the SGI-VIDEO-CONTROL server extension.
-#
-###############################################################################
-
-have_sgivc=no
-with_sgivc_req=unspecified
-# Check whether --with-sgivc-ext or --without-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
 
 
 
 
+if test "$with_xinput" = yes; then
 
 
-   case "$with_sgivc" in
-    yes) ;;
-    no)  ;;
-
-    /*)
-     echo $ac_n "checking for SGI-VIDEO-CONTROL headers""... $ac_c" 1>&6
-echo "configure:4478: checking for SGI-VIDEO-CONTROL headers" >&5
-     d=$with_sgivc/include
-     if test -d $d; then
-       X_CFLAGS="-I$d $X_CFLAGS"
-       echo "$ac_t""$d" 1>&6
-     else
-       echo "$ac_t""not found ($d: no such directory)" 1>&6
-     fi
-
-     echo $ac_n "checking for SGI-VIDEO-CONTROL libs""... $ac_c" 1>&6
-echo "configure:4488: checking for SGI-VIDEO-CONTROL libs" >&5
-     d=$with_sgivc/lib
-     if test -d $d; then
-       X_LIBS="-L$d $X_LIBS"
-       echo "$ac_t""$d" 1>&6
-     else
-       echo "$ac_t""not found ($d: no such directory)" 1>&6
-     fi
-
-     # replace the directory string with "yes".
-     with_sgivc_req="yes"
-     with_sgivc=$with_sgivc_req
-     ;;
+  # first check for Xinput.h
 
 
-    *)
-     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"
   ac_save_CPPFLAGS="$CPPFLAGS"
-  if test \! -z "$includedir" ; then 
+  if test \! -z "$includedir" ; then
     CPPFLAGS="$CPPFLAGS -I$includedir"
   fi
   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
     CPPFLAGS="$CPPFLAGS -I$includedir"
   fi
   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
-  ac_safe=`echo "X11/extensions/XSGIvc.h" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for X11/extensions/XSGIvc.h""... $ac_c" 1>&6
-echo "configure:4523: checking for X11/extensions/XSGIvc.h" >&5
-if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  cat > conftest.$ac_ext <<EOF
-#line 4528 "configure"
-#include "confdefs.h"
-#include <X11/extensions/XSGIvc.h>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4533: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
-  rm -rf conftest*
-  eval "ac_cv_header_$ac_safe=yes"
-else
-  echo "$ac_err" >&5
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_header_$ac_safe=no"
-fi
-rm -f conftest*
-fi
-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-  have_sgivc=yes
-else
-  echo "$ac_t""no" 1>&6
+  CPPFLAGS=`eval eval eval eval eval eval eval eval eval echo $CPPFLAGS`
+  ac_fn_c_check_header_compile "$LINENO" "X11/extensions/XInput.h" "ac_cv_header_X11_extensions_XInput_h" "#include <X11/Xlib.h>
+"
+if test "x$ac_cv_header_X11_extensions_XInput_h" = xyes; then :
+  have_xinput=yes
 fi
 
 fi
 
+
   CPPFLAGS="$ac_save_CPPFLAGS"
 
   CPPFLAGS="$ac_save_CPPFLAGS"
 
-  # if that succeeded, then check for the -lXsgivc
-  if test "$have_sgivc" = yes; then
-    have_sgivc=no
-    
+  # if that succeeded, then check for libXi
+  if test "$have_xinput" = yes; then
+    have_xinput=no
+
   ac_save_CPPFLAGS="$CPPFLAGS"
   ac_save_LDFLAGS="$LDFLAGS"
 #  ac_save_LIBS="$LIBS"
 
   ac_save_CPPFLAGS="$CPPFLAGS"
   ac_save_LDFLAGS="$LDFLAGS"
 #  ac_save_LIBS="$LIBS"
 
-  if test \! -z "$includedir" ; then 
+  if test \! -z "$includedir" ; then
     CPPFLAGS="$CPPFLAGS -I$includedir"
   fi
   # note: $X_CFLAGS includes $x_includes
     CPPFLAGS="$CPPFLAGS -I$includedir"
   fi
   # note: $X_CFLAGS includes $x_includes
   # note: $X_LIBS includes $x_libraries
   LDFLAGS="$LDFLAGS $X_LIBS $X_EXTRA_LIBS"
 
   # note: $X_LIBS includes $x_libraries
   LDFLAGS="$LDFLAGS $X_LIBS $X_EXTRA_LIBS"
 
-  echo $ac_n "checking for XSGIvcQueryGammaMap in -lXsgivc""... $ac_c" 1>&6
-echo "configure:4577: checking for XSGIvcQueryGammaMap in -lXsgivc" >&5
-ac_lib_var=`echo Xsgivc'_'XSGIvcQueryGammaMap | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  ac_save_LIBS="$LIBS"
-LIBS="-lXsgivc -lXext -lX11 $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 4585 "configure"
-#include "confdefs.h"
-/* Override any gcc2 internal prototype to avoid an error.  */
-/* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char XSGIvcQueryGammaMap();
-
-int main() {
-XSGIvcQueryGammaMap()
-; return 0; }
-EOF
-if { (eval echo configure:4596: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=yes"
+  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:${as_lineno-$LINENO}: checking for XListInputDevices in -lXi" >&5
+$as_echo_n "checking for XListInputDevices in -lXi... " >&6; }
+if ${ac_cv_lib_Xi_XListInputDevices+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lXi -lXext -lX11 $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* 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 XListInputDevices ();
+int
+main ()
+{
+return XListInputDevices ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_Xi_XListInputDevices=yes
 else
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=no"
+  ac_cv_lib_Xi_XListInputDevices=no
 fi
 fi
-rm -f conftest*
-LIBS="$ac_save_LIBS"
-
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
 fi
 fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-  have_sgivc=yes; SAVER_LIBS="$SAVER_LIBS -lXsgivc"
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Xi_XListInputDevices" >&5
+$as_echo "$ac_cv_lib_Xi_XListInputDevices" >&6; }
+if test "x$ac_cv_lib_Xi_XListInputDevices" = xyes; then :
+  have_xinput=yes; SAVER_LIBS="$SAVER_LIBS -lXi"
 else
 else
-  echo "$ac_t""no" 1>&6
-true
+  true
 fi
 
   CPPFLAGS="$ac_save_CPPFLAGS"
   LDFLAGS="$ac_save_LDFLAGS"
 #  LIBS="$ac_save_LIBS"
 fi
 
   CPPFLAGS="$ac_save_CPPFLAGS"
   LDFLAGS="$ac_save_LDFLAGS"
 #  LIBS="$ac_save_LIBS"
-  
+
   fi
 
   # if that succeeded, then we've really got it.
   fi
 
   # if that succeeded, then we've really got it.
-  if test "$have_sgivc" = yes; then
-    cat >> confdefs.h <<\EOF
-#define HAVE_SGI_VC_EXTENSION 1
-EOF
+  if test "$have_xinput" = yes; then
+    $as_echo "#define HAVE_XINPUT 1" >>confdefs.h
 
   fi
 
 
   fi
 
-elif test "$with_sgivc" != no; then
-  echo "error: must be yes or no: --with-sgivc-ext=$with_sgivc"
+elif test "$with_xinput" != no; then
+  echo "error: must be yes or no: --with-xinput-ext=$with_xinput"
   exit 1
 fi
 
 
 ###############################################################################
 #
   exit 1
 fi
 
 
 ###############################################################################
 #
-#       Check for the DPMS server extension.
+#       Check for the XF86VMODE server extension (for virtual screens.)
 #
 ###############################################################################
 
 #
 ###############################################################################
 
-have_dpms=no
-with_dpms_req=unspecified
-# Check whether --with-dpms-ext or --without-dpms-ext was given.
-if test "${with_dpms_ext+set}" = set; then
-  withval="$with_dpms_ext"
-  with_dpms="$withval"; with_dpms_req="$withval"
+have_xf86vmode=no
+with_xf86vmode_req=unspecified
+
+# Check whether --with-xf86vmode-ext was given.
+if test "${with_xf86vmode_ext+set}" = set; then :
+  withval=$with_xf86vmode_ext; with_xf86vmode="$withval"; with_xf86vmode_req="$withval"
 else
 else
-  with_dpms=yes
+  with_xf86vmode=yes
 fi
 
 
 
 fi
 
 
 
-   case "$with_dpms" in
+   case "$with_xf86vmode" in
     yes) ;;
     no)  ;;
 
     /*)
     yes) ;;
     no)  ;;
 
     /*)
-     echo $ac_n "checking for DPMS headers""... $ac_c" 1>&6
-echo "configure:4661: checking for DPMS headers" >&5
-     d=$with_dpms/include
+     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for xf86vmode headers" >&5
+$as_echo_n "checking for xf86vmode headers... " >&6; }
+     d=$with_xf86vmode/include
      if test -d $d; then
        X_CFLAGS="-I$d $X_CFLAGS"
      if test -d $d; then
        X_CFLAGS="-I$d $X_CFLAGS"
-       echo "$ac_t""$d" 1>&6
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $d" >&5
+$as_echo "$d" >&6; }
      else
      else
-       echo "$ac_t""not found ($d: no such directory)" 1>&6
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found ($d: no such directory)" >&5
+$as_echo "not found ($d: no such directory)" >&6; }
      fi
 
      fi
 
-     echo $ac_n "checking for DPMS libs""... $ac_c" 1>&6
-echo "configure:4671: checking for DPMS libs" >&5
-     d=$with_dpms/lib
+     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for xf86vmode libs" >&5
+$as_echo_n "checking for xf86vmode libs... " >&6; }
+     d=$with_xf86vmode/lib
      if test -d $d; then
        X_LIBS="-L$d $X_LIBS"
      if test -d $d; then
        X_LIBS="-L$d $X_LIBS"
-       echo "$ac_t""$d" 1>&6
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $d" >&5
+$as_echo "$d" >&6; }
      else
      else
-       echo "$ac_t""not found ($d: no such directory)" 1>&6
+       { $as_echo "$as_me:${as_lineno-$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".
      fi
 
      # replace the directory string with "yes".
-     with_dpms_req="yes"
-     with_dpms=$with_dpms_req
+     with_xf86vmode_req="yes"
+     with_xf86vmode=$with_xf86vmode_req
      ;;
 
     *)
      echo ""
      ;;
 
     *)
      echo ""
-     echo "error: argument to --with-dpms-ext must be \"yes\", \"no\", or a directory."
+     echo "error: argument to --with-xf86vmode-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
      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_dpms" = yes; then
 
 
-  # first check for dpms.h
-  
-  ac_save_CPPFLAGS="$CPPFLAGS"
-  if test \! -z "$includedir" ; then 
-    CPPFLAGS="$CPPFLAGS -I$includedir"
-  fi
-  CPPFLAGS="$CPPFLAGS $X_CFLAGS"
-  ac_safe=`echo "X11/extensions/dpms.h" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for X11/extensions/dpms.h""... $ac_c" 1>&6
-echo "configure:4706: checking for X11/extensions/dpms.h" >&5
-if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  cat > conftest.$ac_ext <<EOF
-#line 4711 "configure"
-#include "confdefs.h"
-#include <X11/extensions/dpms.h>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4716: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
-  rm -rf conftest*
-  eval "ac_cv_header_$ac_safe=yes"
-else
-  echo "$ac_err" >&5
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_header_$ac_safe=no"
-fi
-rm -f conftest*
-fi
-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-  have_dpms=yes
-else
-  echo "$ac_t""no" 1>&6
-fi
+VIDMODE_LIBS=""
 
 
-  CPPFLAGS="$ac_save_CPPFLAGS"
+if test "$with_xf86vmode" = yes; then
 
 
-  # if that succeeded, then check for the DPMS code in the libraries
-  if test "$have_dpms" = yes; then
+  # first check for xf86vmode.h
 
 
-    # first look in -lXext (this is where it is with XFree86 4.0)
-    have_dpms=no
-    
   ac_save_CPPFLAGS="$CPPFLAGS"
   ac_save_CPPFLAGS="$CPPFLAGS"
-  ac_save_LDFLAGS="$LDFLAGS"
-#  ac_save_LIBS="$LIBS"
-
-  if test \! -z "$includedir" ; then 
+  if test \! -z "$includedir" ; then
     CPPFLAGS="$CPPFLAGS -I$includedir"
   fi
     CPPFLAGS="$CPPFLAGS -I$includedir"
   fi
-  # note: $X_CFLAGS includes $x_includes
   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
   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"
-
-  echo $ac_n "checking for DPMSInfo in -lXext""... $ac_c" 1>&6
-echo "configure:4762: checking for DPMSInfo in -lXext" >&5
-ac_lib_var=`echo Xext'_'DPMSInfo | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  ac_save_LIBS="$LIBS"
-LIBS="-lXext -lXext -lX11 $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 4770 "configure"
-#include "confdefs.h"
-/* Override any gcc2 internal prototype to avoid an error.  */
-/* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char DPMSInfo();
-
-int main() {
-DPMSInfo()
-; return 0; }
-EOF
-if { (eval echo configure:4781: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=yes"
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=no"
+  CPPFLAGS=`eval eval eval eval eval eval eval eval eval echo $CPPFLAGS`
+  ac_fn_c_check_header_compile "$LINENO" "X11/extensions/xf86vmode.h" "ac_cv_header_X11_extensions_xf86vmode_h" "#include <X11/Xlib.h>
+"
+if test "x$ac_cv_header_X11_extensions_xf86vmode_h" = xyes; then :
+  have_xf86vmode=yes
 fi
 fi
-rm -f conftest*
-LIBS="$ac_save_LIBS"
 
 
-fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-  have_dpms=yes
-else
-  echo "$ac_t""no" 1>&6
-true
-fi
 
   CPPFLAGS="$ac_save_CPPFLAGS"
 
   CPPFLAGS="$ac_save_CPPFLAGS"
-  LDFLAGS="$ac_save_LDFLAGS"
-#  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 succeeded, then check for the -lXxf86vm
+  if test "$have_xf86vmode" = yes; then
+    have_xf86vmode=no
+
   ac_save_CPPFLAGS="$CPPFLAGS"
   ac_save_LDFLAGS="$LDFLAGS"
 #  ac_save_LIBS="$LIBS"
 
   ac_save_CPPFLAGS="$CPPFLAGS"
   ac_save_LDFLAGS="$LDFLAGS"
 #  ac_save_LIBS="$LIBS"
 
-  if test \! -z "$includedir" ; then 
+  if test \! -z "$includedir" ; then
     CPPFLAGS="$CPPFLAGS -I$includedir"
   fi
   # note: $X_CFLAGS includes $x_includes
     CPPFLAGS="$CPPFLAGS -I$includedir"
   fi
   # note: $X_CFLAGS includes $x_includes
   # note: $X_LIBS includes $x_libraries
   LDFLAGS="$LDFLAGS $X_LIBS $X_EXTRA_LIBS"
 
   # note: $X_LIBS includes $x_libraries
   LDFLAGS="$LDFLAGS $X_LIBS $X_EXTRA_LIBS"
 
-  echo $ac_n "checking for DPMSInfo in -lXdpms""... $ac_c" 1>&6
-echo "configure:4827: checking for DPMSInfo in -lXdpms" >&5
-ac_lib_var=`echo Xdpms'_'DPMSInfo | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+  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:${as_lineno-$LINENO}: checking for XF86VidModeGetViewPort in -lXxf86vm" >&5
+$as_echo_n "checking for XF86VidModeGetViewPort in -lXxf86vm... " >&6; }
+if ${ac_cv_lib_Xxf86vm_XF86VidModeGetViewPort+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
 else
-  ac_save_LIBS="$LIBS"
-LIBS="-lXdpms -lXext -lX11 $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 4835 "configure"
-#include "confdefs.h"
-/* Override any gcc2 internal prototype to avoid an error.  */
-/* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char DPMSInfo();
-
-int main() {
-DPMSInfo()
-; return 0; }
-EOF
-if { (eval echo configure:4846: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=yes"
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lXxf86vm -lXext -lX11 $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* 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 XF86VidModeGetViewPort ();
+int
+main ()
+{
+return XF86VidModeGetViewPort ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_Xxf86vm_XF86VidModeGetViewPort=yes
 else
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=no"
+  ac_cv_lib_Xxf86vm_XF86VidModeGetViewPort=no
 fi
 fi
-rm -f conftest*
-LIBS="$ac_save_LIBS"
-
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
 fi
 fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-  have_dpms=yes; XDPMS_LIBS="-lXdpms"
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Xxf86vm_XF86VidModeGetViewPort" >&5
+$as_echo "$ac_cv_lib_Xxf86vm_XF86VidModeGetViewPort" >&6; }
+if test "x$ac_cv_lib_Xxf86vm_XF86VidModeGetViewPort" = xyes; then :
+  have_xf86vmode=yes;
+                   VIDMODE_LIBS="-lXxf86vm";
+                   SAVER_LIBS="$SAVER_LIBS $VIDMODE_LIBS"
 else
 else
-  echo "$ac_t""no" 1>&6
-true
+  true
 fi
 
   CPPFLAGS="$ac_save_CPPFLAGS"
   LDFLAGS="$ac_save_LDFLAGS"
 #  LIBS="$ac_save_LIBS"
 fi
 
   CPPFLAGS="$ac_save_CPPFLAGS"
   LDFLAGS="$ac_save_LDFLAGS"
 #  LIBS="$ac_save_LIBS"
-  
-    fi
-  fi
 
 
+  fi
 
   # if that succeeded, then we've really got it.
 
   # if that succeeded, then we've really got it.
-  if test "$have_dpms" = yes; then
-    cat >> confdefs.h <<\EOF
-#define HAVE_DPMS_EXTENSION 1
-EOF
+  if test "$have_xf86vmode" = yes; then
+    $as_echo "#define HAVE_XF86VMODE 1" >>confdefs.h
 
   fi
 
 
   fi
 
-elif test "$with_dpms" != no; then
-  echo "error: must be yes or no: --with-dpms-ext=$with_dpms"
+elif test "$with_xf86vmode" != no; then
+  echo "error: must be yes or no: --with-xf86vmode-ext=$with_xf86vmode"
   exit 1
 fi
 
 
 ###############################################################################
 #
   exit 1
 fi
 
 
 ###############################################################################
 #
-#       Check for the XINERAMA server extension.
+#       Check for the XF86VMODE server extension (for gamma fading.)
 #
 ###############################################################################
 
 #
 ###############################################################################
 
-have_xinerama=no
-with_xinerama_req=unspecified
-# Check whether --with-xinerama-ext or --without-xinerama-ext was given.
-if test "${with_xinerama_ext+set}" = set; then
-  withval="$with_xinerama_ext"
-  with_xinerama="$withval"; with_xinerama_req="$withval"
+have_xf86gamma=no
+have_xf86gamma_ramp=no
+with_xf86gamma_req=unspecified
+
+# Check whether --with-xf86gamma-ext was given.
+if test "${with_xf86gamma_ext+set}" = set; then :
+  withval=$with_xf86gamma_ext; with_xf86gamma="$withval"; with_xf86gamma_req="$withval"
 else
 else
-  with_xinerama=yes
+  with_xf86gamma=yes
 fi
 
 
 
 fi
 
 
 
-   case "$with_xinerama" in
+   case "$with_xf86gamma" in
     yes) ;;
     no)  ;;
 
     /*)
     yes) ;;
     no)  ;;
 
     /*)
-     echo $ac_n "checking for XINERAMA headers""... $ac_c" 1>&6
-echo "configure:4913: checking for XINERAMA headers" >&5
-     d=$with_xinerama/include
+     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for xf86gamma headers" >&5
+$as_echo_n "checking for xf86gamma headers... " >&6; }
+     d=$with_xf86gamma/include
      if test -d $d; then
        X_CFLAGS="-I$d $X_CFLAGS"
      if test -d $d; then
        X_CFLAGS="-I$d $X_CFLAGS"
-       echo "$ac_t""$d" 1>&6
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $d" >&5
+$as_echo "$d" >&6; }
      else
      else
-       echo "$ac_t""not found ($d: no such directory)" 1>&6
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found ($d: no such directory)" >&5
+$as_echo "not found ($d: no such directory)" >&6; }
      fi
 
      fi
 
-     echo $ac_n "checking for XINERAMA libs""... $ac_c" 1>&6
-echo "configure:4923: checking for XINERAMA libs" >&5
-     d=$with_xinerama/lib
+     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for xf86gamma libs" >&5
+$as_echo_n "checking for xf86gamma libs... " >&6; }
+     d=$with_xf86gamma/lib
      if test -d $d; then
        X_LIBS="-L$d $X_LIBS"
      if test -d $d; then
        X_LIBS="-L$d $X_LIBS"
-       echo "$ac_t""$d" 1>&6
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $d" >&5
+$as_echo "$d" >&6; }
      else
      else
-       echo "$ac_t""not found ($d: no such directory)" 1>&6
+       { $as_echo "$as_me:${as_lineno-$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".
      fi
 
      # replace the directory string with "yes".
-     with_xinerama_req="yes"
-     with_xinerama=$with_xinerama_req
+     with_xf86gamma_req="yes"
+     with_xf86gamma=$with_xf86gamma_req
      ;;
 
     *)
      echo ""
      ;;
 
     *)
      echo ""
-     echo "error: argument to --with-xinerama-ext must be \"yes\", \"no\", or a directory."
+     echo "error: argument to --with-xf86gamma-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
      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_xinerama" = yes; then
 
 
-  # first check for Xinerama.h
-  
+if test "$with_xf86gamma" = yes; then
+
+  # first check for xf86vmode.h, if we haven't already
+  if test "$have_xf86vmode" = yes; then
+    have_xf86gamma=yes
+  else
+
   ac_save_CPPFLAGS="$CPPFLAGS"
   ac_save_CPPFLAGS="$CPPFLAGS"
-  if test \! -z "$includedir" ; then 
+  if test \! -z "$includedir" ; then
     CPPFLAGS="$CPPFLAGS -I$includedir"
   fi
   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
     CPPFLAGS="$CPPFLAGS -I$includedir"
   fi
   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
-  ac_safe=`echo "X11/extensions/Xinerama.h" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for X11/extensions/Xinerama.h""... $ac_c" 1>&6
-echo "configure:4958: checking for X11/extensions/Xinerama.h" >&5
-if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  cat > conftest.$ac_ext <<EOF
-#line 4963 "configure"
-#include "confdefs.h"
-#include <X11/extensions/Xinerama.h>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4968: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
-  rm -rf conftest*
-  eval "ac_cv_header_$ac_safe=yes"
-else
-  echo "$ac_err" >&5
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_header_$ac_safe=no"
-fi
-rm -f conftest*
-fi
-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-  have_xinerama=yes
-else
-  echo "$ac_t""no" 1>&6
+  CPPFLAGS=`eval eval eval eval eval eval eval eval eval echo $CPPFLAGS`
+  ac_fn_c_check_header_compile "$LINENO" "X11/extensions/xf86vmode.h" "ac_cv_header_X11_extensions_xf86vmode_h" "#include <X11/Xlib.h>
+"
+if test "x$ac_cv_header_X11_extensions_xf86vmode_h" = xyes; then :
+  have_xf86gamma=yes
 fi
 
 fi
 
+
   CPPFLAGS="$ac_save_CPPFLAGS"
   CPPFLAGS="$ac_save_CPPFLAGS"
+  fi
 
 
-  # if that succeeded, then check for the XINERAMA code in the libraries
-  if test "$have_xinerama" = yes; then
+  # if that succeeded, then check for the -lXxf86vm
+  if test "$have_xf86gamma" = yes; then
+    have_xf86gamma=no
 
 
-    # first look in -lXext
-    have_xinerama=no
-    
   ac_save_CPPFLAGS="$CPPFLAGS"
   ac_save_LDFLAGS="$LDFLAGS"
 #  ac_save_LIBS="$LIBS"
 
   ac_save_CPPFLAGS="$CPPFLAGS"
   ac_save_LDFLAGS="$LDFLAGS"
 #  ac_save_LIBS="$LIBS"
 
-  if test \! -z "$includedir" ; then 
+  if test \! -z "$includedir" ; then
     CPPFLAGS="$CPPFLAGS -I$includedir"
   fi
   # note: $X_CFLAGS includes $x_includes
     CPPFLAGS="$CPPFLAGS -I$includedir"
   fi
   # note: $X_CFLAGS includes $x_includes
@@ -4998,60 +8749,65 @@ fi
   # note: $X_LIBS includes $x_libraries
   LDFLAGS="$LDFLAGS $X_LIBS $X_EXTRA_LIBS"
 
   # note: $X_LIBS includes $x_libraries
   LDFLAGS="$LDFLAGS $X_LIBS $X_EXTRA_LIBS"
 
-  echo $ac_n "checking for XineramaQueryExtension in -lXext""... $ac_c" 1>&6
-echo "configure:5014: checking for XineramaQueryExtension in -lXext" >&5
-ac_lib_var=`echo Xext'_'XineramaQueryExtension | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+  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:${as_lineno-$LINENO}: checking for XF86VidModeSetGamma in -lXxf86vm" >&5
+$as_echo_n "checking for XF86VidModeSetGamma in -lXxf86vm... " >&6; }
+if ${ac_cv_lib_Xxf86vm_XF86VidModeSetGamma+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
 else
-  ac_save_LIBS="$LIBS"
-LIBS="-lXext -lXext -lX11 $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 5022 "configure"
-#include "confdefs.h"
-/* Override any gcc2 internal prototype to avoid an error.  */
-/* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char XineramaQueryExtension();
-
-int main() {
-XineramaQueryExtension()
-; return 0; }
-EOF
-if { (eval echo configure:5033: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=yes"
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lXxf86vm -lXext -lX11 $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* 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 XF86VidModeSetGamma ();
+int
+main ()
+{
+return XF86VidModeSetGamma ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_Xxf86vm_XF86VidModeSetGamma=yes
 else
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=no"
+  ac_cv_lib_Xxf86vm_XF86VidModeSetGamma=no
 fi
 fi
-rm -f conftest*
-LIBS="$ac_save_LIBS"
-
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
 fi
 fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-  have_xinerama=yes
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Xxf86vm_XF86VidModeSetGamma" >&5
+$as_echo "$ac_cv_lib_Xxf86vm_XF86VidModeSetGamma" >&6; }
+if test "x$ac_cv_lib_Xxf86vm_XF86VidModeSetGamma" = xyes; then :
+  have_xf86gamma=yes
 else
 else
-  echo "$ac_t""no" 1>&6
-true
+  true
 fi
 
   CPPFLAGS="$ac_save_CPPFLAGS"
   LDFLAGS="$ac_save_LDFLAGS"
 #  LIBS="$ac_save_LIBS"
 fi
 
   CPPFLAGS="$ac_save_CPPFLAGS"
   LDFLAGS="$ac_save_LDFLAGS"
 #  LIBS="$ac_save_LIBS"
-  
 
 
-    # if that failed, look in -lXinerama (this is where it is in XFree86 4.1.)
-    if test "$have_xinerama" = no; then
-      
+  fi
+
+  # check for the Ramp versions of the functions too.
+  if test "$have_xf86gamma" = yes; then
+    have_xf86gamma_ramp=no
+
   ac_save_CPPFLAGS="$CPPFLAGS"
   ac_save_LDFLAGS="$LDFLAGS"
 #  ac_save_LIBS="$LIBS"
 
   ac_save_CPPFLAGS="$CPPFLAGS"
   ac_save_LDFLAGS="$LDFLAGS"
 #  ac_save_LIBS="$LIBS"
 
-  if test \! -z "$includedir" ; then 
+  if test \! -z "$includedir" ; then
     CPPFLAGS="$CPPFLAGS -I$includedir"
   fi
   # note: $X_CFLAGS includes $x_includes
     CPPFLAGS="$CPPFLAGS -I$includedir"
   fi
   # note: $X_CFLAGS includes $x_includes
   # note: $X_LIBS includes $x_libraries
   LDFLAGS="$LDFLAGS $X_LIBS $X_EXTRA_LIBS"
 
   # note: $X_LIBS includes $x_libraries
   LDFLAGS="$LDFLAGS $X_LIBS $X_EXTRA_LIBS"
 
-  echo $ac_n "checking for XineramaQueryExtension in -lXinerama""... $ac_c" 1>&6
-echo "configure:5079: checking for XineramaQueryExtension in -lXinerama" >&5
-ac_lib_var=`echo Xinerama'_'XineramaQueryExtension | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+  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:${as_lineno-$LINENO}: checking for XF86VidModeSetGammaRamp in -lXxf86vm" >&5
+$as_echo_n "checking for XF86VidModeSetGammaRamp in -lXxf86vm... " >&6; }
+if ${ac_cv_lib_Xxf86vm_XF86VidModeSetGammaRamp+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
 else
-  ac_save_LIBS="$LIBS"
-LIBS="-lXinerama -lXext -lX11 $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 5087 "configure"
-#include "confdefs.h"
-/* Override any gcc2 internal prototype to avoid an error.  */
-/* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char XineramaQueryExtension();
-
-int main() {
-XineramaQueryExtension()
-; return 0; }
-EOF
-if { (eval echo configure:5098: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=yes"
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lXxf86vm -lXext -lX11 $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* 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 XF86VidModeSetGammaRamp ();
+int
+main ()
+{
+return XF86VidModeSetGammaRamp ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_Xxf86vm_XF86VidModeSetGammaRamp=yes
 else
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=no"
+  ac_cv_lib_Xxf86vm_XF86VidModeSetGammaRamp=no
 fi
 fi
-rm -f conftest*
-LIBS="$ac_save_LIBS"
-
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
 fi
 fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-  have_xinerama=yes; SAVER_LIBS="$SAVER_LIBS -lXinerama"
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Xxf86vm_XF86VidModeSetGammaRamp" >&5
+$as_echo "$ac_cv_lib_Xxf86vm_XF86VidModeSetGammaRamp" >&6; }
+if test "x$ac_cv_lib_Xxf86vm_XF86VidModeSetGammaRamp" = xyes; then :
+  have_xf86gamma_ramp=yes
 else
 else
-  echo "$ac_t""no" 1>&6
-true
+  true
 fi
 
   CPPFLAGS="$ac_save_CPPFLAGS"
   LDFLAGS="$ac_save_LDFLAGS"
 #  LIBS="$ac_save_LIBS"
 fi
 
   CPPFLAGS="$ac_save_CPPFLAGS"
   LDFLAGS="$ac_save_LDFLAGS"
 #  LIBS="$ac_save_LIBS"
-  
-    fi
+
   fi
 
   fi
 
-  # if that succeeded, then we've really got it.
-  if test "$have_xinerama" = yes; then
-    cat >> confdefs.h <<\EOF
-#define HAVE_XINERAMA 1
-EOF
+  # if those tests succeeded, then we've really got the functions.
+  if test "$have_xf86gamma" = yes; then
+    $as_echo "#define HAVE_XF86VMODE_GAMMA 1" >>confdefs.h
 
   fi
 
 
   fi
 
-elif test "$with_xinerama" != no; then
-  echo "error: must be yes or no: --with-xinerama-ext=$with_xinerama"
+  if test "$have_xf86gamma_ramp" = yes; then
+    $as_echo "#define HAVE_XF86VMODE_GAMMA_RAMP 1" >>confdefs.h
+
+  fi
+
+  # pull in the lib, if we haven't already
+  if test "$have_xf86gamma" = yes -a "$have_xf86vmode" = no; then
+    SAVER_LIBS="$SAVER_LIBS -lXxf86vm"
+  fi
+
+elif test "$with_xf86gamma" != no; then
+  echo "error: must be yes or no: --with-xf86gamma-ext=$with_xf86vmode"
   exit 1
 fi
 
 
 ###############################################################################
 #
   exit 1
 fi
 
 
 ###############################################################################
 #
-#       Check for the XF86VMODE server extension (for virtual screens.)
+#       Check for the RANDR (Resize and Rotate) server extension.
+#
+#       We need this to detect when the resolution of the desktop
+#       has changed out from under us (this is a newer, different
+#       mechanism than the XF86VMODE virtual viewports.)
 #
 ###############################################################################
 
 #
 ###############################################################################
 
-have_xf86vmode=no
-with_xf86vmode_req=unspecified
-# Check whether --with-xf86vmode-ext or --without-xf86vmode-ext was given.
-if test "${with_xf86vmode_ext+set}" = set; then
-  withval="$with_xf86vmode_ext"
-  with_xf86vmode="$withval"; with_xf86vmode_req="$withval"
+have_randr=no
+with_randr_req=unspecified
+
+# Check whether --with-randr-ext was given.
+if test "${with_randr_ext+set}" = set; then :
+  withval=$with_randr_ext; with_randr="$withval"; with_randr_req="$withval"
 else
 else
-  with_xf86vmode=yes
+  with_randr=yes
 fi
 
 
 
 fi
 
 
 
-   case "$with_xf86vmode" in
+   case "$with_randr" in
     yes) ;;
     no)  ;;
 
     /*)
     yes) ;;
     no)  ;;
 
     /*)
-     echo $ac_n "checking for xf86vmode headers""... $ac_c" 1>&6
-echo "configure:5164: checking for xf86vmode headers" >&5
-     d=$with_xf86vmode/include
+     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for RANDR headers" >&5
+$as_echo_n "checking for RANDR headers... " >&6; }
+     d=$with_randr/include
      if test -d $d; then
        X_CFLAGS="-I$d $X_CFLAGS"
      if test -d $d; then
        X_CFLAGS="-I$d $X_CFLAGS"
-       echo "$ac_t""$d" 1>&6
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $d" >&5
+$as_echo "$d" >&6; }
      else
      else
-       echo "$ac_t""not found ($d: no such directory)" 1>&6
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found ($d: no such directory)" >&5
+$as_echo "not found ($d: no such directory)" >&6; }
      fi
 
      fi
 
-     echo $ac_n "checking for xf86vmode libs""... $ac_c" 1>&6
-echo "configure:5174: checking for xf86vmode libs" >&5
-     d=$with_xf86vmode/lib
+     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for RANDR libs" >&5
+$as_echo_n "checking for RANDR libs... " >&6; }
+     d=$with_randr/lib
      if test -d $d; then
        X_LIBS="-L$d $X_LIBS"
      if test -d $d; then
        X_LIBS="-L$d $X_LIBS"
-       echo "$ac_t""$d" 1>&6
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $d" >&5
+$as_echo "$d" >&6; }
      else
      else
-       echo "$ac_t""not found ($d: no such directory)" 1>&6
+       { $as_echo "$as_me:${as_lineno-$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".
      fi
 
      # replace the directory string with "yes".
-     with_xf86vmode_req="yes"
-     with_xf86vmode=$with_xf86vmode_req
+     with_randr_req="yes"
+     with_randr=$with_randr_req
      ;;
 
     *)
      echo ""
      ;;
 
     *)
      echo ""
-     echo "error: argument to --with-xf86vmode-ext must be \"yes\", \"no\", or a directory."
+     echo "error: argument to --with-randr-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
      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_xf86vmode" = yes; then
 
 
-  # first check for xf86vmode.h
-  
+if test "$with_randr" = yes; then
+
+  # first check for Xrandr.h
+
   ac_save_CPPFLAGS="$CPPFLAGS"
   ac_save_CPPFLAGS="$CPPFLAGS"
-  if test \! -z "$includedir" ; then 
+  if test \! -z "$includedir" ; then
     CPPFLAGS="$CPPFLAGS -I$includedir"
   fi
   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
     CPPFLAGS="$CPPFLAGS -I$includedir"
   fi
   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
-  ac_safe=`echo "X11/extensions/xf86vmode.h" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for X11/extensions/xf86vmode.h""... $ac_c" 1>&6
-echo "configure:5209: checking for X11/extensions/xf86vmode.h" >&5
-if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  cat > conftest.$ac_ext <<EOF
-#line 5214 "configure"
-#include "confdefs.h"
-#include <X11/extensions/xf86vmode.h>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5219: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
-  rm -rf conftest*
-  eval "ac_cv_header_$ac_safe=yes"
-else
-  echo "$ac_err" >&5
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_header_$ac_safe=no"
-fi
-rm -f conftest*
-fi
-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-  have_xf86vmode=yes
-else
-  echo "$ac_t""no" 1>&6
+  CPPFLAGS=`eval eval eval eval eval eval eval eval eval echo $CPPFLAGS`
+  ac_fn_c_check_header_compile "$LINENO" "X11/extensions/Xrandr.h" "ac_cv_header_X11_extensions_Xrandr_h" "#include <X11/Xlib.h>
+"
+if test "x$ac_cv_header_X11_extensions_Xrandr_h" = xyes; then :
+  have_randr=yes
 fi
 
 fi
 
+
   CPPFLAGS="$ac_save_CPPFLAGS"
 
   CPPFLAGS="$ac_save_CPPFLAGS"
 
-  # if that succeeded, then check for the -lXxf86vm
-  if test "$have_xf86vmode" = yes; then
-    have_xf86vmode=no
-    
+  # if that succeeded, then check for the XRR code in the libraries
+  if test "$have_randr" = yes; then
+
+    # RANDR probably needs -lXrender
+    xrender_libs=
+
   ac_save_CPPFLAGS="$CPPFLAGS"
   ac_save_LDFLAGS="$LDFLAGS"
 #  ac_save_LIBS="$LIBS"
 
   ac_save_CPPFLAGS="$CPPFLAGS"
   ac_save_LDFLAGS="$LDFLAGS"
 #  ac_save_LIBS="$LIBS"
 
-  if test \! -z "$includedir" ; then 
+  if test \! -z "$includedir" ; then
     CPPFLAGS="$CPPFLAGS -I$includedir"
   fi
   # note: $X_CFLAGS includes $x_includes
     CPPFLAGS="$CPPFLAGS -I$includedir"
   fi
   # note: $X_CFLAGS includes $x_includes
   # note: $X_LIBS includes $x_libraries
   LDFLAGS="$LDFLAGS $X_LIBS $X_EXTRA_LIBS"
 
   # note: $X_LIBS includes $x_libraries
   LDFLAGS="$LDFLAGS $X_LIBS $X_EXTRA_LIBS"
 
-  echo $ac_n "checking for XF86VidModeGetViewPort in -lXxf86vm""... $ac_c" 1>&6
-echo "configure:5263: checking for XF86VidModeGetViewPort in -lXxf86vm" >&5
-ac_lib_var=`echo Xxf86vm'_'XF86VidModeGetViewPort | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  ac_save_LIBS="$LIBS"
-LIBS="-lXxf86vm -lXext -lX11 $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 5271 "configure"
-#include "confdefs.h"
-/* Override any gcc2 internal prototype to avoid an error.  */
-/* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char XF86VidModeGetViewPort();
-
-int main() {
-XF86VidModeGetViewPort()
-; return 0; }
-EOF
-if { (eval echo configure:5282: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=yes"
+  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:${as_lineno-$LINENO}: checking for XRenderSetSubpixelOrder in -lXrender" >&5
+$as_echo_n "checking for XRenderSetSubpixelOrder in -lXrender... " >&6; }
+if ${ac_cv_lib_Xrender_XRenderSetSubpixelOrder+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lXrender -lXext -lX11 $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* 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 XRenderSetSubpixelOrder ();
+int
+main ()
+{
+return XRenderSetSubpixelOrder ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_Xrender_XRenderSetSubpixelOrder=yes
 else
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=no"
+  ac_cv_lib_Xrender_XRenderSetSubpixelOrder=no
 fi
 fi
-rm -f conftest*
-LIBS="$ac_save_LIBS"
-
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
 fi
 fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-  have_xf86vmode=yes; SAVER_LIBS="$SAVER_LIBS -lXxf86vm"
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Xrender_XRenderSetSubpixelOrder" >&5
+$as_echo "$ac_cv_lib_Xrender_XRenderSetSubpixelOrder" >&6; }
+if test "x$ac_cv_lib_Xrender_XRenderSetSubpixelOrder" = xyes; then :
+  xrender_libs="-lXrender"
 else
 else
-  echo "$ac_t""no" 1>&6
-true
+  true
 fi
 
   CPPFLAGS="$ac_save_CPPFLAGS"
   LDFLAGS="$ac_save_LDFLAGS"
 #  LIBS="$ac_save_LIBS"
 fi
 
   CPPFLAGS="$ac_save_CPPFLAGS"
   LDFLAGS="$ac_save_LDFLAGS"
 #  LIBS="$ac_save_LIBS"
-  
-  fi
-
-  # if that succeeded, then we've really got it.
-  if test "$have_xf86vmode" = yes; then
-    cat >> confdefs.h <<\EOF
-#define HAVE_XF86VMODE 1
-EOF
-
-  fi
-
-elif test "$with_xf86vmode" != no; then
-  echo "error: must be yes or no: --with-xf86vmode-ext=$with_xf86vmode"
-  exit 1
-fi
-
 
 
-###############################################################################
-#
-#       Check for the XF86VMODE server extension (for gamma fading.)
-#
-###############################################################################
-
-have_xf86gamma=no
-have_xf86gamma_ramp=no
-with_xf86gamma_req=unspecified
-# Check whether --with-xf86gamma-ext or --without-xf86gamma-ext was given.
-if test "${with_xf86gamma_ext+set}" = set; then
-  withval="$with_xf86gamma_ext"
-  with_xf86gamma="$withval"; with_xf86gamma_req="$withval"
-else
-  with_xf86gamma=yes
-fi
-
-
-
-   case "$with_xf86gamma" in
-    yes) ;;
-    no)  ;;
-
-    /*)
-     echo $ac_n "checking for xf86gamma headers""... $ac_c" 1>&6
-echo "configure:5348: checking for xf86gamma headers" >&5
-     d=$with_xf86gamma/include
-     if test -d $d; then
-       X_CFLAGS="-I$d $X_CFLAGS"
-       echo "$ac_t""$d" 1>&6
-     else
-       echo "$ac_t""not found ($d: no such directory)" 1>&6
-     fi
-
-     echo $ac_n "checking for xf86gamma libs""... $ac_c" 1>&6
-echo "configure:5358: checking for xf86gamma libs" >&5
-     d=$with_xf86gamma/lib
-     if test -d $d; then
-       X_LIBS="-L$d $X_LIBS"
-       echo "$ac_t""$d" 1>&6
-     else
-       echo "$ac_t""not found ($d: no such directory)" 1>&6
-     fi
-
-     # replace the directory string with "yes".
-     with_xf86gamma_req="yes"
-     with_xf86gamma=$with_xf86gamma_req
-     ;;
-
-    *)
-     echo ""
-     echo "error: argument to --with-xf86gamma-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_xf86gamma" = yes; then
+    # first look for RANDR in -lXext
+    have_randr=no
 
 
-  # first check for xf86vmode.h, if we haven't already
-  if test "$have_xf86vmode" = yes; then
-    have_xf86gamma=yes
-  else
-    
   ac_save_CPPFLAGS="$CPPFLAGS"
   ac_save_CPPFLAGS="$CPPFLAGS"
-  if test \! -z "$includedir" ; then 
+  ac_save_LDFLAGS="$LDFLAGS"
+#  ac_save_LIBS="$LIBS"
+
+  if test \! -z "$includedir" ; then
     CPPFLAGS="$CPPFLAGS -I$includedir"
   fi
     CPPFLAGS="$CPPFLAGS -I$includedir"
   fi
+  # note: $X_CFLAGS includes $x_includes
   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
-  ac_safe=`echo "X11/extensions/xf86vmode.h" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for X11/extensions/xf86vmode.h""... $ac_c" 1>&6
-echo "configure:5396: checking for X11/extensions/xf86vmode.h" >&5
-if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+
+  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:${as_lineno-$LINENO}: checking for XRRGetScreenInfo in -lXext" >&5
+$as_echo_n "checking for XRRGetScreenInfo in -lXext... " >&6; }
+if ${ac_cv_lib_Xext_XRRGetScreenInfo+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lXext $xrender_libs -lXext -lX11 $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* 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 XRRGetScreenInfo ();
+int
+main ()
+{
+return XRRGetScreenInfo ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_Xext_XRRGetScreenInfo=yes
 else
 else
-  cat > conftest.$ac_ext <<EOF
-#line 5401 "configure"
-#include "confdefs.h"
-#include <X11/extensions/xf86vmode.h>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5406: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
-  rm -rf conftest*
-  eval "ac_cv_header_$ac_safe=yes"
-else
-  echo "$ac_err" >&5
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_header_$ac_safe=no"
-fi
-rm -f conftest*
-fi
-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-  have_xf86gamma=yes
+  ac_cv_lib_Xext_XRRGetScreenInfo=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Xext_XRRGetScreenInfo" >&5
+$as_echo "$ac_cv_lib_Xext_XRRGetScreenInfo" >&6; }
+if test "x$ac_cv_lib_Xext_XRRGetScreenInfo" = xyes; then :
+  have_randr=yes; SAVER_LIBS="$SAVER_LIBS $xrender_libs"
 else
 else
-  echo "$ac_t""no" 1>&6
+  true
 fi
 
   CPPFLAGS="$ac_save_CPPFLAGS"
 fi
 
   CPPFLAGS="$ac_save_CPPFLAGS"
-  fi
+  LDFLAGS="$ac_save_LDFLAGS"
+#  LIBS="$ac_save_LIBS"
+
+
+    # if that failed, look in -lXrandr
+    if test "$have_randr" = no; then
 
 
-  # if that succeeded, then check for the -lXxf86vm
-  if test "$have_xf86gamma" = yes; then
-    have_xf86gamma=no
-    
   ac_save_CPPFLAGS="$CPPFLAGS"
   ac_save_LDFLAGS="$LDFLAGS"
 #  ac_save_LIBS="$LIBS"
 
   ac_save_CPPFLAGS="$CPPFLAGS"
   ac_save_LDFLAGS="$LDFLAGS"
 #  ac_save_LIBS="$LIBS"
 
-  if test \! -z "$includedir" ; then 
+  if test \! -z "$includedir" ; then
     CPPFLAGS="$CPPFLAGS -I$includedir"
   fi
   # note: $X_CFLAGS includes $x_includes
     CPPFLAGS="$CPPFLAGS -I$includedir"
   fi
   # note: $X_CFLAGS includes $x_includes
   # note: $X_LIBS includes $x_libraries
   LDFLAGS="$LDFLAGS $X_LIBS $X_EXTRA_LIBS"
 
   # note: $X_LIBS includes $x_libraries
   LDFLAGS="$LDFLAGS $X_LIBS $X_EXTRA_LIBS"
 
-  echo $ac_n "checking for XF86VidModeSetGamma in -lXxf86vm""... $ac_c" 1>&6
-echo "configure:5451: checking for XF86VidModeSetGamma in -lXxf86vm" >&5
-ac_lib_var=`echo Xxf86vm'_'XF86VidModeSetGamma | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  ac_save_LIBS="$LIBS"
-LIBS="-lXxf86vm -lXext -lX11 $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 5459 "configure"
-#include "confdefs.h"
-/* Override any gcc2 internal prototype to avoid an error.  */
-/* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char XF86VidModeSetGamma();
-
-int main() {
-XF86VidModeSetGamma()
-; return 0; }
-EOF
-if { (eval echo configure:5470: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=yes"
+  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:${as_lineno-$LINENO}: checking for XRRGetScreenInfo in -lXrandr" >&5
+$as_echo_n "checking for XRRGetScreenInfo in -lXrandr... " >&6; }
+if ${ac_cv_lib_Xrandr_XRRGetScreenInfo+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lXrandr $xrender_libs -lXext -lX11 $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* 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 XRRGetScreenInfo ();
+int
+main ()
+{
+return XRRGetScreenInfo ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_Xrandr_XRRGetScreenInfo=yes
 else
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=no"
+  ac_cv_lib_Xrandr_XRRGetScreenInfo=no
 fi
 fi
-rm -f conftest*
-LIBS="$ac_save_LIBS"
-
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
 fi
 fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-  have_xf86gamma=yes
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Xrandr_XRRGetScreenInfo" >&5
+$as_echo "$ac_cv_lib_Xrandr_XRRGetScreenInfo" >&6; }
+if test "x$ac_cv_lib_Xrandr_XRRGetScreenInfo" = xyes; then :
+  have_randr=yes; SAVER_LIBS="$SAVER_LIBS -lXrandr $xrender_libs"
 else
 else
-  echo "$ac_t""no" 1>&6
-true
+  true
 fi
 
   CPPFLAGS="$ac_save_CPPFLAGS"
   LDFLAGS="$ac_save_LDFLAGS"
 #  LIBS="$ac_save_LIBS"
 fi
 
   CPPFLAGS="$ac_save_CPPFLAGS"
   LDFLAGS="$ac_save_LDFLAGS"
 #  LIBS="$ac_save_LIBS"
-  
+
+    fi
   fi
 
   fi
 
-  # check for the Ramp versions of the functions too.
-  if test "$have_xf86gamma" = yes; then
-    have_xf86gamma_ramp=no
-    
+  # if that succeeded, then we've really got it.
+  if test "$have_randr" = yes; then
+    $as_echo "#define HAVE_RANDR 1" >>confdefs.h
+
+
+    # Now check for version 1.2 in the same libs.
+    # Try to compile, since on MacOS 10.5.7, headers are older than libs!
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XRRGetScreenResources" >&5
+$as_echo_n "checking for XRRGetScreenResources... " >&6; }
+if ${ac_cv_randr_12+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_cv_randr_12=no
+
+  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`
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stdlib.h>
+                         #include <X11/Xlib.h>
+                         #include <X11/extensions/Xrandr.h>
+int
+main ()
+{
+XRRScreenResources *res =
+                           XRRGetScreenResources (0, 0);
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_randr_12=yes
+else
+  ac_cv_randr_12=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+  CPPFLAGS="$ac_save_CPPFLAGS"
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_randr_12" >&5
+$as_echo "$ac_cv_randr_12" >&6; }
+    if test "$ac_cv_randr_12" = yes ; then
+      $as_echo "#define HAVE_RANDR_12 1" >>confdefs.h
+
+    fi
+#   AC_CHECK_X_LIB(c, XRRGetOutputInfo, [AC_DEFINE(HAVE_RANDR_12)],
+#                  [true], $SAVER_LIBS)
+  fi
+
+
+elif test "$with_randr" != no; then
+  echo "error: must be yes or no: --with-randr-ext=$with_randr"
+  exit 1
+fi
+
+
+###############################################################################
+#
+#       Check for XF86MiscSetGrabKeysState (but only bother if we are already
+#      using other XF86 stuff.)
+#
+###############################################################################
+
+have_xf86miscsetgrabkeysstate=no
+if test "$have_xf86gamma" = yes -o "$have_xf86vmode" = yes; then
+
   ac_save_CPPFLAGS="$CPPFLAGS"
   ac_save_LDFLAGS="$LDFLAGS"
 #  ac_save_LIBS="$LIBS"
 
   ac_save_CPPFLAGS="$CPPFLAGS"
   ac_save_LDFLAGS="$LDFLAGS"
 #  ac_save_LIBS="$LIBS"
 
-  if test \! -z "$includedir" ; then 
+  if test \! -z "$includedir" ; then
     CPPFLAGS="$CPPFLAGS -I$includedir"
   fi
   # note: $X_CFLAGS includes $x_includes
     CPPFLAGS="$CPPFLAGS -I$includedir"
   fi
   # note: $X_CFLAGS includes $x_includes
@@ -5502,76 +9270,59 @@ fi
   # note: $X_LIBS includes $x_libraries
   LDFLAGS="$LDFLAGS $X_LIBS $X_EXTRA_LIBS"
 
   # note: $X_LIBS includes $x_libraries
   LDFLAGS="$LDFLAGS $X_LIBS $X_EXTRA_LIBS"
 
-  echo $ac_n "checking for XF86VidModeSetGammaRamp in -lXxf86vm""... $ac_c" 1>&6
-echo "configure:5518: checking for XF86VidModeSetGammaRamp in -lXxf86vm" >&5
-ac_lib_var=`echo Xxf86vm'_'XF86VidModeSetGammaRamp | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  ac_save_LIBS="$LIBS"
-LIBS="-lXxf86vm -lXext -lX11 $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 5526 "configure"
-#include "confdefs.h"
-/* Override any gcc2 internal prototype to avoid an error.  */
-/* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char XF86VidModeSetGammaRamp();
-
-int main() {
-XF86VidModeSetGammaRamp()
-; return 0; }
-EOF
-if { (eval echo configure:5537: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=yes"
+  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:${as_lineno-$LINENO}: checking for XF86MiscSetGrabKeysState in -lXxf86misc" >&5
+$as_echo_n "checking for XF86MiscSetGrabKeysState in -lXxf86misc... " >&6; }
+if ${ac_cv_lib_Xxf86misc_XF86MiscSetGrabKeysState+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lXxf86misc -lXext -lX11 $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* 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 XF86MiscSetGrabKeysState ();
+int
+main ()
+{
+return XF86MiscSetGrabKeysState ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_Xxf86misc_XF86MiscSetGrabKeysState=yes
 else
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=no"
+  ac_cv_lib_Xxf86misc_XF86MiscSetGrabKeysState=no
 fi
 fi
-rm -f conftest*
-LIBS="$ac_save_LIBS"
-
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
 fi
 fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-  have_xf86gamma_ramp=yes
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Xxf86misc_XF86MiscSetGrabKeysState" >&5
+$as_echo "$ac_cv_lib_Xxf86misc_XF86MiscSetGrabKeysState" >&6; }
+if test "x$ac_cv_lib_Xxf86misc_XF86MiscSetGrabKeysState" = xyes; then :
+  have_xf86miscsetgrabkeysstate=yes
 else
 else
-  echo "$ac_t""no" 1>&6
-true
+  true
 fi
 
   CPPFLAGS="$ac_save_CPPFLAGS"
   LDFLAGS="$ac_save_LDFLAGS"
 #  LIBS="$ac_save_LIBS"
 fi
 
   CPPFLAGS="$ac_save_CPPFLAGS"
   LDFLAGS="$ac_save_LDFLAGS"
 #  LIBS="$ac_save_LIBS"
-  
-  fi
-
-  # if those tests succeeded, then we've really got the functions.
-  if test "$have_xf86gamma" = yes; then
-    cat >> confdefs.h <<\EOF
-#define HAVE_XF86VMODE_GAMMA 1
-EOF
-
-  fi
-
-  if test "$have_xf86gamma_ramp" = yes; then
-    cat >> confdefs.h <<\EOF
-#define HAVE_XF86VMODE_GAMMA_RAMP 1
-EOF
 
 
-  fi
+  if test "$have_xf86miscsetgrabkeysstate" = yes ; then
+    SAVER_LIBS="$SAVER_LIBS -lXxf86misc"
+    $as_echo "#define HAVE_XF86MISCSETGRABKEYSSTATE 1" >>confdefs.h
 
 
-  # pull in the lib, if we haven't already
-  if test "$have_xf86gamma" = yes -a "$have_xf86vmode" = no; then
-    SAVER_LIBS="$SAVER_LIBS -lXxf86vm"
   fi
   fi
-
-elif test "$with_xf86gamma" != no; then
-  echo "error: must be yes or no: --with-xf86gamma-ext=$with_xf86vmode"
-  exit 1
 fi
 
 
 fi
 
 
@@ -5581,27 +9332,32 @@ fi
 #
 ###############################################################################
 
 #
 ###############################################################################
 
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for XHPDisableReset in X11/XHPlib.h" >&5
+$as_echo_n "checking for XHPDisableReset in X11/XHPlib.h... " >&6; }
 
   ac_save_CPPFLAGS="$CPPFLAGS"
 
   ac_save_CPPFLAGS="$CPPFLAGS"
-  if test \! -z "$includedir" ; then 
+  if test \! -z "$includedir" ; then
     CPPFLAGS="$CPPFLAGS -I$includedir"
   fi
   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
     CPPFLAGS="$CPPFLAGS -I$includedir"
   fi
   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
-  cat > conftest.$ac_ext <<EOF
-#line 5603 "configure"
-#include "confdefs.h"
+  CPPFLAGS=`eval eval eval eval eval eval eval eval eval echo $CPPFLAGS`
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 #include <X11/XHPlib.h>
 #include <X11/XHPlib.h>
-EOF
+
+_ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  egrep "XHPDisableReset" >/dev/null 2>&1; then
-  rm -rf conftest*
-  cat >> confdefs.h <<\EOF
-#define HAVE_XHPDISABLERESET 1
-EOF
+  $EGREP "XHPDisableReset" >/dev/null 2>&1; then :
+  $as_echo "#define HAVE_XHPDISABLERESET 1" >>confdefs.h
 
                    SAVER_LIBS="-lXhp11 $SAVER_LIBS"
 
                    SAVER_LIBS="-lXhp11 $SAVER_LIBS"
+                   { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
 fi
 fi
-rm -f conftest*
+rm -rf conftest*
 
   CPPFLAGS="$ac_save_CPPFLAGS"
 
 
   CPPFLAGS="$ac_save_CPPFLAGS"
 
@@ -5614,10 +9370,10 @@ rm -f conftest*
 
 have_proc_interrupts=no
 with_proc_interrupts_req=unspecified
 
 have_proc_interrupts=no
 with_proc_interrupts_req=unspecified
-# Check whether --with-proc-interrupts or --without-proc-interrupts was given.
-if test "${with_proc_interrupts+set}" = set; then
-  withval="$with_proc_interrupts"
-  with_proc_interrupts="$withval"; with_proc_interrupts_req="$withval"
+
+# Check whether --with-proc-interrupts was given.
+if test "${with_proc_interrupts+set}" = set; then :
+  withval=$with_proc_interrupts; with_proc_interrupts="$withval"; with_proc_interrupts_req="$withval"
 else
   with_proc_interrupts=yes
 fi
 else
   with_proc_interrupts=yes
 fi
@@ -5625,25 +9381,31 @@ fi
 
 if test "$with_proc_interrupts" = yes; then
 
 
 if test "$with_proc_interrupts" = yes; then
 
-   echo $ac_n "checking whether /proc/interrupts contains keyboard data""... $ac_c" 1>&6
-echo "configure:5641: checking whether /proc/interrupts contains keyboard data" >&5
-if eval "test \"`echo '$''{'ac_cv_have_proc_interrupts'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+  # Note that we may be building in an environment (e.g. Debian buildd chroot)
+  # without a proper /proc filesystem. If /proc/interrupts exists, then we'll
+  # check that it has the bits we need, but otherwise we'll just go on faith.
+  #
+  have_proc_interrupts=yes
+
+  if test -f /proc/interrupts; then
+   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether /proc/interrupts contains keyboard data" >&5
+$as_echo_n "checking whether /proc/interrupts contains keyboard data... " >&6; }
+if ${ac_cv_have_proc_interrupts+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
   ac_cv_have_proc_interrupts=no
 else
   ac_cv_have_proc_interrupts=no
-     if grep keyboard /proc/interrupts >/dev/null 2>&1 ; then
+     if grep 'keyboard\|i8042' /proc/interrupts >/dev/null 2>&1 ; then
        ac_cv_have_proc_interrupts=yes
      fi
        ac_cv_have_proc_interrupts=yes
      fi
-    
-fi
 
 
-echo "$ac_t""$ac_cv_have_proc_interrupts" 1>&6
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_proc_interrupts" >&5
+$as_echo "$ac_cv_have_proc_interrupts" >&6; }
    have_proc_interrupts=$ac_cv_have_proc_interrupts
    have_proc_interrupts=$ac_cv_have_proc_interrupts
+  fi
 
   if test "$have_proc_interrupts" = yes; then
 
   if test "$have_proc_interrupts" = yes; then
-    cat >> confdefs.h <<\EOF
-#define HAVE_PROC_INTERRUPTS 1
-EOF
+    $as_echo "#define HAVE_PROC_INTERRUPTS 1" >>confdefs.h
 
   fi
 
 
   fi
 
@@ -5659,20 +9421,24 @@ fi
 #
 ###############################################################################
 
 #
 ###############################################################################
 
-# Check whether --enable-locking or --disable-locking was given.
-if test "${enable_locking+set}" = set; then
-  enableval="$enable_locking"
-  enable_locking="$enableval"
+# Check whether --enable-locking was given.
+if test "${enable_locking+set}" = set; then :
+  enableval=$enable_locking; enable_locking="$enableval"
 else
 else
-  enable_locking=yes
+  if test "$ac_macosx" = yes; then
+    # We can't lock on MacOS X, so default to not compiling in support for it.
+    # But allow --enable-locking to override that, so I can debug Linux locking
+    # under MacOS X11.
+    enable_locking=no
+   else
+    enable_locking=yes
+   fi
 fi
 
 if test "$enable_locking" = yes; then
   true
 elif test "$enable_locking" = no; then
 fi
 
 if test "$enable_locking" = yes; then
   true
 elif test "$enable_locking" = no; then
-  cat >> confdefs.h <<\EOF
-#define NO_LOCKING 1
-EOF
+  $as_echo "#define NO_LOCKING 1" >>confdefs.h
 
 else
   echo "error: must be yes or no: --enable-locking=$enable_locking"
 
 else
   echo "error: must be yes or no: --enable-locking=$enable_locking"
@@ -5680,47 +9446,26 @@ else
 fi
 
 
 fi
 
 
-
 ###############################################################################
 #
 ###############################################################################
 #
-#       The --enable-vt-locking option
+#       Whether to allow root password to unblank.
 #
 ###############################################################################
 #
 ###############################################################################
+# Check whether --enable-root-passwd was given.
+if test "${enable_root_passwd+set}" = set; then :
+  enableval=$enable_root_passwd; enable_root_passwd="$enableval"
+else
+  enable_root_passwd=yes
+fi
 
 
-#ac_vt_lockswitch=no
-#AC_ARG_ENABLE(vt-locking,[
-#  --enable-vt-locking     Compile in support for locking Virtual Terminals.
-#                          This is the default if the system supports it, and
-#                          if locking support is included (--enable-locking.)
-#  --disable-vt-locking    Do not allow locking of VTs, even if locking is
-#                          enabled.],
-#  [enable_vt_locking="$enableval"],[enable_vt_locking=yes])
-#if test "$enable_vt_locking" = yes; then
-#
-#  AC_CACHE_CHECK([for the VT_LOCKSWITCH ioctl], ac_cv_vt_lockswitch,
-#   [AC_TRY_COMPILE([#include <fcntl.h>
-#                   #include <sys/ioctl.h>
-#                   #include <sys/vt.h>],
-#                  [int x = VT_LOCKSWITCH; int y = VT_UNLOCKSWITCH;],
-#                  [ac_cv_vt_lockswitch=yes],
-#                  [ac_cv_vt_lockswitch=no])])
-#  ac_vt_lockswitch=$ac_cv_vt_lockswitch
-#
-#elif test "$enable_vt_locking" = no; then
-#  true
-#else
-#  echo "error: must be yes or no: --enable-vt-locking=$enable_vt_locking"
-#  exit 1
-#fi
-#
-#if test "$ac_vt_lockswitch" = yes; then
-#  AC_DEFINE(HAVE_VT_LOCKSWITCH)
-#  # the VT_LOCKSWITCH ioctl can only be used when running as root.
-#  # #### but it doesn't work yet, so don't worry about that for now.
-##  need_setuid=yes
-#fi
-
+if test "$enable_root_passwd" = yes; then
+  $as_echo "#define ALLOW_ROOT_PASSWD 1" >>confdefs.h
 
 
+  true
+elif test "$enable_root_passwd" != no; then
+  echo "error: must be yes or no: --enable-root-passwd=$enable_root_passwd"
+  exit 1
+fi
 
 ###############################################################################
 #
 
 ###############################################################################
 #
@@ -5743,39 +9488,68 @@ esac
 have_pam=no
 with_pam_req=unspecified
 
 have_pam=no
 with_pam_req=unspecified
 
-# Check whether --with-pam or --without-pam was given.
-if test "${with_pam+set}" = set; then
-  withval="$with_pam"
-  with_pam="$withval"; with_pam_req="$withval"
+
+# Check whether --with-pam was given.
+if test "${with_pam+set}" = set; then :
+  withval=$with_pam; with_pam="$withval"; with_pam_req="$withval"
 else
   with_pam=$with_pam_default
 fi
 
 
 
 else
   with_pam=$with_pam_default
 fi
 
 
 
+# Check whether --with-pam_service_name was given.
+if test "${with_pam_service_name+set}" = set; then :
+  withval=$with_pam_service_name; pam_service_name="$withval"
+else
+  pam_service_name="xscreensaver"
+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
+  $as_echo "#define PAM_CHECK_ACCOUNT_TYPE 1" >>confdefs.h
+
+  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) ;;
     no)  ;;
 
     /*)
    case "$with_pam" in
     yes) ;;
     no)  ;;
 
     /*)
-     echo $ac_n "checking for PAM headers""... $ac_c" 1>&6
-echo "configure:5774: checking for PAM headers" >&5
+     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for PAM headers" >&5
+$as_echo_n "checking for PAM headers... " >&6; }
      d=$with_pam/include
      if test -d $d; then
        X_CFLAGS="-I$d $X_CFLAGS"
      d=$with_pam/include
      if test -d $d; then
        X_CFLAGS="-I$d $X_CFLAGS"
-       echo "$ac_t""$d" 1>&6
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $d" >&5
+$as_echo "$d" >&6; }
      else
      else
-       echo "$ac_t""not found ($d: no such directory)" 1>&6
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found ($d: no such directory)" >&5
+$as_echo "not found ($d: no such directory)" >&6; }
      fi
 
      fi
 
-     echo $ac_n "checking for PAM libs""... $ac_c" 1>&6
-echo "configure:5784: checking for PAM libs" >&5
+     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for PAM libs" >&5
+$as_echo_n "checking for PAM libs... " >&6; }
      d=$with_pam/lib
      if test -d $d; then
        X_LIBS="-L$d $X_LIBS"
      d=$with_pam/lib
      if test -d $d; then
        X_LIBS="-L$d $X_LIBS"
-       echo "$ac_t""$d" 1>&6
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $d" >&5
+$as_echo "$d" >&6; }
      else
      else
-       echo "$ac_t""not found ($d: no such directory)" 1>&6
+       { $as_echo "$as_me:${as_lineno-$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".
      fi
 
      # replace the directory string with "yes".
@@ -5791,154 +9565,306 @@ echo "configure:5784: checking for PAM libs" >&5
      exit 1
      ;;
    esac
      exit 1
      ;;
    esac
-  
+
 
 if test "$enable_locking" = yes -a "$with_pam" = yes; then
 
 if test "$enable_locking" = yes -a "$with_pam" = yes; then
-  echo $ac_n "checking for PAM""... $ac_c" 1>&6
-echo "configure:5810: checking for PAM" >&5
-if eval "test \"`echo '$''{'ac_cv_pam'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for PAM" >&5
+$as_echo_n "checking for PAM... " >&6; }
+if ${ac_cv_pam+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
 else
-  
+
   ac_save_CPPFLAGS="$CPPFLAGS"
   ac_save_CPPFLAGS="$CPPFLAGS"
-  if test \! -z "$includedir" ; then 
+  if test \! -z "$includedir" ; then
     CPPFLAGS="$CPPFLAGS -I$includedir"
   fi
   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
     CPPFLAGS="$CPPFLAGS -I$includedir"
   fi
   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
-  cat > conftest.$ac_ext <<EOF
-#line 5821 "configure"
-#include "confdefs.h"
+  CPPFLAGS=`eval eval eval eval eval eval eval eval eval echo $CPPFLAGS`
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 #include <security/pam_appl.h>
 #include <security/pam_appl.h>
-int main() {
+int
+main ()
+{
 
 
-; return 0; }
-EOF
-if { (eval echo configure:5828: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
-  rm -rf conftest*
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
   ac_cv_pam=yes
 else
   ac_cv_pam=yes
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
   ac_cv_pam=no
 fi
   ac_cv_pam=no
 fi
-rm -f conftest*
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
   CPPFLAGS="$ac_save_CPPFLAGS"
 fi
   CPPFLAGS="$ac_save_CPPFLAGS"
 fi
-
-echo "$ac_t""$ac_cv_pam" 1>&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_pam" >&5
+$as_echo "$ac_cv_pam" >&6; }
   if test "$ac_cv_pam" = yes ; then
     have_pam=yes
   if test "$ac_cv_pam" = yes ; then
     have_pam=yes
-    cat >> confdefs.h <<\EOF
-#define HAVE_PAM 1
-EOF
+    $as_echo "#define HAVE_PAM 1" >>confdefs.h
+
+    cat >>confdefs.h <<_ACEOF
+#define PAM_SERVICE_NAME "$pam_service_name"
+_ACEOF
+
 
     PASSWD_LIBS="${PASSWD_LIBS} -lpam"
 
     # libpam typically requires dlopen and dlsym.  On FreeBSD,
     # those are in libc.  On Linux and Solaris, they're in libdl.
 
     PASSWD_LIBS="${PASSWD_LIBS} -lpam"
 
     # libpam typically requires dlopen and dlsym.  On FreeBSD,
     # those are in libc.  On Linux and Solaris, they're in libdl.
-    echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
-echo "configure:5853: checking for dlopen in -ldl" >&5
-ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5
+$as_echo_n "checking for dlopen in -ldl... " >&6; }
+if ${ac_cv_lib_dl_dlopen+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
 else
-  ac_save_LIBS="$LIBS"
+  ac_check_lib_save_LIBS=$LIBS
 LIBS="-ldl  $LIBS"
 LIBS="-ldl  $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 5861 "configure"
-#include "confdefs.h"
-/* Override any gcc2 internal prototype to avoid an error.  */
-/* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char dlopen();
-
-int main() {
-dlopen()
-; return 0; }
-EOF
-if { (eval echo configure:5872: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=yes"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* 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 dlopen ();
+int
+main ()
+{
+return dlopen ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_dl_dlopen=yes
 else
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=no"
+  ac_cv_lib_dl_dlopen=no
 fi
 fi
-rm -f conftest*
-LIBS="$ac_save_LIBS"
-
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
 fi
 fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5
+$as_echo "$ac_cv_lib_dl_dlopen" >&6; }
+if test "x$ac_cv_lib_dl_dlopen" = xyes; then :
   PASSWD_LIBS="${PASSWD_LIBS} -ldl"
   PASSWD_LIBS="${PASSWD_LIBS} -ldl"
+fi
+
+
+    # On Linux, sigtimedwait() is in libc; on Solaris, it's in librt.
+    have_timedwait=no
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sigtimedwait in -lc" >&5
+$as_echo_n "checking for sigtimedwait in -lc... " >&6; }
+if ${ac_cv_lib_c_sigtimedwait+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lc  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* 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 sigtimedwait ();
+int
+main ()
+{
+return sigtimedwait ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_c_sigtimedwait=yes
+else
+  ac_cv_lib_c_sigtimedwait=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_c_sigtimedwait" >&5
+$as_echo "$ac_cv_lib_c_sigtimedwait" >&6; }
+if test "x$ac_cv_lib_c_sigtimedwait" = xyes; then :
+  have_timedwait=yes
+                  $as_echo "#define HAVE_SIGTIMEDWAIT 1" >>confdefs.h
+
+fi
+
+    if test "$have_timedwait" = no ; then
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sigtimedwait in -lrt" >&5
+$as_echo_n "checking for sigtimedwait in -lrt... " >&6; }
+if ${ac_cv_lib_rt_sigtimedwait+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lrt  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* 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 sigtimedwait ();
+int
+main ()
+{
+return sigtimedwait ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_rt_sigtimedwait=yes
 else
 else
-  echo "$ac_t""no" 1>&6
+  ac_cv_lib_rt_sigtimedwait=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_rt_sigtimedwait" >&5
+$as_echo "$ac_cv_lib_rt_sigtimedwait" >&6; }
+if test "x$ac_cv_lib_rt_sigtimedwait" = xyes; then :
+  have_timedwait=yes
+                                      $as_echo "#define HAVE_SIGTIMEDWAIT 1" >>confdefs.h
+
+                                      PASSWD_LIBS="${PASSWD_LIBS} -lrt"
 fi
 
 fi
 
+    fi
 
 
-    echo $ac_n "checking how to call pam_strerror""... $ac_c" 1>&6
-echo "configure:5894: checking how to call pam_strerror" >&5
-    if eval "test \"`echo '$''{'ac_cv_pam_strerror_args'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to call pam_strerror" >&5
+$as_echo_n "checking how to call pam_strerror... " >&6; }
+    if ${ac_cv_pam_strerror_args+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
 else
-  cat > conftest.$ac_ext <<EOF
-#line 5899 "configure"
-#include "confdefs.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`
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 #include <stdio.h>
 #include <stdio.h>
-                      #include <stdlib.h>
-                      #include <security/pam_appl.h>
-int main() {
+                        #include <stdlib.h>
+                        #include <security/pam_appl.h>
+int
+main ()
+{
 pam_handle_t *pamh = 0;
 pam_handle_t *pamh = 0;
-                      char *s = pam_strerror(pamh, PAM_SUCCESS);
-; return 0; }
-EOF
-if { (eval echo configure:5909: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
-  rm -rf conftest*
+                        char *s = pam_strerror(pamh, PAM_SUCCESS);
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
   ac_pam_strerror_args=2
 else
   ac_pam_strerror_args=2
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  cat > conftest.$ac_ext <<EOF
-#line 5917 "configure"
-#include "confdefs.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`
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 #include <stdio.h>
 #include <stdio.h>
-                                      #include <stdlib.h>
-                                      #include <security/pam_appl.h>
-int main() {
+                                          #include <stdlib.h>
+                                          #include <security/pam_appl.h>
+int
+main ()
+{
 char *s =
 char *s =
-                                       pam_strerror(PAM_SUCCESS);
-; return 0; }
-EOF
-if { (eval echo configure:5927: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
-  rm -rf conftest*
+                                           pam_strerror(PAM_SUCCESS);
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
   ac_pam_strerror_args=1
 else
   ac_pam_strerror_args=1
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
   ac_pam_strerror_args=0
 fi
   ac_pam_strerror_args=0
 fi
-rm -f conftest*
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+  CPPFLAGS="$ac_save_CPPFLAGS"
 fi
 fi
-rm -f conftest*
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+  CPPFLAGS="$ac_save_CPPFLAGS"
       ac_cv_pam_strerror_args=$ac_pam_strerror_args
 fi
 
     ac_pam_strerror_args=$ac_cv_pam_strerror_args
     if test "$ac_pam_strerror_args" = 1 ; then
       ac_cv_pam_strerror_args=$ac_pam_strerror_args
 fi
 
     ac_pam_strerror_args=$ac_cv_pam_strerror_args
     if test "$ac_pam_strerror_args" = 1 ; then
-      echo "$ac_t""one argument" 1>&6
+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: one argument" >&5
+$as_echo "one argument" >&6; }
     elif test "$ac_pam_strerror_args" = 2 ; then
     elif test "$ac_pam_strerror_args" = 2 ; then
-      cat >> confdefs.h <<\EOF
-#define PAM_STRERROR_TWO_ARGS 1
-EOF
+      $as_echo "#define PAM_STRERROR_TWO_ARGS 1" >>confdefs.h
 
 
-      echo "$ac_t""two arguments" 1>&6
+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: two arguments" >&5
+$as_echo "two arguments" >&6; }
     else
     else
-      echo "$ac_t""unknown" 1>&6
+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: unknown" >&5
+$as_echo "unknown" >&6; }
     fi
     fi
+
+# Check pam_fail_delay
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking pam_fail_delay in -lpam" >&5
+$as_echo_n "checking pam_fail_delay in -lpam... " >&6; }
+    if ${ac_cv_pam_fail_delay+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_save_LDFLAGS="$LDFLAGS"
+      LDFLAGS="-lpam"
+      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <security/pam_appl.h>
+int
+main ()
+{
+pam_handle_t *pamh = 0;
+                  unsigned int usec = 1;
+                  int status = pam_fail_delay (pamh, usec);
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_pam_fail_delay=yes
+else
+  ac_pam_fail_delay=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+      ac_cv_pam_fail_delay=$ac_pam_fail_delay,
+      LDFLAGS=$ac_save_LDFLAGS
+fi
+
+
+      if test "$ac_pam_fail_delay" = yes ; then
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+        $as_echo "#define HAVE_PAM_FAIL_DELAY 1" >>confdefs.h
+
+      else
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+      fi
+
   fi
 fi
 
   fi
 fi
 
@@ -5953,10 +9879,10 @@ have_kerberos=no
 have_kerberos5=no
 with_kerberos_req=unspecified
 
 have_kerberos5=no
 with_kerberos_req=unspecified
 
-# Check whether --with-kerberos or --without-kerberos was given.
-if test "${with_kerberos+set}" = set; then
-  withval="$with_kerberos"
-  with_kerberos="$withval"; with_kerberos_req="$withval"
+
+# Check whether --with-kerberos was given.
+if test "${with_kerberos+set}" = set; then :
+  withval=$with_kerberos; with_kerberos="$withval"; with_kerberos_req="$withval"
 else
   with_kerberos=yes
 fi
 else
   with_kerberos=yes
 fi
@@ -5968,24 +9894,28 @@ fi
     no)  ;;
 
     /*)
     no)  ;;
 
     /*)
-     echo $ac_n "checking for Kerberos headers""... $ac_c" 1>&6
-echo "configure:5984: checking for Kerberos headers" >&5
+     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Kerberos headers" >&5
+$as_echo_n "checking for Kerberos headers... " >&6; }
      d=$with_kerberos/include
      if test -d $d; then
        X_CFLAGS="-I$d $X_CFLAGS"
      d=$with_kerberos/include
      if test -d $d; then
        X_CFLAGS="-I$d $X_CFLAGS"
-       echo "$ac_t""$d" 1>&6
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $d" >&5
+$as_echo "$d" >&6; }
      else
      else
-       echo "$ac_t""not found ($d: no such directory)" 1>&6
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found ($d: no such directory)" >&5
+$as_echo "not found ($d: no such directory)" >&6; }
      fi
 
      fi
 
-     echo $ac_n "checking for Kerberos libs""... $ac_c" 1>&6
-echo "configure:5994: checking for Kerberos libs" >&5
+     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Kerberos libs" >&5
+$as_echo_n "checking for Kerberos libs... " >&6; }
      d=$with_kerberos/lib
      if test -d $d; then
        X_LIBS="-L$d $X_LIBS"
      d=$with_kerberos/lib
      if test -d $d; then
        X_LIBS="-L$d $X_LIBS"
-       echo "$ac_t""$d" 1>&6
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $d" >&5
+$as_echo "$d" >&6; }
      else
      else
-       echo "$ac_t""not found ($d: no such directory)" 1>&6
+       { $as_echo "$as_me:${as_lineno-$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".
      fi
 
      # replace the directory string with "yes".
@@ -6001,193 +9931,296 @@ echo "configure:5994: checking for Kerberos libs" >&5
      exit 1
      ;;
    esac
      exit 1
      ;;
    esac
-  
+
 
 if test "$enable_locking" = yes -a "$with_kerberos" = yes; then
 
 if test "$enable_locking" = yes -a "$with_kerberos" = yes; then
-  echo $ac_n "checking for Kerberos 4""... $ac_c" 1>&6
-echo "configure:6020: checking for Kerberos 4" >&5
-if eval "test \"`echo '$''{'ac_cv_kerberos'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Kerberos 4" >&5
+$as_echo_n "checking for Kerberos 4... " >&6; }
+if ${ac_cv_kerberos+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
 else
-  
+
   ac_save_CPPFLAGS="$CPPFLAGS"
   ac_save_CPPFLAGS="$CPPFLAGS"
-  if test \! -z "$includedir" ; then 
+  if test \! -z "$includedir" ; then
     CPPFLAGS="$CPPFLAGS -I$includedir"
   fi
   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
     CPPFLAGS="$CPPFLAGS -I$includedir"
   fi
   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
-  cat > conftest.$ac_ext <<EOF
-#line 6031 "configure"
-#include "confdefs.h"
+  CPPFLAGS=`eval eval eval eval eval eval eval eval eval echo $CPPFLAGS`
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 #include <krb.h>
 #include <krb.h>
-int main() {
+int
+main ()
+{
 
 
-; return 0; }
-EOF
-if { (eval echo configure:6038: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
-  rm -rf conftest*
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
   ac_cv_kerberos=yes
 else
   ac_cv_kerberos=yes
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
   ac_cv_kerberos=no
 fi
   ac_cv_kerberos=no
 fi
-rm -f conftest*
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
   CPPFLAGS="$ac_save_CPPFLAGS"
 fi
   CPPFLAGS="$ac_save_CPPFLAGS"
 fi
-
-echo "$ac_t""$ac_cv_kerberos" 1>&6
-  echo $ac_n "checking for Kerberos 5""... $ac_c" 1>&6
-echo "configure:6053: checking for Kerberos 5" >&5
-if eval "test \"`echo '$''{'ac_cv_kerberos5'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_kerberos" >&5
+$as_echo "$ac_cv_kerberos" >&6; }
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Kerberos 5" >&5
+$as_echo_n "checking for Kerberos 5... " >&6; }
+if ${ac_cv_kerberos5+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
 else
-  
+
   ac_save_CPPFLAGS="$CPPFLAGS"
   ac_save_CPPFLAGS="$CPPFLAGS"
-  if test \! -z "$includedir" ; then 
+  if test \! -z "$includedir" ; then
     CPPFLAGS="$CPPFLAGS -I$includedir"
   fi
   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
     CPPFLAGS="$CPPFLAGS -I$includedir"
   fi
   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
-  cat > conftest.$ac_ext <<EOF
-#line 6064 "configure"
-#include "confdefs.h"
+  CPPFLAGS=`eval eval eval eval eval eval eval eval eval echo $CPPFLAGS`
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 #include <kerberosIV/krb.h>
 #include <kerberosIV/krb.h>
-int main() {
+int
+main ()
+{
 
 
-; return 0; }
-EOF
-if { (eval echo configure:6071: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
-  rm -rf conftest*
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
   ac_cv_kerberos5=yes
 else
   ac_cv_kerberos5=yes
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
   ac_cv_kerberos5=no
 fi
   ac_cv_kerberos5=no
 fi
-rm -f conftest*
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
   CPPFLAGS="$ac_save_CPPFLAGS"
 fi
   CPPFLAGS="$ac_save_CPPFLAGS"
 fi
-
-echo "$ac_t""$ac_cv_kerberos5" 1>&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_kerberos5" >&5
+$as_echo "$ac_cv_kerberos5" >&6; }
 
   if test "$ac_cv_kerberos" = yes ; then
     have_kerberos=yes
 
   if test "$ac_cv_kerberos" = yes ; then
     have_kerberos=yes
-    cat >> confdefs.h <<\EOF
-#define HAVE_KERBEROS 1
-EOF
+    $as_echo "#define HAVE_KERBEROS 1" >>confdefs.h
 
   fi
 
   if test "$ac_cv_kerberos5" = yes ; then
 
   fi
 
   if test "$ac_cv_kerberos5" = yes ; then
-    have_kerberos=yes
-    have_kerberos5=yes
-    cat >> confdefs.h <<\EOF
-#define HAVE_KERBEROS 1
-EOF
 
 
-    cat >> confdefs.h <<\EOF
-#define HAVE_KERBEROS5 1
-EOF
+    # Andrew Snare <ajs@pigpond.com> wrote:
+    #
+    # You were assuming that if kerberosV (krb5) was found, then kerberosIV
+    # (krb4) was also available.  This turns out not to be the case with
+    # mit-krb-1.2.7; apparently backwards-compatibility with KerberosIV
+    # is optional.
+    #
+    # So, disable kerberosV support if libkrb4 can't be found.
+    # This is not the best solution, but it makes the compile not fail.
+    #
+
+  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:${as_lineno-$LINENO}: checking for krb_get_tf_realm in -lkrb4" >&5
+$as_echo_n "checking for krb_get_tf_realm in -lkrb4... " >&6; }
+if ${ac_cv_lib_krb4_krb_get_tf_realm+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lkrb4  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* 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 krb_get_tf_realm ();
+int
+main ()
+{
+return krb_get_tf_realm ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_krb4_krb_get_tf_realm=yes
+else
+  ac_cv_lib_krb4_krb_get_tf_realm=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_krb4_krb_get_tf_realm" >&5
+$as_echo "$ac_cv_lib_krb4_krb_get_tf_realm" >&6; }
+if test "x$ac_cv_lib_krb4_krb_get_tf_realm" = xyes; then :
+  have_kerberos=yes
+else
+  have_kerberos=no
+fi
+
+  CPPFLAGS="$ac_save_CPPFLAGS"
+  LDFLAGS="$ac_save_LDFLAGS"
+#  LIBS="$ac_save_LIBS"
+
+    if test "$have_kerberos" = yes ; then
+      have_kerberos5=yes
+      $as_echo "#define HAVE_KERBEROS 1" >>confdefs.h
+
+      $as_echo "#define HAVE_KERBEROS5 1" >>confdefs.h
+
+    else
+      have_kerberos5=no
+      { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Cannot find compat lib (libkrb4) needed to use Kerberos 5" >&5
+$as_echo "$as_me: WARNING: Cannot find compat lib (libkrb4) needed to use Kerberos 5" >&2;}
+    fi
 
   fi
 
   if test "$have_kerberos5" = yes ; then
     # from Matt Knopp <mhat@infocalypse.netlag.com>
     # (who got it from amu@mit.edu)
 
   fi
 
   if test "$have_kerberos5" = yes ; then
     # from Matt Knopp <mhat@infocalypse.netlag.com>
     # (who got it from amu@mit.edu)
-    PASSWD_LIBS="$PASSWD_LIBS -lkrb4 -ldes425 -lkrb5 -lk5crypto -lcrypt -lcom_err"
-  elif test "$have_kerberos" = yes ; then
-    # from Tim Showalter <tjs@psaux.com> for FreeBSD 4.2
-    PASSWD_LIBS="$PASSWD_LIBS -lkrb -ldes -lcom_err"
+
+    PASSWD_LIBS="$PASSWD_LIBS -lkrb4 -ldes425 -lkrb5 -lk5crypto -lcom_err"
+
+    # jwz: MacOS X uses -lkrb5, but not -lcrypt
+
+  ac_save_CPPFLAGS="$CPPFLAGS"
+  ac_save_LDFLAGS="$LDFLAGS"
+#  ac_save_LIBS="$LIBS"
+
+  if test \! -z "$includedir" ; then
+    CPPFLAGS="$CPPFLAGS -I$includedir"
   fi
   fi
+  # note: $X_CFLAGS includes $x_includes
+  CPPFLAGS="$CPPFLAGS $X_CFLAGS"
 
 
-  if test "$have_kerberos" = yes ; then
-    echo $ac_n "checking for res_search""... $ac_c" 1>&6
-echo "configure:6118: checking for res_search" >&5
-if eval "test \"`echo '$''{'ac_cv_func_res_search'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  cat > conftest.$ac_ext <<EOF
-#line 6123 "configure"
-#include "confdefs.h"
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char res_search(); below.  */
-#include <assert.h>
-/* Override any gcc2 internal prototype to avoid an error.  */
-/* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char res_search();
+  if test \! -z "$libdir" ; then
+    LDFLAGS="$LDFLAGS -L$libdir"
+  fi
+  # note: $X_LIBS includes $x_libraries
+  LDFLAGS="$LDFLAGS $X_LIBS $X_EXTRA_LIBS"
 
 
-int main() {
+  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:${as_lineno-$LINENO}: checking for crypt in -lcrypt" >&5
+$as_echo_n "checking for crypt in -lcrypt... " >&6; }
+if ${ac_cv_lib_crypt_crypt+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lcrypt  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
 
-/* The GNU C library defines this for functions which it implements
-    to always fail with ENOSYS.  Some functions are actually named
-    something starting with __ and the normal name is an alias.  */
-#if defined (__stub_res_search) || defined (__stub___res_search)
-choke me
-#else
-res_search();
+/* 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
 #endif
-
-; return 0; }
-EOF
-if { (eval echo configure:6146: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  eval "ac_cv_func_res_search=yes"
+char crypt ();
+int
+main ()
+{
+return crypt ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_crypt_crypt=yes
 else
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_func_res_search=no"
+  ac_cv_lib_crypt_crypt=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
 fi
 fi
-rm -f conftest*
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypt_crypt" >&5
+$as_echo "$ac_cv_lib_crypt_crypt" >&6; }
+if test "x$ac_cv_lib_crypt_crypt" = xyes; then :
+  PASSWD_LIBS="$PASSWD_LIBS -lcrypt"
 fi
 
 fi
 
-if eval "test \"`echo '$ac_cv_func_'res_search`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-  :
+  CPPFLAGS="$ac_save_CPPFLAGS"
+  LDFLAGS="$ac_save_LDFLAGS"
+#  LIBS="$ac_save_LIBS"
+
+
+  elif test "$have_kerberos" = yes ; then
+    # from Tim Showalter <tjs@psaux.com> for FreeBSD 4.2
+    PASSWD_LIBS="$PASSWD_LIBS -lkrb -ldes -lcom_err"
+  fi
+
+  if test "$have_kerberos" = yes ; then
+    ac_fn_c_check_func "$LINENO" "res_search" "ac_cv_func_res_search"
+if test "x$ac_cv_func_res_search" = xyes; then :
+
 else
 else
-  echo "$ac_t""no" 1>&6
-echo $ac_n "checking for res_search in -lresolv""... $ac_c" 1>&6
-echo "configure:6164: checking for res_search in -lresolv" >&5
-ac_lib_var=`echo resolv'_'res_search | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for res_search in -lresolv" >&5
+$as_echo_n "checking for res_search in -lresolv... " >&6; }
+if ${ac_cv_lib_resolv_res_search+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
 else
-  ac_save_LIBS="$LIBS"
+  ac_check_lib_save_LIBS=$LIBS
 LIBS="-lresolv  $LIBS"
 LIBS="-lresolv  $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 6172 "configure"
-#include "confdefs.h"
-/* Override any gcc2 internal prototype to avoid an error.  */
-/* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char res_search();
-
-int main() {
-res_search()
-; return 0; }
-EOF
-if { (eval echo configure:6183: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=yes"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* 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 res_search ();
+int
+main ()
+{
+return res_search ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_resolv_res_search=yes
 else
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=no"
+  ac_cv_lib_resolv_res_search=no
 fi
 fi
-rm -f conftest*
-LIBS="$ac_save_LIBS"
-
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
 fi
 fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_resolv_res_search" >&5
+$as_echo "$ac_cv_lib_resolv_res_search" >&6; }
+if test "x$ac_cv_lib_resolv_res_search" = xyes; then :
   PASSWD_LIBS="${PASSWD_LIBS} -lresolv"
 else
   PASSWD_LIBS="${PASSWD_LIBS} -lresolv"
 else
-  echo "$ac_t""no" 1>&6
-echo "configure: warning: Can't find DNS resolver libraries needed for Kerberos" 1>&2
-      
+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Can't find DNS resolver libraries needed for Kerberos" >&5
+$as_echo "$as_me: WARNING: Can't find DNS resolver libraries needed for Kerberos" >&2;}
+
 fi
 
 fi
 fi
 
 fi
@@ -6207,10 +10240,10 @@ need_setuid=no
 have_shadow=no
 with_shadow_req=unspecified
 
 have_shadow=no
 with_shadow_req=unspecified
 
-# Check whether --with-shadow or --without-shadow was given.
-if test "${with_shadow+set}" = set; then
-  withval="$with_shadow"
-  with_shadow="$withval"; with_shadow_req="$withval"
+
+# Check whether --with-shadow was given.
+if test "${with_shadow+set}" = set; then :
+  withval=$with_shadow; with_shadow="$withval"; with_shadow_req="$withval"
 else
   with_shadow=yes
 fi
 else
   with_shadow=yes
 fi
     no)  ;;
 
     /*)
     no)  ;;
 
     /*)
-     echo $ac_n "checking for shadow password headers""... $ac_c" 1>&6
-echo "configure:6238: checking for shadow password headers" >&5
+     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shadow password headers" >&5
+$as_echo_n "checking for shadow password headers... " >&6; }
      d=$with_shadow/include
      if test -d $d; then
        X_CFLAGS="-I$d $X_CFLAGS"
      d=$with_shadow/include
      if test -d $d; then
        X_CFLAGS="-I$d $X_CFLAGS"
-       echo "$ac_t""$d" 1>&6
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $d" >&5
+$as_echo "$d" >&6; }
      else
      else
-       echo "$ac_t""not found ($d: no such directory)" 1>&6
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found ($d: no such directory)" >&5
+$as_echo "not found ($d: no such directory)" >&6; }
      fi
 
      fi
 
-     echo $ac_n "checking for shadow password libs""... $ac_c" 1>&6
-echo "configure:6248: checking for shadow password libs" >&5
+     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shadow password libs" >&5
+$as_echo_n "checking for shadow password libs... " >&6; }
      d=$with_shadow/lib
      if test -d $d; then
        X_LIBS="-L$d $X_LIBS"
      d=$with_shadow/lib
      if test -d $d; then
        X_LIBS="-L$d $X_LIBS"
-       echo "$ac_t""$d" 1>&6
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $d" >&5
+$as_echo "$d" >&6; }
      else
      else
-       echo "$ac_t""not found ($d: no such directory)" 1>&6
+       { $as_echo "$as_me:${as_lineno-$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".
      fi
 
      # replace the directory string with "yes".
@@ -6255,7 +10292,7 @@ echo "configure:6248: checking for shadow password libs" >&5
      exit 1
      ;;
    esac
      exit 1
      ;;
    esac
-  
+
 
 if test "$enable_locking" = no ; then
   with_shadow_req=no
 
 if test "$enable_locking" = no ; then
   with_shadow_req=no
 ###############################################################################
 
 if test "$with_shadow" = yes ; then
 ###############################################################################
 
 if test "$with_shadow" = yes ; then
-  echo $ac_n "checking for Sun-style shadow passwords""... $ac_c" 1>&6
-echo "configure:6286: checking for Sun-style shadow passwords" >&5
-if eval "test \"`echo '$''{'ac_cv_sun_adjunct'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Sun-style shadow passwords" >&5
+$as_echo_n "checking for Sun-style shadow passwords... " >&6; }
+if ${ac_cv_sun_adjunct+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
 else
-  
+
   ac_save_CPPFLAGS="$CPPFLAGS"
   ac_save_CPPFLAGS="$CPPFLAGS"
-  if test \! -z "$includedir" ; then 
+  if test \! -z "$includedir" ; then
     CPPFLAGS="$CPPFLAGS -I$includedir"
   fi
   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
     CPPFLAGS="$CPPFLAGS -I$includedir"
   fi
   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
-  cat > conftest.$ac_ext <<EOF
-#line 6297 "configure"
-#include "confdefs.h"
+  CPPFLAGS=`eval eval eval eval eval eval eval eval eval echo $CPPFLAGS`
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 #include <stdlib.h>
                                     #include <unistd.h>
                                     #include <sys/types.h>
                                     #include <sys/label.h>
                                     #include <sys/audit.h>
                                     #include <pwdadj.h>
 #include <stdlib.h>
                                     #include <unistd.h>
                                     #include <sys/types.h>
                                     #include <sys/label.h>
                                     #include <sys/audit.h>
                                     #include <pwdadj.h>
-int main() {
+int
+main ()
+{
 struct passwd_adjunct *p = getpwanam("nobody");
                        const char *pw = p->pwa_passwd;
 struct passwd_adjunct *p = getpwanam("nobody");
                        const char *pw = p->pwa_passwd;
-; return 0; }
-EOF
-if { (eval echo configure:6310: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
-  rm -rf conftest*
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
   ac_cv_sun_adjunct=yes
 else
   ac_cv_sun_adjunct=yes
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
   ac_cv_sun_adjunct=no
 fi
   ac_cv_sun_adjunct=no
 fi
-rm -f conftest*
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
   CPPFLAGS="$ac_save_CPPFLAGS"
 fi
   CPPFLAGS="$ac_save_CPPFLAGS"
 fi
-
-echo "$ac_t""$ac_cv_sun_adjunct" 1>&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sun_adjunct" >&5
+$as_echo "$ac_cv_sun_adjunct" >&6; }
   if test "$ac_cv_sun_adjunct" = yes; then
     have_shadow_adjunct=yes
     have_shadow=yes
   if test "$ac_cv_sun_adjunct" = yes; then
     have_shadow_adjunct=yes
     have_shadow=yes
 ###############################################################################
 
 if test "$with_shadow" = yes ; then
 ###############################################################################
 
 if test "$with_shadow" = yes ; then
-  echo $ac_n "checking for DEC-style shadow passwords""... $ac_c" 1>&6
-echo "configure:6340: checking for DEC-style shadow passwords" >&5
-if eval "test \"`echo '$''{'ac_cv_enhanced_passwd'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for DEC-style shadow passwords" >&5
+$as_echo_n "checking for DEC-style shadow passwords... " >&6; }
+if ${ac_cv_enhanced_passwd+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
 else
-  
+
   ac_save_CPPFLAGS="$CPPFLAGS"
   ac_save_CPPFLAGS="$CPPFLAGS"
-  if test \! -z "$includedir" ; then 
+  if test \! -z "$includedir" ; then
     CPPFLAGS="$CPPFLAGS -I$includedir"
   fi
   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
     CPPFLAGS="$CPPFLAGS -I$includedir"
   fi
   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
-  cat > conftest.$ac_ext <<EOF
-#line 6351 "configure"
-#include "confdefs.h"
+  CPPFLAGS=`eval eval eval eval eval eval eval eval eval echo $CPPFLAGS`
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 #include <stdlib.h>
                                     #include <unistd.h>
                                     #include <sys/types.h>
                                     #include <pwd.h>
                                     #include <sys/security.h>
                                     #include <prot.h>
 #include <stdlib.h>
                                     #include <unistd.h>
                                     #include <sys/types.h>
                                     #include <pwd.h>
                                     #include <sys/security.h>
                                     #include <prot.h>
-int main() {
+int
+main ()
+{
 struct pr_passwd *p;
                        const char *pw;
                        set_auth_parameters(0, 0);
                        check_auth_parameters();
                        p = getprpwnam("nobody");
                        pw = p->ufld.fd_encrypt;
 struct pr_passwd *p;
                        const char *pw;
                        set_auth_parameters(0, 0);
                        check_auth_parameters();
                        p = getprpwnam("nobody");
                        pw = p->ufld.fd_encrypt;
-; return 0; }
-EOF
-if { (eval echo configure:6368: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
-  rm -rf conftest*
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
   ac_cv_enhanced_passwd=yes
 else
   ac_cv_enhanced_passwd=yes
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
   ac_cv_enhanced_passwd=no
 fi
   ac_cv_enhanced_passwd=no
 fi
-rm -f conftest*
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
   CPPFLAGS="$ac_save_CPPFLAGS"
 fi
   CPPFLAGS="$ac_save_CPPFLAGS"
 fi
-
-echo "$ac_t""$ac_cv_enhanced_passwd" 1>&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_enhanced_passwd" >&5
+$as_echo "$ac_cv_enhanced_passwd" >&6; }
   if test $ac_cv_enhanced_passwd = yes; then
     have_shadow_enhanced=yes
     have_shadow=yes
   if test $ac_cv_enhanced_passwd = yes; then
     have_shadow_enhanced=yes
     have_shadow=yes
@@ -6376,82 +10413,83 @@ echo "$ac_t""$ac_cv_enhanced_passwd" 1>&6
     # (I'm told it needs -lcurses too, but I don't understand why.)
     # But on DEC, it's in -lsecurity.
     #
     # (I'm told it needs -lcurses too, but I don't understand why.)
     # But on DEC, it's in -lsecurity.
     #
-    echo $ac_n "checking for getprpwnam in -lprot""... $ac_c" 1>&6
-echo "configure:6392: checking for getprpwnam in -lprot" >&5
-ac_lib_var=`echo prot'_'getprpwnam | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for getprpwnam in -lprot" >&5
+$as_echo_n "checking for getprpwnam in -lprot... " >&6; }
+if ${ac_cv_lib_prot_getprpwnam+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
 else
-  ac_save_LIBS="$LIBS"
+  ac_check_lib_save_LIBS=$LIBS
 LIBS="-lprot -lx $LIBS"
 LIBS="-lprot -lx $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 6400 "configure"
-#include "confdefs.h"
-/* Override any gcc2 internal prototype to avoid an error.  */
-/* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char getprpwnam();
-
-int main() {
-getprpwnam()
-; return 0; }
-EOF
-if { (eval echo configure:6411: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=yes"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* 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 getprpwnam ();
+int
+main ()
+{
+return getprpwnam ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_prot_getprpwnam=yes
 else
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=no"
+  ac_cv_lib_prot_getprpwnam=no
 fi
 fi
-rm -f conftest*
-LIBS="$ac_save_LIBS"
-
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
 fi
 fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_prot_getprpwnam" >&5
+$as_echo "$ac_cv_lib_prot_getprpwnam" >&6; }
+if test "x$ac_cv_lib_prot_getprpwnam" = xyes; then :
   PASSWD_LIBS="$PASSWD_LIBS -lprot -lcurses -lx"
 else
   PASSWD_LIBS="$PASSWD_LIBS -lprot -lcurses -lx"
 else
-  echo "$ac_t""no" 1>&6
-echo $ac_n "checking for getprpwnam in -lsecurity""... $ac_c" 1>&6
-echo "configure:6430: checking for getprpwnam in -lsecurity" >&5
-ac_lib_var=`echo security'_'getprpwnam | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for getprpwnam in -lsecurity" >&5
+$as_echo_n "checking for getprpwnam in -lsecurity... " >&6; }
+if ${ac_cv_lib_security_getprpwnam+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
 else
-  ac_save_LIBS="$LIBS"
+  ac_check_lib_save_LIBS=$LIBS
 LIBS="-lsecurity  $LIBS"
 LIBS="-lsecurity  $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 6438 "configure"
-#include "confdefs.h"
-/* Override any gcc2 internal prototype to avoid an error.  */
-/* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char getprpwnam();
-
-int main() {
-getprpwnam()
-; return 0; }
-EOF
-if { (eval echo configure:6449: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=yes"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* 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 getprpwnam ();
+int
+main ()
+{
+return getprpwnam ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_security_getprpwnam=yes
 else
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=no"
+  ac_cv_lib_security_getprpwnam=no
 fi
 fi
-rm -f conftest*
-LIBS="$ac_save_LIBS"
-
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
 fi
 fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_security_getprpwnam" >&5
+$as_echo "$ac_cv_lib_security_getprpwnam" >&6; }
+if test "x$ac_cv_lib_security_getprpwnam" = xyes; then :
   PASSWD_LIBS="$PASSWD_LIBS -lsecurity"
   PASSWD_LIBS="$PASSWD_LIBS -lsecurity"
-else
-  echo "$ac_t""no" 1>&6
 fi
 
 fi
 fi
 
 fi
 ###############################################################################
 
 if test "$with_shadow" = yes ; then
 ###############################################################################
 
 if test "$with_shadow" = yes ; then
-  echo $ac_n "checking for HP-style shadow passwords""... $ac_c" 1>&6
-echo "configure:6482: checking for HP-style shadow passwords" >&5
-if eval "test \"`echo '$''{'ac_cv_hpux_passwd'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for HP-style shadow passwords" >&5
+$as_echo_n "checking for HP-style shadow passwords... " >&6; }
+if ${ac_cv_hpux_passwd+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
 else
-  
+
   ac_save_CPPFLAGS="$CPPFLAGS"
   ac_save_CPPFLAGS="$CPPFLAGS"
-  if test \! -z "$includedir" ; then 
+  if test \! -z "$includedir" ; then
     CPPFLAGS="$CPPFLAGS -I$includedir"
   fi
   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
     CPPFLAGS="$CPPFLAGS -I$includedir"
   fi
   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
-  cat > conftest.$ac_ext <<EOF
-#line 6493 "configure"
-#include "confdefs.h"
+  CPPFLAGS=`eval eval eval eval eval eval eval eval eval echo $CPPFLAGS`
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 #include <stdlib.h>
                                     #include <unistd.h>
                                     #include <sys/types.h>
                                     #include <pwd.h>
                                     #include <hpsecurity.h>
                                     #include <prot.h>
 #include <stdlib.h>
                                     #include <unistd.h>
                                     #include <sys/types.h>
                                     #include <pwd.h>
                                     #include <hpsecurity.h>
                                     #include <prot.h>
-int main() {
+int
+main ()
+{
 struct s_passwd *p = getspwnam("nobody");
                        const char *pw = p->pw_passwd;
 struct s_passwd *p = getspwnam("nobody");
                        const char *pw = p->pw_passwd;
-; return 0; }
-EOF
-if { (eval echo configure:6506: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
-  rm -rf conftest*
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
   ac_cv_hpux_passwd=yes
 else
   ac_cv_hpux_passwd=yes
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
   ac_cv_hpux_passwd=no
 fi
   ac_cv_hpux_passwd=no
 fi
-rm -f conftest*
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
   CPPFLAGS="$ac_save_CPPFLAGS"
 fi
   CPPFLAGS="$ac_save_CPPFLAGS"
 fi
-
-echo "$ac_t""$ac_cv_hpux_passwd" 1>&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_hpux_passwd" >&5
+$as_echo "$ac_cv_hpux_passwd" >&6; }
   if test "$ac_cv_hpux_passwd" = yes; then
     have_shadow_hpux=yes
     have_shadow=yes
     need_setuid=yes
 
     # on HPUX, bigcrypt is in -lsec
   if test "$ac_cv_hpux_passwd" = yes; then
     have_shadow_hpux=yes
     have_shadow=yes
     need_setuid=yes
 
     # on HPUX, bigcrypt is in -lsec
-    echo $ac_n "checking for bigcrypt in -lsec""... $ac_c" 1>&6
-echo "configure:6527: checking for bigcrypt in -lsec" >&5
-ac_lib_var=`echo sec'_'bigcrypt | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for bigcrypt in -lsec" >&5
+$as_echo_n "checking for bigcrypt in -lsec... " >&6; }
+if ${ac_cv_lib_sec_bigcrypt+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
 else
-  ac_save_LIBS="$LIBS"
+  ac_check_lib_save_LIBS=$LIBS
 LIBS="-lsec  $LIBS"
 LIBS="-lsec  $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 6535 "configure"
-#include "confdefs.h"
-/* Override any gcc2 internal prototype to avoid an error.  */
-/* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char bigcrypt();
-
-int main() {
-bigcrypt()
-; return 0; }
-EOF
-if { (eval echo configure:6546: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=yes"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* 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 bigcrypt ();
+int
+main ()
+{
+return bigcrypt ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_sec_bigcrypt=yes
 else
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=no"
+  ac_cv_lib_sec_bigcrypt=no
 fi
 fi
-rm -f conftest*
-LIBS="$ac_save_LIBS"
-
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
 fi
 fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_sec_bigcrypt" >&5
+$as_echo "$ac_cv_lib_sec_bigcrypt" >&6; }
+if test "x$ac_cv_lib_sec_bigcrypt" = xyes; then :
   PASSWD_LIBS="$PASSWD_LIBS -lsec"
   PASSWD_LIBS="$PASSWD_LIBS -lsec"
-else
-  echo "$ac_t""no" 1>&6
 fi
 
   fi
 fi
 
   fi
 ###############################################################################
 
 if test "$with_shadow" = yes ; then
 ###############################################################################
 
 if test "$with_shadow" = yes ; then
-  echo $ac_n "checking for FreeBSD-style shadow passwords""... $ac_c" 1>&6
-echo "configure:6584: checking for FreeBSD-style shadow passwords" >&5
-if eval "test \"`echo '$''{'ac_cv_master_passwd'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for FreeBSD-style shadow passwords" >&5
+$as_echo_n "checking for FreeBSD-style shadow passwords... " >&6; }
+if ${ac_cv_master_passwd+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
   if test -f /etc/master.passwd ; then
                     ac_cv_master_passwd=yes
 else
   if test -f /etc/master.passwd ; then
                     ac_cv_master_passwd=yes
@@ -6579,8 +10617,8 @@ else
                     ac_cv_master_passwd=no
                   fi
 fi
                     ac_cv_master_passwd=no
                   fi
 fi
-
-echo "$ac_t""$ac_cv_master_passwd" 1>&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_master_passwd" >&5
+$as_echo "$ac_cv_master_passwd" >&6; }
   if test "$ac_cv_master_passwd" = yes; then
     need_setuid=yes
   fi
   if test "$ac_cv_master_passwd" = yes; then
     need_setuid=yes
   fi
 ###############################################################################
 
 if test "$with_shadow" = yes ; then
 ###############################################################################
 
 if test "$with_shadow" = yes ; then
-  echo $ac_n "checking for generic shadow passwords""... $ac_c" 1>&6
-echo "configure:6610: checking for generic shadow passwords" >&5
-if eval "test \"`echo '$''{'ac_cv_shadow'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for generic shadow passwords" >&5
+$as_echo_n "checking for generic shadow passwords... " >&6; }
+if ${ac_cv_shadow+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
 else
-  
+
   ac_save_CPPFLAGS="$CPPFLAGS"
   ac_save_CPPFLAGS="$CPPFLAGS"
-  if test \! -z "$includedir" ; then 
+  if test \! -z "$includedir" ; then
     CPPFLAGS="$CPPFLAGS -I$includedir"
   fi
   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
     CPPFLAGS="$CPPFLAGS -I$includedir"
   fi
   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
-  cat > conftest.$ac_ext <<EOF
-#line 6621 "configure"
-#include "confdefs.h"
+  CPPFLAGS=`eval eval eval eval eval eval eval eval eval echo $CPPFLAGS`
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 #include <stdlib.h>
                                     #include <unistd.h>
                                     #include <sys/types.h>
                                     #include <pwd.h>
                                     #include <shadow.h>
 #include <stdlib.h>
                                     #include <unistd.h>
                                     #include <sys/types.h>
                                     #include <pwd.h>
                                     #include <shadow.h>
-int main() {
+int
+main ()
+{
 struct spwd *p = getspnam("nobody");
                        const char *pw = p->sp_pwdp;
 struct spwd *p = getspnam("nobody");
                        const char *pw = p->sp_pwdp;
-; return 0; }
-EOF
-if { (eval echo configure:6633: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
-  rm -rf conftest*
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
   ac_cv_shadow=yes
 else
   ac_cv_shadow=yes
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
   ac_cv_shadow=no
 fi
   ac_cv_shadow=no
 fi
-rm -f conftest*
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
   CPPFLAGS="$ac_save_CPPFLAGS"
 fi
   CPPFLAGS="$ac_save_CPPFLAGS"
 fi
-
-echo "$ac_t""$ac_cv_shadow" 1>&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_shadow" >&5
+$as_echo "$ac_cv_shadow" >&6; }
   if test "$ac_cv_shadow" = yes; then
     have_shadow=yes
     need_setuid=yes
 
     # On some systems (UnixWare 2.1), getspnam() is in -lgen instead of -lc.
     have_getspnam=no
   if test "$ac_cv_shadow" = yes; then
     have_shadow=yes
     need_setuid=yes
 
     # On some systems (UnixWare 2.1), getspnam() is in -lgen instead of -lc.
     have_getspnam=no
-    echo $ac_n "checking for getspnam in -lc""... $ac_c" 1>&6
-echo "configure:6654: checking for getspnam in -lc" >&5
-ac_lib_var=`echo c'_'getspnam | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for getspnam in -lc" >&5
+$as_echo_n "checking for getspnam in -lc... " >&6; }
+if ${ac_cv_lib_c_getspnam+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
 else
-  ac_save_LIBS="$LIBS"
+  ac_check_lib_save_LIBS=$LIBS
 LIBS="-lc  $LIBS"
 LIBS="-lc  $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 6662 "configure"
-#include "confdefs.h"
-/* Override any gcc2 internal prototype to avoid an error.  */
-/* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char getspnam();
-
-int main() {
-getspnam()
-; return 0; }
-EOF
-if { (eval echo configure:6673: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=yes"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* 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 getspnam ();
+int
+main ()
+{
+return getspnam ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_c_getspnam=yes
 else
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=no"
+  ac_cv_lib_c_getspnam=no
 fi
 fi
-rm -f conftest*
-LIBS="$ac_save_LIBS"
-
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
 fi
 fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_c_getspnam" >&5
+$as_echo "$ac_cv_lib_c_getspnam" >&6; }
+if test "x$ac_cv_lib_c_getspnam" = xyes; then :
   have_getspnam=yes
   have_getspnam=yes
-else
-  echo "$ac_t""no" 1>&6
 fi
 
     if test "$have_getspnam" = no ; then
 fi
 
     if test "$have_getspnam" = no ; then
-      echo $ac_n "checking for getspnam in -lgen""... $ac_c" 1>&6
-echo "configure:6695: checking for getspnam in -lgen" >&5
-ac_lib_var=`echo gen'_'getspnam | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for getspnam in -lgen" >&5
+$as_echo_n "checking for getspnam in -lgen... " >&6; }
+if ${ac_cv_lib_gen_getspnam+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
 else
-  ac_save_LIBS="$LIBS"
+  ac_check_lib_save_LIBS=$LIBS
 LIBS="-lgen  $LIBS"
 LIBS="-lgen  $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 6703 "configure"
-#include "confdefs.h"
-/* Override any gcc2 internal prototype to avoid an error.  */
-/* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char getspnam();
-
-int main() {
-getspnam()
-; return 0; }
-EOF
-if { (eval echo configure:6714: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=yes"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* 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 getspnam ();
+int
+main ()
+{
+return getspnam ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_gen_getspnam=yes
 else
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=no"
+  ac_cv_lib_gen_getspnam=no
 fi
 fi
-rm -f conftest*
-LIBS="$ac_save_LIBS"
-
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
 fi
 fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_gen_getspnam" >&5
+$as_echo "$ac_cv_lib_gen_getspnam" >&6; }
+if test "x$ac_cv_lib_gen_getspnam" = xyes; then :
   have_getspnam=yes; PASSWD_LIBS="$PASSWD_LIBS -lgen"
   have_getspnam=yes; PASSWD_LIBS="$PASSWD_LIBS -lgen"
-else
-  echo "$ac_t""no" 1>&6
 fi
 
     fi
 fi
 
     fi
@@ -6734,85 +10772,85 @@ if test "$enable_locking" = yes ; then
 
   # On some systems (UnixWare 2.1), crypt() is in -lcrypt instead of -lc.
   have_crypt=no
 
   # On some systems (UnixWare 2.1), crypt() is in -lcrypt instead of -lc.
   have_crypt=no
-  echo $ac_n "checking for crypt in -lc""... $ac_c" 1>&6
-echo "configure:6750: checking for crypt in -lc" >&5
-ac_lib_var=`echo c'_'crypt | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for crypt in -lc" >&5
+$as_echo_n "checking for crypt in -lc... " >&6; }
+if ${ac_cv_lib_c_crypt+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
 else
-  ac_save_LIBS="$LIBS"
+  ac_check_lib_save_LIBS=$LIBS
 LIBS="-lc  $LIBS"
 LIBS="-lc  $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 6758 "configure"
-#include "confdefs.h"
-/* Override any gcc2 internal prototype to avoid an error.  */
-/* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char crypt();
-
-int main() {
-crypt()
-; return 0; }
-EOF
-if { (eval echo configure:6769: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=yes"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* 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 crypt ();
+int
+main ()
+{
+return crypt ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_c_crypt=yes
 else
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=no"
+  ac_cv_lib_c_crypt=no
 fi
 fi
-rm -f conftest*
-LIBS="$ac_save_LIBS"
-
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
 fi
 fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_c_crypt" >&5
+$as_echo "$ac_cv_lib_c_crypt" >&6; }
+if test "x$ac_cv_lib_c_crypt" = xyes; then :
   have_crypt=yes
   have_crypt=yes
-else
-  echo "$ac_t""no" 1>&6
 fi
 
   if test "$have_crypt" = no ; then
 fi
 
   if test "$have_crypt" = no ; then
-    echo $ac_n "checking for crypt in -lcrypt""... $ac_c" 1>&6
-echo "configure:6791: checking for crypt in -lcrypt" >&5
-ac_lib_var=`echo crypt'_'crypt | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for crypt in -lcrypt" >&5
+$as_echo_n "checking for crypt in -lcrypt... " >&6; }
+if ${ac_cv_lib_crypt_crypt+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
 else
-  ac_save_LIBS="$LIBS"
+  ac_check_lib_save_LIBS=$LIBS
 LIBS="-lcrypt  $LIBS"
 LIBS="-lcrypt  $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 6799 "configure"
-#include "confdefs.h"
-/* Override any gcc2 internal prototype to avoid an error.  */
-/* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char crypt();
-
-int main() {
-crypt()
-; return 0; }
-EOF
-if { (eval echo configure:6810: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=yes"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* 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 crypt ();
+int
+main ()
+{
+return crypt ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_crypt_crypt=yes
 else
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=no"
+  ac_cv_lib_crypt_crypt=no
 fi
 fi
-rm -f conftest*
-LIBS="$ac_save_LIBS"
-
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
 fi
 fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypt_crypt" >&5
+$as_echo "$ac_cv_lib_crypt_crypt" >&6; }
+if test "x$ac_cv_lib_crypt_crypt" = xyes; then :
   have_crypt=yes; PASSWD_LIBS="$PASSWD_LIBS -lcrypt"
   have_crypt=yes; PASSWD_LIBS="$PASSWD_LIBS -lcrypt"
-else
-  echo "$ac_t""no" 1>&6
 fi
 
   fi
 fi
 
   fi
 
 
 if test "$have_shadow_adjunct" = yes ; then
 
 
 if test "$have_shadow_adjunct" = yes ; then
-  cat >> confdefs.h <<\EOF
-#define HAVE_ADJUNCT_PASSWD 1
-EOF
+  $as_echo "#define HAVE_ADJUNCT_PASSWD 1" >>confdefs.h
 
 elif test "$have_shadow_enhanced" = yes ; then
 
 elif test "$have_shadow_enhanced" = yes ; then
-  cat >> confdefs.h <<\EOF
-#define HAVE_ENHANCED_PASSWD 1
-EOF
+  $as_echo "#define HAVE_ENHANCED_PASSWD 1" >>confdefs.h
 
 elif test "$have_shadow_hpux" = yes ; then
 
 elif test "$have_shadow_hpux" = yes ; then
-  cat >> confdefs.h <<\EOF
-#define HAVE_HPUX_PASSWD 1
-EOF
+  $as_echo "#define HAVE_HPUX_PASSWD 1" >>confdefs.h
 
 elif test "$have_shadow" = yes ; then
 
 elif test "$have_shadow" = yes ; then
-  cat >> confdefs.h <<\EOF
-#define HAVE_SHADOW_PASSWD 1
-EOF
+  $as_echo "#define HAVE_SHADOW_PASSWD 1" >>confdefs.h
 
 fi
 
 
 ###############################################################################
 #
 
 fi
 
 
 ###############################################################################
 #
-#       Check for -lXm.
+#       Check for external password helper
+#      On SuSE, instead of having xscreensaver be a setuid program, they
+#      fork an external program that takes the password on stdin, and
+#      returns true if that password is a valid one.  Then only that
+#      smaller program needs to be setuid.
+#
+#       (Note that this external program is not a GUI: the GUI is still
+#      all in xscreensaver itself; the external program just does auth.)
 #
 ###############################################################################
 
 #
 ###############################################################################
 
-have_motif=no
-with_motif_req=unspecified
-# Check whether --with-motif or --without-motif was given.
-if test "${with_motif+set}" = set; then
-  withval="$with_motif"
-  with_motif="$withval"; with_motif_req="$withval"
+have_passwd_helper=no
+with_passwd_helper_req=unspecified
+
+
+# Check whether --with-passwd-helper was given.
+if test "${with_passwd_helper+set}" = set; then :
+  withval=$with_passwd_helper; with_passwd_helper="$withval"; with_passwd_helper_req="$withval"
 else
 else
-  with_motif=yes
+  with_passwd_helper=no
 fi
 
 fi
 
+# no HANDLE_X_PATH_ARG for this one
 
 
+if test "$enable_locking" = no ; then
+  with_passwd_helper_req=no
+  with_passwd_helper=no
+fi
 
 
-   case "$with_motif" in
-    yes) ;;
-    no)  ;;
+case "$with_passwd_helper" in
+  ""|no) : ;;
+  /*)
+    cat >>confdefs.h <<_ACEOF
+#define PASSWD_HELPER_PROGRAM "$with_passwd_helper"
+_ACEOF
 
 
-    /*)
-     echo $ac_n "checking for Motif headers""... $ac_c" 1>&6
-echo "configure:6894: checking for Motif headers" >&5
-     d=$with_motif/include
-     if test -d $d; then
-       X_CFLAGS="-I$d $X_CFLAGS"
-       echo "$ac_t""$d" 1>&6
-     else
-       echo "$ac_t""not found ($d: no such directory)" 1>&6
-     fi
+    have_passwd_helper=yes;;
+  *)
+    echo "error: --with-passwd-helper needs full pathname of helper (not '$with_passwd_helper')." >&2
+    exit 1
+esac
 
 
-     echo $ac_n "checking for Motif libs""... $ac_c" 1>&6
-echo "configure:6904: checking for Motif libs" >&5
-     d=$with_motif/lib
-     if test -d $d; then
-       X_LIBS="-L$d $X_LIBS"
-       echo "$ac_t""$d" 1>&6
-     else
-       echo "$ac_t""not found ($d: no such directory)" 1>&6
-     fi
 
 
-     # replace the directory string with "yes".
-     with_motif_req="yes"
-     with_motif=$with_motif_req
-     ;;
+###############################################################################
+#
+#       Check for a login manager for a "New Login" button on the lock dialog.
+#      Usually this will be "/usr/bin/gdmflexiserver".
+#
+###############################################################################
 
 
-    *)
-     echo ""
-     echo "error: argument to --with-motif 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
-  
+with_login_manager_req=unspecified
+default_login_manager_1='gdmflexiserver -ls'
+default_login_manager_2='kdmctl reserve'
 
 
-if test "$with_motif" != yes -a "$with_motif" != no ; then
-  echo "error: must be yes or no: --with-motif=$with_motif"
-  exit 1
+
+# 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=yes
 fi
 
 fi
 
-if test "$with_motif" = yes; then
-  have_motif=no
-  
-  ac_save_CPPFLAGS="$CPPFLAGS"
-  if test \! -z "$includedir" ; then 
-    CPPFLAGS="$CPPFLAGS -I$includedir"
+# no HANDLE_X_PATH_ARG for this one
+
+if test "$enable_locking" = no ; then
+  with_login_manager_req=no
+  with_login_manager=no
+fi
+
+case "$with_login_manager_req" in
+  no)
+    with_login_manager=""
+  ;;
+
+  yes|unspecified)
+    # Try both defaults, use the one that exists.
+
+    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:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_login_manager_tmp+:} false; 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 as_fn_executable_p "$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:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
   fi
   fi
-  CPPFLAGS="$CPPFLAGS $X_CFLAGS"
-  ac_safe=`echo "Xm/Xm.h" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for Xm/Xm.h""... $ac_c" 1>&6
-echo "configure:6943: checking for Xm/Xm.h" >&5
-if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  cat > conftest.$ac_ext <<EOF
-#line 6948 "configure"
-#include "confdefs.h"
-#include <Xm/Xm.h>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:6953: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
-  rm -rf conftest*
-  eval "ac_cv_header_$ac_safe=yes"
-else
-  echo "$ac_err" >&5
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_header_$ac_safe=no"
-fi
-rm -f conftest*
-fi
-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-  have_motif=yes
-                     cat >> confdefs.h <<\EOF
-#define HAVE_MOTIF 1
-EOF
+done
+  done
+IFS=$as_save_IFS
 
 
-                     MOTIF_LIBS="$MOTIF_LIBS -lXm"
+  ;;
+esac
+fi
+login_manager_tmp=$ac_cv_path_login_manager_tmp
+if test -n "$login_manager_tmp"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $login_manager_tmp" >&5
+$as_echo "$login_manager_tmp" >&6; }
 else
 else
-  echo "$ac_t""no" 1>&6
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
 fi
 
-  CPPFLAGS="$ac_save_CPPFLAGS"
+
+    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:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_login_manager_tmp+:} false; 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 as_fn_executable_p "$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:${as_lineno-$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:${as_lineno-$LINENO}: result: $login_manager_tmp" >&5
+$as_echo "$login_manager_tmp" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
 
 fi
 
 
-if test "$have_motif" = yes; then
-  
-  ac_save_CPPFLAGS="$CPPFLAGS"
-  if test \! -z "$includedir" ; then 
-    CPPFLAGS="$CPPFLAGS -I$includedir"
+      if test ! -z "$login_manager_tmp" ; then
+        with_login_manager="$default_login_manager_2"
+      else
+        with_login_manager=""
+      fi
+    fi
+  ;;
+
+  /*)
+    # absolute path specified on cmd line
+    set dummy $with_login_manager_req ; login_manager_tmp=$2
+    { $as_echo "$as_me:${as_lineno-$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:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+    else
+      { $as_echo "$as_me:${as_lineno-$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:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_login_manager_tmp+:} false; 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 as_fn_executable_p "$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:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
   fi
   fi
-  CPPFLAGS="$CPPFLAGS $X_CFLAGS"
-  ac_safe=`echo "Xm/ComboBox.h" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for Xm/ComboBox.h""... $ac_c" 1>&6
-echo "configure:6992: checking for Xm/ComboBox.h" >&5
-if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  cat > conftest.$ac_ext <<EOF
-#line 6997 "configure"
-#include "confdefs.h"
-#include <Xm/ComboBox.h>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:7002: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
-  rm -rf conftest*
-  eval "ac_cv_header_$ac_safe=yes"
-else
-  echo "$ac_err" >&5
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_header_$ac_safe=no"
-fi
-rm -f conftest*
-fi
-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-  cat >> confdefs.h <<\EOF
-#define HAVE_XMCOMBOBOX 1
-EOF
+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:${as_lineno-$LINENO}: result: $login_manager_tmp" >&5
+$as_echo "$login_manager_tmp" >&6; }
 else
 else
-  echo "$ac_t""no" 1>&6
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
 fi
 
-  CPPFLAGS="$ac_save_CPPFLAGS"
+
+    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:${as_lineno-$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_1"
+  NEW_LOGIN_COMMAND_P='! '
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NEW_LOGIN_COMMAND (disabled)" >&5
+$as_echo "$NEW_LOGIN_COMMAND (disabled)" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NEW_LOGIN_COMMAND" >&5
+$as_echo "$NEW_LOGIN_COMMAND" >&6; }
 fi
 
 
 fi
 
 
 
 have_gtk=no
 with_gtk_req=unspecified
 
 have_gtk=no
 with_gtk_req=unspecified
-# Check whether --with-gtk or --without-gtk was given.
-if test "${with_gtk+set}" = set; then
-  withval="$with_gtk"
-  with_gtk="$withval"; with_gtk_req="$withval"
+
+# Check whether --with-gtk was given.
+if test "${with_gtk+set}" = set; then :
+  withval=$with_gtk; with_gtk="$withval"; with_gtk_req="$withval"
 else
   with_gtk=yes
 fi
 else
   with_gtk=yes
 fi
@@ -7049,24 +11177,28 @@ esac
     no)  ;;
 
     /*)
     no)  ;;
 
     /*)
-     echo $ac_n "checking for Gtk headers""... $ac_c" 1>&6
-echo "configure:7065: checking for Gtk headers" >&5
+     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Gtk headers" >&5
+$as_echo_n "checking for Gtk headers... " >&6; }
      d=$with_gtk/include
      if test -d $d; then
        X_CFLAGS="-I$d $X_CFLAGS"
      d=$with_gtk/include
      if test -d $d; then
        X_CFLAGS="-I$d $X_CFLAGS"
-       echo "$ac_t""$d" 1>&6
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $d" >&5
+$as_echo "$d" >&6; }
      else
      else
-       echo "$ac_t""not found ($d: no such directory)" 1>&6
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found ($d: no such directory)" >&5
+$as_echo "not found ($d: no such directory)" >&6; }
      fi
 
      fi
 
-     echo $ac_n "checking for Gtk libs""... $ac_c" 1>&6
-echo "configure:7075: checking for Gtk libs" >&5
+     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Gtk libs" >&5
+$as_echo_n "checking for Gtk libs... " >&6; }
      d=$with_gtk/lib
      if test -d $d; then
        X_LIBS="-L$d $X_LIBS"
      d=$with_gtk/lib
      if test -d $d; then
        X_LIBS="-L$d $X_LIBS"
-       echo "$ac_t""$d" 1>&6
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $d" >&5
+$as_echo "$d" >&6; }
      else
      else
-       echo "$ac_t""not found ($d: no such directory)" 1>&6
+       { $as_echo "$as_me:${as_lineno-$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".
      fi
 
      # replace the directory string with "yes".
@@ -7082,759 +11214,396 @@ echo "configure:7075: checking for Gtk libs" >&5
      exit 1
      ;;
    esac
      exit 1
      ;;
    esac
-  
+
 
 if test "$with_gtk" != yes -a "$with_gtk" != no ; then
   echo "error: must be yes or no: --with-gtk=$with_gtk"
   exit 1
 fi
 
 
 if test "$with_gtk" != yes -a "$with_gtk" != no ; then
   echo "error: must be yes or no: --with-gtk=$with_gtk"
   exit 1
 fi
 
-have_gnome=no
-with_gnome_req=unspecified
-# Check whether --with-gnome or --without-gnome was given.
-if test "${with_gnome+set}" = set; then
-  withval="$with_gnome"
-  with_gnome="$withval"; with_gnome_req="$withval"
-else
-  with_gnome=yes
-fi
-
-
-# if --with-gnome=/directory/ was specified, remember that directory so that
-# we can also look for the `gnome-config' program in that directory.
-case "$with_gnome" in
-  /*)
-    gnome_dir="$with_gnome"
-    ;;
-  *)
-    gnome_dir=""
-    ;;
-esac
-
-
-   case "$with_gnome" in
-    yes) ;;
-    no)  ;;
-
-    /*)
-     echo $ac_n "checking for Gnome headers""... $ac_c" 1>&6
-echo "configure:7133: checking for Gnome headers" >&5
-     d=$with_gnome/include
-     if test -d $d; then
-       X_CFLAGS="-I$d $X_CFLAGS"
-       echo "$ac_t""$d" 1>&6
-     else
-       echo "$ac_t""not found ($d: no such directory)" 1>&6
-     fi
-
-     echo $ac_n "checking for Gnome libs""... $ac_c" 1>&6
-echo "configure:7143: checking for Gnome libs" >&5
-     d=$with_gnome/lib
-     if test -d $d; then
-       X_LIBS="-L$d $X_LIBS"
-       echo "$ac_t""$d" 1>&6
-     else
-       echo "$ac_t""not found ($d: no such directory)" 1>&6
-     fi
-
-     # replace the directory string with "yes".
-     with_gnome_req="yes"
-     with_gnome=$with_gnome_req
-     ;;
-
-    *)
-     echo ""
-     echo "error: argument to --with-gnome 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_gnome" != yes -a "$with_gnome" != no ; then
-  echo "error: must be yes or no: --with-gnome=$with_gnome"
-  exit 1
-fi
-
-
-jurassic_gtk=no
-if test "$with_gtk" = yes; then
-  have_gtk=no
-  
-  # if the user specified --with-gtk=/foo/ or --with-gnome=/foo/ then
-  # look in /foo/bin/ for glib-config, gtk-config, and gnome-config.
-  #
-  gtk_path="$PATH"
 
 
-  if test ! -z "$gtk_dir"; then
-    # canonicalize slashes.
-    foo=`echo "${gtk_dir}/bin" | sed 's@//*@/@g'`
-    gtk_path="$foo:$gtk_path"
-  fi
+parse_gtk_version_string() {
+  # M4 sucks!!
+
+  maj=`echo $ac_gtk_version_string | sed -n 's/\..*//p'`
+  min=`echo $ac_gtk_version_string | sed -n 's/[^.]*\.\([^.]*\).*/\1/p'`
 
 
-  if test ! -z "$gnome_dir"; then
-    # canonicalize slashes.
-    foo=`echo "${gnome_dir}/bin" | sed 's@//*@/@g'`
-    gtk_path="$foo:$gtk_path"
+  ac_gtk_version=`echo "$maj * 1000 + $min" | bc`
+  if test -z "$ac_gtk_version"; then
+    ac_gtk_version=unknown
+    ac_gtk_version_string=unknown
   fi
   fi
+}
 
 
-  for ac_prog in glib12-config glib-config
-do
-# Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:7199: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_path_glib_config'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  case "$glib_config" in
-  /*)
-  ac_cv_path_glib_config="$glib_config" # Let the user override the test with a path.
-  ;;
-  ?:/*)                         
-  ac_cv_path_glib_config="$glib_config" # Let the user override the test with a dos path.
-  ;;
-  *)
-  IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS=":"
-  ac_dummy="$gtk_path"
-  for ac_dir in $ac_dummy; do 
-    test -z "$ac_dir" && ac_dir=.
-    if test -f $ac_dir/$ac_word; then
-      ac_cv_path_glib_config="$ac_dir/$ac_word"
-      break
-    fi
-  done
-  IFS="$ac_save_ifs"
-  ;;
-esac
-fi
-glib_config="$ac_cv_path_glib_config"
-if test -n "$glib_config"; then
-  echo "$ac_t""$glib_config" 1>&6
-else
-  echo "$ac_t""no" 1>&6
+# Find pkg-config... (need this for both gtk and gdk_pixbuf.)
+# if the user specified --with-gtk=/foo/ then look there.
+#
+gtk_path="$PATH"
+if test ! -z "$gtk_dir"; then
+  # canonicalize slashes.
+  foo=`echo "${gtk_dir}/bin" | sed 's@//*@/@g'`
+  gtk_path="$foo:$gtk_path"
 fi
 
 fi
 
-test -n "$glib_config" && break
-done
-
-  for ac_prog in gtk12-config  gtk-config
+for ac_prog in pkg-config
 do
 do
-# Extract the first word of "$ac_prog", so it can be a program name with args.
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
 set dummy $ac_prog; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:7239: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_path_gtk_config'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  case "$gtk_config" in
-  /*)
-  ac_cv_path_gtk_config="$gtk_config" # Let the user override the test with a path.
-  ;;
-  ?:/*)                         
-  ac_cv_path_gtk_config="$gtk_config" # Let the user override the test with a dos path.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_pkg_config+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $pkg_config in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_pkg_config="$pkg_config" # Let the user override the test with a path.
   ;;
   *)
   ;;
   *)
-  IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS=":"
-  ac_dummy="$gtk_path"
-  for ac_dir in $ac_dummy; do 
-    test -z "$ac_dir" && ac_dir=.
-    if test -f $ac_dir/$ac_word; then
-      ac_cv_path_gtk_config="$ac_dir/$ac_word"
-      break
-    fi
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $gtk_path
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_path_pkg_config="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
   done
   done
-  IFS="$ac_save_ifs"
+IFS=$as_save_IFS
+
   ;;
 esac
 fi
   ;;
 esac
 fi
-gtk_config="$ac_cv_path_gtk_config"
-if test -n "$gtk_config"; then
-  echo "$ac_t""$gtk_config" 1>&6
+pkg_config=$ac_cv_path_pkg_config
+if test -n "$pkg_config"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pkg_config" >&5
+$as_echo "$pkg_config" >&6; }
 else
 else
-  echo "$ac_t""no" 1>&6
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
 fi
 
-test -n "$gtk_config" && break
+
+  test -n "$pkg_config" && break
 done
 
 
 done
 
 
-  if test "$with_gnome" = yes; then
-    for ac_prog in gnome-config
-do
-# Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:7281: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_path_gnome_config'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  case "$gnome_config" in
-  /*)
-  ac_cv_path_gnome_config="$gnome_config" # Let the user override the test with a path.
-  ;;
-  ?:/*)                         
-  ac_cv_path_gnome_config="$gnome_config" # Let the user override the test with a dos path.
-  ;;
-  *)
-  IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS=":"
-  ac_dummy="$gtk_path"
-  for ac_dir in $ac_dummy; do 
-    test -z "$ac_dir" && ac_dir=.
-    if test -f $ac_dir/$ac_word; then
-      ac_cv_path_gnome_config="$ac_dir/$ac_word"
-      break
-    fi
-  done
-  IFS="$ac_save_ifs"
-  ;;
-esac
-fi
-gnome_config="$ac_cv_path_gnome_config"
-if test -n "$gnome_config"; then
-  echo "$ac_t""$gnome_config" 1>&6
-else
-  echo "$ac_t""no" 1>&6
+if test -z "$pkg_config" ; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: pkg-config not found!" >&5
+$as_echo "$as_me: WARNING: pkg-config not found!" >&2;}
+  pkg_config="false"
 fi
 
 fi
 
-test -n "$gnome_config" && break
-done
 
 
+# Utility function for running pkg-config-based tests...
+#
+pkgs=''
+pkg_check_version() {
+  if test "$ok" = yes ; then
+    req="$1"
+    min="$2"
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $req" >&5
+$as_echo_n "checking for $req... " >&6; }
+    if $pkg_config --exists "$req" ; then
+      vers=`$pkg_config --modversion "$req"`
+      if $pkg_config --exists "$req >= $min" ; then
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: $vers" >&5
+$as_echo "$vers" >&6; }
+        pkgs="$pkgs $req"
+        return 1
+      else
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: $vers (wanted >= $min)" >&5
+$as_echo "$vers (wanted >= $min)" >&6; }
+        ok=no
+        return 0
+      fi
+    else
+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+      ok=no
+      return 0
+    fi
   fi
   fi
+}
+
+
+jurassic_gtk=no
+gtk_halfassed=no
+
+if test "$with_gtk" = yes; then
+  have_gtk=no
 
 
-  if test -n "$glib_config" -a  -n "$gtk_config" ; then
-    have_gtk=yes
-    if test "$with_gnome" = yes -a -n "$gnome_config" ; then
-      have_gnome=yes
+  ok="yes"
+  pkg_check_version            gtk+-2.0  2.0.1  ; ac_gtk_version_string="$vers"
+  pkg_check_version         gmodule-2.0  2.0.0
+  pkg_check_version          libxml-2.0  2.4.6
+  pkg_check_version        libglade-2.0  1.99.0
+  pkg_check_version      gdk-pixbuf-2.0  2.0.0
+  pkg_check_version gdk-pixbuf-xlib-2.0  2.0.0
+  have_gtk="$ok"
+
+  if test "$have_gtk" = no; then
+    if test -n "$ac_gtk_version_string" ; then
+      gtk_halfassed="$ac_gtk_version_string"
+      gtk_halfassed_lib="$req"
     fi
   fi
 
   if test "$have_gtk" = yes; then
     fi
   fi
 
   if test "$have_gtk" = yes; then
-    echo $ac_n "checking Gtk version number""... $ac_c" 1>&6
-echo "configure:7327: checking Gtk version number" >&5
-if eval "test \"`echo '$''{'ac_cv_gtk_version_string'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  ac_cv_gtk_version_string=`$gtk_config --version`
-fi
-
-echo "$ac_t""$ac_cv_gtk_version_string" 1>&6
-    ac_gtk_version_string=$ac_cv_gtk_version_string
-    # M4 sucks!!
-    
-    maj=`echo $ac_gtk_version_string | sed -n 's/\..*//p'`
-    min=`echo $ac_gtk_version_string | sed -n 's/[^.]*\.\([^.]*\).*/\1/p'`
-    
-    ac_gtk_version=`echo "$maj * 1000 + $min" | bc`
-    if test -z "$ac_gtk_version"; then
-      ac_gtk_version=unknown
-      ac_gtk_version_string=unknown
-    fi
-    if test "$ac_gtk_version" = "unknown" || test "$ac_gtk_version" -lt 1002
-    then
-      have_gtk=no
-      have_gnome=no
-      jurassic_gtk=yes
-    fi
+    parse_gtk_version_string
+    jurassic_gtk=no
   fi
 
   if test "$have_gtk" = yes; then
   fi
 
   if test "$have_gtk" = yes; then
-    echo $ac_n "checking for Gtk includes""... $ac_c" 1>&6
-echo "configure:7356: checking for Gtk includes" >&5
-if eval "test \"`echo '$''{'ac_cv_gtk_config_cflags'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Gtk includes" >&5
+$as_echo_n "checking for Gtk includes... " >&6; }
+if ${ac_cv_gtk_config_cflags+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
 else
-  ac_cv_gtk_config_cflags=`$gtk_config --cflags`
+  ac_cv_gtk_config_cflags=`$pkg_config --cflags $pkgs`
 fi
 fi
-
-echo "$ac_t""$ac_cv_gtk_config_cflags" 1>&6
-    echo $ac_n "checking for Gtk libs""... $ac_c" 1>&6
-echo "configure:7365: checking for Gtk libs" >&5
-if eval "test \"`echo '$''{'ac_cv_gtk_config_libs'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_gtk_config_cflags" >&5
+$as_echo "$ac_cv_gtk_config_cflags" >&6; }
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Gtk libs" >&5
+$as_echo_n "checking for Gtk libs... " >&6; }
+if ${ac_cv_gtk_config_libs+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
 else
-  ac_cv_gtk_config_libs=`$gtk_config --libs`
+  ac_cv_gtk_config_libs=`$pkg_config --libs $pkgs`
 fi
 fi
-
-echo "$ac_t""$ac_cv_gtk_config_libs" 1>&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_gtk_config_libs" >&5
+$as_echo "$ac_cv_gtk_config_libs" >&6; }
   fi
   fi
+
   ac_gtk_config_cflags=$ac_cv_gtk_config_cflags
   ac_gtk_config_libs=$ac_cv_gtk_config_libs
 
   ac_gtk_config_cflags=$ac_cv_gtk_config_cflags
   ac_gtk_config_libs=$ac_cv_gtk_config_libs
 
-  # Check for Gnome Capplet support.
-  #
-  if test "$have_gnome" = yes -a "$have_gtk" = yes; then
-    gnome_config_libs="gtk capplet gnomeui gdk_pixbuf"
-    echo $ac_n "checking for Gnome capplet includes""... $ac_c" 1>&6
-echo "configure:7382: checking for Gnome capplet includes" >&5
-    if eval "test \"`echo '$''{'ac_cv_gnome_config_cflags'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  if ( $gnome_config --cflags $gnome_config_libs 2>&1 >/dev/null | \
-            grep Unknown >/dev/null ) ; then
-         ac_cv_gnome_config_cflags=''
-       else
-         ac_cv_gnome_config_cflags=`$gnome_config --cflags $gnome_config_libs`
-       fi
-fi
-
-    ac_gnome_config_cflags=$ac_cv_gnome_config_cflags
-    if test "$ac_gnome_config_cflags" = "" ; then
-      have_gnome=no
-      echo "$ac_t""no" 1>&6
-    else
-      echo "$ac_t""$ac_gnome_config_cflags" 1>&6
-    fi
-  fi
-
-  if test "$have_gnome" = yes -a "$have_gtk" = yes; then
-    echo $ac_n "checking for Gnome capplet libs""... $ac_c" 1>&6
-echo "configure:7405: checking for Gnome capplet libs" >&5
-    if eval "test \"`echo '$''{'ac_cv_gnome_config_libs'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  if ( $gnome_config --libs $gnome_config_libs 2>&1 >/dev/null |
-            grep Unknown >/dev/null ) ; then
-         ac_cv_gnome_config_libs=''
-       else
-         ac_cv_gnome_config_libs=`$gnome_config --libs $gnome_config_libs`
-       fi
-fi
-
-    ac_gnome_config_libs=$ac_cv_gnome_config_libs
-    if test "$ac_gnome_config_libs" = "" ; then
-      have_gnome=no
-      echo "$ac_t""no" 1>&6
-    else
-      echo "$ac_t""$ac_gnome_config_libs" 1>&6
-    fi
-  fi
-
-  GNOME_DATADIR=""
-  if test "$have_gnome" = yes -a "$have_gtk" = yes; then
-    GNOME_DATADIR=`$gnome_config --datadir`
+  GTK_EXTRA_OBJS=""
+  GTK_DATADIR=""
+  if test "$have_gtk" = yes; then
+    GTK_DATADIR=`$pkg_config --variable=prefix gtk+-2.0`
+    GTK_DATADIR="$GTK_DATADIR/share"
   fi
 
   fi
 
+  if test "$have_gtk" = yes; then
+    INCLUDES="$INCLUDES $ac_gtk_config_cflags"
+    GTK_LIBS="$GTK_LIBS $ac_gtk_config_libs"
+    $as_echo "#define HAVE_GTK 1" >>confdefs.h
 
 
-  # If we have Gnome, then override the gtk-config values with 
-  # the gnome-config values.
-  #
-  if test "$have_gnome" = yes -a "$have_gtk" = yes; then
-    ac_gtk_config_cflags=$ac_gnome_config_cflags
-    ac_gtk_config_libs=$ac_gnome_config_libs
-    cat >> confdefs.h <<\EOF
-#define HAVE_CRAPPLET 1
-EOF
-
+    $as_echo "#define HAVE_GTK2 1" >>confdefs.h
 
 
-    # check for this function that was not in libcapplet 1.2.
-    
-  ac_save_CPPFLAGS="$CPPFLAGS"
-  ac_save_LDFLAGS="$LDFLAGS"
-#  ac_save_LIBS="$LIBS"
+    $as_echo "#define HAVE_XML 1" >>confdefs.h
 
 
-  if test \! -z "$includedir" ; then 
-    CPPFLAGS="$CPPFLAGS -I$includedir"
   fi
   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"
+fi
 
 
-  echo $ac_n "checking for capplet_widget_changes_are_immediate in -lcapplet""... $ac_c" 1>&6
-echo "configure:7462: checking for capplet_widget_changes_are_immediate in -lcapplet" >&5
-ac_lib_var=`echo capplet'_'capplet_widget_changes_are_immediate | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+
+# Check for the various Gnome help and URL loading programs.
+#
+WITH_BROWSER=gnome-open
+if test "$have_gtk" = yes; then
+  for ac_prog in gnome-open
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_gnome_open_program+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
 else
-  ac_save_LIBS="$LIBS"
-LIBS="-lcapplet $ac_gnome_config_libs $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 7470 "configure"
-#include "confdefs.h"
-/* Override any gcc2 internal prototype to avoid an error.  */
-/* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char capplet_widget_changes_are_immediate();
-
-int main() {
-capplet_widget_changes_are_immediate()
-; return 0; }
-EOF
-if { (eval echo configure:7481: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=yes"
+  if test -n "$gnome_open_program"; then
+  ac_cv_prog_gnome_open_program="$gnome_open_program" # Let the user override the test.
 else
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=no"
-fi
-rm -f conftest*
-LIBS="$ac_save_LIBS"
+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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_gnome_open_program="$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
 
 fi
 
 fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-  cat >> confdefs.h <<\EOF
-#define HAVE_CRAPPLET_IMMEDIATE 1
-EOF
-
+fi
+gnome_open_program=$ac_cv_prog_gnome_open_program
+if test -n "$gnome_open_program"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gnome_open_program" >&5
+$as_echo "$gnome_open_program" >&6; }
 else
 else
-  echo "$ac_t""no" 1>&6
-true
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
 fi
 
-  CPPFLAGS="$ac_save_CPPFLAGS"
-  LDFLAGS="$ac_save_LDFLAGS"
-#  LIBS="$ac_save_LIBS"
-  
-  fi
-
-
-  if test "$have_gtk" = yes; then
-    INCLUDES="$INCLUDES $ac_gtk_config_cflags"
-    GTK_LIBS="$GTK_LIBS $ac_gtk_config_libs"
-    cat >> confdefs.h <<\EOF
-#define HAVE_GTK 1
-EOF
-
-  fi
-
-fi
 
 
+  test -n "$gnome_open_program" && break
+done
 
 
-# Check for the Gnome Help Browser.
-#
-if test "$have_gnome" = yes; then
-  # Extract the first word of "gnome-help-browser", so it can be a program name with args.
-set dummy gnome-help-browser; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:7530: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_have_gnome_help'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+  for ac_prog in gnome-url-show
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_gnome_url_show_program+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
 else
-  if test -n "$have_gnome_help"; then
-  ac_cv_prog_have_gnome_help="$have_gnome_help" # Let the user override the test.
+  if test -n "$gnome_url_show_program"; then
+  ac_cv_prog_gnome_url_show_program="$gnome_url_show_program" # Let the user override the test.
 else
 else
-  IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS=":"
-  ac_dummy="$PATH"
-  for ac_dir in $ac_dummy; do
-    test -z "$ac_dir" && ac_dir=.
-    if test -f $ac_dir/$ac_word; then
-      ac_cv_prog_have_gnome_help="yes"
-      break
-    fi
+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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_gnome_url_show_program="$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
   done
   done
-  IFS="$ac_save_ifs"
-  test -z "$ac_cv_prog_have_gnome_help" && ac_cv_prog_have_gnome_help="no"
+IFS=$as_save_IFS
+
 fi
 fi
 fi
 fi
-have_gnome_help="$ac_cv_prog_have_gnome_help"
-if test -n "$have_gnome_help"; then
-  echo "$ac_t""$have_gnome_help" 1>&6
+gnome_url_show_program=$ac_cv_prog_gnome_url_show_program
+if test -n "$gnome_url_show_program"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gnome_url_show_program" >&5
+$as_echo "$gnome_url_show_program" >&6; }
 else
 else
-  echo "$ac_t""no" 1>&6
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
 fi
 
-else
-  have_gnome_help=no
+
+  test -n "$gnome_url_show_program" && break
+done
+
 fi
 
 
 ###############################################################################
 #
 fi
 
 
 ###############################################################################
 #
-#       Check for -lxml
+#       Check for -lXm.
 #
 ###############################################################################
 
 #
 ###############################################################################
 
-have_xml=no
-with_xml_req=unspecified
-xml_halfassed=no
-# Check whether --with-xml or --without-xml was given.
-if test "${with_xml+set}" = set; then
-  withval="$with_xml"
-  with_xml="$withval"; with_xml_req="$withval"
+have_motif=no
+with_motif_req=unspecified
+
+# Check whether --with-motif was given.
+if test "${with_motif+set}" = set; then :
+  withval=$with_motif; with_motif="$withval"; with_motif_req="$withval"
 else
 else
-  with_xml=yes
+  with_motif=no
 fi
 
 
 fi
 
 
-# if --with-xml=/directory/ was specified, remember that directory so that
-# we can also look for the `xml-config' program in that directory.
-case "$with_xml" in
-  /*)
-    xml_dir="$with_xml"
-    ;;
-  *)
-    xml_dir=""
-    ;;
-esac
-
 
 
-   case "$with_xml" in
+   case "$with_motif" in
     yes) ;;
     no)  ;;
 
     /*)
     yes) ;;
     no)  ;;
 
     /*)
-     echo $ac_n "checking for XML headers""... $ac_c" 1>&6
-echo "configure:7598: checking for XML headers" >&5
-     d=$with_xml/include
+     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Motif headers" >&5
+$as_echo_n "checking for Motif headers... " >&6; }
+     d=$with_motif/include
      if test -d $d; then
        X_CFLAGS="-I$d $X_CFLAGS"
      if test -d $d; then
        X_CFLAGS="-I$d $X_CFLAGS"
-       echo "$ac_t""$d" 1>&6
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $d" >&5
+$as_echo "$d" >&6; }
      else
      else
-       echo "$ac_t""not found ($d: no such directory)" 1>&6
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found ($d: no such directory)" >&5
+$as_echo "not found ($d: no such directory)" >&6; }
      fi
 
      fi
 
-     echo $ac_n "checking for XML libs""... $ac_c" 1>&6
-echo "configure:7608: checking for XML libs" >&5
-     d=$with_xml/lib
+     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Motif libs" >&5
+$as_echo_n "checking for Motif libs... " >&6; }
+     d=$with_motif/lib
      if test -d $d; then
        X_LIBS="-L$d $X_LIBS"
      if test -d $d; then
        X_LIBS="-L$d $X_LIBS"
-       echo "$ac_t""$d" 1>&6
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $d" >&5
+$as_echo "$d" >&6; }
      else
      else
-       echo "$ac_t""not found ($d: no such directory)" 1>&6
+       { $as_echo "$as_me:${as_lineno-$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".
      fi
 
      # replace the directory string with "yes".
-     with_xml_req="yes"
-     with_xml=$with_xml_req
+     with_motif_req="yes"
+     with_motif=$with_motif_req
      ;;
 
     *)
      echo ""
      ;;
 
     *)
      echo ""
-     echo "error: argument to --with-xml must be \"yes\", \"no\", or a directory."
+     echo "error: argument to --with-motif 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
      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_xml" != yes -a "$with_xml" != no ; then
-  echo "error: must be yes or no: --with-xml=$with_xml"
+
+if test "$with_motif" != yes -a "$with_motif" != no ; then
+  echo "error: must be yes or no: --with-motif=$with_motif"
   exit 1
 fi
 
   exit 1
 fi
 
-if test "$with_xml" = yes; then
-  have_xml=no
-
-  # if the user specified --with-gtk=/foo/ or --with-gnome=/foo/ then
-  # look in /foo/bin/ for for xml-config.
-  #
-  xml_path="$PATH"
-
-  if test ! -z "$gtk_dir"; then
-    # canonicalize slashes.
-    foo=`echo "${gtk_dir}/bin" | sed 's@//*@/@g'`
-    xml_path="$foo:$xml_path"
-  fi
+if test "$with_motif" = yes; then
+  have_motif=no
 
 
-  if test ! -z "$gnome_dir"; then
-    # canonicalize slashes.
-    foo=`echo "${gnome_dir}/bin" | sed 's@//*@/@g'`
-    xml_path="$foo:$xml_path"
+  ac_save_CPPFLAGS="$CPPFLAGS"
+  if test \! -z "$includedir" ; then
+    CPPFLAGS="$CPPFLAGS -I$includedir"
   fi
   fi
+  CPPFLAGS="$CPPFLAGS $X_CFLAGS"
+  CPPFLAGS=`eval eval eval eval eval eval eval eval eval echo $CPPFLAGS`
+  ac_fn_c_check_header_compile "$LINENO" "Xm/Xm.h" "ac_cv_header_Xm_Xm_h" "#include <stdlib.h>
+                     #include <stdio.h>
+                     #include <X11/Intrinsic.h>
+"
+if test "x$ac_cv_header_Xm_Xm_h" = xyes; then :
+  have_motif=yes
+                     $as_echo "#define HAVE_MOTIF 1" >>confdefs.h
 
 
-  for ac_prog in xml2-config xml-config
-do
-# Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:7662: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_path_xml_config'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  case "$xml_config" in
-  /*)
-  ac_cv_path_xml_config="$xml_config" # Let the user override the test with a path.
-  ;;
-  ?:/*)                         
-  ac_cv_path_xml_config="$xml_config" # Let the user override the test with a dos path.
-  ;;
-  *)
-  IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS=":"
-  ac_dummy="$xml_path"
-  for ac_dir in $ac_dummy; do 
-    test -z "$ac_dir" && ac_dir=.
-    if test -f $ac_dir/$ac_word; then
-      ac_cv_path_xml_config="$ac_dir/$ac_word"
-      break
-    fi
-  done
-  IFS="$ac_save_ifs"
-  ;;
-esac
-fi
-xml_config="$ac_cv_path_xml_config"
-if test -n "$xml_config"; then
-  echo "$ac_t""$xml_config" 1>&6
-else
-  echo "$ac_t""no" 1>&6
+                     MOTIF_LIBS="$MOTIF_LIBS -lXm"
 fi
 
 fi
 
-test -n "$xml_config" && break
-done
-
-
-  # If we found the xml-config program, run it to get flags.
-  #
-  if test -n "$xml_config" ; then
-    echo $ac_n "checking for XML includes""... $ac_c" 1>&6
-echo "configure:7702: checking for XML includes" >&5
-if eval "test \"`echo '$''{'ac_cv_xml_config_cflags'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  ac_cv_xml_config_cflags=`$xml_config --cflags`
-fi
 
 
-echo "$ac_t""$ac_cv_xml_config_cflags" 1>&6
-    echo $ac_n "checking for XML libs""... $ac_c" 1>&6
-echo "configure:7711: checking for XML libs" >&5
-if eval "test \"`echo '$''{'ac_cv_xml_config_libs'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  ac_cv_xml_config_libs=`$xml_config --libs`
+  CPPFLAGS="$ac_save_CPPFLAGS"
 fi
 
 fi
 
-echo "$ac_t""$ac_cv_xml_config_libs" 1>&6
-    ac_xml_config_cflags=$ac_cv_xml_config_cflags
-    ac_xml_config_libs=$ac_cv_xml_config_libs
-  fi
-
-  ac_save_xml_CPPFLAGS="$CPPFLAGS"
-  CPPFLAGS="$CPPFLAGS $ac_xml_config_cflags"
-  
-  ac_save_CPPFLAGS="$CPPFLAGS"
-  if test \! -z "$includedir" ; then 
-    CPPFLAGS="$CPPFLAGS -I$includedir"
-  fi
-  CPPFLAGS="$CPPFLAGS $X_CFLAGS"
-  ac_safe=`echo "xmlIO.h" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for xmlIO.h""... $ac_c" 1>&6
-echo "configure:7733: checking for xmlIO.h" >&5
-if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  cat > conftest.$ac_ext <<EOF
-#line 7738 "configure"
-#include "confdefs.h"
-#include <xmlIO.h>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:7743: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
-  rm -rf conftest*
-  eval "ac_cv_header_$ac_safe=yes"
-else
-  echo "$ac_err" >&5
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_header_$ac_safe=no"
-fi
-rm -f conftest*
-fi
-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-  have_xml=yes
-else
-  echo "$ac_t""no" 1>&6
-fi
 
 
-  CPPFLAGS="$ac_save_CPPFLAGS"
-  CPPFLAGS="$ac_save_xml_CPPFLAGS"
+if test "$have_motif" = yes; then
 
 
-  if test "$have_xml" = yes; then
-    # we have the header, now check for the library
-    have_xml=no
-    xml_halfassed=yes
-    
   ac_save_CPPFLAGS="$CPPFLAGS"
   ac_save_CPPFLAGS="$CPPFLAGS"
-  ac_save_LDFLAGS="$LDFLAGS"
-#  ac_save_LIBS="$LIBS"
-
-  if test \! -z "$includedir" ; then 
+  if test \! -z "$includedir" ; then
     CPPFLAGS="$CPPFLAGS -I$includedir"
   fi
     CPPFLAGS="$CPPFLAGS -I$includedir"
   fi
-  # note: $X_CFLAGS includes $x_includes
   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
+  CPPFLAGS=`eval eval eval eval eval eval eval eval eval echo $CPPFLAGS`
+  ac_fn_c_check_header_compile "$LINENO" "Xm/ComboBox.h" "ac_cv_header_Xm_ComboBox_h" "#include <stdlib.h>
+                     #include <stdio.h>
+                     #include <X11/Intrinsic.h>
+"
+if test "x$ac_cv_header_Xm_ComboBox_h" = xyes; then :
+  $as_echo "#define HAVE_XMCOMBOBOX 1" >>confdefs.h
 
 
-  if test \! -z "$libdir" ; then
-    LDFLAGS="$LDFLAGS -L$libdir"
-  fi
-  # note: $X_LIBS includes $x_libraries
-  LDFLAGS="$LDFLAGS $X_LIBS $X_EXTRA_LIBS"
-
-  echo $ac_n "checking for xmlParseChunk in -lxml""... $ac_c" 1>&6
-echo "configure:7789: checking for xmlParseChunk in -lxml" >&5
-ac_lib_var=`echo xml'_'xmlParseChunk | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  ac_save_LIBS="$LIBS"
-LIBS="-lxml $ac_xml_config_libs $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 7797 "configure"
-#include "confdefs.h"
-/* Override any gcc2 internal prototype to avoid an error.  */
-/* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char xmlParseChunk();
-
-int main() {
-xmlParseChunk()
-; return 0; }
-EOF
-if { (eval echo configure:7808: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=yes"
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=no"
-fi
-rm -f conftest*
-LIBS="$ac_save_LIBS"
-
-fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-  have_xml=yes
-                    xml_halfassed=no
-                    XML_LIBS="-lxml"
-                    cat >> confdefs.h <<\EOF
-#define HAVE_XML 1
-EOF
-
-else
-  echo "$ac_t""no" 1>&6
-true
 fi
 
 fi
 
-  CPPFLAGS="$ac_save_CPPFLAGS"
-  LDFLAGS="$ac_save_LDFLAGS"
-#  LIBS="$ac_save_LIBS"
-  
-  fi
-
-  if test "$have_xml" = yes; then
-    INCLUDES="$INCLUDES $ac_xml_config_cflags"
-    GTK_LIBS="$GTK_LIBS $ac_xml_config_libs"
-    cat >> confdefs.h <<\EOF
-#define HAVE_XML 1
-EOF
-
-  fi
 
 
+  CPPFLAGS="$ac_save_CPPFLAGS"
 fi
 
 
 fi
 
 
 
 have_lesstif=no
 if test "$have_motif" = yes ; then
 
 have_lesstif=no
 if test "$have_motif" = yes ; then
-  echo $ac_n "checking whether Motif is really LessTif""... $ac_c" 1>&6
-echo "configure:7862: checking whether Motif is really LessTif" >&5
-if eval "test \"`echo '$''{'ac_cv_have_lesstif'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether Motif is really LessTif" >&5
+$as_echo_n "checking whether Motif is really LessTif... " >&6; }
+if ${ac_cv_have_lesstif+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
 else
-  
+
   ac_save_CPPFLAGS="$CPPFLAGS"
   ac_save_CPPFLAGS="$CPPFLAGS"
-  if test \! -z "$includedir" ; then 
+  if test \! -z "$includedir" ; then
     CPPFLAGS="$CPPFLAGS -I$includedir"
   fi
     CPPFLAGS="$CPPFLAGS -I$includedir"
   fi
-  CPPFLAGS="$CPPFLAGS $X_CFLAGS"
-  cat > conftest.$ac_ext <<EOF
-#line 7873 "configure"
-#include "confdefs.h"
+  CPPFLAGS="$CPPFLAGS $X_CFLAGS"
+  CPPFLAGS=`eval eval eval eval eval eval eval eval eval echo $CPPFLAGS`
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 #include <Xm/Xm.h>
 #include <Xm/Xm.h>
-int main() {
+int
+main ()
+{
 long vers = LesstifVersion;
 long vers = LesstifVersion;
-; return 0; }
-EOF
-if { (eval echo configure:7880: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
-  rm -rf conftest*
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
   ac_cv_have_lesstif=yes
 else
   ac_cv_have_lesstif=yes
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
   ac_cv_have_lesstif=no
 fi
   ac_cv_have_lesstif=no
 fi
-rm -f conftest*
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
   CPPFLAGS="$ac_save_CPPFLAGS"
 fi
   CPPFLAGS="$ac_save_CPPFLAGS"
 fi
-
-echo "$ac_t""$ac_cv_have_lesstif" 1>&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_lesstif" >&5
+$as_echo "$ac_cv_have_lesstif" >&6; }
   have_lesstif=$ac_cv_have_lesstif
 fi
 
   have_lesstif=$ac_cv_have_lesstif
 fi
 
@@ -7889,24 +11658,24 @@ lesstif_version_string=unknown
 if test "$have_lesstif" = yes ; then
   ltv=unknown
   echo unknown > conftest-lt
 if test "$have_lesstif" = yes ; then
   ltv=unknown
   echo unknown > conftest-lt
-  echo $ac_n "checking LessTif version number""... $ac_c" 1>&6
-echo "configure:7905: checking LessTif version number" >&5
-if eval "test \"`echo '$''{'ac_cv_lesstif_version_string'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking LessTif version number" >&5
+$as_echo_n "checking LessTif version number... " >&6; }
+if ${ac_cv_lesstif_version_string+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
 else
-  
+
   ac_save_CPPFLAGS="$CPPFLAGS"
   ac_save_CPPFLAGS="$CPPFLAGS"
-  if test \! -z "$includedir" ; then 
+  if test \! -z "$includedir" ; then
     CPPFLAGS="$CPPFLAGS -I$includedir"
   fi
   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
     CPPFLAGS="$CPPFLAGS -I$includedir"
   fi
   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
-  if test "$cross_compiling" = yes; then
+  CPPFLAGS=`eval eval eval eval eval eval eval eval eval echo $CPPFLAGS`
+  if test "$cross_compiling" = yes; then :
   ac_cv_lesstif_version=unknown
                      ac_cv_lesstif_version_string=unknown
 else
   ac_cv_lesstif_version=unknown
                      ac_cv_lesstif_version_string=unknown
 else
-  cat > conftest.$ac_ext <<EOF
-#line 7920 "configure"
-#include "confdefs.h"
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 #include <stdio.h>
                      #include <Xm/Xm.h>
                      int main() {
 #include <stdio.h>
                      #include <Xm/Xm.h>
                      int main() {
@@ -7917,27 +11686,24 @@ else
                        fclose(f);
                        exit(0);
                      }
                        fclose(f);
                        exit(0);
                      }
-EOF
-if { (eval echo configure:7933: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
-then
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
   ltv=`cat conftest-lt`
                      ac_cv_lesstif_version=`echo $ltv | sed 's/ .*//'`
                      ac_cv_lesstif_version_string=`echo $ltv | sed 's/.* //'`
 else
   ltv=`cat conftest-lt`
                      ac_cv_lesstif_version=`echo $ltv | sed 's/ .*//'`
                      ac_cv_lesstif_version_string=`echo $ltv | sed 's/.* //'`
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -fr conftest*
   ac_cv_lesstif_version=unknown
                      ac_cv_lesstif_version_string=unknown
 fi
   ac_cv_lesstif_version=unknown
                      ac_cv_lesstif_version_string=unknown
 fi
-rm -fr conftest*
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
 fi
 
   CPPFLAGS="$ac_save_CPPFLAGS"
 fi
 fi
 
   CPPFLAGS="$ac_save_CPPFLAGS"
 fi
-
-echo "$ac_t""$ac_cv_lesstif_version_string" 1>&6
-  rm -f conftest-lt
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lesstif_version_string" >&5
+$as_echo "$ac_cv_lesstif_version_string" >&6; }
+  rm -rf conftest-lt
   lesstif_version=$ac_cv_lesstif_version
   lesstif_version_string=$ac_cv_lesstif_version_string
 
   lesstif_version=$ac_cv_lesstif_version
   lesstif_version_string=$ac_cv_lesstif_version_string
 
 if test "$have_motif" = yes ; then
   mtv=unknown
   echo unknown > conftest-mt
 if test "$have_motif" = yes ; then
   mtv=unknown
   echo unknown > conftest-mt
-  echo $ac_n "checking Motif version number""... $ac_c" 1>&6
-echo "configure:7963: checking Motif version number" >&5
-if eval "test \"`echo '$''{'ac_cv_motif_version_string'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking Motif version number" >&5
+$as_echo_n "checking Motif version number... " >&6; }
+if ${ac_cv_motif_version_string+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
 else
-  
+
   ac_save_CPPFLAGS="$CPPFLAGS"
   ac_save_CPPFLAGS="$CPPFLAGS"
-  if test \! -z "$includedir" ; then 
+  if test \! -z "$includedir" ; then
     CPPFLAGS="$CPPFLAGS -I$includedir"
   fi
   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
     CPPFLAGS="$CPPFLAGS -I$includedir"
   fi
   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
-  if test "$cross_compiling" = yes; then
+  CPPFLAGS=`eval eval eval eval eval eval eval eval eval echo $CPPFLAGS`
+  if test "$cross_compiling" = yes; then :
   ac_cv_motif_version=unknown
                      ac_cv_motif_version_string=unknown
 else
   ac_cv_motif_version=unknown
                      ac_cv_motif_version_string=unknown
 else
-  cat > conftest.$ac_ext <<EOF
-#line 7978 "configure"
-#include "confdefs.h"
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 #include <stdio.h>
                      #include <Xm/Xm.h>
                      int main() {
 #include <stdio.h>
                      #include <Xm/Xm.h>
                      int main() {
@@ -7975,27 +11741,24 @@ else
                        fclose(f);
                        exit(0);
                      }
                        fclose(f);
                        exit(0);
                      }
-EOF
-if { (eval echo configure:7991: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
-then
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
   mtv=`cat conftest-mt`
                      ac_cv_motif_version=`echo $mtv | sed 's/ .*//'`
                      ac_cv_motif_version_string=`echo $mtv | sed 's/.* //'`
 else
   mtv=`cat conftest-mt`
                      ac_cv_motif_version=`echo $mtv | sed 's/ .*//'`
                      ac_cv_motif_version_string=`echo $mtv | sed 's/.* //'`
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -fr conftest*
   ac_cv_motif_version=unknown
                      ac_cv_motif_version_string=unknown
 fi
   ac_cv_motif_version=unknown
                      ac_cv_motif_version_string=unknown
 fi
-rm -fr conftest*
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
 fi
 
   CPPFLAGS="$ac_save_CPPFLAGS"
 fi
 fi
 
   CPPFLAGS="$ac_save_CPPFLAGS"
 fi
-
-echo "$ac_t""$ac_cv_motif_version_string" 1>&6
-  rm -f conftest-mt
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_motif_version_string" >&5
+$as_echo "$ac_cv_motif_version_string" >&6; }
+  rm -rf conftest-mt
   motif_version=$ac_cv_motif_version
   motif_version_string=$ac_cv_motif_version_string
 
   motif_version=$ac_cv_motif_version
   motif_version_string=$ac_cv_motif_version_string
 
 
 motif_requires_xpm=no
 if test "$have_motif" = yes ; then
 
 motif_requires_xpm=no
 if test "$have_motif" = yes ; then
-   echo $ac_n "checking whether Motif requires XPM""... $ac_c" 1>&6
-echo "configure:8035: checking whether Motif requires XPM" >&5
+   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether Motif requires XPM" >&5
+$as_echo_n "checking whether Motif requires XPM... " >&6; }
    if test "$motif_version" = "unknown" || test "$motif_version" -ge 2000
    then
      motif_requires_xpm=yes
    if test "$motif_version" = "unknown" || test "$motif_version" -ge 2000
    then
      motif_requires_xpm=yes
-     echo "$ac_t""maybe" 1>&6
+     { $as_echo "$as_me:${as_lineno-$LINENO}: result: maybe" >&5
+$as_echo "maybe" >&6; }
    else
    else
-     echo "$ac_t""no" 1>&6
+     { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
    fi
 fi
 
    fi
 fi
 
 have_xp_ext=no
 if test "$have_motif" = yes ; then
    have_xp_ext=no
 have_xp_ext=no
 if test "$have_motif" = yes ; then
    have_xp_ext=no
-   
+
   ac_save_CPPFLAGS="$CPPFLAGS"
   ac_save_LDFLAGS="$LDFLAGS"
 #  ac_save_LIBS="$LIBS"
 
   ac_save_CPPFLAGS="$CPPFLAGS"
   ac_save_LDFLAGS="$LDFLAGS"
 #  ac_save_LIBS="$LIBS"
 
-  if test \! -z "$includedir" ; then 
+  if test \! -z "$includedir" ; then
     CPPFLAGS="$CPPFLAGS -I$includedir"
   fi
   # note: $X_CFLAGS includes $x_includes
     CPPFLAGS="$CPPFLAGS -I$includedir"
   fi
   # note: $X_CFLAGS includes $x_includes
@@ -8061,51 +11826,54 @@ if test "$have_motif" = yes ; then
   # note: $X_LIBS includes $x_libraries
   LDFLAGS="$LDFLAGS $X_LIBS $X_EXTRA_LIBS"
 
   # note: $X_LIBS includes $x_libraries
   LDFLAGS="$LDFLAGS $X_LIBS $X_EXTRA_LIBS"
 
-  echo $ac_n "checking for XpQueryExtension in -lXp""... $ac_c" 1>&6
-echo "configure:8077: checking for XpQueryExtension in -lXp" >&5
-ac_lib_var=`echo Xp'_'XpQueryExtension | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+  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:${as_lineno-$LINENO}: checking for XpQueryExtension in -lXp" >&5
+$as_echo_n "checking for XpQueryExtension in -lXp... " >&6; }
+if ${ac_cv_lib_Xp_XpQueryExtension+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
 else
-  ac_save_LIBS="$LIBS"
+  ac_check_lib_save_LIBS=$LIBS
 LIBS="-lXp -lX11 -lXext -lm $LIBS"
 LIBS="-lXp -lX11 -lXext -lm $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 8085 "configure"
-#include "confdefs.h"
-/* Override any gcc2 internal prototype to avoid an error.  */
-/* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char XpQueryExtension();
-
-int main() {
-XpQueryExtension()
-; return 0; }
-EOF
-if { (eval echo configure:8096: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=yes"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* 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 XpQueryExtension ();
+int
+main ()
+{
+return XpQueryExtension ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_Xp_XpQueryExtension=yes
 else
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=no"
+  ac_cv_lib_Xp_XpQueryExtension=no
 fi
 fi
-rm -f conftest*
-LIBS="$ac_save_LIBS"
-
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
 fi
 fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Xp_XpQueryExtension" >&5
+$as_echo "$ac_cv_lib_Xp_XpQueryExtension" >&6; }
+if test "x$ac_cv_lib_Xp_XpQueryExtension" = xyes; then :
   have_xp_ext=yes; MOTIF_LIBS="$MOTIF_LIBS -lXp"
 else
   have_xp_ext=yes; MOTIF_LIBS="$MOTIF_LIBS -lXp"
 else
-  echo "$ac_t""no" 1>&6
-true
+  true
 fi
 
   CPPFLAGS="$ac_save_CPPFLAGS"
   LDFLAGS="$ac_save_LDFLAGS"
 #  LIBS="$ac_save_LIBS"
 fi
 
   CPPFLAGS="$ac_save_CPPFLAGS"
   LDFLAGS="$ac_save_LDFLAGS"
 #  LIBS="$ac_save_LIBS"
-  
+
 fi
 
 
 fi
 
 
 
 have_xintl=no
 if test "$have_motif" = yes ; then
 
 have_xintl=no
 if test "$have_motif" = yes ; then
-  
+
   ac_save_CPPFLAGS="$CPPFLAGS"
   ac_save_LDFLAGS="$LDFLAGS"
 #  ac_save_LIBS="$LIBS"
 
   ac_save_CPPFLAGS="$CPPFLAGS"
   ac_save_LDFLAGS="$LDFLAGS"
 #  ac_save_LIBS="$LIBS"
 
-  if test \! -z "$includedir" ; then 
+  if test \! -z "$includedir" ; then
     CPPFLAGS="$CPPFLAGS -I$includedir"
   fi
   # note: $X_CFLAGS includes $x_includes
     CPPFLAGS="$CPPFLAGS -I$includedir"
   fi
   # note: $X_CFLAGS includes $x_includes
@@ -8134,51 +11902,54 @@ if test "$have_motif" = yes ; then
   # note: $X_LIBS includes $x_libraries
   LDFLAGS="$LDFLAGS $X_LIBS $X_EXTRA_LIBS"
 
   # note: $X_LIBS includes $x_libraries
   LDFLAGS="$LDFLAGS $X_LIBS $X_EXTRA_LIBS"
 
-  echo $ac_n "checking for _Xsetlocale in -lXintl""... $ac_c" 1>&6
-echo "configure:8150: checking for _Xsetlocale in -lXintl" >&5
-ac_lib_var=`echo Xintl'_'_Xsetlocale | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+  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:${as_lineno-$LINENO}: checking for _Xsetlocale in -lXintl" >&5
+$as_echo_n "checking for _Xsetlocale in -lXintl... " >&6; }
+if ${ac_cv_lib_Xintl__Xsetlocale+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
 else
-  ac_save_LIBS="$LIBS"
+  ac_check_lib_save_LIBS=$LIBS
 LIBS="-lXintl -lX11 -lXext -lm $LIBS"
 LIBS="-lXintl -lX11 -lXext -lm $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 8158 "configure"
-#include "confdefs.h"
-/* Override any gcc2 internal prototype to avoid an error.  */
-/* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char _Xsetlocale();
-
-int main() {
-_Xsetlocale()
-; return 0; }
-EOF
-if { (eval echo configure:8169: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=yes"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* 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 _Xsetlocale ();
+int
+main ()
+{
+return _Xsetlocale ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_Xintl__Xsetlocale=yes
 else
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=no"
+  ac_cv_lib_Xintl__Xsetlocale=no
 fi
 fi
-rm -f conftest*
-LIBS="$ac_save_LIBS"
-
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
 fi
 fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Xintl__Xsetlocale" >&5
+$as_echo "$ac_cv_lib_Xintl__Xsetlocale" >&6; }
+if test "x$ac_cv_lib_Xintl__Xsetlocale" = xyes; then :
   have_xintl=yes
 else
   have_xintl=yes
 else
-  echo "$ac_t""no" 1>&6
-have_xintl=no
+  have_xintl=no
 fi
 
   CPPFLAGS="$ac_save_CPPFLAGS"
   LDFLAGS="$ac_save_LDFLAGS"
 #  LIBS="$ac_save_LIBS"
 fi
 
   CPPFLAGS="$ac_save_CPPFLAGS"
   LDFLAGS="$ac_save_LDFLAGS"
 #  LIBS="$ac_save_LIBS"
-  
+
   if test "$have_xintl" = yes; then
     MOTIF_LIBS="$MOTIF_LIBS -lXintl"
   fi
   if test "$have_xintl" = yes; then
     MOTIF_LIBS="$MOTIF_LIBS -lXintl"
   fi
@@ -8195,10 +11966,10 @@ have_gl=no
 ac_have_mesa_gl=no
 with_gl_req=unspecified
 gl_halfassed=no
 ac_have_mesa_gl=no
 with_gl_req=unspecified
 gl_halfassed=no
-# Check whether --with-gl or --without-gl was given.
-if test "${with_gl+set}" = set; then
-  withval="$with_gl"
-  with_gl="$withval"; with_gl_req="$withval"
+
+# Check whether --with-gl was given.
+if test "${with_gl+set}" = set; then :
+  withval=$with_gl; with_gl="$withval"; with_gl_req="$withval"
 else
   with_gl=yes
 fi
 else
   with_gl=yes
 fi
     no)  ;;
 
     /*)
     no)  ;;
 
     /*)
-     echo $ac_n "checking for GL headers""... $ac_c" 1>&6
-echo "configure:8226: checking for GL headers" >&5
+     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GL headers" >&5
+$as_echo_n "checking for GL headers... " >&6; }
      d=$with_gl/include
      if test -d $d; then
        X_CFLAGS="-I$d $X_CFLAGS"
      d=$with_gl/include
      if test -d $d; then
        X_CFLAGS="-I$d $X_CFLAGS"
-       echo "$ac_t""$d" 1>&6
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $d" >&5
+$as_echo "$d" >&6; }
      else
      else
-       echo "$ac_t""not found ($d: no such directory)" 1>&6
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found ($d: no such directory)" >&5
+$as_echo "not found ($d: no such directory)" >&6; }
      fi
 
      fi
 
-     echo $ac_n "checking for GL libs""... $ac_c" 1>&6
-echo "configure:8236: checking for GL libs" >&5
+     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GL libs" >&5
+$as_echo_n "checking for GL libs... " >&6; }
      d=$with_gl/lib
      if test -d $d; then
        X_LIBS="-L$d $X_LIBS"
      d=$with_gl/lib
      if test -d $d; then
        X_LIBS="-L$d $X_LIBS"
-       echo "$ac_t""$d" 1>&6
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $d" >&5
+$as_echo "$d" >&6; }
      else
      else
-       echo "$ac_t""not found ($d: no such directory)" 1>&6
+       { $as_echo "$as_me:${as_lineno-$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".
      fi
 
      # replace the directory string with "yes".
@@ -8243,92 +12018,45 @@ echo "configure:8236: checking for GL libs" >&5
      exit 1
      ;;
    esac
      exit 1
      ;;
    esac
-  
+
 
 ac_mesagl_version=unknown
 ac_mesagl_version_string=unknown
 
 if test "$with_gl" = yes; then
 
 ac_mesagl_version=unknown
 ac_mesagl_version_string=unknown
 
 if test "$with_gl" = yes; then
-  
+
   ac_save_CPPFLAGS="$CPPFLAGS"
   ac_save_CPPFLAGS="$CPPFLAGS"
-  if test \! -z "$includedir" ; then 
+  if test \! -z "$includedir" ; then
     CPPFLAGS="$CPPFLAGS -I$includedir"
   fi
   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
     CPPFLAGS="$CPPFLAGS -I$includedir"
   fi
   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
-  ac_safe=`echo "GL/gl.h" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for GL/gl.h""... $ac_c" 1>&6
-echo "configure:8272: checking for GL/gl.h" >&5
-if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  cat > conftest.$ac_ext <<EOF
-#line 8277 "configure"
-#include "confdefs.h"
-#include <GL/gl.h>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:8282: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
-  rm -rf conftest*
-  eval "ac_cv_header_$ac_safe=yes"
-else
-  echo "$ac_err" >&5
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_header_$ac_safe=no"
-fi
-rm -f conftest*
-fi
-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
+  CPPFLAGS=`eval eval eval eval eval eval eval eval eval echo $CPPFLAGS`
+  ac_fn_c_check_header_mongrel "$LINENO" "GL/gl.h" "ac_cv_header_GL_gl_h" "$ac_includes_default"
+if test "x$ac_cv_header_GL_gl_h" = xyes; then :
   have_gl=yes
 else
   have_gl=yes
 else
-  echo "$ac_t""no" 1>&6
+  have_gl=no
 fi
 
 fi
 
+
   CPPFLAGS="$ac_save_CPPFLAGS"
   if test "$have_gl" = yes ; then
   CPPFLAGS="$ac_save_CPPFLAGS"
   if test "$have_gl" = yes ; then
-    
+
   ac_save_CPPFLAGS="$CPPFLAGS"
   ac_save_CPPFLAGS="$CPPFLAGS"
-  if test \! -z "$includedir" ; then 
+  if test \! -z "$includedir" ; then
     CPPFLAGS="$CPPFLAGS -I$includedir"
   fi
   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
     CPPFLAGS="$CPPFLAGS -I$includedir"
   fi
   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
-  ac_safe=`echo "GL/glx.h" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for GL/glx.h""... $ac_c" 1>&6
-echo "configure:8313: checking for GL/glx.h" >&5
-if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  cat > conftest.$ac_ext <<EOF
-#line 8318 "configure"
-#include "confdefs.h"
-#include <GL/glx.h>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:8323: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
-  rm -rf conftest*
-  eval "ac_cv_header_$ac_safe=yes"
-else
-  echo "$ac_err" >&5
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_header_$ac_safe=no"
-fi
-rm -f conftest*
-fi
-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
+  CPPFLAGS=`eval eval eval eval eval eval eval eval eval echo $CPPFLAGS`
+  ac_fn_c_check_header_compile "$LINENO" "GL/glx.h" "ac_cv_header_GL_glx_h" "#include <GL/gl.h>
+"
+if test "x$ac_cv_header_GL_glx_h" = xyes; then :
   have_gl=yes
 else
   have_gl=yes
 else
-  echo "$ac_t""no" 1>&6
+  have_gl=no
 fi
 
 fi
 
+
   CPPFLAGS="$ac_save_CPPFLAGS"
   fi
 
   CPPFLAGS="$ac_save_CPPFLAGS"
   fi
 
     # We need to know whether it's MesaGL so that we know which libraries
     # to link against.
     #
     # We need to know whether it's MesaGL so that we know which libraries
     # to link against.
     #
-    echo $ac_n "checking whether GL is really MesaGL""... $ac_c" 1>&6
-echo "configure:8355: checking whether GL is really MesaGL" >&5
-if eval "test \"`echo '$''{'ac_cv_have_mesa_gl'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether GL is really MesaGL" >&5
+$as_echo_n "checking whether GL is really MesaGL... " >&6; }
+if ${ac_cv_have_mesa_gl+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
   ac_cv_have_mesa_gl=no
 else
   ac_cv_have_mesa_gl=no
-       
+       if test "$ac_macosx" = no; then
+         # WTF! MacOS 10.5.0 ships the Mesa GL headers!
+         # It's not really Mesa, is it?
+
   ac_save_CPPFLAGS="$CPPFLAGS"
   ac_save_CPPFLAGS="$CPPFLAGS"
-  if test \! -z "$includedir" ; then 
+  if test \! -z "$includedir" ; then
     CPPFLAGS="$CPPFLAGS -I$includedir"
   fi
   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
     CPPFLAGS="$CPPFLAGS -I$includedir"
   fi
   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
-  cat > conftest.$ac_ext <<EOF
-#line 8367 "configure"
-#include "confdefs.h"
+  CPPFLAGS=`eval eval eval eval eval eval eval eval eval echo $CPPFLAGS`
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 #include <GL/glx.h>
 #include <GL/glx.h>
-EOF
+
+_ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  egrep "Mesa|MESA" >/dev/null 2>&1; then
-  rm -rf conftest*
+  $EGREP "Mesa|MESA" >/dev/null 2>&1; then :
   ac_cv_have_mesa_gl=yes
 fi
   ac_cv_have_mesa_gl=yes
 fi
-rm -f conftest*
+rm -rf conftest*
 
   CPPFLAGS="$ac_save_CPPFLAGS"
 
   CPPFLAGS="$ac_save_CPPFLAGS"
-      
+       fi
 fi
 fi
-
-echo "$ac_t""$ac_cv_have_mesa_gl" 1>&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_mesa_gl" >&5
+$as_echo "$ac_cv_have_mesa_gl" >&6; }
     ac_have_mesa_gl=$ac_cv_have_mesa_gl
     ac_have_mesa_gl=$ac_cv_have_mesa_gl
 
     gl_lib_1=""
     GL_LIBS=""
 
 
     gl_lib_1=""
     GL_LIBS=""
 
+    if test "$ac_macosx" = yes; then
+
+      # Without these, every link against libGL gets a bunch of useless
+      # warnings.
+      #
+      osx_crud="-bind_at_load -multiply_defined suppress"
+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: adding \"$osx_crud\" to GL_LIBS" >&5
+$as_echo "adding \"$osx_crud\" to GL_LIBS" >&6; }
+      GL_LIBS="$GL_LIBS $osx_crud"
+      unset osx_crud
+
+      # New lossage in 10.5.0: without this, we get:
+      #   ld: cycle in dylib re-exports with /usr/X11/lib/libGL.dylib
+      #
+      osx_crud="/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib"
+      osx_crud="-Wl,-dylib_file,${osx_crud}:${osx_crud}"
+
+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: adding \"$osx_crud\" to GL_LIBS" >&5
+$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:${as_lineno-$LINENO}: result: omitting \"$libdir\" from LDFLAGS" >&5
+$as_echo "omitting \"$libdir\" from LDFLAGS" >&6; }
+      libdir=''
+
+    fi
+
 
     # Some versions of MesaGL are compiled to require -lpthread.
     # So if the Mesa headers exist, and -lpthread exists, then always
     # link -lpthread after the Mesa libs (be they named -lGL or -lMesaGL.)
     #
     if test "$ac_have_mesa_gl" = yes; then
 
     # Some versions of MesaGL are compiled to require -lpthread.
     # So if the Mesa headers exist, and -lpthread exists, then always
     # link -lpthread after the Mesa libs (be they named -lGL or -lMesaGL.)
     #
     if test "$ac_have_mesa_gl" = yes; then
-      echo $ac_n "checking for pthread_create in -lpthread""... $ac_c" 1>&6
-echo "configure:8396: checking for pthread_create in -lpthread" >&5
-ac_lib_var=`echo pthread'_'pthread_create | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_create in -lpthread" >&5
+$as_echo_n "checking for pthread_create in -lpthread... " >&6; }
+if ${ac_cv_lib_pthread_pthread_create+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
 else
-  ac_save_LIBS="$LIBS"
+  ac_check_lib_save_LIBS=$LIBS
 LIBS="-lpthread  $LIBS"
 LIBS="-lpthread  $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 8404 "configure"
-#include "confdefs.h"
-/* Override any gcc2 internal prototype to avoid an error.  */
-/* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char pthread_create();
-
-int main() {
-pthread_create()
-; return 0; }
-EOF
-if { (eval echo configure:8415: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=yes"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* 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 pthread_create ();
+int
+main ()
+{
+return pthread_create ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_pthread_pthread_create=yes
 else
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=no"
+  ac_cv_lib_pthread_pthread_create=no
 fi
 fi
-rm -f conftest*
-LIBS="$ac_save_LIBS"
-
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
 fi
 fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_create" >&5
+$as_echo "$ac_cv_lib_pthread_pthread_create" >&6; }
+if test "x$ac_cv_lib_pthread_pthread_create" = xyes; then :
   GL_LIBS="-lpthread"
   GL_LIBS="-lpthread"
-else
-  echo "$ac_t""no" 1>&6
 fi
 
     fi
 fi
 
     fi
     #
 
     if test "$ac_have_mesa_gl" = yes ; then
     #
 
     if test "$ac_have_mesa_gl" = yes ; then
-      
+
   ac_save_CPPFLAGS="$CPPFLAGS"
   ac_save_LDFLAGS="$LDFLAGS"
 #  ac_save_LIBS="$LIBS"
 
   ac_save_CPPFLAGS="$CPPFLAGS"
   ac_save_LDFLAGS="$LDFLAGS"
 #  ac_save_LIBS="$LIBS"
 
-  if test \! -z "$includedir" ; then 
+  if test \! -z "$includedir" ; then
     CPPFLAGS="$CPPFLAGS -I$includedir"
   fi
   # note: $X_CFLAGS includes $x_includes
     CPPFLAGS="$CPPFLAGS -I$includedir"
   fi
   # note: $X_CFLAGS includes $x_includes
   # note: $X_LIBS includes $x_libraries
   LDFLAGS="$LDFLAGS $X_LIBS $X_EXTRA_LIBS"
 
   # note: $X_LIBS includes $x_libraries
   LDFLAGS="$LDFLAGS $X_LIBS $X_EXTRA_LIBS"
 
-  echo $ac_n "checking for glXCreateContext in -lMesaGL""... $ac_c" 1>&6
-echo "configure:8462: checking for glXCreateContext in -lMesaGL" >&5
-ac_lib_var=`echo MesaGL'_'glXCreateContext | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  ac_save_LIBS="$LIBS"
-LIBS="-lMesaGL -lMesaGLU $GL_LIBS -lX11 -lXext -lm $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 8470 "configure"
-#include "confdefs.h"
-/* Override any gcc2 internal prototype to avoid an error.  */
-/* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char glXCreateContext();
-
-int main() {
-glXCreateContext()
-; return 0; }
-EOF
-if { (eval echo configure:8481: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=yes"
+  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:${as_lineno-$LINENO}: checking for glXCreateContext in -lMesaGL" >&5
+$as_echo_n "checking for glXCreateContext in -lMesaGL... " >&6; }
+if ${ac_cv_lib_MesaGL_glXCreateContext+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lMesaGL -lMesaGLU $GL_LIBS -lX11 -lXext $VIDMODE_LIBS -lm $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* 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 glXCreateContext ();
+int
+main ()
+{
+return glXCreateContext ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_MesaGL_glXCreateContext=yes
 else
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=no"
+  ac_cv_lib_MesaGL_glXCreateContext=no
 fi
 fi
-rm -f conftest*
-LIBS="$ac_save_LIBS"
-
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
 fi
 fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_MesaGL_glXCreateContext" >&5
+$as_echo "$ac_cv_lib_MesaGL_glXCreateContext" >&6; }
+if test "x$ac_cv_lib_MesaGL_glXCreateContext" = xyes; then :
   gl_lib_1="MesaGL"
   gl_lib_1="MesaGL"
-                      GL_LIBS="-lMesaGL -lMesaGLU $GL_LIBS"
-else
-  echo "$ac_t""no" 1>&6
+                      GL_LIBS="-lMesaGL -lMesaGLU $VIDMODE_LIBS $GL_LIBS"
 fi
 
   CPPFLAGS="$ac_save_CPPFLAGS"
   LDFLAGS="$ac_save_LDFLAGS"
 #  LIBS="$ac_save_LIBS"
 fi
 
   CPPFLAGS="$ac_save_CPPFLAGS"
   LDFLAGS="$ac_save_LDFLAGS"
 #  LIBS="$ac_save_LIBS"
-  
+
     fi
 
     if test "$gl_lib_1" = "" ; then
     fi
 
     if test "$gl_lib_1" = "" ; then
-      
+
   ac_save_CPPFLAGS="$CPPFLAGS"
   ac_save_LDFLAGS="$LDFLAGS"
 #  ac_save_LIBS="$LIBS"
 
   ac_save_CPPFLAGS="$CPPFLAGS"
   ac_save_LDFLAGS="$LDFLAGS"
 #  ac_save_LIBS="$LIBS"
 
-  if test \! -z "$includedir" ; then 
+  if test \! -z "$includedir" ; then
     CPPFLAGS="$CPPFLAGS -I$includedir"
   fi
   # note: $X_CFLAGS includes $x_includes
     CPPFLAGS="$CPPFLAGS -I$includedir"
   fi
   # note: $X_CFLAGS includes $x_includes
   # note: $X_LIBS includes $x_libraries
   LDFLAGS="$LDFLAGS $X_LIBS $X_EXTRA_LIBS"
 
   # note: $X_LIBS includes $x_libraries
   LDFLAGS="$LDFLAGS $X_LIBS $X_EXTRA_LIBS"
 
-  echo $ac_n "checking for glXCreateContext in -lGL""... $ac_c" 1>&6
-echo "configure:8527: checking for glXCreateContext in -lGL" >&5
-ac_lib_var=`echo GL'_'glXCreateContext | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  ac_save_LIBS="$LIBS"
-LIBS="-lGL -lGLU $GL_LIBS -lX11 -lXext -lm $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 8535 "configure"
-#include "confdefs.h"
-/* Override any gcc2 internal prototype to avoid an error.  */
-/* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char glXCreateContext();
-
-int main() {
-glXCreateContext()
-; return 0; }
-EOF
-if { (eval echo configure:8546: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=yes"
+  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:${as_lineno-$LINENO}: checking for glXCreateContext in -lGL" >&5
+$as_echo_n "checking for glXCreateContext in -lGL... " >&6; }
+if ${ac_cv_lib_GL_glXCreateContext+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lGL -lGLU $GL_LIBS -lX11 -lXext $VIDMODE_LIBS -lm $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* 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 glXCreateContext ();
+int
+main ()
+{
+return glXCreateContext ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_GL_glXCreateContext=yes
 else
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=no"
+  ac_cv_lib_GL_glXCreateContext=no
 fi
 fi
-rm -f conftest*
-LIBS="$ac_save_LIBS"
-
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
 fi
 fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_GL_glXCreateContext" >&5
+$as_echo "$ac_cv_lib_GL_glXCreateContext" >&6; }
+if test "x$ac_cv_lib_GL_glXCreateContext" = xyes; then :
   gl_lib_1="GL"
   gl_lib_1="GL"
-                      GL_LIBS="-lGL -lGLU $GL_LIBS"
-else
-  echo "$ac_t""no" 1>&6
+                      GL_LIBS="-lGL -lGLU $VIDMODE_LIBS $GL_LIBS"
 fi
 
   CPPFLAGS="$ac_save_CPPFLAGS"
   LDFLAGS="$ac_save_LDFLAGS"
 #  LIBS="$ac_save_LIBS"
 fi
 
   CPPFLAGS="$ac_save_CPPFLAGS"
   LDFLAGS="$ac_save_LDFLAGS"
 #  LIBS="$ac_save_LIBS"
-  
+
     fi
 
     if test "$gl_lib_1" = "" ; then
     fi
 
     if test "$gl_lib_1" = "" ; then
       gl_halfassed=yes
     else
       # linking works -- we can build the GL hacks.
       gl_halfassed=yes
     else
       # linking works -- we can build the GL hacks.
-      cat >> confdefs.h <<\EOF
-#define HAVE_GL 1
-EOF
+      $as_echo "#define HAVE_GL 1" >>confdefs.h
 
       if test "$ac_have_mesa_gl" = yes ; then
 
       if test "$ac_have_mesa_gl" = yes ; then
-        cat >> confdefs.h <<\EOF
-#define HAVE_MESA_GL 1
-EOF
+        $as_echo "#define HAVE_MESA_GL 1" >>confdefs.h
 
       fi
     fi
 
       fi
     fi
@@ -8588,36 +12351,59 @@ EOF
     #
     if test "$ac_have_mesa_gl" = yes; then
 
     #
     if test "$ac_have_mesa_gl" = yes; then
 
-      echo $ac_n "checking MesaGL version number""... $ac_c" 1>&6
-echo "configure:8604: checking MesaGL version number" >&5
-if eval "test \"`echo '$''{'ac_cv_mesagl_version_string'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking MesaGL version number" >&5
+$as_echo_n "checking MesaGL version number... " >&6; }
+if ${ac_cv_mesagl_version_string+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
   cat > conftest.$ac_ext <<EOF
 else
   cat > conftest.$ac_ext <<EOF
-#line 8609 "configure"
+#line 12364 "configure"
 #include "confdefs.h"
 #include <GL/gl.h>
 #ifndef MESA_MAJOR_VERSION
 # include <GL/xmesa.h>
 #include "confdefs.h"
 #include <GL/gl.h>
 #ifndef MESA_MAJOR_VERSION
 # include <GL/xmesa.h>
-# define MESA_MAJOR_VERSION XMESA_MAJOR_VERSION
-# define MESA_MINOR_VERSION XMESA_MINOR_VERSION
+# ifdef XMESA_MAJOR_VERSION
+   /* Around Mesa 3.2, they took out the Mesa version number, so instead,
+      we have to check the XMesa version number (the number of the X protocol
+      support, which seems to be the same as the Mesa version number.)
+    */
+#  define MESA_MAJOR_VERSION XMESA_MAJOR_VERSION
+#  define MESA_MINOR_VERSION XMESA_MINOR_VERSION
+# else
+   /* Oh great.  Some time after 3.4, they took out the xmesa.h header file,
+      so we have no way of telling what version of Mesa this is at all.
+      So, we'll guess that the osmesa version (the "offscreen protocol")
+      is less than or equal to the real mesa version number.  Except that
+      if OSmesa is 3.3, assume at least Mesa 3.4, since OSmesa was 3.3 in
+      Mesa 3.4.  And Mesa 3.3 had xmesa.h.  What a complete load of shit!
+    */
+# include <GL/osmesa.h>
+#  define MESA_MAJOR_VERSION OSMESA_MAJOR_VERSION
+#  define MESA_MINOR_VERSION OSMESA_MINOR_VERSION or newer, probably?
+#  if OSMESA_MAJOR_VERSION == 3 && OSMESA_MINOR_VERSION == 3
+#   undef MESA_MINOR_VERSION
+#   define MESA_MINOR_VERSION 4 or newer, probably?
+#  endif
+# endif
 #endif
 configure: MESA_MAJOR_VERSION MESA_MINOR_VERSION
 EOF
 
          ac_save_CPPFLAGS="$CPPFLAGS"
 #endif
 configure: MESA_MAJOR_VERSION MESA_MINOR_VERSION
 EOF
 
          ac_save_CPPFLAGS="$CPPFLAGS"
-         if test \! -z "$includedir" ; then 
+         if test \! -z "$includedir" ; then
            CPPFLAGS="$CPPFLAGS -I$includedir"
          fi
          CPPFLAGS="$CPPFLAGS $X_CFLAGS"
 
            CPPFLAGS="$CPPFLAGS -I$includedir"
          fi
          CPPFLAGS="$CPPFLAGS $X_CFLAGS"
 
-          # M4 sucks!!
-         
-         mglv=`(eval "$ac_cpp conftest.$ac_ext") 2>&5 | sed -n \
-              's/^configure:.*\([0-9][0-9]*\).*\([0-9][0-9]*\).*$/\1.\2/p'`
-         
+         mglv=`(eval "$ac_cpp conftest.$ac_ext") 2>&5 | grep configure:`
+
+         # M4 sucks!!
 
 
-         rm -f conftest.$ac_ext
+          mglv=`echo "$mglv" | sed -n \
+             's/^configure: *\([0-9][0-9]*\)  *\([0-9].*\)$/\1.\2/p'`
+
+
+         rm -rf conftest.$ac_ext
 
          CPPFLAGS="$ac_save_CPPFLAGS"
 
 
          CPPFLAGS="$ac_save_CPPFLAGS"
 
@@ -8625,9 +12411,12 @@ EOF
            ac_mesagl_version=unknown
            ac_mesagl_version_string=unknown
          else
            ac_mesagl_version=unknown
            ac_mesagl_version_string=unknown
          else
-           ac_mesagl_version_string=$mglv
-           maj=`echo $mglv | sed -n 's/\..*//p'`
-           min=`echo $mglv | sed -n 's/.*\.//p'`
+           ac_mesagl_version_string="$mglv"
+           # M4 sucks!!
+
+           maj=`echo "$mglv" | sed -n 's/^\([0-9][0-9]*\)\..*$/\1/p'`
+           min=`echo "$mglv" | sed -n 's/^.*\.\([0-9][0-9]*\).*$/\1/p'`
+
            ac_mesagl_version=`echo "$maj * 1000 + $min" | bc`
            if test -z "$ac_mesagl_version"; then
              ac_mesagl_version=unknown
            ac_mesagl_version=`echo "$maj * 1000 + $min" | bc`
            if test -z "$ac_mesagl_version"; then
              ac_mesagl_version=unknown
@@ -8636,10 +12425,10 @@ EOF
          fi
          ac_cv_mesagl_version=$ac_mesagl_version
          ac_cv_mesagl_version_string=$ac_mesagl_version_string
          fi
          ac_cv_mesagl_version=$ac_mesagl_version
          ac_cv_mesagl_version_string=$ac_mesagl_version_string
-      
-fi
 
 
-echo "$ac_t""$ac_cv_mesagl_version_string" 1>&6
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_mesagl_version_string" >&5
+$as_echo "$ac_cv_mesagl_version_string" >&6; }
       ac_mesagl_version=$ac_cv_mesagl_version
       ac_mesagl_version_string=$ac_cv_mesagl_version_string
     fi
       ac_mesagl_version=$ac_cv_mesagl_version
       ac_mesagl_version_string=$ac_cv_mesagl_version_string
     fi
@@ -8647,12 +12436,12 @@ echo "$ac_t""$ac_cv_mesagl_version_string" 1>&6
 
     # Check for OpenGL 1.1 features.
     #
 
     # Check for OpenGL 1.1 features.
     #
-    
+
   ac_save_CPPFLAGS="$CPPFLAGS"
   ac_save_LDFLAGS="$LDFLAGS"
 #  ac_save_LIBS="$LIBS"
 
   ac_save_CPPFLAGS="$CPPFLAGS"
   ac_save_LDFLAGS="$LDFLAGS"
 #  ac_save_LIBS="$LIBS"
 
-  if test \! -z "$includedir" ; then 
+  if test \! -z "$includedir" ; then
     CPPFLAGS="$CPPFLAGS -I$includedir"
   fi
   # note: $X_CFLAGS includes $x_includes
     CPPFLAGS="$CPPFLAGS -I$includedir"
   fi
   # note: $X_CFLAGS includes $x_includes
@@ -8664,54 +12453,57 @@ echo "$ac_t""$ac_cv_mesagl_version_string" 1>&6
   # note: $X_LIBS includes $x_libraries
   LDFLAGS="$LDFLAGS $X_LIBS $X_EXTRA_LIBS"
 
   # note: $X_LIBS includes $x_libraries
   LDFLAGS="$LDFLAGS $X_LIBS $X_EXTRA_LIBS"
 
-  echo $ac_n "checking for glBindTexture in -l$gl_lib_1""... $ac_c" 1>&6
-echo "configure:8680: checking for glBindTexture in -l$gl_lib_1" >&5
-ac_lib_var=`echo $gl_lib_1'_'glBindTexture | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+  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_ac_Lib=`$as_echo "ac_cv_lib_$gl_lib_1''_glBindTexture" | $as_tr_sh`
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for glBindTexture in -l$gl_lib_1" >&5
+$as_echo_n "checking for glBindTexture in -l$gl_lib_1... " >&6; }
+if eval \${$as_ac_Lib+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
 else
-  ac_save_LIBS="$LIBS"
+  ac_check_lib_save_LIBS=$LIBS
 LIBS="-l$gl_lib_1 $GL_LIBS -lX11 -lXext -lm $LIBS"
 LIBS="-l$gl_lib_1 $GL_LIBS -lX11 -lXext -lm $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 8688 "configure"
-#include "confdefs.h"
-/* Override any gcc2 internal prototype to avoid an error.  */
-/* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char glBindTexture();
-
-int main() {
-glBindTexture()
-; return 0; }
-EOF
-if { (eval echo configure:8699: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=yes"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* 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 glBindTexture ();
+int
+main ()
+{
+return glBindTexture ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  eval "$as_ac_Lib=yes"
 else
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=no"
+  eval "$as_ac_Lib=no"
 fi
 fi
-rm -f conftest*
-LIBS="$ac_save_LIBS"
-
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
 fi
 fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-  cat >> confdefs.h <<\EOF
-#define HAVE_GLBINDTEXTURE 1
-EOF
+eval ac_res=\$$as_ac_Lib
+              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+if eval test \"x\$"$as_ac_Lib"\" = x"yes"; then :
+  $as_echo "#define HAVE_GLBINDTEXTURE 1" >>confdefs.h
 
 else
 
 else
-  echo "$ac_t""no" 1>&6
-true
+  true
 fi
 
   CPPFLAGS="$ac_save_CPPFLAGS"
   LDFLAGS="$ac_save_LDFLAGS"
 #  LIBS="$ac_save_LIBS"
 fi
 
   CPPFLAGS="$ac_save_CPPFLAGS"
   LDFLAGS="$ac_save_LDFLAGS"
 #  LIBS="$ac_save_LIBS"
-  
+
   fi
 
 elif test "$with_gl" != no; then
   fi
 
 elif test "$with_gl" != no; then
 have_gle=no
 with_gle_req=unspecified
 gle_halfassed=no
 have_gle=no
 with_gle_req=unspecified
 gle_halfassed=no
-# Check whether --with-gle or --without-gle was given.
-if test "${with_gle+set}" = set; then
-  withval="$with_gle"
-  with_gle="$withval"; with_gle_req="$withval"
+
+# Check whether --with-gle was given.
+if test "${with_gle+set}" = set; then :
+  withval=$with_gle; with_gle="$withval"; with_gle_req="$withval"
 else
   with_gle=yes
 fi
 else
   with_gle=yes
 fi
     no)  ;;
 
     /*)
     no)  ;;
 
     /*)
-     echo $ac_n "checking for GLE headers""... $ac_c" 1>&6
-echo "configure:8760: checking for GLE headers" >&5
+     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GLE headers" >&5
+$as_echo_n "checking for GLE headers... " >&6; }
      d=$with_gle/include
      if test -d $d; then
        X_CFLAGS="-I$d $X_CFLAGS"
      d=$with_gle/include
      if test -d $d; then
        X_CFLAGS="-I$d $X_CFLAGS"
-       echo "$ac_t""$d" 1>&6
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $d" >&5
+$as_echo "$d" >&6; }
      else
      else
-       echo "$ac_t""not found ($d: no such directory)" 1>&6
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found ($d: no such directory)" >&5
+$as_echo "not found ($d: no such directory)" >&6; }
      fi
 
      fi
 
-     echo $ac_n "checking for GLE libs""... $ac_c" 1>&6
-echo "configure:8770: checking for GLE libs" >&5
+     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GLE libs" >&5
+$as_echo_n "checking for GLE libs... " >&6; }
      d=$with_gle/lib
      if test -d $d; then
        X_LIBS="-L$d $X_LIBS"
      d=$with_gle/lib
      if test -d $d; then
        X_LIBS="-L$d $X_LIBS"
-       echo "$ac_t""$d" 1>&6
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $d" >&5
+$as_echo "$d" >&6; }
      else
      else
-       echo "$ac_t""not found ($d: no such directory)" 1>&6
+       { $as_echo "$as_me:${as_lineno-$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".
      fi
 
      # replace the directory string with "yes".
@@ -8777,135 +12573,68 @@ echo "configure:8770: checking for GLE libs" >&5
      exit 1
      ;;
    esac
      exit 1
      ;;
    esac
-  
+
 
 GLE_LIBS=""
 
 
 GLE_LIBS=""
 
-if test "$with_gle" = yes; then
+if test "$have_gl" = no ; then
+ true
+elif test "$with_gle" = yes; then
+
 
 
-  
   ac_save_CPPFLAGS="$CPPFLAGS"
   ac_save_CPPFLAGS="$CPPFLAGS"
-  if test \! -z "$includedir" ; then 
+  if test \! -z "$includedir" ; then
     CPPFLAGS="$CPPFLAGS -I$includedir"
   fi
   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
     CPPFLAGS="$CPPFLAGS -I$includedir"
   fi
   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
-  ac_safe=`echo "GL/gle.h" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for GL/gle.h""... $ac_c" 1>&6
-echo "configure:8806: checking for GL/gle.h" >&5
-if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  cat > conftest.$ac_ext <<EOF
-#line 8811 "configure"
-#include "confdefs.h"
-#include <GL/gle.h>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:8816: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
-  rm -rf conftest*
-  eval "ac_cv_header_$ac_safe=yes"
-else
-  echo "$ac_err" >&5
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_header_$ac_safe=no"
-fi
-rm -f conftest*
-fi
-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
+  CPPFLAGS=`eval eval eval eval eval eval eval eval eval echo $CPPFLAGS`
+  ac_fn_c_check_header_compile "$LINENO" "GL/gle.h" "ac_cv_header_GL_gle_h" "#include <GL/gl.h>
+"
+if test "x$ac_cv_header_GL_gle_h" = xyes; then :
   have_gle3=yes
 else
   have_gle3=yes
 else
-  echo "$ac_t""no" 1>&6
+  have_gle3=no
 fi
 
 fi
 
+
   CPPFLAGS="$ac_save_CPPFLAGS"
   if test "$have_gle3" = yes ; then
     have_gle=yes;
   else
   CPPFLAGS="$ac_save_CPPFLAGS"
   if test "$have_gle3" = yes ; then
     have_gle=yes;
   else
-    
+
   ac_save_CPPFLAGS="$CPPFLAGS"
   ac_save_CPPFLAGS="$CPPFLAGS"
-  if test \! -z "$includedir" ; then 
+  if test \! -z "$includedir" ; then
     CPPFLAGS="$CPPFLAGS -I$includedir"
   fi
   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
     CPPFLAGS="$CPPFLAGS -I$includedir"
   fi
   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
-  ac_safe=`echo "GL/gutil.h" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for GL/gutil.h""... $ac_c" 1>&6
-echo "configure:8849: checking for GL/gutil.h" >&5
-if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  cat > conftest.$ac_ext <<EOF
-#line 8854 "configure"
-#include "confdefs.h"
-#include <GL/gutil.h>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:8859: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
-  rm -rf conftest*
-  eval "ac_cv_header_$ac_safe=yes"
-else
-  echo "$ac_err" >&5
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_header_$ac_safe=no"
-fi
-rm -f conftest*
-fi
-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
+  CPPFLAGS=`eval eval eval eval eval eval eval eval eval echo $CPPFLAGS`
+  ac_fn_c_check_header_compile "$LINENO" "GL/gutil.h" "ac_cv_header_GL_gutil_h" "#include <GL/gl.h>
+"
+if test "x$ac_cv_header_GL_gutil_h" = xyes; then :
   have_gle=yes
 else
   have_gle=yes
 else
-  echo "$ac_t""no" 1>&6
+  have_gle=no
 fi
 
 fi
 
+
   CPPFLAGS="$ac_save_CPPFLAGS"
     if test "$have_gle" = yes ; then
   CPPFLAGS="$ac_save_CPPFLAGS"
     if test "$have_gle" = yes ; then
-      
+
   ac_save_CPPFLAGS="$CPPFLAGS"
   ac_save_CPPFLAGS="$CPPFLAGS"
-  if test \! -z "$includedir" ; then 
+  if test \! -z "$includedir" ; then
     CPPFLAGS="$CPPFLAGS -I$includedir"
   fi
   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
     CPPFLAGS="$CPPFLAGS -I$includedir"
   fi
   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
-  ac_safe=`echo "GL/tube.h" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for GL/tube.h""... $ac_c" 1>&6
-echo "configure:8890: checking for GL/tube.h" >&5
-if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  cat > conftest.$ac_ext <<EOF
-#line 8895 "configure"
-#include "confdefs.h"
-#include <GL/tube.h>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:8900: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
-  rm -rf conftest*
-  eval "ac_cv_header_$ac_safe=yes"
-else
-  echo "$ac_err" >&5
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_header_$ac_safe=no"
-fi
-rm -f conftest*
-fi
-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
+  CPPFLAGS=`eval eval eval eval eval eval eval eval eval echo $CPPFLAGS`
+  ac_fn_c_check_header_compile "$LINENO" "GL/tube.h" "ac_cv_header_GL_tube_h" "#include <GL/gl.h>
+"
+if test "x$ac_cv_header_GL_tube_h" = xyes; then :
   have_gle=yes
 else
   have_gle=yes
 else
-  echo "$ac_t""no" 1>&6
+  have_gle=no
 fi
 
 fi
 
+
   CPPFLAGS="$ac_save_CPPFLAGS"
     fi
   fi
   CPPFLAGS="$ac_save_CPPFLAGS"
     fi
   fi
   if test "$have_gle" = yes ; then
     have_gle=no
     gle_halfassed=yes
   if test "$have_gle" = yes ; then
     have_gle=no
     gle_halfassed=yes
-    
+
   ac_save_CPPFLAGS="$CPPFLAGS"
   ac_save_LDFLAGS="$LDFLAGS"
 #  ac_save_LIBS="$LIBS"
 
   ac_save_CPPFLAGS="$CPPFLAGS"
   ac_save_LDFLAGS="$LDFLAGS"
 #  ac_save_LIBS="$LIBS"
 
-  if test \! -z "$includedir" ; then 
+  if test \! -z "$includedir" ; then
     CPPFLAGS="$CPPFLAGS -I$includedir"
   fi
   # note: $X_CFLAGS includes $x_includes
     CPPFLAGS="$CPPFLAGS -I$includedir"
   fi
   # note: $X_CFLAGS includes $x_includes
   # note: $X_LIBS includes $x_libraries
   LDFLAGS="$LDFLAGS $X_LIBS $X_EXTRA_LIBS"
 
   # note: $X_LIBS includes $x_libraries
   LDFLAGS="$LDFLAGS $X_LIBS $X_EXTRA_LIBS"
 
-  echo $ac_n "checking for gleCreateGC in -lgle""... $ac_c" 1>&6
-echo "configure:8946: checking for gleCreateGC in -lgle" >&5
-ac_lib_var=`echo gle'_'gleCreateGC | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+  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:${as_lineno-$LINENO}: checking for gleCreateGC in -lgle" >&5
+$as_echo_n "checking for gleCreateGC in -lgle... " >&6; }
+if ${ac_cv_lib_gle_gleCreateGC+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
 else
-  ac_save_LIBS="$LIBS"
+  ac_check_lib_save_LIBS=$LIBS
 LIBS="-lgle $GL_LIBS -lX11 -lXext -lm $LIBS"
 LIBS="-lgle $GL_LIBS -lX11 -lXext -lm $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 8954 "configure"
-#include "confdefs.h"
-/* Override any gcc2 internal prototype to avoid an error.  */
-/* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char gleCreateGC();
-
-int main() {
-gleCreateGC()
-; return 0; }
-EOF
-if { (eval echo configure:8965: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=yes"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* 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 gleCreateGC ();
+int
+main ()
+{
+return gleCreateGC ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_gle_gleCreateGC=yes
 else
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=no"
+  ac_cv_lib_gle_gleCreateGC=no
 fi
 fi
-rm -f conftest*
-LIBS="$ac_save_LIBS"
-
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
 fi
 fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_gle_gleCreateGC" >&5
+$as_echo "$ac_cv_lib_gle_gleCreateGC" >&6; }
+if test "x$ac_cv_lib_gle_gleCreateGC" = xyes; then :
   have_gle=yes; gle_halfassed=no; GLE_LIBS="-lgle"
   have_gle=yes; gle_halfassed=no; GLE_LIBS="-lgle"
-else
-  echo "$ac_t""no" 1>&6
 fi
 
   CPPFLAGS="$ac_save_CPPFLAGS"
   LDFLAGS="$ac_save_LDFLAGS"
 #  LIBS="$ac_save_LIBS"
 fi
 
   CPPFLAGS="$ac_save_CPPFLAGS"
   LDFLAGS="$ac_save_LDFLAGS"
 #  LIBS="$ac_save_LIBS"
-  
+
   fi
   if test "$have_gle" = yes ; then
     have_gle=no
   fi
   if test "$have_gle" = yes ; then
     have_gle=no
 # uview_direction_d() was in libgle -- but it's not, it's in libmatrix.
 # Yet the link is succeeding.  Why???
 #
 # uview_direction_d() was in libgle -- but it's not, it's in libmatrix.
 # Yet the link is succeeding.  Why???
 #
-#    AC_CHECK_X_LIB(gle, uview_direction_d, 
+#    AC_CHECK_X_LIB(gle, uview_direction_d,
 #                   [have_gle=yes; gle_halfassed=no],
 #                   [], $GL_LIBS -lX11 -lXext -lm)
 
     # As of GLE 3 this is in libgle, and has changed name to uview_direction!
     # *sigh*
     if test "$have_gle3" = yes ; then
 #                   [have_gle=yes; gle_halfassed=no],
 #                   [], $GL_LIBS -lX11 -lXext -lm)
 
     # As of GLE 3 this is in libgle, and has changed name to uview_direction!
     # *sigh*
     if test "$have_gle3" = yes ; then
-      
+
   ac_save_CPPFLAGS="$CPPFLAGS"
   ac_save_LDFLAGS="$LDFLAGS"
 #  ac_save_LIBS="$LIBS"
 
   ac_save_CPPFLAGS="$CPPFLAGS"
   ac_save_LDFLAGS="$LDFLAGS"
 #  ac_save_LIBS="$LIBS"
 
-  if test \! -z "$includedir" ; then 
+  if test \! -z "$includedir" ; then
     CPPFLAGS="$CPPFLAGS -I$includedir"
   fi
   # note: $X_CFLAGS includes $x_includes
     CPPFLAGS="$CPPFLAGS -I$includedir"
   fi
   # note: $X_CFLAGS includes $x_includes
   # note: $X_LIBS includes $x_libraries
   LDFLAGS="$LDFLAGS $X_LIBS $X_EXTRA_LIBS"
 
   # note: $X_LIBS includes $x_libraries
   LDFLAGS="$LDFLAGS $X_LIBS $X_EXTRA_LIBS"
 
-  echo $ac_n "checking for uview_direction in -lgle""... $ac_c" 1>&6
-echo "configure:9025: checking for uview_direction in -lgle" >&5
-ac_lib_var=`echo gle'_'uview_direction | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+  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:${as_lineno-$LINENO}: checking for uview_direction in -lgle" >&5
+$as_echo_n "checking for uview_direction in -lgle... " >&6; }
+if ${ac_cv_lib_gle_uview_direction+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
 else
-  ac_save_LIBS="$LIBS"
+  ac_check_lib_save_LIBS=$LIBS
 LIBS="-lgle $GL_LIBS -lX11 -lXext -lm $LIBS"
 LIBS="-lgle $GL_LIBS -lX11 -lXext -lm $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 9033 "configure"
-#include "confdefs.h"
-/* Override any gcc2 internal prototype to avoid an error.  */
-/* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char uview_direction();
-
-int main() {
-uview_direction()
-; return 0; }
-EOF
-if { (eval echo configure:9044: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=yes"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* 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 uview_direction ();
+int
+main ()
+{
+return uview_direction ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_gle_uview_direction=yes
 else
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=no"
+  ac_cv_lib_gle_uview_direction=no
 fi
 fi
-rm -f conftest*
-LIBS="$ac_save_LIBS"
-
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
 fi
 fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_gle_uview_direction" >&5
+$as_echo "$ac_cv_lib_gle_uview_direction" >&6; }
+if test "x$ac_cv_lib_gle_uview_direction" = xyes; then :
   have_gle=yes; gle_halfassed=no
   have_gle=yes; gle_halfassed=no
-else
-  echo "$ac_t""no" 1>&6
 fi
 
   CPPFLAGS="$ac_save_CPPFLAGS"
   LDFLAGS="$ac_save_LDFLAGS"
 #  LIBS="$ac_save_LIBS"
 fi
 
   CPPFLAGS="$ac_save_CPPFLAGS"
   LDFLAGS="$ac_save_LDFLAGS"
 #  LIBS="$ac_save_LIBS"
-  
+
     fi
     # if it wasn't in libgle, then look in libmatrix.
     if test "$have_gle" = no ; then
     fi
     # if it wasn't in libgle, then look in libmatrix.
     if test "$have_gle" = no ; then
-      
+
   ac_save_CPPFLAGS="$CPPFLAGS"
   ac_save_LDFLAGS="$LDFLAGS"
 #  ac_save_LIBS="$LIBS"
 
   ac_save_CPPFLAGS="$CPPFLAGS"
   ac_save_LDFLAGS="$LDFLAGS"
 #  ac_save_LIBS="$LIBS"
 
-  if test \! -z "$includedir" ; then 
+  if test \! -z "$includedir" ; then
     CPPFLAGS="$CPPFLAGS -I$includedir"
   fi
   # note: $X_CFLAGS includes $x_includes
     CPPFLAGS="$CPPFLAGS -I$includedir"
   fi
   # note: $X_CFLAGS includes $x_includes
   # note: $X_LIBS includes $x_libraries
   LDFLAGS="$LDFLAGS $X_LIBS $X_EXTRA_LIBS"
 
   # note: $X_LIBS includes $x_libraries
   LDFLAGS="$LDFLAGS $X_LIBS $X_EXTRA_LIBS"
 
-  echo $ac_n "checking for uview_direction_d in -lmatrix""... $ac_c" 1>&6
-echo "configure:9089: checking for uview_direction_d in -lmatrix" >&5
-ac_lib_var=`echo matrix'_'uview_direction_d | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+  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:${as_lineno-$LINENO}: checking for uview_direction_d in -lmatrix" >&5
+$as_echo_n "checking for uview_direction_d in -lmatrix... " >&6; }
+if ${ac_cv_lib_matrix_uview_direction_d+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
 else
-  ac_save_LIBS="$LIBS"
+  ac_check_lib_save_LIBS=$LIBS
 LIBS="-lmatrix $GL_LIBS -lX11 -lXext -lm $LIBS"
 LIBS="-lmatrix $GL_LIBS -lX11 -lXext -lm $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 9097 "configure"
-#include "confdefs.h"
-/* Override any gcc2 internal prototype to avoid an error.  */
-/* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char uview_direction_d();
-
-int main() {
-uview_direction_d()
-; return 0; }
-EOF
-if { (eval echo configure:9108: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=yes"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* 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 uview_direction_d ();
+int
+main ()
+{
+return uview_direction_d ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_matrix_uview_direction_d=yes
 else
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=no"
+  ac_cv_lib_matrix_uview_direction_d=no
 fi
 fi
-rm -f conftest*
-LIBS="$ac_save_LIBS"
-
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
 fi
 fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_matrix_uview_direction_d" >&5
+$as_echo "$ac_cv_lib_matrix_uview_direction_d" >&6; }
+if test "x$ac_cv_lib_matrix_uview_direction_d" = xyes; then :
   have_gle=yes; gle_halfassed=no;
                       GLE_LIBS="$GLE_LIBS -lmatrix"
   have_gle=yes; gle_halfassed=no;
                       GLE_LIBS="$GLE_LIBS -lmatrix"
-else
-  echo "$ac_t""no" 1>&6
 fi
 
   CPPFLAGS="$ac_save_CPPFLAGS"
   LDFLAGS="$ac_save_LDFLAGS"
 #  LIBS="$ac_save_LIBS"
 fi
 
   CPPFLAGS="$ac_save_CPPFLAGS"
   LDFLAGS="$ac_save_LDFLAGS"
 #  LIBS="$ac_save_LIBS"
-  
+
     fi
   fi
 
   if test "$have_gle" = yes ; then
     fi
   fi
 
   if test "$have_gle" = yes ; then
-    cat >> confdefs.h <<\EOF
-#define HAVE_GLE 1
-EOF
+    $as_echo "#define HAVE_GLE 1" >>confdefs.h
 
     if test "$have_gle3" = yes ; then
 
     if test "$have_gle3" = yes ; then
-      cat >> confdefs.h <<\EOF
-#define HAVE_GLE3 1
-EOF
+      $as_echo "#define HAVE_GLE3 1" >>confdefs.h
 
     fi
   fi
 
     fi
   fi
@@ -9141,138 +12872,108 @@ elif test "$with_gle" != no; then
 fi
 
 
 fi
 
 
-
 ###############################################################################
 #
 ###############################################################################
 #
-#       Check for -lXpm.
+#       Handle --with-gles
 #
 ###############################################################################
 
 #
 ###############################################################################
 
-have_xpm=no
-with_xpm_req=unspecified
-# Check whether --with-xpm or --without-xpm was given.
-if test "${with_xpm+set}" = set; then
-  withval="$with_xpm"
-  with_xpm="$withval"; with_xpm_req="$withval"
+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
 else
-  with_xpm=yes
+  with_gles=no
 fi
 
 
 
 fi
 
 
 
-   case "$with_xpm" in
+   case "$with_gles" in
     yes) ;;
     no)  ;;
 
     /*)
     yes) ;;
     no)  ;;
 
     /*)
-     echo $ac_n "checking for XPM headers""... $ac_c" 1>&6
-echo "configure:9181: checking for XPM headers" >&5
-     d=$with_xpm/include
+     { $as_echo "$as_me:${as_lineno-$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"
      if test -d $d; then
        X_CFLAGS="-I$d $X_CFLAGS"
-       echo "$ac_t""$d" 1>&6
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $d" >&5
+$as_echo "$d" >&6; }
      else
      else
-       echo "$ac_t""not found ($d: no such directory)" 1>&6
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found ($d: no such directory)" >&5
+$as_echo "not found ($d: no such directory)" >&6; }
      fi
 
      fi
 
-     echo $ac_n "checking for XPM libs""... $ac_c" 1>&6
-echo "configure:9191: checking for XPM libs" >&5
-     d=$with_xpm/lib
+     { $as_echo "$as_me:${as_lineno-$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"
      if test -d $d; then
        X_LIBS="-L$d $X_LIBS"
-       echo "$ac_t""$d" 1>&6
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $d" >&5
+$as_echo "$d" >&6; }
      else
      else
-       echo "$ac_t""not found ($d: no such directory)" 1>&6
+       { $as_echo "$as_me:${as_lineno-$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".
      fi
 
      # replace the directory string with "yes".
-     with_xpm_req="yes"
-     with_xpm=$with_xpm_req
+     with_gles_req="yes"
+     with_gles=$with_gles_req
      ;;
 
     *)
      echo ""
      ;;
 
     *)
      echo ""
-     echo "error: argument to --with-xpm must be \"yes\", \"no\", or a directory."
+     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
      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_xpm" = yes; then
-  
-  ac_save_CPPFLAGS="$CPPFLAGS"
-  if test \! -z "$includedir" ; then 
-    CPPFLAGS="$CPPFLAGS -I$includedir"
-  fi
-  CPPFLAGS="$CPPFLAGS $X_CFLAGS"
-  ac_safe=`echo "X11/xpm.h" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for X11/xpm.h""... $ac_c" 1>&6
-echo "configure:9224: checking for X11/xpm.h" >&5
-if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  cat > conftest.$ac_ext <<EOF
-#line 9229 "configure"
-#include "confdefs.h"
-#include <X11/xpm.h>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:9234: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
-  rm -rf conftest*
-  eval "ac_cv_header_$ac_safe=yes"
-else
-  echo "$ac_err" >&5
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_header_$ac_safe=no"
-fi
-rm -f conftest*
-fi
-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-  have_xpm=yes
-                    cat >> confdefs.h <<\EOF
-#define HAVE_XPM 1
-EOF
 
 
-                    XPM_LIBS="-lXpm"
-else
-  echo "$ac_t""no" 1>&6
-fi
+if test "$with_gles" = yes; then
+  have_gles=yes
+  $as_echo "#define HAVE_JWZGLES 1" >>confdefs.h
 
 
-  CPPFLAGS="$ac_save_CPPFLAGS"
-elif test "$with_xpm" != no; then
-  echo "error: must be yes or no: --with-xpm=$with_xpm"
+  JWZGLES_OBJS="jwzgles.o"
+  { $as_echo "$as_me:${as_lineno-$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
 
   exit 1
 fi
 
-# See comment near $motif_requires_xpm, above.
-# Need to do this here, after both Motif and XPM have been checked for.
+# May want to phase out glBitmap even in a non-GLES world.
 #
 #
-if test "$have_motif" = yes -a "$have_xpm" = yes ; then
-  if test "$motif_requires_xpm" = yes ; then
-    MOTIF_LIBS="$MOTIF_LIBS $XPM_LIBS"
-  fi
+if test "$have_gles" = yes; then
+  GLFPS_OBJS="fps-gl.o glxfonts.o texfont.o"
+  GLFONT_OBJS=""
+else
+  $as_echo "#define HAVE_GLBITMAP 1" >>confdefs.h
+
+  GLFPS_OBJS="fps-gl.o glxfonts.o"
+  GLFONT_OBJS="texfont.o"
 fi
 
 
 ###############################################################################
 #
 #       Check for -lgdk_pixbuf.
 fi
 
 
 ###############################################################################
 #
 #       Check for -lgdk_pixbuf.
+#       These tests are for gdk_pixbuf usage of the hacks,
+#       not xscreensaver-demo (thus we have to test again to get
+#       the libraries right: don't want to pull in all of GTK
+#       for the hacks.)
 #
 ###############################################################################
 
 have_gdk_pixbuf=no
 with_gdk_pixbuf_req=unspecified
 #
 ###############################################################################
 
 have_gdk_pixbuf=no
 with_gdk_pixbuf_req=unspecified
-# Check whether --with-pixbuf or --without-pixbuf was given.
-if test "${with_pixbuf+set}" = set; then
-  withval="$with_pixbuf"
-  with_gdk_pixbuf="$withval"; with_gdk_pixbuf_req="$withval"
+
+# Check whether --with-pixbuf was given.
+if test "${with_pixbuf+set}" = set; then :
+  withval=$with_pixbuf; with_gdk_pixbuf="$withval"; with_gdk_pixbuf_req="$withval"
 else
   with_gdk_pixbuf=yes
 fi
 else
   with_gdk_pixbuf=yes
 fi
@@ -9295,24 +12996,28 @@ esac
     no)  ;;
 
     /*)
     no)  ;;
 
     /*)
-     echo $ac_n "checking for GDK_PIXBUF headers""... $ac_c" 1>&6
-echo "configure:9311: checking for GDK_PIXBUF headers" >&5
+     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GDK_PIXBUF headers" >&5
+$as_echo_n "checking for GDK_PIXBUF headers... " >&6; }
      d=$with_gdk_pixbuf/include
      if test -d $d; then
        X_CFLAGS="-I$d $X_CFLAGS"
      d=$with_gdk_pixbuf/include
      if test -d $d; then
        X_CFLAGS="-I$d $X_CFLAGS"
-       echo "$ac_t""$d" 1>&6
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $d" >&5
+$as_echo "$d" >&6; }
      else
      else
-       echo "$ac_t""not found ($d: no such directory)" 1>&6
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found ($d: no such directory)" >&5
+$as_echo "not found ($d: no such directory)" >&6; }
      fi
 
      fi
 
-     echo $ac_n "checking for GDK_PIXBUF libs""... $ac_c" 1>&6
-echo "configure:9321: checking for GDK_PIXBUF libs" >&5
+     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GDK_PIXBUF libs" >&5
+$as_echo_n "checking for GDK_PIXBUF libs... " >&6; }
      d=$with_gdk_pixbuf/lib
      if test -d $d; then
        X_LIBS="-L$d $X_LIBS"
      d=$with_gdk_pixbuf/lib
      if test -d $d; then
        X_LIBS="-L$d $X_LIBS"
-       echo "$ac_t""$d" 1>&6
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $d" >&5
+$as_echo "$d" >&6; }
      else
      else
-       echo "$ac_t""not found ($d: no such directory)" 1>&6
+       { $as_echo "$as_me:${as_lineno-$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".
      fi
 
      # replace the directory string with "yes".
@@ -9328,7 +13033,7 @@ echo "configure:9321: checking for GDK_PIXBUF libs" >&5
      exit 1
      ;;
    esac
      exit 1
      ;;
    esac
-  
+
 
 if test "$with_gdk_pixbuf" != yes -a "$with_gdk_pixbuf" != no ; then
   echo "error: must be yes or no: --with-pixbuf=$with_gdk_pixbuf"
 
 if test "$with_gdk_pixbuf" != yes -a "$with_gdk_pixbuf" != no ; then
   echo "error: must be yes or no: --with-pixbuf=$with_gdk_pixbuf"
 if test "$with_gdk_pixbuf" = yes; then
   have_gdk_pixbuf=no
 
 if test "$with_gdk_pixbuf" = yes; then
   have_gdk_pixbuf=no
 
-  # if the user specified --with-gtk=/foo/ or --with-gnome=/foo/ then
-  # look in /foo/bin/ for for gdk-pixbuf-config.
-  #
-  gdk_pixbuf_path="$PATH"
-
-  if test ! -z "$gtk_dir"; then
-    # canonicalize slashes.
-    foo=`echo "${gtk_dir}/bin" | sed 's@//*@/@g'`
-    gdk_pixbuf_path="$foo:$gdk_pixbuf_path"
-  fi
+  pkgs=''
+  ok="yes"
 
 
-  if test ! -z "$gnome_dir"; then
-    # canonicalize slashes.
-    foo=`echo "${gnome_dir}/bin" | sed 's@//*@/@g'`
-    gdk_pixbuf_path="$foo:$gdk_pixbuf_path"
-  fi
+  pkg_check_version gdk-pixbuf-2.0      2.0.0
+  pkg_check_version gdk-pixbuf-xlib-2.0 2.0.0
+  have_gdk_pixbuf="$ok"
 
 
-  for ac_prog in gdk-pixbuf-config
-do
-# Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:9375: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_path_gdk_pixbuf_config'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+  if test "$have_gdk_pixbuf" = yes; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gdk-pixbuf includes" >&5
+$as_echo_n "checking for gdk-pixbuf includes... " >&6; }
+if ${ac_cv_gdk_pixbuf_config_cflags+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
 else
-  case "$gdk_pixbuf_config" in
-  /*)
-  ac_cv_path_gdk_pixbuf_config="$gdk_pixbuf_config" # Let the user override the test with a path.
-  ;;
-  ?:/*)                         
-  ac_cv_path_gdk_pixbuf_config="$gdk_pixbuf_config" # Let the user override the test with a dos path.
-  ;;
-  *)
-  IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS=":"
-  ac_dummy="$gdk_pixbuf_path"
-  for ac_dir in $ac_dummy; do 
-    test -z "$ac_dir" && ac_dir=.
-    if test -f $ac_dir/$ac_word; then
-      ac_cv_path_gdk_pixbuf_config="$ac_dir/$ac_word"
-      break
-    fi
-  done
-  IFS="$ac_save_ifs"
-  ;;
-esac
+  ac_cv_gdk_pixbuf_config_cflags=`$pkg_config --cflags $pkgs`
 fi
 fi
-gdk_pixbuf_config="$ac_cv_path_gdk_pixbuf_config"
-if test -n "$gdk_pixbuf_config"; then
-  echo "$ac_t""$gdk_pixbuf_config" 1>&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_gdk_pixbuf_config_cflags" >&5
+$as_echo "$ac_cv_gdk_pixbuf_config_cflags" >&6; }
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gdk-pixbuf libs" >&5
+$as_echo_n "checking for gdk-pixbuf libs... " >&6; }
+if ${ac_cv_gdk_pixbuf_config_libs+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
 else
-  echo "$ac_t""no" 1>&6
+  ac_cv_gdk_pixbuf_config_libs=`$pkg_config --libs $pkgs`
 fi
 fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_gdk_pixbuf_config_libs" >&5
+$as_echo "$ac_cv_gdk_pixbuf_config_libs" >&6; }
+  fi
 
 
-test -n "$gdk_pixbuf_config" && break
-done
+  ac_gdk_pixbuf_config_cflags=$ac_cv_gdk_pixbuf_config_cflags
+  ac_gdk_pixbuf_config_libs=$ac_cv_gdk_pixbuf_config_libs
 
 
 
 
-  # If we found the gdk-pixbuf-config program, run it to get flags.
-  #
-  if test -n "$gdk_pixbuf_config" ; then
-    echo $ac_n "checking for gdk-pixbuf includes""... $ac_c" 1>&6
-echo "configure:9415: checking for gdk-pixbuf includes" >&5
-if eval "test \"`echo '$''{'ac_cv_gdk_pixbuf_config_cflags'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  ac_cv_gdk_pixbuf_config_cflags=`$gdk_pixbuf_config --cflags`
-fi
+  if test "$have_gdk_pixbuf" = yes; then
+    #
+    # we appear to have pixbuf; check for headers/libs to be sure.
+    #
+    ac_save_gdk_pixbuf_CPPFLAGS="$CPPFLAGS"
+    CPPFLAGS="$CPPFLAGS $ac_gdk_pixbuf_config_cflags"
 
 
-echo "$ac_t""$ac_cv_gdk_pixbuf_config_cflags" 1>&6
-    echo $ac_n "checking for gdk-pixbuf libs""... $ac_c" 1>&6
-echo "configure:9424: checking for gdk-pixbuf libs" >&5
-if eval "test \"`echo '$''{'ac_cv_gdk_pixbuf_config_libs'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  ac_cv_gdk_pixbuf_config_libs=`$gdk_pixbuf_config --libs`
-fi
+    have_gdk_pixbuf=no
+
+    # check for header A...
 
 
-echo "$ac_t""$ac_cv_gdk_pixbuf_config_libs" 1>&6
-    ac_gdk_pixbuf_config_cflags=$ac_cv_gdk_pixbuf_config_cflags
-    ac_gdk_pixbuf_config_libs=$ac_cv_gdk_pixbuf_config_libs
+  ac_save_CPPFLAGS="$CPPFLAGS"
+  if test \! -z "$includedir" ; then
+    CPPFLAGS="$CPPFLAGS -I$includedir"
   fi
   fi
+  CPPFLAGS="$CPPFLAGS $X_CFLAGS"
+  CPPFLAGS=`eval eval eval eval eval eval eval eval eval echo $CPPFLAGS`
+  ac_fn_c_check_header_mongrel "$LINENO" "gdk-pixbuf/gdk-pixbuf.h" "ac_cv_header_gdk_pixbuf_gdk_pixbuf_h" "$ac_includes_default"
+if test "x$ac_cv_header_gdk_pixbuf_gdk_pixbuf_h" = xyes; then :
+  have_gdk_pixbuf=yes
+fi
+
 
 
-  ac_save_gdk_pixbuf_CPPFLAGS="$CPPFLAGS"
-  CPPFLAGS="$CPPFLAGS $ac_gdk_pixbuf_config_cflags"
+  CPPFLAGS="$ac_save_CPPFLAGS"
+
+    # if that worked, check for header B...
+    if test "$have_gdk_pixbuf" = yes; then
+      have_gdk_pixbuf=no
+      gdk_pixbuf_halfassed=yes
 
 
-  # check for header 1...
-  
   ac_save_CPPFLAGS="$CPPFLAGS"
   ac_save_CPPFLAGS="$CPPFLAGS"
-  if test \! -z "$includedir" ; then 
+  if test \! -z "$includedir" ; then
     CPPFLAGS="$CPPFLAGS -I$includedir"
   fi
   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
     CPPFLAGS="$CPPFLAGS -I$includedir"
   fi
   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
-  ac_safe=`echo "gdk-pixbuf/gdk-pixbuf.h" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for gdk-pixbuf/gdk-pixbuf.h""... $ac_c" 1>&6
-echo "configure:9448: checking for gdk-pixbuf/gdk-pixbuf.h" >&5
-if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  cat > conftest.$ac_ext <<EOF
-#line 9453 "configure"
-#include "confdefs.h"
-#include <gdk-pixbuf/gdk-pixbuf.h>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:9458: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
-  rm -rf conftest*
-  eval "ac_cv_header_$ac_safe=yes"
-else
-  echo "$ac_err" >&5
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_header_$ac_safe=no"
-fi
-rm -f conftest*
-fi
-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
+  CPPFLAGS=`eval eval eval eval eval eval eval eval eval echo $CPPFLAGS`
+  ac_fn_c_check_header_mongrel "$LINENO" "gdk-pixbuf/gdk-pixbuf-xlib.h" "ac_cv_header_gdk_pixbuf_gdk_pixbuf_xlib_h" "$ac_includes_default"
+if test "x$ac_cv_header_gdk_pixbuf_gdk_pixbuf_xlib_h" = xyes; then :
   have_gdk_pixbuf=yes
   have_gdk_pixbuf=yes
-else
-  echo "$ac_t""no" 1>&6
+                         gdk_pixbuf_halfassed=no
 fi
 
 fi
 
+
   CPPFLAGS="$ac_save_CPPFLAGS"
 
   CPPFLAGS="$ac_save_CPPFLAGS"
 
-  # if that worked, check for header 2...
-  if test "$have_gdk_pixbuf" = yes; then
-    have_gdk_pixbuf=no
-    
+      # yay, it has a new name in Gtk 2.x...
+      if test "$have_gdk_pixbuf" = no; then
+        have_gdk_pixbuf=no
+        gdk_pixbuf_halfassed=yes
+
   ac_save_CPPFLAGS="$CPPFLAGS"
   ac_save_CPPFLAGS="$CPPFLAGS"
-  if test \! -z "$includedir" ; then 
+  if test \! -z "$includedir" ; then
     CPPFLAGS="$CPPFLAGS -I$includedir"
   fi
   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
     CPPFLAGS="$CPPFLAGS -I$includedir"
   fi
   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
-  ac_safe=`echo "gdk-pixbuf/gdk-pixbuf-xlib.h" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for gdk-pixbuf/gdk-pixbuf-xlib.h""... $ac_c" 1>&6
-echo "configure:9492: checking for gdk-pixbuf/gdk-pixbuf-xlib.h" >&5
-if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  cat > conftest.$ac_ext <<EOF
-#line 9497 "configure"
-#include "confdefs.h"
-#include <gdk-pixbuf/gdk-pixbuf-xlib.h>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:9502: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
-  rm -rf conftest*
-  eval "ac_cv_header_$ac_safe=yes"
-else
-  echo "$ac_err" >&5
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_header_$ac_safe=no"
-fi
-rm -f conftest*
-fi
-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
+  CPPFLAGS=`eval eval eval eval eval eval eval eval eval echo $CPPFLAGS`
+  ac_fn_c_check_header_mongrel "$LINENO" "gdk-pixbuf-xlib/gdk-pixbuf-xlib.h" "ac_cv_header_gdk_pixbuf_xlib_gdk_pixbuf_xlib_h" "$ac_includes_default"
+if test "x$ac_cv_header_gdk_pixbuf_xlib_gdk_pixbuf_xlib_h" = xyes; then :
   have_gdk_pixbuf=yes
   have_gdk_pixbuf=yes
-else
-  echo "$ac_t""no" 1>&6
+                           gdk_pixbuf_halfassed=no
 fi
 
 fi
 
+
   CPPFLAGS="$ac_save_CPPFLAGS"
   CPPFLAGS="$ac_save_CPPFLAGS"
+      fi
+    fi
+    CPPFLAGS="$ac_save_gdk_pixbuf_CPPFLAGS"
   fi
 
   fi
 
-  CPPFLAGS="$ac_save_gdk_pixbuf_CPPFLAGS"
-
   if test "$have_gdk_pixbuf" = yes; then
     # we have the headers, now check for the libraries
     have_gdk_pixbuf=no
     gdk_pixbuf_halfassed=yes
   if test "$have_gdk_pixbuf" = yes; then
     # we have the headers, now check for the libraries
     have_gdk_pixbuf=no
     gdk_pixbuf_halfassed=yes
-    # library 1...
-    
+
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: checking for gdk_pixbuf usability..." >&5
+$as_echo "checking for gdk_pixbuf usability..." >&6; }
+
+    # library A...
+
   ac_save_CPPFLAGS="$CPPFLAGS"
   ac_save_LDFLAGS="$LDFLAGS"
 #  ac_save_LIBS="$LIBS"
 
   ac_save_CPPFLAGS="$CPPFLAGS"
   ac_save_LDFLAGS="$LDFLAGS"
 #  ac_save_LIBS="$LIBS"
 
-  if test \! -z "$includedir" ; then 
+  if test \! -z "$includedir" ; then
     CPPFLAGS="$CPPFLAGS -I$includedir"
   fi
   # note: $X_CFLAGS includes $x_includes
     CPPFLAGS="$CPPFLAGS -I$includedir"
   fi
   # note: $X_CFLAGS includes $x_includes
   # note: $X_LIBS includes $x_libraries
   LDFLAGS="$LDFLAGS $X_LIBS $X_EXTRA_LIBS"
 
   # note: $X_LIBS includes $x_libraries
   LDFLAGS="$LDFLAGS $X_LIBS $X_EXTRA_LIBS"
 
-  echo $ac_n "checking for gdk_pixbuf_new_from_file in -lgdk_pixbuf""... $ac_c" 1>&6
-echo "configure:9551: checking for gdk_pixbuf_new_from_file in -lgdk_pixbuf" >&5
-ac_lib_var=`echo gdk_pixbuf'_'gdk_pixbuf_new_from_file | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  ac_save_LIBS="$LIBS"
-LIBS="-lgdk_pixbuf $ac_gdk_pixbuf_config_libs $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 9559 "configure"
-#include "confdefs.h"
-/* Override any gcc2 internal prototype to avoid an error.  */
-/* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char gdk_pixbuf_new_from_file();
-
-int main() {
-gdk_pixbuf_new_from_file()
-; return 0; }
-EOF
-if { (eval echo configure:9570: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=yes"
+  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:${as_lineno-$LINENO}: checking for gdk_pixbuf_new_from_file in -lc" >&5
+$as_echo_n "checking for gdk_pixbuf_new_from_file in -lc... " >&6; }
+if ${ac_cv_lib_c_gdk_pixbuf_new_from_file+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lc $ac_gdk_pixbuf_config_libs -lX11 -lXext -lm $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* 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 gdk_pixbuf_new_from_file ();
+int
+main ()
+{
+return gdk_pixbuf_new_from_file ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_c_gdk_pixbuf_new_from_file=yes
 else
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=no"
+  ac_cv_lib_c_gdk_pixbuf_new_from_file=no
 fi
 fi
-rm -f conftest*
-LIBS="$ac_save_LIBS"
-
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
 fi
 fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_c_gdk_pixbuf_new_from_file" >&5
+$as_echo "$ac_cv_lib_c_gdk_pixbuf_new_from_file" >&6; }
+if test "x$ac_cv_lib_c_gdk_pixbuf_new_from_file" = xyes; then :
   have_gdk_pixbuf=yes
   have_gdk_pixbuf=yes
-else
-  echo "$ac_t""no" 1>&6
-true
 fi
 
   CPPFLAGS="$ac_save_CPPFLAGS"
   LDFLAGS="$ac_save_LDFLAGS"
 #  LIBS="$ac_save_LIBS"
 fi
 
   CPPFLAGS="$ac_save_CPPFLAGS"
   LDFLAGS="$ac_save_LDFLAGS"
 #  LIBS="$ac_save_LIBS"
-  
-    # library 2...
+
+    # library B...
     if test "$have_gdk_pixbuf" = yes; then
     if test "$have_gdk_pixbuf" = yes; then
-      
+      have_gdk_pixbuf=no
+
   ac_save_CPPFLAGS="$CPPFLAGS"
   ac_save_LDFLAGS="$LDFLAGS"
 #  ac_save_LIBS="$LIBS"
 
   ac_save_CPPFLAGS="$CPPFLAGS"
   ac_save_LDFLAGS="$LDFLAGS"
 #  ac_save_LIBS="$LIBS"
 
-  if test \! -z "$includedir" ; then 
+  if test \! -z "$includedir" ; then
     CPPFLAGS="$CPPFLAGS -I$includedir"
   fi
   # note: $X_CFLAGS includes $x_includes
     CPPFLAGS="$CPPFLAGS -I$includedir"
   fi
   # note: $X_CFLAGS includes $x_includes
   # note: $X_LIBS includes $x_libraries
   LDFLAGS="$LDFLAGS $X_LIBS $X_EXTRA_LIBS"
 
   # note: $X_LIBS includes $x_libraries
   LDFLAGS="$LDFLAGS $X_LIBS $X_EXTRA_LIBS"
 
-  echo $ac_n "checking for gdk_pixbuf_xlib_init in -lgdk_pixbuf_xlib""... $ac_c" 1>&6
-echo "configure:9615: checking for gdk_pixbuf_xlib_init in -lgdk_pixbuf_xlib" >&5
-ac_lib_var=`echo gdk_pixbuf_xlib'_'gdk_pixbuf_xlib_init | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  ac_save_LIBS="$LIBS"
-LIBS="-lgdk_pixbuf_xlib $ac_gdk_pixbuf_config_libs $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 9623 "configure"
-#include "confdefs.h"
-/* Override any gcc2 internal prototype to avoid an error.  */
-/* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char gdk_pixbuf_xlib_init();
-
-int main() {
-gdk_pixbuf_xlib_init()
-; return 0; }
-EOF
-if { (eval echo configure:9634: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=yes"
+  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:${as_lineno-$LINENO}: checking for gdk_pixbuf_xlib_init in -lc" >&5
+$as_echo_n "checking for gdk_pixbuf_xlib_init in -lc... " >&6; }
+if ${ac_cv_lib_c_gdk_pixbuf_xlib_init+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lc $ac_gdk_pixbuf_config_libs -lX11 -lXext -lm $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* 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 gdk_pixbuf_xlib_init ();
+int
+main ()
+{
+return gdk_pixbuf_xlib_init ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_c_gdk_pixbuf_xlib_init=yes
 else
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=no"
+  ac_cv_lib_c_gdk_pixbuf_xlib_init=no
 fi
 fi
-rm -f conftest*
-LIBS="$ac_save_LIBS"
-
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
 fi
 fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_c_gdk_pixbuf_xlib_init" >&5
+$as_echo "$ac_cv_lib_c_gdk_pixbuf_xlib_init" >&6; }
+if test "x$ac_cv_lib_c_gdk_pixbuf_xlib_init" = xyes; then :
   have_gdk_pixbuf=yes
                       gdk_pixbuf_halfassed=no
   have_gdk_pixbuf=yes
                       gdk_pixbuf_halfassed=no
-else
-  echo "$ac_t""no" 1>&6
-true
 fi
 
   CPPFLAGS="$ac_save_CPPFLAGS"
   LDFLAGS="$ac_save_LDFLAGS"
 #  LIBS="$ac_save_LIBS"
 fi
 
   CPPFLAGS="$ac_save_CPPFLAGS"
   LDFLAGS="$ac_save_LDFLAGS"
 #  LIBS="$ac_save_LIBS"
-  
+
     fi
   fi
 
   if test "$have_gdk_pixbuf" = yes; then
     INCLUDES="$INCLUDES $ac_gdk_pixbuf_config_cflags"
     fi
   fi
 
   if test "$have_gdk_pixbuf" = yes; then
     INCLUDES="$INCLUDES $ac_gdk_pixbuf_config_cflags"
-    XPM_LIBS="$ac_gdk_pixbuf_config_libs -lgdk_pixbuf -lgdk_pixbuf_xlib"
-    cat >> confdefs.h <<\EOF
-#define HAVE_GDK_PIXBUF 1
-EOF
+    XPM_LIBS="$ac_gdk_pixbuf_config_libs"
+    $as_echo "#define HAVE_GDK_PIXBUF 1" >>confdefs.h
+
+  else
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: checking for gdk_pixbuf usability... no" >&5
+$as_echo "checking for gdk_pixbuf usability... no" >&6; }
+  fi
+
+  if test "$have_gdk_pixbuf" = yes; then
+
+  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:${as_lineno-$LINENO}: checking for gdk_pixbuf_apply_embedded_orientation in -lc" >&5
+$as_echo_n "checking for gdk_pixbuf_apply_embedded_orientation in -lc... " >&6; }
+if ${ac_cv_lib_c_gdk_pixbuf_apply_embedded_orientation+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lc $ac_gdk_pixbuf_config_libs -lX11 -lXext -lm $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* 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 gdk_pixbuf_apply_embedded_orientation ();
+int
+main ()
+{
+return gdk_pixbuf_apply_embedded_orientation ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_c_gdk_pixbuf_apply_embedded_orientation=yes
+else
+  ac_cv_lib_c_gdk_pixbuf_apply_embedded_orientation=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_c_gdk_pixbuf_apply_embedded_orientation" >&5
+$as_echo "$ac_cv_lib_c_gdk_pixbuf_apply_embedded_orientation" >&6; }
+if test "x$ac_cv_lib_c_gdk_pixbuf_apply_embedded_orientation" = xyes; then :
+  $as_echo "#define HAVE_GDK_PIXBUF_APPLY_EMBEDDED_ORIENTATION 1" >>confdefs.h
+
+fi
+
+  CPPFLAGS="$ac_save_CPPFLAGS"
+  LDFLAGS="$ac_save_LDFLAGS"
+#  LIBS="$ac_save_LIBS"
+
+  fi
+fi
+
+
+###############################################################################
+#
+#       Check for -lXpm.
+#
+###############################################################################
+
+have_xpm=no
+with_xpm_req=unspecified
+
+# Check whether --with-xpm was given.
+if test "${with_xpm+set}" = set; then :
+  withval=$with_xpm; with_xpm="$withval"; with_xpm_req="$withval"
+else
+  with_xpm=yes
+fi
+
+
+
+   case "$with_xpm" in
+    yes) ;;
+    no)  ;;
+
+    /*)
+     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XPM headers" >&5
+$as_echo_n "checking for XPM headers... " >&6; }
+     d=$with_xpm/include
+     if test -d $d; then
+       X_CFLAGS="-I$d $X_CFLAGS"
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $d" >&5
+$as_echo "$d" >&6; }
+     else
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found ($d: no such directory)" >&5
+$as_echo "not found ($d: no such directory)" >&6; }
+     fi
+
+     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XPM libs" >&5
+$as_echo_n "checking for XPM libs... " >&6; }
+     d=$with_xpm/lib
+     if test -d $d; then
+       X_LIBS="-L$d $X_LIBS"
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $d" >&5
+$as_echo "$d" >&6; }
+     else
+       { $as_echo "$as_me:${as_lineno-$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_xpm_req="yes"
+     with_xpm=$with_xpm_req
+     ;;
+
+    *)
+     echo ""
+     echo "error: argument to --with-xpm 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_xpm" = yes; then
+
+  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`
+  ac_fn_c_check_header_compile "$LINENO" "X11/xpm.h" "ac_cv_header_X11_xpm_h" "#include <X11/Xlib.h>
+"
+if test "x$ac_cv_header_X11_xpm_h" = xyes; then :
+  have_xpm=yes
+                    $as_echo "#define HAVE_XPM 1" >>confdefs.h
+
+                    XPM_LIBS="-lXpm $XPM_LIBS"
+fi
+
 
 
+  CPPFLAGS="$ac_save_CPPFLAGS"
+elif test "$with_xpm" != no; then
+  echo "error: must be yes or no: --with-xpm=$with_xpm"
+  exit 1
+fi
+
+# See comment near $motif_requires_xpm, above.
+# Need to do this here, after both Motif and XPM have been checked for.
+#
+if test "$have_motif" = yes -a "$have_xpm" = yes ; then
+  if test "$motif_requires_xpm" = yes ; then
+    MOTIF_LIBS="$MOTIF_LIBS $XPM_LIBS"
   fi
 fi
 
   fi
 fi
 
+if test "$XPM_LIBS" = "" ; then
+  XPM_LIBS=$(MINIXPM)
+fi
+
 
 ###############################################################################
 #
 
 ###############################################################################
 #
 have_jpeg=no
 with_jpeg_req=unspecified
 jpeg_halfassed=no
 have_jpeg=no
 with_jpeg_req=unspecified
 jpeg_halfassed=no
-# Check whether --with-jpeg or --without-jpeg was given.
-if test "${with_jpeg+set}" = set; then
-  withval="$with_jpeg"
-  with_jpeg="$withval"; with_jpeg_req="$withval"
+
+# Check whether --with-jpeg was given.
+if test "${with_jpeg+set}" = set; then :
+  withval=$with_jpeg; with_jpeg="$withval"; with_jpeg_req="$withval"
 else
   with_jpeg=yes
 fi
 else
   with_jpeg=yes
 fi
     no)  ;;
 
     /*)
     no)  ;;
 
     /*)
-     echo $ac_n "checking for JPEG headers""... $ac_c" 1>&6
-echo "configure:9699: checking for JPEG headers" >&5
+     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for JPEG headers" >&5
+$as_echo_n "checking for JPEG headers... " >&6; }
      d=$with_jpeg/include
      if test -d $d; then
        X_CFLAGS="-I$d $X_CFLAGS"
      d=$with_jpeg/include
      if test -d $d; then
        X_CFLAGS="-I$d $X_CFLAGS"
-       echo "$ac_t""$d" 1>&6
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $d" >&5
+$as_echo "$d" >&6; }
      else
      else
-       echo "$ac_t""not found ($d: no such directory)" 1>&6
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found ($d: no such directory)" >&5
+$as_echo "not found ($d: no such directory)" >&6; }
      fi
 
      fi
 
-     echo $ac_n "checking for JPEG libs""... $ac_c" 1>&6
-echo "configure:9709: checking for JPEG libs" >&5
+     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for JPEG libs" >&5
+$as_echo_n "checking for JPEG libs... " >&6; }
      d=$with_jpeg/lib
      if test -d $d; then
        X_LIBS="-L$d $X_LIBS"
      d=$with_jpeg/lib
      if test -d $d; then
        X_LIBS="-L$d $X_LIBS"
-       echo "$ac_t""$d" 1>&6
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $d" >&5
+$as_echo "$d" >&6; }
      else
      else
-       echo "$ac_t""not found ($d: no such directory)" 1>&6
+       { $as_echo "$as_me:${as_lineno-$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".
      fi
 
      # replace the directory string with "yes".
@@ -9716,7 +13526,7 @@ echo "configure:9709: checking for JPEG libs" >&5
      exit 1
      ;;
    esac
      exit 1
      ;;
    esac
-  
+
 
 if test "$with_jpeg" != yes -a "$with_jpeg" != no ; then
   echo "error: must be yes or no: --with-jpeg=$with_jpeg"
 
 if test "$with_jpeg" != yes -a "$with_jpeg" != no ; then
   echo "error: must be yes or no: --with-jpeg=$with_jpeg"
 if test "$with_jpeg" = yes; then
 
   have_jpeg=no
 if test "$with_jpeg" = yes; then
 
   have_jpeg=no
-  
+
   ac_save_CPPFLAGS="$CPPFLAGS"
   ac_save_CPPFLAGS="$CPPFLAGS"
-  if test \! -z "$includedir" ; then 
+  if test \! -z "$includedir" ; then
     CPPFLAGS="$CPPFLAGS -I$includedir"
   fi
   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
     CPPFLAGS="$CPPFLAGS -I$includedir"
   fi
   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
-  ac_safe=`echo "jpeglib.h" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for jpeglib.h""... $ac_c" 1>&6
-echo "configure:9749: checking for jpeglib.h" >&5
-if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  cat > conftest.$ac_ext <<EOF
-#line 9754 "configure"
-#include "confdefs.h"
-#include <jpeglib.h>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:9759: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
-  rm -rf conftest*
-  eval "ac_cv_header_$ac_safe=yes"
-else
-  echo "$ac_err" >&5
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_header_$ac_safe=no"
-fi
-rm -f conftest*
-fi
-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
+  CPPFLAGS=`eval eval eval eval eval eval eval eval eval echo $CPPFLAGS`
+  ac_fn_c_check_header_mongrel "$LINENO" "jpeglib.h" "ac_cv_header_jpeglib_h" "$ac_includes_default"
+if test "x$ac_cv_header_jpeglib_h" = xyes; then :
   have_jpeg=yes
   have_jpeg=yes
-else
-  echo "$ac_t""no" 1>&6
 fi
 
 fi
 
+
   CPPFLAGS="$ac_save_CPPFLAGS"
 
   if test "$have_jpeg" = yes; then
     # we have the header, now check for the library
     have_jpeg=no
     jpeg_halfassed=yes
   CPPFLAGS="$ac_save_CPPFLAGS"
 
   if test "$have_jpeg" = yes; then
     # we have the header, now check for the library
     have_jpeg=no
     jpeg_halfassed=yes
-    
+
   ac_save_CPPFLAGS="$CPPFLAGS"
   ac_save_LDFLAGS="$LDFLAGS"
 #  ac_save_LIBS="$LIBS"
 
   ac_save_CPPFLAGS="$CPPFLAGS"
   ac_save_LDFLAGS="$LDFLAGS"
 #  ac_save_LIBS="$LIBS"
 
-  if test \! -z "$includedir" ; then 
+  if test \! -z "$includedir" ; then
     CPPFLAGS="$CPPFLAGS -I$includedir"
   fi
   # note: $X_CFLAGS includes $x_includes
     CPPFLAGS="$CPPFLAGS -I$includedir"
   fi
   # note: $X_CFLAGS includes $x_includes
   # note: $X_LIBS includes $x_libraries
   LDFLAGS="$LDFLAGS $X_LIBS $X_EXTRA_LIBS"
 
   # note: $X_LIBS includes $x_libraries
   LDFLAGS="$LDFLAGS $X_LIBS $X_EXTRA_LIBS"
 
-  echo $ac_n "checking for jpeg_start_compress in -ljpeg""... $ac_c" 1>&6
-echo "configure:9804: checking for jpeg_start_compress in -ljpeg" >&5
-ac_lib_var=`echo jpeg'_'jpeg_start_compress | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+  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:${as_lineno-$LINENO}: checking for jpeg_start_compress in -ljpeg" >&5
+$as_echo_n "checking for jpeg_start_compress in -ljpeg... " >&6; }
+if ${ac_cv_lib_jpeg_jpeg_start_compress+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
 else
-  ac_save_LIBS="$LIBS"
+  ac_check_lib_save_LIBS=$LIBS
 LIBS="-ljpeg  $LIBS"
 LIBS="-ljpeg  $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 9812 "configure"
-#include "confdefs.h"
-/* Override any gcc2 internal prototype to avoid an error.  */
-/* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char jpeg_start_compress();
-
-int main() {
-jpeg_start_compress()
-; return 0; }
-EOF
-if { (eval echo configure:9823: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=yes"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* 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 jpeg_start_compress ();
+int
+main ()
+{
+return jpeg_start_compress ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_jpeg_jpeg_start_compress=yes
 else
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=no"
+  ac_cv_lib_jpeg_jpeg_start_compress=no
 fi
 fi
-rm -f conftest*
-LIBS="$ac_save_LIBS"
-
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
 fi
 fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_jpeg_jpeg_start_compress" >&5
+$as_echo "$ac_cv_lib_jpeg_jpeg_start_compress" >&6; }
+if test "x$ac_cv_lib_jpeg_jpeg_start_compress" = xyes; then :
   have_jpeg=yes
                     jpeg_halfassed=no
                     JPEG_LIBS="-ljpeg"
   have_jpeg=yes
                     jpeg_halfassed=no
                     JPEG_LIBS="-ljpeg"
-                    cat >> confdefs.h <<\EOF
-#define HAVE_JPEGLIB 1
-EOF
+                    $as_echo "#define HAVE_JPEGLIB 1" >>confdefs.h
+
+fi
+
+  CPPFLAGS="$ac_save_CPPFLAGS"
+  LDFLAGS="$ac_save_LDFLAGS"
+#  LIBS="$ac_save_LIBS"
+
+  fi
+fi
+
+
+###############################################################################
+#
+#       Check for pty support: this allows 'phosphor' and 'apple2'
+#      to run curses-based programs, or be used as terminal windows.
+#
+###############################################################################
+
+PTY_LIBS=
+for ac_header in pty.h util.h
+do :
+  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+  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:${as_lineno-$LINENO}: checking for forkpty in -lutil" >&5
+$as_echo_n "checking for forkpty in -lutil... " >&6; }
+if ${ac_cv_lib_util_forkpty+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lutil  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* 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 forkpty ();
+int
+main ()
+{
+return forkpty ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_util_forkpty=yes
 else
 else
-  echo "$ac_t""no" 1>&6
+  ac_cv_lib_util_forkpty=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_util_forkpty" >&5
+$as_echo "$ac_cv_lib_util_forkpty" >&6; }
+if test "x$ac_cv_lib_util_forkpty" = xyes; then :
+  PTY_LIBS="-lutil"
+                ac_have_forkpty=yes
+                $as_echo "#define HAVE_FORKPTY 1" >>confdefs.h
+
 fi
 
   CPPFLAGS="$ac_save_CPPFLAGS"
   LDFLAGS="$ac_save_LDFLAGS"
 #  LIBS="$ac_save_LIBS"
 fi
 
   CPPFLAGS="$ac_save_CPPFLAGS"
   LDFLAGS="$ac_save_LDFLAGS"
 #  LIBS="$ac_save_LIBS"
-  
+
+
+if test "$ac_have_forkpty" != yes ; then
+  # we don't need (or have) -lutil on MacOS 10.4.2...
+
+  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
   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:${as_lineno-$LINENO}: checking for forkpty in -lc" >&5
+$as_echo_n "checking for forkpty in -lc... " >&6; }
+if ${ac_cv_lib_c_forkpty+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lc  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* 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 forkpty ();
+int
+main ()
+{
+return forkpty ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_c_forkpty=yes
+else
+  ac_cv_lib_c_forkpty=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_c_forkpty" >&5
+$as_echo "$ac_cv_lib_c_forkpty" >&6; }
+if test "x$ac_cv_lib_c_forkpty" = xyes; then :
+  PTY_LIBS=""
+                  $as_echo "#define HAVE_FORKPTY 1" >>confdefs.h
+
 fi
 
 fi
 
+  CPPFLAGS="$ac_save_CPPFLAGS"
+  LDFLAGS="$ac_save_LDFLAGS"
+#  LIBS="$ac_save_LIBS"
+
+fi
 
 ###############################################################################
 #
 
 ###############################################################################
 #
 
 have_xshm=no
 with_xshm_req=unspecified
 
 have_xshm=no
 with_xshm_req=unspecified
-# Check whether --with-xshm-ext or --without-xshm-ext was given.
-if test "${with_xshm_ext+set}" = set; then
-  withval="$with_xshm_ext"
-  with_xshm="$withval"; with_xshm_req="$withval"
+
+# Check whether --with-xshm-ext was given.
+if test "${with_xshm_ext+set}" = set; then :
+  withval=$with_xshm_ext; with_xshm="$withval"; with_xshm_req="$withval"
 else
   with_xshm=yes
 fi
 else
   with_xshm=yes
 fi
     no)  ;;
 
     /*)
     no)  ;;
 
     /*)
-     echo $ac_n "checking for XSHM headers""... $ac_c" 1>&6
-echo "configure:9881: checking for XSHM headers" >&5
+     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XSHM headers" >&5
+$as_echo_n "checking for XSHM headers... " >&6; }
      d=$with_xshm/include
      if test -d $d; then
        X_CFLAGS="-I$d $X_CFLAGS"
      d=$with_xshm/include
      if test -d $d; then
        X_CFLAGS="-I$d $X_CFLAGS"
-       echo "$ac_t""$d" 1>&6
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $d" >&5
+$as_echo "$d" >&6; }
      else
      else
-       echo "$ac_t""not found ($d: no such directory)" 1>&6
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found ($d: no such directory)" >&5
+$as_echo "not found ($d: no such directory)" >&6; }
      fi
 
      fi
 
-     echo $ac_n "checking for XSHM libs""... $ac_c" 1>&6
-echo "configure:9891: checking for XSHM libs" >&5
+     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XSHM libs" >&5
+$as_echo_n "checking for XSHM libs... " >&6; }
      d=$with_xshm/lib
      if test -d $d; then
        X_LIBS="-L$d $X_LIBS"
      d=$with_xshm/lib
      if test -d $d; then
        X_LIBS="-L$d $X_LIBS"
-       echo "$ac_t""$d" 1>&6
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $d" >&5
+$as_echo "$d" >&6; }
      else
      else
-       echo "$ac_t""not found ($d: no such directory)" 1>&6
+       { $as_echo "$as_me:${as_lineno-$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".
      fi
 
      # replace the directory string with "yes".
@@ -9898,139 +13843,62 @@ echo "configure:9891: checking for XSHM libs" >&5
      exit 1
      ;;
    esac
      exit 1
      ;;
    esac
-  
+
 
 if test "$with_xshm" = yes; then
 
   # first check for Xshm.h.
 
 if test "$with_xshm" = yes; then
 
   # first check for Xshm.h.
-  
+
   ac_save_CPPFLAGS="$CPPFLAGS"
   ac_save_CPPFLAGS="$CPPFLAGS"
-  if test \! -z "$includedir" ; then 
+  if test \! -z "$includedir" ; then
     CPPFLAGS="$CPPFLAGS -I$includedir"
   fi
   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
     CPPFLAGS="$CPPFLAGS -I$includedir"
   fi
   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
-  ac_safe=`echo "X11/extensions/XShm.h" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for X11/extensions/XShm.h""... $ac_c" 1>&6
-echo "configure:9926: checking for X11/extensions/XShm.h" >&5
-if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  cat > conftest.$ac_ext <<EOF
-#line 9931 "configure"
-#include "confdefs.h"
-#include <X11/extensions/XShm.h>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:9936: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
-  rm -rf conftest*
-  eval "ac_cv_header_$ac_safe=yes"
-else
-  echo "$ac_err" >&5
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_header_$ac_safe=no"
-fi
-rm -f conftest*
-fi
-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
+  CPPFLAGS=`eval eval eval eval eval eval eval eval eval echo $CPPFLAGS`
+  ac_fn_c_check_header_compile "$LINENO" "X11/extensions/XShm.h" "ac_cv_header_X11_extensions_XShm_h" "#include <X11/Xlib.h>
+"
+if test "x$ac_cv_header_X11_extensions_XShm_h" = xyes; then :
   have_xshm=yes
   have_xshm=yes
-else
-  echo "$ac_t""no" 1>&6
 fi
 
 fi
 
+
   CPPFLAGS="$ac_save_CPPFLAGS"
 
   # if that succeeded, then check for sys/ipc.h.
   if test "$have_xshm" = yes; then
     have_xshm=no
   CPPFLAGS="$ac_save_CPPFLAGS"
 
   # if that succeeded, then check for sys/ipc.h.
   if test "$have_xshm" = yes; then
     have_xshm=no
-    
+
   ac_save_CPPFLAGS="$CPPFLAGS"
   ac_save_CPPFLAGS="$CPPFLAGS"
-  if test \! -z "$includedir" ; then 
+  if test \! -z "$includedir" ; then
     CPPFLAGS="$CPPFLAGS -I$includedir"
   fi
   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
     CPPFLAGS="$CPPFLAGS -I$includedir"
   fi
   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
-  ac_safe=`echo "sys/ipc.h" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for sys/ipc.h""... $ac_c" 1>&6
-echo "configure:9970: checking for sys/ipc.h" >&5
-if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  cat > conftest.$ac_ext <<EOF
-#line 9975 "configure"
-#include "confdefs.h"
-#include <sys/ipc.h>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:9980: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
-  rm -rf conftest*
-  eval "ac_cv_header_$ac_safe=yes"
-else
-  echo "$ac_err" >&5
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_header_$ac_safe=no"
-fi
-rm -f conftest*
-fi
-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
+  CPPFLAGS=`eval eval eval eval eval eval eval eval eval echo $CPPFLAGS`
+  ac_fn_c_check_header_mongrel "$LINENO" "sys/ipc.h" "ac_cv_header_sys_ipc_h" "$ac_includes_default"
+if test "x$ac_cv_header_sys_ipc_h" = xyes; then :
   have_xshm=yes
   have_xshm=yes
-else
-  echo "$ac_t""no" 1>&6
 fi
 
 fi
 
+
   CPPFLAGS="$ac_save_CPPFLAGS"
   fi
 
   # if that succeeded, then check for sys/shm.h.
   if test "$have_xshm" = yes; then
     have_xshm=no
   CPPFLAGS="$ac_save_CPPFLAGS"
   fi
 
   # if that succeeded, then check for sys/shm.h.
   if test "$have_xshm" = yes; then
     have_xshm=no
-    
+
   ac_save_CPPFLAGS="$CPPFLAGS"
   ac_save_CPPFLAGS="$CPPFLAGS"
-  if test \! -z "$includedir" ; then 
+  if test \! -z "$includedir" ; then
     CPPFLAGS="$CPPFLAGS -I$includedir"
   fi
   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
     CPPFLAGS="$CPPFLAGS -I$includedir"
   fi
   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
-  ac_safe=`echo "sys/shm.h" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for sys/shm.h""... $ac_c" 1>&6
-echo "configure:10015: checking for sys/shm.h" >&5
-if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  cat > conftest.$ac_ext <<EOF
-#line 10020 "configure"
-#include "confdefs.h"
-#include <sys/shm.h>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:10025: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
-  rm -rf conftest*
-  eval "ac_cv_header_$ac_safe=yes"
-else
-  echo "$ac_err" >&5
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_header_$ac_safe=no"
-fi
-rm -f conftest*
-fi
-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
+  CPPFLAGS=`eval eval eval eval eval eval eval eval eval echo $CPPFLAGS`
+  ac_fn_c_check_header_mongrel "$LINENO" "sys/shm.h" "ac_cv_header_sys_shm_h" "$ac_includes_default"
+if test "x$ac_cv_header_sys_shm_h" = xyes; then :
   have_xshm=yes
   have_xshm=yes
-else
-  echo "$ac_t""no" 1>&6
 fi
 
 fi
 
+
   CPPFLAGS="$ac_save_CPPFLAGS"
   fi
 
   CPPFLAGS="$ac_save_CPPFLAGS"
   fi
 
     *-aix*)
       if  `uname -v` -eq 3 ; then
         have_xshm=no
     *-aix*)
       if  `uname -v` -eq 3 ; then
         have_xshm=no
-        
+
   ac_save_CPPFLAGS="$CPPFLAGS"
   ac_save_LDFLAGS="$LDFLAGS"
 #  ac_save_LIBS="$LIBS"
 
   ac_save_CPPFLAGS="$CPPFLAGS"
   ac_save_LDFLAGS="$LDFLAGS"
 #  ac_save_LIBS="$LIBS"
 
-  if test \! -z "$includedir" ; then 
+  if test \! -z "$includedir" ; then
     CPPFLAGS="$CPPFLAGS -I$includedir"
   fi
   # note: $X_CFLAGS includes $x_includes
     CPPFLAGS="$CPPFLAGS -I$includedir"
   fi
   # note: $X_CFLAGS includes $x_includes
   # note: $X_LIBS includes $x_libraries
   LDFLAGS="$LDFLAGS $X_LIBS $X_EXTRA_LIBS"
 
   # note: $X_LIBS includes $x_libraries
   LDFLAGS="$LDFLAGS $X_LIBS $X_EXTRA_LIBS"
 
-  echo $ac_n "checking for XShmQueryExtension in -lXextSam""... $ac_c" 1>&6
-echo "configure:10077: checking for XShmQueryExtension in -lXextSam" >&5
-ac_lib_var=`echo XextSam'_'XShmQueryExtension | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+  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:${as_lineno-$LINENO}: checking for XShmQueryExtension in -lXextSam" >&5
+$as_echo_n "checking for XShmQueryExtension in -lXextSam... " >&6; }
+if ${ac_cv_lib_XextSam_XShmQueryExtension+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
 else
-  ac_save_LIBS="$LIBS"
+  ac_check_lib_save_LIBS=$LIBS
 LIBS="-lXextSam -lX11 -lXext -lm $LIBS"
 LIBS="-lXextSam -lX11 -lXext -lm $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 10085 "configure"
-#include "confdefs.h"
-/* Override any gcc2 internal prototype to avoid an error.  */
-/* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char XShmQueryExtension();
-
-int main() {
-XShmQueryExtension()
-; return 0; }
-EOF
-if { (eval echo configure:10096: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=yes"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* 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 XShmQueryExtension ();
+int
+main ()
+{
+return XShmQueryExtension ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_XextSam_XShmQueryExtension=yes
 else
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=no"
+  ac_cv_lib_XextSam_XShmQueryExtension=no
 fi
 fi
-rm -f conftest*
-LIBS="$ac_save_LIBS"
-
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
 fi
 fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_XextSam_XShmQueryExtension" >&5
+$as_echo "$ac_cv_lib_XextSam_XShmQueryExtension" >&6; }
+if test "x$ac_cv_lib_XextSam_XShmQueryExtension" = xyes; then :
   have_xshm=yes; X_EXTRA_LIBS="$X_EXTRA_LIBS -lXextSam"
 else
   have_xshm=yes; X_EXTRA_LIBS="$X_EXTRA_LIBS -lXextSam"
 else
-  echo "$ac_t""no" 1>&6
-true
+  true
 fi
 
   CPPFLAGS="$ac_save_CPPFLAGS"
   LDFLAGS="$ac_save_LDFLAGS"
 #  LIBS="$ac_save_LIBS"
 fi
 
   CPPFLAGS="$ac_save_CPPFLAGS"
   LDFLAGS="$ac_save_LDFLAGS"
 #  LIBS="$ac_save_LIBS"
-  
+
       fi
     ;;
   esac
 
   # if that succeeded, then we've really got it.
   if test "$have_xshm" = yes; then
       fi
     ;;
   esac
 
   # if that succeeded, then we've really got it.
   if test "$have_xshm" = yes; then
-    cat >> confdefs.h <<\EOF
-#define HAVE_XSHM_EXTENSION 1
-EOF
+    $as_echo "#define HAVE_XSHM_EXTENSION 1" >>confdefs.h
 
   fi
 
 
   fi
 
 
 have_xdbe=no
 with_xdbe_req=unspecified
 
 have_xdbe=no
 with_xdbe_req=unspecified
-# Check whether --with-xdbe-ext or --without-xdbe-ext was given.
-if test "${with_xdbe_ext+set}" = set; then
-  withval="$with_xdbe_ext"
-  with_xdbe="$withval"; with_xdbe_req="$withval"
+
+# Check whether --with-xdbe-ext was given.
+if test "${with_xdbe_ext+set}" = set; then :
+  withval=$with_xdbe_ext; with_xdbe="$withval"; with_xdbe_req="$withval"
 else
   with_xdbe=yes
 fi
 else
   with_xdbe=yes
 fi
     no)  ;;
 
     /*)
     no)  ;;
 
     /*)
-     echo $ac_n "checking for DOUBLE-BUFFER headers""... $ac_c" 1>&6
-echo "configure:10163: checking for DOUBLE-BUFFER headers" >&5
+     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for DOUBLE-BUFFER headers" >&5
+$as_echo_n "checking for DOUBLE-BUFFER headers... " >&6; }
      d=$with_xdbe/include
      if test -d $d; then
        X_CFLAGS="-I$d $X_CFLAGS"
      d=$with_xdbe/include
      if test -d $d; then
        X_CFLAGS="-I$d $X_CFLAGS"
-       echo "$ac_t""$d" 1>&6
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $d" >&5
+$as_echo "$d" >&6; }
      else
      else
-       echo "$ac_t""not found ($d: no such directory)" 1>&6
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found ($d: no such directory)" >&5
+$as_echo "not found ($d: no such directory)" >&6; }
      fi
 
      fi
 
-     echo $ac_n "checking for DOUBLE-BUFFER libs""... $ac_c" 1>&6
-echo "configure:10173: checking for DOUBLE-BUFFER libs" >&5
+     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for DOUBLE-BUFFER libs" >&5
+$as_echo_n "checking for DOUBLE-BUFFER libs... " >&6; }
      d=$with_xdbe/lib
      if test -d $d; then
        X_LIBS="-L$d $X_LIBS"
      d=$with_xdbe/lib
      if test -d $d; then
        X_LIBS="-L$d $X_LIBS"
-       echo "$ac_t""$d" 1>&6
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $d" >&5
+$as_echo "$d" >&6; }
      else
      else
-       echo "$ac_t""not found ($d: no such directory)" 1>&6
+       { $as_echo "$as_me:${as_lineno-$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".
      fi
 
      # replace the directory string with "yes".
@@ -10180,55 +14053,28 @@ echo "configure:10173: checking for DOUBLE-BUFFER libs" >&5
      exit 1
      ;;
    esac
      exit 1
      ;;
    esac
-  
+
 
 if test "$with_xdbe" = yes; then
 
 
 if test "$with_xdbe" = yes; then
 
-  
+
   ac_save_CPPFLAGS="$CPPFLAGS"
   ac_save_CPPFLAGS="$CPPFLAGS"
-  if test \! -z "$includedir" ; then 
+  if test \! -z "$includedir" ; then
     CPPFLAGS="$CPPFLAGS -I$includedir"
   fi
   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
     CPPFLAGS="$CPPFLAGS -I$includedir"
   fi
   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
-  ac_safe=`echo "X11/extensions/Xdbe.h" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for X11/extensions/Xdbe.h""... $ac_c" 1>&6
-echo "configure:10207: checking for X11/extensions/Xdbe.h" >&5
-if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  cat > conftest.$ac_ext <<EOF
-#line 10212 "configure"
-#include "confdefs.h"
-#include <X11/extensions/Xdbe.h>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:10217: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
-  rm -rf conftest*
-  eval "ac_cv_header_$ac_safe=yes"
-else
-  echo "$ac_err" >&5
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_header_$ac_safe=no"
-fi
-rm -f conftest*
-fi
-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
+  CPPFLAGS=`eval eval eval eval eval eval eval eval eval echo $CPPFLAGS`
+  ac_fn_c_check_header_compile "$LINENO" "X11/extensions/Xdbe.h" "ac_cv_header_X11_extensions_Xdbe_h" "#include <X11/Xlib.h>
+"
+if test "x$ac_cv_header_X11_extensions_Xdbe_h" = xyes; then :
   have_xdbe=yes
   have_xdbe=yes
-else
-  echo "$ac_t""no" 1>&6
 fi
 
 fi
 
+
   CPPFLAGS="$ac_save_CPPFLAGS"
   if test "$have_xdbe" = yes; then
   CPPFLAGS="$ac_save_CPPFLAGS"
   if test "$have_xdbe" = yes; then
-    cat >> confdefs.h <<\EOF
-#define HAVE_DOUBLE_BUFFER_EXTENSION 1
-EOF
-    
+    $as_echo "#define HAVE_DOUBLE_BUFFER_EXTENSION 1" >>confdefs.h
+
   fi
 
 elif test "$with_xdbe" != no; then
   fi
 
 elif test "$with_xdbe" != no; then
 
 have_readdisplay=no
 with_readdisplay_req=unspecified
 
 have_readdisplay=no
 with_readdisplay_req=unspecified
-# Check whether --with-readdisplay or --without-readdisplay was given.
-if test "${with_readdisplay+set}" = set; then
-  withval="$with_readdisplay"
-  with_readdisplay="$withval"; with_readdisplay_req="$withval"
+
+# Check whether --with-readdisplay was given.
+if test "${with_readdisplay+set}" = set; then :
+  withval=$with_readdisplay; with_readdisplay="$withval"; with_readdisplay_req="$withval"
 else
   with_readdisplay=yes
 fi
 else
   with_readdisplay=yes
 fi
     no)  ;;
 
     /*)
     no)  ;;
 
     /*)
-     echo $ac_n "checking for XReadDisplay headers""... $ac_c" 1>&6
-echo "configure:10280: checking for XReadDisplay headers" >&5
+     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XReadDisplay headers" >&5
+$as_echo_n "checking for XReadDisplay headers... " >&6; }
      d=$with_readdisplay/include
      if test -d $d; then
        X_CFLAGS="-I$d $X_CFLAGS"
      d=$with_readdisplay/include
      if test -d $d; then
        X_CFLAGS="-I$d $X_CFLAGS"
-       echo "$ac_t""$d" 1>&6
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $d" >&5
+$as_echo "$d" >&6; }
      else
      else
-       echo "$ac_t""not found ($d: no such directory)" 1>&6
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found ($d: no such directory)" >&5
+$as_echo "not found ($d: no such directory)" >&6; }
      fi
 
      fi
 
-     echo $ac_n "checking for XReadDisplay libs""... $ac_c" 1>&6
-echo "configure:10290: checking for XReadDisplay libs" >&5
+     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XReadDisplay libs" >&5
+$as_echo_n "checking for XReadDisplay libs... " >&6; }
      d=$with_readdisplay/lib
      if test -d $d; then
        X_LIBS="-L$d $X_LIBS"
      d=$with_readdisplay/lib
      if test -d $d; then
        X_LIBS="-L$d $X_LIBS"
-       echo "$ac_t""$d" 1>&6
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $d" >&5
+$as_echo "$d" >&6; }
      else
      else
-       echo "$ac_t""not found ($d: no such directory)" 1>&6
+       { $as_echo "$as_me:${as_lineno-$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".
      fi
 
      # replace the directory string with "yes".
@@ -10297,51 +14147,24 @@ echo "configure:10290: checking for XReadDisplay libs" >&5
      exit 1
      ;;
    esac
      exit 1
      ;;
    esac
-  
+
 
 if test "$with_readdisplay" = yes; then
 
 if test "$with_readdisplay" = yes; then
-  
+
   ac_save_CPPFLAGS="$CPPFLAGS"
   ac_save_CPPFLAGS="$CPPFLAGS"
-  if test \! -z "$includedir" ; then 
+  if test \! -z "$includedir" ; then
     CPPFLAGS="$CPPFLAGS -I$includedir"
   fi
   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
     CPPFLAGS="$CPPFLAGS -I$includedir"
   fi
   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
-  ac_safe=`echo "X11/extensions/readdisplay.h" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for X11/extensions/readdisplay.h""... $ac_c" 1>&6
-echo "configure:10323: checking for X11/extensions/readdisplay.h" >&5
-if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  cat > conftest.$ac_ext <<EOF
-#line 10328 "configure"
-#include "confdefs.h"
-#include <X11/extensions/readdisplay.h>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:10333: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
-  rm -rf conftest*
-  eval "ac_cv_header_$ac_safe=yes"
-else
-  echo "$ac_err" >&5
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_header_$ac_safe=no"
-fi
-rm -f conftest*
-fi
-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-  cat >> confdefs.h <<\EOF
-#define HAVE_READ_DISPLAY_EXTENSION 1
-EOF
+  CPPFLAGS=`eval eval eval eval eval eval eval eval eval echo $CPPFLAGS`
+  ac_fn_c_check_header_compile "$LINENO" "X11/extensions/readdisplay.h" "ac_cv_header_X11_extensions_readdisplay_h" "#include <X11/Xlib.h>
+"
+if test "x$ac_cv_header_X11_extensions_readdisplay_h" = xyes; then :
+  $as_echo "#define HAVE_READ_DISPLAY_EXTENSION 1" >>confdefs.h
 
 
-else
-  echo "$ac_t""no" 1>&6
 fi
 
 fi
 
+
   CPPFLAGS="$ac_save_CPPFLAGS"
 elif test "$with_readdisplay" != no; then
   echo "error: must be yes or no: --with-readdisplay=$with_readdisplay"
   CPPFLAGS="$ac_save_CPPFLAGS"
 elif test "$with_readdisplay" != no; then
   echo "error: must be yes or no: --with-readdisplay=$with_readdisplay"
 
 ###############################################################################
 #
 
 ###############################################################################
 #
-#       Check for a program to generate random text.
-#
-#       Zippy is funnier than the idiocy generally spat out by `fortune',
-#       so first see if "fortune zippy" works.  Else, use plain "fortune".
-#
-#       We used to dig around in Emacs to look for the "yow" program, but
-#       most people who have Emacs also have "fortune zippy", so nevermind.
+#       Check for a directory full of images to use as the default value
+#      of the "imageDirectory" preference.
 #
 ###############################################################################
 
 #
 ###############################################################################
 
-with_fortune_req=""
-# Check whether --with-fortune or --without-fortune was given.
-if test "${with_fortune+set}" = set; then
-  withval="$with_fortune"
-  with_fortune_req="$withval"; with_fortune="$withval"
-else
-  with_fortune=yes
-fi
+have_imagedir=no
+with_imagedir_req=unspecified
 
 
 
 
-if test "$with_fortune" = no || test "$with_fortune" = yes ; then
-  with_fortune=""
-  with_fortune_req=""
+# Check whether --with-image-directory was given.
+if test "${with_image_directory+set}" = set; then :
+  withval=$with_image_directory; with_imagedir="$withval"; with_imagedir_req="$withval"
+else
+  with_imagedir=yes
 fi
 
 fi
 
-if test -n "$with_fortune_req" ; then
-  ac_cv_fortune_program=""
-  case "$with_fortune_req" in
-    /*)
+# no HANDLE_X_PATH_ARG for this one
 
 
-      set dummy $with_fortune_req ; fortune_tmp=$2
-      echo $ac_n "checking for $fortune_tmp""... $ac_c" 1>&6
-echo "configure:10398: checking for $fortune_tmp" >&5
-      if test -x "$fortune_tmp" ; then
-        echo "$ac_t""yes" 1>&6
-      else
-        echo "$ac_t""no" 1>&6
-        with_fortune=""
-      fi
-    ;;
-    *)
-      set dummy $with_fortune_req ; fortune_tmp=$2
-      # don't cache
-      unset ac_cv_path_fortune_tmp
-      # Extract the first word of "$fortune_tmp", so it can be a program name with args.
-set dummy $fortune_tmp; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:10413: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_path_fortune_tmp'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  case "$fortune_tmp" in
+case "$with_imagedir" in
   /*)
   /*)
-  ac_cv_path_fortune_tmp="$fortune_tmp" # Let the user override the test with a path.
+    # absolute path
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for image directory $with_imagedir" >&5
+$as_echo_n "checking for image directory $with_imagedir... " >&6; }
+    if test -d "$with_imagedir" ; then
+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+    else
+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+      with_imagedir=""
+    fi
+  ;;
+  yes)
+    with_imagedir=""
+
+    #### Could use some more defaults here...
+    for dd in \
+      "/usr/share/backgrounds/images/"          \
+      "/usr/share/wallpapers/"                  \
+      "/Library/Desktop Pictures/"              \
+    ; do
+      if test -z "$with_imagedir"; then
+        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for image directory $dd" >&5
+$as_echo_n "checking for image directory $dd... " >&6; }
+        if test -d "$dd" ; then
+          { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+          with_imagedir="$dd"
+        else
+          { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+        fi
+      fi
+    done
+
   ;;
   ;;
-  ?:/*)                         
-  ac_cv_path_fortune_tmp="$fortune_tmp" # Let the user override the test with a dos path.
+  no)
+    with_imagedir=""
   ;;
   ;;
+
   *)
   *)
-  IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS=":"
-  ac_dummy="$PATH"
-  for ac_dir in $ac_dummy; do 
-    test -z "$ac_dir" && ac_dir=.
-    if test -f $ac_dir/$ac_word; then
-      ac_cv_path_fortune_tmp="$ac_dir/$ac_word"
-      break
-    fi
-  done
-  IFS="$ac_save_ifs"
+    echo "error: must be an absolute path: --with-image-directory=$with_imagedir_req"
+    exit 1
   ;;
 esac
   ;;
 esac
-fi
-fortune_tmp="$ac_cv_path_fortune_tmp"
-if test -n "$fortune_tmp"; then
-  echo "$ac_t""$fortune_tmp" 1>&6
-else
-  echo "$ac_t""no" 1>&6
-fi
+ac_cv_imagedir="$with_imagedir"
 
 
-      if test -z "$fortune_tmp" ; then
-        with_fortune=""
-      fi
-    ;;
-  esac
-  ac_cv_fortune_program="$with_fortune"
+DEFAULT_IMAGES_P='True'
+DEFAULT_IMAGE_DIRECTORY="$ac_cv_imagedir"
 
 
-elif test -n "$ac_cv_fortune_program"; then
-  echo "$ac_t""checking for fortune... (cached) $ac_cv_fortune_program" 1>&6
+if test -z "$DEFAULT_IMAGE_DIRECTORY" ; then
+  DEFAULT_IMAGES_P='False'
 fi
 
 fi
 
-unset ac_cv_path_fortune_tmp
-unset fortune_tmp
 
 
-if test -z "$ac_cv_fortune_program" ; then
+###############################################################################
+#
+#       Pick a text file to use as the default of the "textFile" preference.
+#      Any old file will do, but preferably one that will make interesting
+#      shapes when displayed by "starwars" and "fontglide".
+#
+###############################################################################
+
+have_textfile=no
+with_textfile_req=unspecified
+
 
 
-  # first look for fortune in /usr/games/ (and use absolute path)
-  for ac_prog in fortune
-do
-# Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:10467: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_path_fortune_tmp'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+# Check whether --with-text-file was given.
+if test "${with_text_file+set}" = set; then :
+  withval=$with_text_file; with_textfile="$withval"; with_textfile_req="$withval"
 else
 else
-  case "$fortune_tmp" in
+  with_textfile=yes
+fi
+
+# no HANDLE_X_PATH_ARG for this one
+
+case "$with_textfile" in
   /*)
   /*)
-  ac_cv_path_fortune_tmp="$fortune_tmp" # Let the user override the test with a path.
+    # absolute path
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for text file $with_textfile" >&5
+$as_echo_n "checking for text file $with_textfile... " >&6; }
+    if test -f "$with_textfile" ; then
+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+    else
+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+      with_textfile=""
+    fi
+  ;;
+  yes)
+    with_textfile=""
+
+    #### Could use some more defaults here...
+    for f in \
+      "/usr/X11R6/lib/X11/doc/README"             \
+      "/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:${as_lineno-$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:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+          with_textfile="$f"
+        else
+          { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+        fi
+      fi
+    done
+
   ;;
   ;;
-  ?:/*)                         
-  ac_cv_path_fortune_tmp="$fortune_tmp" # Let the user override the test with a dos path.
+  no)
+    with_textfile=""
   ;;
   ;;
+
   *)
   *)
-  IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS=":"
-  ac_dummy=""/usr/games""
-  for ac_dir in $ac_dummy; do 
-    test -z "$ac_dir" && ac_dir=.
-    if test -f $ac_dir/$ac_word; then
-      ac_cv_path_fortune_tmp="$ac_dir/$ac_word"
-      break
-    fi
-  done
-  IFS="$ac_save_ifs"
+    echo "error: must be an absolute path: --with-text-file=$with_textfile_req"
+    exit 1
   ;;
 esac
   ;;
 esac
-fi
-fortune_tmp="$ac_cv_path_fortune_tmp"
-if test -n "$fortune_tmp"; then
-  echo "$ac_t""$fortune_tmp" 1>&6
-else
-  echo "$ac_t""no" 1>&6
-fi
-
-test -n "$fortune_tmp" && break
-done
-
-
-  # if it's not there, look on $PATH (and don't use absolute path)
-  if test -z "$fortune_tmp" ; then
-     for ac_prog in fortune
-do
-# Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:10510: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_fortune_tmp'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  if test -n "$fortune_tmp"; then
-  ac_cv_prog_fortune_tmp="$fortune_tmp" # Let the user override the test.
-else
-  IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS=":"
-  ac_dummy="$PATH"
-  for ac_dir in $ac_dummy; do
-    test -z "$ac_dir" && ac_dir=.
-    if test -f $ac_dir/$ac_word; then
-      ac_cv_prog_fortune_tmp="$ac_prog"
-      break
-    fi
-  done
-  IFS="$ac_save_ifs"
-fi
-fi
-fortune_tmp="$ac_cv_prog_fortune_tmp"
-if test -n "$fortune_tmp"; then
-  echo "$ac_t""$fortune_tmp" 1>&6
-else
-  echo "$ac_t""no" 1>&6
-fi
+ac_cv_textfile="$with_textfile"
 
 
-test -n "$fortune_tmp" && break
-done
+DEFAULT_TEXT_FILE="$ac_cv_textfile"
 
 
-  fi
 
 
-  # if we didn't find anything, then just assume /usr/games/
-  if test -z "$fortune_tmp" ; then
-     fortune_tmp="/usr/games/fortune"
-  fi
+###############################################################################
+#
+#       Check the browser to see help URL
+#
+###############################################################################
 
 
-  ac_cv_fortune_program="$fortune_tmp"
+have_browser=no
+with_browser_req=unspecified
 
 
-  # now check to see whether "fortune zippy" works.
-  #
-  fortune_tmp="$fortune_tmp zippy"
-  echo $ac_n "checking for zippy quotes""... $ac_c" 1>&6
-echo "configure:10552: checking for zippy quotes" >&5
-  if ( $fortune_tmp >/dev/null 2>&1 ); then
-    ac_cv_fortune_program="$fortune_tmp"
-    echo "$ac_t""$fortune_tmp" 1>&6
-  else
-    echo "$ac_t""no" 1>&6
-  fi
 
 
+# Check whether --with-browser was given.
+if test "${with_browser+set}" = set; then :
+  withval=$with_browser; with_browser="$withval"; with_browser_req="$withval"
+else
+  with_browser=no
 fi
 
 fi
 
-unset ac_cv_path_fortune_tmp
-unset fortune_tmp
-
-cat >> confdefs.h <<EOF
-#define FORTUNE_PROGRAM "$ac_cv_fortune_program"
-EOF
-
+# no HANDLE_X_PATH_ARG for this one
 
 
+case "$with_browser" in
+  no )
+  ;;
+  * )
+    WITH_BROWSER=$with_browser
+    gnome_open_program=$with_browser
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for browser $with_browser" >&5
+$as_echo_n "checking for browser $with_browser... " >&6; }
+    with_browser_fullpath=`which $with_browser 2>/dev/null`
+    case $with_browser_fullpath in
+        /* )
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+                have_browser=yes
+                ;;
+       * )
+              { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+# Only warning: we don't want to install all packages for the
+# dependency of the browser in building stage...
+              echo "WARNING: browser not found: --with-browser=$with_browser"
+              ;;
+    esac
+  ;;
+esac
+ac_cv_browser="$with_browser"
 
 ###############################################################################
 #
 
 ###############################################################################
 #
@@ -10565,10 +14382,10 @@ EOF
 
 setuid_hacks_default=no
 setuid_hacks="$setuid_hacks_default"
 
 setuid_hacks_default=no
 setuid_hacks="$setuid_hacks_default"
-# Check whether --with-setuid-hacks or --without-setuid-hacks was given.
-if test "${with_setuid_hacks+set}" = set; then
-  withval="$with_setuid_hacks"
-  setuid_hacks="$withval"
+
+# Check whether --with-setuid-hacks was given.
+if test "${with_setuid_hacks+set}" = set; then :
+  withval=$with_setuid_hacks; setuid_hacks="$withval"
 else
   setuid_hacks="$setuid_hacks_default"
 fi
 else
   setuid_hacks="$setuid_hacks_default"
 fi
     no)  ;;
 
     /*)
     no)  ;;
 
     /*)
-     echo $ac_n "checking for setuid hacks headers""... $ac_c" 1>&6
-echo "configure:10596: checking for setuid hacks headers" >&5
+     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for setuid hacks headers" >&5
+$as_echo_n "checking for setuid hacks headers... " >&6; }
      d=$setuid_hacks/include
      if test -d $d; then
        X_CFLAGS="-I$d $X_CFLAGS"
      d=$setuid_hacks/include
      if test -d $d; then
        X_CFLAGS="-I$d $X_CFLAGS"
-       echo "$ac_t""$d" 1>&6
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $d" >&5
+$as_echo "$d" >&6; }
      else
      else
-       echo "$ac_t""not found ($d: no such directory)" 1>&6
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found ($d: no such directory)" >&5
+$as_echo "not found ($d: no such directory)" >&6; }
      fi
 
      fi
 
-     echo $ac_n "checking for setuid hacks libs""... $ac_c" 1>&6
-echo "configure:10606: checking for setuid hacks libs" >&5
+     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for setuid hacks libs" >&5
+$as_echo_n "checking for setuid hacks libs... " >&6; }
      d=$setuid_hacks/lib
      if test -d $d; then
        X_LIBS="-L$d $X_LIBS"
      d=$setuid_hacks/lib
      if test -d $d; then
        X_LIBS="-L$d $X_LIBS"
-       echo "$ac_t""$d" 1>&6
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $d" >&5
+$as_echo "$d" >&6; }
      else
      else
-       echo "$ac_t""not found ($d: no such directory)" 1>&6
+       { $as_echo "$as_me:${as_lineno-$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".
      fi
 
      # replace the directory string with "yes".
@@ -10613,7 +14434,7 @@ echo "configure:10606: checking for setuid hacks libs" >&5
      exit 1
      ;;
    esac
      exit 1
      ;;
    esac
-  
+
 
 if test "$setuid_hacks" = yes; then
   true
 
 if test "$setuid_hacks" = yes; then
   true
@@ -10635,7 +14456,7 @@ DEPEND_FLAGS=
 DEPEND_DEFINES=
 
 
 DEPEND_DEFINES=
 
 
-if test \! -z "$includedir" ; then 
+if test \! -z "$includedir" ; then
   INCLUDES="$INCLUDES -I$includedir"
 fi
 
   INCLUDES="$INCLUDES -I$includedir"
 fi
 
@@ -10644,7 +14465,7 @@ if test \! -z "$libdir" ; then
 fi
 
 
 fi
 
 
-PREFERRED_DEMO_PROGRAM=xscreensaver-demo-Xm
+PREFERRED_DEMO_PROGRAM=''
 ALL_DEMO_PROGRAMS=
 if test "$have_motif" = yes; then
   PREFERRED_DEMO_PROGRAM=xscreensaver-demo-Xm
 ALL_DEMO_PROGRAMS=
 if test "$have_motif" = yes; then
   PREFERRED_DEMO_PROGRAM=xscreensaver-demo-Xm
@@ -10664,6 +14485,15 @@ if test "$have_pam" = yes; then
   PASSWD_SRCS="$PASSWD_SRCS \$(PAM_SRCS)"
   PASSWD_OBJS="$PASSWD_OBJS \$(PAM_OBJS)"
   INSTALL_PAM="install-pam"
   PASSWD_SRCS="$PASSWD_SRCS \$(PAM_SRCS)"
   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)"
 fi
   PASSWD_SRCS="$PASSWD_SRCS \$(PWENT_SRCS)"
   PASSWD_OBJS="$PASSWD_OBJS \$(PWENT_OBJS)"
 fi
   PASSWD_SRCS="$PASSWD_SRCS \$(PWENT_SRCS)"
   PASSWD_OBJS="$PASSWD_OBJS \$(PWENT_OBJS)"
@@ -10677,6 +14507,17 @@ else
   LOCK_OBJS='$(NOLOCK_OBJS_1)'
 fi
 
   LOCK_OBJS='$(NOLOCK_OBJS_1)'
 fi
 
+if test "$ac_macosx" = yes; then
+  EXES_OSX='$(EXES_OSX)'
+  SCRIPTS_OSX='$(SCRIPTS_OSX)'
+  MEN_OSX='$(MEN_OSX)'
+else
+  EXES_OSX=
+  SCRIPTS_OSX=
+  MEN_OSX=
+fi
+
+
 INSTALL_SETUID='$(INSTALL_PROGRAM) $(SUID_FLAGS)'
 
 if test "$need_setuid" = yes; then
 INSTALL_SETUID='$(INSTALL_PROGRAM) $(SUID_FLAGS)'
 
 if test "$need_setuid" = yes; then
 tab='  '
 if test "$have_gl" = yes; then
   GL_EXES='$(GL_EXES)'
 tab='  '
 if test "$have_gl" = yes; then
   GL_EXES='$(GL_EXES)'
+  SUID_EXES='$(SUID_EXES)'
+  RETIRED_GL_EXES='$(RETIRED_GL_EXES)'
   GL_UTIL_EXES='$(GL_UTIL_EXES)'
   GL_MEN='$(GL_MEN)'
   GL_UTIL_EXES='$(GL_UTIL_EXES)'
   GL_MEN='$(GL_MEN)'
-  GL_KLUDGE="${tab}  "
+  GL_KLUDGE=" "
 else
 else
-  GL_KLUDGE="-${tab}  "
+  GL_KLUDGE="-"
 fi
 
 if test "$have_gle" = yes; then
   GLE_EXES='$(GLE_EXES)'
 fi
 
 if test "$have_gle" = yes; then
   GLE_EXES='$(GLE_EXES)'
-  GLE_MEN='$(GLE_MEN)'
-  GLE_KLUDGE="${tab}   "
+  GLE_KLUDGE=" "
 else
 else
-  GLE_KLUDGE="-${tab}   "
+  GLE_KLUDGE="-"
 fi
 
 if test "$have_jpeg" = yes -a "$have_gdk_pixbuf" = yes; then
 fi
 
 if test "$have_jpeg" = yes -a "$have_gdk_pixbuf" = yes; then
 
 # Another substitution in the XScreenSaver.ad.in file:
 #
 
 # Another substitution in the XScreenSaver.ad.in file:
 #
-if test "$have_gnome_help" = yes; then
-  GNOMEHELP_Y=''
-  GNOMEHELP_N='!    '
+if test "$gnome_open_program" != ''; then
+  GNOME24=''
+  GNOME22='!   '
+  NOGNOME='!   '
+elif test "$gnome_url_show_program" != ''; then
+  GNOME24='!   '
+  GNOME22=''
+  NOGNOME='!   '
 else
 else
-  GNOMEHELP_Y='!    '
-  GNOMEHELP_N=''
+  GNOME24='!   '
+  GNOME22='!   '
+  NOGNOME=''
 fi
 
 
 fi
 
 
-# Now that we know whether we have Gnome, we can decide where the XML
-# config files get installed.
+# Set PO_DATADIR to something sensible.
 #
 #
-if test -z "$HACK_CONF_DIR" ; then
-  if test -n "$GNOME_DATADIR" ; then
-    HACK_CONF_DIR='${GNOME_DATADIR}/control-center/screensavers'
-  else
-    HACK_CONF_DIR='${prefix}/lib/xscreensaver/config'
-  fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for locale directory" >&5
+$as_echo_n "checking for locale directory... " >&6; }
+if test -n "$GTK_DATADIR" ; then
+  PO_DATADIR="$GTK_DATADIR"
+elif test "$have_gtk" = yes; then
+  PO_DATADIR=`$pkg_config --variable=prefix gtk+-2.0`
+  PO_DATADIR="$PO_DATADIR/share"
 fi
 
 fi
 
-
-
-# After computing $HACK_CONF_DIR, make sure $GTK_ICONDIR has a value
-# so that we know where to install the Gtk pixmaps.
-#
-if test -n "$GNOME_DATADIR" ; then
-  GTK_ICONDIR='$(GNOME_DATADIR)/pixmaps'
-elif test "$have_gtk" = yes; then
-  # should this be "$(prefix)/share/pixmaps"? But /usr/X11R6/share/ is wrong...
-  GTK_ICONDIR='/usr/share/pixmaps'
-else
-  GTK_ICONDIR=''
+if test -z "$PO_DATADIR" ; then
+  #
+  # #### Total fucking kludge --
+  # Map /build/prefix/usr/X11R6/share/ to /build/prefix/usr/share/
+  # but of course we need to expand all the nested variables to do that...
+  #
+  dd=`eval eval eval eval eval eval eval eval eval eval eval echo $datadir`
+  PO_DATADIR=`echo $dd | sed 's@/X11R6/@/@'`
 fi
 
 fi
 
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $PO_DATADIR/locale" >&5
+$as_echo "$PO_DATADIR/locale" >&6; }
+
 
 # canonicalize slashes.
 HACK_CONF_DIR=`echo "${HACK_CONF_DIR}" | sed 's@/$@@;s@//*@/@g'`
 
 
 # canonicalize slashes.
 HACK_CONF_DIR=`echo "${HACK_CONF_DIR}" | sed 's@/$@@;s@//*@/@g'`
 
+# gcc 3.0 likes to issue this warning for every file:
+#
+# cc1: warning: changing search order for system directory "/usr/local/include"
+# cc1: warning:   as it has already been specified as a non-system directory
+#
+# Yay.  We can only avoid that by deleting "-I${prefix}/include" from the list.
+# Which *should* be totally redundant, and thus an ok thing to delete?
+#
+INCLUDES=`echo "$INCLUDES" | sed 's@ -I${prefix}/include@@g;'`
 
 
 ###############################################################################
 
 
 ###############################################################################
@@ -10808,7 +14664,6 @@ HACK_CONF_DIR=`echo "${HACK_CONF_DIR}" | sed 's@/$@@;s@//*@/@g'`
 
 
 
 
 
 
-APPDEFAULTS=$ac_x_app_defaults
 
 
 
 
 
 
@@ -10816,438 +14671,1377 @@ APPDEFAULTS=$ac_x_app_defaults
 
 
 
 
 
 
-trap '' 1 2 15
-cat > confcache <<\EOF
-# This file is a shell script that caches the results of configure
-# tests run on this system so they can be shared between configure
-# scripts and configure runs.  It is not useful on other systems.
-# If it contains results you don't want to keep, you may remove or edit it.
-#
-# By default, configure uses ./config.cache as the cache file,
-# creating it if it does not exist already.  You can give configure
-# the --cache-file=FILE option to use a different cache file; that is
-# what configure does when it calls configure scripts in
-# subdirectories, so they share the cache.
-# Giving --cache-file=/dev/null disables caching, for debugging configure.
-# config.status only pays attention to the cache file if you give it the
-# --recheck option to rerun configure.
-#
-EOF
-# The following way of writing the cache mishandles newlines in values,
-# but we know of no workaround that is simple, portable, and efficient.
-# So, don't put newlines in cache variables' values.
-# Ultrix sh set writes to stderr and can't be redirected directly,
-# and sets the high bit in the cache file unless we assign to the vars.
-(set) 2>&1 |
-  case `(ac_space=' '; set | grep ac_space) 2>&1` in
-  *ac_space=\ *)
-    # `set' does not quote correctly, so add quotes (double-quote substitution
-    # turns \\\\ into \\, and sed turns \\ into \).
-    sed -n \
-      -e "s/'/'\\\\''/g" \
-      -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
-    ;;
-  *)
-    # `set' quotes correctly as required by POSIX, so do not add quotes.
-    sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
-    ;;
-  esac >> confcache
-if cmp -s $cache_file confcache; then
-  :
-else
-  if test -w $cache_file; then
-    echo "updating cache $cache_file"
-    cat confcache > $cache_file
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+APPDEFAULTS=$ac_x_app_defaults
+
+
+
+
+
+
+
+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
+# tests run on this system so they can be shared between configure
+# scripts and configure runs, see configure's option --config-cache.
+# It is not useful on other systems.  If it contains results you don't
+# want to keep, you may remove or edit it.
+#
+# config.status only pays attention to the cache file if you give it
+# the --recheck option to rerun configure.
+#
+# `ac_cv_env_foo' variables (set or unset) will be overridden when
+# loading this file, other *unset* `ac_cv_foo' will be assigned the
+# following values.
+
+_ACEOF
+
+# The following way of writing the cache mishandles newlines in values,
+# but we know of no workaround that is simple, portable, and efficient.
+# So, we kill variables containing newlines.
+# Ultrix sh set writes to stderr and can't be redirected directly,
+# and sets the high bit in the cache file unless we assign to the vars.
+(
+  for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do
+    eval ac_val=\$$ac_var
+    case $ac_val in #(
+    *${as_nl}*)
+      case $ac_var in #(
+      *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
+      esac
+      case $ac_var in #(
+      _ | IFS | as_nl) ;; #(
+      BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
+      *) { eval $ac_var=; unset $ac_var;} ;;
+      esac ;;
+    esac
+  done
+
+  (set) 2>&1 |
+    case $as_nl`(ac_space=' '; set) 2>&1` in #(
+    *${as_nl}ac_space=\ *)
+      # `set' does not quote correctly, so add quotes: double-quote
+      # substitution turns \\\\ into \\, and sed turns \\ into \.
+      sed -n \
+       "s/'/'\\\\''/g;
+         s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
+      ;; #(
+    *)
+      # `set' quotes correctly as required by POSIX, so do not add quotes.
+      sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+      ;;
+    esac |
+    sort
+) |
+  sed '
+     /^ac_cv_env_/b end
+     t clear
+     :clear
+     s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
+     t end
+     s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
+     :end' >>confcache
+if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
+  if test -w "$cache_file"; then
+    if test "x$cache_file" != "x/dev/null"; then
+      { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5
+$as_echo "$as_me: updating cache $cache_file" >&6;}
+      if test ! -f "$cache_file" || test -h "$cache_file"; then
+       cat confcache >"$cache_file"
+      else
+        case $cache_file in #(
+        */* | ?:*)
+         mv -f confcache "$cache_file"$$ &&
+         mv -f "$cache_file"$$ "$cache_file" ;; #(
+        *)
+         mv -f confcache "$cache_file" ;;
+       esac
+      fi
+    fi
+  else
+    { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5
+$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
+  fi
+fi
+rm -f confcache
+
+test "x$prefix" = xNONE && prefix=$ac_default_prefix
+# Let make expand exec_prefix.
+test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
+
+DEFS=-DHAVE_CONFIG_H
+
+ac_libobjs=
+ac_ltlibobjs=
+U=
+for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
+  # 1. Remove the extension, and $U if already installed.
+  ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
+  ac_i=`$as_echo "$ac_i" | sed "$ac_script"`
+  # 2. Prepend LIBOBJDIR.  When used with automake>=1.10 LIBOBJDIR
+  #    will be set to the directory where LIBOBJS objects are built.
+  as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext"
+  as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo'
+done
+LIBOBJS=$ac_libobjs
+
+LTLIBOBJS=$ac_ltlibobjs
+
+
+
+
+        mv -f po/POTFILES po/POTFILES.tmp
+        sed -e 's/\[.*\] *//' < po/POTFILES.tmp > po/POTFILES
+        rm -f po/POTFILES.tmp
+
+
+
+: "${CONFIG_STATUS=./config.status}"
+ac_write_fail=0
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files $CONFIG_STATUS"
+{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5
+$as_echo "$as_me: creating $CONFIG_STATUS" >&6;}
+as_write_fail=0
+cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1
+#! $SHELL
+# Generated by $as_me.
+# Run this file to recreate the current configuration.
+# Compiler output produced by configure, useful for debugging
+# configure, is in config.log if it exists.
+
+debug=false
+ac_cs_recheck=false
+ac_cs_silent=false
+
+SHELL=\${CONFIG_SHELL-$SHELL}
+export SHELL
+_ASEOF
+cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1
+## -------------------- ##
+## M4sh Initialization. ##
+## -------------------- ##
+
+# Be more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
+  emulate sh
+  NULLCMD=:
+  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '${1+"$@"}'='"$@"'
+  setopt NO_GLOB_SUBST
+else
+  case `(set -o) 2>/dev/null` in #(
+  *posix*) :
+    set -o posix ;; #(
+  *) :
+     ;;
+esac
+fi
+
+
+as_nl='
+'
+export as_nl
+# Printing a long string crashes Solaris 7 /usr/bin/printf.
+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
+# Prefer a ksh shell builtin over an external printf program on Solaris,
+# but without wasting forks for bash or zsh.
+if test -z "$BASH_VERSION$ZSH_VERSION" \
+    && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
+  as_echo='print -r --'
+  as_echo_n='print -rn --'
+elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
+  as_echo='printf %s\n'
+  as_echo_n='printf %s'
+else
+  if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
+    as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
+    as_echo_n='/usr/ucb/echo -n'
+  else
+    as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
+    as_echo_n_body='eval
+      arg=$1;
+      case $arg in #(
+      *"$as_nl"*)
+       expr "X$arg" : "X\\(.*\\)$as_nl";
+       arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
+      esac;
+      expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
+    '
+    export as_echo_n_body
+    as_echo_n='sh -c $as_echo_n_body as_echo'
+  fi
+  export as_echo_body
+  as_echo='sh -c $as_echo_body as_echo'
+fi
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+  PATH_SEPARATOR=:
+  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
+    (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
+      PATH_SEPARATOR=';'
+  }
+fi
+
+
+# IFS
+# We need space, tab and new line, in precisely that order.  Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+IFS=" ""       $as_nl"
+
+# Find who we are.  Look in the path if we contain no directory separator.
+as_myself=
+case $0 in #((
+  *[\\/]* ) as_myself=$0 ;;
+  *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+  done
+IFS=$as_save_IFS
+
+     ;;
+esac
+# We did not find ourselves, most probably we were run as `sh COMMAND'
+# in which case we are not to be found in the path.
+if test "x$as_myself" = x; then
+  as_myself=$0
+fi
+if test ! -f "$as_myself"; then
+  $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+  exit 1
+fi
+
+# Unset variables that we do not need and which cause bugs (e.g. in
+# pre-3.0 UWIN ksh).  But do not cause bugs in bash 2.01; the "|| exit 1"
+# suppresses any "Segmentation fault" message there.  '((' could
+# trigger a bug in pdksh 5.2.14.
+for as_var in BASH_ENV ENV MAIL MAILPATH
+do eval test x\${$as_var+set} = xset \
+  && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
+done
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+LC_ALL=C
+export LC_ALL
+LANGUAGE=C
+export LANGUAGE
+
+# CDPATH.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+
+# as_fn_error STATUS ERROR [LINENO LOG_FD]
+# ----------------------------------------
+# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
+# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
+# script with STATUS, using 1 if that was 0.
+as_fn_error ()
+{
+  as_status=$1; test $as_status -eq 0 && as_status=1
+  if test "$4"; then
+    as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+    $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
+  fi
+  $as_echo "$as_me: error: $2" >&2
+  as_fn_exit $as_status
+} # as_fn_error
+
+
+# as_fn_set_status STATUS
+# -----------------------
+# Set $? to STATUS, without forking.
+as_fn_set_status ()
+{
+  return $1
+} # as_fn_set_status
+
+# as_fn_exit STATUS
+# -----------------
+# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
+as_fn_exit ()
+{
+  set +e
+  as_fn_set_status $1
+  exit $1
+} # as_fn_exit
+
+# as_fn_unset VAR
+# ---------------
+# Portably unset VAR.
+as_fn_unset ()
+{
+  { eval $1=; unset $1;}
+}
+as_unset=as_fn_unset
+# as_fn_append VAR VALUE
+# ----------------------
+# Append the text in VALUE to the end of the definition contained in VAR. Take
+# advantage of any shell optimizations that allow amortized linear growth over
+# repeated appends, instead of the typical quadratic growth present in naive
+# implementations.
+if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
+  eval 'as_fn_append ()
+  {
+    eval $1+=\$2
+  }'
+else
+  as_fn_append ()
+  {
+    eval $1=\$$1\$2
+  }
+fi # as_fn_append
+
+# as_fn_arith ARG...
+# ------------------
+# Perform arithmetic evaluation on the ARGs, and store the result in the
+# global $as_val. Take advantage of shells that can avoid forks. The arguments
+# must be portable across $(()) and expr.
+if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
+  eval 'as_fn_arith ()
+  {
+    as_val=$(( $* ))
+  }'
+else
+  as_fn_arith ()
+  {
+    as_val=`expr "$@" || test $? -eq 1`
+  }
+fi # as_fn_arith
+
+
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; then
+  as_expr=expr
+else
+  as_expr=false
+fi
+
+if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
+  as_basename=basename
+else
+  as_basename=false
+fi
+
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+  as_dirname=dirname
+else
+  as_dirname=false
+fi
+
+as_me=`$as_basename -- "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+        X"$0" : 'X\(//\)$' \| \
+        X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X/"$0" |
+    sed '/^.*\/\([^/][^/]*\)\/*$/{
+           s//\1/
+           q
+         }
+         /^X\/\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\/\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`
+
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in #(((((
+-n*)
+  case `echo 'xy\c'` in
+  *c*) ECHO_T='        ';;     # ECHO_T is single tab character.
+  xy)  ECHO_C='\c';;
+  *)   echo `echo ksh88 bug on AIX 6.1` > /dev/null
+       ECHO_T='        ';;
+  esac;;
+*)
+  ECHO_N='-n';;
+esac
+
+rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+  rm -f conf$$.dir/conf$$.file
+else
+  rm -f conf$$.dir
+  mkdir conf$$.dir 2>/dev/null
+fi
+if (echo >conf$$.file) 2>/dev/null; then
+  if ln -s conf$$.file conf$$ 2>/dev/null; then
+    as_ln_s='ln -s'
+    # ... but there are two gotchas:
+    # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+    # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+    # In both cases, we have to default to `cp -pR'.
+    ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+      as_ln_s='cp -pR'
+  elif ln conf$$.file conf$$ 2>/dev/null; then
+    as_ln_s=ln
+  else
+    as_ln_s='cp -pR'
+  fi
+else
+  as_ln_s='cp -pR'
+fi
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
+
+
+# as_fn_mkdir_p
+# -------------
+# Create "$as_dir" as a directory, including parents if necessary.
+as_fn_mkdir_p ()
+{
+
+  case $as_dir in #(
+  -*) as_dir=./$as_dir;;
+  esac
+  test -d "$as_dir" || eval $as_mkdir_p || {
+    as_dirs=
+    while :; do
+      case $as_dir in #(
+      *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
+      *) as_qdir=$as_dir;;
+      esac
+      as_dirs="'$as_qdir' $as_dirs"
+      as_dir=`$as_dirname -- "$as_dir" ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+        X"$as_dir" : 'X\(//\)[^/]' \| \
+        X"$as_dir" : 'X\(//\)$' \| \
+        X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_dir" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)[^/].*/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`
+      test -d "$as_dir" && break
+    done
+    test -z "$as_dirs" || eval "mkdir $as_dirs"
+  } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
+
+
+} # as_fn_mkdir_p
+if mkdir -p . 2>/dev/null; then
+  as_mkdir_p='mkdir -p "$as_dir"'
+else
+  test -d ./-p && rmdir ./-p
+  as_mkdir_p=false
+fi
+
+
+# as_fn_executable_p FILE
+# -----------------------
+# Test if FILE is an executable regular file.
+as_fn_executable_p ()
+{
+  test -f "$1" && test -x "$1"
+} # as_fn_executable_p
+as_test_x='test -x'
+as_executable_p=as_fn_executable_p
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+
+
+exec 6>&1
+## ----------------------------------- ##
+## Main body of $CONFIG_STATUS script. ##
+## ----------------------------------- ##
+_ASEOF
+test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# Save the log message, to keep $0 and so on meaningful, and to
+# report actual input values of CONFIG_FILES etc. instead of their
+# values after options handling.
+ac_log="
+This file was extended by $as_me, which was
+generated by GNU Autoconf 2.69.  Invocation command line was
+
+  CONFIG_FILES    = $CONFIG_FILES
+  CONFIG_HEADERS  = $CONFIG_HEADERS
+  CONFIG_LINKS    = $CONFIG_LINKS
+  CONFIG_COMMANDS = $CONFIG_COMMANDS
+  $ $0 $@
+
+on `(hostname || uname -n) 2>/dev/null | sed 1q`
+"
+
+_ACEOF
+
+case $ac_config_files in *"
+"*) set x $ac_config_files; shift; ac_config_files=$*;;
+esac
+
+case $ac_config_headers in *"
+"*) set x $ac_config_headers; shift; ac_config_headers=$*;;
+esac
+
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+# Files that config.status was made for.
+config_files="$ac_config_files"
+config_headers="$ac_config_headers"
+config_commands="$ac_config_commands"
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+ac_cs_usage="\
+\`$as_me' instantiates files and other configuration actions
+from templates according to the current configuration.  Unless the files
+and actions are specified as TAGs, all are instantiated by default.
+
+Usage: $0 [OPTION]... [TAG]...
+
+  -h, --help       print this help, then exit
+  -V, --version    print version number and configuration settings, then exit
+      --config     print configuration, then exit
+  -q, --quiet, --silent
+                   do not print progress messages
+  -d, --debug      don't remove temporary files
+      --recheck    update $as_me by reconfiguring in the same conditions
+      --file=FILE[:TEMPLATE]
+                   instantiate the configuration file FILE
+      --header=FILE[:TEMPLATE]
+                   instantiate the configuration header FILE
+
+Configuration files:
+$config_files
+
+Configuration headers:
+$config_headers
+
+Configuration commands:
+$config_commands
+
+Report bugs to the package provider."
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
+ac_cs_version="\\
+config.status
+configured by $0, generated by GNU Autoconf 2.69,
+  with options \\"\$ac_cs_config\\"
+
+Copyright (C) 2012 Free Software Foundation, Inc.
+This config.status script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it."
+
+ac_pwd='$ac_pwd'
+srcdir='$srcdir'
+INSTALL='$INSTALL'
+test -n "\$AWK" || AWK=awk
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# The default lists apply if the user does not specify any file.
+ac_need_defaults=:
+while test $# != 0
+do
+  case $1 in
+  --*=?*)
+    ac_option=`expr "X$1" : 'X\([^=]*\)='`
+    ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'`
+    ac_shift=:
+    ;;
+  --*=)
+    ac_option=`expr "X$1" : 'X\([^=]*\)='`
+    ac_optarg=
+    ac_shift=:
+    ;;
+  *)
+    ac_option=$1
+    ac_optarg=$2
+    ac_shift=shift
+    ;;
+  esac
+
+  case $ac_option in
+  # Handling of the options.
+  -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
+    ac_cs_recheck=: ;;
+  --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
+    $as_echo "$ac_cs_version"; exit ;;
+  --config | --confi | --conf | --con | --co | --c )
+    $as_echo "$ac_cs_config"; exit ;;
+  --debug | --debu | --deb | --de | --d | -d )
+    debug=: ;;
+  --file | --fil | --fi | --f )
+    $ac_shift
+    case $ac_optarg in
+    *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
+    '') as_fn_error $? "missing file argument" ;;
+    esac
+    as_fn_append CONFIG_FILES " '$ac_optarg'"
+    ac_need_defaults=false;;
+  --header | --heade | --head | --hea )
+    $ac_shift
+    case $ac_optarg in
+    *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
+    esac
+    as_fn_append CONFIG_HEADERS " '$ac_optarg'"
+    ac_need_defaults=false;;
+  --he | --h)
+    # Conflict between --help and --header
+    as_fn_error $? "ambiguous option: \`$1'
+Try \`$0 --help' for more information.";;
+  --help | --hel | -h )
+    $as_echo "$ac_cs_usage"; exit ;;
+  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+  | -silent | --silent | --silen | --sile | --sil | --si | --s)
+    ac_cs_silent=: ;;
+
+  # This is an error.
+  -*) as_fn_error $? "unrecognized option: \`$1'
+Try \`$0 --help' for more information." ;;
+
+  *) as_fn_append ac_config_targets " $1"
+     ac_need_defaults=false ;;
+
+  esac
+  shift
+done
+
+ac_configure_extra_args=
+
+if $ac_cs_silent; then
+  exec 6>/dev/null
+  ac_configure_extra_args="$ac_configure_extra_args --silent"
+fi
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+if \$ac_cs_recheck; then
+  set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
+  shift
+  \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6
+  CONFIG_SHELL='$SHELL'
+  export CONFIG_SHELL
+  exec "\$@"
+fi
+
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+exec 5>>config.log
+{
+  echo
+  sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
+## Running $as_me. ##
+_ASBOX
+  $as_echo "$ac_log"
+} >&5
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+#
+# INIT-COMMANDS
+#
+INTLTOOL_PERL=${INTLTOOL_PERL}
+
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+
+# Handling of arguments.
+for ac_config_target in $ac_config_targets
+do
+  case $ac_config_target in
+    "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;;
+    "default-1") CONFIG_COMMANDS="$CONFIG_COMMANDS default-1" ;;
+    "default-2") CONFIG_COMMANDS="$CONFIG_COMMANDS default-2" ;;
+    "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" ;;
+    "driver/XScreenSaver.ad") CONFIG_FILES="$CONFIG_FILES driver/XScreenSaver.ad" ;;
+
+  *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
+  esac
+done
+
+
+# If the user did not use the arguments to specify the items to instantiate,
+# then the envvar interface is used.  Set only those that are not.
+# We use the long form for the default assignment because of an extremely
+# bizarre bug on SunOS 4.1.3.
+if $ac_need_defaults; then
+  test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
+  test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
+  test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
+fi
+
+# Have a temporary directory for convenience.  Make it in the build tree
+# simply because there is no reason against having it here, and in addition,
+# creating and moving files from /tmp can sometimes cause problems.
+# Hook for its removal unless debugging.
+# Note that there is a small window in which the directory will not be cleaned:
+# after its creation but before its name has been assigned to `$tmp'.
+$debug ||
+{
+  tmp= ac_tmp=
+  trap 'exit_status=$?
+  : "${ac_tmp:=$tmp}"
+  { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status
+' 0
+  trap 'as_fn_exit 1' 1 2 13 15
+}
+# Create a (secure) tmp directory for tmp files.
+
+{
+  tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
+  test -d "$tmp"
+}  ||
+{
+  tmp=./conf$$-$RANDOM
+  (umask 077 && mkdir "$tmp")
+} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5
+ac_tmp=$tmp
+
+# Set up the scripts for CONFIG_FILES section.
+# No need to generate them if there are no CONFIG_FILES.
+# This happens for instance with `./config.status config.h'.
+if test -n "$CONFIG_FILES"; then
+
+
+ac_cr=`echo X | tr X '\015'`
+# On cygwin, bash can eat \r inside `` if the user requested igncr.
+# But we know of no other shell where ac_cr would be empty at this
+# point, so we can use a bashism as a fallback.
+if test "x$ac_cr" = x; then
+  eval ac_cr=\$\'\\r\'
+fi
+ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null`
+if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then
+  ac_cs_awk_cr='\\r'
+else
+  ac_cs_awk_cr=$ac_cr
+fi
+
+echo 'BEGIN {' >"$ac_tmp/subs1.awk" &&
+_ACEOF
+
+
+{
+  echo "cat >conf$$subs.awk <<_ACEOF" &&
+  echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' &&
+  echo "_ACEOF"
+} >conf$$subs.sh ||
+  as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
+ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'`
+ac_delim='%!_!# '
+for ac_last_try in false false false false false :; do
+  . ./conf$$subs.sh ||
+    as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
+
+  ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X`
+  if test $ac_delim_n = $ac_delim_num; then
+    break
+  elif $ac_last_try; then
+    as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
   else
   else
-    echo "not updating unwritable cache $cache_file"
+    ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
   fi
   fi
-fi
-rm -f confcache
-
-trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
+done
+rm -f conf$$subs.sh
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK &&
+_ACEOF
+sed -n '
+h
+s/^/S["/; s/!.*/"]=/
+p
+g
+s/^[^!]*!//
+:repl
+t repl
+s/'"$ac_delim"'$//
+t delim
+:nl
+h
+s/\(.\{148\}\)..*/\1/
+t more1
+s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/
+p
+n
+b repl
+:more1
+s/["\\]/\\&/g; s/^/"/; s/$/"\\/
+p
+g
+s/.\{148\}//
+t nl
+:delim
+h
+s/\(.\{148\}\)..*/\1/
+t more2
+s/["\\]/\\&/g; s/^/"/; s/$/"/
+p
+b
+:more2
+s/["\\]/\\&/g; s/^/"/; s/$/"\\/
+p
+g
+s/.\{148\}//
+t delim
+' <conf$$subs.awk | sed '
+/^[^""]/{
+  N
+  s/\n//
+}
+' >>$CONFIG_STATUS || ac_write_fail=1
+rm -f conf$$subs.awk
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+_ACAWK
+cat >>"\$ac_tmp/subs1.awk" <<_ACAWK &&
+  for (key in S) S_is_set[key] = 1
+  FS = "\a"
 
 
-test "x$prefix" = xNONE && prefix=$ac_default_prefix
-# Let make expand exec_prefix.
-test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
+}
+{
+  line = $ 0
+  nfields = split(line, field, "@")
+  substed = 0
+  len = length(field[1])
+  for (i = 2; i < nfields; i++) {
+    key = field[i]
+    keylen = length(key)
+    if (S_is_set[key]) {
+      value = S[key]
+      line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3)
+      len += length(value) + length(field[++i])
+      substed = 1
+    } else
+      len += 1 + keylen
+  }
+
+  print line
+}
 
 
-# Any assignment to VPATH causes Sun make to only execute
-# the first set of double-colon rules, so remove it if not needed.
-# If there is a colon in the path, we need to keep it.
+_ACAWK
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then
+  sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"
+else
+  cat
+fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \
+  || as_fn_error $? "could not setup config files machinery" "$LINENO" 5
+_ACEOF
+
+# VPATH may cause trouble with some makes, so we remove sole $(srcdir),
+# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and
+# trailing colons and then remove the whole line if VPATH becomes empty
+# (actually we leave an empty line to preserve line numbers).
 if test "x$srcdir" = x.; then
 if test "x$srcdir" = x.; then
-  ac_vpsub='/^[        ]*VPATH[        ]*=[^:]*$/d'
-fi
-
-trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
-
-DEFS=-DHAVE_CONFIG_H
+  ac_vpsub='/^[         ]*VPATH[        ]*=[    ]*/{
+h
+s///
+s/^/:/
+s/[     ]*$/:/
+s/:\$(srcdir):/:/g
+s/:\${srcdir}:/:/g
+s/:@srcdir@:/:/g
+s/^:*//
+s/:*$//
+x
+s/\(=[  ]*\).*/\1/
+G
+s/\n//
+s/^[^=]*=[      ]*$//
+}'
+fi
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+fi # test -n "$CONFIG_FILES"
+
+# Set up the scripts for CONFIG_HEADERS section.
+# No need to generate them if there are no CONFIG_HEADERS.
+# This happens for instance with `./config.status Makefile'.
+if test -n "$CONFIG_HEADERS"; then
+cat >"$ac_tmp/defines.awk" <<\_ACAWK ||
+BEGIN {
+_ACEOF
+
+# Transform confdefs.h into an awk script `defines.awk', embedded as
+# here-document in config.status, that substitutes the proper values into
+# config.h.in to produce config.h.
+
+# Create a delimiter string that does not exist in confdefs.h, to ease
+# handling of long lines.
+ac_delim='%!_!# '
+for ac_last_try in false false :; do
+  ac_tt=`sed -n "/$ac_delim/p" confdefs.h`
+  if test -z "$ac_tt"; then
+    break
+  elif $ac_last_try; then
+    as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5
+  else
+    ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
+  fi
+done
 
 
-# Without the "./", some shells look in PATH for config.status.
-: ${CONFIG_STATUS=./config.status}
+# For the awk script, D is an array of macro values keyed by name,
+# likewise P contains macro parameters if any.  Preserve backslash
+# newline sequences.
+
+ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]*
+sed -n '
+s/.\{148\}/&'"$ac_delim"'/g
+t rset
+:rset
+s/^[    ]*#[    ]*define[       ][      ]*/ /
+t def
+d
+:def
+s/\\$//
+t bsnl
+s/["\\]/\\&/g
+s/^ \('"$ac_word_re"'\)\(([^()]*)\)[    ]*\(.*\)/P["\1"]="\2"\
+D["\1"]=" \3"/p
+s/^ \('"$ac_word_re"'\)[        ]*\(.*\)/D["\1"]=" \2"/p
+d
+:bsnl
+s/["\\]/\\&/g
+s/^ \('"$ac_word_re"'\)\(([^()]*)\)[    ]*\(.*\)/P["\1"]="\2"\
+D["\1"]=" \3\\\\\\n"\\/p
+t cont
+s/^ \('"$ac_word_re"'\)[        ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p
+t cont
+d
+:cont
+n
+s/.\{148\}/&'"$ac_delim"'/g
+t clear
+:clear
+s/\\$//
+t bsnlc
+s/["\\]/\\&/g; s/^/"/; s/$/"/p
+d
+:bsnlc
+s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p
+b cont
+' <confdefs.h | sed '
+s/'"$ac_delim"'/"\\\
+"/g' >>$CONFIG_STATUS || ac_write_fail=1
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+  for (key in D) D_is_set[key] = 1
+  FS = "\a"
+}
+/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ {
+  line = \$ 0
+  split(line, arg, " ")
+  if (arg[1] == "#") {
+    defundef = arg[2]
+    mac1 = arg[3]
+  } else {
+    defundef = substr(arg[1], 2)
+    mac1 = arg[2]
+  }
+  split(mac1, mac2, "(") #)
+  macro = mac2[1]
+  prefix = substr(line, 1, index(line, defundef) - 1)
+  if (D_is_set[macro]) {
+    # Preserve the white space surrounding the "#".
+    print prefix "define", macro P[macro] D[macro]
+    next
+  } else {
+    # Replace #undef with comments.  This is necessary, for example,
+    # in the case of _POSIX_SOURCE, which is predefined and required
+    # on some systems where configure will not decide to define it.
+    if (defundef == "undef") {
+      print "/*", prefix defundef, macro, "*/"
+      next
+    }
+  }
+}
+{ print }
+_ACAWK
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+  as_fn_error $? "could not setup config headers machinery" "$LINENO" 5
+fi # test -n "$CONFIG_HEADERS"
 
 
-echo creating $CONFIG_STATUS
-rm -f $CONFIG_STATUS
-cat > $CONFIG_STATUS <<EOF
-#! /bin/sh
-# Generated automatically by configure.
-# Run this file to recreate the current configuration.
-# This directory was configured as follows,
-# on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
-#
-# $0 $ac_configure_args
-#
-# Compiler output produced by configure, useful for debugging
-# configure, is in ./config.log if it exists.
 
 
-ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
-for ac_option
+eval set X "  :F $CONFIG_FILES  :H $CONFIG_HEADERS    :C $CONFIG_COMMANDS"
+shift
+for ac_tag
 do
 do
-  case "\$ac_option" in
-  -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
-    echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
-    exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
-  -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
-    echo "$CONFIG_STATUS generated by autoconf version 2.13"
-    exit 0 ;;
-  -help | --help | --hel | --he | --h)
-    echo "\$ac_cs_usage"; exit 0 ;;
-  *) echo "\$ac_cs_usage"; exit 1 ;;
+  case $ac_tag in
+  :[FHLC]) ac_mode=$ac_tag; continue;;
   esac
   esac
-done
+  case $ac_mode$ac_tag in
+  :[FHL]*:*);;
+  :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;;
+  :[FH]-) ac_tag=-:-;;
+  :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
+  esac
+  ac_save_IFS=$IFS
+  IFS=:
+  set x $ac_tag
+  IFS=$ac_save_IFS
+  shift
+  ac_file=$1
+  shift
 
 
-ac_given_srcdir=$srcdir
-ac_given_INSTALL="$INSTALL"
+  case $ac_mode in
+  :L) ac_source=$1;;
+  :[FH])
+    ac_file_inputs=
+    for ac_f
+    do
+      case $ac_f in
+      -) ac_f="$ac_tmp/stdin";;
+      *) # Look for the file first in the build tree, then in the source tree
+        # (if the path is not absolute).  The absolute path cannot be DOS-style,
+        # because $ac_f cannot contain `:'.
+        test -f "$ac_f" ||
+          case $ac_f in
+          [\\/$]*) false;;
+          *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
+          esac ||
+          as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;;
+      esac
+      case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
+      as_fn_append ac_file_inputs " '$ac_f'"
+    done
 
 
-trap 'rm -fr `echo "Makefile
-          utils/Makefile
-          driver/Makefile
-          hacks/Makefile
-          hacks/glx/Makefile
-          driver/XScreenSaver.ad config.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
-EOF
-cat >> $CONFIG_STATUS <<EOF
+    # Let's still pretend it is `configure' which instantiates (i.e., don't
+    # use $as_me), people would be surprised to read:
+    #    /* config.h.  Generated by config.status.  */
+    configure_input='Generated from '`
+         $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g'
+       `' by configure.'
+    if test x"$ac_file" != x-; then
+      configure_input="$ac_file.  $configure_input"
+      { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5
+$as_echo "$as_me: creating $ac_file" >&6;}
+    fi
+    # Neutralize special characters interpreted by sed in replacement strings.
+    case $configure_input in #(
+    *\&* | *\|* | *\\* )
+       ac_sed_conf_input=`$as_echo "$configure_input" |
+       sed 's/[\\\\&|]/\\\\&/g'`;; #(
+    *) ac_sed_conf_input=$configure_input;;
+    esac
 
 
-# Protect against being on the right side of a sed subst in config.status.
-sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
- s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
-$ac_vpsub
-$extrasub
-s%@SHELL@%$SHELL%g
-s%@CFLAGS@%$CFLAGS%g
-s%@CPPFLAGS@%$CPPFLAGS%g
-s%@CXXFLAGS@%$CXXFLAGS%g
-s%@FFLAGS@%$FFLAGS%g
-s%@DEFS@%$DEFS%g
-s%@LDFLAGS@%$LDFLAGS%g
-s%@LIBS@%$LIBS%g
-s%@exec_prefix@%$exec_prefix%g
-s%@prefix@%$prefix%g
-s%@program_transform_name@%$program_transform_name%g
-s%@bindir@%$bindir%g
-s%@sbindir@%$sbindir%g
-s%@libexecdir@%$libexecdir%g
-s%@datadir@%$datadir%g
-s%@sysconfdir@%$sysconfdir%g
-s%@sharedstatedir@%$sharedstatedir%g
-s%@localstatedir@%$localstatedir%g
-s%@libdir@%$libdir%g
-s%@includedir@%$includedir%g
-s%@oldincludedir@%$oldincludedir%g
-s%@infodir@%$infodir%g
-s%@mandir@%$mandir%g
-s%@host@%$host%g
-s%@host_alias@%$host_alias%g
-s%@host_cpu@%$host_cpu%g
-s%@host_vendor@%$host_vendor%g
-s%@host_os@%$host_os%g
-s%@CC@%$CC%g
-s%@CPP@%$CPP%g
-s%@EXEEXT@%$EXEEXT%g
-s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
-s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
-s%@INSTALL_DATA@%$INSTALL_DATA%g
-s%@SET_MAKE@%$SET_MAKE%g
-s%@PERL@%$PERL%g
-s%@X_CFLAGS@%$X_CFLAGS%g
-s%@X_PRE_LIBS@%$X_PRE_LIBS%g
-s%@X_LIBS@%$X_LIBS%g
-s%@X_EXTRA_LIBS@%$X_EXTRA_LIBS%g
-s%@glib_config@%$glib_config%g
-s%@gtk_config@%$gtk_config%g
-s%@gnome_config@%$gnome_config%g
-s%@have_gnome_help@%$have_gnome_help%g
-s%@xml_config@%$xml_config%g
-s%@gdk_pixbuf_config@%$gdk_pixbuf_config%g
-s%@fortune_tmp@%$fortune_tmp%g
-s%@INCLUDES@%$INCLUDES%g
-s%@PREFERRED_DEMO_PROGRAM@%$PREFERRED_DEMO_PROGRAM%g
-s%@ALL_DEMO_PROGRAMS@%$ALL_DEMO_PROGRAMS%g
-s%@SAVER_LIBS@%$SAVER_LIBS%g
-s%@MOTIF_LIBS@%$MOTIF_LIBS%g
-s%@GTK_LIBS@%$GTK_LIBS%g
-s%@XML_LIBS@%$XML_LIBS%g
-s%@JPEG_LIBS@%$JPEG_LIBS%g
-s%@HACK_LIBS@%$HACK_LIBS%g
-s%@XPM_LIBS@%$XPM_LIBS%g
-s%@GL_LIBS@%$GL_LIBS%g
-s%@GLE_LIBS@%$GLE_LIBS%g
-s%@XDPMS_LIBS@%$XDPMS_LIBS%g
-s%@PASSWD_LIBS@%$PASSWD_LIBS%g
-s%@INSTALL_SETUID@%$INSTALL_SETUID%g
-s%@SETUID_HACKS@%$SETUID_HACKS%g
-s%@INSTALL_DIRS@%$INSTALL_DIRS%g
-s%@NEED_SETUID@%$NEED_SETUID%g
-s%@INSTALL_PAM@%$INSTALL_PAM%g
-s%@PASSWD_SRCS@%$PASSWD_SRCS%g
-s%@PASSWD_OBJS@%$PASSWD_OBJS%g
-s%@XMU_SRCS@%$XMU_SRCS%g
-s%@XMU_OBJS@%$XMU_OBJS%g
-s%@XMU_LIBS@%$XMU_LIBS%g
-s%@SAVER_GL_SRCS@%$SAVER_GL_SRCS%g
-s%@SAVER_GL_OBJS@%$SAVER_GL_OBJS%g
-s%@SAVER_GL_LIBS@%$SAVER_GL_LIBS%g
-s%@LOCK_SRCS@%$LOCK_SRCS%g
-s%@LOCK_OBJS@%$LOCK_OBJS%g
-s%@JPEG_EXES@%$JPEG_EXES%g
-s%@GL_EXES@%$GL_EXES%g
-s%@GL_UTIL_EXES@%$GL_UTIL_EXES%g
-s%@GL_MEN@%$GL_MEN%g
-s%@GL_KLUDGE@%$GL_KLUDGE%g
-s%@GLE_EXES@%$GLE_EXES%g
-s%@GLE_MEN@%$GLE_MEN%g
-s%@GLE_KLUDGE@%$GLE_KLUDGE%g
-s%@GNOMEHELP_Y@%$GNOMEHELP_Y%g
-s%@GNOMEHELP_N@%$GNOMEHELP_N%g
-s%@HACKDIR@%$HACKDIR%g
-s%@GNOME_DATADIR@%$GNOME_DATADIR%g
-s%@GTK_ICONDIR@%$GTK_ICONDIR%g
-s%@HACK_CONF_DIR@%$HACK_CONF_DIR%g
-s%@APPDEFAULTS@%$APPDEFAULTS%g
-s%@DEPEND@%$DEPEND%g
-s%@DEPEND_FLAGS@%$DEPEND_FLAGS%g
-s%@DEPEND_DEFINES@%$DEPEND_DEFINES%g
-
-CEOF
-EOF
+    case $ac_tag in
+    *:-:* | *:-) cat >"$ac_tmp/stdin" \
+      || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;;
+    esac
+    ;;
+  esac
 
 
-cat >> $CONFIG_STATUS <<\EOF
-
-# Split the substitutions into bite-sized pieces for seds with
-# small command number limits, like on Digital OSF/1 and HP-UX.
-ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
-ac_file=1 # Number of current file.
-ac_beg=1 # First line for current file.
-ac_end=$ac_max_sed_cmds # Line after last line for current file.
-ac_more_lines=:
-ac_sed_cmds=""
-while $ac_more_lines; do
-  if test $ac_beg -gt 1; then
-    sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
-  else
-    sed "${ac_end}q" conftest.subs > conftest.s$ac_file
-  fi
-  if test ! -s conftest.s$ac_file; then
-    ac_more_lines=false
-    rm -f conftest.s$ac_file
-  else
-    if test -z "$ac_sed_cmds"; then
-      ac_sed_cmds="sed -f conftest.s$ac_file"
-    else
-      ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
-    fi
-    ac_file=`expr $ac_file + 1`
-    ac_beg=$ac_end
-    ac_end=`expr $ac_end + $ac_max_sed_cmds`
-  fi
-done
-if test -z "$ac_sed_cmds"; then
-  ac_sed_cmds=cat
-fi
-EOF
+  ac_dir=`$as_dirname -- "$ac_file" ||
+$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+        X"$ac_file" : 'X\(//\)[^/]' \| \
+        X"$ac_file" : 'X\(//\)$' \| \
+        X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$ac_file" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)[^/].*/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`
+  as_dir="$ac_dir"; as_fn_mkdir_p
+  ac_builddir=.
+
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+  ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
+  # A ".." for each directory in $ac_dir_suffix.
+  ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
+  case $ac_top_builddir_sub in
+  "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+  *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+  esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
+
+case $srcdir in
+  .)  # We are building in place.
+    ac_srcdir=.
+    ac_top_srcdir=$ac_top_builddir_sub
+    ac_abs_top_srcdir=$ac_pwd ;;
+  [\\/]* | ?:[\\/]* )  # Absolute name.
+    ac_srcdir=$srcdir$ac_dir_suffix;
+    ac_top_srcdir=$srcdir
+    ac_abs_top_srcdir=$srcdir ;;
+  *) # Relative name.
+    ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+    ac_top_srcdir=$ac_top_build_prefix$srcdir
+    ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
+esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
 
 
-cat >> $CONFIG_STATUS <<EOF
 
 
-CONFIG_FILES=\${CONFIG_FILES-"Makefile
-          utils/Makefile
-          driver/Makefile
-          hacks/Makefile
-          hacks/glx/Makefile
-          driver/XScreenSaver.ad"}
-EOF
-cat >> $CONFIG_STATUS <<\EOF
-for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
-  # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
-  case "$ac_file" in
-  *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
-       ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
-  *) ac_file_in="${ac_file}.in" ;;
-  esac
+  case $ac_mode in
+  :F)
+  #
+  # CONFIG_FILE
+  #
 
 
-  # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
+  case $INSTALL in
+  [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
+  *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;;
+  esac
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# If the template does not know about datarootdir, expand it.
+# FIXME: This hack should be removed a few years after 2.60.
+ac_datarootdir_hack=; ac_datarootdir_seen=
+ac_sed_dataroot='
+/datarootdir/ {
+  p
+  q
+}
+/@datadir@/p
+/@docdir@/p
+/@infodir@/p
+/@localedir@/p
+/@mandir@/p'
+case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in
+*datarootdir*) ac_datarootdir_seen=yes;;
+*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
+$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+  ac_datarootdir_hack='
+  s&@datadir@&$datadir&g
+  s&@docdir@&$docdir&g
+  s&@infodir@&$infodir&g
+  s&@localedir@&$localedir&g
+  s&@mandir@&$mandir&g
+  s&\\\${datarootdir}&$datarootdir&g' ;;
+esac
+_ACEOF
 
 
-  # Remove last slash and all that follows it.  Not all systems have dirname.
-  ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
-  if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
-    # The file is in a subdirectory.
-    test ! -d "$ac_dir" && mkdir "$ac_dir"
-    ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
-    # A "../" for each directory in $ac_dir_suffix.
-    ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
+# Neutralize VPATH when `$srcdir' = `.'.
+# Shell code in configure.ac might set extrasub.
+# FIXME: do we really want to maintain this feature?
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ac_sed_extra="$ac_vpsub
+$extrasub
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+:t
+/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
+s|@configure_input@|$ac_sed_conf_input|;t t
+s&@top_builddir@&$ac_top_builddir_sub&;t t
+s&@top_build_prefix@&$ac_top_build_prefix&;t t
+s&@srcdir@&$ac_srcdir&;t t
+s&@abs_srcdir@&$ac_abs_srcdir&;t t
+s&@top_srcdir@&$ac_top_srcdir&;t t
+s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t
+s&@builddir@&$ac_builddir&;t t
+s&@abs_builddir@&$ac_abs_builddir&;t t
+s&@abs_top_builddir@&$ac_abs_top_builddir&;t t
+s&@INSTALL@&$ac_INSTALL&;t t
+$ac_datarootdir_hack
+"
+eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \
+  >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+
+test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
+  { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } &&
+  { ac_out=`sed -n '/^[         ]*datarootdir[  ]*:*=/p' \
+      "$ac_tmp/out"`; test -z "$ac_out"; } &&
+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined.  Please make sure it is defined" >&5
+$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined.  Please make sure it is defined" >&2;}
+
+  rm -f "$ac_tmp/stdin"
+  case $ac_file in
+  -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";;
+  *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";;
+  esac \
+  || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+ ;;
+  :H)
+  #
+  # CONFIG_HEADER
+  #
+  if test x"$ac_file" != x-; then
+    {
+      $as_echo "/* $configure_input  */" \
+      && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs"
+    } >"$ac_tmp/config.h" \
+      || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+    if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then
+      { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5
+$as_echo "$as_me: $ac_file is unchanged" >&6;}
+    else
+      rm -f "$ac_file"
+      mv "$ac_tmp/config.h" "$ac_file" \
+       || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+    fi
   else
   else
-    ac_dir_suffix= ac_dots=
+    $as_echo "/* $configure_input  */" \
+      && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \
+      || as_fn_error $? "could not create -" "$LINENO" 5
   fi
   fi
+ ;;
 
 
-  case "$ac_given_srcdir" in
-  .)  srcdir=.
-      if test -z "$ac_dots"; then top_srcdir=.
-      else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
-  /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
-  *) # Relative path.
-    srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
-    top_srcdir="$ac_dots$ac_given_srcdir" ;;
+  :C)  { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5
+$as_echo "$as_me: executing $ac_file commands" >&6;}
+ ;;
   esac
 
   esac
 
-  case "$ac_given_INSTALL" in
-  [/$]*) INSTALL="$ac_given_INSTALL" ;;
-  *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
-  esac
 
 
-  echo creating "$ac_file"
-  rm -f "$ac_file"
-  configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
-  case "$ac_file" in
-  *Makefile*) ac_comsub="1i\\
-# $configure_input" ;;
-  *) ac_comsub= ;;
-  esac
+  case $ac_file$ac_mode in
+    "default-1":C)
 
 
-  ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
-  sed -e "$ac_comsub
-s%@configure_input@%$configure_input%g
-s%@srcdir@%$srcdir%g
-s%@top_srcdir@%$top_srcdir%g
-s%@INSTALL@%$INSTALL%g
-" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
-fi; done
-rm -f conftest.s*
-
-# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
-# NAME is the cpp macro being defined and VALUE is the value it is being given.
-#
-# ac_d sets the value in "#define NAME VALUE" lines.
-ac_dA='s%^\([  ]*\)#\([        ]*define[       ][      ]*\)'
-ac_dB='\([     ][      ]*\)[^  ]*%\1#\2'
-ac_dC='\3'
-ac_dD='%g'
-# ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
-ac_uA='s%^\([  ]*\)#\([        ]*\)undef\([    ][      ]*\)'
-ac_uB='\([     ]\)%\1#\2define\3'
-ac_uC=' '
-ac_uD='\4%g'
-# ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
-ac_eA='s%^\([  ]*\)#\([        ]*\)undef\([    ][      ]*\)'
-ac_eB='$%\1#\2define\3'
-ac_eC=' '
-ac_eD='%g'
-
-if test "${CONFIG_HEADERS+set}" != set; then
-EOF
-cat >> $CONFIG_STATUS <<EOF
-  CONFIG_HEADERS="config.h"
-EOF
-cat >> $CONFIG_STATUS <<\EOF
-fi
-for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
-  # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
-  case "$ac_file" in
-  *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
-       ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
-  *) ac_file_in="${ac_file}.in" ;;
-  esac
+sed -e "s:@INTLTOOL_PERL@:${INTLTOOL_PERL}:;" < ${srcdir}/intltool-extract.in > intltool-extract.out
+if cmp -s intltool-extract intltool-extract.out 2>/dev/null; then
+  rm -f intltool-extract.out
+else
+  mv -f intltool-extract.out intltool-extract
+fi
+chmod ugo+x intltool-extract
+chmod u+w intltool-extract
 
 
-  echo creating $ac_file
+sed -e "s:@INTLTOOL_PERL@:${INTLTOOL_PERL}:;" < ${srcdir}/intltool-merge.in > intltool-merge.out
+if cmp -s intltool-merge intltool-merge.out 2>/dev/null; then
+  rm -f intltool-merge.out
+else
+  mv -f intltool-merge.out intltool-merge
+fi
+chmod ugo+x intltool-merge
+chmod u+w intltool-merge
 
 
-  rm -f conftest.frag conftest.in conftest.out
-  ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
-  cat $ac_file_inputs > conftest.in
+sed -e "s:@INTLTOOL_PERL@:${INTLTOOL_PERL}:;" < ${srcdir}/intltool-update.in > intltool-update.out
+if cmp -s intltool-update intltool-update.out 2>/dev/null; then
+  rm -f intltool-update.out
+else
+  mv -f intltool-update.out intltool-update
+fi
+chmod ugo+x intltool-update
+chmod u+w intltool-update
 
 
-EOF
+ ;;
+    "default-2":C) case "$CONFIG_FILES" in *po/Makefile.in*)
+        rm -f po/stamp-it po/stamp-it.tmp
+        > po/stamp-it.tmp
+        sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile
+        mv po/stamp-it.tmp po/stamp-it
+      esac ;;
 
 
-# Transform confdefs.h into a sed script conftest.vals that substitutes
-# the proper values into config.h.in to produce config.h.  And first:
-# Protect against being on the right side of a sed subst in config.status.
-# Protect against being in an unquoted here document in config.status.
-rm -f conftest.vals
-cat > conftest.hdr <<\EOF
-s/[\\&%]/\\&/g
-s%[\\$`]%\\&%g
-s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
-s%ac_d%ac_u%gp
-s%ac_u%ac_e%gp
-EOF
-sed -n -f conftest.hdr confdefs.h > conftest.vals
-rm -f conftest.hdr
-
-# This sed command replaces #undef with comments.  This is necessary, for
-# example, in the case of _POSIX_SOURCE, which is predefined and required
-# on some systems where configure will not decide to define it.
-cat >> conftest.vals <<\EOF
-s%^[   ]*#[    ]*undef[        ][      ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
-EOF
+  esac
+done # for ac_tag
 
 
-# Break up conftest.vals because some shells have a limit on
-# the size of here documents, and old seds have small limits too.
 
 
-rm -f conftest.tail
-while :
-do
-  ac_lines=`grep -c . conftest.vals`
-  # grep -c gives empty output for an empty file on some AIX systems.
-  if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
-  # Write a limited-size here document to conftest.frag.
-  echo '  cat > conftest.frag <<CEOF' >> $CONFIG_STATUS
-  sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
-  echo 'CEOF
-  sed -f conftest.frag conftest.in > conftest.out
-  rm -f conftest.in
-  mv conftest.out conftest.in
-' >> $CONFIG_STATUS
-  sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
-  rm -f conftest.vals
-  mv conftest.tail conftest.vals
-done
-rm -f conftest.vals
-
-cat >> $CONFIG_STATUS <<\EOF
-  rm -f conftest.frag conftest.h
-  echo "/* $ac_file.  Generated automatically by configure.  */" > conftest.h
-  cat conftest.in >> conftest.h
-  rm -f conftest.in
-  if cmp -s $ac_file conftest.h 2>/dev/null; then
-    echo "$ac_file is unchanged"
-    rm -f conftest.h
-  else
-    # Remove last slash and all that follows it.  Not all systems have dirname.
-      ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
-      if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
-      # The file is in a subdirectory.
-      test ! -d "$ac_dir" && mkdir "$ac_dir"
-    fi
-    rm -f $ac_file
-    mv conftest.h $ac_file
-  fi
-fi; done
+as_fn_exit 0
+_ACEOF
+ac_clean_files=$ac_clean_files_save
 
 
-EOF
-cat >> $CONFIG_STATUS <<EOF
+test $ac_write_fail = 0 ||
+  as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5
 
 
-EOF
-cat >> $CONFIG_STATUS <<\EOF
 
 
-exit 0
-EOF
-chmod +x $CONFIG_STATUS
-rm -fr confdefs* $ac_clean_files
-test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
+# configure is writing to config.log, and then calls config.status.
+# config.status does its own redirection, appending to config.log.
+# Unfortunately, on DOS this fails, as config.log is still kept open
+# by configure, so config.status won't be able to write to it; its
+# output is simply discarded.  So we exec the FD to /dev/null,
+# effectively closing config.log, so it can be properly (re)opened and
+# appended to by config.status.  When coming back to configure, we
+# need to make the FD available again.
+if test "$no_create" != yes; then
+  ac_cs_success=:
+  ac_config_status_args=
+  test "$silent" = yes &&
+    ac_config_status_args="$ac_config_status_args --quiet"
+  exec 5>/dev/null
+  $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
+  exec 5>>config.log
+  # Use ||, not &&, to avoid exiting from the if with $? = 1, which
+  # would make configure fail if this is the last instruction.
+  $ac_cs_success || as_fn_exit 1
+fi
+if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5
+$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
+fi
 
 
 ###############################################################################
 
 
 ###############################################################################
@@ -11310,10 +16104,6 @@ if test "$with_sgi_req" = yes -a "$have_sgi" = no ; then
   warn 'The SGI saver extension was requested, but was not found.'
 fi
 
   warn 'The SGI saver extension was requested, but was not found.'
 fi
 
-if test "$with_mit_req" = yes -a "$have_mit" = no ; then
-  warn 'The MIT saver extension was requested, but was not found.'
-fi
-
 if test "$with_xidle_req" = yes -a "$have_xidle" = no ; then
   warn 'The XIdle extension was requested, but was not found.'
 fi
 if test "$with_xidle_req" = yes -a "$have_xidle" = no ; then
   warn 'The XIdle extension was requested, but was not found.'
 fi
@@ -11342,14 +16132,64 @@ if test "$with_xf86vmode_req" = yes -a "$have_xf86vmode" = no ; then
   warn 'The XF86VMODE extension was requested, but was not found.'
 fi
 
   warn 'The XF86VMODE extension was requested, but was not found.'
 fi
 
+if test "$with_randr_req" = yes -a "$have_randr" = no ; then
+  warn 'The RANDR extension was requested, but was not found.'
+fi
+
 if test "$with_proc_interrupts_req" = yes -a "$have_proc_interrupts" = no; then
   warn "Checking of /proc/interrupts was requested, but it's bogus."
 fi
 
 if test "$with_proc_interrupts_req" = yes -a "$have_proc_interrupts" = no; then
   warn "Checking of /proc/interrupts was requested, but it's bogus."
 fi
 
+if test "$pkg_config" = false ; then
+  warnL 'The "pkg-config" program was not found.  Without that,'
+  warn2 "detection of the various GTK libraries won't work."
+else
+  pkgerr=`$pkg_config --list-all 2>&1 >/dev/null`
+  if test "x$pkgerr" != "x" ; then
+    warnL 'The "pkg-config" program produces errors.  This often causes'
+    warn2 "detection of the various GTK libraries to malfunction."
+    warn2 "The errors are:"
+    echo ''
+    echo "$pkgerr" | sed 's/^/             > /g'
+  fi
+fi
+
+if test "$gtk_halfassed" != no ; then
+  warnL "GTK version $gtk_halfassed was found, but at least one supporting"
+  warn2 "library ($gtk_halfassed_lib) was not, so GTK can't be used."
+  warn2 "Perhaps some of the development packages are not installed?"
+  if test "$have_gtk" = yes ; then
+    v="$ac_gtk_version_string"
+    warn2 "GTK $v is also installed, so it will be used instead."
+    warn2 "Please read the above output and the \`config.log' file"
+    warn2 "for more details."
+  fi
+fi
+
+motif_warn2() {
+  warn2 'Though the Motif front-end to xscreensaver is still'
+  warn2 'maintained, it is no longer being updated with new'
+  warn2 'features: all new development on the xscreensaver-demo'
+  warn2 'program is happening in the GTK version, and not in the'
+  warn2 'Motif version.  It is recommended that you build against'
+  warn2 'GTK instead of Motif.  See <http://www.gtk.org/>.'
+}
 
 if test "$have_motif" = no -a "$have_gtk" = no; then
 
 if test "$have_motif" = no -a "$have_gtk" = no; then
-  warnL "Neither Motif nor Gtk seem to be available;"
-  warn2 "the \`xscreensaver-demo' program requires one of these."
+
+  if test "$with_motif" = yes; then
+    warnL "Neither the GTK nor Motif libraries were found; the"
+    warn2 "\`xscreensaver-demo' program requires one of these."
+    echo ''
+    motif_warn2
+  else
+    warnL "The GTK libraries do not seem to be available; the"
+    warn2 "\`xscreensaver-demo' program requires them."
+#   echo ''
+#   warn2 'You can use Motif or Lesstif instead of GTK (use the'
+#   warn2 "\`--with-motif' option) but that is NOT recommended."
+#   motif_warn2
+  fi
 
 elif test "$with_motif_req" = yes -a "$have_motif" = no ; then
   warnL "Use of Motif was requested, but it wasn't found;"
 
 elif test "$with_motif_req" = yes -a "$have_motif" = no ; then
   warnL "Use of Motif was requested, but it wasn't found;"
@@ -11357,7 +16197,7 @@ elif test "$with_motif_req" = yes -a "$have_motif" = no ; then
 
 elif test "$jurassic_gtk" = yes ; then
 
 
 elif test "$jurassic_gtk" = yes ; then
 
-  pref_gtk=1.2
+  pref_gtk=2.0
 
   v="$ac_gtk_version_string"
   if test "$with_gtk_req" = yes -a "$ac_gtk_version" = "unknown" ; then
 
   v="$ac_gtk_version_string"
   if test "$with_gtk_req" = yes -a "$ac_gtk_version" = "unknown" ; then
@@ -11368,42 +16208,17 @@ elif test "$jurassic_gtk" = yes ; then
     warnL "Gtk was found on this system, but it is version $v;"
   fi
 
     warnL "Gtk was found on this system, but it is version $v;"
   fi
 
-  warn2 "Gtk $pref_gtk or newer is required.  Motif will be used instead."
+  warn2 "Gtk $pref_gtk or newer is required."
 
 elif test "$with_gtk_req" = yes -a "$have_gtk" = no ; then
 
 elif test "$with_gtk_req" = yes -a "$have_gtk" = no ; then
-  warnL "Use of Gtk was requested, but it wasn't found;"
-  warn2 "Motif will be used instead."
-
-fi
-
-
-if test "$with_gnome_req" = yes -a "$have_gnome" = no ; then
-  warn  'Use of the Gnome Control Panel was requested, but the necessary'
-  warn2 'headers and/or libraries were not found.'
+  warnL "Use of Gtk was requested, but it wasn't found."
 fi
 
 fi
 
-if test "$have_gtk" = yes ; then
-  if test "$have_xml" = no ; then
-    if test "$with_xml_req" = yes ; then
-      warn  'Use of the XML library was requested, but the necessary'
-      warn2 'headers and/or libraries were not found.'
-    else
-      warn  'GTK is being used, but the XML library was not found.'
-    fi
-
-    if test "$xml_halfassed" = yes ; then
-      echo ''
-      warn2 'More specifically, we found the headers, but not the'
-      warn2 'libraries; so either XML is half-installed on this'
-      warn2 "system, or something else went wrong.  The \`config.log'"
-      warn2 'file might contain some clues.'
-    fi
 
 
-    echo ''
-    warn2 "Without XML, the per-display-mode \`Settings' dialogs"
-    warn2 'will not be available.  Specify the location of the XML'
-    warn2 'library through the --with-xml option to configure.'
-  fi
+if test "$have_gtk" = yes -a "$have_gdk_pixbuf" = no ; then
+  warn  "GTK is being used, but the GDK-Pixbuf library and/or"
+  warn2 "headers were not found.  That can't be good.  Please"
+  warn2 "install the GDK-Pixbuf development kit and re-configure."
 fi
 
 if test "$have_motif" = yes -a "$have_lesstif" = yes ; then
 fi
 
 if test "$have_motif" = yes -a "$have_lesstif" = yes ; then
 if test "$have_motif" = yes -a "$have_gtk" = no ; then
   warn  'Motif is being used, and GTK is not.'
   echo  ''
 if test "$have_motif" = yes -a "$have_gtk" = no ; then
   warn  'Motif is being used, and GTK is not.'
   echo  ''
-  warn2 'Though the Motif front-end to xscreensaver is still'
-  warn2 'maintained, it is no longer being updated with new'
-  warn2 'features: all new development on the xscreensaver-demo'
-  warn2 'program is happening in the GTK version, and not in the'
-  warn2 'Motif version.  It is recommended that you build against'
-  warn2 'GTK instead of Motif.  See <http://www.gtk.org/>.'
+  motif_warn2
 fi
 
 
 fi
 
 
@@ -11445,9 +16255,18 @@ if test "$with_gdk_pixbuf_req" = yes  -a "$have_gdk_pixbuf" = no; then
   warnL 'Use of GDK-Pixbuf was requested, but it was not found.'
 fi
 
   warnL 'Use of GDK-Pixbuf was requested, but it was not found.'
 fi
 
-if test "$have_xpm" = no -a "$have_gdk_pixbuf" = no; then
+if test "$have_gdk_pixbuf" = no -o "$gdk_pixbuf_halfassed" = yes || \
+   test "$have_gdk_pixbuf" = no -a "$have_xpm" = no ; then
+
+  if test "$with_gdk_pixbuf_req" = yes ; then
+    true
+  elif test "$with_gdk_pixbuf_req" = no ; then
+    warnL 'The GDK-Pixbuf library is not being used.'
+  else
+    warnL 'The GDK-Pixbuf library was not found.'
+  fi
 
 
-  if test "$with_xpm_req" = yes ; then
+  if test "$with_xpm_req" = yes -o "$have_xpm" = yes ; then
     true
   elif test "$with_xpm_req" = no ; then
     warnL 'The XPM library is not being used.'
     true
   elif test "$with_xpm_req" = no ; then
     warnL 'The XPM library is not being used.'
@@ -11455,12 +16274,8 @@ if test "$have_xpm" = no -a "$have_gdk_pixbuf" = no; then
     warnL 'The XPM library was not found.'
   fi
 
     warnL 'The XPM library was not found.'
   fi
 
-  if test "$with_gdk_pixbuf_req" = yes ; then
-    true
-  elif test "$with_gdk_pixbuf_req" = no ; then
-    warnL 'The GDK-Pixbuf library is not being used.'
-  else
-    warnL 'The GDK-Pixbuf library was not found.'
+  if test "$have_gdk_pixbuf" = no -a "$have_xpm" = yes ; then
+    warn2 'The XPM library is being used instead.'
   fi
 
   if test "$gdk_pixbuf_halfassed" = yes ; then
   fi
 
   if test "$gdk_pixbuf_halfassed" = yes ; then
@@ -11472,16 +16287,10 @@ if test "$have_xpm" = no -a "$have_gdk_pixbuf" = no; then
   fi
 
   echo ''
   fi
 
   echo ''
-  warn2 'Some of the demos will not be as colorful as they'
-  warn2 'could be.  You should consider installing Pixbuf or'
-  warn2 'XPM and re-running configure.  (Remember to delete'
-  warn2 'the config.cache file first.)  The Pixbuf library is'
-  warn2 'a part of GNOME.  The XPM library comes with most'
-  warn2 'X11 installations; you can also find it at the X11'
-  warn2 'archive sites, such as <http://sunsite.unc.edu/>.'
-  echo  ''
-  warn2 'GDK-Pixbuf is recommended over XPM, as it provides'
-  warn2 'support for more image formats.'
+  warn2 'Some of the demos will not use images as much as they could.'
+  warn2 'You should consider installing GDK-Pixbuf and re-running'
+  warn2 'configure.  (GDK-Pixbuf is recommended over XPM, as it'
+  warn2 'provides support for more image formats.)'
 fi
 
 
 fi
 
 
@@ -11503,7 +16312,13 @@ if test "$have_jpeg" = no ; then
     echo ''
   fi
 
     echo ''
   fi
 
-  warn2 "This means the \`webcollage' program will be much slower."
+  if test "$have_gdk_pixbuf" = no ; then
+    warn2 "This means that it won't be possible for the image-manipulating"
+    warn2 "display modes to load files from disk; and it also means that"
+    warn2 "the \`webcollage' program will be much slower."
+  else
+    warn2 "This means the \`webcollage' program will be much slower."
+  fi
 fi
 
 
 fi
 
 
@@ -11513,17 +16328,19 @@ if test "$have_gl" = yes -a "$ac_have_mesa_gl" = yes ; then
   pgl="$preferred_mesagl"
 
   if test "$ac_mesagl_version" = unknown; then
   pgl="$preferred_mesagl"
 
   if test "$ac_mesagl_version" = unknown; then
-    warnL "Unable to determine the MesaGL version number!"
-    warn2 "Make sure you are using version $preferred_mesagl or newer."
+    true
+    # warnL "Unable to determine the MesaGL version number!"
+    # warn2 "Make sure you are using version $preferred_mesagl or newer."
 
   elif test \! "$ac_mesagl_version" -gt 2006; then
 
   elif test \! "$ac_mesagl_version" -gt 2006; then
-    warnL "MesaGL version $mgv is being used.  MesaGL 2.6 and earlier"
-    warn2 "have a security bug.  It is strongly recommended that you"
-    warn2 "upgrade to at least version $preferred_mesagl."
+    warnL "MesaGL version number is $mgv --"
+    warn2 "MesaGL 2.6 and earlier have a security bug.  It is strongly"
+    warn2 "recommended that you upgrade to at least version $preferred_mesagl."
 
   elif test \! "$ac_mesagl_version" -gt 3003; then
 
   elif test \! "$ac_mesagl_version" -gt 3003; then
-    warnL "MesaGL version $mgv is being used.  That version has some"
-    warn2 "bugs; it is recommended that you upgrade to $pgl or newer."
+    warnL "MesaGL version number is $mgv --"
+    warn2 "MesaGL 3.3 and earlier have some bugs; it is recommended"
+    warn2 "that you upgrade to $pgl or newer."
   fi
 fi
 
   fi
 fi
 
@@ -11547,8 +16364,7 @@ if test "$have_gl" = no ; then
   echo ''
   warn2 'Those demos which use 3D will not be built or installed.'
   warn2 'You might want to consider installing OpenGL and'
   echo ''
   warn2 'Those demos which use 3D will not be built or installed.'
   warn2 'You might want to consider installing OpenGL and'
-  warn2 're-running configure.  (Remember to delete the'
-  warn2 "config.cache file first.)  If your vendor doesn't ship"
+  warn2 "re-running configure.  If your vendor doesn't ship"
   warn2 'their own implementation of OpenGL, you can get a free'
   warn2 'version at <http://www.mesa3d.org/>.  For general OpenGL'
   warn2 'info, see <http://www.opengl.org/>.'
   warn2 'their own implementation of OpenGL, you can get a free'
   warn2 'version at <http://www.mesa3d.org/>.  For general OpenGL'
   warn2 'info, see <http://www.opengl.org/>.'
 
 
 if test "$have_gl" = yes -a "$have_gle" = no ; then
 
 
 if test "$have_gl" = yes -a "$have_gle" = no ; then
+
+ # nobody cares about this; don't print the warning unless it was
+ # requested and not found, or halfway-found.
+ if test "$with_gle_req" = yes -o "$gle_halfassed" = yes ; then
+
   if test "$with_gle_req" = yes ; then
     noteL 'Use of the GLE (GL Extrusion) library was requested, but'
     warn2 'it was not found (though the OpenGL library was found, and'
   if test "$with_gle_req" = yes ; then
     noteL 'Use of the GLE (GL Extrusion) library was requested, but'
     warn2 'it was not found (though the OpenGL library was found, and'
@@ -11580,11 +16401,11 @@ if test "$have_gl" = yes -a "$have_gle" = no ; then
   echo ''
   warn2 'Some of the OpenGL (3D) demos (those that depend on GLE)'
   warn2 'will not be built or installed.  You might want to consider'
   echo ''
   warn2 'Some of the OpenGL (3D) demos (those that depend on GLE)'
   warn2 'will not be built or installed.  You might want to consider'
-  warn2 'installing GLE and re-running configure.  (Remember to delete'
-  warn2 'the config.cache file first.)  You can find the GLE library'
-  warn2 'at <http://www.linas.org/gle/>.  For general OpenGL info,'
-  warn2 'see <http://www.opengl.org/>.'
+  warn2 'installing GLE and re-running configure.  You can find the'
+  warn2 'GLE library at <http://www.linas.org/gle/>.  For general'
+  warn2 'OpenGL info, see <http://www.opengl.org/>.'
 
 
+ fi
 fi
 
 
 fi
 
 
@@ -11592,13 +16413,6 @@ if test "$with_readdisplay_req" = yes -a "$have_readdisplay" = no ; then
   warn 'Use of XReadDisplay was requested, but it was not found.'
 fi
 
   warn 'Use of XReadDisplay was requested, but it was not found.'
 fi
 
-if test -n "$with_fortune_req"; then
-  if test "$with_fortune_req" != "$ac_cv_fortune_program" ; then
-    warnL "$with_fortune_req was requested as the Fortune program,"
-    warn2 "but was not found.  The default will be used instead."
-  fi
-fi
-
 if test "$with_kerberos_req" = yes -a "$have_kerberos" = no ; then
   warn 'Use of Kerberos was requested, but it was not found.'
 fi
 if test "$with_kerberos_req" = yes -a "$have_kerberos" = no ; then
   warn 'Use of Kerberos was requested, but it was not found.'
 fi
@@ -11611,28 +16425,20 @@ if test "$with_shadow_req" = yes -a "$have_shadow" = no ; then
   warn 'Use of shadow passwords was requested, but they were not found.'
 fi
 
   warn 'Use of shadow passwords was requested, but they were not found.'
 fi
 
+if test "$ac_macosx" = yes ; then
+  if test "$enable_locking" = yes ; then
+    warn  "You have specified --enable-locking on MacOS X."
+    warn2 "THIS DOES NOT WORK!  Don't do this!"
+  fi
+fi
+
 
 # You are in a twisty maze of namespaces and syntaxes, all alike.
 # Fuck the skull of Unix.
 #
 
 # You are in a twisty maze of namespaces and syntaxes, all alike.
 # Fuck the skull of Unix.
 #
-eval bindir=${bindir}
-eval bindir=${bindir}
-eval bindir=${bindir}
-eval bindir=${bindir}
-eval bindir=${bindir}
-eval bindir=${bindir}
-eval HACKDIR=${HACKDIR}
-eval HACKDIR=${HACKDIR}
-eval HACKDIR=${HACKDIR}
-eval HACKDIR=${HACKDIR}
-eval HACKDIR=${HACKDIR}
-eval HACKDIR=${HACKDIR}
-eval HACK_CONF_DIR=${HACK_CONF_DIR}
-eval HACK_CONF_DIR=${HACK_CONF_DIR}
-eval HACK_CONF_DIR=${HACK_CONF_DIR}
-eval HACK_CONF_DIR=${HACK_CONF_DIR}
-eval HACK_CONF_DIR=${HACK_CONF_DIR}
-eval HACK_CONF_DIR=${HACK_CONF_DIR}
+bindir=`eval eval eval eval eval eval eval echo $bindir`
+HACKDIR=`eval eval eval eval eval eval eval echo $HACKDIR`
+HACK_CONF_DIR=`eval eval eval eval eval eval eval echo $HACK_CONF_DIR`
 
 # canonicalize slashes.
 bindir=`echo  "${bindir}"              | sed 's@/$@@;s@//*@/@g'`
 
 # canonicalize slashes.
 bindir=`echo  "${bindir}"              | sed 's@/$@@;s@//*@/@g'`
@@ -11644,47 +16450,79 @@ HACK_CONF_DIR=`echo "${HACK_CONF_DIR}" | sed 's@/$@@;s@//*@/@g'`
 for bad_choice in xscreensaver xscreensaver-demo xscreensaver-command ; do
   if test "${HACKDIR}" = "${bindir}/${bad_choice}" ; then
     echo ""
 for bad_choice in xscreensaver xscreensaver-demo xscreensaver-command ; do
   if test "${HACKDIR}" = "${bindir}/${bad_choice}" ; then
     echo ""
-    { echo "configure: error: \"--with-hackdir=${bindir}/${bad_choice}\" won't work.
+    as_fn_error $? "\"--with-hackdir=${bindir}/${bad_choice}\" won't work.
                    There will be an executable installed with that name, so
                    that can't be the name of a directory as well.  Please
                    There will be an executable installed with that name, so
                    that can't be the name of a directory as well.  Please
-                   re-configure with a different directory name." 1>&2; exit 1; }
+                   re-configure with a different directory name." "$LINENO" 5
   fi
 done
 
 
 do_dir_warning=no
 
   fi
 done
 
 
 do_dir_warning=no
 
-# Now let's see if there's a previous RPM version already installed.  Blargh!
+# Now let's warn if there's a previous RPM version already installed.
+# But don't bother with this test if we are currently *building* an RPM.
 
 
-# M4 sucks!!
+if test -z "$RPM_PACKAGE_VERSION" ; then
 
 
-rpmv=`(rpm -qv xscreensaver) 2>&- | \
-      sed -n 's/^xscreensaver-\([0-9][0-9]*[.][0-9][0-9]*\)-.*$/\1/p'`
+  rpmnames="xscreensaver xscreensaver-base xscreensaver-extras"
 
 
+  # M4 sucks!!
 
 
-if test \! -z "$rpmv" ; then
-  rpmbdir=`rpm -ql xscreensaver | sed -n 's@^\(.*\)/xscreensaver-demo$@\1@p'`
-  rpmhdir=`rpm -ql xscreensaver | sed -n 's@^\(.*\)/attraction$@\1@p'`
+  rpmv=`(rpm -qv $rpmnames) 2>/dev/null | \
+        sed -n 's/^[-a-z]*-\([0-9][0-9]*[.][0-9][0-9a-z]*\)-.*$/\1/p' | \
+        head -1`
 
 
-  warning=no
-  warnL "There is already an installed RPM of xscreensaver $rpmv"
-  warn2 "on this system.  You might want to remove it (with"
-  warn2 '"rpm -ve xscreensaver") before running "make install"'
-  warn2 "from this directory."
-  echo ""
-  warn2 "Alternately, you could build this version of xscreensaver"
-  warn2 'as an RPM, and then install that.  An "xscreensaver.spec"'
-  warn2 "file is included.  See the RPM documentation for more info."
-  echo ""
 
 
-  if test "$rpmbdir" = "$rpmhdir" ; then
-    warn2 "The RPM version was installed in $rpmbdir/."
-  else
-    warn2 "The RPM version was installed in $rpmbdir/,"
-    warn2 "with demos in $rpmhdir/."
+  if test \! -z "$rpmv" ; then
+    rpmbdir=`rpm -ql $rpmnames | sed -n 's@^\(.*\)/xscreensaver-demo$@\1@p'`
+    rpmhdir=`rpm -ql $rpmnames | sed -n 's@^\(.*\)/popsquares$@\1@p'`
+
+    warning=no
+    warnL "There is already an installed RPM of xscreensaver $rpmv"
+    warn2 'on this system.  You might want to remove it ("rpm -ve")'
+    warn2 'before running "make install" in this directory.'
+    echo ""
+    warn2 "Alternately, you could build this version of xscreensaver"
+    warn2 'as an RPM, and then install that.  An "xscreensaver.spec"'
+    warn2 'file is included.  Try "rpmbuild -v -ba xscreensaver.spec".'
+    warn2 "See the RPM documentation for more info."
+    echo ""
+
+    if test "$rpmbdir" = "$rpmhdir" ; then
+      warn2 "The RPM version was installed in $rpmbdir/."
+      do_dir_warning=yes
+    else
+      warn2 "The RPM version was installed in $rpmbdir/,"
+      warn2 "with demos in $rpmhdir/."
+    fi
+  fi
+fi
+
+# Also warn if there's a Debian package installed.
+#
+debnames="xscreensaver xscreensaver-data xscreensaver-data-extra"
+debv=''
+for dpkg in $debnames ; do
+  if test -z "$debv"; then
+    debv=`dpkg -s $dpkg 2>/dev/null | sed -n 's/^Version: \(.*\)$/\1/p'`
   fi
   fi
+done
 
 
-  do_dir_warning=yes
+if test \! -z "$debv" ; then
+  debbdir=`dpkg -L $debnames 2>/dev/null | \
+            sed -n 's@^\(.*/bin/\)xscreensaver$@\1@p'`
+  debhdir=`dpkg -L $debnames 2>/dev/null | \
+            sed -n 's@^\(.*/\)popsquares$@\1@p'`
+  if test -z "$debbdir" ; then debbdir='???'; fi
+  if test -z "$debhdir" ; then debhdir='???'; fi
+
+  warning=no
+  warnL "There is already an installed dpkg of xscreensaver"
+  warn2 "version \"$debv\" on this system."
+  echo ""
+  warn2 "The dpkg was installed in $debbdir,"
+  warn2 "with demos in $debhdir."
 fi
 
 
 fi
 
 
@@ -11700,7 +16538,7 @@ if test "$do_dir_warning" = yes; then
   echo '      "xscreensaver-demo", and "xscreensaver-command" executables'
   echo "      will be installed in ${bindir}/."
   echo ""
   echo '      "xscreensaver-demo", and "xscreensaver-command" executables'
   echo "      will be installed in ${bindir}/."
   echo ""
-  echo "      The various graphics demos (140+ different executables) will"
+  echo "      The various graphics demos (190+ different executables) will"
   echo "      be installed in ${HACKDIR}/."
   echo ""
   echo "      If you would prefer the demos to be installed elsewhere,"
   echo "      be installed in ${HACKDIR}/."
   echo ""
   echo "      If you would prefer the demos to be installed elsewhere,"
@@ -11719,6 +16557,7 @@ if test "$do_dir_warning" = no; then
   fi
   echo "User programs will be installed in ${bindir}/"
   echo "Screen savers will be installed in ${HACKDIR}/"
   fi
   echo "User programs will be installed in ${bindir}/"
   echo "Screen savers will be installed in ${HACKDIR}/"
-  echo "Configuration will be installed in ${HACK_CONF_DIR}/"
+  echo "Configuration dialogs will be installed in ${HACK_CONF_DIR}/"
+  echo "System-wide default settings will be installed in ${APPDEFAULTS}/"
   echo ''
 fi
   echo ''
 fi