#! /bin/sh

# 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.
#
# This configure script is free software; the Free Software Foundation
# gives unlimited permission to copy, distribute and modify it.

# 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

Screen locking options:

  --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:

  --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

Graphics options:

  --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.)
"

# Initialize some variables set by options.
# The variables have the same names as the options, with
# dashes changed to underlines.
build=NONE
cache_file=./config.cache
exec_prefix=NONE
host=NONE
no_create=
nonopt=NONE
no_recursion=
prefix=NONE
program_prefix=NONE
program_suffix=NONE
program_transform_name=s,x,x,
silent=
site=
srcdir=
target=NONE
verbose=
x_includes=NONE
x_libraries=NONE
bindir='${exec_prefix}/bin'
sbindir='${exec_prefix}/sbin'
libexecdir='${exec_prefix}/libexec'
datadir='${prefix}/share'
sysconfdir='${prefix}/etc'
sharedstatedir='${prefix}/com'
localstatedir='${prefix}/var'
libdir='${exec_prefix}/lib'
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

ac_prev=
for ac_option
do

  # If the previous option needs an argument, assign it.
  if test -n "$ac_prev"; then
    eval "$ac_prev=\$ac_option"
    ac_prev=
    continue
  fi

  case "$ac_option" in
  -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
  *) ac_optarg= ;;
  esac

  # Accept the important Cygnus configure options, so we can diagnose typos.

  case "$ac_option" in

  -bindir | --bindir | --bindi | --bind | --bin | --bi)
    ac_prev=bindir ;;
  -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
    bindir="$ac_optarg" ;;

  -build | --build | --buil | --bui | --bu)
    ac_prev=build ;;
  -build=* | --build=* | --buil=* | --bui=* | --bu=*)
    build="$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="$ac_optarg" ;;

  -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
    ac_prev=datadir ;;
  -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
  | --da=*)
    datadir="$ac_optarg" ;;

  -disable-* | --disable-*)
    ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
    # 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" ;;

  -enable-* | --enable-*)
    ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
    # 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 ;;
    esac
    eval "enable_${ac_feature}='$ac_optarg'" ;;

  -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
  | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
  | --exec | --exe | --ex)
    ac_prev=exec_prefix ;;
  -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
  | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
  | --exec=* | --exe=* | --ex=*)
    exec_prefix="$ac_optarg" ;;

  -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 ;;

  -host | --host | --hos | --ho)
    ac_prev=host ;;
  -host=* | --host=* | --hos=* | --ho=*)
    host="$ac_optarg" ;;

  -includedir | --includedir | --includedi | --included | --include \
  | --includ | --inclu | --incl | --inc)
    ac_prev=includedir ;;
  -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
  | --includ=* | --inclu=* | --incl=* | --inc=*)
    includedir="$ac_optarg" ;;

  -infodir | --infodir | --infodi | --infod | --info | --inf)
    ac_prev=infodir ;;
  -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
    infodir="$ac_optarg" ;;

  -libdir | --libdir | --libdi | --libd)
    ac_prev=libdir ;;
  -libdir=* | --libdir=* | --libdi=* | --libd=*)
    libdir="$ac_optarg" ;;

  -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
  | --libexe | --libex | --libe)
    ac_prev=libexecdir ;;
  -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
  | --libexe=* | --libex=* | --libe=*)
    libexecdir="$ac_optarg" ;;

  -localstatedir | --localstatedir | --localstatedi | --localstated \
  | --localstate | --localstat | --localsta | --localst \
  | --locals | --local | --loca | --loc | --lo)
    ac_prev=localstatedir ;;
  -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
  | --localstate=* | --localstat=* | --localsta=* | --localst=* \
  | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
    localstatedir="$ac_optarg" ;;

  -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
    ac_prev=mandir ;;
  -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
    mandir="$ac_optarg" ;;

  -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_create=yes ;;

  -no-recursion | --no-recursion | --no-recursio | --no-recursi \
  | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
    no_recursion=yes ;;

  -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
  | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
  | --oldin | --oldi | --old | --ol | --o)
    ac_prev=oldincludedir ;;
  -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
  | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
  | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
    oldincludedir="$ac_optarg" ;;

  -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
    ac_prev=prefix ;;
  -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
    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="$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="$ac_optarg" ;;

  -program-transform-name | --program-transform-name \
  | --program-transform-nam | --program-transform-na \
  | --program-transform-n | --program-transform- \
  | --program-transform | --program-transfor \
  | --program-transfo | --program-transf \
  | --program-trans | --program-tran \
  | --progr-tra | --program-tr | --program-t)
    ac_prev=program_transform_name ;;
  -program-transform-name=* | --program-transform-name=* \
  | --program-transform-nam=* | --program-transform-na=* \
  | --program-transform-n=* | --program-transform-=* \
  | --program-transform=* | --program-transfor=* \
  | --program-transfo=* | --program-transf=* \
  | --program-trans=* | --program-tran=* \
  | --progr-tra=* | --program-tr=* | --program-t=*)
    program_transform_name="$ac_optarg" ;;

  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
  | -silent | --silent | --silen | --sile | --sil)
    silent=yes ;;

  -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
    ac_prev=sbindir ;;
  -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
  | --sbi=* | --sb=*)
    sbindir="$ac_optarg" ;;

  -sharedstatedir | --sharedstatedir | --sharedstatedi \
  | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
  | --sharedst | --shareds | --shared | --share | --shar \
  | --sha | --sh)
    ac_prev=sharedstatedir ;;
  -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
  | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
  | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
  | --sha=* | --sh=*)
    sharedstatedir="$ac_optarg" ;;

  -site | --site | --sit)
    ac_prev=site ;;
  -site=* | --site=* | --sit=*)
    site="$ac_optarg" ;;

  -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
    ac_prev=srcdir ;;
  -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
    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="$ac_optarg" ;;

  -target | --target | --targe | --targ | --tar | --ta | --t)
    ac_prev=target ;;
  -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
    target="$ac_optarg" ;;

  -v | -verbose | --verbose | --verbos | --verbo | --verb)
    verbose=yes ;;

  -version | --version | --versio | --versi | --vers)
    echo "configure generated by autoconf version 2.13"
    exit 0 ;;

  -with-* | --with-*)
    ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
    # 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 ;;
    esac
    eval "with_${ac_package}='$ac_optarg'" ;;

  -without-* | --without-*)
    ac_package=`echo $ac_option|sed -e 's/-*without-//'`
    # 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" ;;

  --x)
    # Obsolete; use --with-x.
    with_x=yes ;;

  -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-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" ;;

  -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
    ;;

  *)
    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"
    ;;

  esac
done

