configure.in
author Ryan C. Gordon <icculus@icculus.org>
Mon, 12 Dec 2005 09:26:32 +0000
changeset 1201 718d00094f82
parent 1200 8f418dce02b2
child 1203 a67c8b2ae356
permissions -rw-r--r--
Date: Sat, 10 Dec 2005 18:29:41 +0100
From: Alberto Mardegan <mardy@users.sourceforge.net>
To: sdl@libsdl.org
Subject: [SDL] [PATCH] Touchscreen support to fbcon via tslib


Hi all!

I'm new to this list, I just subscribed. I've attached to this e-mail
a patch I've written in order to add Touchscreen support to SDL's fbcon
module via the tslib library.
Since it introduces a new dependency, I've also edited the the
configure.in file and added it as a compile-time option.

This patch is especially useful for handhelds (I've tested it in my
Zaurus).
Please consider applying it. :-)


--
Saluti,
Mardy
http://interlingua.altervista.org
     1 dnl Process this file with autoconf to produce a configure script.
     2 AC_INIT(README)
     3 
     4 dnl Set various version strings - taken gratefully from the GTk sources
     5 #
     6 # Making releases:
     7 # Edit include/SDL/SDL_version.h and change the version, then:
     8 #   SDL_MICRO_VERSION += 1;
     9 #   SDL_INTERFACE_AGE += 1;
    10 #   SDL_BINARY_AGE += 1;
    11 # if any functions have been added, set SDL_INTERFACE_AGE to 0.
    12 # if backwards compatibility has been broken,
    13 # set SDL_BINARY_AGE and SDL_INTERFACE_AGE to 0.
    14 #
    15 SDL_MAJOR_VERSION=1
    16 SDL_MINOR_VERSION=2
    17 SDL_MICRO_VERSION=9
    18 SDL_INTERFACE_AGE=2
    19 SDL_BINARY_AGE=9
    20 SDL_VERSION=$SDL_MAJOR_VERSION.$SDL_MINOR_VERSION.$SDL_MICRO_VERSION
    21 
    22 AC_SUBST(SDL_MAJOR_VERSION)
    23 AC_SUBST(SDL_MINOR_VERSION)
    24 AC_SUBST(SDL_MICRO_VERSION)
    25 AC_SUBST(SDL_INTERFACE_AGE)
    26 AC_SUBST(SDL_BINARY_AGE)
    27 AC_SUBST(SDL_VERSION)
    28 
    29 # libtool versioning
    30 LT_RELEASE=$SDL_MAJOR_VERSION.$SDL_MINOR_VERSION
    31 LT_CURRENT=`expr $SDL_MICRO_VERSION - $SDL_INTERFACE_AGE`
    32 LT_REVISION=$SDL_INTERFACE_AGE
    33 LT_AGE=`expr $SDL_BINARY_AGE - $SDL_INTERFACE_AGE`
    34 
    35 AC_SUBST(LT_RELEASE)
    36 AC_SUBST(LT_CURRENT)
    37 AC_SUBST(LT_REVISION)
    38 AC_SUBST(LT_AGE)
    39 
    40 dnl Detect the canonical host and target build environment
    41 AC_CANONICAL_SYSTEM
    42 
    43 dnl Setup for automake
    44 AM_INIT_AUTOMAKE(SDL, $SDL_VERSION)
    45 
    46 dnl Check for tools
    47 
    48 AC_LIBTOOL_WIN32_DLL
    49 AM_PROG_LIBTOOL
    50 AC_PROG_MAKE_SET
    51 AC_PROG_CC
    52 AC_C_INLINE
    53 AC_C_CONST
    54 AC_PROG_CXX
    55 AC_PROG_INSTALL
    56 AC_FUNC_ALLOCA
    57 ASFLAGS=""
    58 AC_SUBST(ASFLAGS)
    59 CCAS="$CC"
    60 AC_SUBST(CCAS)
    61 CCASFLAGS=""
    62 AC_SUBST(CCASFLAGS)
    63 AM_CONDITIONAL([am__fastdepOBJC], false)
    64 
    65 dnl The alpha architecture needs special flags for binary portability
    66 case "$target" in
    67     alpha*-*-linux*)
    68         if test x$ac_cv_prog_gcc = xyes; then
    69             CFLAGS="$CFLAGS -mcpu=ev4 -Wa,-mall"
    70         fi
    71         ;;
    72 esac
    73 
    74 dnl Add compiler-specific optimization flags
    75 
    76 dnl See if the user wants aggressive optimizations of the code
    77 AC_ARG_ENABLE(debug,
    78 [  --enable-debug          Disable aggressive optimizations [default=yes]],
    79               , enable_debug=yes)
    80 if test x$enable_debug != xyes; then
    81     if test x$ac_cv_prog_gcc = xyes; then
    82         CFLAGS="$CFLAGS -fexpensive-optimizations"
    83         # Ack! This breaks the MMX YV12 conversion on gcc 2.95.2
    84         # CFLAGS="$CFLAGS -fomit-frame-pointer"
    85     fi
    86     case "$target" in
    87         i486-*-*)
    88             if test x$ac_cv_prog_gcc = xyes; then
    89                 CFLAGS="$CFLAGS -march=i486"
    90             fi
    91             ;;
    92         i?86-*-*)
    93             if test x$ac_cv_prog_gcc = xyes; then
    94                 CFLAGS="$CFLAGS -march=pentium -mcpu=pentiumpro"
    95             fi
    96             ;;
    97         *-*-osf*)
    98             if test x$ac_cv_prog_gcc != xyes; then
    99                 CFLAGS="-g3 -fast -arch host"
   100             fi
   101             ;;
   102     esac
   103 fi
   104 
   105 dnl Add verbose warnings by default, and allow ANSI compliance checking
   106 AC_ARG_ENABLE(strict-ansi,
   107 [  --enable-strict-ansi    Enable strict ANSI compliance build [default=no]],
   108               , enable_strict_ansi=no)
   109 if test x$ac_cv_prog_gcc = xyes; then
   110     CFLAGS="$CFLAGS -Wall"
   111     if test x$enable_strict_ansi = xyes; then
   112         CFLAGS="$CFLAGS -ansi -pedantic -D_XOPEN_SOURCE"
   113     fi
   114 fi
   115 
   116 dnl Initialize the compiler and linker flags for SDL applications
   117 
   118 SDL_CFLAGS=""
   119 SDL_LIBS="-lSDL"
   120 
   121 dnl Add the math library for the new gamma correction support
   122 
   123 case "$target" in
   124     *-*-cygwin* | *-*-mingw32*)
   125         MATHLIB=""
   126         ;;
   127     *-*-beos*)
   128         MATHLIB=""
   129         ;;
   130     *-*-darwin*)
   131         MATHLIB=""
   132         ;;
   133     *)
   134         MATHLIB="-lm"
   135         ;;
   136 esac
   137 SYSTEM_LIBS="$SYSTEM_LIBS $MATHLIB"
   138 
   139 dnl Enable/disable various subsystems of the SDL library
   140 
   141 AC_ARG_ENABLE(audio,
   142 [  --enable-audio          Enable the audio subsystem [default=yes]],
   143               , enable_audio=yes)
   144 if test x$enable_audio = xyes; then
   145     SDL_EXTRADIRS="$SDL_EXTRADIRS audio"
   146     SDL_EXTRALIBS="$SDL_EXTRALIBS audio/libaudio.la"
   147 else
   148     CFLAGS="$CFLAGS -DDISABLE_AUDIO"
   149 fi
   150 AC_ARG_ENABLE(video,
   151 [  --enable-video          Enable the video subsystem [default=yes]],
   152               , enable_video=yes)
   153 if test x$enable_video = xyes; then
   154     SDL_EXTRADIRS="$SDL_EXTRADIRS video"
   155     SDL_EXTRALIBS="$SDL_EXTRALIBS video/libvideo.la"
   156 else
   157     CFLAGS="$CFLAGS -DDISABLE_VIDEO"
   158 fi
   159 AC_ARG_ENABLE(events,
   160 [  --enable-events         Enable the events subsystem [default=yes]],
   161               , enable_events=yes)
   162 if test x$enable_video = xyes -a x$enable_events = xyes; then
   163     SDL_EXTRADIRS="$SDL_EXTRADIRS events"
   164     SDL_EXTRALIBS="$SDL_EXTRALIBS events/libevents.la"
   165 else
   166     CFLAGS="$CFLAGS -DDISABLE_EVENTS"
   167 fi
   168 AC_ARG_ENABLE(joystick,
   169 [  --enable-joystick       Enable the joystick subsystem [default=yes]],
   170               , enable_joystick=yes)
   171 if test x$enable_joystick = xyes; then
   172     SDL_EXTRADIRS="$SDL_EXTRADIRS joystick"
   173     SDL_EXTRALIBS="$SDL_EXTRALIBS joystick/libjoystick.la"
   174 else
   175     CFLAGS="$CFLAGS -DDISABLE_JOYSTICK"
   176 fi
   177 AC_ARG_ENABLE(cdrom,
   178 [  --enable-cdrom          Enable the cdrom subsystem [default=yes]],
   179               , enable_cdrom=yes)
   180 if test x$enable_cdrom = xyes; then
   181     SDL_EXTRADIRS="$SDL_EXTRADIRS cdrom"
   182     SDL_EXTRALIBS="$SDL_EXTRALIBS cdrom/libcdrom.la"
   183 else
   184     CFLAGS="$CFLAGS -DDISABLE_CDROM"
   185 fi
   186 AC_ARG_ENABLE(threads,
   187 [  --enable-threads        Enable the threading subsystem [default=yes]],
   188               , enable_threads=yes)
   189 SDL_EXTRADIRS="$SDL_EXTRADIRS thread"
   190 SDL_EXTRALIBS="$SDL_EXTRALIBS thread/libthread.la"
   191 if test x$enable_threads != xyes; then
   192     CFLAGS="$CFLAGS -DDISABLE_THREADS"
   193     COPY_ARCH_SRC(src/thread, generic, SDL_systhread.c)
   194     COPY_ARCH_SRC(src/thread, generic, SDL_systhread_c.h)
   195     COPY_ARCH_SRC(src/thread, generic, SDL_sysmutex.c)
   196     COPY_ARCH_SRC(src/thread, generic, SDL_sysmutex_c.h)
   197     COPY_ARCH_SRC(src/thread, generic, SDL_syssem.c)
   198     COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
   199     COPY_ARCH_SRC(src/thread, generic, SDL_syscond.c)
   200     COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
   201 fi
   202 AC_ARG_ENABLE(timers,
   203 [  --enable-timers         Enable the timer subsystem [default=yes]],
   204               , enable_timers=yes)
   205 if test x$enable_timers = xyes; then
   206     SDL_EXTRADIRS="$SDL_EXTRADIRS timer"
   207     SDL_EXTRALIBS="$SDL_EXTRALIBS timer/libtimer.la"
   208 else
   209     CFLAGS="$CFLAGS -DDISABLE_TIMERS"
   210 fi
   211 AC_ARG_ENABLE(endian,
   212 [  --enable-endian         Enable the endian subsystem [default=yes]],
   213               , enable_endian=yes)
   214 if test x$enable_endian = xyes; then
   215     SDL_EXTRADIRS="$SDL_EXTRADIRS endian"
   216     SDL_EXTRALIBS="$SDL_EXTRALIBS endian/libendian.la"
   217 else
   218     CFLAGS="$CFLAGS -DDISABLE_ENDIAN"
   219 fi
   220 AC_ARG_ENABLE(file,
   221 [  --enable-file           Enable the file subsystem [default=yes]],
   222               , enable_file=yes)
   223 if test x$enable_file = xyes; then
   224     SDL_EXTRADIRS="$SDL_EXTRADIRS file"
   225     SDL_EXTRALIBS="$SDL_EXTRALIBS file/libfile.la"
   226 else
   227     CFLAGS="$CFLAGS -DDISABLE_FILE"
   228 fi
   229 AC_ARG_ENABLE(cpuinfo,
   230 [  --enable-cpuinfo        Enable the cpuinfo subsystem [default=yes]],
   231               , enable_cpuinfo=yes)
   232 if test x$enable_cpuinfo = xyes; then
   233     SDL_EXTRADIRS="$SDL_EXTRADIRS cpuinfo"
   234     SDL_EXTRALIBS="$SDL_EXTRALIBS cpuinfo/libcpuinfo.la"
   235 else
   236     CFLAGS="$CFLAGS -DDISABLE_CPUINFO"
   237 fi
   238 
   239 dnl See if the OSS audio interface is supported
   240 CheckOSS()
   241 {
   242     AC_ARG_ENABLE(oss,
   243 [  --enable-oss            support the OSS audio API [default=yes]],
   244                   , enable_oss=yes)
   245     if test x$enable_audio = xyes -a x$enable_oss = xyes; then
   246         AC_MSG_CHECKING(for OSS audio support)
   247         have_oss=no
   248         if test x$have_oss != xyes; then
   249             AC_TRY_COMPILE([
   250               #include <sys/soundcard.h>
   251             ],[
   252               int arg = SNDCTL_DSP_SETFRAGMENT;
   253             ],[
   254             have_oss=yes
   255             ])
   256         fi
   257         if test x$have_oss != xyes; then
   258             AC_TRY_COMPILE([
   259               #include <soundcard.h>
   260             ],[
   261               int arg = SNDCTL_DSP_SETFRAGMENT;
   262             ],[
   263             have_oss=yes
   264             CFLAGS="$CFLAGS -DOSS_USE_SOUNDCARD_H"
   265             ])
   266         fi
   267         AC_MSG_RESULT($have_oss)
   268         if test x$have_oss = xyes; then
   269             CFLAGS="$CFLAGS -DOSS_SUPPORT"
   270             AUDIO_SUBDIRS="$AUDIO_SUBDIRS dsp"
   271             AUDIO_DRIVERS="$AUDIO_DRIVERS dsp/libaudio_dsp.la"
   272             AUDIO_SUBDIRS="$AUDIO_SUBDIRS dma"
   273             AUDIO_DRIVERS="$AUDIO_DRIVERS dma/libaudio_dma.la"
   274         fi
   275     fi
   276 }
   277 
   278 dnl See if the ALSA audio interface is supported
   279 CheckALSA()
   280 {
   281     AC_ARG_ENABLE(alsa,
   282 [  --enable-alsa           support the ALSA audio API [default=yes]],
   283                   , enable_alsa=yes)
   284     if test x$enable_audio = xyes -a x$enable_alsa = xyes; then
   285         AM_PATH_ALSA(0.9.0, have_alsa=yes, have_alsa=no)
   286         # Restore all flags from before the ALSA detection runs
   287         CFLAGS="$alsa_save_CFLAGS"
   288         LDFLAGS="$alsa_save_LDFLAGS"
   289         LIBS="$alsa_save_LIBS"
   290         if test x$have_alsa = xyes; then
   291             AC_ARG_ENABLE(alsa-shared,
   292 [  --enable-alsa-shared     dynamically load ALSA audio support [default=yes]],
   293                           , enable_alsa_shared=yes)
   294             if test "x`echo $ALSA_LIBS | grep -- -L`" = "x"; then
   295                 if test "x`ls /lib/libasound.so.* 2> /dev/null`" != "x"; then
   296                     ALSA_LIBS="-L/lib $ALSA_LIBS"
   297                 elif test "x`ls /usr/lib/libasound.so.* 2> /dev/null`" != "x"; then
   298                     ALSA_LIBS="-L/usr/lib $ALSA_LIBS"
   299                 elif test "x`ls /usr/local/lib/libasound.so.* 2> /dev/null`" != "x"; then
   300                     ALSA_LIBS="-L/usr/local/lib $ALSA_LIBS"
   301                 fi
   302             fi
   303             alsa_lib_spec=`echo $ALSA_LIBS | sed 's/.*-L\([[^ ]]*\).*/\1\/libasound.so.*/'`
   304             alsa_lib=`ls $alsa_lib_spec | sed 's/.*\/\(.*\)/\1/; q'`
   305             echo "-- $alsa_lib_spec -> $alsa_lib"
   306 
   307             if test x$have_loadso != xyes && \
   308                test x$enable_alsa_shared = xyes; then
   309                 AC_MSG_ERROR([You must have SDL_LoadObject() support])
   310             fi
   311             if test x$have_loadso = xyes && \
   312                test x$enable_alsa_shared = xyes && test x$alsa_lib != x; then
   313                 CFLAGS="$CFLAGS -DALSA_SUPPORT -DALSA_DYNAMIC=\$(alsa_lib) $ALSA_CFLAGS"
   314                 AC_SUBST(alsa_lib)
   315 
   316                 use_dlvsym=no
   317                 AC_CHECK_LIB(dl, dlvsym, [use_dlvsym=yes])
   318                 if test x$use_dlvsym = xyes; then
   319                     CFLAGS="$CFLAGS -DUSE_DLVSYM"
   320                 fi
   321             else
   322                 CFLAGS="$CFLAGS -DALSA_SUPPORT $ALSA_CFLAGS"
   323                 SYSTEM_LIBS="$SYSTEM_LIBS $ALSA_LIBS"
   324             fi
   325             AUDIO_SUBDIRS="$AUDIO_SUBDIRS alsa"
   326             AUDIO_DRIVERS="$AUDIO_DRIVERS alsa/libaudio_alsa.la"
   327         fi
   328     fi
   329 }
   330 
   331 dnl Check whether we want to use IRIX 6.5+ native audio or not
   332 CheckDMEDIA()
   333 {
   334     if test x$enable_audio = xyes; then
   335         AC_MSG_CHECKING(for dmedia audio support)
   336         have_dmedia=no
   337         AC_TRY_COMPILE([
   338           #include <dmedia/audio.h>
   339         ],[
   340           ALport audio_port;
   341         ],[
   342         have_dmedia=yes
   343         ])
   344         AC_MSG_RESULT($have_dmedia)
   345         # Set up files for the audio library
   346         if test x$have_dmedia = xyes; then
   347             CFLAGS="$CFLAGS -DDMEDIA_SUPPORT"
   348             AUDIO_SUBDIRS="$AUDIO_SUBDIRS dmedia"
   349             AUDIO_DRIVERS="$AUDIO_DRIVERS dmedia/libaudio_dmedia.la"
   350             SYSTEM_LIBS="$SYSTEM_LIBS -laudio"
   351         fi
   352     fi
   353 }
   354 
   355 dnl Find the ESD includes and libraries
   356 CheckESD()
   357 {
   358     AC_ARG_ENABLE(esd,
   359 [  --enable-esd            support the Enlightened Sound Daemon [default=yes]],
   360                   , enable_esd=yes)
   361     if test x$enable_audio = xyes -a x$enable_esd = xyes; then
   362         AM_PATH_ESD(0.2.8, have_esd=yes, have_esd=no)
   363         if test x$have_esd = xyes; then
   364             AC_ARG_ENABLE(esd-shared,
   365 [  --enable-esd-shared     dynamically load ESD audio support [default=yes]],
   366                           , enable_esd_shared=yes)
   367             esd_lib_spec=`echo $ESD_LIBS | sed 's/.*-L\([[^ ]]*\).*/\1\/libesd.so.*/'`
   368             esd_lib=`ls $esd_lib_spec | sed 's/.*\/\(.*\)/\1/; q'`
   369             echo "-- $esd_lib_spec -> $esd_lib"
   370             if test x$have_loadso != xyes && \
   371                test x$enable_esd_shared = xyes; then
   372                 AC_MSG_ERROR([You must have SDL_LoadObject() support])
   373             fi
   374             if test x$have_loadso = xyes && \
   375                test x$enable_esd_shared = xyes && test x$esd_lib != x; then
   376                 CFLAGS="$CFLAGS -DESD_SUPPORT -DESD_DYNAMIC=\$(esd_lib) $ESD_CFLAGS"
   377                 AC_SUBST(esd_lib)
   378             else
   379                 CFLAGS="$CFLAGS -DESD_SUPPORT $ESD_CFLAGS"
   380                 SYSTEM_LIBS="$SYSTEM_LIBS $ESD_LIBS"
   381             fi
   382             AUDIO_SUBDIRS="$AUDIO_SUBDIRS esd"
   383             AUDIO_DRIVERS="$AUDIO_DRIVERS esd/libaudio_esd.la"
   384         fi
   385     fi
   386 }
   387 
   388 CheckARTSC()
   389 {
   390     AC_ARG_ENABLE(arts,
   391 [  --enable-arts           support the Analog Real Time Synthesizer [default=yes]],
   392                   , enable_arts=yes)
   393     if test x$enable_audio = xyes -a x$enable_arts = xyes; then
   394         AC_PATH_PROG(ARTSCCONFIG, artsc-config)
   395         if test x$ARTSCCONFIG = x -o x$ARTSCCONFIG = x'"$ARTSCCONFIG"'; then
   396             : # arts isn't installed
   397         else
   398             ARTSC_CFLAGS=`$ARTSCCONFIG --cflags`
   399             ARTSC_LIBS=`$ARTSCCONFIG --libs`
   400             ARTSC_PREFIX=`$ARTSCCONFIG --arts-prefix`
   401             AC_MSG_CHECKING(for aRts development environment)
   402             audio_arts=no
   403             save_CFLAGS="$CFLAGS"
   404             CFLAGS="$CFLAGS $ARTSC_CFLAGS"
   405             AC_TRY_COMPILE([
   406              #include <artsc.h>
   407             ],[
   408              arts_stream_t stream;
   409             ],[
   410             audio_arts=yes
   411             ])
   412             CFLAGS="$save_CFLAGS"
   413             AC_MSG_RESULT($audio_arts)
   414             if test x$audio_arts = xyes; then
   415                 AC_ARG_ENABLE(arts-shared,
   416 [  --enable-arts-shared    dynamically load aRts audio support [default=yes]],
   417                               , enable_arts_shared=yes)
   418                 arts_lib_spec="$ARTSC_PREFIX/lib/libartsc.so.*"
   419                 arts_lib=`ls $arts_lib_spec | sed 's/.*\/\(.*\)/\1/; q'`
   420                 echo "-- $arts_lib_spec -> $arts_lib"
   421                 if test x$have_loadso != xyes && \
   422                    test x$enable_arts_shared = xyes; then
   423                     AC_MSG_ERROR([You must have SDL_LoadObject() support])
   424                 fi
   425                 if test x$have_loadso = xyes && \
   426                    test x$enable_arts_shared = xyes && test x$arts_lib != x; then
   427                     CFLAGS="$CFLAGS -DARTSC_SUPPORT -DARTSC_DYNAMIC=\$(arts_lib) $ARTSC_CFLAGS"
   428                     AC_SUBST(arts_lib)
   429                 else
   430                     CFLAGS="$CFLAGS -DARTSC_SUPPORT $ARTSC_CFLAGS"
   431                     SYSTEM_LIBS="$SYSTEM_LIBS $ARTSC_LIBS"
   432                 fi
   433                 AUDIO_SUBDIRS="$AUDIO_SUBDIRS arts"
   434                 AUDIO_DRIVERS="$AUDIO_DRIVERS arts/libaudio_arts.la"
   435             fi
   436         fi
   437     fi
   438 }
   439 
   440 dnl See if the NAS audio interface is supported
   441 CheckNAS()
   442 {
   443     AC_ARG_ENABLE(nas,
   444 [  --enable-nas            support the NAS audio API [default=yes]],
   445                   , enable_nas=yes)
   446     if test x$enable_audio = xyes -a x$enable_nas = xyes; then
   447         AC_MSG_CHECKING(for NAS audio support)
   448         have_nas=no
   449         if test -r /usr/X11R6/include/audio/audiolib.h; then
   450             have_nas=yes
   451             CFLAGS="$CFLAGS -DNAS_SUPPORT -I/usr/X11R6/include/"
   452             SYSTEM_LIBS="$SYSTEM_LIBS -laudio -lXt"
   453             AUDIO_SUBDIRS="$AUDIO_SUBDIRS nas"
   454             AUDIO_DRIVERS="$AUDIO_DRIVERS nas/libaudio_nas.la"
   455 
   456         dnl On IRIX, the NAS includes are in a different directory,
   457         dnl and libnas must be explicitly linked in
   458 
   459         elif test -r /usr/freeware/include/nas/audiolib.h; then
   460             have_nas=yes
   461             CFLAGS="$CFLAGS -DNAS_SUPPORT"
   462             SYSTEM_LIBS="$SYSTEM_LIBS -lnas -lXt"
   463             AUDIO_SUBDIRS="$AUDIO_SUBDIRS nas"
   464             AUDIO_DRIVERS="$AUDIO_DRIVERS nas/libaudio_nas.la"
   465         fi
   466         AC_MSG_RESULT($have_nas)
   467     fi
   468 }
   469 
   470 dnl rcg07142001 See if the user wants the disk writer audio driver...
   471 CheckDiskAudio()
   472 {
   473     AC_ARG_ENABLE(diskaudio,
   474 [  --enable-diskaudio      support the disk writer audio driver [default=yes]],
   475                   , enable_diskaudio=yes)
   476     if test x$enable_audio = xyes -a x$enable_diskaudio = xyes; then
   477         CFLAGS="$CFLAGS -DDISKAUD_SUPPORT"
   478         AUDIO_SUBDIRS="$AUDIO_SUBDIRS disk"
   479         AUDIO_DRIVERS="$AUDIO_DRIVERS disk/libaudio_disk.la"
   480     fi
   481 }
   482 
   483 dnl Set up the Atari Audio driver
   484 CheckAtariAudio()
   485 {
   486     AC_ARG_ENABLE(mintaudio,
   487 [  --enable-mintaudio      support Atari audio driver [default=yes]],
   488                   , enable_mintaudio=yes)
   489     if test x$enable_audio = xyes -a x$enable_mintaudio = xyes; then
   490         mintaudio=no
   491         AC_CHECK_HEADER(mint/falcon.h, have_mint_falcon_hdr=yes)
   492         if test x$have_mint_falcon_hdr = xyes; then
   493             mintaudio=yes
   494             CFLAGS="$CFLAGS -DMINTAUDIO_SUPPORT"
   495             AUDIO_SUBDIRS="$AUDIO_SUBDIRS mint"
   496             AUDIO_DRIVERS="$AUDIO_DRIVERS mint/libaudio_mintaudio.la"
   497         fi
   498     fi
   499 }
   500 
   501 dnl See if we can use x86 assembly blitters
   502 # NASM is available from: http://nasm.octium.net/
   503 CheckNASM()
   504 {
   505     dnl Make sure we are running on an x86 platform
   506     case $target in
   507         i?86*)
   508             ;;
   509         *)
   510         # Nope, bail early.
   511             return
   512             ;;
   513     esac
   514     dnl Check for NASM (for assembly blit routines)
   515     AC_ARG_ENABLE(nasm,
   516 [  --enable-nasm           use nasm assembly blitters on x86 [default=yes]],
   517                   , enable_nasm=yes)
   518     if test x$enable_video = xyes -a x$enable_nasm = xyes; then
   519         AC_PATH_PROG(NASM, nasm)
   520         if test x$NASM = x -o x$NASM = x'"$NASM"'; then
   521             : # nasm isn't installed
   522         else
   523             CFLAGS="$CFLAGS -DUSE_ASMBLIT -I$srcdir/hermes"
   524             case $ARCH in
   525               win32)
   526                   NASMFLAGS="-f win32"
   527                   ;;
   528               openbsd)
   529                   NASMFLAGS="-f aoutb"
   530                   ;;
   531               *)
   532                   NASMFLAGS="-f elf"
   533                   ;;
   534             esac
   535             AC_SUBST(NASMFLAGS)
   536             CFLAGS="$CFLAGS -I\$(top_srcdir)/src/hermes"
   537             SDL_EXTRADIRS="$SDL_EXTRADIRS hermes"
   538             SDL_EXTRALIBS="$SDL_EXTRALIBS hermes/libhermes.la"
   539             use_nasm=yes
   540             
   541             case "$target" in
   542                 # this line is needed for QNX, because it's not defined the __ELF__
   543                 *-*-qnx*) CFLAGS="$CFLAGS -D__ELF__"
   544                           ;;
   545 
   546             esac
   547 
   548         fi
   549     fi
   550 }
   551 
   552 dnl Do the iPod thing
   553 CheckIPod()
   554 {
   555     AC_ARG_ENABLE(ipod,
   556 [  --enable-ipod          configure SDL to work with iPodLinux [default=yes on arm-elf]],
   557 	, enable_ipod=yes)
   558 
   559     if test x$enable_ipod = xyes; then
   560 	CFLAGS="$CFLAGS -DENABLE_IPOD -DIPOD"
   561 	VIDEO_SUBDIRS="$VIDEO_SUBDIRS ipod"
   562 	VIDEO_DRIVERS="$VIDEO_DRIVERS ipod/libvideo_ipod.la"
   563     fi
   564 }	
   565 
   566 dnl Find the nanox include and library directories
   567 CheckNANOX()
   568 {
   569     AC_ARG_ENABLE(video-nanox,
   570         [  --enable-video-nanox use nanox video driver [default=no]],
   571         , enable_video_nanox=no)
   572     AC_ARG_ENABLE(nanox-debug,  
   573         [  --enable-nanox-debug print debug messages [default=no]],
   574         , enable_nanox_debug=no)
   575     AC_ARG_ENABLE(nanox-share-memory,  
   576         [  --enable-nanox-share-memory use share memory [default=no]],
   577         , enable_nanox_share_memory=no)
   578     AC_ARG_ENABLE(nanox_direct_fb, 
   579         [  --enable-nanox-direct-fb use direct framebuffer access [default=no]],
   580         , enable_nanox_direct_fb=no)
   581 
   582     if test x$enable_video = xyes -a x$enable_video_nanox = xyes; then
   583         if test x$enable_nanox_debug = xyes; then
   584             CFLAGS="$CFLAGS -DENABLE_NANOX_DEBUG"
   585         fi
   586 
   587         if test x$enable_nanox_share_memory = xyes; then
   588             CFLAGS="$CFLAGS -DNANOX_SHARE_MEMORY"
   589         fi
   590 
   591         if test x$enable_nanox_direct_fb = xyes; then
   592             CFLAGS="$CFLAGS -DENABLE_NANOX_DIRECT_FB"
   593         fi
   594 
   595         CFLAGS="$CFLAGS $X_CFLAGS -DENABLE_NANOX"
   596         SYSTEM_LIBS="$SYSTEM_LIBS -lnano-X"
   597         VIDEO_SUBDIRS="$VIDEO_SUBDIRS nanox"
   598         VIDEO_DRIVERS="$VIDEO_DRIVERS nanox/libvideo_nanox.la"
   599     fi
   600 }
   601 
   602 dnl Find the X11 include and library directories
   603 CheckX11()
   604 {
   605     AC_ARG_ENABLE(video-x11,
   606 [  --enable-video-x11      use X11 video driver [default=yes]],
   607                   , enable_video_x11=yes)
   608     if test x$enable_video = xyes -a x$enable_video_x11 = xyes; then
   609         AC_PATH_X
   610         AC_PATH_XTRA
   611         if test x$have_x = xyes; then
   612             AC_ARG_ENABLE(x11-shared,
   613 [  --enable-x11-shared     dynamically load X11 support [default=yes]],
   614                           , enable_x11_shared=yes)
   615 
   616             dnl !!! FIXME: if a platform needs more than this, fill it in!
   617             case "$target" in
   618                 *-*-darwin* )
   619                     x11_lib='/usr/X11R6/lib/libX11.6.dylib'
   620                     x11ext_lib='/usr/X11R6/lib/libXext.6.dylib'
   621                     ;;
   622                 *)
   623                     x11_lib='libX11.so.6'
   624                     x11ext_lib='libXext.so.6'
   625                     ;;
   626             esac
   627 
   628             if test x$have_loadso != xyes && \
   629                test x$enable_x11_shared = xyes; then
   630                 AC_MSG_ERROR([You must have SDL_LoadObject() support])
   631             fi
   632 
   633             if test x$have_loadso = xyes && \
   634                test x$enable_x11_shared = xyes && test x$x11_lib != x && test x$x11ext_lib != x; then
   635                 CFLAGS="$CFLAGS $X_CFLAGS -DENABLE_X11 -DXTHREADS -DX11_DYNAMIC=\$(x11_lib) -DX11EXT_DYNAMIC=\$(x11ext_lib) -I$srcdir/include -I$srcdir/src/video"
   636                 SYSTEM_LIBS="$SYSTEM_LIBS $X_LIBS"
   637                 echo "-- dynamic libX11 -> $x11_lib"
   638                 echo "-- dynamic libX11ext -> $x11ext_lib"
   639                 AC_SUBST(x11_lib)
   640                 AC_SUBST(x11ext_lib)
   641             else
   642                 CFLAGS="$CFLAGS $X_CFLAGS -DENABLE_X11 -DXTHREADS -I$srcdir/include -I$srcdir/src/video"
   643                 SYSTEM_LIBS="$SYSTEM_LIBS $X_LIBS -lX11 -lXext"
   644             fi
   645 
   646             if test x$ac_cv_func_shmat != xyes; then
   647                 CFLAGS="$CFLAGS -DNO_SHARED_MEMORY"
   648             fi
   649 
   650             VIDEO_SUBDIRS="$VIDEO_SUBDIRS x11"
   651             VIDEO_DRIVERS="$VIDEO_DRIVERS x11/libvideo_x11.la"
   652 
   653             AC_ARG_ENABLE(video-x11-vm,
   654 [  --enable-video-x11-vm   use X11 VM extension for fullscreen [default=yes]],
   655                           , enable_video_x11_vm=yes)
   656             if test x$enable_video_x11_vm = xyes; then
   657                 AC_MSG_CHECKING(for XFree86 VidMode 1.0 support)
   658                 video_x11_vm=no
   659                 AC_TRY_COMPILE([
   660                  #include <X11/Xlib.h>
   661                  #include <XFree86/extensions/xf86vmode.h>
   662                 ],[
   663                 ],[
   664                 video_x11_vm=yes
   665                 ])
   666                 AC_MSG_RESULT($video_x11_vm)
   667                 if test x$video_x11_vm = xyes; then
   668                     CFLAGS="$CFLAGS -DXFREE86_VM"
   669                     VIDEO_SUBDIRS="$VIDEO_SUBDIRS XFree86/Xxf86vm"
   670                     VIDEO_DRIVERS="$VIDEO_DRIVERS XFree86/Xxf86vm/libXFree86_Xxf86vm.la"
   671                     AC_MSG_CHECKING(for XFree86 VidMode gamma support)
   672                     video_x11_vmgamma=no
   673                     AC_TRY_COMPILE([
   674                      #include <X11/Xlib.h>
   675                      #include <XFree86/extensions/xf86vmode.h>
   676                     ],[
   677                      SDL_NAME(XF86VidModeGamma) gamma;
   678                     ],[
   679                     video_x11_vmgamma=yes
   680                     ])
   681                     AC_MSG_RESULT($video_x11_vmgamma)
   682                     if test x$video_x11_vmgamma = xyes; then
   683                         CFLAGS="$CFLAGS -DXFREE86_VMGAMMA"
   684                     fi
   685                 fi
   686             fi
   687             AC_ARG_ENABLE(dga,
   688 [  --enable-dga            allow use of X11 DGA code [default=yes]],
   689                           , enable_dga=yes)
   690             AC_ARG_ENABLE(video-x11-dgamouse,
   691 [  --enable-video-x11-dgamouse  use X11 DGA for mouse events [default=yes]],
   692                           , enable_video_x11_dgamouse=yes)
   693             if test x$enable_dga = xyes; then
   694                 AC_MSG_CHECKING(for XFree86 DGA 1.0 support)
   695                 video_x11_dga=no
   696                 AC_TRY_COMPILE([
   697                  #include <X11/Xlib.h>
   698                  #include <XFree86/extensions/xf86dga.h>
   699                 ],[
   700                 ],[
   701                 video_x11_dga=yes
   702                 ])
   703                 AC_MSG_RESULT($video_x11_dga)
   704                 if test x$video_x11_dga = xyes; then
   705                     CFLAGS="$CFLAGS -DXFREE86_DGAMOUSE"
   706                     if test x$enable_video_x11_dgamouse = xyes; then
   707                         CFLAGS="$CFLAGS -DDEFAULT_DGAMOUSE"
   708                     fi
   709                     VIDEO_SUBDIRS="$VIDEO_SUBDIRS XFree86/Xxf86dga"
   710                     VIDEO_DRIVERS="$VIDEO_DRIVERS XFree86/Xxf86dga/libXFree86_Xxf86dga.la"
   711                 fi
   712             fi
   713             AC_ARG_ENABLE(video-x11-xv,
   714 [  --enable-video-x11-xv   use X11 XvImage extension for video [default=yes]],
   715                           , enable_video_x11_xv=yes)
   716             if test x$enable_video_x11_xv = xyes; then
   717                 AC_MSG_CHECKING(for XFree86 XvImage support)
   718                 video_x11_xv=no
   719                 AC_TRY_COMPILE([
   720                  #include <X11/Xlib.h>
   721                  #include <sys/ipc.h>
   722                  #include <sys/shm.h>
   723                  #include <X11/extensions/XShm.h>
   724                  #include <XFree86/extensions/Xvlib.h>
   725                 ],[
   726                  SDL_NAME(XvImage) *image;
   727                 ],[
   728                 video_x11_xv=yes
   729                 ])
   730                 AC_MSG_RESULT($video_x11_xv)
   731                 if test x$video_x11_xv = xyes; then
   732                     CFLAGS="$CFLAGS -DXFREE86_XV"
   733                     VIDEO_SUBDIRS="$VIDEO_SUBDIRS XFree86/Xv"
   734                     VIDEO_DRIVERS="$VIDEO_DRIVERS XFree86/Xv/libXFree86_Xv.la"
   735                 fi
   736             fi
   737             AC_ARG_ENABLE(video-x11-xinerama,
   738 [  --enable-video-x11-xinerama   enable X11 Xinerama support [default=yes]],
   739                             , enable_video_x11_xinerama=yes)
   740             if test x$enable_video_x11_xinerama = xyes; then
   741                 AC_MSG_CHECKING(for X11 Xinerama support)
   742                 video_x11_xinerama=no
   743                 AC_TRY_COMPILE([
   744                  #include <X11/Xlib.h>
   745                  #include <XFree86/extensions/Xinerama.h>
   746                 ],[
   747                  SDL_NAME(XineramaScreenInfo) *xinerama;
   748                 ],[
   749                 video_x11_xinerama=yes
   750                 ])
   751                 AC_MSG_RESULT($video_x11_xinerama)
   752                 if test x$video_x11_xinerama = xyes; then
   753                     CFLAGS="$CFLAGS -DHAVE_XINERAMA"
   754                     VIDEO_SUBDIRS="$VIDEO_SUBDIRS XFree86/Xinerama"
   755                     VIDEO_DRIVERS="$VIDEO_DRIVERS XFree86/Xinerama/libXFree86_Xinerama.la"
   756                 fi
   757             fi
   758             AC_ARG_ENABLE(video-x11-xme,
   759 [  --enable-video-x11-xme  enable Xi Graphics XME for fullscreen [default=yes]],
   760                             , enable_video_x11_xme=yes)
   761             if test x$enable_video_x11_xme = xyes; then
   762                 AC_MSG_CHECKING(for Xi Graphics XiGMiscExtension support)
   763                 video_x11_xme=no
   764                 AC_TRY_COMPILE([
   765                  #include <X11/Xlib.h>
   766                  #include <X11/extensions/xme.h>
   767                 ],[
   768                  XiGMiscResolutionInfo *resolutions;
   769                 ],[
   770                 video_x11_xme=yes
   771                 ])
   772                 AC_MSG_RESULT($video_x11_xme)
   773                 if test x$video_x11_xme = xyes; then
   774                     CFLAGS="$CFLAGS -DHAVE_XIGXME"
   775                     SYSTEM_LIBS="$SYSTEM_LIBS -lxme"
   776                 fi
   777             fi
   778         fi
   779     fi
   780 }
   781 
   782 dnl Find the X11 DGA 2.0 include and library directories
   783 CheckDGA()
   784 {
   785     AC_ARG_ENABLE(video-dga,
   786 [  --enable-video-dga      use DGA 2.0 video driver [default=yes]],
   787                   , enable_video_dga=yes)
   788     if test x$video_x11_dga = xyes -a x$enable_video_dga = xyes; then
   789         save_CFLAGS="$CFLAGS"; CFLAGS="$CFLAGS -Isrc/video"
   790         AC_MSG_CHECKING(for XFree86 DGA 2.0 support)
   791         video_x11_dga2=no
   792         AC_TRY_COMPILE([
   793          #include <X11/Xlib.h>
   794          #include <XFree86/extensions/xf86dga.h>
   795         ],[
   796          SDL_NAME(XDGAEvent) xevent;
   797         ],[
   798         video_x11_dga2=yes
   799         ])
   800         AC_MSG_RESULT($video_x11_dga2)
   801         if test x$video_x11_dga2 = xyes; then
   802             CFLAGS="$CFLAGS -DENABLE_DGA"
   803             VIDEO_SUBDIRS="$VIDEO_SUBDIRS dga"
   804             VIDEO_DRIVERS="$VIDEO_DRIVERS dga/libvideo_dga.la"
   805         fi
   806     fi
   807 }
   808 
   809 CheckPHOTON()
   810 {
   811     AC_ARG_ENABLE(video-photon,
   812 [  --enable-video-photon   use QNX Photon video driver [default=yes]],
   813                   , enable_video_photon=yes)
   814     if test x$enable_video = xyes -a x$enable_video_photon = xyes; then
   815         AC_MSG_CHECKING(for QNX Photon support)
   816         video_photon=no
   817         AC_TRY_COMPILE([
   818           #include <Ph.h>
   819           #include <Pt.h>
   820           #include <photon/Pg.h>
   821           #include <photon/PdDirect.h>
   822         ],[
   823          PgDisplaySettings_t *visual;
   824         ],[
   825         video_photon=yes
   826         ])
   827         AC_MSG_RESULT($video_photon)
   828         if test x$video_photon = xyes; then
   829             CFLAGS="$CFLAGS -DENABLE_PHOTON"
   830             SYSTEM_LIBS="$SYSTEM_LIBS -lph"
   831             VIDEO_SUBDIRS="$VIDEO_SUBDIRS photon"
   832             VIDEO_DRIVERS="$VIDEO_DRIVERS photon/libvideo_photon.la"
   833             CheckOpenGLQNX
   834         fi
   835     fi
   836 }
   837 
   838 dnl Find the framebuffer console includes
   839 CheckFBCON()
   840 {
   841     AC_ARG_ENABLE(video-fbcon,
   842 [  --enable-video-fbcon    use framebuffer console video driver [default=yes]],
   843                   , enable_video_fbcon=yes)
   844     if test x$enable_video = xyes -a x$enable_video_fbcon = xyes; then
   845         AC_MSG_CHECKING(for framebuffer console support)
   846         video_fbcon=no
   847         AC_TRY_COMPILE([
   848          #include <linux/fb.h>
   849          #include <linux/kd.h>
   850          #include <linux/keyboard.h>
   851         ],[
   852         ],[
   853         video_fbcon=yes
   854         ])
   855         AC_MSG_RESULT($video_fbcon)
   856         if test x$video_fbcon = xyes; then
   857             CFLAGS="$CFLAGS -DENABLE_FBCON"
   858             VIDEO_SUBDIRS="$VIDEO_SUBDIRS fbcon"
   859             VIDEO_DRIVERS="$VIDEO_DRIVERS fbcon/libvideo_fbcon.la"
   860         fi
   861     fi
   862 }
   863 
   864 dnl Find DirectFB
   865 CheckDirectFB()
   866 {
   867     AC_ARG_ENABLE(video-directfb,
   868 [  --enable-video-directfb use DirectFB video driver [default=no]],
   869                   , enable_video_directfb=no)
   870     if test x$enable_video = xyes -a x$enable_video_directfb = xyes; then
   871         video_directfb=no
   872 
   873         AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
   874         if test x$PKG_CONFIG = xno ; then
   875             AC_MSG_WARN([*** pkg-config is required to build the DirectFB video driver.])
   876         else
   877             AC_MSG_CHECKING(for DirectFB support)
   878 
   879             if ! $PKG_CONFIG --atleast-pkgconfig-version 0.7 ; then
   880                 AC_MSG_ERROR([*** pkg-config too old; version 0.7 or better required.])
   881             fi
   882 
   883             DIRECTFB_REQUIRED_VERSION=0.9.15
   884 
   885             if $PKG_CONFIG --atleast-version $DIRECTFB_REQUIRED_VERSION directfb ; then
   886                 DIRECTFB_CFLAGS=`$PKG_CONFIG --cflags directfb`
   887                 DIRECTFB_LIBS=`$PKG_CONFIG --libs directfb`
   888                 video_directfb=yes
   889             fi
   890         fi
   891 
   892         AC_MSG_RESULT($video_directfb)
   893         if test x$video_directfb = xyes; then
   894             CFLAGS="$CFLAGS -DENABLE_DIRECTFB"
   895             VIDEO_SUBDIRS="$VIDEO_SUBDIRS directfb"
   896             VIDEO_DRIVERS="$VIDEO_DRIVERS directfb/libvideo_directfb.la"
   897 
   898             AC_SUBST(DIRECTFB_CFLAGS)
   899             AC_SUBST(DIRECTFB_LIBS)
   900         fi
   901     fi
   902 }
   903 
   904 dnl See if we're running on PlayStation 2 hardware
   905 CheckPS2GS()
   906 {
   907     AC_ARG_ENABLE(video-ps2gs,
   908 [  --enable-video-ps2gs    use PlayStation 2 GS video driver [default=yes]],
   909                   , enable_video_ps2gs=yes)
   910     if test x$enable_video = xyes -a x$enable_video_ps2gs = xyes; then
   911         AC_MSG_CHECKING(for PlayStation 2 GS support)
   912         video_ps2gs=no
   913         AC_TRY_COMPILE([
   914          #include <linux/ps2/dev.h>
   915          #include <linux/ps2/gs.h>
   916         ],[
   917         ],[
   918         video_ps2gs=yes
   919         ])
   920         AC_MSG_RESULT($video_ps2gs)
   921         if test x$video_ps2gs = xyes; then
   922             CFLAGS="$CFLAGS -DENABLE_PS2GS"
   923             VIDEO_SUBDIRS="$VIDEO_SUBDIRS ps2gs"
   924             VIDEO_DRIVERS="$VIDEO_DRIVERS ps2gs/libvideo_ps2gs.la"
   925         fi
   926     fi
   927 }
   928 
   929 dnl Find the GGI includes
   930 CheckGGI()
   931 {
   932     AC_ARG_ENABLE(video-ggi,
   933 [  --enable-video-ggi      use GGI video driver [default=no]],
   934                   , enable_video_ggi=no)
   935     if test x$enable_video = xyes -a x$enable_video_ggi = xyes; then
   936         AC_MSG_CHECKING(for GGI support)
   937         video_ggi=no
   938         AC_TRY_COMPILE([
   939          #include <ggi/ggi.h>
   940          #include <ggi/gii.h>
   941         ],[
   942         ],[
   943         video_ggi=yes
   944         ])
   945         AC_MSG_RESULT($video_ggi)
   946         if test x$video_ggi = xyes; then
   947             CFLAGS="$CFLAGS $X_CFLAGS -DENABLE_GGI"
   948             SYSTEM_LIBS="$SYSTEM_LIBS -lggi -lgii -lgg"
   949 
   950             VIDEO_SUBDIRS="$VIDEO_SUBDIRS ggi"
   951             VIDEO_DRIVERS="$VIDEO_DRIVERS ggi/libvideo_ggi.la"
   952         fi
   953     fi
   954 }
   955 
   956 dnl Find the SVGAlib includes and libraries
   957 CheckSVGA()
   958 {
   959     AC_ARG_ENABLE(video-svga,
   960 [  --enable-video-svga     use SVGAlib video driver [default=no]],
   961                   , enable_video_svga=no)
   962     if test x$enable_video = xyes -a x$enable_video_svga = xyes; then
   963         AC_MSG_CHECKING(for SVGAlib (1.4.0+) support)
   964         video_svga=no
   965         AC_TRY_COMPILE([
   966          #include <vga.h>
   967          #include <vgamouse.h>
   968          #include <vgakeyboard.h>
   969         ],[
   970          if ( SCANCODE_RIGHTWIN && SCANCODE_LEFTWIN ) {
   971              exit(0);
   972          }
   973         ],[
   974         video_svga=yes
   975         ])
   976         AC_MSG_RESULT($video_svga)
   977         if test x$video_svga = xyes; then
   978             CFLAGS="$CFLAGS -DENABLE_SVGALIB"
   979             SYSTEM_LIBS="$SYSTEM_LIBS -lvga"
   980 
   981             VIDEO_SUBDIRS="$VIDEO_SUBDIRS svga"
   982             VIDEO_DRIVERS="$VIDEO_DRIVERS svga/libvideo_svga.la"
   983         fi
   984     fi
   985 }
   986 
   987 dnl Find the VGL includes and libraries
   988 CheckVGL()
   989 {
   990     AC_ARG_ENABLE(video-vgl,
   991 [  --enable-video-vgl      use VGL video driver [default=no]],
   992                   , enable_video_vgl=no)
   993     if test x$enable_video = xyes -a x$enable_video_vgl = xyes; then
   994         AC_MSG_CHECKING(for libVGL support)
   995         video_vgl=no
   996         AC_TRY_COMPILE([
   997          #include <sys/fbio.h>
   998          #include <sys/consio.h>
   999          #include <sys/kbio.h>
  1000          #include <vgl.h>
  1001         ],[
  1002          VGLBitmap bitmap;
  1003          exit(bitmap.Bitmap);
  1004         ],[
  1005         video_vgl=yes
  1006         ])
  1007         AC_MSG_RESULT($video_vgl)
  1008         if test x$video_vgl = xyes; then
  1009             CFLAGS="$CFLAGS -DENABLE_VGL"
  1010             SYSTEM_LIBS="$SYSTEM_LIBS -lvgl"
  1011 
  1012             VIDEO_SUBDIRS="$VIDEO_SUBDIRS vgl"
  1013             VIDEO_DRIVERS="$VIDEO_DRIVERS vgl/libvideo_vgl.la"
  1014         fi
  1015     fi
  1016 }
  1017 
  1018 dnl Find the AAlib includes
  1019 CheckAAlib()
  1020 {
  1021     AC_ARG_ENABLE(video-aalib,
  1022 [  --enable-video-aalib    use AAlib video driver [default=no]],
  1023                   , enable_video_aalib=no)
  1024     if test x$enable_video = xyes -a x$enable_video_aalib = xyes; then
  1025         AC_MSG_CHECKING(for AAlib support)
  1026         video_aalib=no
  1027         AC_TRY_COMPILE([
  1028          #include <aalib.h>
  1029         ],[
  1030         ],[
  1031         video_aalib=yes
  1032         ])
  1033         AC_MSG_RESULT($video_aalib)
  1034         if test x$video_aalib = xyes; then
  1035             CFLAGS="$CFLAGS -DENABLE_AALIB"
  1036             SYSTEM_LIBS="$SYSTEM_LIBS -laa"
  1037 
  1038             VIDEO_SUBDIRS="$VIDEO_SUBDIRS aalib"
  1039             VIDEO_DRIVERS="$VIDEO_DRIVERS aalib/libvideo_aa.la"
  1040         fi
  1041     fi
  1042 }
  1043 
  1044 dnl Set up the Atari Xbios driver
  1045 CheckAtariXbiosVideo()
  1046 {
  1047     AC_ARG_ENABLE(xbios,
  1048 [  --enable-video-xbios    use Atari Xbios video driver [default=yes]],
  1049                   , enable_video_xbios=yes)
  1050     video_xbios=no
  1051     if test x$enable_video = xyes -a x$enable_video_xbios = xyes; then
  1052         video_xbios=yes
  1053         CFLAGS="$CFLAGS -DENABLE_XBIOS"
  1054         VIDEO_SUBDIRS="$VIDEO_SUBDIRS xbios"
  1055         VIDEO_DRIVERS="$VIDEO_DRIVERS xbios/libvideo_xbios.la"
  1056     fi
  1057 }
  1058 
  1059 dnl Set up the Atari Gem driver
  1060 CheckAtariGemVideo()
  1061 {
  1062     AC_ARG_ENABLE(gem,
  1063 [  --enable-video-gem      use Atari Gem video driver [default=yes]],
  1064                   , enable_video_gem=yes)
  1065     if test x$enable_video = xyes -a x$enable_video_gem = xyes; then
  1066         video_gem=no
  1067         AC_CHECK_HEADER(gem.h, have_gem_hdr=yes)
  1068         AC_CHECK_LIB(gem, appl_init, have_gem_lib=yes)
  1069         if test x$have_gem_hdr = xyes -a x$have_gem_lib = xyes; then
  1070             video_gem=yes
  1071             CFLAGS="$CFLAGS -DENABLE_GEM"
  1072             SYSTEM_LIBS="$SYSTEM_LIBS -lgem"
  1073             VIDEO_SUBDIRS="$VIDEO_SUBDIRS gem"
  1074             VIDEO_DRIVERS="$VIDEO_DRIVERS gem/libvideo_gem.la"
  1075         fi
  1076     fi
  1077 }
  1078 
  1079 dnl Set up the Atari Bios keyboard driver
  1080 CheckAtariBiosEvent()
  1081 {
  1082     CFLAGS="$CFLAGS -I\$(top_srcdir)/src/video/ataricommon"
  1083     VIDEO_SUBDIRS="$VIDEO_SUBDIRS ataricommon"
  1084     VIDEO_DRIVERS="$VIDEO_DRIVERS ataricommon/libvideo_ataricommon.la"
  1085 }
  1086 
  1087 dnl rcg04172001 Set up the Null video driver.
  1088 CheckDummyVideo()
  1089 {
  1090     AC_ARG_ENABLE(video-dummy,
  1091 [  --enable-video-dummy    use dummy video driver [default=yes]],
  1092                   , enable_video_dummy=yes)
  1093     if test x$enable_video_dummy = xyes; then
  1094       CFLAGS="$CFLAGS -DENABLE_DUMMYVIDEO"
  1095       VIDEO_SUBDIRS="$VIDEO_SUBDIRS dummy"
  1096       VIDEO_DRIVERS="$VIDEO_DRIVERS dummy/libvideo_null.la"
  1097     fi
  1098 }
  1099 
  1100 dnl Check to see if OpenGL support is desired
  1101 AC_ARG_ENABLE(video-opengl,
  1102 [  --enable-video-opengl   include OpenGL context creation [default=yes]],
  1103               , enable_video_opengl=yes)
  1104 
  1105 dnl Find OpenGL
  1106 CheckOpenGLX11()
  1107 {
  1108     if test x$enable_video = xyes -a x$enable_video_opengl = xyes; then
  1109         AC_MSG_CHECKING(for OpenGL (GLX) support)
  1110         video_opengl=no
  1111         AC_TRY_COMPILE([
  1112          #include <GL/gl.h>
  1113          #include <GL/glx.h>
  1114          #include <dlfcn.h> /* For loading extensions */
  1115         ],[
  1116         ],[
  1117         video_opengl=yes
  1118         ])
  1119         AC_MSG_RESULT($video_opengl)
  1120         if test x$video_opengl = xyes; then
  1121             CFLAGS="$CFLAGS -DHAVE_OPENGL -DHAVE_OPENGL_X11"
  1122             if test x$have_loadso != xyes; then
  1123                 AC_CHECK_LIB(dl, dlopen, SYSTEM_LIBS="$SYSTEM_LIBS -ldl")
  1124             fi
  1125         fi
  1126     fi
  1127 }
  1128 
  1129 dnl Find QNX RtP OpenGL
  1130 CheckOpenGLQNX()
  1131 {
  1132     if test x$enable_video = xyes -a x$enable_video_opengl = xyes; then
  1133         AC_MSG_CHECKING(for OpenGL (Photon) support)
  1134         video_opengl=no
  1135         AC_TRY_COMPILE([
  1136          #include <GL/gl.h>
  1137         ],[
  1138         ],[
  1139         video_opengl=yes
  1140         ])
  1141         AC_MSG_RESULT($video_opengl)
  1142         if test x$video_opengl = xyes; then
  1143             CFLAGS="$CFLAGS -DHAVE_OPENGL"
  1144             SYSTEM_LIBS="$SYSTEM_LIBS -lGL"
  1145             if test x$have_loadso != xyes; then
  1146                 AC_CHECK_LIB(c, dlopen, SYSTEM_LIBS="$SYSTEM_LIBS", AC_CHECK_LIB(ltdl, dlopen, SYSTEM_LIBS="$SYSTEM_LIBS -lltdl"))
  1147             fi
  1148         fi
  1149     fi
  1150 }
  1151 
  1152 dnl Check for BeOS OpenGL
  1153 CheckBeGL()
  1154 {
  1155     if test x$enable_video = xyes -a x$enable_video_opengl = xyes; then
  1156         CFLAGS="$CFLAGS -DHAVE_OPENGL"
  1157         SYSTEM_LIBS="$SYSTEM_LIBS -lGL"
  1158     fi
  1159 }
  1160 
  1161 dnl Check for MacOS OpenGL
  1162 CheckMacGL()
  1163 {
  1164     if test x$enable_video = xyes -a x$enable_video_opengl = xyes; then
  1165         CFLAGS="$CFLAGS -DHAVE_OPENGL"
  1166         case "$target" in
  1167             *-*-darwin*)
  1168                 SYSTEM_LIBS="$SYSTEM_LIBS -framework OpenGL"
  1169                 # The following is probably not available in Darwin:
  1170                 SYSTEM_LIBS="$SYSTEM_LIBS -framework AGL"
  1171         esac
  1172     fi
  1173 }
  1174 
  1175 dnl Check for Mesa offscreen rendering
  1176 CheckAtariOSMesa()
  1177 {
  1178     if test "x$enable_video" = "xyes" -a "x$enable_video_opengl" = "xyes"; then
  1179         AC_CHECK_HEADER(GL/osmesa.h, have_osmesa_hdr=yes)
  1180         AC_CHECK_LIB(OSMesa, OSMesaCreateContext, have_osmesa_lib=yes, have_osmesa_lib=no, -lm)
  1181 
  1182         # Static linking to -lOSMesa
  1183         AC_PATH_PROG(OSMESA_CONFIG, osmesa-config, no)
  1184         if test "x$OSMESA_CONFIG" = "xno" -o "x$enable_atari_ldg" = "xno"; then
  1185             # -lOSMesa is really the static library
  1186             if test "x$have_osmesa_hdr" = "xyes" -a "x$have_osmesa_lib" = "xyes"; then
  1187     	        CFLAGS="$CFLAGS -DHAVE_OPENGL"
  1188 		    	SYSTEM_LIBS="$SYSTEM_LIBS -lOSMesa"
  1189             fi
  1190         else
  1191             # -lOSMesa is a loader for OSMesa.ldg
  1192             OSMESA_CFLAGS=`$OSMESA_CONFIG --cflags`
  1193             OSMESA_LIBS=`$OSMESA_CONFIG --libs`
  1194             CFLAGS="$CFLAGS -DHAVE_OPENGL $OSMESA_CFLAGS"
  1195             SYSTEM_LIBS="$SYSTEM_LIBS $OSMESA_LIBS"
  1196         fi
  1197 
  1198         AC_ARG_ENABLE(osmesa-shared,
  1199 [  --enable-osmesa-shared  dynamically load OSMesa OpenGL support [default=yes]],
  1200                               , enable_osmesa_shared=yes)
  1201         if test "x$enable_osmesa_shared" = "xyes" -a "x$enable_atari_ldg" = "xyes"; then
  1202             # Dynamic linking
  1203             if test "x$have_osmesa_hdr" = "xyes"; then
  1204                 CFLAGS="$CFLAGS -DENABLE_OSMESA_SHARED"
  1205             fi
  1206 		fi
  1207     fi
  1208 }
  1209 
  1210 dnl See if we can use the new unified event interface in Linux 2.4
  1211 CheckInputEvents()
  1212 {
  1213     dnl Check for Linux 2.4 unified input event interface support
  1214     AC_ARG_ENABLE(input-events,
  1215 [  --enable-input-events   use Linux 2.4 unified input interface [default=yes]],
  1216                   , enable_input_events=yes)
  1217     if test x$enable_input_events = xyes; then
  1218         AC_MSG_CHECKING(for Linux 2.4 unified input interface)
  1219         use_input_events=no
  1220         AC_TRY_COMPILE([
  1221           #include <linux/input.h>
  1222         ],[
  1223           #ifndef EVIOCGNAME
  1224           #error EVIOCGNAME() ioctl not available
  1225           #endif
  1226         ],[
  1227         use_input_events=yes
  1228         ])
  1229         AC_MSG_RESULT($use_input_events)
  1230         if test x$use_input_events = xyes; then
  1231             CFLAGS="$CFLAGS -DUSE_INPUT_EVENTS"
  1232         fi
  1233     fi
  1234 }
  1235 
  1236 dnl See if we can use the Touchscreen input library
  1237 CheckTslib()
  1238 {
  1239     AC_ARG_ENABLE(input-tslib,
  1240 [  --enable-input-tslib    use the Touchscreen library for input [default=yes]],
  1241                   , enable_input_tslib=yes)
  1242     if test x$enable_input_tslib = xyes; then
  1243         AC_MSG_CHECKING(for Touchscreen library support)
  1244         enable_input_tslib=no
  1245         AC_TRY_COMPILE([
  1246           #include "tslib.h"
  1247         ],[
  1248         ],[
  1249         enable_input_tslib=yes
  1250         ])
  1251         AC_MSG_RESULT($enable_input_tslib)
  1252         if test x$enable_input_tslib = xyes; then
  1253             CFLAGS="$CFLAGS -DHAVE_TSLIB"
  1254             SYSTEM_LIBS="$SYSTEM_LIBS -lts"
  1255         fi
  1256     fi
  1257 }
  1258 
  1259 dnl See if we can use GNU pth library for threads
  1260 CheckPTH()
  1261 {
  1262     dnl Check for pth support
  1263     AC_ARG_ENABLE(pth,
  1264 [  --enable-pth            use GNU pth library for multi-threading [default=yes]],
  1265                   , enable_pth=yes)
  1266     if test x$enable_threads = xyes -a x$enable_pth = xyes; then
  1267         AC_PATH_PROG(PTH_CONFIG, pth-config, no)
  1268         if test "$PTH_CONFIG" = "no"; then
  1269             use_pth=no
  1270         else
  1271             PTH_CFLAGS=`$PTH_CONFIG --cflags`
  1272             PTH_LIBS=`$PTH_CONFIG --libs --all`
  1273             SDL_CFLAGS="$SDL_CFLAGS $PTH_CFLAGS"
  1274             SDL_LIBS="$SDL_LIBS $PTH_LIBS"
  1275             CFLAGS="$CFLAGS -DENABLE_PTH"
  1276             use_pth=yes
  1277         fi
  1278         AC_MSG_CHECKING(pth)
  1279         if test "x$use_pth" = xyes; then
  1280             AC_MSG_RESULT(yes)
  1281         else
  1282             AC_MSG_RESULT(no)
  1283         fi
  1284     fi
  1285 }
  1286 
  1287 dnl See what type of thread model to use on Linux and Solaris
  1288 CheckPTHREAD()
  1289 {
  1290     dnl Check for pthread support
  1291     AC_ARG_ENABLE(pthreads,
  1292 [  --enable-pthreads       use POSIX threads for multi-threading [default=yes]],
  1293                   , enable_pthreads=yes)
  1294     dnl This is used on Linux for glibc binary compatibility (Doh!)
  1295     AC_ARG_ENABLE(pthread-sem,
  1296 [  --enable-pthread-sem    use pthread semaphores [default=yes]],
  1297                   , enable_pthread_sem=yes)
  1298     case "$target" in
  1299         *-*-bsdi*)
  1300             pthread_cflags="-D_REENTRANT -D_THREAD_SAFE"
  1301             pthread_lib=""
  1302             ;;
  1303         *-*-darwin*)
  1304             pthread_cflags="-D_THREAD_SAFE"
  1305 # causes Carbon.p complaints?
  1306 #            pthread_cflags="-D_REENTRANT -D_THREAD_SAFE"
  1307             ;;
  1308         *-*-freebsd*)
  1309             pthread_cflags="-D_REENTRANT -D_THREAD_SAFE"
  1310             pthread_lib="-pthread"
  1311             ;;
  1312         *-*-netbsd*)
  1313             pthread_cflags="-I/usr/include -D_REENTRANT -D_THREAD_SAFE"
  1314             pthread_lib="-L/usr/lib -lpthread"
  1315             ;;
  1316         *-*-openbsd*)
  1317             pthread_cflags="-D_REENTRANT"
  1318             pthread_lib="-pthread"
  1319             ;;
  1320         *-*-solaris*)
  1321             pthread_cflags="-D_REENTRANT"
  1322             pthread_lib="-lpthread -lposix4"
  1323             ;;
  1324         *-*-sysv5*)
  1325             pthread_cflags="-D_REENTRANT -Kthread"
  1326             pthread_lib=""
  1327             ;;
  1328         *-*-irix*)
  1329             pthread_cflags="-D_SGI_MP_SOURCE"
  1330             pthread_lib="-lpthread"
  1331             ;;
  1332         *-*-aix*)
  1333             pthread_cflags="-D_REENTRANT -mthreads"
  1334             pthread_lib="-lpthread"
  1335             ;;
  1336         *-*-hpux11*)
  1337             pthread_cflags="-D_REENTRANT"
  1338             pthread_lib="-L/usr/lib -lpthread"
  1339             ;;
  1340         *-*-qnx*)
  1341             pthread_cflags=""
  1342             pthread_lib=""
  1343             ;;
  1344         *-*-osf*)
  1345             pthread_cflags="-D_REENTRANT"
  1346             if test x$ac_cv_prog_gcc = xyes; then
  1347                 pthread_lib="-lpthread -lrt"
  1348             else
  1349                 pthread_lib="-lpthread -lexc -lrt"
  1350             fi
  1351             ;;
  1352         *)
  1353             pthread_cflags="-D_REENTRANT"
  1354             pthread_lib="-lpthread"
  1355             ;;
  1356     esac
  1357     if test x$enable_threads = xyes -a x$enable_pthreads = xyes -a x$enable_ipod != xyes; then
  1358         # Save the original compiler flags and libraries
  1359         ac_save_cflags="$CFLAGS"; ac_save_libs="$LIBS"
  1360         # Add the pthread compiler flags and libraries
  1361         CFLAGS="$CFLAGS $pthread_cflags"; LIBS="$LIBS $pthread_lib"
  1362         # Check to see if we have pthread support on this system
  1363         AC_MSG_CHECKING(for pthreads)
  1364         use_pthreads=no
  1365         AC_TRY_LINK([
  1366          #include <pthread.h>
  1367         ],[
  1368          pthread_attr_t type;
  1369          pthread_attr_init(&type);
  1370         ],[
  1371         use_pthreads=yes
  1372         ])
  1373         AC_MSG_RESULT($use_pthreads)
  1374         # Restore the compiler flags and libraries
  1375         CFLAGS="$ac_save_cflags"; LIBS="$ac_save_libs"
  1376         # Do futher testing if we have pthread support...
  1377         if test x$use_pthreads = xyes; then
  1378             CFLAGS="$CFLAGS $pthread_cflags -DSDL_USE_PTHREADS"
  1379             LIBS="$LIBS $pthread_lib"
  1380             SDL_CFLAGS="$SDL_CFLAGS $pthread_cflags"
  1381             SDL_LIBS="$SDL_LIBS $pthread_lib"
  1382 
  1383             # Check to see if recursive mutexes are available
  1384             AC_MSG_CHECKING(for recursive mutexes)
  1385             has_recursive_mutexes=no
  1386             AC_TRY_LINK([
  1387               #include <pthread.h>
  1388             ],[
  1389               pthread_mutexattr_t attr;
  1390               #if defined(linux) && !(defined(__arm__) && defined(QWS))
  1391               pthread_mutexattr_setkind_np(&attr, PTHREAD_MUTEX_RECURSIVE_NP);
  1392               #else
  1393               pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
  1394               #endif
  1395             ],[
  1396             has_recursive_mutexes=yes
  1397             ])
  1398             # Some systems have broken recursive mutex implementations
  1399             case "$target" in
  1400                 *-*-darwin*)
  1401                     has_recursive_mutexes=no
  1402                     ;;
  1403                 *-*-solaris*)
  1404                     has_recursive_mutexes=no
  1405                     ;;
  1406             esac
  1407             AC_MSG_RESULT($has_recursive_mutexes)
  1408             if test x$has_recursive_mutexes != xyes; then
  1409                 CFLAGS="$CFLAGS -DPTHREAD_NO_RECURSIVE_MUTEX"
  1410             fi
  1411 
  1412             # Check to see if pthread semaphore support is missing
  1413             if test x$enable_pthread_sem = xyes; then
  1414                 AC_MSG_CHECKING(for pthread semaphores)
  1415                 have_pthread_sem=no
  1416                 AC_TRY_COMPILE([
  1417                   #include <pthread.h>
  1418                   #include <semaphore.h>
  1419                 ],[
  1420                 ],[
  1421                 have_pthread_sem=yes
  1422                 ])
  1423                 AC_MSG_RESULT($have_pthread_sem)
  1424             fi
  1425 
  1426             # Check to see if this is broken glibc 2.0 pthreads
  1427             case "$target" in
  1428                 *-*-linux*)
  1429                     AC_MSG_CHECKING(for broken glibc 2.0 pthreads)
  1430                     glibc20_pthreads=no
  1431                     AC_TRY_COMPILE([
  1432                       #include <features.h>
  1433                       #if (__GLIBC__ == 2) && (__GLIBC_MINOR__ == 0)
  1434                       #warning Working around a bug in glibc 2.0 pthreads
  1435                       #else
  1436                       #error pthread implementation okay
  1437                       #endif /* glibc 2.0 */
  1438                     ],[
  1439                     ],[
  1440                     glibc20_pthreads=yes
  1441                     ])
  1442                     AC_MSG_RESULT($glibc20_pthreads)
  1443             esac
  1444         fi
  1445     fi
  1446 
  1447     AC_MSG_CHECKING(whether semun is defined in /usr/include/sys/sem.h)
  1448     have_semun=no
  1449     AC_TRY_COMPILE([
  1450       #include <sys/types.h>
  1451       #include <sys/sem.h>
  1452     ],[
  1453       union semun t;
  1454     ],[
  1455     have_semun=yes
  1456     ])
  1457     AC_MSG_RESULT($have_semun)
  1458     if test x$have_semun = xyes; then
  1459         CFLAGS="$CFLAGS -DHAVE_SEMUN"
  1460     fi
  1461 
  1462     # See if we can use GNU Pth or clone() on Linux directly
  1463     if test x$enable_threads = xyes -a x$use_pthreads != xyes; then
  1464         CheckPTH
  1465         if test x$use_pth != xyes; then
  1466             case "$target" in
  1467                 *-*-linux*)
  1468                     use_clone=yes
  1469                     ;;
  1470             esac
  1471         fi
  1472     fi
  1473 }
  1474 
  1475 # Note that we need to have either semaphores or to have mutexes and
  1476 # condition variables to implement all thread synchronization primitives
  1477 CopyUnixThreadSource()
  1478 {
  1479     if test x$use_pthreads = xyes -o x$use_clone = xyes; then
  1480         # Basic thread creation functions
  1481         COPY_ARCH_SRC(src/thread, linux, SDL_systhread.c)
  1482         COPY_ARCH_SRC(src/thread, linux, SDL_systhread_c.h)
  1483 
  1484         # Semaphores
  1485         # We can fake these with mutexes and condition variables if necessary
  1486         if test x$use_pthreads = xyes -a x$have_pthread_sem != xyes; then
  1487             COPY_ARCH_SRC(src/thread, generic, SDL_syssem.c)
  1488         else
  1489             COPY_ARCH_SRC(src/thread, linux, SDL_syssem.c)
  1490         fi
  1491         COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
  1492 
  1493         # Mutexes
  1494         # We can fake these with semaphores if necessary
  1495         case "$target" in
  1496             *-*-bsdi*)
  1497                 COPY_ARCH_SRC(src/thread, bsdi, SDL_syssem.c)
  1498                 COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
  1499                 COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex.c)
  1500                 COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex_c.h)
  1501                 ;;
  1502             *)
  1503                 if test x$glibc20_pthreads = xyes; then
  1504                     COPY_ARCH_SRC(src/thread, generic, SDL_sysmutex.c)
  1505                     COPY_ARCH_SRC(src/thread, generic, SDL_sysmutex_c.h)
  1506                 else
  1507                     COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex.c)
  1508                     COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex_c.h)
  1509                 fi
  1510                 ;;
  1511         esac
  1512 
  1513         # Condition variables
  1514         # We can fake these with semaphores and mutexes if necessary
  1515         if test x$glibc20_pthreads = xyes -o x$has_recursive_mutexes != xyes; then
  1516             COPY_ARCH_SRC(src/thread, generic, SDL_syscond.c)
  1517         else
  1518             COPY_ARCH_SRC(src/thread, linux, SDL_syscond.c)
  1519         fi
  1520         COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
  1521 
  1522     elif test x$use_pth = xyes; then
  1523         COPY_ARCH_SRC(src/thread, pth, SDL_systhread.c)
  1524         COPY_ARCH_SRC(src/thread, pth, SDL_systhread_c.h)
  1525         COPY_ARCH_SRC(src/thread, pth, SDL_sysmutex.c)
  1526         COPY_ARCH_SRC(src/thread, pth, SDL_sysmutex_c.h)
  1527         COPY_ARCH_SRC(src/thread, pth, SDL_syscond.c)
  1528         COPY_ARCH_SRC(src/thread, pth, SDL_syscond_c.h)
  1529         COPY_ARCH_SRC(src/thread, generic, SDL_syssem.c)
  1530         COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
  1531     else
  1532        AC_MSG_ERROR([
  1533 *** No thread support detected
  1534        ])
  1535     fi
  1536 }
  1537 
  1538 dnl See if we can use sigaction() instead of signal()
  1539 CheckSIGACTION()
  1540 {
  1541     dnl Check for sigaction support
  1542     AC_ARG_ENABLE(sigaction,
  1543 [  --enable-sigaction      use sigaction instead of signal [default=yes]],
  1544                   , enable_sigaction=yes)
  1545     if test x$enable_sigaction = xyes; then
  1546         AC_MSG_CHECKING(sigaction)
  1547         have_sigaction=no
  1548         AC_TRY_COMPILE([
  1549          #include <signal.h>
  1550         ],[
  1551          struct sigaction junk;
  1552          sigaction(0, &junk, &junk);
  1553         ],[
  1554         have_sigaction=yes
  1555         ])
  1556         AC_MSG_RESULT($have_sigaction)
  1557         if test x$have_sigaction = xyes; then
  1558             CFLAGS="$CFLAGS -DHAVE_SIGACTION"
  1559         fi
  1560     fi
  1561 }
  1562 
  1563 dnl Determine whether the compiler can produce Win32 executables
  1564 CheckWIN32()
  1565 {
  1566     AC_MSG_CHECKING(Win32 compiler)
  1567     have_win32_gcc=no
  1568     AC_TRY_COMPILE([
  1569      #include <windows.h>
  1570     ],[
  1571     ],[
  1572     have_win32_gcc=yes
  1573     ])
  1574     AC_MSG_RESULT($have_win32_gcc)
  1575     if test x$have_win32_gcc != xyes; then
  1576        AC_MSG_ERROR([
  1577 *** Your compiler ($CC) does not produce Win32 executables!
  1578        ])
  1579     fi
  1580 
  1581     dnl See if the user wants to redirect standard output to files
  1582     AC_ARG_ENABLE(stdio-redirect,
  1583 [  --enable-stdio-redirect Redirect STDIO to files on Win32 [default=yes]],
  1584                   , enable_stdio_redirect=yes)
  1585     if test x$enable_stdio_redirect != xyes; then
  1586         CFLAGS="$CFLAGS -DNO_STDIO_REDIRECT"
  1587     fi
  1588 }
  1589 
  1590 dnl Find the DirectX includes and libraries
  1591 CheckDIRECTX()
  1592 {
  1593     AC_ARG_ENABLE(directx,
  1594 [  --enable-directx        use DirectX for Win32 audio/video [default=yes]],
  1595                   , enable_directx=yes)
  1596     if test x$enable_directx = xyes; then
  1597         AC_MSG_CHECKING(for DirectX headers and libraries)
  1598         use_directx=no
  1599         tmp_cflags=$CFLAGS
  1600         CFLAGS="$CFLAGS -I$srcdir"
  1601         AC_TRY_COMPILE([
  1602          #include "src/video/windx5/directx.h"
  1603         ],[
  1604         ],[
  1605         use_directx=yes
  1606         ])
  1607         CFLAGS=$tmp_cflags
  1608         AC_MSG_RESULT($use_directx)
  1609     fi
  1610 
  1611     CFLAGS="$CFLAGS -I\$(top_srcdir)/src/video/wincommon"
  1612     SYSTEM_LIBS="$SYSTEM_LIBS -luser32 -lgdi32 -lwinmm"
  1613     VIDEO_SUBDIRS="$VIDEO_SUBDIRS wincommon"
  1614     VIDEO_DRIVERS="$VIDEO_DRIVERS wincommon/libvideo_wincommon.la"
  1615     # Enable the DIB driver
  1616     CFLAGS="$CFLAGS -DENABLE_WINDIB"
  1617     VIDEO_SUBDIRS="$VIDEO_SUBDIRS windib"
  1618     VIDEO_DRIVERS="$VIDEO_DRIVERS windib/libvideo_windib.la"
  1619     # See if we should enable the DirectX driver
  1620     if test x$use_directx = xyes; then
  1621         CFLAGS="$CFLAGS -DENABLE_DIRECTX"
  1622         SYSTEM_LIBS="$SYSTEM_LIBS -ldxguid"
  1623         VIDEO_SUBDIRS="$VIDEO_SUBDIRS windx5"
  1624         VIDEO_DRIVERS="$VIDEO_DRIVERS windx5/libvideo_windx5.la"
  1625     fi
  1626 }
  1627 
  1628 dnl Set up the BWindow video driver on BeOS
  1629 CheckBWINDOW()
  1630 {
  1631     CFLAGS="$CFLAGS -DENABLE_BWINDOW"
  1632     VIDEO_SUBDIRS="$VIDEO_SUBDIRS bwindow"
  1633     VIDEO_DRIVERS="$VIDEO_DRIVERS bwindow/libvideo_bwindow.la"
  1634 }
  1635 
  1636 dnl Set up the QTopia video driver if enabled
  1637 CheckQtopia()
  1638 {
  1639     AC_ARG_ENABLE(video-qtopia,
  1640 [  --enable-video-qtopia   use Qtopia video driver [default=no]],
  1641                   , enable_video_qtopia=no)
  1642     if test x$enable_video = xyes -a x$enable_video_qtopia = xyes; then
  1643         AC_MSG_CHECKING(for Qtopia support)
  1644         video_qtopia=no
  1645         AC_LANG_CPLUSPLUS
  1646         OLD_CXX="$CXXFLAGS"
  1647         CXXFLAGS="-DQT_QWS_EBX -fno-rtti -fno-exceptions -DQT_QWS_CUSTOM -DQWS -I${QPEDIR}/include -I${QTDIR}/include/ -DNO_DEBUG"
  1648         AC_TRY_COMPILE([
  1649          #include <qpe/qpeapplication.h>
  1650         ],[
  1651         ],[
  1652         video_qtopia=yes
  1653         ])
  1654         CXXFLAGS="$OLD_CXX"
  1655         AC_MSG_RESULT($video_qtopia)
  1656         if test x$video_qtopia = xyes; then
  1657             CFLAGS="$CFLAGS -DENABLE_QTOPIA -DQT_QWS_EBX -DQT_QWS_CUSTOM -DQWS -I${QPEDIR}/include -I${QTDIR}/include/ -DNO_DEBUG -fno-rtti -fno-exceptions"
  1658             SDL_LIBS="$SDL_LIBS -L${QPEDIR}/lib -L${QTDIR}/lib/ -lqpe -lqte"
  1659             SDL_CFLAGS="$SDL_CFLAGS -DQWS"	  
  1660             VIDEO_SUBDIRS="$VIDEO_SUBDIRS qtopia"
  1661             VIDEO_DRIVERS="$VIDEO_DRIVERS qtopia/libvideo_qtopia.la"
  1662         else
  1663 	AC_MSG_ERROR([
  1664 *** Failed to find Qtopia includes. Make sure that the QTDIR and QPEDIR
  1665 *** environment variables are set correctly.])
  1666         fi
  1667         AC_LANG_C
  1668     fi
  1669 }
  1670 
  1671 dnl Set up the wscons video driver if enabled
  1672 CheckWscons()
  1673 {
  1674     AC_ARG_ENABLE(video-wscons,
  1675 [  --enable-video-wscons   use wscons video driver [default=no]],
  1676                   , enable_video_wscons=no)
  1677     if test x$enable_video = xyes -a x$enable_video_wscons = xyes; then
  1678         AC_MSG_CHECKING(for wscons support)
  1679         video_wscons=no
  1680         AC_LANG_C
  1681         AC_TRY_COMPILE([
  1682        #include <sys/time.h>
  1683        #include <dev/wscons/wsconsio.h>
  1684         ],[
  1685         ],[
  1686         video_wscons=yes
  1687         ])
  1688         AC_MSG_RESULT($video_wscons)
  1689         if test x$video_wscons = xyes; then
  1690             CFLAGS="$CFLAGS -DENABLE_WSCONS"
  1691             VIDEO_SUBDIRS="$VIDEO_SUBDIRS wscons"
  1692             VIDEO_DRIVERS="$VIDEO_DRIVERS wscons/libvideo_wscons.la"
  1693         else
  1694       AC_MSG_ERROR([
  1695 *** Failed to find wscons includes.])
  1696         fi
  1697       AC_LANG_C
  1698     fi
  1699 }
  1700 
  1701 
  1702 dnl Set up the PicoGUI video driver if enabled
  1703 CheckPicoGUI()
  1704 {
  1705     AC_ARG_ENABLE(video-picogui,
  1706 [  --enable-video-picogui  use PicoGUI video driver [default=no]],
  1707                   , enable_video_picogui=no)
  1708     if test x$enable_video = xyes -a x$enable_video_picogui = xyes; then
  1709         AC_MSG_CHECKING(for PicoGUI support)
  1710         video_picogui=no
  1711         AC_TRY_COMPILE([
  1712          #include <picogui.h>
  1713         ],[
  1714         ],[
  1715         video_picogui=yes
  1716         ])
  1717         AC_MSG_RESULT($video_picogui)
  1718         if test x$video_picogui = xyes; then
  1719 	    SDL_LIBS="$SDL_LIBS -lpgui"
  1720             CFLAGS="$CFLAGS -DENABLE_PICOGUI"
  1721             VIDEO_SUBDIRS="$VIDEO_SUBDIRS picogui"
  1722             VIDEO_DRIVERS="$VIDEO_DRIVERS picogui/libvideo_picogui.la"
  1723         fi
  1724         AC_LANG_C
  1725     fi
  1726 }
  1727 
  1728 dnl Set up the Mac toolbox video driver for Mac OS 7-9
  1729 CheckTOOLBOX()
  1730 {
  1731     CFLAGS="$CFLAGS -DENABLE_TOOLBOX -DENABLE_DRAWSPROCKET"
  1732     VIDEO_SUBDIRS="$VIDEO_SUBDIRS maccommon"
  1733     VIDEO_DRIVERS="$VIDEO_DRIVERS maccommon/libvideo_maccommon.la"
  1734     VIDEO_SUBDIRS="$VIDEO_SUBDIRS macrom"
  1735     VIDEO_DRIVERS="$VIDEO_DRIVERS macrom/libvideo_macrom.la"
  1736     VIDEO_SUBDIRS="$VIDEO_SUBDIRS macdsp"
  1737     VIDEO_DRIVERS="$VIDEO_DRIVERS macdsp/libvideo_macdsp.la"
  1738 }
  1739 
  1740 dnl Set up the Carbon/QuickDraw video driver for Mac OS X (but not Darwin)
  1741 CheckCARBON()
  1742 {
  1743     AC_ARG_ENABLE(video-carbon,
  1744 [  --enable-video-carbon   use Carbon/QuickDraw video driver [default=no]],
  1745                   , enable_video_carbon=no)
  1746   if test x$enable_video = xyes -a x$enable_video_carbon = xyes; then
  1747     AC_MSG_CHECKING(for Carbon framework)
  1748     have_carbon=no
  1749     if test x$have_carbon != xyes; then
  1750         AC_TRY_COMPILE([
  1751           #include <Carbon/Carbon.h>
  1752         ],[
  1753         ],[
  1754         have_carbon=yes
  1755         ])
  1756     fi
  1757     AC_MSG_RESULT($have_carbon)
  1758     if test x$have_carbon = xyes; then
  1759     # "MACOSX" is not an official definition, but it's commonly
  1760     # accepted as a way to differentiate between what runs on X
  1761     # and what runs on older Macs - while in theory "Carbon" defns
  1762     # are consistent between the two, in practice Carbon is still
  1763     # changing. -sts Aug 2000
  1764     mac_autoconf_target_workaround="MAC"
  1765     CFLAGS="$CFLAGS -I/System/Library/Frameworks/Carbon.framework/Headers \
  1766       -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"
  1767     VIDEO_SUBDIRS="$VIDEO_SUBDIRS maccommon"
  1768     VIDEO_DRIVERS="$VIDEO_DRIVERS maccommon/libvideo_maccommon.la"
  1769     VIDEO_SUBDIRS="$VIDEO_SUBDIRS macrom"
  1770     VIDEO_DRIVERS="$VIDEO_DRIVERS macrom/libvideo_macrom.la"
  1771     #VIDEO_SUBDIRS="$VIDEO_SUBDIRS macdsp"
  1772     #VIDEO_DRIVERS="$VIDEO_DRIVERS macdsp/libvideo_macdsp.la"
  1773     fi
  1774   fi
  1775 }
  1776 
  1777 dnl Set up the Cocoa/Quartz video driver for Mac OS X (but not Darwin)
  1778 CheckCOCOA()
  1779 {
  1780     AC_ARG_ENABLE(video-cocoa,
  1781 [  --enable-video-cocoa    use Cocoa/Quartz video driver [default=yes]],
  1782                   , enable_video_cocoa=yes)
  1783   if test x$enable_video = xyes -a x$enable_video_cocoa = xyes; then
  1784     old_CFLAGS="$CFLAGS"
  1785     dnl work around that we don't have Objective-C support in autoconf
  1786     CFLAGS="$CFLAGS -x objective-c"
  1787     AC_MSG_CHECKING(for Cocoa framework)
  1788     have_cocoa=no
  1789     if test x$have_cocoa != xyes; then
  1790         AC_TRY_COMPILE([
  1791           #import <Cocoa/Cocoa.h>
  1792         ],[
  1793         ],[
  1794         have_cocoa=yes
  1795         ])
  1796     fi
  1797     AC_MSG_RESULT($have_cocoa)
  1798     CFLAGS="$old_CFLAGS"
  1799     if test x$have_cocoa = xyes; then
  1800     # "MACOSX" is not an official definition, but it's commonly
  1801     # accepted as a way to differentiate between what runs on X
  1802     # and what runs on older Macs - while in theory "Carbon" defns
  1803     # are consistent between the two, in practice Carbon is still
  1804     # changing. -sts Aug 2000
  1805     mac_autoconf_target_workaround="MAC"
  1806     CFLAGS="$CFLAGS -I/System/Library/Frameworks/Carbon.framework/Headers \
  1807       -I/System/Library/Frameworks/Cocoa.framework/Headers -fpascal-strings \
  1808       -DENABLE_QUARTZ -DMACOSX -DTARGET_API_${mac_autoconf_target_workaround}_CARBON=1 -I\$(top_srcdir)/src/video/quartz"
  1809     VIDEO_SUBDIRS="$VIDEO_SUBDIRS quartz"
  1810     VIDEO_DRIVERS="$VIDEO_DRIVERS quartz/libvideo_quartz.la"
  1811     fi
  1812   fi
  1813 }
  1814 
  1815 dnl Check for the dlfcn.h interface for dynamically loading objects
  1816 CheckDLOPEN()
  1817 {
  1818     AC_ARG_ENABLE(sdl-dlopen,
  1819 [  --enable-sdl-dlopen     use dlopen for shared object loading [default=yes]],
  1820                   , enable_sdl_dlopen=yes)
  1821     if test x$enable_sdl_dlopen = xyes; then
  1822         AC_MSG_CHECKING(for dlopen)
  1823         have_loadso=no
  1824         AC_TRY_COMPILE([
  1825          #include <dlfcn.h>
  1826         ],[
  1827         ],[
  1828         have_loadso=yes
  1829         ])
  1830         AC_MSG_RESULT($have_loadso)
  1831 
  1832         if test x$have_loadso = xyes; then
  1833             CFLAGS="$CFLAGS -DUSE_DLOPEN"
  1834             AC_CHECK_LIB(c, dlopen, SYSTEM_LIBS="$SYSTEM_LIBS",
  1835                AC_CHECK_LIB(dl, dlopen, SYSTEM_LIBS="$SYSTEM_LIBS -ldl",
  1836                   AC_CHECK_LIB(ltdl, dlopen, SYSTEM_LIBS="$SYSTEM_LIBS -lltdl")))
  1837         fi
  1838     fi
  1839 }
  1840 
  1841 dnl Set up the Atari LDG (shared object loader)
  1842 CheckAtariLdg()
  1843 {
  1844     AC_ARG_ENABLE(atari-ldg,
  1845 [  --enable-atari-ldg      use Atari LDG for shared object loading [default=yes]],
  1846                   , enable_atari_ldg=yes)
  1847     if test x$video_gem = xyes -a x$enable_atari_ldg = xyes; then
  1848         AC_CHECK_HEADER(ldg.h, have_ldg_hdr=yes)
  1849         AC_CHECK_LIB(ldg, ldg_open, have_ldg_lib=yes, have_ldg_lib=no, -lgem)
  1850         if test x$have_ldg_hdr = xyes -a x$have_ldg_lib = xyes; then
  1851             have_loadso=yes
  1852             CFLAGS="$CFLAGS -DENABLE_LDG"
  1853             SYSTEM_LIBS="$SYSTEM_LIBS -lldg -lgem"
  1854         fi
  1855     fi
  1856 }
  1857 
  1858 dnl Check for the usbhid(3) library on *BSD
  1859 CheckUSBHID()
  1860 {
  1861     if test x$enable_joystick = xyes; then
  1862         have_libusbhid=no
  1863         have_libusb=no
  1864         AC_CHECK_LIB(usbhid, hid_init, have_libusbhid=yes)
  1865         AC_CHECK_LIB(usb, hid_init, have_libusb=yes)
  1866         if test x$have_libusbhid = xyes; then
  1867             SYSTEM_LIBS="$SYSTEM_LIBS -lusbhid"
  1868         fi
  1869         if test x$have_libusb = xyes; then
  1870             SYSTEM_LIBS="$SYSTEM_LIBS -lusb"
  1871         fi
  1872 
  1873         AC_CHECK_HEADER(usb.h, have_usb_h=yes)
  1874         AC_CHECK_HEADER(usbhid.h, have_usbhid_h=yes)
  1875         AC_CHECK_HEADER(libusb.h, have_libusb_h=yes)
  1876         AC_CHECK_HEADER(libusbhid.h, have_libusbhid_h=yes)
  1877         if test x$have_usb_h = xyes; then
  1878             CFLAGS="$CFLAGS -DHAVE_USB_H"
  1879         fi
  1880         if test x$have_usbhid_h = xyes; then
  1881             CFLAGS="$CFLAGS -DHAVE_USBHID_H"
  1882         fi
  1883         if test x$have_libusb_h = xyes; then
  1884             CFLAGS="$CFLAGS -DHAVE_LIBUSB_H"
  1885         fi
  1886         if test x$have_libusbhid_h = xyes; then
  1887             CFLAGS="$CFLAGS -DHAVE_LIBUSBHID_H"
  1888         fi
  1889 
  1890         AC_MSG_CHECKING(for usbhid)
  1891         have_usbhid=no
  1892         AC_TRY_COMPILE([
  1893           #include <sys/types.h>
  1894           #if defined(HAVE_USB_H)
  1895           #include <usb.h>
  1896           #endif
  1897           #include <dev/usb/usb.h>
  1898           #include <dev/usb/usbhid.h>
  1899           #if defined(HAVE_USBHID_H)
  1900           #include <usbhid.h>
  1901           #elif defined(HAVE_LIBUSB_H)
  1902           #include <libusb.h>
  1903           #elif defined(HAVE_LIBUSBHID_H)
  1904           #include <libusbhid.h>
  1905           #endif
  1906         ],[
  1907           struct report_desc *repdesc;
  1908           struct usb_ctl_report *repbuf;
  1909           hid_kind_t hidkind;
  1910         ],[
  1911         have_usbhid=yes
  1912         ])
  1913         AC_MSG_RESULT($have_usbhid)
  1914 
  1915         if test x$have_usbhid = xyes; then
  1916             AC_MSG_CHECKING(for ucr_data member of usb_ctl_report)
  1917             have_usbhid_ucr_data=no
  1918             AC_TRY_COMPILE([
  1919               #include <sys/types.h>
  1920               #if defined(HAVE_USB_H)
  1921               #include <usb.h>
  1922               #endif
  1923               #include <dev/usb/usb.h>
  1924               #include <dev/usb/usbhid.h>
  1925               #if defined(HAVE_USBHID_H)
  1926               #include <usbhid.h>
  1927               #elif defined(HAVE_LIBUSB_H)
  1928               #include <libusb.h>
  1929               #elif defined(HAVE_LIBUSBHID_H)
  1930               #include <libusbhid.h>
  1931               #endif
  1932             ],[
  1933               struct usb_ctl_report buf;
  1934               if (buf.ucr_data) { }
  1935             ],[
  1936             have_usbhid_ucr_data=yes
  1937             ])
  1938             if test x$have_usbhid_ucr_data = xyes; then
  1939                 CFLAGS="$CFLAGS -DUSBHID_UCR_DATA"
  1940             fi
  1941             AC_MSG_RESULT($have_usbhid_ucr_data)
  1942             
  1943 	    AC_MSG_CHECKING(for new usbhid API)
  1944             have_usbhid_new=no
  1945             AC_TRY_COMPILE([
  1946               #include <sys/types.h>
  1947               #if defined(HAVE_USB_H)
  1948               #include <usb.h>
  1949               #endif
  1950               #include <dev/usb/usb.h>
  1951               #include <dev/usb/usbhid.h>
  1952               #if defined(HAVE_USBHID_H)
  1953               #include <usbhid.h>
  1954               #elif defined(HAVE_LIBUSB_H)
  1955               #include <libusb.h>
  1956               #elif defined(HAVE_LIBUSBHID_H)
  1957               #include <libusbhid.h>
  1958               #endif
  1959             ],[
  1960               report_desc_t d;
  1961 	      hid_start_parse(d, 1, 1);
  1962             ],[
  1963             have_usbhid_new=yes
  1964             ])
  1965             if test x$have_usbhid_new = xyes; then
  1966                 CFLAGS="$CFLAGS -DUSBHID_NEW"
  1967             fi
  1968             AC_MSG_RESULT($have_usbhid_new)
  1969 
  1970             JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS bsd"
  1971             JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS bsd/libjoystick_bsd.la"
  1972         fi
  1973     fi
  1974 }
  1975 
  1976 dnl Check for altivec instruction support using gas syntax
  1977 CheckAltivec()
  1978 {
  1979     have_altivec_h_hdr=no
  1980     AC_CHECK_HEADER(altivec.h, have_altivec_h_hdr=yes)
  1981 
  1982     save_CFLAGS="${CFLAGS}"
  1983     have_gcc_altivec=no
  1984     AC_MSG_CHECKING(for Altivec with GCC -maltivec option)
  1985     CFLAGS="${save_CFLAGS} -DGCC_ALTIVEC -DUSE_ALTIVEC_BLITTERS -maltivec"
  1986 
  1987     if test x$have_altivec_h_hdr = xyes; then
  1988       AC_TRY_COMPILE([
  1989       #include <altivec.h>
  1990       vector unsigned int vzero() {
  1991           return vec_splat_u32(0);
  1992       }
  1993       ],[
  1994       ],[
  1995       have_gcc_altivec=yes
  1996       ])
  1997       AC_MSG_RESULT($have_gcc_altivec)
  1998     else
  1999       AC_TRY_COMPILE([
  2000       vector unsigned int vzero() {
  2001           return vec_splat_u32(0);
  2002       }
  2003       ],[
  2004       ],[
  2005       have_gcc_altivec=yes
  2006       ])
  2007       AC_MSG_RESULT($have_gcc_altivec)
  2008     fi
  2009 
  2010     if test x$have_gcc_altivec = xno; then
  2011         AC_MSG_CHECKING(for Altivec with GCC -faltivec option)
  2012         CFLAGS="${save_CFLAGS} -DGCC_ALTIVEC -DUSE_ALTIVEC_BLITTERS -faltivec"
  2013         if test x$have_altivec_h_hdr = xyes; then
  2014           AC_TRY_COMPILE([
  2015           #include <altivec.h>
  2016           vector unsigned int vzero() {
  2017               return vec_splat_u32(0);
  2018           }
  2019           ],[
  2020           ],[
  2021           have_gcc_altivec=yes
  2022           ])
  2023           AC_MSG_RESULT($have_gcc_altivec)
  2024         else
  2025           AC_TRY_COMPILE([
  2026           vector unsigned int vzero() {
  2027               return vec_splat_u32(0);
  2028           }
  2029           ],[
  2030           ],[
  2031           have_gcc_altivec=yes
  2032           ])
  2033           AC_MSG_RESULT($have_gcc_altivec)
  2034         fi
  2035     fi
  2036 
  2037     if test x$have_gcc_altivec = xno; then
  2038         CFLAGS="${save_CFLAGS}"
  2039     else
  2040         if test x$have_altivec_h_hdr = xyes; then
  2041           CFLAGS="${CFLAGS} -DHAVE_ALTIVEC_H"
  2042         fi
  2043     fi
  2044 }
  2045 
  2046 dnl Check for a valid linux/version.h
  2047 CheckLinuxVersion()
  2048 {
  2049     AC_CHECK_HEADER(linux/version.h, have_linux_version_h=yes)
  2050     if test x$have_linux_version_h = xyes; then
  2051         CFLAGS="$CFLAGS -DHAVE_LINUX_VERSION_H"
  2052     fi
  2053 }
  2054 
  2055 dnl Check if we want to use RPATH
  2056 CheckRPATH()
  2057 {
  2058     AC_ARG_ENABLE(rpath,
  2059 [  --enable-rpath          use an rpath when linking SDL [default=yes]],
  2060                   , enable_rpath=yes)
  2061 }
  2062 
  2063 have_loadso=no
  2064 case "$target" in
  2065     arm-*-elf*)
  2066 	ARCH=linux
  2067 	CheckDummyVideo
  2068 	CheckIPod
  2069 	# Set up files for the timer library
  2070         if test x$enable_timers = xyes; then
  2071             COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
  2072         fi
  2073 	;;
  2074     *-*-linux*|*-*-gnu*|*-*-k*bsd*-gnu)
  2075         case "$target" in
  2076           *-*-linux*) ARCH=linux ;;
  2077           *-*-kfreebsd*-gnu) ARCH=kfreebsd-gnu ;;
  2078           *-*-knetbsd*-gnu) ARCH=knetbsd-gnu ;;
  2079           *-*-kopenbsd*-gnu) ARCH=kopenbsd-gnu ;;
  2080           *-*-gnu*) ARCH=gnu ;; # must be last
  2081         esac
  2082         CheckDummyVideo
  2083         CheckDiskAudio
  2084         CheckDLOPEN
  2085         CheckNASM
  2086         CheckOSS
  2087         CheckALSA
  2088         CheckARTSC
  2089         CheckESD
  2090         CheckNAS
  2091         CheckX11
  2092         CheckNANOX
  2093         CheckDGA
  2094         CheckFBCON
  2095         CheckDirectFB
  2096         CheckPS2GS
  2097         CheckGGI
  2098         CheckSVGA
  2099         CheckAAlib
  2100         CheckQtopia
  2101         CheckPicoGUI
  2102         CheckOpenGLX11
  2103         CheckInputEvents
  2104         CheckTslib
  2105         CheckPTHREAD
  2106         CheckSIGACTION
  2107         CheckAltivec
  2108         CheckLinuxVersion
  2109         CheckRPATH
  2110 
  2111         # Set up files for the main() stub
  2112         if test "x$video_qtopia" = "xyes"; then
  2113           SDL_CFLAGS="$SDL_CFLAGS -Dmain=SDL_main"
  2114           SDL_LIBS="-lSDLmain $SDL_LIBS"
  2115         fi
  2116         # Set up files for the audio library
  2117         # We use the OSS and ALSA API's, not the Sun audio API
  2118         #if test x$enable_audio = xyes; then
  2119         #    CFLAGS="$CFLAGS -DSUNAUDIO_SUPPORT"
  2120         #    AUDIO_SUBDIRS="$AUDIO_SUBDIRS sun"
  2121         #    AUDIO_DRIVERS="$AUDIO_DRIVERS sun/libaudio_sun.la"
  2122         #fi
  2123         # Set up files for the joystick library
  2124         if test x$enable_joystick = xyes; then
  2125 	  case $ARCH in
  2126 	    linux)
  2127               JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS linux"
  2128               JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS linux/libjoystick_linux.la"
  2129 	    ;;
  2130 	    gnu)
  2131               JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS dummy"
  2132               JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS dummy/libjoystick_dummy.la"
  2133 	    ;;
  2134 	    k*bsd-gnu)
  2135               JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS bsd"
  2136               JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS bsd/libjoystick_bsd.la"
  2137 	    ;;
  2138 	  esac
  2139         fi
  2140         # Set up files for the cdrom library
  2141         if test x$enable_cdrom = xyes; then
  2142 	  case $ARCH in
  2143 	    linux)
  2144               CDROM_SUBDIRS="$CDROM_SUBDIRS linux"
  2145               CDROM_DRIVERS="$CDROM_DRIVERS linux/libcdrom_linux.la"
  2146 	    ;;
  2147 	    gnu)
  2148               CDROM_SUBDIRS="$CDROM_SUBDIRS dummy"
  2149               CDROM_DRIVERS="$CDROM_DRIVERS dummy/libcdrom_dummy.la"
  2150 	    ;;
  2151 	    kfreebsd-gnu)
  2152               CDROM_SUBDIRS="$CDROM_SUBDIRS freebsd"
  2153               CDROM_DRIVERS="$CDROM_DRIVERS freebsd/libcdrom_freebsd.la"
  2154 	    ;;
  2155 	    knetbsd-gnu|kopenbsd-gnu)
  2156               CDROM_SUBDIRS="$CDROM_SUBDIRS openbsd"
  2157               CDROM_DRIVERS="$CDROM_DRIVERS openbsd/libcdrom_openbsd.la"
  2158 	    ;;
  2159 	  esac
  2160         fi
  2161         # Set up files for the thread library
  2162         if test x$enable_threads = xyes; then
  2163             CopyUnixThreadSource
  2164         fi
  2165         # Set up files for the timer library
  2166         if test x$enable_timers = xyes; then
  2167             COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
  2168         fi
  2169         ;;
  2170     *-*-bsdi*)
  2171         ARCH=bsdi
  2172         CheckDummyVideo
  2173         CheckDiskAudio
  2174         CheckDLOPEN
  2175         CheckNASM
  2176         CheckOSS
  2177         CheckARTSC
  2178         CheckESD
  2179         CheckNAS
  2180         CheckX11
  2181         CheckDGA
  2182         CheckSVGA
  2183         CheckAAlib
  2184         CheckOpenGLX11
  2185         CheckPTHREAD
  2186         CheckSIGACTION
  2187         CheckRPATH
  2188         # Set up files for the audio library
  2189         # We use the OSS and ALSA API's, not the Sun audio API
  2190         #if test x$enable_audio = xyes; then
  2191         #    CFLAGS="$CFLAGS -DSUNAUDIO_SUPPORT"
  2192         #    AUDIO_SUBDIRS="$AUDIO_SUBDIRS sun"
  2193         #    AUDIO_DRIVERS="$AUDIO_DRIVERS sun/libaudio_sun.la"
  2194         #fi
  2195         # Set up files for the joystick library
  2196         # (No joystick support yet)
  2197         if test x$enable_joystick = xyes; then
  2198             JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS dummy"
  2199             JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS dummy/libjoystick_dummy.la"
  2200         fi
  2201         # Set up files for the cdrom library
  2202         if test x$enable_cdrom = xyes; then
  2203             CDROM_SUBDIRS="$CDROM_SUBDIRS bsdi"
  2204             CDROM_DRIVERS="$CDROM_DRIVERS bsdi/libcdrom_bsdi.la"
  2205         fi
  2206         # Set up files for the thread library
  2207         if test x$enable_threads = xyes; then
  2208             CopyUnixThreadSource
  2209         fi
  2210         # Set up files for the timer library
  2211         if test x$enable_timers = xyes; then
  2212             COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
  2213         fi
  2214         ;;
  2215     *-*-freebsd*)
  2216         ARCH=freebsd
  2217         CheckDummyVideo
  2218         CheckDiskAudio
  2219         CheckDLOPEN
  2220         CheckVGL
  2221         CheckNASM
  2222         CheckOSS
  2223         CheckARTSC
  2224         CheckESD
  2225         CheckNAS
  2226         CheckX11
  2227         CheckDGA
  2228         CheckSVGA
  2229         CheckAAlib
  2230         CheckOpenGLX11
  2231         CheckPTHREAD
  2232         CheckSIGACTION
  2233         CheckUSBHID
  2234         CheckRPATH
  2235         # Set up files for the audio library
  2236         # We use the OSS and ALSA API's, not the Sun audio API
  2237         #if test x$enable_audio = xyes; then
  2238         #    CFLAGS="$CFLAGS -DSUNAUDIO_SUPPORT"
  2239         #    AUDIO_SUBDIRS="$AUDIO_SUBDIRS sun"
  2240         #    AUDIO_DRIVERS="$AUDIO_DRIVERS sun/libaudio_sun.la"
  2241         #fi
  2242         # Set up files for the cdrom library
  2243         if test x$enable_cdrom = xyes; then
  2244             CDROM_SUBDIRS="$CDROM_SUBDIRS freebsd"
  2245             CDROM_DRIVERS="$CDROM_DRIVERS freebsd/libcdrom_freebsd.la"
  2246         fi
  2247         # Set up files for the thread library
  2248         if test x$enable_threads = xyes; then
  2249             CopyUnixThreadSource
  2250         fi
  2251         # Set up files for the timer library
  2252         if test x$enable_timers = xyes; then
  2253             COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
  2254         fi
  2255         ;;
  2256     *-*-netbsd*)
  2257         ARCH=netbsd
  2258         CheckDummyVideo
  2259         CheckDiskAudio
  2260         CheckDLOPEN
  2261         CheckNASM
  2262         CheckOSS
  2263         CheckARTSC
  2264         CheckESD
  2265         CheckNAS
  2266         CheckX11
  2267         CheckAAlib
  2268 	CheckWscons
  2269         CheckOpenGLX11
  2270         CheckPTHREAD
  2271         CheckSIGACTION
  2272         CheckUSBHID
  2273         CheckRPATH
  2274         # Set up files for the audio library
  2275         if test x$enable_audio = xyes; then
  2276             CFLAGS="$CFLAGS -DSUNAUDIO_SUPPORT"
  2277             AUDIO_SUBDIRS="$AUDIO_SUBDIRS sun"
  2278             AUDIO_DRIVERS="$AUDIO_DRIVERS sun/libaudio_sun.la"
  2279         fi
  2280         # Set up files for the cdrom library
  2281         if test x$enable_cdrom = xyes; then
  2282             CDROM_SUBDIRS="$CDROM_SUBDIRS openbsd"
  2283             CDROM_DRIVERS="$CDROM_DRIVERS openbsd/libcdrom_openbsd.la"
  2284         fi
  2285         # Set up files for the thread library
  2286         if test x$enable_threads = xyes; then
  2287             if test x$use_pthreads = xyes; then
  2288                 CFLAGS="$CFLAGS -D_POSIX_THREAD_SYSCALL_SOFT=1"
  2289             fi
  2290             CopyUnixThreadSource
  2291         fi
  2292         # Set up files for the timer library
  2293         if test x$enable_timers = xyes; then
  2294             COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
  2295         fi
  2296         # NetBSD does not define "unix"
  2297         CFLAGS="$CFLAGS -Dunix"
  2298         ;;
  2299     *-*-openbsd*)
  2300         ARCH=openbsd
  2301         CheckDummyVideo
  2302         CheckDiskAudio
  2303         CheckDLOPEN
  2304         CheckNASM
  2305         CheckOSS
  2306         CheckARTSC
  2307         CheckESD
  2308         CheckNAS
  2309         CheckX11
  2310         CheckAAlib
  2311         CheckOpenGLX11
  2312         CheckPTHREAD
  2313         CheckSIGACTION
  2314         CheckUSBHID
  2315         CheckRPATH
  2316         # Set up files for the audio library
  2317         if test x$enable_audio = xyes; then
  2318             CFLAGS="$CFLAGS -DOPENBSD_AUDIO_SUPPORT"
  2319             AUDIO_SUBDIRS="$AUDIO_SUBDIRS openbsd"
  2320             AUDIO_DRIVERS="$AUDIO_DRIVERS openbsd/libaudio_openbsd.la"
  2321         fi
  2322         # OpenBSD needs linking with ossaudio emulation library
  2323         if test x$have_oss = xyes; then
  2324             SYSTEM_LIBS="$SYSTEM_LIBS -lossaudio"
  2325         fi
  2326         # Set up files for the cdrom library
  2327         if test x$enable_cdrom = xyes; then
  2328             CDROM_SUBDIRS="$CDROM_SUBDIRS openbsd"
  2329             CDROM_DRIVERS="$CDROM_DRIVERS openbsd/libcdrom_openbsd.la"
  2330         fi
  2331         # Set up files for the thread library
  2332         if test x$enable_threads = xyes; then
  2333             CopyUnixThreadSource
  2334         fi
  2335         # Set up files for the timer library
  2336         if test x$enable_timers = xyes; then
  2337             COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
  2338         fi
  2339         # OpenBSD does not define "unix"
  2340         CFLAGS="$CFLAGS -Dunix"
  2341         ;;
  2342     *-*-sysv5*)
  2343         ARCH=sysv5
  2344         CheckDummyVideo
  2345         CheckDiskAudio
  2346         CheckDLOPEN
  2347         CheckNASM
  2348         CheckOSS
  2349         CheckARTSC
  2350         CheckESD
  2351         CheckNAS
  2352         CheckX11
  2353         CheckAAlib
  2354         CheckOpenGLX11
  2355         CheckPTHREAD
  2356         CheckSIGACTION
  2357         CheckRPATH
  2358         # Set up files for the audio library
  2359         if test x$enable_audio = xyes; then
  2360             CFLAGS="$CFLAGS -DSUNAUDIO_SUPPORT"
  2361             AUDIO_SUBDIRS="$AUDIO_SUBDIRS sun"
  2362             AUDIO_DRIVERS="$AUDIO_DRIVERS sun/libaudio_sun.la"
  2363         fi
  2364         # Set up files for the joystick library
  2365         # (No joystick support yet)
  2366         if test x$enable_joystick = xyes; then
  2367             JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS dummy"
  2368             JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS dummy/libjoystick_dummy.la"
  2369         fi
  2370         # Set up files for the cdrom library
  2371         if test x$enable_cdrom = xyes; then
  2372             CDROM_SUBDIRS="$CDROM_SUBDIRS dummy"
  2373             CDROM_DRIVERS="$CDROM_DRIVERS dummy/libcdrom_dummy.la"
  2374         fi
  2375         # Set up files for the thread library
  2376         if test x$enable_threads = xyes; then
  2377             CopyUnixThreadSource
  2378         fi
  2379         # Set up files for the timer library
  2380         if test x$enable_timers = xyes; then
  2381             COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
  2382         fi
  2383         ;;
  2384     *-*-solaris*)
  2385         ARCH=solaris
  2386         CFLAGS="$CFLAGS -D__ELF__" # Fix for nasm on Solaris x86
  2387         CheckDummyVideo
  2388         CheckDiskAudio
  2389         CheckDLOPEN
  2390         CheckNASM
  2391         CheckOSS
  2392         CheckARTSC
  2393         CheckESD
  2394         CheckNAS
  2395         CheckX11
  2396         CheckAAlib
  2397         CheckOpenGLX11
  2398         CheckPTHREAD
  2399         CheckSIGACTION
  2400         CheckRPATH
  2401         # Set up files for the audio library
  2402         if test x$enable_audio = xyes; then
  2403             CFLAGS="$CFLAGS -DSUNAUDIO_SUPPORT"
  2404             AUDIO_SUBDIRS="$AUDIO_SUBDIRS sun"
  2405             AUDIO_DRIVERS="$AUDIO_DRIVERS sun/libaudio_sun.la"
  2406         fi
  2407         # Set up files for the joystick library
  2408         # (No joystick support yet)
  2409         if test x$enable_joystick = xyes; then
  2410             JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS dummy"
  2411             JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS dummy/libjoystick_dummy.la"
  2412         fi
  2413         # Set up files for the cdrom library
  2414         if test x$enable_cdrom = xyes; then
  2415             CDROM_SUBDIRS="$CDROM_SUBDIRS linux"
  2416             CDROM_DRIVERS="$CDROM_DRIVERS linux/libcdrom_linux.la"
  2417         fi
  2418         # Set up files for the thread library
  2419         if test x$enable_threads = xyes; then
  2420             CopyUnixThreadSource
  2421         fi
  2422         # Set up files for the timer library
  2423         if test x$enable_timers = xyes; then
  2424             COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
  2425         fi
  2426         ;;
  2427     *-*-irix*)
  2428         ARCH=irix
  2429         CheckDummyVideo
  2430         CheckDiskAudio
  2431         CheckDLOPEN
  2432         CheckDMEDIA
  2433         CheckESD
  2434         CheckNAS
  2435         CheckX11
  2436         CheckAAlib
  2437         CheckOpenGLX11
  2438         CheckPTHREAD
  2439         CheckSIGACTION
  2440         # We use the dmedia audio API, not the Sun audio API
  2441         #if test x$enable_audio = xyes; then
  2442         #    CFLAGS="$CFLAGS -DSUNAUDIO_SUPPORT"
  2443         #    AUDIO_SUBDIRS="$AUDIO_SUBDIRS sun"
  2444         #    AUDIO_DRIVERS="$AUDIO_DRIVERS sun/libaudio_sun.la"
  2445         #fi
  2446         # Set up files for the joystick library
  2447         # (No joystick support yet)
  2448         if test x$enable_joystick = xyes; then
  2449             JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS dummy"
  2450             JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS dummy/libjoystick_dummy.la"
  2451         fi
  2452         # Set up files for the cdrom library
  2453         # (No CD-ROM support yet)
  2454         if test x$enable_cdrom = xyes; then
  2455             CDROM_SUBDIRS="$CDROM_SUBDIRS dummy"
  2456             CDROM_DRIVERS="$CDROM_DRIVERS dummy/libcdrom_dummy.la"
  2457         fi
  2458         # Set up files for the thread library
  2459         if test x$enable_threads = xyes; then
  2460             if test x$use_pthreads = xyes -o x$use_pth = xyes; then
  2461                 CopyUnixThreadSource
  2462             else
  2463                 COPY_ARCH_SRC(src/thread, irix, SDL_systhread.c)
  2464                 COPY_ARCH_SRC(src/thread, irix, SDL_systhread_c.h)
  2465                 COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex.c)
  2466                 COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex_c.h)
  2467                 COPY_ARCH_SRC(src/thread, linux, SDL_syssem.c)
  2468                 COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
  2469                 COPY_ARCH_SRC(src/thread, generic, SDL_syscond.c)
  2470                 COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
  2471             fi
  2472         fi
  2473         # Set up files for the timer library
  2474         if test x$enable_timers = xyes; then
  2475             COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
  2476         fi
  2477         ;;
  2478     *-*-hpux*)
  2479         ARCH=hpux
  2480         CheckDummyVideo
  2481         CheckDiskAudio
  2482         CheckDLOPEN
  2483         CheckOSS
  2484         CheckNAS
  2485         CheckX11
  2486         CheckGGI
  2487         CheckAAlib
  2488         CheckOpenGLX11
  2489         CheckPTHREAD
  2490         CheckSIGACTION
  2491         # Set up files for the audio library
  2492         if test x$enable_audio = xyes; then
  2493             CFLAGS="$CFLAGS -DSUNAUDIO_SUPPORT"
  2494             AUDIO_SUBDIRS="$AUDIO_SUBDIRS sun"
  2495             AUDIO_DRIVERS="$AUDIO_DRIVERS sun/libaudio_sun.la"
  2496         fi
  2497         # Set up files for the joystick library
  2498         # (No joystick support yet)
  2499         if test x$enable_joystick = xyes; then
  2500             JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS dummy"
  2501             JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS dummy/libjoystick_dummy.la"
  2502         fi
  2503         # Set up files for the cdrom library
  2504         # (No CD-ROM support yet)
  2505         if test x$enable_cdrom = xyes; then
  2506             CDROM_SUBDIRS="$CDROM_SUBDIRS dummy"
  2507             CDROM_DRIVERS="$CDROM_DRIVERS dummy/libcdrom_dummy.la"
  2508         fi
  2509         # Set up files for the thread library
  2510         if test x$enable_threads = xyes; then
  2511             CopyUnixThreadSource
  2512         fi
  2513         # Set up files for the timer library
  2514         if test x$enable_timers = xyes; then
  2515             COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
  2516         fi
  2517         ;;
  2518     *-*-aix*)
  2519         ARCH=aix
  2520         CheckDummyVideo
  2521         CheckDiskAudio
  2522         CheckDLOPEN
  2523         CheckOSS
  2524         CheckNAS
  2525         CheckX11
  2526         CheckGGI
  2527         CheckAAlib
  2528         CheckOpenGLX11
  2529         CheckPTHREAD
  2530         CheckSIGACTION
  2531         # Set up files for the audio library
  2532         if test x$enable_audio = xyes; then
  2533             AUDIO_SUBDIRS="$AUDIO_SUBDIRS paudio"
  2534             AUDIO_DRIVERS="$AUDIO_DRIVERS paudio/libaudio_paudio.la"
  2535         fi
  2536         # Set up files for the joystick library
  2537         # (No joystick support yet)
  2538         if test x$enable_joystick = xyes; then
  2539             JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS dummy"
  2540             JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS dummy/libjoystick_dummy.la"
  2541         fi
  2542         # Set up files for the cdrom library
  2543         if test x$enable_cdrom = xyes; then
  2544             CDROM_SUBDIRS="$CDROM_SUBDIRS aix"
  2545             CDROM_DRIVERS="$CDROM_DRIVERS aix/libcdrom_aix.la"
  2546         fi
  2547         # Set up files for the thread library
  2548         if test x$enable_threads = xyes; then
  2549             CopyUnixThreadSource
  2550         fi
  2551         # Set up files for the timer library
  2552         if test x$enable_timers = xyes; then
  2553             COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
  2554         fi
  2555         ;;
  2556     *-*-osf*)
  2557         ARCH=osf
  2558         CheckDummyVideo
  2559         CheckDiskAudio
  2560         CheckDLOPEN
  2561         CheckNAS
  2562         CheckX11
  2563         CheckGGI
  2564         CheckAAlib
  2565         CheckOpenGLX11
  2566         CheckPTHREAD
  2567         CheckSIGACTION
  2568         # Set up files for the audio library
  2569         if test x$enable_audio = xyes; then
  2570             CFLAGS="$CFLAGS -I/usr/include/mme -DMMEAUDIO_SUPPORT"
  2571             SYSTEM_LIBS="$SYSTEM_LIBS -lmme"
  2572             AUDIO_SUBDIRS="$AUDIO_SUBDIRS mme"
  2573             AUDIO_DRIVERS="$AUDIO_DRIVERS mme/libaudio_mme.la"
  2574         fi
  2575         # Set up files for the joystick library
  2576         # (No joystick support yet)
  2577         if test x$enable_joystick = xyes; then
  2578             JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS dummy"
  2579             JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS dummy/libjoystick_dummy.la"
  2580         fi
  2581         # Set up files for the cdrom library
  2582         # (No cdrom support yet)
  2583         if test x$enable_cdrom = xyes; then
  2584             CDROM_SUBDIRS="$CDROM_SUBDIRS osf"
  2585             CDROM_DRIVERS="$CDROM_DRIVERS osf/libcdrom_osf.la"
  2586         fi
  2587         # Set up files for the thread library
  2588         if test x$enable_threads = xyes; then
  2589             CopyUnixThreadSource
  2590         fi
  2591         # Set up files for the timer library
  2592         if test x$enable_timers = xyes; then
  2593             COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
  2594         fi
  2595         ;;
  2596     *-*-qnx*)
  2597         ARCH=qnx
  2598         CheckDummyVideo
  2599         CheckDiskAudio
  2600         # CheckNASM
  2601         CheckDLOPEN
  2602         CheckNAS
  2603         CheckPHOTON
  2604         CheckX11
  2605         CheckOpenGLX11
  2606         CheckPTHREAD
  2607         CheckSIGACTION
  2608         # Set up files for the audio library
  2609         if test x$enable_audio = xyes; then
  2610             CFLAGS="$CFLAGS -DQNXNTOAUDIO_SUPPORT"
  2611             SYSTEM_LIBS="$SYSTEM_LIBS -lasound"
  2612             AUDIO_SUBDIRS="$AUDIO_SUBDIRS nto"
  2613             AUDIO_DRIVERS="$AUDIO_DRIVERS nto/libaudio_nto.la"
  2614         fi
  2615         # Set up files for the joystick library
  2616         if test x$enable_joystick = xyes; then
  2617         # (No joystick support yet)
  2618             JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS dummy"
  2619             JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS dummy/libjoystick_dummy.la"
  2620         fi
  2621         # Set up files for the cdrom library
  2622         if test x$enable_cdrom = xyes; then
  2623             CDROM_SUBDIRS="$CDROM_SUBDIRS qnx"
  2624             CDROM_DRIVERS="$CDROM_DRIVERS qnx/libcdrom_qnx.la"
  2625         fi
  2626         # Set up files for the thread library
  2627         if test x$enable_threads = xyes; then
  2628             CopyUnixThreadSource
  2629         fi
  2630         # Set up files for the timer library
  2631         if test x$enable_timers = xyes; then
  2632             COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
  2633         fi
  2634         ;;
  2635     *-*-cygwin* | *-*-mingw32*)
  2636         ARCH=win32
  2637         have_loadso=yes
  2638         if test "$build" != "$target"; then # cross-compiling
  2639             # Default cross-compile location
  2640             ac_default_prefix=/usr/local/cross-tools/i386-mingw32msvc
  2641         else
  2642             # Look for the location of the tools and install there
  2643             if test "$BUILD_PREFIX" != ""; then
  2644                 ac_default_prefix=$BUILD_PREFIX
  2645             fi
  2646         fi
  2647         CheckDummyVideo
  2648         CheckDiskAudio
  2649         CheckWIN32
  2650         CheckDIRECTX
  2651         CheckNASM
  2652         # Set up files for the audio library
  2653         if test x$enable_audio = xyes; then
  2654             AUDIO_SUBDIRS="$AUDIO_SUBDIRS windib"
  2655             AUDIO_DRIVERS="$AUDIO_DRIVERS windib/libaudio_windib.la"
  2656             if test x$use_directx = xyes; then
  2657                 AUDIO_SUBDIRS="$AUDIO_SUBDIRS windx5"
  2658                 AUDIO_DRIVERS="$AUDIO_DRIVERS windx5/libaudio_windx5.la"
  2659             fi
  2660         fi
  2661         # Set up files for the joystick library
  2662         if test x$enable_joystick = xyes; then
  2663             JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS win32"
  2664             JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS win32/libjoystick_winmm.la"
  2665         fi
  2666         # Set up files for the cdrom library
  2667         if test x$enable_cdrom = xyes; then
  2668             CDROM_SUBDIRS="$CDROM_SUBDIRS win32"
  2669             CDROM_DRIVERS="$CDROM_DRIVERS win32/libcdrom_win32.la"
  2670         fi
  2671         # Set up files for the thread library
  2672         if test x$enable_threads = xyes; then
  2673             COPY_ARCH_SRC(src/thread, win32, SDL_systhread.c)
  2674             COPY_ARCH_SRC(src/thread, win32, SDL_systhread_c.h)
  2675             COPY_ARCH_SRC(src/thread, win32, SDL_sysmutex.c)
  2676             COPY_ARCH_SRC(src/thread, generic, SDL_sysmutex_c.h)
  2677             COPY_ARCH_SRC(src/thread, win32, SDL_syssem.c)
  2678             COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
  2679             COPY_ARCH_SRC(src/thread, generic, SDL_syscond.c)
  2680             COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
  2681         fi
  2682         # Set up files for the timer library
  2683         if test x$enable_timers = xyes; then
  2684             COPY_ARCH_SRC(src/timer, win32, SDL_systimer.c)
  2685         fi
  2686         # The Win32 platform requires special setup
  2687         SDL_CFLAGS="$SDL_CFLAGS -Dmain=SDL_main"
  2688         case "$target" in
  2689             *-*-cygwin*)
  2690                 CFLAGS="$CFLAGS -I/usr/include/mingw -DWIN32 -Uunix -mno-cygwin"
  2691                 SDL_CFLAGS="$SDL_CFLAGS -I/usr/include/mingw -DWIN32 -Uunix -mno-cygwin"
  2692                 LIBS="$LIBS -mno-cygwin"
  2693                 SDL_LIBS="-lmingw32 -lSDLmain $SDL_LIBS -mwindows -mno-cygwin"
  2694                 ;;
  2695             *-*-mingw32*)
  2696                 SDL_LIBS="-lmingw32 -lSDLmain $SDL_LIBS -mwindows"
  2697                 ;;
  2698         esac
  2699         ;;
  2700     *-*-beos*)
  2701         ARCH=beos
  2702         ac_default_prefix=/boot/develop/tools/gnupro
  2703         have_loadso=yes
  2704         CheckDummyVideo
  2705         CheckDiskAudio
  2706         CheckNASM
  2707         CheckBWINDOW
  2708         CheckBeGL
  2709         # Set up files for the audio library
  2710         if test x$enable_audio = xyes; then
  2711             AUDIO_SUBDIRS="$AUDIO_SUBDIRS baudio"
  2712             AUDIO_DRIVERS="$AUDIO_DRIVERS baudio/libaudio_baudio.la"
  2713         fi
  2714         # Set up files for the joystick library
  2715         if test x$enable_joystick = xyes; then
  2716             JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS beos"
  2717             JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS beos/libjoystick_beos.la"
  2718         fi
  2719         # Set up files for the cdrom library
  2720         if test x$enable_cdrom = xyes; then
  2721             CDROM_SUBDIRS="$CDROM_SUBDIRS beos"
  2722             CDROM_DRIVERS="$CDROM_DRIVERS beos/libcdrom_beos.la"
  2723         fi
  2724         # Set up files for the thread library
  2725         if test x$enable_threads = xyes; then
  2726             COPY_ARCH_SRC(src/thread, beos, SDL_systhread.c)
  2727             COPY_ARCH_SRC(src/thread, beos, SDL_systhread_c.h)
  2728             COPY_ARCH_SRC(src/thread, generic, SDL_sysmutex.c)
  2729             COPY_ARCH_SRC(src/thread, generic, SDL_sysmutex_c.h)
  2730             COPY_ARCH_SRC(src/thread, beos, SDL_syssem.c)
  2731             COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
  2732             COPY_ARCH_SRC(src/thread, generic, SDL_syscond.c)
  2733             COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
  2734         fi
  2735         # Set up files for the timer library
  2736         if test x$enable_timers = xyes; then
  2737             COPY_ARCH_SRC(src/timer, beos, SDL_systimer.c)
  2738         fi
  2739         # The BeOS platform requires special libraries
  2740         SYSTEM_LIBS="$SYSTEM_LIBS -lroot -lbe -lmedia -lgame -ldevice -ltextencoding"
  2741         ;;
  2742     *-*-macos*)
  2743         # This would be used if cross-compiling to MacOS 9.  No way to
  2744         # use it at present, but Apple is working on a X-to-9 compiler
  2745         # for which this case would be handy.
  2746         ARCH=macos
  2747         have_loadso=yes
  2748         CheckDummyVideo
  2749         CheckDiskAudio
  2750         CheckTOOLBOX
  2751         CheckMacGL
  2752         # Set up files for the audio library
  2753         if test x$enable_audio = xyes; then
  2754             AUDIO_SUBDIRS="$AUDIO_SUBDIRS macrom"
  2755             AUDIO_DRIVERS="$AUDIO_DRIVERS macrom/libaudio_macrom.la"
  2756         fi
  2757         # Set up files for the joystick library
  2758         if test x$enable_joystick = xyes; then
  2759             JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS macos"
  2760             JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS macos/libjoystick_macos.la"
  2761         fi
  2762         # Set up files for the cdrom library
  2763         if test x$enable_cdrom = xyes; then
  2764             CDROM_SUBDIRS="$CDROM_SUBDIRS macos"
  2765             CDROM_DRIVERS="$CDROM_DRIVERS macos/libcdrom_macos.la"
  2766         fi
  2767         # Set up files for the thread library
  2768         if test x$enable_threads = xyes; then
  2769             COPY_ARCH_SRC(src/thread, macos, SDL_systhread.c)
  2770             COPY_ARCH_SRC(src/thread, macos, SDL_systhread_c.h)
  2771             COPY_ARCH_SRC(src/thread, generic, SDL_sysmutex.c)
  2772             COPY_ARCH_SRC(src/thread, generic, SDL_sysmutex_c.h)
  2773             COPY_ARCH_SRC(src/thread, macos, SDL_syssem.c)
  2774             COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
  2775             COPY_ARCH_SRC(src/thread, generic, SDL_syscond.c)
  2776             COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
  2777         fi
  2778         # Set up files for the timer library
  2779         if test x$enable_timers = xyes; then
  2780             COPY_ARCH_SRC(src/timer, macos, SDL_systimer.c)
  2781         fi
  2782         # The MacOS platform requires special setup
  2783         SDL_CFLAGS="$SDL_CFLAGS -Dmain=SDL_main"
  2784         SDL_LIBS="-lSDLmain $SDL_LIBS"
  2785         ;;
  2786     *-*-darwin* )
  2787         # This could be either full "Mac OS X", or plain "Darwin" which is
  2788         # just the OS X kernel sans upper layers like Carbon and Cocoa.
  2789         # Next line is broken, and a few files below require Mac OS X (full)
  2790         ARCH=macosx
  2791         have_loadso=yes
  2792         CheckDummyVideo
  2793         CheckDiskAudio
  2794         CheckCOCOA
  2795         CheckCARBON
  2796         CheckX11
  2797         CheckMacGL
  2798         CheckOpenGLX11
  2799         CheckPTHREAD
  2800         CheckSIGACTION
  2801         CheckAltivec
  2802         # If either the audio or CD driver is used, add the AudioUnit framework
  2803         if test x$enable_audio = xyes -o x$enable_cdrom = xyes; then
  2804             SYSTEM_LIBS="$SYSTEM_LIBS -framework AudioToolbox -framework AudioUnit"
  2805         fi
  2806         # Set up files for the audio library
  2807         if test x$enable_audio = xyes; then
  2808             AUDIO_SUBDIRS="$AUDIO_SUBDIRS macosx"
  2809             AUDIO_DRIVERS="$AUDIO_DRIVERS macosx/libaudio_macosx.la"
  2810             AUDIO_SUBDIRS="$AUDIO_SUBDIRS macrom"
  2811             AUDIO_DRIVERS="$AUDIO_DRIVERS macrom/libaudio_macrom.la"
  2812         fi
  2813         # Set up files for the joystick library
  2814         if test x$enable_joystick = xyes; then
  2815             JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS darwin"
  2816             JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS darwin/libjoystick_darwin.la"
  2817             SYSTEM_LIBS="$SYSTEM_LIBS -framework IOKit"
  2818         fi
  2819         # Set up files for the cdrom library
  2820         if test x$enable_cdrom = xyes; then
  2821             CDROM_SUBDIRS="$CDROM_SUBDIRS macosx"
  2822             CDROM_DRIVERS="$CDROM_DRIVERS macosx/libcdrom_macosx.la"
  2823         fi
  2824         # Set up files for the thread library
  2825         if test x$enable_threads = xyes; then
  2826             CopyUnixThreadSource
  2827         fi
  2828         # Set up files for the timer library
  2829         if test x$enable_timers = xyes; then
  2830             COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
  2831         fi
  2832         # The MacOS X platform requires special setup.
  2833         SDL_LIBS="-lSDLmain $SDL_LIBS"
  2834         if test x$enable_video_cocoa = xyes; then
  2835             SYSTEM_LIBS="$SYSTEM_LIBS -framework Cocoa"
  2836         fi
  2837         if test x$enable_video_carbon = xyes -o x$enable_video_cocoa = xyes; then
  2838             # The Cocoa backend still needs Carbon, and the YUV code QuickTime
  2839             SYSTEM_LIBS="$SYSTEM_LIBS -framework Carbon -framework QuickTime"
  2840         fi
  2841         #if test x$enable_video_carbon = xyes; then
  2842         #    SYSTEM_LIBS="$SYSTEM_LIBS -framework DrawSprocket"
  2843         #fi
  2844         ;;
  2845     *-*-mint*)
  2846         ARCH=mint
  2847         CheckDummyVideo
  2848         CheckDiskAudio
  2849         CheckAtariBiosEvent
  2850         CheckAtariXbiosVideo
  2851         CheckAtariGemVideo
  2852         CheckAtariAudio
  2853         CheckAtariLdg
  2854 		CheckAtariOSMesa
  2855         CheckPTH
  2856         # Set up files for the audio library
  2857         if test x$enable_threads = xyes -a x$enable_pth = xyes; then
  2858             if test x$enable_audio = xyes; then
  2859                 CFLAGS="$CFLAGS -DSUNAUDIO_SUPPORT"
  2860                 AUDIO_SUBDIRS="$AUDIO_SUBDIRS sun"
  2861                 AUDIO_DRIVERS="$AUDIO_DRIVERS sun/libaudio_sun.la"
  2862             fi
  2863         fi
  2864         # Set up files for the joystick library
  2865         if test x$enable_joystick = xyes; then
  2866             JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS mint"
  2867             JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS mint/libjoystick_mint.la"
  2868         fi
  2869         # Set up files for the cdrom library
  2870         if test x$enable_cdrom = xyes; then
  2871             CDROM_SUBDIRS="$CDROM_SUBDIRS mint"
  2872             CDROM_DRIVERS="$CDROM_DRIVERS mint/libcdrom_mint.la"
  2873         fi
  2874         # Set up files for the thread library
  2875         if test x$enable_threads = xyes; then
  2876             CopyUnixThreadSource
  2877         fi
  2878         # Set up files for the timer library
  2879         if test x$enable_timers = xyes; then
  2880             if test x$enable_threads = xyes -a x$enable_pth = xyes; then
  2881                 COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
  2882             else
  2883                 COPY_ARCH_SRC(src/timer, mint, SDL_systimer.c)
  2884             fi
  2885         fi
  2886         # MiNT does not define "unix"
  2887         CFLAGS="$CFLAGS -Dunix"
  2888         ;;
  2889     *-riscos)
  2890         ARCH=riscos
  2891         # Set up files for the video library
  2892         if test x$enable_video = xyes; then
  2893             VIDEO_SUBDIRS="$VIDEO_SUBDIRS riscos"
  2894             VIDEO_DRIVERS="$VIDEO_DRIVERS riscos/libvideo_riscos.la"
  2895         fi
  2896         # Set up files for the audio library
  2897         if test x$enable_audio = xyes; then
  2898             CFLAGS="$CFLAGS -DOSS_SUPPORT"
  2899             AUDIO_SUBDIRS="$AUDIO_SUBDIRS dsp"
  2900             AUDIO_DRIVERS="$AUDIO_DRIVERS dsp/libaudio_dsp.la"
  2901             AUDIO_SUBDIRS="$AUDIO_SUBDIRS dma"
  2902             AUDIO_DRIVERS="$AUDIO_DRIVERS dma/libaudio_dma.la"
  2903         fi
  2904         # Set up files for the joystick library
  2905         if test x$enable_joystick = xyes; then
  2906             JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS riscos"
  2907             JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS riscos/libjoystick_riscos.la"
  2908         fi
  2909         # Set up files for the cdrom library
  2910         if test x$enable_cdrom = xyes; then
  2911             CDROM_SUBDIRS="$CDROM_SUBDIRS dummy"
  2912             CDROM_DRIVERS="$CDROM_DRIVERS dummy/libcdrom_dummy.la"
  2913         fi
  2914         # Set up files for the thread library
  2915         if test x$enable_threads = xyes; then
  2916             COPY_ARCH_SRC(src/thread, riscos, SDL_systhread.c)
  2917             COPY_ARCH_SRC(src/thread, riscos, SDL_systhread_c.h)
  2918             COPY_ARCH_SRC(src/thread, riscos, SDL_sysmutex.c)
  2919             COPY_ARCH_SRC(src/thread, riscos, SDL_sysmutex_c.h)
  2920             COPY_ARCH_SRC(src/thread, riscos, SDL_syssem.c)
  2921             COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
  2922             COPY_ARCH_SRC(src/thread, riscos, SDL_syscond.c)
  2923             COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
  2924         else
  2925             CFLAGS="$CFLAGS -DDISABLE_THREADS"
  2926         fi
  2927         # Set up files for the timer library
  2928         if test x$enable_timers = xyes; then
  2929             COPY_ARCH_SRC(src/timer, riscos, SDL_systimer.c)
  2930         fi
  2931 
  2932         CFLAGS="$CFLAGS -DENABLE_RISCOS"
  2933 
  2934         SYSTEM_LIBS="$SYSTEM_LIBS -ljpeg -ltiff -lpng -lz"
  2935         ;;
  2936     *)
  2937         AC_MSG_ERROR(Unsupported target:  Please add to configure.in)
  2938         ;;
  2939 esac
  2940 AC_SUBST(ARCH)
  2941 
  2942 # Set the conditional variables for this target
  2943 AM_CONDITIONAL(TARGET_LINUX, test $ARCH = linux)
  2944 AM_CONDITIONAL(TARGET_QTOPIA, test "x$video_qtopia" = "xyes")
  2945 AM_CONDITIONAL(TARGET_SOLARIS, test $ARCH = solaris)
  2946 AM_CONDITIONAL(TARGET_IRIX, test $ARCH = irix)
  2947 AM_CONDITIONAL(TARGET_BSDI, test $ARCH = bsdi)
  2948 AM_CONDITIONAL(TARGET_FREEBSD, test $ARCH = freebsd)
  2949 AM_CONDITIONAL(TARGET_NETBSD, test $ARCH = netbsd)
  2950 AM_CONDITIONAL(TARGET_OPENBSD, test $ARCH = openbsd)
  2951 AM_CONDITIONAL(TARGET_AIX, test $ARCH = aix)
  2952 AM_CONDITIONAL(TARGET_WIN32, test $ARCH = win32)
  2953 AM_CONDITIONAL(TARGET_BEOS, test $ARCH = beos)
  2954 AM_CONDITIONAL(TARGET_MACOS, test $ARCH = macos)
  2955 AM_CONDITIONAL(TARGET_MACOSX, test $ARCH = macosx)
  2956 AM_CONDITIONAL(TARGET_QNX, test $ARCH = qnx)
  2957 AM_CONDITIONAL(TARGET_MINT, test $ARCH = mint)
  2958 AM_CONDITIONAL(TARGET_IPOD, test x$enable_ipod = xyes)
  2959 
  2960 # More automake conditionals
  2961 AM_CONDITIONAL(USE_DIRECTX, test x$use_directx = xyes)
  2962 AM_CONDITIONAL(USE_CLONE, test x$use_clone = xyes)
  2963 AM_CONDITIONAL(HAVE_NASM, test x$use_nasm = xyes)
  2964 AM_CONDITIONAL(USE_COCOA, test x$enable_video_cocoa = xyes)
  2965 AM_CONDITIONAL(USE_CARBON, test x$enable_video_carbon = xyes)
  2966 
  2967 # Set conditional variables for shared and static library selection.
  2968 # These are not used in any Makefile.am but in sdl-config.in.
  2969 AM_CONDITIONAL([ENABLE_SHARED], [test "$enable_shared" = yes])
  2970 AM_CONDITIONAL([ENABLE_STATIC], [test "$enable_static" = yes])
  2971 
  2972 # Set runtime shared library paths as needed
  2973 
  2974 if test "x$enable_rpath" = "xyes"; then
  2975   if test $ARCH = linux -o $ARCH = freebsd -o $ARCH = bsdi; then
  2976     SDL_RLD_FLAGS="-Wl,-rpath,\${exec_prefix}/lib"
  2977   fi
  2978   if test $ARCH = solaris; then
  2979     SDL_RLD_FLAGS="-R\${exec_prefix}/lib"
  2980   fi
  2981 else
  2982   SDL_RLD_FLAGS=""
  2983 fi
  2984 
  2985 case "$ARCH" in
  2986   openbsd | netbsd | bsdi)
  2987     SHARED_SYSTEM_LIBS="$SYSTEM_LIBS"
  2988     ;;
  2989   qnx)
  2990     SHARED_SYSTEM_LIBS="$SYSTEM_LIBS"
  2991     ;;
  2992   macosx)
  2993     SHARED_SYSTEM_LIBS=""
  2994     if test x$enable_video = xyes -a x$enable_video_cocoa = xyes; then
  2995       SHARED_SYSTEM_LIBS="$SHARED_SYSTEM_LIBS -framework Cocoa"
  2996     fi
  2997     if test x$enable_video = xyes -a x$enable_video_carbon = xyes; then
  2998       SHARED_SYSTEM_LIBS="$SHARED_SYSTEM_LIBS -framework Carbon"
  2999     fi
  3000     if test x$enable_video = xyes -a x$enable_video_opengl = xyes; then
  3001       SHARED_SYSTEM_LIBS="$SHARED_SYSTEM_LIBS -framework OpenGL"
  3002     fi
  3003     ;;
  3004   *)
  3005     SHARED_SYSTEM_LIBS=""
  3006     ;;
  3007 esac
  3008 
  3009 case "$ARCH" in
  3010   macosx)
  3011     # Evil hack to allow static linking on Mac OS X
  3012     SDL_STATIC_LIBS="\${exec_prefix}/lib/libSDLmain.a \${exec_prefix}/lib/libSDL.a"
  3013     ;;
  3014   *)
  3015     SDL_STATIC_LIBS="$SDL_LIBS"
  3016     ;;
  3017 esac
  3018 
  3019 
  3020 STATIC_SYSTEM_LIBS="$SYSTEM_LIBS"
  3021 
  3022 dnl Output the video drivers we use
  3023 if test x$enable_video = xtrue; then
  3024     if test "$VIDEO_SUBDIRS" = ""; then
  3025         AC_MSG_ERROR(*** No video drivers are enabled!)
  3026     fi
  3027 fi
  3028 AC_SUBST(AUDIO_SUBDIRS)
  3029 AC_SUBST(AUDIO_DRIVERS)
  3030 AC_SUBST(VIDEO_SUBDIRS)
  3031 AC_SUBST(VIDEO_DRIVERS)
  3032 AC_SUBST(JOYSTICK_SUBDIRS)
  3033 AC_SUBST(JOYSTICK_DRIVERS)
  3034 AC_SUBST(CDROM_SUBDIRS)
  3035 AC_SUBST(CDROM_DRIVERS)
  3036 AC_SUBST(SDL_EXTRADIRS)
  3037 AC_SUBST(SDL_EXTRALIBS)
  3038 
  3039 dnl Expand the cflags and libraries needed by apps using SDL
  3040 AC_SUBST(SDL_CFLAGS)
  3041 AC_SUBST(SDL_LIBS)
  3042 AC_SUBST(SDL_STATIC_LIBS)
  3043 AC_SUBST(SDL_RLD_FLAGS)
  3044 
  3045 dnl Expand the libraries needed for static and dynamic linking
  3046 AC_SUBST(STATIC_SYSTEM_LIBS)
  3047 AC_SUBST(SHARED_SYSTEM_LIBS)
  3048 AC_SUBST(SYSTEM_LIBS)
  3049 
  3050 dnl Expand the include directories for building SDL
  3051 CFLAGS="$CFLAGS -I\$(top_srcdir)/include"
  3052 CFLAGS="$CFLAGS -I\$(top_srcdir)/include/SDL"
  3053 CFLAGS="$CFLAGS -I\$(top_srcdir)/src -I\$(top_srcdir)/src/main/$ARCH"
  3054 CFLAGS="$CFLAGS -I\$(top_srcdir)/src/audio"
  3055 CFLAGS="$CFLAGS -I\$(top_srcdir)/src/video"
  3056 CFLAGS="$CFLAGS -I\$(top_srcdir)/src/video/XFree86/extensions"
  3057 CFLAGS="$CFLAGS -I\$(top_srcdir)/src/events"
  3058 CFLAGS="$CFLAGS -I\$(top_srcdir)/src/joystick"
  3059 CFLAGS="$CFLAGS -I\$(top_srcdir)/src/cdrom"
  3060 CFLAGS="$CFLAGS -I\$(top_srcdir)/src/thread"
  3061 CFLAGS="$CFLAGS -I\$(top_srcdir)/src/timer"
  3062 CFLAGS="$CFLAGS -I\$(top_srcdir)/src/endian"
  3063 CFLAGS="$CFLAGS -I\$(top_srcdir)/src/file"
  3064 CFLAGS="$CFLAGS -I\$(top_builddir)/src/thread"
  3065 CXXFLAGS="$CFLAGS"
  3066 
  3067 
  3068 # Check for darwin at the very end and set up the Objective C compiler
  3069 # We do this here so that we get the full CFLAGS into OBJCFLAGS
  3070 case "$target" in
  3071     *-*-darwin*)
  3072         dnl AC_PROG_OBJC doesn't seem to exist, this is the SDL workaround
  3073         AC_MSG_CHECKING(for an Objective-C compiler)
  3074         OBJC="$CC"
  3075         AC_SUBST(OBJC)
  3076         OBJCFLAGS="$CFLAGS"
  3077         AC_SUBST(OBJCFLAGS)
  3078         dnl _AM_DEPENDENCIES(OBJC) doesn't work, so hard code OBJCDEPMODE here
  3079         dnl _AM_DEPENDENCIES(OBJC)
  3080         dnl Of course, hard coding doesn't work for some versions of automake
  3081         OBJCDEPMODE="depmode=gcc"
  3082         AC_SUBST(OBJCDEPMODE)
  3083         dnl Trying this to satisfy everybody...
  3084         AC_MSG_RESULT(not implemented yet)
  3085         ;;
  3086 esac
  3087 
  3088 # Finally create all the generated files
  3089 dnl Important: Any directory that you want to be in the distcheck should
  3090 dnl            have a file listed here, so that configure generates the
  3091 dnl            subdirectories on the build target.
  3092 AC_OUTPUT([
  3093 Makefile
  3094 docs/Makefile
  3095 docs/html/Makefile
  3096 docs/man3/Makefile
  3097 include/Makefile
  3098 src/Makefile
  3099 src/main/Makefile
  3100 src/main/macos/Makefile
  3101 src/main/macosx/Makefile
  3102 src/main/macosx/Info.plist
  3103 src/audio/Makefile
  3104 src/audio/alsa/Makefile
  3105 src/audio/arts/Makefile
  3106 src/audio/baudio/Makefile
  3107 src/audio/dc/Makefile
  3108 src/audio/disk/Makefile
  3109 src/audio/dma/Makefile
  3110 src/audio/dmedia/Makefile
  3111 src/audio/dsp/Makefile
  3112 src/audio/esd/Makefile
  3113 src/audio/macosx/Makefile
  3114 src/audio/macrom/Makefile
  3115 src/audio/mint/Makefile
  3116 src/audio/mme/Makefile
  3117 src/audio/nas/Makefile
  3118 src/audio/nto/Makefile
  3119 src/audio/openbsd/Makefile
  3120 src/audio/paudio/Makefile
  3121 src/audio/sun/Makefile
  3122 src/audio/ums/Makefile
  3123 src/audio/windib/Makefile
  3124 src/audio/windx5/Makefile
  3125 src/video/Makefile
  3126 src/video/aalib/Makefile
  3127 src/video/ataricommon/Makefile
  3128 src/video/bwindow/Makefile
  3129 src/video/cybergfx/Makefile
  3130 src/video/dc/Makefile
  3131 src/video/dga/Makefile
  3132 src/video/directfb/Makefile
  3133 src/video/dummy/Makefile
  3134 src/video/epoc/Makefile
  3135 src/video/fbcon/Makefile
  3136 src/video/gem/Makefile
  3137 src/video/ggi/Makefile
  3138 src/video/ipod/Makefile
  3139 src/video/maccommon/Makefile
  3140 src/video/macdsp/Makefile
  3141 src/video/macrom/Makefile
  3142 src/video/nanox/Makefile
  3143 src/video/photon/Makefile
  3144 src/video/picogui/Makefile
  3145 src/video/ps2gs/Makefile
  3146 src/video/qtopia/Makefile
  3147 src/video/wscons/Makefile
  3148 src/video/quartz/Makefile
  3149 src/video/riscos/Makefile
  3150 src/video/svga/Makefile
  3151 src/video/vgl/Makefile
  3152 src/video/wincommon/Makefile
  3153 src/video/windib/Makefile
  3154 src/video/windx5/Makefile
  3155 src/video/x11/Makefile
  3156 src/video/xbios/Makefile
  3157 src/video/XFree86/Makefile
  3158 src/video/XFree86/extensions/Makefile
  3159 src/video/XFree86/Xinerama/Makefile
  3160 src/video/XFree86/Xv/Makefile
  3161 src/video/XFree86/Xxf86dga/Makefile
  3162 src/video/XFree86/Xxf86vm/Makefile
  3163 src/events/Makefile
  3164 src/joystick/Makefile
  3165 src/joystick/amigaos/Makefile
  3166 src/joystick/beos/Makefile
  3167 src/joystick/bsd/Makefile
  3168 src/joystick/darwin/Makefile
  3169 src/joystick/dc/Makefile
  3170 src/joystick/dummy/Makefile
  3171 src/joystick/linux/Makefile
  3172 src/joystick/macos/Makefile
  3173 src/joystick/mint/Makefile
  3174 src/joystick/riscos/Makefile
  3175 src/joystick/win32/Makefile
  3176 src/cdrom/Makefile
  3177 src/cdrom/aix/Makefile
  3178 src/cdrom/beos/Makefile
  3179 src/cdrom/dc/Makefile
  3180 src/cdrom/dummy/Makefile
  3181 src/cdrom/bsdi/Makefile
  3182 src/cdrom/freebsd/Makefile
  3183 src/cdrom/linux/Makefile
  3184 src/cdrom/macos/Makefile
  3185 src/cdrom/macosx/Makefile
  3186 src/cdrom/mint/Makefile
  3187 src/cdrom/openbsd/Makefile
  3188 src/cdrom/osf/Makefile
  3189 src/cdrom/qnx/Makefile
  3190 src/cdrom/win32/Makefile
  3191 src/thread/Makefile
  3192 src/timer/Makefile
  3193 src/endian/Makefile
  3194 src/file/Makefile
  3195 src/cpuinfo/Makefile
  3196 src/hermes/Makefile
  3197 sdl-config
  3198 SDL.spec
  3199 SDL.qpg
  3200 ], [chmod +x sdl-config])