#! /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
  --enable-shared[=PKGS]  build shared libraries [default=yes]"
ac_help="$ac_help
  --enable-static[=PKGS]  build static libraries [default=yes]"
ac_help="$ac_help
  --enable-fast-install[=PKGS]  optimize for fast installation [default=yes]"
ac_help="$ac_help
  --with-gnu-ld           assume the C compiler uses GNU ld [default=no]"
ac_help="$ac_help
  --disable-libtool-lock  avoid locking (might break parallel builds)"
ac_help="$ac_help
  --enable-debug          Disable aggressive optimizations [default=yes]"
ac_help="$ac_help
  --enable-strict-ansi    Enable strict ANSI compliance build [default=no]"
ac_help="$ac_help
  --enable-audio          Enable the audio subsystem [default=yes]"
ac_help="$ac_help
  --enable-video          Enable the video subsystem [default=yes]"
ac_help="$ac_help
  --enable-events         Enable the events subsystem [default=yes]"
ac_help="$ac_help
  --enable-joystick       Enable the joystick subsystem [default=yes]"
ac_help="$ac_help
  --enable-cdrom          Enable the cdrom subsystem [default=yes]"
ac_help="$ac_help
  --enable-threads        Enable the threading subsystem [default=yes]"
ac_help="$ac_help
  --enable-timers         Enable the timer subsystem [default=yes]"
ac_help="$ac_help
  --enable-endian         Enable the endian subsystem [default=yes]"
ac_help="$ac_help
  --enable-file           Enable the file subsystem [default=yes]"
ac_help="$ac_help
  --enable-oss            support the OSS audio API [default=yes]"
ac_help="$ac_help
  --enable-alsa           support the ALSA audio API [default=yes]"
ac_help="$ac_help
  --enable-esd            support the Enlightened Sound Daemon [default=yes]"
ac_help="$ac_help
  --with-esd-prefix=PFX   Prefix where ESD is installed (optional)"
ac_help="$ac_help
  --with-esd-exec-prefix=PFX Exec prefix where ESD is installed (optional)"
ac_help="$ac_help
  --disable-esdtest       Do not try to compile and run a test ESD program"
ac_help="$ac_help
  --enable-esd-shared     dynamically load ESD audio support [default=yes]"
ac_help="$ac_help
  --enable-arts           support the Analog Real Time Synthesizer [default=yes]"
ac_help="$ac_help
  --enable-arts-shared    dynamically load aRts audio support [default=yes]"
ac_help="$ac_help
  --enable-nas            support the NAS audio API [default=yes]"
ac_help="$ac_help
  --enable-diskaudio      support the disk writer audio driver [default=yes]"
ac_help="$ac_help
  --enable-mintaudio      support Atari audio driver [default=yes]"
ac_help="$ac_help
  --enable-nasm           use nasm assembly blitters on x86 [default=yes]"
ac_help="$ac_help
  --enable-video-nanox use nanox video driver [default=no]"
ac_help="$ac_help
  --enable-nanox-debug print debug messages [default=no]"
ac_help="$ac_help
  --enable-nanox-share-memory use share memory [default=no]"
ac_help="$ac_help
  --enable-nanox-direct-fb use direct framebuffer access [default=no]"
ac_help="$ac_help
  --enable-video-x11      use X11 video driver [default=yes]"
ac_help="$ac_help
  --with-x                use the X Window System"
ac_help="$ac_help
  --enable-video-x11-vm   use X11 VM extension for fullscreen [default=yes]"
ac_help="$ac_help
  --enable-dga            allow use of X11 DGA code [default=yes]"
ac_help="$ac_help
  --enable-video-x11-dgamouse  use X11 DGA for mouse events [default=yes]"
ac_help="$ac_help
  --enable-video-x11-xv   use X11 XvImage extension for video [default=yes]"
ac_help="$ac_help
  --enable-video-x11-xinerama   enable X11 Xinerama support [default=yes]"
ac_help="$ac_help
  --enable-video-x11-xme  enable Xi Graphics XME for fullscreen [default=yes]"
ac_help="$ac_help
  --enable-video-dga      use DGA 2.0 video driver [default=yes]"
ac_help="$ac_help
  --enable-video-photon   use QNX Photon video driver [default=yes]"
ac_help="$ac_help
  --enable-video-fbcon    use framebuffer console video driver [default=yes]"
ac_help="$ac_help
  --enable-video-directfb use DirectFB video driver [default=no]"
ac_help="$ac_help
  --enable-video-ps2gs    use PlayStation 2 GS video driver [default=yes]"
ac_help="$ac_help
  --enable-video-ggi      use GGI video driver [default=no]"
ac_help="$ac_help
  --enable-video-svga     use SVGAlib video driver [default=no]"
ac_help="$ac_help
  --enable-video-vgl      use VGL video driver [default=no]"
ac_help="$ac_help
  --enable-video-aalib    use AAlib video driver [default=no]"
ac_help="$ac_help
  --enable-video-xbios    use Atari Xbios video driver [default=yes]"
ac_help="$ac_help
  --enable-video-gem      use Atari Gem video driver [default=yes]"
ac_help="$ac_help
  --enable-video-dummy    use dummy video driver [default=yes]"
ac_help="$ac_help
  --enable-video-opengl   include OpenGL context creation [default=yes]"
ac_help="$ac_help
  --enable-input-events   use Linux 2.4 unified input interface [default=yes]"
ac_help="$ac_help
  --enable-pth            use GNU pth library for multi-threading [default=yes]"
ac_help="$ac_help
  --enable-pthreads       use POSIX threads for multi-threading [default=yes]"
ac_help="$ac_help
  --enable-pthread-sem    use pthread semaphores [default=yes]"
ac_help="$ac_help
  --enable-stdio-redirect Redirect STDIO to files on Win32 [default=yes]"
ac_help="$ac_help
  --enable-directx        use DirectX for Win32 audio/video [default=yes]"
ac_help="$ac_help
  --enable-video-qtopia   use Qtopia video driver [default=no]"
ac_help="$ac_help
  --enable-video-picogui  use PicoGUI video driver [default=no]"
ac_help="$ac_help
  --enable-dlopen         use dlopen for shared object loading [default=no]"
ac_help="$ac_help
  --enable-atari-ldg      use Atari LDG for shared object loading [default=yes]"

# 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]
  --sbindir=DIR           system admin executables in DIR [EPREFIX/sbin]
  --libexecdir=DIR        program executables in DIR [EPREFIX/libexec]
  --datadir=DIR           read-only architecture-independent data in DIR
                          [PREFIX/share]
  --sysconfdir=DIR        read-only single-machine data in DIR [PREFIX/etc]
  --sharedstatedir=DIR    modifiable architecture-independent data in DIR
                          [PREFIX/com]
  --localstatedir=DIR     modifiable single-machine data in DIR [PREFIX/var]
  --libdir=DIR            object code libraries in DIR [EPREFIX/lib]
  --includedir=DIR        C header files in DIR [PREFIX/include]
  --oldincludedir=DIR     C header files for non-gcc in DIR [/usr/include]
  --infodir=DIR           info documentation in DIR [PREFIX/info]
  --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]
Features and packages:
  --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
  --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
  --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
  --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
  --x-includes=DIR        X include files are in DIR
  --x-libraries=DIR       X library files are in DIR
EOF
    if test -n "$ac_help"; then
      echo "--enable and --with options recognized:$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=README

# 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



#
# Making releases:
# Edit include/SDL/SDL_version.h and change the version, then:
#   SDL_MICRO_VERSION += 1;
#   SDL_INTERFACE_AGE += 1;
#   SDL_BINARY_AGE += 1;
# if any functions have been added, set SDL_INTERFACE_AGE to 0.
# if backwards compatibility has been broken,
# set SDL_BINARY_AGE and SDL_INTERFACE_AGE to 0.
#
SDL_MAJOR_VERSION=1
SDL_MINOR_VERSION=2
SDL_MICRO_VERSION=6
SDL_INTERFACE_AGE=6
SDL_BINARY_AGE=6
SDL_VERSION=$SDL_MAJOR_VERSION.$SDL_MINOR_VERSION.$SDL_MICRO_VERSION








# libtool versioning
LT_RELEASE=$SDL_MAJOR_VERSION.$SDL_MINOR_VERSION
LT_CURRENT=`expr $SDL_MICRO_VERSION - $SDL_INTERFACE_AGE`
LT_REVISION=$SDL_INTERFACE_AGE
LT_AGE=`expr $SDL_BINARY_AGE - $SDL_INTERFACE_AGE`






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.


# Do some error checking and defaulting for the host and target type.
# The inputs are:
#    configure --host=HOST --target=TARGET --build=BUILD NONOPT
#
# The rules are:
# 1. You are not allowed to specify --host, --target, and nonopt at the
#    same time.
# 2. Host defaults to nonopt.
# 3. If nonopt is not specified, then host defaults to the current host,
#    as determined by config.guess.
# 4. Target and build default to nonopt.
# 5. If nonopt is not specified, then target and build default to host.

# The aliases save the names the user supplied, while $host etc.
# will get canonicalized.
case $host---$target---$nonopt in
NONE---*---* | *---NONE---* | *---*---NONE) ;;
*) { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } ;;
esac


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

echo $ac_n "checking target system type""... $ac_c" 1>&6
echo "configure:757: checking target system type" >&5

target_alias=$target
case "$target_alias" in
NONE)
  case $nonopt in
  NONE) target_alias=$host_alias ;;
  *) target_alias=$nonopt ;;
  esac ;;
esac

target=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $target_alias`
target_cpu=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
target_vendor=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
target_os=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
echo "$ac_t""$target" 1>&6

echo $ac_n "checking build system type""... $ac_c" 1>&6
echo "configure:775: checking build system type" >&5

build_alias=$build
case "$build_alias" in
NONE)
  case $nonopt in
  NONE) build_alias=$host_alias ;;
  *) build_alias=$nonopt ;;
  esac ;;
esac

build=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $build_alias`
build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
echo "$ac_t""$build" 1>&6

test "$host_alias" != "$target_alias" &&
  test "$program_prefix$program_suffix$program_transform_name" = \
    NONENONEs,x,x, &&
  program_prefix=${target_alias}-


# 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:810: 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 build environment is sane""... $ac_c" 1>&6
echo "configure:863: checking whether build environment is sane" >&5
# Just in case
sleep 1
echo timestamp > conftestfile
# Do `set' in a subshell so we don't clobber the current shell's
# arguments.  Must try -L first in case configure is actually a
# symlink; some systems play weird games with the mod time of symlinks
# (eg FreeBSD returns the mod time of the symlink's containing
# directory).
if (
   set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
   if test "$*" = "X"; then
      # -L didn't work.
      set X `ls -t $srcdir/configure conftestfile`
   fi
   if test "$*" != "X $srcdir/configure conftestfile" \
      && test "$*" != "X conftestfile $srcdir/configure"; then

      # If neither matched, then we have a broken ls.  This can happen
      # if, for instance, CONFIG_SHELL is bash and it inherits a
      # broken ls alias from the environment.  This has actually
      # happened.  Such a system could not be considered "sane".
      { echo "configure: error: ls -t appears to fail.  Make sure there is not a broken
alias in your environment" 1>&2; exit 1; }
   fi

   test "$2" = conftestfile
   )
then
   # Ok.
   :
else
   { echo "configure: error: newly created file is older than distributed files!
Check your system clock" 1>&2; exit 1; }
fi
rm -f conftest*
echo "$ac_t""yes" 1>&6
if test "$program_transform_name" = s,x,x,; then
  program_transform_name=
else
  # Double any \ or $.  echo might interpret backslashes.
  cat <<\EOF_SED > conftestsed
s,\\,\\\\,g; s,\$,$$,g
EOF_SED
  program_transform_name="`echo $program_transform_name|sed -f conftestsed`"
  rm -f conftestsed
fi
test "$program_prefix" != NONE &&
  program_transform_name="s,^,${program_prefix},; $program_transform_name"
# Use a double $ so make ignores it.
test "$program_suffix" != NONE &&
  program_transform_name="s,\$\$,${program_suffix},; $program_transform_name"

# sed with no file args requires a program.
test "$program_transform_name" = "" && program_transform_name="s,x,x,"

echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
echo "configure:920: 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



PACKAGE=SDL

VERSION=$SDL_VERSION

if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
  { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; }
fi
cat >> confdefs.h <<EOF
#define PACKAGE "$PACKAGE"
EOF

cat >> confdefs.h <<EOF
#define VERSION "$VERSION"
EOF



missing_dir=`cd $ac_aux_dir && pwd`
echo $ac_n "checking for working aclocal""... $ac_c" 1>&6
echo "configure:967: checking for working aclocal" >&5
# Run test in a subshell; some versions of sh will print an error if
# an executable is not found, even if stderr is redirected.
# Redirect stdin to placate older versions of autoconf.  Sigh.
if (aclocal --version) < /dev/null > /dev/null 2>&1; then
   ACLOCAL=aclocal
   echo "$ac_t""found" 1>&6
else
   ACLOCAL="$missing_dir/missing aclocal"
   echo "$ac_t""missing" 1>&6
fi

echo $ac_n "checking for working autoconf""... $ac_c" 1>&6
echo "configure:980: checking for working autoconf" >&5
# Run test in a subshell; some versions of sh will print an error if
# an executable is not found, even if stderr is redirected.
# Redirect stdin to placate older versions of autoconf.  Sigh.
if (autoconf --version) < /dev/null > /dev/null 2>&1; then
   AUTOCONF=autoconf
   echo "$ac_t""found" 1>&6
else
   AUTOCONF="$missing_dir/missing autoconf"
   echo "$ac_t""missing" 1>&6
fi

echo $ac_n "checking for working automake""... $ac_c" 1>&6
echo "configure:993: checking for working automake" >&5
# Run test in a subshell; some versions of sh will print an error if
# an executable is not found, even if stderr is redirected.
# Redirect stdin to placate older versions of autoconf.  Sigh.
if (automake --version) < /dev/null > /dev/null 2>&1; then
   AUTOMAKE=automake
   echo "$ac_t""found" 1>&6
else
   AUTOMAKE="$missing_dir/missing automake"
   echo "$ac_t""missing" 1>&6
fi

echo $ac_n "checking for working autoheader""... $ac_c" 1>&6
echo "configure:1006: checking for working autoheader" >&5
# Run test in a subshell; some versions of sh will print an error if
# an executable is not found, even if stderr is redirected.
# Redirect stdin to placate older versions of autoconf.  Sigh.
if (autoheader --version) < /dev/null > /dev/null 2>&1; then
   AUTOHEADER=autoheader
   echo "$ac_t""found" 1>&6
else
   AUTOHEADER="$missing_dir/missing autoheader"
   echo "$ac_t""missing" 1>&6
fi

echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6
echo "configure:1019: checking for working makeinfo" >&5
# Run test in a subshell; some versions of sh will print an error if
# an executable is not found, even if stderr is redirected.
# Redirect stdin to placate older versions of autoconf.  Sigh.
if (makeinfo --version) < /dev/null > /dev/null 2>&1; then
   MAKEINFO=makeinfo
   echo "$ac_t""found" 1>&6
else
   MAKEINFO="$missing_dir/missing makeinfo"
   echo "$ac_t""missing" 1>&6
fi





# Check whether --enable-shared or --disable-shared was given.
if test "${enable_shared+set}" = set; then
  enableval="$enable_shared"
  p=${PACKAGE-default}
case "$enableval" in
yes) enable_shared=yes ;;
no) enable_shared=no ;;
*)
  enable_shared=no
  # Look at the argument we got.  We use all the common list separators.
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
  for pkg in $enableval; do
    if test "X$pkg" = "X$p"; then
      enable_shared=yes
    fi
  done
  IFS="$ac_save_ifs"
  ;;
esac
else
  enable_shared=yes
fi

# Check whether --enable-static or --disable-static was given.
if test "${enable_static+set}" = set; then
  enableval="$enable_static"
  p=${PACKAGE-default}
case "$enableval" in
yes) enable_static=yes ;;
no) enable_static=no ;;
*)
  enable_static=no
  # Look at the argument we got.  We use all the common list separators.
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
  for pkg in $enableval; do
    if test "X$pkg" = "X$p"; then
      enable_static=yes
    fi
  done
  IFS="$ac_save_ifs"
  ;;
esac
else
  enable_static=yes
fi

# Check whether --enable-fast-install or --disable-fast-install was given.
if test "${enable_fast_install+set}" = set; then
  enableval="$enable_fast_install"
  p=${PACKAGE-default}
case "$enableval" in
yes) enable_fast_install=yes ;;
no) enable_fast_install=no ;;
*)
  enable_fast_install=no
  # Look at the argument we got.  We use all the common list separators.
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
  for pkg in $enableval; do
    if test "X$pkg" = "X$p"; then
      enable_fast_install=yes
    fi
  done
  IFS="$ac_save_ifs"
  ;;
esac
else
  enable_fast_install=yes
fi

# Extract the first word of "ranlib", so it can be a program name with args.
set dummy ranlib; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:1107: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test -n "$RANLIB"; then
  ac_cv_prog_RANLIB="$RANLIB" # 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_RANLIB="ranlib"
      break
    fi
  done
  IFS="$ac_save_ifs"
  test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
fi
fi
RANLIB="$ac_cv_prog_RANLIB"
if test -n "$RANLIB"; then
  echo "$ac_t""$RANLIB" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

# 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:1137: 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:1167: 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:1218: 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:1250: 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 1261 "configure"
#include "confdefs.h"

main(){return(0);}
EOF
if { (eval echo configure:1266: \"$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:1292: 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:1297: 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:1306: \"$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:1325: 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

# Check whether --with-gnu-ld or --without-gnu-ld was given.
if test "${with_gnu_ld+set}" = set; then
  withval="$with_gnu_ld"
  test "$withval" = no || with_gnu_ld=yes
else
  with_gnu_ld=no
fi

ac_prog=ld
if test "$ac_cv_prog_gcc" = yes; then
  # Check if gcc -print-prog-name=ld gives a path.
  echo $ac_n "checking for ld used by GCC""... $ac_c" 1>&6
echo "configure:1368: checking for ld used by GCC" >&5
  DELCR='tr -d \015'
  ac_prog=`($CC -print-prog-name=ld | $DELCR) 2>&5`
  case "$ac_prog" in
    # Accept absolute paths.
    [\\/]* | [A-Za-z]:[\\/]*)
      re_direlt='/[^/][^/]*/\.\./'
      # Canonicalize the path of ld
      ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
      while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
	ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
      done
      test -z "$LD" && LD="$ac_prog"
      ;;
  "")
    # If it fails, then pretend we aren't using GCC.
    ac_prog=ld
    ;;
  *)
    # If it is relative, then search for the first ld in PATH.
    with_gnu_ld=unknown
    ;;
  esac
elif test "$with_gnu_ld" = yes; then
  echo $ac_n "checking for GNU ld""... $ac_c" 1>&6
echo "configure:1393: checking for GNU ld" >&5
else
  echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6
echo "configure:1396: checking for non-GNU ld" >&5
fi
if eval "test \"`echo '$''{'ac_cv_path_LD'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test -z "$LD"; then
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
  for ac_dir in $PATH; do
    test -z "$ac_dir" && ac_dir=.
    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
      ac_cv_path_LD="$ac_dir/$ac_prog"
      # Check to see if the program is GNU ld.  I'd rather use --version,
      # but apparently some GNU ld's only accept -v.
      # Break only if it was the GNU/non-GNU ld that we prefer.
      if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
	test "$with_gnu_ld" != no && break
      else
	test "$with_gnu_ld" != yes && break
      fi
    fi
  done
  IFS="$ac_save_ifs"
else
  ac_cv_path_LD="$LD" # Let the user override the test with a path.
fi
fi

LD="$ac_cv_path_LD"
if test -n "$LD"; then
  echo "$ac_t""$LD" 1>&6
else
  echo "$ac_t""no" 1>&6
fi
test -z "$LD" && { echo "configure: error: no acceptable ld found in \$PATH" 1>&2; exit 1; }
echo $ac_n "checking if the linker ($LD) is GNU ld""... $ac_c" 1>&6
echo "configure:1431: checking if the linker ($LD) is GNU ld" >&5
if eval "test \"`echo '$''{'ac_cv_prog_gnu_ld'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  # I'd rather use --version here, but apparently some GNU ld's only accept -v.
if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
  ac_cv_prog_gnu_ld=yes
else
  ac_cv_prog_gnu_ld=no
fi
fi

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


echo $ac_n "checking for BSD-compatible nm""... $ac_c" 1>&6
echo "configure:1447: checking for BSD-compatible nm" >&5
if eval "test \"`echo '$''{'ac_cv_path_NM'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test -n "$NM"; then
  # Let the user override the test.
  ac_cv_path_NM="$NM"
else
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
  for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/nm || test -f $ac_dir/nm$ac_exeext ; then
      # Check to see if the nm accepts a BSD-compat flag.
      # Adding the `sed 1q' prevents false positives on HP-UX, which says:
      #   nm: unknown option "B" ignored
      if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
	ac_cv_path_NM="$ac_dir/nm -B"
	break
      elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
	ac_cv_path_NM="$ac_dir/nm -p"
	break
      else
	ac_cv_path_NM=${ac_cv_path_NM="$ac_dir/nm"} # keep the first match, but
	continue # so that we can try to find one that supports BSD flags
      fi
    fi
  done
  IFS="$ac_save_ifs"
  test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
fi
fi

NM="$ac_cv_path_NM"
echo "$ac_t""$NM" 1>&6

echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
echo "configure:1483: checking whether ln -s works" >&5
if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  rm -f conftestdata
if ln -s X conftestdata 2>/dev/null
then
  rm -f conftestdata
  ac_cv_prog_LN_S="ln -s"
else
  ac_cv_prog_LN_S=ln
fi
fi
LN_S="$ac_cv_prog_LN_S"
if test "$ac_cv_prog_LN_S" = "ln -s"; then
  echo "$ac_t""yes" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

if test $host != $build; then
  ac_tool_prefix=${host_alias}-
else
  ac_tool_prefix=
fi


case "$target" in
NONE) lt_target="$host" ;;
*) lt_target="$target" ;;
esac

# Check for any special flags to pass to ltconfig.
libtool_flags="--cache-file=$cache_file"
test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install"
test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"

libtool_flags="$libtool_flags --enable-win32-dll"
# Check whether --enable-libtool-lock or --disable-libtool-lock was given.
if test "${enable_libtool_lock+set}" = set; then
  enableval="$enable_libtool_lock"
  :
fi

test "x$enable_libtool_lock" = xno && libtool_flags="$libtool_flags --disable-lock"
test x"$silent" = xyes && libtool_flags="$libtool_flags --silent"

# Some flags need to be propagated to the compiler or linker for good
# libtool support.
case "$lt_target" in
*-*-irix6*)
  # Find out which ABI we are using.
  echo '#line 1538 "configure"' > conftest.$ac_ext
  if { (eval echo configure:1539: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
    case "`/usr/bin/file conftest.o`" in
    *32-bit*)
      LD="${LD-ld} -32"
      ;;
    *N32*)
      LD="${LD-ld} -n32"
      ;;
    *64-bit*)
      LD="${LD-ld} -64"
      ;;
    esac
  fi
  rm -rf conftest*
  ;;

*-*-sco3.2v5*)
  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
  SAVE_CFLAGS="$CFLAGS"
  CFLAGS="$CFLAGS -belf"
  echo $ac_n "checking whether the C compiler needs -belf""... $ac_c" 1>&6
echo "configure:1560: checking whether the C compiler needs -belf" >&5
if eval "test \"`echo '$''{'lt_cv_cc_needs_belf'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 1565 "configure"
#include "confdefs.h"