if test -n "$ac_prev"; then
  { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
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
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
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" ;;
  esac
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

# 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

# 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
  # 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=.
  srcdir=$ac_confdir
  if test ! -r $srcdir/$ac_unique_file; then
    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
done


###############################################################################
#
#       Function to figure out how to run the compiler.
#
###############################################################################




###############################################################################
#
#       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!)
#
###############################################################################






###############################################################################
#
#       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...
#










# 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.
#
###############################################################################
###############################################################################

# 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

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

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

cat > conftest.$ac_ext << EOF

#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>
                   #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 icmp i;
                   struct sockaddr s;
                   struct sockaddr_in si;
                   struct ip ip;
                   i.icmp_type = ICMP_ECHO;
                   i.icmp_code = 0;
                   i.icmp_cksum = 0;
                   i.icmp_id = 0;
                   i.icmp_seq = 0;
                   si.sin_family = AF_INET;
                   #if defined(__DECC) || defined(_IP_VHL)
                   ip.ip_vhl = 0;
                   #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*
  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
fi
rm -f conftest*
fi

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

 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
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
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  ac_cv_have_icmphdr=no
fi
rm -f conftest*
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
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
 
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
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
fi
PERL="$ac_cv_path_PERL"
if test -n "$PERL"; then
  echo "$ac_t""$PERL" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

test -n "$PERL" && break
done

  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

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

# 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 "$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

  # 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
    fi
  done
fi
rm -f conftest*
fi # $ac_x_includes = NO

if test "$ac_x_libraries" = NO; then
  # Check for the libraries.

  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=
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 \
    ; \
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
done
fi
rm -f conftest*
fi # $ac_x_libraries = NO

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"
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
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

  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.

  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
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"
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
  X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"
else
  echo "$ac_t""no" 1>&6
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
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"
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
  X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"
else
  echo "$ac_t""no" 1>&6
fi

    fi

    # 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
  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() {

/* 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

; 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"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_func_gethostbyname=no"
fi
rm -f conftest*
fi

if eval "test \"`echo '$ac_cv_func_'gethostbyname`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  :
else
  echo "$ac_t""no" 1>&6
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"
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
  X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl"
else
  echo "$ac_t""no" 1>&6
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@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
  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();

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_connect) || defined (__stub___connect)
choke me
#else
connect();
#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"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_func_connect=no"
fi
rm -f conftest*
fi

if eval "test \"`echo '$ac_cv_func_'connect`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  :
else
  echo "$ac_t""no" 1>&6
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"
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
  X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS"
else
  echo "$ac_t""no" 1>&6
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();
#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"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_func_remove=no"
fi
rm -f conftest*
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

    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
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_EXTRA_LIBS="$X_EXTRA_LIBS -lposix"
else
  echo "$ac_t""no" 1>&6
fi

    fi

    # 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
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();

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_shmat) || defined (__stub___shmat)
choke me
#else
shmat();
#endif

; 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"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_func_shmat=no"
fi
rm -f conftest*
fi

if eval "test \"`echo '$ac_cv_func_'shmat`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  :
else
  echo "$ac_t""no" 1>&6
fi

    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"
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
  X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"
else
  echo "$ac_t""no" 1>&6
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"
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
  X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE"
else
  echo "$ac_t""no" 1>&6
fi

  LDFLAGS="$ac_save_LDFLAGS"

fi


if test "$have_x" != yes; then
  { echo "configure: error: Couldn't find X11 headers/libs.  Try \`$0 --help'." 1>&2; exit 1; }
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`
    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
    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

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*)

      # 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"

        # 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"
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
  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

  fi



###############################################################################
#
#       Check for -lXmu (some fucked up vendors don't ship it...)
#
###############################################################################

have_xmu=no

  ac_save_CPPFLAGS="$CPPFLAGS"
  if test \! -z "$includedir" ; then 
    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
  have_xmu=yes
else
  echo "$ac_t""no" 1>&6
fi

  CPPFLAGS="$ac_save_CPPFLAGS"
if test "$have_xmu" = no ; then
  XMU_SRCS='$(UTILS_SRC)/xmu.c'
  XMU_OBJS='$(UTILS_BIN)/xmu.o'
  XMU_LIBS=''
else
  XMU_SRCS=''
  XMU_OBJS=''
  XMU_LIBS='-lXmu'
  cat >> confdefs.h <<\EOF
#define HAVE_XMU 1
EOF

fi


###############################################################################
#
#       Check for the SunOS 4.1.x _get_wmShellWidgetClass bug.
#       See comp.windows.x FAQ question 124.  The right fix is to
#       get OpenWindows 3.0 patches 100512-02 and 100573-03.
#
###############################################################################

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
else
  ac_save_LDFLAGS="$LDFLAGS"
                    if test \! -z "$x_libraries" ; then
                      LDFLAGS="$LDFLAGS -L$x_libraries"
                    fi
                    # Note: this trick never works!  (Generally.)
                    # 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"

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*
  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
rm -f conftest*
                    LDFLAGS="$ac_save_LDFLAGS"
fi

echo "$ac_t""$ac_cv_sunos_xmu_bug" 1>&6
    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
else
  ac_save_LDFLAGS="$LDFLAGS"
                      LDFLAGS="$LDFLAGS -static"
                      cat > conftest.$ac_ext <<EOF
#line 3795 "configure"
#include "confdefs.h"

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*
  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
rm -f conftest*
                    LDFLAGS="$ac_save_LDFLAGS"
fi

echo "$ac_t""$ac_cv_ld_static" 1>&6
      if test "$ac_cv_ld_static" = yes ; then
        LDFLAGS="$LDFLAGS -static"
      else
        LDFLAGS="$LDFLAGS -Bstatic"
      fi
    fi
    ;;
  esac
fi


###############################################################################
#
#       Handle the --with-hackdir option
#
###############################################################################

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"
else
  with_hackdir=yes
fi


if test x"$with_hackdir" = xyes; then
  HACKDIR='${exec_prefix}/lib/xscreensaver'
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
fi

# canonicalize slashes.
HACKDIR=`echo "${HACKDIR}" | sed 's@/$@@;s@//*@/@g'`

# 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
fi

if test -n "$obsolete_enable"; then
  echo "error: the --enable-subdir option has been replaced with"
  echo "       the new --with-hackdir option; see \`configure --help'"
  echo "       for more information."
  exit 1
fi


###############################################################################
#
#       Handle the --with-configdir option
#
###############################################################################

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"
else
  with_configdir=yes
fi


if test x"$with_configdir" = xyes; then
  # filled in later...
  HACK_CONF_DIR=''
elif test x"$with_configdir" = xno; then
  echo "error: must be yes, or a pathname: --with-configdir=$with_configdir"
  exit 1
else
  # there must be a better way than this...
  if test -z "`echo $with_configdir | sed 's@^/.*@@'`" ; then
    # absolute path
    HACK_CONF_DIR=$with_configdir
  else
    # relative path
    HACK_CONF_DIR="\${exec_prefix}$with_configdir"
  fi
fi




###############################################################################
#
#       Check for the SGI SCREEN_SAVER server extension.
#
###############################################################################

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"
else
  with_sgi=yes
fi



   case "$with_sgi" in
    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
     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 SCREEN_SAVER libs""... $ac_c" 1>&6
echo "configure:3951: checking for SGI SCREEN_SAVER libs" >&5
     d=$with_sgi/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_sgi_req="yes"
     with_sgi=$with_sgi_req
     ;;

    *)
     echo ""
     echo "error: argument to --with-sgi-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_sgi" = 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/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
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

else
  echo "$ac_t""no" 1>&6
fi

  CPPFLAGS="$ac_save_CPPFLAGS"

elif test "$with_sgi" != no; then
  echo "error: must be yes or no: --with-sgi-ext=$with_sgi"
  exit 1
fi


###############################################################################
#
#       Check for the MIT-SCREEN-SAVER 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"
else
  with_mit=yes
fi



   case "$with_mit" in
    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
     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 MIT-SCREEN-SAVER libs""... $ac_c" 1>&6
echo "configure:4061: checking for MIT-SCREEN-SAVER libs" >&5
     d=$with_mit/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_mit_req="yes"
     with_mit=$with_mit_req
     ;;

    *)
     echo ""
     echo "error: argument to --with-mit-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_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"

  # 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"

  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"

  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"
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"
  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.
      
  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"

  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
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"
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_mit=yes; SAVER_LIBS="$SAVER_LIBS -lXExExt"
else
  echo "$ac_t""no" 1>&6
true
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.
      
  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"

  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
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"
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_mit=yes; SAVER_LIBS="$SAVER_LIBS -lXss"
else
  echo "$ac_t""no" 1>&6
true
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

elif test "$with_mit" != no; then
  echo "error: must be yes or no: --with-mit-ext=$with_mit"
  exit 1
fi


###############################################################################
#
#       Check for the XIDLE 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"
else
  with_xidle=yes
fi



   case "$with_xidle" in
    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
     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 XIDLE libs""... $ac_c" 1>&6
echo "configure:4379: checking for XIDLE libs" >&5
     d=$with_xidle/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_xidle_req="yes"
     with_xidle=$with_xidle_req
     ;;

    *)
     echo ""
     echo "error: argument to --with-xidle-ext must be \"yes\", \"no\", or a directory."
     echo "       If it is a directory, then \`DIR/include' will be added to"
     echo "       the -I list, and \`DIR/lib' will be added to the -L list."
     exit 1
     ;;
   esac
  

if 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



   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
     ;;

    *)
     echo ""
     echo "error: argument to --with-sgivc-ext must be \"yes\", \"no\", or a directory."
     echo "       If it is a directory, then \`DIR/include' will be added to"
     echo "       the -I list, and \`DIR/lib' will be added to the -L list."
     exit 1
     ;;
   esac
  

if test "$with_sgivc" = yes; then

  # first check for XSGIvc.h
  
  ac_save_CPPFLAGS="$CPPFLAGS"
  if test \! -z "$includedir" ; then 
    CPPFLAGS="$CPPFLAGS -I$includedir"
  fi
  CPPFLAGS="$CPPFLAGS $X_CFLAGS"
  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
fi

  CPPFLAGS="$ac_save_CPPFLAGS"

  # if that succeeded, then check for the -lXsgivc
  if test "$have_sgivc" = yes; then
    have_sgivc=no
    
  ac_save_CPPFLAGS="$CPPFLAGS"
  ac_save_LDFLAGS="$LDFLAGS"
#  ac_save_LIBS="$LIBS"

  if test \! -z "$includedir" ; then 
    CPPFLAGS="$CPPFLAGS -I$includedir"
  fi
  # note: $X_CFLAGS includes $x_includes
  CPPFLAGS="$CPPFLAGS $X_CFLAGS"

  if test \! -z "$libdir" ; then
    LDFLAGS="$LDFLAGS -L$libdir"
  fi
  # note: $X_LIBS includes $x_libraries
  LDFLAGS="$LDFLAGS $X_LIBS $X_EXTRA_LIBS"

  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"
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_sgivc=yes; SAVER_LIBS="$SAVER_LIBS -lXsgivc"
else
  echo "$ac_t""no" 1>&6
true
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_sgivc" = yes; then
    cat >> confdefs.h <<\EOF
#define HAVE_SGI_VC_EXTENSION 1
EOF

  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 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"
else
  with_dpms=yes
fi



   case "$with_dpms" in
    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
     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 DPMS libs""... $ac_c" 1>&6
echo "configure:4671: checking for DPMS libs" >&5
     d=$with_dpms/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_dpms_req="yes"
     with_dpms=$with_dpms_req
     ;;

    *)
     echo ""
     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
  

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

  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_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"

  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"
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"
  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"

  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
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"
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_dpms=yes; XDPMS_LIBS="-lXdpms"
else
  echo "$ac_t""no" 1>&6
true
fi

  CPPFLAGS="$ac_save_CPPFLAGS"
  LDFLAGS="$ac_save_LDFLAGS"
#  LIBS="$ac_save_LIBS"
  
    fi
  fi


  # 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

  fi

elif test "$with_dpms" != no; then
  echo "error: must be yes or no: --with-dpms-ext=$with_dpms"
  exit 1
fi


###############################################################################
#
#       Check for the XINERAMA server extension.
#
###############################################################################

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"
else
  with_xinerama=yes
fi



   case "$with_xinerama" in
    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
     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 XINERAMA libs""... $ac_c" 1>&6
echo "configure:4923: checking for XINERAMA libs" >&5
     d=$with_xinerama/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_xinerama_req="yes"
     with_xinerama=$with_xinerama_req
     ;;

    *)
     echo ""
     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
  

if test "$with_xinerama" = yes; then

  # first check for Xinerama.h
  
  ac_save_CPPFLAGS="$CPPFLAGS"
  if test \! -z "$includedir" ; then 
    CPPFLAGS="$CPPFLAGS -I$includedir"
  fi
  CPPFLAGS="$CPPFLAGS $X_CFLAGS"
  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
fi

  CPPFLAGS="$ac_save_CPPFLAGS"

  # 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"

  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"

  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
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"
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_xinerama=yes
else
  echo "$ac_t""no" 1>&6
true
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
      
  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"

  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
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"
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_xinerama=yes; SAVER_LIBS="$SAVER_LIBS -lXinerama"
else
  echo "$ac_t""no" 1>&6
true
fi

  CPPFLAGS="$ac_save_CPPFLAGS"
  LDFLAGS="$ac_save_LDFLAGS"
#  LIBS="$ac_save_LIBS"
  
    fi
  fi

  # if that succeeded, then we've really got it.
  if test "$have_xinerama" = yes; then
    cat >> confdefs.h <<\EOF
#define HAVE_XINERAMA 1
EOF

  fi

elif test "$with_xinerama" != no; then
  echo "error: must be yes or no: --with-xinerama-ext=$with_xinerama"
  exit 1
fi


###############################################################################
#
#       Check for the XF86VMODE server extension (for virtual screens.)
#
###############################################################################

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"
else
  with_xf86vmode=yes
fi



   case "$with_xf86vmode" in
    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
     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 xf86vmode libs""... $ac_c" 1>&6
echo "configure:5174: checking for xf86vmode libs" >&5
     d=$with_xf86vmode/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_xf86vmode_req="yes"
     with_xf86vmode=$with_xf86vmode_req
     ;;

    *)
     echo ""
     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
  

if test "$with_xf86vmode" = yes; then

  # first check for xf86vmode.h
  
  ac_save_CPPFLAGS="$CPPFLAGS"
  if test \! -z "$includedir" ; then 
    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
fi

  CPPFLAGS="$ac_save_CPPFLAGS"

  # 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"

  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"

  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"
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_xf86vmode=yes; SAVER_LIBS="$SAVER_LIBS -lXxf86vm"
else
  echo "$ac_t""no" 1>&6
true
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 check for xf86vmode.h, if we haven't already
  if test "$have_xf86vmode" = yes; then
    have_xf86gamma=yes
  else
    
  ac_save_CPPFLAGS="$CPPFLAGS"
  if test \! -z "$includedir" ; then 
    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: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
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
else
  echo "$ac_t""no" 1>&6
fi

  CPPFLAGS="$ac_save_CPPFLAGS"
  fi

  # 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"

  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"

  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"
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_xf86gamma=yes
else
  echo "$ac_t""no" 1>&6
true
fi

  CPPFLAGS="$ac_save_CPPFLAGS"
  LDFLAGS="$ac_save_LDFLAGS"
#  LIBS="$ac_save_LIBS"
  
  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"

  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"

  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"
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_xf86gamma_ramp=yes
else
  echo "$ac_t""no" 1>&6
true
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

  # 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


###############################################################################
#
#       Check for HP XHPDisableReset and XHPEnableReset.
#
###############################################################################


  ac_save_CPPFLAGS="$CPPFLAGS"
  if test \! -z "$includedir" ; then 
    CPPFLAGS="$CPPFLAGS -I$includedir"
  fi
  CPPFLAGS="$CPPFLAGS $X_CFLAGS"
  cat > conftest.$ac_ext <<EOF
#line 5603 "configure"
#include "confdefs.h"
#include <X11/XHPlib.h>
EOF
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

                   SAVER_LIBS="-lXhp11 $SAVER_LIBS"
fi
rm -f conftest*

  CPPFLAGS="$ac_save_CPPFLAGS"


###############################################################################
#
#       Check for /proc/interrupts.
#
###############################################################################

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"
else
  with_proc_interrupts=yes
fi


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
else
  ac_cv_have_proc_interrupts=no
     if grep keyboard /proc/interrupts >/dev/null 2>&1 ; then
       ac_cv_have_proc_interrupts=yes
     fi
    
fi

echo "$ac_t""$ac_cv_have_proc_interrupts" 1>&6
   have_proc_interrupts=$ac_cv_have_proc_interrupts

  if test "$have_proc_interrupts" = yes; then
    cat >> confdefs.h <<\EOF
#define HAVE_PROC_INTERRUPTS 1
EOF

  fi

elif test "$with_proc_interrupts" != no; then
  echo "error: must be yes or no: --with-proc-interrupts=$with_proc_interrupts"
  exit 1
fi


###############################################################################
#
#       The --enable-locking option
#
###############################################################################

# Check whether --enable-locking or --disable-locking was given.
if test "${enable_locking+set}" = set; then
  enableval="$enable_locking"
  enable_locking="$enableval"
else
  enable_locking=yes
fi

if test "$enable_locking" = yes; then
  true
elif test "$enable_locking" = no; then
  cat >> confdefs.h <<\EOF
#define NO_LOCKING 1
EOF

else
  echo "error: must be yes or no: --enable-locking=$enable_locking"
  exit 1
fi



###############################################################################
#
#       The --enable-vt-locking option
#
###############################################################################

#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



###############################################################################
#
#       Check for PAM.
#
###############################################################################

case "$host" in
  *-solaris*)
   # Solaris systems tend to come with PAM misconfigured.
   #  Don't build it by default, even if the headers exist.
   with_pam_default=no
   ;;
  *)
   # Default to building PAM support on all other systems, if it exists.
   with_pam_default=yes
  ;;
esac

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"
else
  with_pam=$with_pam_default
fi



   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
     d=$with_pam/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 PAM libs""... $ac_c" 1>&6
echo "configure:5784: checking for PAM libs" >&5
     d=$with_pam/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_pam_req="yes"
     with_pam=$with_pam_req
     ;;

    *)
     echo ""
     echo "error: argument to --with-pam 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 "$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
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 5821 "configure"
#include "confdefs.h"
#include <security/pam_appl.h>
int main() {

; return 0; }
EOF
if { (eval echo configure:5828: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  ac_cv_pam=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  ac_cv_pam=no
fi
rm -f conftest*
  CPPFLAGS="$ac_save_CPPFLAGS"
fi

echo "$ac_t""$ac_cv_pam" 1>&6
  if test "$ac_cv_pam" = yes ; then
    have_pam=yes
    cat >> confdefs.h <<\EOF
#define HAVE_PAM 1
EOF

    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
else
  ac_save_LIBS="$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"
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
  PASSWD_LIBS="${PASSWD_LIBS} -ldl"
else
  echo "$ac_t""no" 1>&6
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
else
  cat > conftest.$ac_ext <<EOF
#line 5899 "configure"
#include "confdefs.h"
#include <stdio.h>
                      #include <stdlib.h>
                      #include <security/pam_appl.h>
int main() {
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*
  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"
#include <stdio.h>
                                      #include <stdlib.h>
                                      #include <security/pam_appl.h>
int main() {
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*
  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
rm -f conftest*
fi
rm -f conftest*
      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
    elif test "$ac_pam_strerror_args" = 2 ; then
      cat >> confdefs.h <<\EOF
#define PAM_STRERROR_TWO_ARGS 1
EOF

      echo "$ac_t""two arguments" 1>&6
    else
      echo "$ac_t""unknown" 1>&6
    fi
  fi
fi


###############################################################################
#
#       Check for Kerberos.
#
###############################################################################

have_kerberos=no
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"
else
  with_kerberos=yes
fi



   case "$with_kerberos" in
    yes) ;;
    no)  ;;

    /*)
     echo $ac_n "checking for Kerberos headers""... $ac_c" 1>&6
echo "configure:5984: checking for Kerberos headers" >&5
     d=$with_kerberos/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 Kerberos libs""... $ac_c" 1>&6
echo "configure:5994: checking for Kerberos libs" >&5
     d=$with_kerberos/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_kerberos_req="yes"
     with_kerberos=$with_kerberos_req
     ;;

    *)
     echo ""
     echo "error: argument to --with-kerberos 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 "$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
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 6031 "configure"
#include "confdefs.h"
#include <krb.h>
int main() {

; return 0; }
EOF
if { (eval echo configure:6038: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  ac_cv_kerberos=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  ac_cv_kerberos=no
fi
rm -f conftest*
  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
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 6064 "configure"
#include "confdefs.h"
#include <kerberosIV/krb.h>
int main() {

; return 0; }
EOF
if { (eval echo configure:6071: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  ac_cv_kerberos5=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  ac_cv_kerberos5=no
fi
rm -f conftest*
  CPPFLAGS="$ac_save_CPPFLAGS"
fi

echo "$ac_t""$ac_cv_kerberos5" 1>&6

  if test "$ac_cv_kerberos" = yes ; then
    have_kerberos=yes
    cat >> confdefs.h <<\EOF
#define HAVE_KERBEROS 1
EOF

  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

  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"
  fi

  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();

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_res_search) || defined (__stub___res_search)
choke me
#else
res_search();
#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"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_func_res_search=no"
fi
rm -f conftest*
fi

if eval "test \"`echo '$ac_cv_func_'res_search`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  :
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
else
  ac_save_LIBS="$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"
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
  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
      
fi

fi

  fi
fi


###############################################################################
#
#       Check for the nine billion variants of shadow passwords...
#
###############################################################################

need_setuid=no

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"
else
  with_shadow=yes
fi



   case "$with_shadow" in
    yes) ;;
    no)  ;;

    /*)
     echo $ac_n "checking for shadow password headers""... $ac_c" 1>&6
echo "configure:6238: checking for shadow password headers" >&5
     d=$with_shadow/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 shadow password libs""... $ac_c" 1>&6
echo "configure:6248: checking for shadow password libs" >&5
     d=$with_shadow/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_shadow_req="yes"
     with_shadow=$with_shadow_req
     ;;

    *)
     echo ""
     echo "error: argument to --with-shadow 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 "$enable_locking" = no ; then
  with_shadow_req=no
  with_shadow=no
fi


###############################################################################
#
#       Check for Sun "adjunct" passwords.
#
###############################################################################

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
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 6297 "configure"
#include "confdefs.h"
#include <stdlib.h>
                                    #include <unistd.h>
                                    #include <sys/types.h>
                                    #include <sys/label.h>
                                    #include <sys/audit.h>
                                    #include <pwdadj.h>
int main() {
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*
  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
rm -f conftest*
  CPPFLAGS="$ac_save_CPPFLAGS"
fi

echo "$ac_t""$ac_cv_sun_adjunct" 1>&6
  if test "$ac_cv_sun_adjunct" = yes; then
    have_shadow_adjunct=yes
    have_shadow=yes
    need_setuid=yes
  fi
fi


###############################################################################
#
#       Check for DEC and SCO so-called "enhanced" security.
#
###############################################################################

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
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 6351 "configure"
#include "confdefs.h"
#include <stdlib.h>
                                    #include <unistd.h>
                                    #include <sys/types.h>
                                    #include <pwd.h>
                                    #include <sys/security.h>
                                    #include <prot.h>
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;
; return 0; }
EOF
if { (eval echo configure:6368: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  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
rm -f conftest*
  CPPFLAGS="$ac_save_CPPFLAGS"
fi

echo "$ac_t""$ac_cv_enhanced_passwd" 1>&6
  if test $ac_cv_enhanced_passwd = yes; then
    have_shadow_enhanced=yes
    have_shadow=yes
    need_setuid=yes

    # On SCO, getprpwnam() is in -lprot (which uses nap() from -lx)
    # (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
else
  ac_save_LIBS="$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"
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
  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
else
  ac_save_LIBS="$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"
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
  PASSWD_LIBS="$PASSWD_LIBS -lsecurity"
else
  echo "$ac_t""no" 1>&6
fi

fi

  fi
fi

###############################################################################
#
#       Check for HP's entry in the "Not Invented Here" Sweepstakes.
#
###############################################################################

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
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 6493 "configure"
#include "confdefs.h"
#include <stdlib.h>
                                    #include <unistd.h>
                                    #include <sys/types.h>
                                    #include <pwd.h>
                                    #include <hpsecurity.h>
                                    #include <prot.h>
int main() {
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*
  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
rm -f conftest*
  CPPFLAGS="$ac_save_CPPFLAGS"
fi

echo "$ac_t""$ac_cv_hpux_passwd" 1>&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
    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
else
  ac_save_LIBS="$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"
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
  PASSWD_LIBS="$PASSWD_LIBS -lsec"
else
  echo "$ac_t""no" 1>&6
fi

  fi
fi


###############################################################################
#
#       Check for FreeBSD-style shadow passwords.
#
#       On FreeBSD, getpwnam() and friends work just like on non-shadow-
#       password systems -- except you only get stuff in the pw_passwd field
#       if the running program is setuid.  So, guess that we've got this
#       lossage to contend with if /etc/master.passwd exists, and default to
#       a setuid installation.
#
###############################################################################

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
else
  if test -f /etc/master.passwd ; then
                    ac_cv_master_passwd=yes
                  else
                    ac_cv_master_passwd=no
                  fi
fi

echo "$ac_t""$ac_cv_master_passwd" 1>&6
  if test "$ac_cv_master_passwd" = yes; then
    need_setuid=yes
  fi
fi


###############################################################################
#
#       Check for traditional (ha!) shadow passwords.
#
###############################################################################

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
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 6621 "configure"
#include "confdefs.h"
#include <stdlib.h>
                                    #include <unistd.h>
                                    #include <sys/types.h>
                                    #include <pwd.h>
                                    #include <shadow.h>
int main() {
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*
  ac_cv_shadow=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  ac_cv_shadow=no
fi
rm -f conftest*
  CPPFLAGS="$ac_save_CPPFLAGS"
fi

echo "$ac_t""$ac_cv_shadow" 1>&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
    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
else
  ac_save_LIBS="$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"
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_getspnam=yes
else
  echo "$ac_t""no" 1>&6
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
else
  ac_save_LIBS="$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"
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_getspnam=yes; PASSWD_LIBS="$PASSWD_LIBS -lgen"
else
  echo "$ac_t""no" 1>&6
fi

    fi
  fi
fi


###############################################################################
#
#       Check for other libraries needed for non-shadow passwords.
#
###############################################################################

if test "$enable_locking" = yes ; then

  # 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
else
  ac_save_LIBS="$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"
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_crypt=yes
else
  echo "$ac_t""no" 1>&6
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
else
  ac_save_LIBS="$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"
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_crypt=yes; PASSWD_LIBS="$PASSWD_LIBS -lcrypt"
else
  echo "$ac_t""no" 1>&6
fi

  fi
fi


# Most of the above shadow mechanisms will have set need_setuid to yes,
# if they were found.  But, on some systems, we need setuid even when
# using plain old vanilla passwords.
#
if test "$enable_locking" = yes ; then
  case "$host" in
    *-hpux* | *-aix* | *-netbsd* | *-freebsd* | *-openbsd* )
      need_setuid=yes
    ;;
  esac
fi


if test "$have_shadow_adjunct" = yes ; then
  cat >> confdefs.h <<\EOF
#define HAVE_ADJUNCT_PASSWD 1
EOF

elif test "$have_shadow_enhanced" = yes ; then
  cat >> confdefs.h <<\EOF
#define HAVE_ENHANCED_PASSWD 1
EOF

elif test "$have_shadow_hpux" = yes ; then
  cat >> confdefs.h <<\EOF
#define HAVE_HPUX_PASSWD 1
EOF

elif test "$have_shadow" = yes ; then
  cat >> confdefs.h <<\EOF
#define HAVE_SHADOW_PASSWD 1
EOF

fi


###############################################################################
#
#       Check for -lXm.
#
###############################################################################

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"
else
  with_motif=yes
fi



   case "$with_motif" in
    yes) ;;
    no)  ;;

    /*)
     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

     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
     ;;

    *)
     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
  

if test "$with_motif" != yes -a "$with_motif" != no ; then
  echo "error: must be yes or no: --with-motif=$with_motif"
  exit 1
fi

if test "$with_motif" = yes; then
  have_motif=no
  
  ac_save_CPPFLAGS="$CPPFLAGS"
  if test \! -z "$includedir" ; then 
    CPPFLAGS="$CPPFLAGS -I$includedir"
  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

                     MOTIF_LIBS="$MOTIF_LIBS -lXm"
else
  echo "$ac_t""no" 1>&6
fi

  CPPFLAGS="$ac_save_CPPFLAGS"
fi


if test "$have_motif" = yes; then
  
  ac_save_CPPFLAGS="$CPPFLAGS"
  if test \! -z "$includedir" ; then 
    CPPFLAGS="$CPPFLAGS -I$includedir"
  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

else
  echo "$ac_t""no" 1>&6
fi

  CPPFLAGS="$ac_save_CPPFLAGS"
fi


###############################################################################
#
#       Check for -lgtk (and Gnome stuff)
#
###############################################################################

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"
else
  with_gtk=yes
fi


# if --with-gtk=/directory/ was specified, remember that directory so that
# we can also look for the `gtk-config' program in that directory.
case "$with_gtk" in
  /*)
    gtk_dir="$with_gtk"
    ;;
  *)
    gtk_dir=""
    ;;
esac


   case "$with_gtk" in
    yes) ;;
    no)  ;;

    /*)
     echo $ac_n "checking for Gtk headers""... $ac_c" 1>&6
echo "configure:7065: checking for Gtk headers" >&5
     d=$with_gtk/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 Gtk libs""... $ac_c" 1>&6
echo "configure:7075: checking for Gtk libs" >&5
     d=$with_gtk/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_gtk_req="yes"
     with_gtk=$with_gtk_req
     ;;

    *)
     echo ""
     echo "error: argument to --with-gtk 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_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

  if test ! -z "$gnome_dir"; then
    # canonicalize slashes.
    foo=`echo "${gnome_dir}/bin" | sed 's@//*@/@g'`
    gtk_path="$foo:$gtk_path"
  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
fi

test -n "$glib_config" && break
done

  for ac_prog in gtk12-config  gtk-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: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.
  ;;
  *)
  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
  done
  IFS="$ac_save_ifs"
  ;;
esac
fi
gtk_config="$ac_cv_path_gtk_config"
if test -n "$gtk_config"; then
  echo "$ac_t""$gtk_config" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

test -n "$gtk_config" && break
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
fi

test -n "$gnome_config" && break
done

  fi

  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
    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
  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
else
  ac_cv_gtk_config_cflags=`$gtk_config --cflags`
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
else
  ac_cv_gtk_config_libs=`$gtk_config --libs`
fi

echo "$ac_t""$ac_cv_gtk_config_libs" 1>&6
  fi
  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`
  fi


  # 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


    # check for this function that was not in libcapplet 1.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
  # note: $X_LIBS includes $x_libraries
  LDFLAGS="$LDFLAGS $X_LIBS $X_EXTRA_LIBS"

  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
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"
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
  cat >> confdefs.h <<\EOF
#define HAVE_CRAPPLET_IMMEDIATE 1
EOF

else
  echo "$ac_t""no" 1>&6
true
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


# 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
else
  if test -n "$have_gnome_help"; then
  ac_cv_prog_have_gnome_help="$have_gnome_help" # 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_have_gnome_help="yes"
      break
    fi
  done
  IFS="$ac_save_ifs"
  test -z "$ac_cv_prog_have_gnome_help" && ac_cv_prog_have_gnome_help="no"
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
else
  echo "$ac_t""no" 1>&6
fi

else
  have_gnome_help=no
fi


###############################################################################
#
#       Check for -lxml
#
###############################################################################

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"
else
  with_xml=yes
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
    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
     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 XML libs""... $ac_c" 1>&6
echo "configure:7608: checking for XML libs" >&5
     d=$with_xml/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_xml_req="yes"
     with_xml=$with_xml_req
     ;;

    *)
     echo ""
     echo "error: argument to --with-xml 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_xml" != yes -a "$with_xml" != no ; then
  echo "error: must be yes or no: --with-xml=$with_xml"
  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 ! -z "$gnome_dir"; then
    # canonicalize slashes.
    foo=`echo "${gnome_dir}/bin" | sed 's@//*@/@g'`
    xml_path="$foo:$xml_path"
  fi

  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
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`
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_xml" = yes; then
    # we have the header, now check for the library
    have_xml=no
    xml_halfassed=yes
    
  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"

  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

  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

fi


###############################################################################
#
#       Checking whether Motif is really Lesstif.
#
###############################################################################

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
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 7873 "configure"
#include "confdefs.h"
#include <Xm/Xm.h>
int main() {
long vers = LesstifVersion;
; return 0; }
EOF
if { (eval echo configure:7880: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  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
rm -f conftest*
  CPPFLAGS="$ac_save_CPPFLAGS"
fi

echo "$ac_t""$ac_cv_have_lesstif" 1>&6
  have_lesstif=$ac_cv_have_lesstif
fi


lesstif_version=unknown
lesstif_version_string=unknown

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
else
  
  ac_save_CPPFLAGS="$CPPFLAGS"
  if test \! -z "$includedir" ; then 
    CPPFLAGS="$CPPFLAGS -I$includedir"
  fi
  CPPFLAGS="$CPPFLAGS $X_CFLAGS"
  if test "$cross_compiling" = yes; then
  ac_cv_lesstif_version=unknown
                     ac_cv_lesstif_version_string=unknown
else
  cat > conftest.$ac_ext <<EOF
#line 7920 "configure"
#include "confdefs.h"
#include <stdio.h>
                     #include <Xm/Xm.h>
                     int main() {
                       FILE *f = fopen("conftest-lt", "w");
                       if (!f) exit(1);
                       fprintf(f, "%d %d.%d\n", LesstifVersion,
                          LESSTIF_VERSION, LESSTIF_REVISION);
                       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
  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
rm -fr conftest*
fi

  CPPFLAGS="$ac_save_CPPFLAGS"
fi

echo "$ac_t""$ac_cv_lesstif_version_string" 1>&6
  rm -f conftest-lt
  lesstif_version=$ac_cv_lesstif_version
  lesstif_version_string=$ac_cv_lesstif_version_string

fi


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
else
  
  ac_save_CPPFLAGS="$CPPFLAGS"
  if test \! -z "$includedir" ; then 
    CPPFLAGS="$CPPFLAGS -I$includedir"
  fi
  CPPFLAGS="$CPPFLAGS $X_CFLAGS"
  if test "$cross_compiling" = yes; then
  ac_cv_motif_version=unknown
                     ac_cv_motif_version_string=unknown
else
  cat > conftest.$ac_ext <<EOF
#line 7978 "configure"
#include "confdefs.h"
#include <stdio.h>
                     #include <Xm/Xm.h>
                     int main() {
                       FILE *f = fopen("conftest-mt", "w");
                       if (!f) exit(1);
                       fprintf(f, "%d %d.%d\n", XmVersion,
                          XmVERSION, XmREVISION);
                       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
  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
rm -fr conftest*
fi

  CPPFLAGS="$ac_save_CPPFLAGS"
fi

echo "$ac_t""$ac_cv_motif_version_string" 1>&6
  rm -f conftest-mt
  motif_version=$ac_cv_motif_version
  motif_version_string=$ac_cv_motif_version_string

fi


###############################################################################
#
#       Checking whether Motif requires -lXpm.
#
#       If this is Motif 2.x, and we have XPM, then link against XPM as well.
#       The deal is, Motif 2.x requires XPM -- but it's a compilation option
#       of the library whether to build the XPM code into libXm, or whether
#       to rely on an external libXm.  So the only way to tell whether XPM is
#       a link-time requirement is to examine libXm.a, which is very
#       difficult to do in an autoconf script.  So... if it's Motif 2.x, we
#       always link against XPM if the XPM lib exists (and this will be a
#       no-op if libXm happens to already have the XPM code in it.)
#
###############################################################################

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
   if test "$motif_version" = "unknown" || test "$motif_version" -ge 2000
   then
     motif_requires_xpm=yes
     echo "$ac_t""maybe" 1>&6
   else
     echo "$ac_t""no" 1>&6
   fi
fi


###############################################################################
#
#       Checking whether Motif requires -lXp.
#
#       Some versions of Motif (2.1.0, at least) require -lXp, the "X Printing
#       Extension".   Why this extension isn't in -lXext with all the others,
#       I have no idea.
#
###############################################################################

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"

  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"

  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
else
  ac_save_LIBS="$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"
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_xp_ext=yes; MOTIF_LIBS="$MOTIF_LIBS -lXp"
else
  echo "$ac_t""no" 1>&6
true
fi

  CPPFLAGS="$ac_save_CPPFLAGS"
  LDFLAGS="$ac_save_LDFLAGS"
#  LIBS="$ac_save_LIBS"
  
fi


###############################################################################
#
#       Checking whether Motif requires -lXintl (for _Xsetlocale.)
#
###############################################################################

have_xintl=no
if test "$have_motif" = 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"

  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
else
  ac_save_LIBS="$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"
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_xintl=yes
else
  echo "$ac_t""no" 1>&6
have_xintl=no
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
fi


###############################################################################
#
#       Check for -lGL or -lMesaGL.
#
###############################################################################

have_gl=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"
else
  with_gl=yes
fi



   case "$with_gl" in
    yes) ;;
    no)  ;;

    /*)
     echo $ac_n "checking for GL headers""... $ac_c" 1>&6
echo "configure:8226: checking for GL headers" >&5
     d=$with_gl/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 GL libs""... $ac_c" 1>&6
echo "configure:8236: checking for GL libs" >&5
     d=$with_gl/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_gl_req="yes"
     with_gl=$with_gl_req
     ;;

    *)
     echo ""
     echo "error: argument to --with-gl 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
  

ac_mesagl_version=unknown
ac_mesagl_version_string=unknown

if test "$with_gl" = yes; then
  
  ac_save_CPPFLAGS="$CPPFLAGS"
  if test \! -z "$includedir" ; then 
    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
  have_gl=yes
else
  echo "$ac_t""no" 1>&6
fi

  CPPFLAGS="$ac_save_CPPFLAGS"
  if test "$have_gl" = yes ; then
    
  ac_save_CPPFLAGS="$CPPFLAGS"
  if test \! -z "$includedir" ; then 
    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
  have_gl=yes
else
  echo "$ac_t""no" 1>&6
fi

  CPPFLAGS="$ac_save_CPPFLAGS"
  fi

  # If we have the headers, try and figure out which vendor it's from.
  #
  if test "$have_gl" = yes ; then

    # 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
else
  ac_cv_have_mesa_gl=no
       
  ac_save_CPPFLAGS="$CPPFLAGS"
  if test \! -z "$includedir" ; then 
    CPPFLAGS="$CPPFLAGS -I$includedir"
  fi
  CPPFLAGS="$CPPFLAGS $X_CFLAGS"
  cat > conftest.$ac_ext <<EOF
#line 8367 "configure"
#include "confdefs.h"
#include <GL/glx.h>
EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  egrep "Mesa|MESA" >/dev/null 2>&1; then
  rm -rf conftest*
  ac_cv_have_mesa_gl=yes
fi
rm -f conftest*

  CPPFLAGS="$ac_save_CPPFLAGS"
      
fi

echo "$ac_t""$ac_cv_have_mesa_gl" 1>&6
    ac_have_mesa_gl=$ac_cv_have_mesa_gl
 

    gl_lib_1=""
    GL_LIBS=""


    # 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
else
  ac_save_LIBS="$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"
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
  GL_LIBS="-lpthread"
else
  echo "$ac_t""no" 1>&6
fi

    fi


    # If we have Mesa headers, check to see if we can link against -lMesaGL.
    # If we don't have Mesa headers, or we don't have -lMesaGL, try -lGL.
    # Else, warn that GL is busted.  (We have the headers, but no libs.)
    #

    if test "$ac_have_mesa_gl" = 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"

  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"
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
  gl_lib_1="MesaGL"
                      GL_LIBS="-lMesaGL -lMesaGLU $GL_LIBS"
else
  echo "$ac_t""no" 1>&6
fi

  CPPFLAGS="$ac_save_CPPFLAGS"
  LDFLAGS="$ac_save_LDFLAGS"
#  LIBS="$ac_save_LIBS"
  
    fi

    if test "$gl_lib_1" = "" ; 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"

  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"
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
  gl_lib_1="GL"
                      GL_LIBS="-lGL -lGLU $GL_LIBS"
else
  echo "$ac_t""no" 1>&6
fi

  CPPFLAGS="$ac_save_CPPFLAGS"
  LDFLAGS="$ac_save_LDFLAGS"
#  LIBS="$ac_save_LIBS"
  
    fi

    if test "$gl_lib_1" = "" ; then
      # we have headers, but no libs -- bail.
      have_gl=no
      ac_have_mesa_gl=no
      gl_halfassed=yes
    else
      # linking works -- we can build the GL hacks.
      cat >> confdefs.h <<\EOF
#define HAVE_GL 1
EOF

      if test "$ac_have_mesa_gl" = yes ; then
        cat >> confdefs.h <<\EOF
#define HAVE_MESA_GL 1
EOF

      fi
    fi
  fi


  # Now that we know we have GL headers and libs, do some more GL testing.
  #

  if test "$have_gl" = yes ; then
    # If it's MesaGL, we'd like to issue a warning if the version number
    # is less than or equal to 2.6, because that version had a security bug.
    #
    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
else
  cat > conftest.$ac_ext <<EOF
#line 8609 "configure"
#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
#endif
configure: MESA_MAJOR_VERSION MESA_MINOR_VERSION
EOF

         ac_save_CPPFLAGS="$CPPFLAGS"
         if test \! -z "$includedir" ; then 
           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'`
         

         rm -f conftest.$ac_ext

         CPPFLAGS="$ac_save_CPPFLAGS"

         if test "$mglv" = ""; then
           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=`echo "$maj * 1000 + $min" | bc`
           if test -z "$ac_mesagl_version"; then
             ac_mesagl_version=unknown
             ac_mesagl_version_string=unknown
           fi
         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
      ac_mesagl_version=$ac_cv_mesagl_version
      ac_mesagl_version_string=$ac_cv_mesagl_version_string
    fi


    # Check for OpenGL 1.1 features.
    #
    
  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"

  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
else
  ac_save_LIBS="$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"
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
  cat >> confdefs.h <<\EOF
#define HAVE_GLBINDTEXTURE 1
EOF

else
  echo "$ac_t""no" 1>&6
true
fi

  CPPFLAGS="$ac_save_CPPFLAGS"
  LDFLAGS="$ac_save_LDFLAGS"
#  LIBS="$ac_save_LIBS"
  
  fi

elif test "$with_gl" != no; then
  echo "error: must be yes or no: --with-gl=$with_gl"
  exit 1
fi


###############################################################################
#
#       Check for -lgle.
#
###############################################################################

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"
else
  with_gle=yes
fi



   case "$with_gle" in
    yes) ;;
    no)  ;;

    /*)
     echo $ac_n "checking for GLE headers""... $ac_c" 1>&6
echo "configure:8760: checking for GLE headers" >&5
     d=$with_gle/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 GLE libs""... $ac_c" 1>&6
echo "configure:8770: checking for GLE libs" >&5
     d=$with_gle/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_gle_req="yes"
     with_gle=$with_gle_req
     ;;

    *)
     echo ""
     echo "error: argument to --with-gle 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
  

GLE_LIBS=""

if test "$with_gle" = yes; then

  
  ac_save_CPPFLAGS="$CPPFLAGS"
  if test \! -z "$includedir" ; then 
    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
  have_gle3=yes
else
  echo "$ac_t""no" 1>&6
fi

  CPPFLAGS="$ac_save_CPPFLAGS"
  if test "$have_gle3" = yes ; then
    have_gle=yes;
  else
    
  ac_save_CPPFLAGS="$CPPFLAGS"
  if test \! -z "$includedir" ; then 
    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
  have_gle=yes
else
  echo "$ac_t""no" 1>&6
fi

  CPPFLAGS="$ac_save_CPPFLAGS"
    if test "$have_gle" = yes ; then
      
  ac_save_CPPFLAGS="$CPPFLAGS"
  if test \! -z "$includedir" ; then 
    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
  have_gle=yes
else
  echo "$ac_t""no" 1>&6
fi

  CPPFLAGS="$ac_save_CPPFLAGS"
    fi
  fi

  if test "$have_gle" = yes ; then
    have_gle=no
    gle_halfassed=yes
    
  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"

  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
else
  ac_save_LIBS="$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"
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_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
  if test "$have_gle" = yes ; then
    have_gle=no
    gle_halfassed=yes

    # sometimes the libmatrix stuff is included in libgle.  look there first.
#
# I don't get it.  For some reason, this test passes on SGI, as if
# 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, 
#                   [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"

  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"

  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
else
  ac_save_LIBS="$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"
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_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
    # 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"

  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"

  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
else
  ac_save_LIBS="$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"
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_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
  fi

  if test "$have_gle" = yes ; then
    cat >> confdefs.h <<\EOF
#define HAVE_GLE 1
EOF

    if test "$have_gle3" = yes ; then
      cat >> confdefs.h <<\EOF
#define HAVE_GLE3 1
EOF

    fi
  fi

elif test "$with_gle" != no; then
  echo "error: must be yes or no: --with-gle=$with_gle"
  exit 1

fi



###############################################################################
#
#       Check for -lXpm.
#
###############################################################################

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"
else
  with_xpm=yes
fi



   case "$with_xpm" in
    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
     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 XPM libs""... $ac_c" 1>&6
echo "configure:9191: checking for XPM libs" >&5
     d=$with_xpm/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_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"
  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

  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


###############################################################################
#
#       Check for -lgdk_pixbuf.
#
###############################################################################

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"
else
  with_gdk_pixbuf=yes
fi


# if --with-pixbuf=/directory/ was specified, remember that directory so that
# we can also look for the `gdk-pixbuf-config' program in that directory.
case "$with_gdk_pixbuf" in
  /*)
    gdk_pixbuf_dir="$with_gdk_pixbuf"
    ;;
  *)
    gdk_pixbuf_dir=""
    ;;
esac


   case "$with_gdk_pixbuf" in
    yes) ;;
    no)  ;;

    /*)
     echo $ac_n "checking for GDK_PIXBUF headers""... $ac_c" 1>&6
echo "configure:9311: checking for GDK_PIXBUF headers" >&5
     d=$with_gdk_pixbuf/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 GDK_PIXBUF libs""... $ac_c" 1>&6
echo "configure:9321: checking for GDK_PIXBUF libs" >&5
     d=$with_gdk_pixbuf/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_gdk_pixbuf_req="yes"
     with_gdk_pixbuf=$with_gdk_pixbuf_req
     ;;

    *)
     echo ""
     echo "error: argument to --with-pixbuf 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_gdk_pixbuf" != yes -a "$with_gdk_pixbuf" != no ; then
  echo "error: must be yes or no: --with-pixbuf=$with_gdk_pixbuf"
  exit 1
fi

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

  if test ! -z "$gnome_dir"; then
    # canonicalize slashes.
    foo=`echo "${gnome_dir}/bin" | sed 's@//*@/@g'`
    gdk_pixbuf_path="$foo:$gdk_pixbuf_path"
  fi

  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
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
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
else
  echo "$ac_t""no" 1>&6
fi

test -n "$gdk_pixbuf_config" && break
done


  # 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

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

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
  fi

  ac_save_gdk_pixbuf_CPPFLAGS="$CPPFLAGS"
  CPPFLAGS="$CPPFLAGS $ac_gdk_pixbuf_config_cflags"

  # check for header 1...
  
  ac_save_CPPFLAGS="$CPPFLAGS"
  if test \! -z "$includedir" ; then 
    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
  have_gdk_pixbuf=yes
else
  echo "$ac_t""no" 1>&6
fi

  CPPFLAGS="$ac_save_CPPFLAGS"

  # if that worked, check for header 2...
  if test "$have_gdk_pixbuf" = yes; then
    have_gdk_pixbuf=no
    
  ac_save_CPPFLAGS="$CPPFLAGS"
  if test \! -z "$includedir" ; then 
    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
  have_gdk_pixbuf=yes
else
  echo "$ac_t""no" 1>&6
fi

  CPPFLAGS="$ac_save_CPPFLAGS"
  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
    # library 1...
    
  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"

  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"
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_gdk_pixbuf=yes
else
  echo "$ac_t""no" 1>&6
true
fi

  CPPFLAGS="$ac_save_CPPFLAGS"
  LDFLAGS="$ac_save_LDFLAGS"
#  LIBS="$ac_save_LIBS"
  
    # library 2...
    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"

  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"
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_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
  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

  fi
fi


###############################################################################
#
#       Check for -ljpeg
#
###############################################################################

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"
else
  with_jpeg=yes
fi



   case "$with_jpeg" in
    yes) ;;
    no)  ;;

    /*)
     echo $ac_n "checking for JPEG headers""... $ac_c" 1>&6
echo "configure:9699: checking for JPEG headers" >&5
     d=$with_jpeg/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 JPEG libs""... $ac_c" 1>&6
echo "configure:9709: checking for JPEG libs" >&5
     d=$with_jpeg/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_jpeg_req="yes"
     with_jpeg=$with_jpeg_req
     ;;

    *)
     echo ""
     echo "error: argument to --with-jpeg 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_jpeg" != yes -a "$with_jpeg" != no ; then
  echo "error: must be yes or no: --with-jpeg=$with_jpeg"
  exit 1
fi

if test "$with_jpeg" = yes; then

  have_jpeg=no
  
  ac_save_CPPFLAGS="$CPPFLAGS"
  if test \! -z "$includedir" ; then 
    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
  have_jpeg=yes
else
  echo "$ac_t""no" 1>&6
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
    
  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"

  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
else
  ac_save_LIBS="$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"
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_jpeg=yes
                    jpeg_halfassed=no
                    JPEG_LIBS="-ljpeg"
                    cat >> confdefs.h <<\EOF
#define HAVE_JPEGLIB 1
EOF

else
  echo "$ac_t""no" 1>&6
fi

  CPPFLAGS="$ac_save_CPPFLAGS"
  LDFLAGS="$ac_save_LDFLAGS"
#  LIBS="$ac_save_LIBS"
  
  fi
fi


###############################################################################
#
#       Check for the XSHM server extension.
#
###############################################################################

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"
else
  with_xshm=yes
fi



   case "$with_xshm" in
    yes) ;;
    no)  ;;

    /*)
     echo $ac_n "checking for XSHM headers""... $ac_c" 1>&6
echo "configure:9881: checking for XSHM headers" >&5
     d=$with_xshm/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 XSHM libs""... $ac_c" 1>&6
echo "configure:9891: checking for XSHM libs" >&5
     d=$with_xshm/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_xshm_req="yes"
     with_xshm=$with_xshm_req
     ;;

    *)
     echo ""
     echo "error: argument to --with-xshm-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_xshm" = yes; then

  # first check for Xshm.h.
  
  ac_save_CPPFLAGS="$CPPFLAGS"
  if test \! -z "$includedir" ; then 
    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
  have_xshm=yes
else
  echo "$ac_t""no" 1>&6
fi

  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"
  if test \! -z "$includedir" ; then 
    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
  have_xshm=yes
else
  echo "$ac_t""no" 1>&6
fi

  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"
  if test \! -z "$includedir" ; then 
    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
  have_xshm=yes
else
  echo "$ac_t""no" 1>&6
fi

  CPPFLAGS="$ac_save_CPPFLAGS"
  fi

  # AIX is pathological, as usual: apparently it's normal for the Xshm headers
  # to exist, but the library code to not exist.  And even better, the library
  # code is in its own library: libXextSam.a.  So, if we're on AIX, and that
  # lib doesn't exist, give up.  (This lib gets added to X_EXTRA_LIBS, and
  # that's not quite right, but close enough.)
  #
  case "$host" in
    *-aix*)
      if  `uname -v` -eq 3 ; then
        have_xshm=no
        
  ac_save_CPPFLAGS="$CPPFLAGS"
  ac_save_LDFLAGS="$LDFLAGS"
#  ac_save_LIBS="$LIBS"

  if test \! -z "$includedir" ; then 
    CPPFLAGS="$CPPFLAGS -I$includedir"
  fi
  # note: $X_CFLAGS includes $x_includes
  CPPFLAGS="$CPPFLAGS $X_CFLAGS"

  if test \! -z "$libdir" ; then
    LDFLAGS="$LDFLAGS -L$libdir"
  fi
  # note: $X_LIBS includes $x_libraries
  LDFLAGS="$LDFLAGS $X_LIBS $X_EXTRA_LIBS"

  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
else
  ac_save_LIBS="$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"
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_xshm=yes; X_EXTRA_LIBS="$X_EXTRA_LIBS -lXextSam"
else
  echo "$ac_t""no" 1>&6
true
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
    cat >> confdefs.h <<\EOF
#define HAVE_XSHM_EXTENSION 1
EOF

  fi

elif test "$with_xshm" != no; then
  echo "error: must be yes or no: --with-xshm-ext=$with_xshm"
  exit 1
fi


###############################################################################
#
#       Check for the DOUBLE-BUFFER server extension.
#
###############################################################################

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"
else
  with_xdbe=yes
fi



   case "$with_xdbe" in
    yes) ;;
    no)  ;;

    /*)
     echo $ac_n "checking for DOUBLE-BUFFER headers""... $ac_c" 1>&6
echo "configure:10163: checking for DOUBLE-BUFFER headers" >&5
     d=$with_xdbe/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 DOUBLE-BUFFER libs""... $ac_c" 1>&6
echo "configure:10173: checking for DOUBLE-BUFFER libs" >&5
     d=$with_xdbe/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_xdbe_req="yes"
     with_xdbe=$with_xdbe_req
     ;;

    *)
     echo ""
     echo "error: argument to --with-xdbe-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_xdbe" = 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/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
  have_xdbe=yes
else
  echo "$ac_t""no" 1>&6
fi

  CPPFLAGS="$ac_save_CPPFLAGS"
  if test "$have_xdbe" = yes; then
    cat >> confdefs.h <<\EOF
#define HAVE_DOUBLE_BUFFER_EXTENSION 1
EOF
    
  fi

elif test "$with_xdbe" != no; then
  echo "error: must be yes or no: --with-xdbe-ext=$with_xshm"
  exit 1
fi


###############################################################################
#
#       Check for the SGI XReadDisplay server extension.
#
#       Note: this has to be down here, rather than up with the other server
#       extension tests, so that the output of `configure --help' is in the
#       right order.  Arrgh!
#
###############################################################################

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"
else
  with_readdisplay=yes
fi



   case "$with_readdisplay" in
    yes) ;;
    no)  ;;

    /*)
     echo $ac_n "checking for XReadDisplay headers""... $ac_c" 1>&6
echo "configure:10280: checking for XReadDisplay headers" >&5
     d=$with_readdisplay/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 XReadDisplay libs""... $ac_c" 1>&6
echo "configure:10290: checking for XReadDisplay libs" >&5
     d=$with_readdisplay/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_readdisplay_req="yes"
     with_readdisplay=$with_readdisplay_req
     ;;

    *)
     echo ""
     echo "error: argument to --with-readdisplay 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_readdisplay" = 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/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

else
  echo "$ac_t""no" 1>&6
fi

  CPPFLAGS="$ac_save_CPPFLAGS"
elif test "$with_readdisplay" != no; then
  echo "error: must be yes or no: --with-readdisplay=$with_readdisplay"
  exit 1
fi


###############################################################################
#
#       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.
#
###############################################################################

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


if test "$with_fortune" = no || test "$with_fortune" = yes ; then
  with_fortune=""
  with_fortune_req=""
fi

if test -n "$with_fortune_req" ; then
  ac_cv_fortune_program=""
  case "$with_fortune_req" in
    /*)

      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
  /*)
  ac_cv_path_fortune_tmp="$fortune_tmp" # Let the user override the test with a path.
  ;;
  ?:/*)			 
  ac_cv_path_fortune_tmp="$fortune_tmp" # 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_fortune_tmp="$ac_dir/$ac_word"
      break
    fi
  done
  IFS="$ac_save_ifs"
  ;;
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

      if test -z "$fortune_tmp" ; then
        with_fortune=""
      fi
    ;;
  esac
  ac_cv_fortune_program="$with_fortune"

elif test -n "$ac_cv_fortune_program"; then
  echo "$ac_t""checking for fortune... (cached) $ac_cv_fortune_program" 1>&6
fi

unset ac_cv_path_fortune_tmp
unset fortune_tmp

if test -z "$ac_cv_fortune_program" ; then

  # 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
else
  case "$fortune_tmp" in
  /*)
  ac_cv_path_fortune_tmp="$fortune_tmp" # Let the user override the test with a path.
  ;;
  ?:/*)			 
  ac_cv_path_fortune_tmp="$fortune_tmp" # Let the user override the test with a dos path.
  ;;
  *)
  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"
  ;;
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

test -n "$fortune_tmp" && break
done

  fi

  # if we didn't find anything, then just assume /usr/games/
  if test -z "$fortune_tmp" ; then
     fortune_tmp="/usr/games/fortune"
  fi

  ac_cv_fortune_program="$fortune_tmp"

  # 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

fi

unset ac_cv_path_fortune_tmp
unset fortune_tmp

cat >> confdefs.h <<EOF
#define FORTUNE_PROGRAM "$ac_cv_fortune_program"
EOF



###############################################################################
#
#       Check whether it's ok to install some hacks as setuid (e.g., "sonar")
#       This should be safe, but let's give people the option.
#
###############################################################################

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"
else
  setuid_hacks="$setuid_hacks_default"
fi



   case "$setuid_hacks" in
    yes) ;;
    no)  ;;

    /*)
     echo $ac_n "checking for setuid hacks headers""... $ac_c" 1>&6
echo "configure:10596: checking for setuid hacks headers" >&5
     d=$setuid_hacks/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 setuid hacks libs""... $ac_c" 1>&6
echo "configure:10606: checking for setuid hacks libs" >&5
     d=$setuid_hacks/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".
     setuid_hacks_req="yes"
     setuid_hacks=$setuid_hacks_req
     ;;

    *)
     echo ""
     echo "error: argument to --with-setuid-hacks 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 "$setuid_hacks" = yes; then
  true
elif test "$setuid_hacks" != no; then
  echo "error: must be yes or no: --with-setuid-hacks=$setuid_hacks"
  exit 1
fi


###############################################################################
#
#       Done testing.  Now, set up the various -I and -L variables,
#       and decide which GUI program to build by default.
#
###############################################################################

DEPEND=makedepend
DEPEND_FLAGS=
DEPEND_DEFINES=


if test \! -z "$includedir" ; then 
  INCLUDES="$INCLUDES -I$includedir"
fi

if test \! -z "$libdir" ; then
  LDFLAGS="$LDFLAGS -L$libdir"
fi


PREFERRED_DEMO_PROGRAM=xscreensaver-demo-Xm
ALL_DEMO_PROGRAMS=
if test "$have_motif" = yes; then
  PREFERRED_DEMO_PROGRAM=xscreensaver-demo-Xm
  ALL_DEMO_PROGRAMS="$PREFERRED_DEMO_PROGRAM $ALL_DEMO_PROGRAMS"
fi
if test "$have_gtk" = yes; then
  PREFERRED_DEMO_PROGRAM=xscreensaver-demo-Gtk
  ALL_DEMO_PROGRAMS="$PREFERRED_DEMO_PROGRAM $ALL_DEMO_PROGRAMS"
fi


if test "$have_kerberos" = yes; then
  PASSWD_SRCS="$PASSWD_SRCS \$(KERBEROS_SRCS)"
  PASSWD_OBJS="$PASSWD_OBJS \$(KERBEROS_OBJS)"
fi
if test "$have_pam" = yes; then
  PASSWD_SRCS="$PASSWD_SRCS \$(PAM_SRCS)"
  PASSWD_OBJS="$PASSWD_OBJS \$(PAM_OBJS)"
  INSTALL_PAM="install-pam"
fi
  PASSWD_SRCS="$PASSWD_SRCS \$(PWENT_SRCS)"
  PASSWD_OBJS="$PASSWD_OBJS \$(PWENT_OBJS)"


if test "$enable_locking" = yes; then
  LOCK_SRCS='$(LOCK_SRCS_1) $(PASSWD_SRCS)'
  LOCK_OBJS='$(LOCK_OBJS_1) $(PASSWD_OBJS)'
else
  LOCK_SRCS='$(NOLOCK_SRCS_1)'
  LOCK_OBJS='$(NOLOCK_OBJS_1)'
fi

INSTALL_SETUID='$(INSTALL_PROGRAM) $(SUID_FLAGS)'

if test "$need_setuid" = yes; then
  NEED_SETUID=yes
else
  NEED_SETUID=no
fi

if test "$setuid_hacks" = yes; then
  SETUID_HACKS=yes
else
  SETUID_HACKS=no
fi

tab='	'
if test "$have_gl" = yes; then
  GL_EXES='$(GL_EXES)'
  GL_UTIL_EXES='$(GL_UTIL_EXES)'
  GL_MEN='$(GL_MEN)'
  GL_KLUDGE="${tab}  "
else
  GL_KLUDGE="-${tab}  "
fi

if test "$have_gle" = yes; then
  GLE_EXES='$(GLE_EXES)'
  GLE_MEN='$(GLE_MEN)'
  GLE_KLUDGE="${tab}   "
else
  GLE_KLUDGE="-${tab}   "
fi

if test "$have_jpeg" = yes -a "$have_gdk_pixbuf" = yes; then
 JPEG_EXES='$(JPEG_EXES)'
fi


# Another substitution in the XScreenSaver.ad.in file:
#
if test "$have_gnome_help" = yes; then
  GNOMEHELP_Y=''
  GNOMEHELP_N='!    '
else
  GNOMEHELP_Y='!    '
  GNOMEHELP_N=''
fi


# Now that we know whether we have Gnome, we can decide where the XML
# config files get installed.
#
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
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=''
fi


# canonicalize slashes.
HACK_CONF_DIR=`echo "${HACK_CONF_DIR}" | sed 's@/$@@;s@//*@/@g'`



###############################################################################
#
#       Perform substitutions and write Makefiles.
#
###############################################################################















































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
  else
    echo "not updating unwritable cache $cache_file"
  fi
fi
rm -f confcache

trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15

test "x$prefix" = xNONE && prefix=$ac_default_prefix
# Let make expand exec_prefix.
test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'

# 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.
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

# Without the "./", some shells look in PATH for config.status.
: ${CONFIG_STATUS=./config.status}

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
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 ;;
  esac
done

ac_given_srcdir=$srcdir
ac_given_INSTALL="$INSTALL"

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

# 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

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

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

  # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.

  # 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'`
  else
    ac_dir_suffix= ac_dots=
  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" ;;
  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

  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

  echo creating $ac_file

  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

EOF

# 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

# 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

EOF
cat >> $CONFIG_STATUS <<EOF

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


###############################################################################
#
#       Print some warnings at the end.
#
###############################################################################

warn_prefix_1="    Warning:"
warn_prefix_2="       Note:"
warn_prefix="$warn_prefix_1"

warning=no
warnsep='    #################################################################'

warnpre() {
  if test "$warning" = no ; then
    echo '' ; echo "$warnsep" ; echo ''
    warning=yes
  fi
}

warn() {
  warnpre
  if test "$warning" = long ; then echo '' ; fi
  warning=yes
  rest="$@"
  echo "$warn_prefix $rest"
}

warnL() {
  was=$warning
  warnpre
  warning=yes
  if test "$was" != no ; then echo '' ; fi
  rest="$@"
  echo "$warn_prefix $rest"
}

warn2() {
  rest="$@"
  echo "             $rest"
  warning=long
}

note() {
  warn_prefix="$warn_prefix_2"
  warn $@
  warn_prefix="$warn_prefix_1"
}

noteL() {
  warn_prefix="$warn_prefix_2"
  warnL $@
  warn_prefix="$warn_prefix_1"
}


if test "$with_sgi_req" = yes -a "$have_sgi" = no ; then
  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_xshm_req" = yes -a "$have_xshm" = no ; then
  warn 'The XSHM extension was requested, but was not found.'
fi

if test "$with_xdbe_req" = yes -a "$have_xdbe" = no ; then
  warn 'The DOUBLE-BUFFER extension was requested, but was not found.'
fi

if test "$with_sgivc_req" = yes -a "$have_sgivc" = no ; then
  warn 'The SGI-VIDEO-CONTROL extension was requested, but was not found.'
fi

if test "$with_dpms_req" = yes -a "$have_dpms" = no ; then
  warn 'The DPMS extension was requested, but was not found.'
fi

if test "$with_xinerama_req" = yes -a "$have_xinerama" = no ; then
  warn 'The Xinerama extension was requested, but was not found.'
fi

if test "$with_xf86vmode_req" = yes -a "$have_xf86vmode" = no ; then
  warn 'The XF86VMODE 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 "$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."

elif test "$with_motif_req" = yes -a "$have_motif" = no ; then
  warnL "Use of Motif was requested, but it wasn't found;"
  warn2 "Gtk will be used instead."

elif test "$jurassic_gtk" = yes ; then

  pref_gtk=1.2

  v="$ac_gtk_version_string"
  if test "$with_gtk_req" = yes -a "$ac_gtk_version" = "unknown" ; then
    warnL "Use of Gtk was requested, but its version number is unknown;"
  elif test "$with_gtk_req" = yes ; then
    warnL "Use of Gtk was requested, but it is version $v;"
  else
    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."

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.'
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
fi

if test "$have_motif" = yes -a "$have_lesstif" = yes ; then

  preferred_lesstif=0.92

  if test "$lesstif_version" = unknown; then
    warnL "Unable to determine the LessTif version number!"
    warn2 "Make sure you are using version $preferred_lesstif or newer."
    warn2 "See <http://www.lesstif.org/>."

  elif test \! $lesstif_version -gt 82; then
    warnL "LessTif version $lesstif_version_string is being used."
    warn2 "LessTif versions 0.82 and earlier are too buggy to"
    warn2 "use with XScreenSaver; it is strongly recommended"
    warn2 "that you upgrade to at least version $preferred_lesstif!"
    warn2 "See <http://www.lesstif.org/>."
  fi
fi


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/>.'
fi


if test "$with_xpm_req" = yes -a "$have_xpm" = no; then
  warnL 'Use of XPM was requested, but it was not found.'
fi

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

if test "$have_xpm" = no -a "$have_gdk_pixbuf" = no; then

  if test "$with_xpm_req" = yes ; then
    true
  elif test "$with_xpm_req" = no ; then
    warnL 'The XPM library is not being used.'
  else
    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.'
  fi

  if test "$gdk_pixbuf_halfassed" = yes ; then
    echo ''
    warn2 'More specifically, we found the headers, but not the'
    warn2 'libraries; so either GDK-Pixbuf is half-installed on this'
    warn2 "system, or something else went wrong.  The \`config.log'"
    warn2 'file might contain some clues.'
  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.'
fi


if test "$have_jpeg" = no ; then
  if test "$with_jpeg_req" = yes ; then
    warnL 'Use of libjpeg was requested, but it was not found.'
  elif test "$with_jpeg_req" = no ; then
    noteL 'The JPEG library is not being used.'
  else
    noteL 'The JPEG library was not found.'
  fi

  if test "$jpeg_halfassed" = yes ; then
    echo ''
    warn2 'More specifically, we found the headers, but not the'
    warn2 'library; so either JPEG is half-installed on this'
    warn2 "system, or something else went wrong.  The \`config.log'"
    warn2 'file might contain some clues.'
    echo ''
  fi

  warn2 "This means the \`webcollage' program will be much slower."
fi


if test "$have_gl" = yes -a "$ac_have_mesa_gl" = yes ; then
  preferred_mesagl=3.4
  mgv="$ac_mesagl_version_string"
  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."

  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."

  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."
  fi
fi

if test "$have_gl" = no ; then
  if test "$with_gl_req" = yes ; then
    warnL 'Use of GL was requested, but it was not found.'
  elif test "$with_gl_req" = no ; then
    noteL 'The OpenGL 3D library is not being used.'
  else
    noteL 'The OpenGL 3D library was not found.'
  fi

  if test "$gl_halfassed" = yes ; then
    echo ''
    warn2 'More specifically, we found the headers, but not the'
    warn2 'libraries; so either GL is half-installed on this'
    warn2 "system, or something else went wrong.  The \`config.log'"
    warn2 'file might contain some clues.'
  fi

  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 '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/>.'

fi


if test "$have_gl" = yes -a "$have_gle" = no ; 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'
    warn2 'is being used.)'
  elif test "$with_gle_req" = no ; then
    noteL 'The OpenGL Library is being used, but the GLE (GL Extrusion)'
    warn2 'library is not.'
  else
    noteL 'The OpenGL Library was found, but the GLE (GL Extrusion)'
    warn2 'was not.'
  fi

  if test "$gle_halfassed" = yes ; then
    echo ''
    warn2 'More specifically, we found the headers, but not the'
    warn2 'libraries; so either GLE is half-installed on this'
    warn2 "system, or something else went wrong.  The \`config.log'"
    warn2 'file might contain some clues.'
  fi

  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/>.'

fi


if test "$with_readdisplay_req" = yes -a "$have_readdisplay" = no ; then
  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_pam_req" = yes -a "$have_pam" = no ; then
  warn 'Use of PAM was requested, but it was not found.'
fi

if test "$with_shadow_req" = yes -a "$have_shadow" = no ; then
  warn 'Use of shadow passwords was requested, but they were not found.'
fi


# 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}

# canonicalize slashes.
bindir=`echo  "${bindir}"              | sed 's@/$@@;s@//*@/@g'`
HACKDIR=`echo "${HACKDIR}"             | sed 's@/$@@;s@//*@/@g'`
HACK_CONF_DIR=`echo "${HACK_CONF_DIR}" | sed 's@/$@@;s@//*@/@g'`


# Sanity check the hackdir
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.
                   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; }
  fi
done


do_dir_warning=no

# Now let's see if there's a previous RPM version already installed.  Blargh!

# M4 sucks!!

rpmv=`(rpm -qv xscreensaver) 2>&- | \
      sed -n 's/^xscreensaver-\([0-9][0-9]*[.][0-9][0-9]*\)-.*$/\1/p'`


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'`

  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/."
  fi

  do_dir_warning=yes
fi


if test "${bindir}" = "${HACKDIR}" ; then
  do_dir_warning=yes
fi

if test "$do_dir_warning" = yes; then
  echo ""
  echo "$warnsep"
  echo ""
  echo '      When you run "make install", the "xscreensaver",'
  echo '      "xscreensaver-demo", and "xscreensaver-command" executables'
  echo "      will be installed in ${bindir}/."
  echo ""
  echo "      The various graphics demos (140+ different executables) will"
  echo "      be installed in ${HACKDIR}/."
  echo ""
  echo "      If you would prefer the demos to be installed elsewhere,"
  echo "      you should re-run configure with the --with-hackdir=DIR"
  echo "      option.  For more information, run \`./configure --help'."
  warning=yes
fi

if test "$warning" != no; then
  echo '' ; echo "$warnsep" ; echo ''
fi

if test "$do_dir_warning" = no; then
  if test "$warning" = no; then
    echo ''
  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 ''
fi