int main() {

; return 0; }
EOF
if { (eval echo configure:1572: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  lt_cv_cc_needs_belf=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  lt_cv_cc_needs_belf=no
fi
rm -f conftest*
fi

echo "$ac_t""$lt_cv_cc_needs_belf" 1>&6
  if test x"$lt_cv_cc_needs_belf" != x"yes"; then
    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
    CFLAGS="$SAVE_CFLAGS"
  fi
  ;;

*-*-cygwin* | *-*-mingw*)
  # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args.
set dummy ${ac_tool_prefix}dlltool; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:1595: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_DLLTOOL'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test -n "$DLLTOOL"; then
  ac_cv_prog_DLLTOOL="$DLLTOOL" # 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_DLLTOOL="${ac_tool_prefix}dlltool"
      break
    fi
  done
  IFS="$ac_save_ifs"
fi
fi
DLLTOOL="$ac_cv_prog_DLLTOOL"
if test -n "$DLLTOOL"; then
  echo "$ac_t""$DLLTOOL" 1>&6
else
  echo "$ac_t""no" 1>&6
fi


if test -z "$ac_cv_prog_DLLTOOL"; then
if test -n "$ac_tool_prefix"; then
  # Extract the first word of "dlltool", so it can be a program name with args.
set dummy dlltool; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:1627: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_DLLTOOL'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test -n "$DLLTOOL"; then
  ac_cv_prog_DLLTOOL="$DLLTOOL" # 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_DLLTOOL="dlltool"
      break
    fi
  done
  IFS="$ac_save_ifs"
  test -z "$ac_cv_prog_DLLTOOL" && ac_cv_prog_DLLTOOL="false"
fi
fi
DLLTOOL="$ac_cv_prog_DLLTOOL"
if test -n "$DLLTOOL"; then
  echo "$ac_t""$DLLTOOL" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

else
  DLLTOOL="false"
fi
fi

  # Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args.
set dummy ${ac_tool_prefix}as; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:1662: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_AS'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test -n "$AS"; then
  ac_cv_prog_AS="$AS" # 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_AS="${ac_tool_prefix}as"
      break
    fi
  done
  IFS="$ac_save_ifs"
fi
fi
AS="$ac_cv_prog_AS"
if test -n "$AS"; then
  echo "$ac_t""$AS" 1>&6
else
  echo "$ac_t""no" 1>&6
fi


if test -z "$ac_cv_prog_AS"; then
if test -n "$ac_tool_prefix"; then
  # Extract the first word of "as", so it can be a program name with args.
set dummy as; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:1694: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_AS'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test -n "$AS"; then
  ac_cv_prog_AS="$AS" # 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_AS="as"
      break
    fi
  done
  IFS="$ac_save_ifs"
  test -z "$ac_cv_prog_AS" && ac_cv_prog_AS="false"
fi
fi
AS="$ac_cv_prog_AS"
if test -n "$AS"; then
  echo "$ac_t""$AS" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

else
  AS="false"
fi
fi

  # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args.
set dummy ${ac_tool_prefix}objdump; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:1729: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_OBJDUMP'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test -n "$OBJDUMP"; then
  ac_cv_prog_OBJDUMP="$OBJDUMP" # 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_OBJDUMP="${ac_tool_prefix}objdump"
      break
    fi
  done
  IFS="$ac_save_ifs"
fi
fi
OBJDUMP="$ac_cv_prog_OBJDUMP"
if test -n "$OBJDUMP"; then
  echo "$ac_t""$OBJDUMP" 1>&6
else
  echo "$ac_t""no" 1>&6
fi


if test -z "$ac_cv_prog_OBJDUMP"; then
if test -n "$ac_tool_prefix"; then
  # Extract the first word of "objdump", so it can be a program name with args.
set dummy objdump; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:1761: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_OBJDUMP'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test -n "$OBJDUMP"; then
  ac_cv_prog_OBJDUMP="$OBJDUMP" # 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_OBJDUMP="objdump"
      break
    fi
  done
  IFS="$ac_save_ifs"
  test -z "$ac_cv_prog_OBJDUMP" && ac_cv_prog_OBJDUMP="false"
fi
fi
OBJDUMP="$ac_cv_prog_OBJDUMP"
if test -n "$OBJDUMP"; then
  echo "$ac_t""$OBJDUMP" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

else
  OBJDUMP="false"
fi
fi

  ;;

esac


# Save cache, so that ltconfig can load it
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


# Actually configure libtool.  ac_aux_dir is where install-sh is found.
CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" \
DLLTOOL="$DLLTOOL" AS="$AS" OBJDUMP="$OBJDUMP" \
${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \
$libtool_flags --no-verify $ac_aux_dir/ltmain.sh $lt_target \
|| { echo "configure: error: libtool configure failed" 1>&2; exit 1; }

# Reload cache, that may have been modified by ltconfig
if test -r "$cache_file"; then
  echo "loading cache $cache_file"
  . $cache_file
else
  echo "creating cache $cache_file"
  > $cache_file
fi


# This can be used to rebuild libtool when needed
LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh"

# Always use our own libtool.
LIBTOOL='$(SHELL) $(top_builddir)/libtool'

# Redirect the config.log output again, so that the ltconfig log is not
# clobbered by the next message.
exec 5>>./config.log

echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
echo "configure:1877: 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

# 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:1906: 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:1936: 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:1987: 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:2019: 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 2030 "configure"
#include "confdefs.h"

main(){return(0);}
EOF
if { (eval echo configure:2035: \"$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:2061: 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:2066: 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:2075: \"$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:2094: 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

echo $ac_n "checking for inline""... $ac_c" 1>&6
echo "configure:2126: 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 2133 "configure"
#include "confdefs.h"

int main() {
} $ac_kw foo() {
; return 0; }
EOF
if { (eval echo configure:2140: \"$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 working const""... $ac_c" 1>&6
echo "configure:2166: 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 2171 "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:2220: \"$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

for ac_prog in $CCC c++ g++ gcc CC cxx cc++ cl
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:2245: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CXX'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test -n "$CXX"; then
  ac_cv_prog_CXX="$CXX" # 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_CXX="$ac_prog"
      break
    fi
  done
  IFS="$ac_save_ifs"
fi
fi
CXX="$ac_cv_prog_CXX"
if test -n "$CXX"; then
  echo "$ac_t""$CXX" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

test -n "$CXX" && break
done
test -n "$CXX" || CXX="gcc"


echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works""... $ac_c" 1>&6
echo "configure:2277: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works" >&5

ac_ext=C
# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CXXCPP $CPPFLAGS'
ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cxx_cross

cat > conftest.$ac_ext << EOF

#line 2288 "configure"
#include "confdefs.h"

int main(){return(0);}
EOF
if { (eval echo configure:2293: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  ac_cv_prog_cxx_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_cxx_cross=no
  else
    ac_cv_prog_cxx_cross=yes
  fi
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  ac_cv_prog_cxx_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_cxx_works" 1>&6
if test $ac_cv_prog_cxx_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 ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
echo "configure:2319: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler" >&5
echo "$ac_t""$ac_cv_prog_cxx_cross" 1>&6
cross_compiling=$ac_cv_prog_cxx_cross

echo $ac_n "checking whether we are using GNU C++""... $ac_c" 1>&6
echo "configure:2324: checking whether we are using GNU C++" >&5
if eval "test \"`echo '$''{'ac_cv_prog_gxx'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.C <<EOF
#ifdef __GNUC__
  yes;
#endif
EOF
if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:2333: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
  ac_cv_prog_gxx=yes
else
  ac_cv_prog_gxx=no
fi
fi

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

if test $ac_cv_prog_gxx = yes; then
  GXX=yes
else
  GXX=
fi

ac_test_CXXFLAGS="${CXXFLAGS+set}"
ac_save_CXXFLAGS="$CXXFLAGS"
CXXFLAGS=
echo $ac_n "checking whether ${CXX-g++} accepts -g""... $ac_c" 1>&6
echo "configure:2352: checking whether ${CXX-g++} accepts -g" >&5
if eval "test \"`echo '$''{'ac_cv_prog_cxx_g'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  echo 'void f(){}' > conftest.cc
if test -z "`${CXX-g++} -g -c conftest.cc 2>&1`"; then
  ac_cv_prog_cxx_g=yes
else
  ac_cv_prog_cxx_g=no
fi
rm -f conftest*

fi

echo "$ac_t""$ac_cv_prog_cxx_g" 1>&6
if test "$ac_test_CXXFLAGS" = set; then
  CXXFLAGS="$ac_save_CXXFLAGS"
elif test $ac_cv_prog_cxx_g = yes; then
  if test "$GXX" = yes; then
    CXXFLAGS="-g -O2"
  else
    CXXFLAGS="-g"
  fi
else
  if test "$GXX" = yes; then
    CXXFLAGS="-O2"
  else
    CXXFLAGS=
  fi
fi

# 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:2395: 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 how to run the C preprocessor""... $ac_c" 1>&6
echo "configure:2448: 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 2463 "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:2469: \"$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 2480 "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:2486: \"$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 2497 "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:2503: \"$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

# The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
# for constant arguments.  Useless!
echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6
echo "configure:2530: checking for working alloca.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 2535 "configure"
#include "confdefs.h"
#include <alloca.h>
int main() {
char *p = alloca(2 * sizeof(int));
; return 0; }
EOF
if { (eval echo configure:2542: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  ac_cv_header_alloca_h=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  ac_cv_header_alloca_h=no
fi
rm -f conftest*
fi

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

fi

echo $ac_n "checking for alloca""... $ac_c" 1>&6
echo "configure:2563: checking for alloca" >&5
if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 2568 "configure"
#include "confdefs.h"

#ifdef __GNUC__
# define alloca __builtin_alloca
#else
# ifdef _MSC_VER
#  include <malloc.h>
#  define alloca _alloca
# else
#  if HAVE_ALLOCA_H
#   include <alloca.h>
#  else
#   ifdef _AIX
 #pragma alloca
#   else
#    ifndef alloca /* predefined by HP cc +Olibcalls */
char *alloca ();
#    endif
#   endif
#  endif
# endif
#endif

int main() {
char *p = (char *) alloca(1);
; return 0; }
EOF
if { (eval echo configure:2596: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  ac_cv_func_alloca_works=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  ac_cv_func_alloca_works=no
fi
rm -f conftest*
fi

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

fi

if test $ac_cv_func_alloca_works = no; then
  # The SVR3 libPW and SVR4 libucb both contain incompatible functions
  # that cause trouble.  Some versions do not even contain alloca or
  # contain a buggy version.  If you still want to use their alloca,
  # use ar to extract alloca.o from them instead of compiling alloca.c.
  ALLOCA=alloca.${ac_objext}
  cat >> confdefs.h <<\EOF
#define C_ALLOCA 1
EOF


echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6
echo "configure:2628: checking whether alloca needs Cray hooks" >&5
if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 2633 "configure"
#include "confdefs.h"
#if defined(CRAY) && ! defined(CRAY2)
webecray
#else
wenotbecray
#endif

EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  egrep "webecray" >/dev/null 2>&1; then
  rm -rf conftest*
  ac_cv_os_cray=yes
else
  rm -rf conftest*
  ac_cv_os_cray=no
fi
rm -f conftest*

fi

echo "$ac_t""$ac_cv_os_cray" 1>&6
if test $ac_cv_os_cray = yes; then
for ac_func in _getb67 GETB67 getb67; do
  echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:2658: 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 2663 "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:2686: \"$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
  cat >> confdefs.h <<EOF
#define CRAY_STACKSEG_END $ac_func
EOF

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

done
fi

echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6
echo "configure:2713: checking stack direction for C alloca" >&5
if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test "$cross_compiling" = yes; then
  ac_cv_c_stack_direction=0
else
  cat > conftest.$ac_ext <<EOF
#line 2721 "configure"
#include "confdefs.h"
find_stack_direction ()
{
  static char *addr = 0;
  auto char dummy;
  if (addr == 0)
    {
      addr = &dummy;
      return find_stack_direction ();
    }
  else
    return (&dummy > addr) ? 1 : -1;
}
main ()
{
  exit (find_stack_direction() < 0);
}
EOF
if { (eval echo configure:2740: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
  ac_cv_c_stack_direction=1
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -fr conftest*
  ac_cv_c_stack_direction=-1
fi
rm -fr conftest*
fi

fi

echo "$ac_t""$ac_cv_c_stack_direction" 1>&6
cat >> confdefs.h <<EOF
#define STACK_DIRECTION $ac_cv_c_stack_direction
EOF

fi

ASFLAGS=""

CCAS="$CC"

CCASFLAGS=""



if false; then
  am__fastdepOBJC_TRUE=
  am__fastdepOBJC_FALSE='#'
else
  am__fastdepOBJC_TRUE='#'
  am__fastdepOBJC_FALSE=
fi

case "$target" in
    alpha*-*-linux*)
        if test x$ac_cv_prog_gcc = xyes; then
            CFLAGS="$CFLAGS -mcpu=ev4 -Wa,-mall"
        fi
        ;;
esac


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

if test x$enable_debug != xyes; then
    if test x$ac_cv_prog_gcc = xyes; then
        CFLAGS="$CFLAGS -fexpensive-optimizations"
        # Ack! This breaks the MMX YV12 conversion on gcc 2.95.2
        # CFLAGS="$CFLAGS -fomit-frame-pointer"
    fi
    case "$target" in
        i486-*-*)
            if test x$ac_cv_prog_gcc = xyes; then
                CFLAGS="$CFLAGS -march=486"
            fi
            ;;
        i?86-*-*)
            if test x$ac_cv_prog_gcc = xyes; then
                CFLAGS="$CFLAGS -march=pentium -mcpu=pentiumpro"
            fi
            ;;
        *-*-osf*)
            if test x$ac_cv_prog_gcc != xyes; then
                CFLAGS="-g3 -fast -arch host"
            fi
            ;;
    esac
fi

# Check whether --enable-strict-ansi or --disable-strict-ansi was given.
if test "${enable_strict_ansi+set}" = set; then
  enableval="$enable_strict_ansi"
  :
else
  enable_strict_ansi=no
fi

if test x$ac_cv_prog_gcc = xyes; then
    CFLAGS="$CFLAGS -Wall"
    if test x$enable_strict_ansi = xyes; then
        CFLAGS="$CFLAGS -ansi -pedantic -D_XOPEN_SOURCE"
    fi
fi


SDL_CFLAGS=""
SDL_LIBS="-lSDL"


case "$target" in
    *-*-cygwin* | *-*-mingw32*)
        MATHLIB=""
        ;;
    *-*-beos*)
        MATHLIB=""
        ;;
    *-*-darwin*)
        MATHLIB=""
        ;;
    *)
        MATHLIB="-lm"
        ;;
esac
SYSTEM_LIBS="$SYSTEM_LIBS $MATHLIB"


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

if test x$enable_audio = xyes; then
    SDL_EXTRADIRS="$SDL_EXTRADIRS audio"
    SDL_EXTRALIBS="$SDL_EXTRALIBS audio/libaudio.la"
else
    CFLAGS="$CFLAGS -DDISABLE_AUDIO"
fi
# Check whether --enable-video or --disable-video was given.
if test "${enable_video+set}" = set; then
  enableval="$enable_video"
  :
else
  enable_video=yes
fi

if test x$enable_video = xyes; then
    SDL_EXTRADIRS="$SDL_EXTRADIRS video"
    SDL_EXTRALIBS="$SDL_EXTRALIBS video/libvideo.la"
else
    CFLAGS="$CFLAGS -DDISABLE_VIDEO"
fi
# Check whether --enable-events or --disable-events was given.
if test "${enable_events+set}" = set; then
  enableval="$enable_events"
  :
else
  enable_events=yes
fi

if test x$enable_video = xyes -a x$enable_events = xyes; then
    SDL_EXTRADIRS="$SDL_EXTRADIRS events"
    SDL_EXTRALIBS="$SDL_EXTRALIBS events/libevents.la"
else
    CFLAGS="$CFLAGS -DDISABLE_EVENTS"
fi
# Check whether --enable-joystick or --disable-joystick was given.
if test "${enable_joystick+set}" = set; then
  enableval="$enable_joystick"
  :
else
  enable_joystick=yes
fi

if test x$enable_joystick = xyes; then
    SDL_EXTRADIRS="$SDL_EXTRADIRS joystick"
    SDL_EXTRALIBS="$SDL_EXTRALIBS joystick/libjoystick.la"
else
    CFLAGS="$CFLAGS -DDISABLE_JOYSTICK"
fi
# Check whether --enable-cdrom or --disable-cdrom was given.
if test "${enable_cdrom+set}" = set; then
  enableval="$enable_cdrom"
  :
else
  enable_cdrom=yes
fi

if test x$enable_cdrom = xyes; then
    SDL_EXTRADIRS="$SDL_EXTRADIRS cdrom"
    SDL_EXTRALIBS="$SDL_EXTRALIBS cdrom/libcdrom.la"
else
    CFLAGS="$CFLAGS -DDISABLE_CDROM"
fi
# Check whether --enable-threads or --disable-threads was given.
if test "${enable_threads+set}" = set; then
  enableval="$enable_threads"
  :
else
  enable_threads=yes
fi

SDL_EXTRADIRS="$SDL_EXTRADIRS thread"
SDL_EXTRALIBS="$SDL_EXTRALIBS thread/libthread.la"
if test x$enable_threads != xyes; then
    CFLAGS="$CFLAGS -DDISABLE_THREADS"
    
  echo "Copying src/thread/generic/SDL_systhread.c -> src/thread/SDL_systhread.c"
  old="$srcdir/src/thread/generic/SDL_systhread.c"
  new="$srcdir/src/thread/SDL_systhread.c"
  cat >$new <<__EOF__
/* WARNING:  This file was automatically generated!
 * Original: $old
 */
__EOF__
  cat >>$new <$old

    
  echo "Copying src/thread/generic/SDL_systhread_c.h -> src/thread/SDL_systhread_c.h"
  old="$srcdir/src/thread/generic/SDL_systhread_c.h"
  new="$srcdir/src/thread/SDL_systhread_c.h"
  cat >$new <<__EOF__
/* WARNING:  This file was automatically generated!
 * Original: $old
 */
__EOF__
  cat >>$new <$old

    
  echo "Copying src/thread/generic/SDL_sysmutex.c -> src/thread/SDL_sysmutex.c"
  old="$srcdir/src/thread/generic/SDL_sysmutex.c"
  new="$srcdir/src/thread/SDL_sysmutex.c"
  cat >$new <<__EOF__
/* WARNING:  This file was automatically generated!
 * Original: $old
 */
__EOF__
  cat >>$new <$old

    
  echo "Copying src/thread/generic/SDL_sysmutex_c.h -> src/thread/SDL_sysmutex_c.h"
  old="$srcdir/src/thread/generic/SDL_sysmutex_c.h"
  new="$srcdir/src/thread/SDL_sysmutex_c.h"
  cat >$new <<__EOF__
/* WARNING:  This file was automatically generated!
 * Original: $old
 */
__EOF__
  cat >>$new <$old

    
  echo "Copying src/thread/generic/SDL_syssem.c -> src/thread/SDL_syssem.c"
  old="$srcdir/src/thread/generic/SDL_syssem.c"
  new="$srcdir/src/thread/SDL_syssem.c"
  cat >$new <<__EOF__
/* WARNING:  This file was automatically generated!
 * Original: $old
 */
__EOF__
  cat >>$new <$old

    
  echo "Copying src/thread/generic/SDL_syssem_c.h -> src/thread/SDL_syssem_c.h"
  old="$srcdir/src/thread/generic/SDL_syssem_c.h"
  new="$srcdir/src/thread/SDL_syssem_c.h"
  cat >$new <<__EOF__
/* WARNING:  This file was automatically generated!
 * Original: $old
 */
__EOF__
  cat >>$new <$old

    
  echo "Copying src/thread/generic/SDL_syscond.c -> src/thread/SDL_syscond.c"
  old="$srcdir/src/thread/generic/SDL_syscond.c"
  new="$srcdir/src/thread/SDL_syscond.c"
  cat >$new <<__EOF__
/* WARNING:  This file was automatically generated!
 * Original: $old
 */
__EOF__
  cat >>$new <$old

    
  echo "Copying src/thread/generic/SDL_syscond_c.h -> src/thread/SDL_syscond_c.h"
  old="$srcdir/src/thread/generic/SDL_syscond_c.h"
  new="$srcdir/src/thread/SDL_syscond_c.h"
  cat >$new <<__EOF__
/* WARNING:  This file was automatically generated!
 * Original: $old
 */
__EOF__
  cat >>$new <$old

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

if test x$enable_timers = xyes; then
    SDL_EXTRADIRS="$SDL_EXTRADIRS timer"
    SDL_EXTRALIBS="$SDL_EXTRALIBS timer/libtimer.la"
else
    CFLAGS="$CFLAGS -DDISABLE_TIMERS"
fi
# Check whether --enable-endian or --disable-endian was given.
if test "${enable_endian+set}" = set; then
  enableval="$enable_endian"
  :
else
  enable_endian=yes
fi

if test x$enable_endian = xyes; then
    SDL_EXTRADIRS="$SDL_EXTRADIRS endian"
    SDL_EXTRALIBS="$SDL_EXTRALIBS endian/libendian.la"
else
    CFLAGS="$CFLAGS -DDISABLE_ENDIAN"
fi
# Check whether --enable-file or --disable-file was given.
if test "${enable_file+set}" = set; then
  enableval="$enable_file"
  :
else
  enable_file=yes
fi

if test x$enable_file = xyes; then
    SDL_EXTRADIRS="$SDL_EXTRADIRS file"
    SDL_EXTRALIBS="$SDL_EXTRALIBS file/libfile.la"
else
    CFLAGS="$CFLAGS -DDISABLE_FILE"
fi

CheckOSS()
{
    # Check whether --enable-oss or --disable-oss was given.
if test "${enable_oss+set}" = set; then
  enableval="$enable_oss"
  :
else
  enable_oss=yes
fi

    if test x$enable_audio = xyes -a x$enable_oss = xyes; then
        echo $ac_n "checking for OSS audio support""... $ac_c" 1>&6
echo "configure:3082: checking for OSS audio support" >&5
        have_oss=no
        if test x$have_oss != xyes; then
            cat > conftest.$ac_ext <<EOF
#line 3086 "configure"
#include "confdefs.h"

              #include <sys/soundcard.h>
            
int main() {

              int arg = SNDCTL_DSP_SETFRAGMENT;
            
; return 0; }
EOF
if { (eval echo configure:3097: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  
            have_oss=yes
            
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
fi
rm -f conftest*
        fi
        if test x$have_oss != xyes; then
            cat > conftest.$ac_ext <<EOF
#line 3110 "configure"
#include "confdefs.h"

              #include <soundcard.h>
            
int main() {

              int arg = SNDCTL_DSP_SETFRAGMENT;
            
; return 0; }
EOF
if { (eval echo configure:3121: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  
            have_oss=yes
            CFLAGS="$CFLAGS -DOSS_USE_SOUNDCARD_H"
            
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
fi
rm -f conftest*
        fi
        echo "$ac_t""$have_oss" 1>&6
        if test x$have_oss = xyes; then
            CFLAGS="$CFLAGS -DOSS_SUPPORT"
            AUDIO_SUBDIRS="$AUDIO_SUBDIRS dsp"
            AUDIO_DRIVERS="$AUDIO_DRIVERS dsp/libaudio_dsp.la"
            AUDIO_SUBDIRS="$AUDIO_SUBDIRS dma"
            AUDIO_DRIVERS="$AUDIO_DRIVERS dma/libaudio_dma.la"
        fi
    fi
}

CheckALSA()
{
    # Check whether --enable-alsa or --disable-alsa was given.
if test "${enable_alsa+set}" = set; then
  enableval="$enable_alsa"
  :
else
  enable_alsa=yes
fi

    if test x$enable_audio = xyes -a x$enable_alsa = xyes; then
        echo $ac_n "checking for ALSA audio support""... $ac_c" 1>&6
echo "configure:3156: checking for ALSA audio support" >&5
        have_alsa=no
        cat > conftest.$ac_ext <<EOF
#line 3159 "configure"
#include "confdefs.h"

          #include <alsa/asoundlib.h>
        
int main() {

          #if SND_LIB_VERSION < ((0<<16)|(9<<8)|0)
          #error Your version of ALSA is too old
          #endif
          snd_pcm_t *pcm_handle;
        
; return 0; }
EOF
if { (eval echo configure:3173: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  
        echo $ac_n "checking for snd_pcm_open in -lasound""... $ac_c" 1>&6
echo "configure:3177: checking for snd_pcm_open in -lasound" >&5
ac_lib_var=`echo asound'_'snd_pcm_open | 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="-lasound  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 3185 "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 snd_pcm_open();

int main() {
snd_pcm_open()
; return 0; }
EOF
if { (eval echo configure:3196: \"$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_alsa=yes
else
  echo "$ac_t""no" 1>&6
fi

        
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
fi
rm -f conftest*
        if test x$have_alsa = xyes; then
            CFLAGS="$CFLAGS -DALSA_SUPPORT"
            SYSTEM_LIBS="$SYSTEM_LIBS -lasound"
            AUDIO_SUBDIRS="$AUDIO_SUBDIRS alsa"
            AUDIO_DRIVERS="$AUDIO_DRIVERS alsa/libaudio_alsa.la"
        else
            echo "$ac_t""$have_alsa" 1>&6
        fi
    fi
}

CheckDMEDIA()
{
    if test x$enable_audio = xyes; then
        echo $ac_n "checking for dmedia audio support""... $ac_c" 1>&6
echo "configure:3237: checking for dmedia audio support" >&5
        have_dmedia=no
        cat > conftest.$ac_ext <<EOF
#line 3240 "configure"
#include "confdefs.h"

          #include <dmedia/audio.h>
        
int main() {

          ALport audio_port;
        
; return 0; }
EOF
if { (eval echo configure:3251: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  
        have_dmedia=yes
        
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
fi
rm -f conftest*
        # Set up files for the audio library
        if test x$have_dmedia = xyes; then
            CFLAGS="$CFLAGS -DDMEDIA_SUPPORT"
            AUDIO_SUBDIRS="$AUDIO_SUBDIRS dmedia"
            AUDIO_DRIVERS="$AUDIO_DRIVERS dmedia/libaudio_dmedia.la"
            SYSTEM_LIBS="$SYSTEM_LIBS -laudio"
        fi
    fi
}

CheckESD()
{
    # Check whether --enable-esd or --disable-esd was given.
if test "${enable_esd+set}" = set; then
  enableval="$enable_esd"
  :
else
  enable_esd=yes
fi

    if test x$enable_audio = xyes -a x$enable_esd = xyes; then
        use_esd=no
        # Check whether --with-esd-prefix or --without-esd-prefix was given.
if test "${with_esd_prefix+set}" = set; then
  withval="$with_esd_prefix"
  esd_prefix="$withval"
else
  esd_prefix=""
fi

# Check whether --with-esd-exec-prefix or --without-esd-exec-prefix was given.
if test "${with_esd_exec_prefix+set}" = set; then
  withval="$with_esd_exec_prefix"
  esd_exec_prefix="$withval"
else
  esd_exec_prefix=""
fi

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


  if test x$esd_exec_prefix != x ; then
     esd_args="$esd_args --exec-prefix=$esd_exec_prefix"
     if test x${ESD_CONFIG+set} != xset ; then
        ESD_CONFIG=$esd_exec_prefix/bin/esd-config
     fi
  fi
  if test x$esd_prefix != x ; then
     esd_args="$esd_args --prefix=$esd_prefix"
     if test x${ESD_CONFIG+set} != xset ; then
        ESD_CONFIG=$esd_prefix/bin/esd-config
     fi
  fi

  # Extract the first word of "esd-config", so it can be a program name with args.
set dummy esd-config; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:3324: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_ESD_CONFIG'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  case "$ESD_CONFIG" in
  /*)
  ac_cv_path_ESD_CONFIG="$ESD_CONFIG" # Let the user override the test with a path.
  ;;
  ?:/*)			 
  ac_cv_path_ESD_CONFIG="$ESD_CONFIG" # 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_ESD_CONFIG="$ac_dir/$ac_word"
      break
    fi
  done
  IFS="$ac_save_ifs"
  test -z "$ac_cv_path_ESD_CONFIG" && ac_cv_path_ESD_CONFIG="no"
  ;;
esac
fi
ESD_CONFIG="$ac_cv_path_ESD_CONFIG"
if test -n "$ESD_CONFIG"; then
  echo "$ac_t""$ESD_CONFIG" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

  min_esd_version=0.2.8
  echo $ac_n "checking for ESD - version >= $min_esd_version""... $ac_c" 1>&6
echo "configure:3359: checking for ESD - version >= $min_esd_version" >&5
  no_esd=""
  if test "$ESD_CONFIG" = "no" ; then
    no_esd=yes
  else
    ESD_CFLAGS=`$ESD_CONFIG $esdconf_args --cflags`
    ESD_LIBS=`$ESD_CONFIG $esdconf_args --libs`

    esd_major_version=`$ESD_CONFIG $esd_args --version | \
           sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\1/'`
    esd_minor_version=`$ESD_CONFIG $esd_args --version | \
           sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\2/'`
    esd_micro_version=`$ESD_CONFIG $esd_config_args --version | \
           sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\3/'`
    if test "x$enable_esdtest" = "xyes" ; then
      ac_save_CFLAGS="$CFLAGS"
      ac_save_LIBS="$LIBS"
      CFLAGS="$CFLAGS $ESD_CFLAGS"
      LIBS="$LIBS $ESD_LIBS"
      rm -f conf.esdtest
      if test "$cross_compiling" = yes; then
  echo $ac_n "cross compiling; assumed OK... $ac_c"
else
  cat > conftest.$ac_ext <<EOF
#line 3383 "configure"
#include "confdefs.h"

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <esd.h>

char*
my_strdup (char *str)
{
  char *new_str;
  
  if (str)
    {
      new_str = malloc ((strlen (str) + 1) * sizeof(char));
      strcpy (new_str, str);
    }
  else
    new_str = NULL;
  
  return new_str;
}

int main ()
{
  int major, minor, micro;
  char *tmp_version;

  system ("touch conf.esdtest");

  /* HP/UX 9 (%@#!) writes to sscanf strings */
  tmp_version = my_strdup("$min_esd_version");
  if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
     printf("%s, bad version string\n", "$min_esd_version");
     exit(1);
   }

   if (($esd_major_version > major) ||
      (($esd_major_version == major) && ($esd_minor_version > minor)) ||
      (($esd_major_version == major) && ($esd_minor_version == minor) && ($esd_micro_version >= micro)))
    {
      return 0;
    }
  else
    {
      printf("\n*** 'esd-config --version' returned %d.%d.%d, but the minimum version\n", $esd_major_version, $esd_minor_version, $esd_micro_version);
      printf("*** of ESD required is %d.%d.%d. If esd-config is correct, then it is\n", major, minor, micro);
      printf("*** best to upgrade to the required version.\n");
      printf("*** If esd-config was wrong, set the environment variable ESD_CONFIG\n");
      printf("*** to point to the correct copy of esd-config, and remove the file\n");
      printf("*** config.cache before re-running configure\n");
      return 1;
    }
}


EOF
if { (eval echo configure:3441: \"$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*
  no_esd=yes
fi
rm -fr conftest*
fi

       CFLAGS="$ac_save_CFLAGS"
       LIBS="$ac_save_LIBS"
     fi
  fi
  if test "x$no_esd" = x ; then
     echo "$ac_t""yes" 1>&6
     use_esd=yes     
  else
     echo "$ac_t""no" 1>&6
     if test "$ESD_CONFIG" = "no" ; then
       echo "*** The esd-config script installed by ESD could not be found"
       echo "*** If ESD was installed in PREFIX, make sure PREFIX/bin is in"
       echo "*** your path, or set the ESD_CONFIG environment variable to the"
       echo "*** full path to esd-config."
     else
       if test -f conf.esdtest ; then
        :
       else
          echo "*** Could not run ESD test program, checking why..."
          CFLAGS="$CFLAGS $ESD_CFLAGS"
          LIBS="$LIBS $ESD_LIBS"
          cat > conftest.$ac_ext <<EOF
#line 3475 "configure"
#include "confdefs.h"

#include <stdio.h>
#include <esd.h>

int main() {
 return 0; 
; return 0; }
EOF
if { (eval echo configure:3485: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
   echo "*** The test program compiled, but did not run. This usually means"
          echo "*** that the run-time linker is not finding ESD or finding the wrong"
          echo "*** version of ESD. If it is not finding ESD, you'll need to set your"
          echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
          echo "*** to the installed location  Also, make sure you have run ldconfig if that"
          echo "*** is required on your system"
	  echo "***"
          echo "*** If you have an old version installed, it is best to remove it, although"
          echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
   echo "*** The test program failed to compile or link. See the file config.log for the"
          echo "*** exact error that occured. This usually means ESD was incorrectly installed"
          echo "*** or that you have moved ESD since it was installed. In the latter case, you"
          echo "*** may want to edit the esd-config script: $ESD_CONFIG" 
fi
rm -f conftest*
          CFLAGS="$ac_save_CFLAGS"
          LIBS="$ac_save_LIBS"
       fi
     fi
     ESD_CFLAGS=""
     ESD_LIBS=""
     :
  fi
  
  
  rm -f conf.esdtest

        if test x$use_esd = xyes; then
            # Check whether --enable-esd-shared or --disable-esd-shared was given.
if test "${enable_esd_shared+set}" = set; then
  enableval="$enable_esd_shared"
  :
else
  enable_esd_shared=yes
fi

            esd_lib_spec=`echo $ESD_LIBS | sed 's/.*-L\([^ ]*\).*/\1\/libesd.so.*/'`
            esd_lib=`ls $esd_lib_spec | head -1 | sed 's/.*\/\(.*\)/\1/'`
            echo "-- $esd_lib_spec -> $esd_lib"
            if test x$enable_dlopen != xyes && \
               test x$enable_esd_shared = xyes; then
                { echo "configure: error: You must have dlopen() support and use the --enable-dlopen option" 1>&2; exit 1; }
            fi
            if test x$enable_dlopen = xyes && \
               test x$enable_esd_shared = xyes && test x$esd_lib != x; then
                CFLAGS="$CFLAGS -DESD_SUPPORT -DESD_DYNAMIC=\$(esd_lib) $ESD_CFLAGS"
                
            else
                CFLAGS="$CFLAGS -DESD_SUPPORT $ESD_CFLAGS"
                SYSTEM_LIBS="$SYSTEM_LIBS $ESD_LIBS"
            fi
            AUDIO_SUBDIRS="$AUDIO_SUBDIRS esd"
            AUDIO_DRIVERS="$AUDIO_DRIVERS esd/libaudio_esd.la"
        fi
    fi
}

CheckARTSC()
{
    # Check whether --enable-arts or --disable-arts was given.
if test "${enable_arts+set}" = set; then
  enableval="$enable_arts"
  :
else
  enable_arts=yes
fi

    if test x$enable_audio = xyes -a x$enable_arts = xyes; then
        # Extract the first word of "artsc-config", so it can be a program name with args.
set dummy artsc-config; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:3562: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_ARTSCCONFIG'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  case "$ARTSCCONFIG" in
  /*)
  ac_cv_path_ARTSCCONFIG="$ARTSCCONFIG" # Let the user override the test with a path.
  ;;
  ?:/*)			 
  ac_cv_path_ARTSCCONFIG="$ARTSCCONFIG" # 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_ARTSCCONFIG="$ac_dir/$ac_word"
      break
    fi
  done
  IFS="$ac_save_ifs"
  ;;
esac
fi
ARTSCCONFIG="$ac_cv_path_ARTSCCONFIG"
if test -n "$ARTSCCONFIG"; then
  echo "$ac_t""$ARTSCCONFIG" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

        if test x$ARTSCCONFIG = x -o x$ARTSCCONFIG = x'"$ARTSCCONFIG"'; then
            : # arts isn't installed
        else
            ARTSC_CFLAGS=`$ARTSCCONFIG --cflags`
            ARTSC_LIBS=`$ARTSCCONFIG --libs`
            echo $ac_n "checking for aRts development environment""... $ac_c" 1>&6
echo "configure:3600: checking for aRts development environment" >&5
            audio_arts=no
            save_CFLAGS="$CFLAGS"
            CFLAGS="$CFLAGS $ARTSC_CFLAGS"
            cat > conftest.$ac_ext <<EOF
#line 3605 "configure"
#include "confdefs.h"

             #include <artsc.h>
            
int main() {

             arts_stream_t stream;
            
; return 0; }
EOF
if { (eval echo configure:3616: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  
            audio_arts=yes
            
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
fi
rm -f conftest*
            CFLAGS="$save_CFLAGS"
            echo "$ac_t""$audio_arts" 1>&6
            if test x$audio_arts = xyes; then
                # Check whether --enable-arts-shared or --disable-arts-shared was given.
if test "${enable_arts_shared+set}" = set; then
  enableval="$enable_arts_shared"
  :
else
  enable_arts_shared=yes
fi

                arts_lib_spec=`echo $ARTSC_LIBS | sed 's/.*-L\([^ ]*\).*/\1\/libartsc.so.*/'`
                arts_lib=`ls $arts_lib_spec | head -1 | sed 's/.*\/\(.*\)/\1/'`
                echo "-- $arts_lib_spec -> $arts_lib"
                if test x$enable_dlopen != xyes && \
                   test x$enable_arts_shared = xyes; then
                    { echo "configure: error: You must have dlopen() support and use the --enable-dlopen option" 1>&2; exit 1; }
                fi
                if test x$enable_dlopen = xyes && \
                   test x$enable_arts_shared = xyes && test x$arts_lib != x; then
                    CFLAGS="$CFLAGS -DARTSC_SUPPORT -DARTSC_DYNAMIC=\$(arts_lib) $ARTSC_CFLAGS"
                    
                else
                    CFLAGS="$CFLAGS -DARTSC_SUPPORT $ARTSC_CFLAGS"
                    SYSTEM_LIBS="$SYSTEM_LIBS $ARTSC_LIBS"
                fi
                AUDIO_SUBDIRS="$AUDIO_SUBDIRS arts"
                AUDIO_DRIVERS="$AUDIO_DRIVERS arts/libaudio_arts.la"
            fi
        fi
    fi
}

CheckNAS()
{
    # Check whether --enable-nas or --disable-nas was given.
if test "${enable_nas+set}" = set; then
  enableval="$enable_nas"
  :
else
  enable_nas=yes
fi

    if test x$enable_audio = xyes -a x$enable_nas = xyes; then
        echo $ac_n "checking for NAS audio support""... $ac_c" 1>&6
echo "configure:3671: checking for NAS audio support" >&5
        have_nas=no
        if test -r /usr/X11R6/include/audio/audiolib.h; then
            have_nas=yes
            CFLAGS="$CFLAGS -DNAS_SUPPORT"
            SYSTEM_LIBS="$SYSTEM_LIBS -laudio -lXt"
            AUDIO_SUBDIRS="$AUDIO_SUBDIRS nas"
            AUDIO_DRIVERS="$AUDIO_DRIVERS nas/libaudio_nas.la"

                
        elif test -r /usr/freeware/include/nas/audiolib.h; then
            have_nas=yes
            CFLAGS="$CFLAGS -DNAS_SUPPORT"
            SYSTEM_LIBS="$SYSTEM_LIBS -lnas -lXt"
            AUDIO_SUBDIRS="$AUDIO_SUBDIRS nas"
            AUDIO_DRIVERS="$AUDIO_DRIVERS nas/libaudio_nas.la"
        fi
        echo "$ac_t""$have_nas" 1>&6
    fi
}

CheckDiskAudio()
{
    # Check whether --enable-diskaudio or --disable-diskaudio was given.
if test "${enable_diskaudio+set}" = set; then
  enableval="$enable_diskaudio"
  :
else
  enable_diskaudio=yes
fi

    if test x$enable_audio = xyes -a x$enable_diskaudio = xyes; then
        CFLAGS="$CFLAGS -DDISKAUD_SUPPORT"
        AUDIO_SUBDIRS="$AUDIO_SUBDIRS disk"
        AUDIO_DRIVERS="$AUDIO_DRIVERS disk/libaudio_disk.la"
    fi
}

CheckAtariAudio()
{
    # Check whether --enable-mintaudio or --disable-mintaudio was given.
if test "${enable_mintaudio+set}" = set; then
  enableval="$enable_mintaudio"
  :
else
  enable_mintaudio=yes
fi

    if test x$enable_audio = xyes -a x$enable_mintaudio = xyes; then
        mintaudio=no
        ac_safe=`echo "mint/falcon.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for mint/falcon.h""... $ac_c" 1>&6
echo "configure:3723: checking for mint/falcon.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 3728 "configure"
#include "confdefs.h"
#include <mint/falcon.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:3733: \"$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_mint_falcon_hdr=yes
else
  echo "$ac_t""no" 1>&6
fi

        if test x$have_mint_falcon_hdr = xyes; then
            mintaudio=yes
            CFLAGS="$CFLAGS -DMINTAUDIO_SUPPORT"
            AUDIO_SUBDIRS="$AUDIO_SUBDIRS mint"
            AUDIO_DRIVERS="$AUDIO_DRIVERS mint/libaudio_mintaudio.la"
        fi
    fi
}

# NASM is available from: http://nasm.octium.net/
CheckNASM()
{
        case $target in
        i?86*)
            ;;
        *)
        # Nope, bail early.
            return
            ;;
    esac
        # Check whether --enable-nasm or --disable-nasm was given.
if test "${enable_nasm+set}" = set; then
  enableval="$enable_nasm"
  :
else
  enable_nasm=yes
fi

    if test x$enable_video = xyes -a x$enable_nasm = xyes; then
        # Extract the first word of "nasm", so it can be a program name with args.
set dummy nasm; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:3786: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_NASM'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  case "$NASM" in
  /*)
  ac_cv_path_NASM="$NASM" # Let the user override the test with a path.
  ;;
  ?:/*)			 
  ac_cv_path_NASM="$NASM" # 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_NASM="$ac_dir/$ac_word"
      break
    fi
  done
  IFS="$ac_save_ifs"
  ;;
esac
fi
NASM="$ac_cv_path_NASM"
if test -n "$NASM"; then
  echo "$ac_t""$NASM" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

        if test x$NASM = x -o x$NASM = x'"$NASM"'; then
            : # nasm isn't installed
        else
            CFLAGS="$CFLAGS -DUSE_ASMBLIT -I$srcdir/hermes"
            case $ARCH in
              win32)
                  NASMFLAGS="-f win32"
                  ;;
              openbsd)
                  NASMFLAGS="-f aoutb"
                  ;;
              *)
                  NASMFLAGS="-f elf"
                  ;;
            esac
            
            CFLAGS="$CFLAGS -I\$(top_srcdir)/src/hermes"
            SDL_EXTRADIRS="$SDL_EXTRADIRS hermes"
            SDL_EXTRALIBS="$SDL_EXTRALIBS hermes/libhermes.la"
        fi
    fi
}

CheckNANOX()
{
    # Check whether --enable-video-nanox or --disable-video-nanox was given.
if test "${enable_video_nanox+set}" = set; then
  enableval="$enable_video_nanox"
  :
else
  enable_video_nanox=no
fi

    # Check whether --enable-nanox-debug or --disable-nanox-debug was given.
if test "${enable_nanox_debug+set}" = set; then
  enableval="$enable_nanox_debug"
  :
else
  enable_nanox_debug=no
fi

    # Check whether --enable-nanox-share-memory or --disable-nanox-share-memory was given.
if test "${enable_nanox_share_memory+set}" = set; then
  enableval="$enable_nanox_share_memory"
  :
else
  enable_nanox_share_memory=no
fi

    # Check whether --enable-nanox_direct_fb or --disable-nanox_direct_fb was given.
if test "${enable_nanox_direct_fb+set}" = set; then
  enableval="$enable_nanox_direct_fb"
  :
else
  enable_nanox_direct_fb=no
fi


    if test x$enable_video = xyes -a x$enable_video_nanox = xyes; then
        if test x$enable_nanox_debug = xyes; then
            CFLAGS="$CFLAGS -DENABLE_NANOX_DEBUG"
        fi

        if test x$enable_nanox_share_memory = xyes; then
            CFLAGS="$CFLAGS -DNANOX_SHARE_MEMORY"
        fi

        if test x$enable_nanox_direct_fb = xyes; then
            CFLAGS="$CFLAGS -DENABLE_NANOX_DIRECT_FB"
        fi

        CFLAGS="$CFLAGS $X_CFLAGS -DENABLE_NANOX"
        SYSTEM_LIBS="$SYSTEM_LIBS -lnano-X"
        VIDEO_SUBDIRS="$VIDEO_SUBDIRS nanox"
        VIDEO_DRIVERS="$VIDEO_DRIVERS nanox/libvideo_nanox.la"
    fi
}

CheckX11()
{
    # Check whether --enable-video-x11 or --disable-video-x11 was given.
if test "${enable_video_x11+set}" = set; then
  enableval="$enable_video_x11"
  :
else
  enable_video_x11=yes
fi

    if test x$enable_video = xyes -a x$enable_video_x11 = xyes; then
        # 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:3912: 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 3974 "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:3979: \"$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 4048 "configure"
#include "confdefs.h"

int main() {
${x_direct_test_function}()
; return 0; }
EOF
if { (eval echo configure:4055: \"$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:4161: 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 4164 "configure"
#include "confdefs.h"

int main() {

; return 0; }
EOF
if { (eval echo configure:4171: \"$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 4187 "configure"
#include "confdefs.h"

int main() {

; return 0; }
EOF
if { (eval echo configure:4194: \"$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:4226: 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 4234 "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:4245: \"$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:4267: 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 4275 "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:4286: \"$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:4315: 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 4320 "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:4343: \"$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:4364: 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 4372 "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:4383: \"$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:4413: 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 4418 "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:4441: \"$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:4462: 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 4470 "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:4481: \"$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:4505: 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 4510 "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:4533: \"$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:4554: 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 4562 "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:4573: \"$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:4597: 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 4602 "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:4625: \"$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:4646: 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 4654 "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:4665: \"$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:4698: 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 4706 "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:4717: \"$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 x$have_x = xyes; then
            CFLAGS="$CFLAGS $X_CFLAGS -DENABLE_X11 -DXTHREADS -I$srcdir/include -I$srcdir/src/video"
            if test x$ac_cv_func_shmat != xyes; then
                CFLAGS="$CFLAGS -DNO_SHARED_MEMORY"
            fi
            SYSTEM_LIBS="$SYSTEM_LIBS $X_LIBS -lX11 -lXext"
            VIDEO_SUBDIRS="$VIDEO_SUBDIRS x11"
            VIDEO_DRIVERS="$VIDEO_DRIVERS x11/libvideo_x11.la"

            # Check whether --enable-video-x11-vm or --disable-video-x11-vm was given.
if test "${enable_video_x11_vm+set}" = set; then
  enableval="$enable_video_x11_vm"
  :
else
  enable_video_x11_vm=yes
fi

            if test x$enable_video_x11_vm = xyes; then
                echo $ac_n "checking for XFree86 VidMode 1.0 support""... $ac_c" 1>&6
echo "configure:4760: checking for XFree86 VidMode 1.0 support" >&5
                video_x11_vm=no
                cat > conftest.$ac_ext <<EOF
#line 4763 "configure"
#include "confdefs.h"

                 #include <X11/Xlib.h>
                 #include <XFree86/extensions/xf86vmode.h>
                
int main() {

                
; return 0; }
EOF
if { (eval echo configure:4774: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  
                video_x11_vm=yes
                
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
fi
rm -f conftest*
                echo "$ac_t""$video_x11_vm" 1>&6
                if test x$video_x11_vm = xyes; then
                    CFLAGS="$CFLAGS -DXFREE86_VM"
                    VIDEO_SUBDIRS="$VIDEO_SUBDIRS XFree86/Xxf86vm"
                    VIDEO_DRIVERS="$VIDEO_DRIVERS XFree86/Xxf86vm/libXFree86_Xxf86vm.la"
                    echo $ac_n "checking for XFree86 VidMode gamma support""... $ac_c" 1>&6
echo "configure:4790: checking for XFree86 VidMode gamma support" >&5
                    video_x11_vmgamma=no
                    cat > conftest.$ac_ext <<EOF
#line 4793 "configure"
#include "confdefs.h"

                     #include <X11/Xlib.h>
                     #include <XFree86/extensions/xf86vmode.h>
                    
int main() {

                     SDL_NAME(XF86VidModeGamma) gamma;
                    
; return 0; }
EOF
if { (eval echo configure:4805: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  
                    video_x11_vmgamma=yes
                    
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
fi
rm -f conftest*
                    echo "$ac_t""$video_x11_vmgamma" 1>&6
                    if test x$video_x11_vmgamma = xyes; then
                        CFLAGS="$CFLAGS -DXFREE86_VMGAMMA"
                    fi
                fi
            fi
            # Check whether --enable-dga or --disable-dga was given.
if test "${enable_dga+set}" = set; then
  enableval="$enable_dga"
  :
else
  enable_dga=yes
fi

            # Check whether --enable-video-x11-dgamouse or --disable-video-x11-dgamouse was given.
if test "${enable_video_x11_dgamouse+set}" = set; then
  enableval="$enable_video_x11_dgamouse"
  :
else
  enable_video_x11_dgamouse=yes
fi

            if test x$enable_dga = xyes; then
                echo $ac_n "checking for XFree86 DGA 1.0 support""... $ac_c" 1>&6
echo "configure:4839: checking for XFree86 DGA 1.0 support" >&5
                video_x11_dga=no
                cat > conftest.$ac_ext <<EOF
#line 4842 "configure"
#include "confdefs.h"

                 #include <X11/Xlib.h>
                 #include <XFree86/extensions/xf86dga.h>
                
int main() {

                
; return 0; }
EOF
if { (eval echo configure:4853: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  
                video_x11_dga=yes
                
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
fi
rm -f conftest*
                echo "$ac_t""$video_x11_dga" 1>&6
                if test x$video_x11_dga = xyes; then
                    CFLAGS="$CFLAGS -DXFREE86_DGAMOUSE"
                    if test x$enable_video_x11_dgamouse = xyes; then
                        CFLAGS="$CFLAGS -DDEFAULT_DGAMOUSE"
                    fi
                    VIDEO_SUBDIRS="$VIDEO_SUBDIRS XFree86/Xxf86dga"
                    VIDEO_DRIVERS="$VIDEO_DRIVERS XFree86/Xxf86dga/libXFree86_Xxf86dga.la"
                fi
            fi
            # Check whether --enable-video-x11-xv or --disable-video-x11-xv was given.
if test "${enable_video_x11_xv+set}" = set; then
  enableval="$enable_video_x11_xv"
  :
else
  enable_video_x11_xv=yes
fi

            if test x$enable_video_x11_xv = xyes; then
                echo $ac_n "checking for XFree86 XvImage support""... $ac_c" 1>&6
echo "configure:4883: checking for XFree86 XvImage support" >&5
                video_x11_xv=no
                cat > conftest.$ac_ext <<EOF
#line 4886 "configure"
#include "confdefs.h"

                 #include <X11/Xlib.h>
                 #include <sys/ipc.h>
                 #include <sys/shm.h>
                 #include <X11/extensions/XShm.h>
                 #include <XFree86/extensions/Xvlib.h>
                
int main() {

                 SDL_NAME(XvImage) *image;
                
; return 0; }
EOF
if { (eval echo configure:4901: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  
                video_x11_xv=yes
                
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
fi
rm -f conftest*
                echo "$ac_t""$video_x11_xv" 1>&6
                if test x$video_x11_xv = xyes; then
                    CFLAGS="$CFLAGS -DXFREE86_XV"
                    VIDEO_SUBDIRS="$VIDEO_SUBDIRS XFree86/Xv"
                    VIDEO_DRIVERS="$VIDEO_DRIVERS XFree86/Xv/libXFree86_Xv.la"
                fi
            fi
            # Check whether --enable-video-x11-xinerama or --disable-video-x11-xinerama was given.
if test "${enable_video_x11_xinerama+set}" = set; then
  enableval="$enable_video_x11_xinerama"
  :
else
  enable_video_x11_xinerama=yes
fi

            if test x$enable_video_x11_xinerama = xyes; then
                echo $ac_n "checking for X11 Xinerama support""... $ac_c" 1>&6
echo "configure:4928: checking for X11 Xinerama support" >&5
                video_x11_xinerama=no
                cat > conftest.$ac_ext <<EOF
#line 4931 "configure"
#include "confdefs.h"

                 #include <X11/Xlib.h>
                 #include <XFree86/extensions/Xinerama.h>
                
int main() {

                 SDL_NAME(XineramaScreenInfo) *xinerama;
                
; return 0; }
EOF
if { (eval echo configure:4943: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  
                video_x11_xinerama=yes
                
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
fi
rm -f conftest*
                echo "$ac_t""$video_x11_xinerama" 1>&6
                if test x$video_x11_xinerama = xyes; then
                    CFLAGS="$CFLAGS -DHAVE_XINERAMA"
                    VIDEO_SUBDIRS="$VIDEO_SUBDIRS XFree86/Xinerama"
                    VIDEO_DRIVERS="$VIDEO_DRIVERS XFree86/Xinerama/libXFree86_Xinerama.la"
                fi
            fi
            # Check whether --enable-video-x11-xme or --disable-video-x11-xme was given.
if test "${enable_video_x11_xme+set}" = set; then
  enableval="$enable_video_x11_xme"
  :
else
  enable_video_x11_xme=yes
fi

            if test x$enable_video_x11_xme = xyes; then
                echo $ac_n "checking for Xi Graphics XiGMiscExtension support""... $ac_c" 1>&6
echo "configure:4970: checking for Xi Graphics XiGMiscExtension support" >&5
                video_x11_xme=no
                cat > conftest.$ac_ext <<EOF
#line 4973 "configure"
#include "confdefs.h"

                 #include <X11/Xlib.h>
                 #include <X11/extensions/xme.h>
                
int main() {

                 XiGMiscResolutionInfo *resolutions;
                
; return 0; }
EOF
if { (eval echo configure:4985: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  
                video_x11_xme=yes
                
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
fi
rm -f conftest*
                echo "$ac_t""$video_x11_xme" 1>&6
                if test x$video_x11_xme = xyes; then
                    CFLAGS="$CFLAGS -DHAVE_XIGXME"
                    SYSTEM_LIBS="$SYSTEM_LIBS -lxme"
                fi
            fi
        fi
    fi
}

CheckDGA()
{
    # Check whether --enable-video-dga or --disable-video-dga was given.
if test "${enable_video_dga+set}" = set; then
  enableval="$enable_video_dga"
  :
else
  enable_video_dga=yes
fi

    if test x$video_x11_dga = xyes -a x$enable_video_dga = xyes; then
        save_CFLAGS="$CFLAGS"; CFLAGS="$CFLAGS -Isrc/video"
        echo $ac_n "checking for XFree86 DGA 2.0 support""... $ac_c" 1>&6
echo "configure:5018: checking for XFree86 DGA 2.0 support" >&5
        video_x11_dga2=no
        cat > conftest.$ac_ext <<EOF
#line 5021 "configure"
#include "confdefs.h"

         #include <X11/Xlib.h>
         #include <XFree86/extensions/xf86dga.h>
        
int main() {

         SDL_NAME(XDGAEvent) xevent;
        
; return 0; }
EOF
if { (eval echo configure:5033: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  
        video_x11_dga2=yes
        
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
fi
rm -f conftest*
        echo "$ac_t""$video_x11_dga2" 1>&6
        if test x$video_x11_dga2 = xyes; then
            CFLAGS="$CFLAGS -DENABLE_DGA"
            VIDEO_SUBDIRS="$VIDEO_SUBDIRS dga"
            VIDEO_DRIVERS="$VIDEO_DRIVERS dga/libvideo_dga.la"
        fi
    fi
}

CheckPHOTON()
{
    # Check whether --enable-video-photon or --disable-video-photon was given.
if test "${enable_video_photon+set}" = set; then
  enableval="$enable_video_photon"
  :
else
  enable_video_photon=yes
fi

    if test x$enable_video = xyes -a x$enable_video_photon = xyes; then
        echo $ac_n "checking for QNX Photon support""... $ac_c" 1>&6
echo "configure:5064: checking for QNX Photon support" >&5
        video_photon=no
        cat > conftest.$ac_ext <<EOF
#line 5067 "configure"
#include "confdefs.h"

          #include <Ph.h>
          #include <Pt.h>
          #include <photon/Pg.h>
          #include <photon/PdDirect.h>
        
int main() {

         PgDisplaySettings_t *visual;
        
; return 0; }
EOF
if { (eval echo configure:5081: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  
        video_photon=yes
        
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
fi
rm -f conftest*
        echo "$ac_t""$video_photon" 1>&6
        if test x$video_photon = xyes; then
            CFLAGS="$CFLAGS -DENABLE_PHOTON"
            SYSTEM_LIBS="$SYSTEM_LIBS -lph"
            VIDEO_SUBDIRS="$VIDEO_SUBDIRS photon"
            VIDEO_DRIVERS="$VIDEO_DRIVERS photon/libvideo_photon.la"
            CheckOpenGLQNX
        fi
    fi
}

CheckFBCON()
{
    # Check whether --enable-video-fbcon or --disable-video-fbcon was given.
if test "${enable_video_fbcon+set}" = set; then
  enableval="$enable_video_fbcon"
  :
else
  enable_video_fbcon=yes
fi

    if test x$enable_video = xyes -a x$enable_video_fbcon = xyes; then
        echo $ac_n "checking for framebuffer console support""... $ac_c" 1>&6
echo "configure:5114: checking for framebuffer console support" >&5
        video_fbcon=no
        cat > conftest.$ac_ext <<EOF
#line 5117 "configure"
#include "confdefs.h"

         #include <linux/fb.h>
         #include <linux/kd.h>
         #include <linux/keyboard.h>
        
int main() {

        
; return 0; }
EOF
if { (eval echo configure:5129: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  
        video_fbcon=yes
        
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
fi
rm -f conftest*
        echo "$ac_t""$video_fbcon" 1>&6
        if test x$video_fbcon = xyes; then
            CFLAGS="$CFLAGS -DENABLE_FBCON"
            VIDEO_SUBDIRS="$VIDEO_SUBDIRS fbcon"
            VIDEO_DRIVERS="$VIDEO_DRIVERS fbcon/libvideo_fbcon.la"
        fi
    fi
}

CheckDirectFB()
{
    # Check whether --enable-video-directfb or --disable-video-directfb was given.
if test "${enable_video_directfb+set}" = set; then
  enableval="$enable_video_directfb"
  :
else
  enable_video_directfb=no
fi

    if test x$enable_video = xyes -a x$enable_video_directfb = xyes; then
        video_directfb=no

        # Extract the first word of "pkg-config", so it can be a program name with args.
set dummy pkg-config; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:5164: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_PKG_CONFIG'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  case "$PKG_CONFIG" in
  /*)
  ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
  ;;
  ?:/*)			 
  ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # 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_PKG_CONFIG="$ac_dir/$ac_word"
      break
    fi
  done
  IFS="$ac_save_ifs"
  test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no"
  ;;
esac
fi
PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
if test -n "$PKG_CONFIG"; then
  echo "$ac_t""$PKG_CONFIG" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

        if test x$PKG_CONFIG = xno ; then
            echo "configure: warning: *** pkg-config is required to build the DirectFB video driver." 1>&2
        else
            echo $ac_n "checking for DirectFB support""... $ac_c" 1>&6
echo "configure:5201: checking for DirectFB support" >&5

            if ! $PKG_CONFIG --atleast-pkgconfig-version 0.7 ; then
                { echo "configure: error: *** pkg-config too old; version 0.7 or better required." 1>&2; exit 1; }
            fi

            DIRECTFB_REQUIRED_VERSION=0.9.15

            if $PKG_CONFIG --atleast-version $DIRECTFB_REQUIRED_VERSION directfb ; then
                DIRECTFB_CFLAGS=`$PKG_CONFIG --cflags directfb`
                DIRECTFB_LIBS=`$PKG_CONFIG --libs directfb`
                video_directfb=yes
            fi
        fi

        echo "$ac_t""$video_directfb" 1>&6
        if test x$video_directfb = xyes; then
            CFLAGS="$CFLAGS -DENABLE_DIRECTFB"
            VIDEO_SUBDIRS="$VIDEO_SUBDIRS directfb"
            VIDEO_DRIVERS="$VIDEO_DRIVERS directfb/libvideo_directfb.la"

            
            
        fi
    fi
}

CheckPS2GS()
{
    # Check whether --enable-video-ps2gs or --disable-video-ps2gs was given.
if test "${enable_video_ps2gs+set}" = set; then
  enableval="$enable_video_ps2gs"
  :
else
  enable_video_ps2gs=yes
fi

    if test x$enable_video = xyes -a x$enable_video_ps2gs = xyes; then
        echo $ac_n "checking for PlayStation 2 GS support""... $ac_c" 1>&6
echo "configure:5240: checking for PlayStation 2 GS support" >&5
        video_ps2gs=no
        cat > conftest.$ac_ext <<EOF
#line 5243 "configure"
#include "confdefs.h"

         #include <linux/ps2/dev.h>
         #include <linux/ps2/gs.h>
        
int main() {

        
; return 0; }
EOF
if { (eval echo configure:5254: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  
        video_ps2gs=yes
        
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
fi
rm -f conftest*
        echo "$ac_t""$video_ps2gs" 1>&6
        if test x$video_ps2gs = xyes; then
            CFLAGS="$CFLAGS -DENABLE_PS2GS"
            VIDEO_SUBDIRS="$VIDEO_SUBDIRS ps2gs"
            VIDEO_DRIVERS="$VIDEO_DRIVERS ps2gs/libvideo_ps2gs.la"
        fi
    fi
}

CheckGGI()
{
    # Check whether --enable-video-ggi or --disable-video-ggi was given.
if test "${enable_video_ggi+set}" = set; then
  enableval="$enable_video_ggi"
  :
else
  enable_video_ggi=no
fi

    if test x$enable_video = xyes -a x$enable_video_ggi = xyes; then
        echo $ac_n "checking for GGI support""... $ac_c" 1>&6
echo "configure:5285: checking for GGI support" >&5
        video_ggi=no
        cat > conftest.$ac_ext <<EOF
#line 5288 "configure"
#include "confdefs.h"

         #include <ggi/ggi.h>
         #include <ggi/gii.h>
        
int main() {

        
; return 0; }
EOF
if { (eval echo configure:5299: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  
        video_ggi=yes
        
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
fi
rm -f conftest*
        echo "$ac_t""$video_ggi" 1>&6
        if test x$video_ggi = xyes; then
            CFLAGS="$CFLAGS $X_CFLAGS -DENABLE_GGI"
            SYSTEM_LIBS="$SYSTEM_LIBS -lggi -lgii -lgg"

            VIDEO_SUBDIRS="$VIDEO_SUBDIRS ggi"
            VIDEO_DRIVERS="$VIDEO_DRIVERS ggi/libvideo_ggi.la"
        fi
    fi
}

CheckSVGA()
{
    # Check whether --enable-video-svga or --disable-video-svga was given.
if test "${enable_video_svga+set}" = set; then
  enableval="$enable_video_svga"
  :
else
  enable_video_svga=no
fi

    if test x$enable_video = xyes -a x$enable_video_svga = xyes; then
        echo $ac_n "checking for SVGAlib (1.4.0+) support""... $ac_c" 1>&6
echo "configure:5332: checking for SVGAlib (1.4.0+) support" >&5
        video_svga=no
        cat > conftest.$ac_ext <<EOF
#line 5335 "configure"
#include "confdefs.h"

         #include <vga.h>
         #include <vgamouse.h>
         #include <vgakeyboard.h>
        
int main() {

         if ( SCANCODE_RIGHTWIN && SCANCODE_LEFTWIN ) {
             exit(0);
         }
        
; return 0; }
EOF
if { (eval echo configure:5350: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  
        video_svga=yes
        
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
fi
rm -f conftest*
        echo "$ac_t""$video_svga" 1>&6
        if test x$video_svga = xyes; then
            CFLAGS="$CFLAGS -DENABLE_SVGALIB"
            SYSTEM_LIBS="$SYSTEM_LIBS -lvga"

            VIDEO_SUBDIRS="$VIDEO_SUBDIRS svga"
            VIDEO_DRIVERS="$VIDEO_DRIVERS svga/libvideo_svga.la"
        fi
    fi
}

CheckVGL()
{
    # Check whether --enable-video-vgl or --disable-video-vgl was given.
if test "${enable_video_vgl+set}" = set; then
  enableval="$enable_video_vgl"
  :
else
  enable_video_vgl=no
fi

    if test x$enable_video = xyes -a x$enable_video_vgl = xyes; then
        echo $ac_n "checking for libVGL support""... $ac_c" 1>&6
echo "configure:5383: checking for libVGL support" >&5
        video_vgl=no
        cat > conftest.$ac_ext <<EOF
#line 5386 "configure"
#include "confdefs.h"

         #include <sys/fbio.h>
         #include <sys/consio.h>
         #include <sys/kbio.h>
         #include <vgl.h>
        
int main() {

         VGLBitmap bitmap;
         exit(bitmap.Bitmap);
        
; return 0; }
EOF
if { (eval echo configure:5401: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  
        video_vgl=yes
        
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
fi
rm -f conftest*
        echo "$ac_t""$video_vgl" 1>&6
        if test x$video_vgl = xyes; then
            CFLAGS="$CFLAGS -DENABLE_VGL"
            SYSTEM_LIBS="$SYSTEM_LIBS -lvgl"

            VIDEO_SUBDIRS="$VIDEO_SUBDIRS vgl"
            VIDEO_DRIVERS="$VIDEO_DRIVERS vgl/libvideo_vgl.la"
        fi
    fi
}

CheckAAlib()
{
    # Check whether --enable-video-aalib or --disable-video-aalib was given.
if test "${enable_video_aalib+set}" = set; then
  enableval="$enable_video_aalib"
  :
else
  enable_video_aalib=no
fi

    if test x$enable_video = xyes -a x$enable_video_aalib = xyes; then
        echo $ac_n "checking for AAlib support""... $ac_c" 1>&6
echo "configure:5434: checking for AAlib support" >&5
        video_aalib=no
        cat > conftest.$ac_ext <<EOF
#line 5437 "configure"
#include "confdefs.h"

         #include <aalib.h>
        
int main() {

        
; return 0; }
EOF
if { (eval echo configure:5447: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  
        video_aalib=yes
        
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
fi
rm -f conftest*
        echo "$ac_t""$video_aalib" 1>&6
        if test x$video_aalib = xyes; then
            CFLAGS="$CFLAGS -DENABLE_AALIB"
            SYSTEM_LIBS="$SYSTEM_LIBS -laa"

            VIDEO_SUBDIRS="$VIDEO_SUBDIRS aalib"
            VIDEO_DRIVERS="$VIDEO_DRIVERS aalib/libvideo_aa.la"
        fi
    fi
}

CheckAtariXbiosVideo()
{
    # Check whether --enable-xbios or --disable-xbios was given.
if test "${enable_xbios+set}" = set; then
  enableval="$enable_xbios"
  :
else
  enable_video_xbios=yes
fi

    video_xbios=no
    if test x$enable_video = xyes -a x$enable_video_xbios = xyes; then
        video_xbios=yes
        CFLAGS="$CFLAGS -DENABLE_XBIOS"
        VIDEO_SUBDIRS="$VIDEO_SUBDIRS xbios"
        VIDEO_DRIVERS="$VIDEO_DRIVERS xbios/libvideo_xbios.la"
    fi
}

CheckAtariGemVideo()
{
    # Check whether --enable-gem or --disable-gem was given.
if test "${enable_gem+set}" = set; then
  enableval="$enable_gem"
  :
else
  enable_video_gem=yes
fi

    if test x$enable_video = xyes -a x$enable_video_gem = xyes; then
        video_gem=no
        ac_safe=`echo "gem.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for gem.h""... $ac_c" 1>&6
echo "configure:5501: checking for gem.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 5506 "configure"
#include "confdefs.h"
#include <gem.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:5511: \"$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_gem_hdr=yes
else
  echo "$ac_t""no" 1>&6
fi

        echo $ac_n "checking for appl_init in -lgem""... $ac_c" 1>&6
echo "configure:5533: checking for appl_init in -lgem" >&5
ac_lib_var=`echo gem'_'appl_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="-lgem  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 5541 "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 appl_init();

int main() {
appl_init()
; return 0; }
EOF
if { (eval echo configure:5552: \"$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_gem_lib=yes
else
  echo "$ac_t""no" 1>&6
fi

        if test x$have_gem_hdr = xyes -a x$have_gem_lib = xyes; then
            video_gem=yes
            CFLAGS="$CFLAGS -DENABLE_GEM"
            SYSTEM_LIBS="$SYSTEM_LIBS -lgem"
            VIDEO_SUBDIRS="$VIDEO_SUBDIRS gem"
            VIDEO_DRIVERS="$VIDEO_DRIVERS gem/libvideo_gem.la"
        fi
    fi
}

CheckAtariBiosEvent()
{
    CFLAGS="$CFLAGS -I\$(top_srcdir)/src/video/ataricommon"
    VIDEO_SUBDIRS="$VIDEO_SUBDIRS ataricommon"
    VIDEO_DRIVERS="$VIDEO_DRIVERS ataricommon/libvideo_ataricommon.la"
}

CheckDummyVideo()
{
    # Check whether --enable-video-dummy or --disable-video-dummy was given.
if test "${enable_video_dummy+set}" = set; then
  enableval="$enable_video_dummy"
  :
else
  enable_video_dummy=yes
fi

    if test x$enable_video_dummy = xyes; then
      CFLAGS="$CFLAGS -DENABLE_DUMMYVIDEO"
      VIDEO_SUBDIRS="$VIDEO_SUBDIRS dummy"
      VIDEO_DRIVERS="$VIDEO_DRIVERS dummy/libvideo_null.la"
    fi
}

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


CheckOpenGL()
{
    if test x$enable_video = xyes -a x$enable_video_opengl = xyes; then
        echo $ac_n "checking for OpenGL (GLX) support""... $ac_c" 1>&6
echo "configure:5619: checking for OpenGL (GLX) support" >&5
        video_opengl=no
        cat > conftest.$ac_ext <<EOF
#line 5622 "configure"
#include "confdefs.h"

         #include <GL/gl.h>
         #include <GL/glx.h>
         #include <dlfcn.h> /* For loading extensions */
        
int main() {

        
; return 0; }
EOF
if { (eval echo configure:5634: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  
        video_opengl=yes
        
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
fi
rm -f conftest*
        echo "$ac_t""$video_opengl" 1>&6
        if test x$video_opengl = xyes; then
            CFLAGS="$CFLAGS -DHAVE_OPENGL"
            if test x$use_dlopen != xyes; then
                echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
echo "configure:5649: 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 5657 "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:5668: \"$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
  SYSTEM_LIBS="$SYSTEM_LIBS -ldl"
else
  echo "$ac_t""no" 1>&6
fi

            fi
        fi
    fi
}

CheckOpenGLQNX()
{
    if test x$enable_video = xyes -a x$enable_video_opengl = xyes; then
        echo $ac_n "checking for OpenGL (Photon) support""... $ac_c" 1>&6
echo "configure:5697: checking for OpenGL (Photon) support" >&5
        video_opengl=no
        cat > conftest.$ac_ext <<EOF
#line 5700 "configure"
#include "confdefs.h"

         #include <GL/gl.h>
        
int main() {

        
; return 0; }
EOF
if { (eval echo configure:5710: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  
        video_opengl=yes
        
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
fi
rm -f conftest*
        echo "$ac_t""$video_opengl" 1>&6
        if test x$video_opengl = xyes; then
            CFLAGS="$CFLAGS -DHAVE_OPENGL"
            SYSTEM_LIBS="$SYSTEM_LIBS -lGL"
            if test x$use_dlopen != xyes; then
                echo $ac_n "checking for dlopen in -lc""... $ac_c" 1>&6
echo "configure:5726: checking for dlopen in -lc" >&5
ac_lib_var=`echo c'_'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="-lc  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 5734 "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:5745: \"$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
  SYSTEM_LIBS="$SYSTEM_LIBS"
else
  echo "$ac_t""no" 1>&6
echo $ac_n "checking for dlopen in -lltdl""... $ac_c" 1>&6
echo "configure:5764: checking for dlopen in -lltdl" >&5
ac_lib_var=`echo ltdl'_'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="-lltdl  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 5772 "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:5783: \"$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
  SYSTEM_LIBS="$SYSTEM_LIBS -lltdl"
else
  echo "$ac_t""no" 1>&6
fi

fi

            fi
        fi
    fi
}

CheckBeGL()
{
    if test x$enable_video = xyes -a x$enable_video_opengl = xyes; then
        CFLAGS="$CFLAGS -DHAVE_OPENGL"
        SYSTEM_LIBS="$SYSTEM_LIBS -lGL"
    fi
}

CheckMacGL()
{
    if test x$enable_video = xyes -a x$enable_video_opengl = xyes; then
        CFLAGS="$CFLAGS -DHAVE_OPENGL"
        case "$target" in
            *-*-darwin*)
                SYSTEM_LIBS="$SYSTEM_LIBS -framework OpenGL -framework AGL"
        esac
    fi
}

CheckInputEvents()
{
        # Check whether --enable-input-events or --disable-input-events was given.
if test "${enable_input_events+set}" = set; then
  enableval="$enable_input_events"
  :
else
  enable_input_events=yes
fi

    if test x$enable_input_events = xyes; then
        echo $ac_n "checking for Linux 2.4 unified input interface""... $ac_c" 1>&6
echo "configure:5841: checking for Linux 2.4 unified input interface" >&5
        use_input_events=no
        cat > conftest.$ac_ext <<EOF
#line 5844 "configure"
#include "confdefs.h"

          #include <linux/input.h>
        
int main() {

          #ifndef EVIOCGNAME
          #error EVIOCGNAME() ioctl not available
          #endif
        
; return 0; }
EOF
if { (eval echo configure:5857: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  
        use_input_events=yes
        
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
fi
rm -f conftest*
        echo "$ac_t""$use_input_events" 1>&6
        if test x$use_input_events = xyes; then
            CFLAGS="$CFLAGS -DUSE_INPUT_EVENTS"
        fi
    fi
}

CheckPTH()
{
        # Check whether --enable-pth or --disable-pth was given.
if test "${enable_pth+set}" = set; then
  enableval="$enable_pth"
  :
else
  enable_pth=yes
fi

    if test x$enable_threads = xyes -a x$enable_pth = xyes; then
        # Extract the first word of "pth-config", so it can be a program name with args.
set dummy pth-config; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:5888: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_PTH_CONFIG'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  case "$PTH_CONFIG" in
  /*)
  ac_cv_path_PTH_CONFIG="$PTH_CONFIG" # Let the user override the test with a path.
  ;;
  ?:/*)			 
  ac_cv_path_PTH_CONFIG="$PTH_CONFIG" # 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_PTH_CONFIG="$ac_dir/$ac_word"
      break
    fi
  done
  IFS="$ac_save_ifs"
  test -z "$ac_cv_path_PTH_CONFIG" && ac_cv_path_PTH_CONFIG="no"
  ;;
esac
fi
PTH_CONFIG="$ac_cv_path_PTH_CONFIG"
if test -n "$PTH_CONFIG"; then
  echo "$ac_t""$PTH_CONFIG" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

        if test "$PTH_CONFIG" = "no"; then
            use_pth=no
        else
            PTH_CFLAGS=`$PTH_CONFIG --cflags`
            PTH_LIBS=`$PTH_CONFIG --libs --all`
            SDL_CFLAGS="$SDL_CFLAGS $PTH_CFLAGS"
            SDL_LIBS="$SDL_LIBS $PTH_LIBS"
            CFLAGS="$CFLAGS -DENABLE_PTH"
            use_pth=yes
        fi
        echo $ac_n "checking pth""... $ac_c" 1>&6
echo "configure:5932: checking pth" >&5
        if test "x$use_pth" = xyes; then
            echo "$ac_t""yes" 1>&6
        else
            echo "$ac_t""no" 1>&6
        fi
    fi
}

CheckPTHREAD()
{
        # Check whether --enable-pthreads or --disable-pthreads was given.
if test "${enable_pthreads+set}" = set; then
  enableval="$enable_pthreads"
  :
else
  enable_pthreads=yes
fi

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

    case "$target" in
        *-*-bsdi*)
            pthread_cflags="-D_REENTRANT -D_THREAD_SAFE"
            pthread_lib=""
            ;;
        *-*-darwin*)
            pthread_cflags="-D_THREAD_SAFE"
# causes Carbon.p complaints?
#            pthread_cflags="-D_REENTRANT -D_THREAD_SAFE"
            ;;
        *-*-freebsd*)
            pthread_cflags="-D_REENTRANT -D_THREAD_SAFE"
            pthread_lib="-pthread"
            ;;
        *-*-netbsd*)
            pthread_cflags="-I/usr/pkg/include -D_REENTRANT"
            pthread_lib="-L/usr/pkg/lib -lpthread -lsem"
            ;;
        *-*-openbsd*)
            pthread_cflags="-D_REENTRANT"
            pthread_lib="-pthread"
            ;;
        *-*-solaris*)
            pthread_cflags="-D_REENTRANT"
            pthread_lib="-lpthread -lposix4"
            ;;
        *-*-sysv5*)
            pthread_cflags="-D_REENTRANT -Kthread"
            pthread_lib=""
            ;;
        *-*-irix*)
            pthread_cflags="-D_SGI_MP_SOURCE"
            pthread_lib="-lpthread"
            ;;
        *-*-aix*)
            pthread_cflags="-D_REENTRANT -mthreads"
            pthread_lib="-lpthread"
            ;;
        *-*-hpux11*)
            pthread_cflags="-D_REENTRANT"
            pthread_lib="-L/usr/lib -lpthread"
            ;;
        *-*-qnx*)
            pthread_cflags=""
            pthread_lib=""
            ;;
        *)
            pthread_cflags="-D_REENTRANT"
            pthread_lib="-lpthread"
            ;;
    esac
    if test x$enable_threads = xyes -a x$enable_pthreads = xyes; then
        # Save the original compiler flags and libraries
        ac_save_cflags="$CFLAGS"; ac_save_libs="$LIBS"
        # Add the pthread compiler flags and libraries
        CFLAGS="$CFLAGS $pthread_cflags"; LIBS="$LIBS $pthread_lib"
        # Check to see if we have pthread support on this system
        echo $ac_n "checking for pthreads""... $ac_c" 1>&6
echo "configure:6017: checking for pthreads" >&5
        use_pthreads=no
        cat > conftest.$ac_ext <<EOF
#line 6020 "configure"
#include "confdefs.h"

         #include <pthread.h>
        
int main() {

         pthread_attr_t type;
         pthread_attr_init(&type);
        
; return 0; }
EOF
if { (eval echo configure:6032: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  
        use_pthreads=yes
        
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
fi
rm -f conftest*
        echo "$ac_t""$use_pthreads" 1>&6
        # Restore the compiler flags and libraries
        CFLAGS="$ac_save_cflags"; LIBS="$ac_save_libs"
        # Do futher testing if we have pthread support...
        if test x$use_pthreads = xyes; then
            CFLAGS="$CFLAGS $pthread_cflags -DSDL_USE_PTHREADS"
            SDL_CFLAGS="$SDL_CFLAGS $pthread_cflags"
            SDL_LIBS="$SDL_LIBS $pthread_lib"

            # Check to see if recursive mutexes are available
            echo $ac_n "checking for recursive mutexes""... $ac_c" 1>&6
echo "configure:6053: checking for recursive mutexes" >&5
            has_recursive_mutexes=no
            cat > conftest.$ac_ext <<EOF
#line 6056 "configure"
#include "confdefs.h"

              #include <pthread.h>
            
int main() {

              pthread_mutexattr_t attr;
              #if defined(linux) && !(defined(__arm__) && defined(QWS))
              pthread_mutexattr_setkind_np(&attr, PTHREAD_MUTEX_RECURSIVE_NP);
              #else
              pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
              #endif
            
; return 0; }
EOF
if { (eval echo configure:6072: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  
            has_recursive_mutexes=yes
            
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
fi
rm -f conftest*
            # Some systems have broken recursive mutex implementations
            case "$target" in
                *-*-darwin*)
                    has_recursive_mutexes=no
                    ;;
                *-*-solaris*)
                    has_recursive_mutexes=no
                    ;;
            esac
            echo "$ac_t""$has_recursive_mutexes" 1>&6
            if test x$has_recursive_mutexes != xyes; then
                CFLAGS="$CFLAGS -DPTHREAD_NO_RECURSIVE_MUTEX"
            fi

            # Check to see if pthread semaphore support is missing
            if test x$enable_pthread_sem = xyes; then
                echo $ac_n "checking for pthread semaphores""... $ac_c" 1>&6
echo "configure:6099: checking for pthread semaphores" >&5
                have_pthread_sem=no
                cat > conftest.$ac_ext <<EOF
#line 6102 "configure"
#include "confdefs.h"

                  #include <pthread.h>
                  #include <semaphore.h>
                
int main() {

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

            # Check to see if this is broken glibc 2.0 pthreads
            case "$target" in
                *-*-linux*)
                    echo $ac_n "checking for broken glibc 2.0 pthreads""... $ac_c" 1>&6
echo "configure:6130: checking for broken glibc 2.0 pthreads" >&5
                    glibc20_pthreads=no
                    cat > conftest.$ac_ext <<EOF
#line 6133 "configure"
#include "confdefs.h"

                      #include <features.h>
                      #if (__GLIBC__ == 2) && (__GLIBC_MINOR__ == 0)
                      #warning Working around a bug in glibc 2.0 pthreads
                      #else
                      #error pthread implementation okay
                      #endif /* glibc 2.0 */
                    
int main() {

                    
; return 0; }
EOF
if { (eval echo configure:6148: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  
                    glibc20_pthreads=yes
                    
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
fi
rm -f conftest*
                    echo "$ac_t""$glibc20_pthreads" 1>&6
            esac
        fi
    fi

    echo $ac_n "checking whether semun is defined in /usr/include/sys/sem.h""... $ac_c" 1>&6
echo "configure:6164: checking whether semun is defined in /usr/include/sys/sem.h" >&5
    have_semun=no
    cat > conftest.$ac_ext <<EOF
#line 6167 "configure"
#include "confdefs.h"

      #include <sys/types.h>
      #include <sys/sem.h>
    
int main() {

      union semun t;
    
; return 0; }
EOF
if { (eval echo configure:6179: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  
    have_semun=yes
    
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
fi
rm -f conftest*
    echo "$ac_t""$have_semun" 1>&6
    if test x$have_semun = xyes; then
        CFLAGS="$CFLAGS -DHAVE_SEMUN"
    fi

    # See if we can use GNU Pth or clone() on Linux directly
    if test x$enable_threads = xyes -a x$use_pthreads != xyes; then
        CheckPTH
        if test x$use_pth != xyes; then
            case "$target" in
                *-*-linux*)
                    use_clone=yes
                    ;;
            esac
        fi
    fi
}

# Note that we need to have either semaphores or to have mutexes and
# condition variables to implement all thread synchronization primitives
CopyUnixThreadSource()
{
    if test x$use_pthreads = xyes -o x$use_clone = xyes; then
        # Basic thread creation functions
        
  echo "Copying src/thread/linux/SDL_systhread.c -> src/thread/SDL_systhread.c"
  old="$srcdir/src/thread/linux/SDL_systhread.c"
  new="$srcdir/src/thread/SDL_systhread.c"
  cat >$new <<__EOF__
/* WARNING:  This file was automatically generated!
 * Original: $old
 */
__EOF__
  cat >>$new <$old

        if test x$use_clone = xyes; then
            
  echo "Copying src/thread/linux/clone.S -> src/thread/clone.S"
  old="$srcdir/src/thread/linux/clone.S"
  new="$srcdir/src/thread/clone.S"
  cat >$new <<__EOF__
/* WARNING:  This file was automatically generated!
 * Original: $old
 */
__EOF__
  cat >>$new <$old

        fi
        
  echo "Copying src/thread/linux/SDL_systhread_c.h -> src/thread/SDL_systhread_c.h"
  old="$srcdir/src/thread/linux/SDL_systhread_c.h"
  new="$srcdir/src/thread/SDL_systhread_c.h"
  cat >$new <<__EOF__
/* WARNING:  This file was automatically generated!
 * Original: $old
 */
__EOF__
  cat >>$new <$old


        # Semaphores
        # We can fake these with mutexes and condition variables if necessary
        if test x$use_pthreads = xyes -a x$have_pthread_sem != xyes; then
            
  echo "Copying src/thread/generic/SDL_syssem.c -> src/thread/SDL_syssem.c"
  old="$srcdir/src/thread/generic/SDL_syssem.c"
  new="$srcdir/src/thread/SDL_syssem.c"
  cat >$new <<__EOF__
/* WARNING:  This file was automatically generated!
 * Original: $old
 */
__EOF__
  cat >>$new <$old

        else
            
  echo "Copying src/thread/linux/SDL_syssem.c -> src/thread/SDL_syssem.c"
  old="$srcdir/src/thread/linux/SDL_syssem.c"
  new="$srcdir/src/thread/SDL_syssem.c"
  cat >$new <<__EOF__
/* WARNING:  This file was automatically generated!
 * Original: $old
 */
__EOF__
  cat >>$new <$old

        fi
        
  echo "Copying src/thread/generic/SDL_syssem_c.h -> src/thread/SDL_syssem_c.h"
  old="$srcdir/src/thread/generic/SDL_syssem_c.h"
  new="$srcdir/src/thread/SDL_syssem_c.h"
  cat >$new <<__EOF__
/* WARNING:  This file was automatically generated!
 * Original: $old
 */
__EOF__
  cat >>$new <$old


        # Mutexes
        # We can fake these with semaphores if necessary
        case "$target" in
            *-*-bsdi*)
                
  echo "Copying src/thread/bsdi/SDL_syssem.c -> src/thread/SDL_syssem.c"
  old="$srcdir/src/thread/bsdi/SDL_syssem.c"
  new="$srcdir/src/thread/SDL_syssem.c"
  cat >$new <<__EOF__
/* WARNING:  This file was automatically generated!
 * Original: $old
 */
__EOF__
  cat >>$new <$old

                
  echo "Copying src/thread/generic/SDL_syssem_c.h -> src/thread/SDL_syssem_c.h"
  old="$srcdir/src/thread/generic/SDL_syssem_c.h"
  new="$srcdir/src/thread/SDL_syssem_c.h"
  cat >$new <<__EOF__
/* WARNING:  This file was automatically generated!
 * Original: $old
 */
__EOF__
  cat >>$new <$old

                
  echo "Copying src/thread/linux/SDL_sysmutex.c -> src/thread/SDL_sysmutex.c"
  old="$srcdir/src/thread/linux/SDL_sysmutex.c"
  new="$srcdir/src/thread/SDL_sysmutex.c"
  cat >$new <<__EOF__
/* WARNING:  This file was automatically generated!
 * Original: $old
 */
__EOF__
  cat >>$new <$old

                
  echo "Copying src/thread/linux/SDL_sysmutex_c.h -> src/thread/SDL_sysmutex_c.h"
  old="$srcdir/src/thread/linux/SDL_sysmutex_c.h"
  new="$srcdir/src/thread/SDL_sysmutex_c.h"
  cat >$new <<__EOF__
/* WARNING:  This file was automatically generated!
 * Original: $old
 */
__EOF__
  cat >>$new <$old

                ;;
            *)
                if test x$glibc20_pthreads = xyes; then
                    
  echo "Copying src/thread/generic/SDL_sysmutex.c -> src/thread/SDL_sysmutex.c"
  old="$srcdir/src/thread/generic/SDL_sysmutex.c"
  new="$srcdir/src/thread/SDL_sysmutex.c"
  cat >$new <<__EOF__
/* WARNING:  This file was automatically generated!
 * Original: $old
 */
__EOF__
  cat >>$new <$old

                    
  echo "Copying src/thread/generic/SDL_sysmutex_c.h -> src/thread/SDL_sysmutex_c.h"
  old="$srcdir/src/thread/generic/SDL_sysmutex_c.h"
  new="$srcdir/src/thread/SDL_sysmutex_c.h"
  cat >$new <<__EOF__
/* WARNING:  This file was automatically generated!
 * Original: $old
 */
__EOF__
  cat >>$new <$old

                else
                    
  echo "Copying src/thread/linux/SDL_sysmutex.c -> src/thread/SDL_sysmutex.c"
  old="$srcdir/src/thread/linux/SDL_sysmutex.c"
  new="$srcdir/src/thread/SDL_sysmutex.c"
  cat >$new <<__EOF__
/* WARNING:  This file was automatically generated!
 * Original: $old
 */
__EOF__
  cat >>$new <$old

                    
  echo "Copying src/thread/linux/SDL_sysmutex_c.h -> src/thread/SDL_sysmutex_c.h"
  old="$srcdir/src/thread/linux/SDL_sysmutex_c.h"
  new="$srcdir/src/thread/SDL_sysmutex_c.h"
  cat >$new <<__EOF__
/* WARNING:  This file was automatically generated!
 * Original: $old
 */
__EOF__
  cat >>$new <$old

                fi
                ;;
        esac

        # Condition variables
        # We can fake these with semaphores and mutexes if necessary
        if test x$glibc20_pthreads = xyes -o x$has_recursive_mutexes != xyes; then
            
  echo "Copying src/thread/generic/SDL_syscond.c -> src/thread/SDL_syscond.c"
  old="$srcdir/src/thread/generic/SDL_syscond.c"
  new="$srcdir/src/thread/SDL_syscond.c"
  cat >$new <<__EOF__
/* WARNING:  This file was automatically generated!
 * Original: $old
 */
__EOF__
  cat >>$new <$old

        else
            
  echo "Copying src/thread/linux/SDL_syscond.c -> src/thread/SDL_syscond.c"
  old="$srcdir/src/thread/linux/SDL_syscond.c"
  new="$srcdir/src/thread/SDL_syscond.c"
  cat >$new <<__EOF__
/* WARNING:  This file was automatically generated!
 * Original: $old
 */
__EOF__
  cat >>$new <$old

        fi
        
  echo "Copying src/thread/generic/SDL_syscond_c.h -> src/thread/SDL_syscond_c.h"
  old="$srcdir/src/thread/generic/SDL_syscond_c.h"
  new="$srcdir/src/thread/SDL_syscond_c.h"
  cat >$new <<__EOF__
/* WARNING:  This file was automatically generated!
 * Original: $old
 */
__EOF__
  cat >>$new <$old


    elif test x$use_pth = xyes; then
        
  echo "Copying src/thread/pth/SDL_systhread.c -> src/thread/SDL_systhread.c"
  old="$srcdir/src/thread/pth/SDL_systhread.c"
  new="$srcdir/src/thread/SDL_systhread.c"
  cat >$new <<__EOF__
/* WARNING:  This file was automatically generated!
 * Original: $old
 */
__EOF__
  cat >>$new <$old

        
  echo "Copying src/thread/pth/SDL_systhread_c.h -> src/thread/SDL_systhread_c.h"
  old="$srcdir/src/thread/pth/SDL_systhread_c.h"
  new="$srcdir/src/thread/SDL_systhread_c.h"
  cat >$new <<__EOF__
/* WARNING:  This file was automatically generated!
 * Original: $old
 */
__EOF__
  cat >>$new <$old

        
  echo "Copying src/thread/pth/SDL_sysmutex.c -> src/thread/SDL_sysmutex.c"
  old="$srcdir/src/thread/pth/SDL_sysmutex.c"
  new="$srcdir/src/thread/SDL_sysmutex.c"
  cat >$new <<__EOF__
/* WARNING:  This file was automatically generated!
 * Original: $old
 */
__EOF__
  cat >>$new <$old

        
  echo "Copying src/thread/pth/SDL_sysmutex_c.h -> src/thread/SDL_sysmutex_c.h"
  old="$srcdir/src/thread/pth/SDL_sysmutex_c.h"
  new="$srcdir/src/thread/SDL_sysmutex_c.h"
  cat >$new <<__EOF__
/* WARNING:  This file was automatically generated!
 * Original: $old
 */
__EOF__
  cat >>$new <$old

        
  echo "Copying src/thread/pth/SDL_syscond.c -> src/thread/SDL_syscond.c"
  old="$srcdir/src/thread/pth/SDL_syscond.c"
  new="$srcdir/src/thread/SDL_syscond.c"
  cat >$new <<__EOF__
/* WARNING:  This file was automatically generated!
 * Original: $old
 */
__EOF__
  cat >>$new <$old

        
  echo "Copying src/thread/pth/SDL_syscond_c.h -> src/thread/SDL_syscond_c.h"
  old="$srcdir/src/thread/pth/SDL_syscond_c.h"
  new="$srcdir/src/thread/SDL_syscond_c.h"
  cat >$new <<__EOF__
/* WARNING:  This file was automatically generated!
 * Original: $old
 */
__EOF__
  cat >>$new <$old

        
  echo "Copying src/thread/generic/SDL_syssem.c -> src/thread/SDL_syssem.c"
  old="$srcdir/src/thread/generic/SDL_syssem.c"
  new="$srcdir/src/thread/SDL_syssem.c"
  cat >$new <<__EOF__
/* WARNING:  This file was automatically generated!
 * Original: $old
 */
__EOF__
  cat >>$new <$old

        
  echo "Copying src/thread/generic/SDL_syssem_c.h -> src/thread/SDL_syssem_c.h"
  old="$srcdir/src/thread/generic/SDL_syssem_c.h"
  new="$srcdir/src/thread/SDL_syssem_c.h"
  cat >$new <<__EOF__
/* WARNING:  This file was automatically generated!
 * Original: $old
 */
__EOF__
  cat >>$new <$old

    else
       { echo "configure: error: 
*** No thread support detected
       " 1>&2; exit 1; }
    fi
}

CheckWIN32()
{
    echo $ac_n "checking Win32 compiler""... $ac_c" 1>&6
echo "configure:6526: checking Win32 compiler" >&5
    have_win32_gcc=no
    cat > conftest.$ac_ext <<EOF
#line 6529 "configure"
#include "confdefs.h"

     #include <windows.h>
    
int main() {

    
; return 0; }
EOF
if { (eval echo configure:6539: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  
    have_win32_gcc=yes
    
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
fi
rm -f conftest*
    echo "$ac_t""$have_win32_gcc" 1>&6
    if test x$have_win32_gcc != xyes; then
       { echo "configure: error: 
*** Your compiler ($CC) does not produce Win32 executables!
       " 1>&2; exit 1; }
    fi

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

    if test x$enable_stdio_redirect != xyes; then
        CFLAGS="$CFLAGS -DNO_STDIO_REDIRECT"
    fi
}

CheckDIRECTX()
{
    # Check whether --enable-directx or --disable-directx was given.
if test "${enable_directx+set}" = set; then
  enableval="$enable_directx"
  :
else
  enable_directx=yes
fi

    if test x$enable_directx = xyes; then
        echo $ac_n "checking for DirectX headers and libraries""... $ac_c" 1>&6
echo "configure:6581: checking for DirectX headers and libraries" >&5
        use_directx=no
        cat > conftest.$ac_ext <<EOF
#line 6584 "configure"
#include "confdefs.h"

         #include "src/video/windx5/directx.h"
        
int main() {

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

    CFLAGS="$CFLAGS -I\$(top_srcdir)/src/video/wincommon"
    SYSTEM_LIBS="$SYSTEM_LIBS -luser32 -lgdi32 -lwinmm"
    VIDEO_SUBDIRS="$VIDEO_SUBDIRS wincommon"
    VIDEO_DRIVERS="$VIDEO_DRIVERS wincommon/libvideo_wincommon.la"
    # Enable the DIB driver
    CFLAGS="$CFLAGS -DENABLE_WINDIB"
    VIDEO_SUBDIRS="$VIDEO_SUBDIRS windib"
    VIDEO_DRIVERS="$VIDEO_DRIVERS windib/libvideo_windib.la"
    # See if we should enable the DirectX driver
    if test x$use_directx = xyes; then
        CFLAGS="$CFLAGS -DENABLE_DIRECTX"
        SYSTEM_LIBS="$SYSTEM_LIBS -ldxguid"
        VIDEO_SUBDIRS="$VIDEO_SUBDIRS windx5"
        VIDEO_DRIVERS="$VIDEO_DRIVERS windx5/libvideo_windx5.la"
    fi
}

CheckBWINDOW()
{
    CFLAGS="$CFLAGS -DENABLE_BWINDOW"
    VIDEO_SUBDIRS="$VIDEO_SUBDIRS bwindow"
    VIDEO_DRIVERS="$VIDEO_DRIVERS bwindow/libvideo_bwindow.la"
}

CheckQtopia()
{
    # Check whether --enable-video-qtopia or --disable-video-qtopia was given.
if test "${enable_video_qtopia+set}" = set; then
  enableval="$enable_video_qtopia"
  :
else
  enable_video_qtopia=no
fi

    if test x$enable_video = xyes -a x$enable_video_qtopia = xyes; then
        echo $ac_n "checking for Qtopia support""... $ac_c" 1>&6
echo "configure:6643: checking for Qtopia support" >&5
        video_qtopia=no
        ac_ext=C
# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CXXCPP $CPPFLAGS'
ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cxx_cross

        OLD_CXX="$CXXFLAGS"
        CXXFLAGS="-DQT_QWS_EBX -fno-rtti -fno-exceptions -DQT_QWS_CUSTOM -DQWS -I${QPEDIR}/include -I${QTDIR}/include/ -DNO_DEBUG"
        cat > conftest.$ac_ext <<EOF
#line 6655 "configure"
#include "confdefs.h"

         #include <qpe/qpeapplication.h>
        
int main() {

        
; return 0; }
EOF
if { (eval echo configure:6665: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  
        video_qtopia=yes
        
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
fi
rm -f conftest*
        CXXFLAGS="$OLD_CXX"
        echo "$ac_t""$video_qtopia" 1>&6
        if test x$video_qtopia = xyes; then
            CFLAGS="$CFLAGS -DENABLE_QTOPIA -DQT_QWS_EBX -DQT_QWS_CUSTOM -DQWS -I${QPEDIR}/include -I${QTDIR}/include/ -DNO_DEBUG -fno-rtti -fno-exceptions"
            SDL_LIBS="$SDL_LIBS -L${QPEDIR}/lib -L${QTDIR}/lib/ -lqpe -lqte"
            SDL_CFLAGS="$SDL_CFLAGS -DQWS"	  
            VIDEO_SUBDIRS="$VIDEO_SUBDIRS qtopia"
            VIDEO_DRIVERS="$VIDEO_DRIVERS qtopia/libvideo_qtopia.la"
        else
	{ echo "configure: error: 
*** Failed to find Qtopia includes. Make sure that the QTDIR and QPEDIR
*** environment variables are set correctly." 1>&2; exit 1; }
        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

    fi
}

CheckPicoGUI()
{
    # Check whether --enable-video-picogui or --disable-video-picogui was given.
if test "${enable_video_picogui+set}" = set; then
  enableval="$enable_video_picogui"
  :
else
  enable_video_picogui=no
fi

    if test x$enable_video = xyes -a x$enable_video_picogui = xyes; then
        echo $ac_n "checking for PicoGUI support""... $ac_c" 1>&6
echo "configure:6710: checking for PicoGUI support" >&5
        video_picogui=no
        cat > conftest.$ac_ext <<EOF
#line 6713 "configure"
#include "confdefs.h"

         #include <picogui.h>
        
int main() {

        
; return 0; }
EOF
if { (eval echo configure:6723: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  
        video_picogui=yes
        
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
fi
rm -f conftest*
        echo "$ac_t""$video_picogui" 1>&6
        if test x$video_picogui = xyes; then
	    SDL_LIBS="$SDL_LIBS -lpgui"
            CFLAGS="$CFLAGS -DENABLE_PICOGUI"
            VIDEO_SUBDIRS="$VIDEO_SUBDIRS picogui"
            VIDEO_DRIVERS="$VIDEO_DRIVERS picogui/libvideo_picogui.la"
        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

    fi
}

CheckTOOLBOX()
{
    VIDEO_SUBDIRS="$VIDEO_SUBDIRS maccommon"
    VIDEO_DRIVERS="$VIDEO_DRIVERS maccommon/libvideo_maccommon.la"
    VIDEO_SUBDIRS="$VIDEO_SUBDIRS macrom"
    VIDEO_DRIVERS="$VIDEO_DRIVERS macrom/libvideo_macrom.la"
}

CheckCARBON()
{
    # "MACOSX" is not an official definition, but it's commonly
    # accepted as a way to differentiate between what runs on X
    # and what runs on older Macs - while in theory "Carbon" defns
    # are consistent between the two, in practice Carbon is still
    # changing. -sts Aug 2000
    mac_autoconf_target_workaround="MAC"
    CFLAGS="$CFLAGS -I/System/Library/Frameworks/Carbon.framework/Headers \
      -fpascal-strings -DENABLE_TOOLBOX -DMACOSX -DTARGET_API_${mac_autoconf_target_workaround}_CARBON=1 -I\$(top_srcdir)/src/video/maccommon -I\$(top_srcdir)/src/video/macrom -I\$(top_srcdir)/src/video/macdsp"
    VIDEO_SUBDIRS="$VIDEO_SUBDIRS maccommon"
    VIDEO_DRIVERS="$VIDEO_DRIVERS maccommon/libvideo_maccommon.la"
    VIDEO_SUBDIRS="$VIDEO_SUBDIRS macrom"
    VIDEO_DRIVERS="$VIDEO_DRIVERS macrom/libvideo_macrom.la"
}

CheckQUARTZ()
{
    # "MACOSX" is not an official definition, but it's commonly
    # accepted as a way to differentiate between what runs on X
    # and what runs on older Macs - while in theory "Carbon" defns
    # are consistent between the two, in practice Carbon is still
    # changing. -sts Aug 2000
    mac_autoconf_target_workaround="MAC"
    CFLAGS="$CFLAGS -I/System/Library/Frameworks/Carbon.framework/Headers \
      -I/System/Library/Frameworks/Cocoa.framework/Headers -fpascal-strings \
      -DENABLE_QUARTZ -DMACOSX -DTARGET_API_${mac_autoconf_target_workaround}_CARBON=1 -I\$(top_srcdir)/src/video/quartz"
    VIDEO_SUBDIRS="$VIDEO_SUBDIRS quartz"
    VIDEO_DRIVERS="$VIDEO_DRIVERS quartz/libvideo_quartz.la"
}

CheckDLOPEN()
{
    # Check whether --enable-dlopen or --disable-dlopen was given.
if test "${enable_dlopen+set}" = set; then
  enableval="$enable_dlopen"
  :
else
  enable_dlopen=yes
fi

    if test x$enable_dlopen = xyes; then
        echo $ac_n "checking for dlopen""... $ac_c" 1>&6
echo "configure:6801: checking for dlopen" >&5
        use_dlopen=no
        cat > conftest.$ac_ext <<EOF
#line 6804 "configure"
#include "confdefs.h"

         #include <dlfcn.h>
        
int main() {

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

        if test x$use_dlopen = xyes; then
            CFLAGS="$CFLAGS -DUSE_DLOPEN"
            echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
echo "configure:6829: 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 6837 "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:6848: \"$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
  SYSTEM_LIBS="$SYSTEM_LIBS -ldl"
else
  echo "$ac_t""no" 1>&6
echo $ac_n "checking for dlopen in -lltdl""... $ac_c" 1>&6
echo "configure:6867: checking for dlopen in -lltdl" >&5
ac_lib_var=`echo ltdl'_'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="-lltdl  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 6875 "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:6886: \"$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
  SYSTEM_LIBS="$SYSTEM_LIBS -lltdl"
else
  echo "$ac_t""no" 1>&6
fi

fi

        fi
    fi
}

CheckAtariLdg()
{
    # Check whether --enable-atari-ldg or --disable-atari-ldg was given.
if test "${enable_atari_ldg+set}" = set; then
  enableval="$enable_atari_ldg"
  :
else
  enable_atari_ldg=yes
fi

    if test x$video_gem = xyes -a x$enable_atari_ldg = xyes; then
        ac_safe=`echo "ldg.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for ldg.h""... $ac_c" 1>&6
echo "configure:6925: checking for ldg.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 6930 "configure"
#include "confdefs.h"
#include <ldg.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:6935: \"$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_ldg_hdr=yes
else
  echo "$ac_t""no" 1>&6
fi

        echo $ac_n "checking for ldg_open in -lldg""... $ac_c" 1>&6
echo "configure:6957: checking for ldg_open in -lldg" >&5
ac_lib_var=`echo ldg'_'ldg_open | 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="-lldg -lgem $LIBS"
cat > conftest.$ac_ext <<EOF
#line 6965 "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 ldg_open();

int main() {
ldg_open()
; return 0; }
EOF
if { (eval echo configure:6976: \"$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_ldg_lib=yes
else
  echo "$ac_t""no" 1>&6
have_ldg_lib=no
fi

        if test x$have_ldg_hdr = xyes -a x$have_ldg_lib = xyes; then
            CFLAGS="$CFLAGS -DENABLE_LDG"
            SYSTEM_LIBS="$SYSTEM_LIBS -lldg"
        fi
    fi
}

CheckUSBHID()
{
    if test x$enable_joystick = xyes; then
        have_libusbhid=no
        have_libusb=no
        echo $ac_n "checking for hid_init in -lusbhid""... $ac_c" 1>&6
echo "configure:7010: checking for hid_init in -lusbhid" >&5
ac_lib_var=`echo usbhid'_'hid_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="-lusbhid  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 7018 "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 hid_init();

int main() {
hid_init()
; return 0; }
EOF
if { (eval echo configure:7029: \"$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_libusbhid=yes
else
  echo "$ac_t""no" 1>&6
fi

        echo $ac_n "checking for hid_init in -lusb""... $ac_c" 1>&6
echo "configure:7050: checking for hid_init in -lusb" >&5
ac_lib_var=`echo usb'_'hid_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="-lusb  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 7058 "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 hid_init();

int main() {
hid_init()
; return 0; }
EOF
if { (eval echo configure:7069: \"$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_libusb=yes
else
  echo "$ac_t""no" 1>&6
fi

        if test x$have_libusbhid = xyes; then
            SYSTEM_LIBS="$SYSTEM_LIBS -lusbhid"
        fi
        if test x$have_libusb = xyes; then
            SYSTEM_LIBS="$SYSTEM_LIBS -lusb"
        fi

        ac_safe=`echo "usb.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for usb.h""... $ac_c" 1>&6
echo "configure:7098: checking for usb.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 7103 "configure"
#include "confdefs.h"
#include <usb.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:7108: \"$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_usb_h=yes
else
  echo "$ac_t""no" 1>&6
fi

        ac_safe=`echo "usbhid.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for usbhid.h""... $ac_c" 1>&6
echo "configure:7131: checking for usbhid.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 7136 "configure"
#include "confdefs.h"
#include <usbhid.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:7141: \"$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_usbhid_h=yes
else
  echo "$ac_t""no" 1>&6
fi

        ac_safe=`echo "libusb.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for libusb.h""... $ac_c" 1>&6
echo "configure:7164: checking for libusb.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 7169 "configure"
#include "confdefs.h"
#include <libusb.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:7174: \"$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_libusb_h=yes
else
  echo "$ac_t""no" 1>&6
fi

        ac_safe=`echo "libusbhid.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for libusbhid.h""... $ac_c" 1>&6
echo "configure:7197: checking for libusbhid.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 7202 "configure"
#include "confdefs.h"
#include <libusbhid.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:7207: \"$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_libusbhid_h=yes
else
  echo "$ac_t""no" 1>&6
fi

        if test x$have_usb_h = xyes; then
            CFLAGS="$CFLAGS -DHAVE_USB_H"
        fi
        if test x$have_usbhid_h = xyes; then
            CFLAGS="$CFLAGS -DHAVE_USBHID_H"
        fi
        if test x$have_libusb_h = xyes; then
            CFLAGS="$CFLAGS -DHAVE_LIBUSB_H"
        fi
        if test x$have_libusbhid_h = xyes; then
            CFLAGS="$CFLAGS -DHAVE_LIBUSBHID_H"
        fi

        echo $ac_n "checking for usbhid""... $ac_c" 1>&6
echo "configure:7242: checking for usbhid" >&5
        have_usbhid=no
        cat > conftest.$ac_ext <<EOF
#line 7245 "configure"
#include "confdefs.h"

          #include <sys/types.h>
          #if defined(HAVE_USB_H)
          #include <usb.h>
          #endif
          #include <dev/usb/usb.h>
          #include <dev/usb/usbhid.h>
          #if defined(HAVE_USBHID_H)
          #include <usbhid.h>
          #elif defined(HAVE_LIBUSB_H)
          #include <libusb.h>
          #elif defined(HAVE_LIBUSBHID_H)
          #include <libusbhid.h>
          #endif
        
int main() {

          struct report_desc *repdesc;
          struct usb_ctl_report *repbuf;
          hid_kind_t hidkind;
        
; return 0; }
EOF
if { (eval echo configure:7270: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  
        have_usbhid=yes
        
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
fi
rm -f conftest*
        echo "$ac_t""$have_usbhid" 1>&6

        if test x$have_usbhid = xyes; then
            echo $ac_n "checking for ucr_data member of usb_ctl_report""... $ac_c" 1>&6
echo "configure:7284: checking for ucr_data member of usb_ctl_report" >&5
            have_usbhid_ucr_data=no
            cat > conftest.$ac_ext <<EOF
#line 7287 "configure"
#include "confdefs.h"

              #include <sys/types.h>
              #if defined(HAVE_USB_H)
              #include <usb.h>
              #endif
              #include <dev/usb/usb.h>
              #include <dev/usb/usbhid.h>
              #if defined(HAVE_USBHID_H)
              #include <usbhid.h>
              #elif defined(HAVE_LIBUSB_H)
              #include <libusb.h>
              #elif defined(HAVE_LIBUSBHID_H)
              #include <libusbhid.h>
              #endif
            
int main() {

              struct usb_ctl_report buf;
              if (buf.ucr_data) { }
            
; return 0; }
EOF
if { (eval echo configure:7311: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  
            have_usbhid_ucr_data=yes
            
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
fi
rm -f conftest*
            if test x$have_usbhid_ucr_data = xyes; then
                CFLAGS="$CFLAGS -DUSBHID_UCR_DATA"
            fi
            echo "$ac_t""$have_usbhid_ucr_data" 1>&6
            
	    echo $ac_n "checking for new usbhid API""... $ac_c" 1>&6
echo "configure:7327: checking for new usbhid API" >&5
            have_usbhid_new=no
            cat > conftest.$ac_ext <<EOF
#line 7330 "configure"
#include "confdefs.h"

              #include <sys/types.h>
              #if defined(HAVE_USB_H)
              #include <usb.h>
              #endif
              #include <dev/usb/usb.h>
              #include <dev/usb/usbhid.h>
              #if defined(HAVE_USBHID_H)
              #include <usbhid.h>
              #elif defined(HAVE_LIBUSB_H)
              #include <libusb.h>
              #elif defined(HAVE_LIBUSBHID_H)
              #include <libusbhid.h>
              #endif
            
int main() {

              report_desc_t d;
	      hid_start_parse(d, 1, 1);
            
; return 0; }
EOF
if { (eval echo configure:7354: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  
            have_usbhid_new=yes
            
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
fi
rm -f conftest*
            if test x$have_usbhid_new = xyes; then
                CFLAGS="$CFLAGS -DUSBHID_NEW"
            fi
            echo "$ac_t""$have_usbhid_new" 1>&6

            JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS bsd"
            JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS bsd/libjoystick_bsd.la"
        fi
    fi
}

case "$target" in
    *-*-linux*)
        ARCH=linux
        CheckDummyVideo
        CheckDiskAudio
        CheckDLOPEN
        CheckNASM
        CheckOSS
        CheckALSA
        CheckARTSC
        CheckESD
        CheckNAS
        CheckX11
        CheckNANOX
        CheckDGA
        CheckFBCON
        CheckDirectFB
        CheckPS2GS
        CheckGGI
        CheckSVGA
        CheckAAlib
        CheckQtopia
        CheckPicoGUI
        CheckOpenGL
        CheckInputEvents
        CheckPTHREAD
        # Set up files for the main() stub
        if test "x$video_qtopia" = "xyes"; then
          
  echo "Copying src/main/linux/SDL_Qtopia_main.cc -> src/main/SDL_Qtopia_main.cc"
  old="$srcdir/src/main/linux/SDL_Qtopia_main.cc"
  new="$srcdir/src/main/SDL_Qtopia_main.cc"
  cat >$new <<__EOF__
/* WARNING:  This file was automatically generated!
 * Original: $old
 */
__EOF__
  cat >>$new <$old

          SDL_CFLAGS="$SDL_CFLAGS -Dmain=SDL_main"
          SDL_LIBS="-lSDLmain $SDL_LIBS"
        else
          
  echo "Copying src/main/linux/SDL_main.c -> src/main/SDL_main.c"
  old="$srcdir/src/main/linux/SDL_main.c"
  new="$srcdir/src/main/SDL_main.c"
  cat >$new <<__EOF__
/* WARNING:  This file was automatically generated!
 * Original: $old
 */
__EOF__
  cat >>$new <$old

        fi
        # Set up files for the audio library
        # We use the OSS and ALSA API's, not the Sun audio API
        #if test x$enable_audio = xyes; then
        #    CFLAGS="$CFLAGS -DSUNAUDIO_SUPPORT"
        #    AUDIO_SUBDIRS="$AUDIO_SUBDIRS sun"
        #    AUDIO_DRIVERS="$AUDIO_DRIVERS sun/libaudio_sun.la"
        #fi
        # Set up files for the joystick library
        if test x$enable_joystick = xyes; then
            JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS linux"
            JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS linux/libjoystick_linux.la"
        fi
        # Set up files for the cdrom library
        if test x$enable_cdrom = xyes; then
            CDROM_SUBDIRS="$CDROM_SUBDIRS linux"
            CDROM_DRIVERS="$CDROM_DRIVERS linux/libcdrom_linux.la"
        fi
        # Set up files for the thread library
        if test x$enable_threads = xyes; then
            CopyUnixThreadSource
        fi
        # Set up files for the timer library
        if test x$enable_timers = xyes; then
            
  echo "Copying src/timer/linux/SDL_systimer.c -> src/timer/SDL_systimer.c"
  old="$srcdir/src/timer/linux/SDL_systimer.c"
  new="$srcdir/src/timer/SDL_systimer.c"
  cat >$new <<__EOF__
/* WARNING:  This file was automatically generated!
 * Original: $old
 */
__EOF__
  cat >>$new <$old

        fi
        ;;
    *-*-bsdi*)
        ARCH=bsdi
        CheckDummyVideo
        CheckDiskAudio
        CheckDLOPEN
        CheckNASM
        CheckOSS
        CheckARTSC
        CheckESD
        CheckNAS
        CheckX11
        CheckDGA
        CheckSVGA
        CheckAAlib
        CheckOpenGL
        CheckPTHREAD
        # Set up files for the main() stub
        
  echo "Copying src/main/linux/SDL_main.c -> src/main/SDL_main.c"
  old="$srcdir/src/main/linux/SDL_main.c"
  new="$srcdir/src/main/SDL_main.c"
  cat >$new <<__EOF__
/* WARNING:  This file was automatically generated!
 * Original: $old
 */
__EOF__
  cat >>$new <$old

        # Set up files for the audio library
        # We use the OSS and ALSA API's, not the Sun audio API
        #if test x$enable_audio = xyes; then
        #    CFLAGS="$CFLAGS -DSUNAUDIO_SUPPORT"
        #    AUDIO_SUBDIRS="$AUDIO_SUBDIRS sun"
        #    AUDIO_DRIVERS="$AUDIO_DRIVERS sun/libaudio_sun.la"
        #fi
        # Set up files for the joystick library
        # (No joystick support yet)
        if test x$enable_joystick = xyes; then
            JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS dummy"
            JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS dummy/libjoystick_dummy.la"
        fi
        # Set up files for the cdrom library
        if test x$enable_cdrom = xyes; then
            CDROM_SUBDIRS="$CDROM_SUBDIRS bsdi"
            CDROM_DRIVERS="$CDROM_DRIVERS bsdi/libcdrom_bsdi.la"
        fi
        # Set up files for the thread library
        if test x$enable_threads = xyes; then
            CopyUnixThreadSource
        fi
        # Set up files for the timer library
        if test x$enable_timers = xyes; then
            
  echo "Copying src/timer/linux/SDL_systimer.c -> src/timer/SDL_systimer.c"
  old="$srcdir/src/timer/linux/SDL_systimer.c"
  new="$srcdir/src/timer/SDL_systimer.c"
  cat >$new <<__EOF__
/* WARNING:  This file was automatically generated!
 * Original: $old
 */
__EOF__
  cat >>$new <$old

        fi
        ;;
    *-*-freebsd*)
        ARCH=freebsd
        CheckDummyVideo
        CheckDiskAudio
        CheckDLOPEN
        CheckVGL
        CheckNASM
        CheckOSS
        CheckARTSC
        CheckESD
        CheckNAS
        CheckX11
        CheckDGA
        CheckSVGA
        CheckAAlib
        CheckOpenGL
        CheckPTHREAD
        CheckUSBHID
        # Set up files for the main() stub
        
  echo "Copying src/main/linux/SDL_main.c -> src/main/SDL_main.c"
  old="$srcdir/src/main/linux/SDL_main.c"
  new="$srcdir/src/main/SDL_main.c"
  cat >$new <<__EOF__
/* WARNING:  This file was automatically generated!
 * Original: $old
 */
__EOF__
  cat >>$new <$old

        # Set up files for the audio library
        # We use the OSS and ALSA API's, not the Sun audio API
        #if test x$enable_audio = xyes; then
        #    CFLAGS="$CFLAGS -DSUNAUDIO_SUPPORT"
        #    AUDIO_SUBDIRS="$AUDIO_SUBDIRS sun"
        #    AUDIO_DRIVERS="$AUDIO_DRIVERS sun/libaudio_sun.la"
        #fi
        # Set up files for the cdrom library
        if test x$enable_cdrom = xyes; then
            CDROM_SUBDIRS="$CDROM_SUBDIRS freebsd"
            CDROM_DRIVERS="$CDROM_DRIVERS freebsd/libcdrom_freebsd.la"
        fi
        # Set up files for the thread library
        if test x$enable_threads = xyes; then
            CopyUnixThreadSource
        fi
        # Set up files for the timer library
        if test x$enable_timers = xyes; then
            
  echo "Copying src/timer/linux/SDL_systimer.c -> src/timer/SDL_systimer.c"
  old="$srcdir/src/timer/linux/SDL_systimer.c"
  new="$srcdir/src/timer/SDL_systimer.c"
  cat >$new <<__EOF__
/* WARNING:  This file was automatically generated!
 * Original: $old
 */
__EOF__
  cat >>$new <$old

        fi
        ;;
    *-*-netbsd*)
        ARCH=netbsd
        CheckDummyVideo
        CheckDiskAudio
        CheckDLOPEN
        CheckNASM
        CheckOSS
        CheckARTSC
        CheckESD
        CheckNAS
        CheckX11
        CheckAAlib
        CheckOpenGL
        CheckPTHREAD
        CheckUSBHID
        # Set up files for the main() stub
        
  echo "Copying src/main/linux/SDL_main.c -> src/main/SDL_main.c"
  old="$srcdir/src/main/linux/SDL_main.c"
  new="$srcdir/src/main/SDL_main.c"
  cat >$new <<__EOF__
/* WARNING:  This file was automatically generated!
 * Original: $old
 */
__EOF__
  cat >>$new <$old

        # Set up files for the audio library
        if test x$enable_audio = xyes; then
            CFLAGS="$CFLAGS -DSUNAUDIO_SUPPORT"
            AUDIO_SUBDIRS="$AUDIO_SUBDIRS sun"
            AUDIO_DRIVERS="$AUDIO_DRIVERS sun/libaudio_sun.la"
        fi
        # Set up files for the cdrom library
        if test x$enable_cdrom = xyes; then
            CDROM_SUBDIRS="$CDROM_SUBDIRS openbsd"
            CDROM_DRIVERS="$CDROM_DRIVERS openbsd/libcdrom_openbsd.la"
        fi
        # Set up files for the thread library
        if test x$enable_threads = xyes; then
            if test x$use_pthreads = xyes; then
                CFLAGS="$CFLAGS -D_POSIX_THREAD_SYSCALL_SOFT=1"
            fi
            CopyUnixThreadSource
        fi
        # Set up files for the timer library
        if test x$enable_timers = xyes; then
            
  echo "Copying src/timer/linux/SDL_systimer.c -> src/timer/SDL_systimer.c"
  old="$srcdir/src/timer/linux/SDL_systimer.c"
  new="$srcdir/src/timer/SDL_systimer.c"
  cat >$new <<__EOF__
/* WARNING:  This file was automatically generated!
 * Original: $old
 */
__EOF__
  cat >>$new <$old

        fi
        # NetBSD does not define "unix"
        CFLAGS="$CFLAGS -Dunix"
        ;;
    *-*-openbsd*)
        ARCH=openbsd
        CheckDummyVideo
        CheckDiskAudio
        CheckDLOPEN
        CheckNASM
        CheckOSS
        CheckARTSC
        CheckESD
        CheckNAS
        CheckX11
        CheckAAlib
        CheckOpenGL
        CheckPTHREAD
        CheckUSBHID
        # Set up files for the main() stub
        
  echo "Copying src/main/linux/SDL_main.c -> src/main/SDL_main.c"
  old="$srcdir/src/main/linux/SDL_main.c"
  new="$srcdir/src/main/SDL_main.c"
  cat >$new <<__EOF__
/* WARNING:  This file was automatically generated!
 * Original: $old
 */
__EOF__
  cat >>$new <$old

        # Set up files for the audio library
        if test x$enable_audio = xyes; then
            CFLAGS="$CFLAGS -DOPENBSD_AUDIO_SUPPORT"
            AUDIO_SUBDIRS="$AUDIO_SUBDIRS openbsd"
            AUDIO_DRIVERS="$AUDIO_DRIVERS openbsd/libaudio_openbsd.la"
        fi
        # OpenBSD needs linking with ossaudio emulation library
        if test x$have_oss = xyes; then
            SYSTEM_LIBS="$SYSTEM_LIBS -lossaudio"
        fi
        # Set up files for the cdrom library
        if test x$enable_cdrom = xyes; then
            CDROM_SUBDIRS="$CDROM_SUBDIRS openbsd"
            CDROM_DRIVERS="$CDROM_DRIVERS openbsd/libcdrom_openbsd.la"
        fi
        # Set up files for the thread library
        if test x$enable_threads = xyes; then
            CopyUnixThreadSource
        fi
        # Set up files for the timer library
        if test x$enable_timers = xyes; then
            
  echo "Copying src/timer/linux/SDL_systimer.c -> src/timer/SDL_systimer.c"
  old="$srcdir/src/timer/linux/SDL_systimer.c"
  new="$srcdir/src/timer/SDL_systimer.c"
  cat >$new <<__EOF__
/* WARNING:  This file was automatically generated!
 * Original: $old
 */
__EOF__
  cat >>$new <$old

        fi
        # OpenBSD does not define "unix"
        CFLAGS="$CFLAGS -Dunix"
        ;;
    *-*-sysv5*)
        ARCH=sysv5
        CheckDummyVideo
        CheckDiskAudio
        CheckDLOPEN
        CheckNASM
        CheckOSS
        CheckARTSC
        CheckESD
        CheckNAS
        CheckX11
        CheckAAlib
        CheckOpenGL
        CheckPTHREAD
        # Set up files for the main() stub
        
  echo "Copying src/main/linux/SDL_main.c -> src/main/SDL_main.c"
  old="$srcdir/src/main/linux/SDL_main.c"
  new="$srcdir/src/main/SDL_main.c"
  cat >$new <<__EOF__
/* WARNING:  This file was automatically generated!
 * Original: $old
 */
__EOF__
  cat >>$new <$old

        # Set up files for the audio library
        if test x$enable_audio = xyes; then
            CFLAGS="$CFLAGS -DSUNAUDIO_SUPPORT"
            AUDIO_SUBDIRS="$AUDIO_SUBDIRS sun"
            AUDIO_DRIVERS="$AUDIO_DRIVERS sun/libaudio_sun.la"
        fi
        # Set up files for the joystick library
        # (No joystick support yet)
        if test x$enable_joystick = xyes; then
            JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS dummy"
            JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS dummy/libjoystick_dummy.la"
        fi
        # Set up files for the cdrom library
        if test x$enable_cdrom = xyes; then
            CDROM_SUBDIRS="$CDROM_SUBDIRS dummy"
            CDROM_DRIVERS="$CDROM_DRIVERS dummy/libcdrom_dummy.la"
        fi
        # Set up files for the thread library
        if test x$enable_threads = xyes; then
            CopyUnixThreadSource
        fi
        # Set up files for the timer library
        if test x$enable_timers = xyes; then
            
  echo "Copying src/timer/linux/SDL_systimer.c -> src/timer/SDL_systimer.c"
  old="$srcdir/src/timer/linux/SDL_systimer.c"
  new="$srcdir/src/timer/SDL_systimer.c"
  cat >$new <<__EOF__
/* WARNING:  This file was automatically generated!
 * Original: $old
 */
__EOF__
  cat >>$new <$old

        fi
        ;;
    *-*-solaris*)
        ARCH=solaris
        CFLAGS="$CFLAGS -D__ELF__" # Fix for nasm on Solaris x86
        CheckDummyVideo
        CheckDiskAudio
        CheckDLOPEN
        CheckNASM
        CheckOSS
        CheckARTSC
        CheckESD
        CheckNAS
        CheckX11
        CheckAAlib
        CheckOpenGL
        CheckPTHREAD
        # Set up files for the main() stub
        
  echo "Copying src/main/linux/SDL_main.c -> src/main/SDL_main.c"
  old="$srcdir/src/main/linux/SDL_main.c"
  new="$srcdir/src/main/SDL_main.c"
  cat >$new <<__EOF__
/* WARNING:  This file was automatically generated!
 * Original: $old
 */
__EOF__
  cat >>$new <$old

        # Set up files for the audio library
        if test x$enable_audio = xyes; then
            CFLAGS="$CFLAGS -DSUNAUDIO_SUPPORT"
            AUDIO_SUBDIRS="$AUDIO_SUBDIRS sun"
            AUDIO_DRIVERS="$AUDIO_DRIVERS sun/libaudio_sun.la"
        fi
        # Set up files for the joystick library
        # (No joystick support yet)
        if test x$enable_joystick = xyes; then
            JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS dummy"
            JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS dummy/libjoystick_dummy.la"
        fi
        # Set up files for the cdrom library
        if test x$enable_cdrom = xyes; then
            CDROM_SUBDIRS="$CDROM_SUBDIRS linux"
            CDROM_DRIVERS="$CDROM_DRIVERS linux/libcdrom_linux.la"
        fi
        # Set up files for the thread library
        if test x$enable_threads = xyes; then
            CopyUnixThreadSource
        fi
        # Set up files for the timer library
        if test x$enable_timers = xyes; then
            
  echo "Copying src/timer/linux/SDL_systimer.c -> src/timer/SDL_systimer.c"
  old="$srcdir/src/timer/linux/SDL_systimer.c"
  new="$srcdir/src/timer/SDL_systimer.c"
  cat >$new <<__EOF__
/* WARNING:  This file was automatically generated!
 * Original: $old
 */
__EOF__
  cat >>$new <$old

        fi
        ;;
    *-*-irix*)
        ARCH=irix
        CheckDummyVideo
        CheckDiskAudio
        CheckDLOPEN
        CheckDMEDIA
        CheckESD
        CheckNAS
        CheckX11
        CheckAAlib
        CheckOpenGL
        CheckPTHREAD
        # Set up files for the main() stub
        
  echo "Copying src/main/linux/SDL_main.c -> src/main/SDL_main.c"
  old="$srcdir/src/main/linux/SDL_main.c"
  new="$srcdir/src/main/SDL_main.c"
  cat >$new <<__EOF__
/* WARNING:  This file was automatically generated!
 * Original: $old
 */
__EOF__
  cat >>$new <$old

        # We use the dmedia audio API, not the Sun audio API
        #if test x$enable_audio = xyes; then
        #    CFLAGS="$CFLAGS -DSUNAUDIO_SUPPORT"
        #    AUDIO_SUBDIRS="$AUDIO_SUBDIRS sun"
        #    AUDIO_DRIVERS="$AUDIO_DRIVERS sun/libaudio_sun.la"
        #fi
        # Set up files for the joystick library
        # (No joystick support yet)
        if test x$enable_joystick = xyes; then
            JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS dummy"
            JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS dummy/libjoystick_dummy.la"
        fi
        # Set up files for the cdrom library
        # (No CD-ROM support yet)
        if test x$enable_cdrom = xyes; then
            CDROM_SUBDIRS="$CDROM_SUBDIRS dummy"
            CDROM_DRIVERS="$CDROM_DRIVERS dummy/libcdrom_dummy.la"
        fi
        # Set up files for the thread library
        if test x$enable_threads = xyes; then
            if test x$use_pthreads = xyes -o x$use_pth = xyes; then
                CopyUnixThreadSource
            else
                
  echo "Copying src/thread/irix/SDL_systhread.c -> src/thread/SDL_systhread.c"
  old="$srcdir/src/thread/irix/SDL_systhread.c"
  new="$srcdir/src/thread/SDL_systhread.c"
  cat >$new <<__EOF__
/* WARNING:  This file was automatically generated!
 * Original: $old
 */
__EOF__
  cat >>$new <$old

                
  echo "Copying src/thread/irix/SDL_systhread_c.h -> src/thread/SDL_systhread_c.h"
  old="$srcdir/src/thread/irix/SDL_systhread_c.h"
  new="$srcdir/src/thread/SDL_systhread_c.h"
  cat >$new <<__EOF__
/* WARNING:  This file was automatically generated!
 * Original: $old
 */
__EOF__
  cat >>$new <$old

                
  echo "Copying src/thread/linux/SDL_sysmutex.c -> src/thread/SDL_sysmutex.c"
  old="$srcdir/src/thread/linux/SDL_sysmutex.c"
  new="$srcdir/src/thread/SDL_sysmutex.c"
  cat >$new <<__EOF__
/* WARNING:  This file was automatically generated!
 * Original: $old
 */
__EOF__
  cat >>$new <$old

                
  echo "Copying src/thread/linux/SDL_sysmutex_c.h -> src/thread/SDL_sysmutex_c.h"
  old="$srcdir/src/thread/linux/SDL_sysmutex_c.h"
  new="$srcdir/src/thread/SDL_sysmutex_c.h"
  cat >$new <<__EOF__
/* WARNING:  This file was automatically generated!
 * Original: $old
 */
__EOF__
  cat >>$new <$old

                
  echo "Copying src/thread/linux/SDL_syssem.c -> src/thread/SDL_syssem.c"
  old="$srcdir/src/thread/linux/SDL_syssem.c"
  new="$srcdir/src/thread/SDL_syssem.c"
  cat >$new <<__EOF__
/* WARNING:  This file was automatically generated!
 * Original: $old
 */
__EOF__
  cat >>$new <$old

                
  echo "Copying src/thread/generic/SDL_syssem_c.h -> src/thread/SDL_syssem_c.h"
  old="$srcdir/src/thread/generic/SDL_syssem_c.h"
  new="$srcdir/src/thread/SDL_syssem_c.h"
  cat >$new <<__EOF__
/* WARNING:  This file was automatically generated!
 * Original: $old
 */
__EOF__
  cat >>$new <$old

                
  echo "Copying src/thread/generic/SDL_syscond.c -> src/thread/SDL_syscond.c"
  old="$srcdir/src/thread/generic/SDL_syscond.c"
  new="$srcdir/src/thread/SDL_syscond.c"
  cat >$new <<__EOF__
/* WARNING:  This file was automatically generated!
 * Original: $old
 */
__EOF__
  cat >>$new <$old

                
  echo "Copying src/thread/generic/SDL_syscond_c.h -> src/thread/SDL_syscond_c.h"
  old="$srcdir/src/thread/generic/SDL_syscond_c.h"
  new="$srcdir/src/thread/SDL_syscond_c.h"
  cat >$new <<__EOF__
/* WARNING:  This file was automatically generated!
 * Original: $old
 */
__EOF__
  cat >>$new <$old

            fi
        fi
        # Set up files for the timer library
        if test x$enable_timers = xyes; then
            
  echo "Copying src/timer/linux/SDL_systimer.c -> src/timer/SDL_systimer.c"
  old="$srcdir/src/timer/linux/SDL_systimer.c"
  new="$srcdir/src/timer/SDL_systimer.c"
  cat >$new <<__EOF__
/* WARNING:  This file was automatically generated!
 * Original: $old
 */
__EOF__
  cat >>$new <$old

        fi
        ;;
    *-*-hpux*)
        ARCH=hpux
        CheckDummyVideo
        CheckDiskAudio
        CheckDLOPEN
        CheckOSS
        CheckNAS
        CheckX11
        CheckGGI
        CheckAAlib
        CheckOpenGL
        CheckPTHREAD
        # Set up files for the main() stub
        
  echo "Copying src/main/linux/SDL_main.c -> src/main/SDL_main.c"
  old="$srcdir/src/main/linux/SDL_main.c"
  new="$srcdir/src/main/SDL_main.c"
  cat >$new <<__EOF__
/* WARNING:  This file was automatically generated!
 * Original: $old
 */
__EOF__
  cat >>$new <$old

        # Set up files for the audio library
        if test x$enable_audio = xyes; then
            CFLAGS="$CFLAGS -DSUNAUDIO_SUPPORT"
            AUDIO_SUBDIRS="$AUDIO_SUBDIRS sun"
            AUDIO_DRIVERS="$AUDIO_DRIVERS sun/libaudio_sun.la"
        fi
        # Set up files for the joystick library
        # (No joystick support yet)
        if test x$enable_joystick = xyes; then
            JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS dummy"
            JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS dummy/libjoystick_dummy.la"
        fi
        # Set up files for the cdrom library
        # (No CD-ROM support yet)
        if test x$enable_cdrom = xyes; then
            CDROM_SUBDIRS="$CDROM_SUBDIRS dummy"
            CDROM_DRIVERS="$CDROM_DRIVERS dummy/libcdrom_dummy.la"
        fi
        # Set up files for the thread library
        if test x$enable_threads = xyes; then
            CopyUnixThreadSource
        fi
        # Set up files for the timer library
        if test x$enable_timers = xyes; then
            
  echo "Copying src/timer/linux/SDL_systimer.c -> src/timer/SDL_systimer.c"
  old="$srcdir/src/timer/linux/SDL_systimer.c"
  new="$srcdir/src/timer/SDL_systimer.c"
  cat >$new <<__EOF__
/* WARNING:  This file was automatically generated!
 * Original: $old
 */
__EOF__
  cat >>$new <$old

        fi
        ;;
    *-*-aix*)
        ARCH=aix
        CheckDummyVideo
        CheckDiskAudio
        CheckDLOPEN
        CheckOSS
        CheckNAS
        CheckX11
        CheckGGI
        CheckAAlib
        CheckOpenGL
        CheckPTHREAD
        # Set up files for the main() stub
        
  echo "Copying src/main/linux/SDL_main.c -> src/main/SDL_main.c"
  old="$srcdir/src/main/linux/SDL_main.c"
  new="$srcdir/src/main/SDL_main.c"
  cat >$new <<__EOF__
/* WARNING:  This file was automatically generated!
 * Original: $old
 */
__EOF__
  cat >>$new <$old

        # Set up files for the audio library
        if test x$enable_audio = xyes; then
            AUDIO_SUBDIRS="$AUDIO_SUBDIRS paudio"
            AUDIO_DRIVERS="$AUDIO_DRIVERS paudio/libaudio_paudio.la"
        fi
        # Set up files for the joystick library
        # (No joystick support yet)
        if test x$enable_joystick = xyes; then
            JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS dummy"
            JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS dummy/libjoystick_dummy.la"
        fi
        # Set up files for the cdrom library
        if test x$enable_cdrom = xyes; then
            CDROM_SUBDIRS="$CDROM_SUBDIRS aix"
            CDROM_DRIVERS="$CDROM_DRIVERS aix/libcdrom_aix.la"
        fi
        # Set up files for the thread library
        if test x$enable_threads = xyes; then
            CopyUnixThreadSource
        fi
        # Set up files for the timer library
        if test x$enable_timers = xyes; then
            
  echo "Copying src/timer/linux/SDL_systimer.c -> src/timer/SDL_systimer.c"
  old="$srcdir/src/timer/linux/SDL_systimer.c"
  new="$srcdir/src/timer/SDL_systimer.c"
  cat >$new <<__EOF__
/* WARNING:  This file was automatically generated!
 * Original: $old
 */
__EOF__
  cat >>$new <$old

        fi
        ;;
    *-*-osf*)
        ARCH=osf
        CheckDummyVideo
        CheckDiskAudio
        CheckDLOPEN
        CheckNAS
        CheckX11
        CheckGGI
        CheckAAlib
        CheckOpenGL
        CheckPTHREAD
        SDL_LIBS="$SDL_LIBS -lrt"
        # Set up files for the main() stub
        
  echo "Copying src/main/linux/SDL_main.c -> src/main/SDL_main.c"
  old="$srcdir/src/main/linux/SDL_main.c"
  new="$srcdir/src/main/SDL_main.c"
  cat >$new <<__EOF__
/* WARNING:  This file was automatically generated!
 * Original: $old
 */
__EOF__
  cat >>$new <$old

        # Set up files for the audio library
        if test x$enable_audio = xyes; then
            CFLAGS="$CFLAGS -I/usr/include/mme -DMMEAUDIO_SUPPORT"
            SYSTEM_LIBS="$SYSTEM_LIBS -lmme"
            AUDIO_SUBDIRS="$AUDIO_SUBDIRS mme"
            AUDIO_DRIVERS="$AUDIO_DRIVERS mme/libaudio_mme.la"
        fi
        # Set up files for the joystick library
        # (No joystick support yet)
        if test x$enable_joystick = xyes; then
            JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS dummy"
            JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS dummy/libjoystick_dummy.la"
        fi
        # Set up files for the cdrom library
        # (No cdrom support yet)
        if test x$enable_cdrom = xyes; then
            CDROM_SUBDIRS="$CDROM_SUBDIRS osf"
            CDROM_DRIVERS="$CDROM_DRIVERS osf/libcdrom_osf.la"
        fi
        # Set up files for the thread library
        if test x$enable_threads = xyes; then
            CopyUnixThreadSource
        fi
        # Set up files for the timer library
        if test x$enable_timers = xyes; then
            
  echo "Copying src/timer/linux/SDL_systimer.c -> src/timer/SDL_systimer.c"
  old="$srcdir/src/timer/linux/SDL_systimer.c"
  new="$srcdir/src/timer/SDL_systimer.c"
  cat >$new <<__EOF__
/* WARNING:  This file was automatically generated!
 * Original: $old
 */
__EOF__
  cat >>$new <$old

        fi
        ;;
    *-*-qnx*)
        ARCH=qnx
        CheckDummyVideo
        CheckDiskAudio
        CheckDLOPEN
        CheckNAS
        CheckPHOTON
        CheckX11
        CheckOpenGL
        CheckPTHREAD
        # Set up files for the main() stub
        
  echo "Copying src/main/linux/SDL_main.c -> src/main/SDL_main.c"
  old="$srcdir/src/main/linux/SDL_main.c"
  new="$srcdir/src/main/SDL_main.c"
  cat >$new <<__EOF__
/* WARNING:  This file was automatically generated!
 * Original: $old
 */
__EOF__
  cat >>$new <$old

        # Set up files for the audio library
        if test x$enable_audio = xyes; then
            CFLAGS="$CFLAGS -DQNXNTOAUDIO_SUPPORT"
            SYSTEM_LIBS="$SYSTEM_LIBS -lasound"
            AUDIO_SUBDIRS="$AUDIO_SUBDIRS nto"
            AUDIO_DRIVERS="$AUDIO_DRIVERS nto/libaudio_nto.la"
        fi
        # Set up files for the joystick library
        if test x$enable_joystick = xyes; then
        # (No joystick support yet)
            JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS dummy"
            JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS dummy/libjoystick_dummy.la"
        fi
        # Set up files for the cdrom library
        if test x$enable_cdrom = xyes; then
            CDROM_SUBDIRS="$CDROM_SUBDIRS qnx"
            CDROM_DRIVERS="$CDROM_DRIVERS qnx/libcdrom_qnx.la"
        fi
        # Set up files for the thread library
        if test x$enable_threads = xyes; then
            CopyUnixThreadSource
        fi
        # Set up files for the timer library
        if test x$enable_timers = xyes; then
            
  echo "Copying src/timer/linux/SDL_systimer.c -> src/timer/SDL_systimer.c"
  old="$srcdir/src/timer/linux/SDL_systimer.c"
  new="$srcdir/src/timer/SDL_systimer.c"
  cat >$new <<__EOF__
/* WARNING:  This file was automatically generated!
 * Original: $old
 */
__EOF__
  cat >>$new <$old

        fi
        ;;
    *-*-cygwin* | *-*-mingw32*)
        ARCH=win32
        if test "$build" != "$target"; then # cross-compiling
            # Default cross-compile location
            ac_default_prefix=/usr/local/cross-tools/i386-mingw32msvc
        else
            # Look for the location of the tools and install there
            if  "$BUILD_PREFIX" != "" ; then
                ac_default_prefix=$BUILD_PREFIX
            fi
        fi
        CheckDummyVideo
        CheckDiskAudio
        CheckWIN32
        CheckDIRECTX
        CheckNASM
        # Set up files for the main() stub
        
  echo "Copying src/main/win32/SDL_main.c -> src/main/SDL_main.c"
  old="$srcdir/src/main/win32/SDL_main.c"
  new="$srcdir/src/main/SDL_main.c"
  cat >$new <<__EOF__
/* WARNING:  This file was automatically generated!
 * Original: $old
 */
__EOF__
  cat >>$new <$old

        # Set up files for the audio library
        if test x$enable_audio = xyes; then
            AUDIO_SUBDIRS="$AUDIO_SUBDIRS windib"
            AUDIO_DRIVERS="$AUDIO_DRIVERS windib/libaudio_windib.la"
            if test x$use_directx = xyes; then
                AUDIO_SUBDIRS="$AUDIO_SUBDIRS windx5"
                AUDIO_DRIVERS="$AUDIO_DRIVERS windx5/libaudio_windx5.la"
            fi
        fi
        # Set up files for the joystick library
        if test x$enable_joystick = xyes; then
            JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS win32"
            JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS win32/libjoystick_winmm.la"
        fi
        # Set up files for the cdrom library
        if test x$enable_cdrom = xyes; then
            CDROM_SUBDIRS="$CDROM_SUBDIRS win32"
            CDROM_DRIVERS="$CDROM_DRIVERS win32/libcdrom_win32.la"
        fi
        # Set up files for the thread library
        if test x$enable_threads = xyes; then
            
  echo "Copying src/thread/win32/SDL_systhread.c -> src/thread/SDL_systhread.c"
  old="$srcdir/src/thread/win32/SDL_systhread.c"
  new="$srcdir/src/thread/SDL_systhread.c"
  cat >$new <<__EOF__
/* WARNING:  This file was automatically generated!
 * Original: $old
 */
__EOF__
  cat >>$new <$old

            
  echo "Copying src/thread/win32/SDL_systhread_c.h -> src/thread/SDL_systhread_c.h"
  old="$srcdir/src/thread/win32/SDL_systhread_c.h"
  new="$srcdir/src/thread/SDL_systhread_c.h"
  cat >$new <<__EOF__
/* WARNING:  This file was automatically generated!
 * Original: $old
 */
__EOF__
  cat >>$new <$old

            
  echo "Copying src/thread/win32/SDL_sysmutex.c -> src/thread/SDL_sysmutex.c"
  old="$srcdir/src/thread/win32/SDL_sysmutex.c"
  new="$srcdir/src/thread/SDL_sysmutex.c"
  cat >$new <<__EOF__
/* WARNING:  This file was automatically generated!
 * Original: $old
 */
__EOF__
  cat >>$new <$old

            
  echo "Copying src/thread/generic/SDL_sysmutex_c.h -> src/thread/SDL_sysmutex_c.h"
  old="$srcdir/src/thread/generic/SDL_sysmutex_c.h"
  new="$srcdir/src/thread/SDL_sysmutex_c.h"
  cat >$new <<__EOF__
/* WARNING:  This file was automatically generated!
 * Original: $old
 */
__EOF__
  cat >>$new <$old

            
  echo "Copying src/thread/win32/SDL_syssem.c -> src/thread/SDL_syssem.c"
  old="$srcdir/src/thread/win32/SDL_syssem.c"
  new="$srcdir/src/thread/SDL_syssem.c"
  cat >$new <<__EOF__
/* WARNING:  This file was automatically generated!
 * Original: $old
 */
__EOF__
  cat >>$new <$old

            
  echo "Copying src/thread/generic/SDL_syssem_c.h -> src/thread/SDL_syssem_c.h"
  old="$srcdir/src/thread/generic/SDL_syssem_c.h"
  new="$srcdir/src/thread/SDL_syssem_c.h"
  cat >$new <<__EOF__
/* WARNING:  This file was automatically generated!
 * Original: $old
 */
__EOF__
  cat >>$new <$old

            
  echo "Copying src/thread/generic/SDL_syscond.c -> src/thread/SDL_syscond.c"
  old="$srcdir/src/thread/generic/SDL_syscond.c"
  new="$srcdir/src/thread/SDL_syscond.c"
  cat >$new <<__EOF__
/* WARNING:  This file was automatically generated!
 * Original: $old
 */
__EOF__
  cat >>$new <$old

            
  echo "Copying src/thread/generic/SDL_syscond_c.h -> src/thread/SDL_syscond_c.h"
  old="$srcdir/src/thread/generic/SDL_syscond_c.h"
  new="$srcdir/src/thread/SDL_syscond_c.h"
  cat >$new <<__EOF__
/* WARNING:  This file was automatically generated!
 * Original: $old
 */
__EOF__
  cat >>$new <$old

        fi
        # Set up files for the timer library
        if test x$enable_timers = xyes; then
            
  echo "Copying src/timer/win32/SDL_systimer.c -> src/timer/SDL_systimer.c"
  old="$srcdir/src/timer/win32/SDL_systimer.c"
  new="$srcdir/src/timer/SDL_systimer.c"
  cat >$new <<__EOF__
/* WARNING:  This file was automatically generated!
 * Original: $old
 */
__EOF__
  cat >>$new <$old

        fi
        # The Win32 platform requires special setup
        SDL_CFLAGS="$SDL_CFLAGS -Dmain=SDL_main"
        case "$target" in
            *-*-cygwin*)
                CFLAGS="$CFLAGS -I/usr/include/mingw -DWIN32 -Uunix -mno-cygwin"
                SDL_CFLAGS="$SDL_CFLAGS -I/usr/include/mingw -DWIN32 -Uunix -mno-cygwin"
                LIBS="$LIBS -mno-cygwin"
                SDL_LIBS="-lmingw32 -lSDLmain $SDL_LIBS -mwindows -mno-cygwin"
                ;;
            *-*-mingw32*)
                SDL_LIBS="-lmingw32 -lSDLmain $SDL_LIBS -mwindows"
                ;;
        esac
        ;;
    *-*-beos*)
        ARCH=beos
        ac_default_prefix=/boot/develop/tools/gnupro
        CheckDummyVideo
        CheckDiskAudio
        CheckNASM
        CheckBWINDOW
        CheckBeGL
        # Set up files for the main() stub
        
  echo "Copying src/main/linux/SDL_main.c -> src/main/SDL_main.c"
  old="$srcdir/src/main/linux/SDL_main.c"
  new="$srcdir/src/main/SDL_main.c"
  cat >$new <<__EOF__
/* WARNING:  This file was automatically generated!
 * Original: $old
 */
__EOF__
  cat >>$new <$old

        
  echo "Copying src/main/beos/SDL_BeApp.cc -> src/main/SDL_BeApp.cc"
  old="$srcdir/src/main/beos/SDL_BeApp.cc"
  new="$srcdir/src/main/SDL_BeApp.cc"
  cat >$new <<__EOF__
/* WARNING:  This file was automatically generated!
 * Original: $old
 */
__EOF__
  cat >>$new <$old

        
  echo "Copying src/main/beos/SDL_BeApp.h -> src/main/SDL_BeApp.h"
  old="$srcdir/src/main/beos/SDL_BeApp.h"
  new="$srcdir/src/main/SDL_BeApp.h"
  cat >$new <<__EOF__
/* WARNING:  This file was automatically generated!
 * Original: $old
 */
__EOF__
  cat >>$new <$old

        # Set up files for the audio library
        if test x$enable_audio = xyes; then
            AUDIO_SUBDIRS="$AUDIO_SUBDIRS baudio"
            AUDIO_DRIVERS="$AUDIO_DRIVERS baudio/libaudio_baudio.la"
        fi
        # Set up files for the joystick library
        if test x$enable_joystick = xyes; then
            JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS beos"
            JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS beos/libjoystick_beos.la"
        fi
        # Set up files for the cdrom library
        if test x$enable_cdrom = xyes; then
            CDROM_SUBDIRS="$CDROM_SUBDIRS beos"
            CDROM_DRIVERS="$CDROM_DRIVERS beos/libcdrom_beos.la"
        fi
        # Set up files for the thread library
        if test x$enable_threads = xyes; then
            
  echo "Copying src/thread/beos/SDL_systhread.c -> src/thread/SDL_systhread.c"
  old="$srcdir/src/thread/beos/SDL_systhread.c"
  new="$srcdir/src/thread/SDL_systhread.c"
  cat >$new <<__EOF__
/* WARNING:  This file was automatically generated!
 * Original: $old
 */
__EOF__
  cat >>$new <$old

            
  echo "Copying src/thread/beos/SDL_systhread_c.h -> src/thread/SDL_systhread_c.h"
  old="$srcdir/src/thread/beos/SDL_systhread_c.h"
  new="$srcdir/src/thread/SDL_systhread_c.h"
  cat >$new <<__EOF__
/* WARNING:  This file was automatically generated!
 * Original: $old
 */
__EOF__
  cat >>$new <$old

            
  echo "Copying src/thread/generic/SDL_sysmutex.c -> src/thread/SDL_sysmutex.c"
  old="$srcdir/src/thread/generic/SDL_sysmutex.c"
  new="$srcdir/src/thread/SDL_sysmutex.c"
  cat >$new <<__EOF__
/* WARNING:  This file was automatically generated!
 * Original: $old
 */
__EOF__
  cat >>$new <$old

            
  echo "Copying src/thread/generic/SDL_sysmutex_c.h -> src/thread/SDL_sysmutex_c.h"
  old="$srcdir/src/thread/generic/SDL_sysmutex_c.h"
  new="$srcdir/src/thread/SDL_sysmutex_c.h"
  cat >$new <<__EOF__
/* WARNING:  This file was automatically generated!
 * Original: $old
 */
__EOF__
  cat >>$new <$old

            
  echo "Copying src/thread/beos/SDL_syssem.c -> src/thread/SDL_syssem.c"
  old="$srcdir/src/thread/beos/SDL_syssem.c"
  new="$srcdir/src/thread/SDL_syssem.c"
  cat >$new <<__EOF__
/* WARNING:  This file was automatically generated!
 * Original: $old
 */
__EOF__
  cat >>$new <$old

            
  echo "Copying src/thread/generic/SDL_syssem_c.h -> src/thread/SDL_syssem_c.h"
  old="$srcdir/src/thread/generic/SDL_syssem_c.h"
  new="$srcdir/src/thread/SDL_syssem_c.h"
  cat >$new <<__EOF__
/* WARNING:  This file was automatically generated!
 * Original: $old
 */
__EOF__
  cat >>$new <$old

            
  echo "Copying src/thread/generic/SDL_syscond.c -> src/thread/SDL_syscond.c"
  old="$srcdir/src/thread/generic/SDL_syscond.c"
  new="$srcdir/src/thread/SDL_syscond.c"
  cat >$new <<__EOF__
/* WARNING:  This file was automatically generated!
 * Original: $old
 */
__EOF__
  cat >>$new <$old

            
  echo "Copying src/thread/generic/SDL_syscond_c.h -> src/thread/SDL_syscond_c.h"
  old="$srcdir/src/thread/generic/SDL_syscond_c.h"
  new="$srcdir/src/thread/SDL_syscond_c.h"
  cat >$new <<__EOF__
/* WARNING:  This file was automatically generated!
 * Original: $old
 */
__EOF__
  cat >>$new <$old

        fi
        # Set up files for the timer library
        if test x$enable_timers = xyes; then
            
  echo "Copying src/timer/beos/SDL_systimer.c -> src/timer/SDL_systimer.c"
  old="$srcdir/src/timer/beos/SDL_systimer.c"
  new="$srcdir/src/timer/SDL_systimer.c"
  cat >$new <<__EOF__
/* WARNING:  This file was automatically generated!
 * Original: $old
 */
__EOF__
  cat >>$new <$old

        fi
        # The BeOS platform requires special libraries
        SYSTEM_LIBS="$SYSTEM_LIBS -lroot -lbe -lmedia -lgame -ldevice -ltextencoding"
        ;;
    *-*-macos*)
        # This would be used if cross-compiling to MacOS 9.  No way to
        # use it at present, but Apple is working on a X-to-9 compiler
        # for which this case would be handy.
        ARCH=macos
        CheckDummyVideo
        CheckDiskAudio
        CheckTOOLBOX
        CheckMacGL
        # Set up files for the main() stub
        
  echo "Copying src/main/macos/SDL_main.c -> src/main/SDL_main.c"
  old="$srcdir/src/main/macos/SDL_main.c"
  new="$srcdir/src/main/SDL_main.c"
  cat >$new <<__EOF__
/* WARNING:  This file was automatically generated!
 * Original: $old
 */
__EOF__
  cat >>$new <$old

        # Set up files for the audio library
        if test x$enable_audio = xyes; then
            AUDIO_SUBDIRS="$AUDIO_SUBDIRS macrom"
            AUDIO_DRIVERS="$AUDIO_DRIVERS macrom/libaudio_macrom.la"
        fi
        # Set up files for the joystick library
        if test x$enable_joystick = xyes; then
            JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS macos"
            JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS macos/libjoystick_macos.la"
        fi
        # Set up files for the cdrom library
        if test x$enable_cdrom = xyes; then
            CDROM_SUBDIRS="$CDROM_SUBDIRS macos"
            CDROM_DRIVERS="$CDROM_DRIVERS macos/libcdrom_macos.la"
        fi
        # Set up files for the thread library
        if test x$enable_threads = xyes; then
            
  echo "Copying src/thread/macos/SDL_systhread.c -> src/thread/SDL_systhread.c"
  old="$srcdir/src/thread/macos/SDL_systhread.c"
  new="$srcdir/src/thread/SDL_systhread.c"
  cat >$new <<__EOF__
/* WARNING:  This file was automatically generated!
 * Original: $old
 */
__EOF__
  cat >>$new <$old

            
  echo "Copying src/thread/macos/SDL_systhread_c.h -> src/thread/SDL_systhread_c.h"
  old="$srcdir/src/thread/macos/SDL_systhread_c.h"
  new="$srcdir/src/thread/SDL_systhread_c.h"
  cat >$new <<__EOF__
/* WARNING:  This file was automatically generated!
 * Original: $old
 */
__EOF__
  cat >>$new <$old

            
  echo "Copying src/thread/generic/SDL_sysmutex.c -> src/thread/SDL_sysmutex.c"
  old="$srcdir/src/thread/generic/SDL_sysmutex.c"
  new="$srcdir/src/thread/SDL_sysmutex.c"
  cat >$new <<__EOF__
/* WARNING:  This file was automatically generated!
 * Original: $old
 */
__EOF__
  cat >>$new <$old

            
  echo "Copying src/thread/generic/SDL_sysmutex_c.h -> src/thread/SDL_sysmutex_c.h"
  old="$srcdir/src/thread/generic/SDL_sysmutex_c.h"
  new="$srcdir/src/thread/SDL_sysmutex_c.h"
  cat >$new <<__EOF__
/* WARNING:  This file was automatically generated!
 * Original: $old
 */
__EOF__
  cat >>$new <$old

            
  echo "Copying src/thread/macos/SDL_syssem.c -> src/thread/SDL_syssem.c"
  old="$srcdir/src/thread/macos/SDL_syssem.c"
  new="$srcdir/src/thread/SDL_syssem.c"
  cat >$new <<__EOF__
/* WARNING:  This file was automatically generated!
 * Original: $old
 */
__EOF__
  cat >>$new <$old

            
  echo "Copying src/thread/generic/SDL_syssem_c.h -> src/thread/SDL_syssem_c.h"
  old="$srcdir/src/thread/generic/SDL_syssem_c.h"
  new="$srcdir/src/thread/SDL_syssem_c.h"
  cat >$new <<__EOF__
/* WARNING:  This file was automatically generated!
 * Original: $old
 */
__EOF__
  cat >>$new <$old

            
  echo "Copying src/thread/generic/SDL_syscond.c -> src/thread/SDL_syscond.c"
  old="$srcdir/src/thread/generic/SDL_syscond.c"
  new="$srcdir/src/thread/SDL_syscond.c"
  cat >$new <<__EOF__
/* WARNING:  This file was automatically generated!
 * Original: $old
 */
__EOF__
  cat >>$new <$old

            
  echo "Copying src/thread/generic/SDL_syscond_c.h -> src/thread/SDL_syscond_c.h"
  old="$srcdir/src/thread/generic/SDL_syscond_c.h"
  new="$srcdir/src/thread/SDL_syscond_c.h"
  cat >$new <<__EOF__
/* WARNING:  This file was automatically generated!
 * Original: $old
 */
__EOF__
  cat >>$new <$old

        fi
        # Set up files for the timer library
        if test x$enable_timers = xyes; then
            
  echo "Copying src/timer/macos/SDL_systimer.c -> src/timer/SDL_systimer.c"
  old="$srcdir/src/timer/macos/SDL_systimer.c"
  new="$srcdir/src/timer/SDL_systimer.c"
  cat >$new <<__EOF__
/* WARNING:  This file was automatically generated!
 * Original: $old
 */
__EOF__
  cat >>$new <$old

        fi
        # The MacOS platform requires special setup
        SDL_CFLAGS="$SDL_CFLAGS -Dmain=SDL_main"
        SDL_LIBS="-lSDLmain $SDL_LIBS"
        ;;
    *-*-darwin* )
        # Strictly speaking, we want "Mac OS X", not "Darwin", which is
        # just the OS X kernel sans upper layers like Carbon and Cocoa.
        # But config.guess comes back with "darwin", so go with the flow.
        ARCH=macosx
        CheckDummyVideo
        CheckDiskAudio
        CheckQUARTZ
        CheckMacGL
        CheckPTHREAD
        # Set up files for the main() stub
        
  echo "Copying src/main/macosx/SDLMain.m -> src/main/SDLMain.m"
  old="$srcdir/src/main/macosx/SDLMain.m"
  new="$srcdir/src/main/SDLMain.m"
  cat >$new <<__EOF__
/* WARNING:  This file was automatically generated!
 * Original: $old
 */
__EOF__
  cat >>$new <$old

        
  echo "Copying src/main/macosx/SDLMain.h -> src/main/SDLMain.h"
  old="$srcdir/src/main/macosx/SDLMain.h"
  new="$srcdir/src/main/SDLMain.h"
  cat >$new <<__EOF__
/* WARNING:  This file was automatically generated!
 * Original: $old
 */
__EOF__
  cat >>$new <$old

        # Set up files for the audio library
        if test x$enable_audio = xyes; then
            AUDIO_SUBDIRS="$AUDIO_SUBDIRS macrom"
            AUDIO_DRIVERS="$AUDIO_DRIVERS macrom/libaudio_macrom.la"
        fi
        # Set up files for the joystick library
        if test x$enable_joystick = xyes; then
            JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS darwin"
            JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS darwin/libjoystick_darwin.la"
            SYSTEM_LIBS="$SYSTEM_LIBS -framework IOKit"
        fi
        # Set up files for the cdrom library
        if test x$enable_cdrom = xyes; then
	    # The CD-ROM code won't work on old versions of MacOS X yet...
            #CDROM_SUBDIRS="$CDROM_SUBDIRS macosx"
            #CDROM_DRIVERS="$CDROM_DRIVERS macosx/libcdrom_macosx.la"
            #SYSTEM_LIBS="$SYSTEM_LIBS -framework AudioToolbox -framework AudioUnit -lstdc++"
            CDROM_SUBDIRS="$CDROM_SUBDIRS dummy"
            CDROM_DRIVERS="$CDROM_DRIVERS dummy/libcdrom_dummy.la"
        fi
        # Set up files for the thread library
        if test x$enable_threads = xyes; then
            CopyUnixThreadSource
        fi
        # Set up files for the timer library
        if test x$enable_timers = xyes; then
            
  echo "Copying src/timer/linux/SDL_systimer.c -> src/timer/SDL_systimer.c"
  old="$srcdir/src/timer/linux/SDL_systimer.c"
  new="$srcdir/src/timer/SDL_systimer.c"
  cat >$new <<__EOF__
/* WARNING:  This file was automatically generated!
 * Original: $old
 */
__EOF__
  cat >>$new <$old

        fi
        # The MacOS X platform requires special setup.
        SDL_LIBS="-lSDLmain $SDL_LIBS"
        # The Cocoa backend still needs Carbon, and the YUV code QuickTime
        SYSTEM_LIBS="$SYSTEM_LIBS -framework Cocoa -framework Carbon -framework QuickTime"
        ;;
    *-*-mint*)
        ARCH=mint
        CheckDummyVideo
        CheckDiskAudio
        CheckAtariBiosEvent
        CheckAtariXbiosVideo
        CheckAtariGemVideo
        CheckAtariAudio
        CheckAtariLdg
        CheckPTH
        # Set up files for the main() stub
        
  echo "Copying src/main/linux/SDL_main.c -> src/main/SDL_main.c"
  old="$srcdir/src/main/linux/SDL_main.c"
  new="$srcdir/src/main/SDL_main.c"
  cat >$new <<__EOF__
/* WARNING:  This file was automatically generated!
 * Original: $old
 */
__EOF__
  cat >>$new <$old

        # Set up files for the audio library
        if test x$enable_threads = xyes -a x$enable_pth = xyes; then
            if test x$enable_audio = xyes; then
                CFLAGS="$CFLAGS -DSUNAUDIO_SUPPORT"
                AUDIO_SUBDIRS="$AUDIO_SUBDIRS sun"
                AUDIO_DRIVERS="$AUDIO_DRIVERS sun/libaudio_sun.la"
            fi
        fi
        # Set up files for the joystick library
        if test x$enable_joystick = xyes; then
            JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS mint"
            JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS mint/libjoystick_mint.la"
        fi
        # Set up files for the cdrom library
        if test x$enable_cdrom = xyes; then
            CDROM_SUBDIRS="$CDROM_SUBDIRS dummy"
            CDROM_DRIVERS="$CDROM_DRIVERS dummy/libcdrom_dummy.la"
        fi
        # Set up files for the thread library
        if test x$enable_threads = xyes; then
            CopyUnixThreadSource
        fi
        # Set up files for the timer library
        if test x$enable_timers = xyes; then
            if test x$enable_threads = xyes -a x$enable_pth = xyes; then
                
  echo "Copying src/timer/linux/SDL_systimer.c -> src/timer/SDL_systimer.c"
  old="$srcdir/src/timer/linux/SDL_systimer.c"
  new="$srcdir/src/timer/SDL_systimer.c"
  cat >$new <<__EOF__
/* WARNING:  This file was automatically generated!
 * Original: $old
 */
__EOF__
  cat >>$new <$old

            else
                
  echo "Copying src/timer/mint/SDL_systimer.c -> src/timer/SDL_systimer.c"
  old="$srcdir/src/timer/mint/SDL_systimer.c"
  new="$srcdir/src/timer/SDL_systimer.c"
  cat >$new <<__EOF__
/* WARNING:  This file was automatically generated!
 * Original: $old
 */
__EOF__
  cat >>$new <$old

                
  echo "Copying src/timer/mint/SDL_vbltimer.S -> src/timer/SDL_vbltimer.S"
  old="$srcdir/src/timer/mint/SDL_vbltimer.S"
  new="$srcdir/src/timer/SDL_vbltimer.S"
  cat >$new <<__EOF__
/* WARNING:  This file was automatically generated!
 * Original: $old
 */
__EOF__
  cat >>$new <$old

                
  echo "Copying src/timer/mint/SDL_vbltimer_s.h -> src/timer/SDL_vbltimer_s.h"
  old="$srcdir/src/timer/mint/SDL_vbltimer_s.h"
  new="$srcdir/src/timer/SDL_vbltimer_s.h"
  cat >$new <<__EOF__
/* WARNING:  This file was automatically generated!
 * Original: $old
 */
__EOF__
  cat >>$new <$old

            fi
        fi
        # MiNT does not define "unix"
        CFLAGS="$CFLAGS -Dunix"
        ;;
    *-*-riscos)
        ARCH=riscos
        JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS riscos"
        JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS riscos/libjoystick_riscos.la"
        
  echo "Copying src/timer/riscos/SDL_systimer.c -> src/timer/SDL_systimer.c"
  old="$srcdir/src/timer/riscos/SDL_systimer.c"
  new="$srcdir/src/timer/SDL_systimer.c"
  cat >$new <<__EOF__
/* WARNING:  This file was automatically generated!
 * Original: $old
 */
__EOF__
  cat >>$new <$old

        
  echo "Copying src/main/linux/SDL_main.c -> src/main/SDL_main.c"
  old="$srcdir/src/main/linux/SDL_main.c"
  new="$srcdir/src/main/SDL_main.c"
  cat >$new <<__EOF__
/* WARNING:  This file was automatically generated!
 * Original: $old
 */
__EOF__
  cat >>$new <$old

        VIDEO_SUBDIRS="$VIDEO_SUBDIRS riscos"
        VIDEO_DRIVERS="$VIDEO_DRIVERS riscos/libvideo_riscos.la"
        AUDIO_SUBDIRS="$AUDIO_SUBDIRS riscos"
        AUDIO_DRIVERS="$AUDIO_DRIVERS riscos/libaudio_riscos.la"

        if test x$enable_cdrom = xyes; then
            CDROM_SUBDIRS="$CDROM_SUBDIRS dummy"
            CDROM_DRIVERS="$CDROM_DRIVERS dummy/libcdrom_dummy.la"
        fi

        CFLAGS="$CFLAGS -DDISABLE_THREADS -DENABLE_RISCOS -DDRENDERER_SUPPORT"

        SYSTEM_LIBS="$SYSTEM_LIBS -ljpeg -ltiff -lpng -lz"
        ;;
    *)
        { echo "configure: error: Unsupported target:  Please add to configure.in" 1>&2; exit 1; }
        ;;
esac


# Set the conditional variables for this target


if test $ARCH = linux; then
  TARGET_LINUX_TRUE=
  TARGET_LINUX_FALSE='#'
else
  TARGET_LINUX_TRUE='#'
  TARGET_LINUX_FALSE=
fi


if test "x$video_qtopia" = "xyes"; then
  TARGET_QTOPIA_TRUE=
  TARGET_QTOPIA_FALSE='#'
else
  TARGET_QTOPIA_TRUE='#'
  TARGET_QTOPIA_FALSE=
fi


if test $ARCH = solaris; then
  TARGET_SOLARIS_TRUE=
  TARGET_SOLARIS_FALSE='#'
else
  TARGET_SOLARIS_TRUE='#'
  TARGET_SOLARIS_FALSE=
fi


if test $ARCH = irix; then
  TARGET_IRIX_TRUE=
  TARGET_IRIX_FALSE='#'
else
  TARGET_IRIX_TRUE='#'
  TARGET_IRIX_FALSE=
fi


if test $ARCH = bsdi; then
  TARGET_BSDI_TRUE=
  TARGET_BSDI_FALSE='#'
else
  TARGET_BSDI_TRUE='#'
  TARGET_BSDI_FALSE=
fi


if test $ARCH = freebsd; then
  TARGET_FREEBSD_TRUE=
  TARGET_FREEBSD_FALSE='#'
else
  TARGET_FREEBSD_TRUE='#'
  TARGET_FREEBSD_FALSE=
fi


if test $ARCH = netbsd; then
  TARGET_NETBSD_TRUE=
  TARGET_NETBSD_FALSE='#'
else
  TARGET_NETBSD_TRUE='#'
  TARGET_NETBSD_FALSE=
fi


if test $ARCH = openbsd; then
  TARGET_OPENBSD_TRUE=
  TARGET_OPENBSD_FALSE='#'
else
  TARGET_OPENBSD_TRUE='#'
  TARGET_OPENBSD_FALSE=
fi


if test $ARCH = aix; then
  TARGET_AIX_TRUE=
  TARGET_AIX_FALSE='#'
else
  TARGET_AIX_TRUE='#'
  TARGET_AIX_FALSE=
fi


if test $ARCH = win32; then
  TARGET_WIN32_TRUE=
  TARGET_WIN32_FALSE='#'
else
  TARGET_WIN32_TRUE='#'
  TARGET_WIN32_FALSE=
fi


if test $ARCH = beos; then
  TARGET_BEOS_TRUE=
  TARGET_BEOS_FALSE='#'
else
  TARGET_BEOS_TRUE='#'
  TARGET_BEOS_FALSE=
fi


if test $ARCH = macos; then
  TARGET_MACOS_TRUE=
  TARGET_MACOS_FALSE='#'
else
  TARGET_MACOS_TRUE='#'
  TARGET_MACOS_FALSE=
fi


if test $ARCH = macosx; then
  TARGET_MACOSX_TRUE=
  TARGET_MACOSX_FALSE='#'
else
  TARGET_MACOSX_TRUE='#'
  TARGET_MACOSX_FALSE=
fi


if test $ARCH = qnx; then
  TARGET_QNX_TRUE=
  TARGET_QNX_FALSE='#'
else
  TARGET_QNX_TRUE='#'
  TARGET_QNX_FALSE=
fi


if test $ARCH = mint; then
  TARGET_MINT_TRUE=
  TARGET_MINT_FALSE='#'
else
  TARGET_MINT_TRUE='#'
  TARGET_MINT_FALSE=
fi

# More automake conditionals


if test x$use_directx = xyes; then
  USE_DIRECTX_TRUE=
  USE_DIRECTX_FALSE='#'
else
  USE_DIRECTX_TRUE='#'
  USE_DIRECTX_FALSE=
fi


if test x$use_clone = xyes; then
  USE_CLONE_TRUE=
  USE_CLONE_FALSE='#'
else
  USE_CLONE_TRUE='#'
  USE_CLONE_FALSE=
fi

# Set conditional variables for shared and static library selection.
# These are not used in any Makefile.am but in sdl-config.in.


if test "$enable_shared" = yes; then
  ENABLE_SHARED_TRUE=
  ENABLE_SHARED_FALSE='#'
else
  ENABLE_SHARED_TRUE='#'
  ENABLE_SHARED_FALSE=
fi


if test "$enable_static" = yes; then
  ENABLE_STATIC_TRUE=
  ENABLE_STATIC_FALSE='#'
else
  ENABLE_STATIC_TRUE='#'
  ENABLE_STATIC_FALSE=
fi

# Set runtime shared library paths as needed

if test $ARCH = linux -o $ARCH = freebsd -o $ARCH = bsdi; then
  SDL_RLD_FLAGS="-Wl,-rpath,\${exec_prefix}/lib"
fi
if test $ARCH = solaris; then
  SDL_RLD_FLAGS="-R\${exec_prefix}/lib"
fi

case "$ARCH" in
  openbsd | netbsd | bsdi)
    SHARED_SYSTEM_LIBS="$SYSTEM_LIBS"
    ;;
  qnx)
    SHARED_SYSTEM_LIBS="$SYSTEM_LIBS"
    ;;
  macosx)
    SHARED_SYSTEM_LIBS="-framework Cocoa"
    if test x$enable_video = xyes -a x$enable_video_opengl = xyes; then
      SHARED_SYSTEM_LIBS="$SHARED_SYSTEM_LIBS -framework OpenGL"
    fi
    ;;
  *)
    SHARED_SYSTEM_LIBS=""
    ;;
esac

STATIC_SYSTEM_LIBS="$SYSTEM_LIBS"

if test x$enable_video = xtrue; then
    if test "$VIDEO_SUBDIRS" = ""; then
        { echo "configure: error: *** No video drivers are enabled!" 1>&2; exit 1; }
    fi
fi



















CFLAGS="$CFLAGS -I\$(top_srcdir)/include"
CFLAGS="$CFLAGS -I\$(top_srcdir)/include/SDL"
CFLAGS="$CFLAGS -I\$(top_srcdir)/src -I\$(top_srcdir)/src/$ARCH"
CFLAGS="$CFLAGS -I\$(top_srcdir)/src/main"
CFLAGS="$CFLAGS -I\$(top_srcdir)/src/audio"
CFLAGS="$CFLAGS -I\$(top_srcdir)/src/video"
CFLAGS="$CFLAGS -I\$(top_srcdir)/src/video/XFree86/extensions"
CFLAGS="$CFLAGS -I\$(top_srcdir)/src/events"
CFLAGS="$CFLAGS -I\$(top_srcdir)/src/joystick"
CFLAGS="$CFLAGS -I\$(top_srcdir)/src/cdrom"
CFLAGS="$CFLAGS -I\$(top_srcdir)/src/thread"
CFLAGS="$CFLAGS -I\$(top_srcdir)/src/timer"
CFLAGS="$CFLAGS -I\$(top_srcdir)/src/endian"
CFLAGS="$CFLAGS -I\$(top_srcdir)/src/file"
CXXFLAGS="$CFLAGS"


# Check for darwin at the very end and set up the Objective C compiler
# We do this here so that we get the full CFLAGS into OBJCFLAGS
case "$target" in
    *-*-darwin*)
                echo $ac_n "checking for an Objective-C compiler""... $ac_c" 1>&6
echo "configure:9182: checking for an Objective-C compiler" >&5
        OBJC="$CC"
        
        OBJCFLAGS="$CFLAGS"
        
                                OBJCDEPMODE="depmode=gcc"
        
                echo "$ac_t""not implemented yet" 1>&6
        ;;
esac

# Finally create all the generated files
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

# Transform confdefs.h into DEFS.
# Protect against shell expansion while executing Makefile rules.
# Protect against Makefile macro expansion.
cat > conftest.defs <<\EOF
s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%-D\1=\2%g
s%[ 	`~#$^&*(){}\\|;'"<>?]%\\&%g
s%\[%\\&%g
s%\]%\\&%g
s%\$%$$%g
EOF
DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' '`
rm -f conftest.defs


# 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
docs/Makefile
docs/html/Makefile
docs/man3/Makefile
include/Makefile
src/Makefile
src/main/Makefile
src/main/macosx/Makefile
src/main/macosx/Info.plist
src/audio/Makefile
src/audio/alsa/Makefile
src/audio/arts/Makefile
src/audio/baudio/Makefile
src/audio/dc/Makefile
src/audio/disk/Makefile
src/audio/dma/Makefile
src/audio/dmedia/Makefile
src/audio/dsp/Makefile
src/audio/esd/Makefile
src/audio/macrom/Makefile
src/audio/mint/Makefile
src/audio/mme/Makefile
src/audio/nas/Makefile
src/audio/nto/Makefile
src/audio/openbsd/Makefile
src/audio/paudio/Makefile
src/audio/riscos/Makefile
src/audio/sun/Makefile
src/audio/ums/Makefile
src/audio/windib/Makefile
src/audio/windx5/Makefile
src/video/Makefile
src/video/aalib/Makefile
src/video/ataricommon/Makefile
src/video/bwindow/Makefile
src/video/cybergfx/Makefile
src/video/dc/Makefile
src/video/dga/Makefile
src/video/directfb/Makefile
src/video/dummy/Makefile
src/video/epoc/Makefile
src/video/fbcon/Makefile
src/video/gem/Makefile
src/video/ggi/Makefile
src/video/maccommon/Makefile
src/video/macdsp/Makefile
src/video/macrom/Makefile
src/video/nanox/Makefile
src/video/photon/Makefile
src/video/picogui/Makefile
src/video/ps2gs/Makefile
src/video/qtopia/Makefile
src/video/quartz/Makefile
src/video/riscos/Makefile
src/video/svga/Makefile
src/video/vgl/Makefile
src/video/wincommon/Makefile
src/video/windib/Makefile
src/video/windx5/Makefile
src/video/x11/Makefile
src/video/xbios/Makefile
src/video/XFree86/Makefile
src/video/XFree86/extensions/Makefile
src/video/XFree86/Xinerama/Makefile
src/video/XFree86/Xv/Makefile
src/video/XFree86/Xxf86dga/Makefile
src/video/XFree86/Xxf86vm/Makefile
src/events/Makefile
src/joystick/Makefile
src/joystick/amigaos/Makefile
src/joystick/beos/Makefile
src/joystick/bsd/Makefile
src/joystick/darwin/Makefile
src/joystick/dc/Makefile
src/joystick/dummy/Makefile
src/joystick/linux/Makefile
src/joystick/macos/Makefile
src/joystick/mint/Makefile
src/joystick/riscos/Makefile
src/joystick/win32/Makefile
src/cdrom/Makefile
src/cdrom/aix/Makefile
src/cdrom/beos/Makefile
src/cdrom/dc/Makefile
src/cdrom/dummy/Makefile
src/cdrom/bsdi/Makefile
src/cdrom/freebsd/Makefile
src/cdrom/linux/Makefile
src/cdrom/macos/Makefile
src/cdrom/macosx/Makefile
src/cdrom/openbsd/Makefile
src/cdrom/osf/Makefile
src/cdrom/qnx/Makefile
src/cdrom/win32/Makefile
src/thread/Makefile
src/timer/Makefile
src/endian/Makefile
src/file/Makefile
src/hermes/Makefile
sdl-config
SDL.spec
SDL.qpg
" | 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%@SDL_MAJOR_VERSION@%$SDL_MAJOR_VERSION%g
s%@SDL_MINOR_VERSION@%$SDL_MINOR_VERSION%g
s%@SDL_MICRO_VERSION@%$SDL_MICRO_VERSION%g
s%@SDL_INTERFACE_AGE@%$SDL_INTERFACE_AGE%g
s%@SDL_BINARY_AGE@%$SDL_BINARY_AGE%g
s%@SDL_VERSION@%$SDL_VERSION%g
s%@LT_RELEASE@%$LT_RELEASE%g
s%@LT_CURRENT@%$LT_CURRENT%g
s%@LT_REVISION@%$LT_REVISION%g
s%@LT_AGE@%$LT_AGE%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%@target@%$target%g
s%@target_alias@%$target_alias%g
s%@target_cpu@%$target_cpu%g
s%@target_vendor@%$target_vendor%g
s%@target_os@%$target_os%g
s%@build@%$build%g
s%@build_alias@%$build_alias%g
s%@build_cpu@%$build_cpu%g
s%@build_vendor@%$build_vendor%g
s%@build_os@%$build_os%g
s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
s%@INSTALL_DATA@%$INSTALL_DATA%g
s%@PACKAGE@%$PACKAGE%g
s%@VERSION@%$VERSION%g
s%@ACLOCAL@%$ACLOCAL%g
s%@AUTOCONF@%$AUTOCONF%g
s%@AUTOMAKE@%$AUTOMAKE%g
s%@AUTOHEADER@%$AUTOHEADER%g
s%@MAKEINFO@%$MAKEINFO%g
s%@SET_MAKE@%$SET_MAKE%g
s%@RANLIB@%$RANLIB%g
s%@CC@%$CC%g
s%@LN_S@%$LN_S%g
s%@DLLTOOL@%$DLLTOOL%g
s%@AS@%$AS%g
s%@OBJDUMP@%$OBJDUMP%g
s%@LIBTOOL@%$LIBTOOL%g
s%@CXX@%$CXX%g
s%@CPP@%$CPP%g
s%@ALLOCA@%$ALLOCA%g
s%@ASFLAGS@%$ASFLAGS%g
s%@CCAS@%$CCAS%g
s%@CCASFLAGS@%$CCASFLAGS%g
s%@am__fastdepOBJC_TRUE@%$am__fastdepOBJC_TRUE%g
s%@am__fastdepOBJC_FALSE@%$am__fastdepOBJC_FALSE%g
s%@ESD_CONFIG@%$ESD_CONFIG%g
s%@ESD_CFLAGS@%$ESD_CFLAGS%g
s%@ESD_LIBS@%$ESD_LIBS%g
s%@esd_lib@%$esd_lib%g
s%@ARTSCCONFIG@%$ARTSCCONFIG%g
s%@arts_lib@%$arts_lib%g
s%@NASM@%$NASM%g
s%@NASMFLAGS@%$NASMFLAGS%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%@PKG_CONFIG@%$PKG_CONFIG%g
s%@DIRECTFB_CFLAGS@%$DIRECTFB_CFLAGS%g
s%@DIRECTFB_LIBS@%$DIRECTFB_LIBS%g
s%@PTH_CONFIG@%$PTH_CONFIG%g
s%@ARCH@%$ARCH%g
s%@TARGET_LINUX_TRUE@%$TARGET_LINUX_TRUE%g
s%@TARGET_LINUX_FALSE@%$TARGET_LINUX_FALSE%g
s%@TARGET_QTOPIA_TRUE@%$TARGET_QTOPIA_TRUE%g
s%@TARGET_QTOPIA_FALSE@%$TARGET_QTOPIA_FALSE%g
s%@TARGET_SOLARIS_TRUE@%$TARGET_SOLARIS_TRUE%g
s%@TARGET_SOLARIS_FALSE@%$TARGET_SOLARIS_FALSE%g
s%@TARGET_IRIX_TRUE@%$TARGET_IRIX_TRUE%g
s%@TARGET_IRIX_FALSE@%$TARGET_IRIX_FALSE%g
s%@TARGET_BSDI_TRUE@%$TARGET_BSDI_TRUE%g
s%@TARGET_BSDI_FALSE@%$TARGET_BSDI_FALSE%g
s%@TARGET_FREEBSD_TRUE@%$TARGET_FREEBSD_TRUE%g
s%@TARGET_FREEBSD_FALSE@%$TARGET_FREEBSD_FALSE%g
s%@TARGET_NETBSD_TRUE@%$TARGET_NETBSD_TRUE%g
s%@TARGET_NETBSD_FALSE@%$TARGET_NETBSD_FALSE%g
s%@TARGET_OPENBSD_TRUE@%$TARGET_OPENBSD_TRUE%g
s%@TARGET_OPENBSD_FALSE@%$TARGET_OPENBSD_FALSE%g
s%@TARGET_AIX_TRUE@%$TARGET_AIX_TRUE%g
s%@TARGET_AIX_FALSE@%$TARGET_AIX_FALSE%g
s%@TARGET_WIN32_TRUE@%$TARGET_WIN32_TRUE%g
s%@TARGET_WIN32_FALSE@%$TARGET_WIN32_FALSE%g
s%@TARGET_BEOS_TRUE@%$TARGET_BEOS_TRUE%g
s%@TARGET_BEOS_FALSE@%$TARGET_BEOS_FALSE%g
s%@TARGET_MACOS_TRUE@%$TARGET_MACOS_TRUE%g
s%@TARGET_MACOS_FALSE@%$TARGET_MACOS_FALSE%g
s%@TARGET_MACOSX_TRUE@%$TARGET_MACOSX_TRUE%g
s%@TARGET_MACOSX_FALSE@%$TARGET_MACOSX_FALSE%g
s%@TARGET_QNX_TRUE@%$TARGET_QNX_TRUE%g
s%@TARGET_QNX_FALSE@%$TARGET_QNX_FALSE%g
s%@TARGET_MINT_TRUE@%$TARGET_MINT_TRUE%g
s%@TARGET_MINT_FALSE@%$TARGET_MINT_FALSE%g
s%@USE_DIRECTX_TRUE@%$USE_DIRECTX_TRUE%g
s%@USE_DIRECTX_FALSE@%$USE_DIRECTX_FALSE%g
s%@USE_CLONE_TRUE@%$USE_CLONE_TRUE%g
s%@USE_CLONE_FALSE@%$USE_CLONE_FALSE%g
s%@ENABLE_SHARED_TRUE@%$ENABLE_SHARED_TRUE%g
s%@ENABLE_SHARED_FALSE@%$ENABLE_SHARED_FALSE%g
s%@ENABLE_STATIC_TRUE@%$ENABLE_STATIC_TRUE%g
s%@ENABLE_STATIC_FALSE@%$ENABLE_STATIC_FALSE%g
s%@AUDIO_SUBDIRS@%$AUDIO_SUBDIRS%g
s%@AUDIO_DRIVERS@%$AUDIO_DRIVERS%g
s%@VIDEO_SUBDIRS@%$VIDEO_SUBDIRS%g
s%@VIDEO_DRIVERS@%$VIDEO_DRIVERS%g
s%@JOYSTICK_SUBDIRS@%$JOYSTICK_SUBDIRS%g
s%@JOYSTICK_DRIVERS@%$JOYSTICK_DRIVERS%g
s%@CDROM_SUBDIRS@%$CDROM_SUBDIRS%g
s%@CDROM_DRIVERS@%$CDROM_DRIVERS%g
s%@SDL_EXTRADIRS@%$SDL_EXTRADIRS%g
s%@SDL_EXTRALIBS@%$SDL_EXTRALIBS%g
s%@SDL_CFLAGS@%$SDL_CFLAGS%g
s%@SDL_LIBS@%$SDL_LIBS%g
s%@SDL_RLD_FLAGS@%$SDL_RLD_FLAGS%g
s%@STATIC_SYSTEM_LIBS@%$STATIC_SYSTEM_LIBS%g
s%@SHARED_SYSTEM_LIBS@%$SHARED_SYSTEM_LIBS%g
s%@SYSTEM_LIBS@%$SYSTEM_LIBS%g
s%@OBJC@%$OBJC%g
s%@OBJCFLAGS@%$OBJCFLAGS%g
s%@OBJCDEPMODE@%$OBJCDEPMODE%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
docs/Makefile
docs/html/Makefile
docs/man3/Makefile
include/Makefile
src/Makefile
src/main/Makefile
src/main/macosx/Makefile
src/main/macosx/Info.plist
src/audio/Makefile
src/audio/alsa/Makefile
src/audio/arts/Makefile
src/audio/baudio/Makefile
src/audio/dc/Makefile
src/audio/disk/Makefile
src/audio/dma/Makefile
src/audio/dmedia/Makefile
src/audio/dsp/Makefile
src/audio/esd/Makefile
src/audio/macrom/Makefile
src/audio/mint/Makefile
src/audio/mme/Makefile
src/audio/nas/Makefile
src/audio/nto/Makefile
src/audio/openbsd/Makefile
src/audio/paudio/Makefile
src/audio/riscos/Makefile
src/audio/sun/Makefile
src/audio/ums/Makefile
src/audio/windib/Makefile
src/audio/windx5/Makefile
src/video/Makefile
src/video/aalib/Makefile
src/video/ataricommon/Makefile
src/video/bwindow/Makefile
src/video/cybergfx/Makefile
src/video/dc/Makefile
src/video/dga/Makefile
src/video/directfb/Makefile
src/video/dummy/Makefile
src/video/epoc/Makefile
src/video/fbcon/Makefile
src/video/gem/Makefile
src/video/ggi/Makefile
src/video/maccommon/Makefile
src/video/macdsp/Makefile
src/video/macrom/Makefile
src/video/nanox/Makefile
src/video/photon/Makefile
src/video/picogui/Makefile
src/video/ps2gs/Makefile
src/video/qtopia/Makefile
src/video/quartz/Makefile
src/video/riscos/Makefile
src/video/svga/Makefile
src/video/vgl/Makefile
src/video/wincommon/Makefile
src/video/windib/Makefile
src/video/windx5/Makefile
src/video/x11/Makefile
src/video/xbios/Makefile
src/video/XFree86/Makefile
src/video/XFree86/extensions/Makefile
src/video/XFree86/Xinerama/Makefile
src/video/XFree86/Xv/Makefile
src/video/XFree86/Xxf86dga/Makefile
src/video/XFree86/Xxf86vm/Makefile
src/events/Makefile
src/joystick/Makefile
src/joystick/amigaos/Makefile
src/joystick/beos/Makefile
src/joystick/bsd/Makefile
src/joystick/darwin/Makefile
src/joystick/dc/Makefile
src/joystick/dummy/Makefile
src/joystick/linux/Makefile
src/joystick/macos/Makefile
src/joystick/mint/Makefile
src/joystick/riscos/Makefile
src/joystick/win32/Makefile
src/cdrom/Makefile
src/cdrom/aix/Makefile
src/cdrom/beos/Makefile
src/cdrom/dc/Makefile
src/cdrom/dummy/Makefile
src/cdrom/bsdi/Makefile
src/cdrom/freebsd/Makefile
src/cdrom/linux/Makefile
src/cdrom/macos/Makefile
src/cdrom/macosx/Makefile
src/cdrom/openbsd/Makefile
src/cdrom/osf/Makefile
src/cdrom/qnx/Makefile
src/cdrom/win32/Makefile
src/thread/Makefile
src/timer/Makefile
src/endian/Makefile
src/file/Makefile
src/hermes/Makefile
sdl-config
SDL.spec
SDL.qpg
"}
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*

EOF
cat >> $CONFIG_STATUS <<EOF

EOF
cat >> $CONFIG_STATUS <<\EOF
chmod +x sdl-config
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

