configure.in
author Ryan C. Gordon <icculus@icculus.org>
Thu, 08 Sep 2005 06:43:51 +0000
changeset 1136 d16c010d5d98
parent 1133 609c060fd2a2
child 1140 af8b0f9ac2f4
permissions -rw-r--r--
Fix dlvsym() detection in the configure script.

--ryan.


From: Mike Frysinger <vapier@gentoo.org>
To: sdl@libsdl.org
Subject: Re: [SDL] sdl, sdl-mixer not compiling with uclibc
Date: Wed, 7 Sep 2005 19:17:49 -0400

in this case actually, the error is in libsdl

the configure check for dlvsym presence is pretty pointless, it currently
always detects it

AC_TRY_COMPILE([
#include <stdio.h>
#define __USE_GNU
#include <dlfcn.h>
],[
dlvsym(NULL,"","");
],[
use_dlvsym=yes
])

since it's merely compiling, the warning about dlvsym being implicitly
declared doesnt trigger a failure

find attached a patch to fix this
-mike
     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$use_dlopen != xyes && \
   308                test x$enable_alsa_shared = xyes; then
   309                 AC_MSG_ERROR([You must have dlopen() support and use the --enable-dlopen option])
   310             fi
   311             if test x$use_dlopen = 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$use_dlopen != xyes && \
   371                test x$enable_esd_shared = xyes; then
   372                 AC_MSG_ERROR([You must have dlopen() support and use the --enable-dlopen option])
   373             fi
   374             if test x$use_dlopen = 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$use_dlopen != xyes && \
   422                    test x$enable_arts_shared = xyes; then
   423                     AC_MSG_ERROR([You must have dlopen() support and use the --enable-dlopen option])
   424                 fi
   425                 if test x$use_dlopen = 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 Find the nanox include and library directories
   553 CheckNANOX()
   554 {
   555     AC_ARG_ENABLE(video-nanox,
   556         [  --enable-video-nanox use nanox video driver [default=no]],
   557         , enable_video_nanox=no)
   558     AC_ARG_ENABLE(nanox-debug,  
   559         [  --enable-nanox-debug print debug messages [default=no]],
   560         , enable_nanox_debug=no)
   561     AC_ARG_ENABLE(nanox-share-memory,  
   562         [  --enable-nanox-share-memory use share memory [default=no]],
   563         , enable_nanox_share_memory=no)
   564     AC_ARG_ENABLE(nanox_direct_fb, 
   565         [  --enable-nanox-direct-fb use direct framebuffer access [default=no]],
   566         , enable_nanox_direct_fb=no)
   567 
   568     if test x$enable_video = xyes -a x$enable_video_nanox = xyes; then
   569         if test x$enable_nanox_debug = xyes; then
   570             CFLAGS="$CFLAGS -DENABLE_NANOX_DEBUG"
   571         fi
   572 
   573         if test x$enable_nanox_share_memory = xyes; then
   574             CFLAGS="$CFLAGS -DNANOX_SHARE_MEMORY"
   575         fi
   576 
   577         if test x$enable_nanox_direct_fb = xyes; then
   578             CFLAGS="$CFLAGS -DENABLE_NANOX_DIRECT_FB"
   579         fi
   580 
   581         CFLAGS="$CFLAGS $X_CFLAGS -DENABLE_NANOX"
   582         SYSTEM_LIBS="$SYSTEM_LIBS -lnano-X"
   583         VIDEO_SUBDIRS="$VIDEO_SUBDIRS nanox"
   584         VIDEO_DRIVERS="$VIDEO_DRIVERS nanox/libvideo_nanox.la"
   585     fi
   586 }
   587 
   588 dnl Find the X11 include and library directories
   589 CheckX11()
   590 {
   591     AC_ARG_ENABLE(video-x11,
   592 [  --enable-video-x11      use X11 video driver [default=yes]],
   593                   , enable_video_x11=yes)
   594     if test x$enable_video = xyes -a x$enable_video_x11 = xyes; then
   595         AC_PATH_X
   596         AC_PATH_XTRA
   597         if test x$have_x = xyes; then
   598             CFLAGS="$CFLAGS $X_CFLAGS -DENABLE_X11 -DXTHREADS -I$srcdir/include -I$srcdir/src/video"
   599             if test x$ac_cv_func_shmat != xyes; then
   600                 CFLAGS="$CFLAGS -DNO_SHARED_MEMORY"
   601             fi
   602             SYSTEM_LIBS="$SYSTEM_LIBS $X_LIBS -lX11 -lXext"
   603             VIDEO_SUBDIRS="$VIDEO_SUBDIRS x11"
   604             VIDEO_DRIVERS="$VIDEO_DRIVERS x11/libvideo_x11.la"
   605 
   606             AC_ARG_ENABLE(video-x11-vm,
   607 [  --enable-video-x11-vm   use X11 VM extension for fullscreen [default=yes]],
   608                           , enable_video_x11_vm=yes)
   609             if test x$enable_video_x11_vm = xyes; then
   610                 AC_MSG_CHECKING(for XFree86 VidMode 1.0 support)
   611                 video_x11_vm=no
   612                 AC_TRY_COMPILE([
   613                  #include <X11/Xlib.h>
   614                  #include <XFree86/extensions/xf86vmode.h>
   615                 ],[
   616                 ],[
   617                 video_x11_vm=yes
   618                 ])
   619                 AC_MSG_RESULT($video_x11_vm)
   620                 if test x$video_x11_vm = xyes; then
   621                     CFLAGS="$CFLAGS -DXFREE86_VM"
   622                     VIDEO_SUBDIRS="$VIDEO_SUBDIRS XFree86/Xxf86vm"
   623                     VIDEO_DRIVERS="$VIDEO_DRIVERS XFree86/Xxf86vm/libXFree86_Xxf86vm.la"
   624                     AC_MSG_CHECKING(for XFree86 VidMode gamma support)
   625                     video_x11_vmgamma=no
   626                     AC_TRY_COMPILE([
   627                      #include <X11/Xlib.h>
   628                      #include <XFree86/extensions/xf86vmode.h>
   629                     ],[
   630                      SDL_NAME(XF86VidModeGamma) gamma;
   631                     ],[
   632                     video_x11_vmgamma=yes
   633                     ])
   634                     AC_MSG_RESULT($video_x11_vmgamma)
   635                     if test x$video_x11_vmgamma = xyes; then
   636                         CFLAGS="$CFLAGS -DXFREE86_VMGAMMA"
   637                     fi
   638                 fi
   639             fi
   640             AC_ARG_ENABLE(dga,
   641 [  --enable-dga            allow use of X11 DGA code [default=yes]],
   642                           , enable_dga=yes)
   643             AC_ARG_ENABLE(video-x11-dgamouse,
   644 [  --enable-video-x11-dgamouse  use X11 DGA for mouse events [default=yes]],
   645                           , enable_video_x11_dgamouse=yes)
   646             if test x$enable_dga = xyes; then
   647                 AC_MSG_CHECKING(for XFree86 DGA 1.0 support)
   648                 video_x11_dga=no
   649                 AC_TRY_COMPILE([
   650                  #include <X11/Xlib.h>
   651                  #include <XFree86/extensions/xf86dga.h>
   652                 ],[
   653                 ],[
   654                 video_x11_dga=yes
   655                 ])
   656                 AC_MSG_RESULT($video_x11_dga)
   657                 if test x$video_x11_dga = xyes; then
   658                     CFLAGS="$CFLAGS -DXFREE86_DGAMOUSE"
   659                     if test x$enable_video_x11_dgamouse = xyes; then
   660                         CFLAGS="$CFLAGS -DDEFAULT_DGAMOUSE"
   661                     fi
   662                     VIDEO_SUBDIRS="$VIDEO_SUBDIRS XFree86/Xxf86dga"
   663                     VIDEO_DRIVERS="$VIDEO_DRIVERS XFree86/Xxf86dga/libXFree86_Xxf86dga.la"
   664                 fi
   665             fi
   666             AC_ARG_ENABLE(video-x11-xv,
   667 [  --enable-video-x11-xv   use X11 XvImage extension for video [default=yes]],
   668                           , enable_video_x11_xv=yes)
   669             if test x$enable_video_x11_xv = xyes; then
   670                 AC_MSG_CHECKING(for XFree86 XvImage support)
   671                 video_x11_xv=no
   672                 AC_TRY_COMPILE([
   673                  #include <X11/Xlib.h>
   674                  #include <sys/ipc.h>
   675                  #include <sys/shm.h>
   676                  #include <X11/extensions/XShm.h>
   677                  #include <XFree86/extensions/Xvlib.h>
   678                 ],[
   679                  SDL_NAME(XvImage) *image;
   680                 ],[
   681                 video_x11_xv=yes
   682                 ])
   683                 AC_MSG_RESULT($video_x11_xv)
   684                 if test x$video_x11_xv = xyes; then
   685                     CFLAGS="$CFLAGS -DXFREE86_XV"
   686                     VIDEO_SUBDIRS="$VIDEO_SUBDIRS XFree86/Xv"
   687                     VIDEO_DRIVERS="$VIDEO_DRIVERS XFree86/Xv/libXFree86_Xv.la"
   688                 fi
   689             fi
   690             AC_ARG_ENABLE(video-x11-xinerama,
   691 [  --enable-video-x11-xinerama   enable X11 Xinerama support [default=yes]],
   692                             , enable_video_x11_xinerama=yes)
   693             if test x$enable_video_x11_xinerama = xyes; then
   694                 AC_MSG_CHECKING(for X11 Xinerama support)
   695                 video_x11_xinerama=no
   696                 AC_TRY_COMPILE([
   697                  #include <X11/Xlib.h>
   698                  #include <XFree86/extensions/Xinerama.h>
   699                 ],[
   700                  SDL_NAME(XineramaScreenInfo) *xinerama;
   701                 ],[
   702                 video_x11_xinerama=yes
   703                 ])
   704                 AC_MSG_RESULT($video_x11_xinerama)
   705                 if test x$video_x11_xinerama = xyes; then
   706                     CFLAGS="$CFLAGS -DHAVE_XINERAMA"
   707                     VIDEO_SUBDIRS="$VIDEO_SUBDIRS XFree86/Xinerama"
   708                     VIDEO_DRIVERS="$VIDEO_DRIVERS XFree86/Xinerama/libXFree86_Xinerama.la"
   709                 fi
   710             fi
   711             AC_ARG_ENABLE(video-x11-xme,
   712 [  --enable-video-x11-xme  enable Xi Graphics XME for fullscreen [default=yes]],
   713                             , enable_video_x11_xme=yes)
   714             if test x$enable_video_x11_xme = xyes; then
   715                 AC_MSG_CHECKING(for Xi Graphics XiGMiscExtension support)
   716                 video_x11_xme=no
   717                 AC_TRY_COMPILE([
   718                  #include <X11/Xlib.h>
   719                  #include <X11/extensions/xme.h>
   720                 ],[
   721                  XiGMiscResolutionInfo *resolutions;
   722                 ],[
   723                 video_x11_xme=yes
   724                 ])
   725                 AC_MSG_RESULT($video_x11_xme)
   726                 if test x$video_x11_xme = xyes; then
   727                     CFLAGS="$CFLAGS -DHAVE_XIGXME"
   728                     SYSTEM_LIBS="$SYSTEM_LIBS -lxme"
   729                 fi
   730             fi
   731         fi
   732     fi
   733 }
   734 
   735 
   736 dnl Check for X11 on Mac OS X / Darwin
   737 CheckMacX11()
   738 {
   739     AC_ARG_ENABLE(video-x11,
   740 [  --enable-video-x11      use X11 video driver [default=no]],
   741                   , enable_video_x11=no)
   742     if test x$enable_video = xyes -a x$enable_video_x11 = xyes; then
   743         AC_PATH_X
   744         AC_PATH_XTRA
   745         if test x$have_x = xyes; then
   746             CFLAGS="$CFLAGS $X_CFLAGS -DENABLE_X11 -DXTHREADS -I$srcdir/include -I$srcdir/src/video"
   747             if test x$ac_cv_func_shmat != xyes; then
   748                 CFLAGS="$CFLAGS -DNO_SHARED_MEMORY"
   749             fi
   750             SYSTEM_LIBS="$SYSTEM_LIBS $X_LIBS -lX11 -lXext"
   751             VIDEO_SUBDIRS="$VIDEO_SUBDIRS x11"
   752             VIDEO_DRIVERS="$VIDEO_DRIVERS x11/libvideo_x11.la"
   753         fi
   754     fi
   755 }
   756 
   757 dnl Find the X11 DGA 2.0 include and library directories
   758 CheckDGA()
   759 {
   760     AC_ARG_ENABLE(video-dga,
   761 [  --enable-video-dga      use DGA 2.0 video driver [default=yes]],
   762                   , enable_video_dga=yes)
   763     if test x$video_x11_dga = xyes -a x$enable_video_dga = xyes; then
   764         save_CFLAGS="$CFLAGS"; CFLAGS="$CFLAGS -Isrc/video"
   765         AC_MSG_CHECKING(for XFree86 DGA 2.0 support)
   766         video_x11_dga2=no
   767         AC_TRY_COMPILE([
   768          #include <X11/Xlib.h>
   769          #include <XFree86/extensions/xf86dga.h>
   770         ],[
   771          SDL_NAME(XDGAEvent) xevent;
   772         ],[
   773         video_x11_dga2=yes
   774         ])
   775         AC_MSG_RESULT($video_x11_dga2)
   776         if test x$video_x11_dga2 = xyes; then
   777             CFLAGS="$CFLAGS -DENABLE_DGA"
   778             VIDEO_SUBDIRS="$VIDEO_SUBDIRS dga"
   779             VIDEO_DRIVERS="$VIDEO_DRIVERS dga/libvideo_dga.la"
   780         fi
   781     fi
   782 }
   783 
   784 CheckPHOTON()
   785 {
   786     AC_ARG_ENABLE(video-photon,
   787 [  --enable-video-photon   use QNX Photon video driver [default=yes]],
   788                   , enable_video_photon=yes)
   789     if test x$enable_video = xyes -a x$enable_video_photon = xyes; then
   790         AC_MSG_CHECKING(for QNX Photon support)
   791         video_photon=no
   792         AC_TRY_COMPILE([
   793           #include <Ph.h>
   794           #include <Pt.h>
   795           #include <photon/Pg.h>
   796           #include <photon/PdDirect.h>
   797         ],[
   798          PgDisplaySettings_t *visual;
   799         ],[
   800         video_photon=yes
   801         ])
   802         AC_MSG_RESULT($video_photon)
   803         if test x$video_photon = xyes; then
   804             CFLAGS="$CFLAGS -DENABLE_PHOTON"
   805             SYSTEM_LIBS="$SYSTEM_LIBS -lph"
   806             VIDEO_SUBDIRS="$VIDEO_SUBDIRS photon"
   807             VIDEO_DRIVERS="$VIDEO_DRIVERS photon/libvideo_photon.la"
   808             CheckOpenGLQNX
   809         fi
   810     fi
   811 }
   812 
   813 dnl Find the framebuffer console includes
   814 CheckFBCON()
   815 {
   816     AC_ARG_ENABLE(video-fbcon,
   817 [  --enable-video-fbcon    use framebuffer console video driver [default=yes]],
   818                   , enable_video_fbcon=yes)
   819     if test x$enable_video = xyes -a x$enable_video_fbcon = xyes; then
   820         AC_MSG_CHECKING(for framebuffer console support)
   821         video_fbcon=no
   822         AC_TRY_COMPILE([
   823          #include <linux/fb.h>
   824          #include <linux/kd.h>
   825          #include <linux/keyboard.h>
   826         ],[
   827         ],[
   828         video_fbcon=yes
   829         ])
   830         AC_MSG_RESULT($video_fbcon)
   831         if test x$video_fbcon = xyes; then
   832             CFLAGS="$CFLAGS -DENABLE_FBCON"
   833             VIDEO_SUBDIRS="$VIDEO_SUBDIRS fbcon"
   834             VIDEO_DRIVERS="$VIDEO_DRIVERS fbcon/libvideo_fbcon.la"
   835         fi
   836     fi
   837 }
   838 
   839 dnl Find DirectFB
   840 CheckDirectFB()
   841 {
   842     AC_ARG_ENABLE(video-directfb,
   843 [  --enable-video-directfb use DirectFB video driver [default=no]],
   844                   , enable_video_directfb=no)
   845     if test x$enable_video = xyes -a x$enable_video_directfb = xyes; then
   846         video_directfb=no
   847 
   848         AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
   849         if test x$PKG_CONFIG = xno ; then
   850             AC_MSG_WARN([*** pkg-config is required to build the DirectFB video driver.])
   851         else
   852             AC_MSG_CHECKING(for DirectFB support)
   853 
   854             if ! $PKG_CONFIG --atleast-pkgconfig-version 0.7 ; then
   855                 AC_MSG_ERROR([*** pkg-config too old; version 0.7 or better required.])
   856             fi
   857 
   858             DIRECTFB_REQUIRED_VERSION=0.9.15
   859 
   860             if $PKG_CONFIG --atleast-version $DIRECTFB_REQUIRED_VERSION directfb ; then
   861                 DIRECTFB_CFLAGS=`$PKG_CONFIG --cflags directfb`
   862                 DIRECTFB_LIBS=`$PKG_CONFIG --libs directfb`
   863                 video_directfb=yes
   864             fi
   865         fi
   866 
   867         AC_MSG_RESULT($video_directfb)
   868         if test x$video_directfb = xyes; then
   869             CFLAGS="$CFLAGS -DENABLE_DIRECTFB"
   870             VIDEO_SUBDIRS="$VIDEO_SUBDIRS directfb"
   871             VIDEO_DRIVERS="$VIDEO_DRIVERS directfb/libvideo_directfb.la"
   872 
   873             AC_SUBST(DIRECTFB_CFLAGS)
   874             AC_SUBST(DIRECTFB_LIBS)
   875         fi
   876     fi
   877 }
   878 
   879 dnl See if we're running on PlayStation 2 hardware
   880 CheckPS2GS()
   881 {
   882     AC_ARG_ENABLE(video-ps2gs,
   883 [  --enable-video-ps2gs    use PlayStation 2 GS video driver [default=yes]],
   884                   , enable_video_ps2gs=yes)
   885     if test x$enable_video = xyes -a x$enable_video_ps2gs = xyes; then
   886         AC_MSG_CHECKING(for PlayStation 2 GS support)
   887         video_ps2gs=no
   888         AC_TRY_COMPILE([
   889          #include <linux/ps2/dev.h>
   890          #include <linux/ps2/gs.h>
   891         ],[
   892         ],[
   893         video_ps2gs=yes
   894         ])
   895         AC_MSG_RESULT($video_ps2gs)
   896         if test x$video_ps2gs = xyes; then
   897             CFLAGS="$CFLAGS -DENABLE_PS2GS"
   898             VIDEO_SUBDIRS="$VIDEO_SUBDIRS ps2gs"
   899             VIDEO_DRIVERS="$VIDEO_DRIVERS ps2gs/libvideo_ps2gs.la"
   900         fi
   901     fi
   902 }
   903 
   904 dnl Find the GGI includes
   905 CheckGGI()
   906 {
   907     AC_ARG_ENABLE(video-ggi,
   908 [  --enable-video-ggi      use GGI video driver [default=no]],
   909                   , enable_video_ggi=no)
   910     if test x$enable_video = xyes -a x$enable_video_ggi = xyes; then
   911         AC_MSG_CHECKING(for GGI support)
   912         video_ggi=no
   913         AC_TRY_COMPILE([
   914          #include <ggi/ggi.h>
   915          #include <ggi/gii.h>
   916         ],[
   917         ],[
   918         video_ggi=yes
   919         ])
   920         AC_MSG_RESULT($video_ggi)
   921         if test x$video_ggi = xyes; then
   922             CFLAGS="$CFLAGS $X_CFLAGS -DENABLE_GGI"
   923             SYSTEM_LIBS="$SYSTEM_LIBS -lggi -lgii -lgg"
   924 
   925             VIDEO_SUBDIRS="$VIDEO_SUBDIRS ggi"
   926             VIDEO_DRIVERS="$VIDEO_DRIVERS ggi/libvideo_ggi.la"
   927         fi
   928     fi
   929 }
   930 
   931 dnl Find the SVGAlib includes and libraries
   932 CheckSVGA()
   933 {
   934     AC_ARG_ENABLE(video-svga,
   935 [  --enable-video-svga     use SVGAlib video driver [default=no]],
   936                   , enable_video_svga=no)
   937     if test x$enable_video = xyes -a x$enable_video_svga = xyes; then
   938         AC_MSG_CHECKING(for SVGAlib (1.4.0+) support)
   939         video_svga=no
   940         AC_TRY_COMPILE([
   941          #include <vga.h>
   942          #include <vgamouse.h>
   943          #include <vgakeyboard.h>
   944         ],[
   945          if ( SCANCODE_RIGHTWIN && SCANCODE_LEFTWIN ) {
   946              exit(0);
   947          }
   948         ],[
   949         video_svga=yes
   950         ])
   951         AC_MSG_RESULT($video_svga)
   952         if test x$video_svga = xyes; then
   953             CFLAGS="$CFLAGS -DENABLE_SVGALIB"
   954             SYSTEM_LIBS="$SYSTEM_LIBS -lvga"
   955 
   956             VIDEO_SUBDIRS="$VIDEO_SUBDIRS svga"
   957             VIDEO_DRIVERS="$VIDEO_DRIVERS svga/libvideo_svga.la"
   958         fi
   959     fi
   960 }
   961 
   962 dnl Find the VGL includes and libraries
   963 CheckVGL()
   964 {
   965     AC_ARG_ENABLE(video-vgl,
   966 [  --enable-video-vgl      use VGL video driver [default=no]],
   967                   , enable_video_vgl=no)
   968     if test x$enable_video = xyes -a x$enable_video_vgl = xyes; then
   969         AC_MSG_CHECKING(for libVGL support)
   970         video_vgl=no
   971         AC_TRY_COMPILE([
   972          #include <sys/fbio.h>
   973          #include <sys/consio.h>
   974          #include <sys/kbio.h>
   975          #include <vgl.h>
   976         ],[
   977          VGLBitmap bitmap;
   978          exit(bitmap.Bitmap);
   979         ],[
   980         video_vgl=yes
   981         ])
   982         AC_MSG_RESULT($video_vgl)
   983         if test x$video_vgl = xyes; then
   984             CFLAGS="$CFLAGS -DENABLE_VGL"
   985             SYSTEM_LIBS="$SYSTEM_LIBS -lvgl"
   986 
   987             VIDEO_SUBDIRS="$VIDEO_SUBDIRS vgl"
   988             VIDEO_DRIVERS="$VIDEO_DRIVERS vgl/libvideo_vgl.la"
   989         fi
   990     fi
   991 }
   992 
   993 dnl Find the AAlib includes
   994 CheckAAlib()
   995 {
   996     AC_ARG_ENABLE(video-aalib,
   997 [  --enable-video-aalib    use AAlib video driver [default=no]],
   998                   , enable_video_aalib=no)
   999     if test x$enable_video = xyes -a x$enable_video_aalib = xyes; then
  1000         AC_MSG_CHECKING(for AAlib support)
  1001         video_aalib=no
  1002         AC_TRY_COMPILE([
  1003          #include <aalib.h>
  1004         ],[
  1005         ],[
  1006         video_aalib=yes
  1007         ])
  1008         AC_MSG_RESULT($video_aalib)
  1009         if test x$video_aalib = xyes; then
  1010             CFLAGS="$CFLAGS -DENABLE_AALIB"
  1011             SYSTEM_LIBS="$SYSTEM_LIBS -laa"
  1012 
  1013             VIDEO_SUBDIRS="$VIDEO_SUBDIRS aalib"
  1014             VIDEO_DRIVERS="$VIDEO_DRIVERS aalib/libvideo_aa.la"
  1015         fi
  1016     fi
  1017 }
  1018 
  1019 dnl Set up the Atari Xbios driver
  1020 CheckAtariXbiosVideo()
  1021 {
  1022     AC_ARG_ENABLE(xbios,
  1023 [  --enable-video-xbios    use Atari Xbios video driver [default=yes]],
  1024                   , enable_video_xbios=yes)
  1025     video_xbios=no
  1026     if test x$enable_video = xyes -a x$enable_video_xbios = xyes; then
  1027         video_xbios=yes
  1028         CFLAGS="$CFLAGS -DENABLE_XBIOS"
  1029         VIDEO_SUBDIRS="$VIDEO_SUBDIRS xbios"
  1030         VIDEO_DRIVERS="$VIDEO_DRIVERS xbios/libvideo_xbios.la"
  1031     fi
  1032 }
  1033 
  1034 dnl Set up the Atari Gem driver
  1035 CheckAtariGemVideo()
  1036 {
  1037     AC_ARG_ENABLE(gem,
  1038 [  --enable-video-gem      use Atari Gem video driver [default=yes]],
  1039                   , enable_video_gem=yes)
  1040     if test x$enable_video = xyes -a x$enable_video_gem = xyes; then
  1041         video_gem=no
  1042         AC_CHECK_HEADER(gem.h, have_gem_hdr=yes)
  1043         AC_CHECK_LIB(gem, appl_init, have_gem_lib=yes)
  1044         if test x$have_gem_hdr = xyes -a x$have_gem_lib = xyes; then
  1045             video_gem=yes
  1046             CFLAGS="$CFLAGS -DENABLE_GEM"
  1047             SYSTEM_LIBS="$SYSTEM_LIBS -lgem"
  1048             VIDEO_SUBDIRS="$VIDEO_SUBDIRS gem"
  1049             VIDEO_DRIVERS="$VIDEO_DRIVERS gem/libvideo_gem.la"
  1050         fi
  1051     fi
  1052 }
  1053 
  1054 dnl Set up the Atari Bios keyboard driver
  1055 CheckAtariBiosEvent()
  1056 {
  1057     CFLAGS="$CFLAGS -I\$(top_srcdir)/src/video/ataricommon"
  1058     VIDEO_SUBDIRS="$VIDEO_SUBDIRS ataricommon"
  1059     VIDEO_DRIVERS="$VIDEO_DRIVERS ataricommon/libvideo_ataricommon.la"
  1060 }
  1061 
  1062 dnl rcg04172001 Set up the Null video driver.
  1063 CheckDummyVideo()
  1064 {
  1065     AC_ARG_ENABLE(video-dummy,
  1066 [  --enable-video-dummy    use dummy video driver [default=yes]],
  1067                   , enable_video_dummy=yes)
  1068     if test x$enable_video_dummy = xyes; then
  1069       CFLAGS="$CFLAGS -DENABLE_DUMMYVIDEO"
  1070       VIDEO_SUBDIRS="$VIDEO_SUBDIRS dummy"
  1071       VIDEO_DRIVERS="$VIDEO_DRIVERS dummy/libvideo_null.la"
  1072     fi
  1073 }
  1074 
  1075 dnl Check to see if OpenGL support is desired
  1076 AC_ARG_ENABLE(video-opengl,
  1077 [  --enable-video-opengl   include OpenGL context creation [default=yes]],
  1078               , enable_video_opengl=yes)
  1079 
  1080 dnl Find OpenGL
  1081 CheckOpenGL()
  1082 {
  1083     if test x$enable_video = xyes -a x$enable_video_opengl = xyes; then
  1084         AC_MSG_CHECKING(for OpenGL (GLX) support)
  1085         video_opengl=no
  1086         AC_TRY_COMPILE([
  1087          #include <GL/gl.h>
  1088          #include <GL/glx.h>
  1089          #include <dlfcn.h> /* For loading extensions */
  1090         ],[
  1091         ],[
  1092         video_opengl=yes
  1093         ])
  1094         AC_MSG_RESULT($video_opengl)
  1095         if test x$video_opengl = xyes; then
  1096             CFLAGS="$CFLAGS -DHAVE_OPENGL"
  1097             if test x$use_dlopen != xyes; then
  1098                 AC_CHECK_LIB(dl, dlopen, SYSTEM_LIBS="$SYSTEM_LIBS -ldl")
  1099             fi
  1100         fi
  1101     fi
  1102 }
  1103 
  1104 dnl Find QNX RtP OpenGL
  1105 CheckOpenGLQNX()
  1106 {
  1107     if test x$enable_video = xyes -a x$enable_video_opengl = xyes; then
  1108         AC_MSG_CHECKING(for OpenGL (Photon) support)
  1109         video_opengl=no
  1110         AC_TRY_COMPILE([
  1111          #include <GL/gl.h>
  1112         ],[
  1113         ],[
  1114         video_opengl=yes
  1115         ])
  1116         AC_MSG_RESULT($video_opengl)
  1117         if test x$video_opengl = xyes; then
  1118             CFLAGS="$CFLAGS -DHAVE_OPENGL"
  1119             SYSTEM_LIBS="$SYSTEM_LIBS -lGL"
  1120             if test x$use_dlopen != xyes; then
  1121                 AC_CHECK_LIB(c, dlopen, SYSTEM_LIBS="$SYSTEM_LIBS", AC_CHECK_LIB(ltdl, dlopen, SYSTEM_LIBS="$SYSTEM_LIBS -lltdl"))
  1122             fi
  1123         fi
  1124     fi
  1125 }
  1126 
  1127 dnl Check for BeOS OpenGL
  1128 CheckBeGL()
  1129 {
  1130     if test x$enable_video = xyes -a x$enable_video_opengl = xyes; then
  1131         CFLAGS="$CFLAGS -DHAVE_OPENGL"
  1132         SYSTEM_LIBS="$SYSTEM_LIBS -lGL"
  1133     fi
  1134 }
  1135 
  1136 dnl Check for MacOS OpenGL
  1137 CheckMacGL()
  1138 {
  1139     if test x$enable_video = xyes -a x$enable_video_opengl = xyes; then
  1140         CFLAGS="$CFLAGS -DHAVE_OPENGL"
  1141         case "$target" in
  1142             *-*-darwin*)
  1143                 SYSTEM_LIBS="$SYSTEM_LIBS -framework OpenGL"
  1144                 # The following is probably not available in Darwin:
  1145                 SYSTEM_LIBS="$SYSTEM_LIBS -framework AGL"
  1146         esac
  1147     fi
  1148 }
  1149 
  1150 dnl Check for Mesa offscreen rendering
  1151 CheckAtariOSMesa()
  1152 {
  1153     if test "x$enable_video" = "xyes" -a "x$enable_video_opengl" = "xyes"; then
  1154         AC_CHECK_HEADER(GL/osmesa.h, have_osmesa_hdr=yes)
  1155         AC_CHECK_LIB(OSMesa, OSMesaCreateContext, have_osmesa_lib=yes, have_osmesa_lib=no, -lm)
  1156 
  1157         # Static linking to -lOSMesa
  1158         AC_PATH_PROG(OSMESA_CONFIG, osmesa-config, no)
  1159         if test "x$OSMESA_CONFIG" = "xno" -o "x$enable_atari_ldg" = "xno"; then
  1160             # -lOSMesa is really the static library
  1161             if test "x$have_osmesa_hdr" = "xyes" -a "x$have_osmesa_lib" = "xyes"; then
  1162     	        CFLAGS="$CFLAGS -DHAVE_OPENGL"
  1163 		    	SYSTEM_LIBS="$SYSTEM_LIBS -lOSMesa"
  1164             fi
  1165         else
  1166             # -lOSMesa is a loader for OSMesa.ldg
  1167             OSMESA_CFLAGS=`$OSMESA_CONFIG --cflags`
  1168             OSMESA_LIBS=`$OSMESA_CONFIG --libs`
  1169             CFLAGS="$CFLAGS -DHAVE_OPENGL $OSMESA_CFLAGS"
  1170             SYSTEM_LIBS="$SYSTEM_LIBS $OSMESA_LIBS"
  1171         fi
  1172 
  1173         AC_ARG_ENABLE(osmesa-shared,
  1174 [  --enable-osmesa-shared  dynamically load OSMesa OpenGL support [default=yes]],
  1175                               , enable_osmesa_shared=yes)
  1176         if test "x$enable_osmesa_shared" = "xyes" -a "x$enable_atari_ldg" = "xyes"; then
  1177             # Dynamic linking
  1178             if test "x$have_osmesa_hdr" = "xyes"; then
  1179                 CFLAGS="$CFLAGS -DENABLE_OSMESA_SHARED"
  1180             fi
  1181 		fi
  1182     fi
  1183 }
  1184 
  1185 dnl See if we can use the new unified event interface in Linux 2.4
  1186 CheckInputEvents()
  1187 {
  1188     dnl Check for Linux 2.4 unified input event interface support
  1189     AC_ARG_ENABLE(input-events,
  1190 [  --enable-input-events   use Linux 2.4 unified input interface [default=yes]],
  1191                   , enable_input_events=yes)
  1192     if test x$enable_input_events = xyes; then
  1193         AC_MSG_CHECKING(for Linux 2.4 unified input interface)
  1194         use_input_events=no
  1195         AC_TRY_COMPILE([
  1196           #include <linux/input.h>
  1197         ],[
  1198           #ifndef EVIOCGNAME
  1199           #error EVIOCGNAME() ioctl not available
  1200           #endif
  1201         ],[
  1202         use_input_events=yes
  1203         ])
  1204         AC_MSG_RESULT($use_input_events)
  1205         if test x$use_input_events = xyes; then
  1206             CFLAGS="$CFLAGS -DUSE_INPUT_EVENTS"
  1207         fi
  1208     fi
  1209 }
  1210 
  1211 dnl See if we can use GNU pth library for threads
  1212 CheckPTH()
  1213 {
  1214     dnl Check for pth support
  1215     AC_ARG_ENABLE(pth,
  1216 [  --enable-pth            use GNU pth library for multi-threading [default=yes]],
  1217                   , enable_pth=yes)
  1218     if test x$enable_threads = xyes -a x$enable_pth = xyes; then
  1219         AC_PATH_PROG(PTH_CONFIG, pth-config, no)
  1220         if test "$PTH_CONFIG" = "no"; then
  1221             use_pth=no
  1222         else
  1223             PTH_CFLAGS=`$PTH_CONFIG --cflags`
  1224             PTH_LIBS=`$PTH_CONFIG --libs --all`
  1225             SDL_CFLAGS="$SDL_CFLAGS $PTH_CFLAGS"
  1226             SDL_LIBS="$SDL_LIBS $PTH_LIBS"
  1227             CFLAGS="$CFLAGS -DENABLE_PTH"
  1228             use_pth=yes
  1229         fi
  1230         AC_MSG_CHECKING(pth)
  1231         if test "x$use_pth" = xyes; then
  1232             AC_MSG_RESULT(yes)
  1233         else
  1234             AC_MSG_RESULT(no)
  1235         fi
  1236     fi
  1237 }
  1238 
  1239 dnl See what type of thread model to use on Linux and Solaris
  1240 CheckPTHREAD()
  1241 {
  1242     dnl Check for pthread support
  1243     AC_ARG_ENABLE(pthreads,
  1244 [  --enable-pthreads       use POSIX threads for multi-threading [default=yes]],
  1245                   , enable_pthreads=yes)
  1246     dnl This is used on Linux for glibc binary compatibility (Doh!)
  1247     AC_ARG_ENABLE(pthread-sem,
  1248 [  --enable-pthread-sem    use pthread semaphores [default=yes]],
  1249                   , enable_pthread_sem=yes)
  1250     case "$target" in
  1251         *-*-bsdi*)
  1252             pthread_cflags="-D_REENTRANT -D_THREAD_SAFE"
  1253             pthread_lib=""
  1254             ;;
  1255         *-*-darwin*)
  1256             pthread_cflags="-D_THREAD_SAFE"
  1257 # causes Carbon.p complaints?
  1258 #            pthread_cflags="-D_REENTRANT -D_THREAD_SAFE"
  1259             ;;
  1260         *-*-freebsd*)
  1261             pthread_cflags="-D_REENTRANT -D_THREAD_SAFE"
  1262             pthread_lib="-pthread"
  1263             ;;
  1264         *-*-netbsd*)
  1265             pthread_cflags="-I/usr/pkg/include -D_REENTRANT"
  1266             pthread_lib="-L/usr/pkg/lib -lpthread -lsem"
  1267             ;;
  1268         *-*-openbsd*)
  1269             pthread_cflags="-D_REENTRANT"
  1270             pthread_lib="-pthread"
  1271             ;;
  1272         *-*-solaris*)
  1273             pthread_cflags="-D_REENTRANT"
  1274             pthread_lib="-lpthread -lposix4"
  1275             ;;
  1276         *-*-sysv5*)
  1277             pthread_cflags="-D_REENTRANT -Kthread"
  1278             pthread_lib=""
  1279             ;;
  1280         *-*-irix*)
  1281             pthread_cflags="-D_SGI_MP_SOURCE"
  1282             pthread_lib="-lpthread"
  1283             ;;
  1284         *-*-aix*)
  1285             pthread_cflags="-D_REENTRANT -mthreads"
  1286             pthread_lib="-lpthread"
  1287             ;;
  1288         *-*-hpux11*)
  1289             pthread_cflags="-D_REENTRANT"
  1290             pthread_lib="-L/usr/lib -lpthread"
  1291             ;;
  1292         *-*-qnx*)
  1293             pthread_cflags=""
  1294             pthread_lib=""
  1295             ;;
  1296         *-*-osf*)
  1297             pthread_cflags="-D_REENTRANT"
  1298             if test x$ac_cv_prog_gcc = xyes; then
  1299                 pthread_lib="-lpthread -lrt"
  1300             else
  1301                 pthread_lib="-lpthread -lexc -lrt"
  1302             fi
  1303             ;;
  1304         *)
  1305             pthread_cflags="-D_REENTRANT"
  1306             pthread_lib="-lpthread"
  1307             ;;
  1308     esac
  1309     if test x$enable_threads = xyes -a x$enable_pthreads = xyes; then
  1310         # Save the original compiler flags and libraries
  1311         ac_save_cflags="$CFLAGS"; ac_save_libs="$LIBS"
  1312         # Add the pthread compiler flags and libraries
  1313         CFLAGS="$CFLAGS $pthread_cflags"; LIBS="$LIBS $pthread_lib"
  1314         # Check to see if we have pthread support on this system
  1315         AC_MSG_CHECKING(for pthreads)
  1316         use_pthreads=no
  1317         AC_TRY_LINK([
  1318          #include <pthread.h>
  1319         ],[
  1320          pthread_attr_t type;
  1321          pthread_attr_init(&type);
  1322         ],[
  1323         use_pthreads=yes
  1324         ])
  1325         AC_MSG_RESULT($use_pthreads)
  1326         # Restore the compiler flags and libraries
  1327         CFLAGS="$ac_save_cflags"; LIBS="$ac_save_libs"
  1328         # Do futher testing if we have pthread support...
  1329         if test x$use_pthreads = xyes; then
  1330             CFLAGS="$CFLAGS $pthread_cflags -DSDL_USE_PTHREADS"
  1331             LIBS="$LIBS $pthread_lib"
  1332             SDL_CFLAGS="$SDL_CFLAGS $pthread_cflags"
  1333             SDL_LIBS="$SDL_LIBS $pthread_lib"
  1334 
  1335             # Check to see if recursive mutexes are available
  1336             AC_MSG_CHECKING(for recursive mutexes)
  1337             has_recursive_mutexes=no
  1338             AC_TRY_LINK([
  1339               #include <pthread.h>
  1340             ],[
  1341               pthread_mutexattr_t attr;
  1342               #if defined(linux) && !(defined(__arm__) && defined(QWS))
  1343               pthread_mutexattr_setkind_np(&attr, PTHREAD_MUTEX_RECURSIVE_NP);
  1344               #else
  1345               pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
  1346               #endif
  1347             ],[
  1348             has_recursive_mutexes=yes
  1349             ])
  1350             # Some systems have broken recursive mutex implementations
  1351             case "$target" in
  1352                 *-*-darwin*)
  1353                     has_recursive_mutexes=no
  1354                     ;;
  1355                 *-*-solaris*)
  1356                     has_recursive_mutexes=no
  1357                     ;;
  1358             esac
  1359             AC_MSG_RESULT($has_recursive_mutexes)
  1360             if test x$has_recursive_mutexes != xyes; then
  1361                 CFLAGS="$CFLAGS -DPTHREAD_NO_RECURSIVE_MUTEX"
  1362             fi
  1363 
  1364             # Check to see if pthread semaphore support is missing
  1365             if test x$enable_pthread_sem = xyes; then
  1366                 AC_MSG_CHECKING(for pthread semaphores)
  1367                 have_pthread_sem=no
  1368                 AC_TRY_COMPILE([
  1369                   #include <pthread.h>
  1370                   #include <semaphore.h>
  1371                 ],[
  1372                 ],[
  1373                 have_pthread_sem=yes
  1374                 ])
  1375                 AC_MSG_RESULT($have_pthread_sem)
  1376             fi
  1377 
  1378             # Check to see if this is broken glibc 2.0 pthreads
  1379             case "$target" in
  1380                 *-*-linux*)
  1381                     AC_MSG_CHECKING(for broken glibc 2.0 pthreads)
  1382                     glibc20_pthreads=no
  1383                     AC_TRY_COMPILE([
  1384                       #include <features.h>
  1385                       #if (__GLIBC__ == 2) && (__GLIBC_MINOR__ == 0)
  1386                       #warning Working around a bug in glibc 2.0 pthreads
  1387                       #else
  1388                       #error pthread implementation okay
  1389                       #endif /* glibc 2.0 */
  1390                     ],[
  1391                     ],[
  1392                     glibc20_pthreads=yes
  1393                     ])
  1394                     AC_MSG_RESULT($glibc20_pthreads)
  1395             esac
  1396         fi
  1397     fi
  1398 
  1399     AC_MSG_CHECKING(whether semun is defined in /usr/include/sys/sem.h)
  1400     have_semun=no
  1401     AC_TRY_COMPILE([
  1402       #include <sys/types.h>
  1403       #include <sys/sem.h>
  1404     ],[
  1405       union semun t;
  1406     ],[
  1407     have_semun=yes
  1408     ])
  1409     AC_MSG_RESULT($have_semun)
  1410     if test x$have_semun = xyes; then
  1411         CFLAGS="$CFLAGS -DHAVE_SEMUN"
  1412     fi
  1413 
  1414     # See if we can use GNU Pth or clone() on Linux directly
  1415     if test x$enable_threads = xyes -a x$use_pthreads != xyes; then
  1416         CheckPTH
  1417         if test x$use_pth != xyes; then
  1418             case "$target" in
  1419                 *-*-linux*)
  1420                     use_clone=yes
  1421                     ;;
  1422             esac
  1423         fi
  1424     fi
  1425 }
  1426 
  1427 # Note that we need to have either semaphores or to have mutexes and
  1428 # condition variables to implement all thread synchronization primitives
  1429 CopyUnixThreadSource()
  1430 {
  1431     if test x$use_pthreads = xyes -o x$use_clone = xyes; then
  1432         # Basic thread creation functions
  1433         COPY_ARCH_SRC(src/thread, linux, SDL_systhread.c)
  1434         COPY_ARCH_SRC(src/thread, linux, SDL_systhread_c.h)
  1435 
  1436         # Semaphores
  1437         # We can fake these with mutexes and condition variables if necessary
  1438         if test x$use_pthreads = xyes -a x$have_pthread_sem != xyes; then
  1439             COPY_ARCH_SRC(src/thread, generic, SDL_syssem.c)
  1440         else
  1441             COPY_ARCH_SRC(src/thread, linux, SDL_syssem.c)
  1442         fi
  1443         COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
  1444 
  1445         # Mutexes
  1446         # We can fake these with semaphores if necessary
  1447         case "$target" in
  1448             *-*-bsdi*)
  1449                 COPY_ARCH_SRC(src/thread, bsdi, SDL_syssem.c)
  1450                 COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
  1451                 COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex.c)
  1452                 COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex_c.h)
  1453                 ;;
  1454             *)
  1455                 if test x$glibc20_pthreads = xyes; then
  1456                     COPY_ARCH_SRC(src/thread, generic, SDL_sysmutex.c)
  1457                     COPY_ARCH_SRC(src/thread, generic, SDL_sysmutex_c.h)
  1458                 else
  1459                     COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex.c)
  1460                     COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex_c.h)
  1461                 fi
  1462                 ;;
  1463         esac
  1464 
  1465         # Condition variables
  1466         # We can fake these with semaphores and mutexes if necessary
  1467         if test x$glibc20_pthreads = xyes -o x$has_recursive_mutexes != xyes; then
  1468             COPY_ARCH_SRC(src/thread, generic, SDL_syscond.c)
  1469         else
  1470             COPY_ARCH_SRC(src/thread, linux, SDL_syscond.c)
  1471         fi
  1472         COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
  1473 
  1474     elif test x$use_pth = xyes; then
  1475         COPY_ARCH_SRC(src/thread, pth, SDL_systhread.c)
  1476         COPY_ARCH_SRC(src/thread, pth, SDL_systhread_c.h)
  1477         COPY_ARCH_SRC(src/thread, pth, SDL_sysmutex.c)
  1478         COPY_ARCH_SRC(src/thread, pth, SDL_sysmutex_c.h)
  1479         COPY_ARCH_SRC(src/thread, pth, SDL_syscond.c)
  1480         COPY_ARCH_SRC(src/thread, pth, SDL_syscond_c.h)
  1481         COPY_ARCH_SRC(src/thread, generic, SDL_syssem.c)
  1482         COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
  1483     else
  1484        AC_MSG_ERROR([
  1485 *** No thread support detected
  1486        ])
  1487     fi
  1488 }
  1489 
  1490 dnl See if we can use sigaction() instead of signal()
  1491 CheckSIGACTION()
  1492 {
  1493     dnl Check for sigaction support
  1494     AC_ARG_ENABLE(sigaction,
  1495 [  --enable-sigaction      use sigaction instead of signal [default=yes]],
  1496                   , enable_sigaction=yes)
  1497     if test x$enable_sigaction = xyes; then
  1498         AC_MSG_CHECKING(sigaction)
  1499         have_sigaction=no
  1500         AC_TRY_COMPILE([
  1501          #include <signal.h>
  1502         ],[
  1503          struct sigaction junk;
  1504          sigaction(0, &junk, &junk);
  1505         ],[
  1506         have_sigaction=yes
  1507         ])
  1508         AC_MSG_RESULT($have_sigaction)
  1509         if test x$have_sigaction = xyes; then
  1510             CFLAGS="$CFLAGS -DHAVE_SIGACTION"
  1511         fi
  1512     fi
  1513 }
  1514 
  1515 dnl Determine whether the compiler can produce Win32 executables
  1516 CheckWIN32()
  1517 {
  1518     AC_MSG_CHECKING(Win32 compiler)
  1519     have_win32_gcc=no
  1520     AC_TRY_COMPILE([
  1521      #include <windows.h>
  1522     ],[
  1523     ],[
  1524     have_win32_gcc=yes
  1525     ])
  1526     AC_MSG_RESULT($have_win32_gcc)
  1527     if test x$have_win32_gcc != xyes; then
  1528        AC_MSG_ERROR([
  1529 *** Your compiler ($CC) does not produce Win32 executables!
  1530        ])
  1531     fi
  1532 
  1533     dnl See if the user wants to redirect standard output to files
  1534     AC_ARG_ENABLE(stdio-redirect,
  1535 [  --enable-stdio-redirect Redirect STDIO to files on Win32 [default=yes]],
  1536                   , enable_stdio_redirect=yes)
  1537     if test x$enable_stdio_redirect != xyes; then
  1538         CFLAGS="$CFLAGS -DNO_STDIO_REDIRECT"
  1539     fi
  1540 }
  1541 
  1542 dnl Find the DirectX includes and libraries
  1543 CheckDIRECTX()
  1544 {
  1545     AC_ARG_ENABLE(directx,
  1546 [  --enable-directx        use DirectX for Win32 audio/video [default=yes]],
  1547                   , enable_directx=yes)
  1548     if test x$enable_directx = xyes; then
  1549         AC_MSG_CHECKING(for DirectX headers and libraries)
  1550         use_directx=no
  1551         tmp_cflags=$CFLAGS
  1552         CFLAGS="$CFLAGS -I$srcdir"
  1553         AC_TRY_COMPILE([
  1554          #include "src/video/windx5/directx.h"
  1555         ],[
  1556         ],[
  1557         use_directx=yes
  1558         ])
  1559         CFLAGS=$tmp_cflags
  1560         AC_MSG_RESULT($use_directx)
  1561     fi
  1562 
  1563     CFLAGS="$CFLAGS -I\$(top_srcdir)/src/video/wincommon"
  1564     SYSTEM_LIBS="$SYSTEM_LIBS -luser32 -lgdi32 -lwinmm"
  1565     VIDEO_SUBDIRS="$VIDEO_SUBDIRS wincommon"
  1566     VIDEO_DRIVERS="$VIDEO_DRIVERS wincommon/libvideo_wincommon.la"
  1567     # Enable the DIB driver
  1568     CFLAGS="$CFLAGS -DENABLE_WINDIB"
  1569     VIDEO_SUBDIRS="$VIDEO_SUBDIRS windib"
  1570     VIDEO_DRIVERS="$VIDEO_DRIVERS windib/libvideo_windib.la"
  1571     # See if we should enable the DirectX driver
  1572     if test x$use_directx = xyes; then
  1573         CFLAGS="$CFLAGS -DENABLE_DIRECTX"
  1574         SYSTEM_LIBS="$SYSTEM_LIBS -ldxguid"
  1575         VIDEO_SUBDIRS="$VIDEO_SUBDIRS windx5"
  1576         VIDEO_DRIVERS="$VIDEO_DRIVERS windx5/libvideo_windx5.la"
  1577     fi
  1578 }
  1579 
  1580 dnl Set up the BWindow video driver on BeOS
  1581 CheckBWINDOW()
  1582 {
  1583     CFLAGS="$CFLAGS -DENABLE_BWINDOW"
  1584     VIDEO_SUBDIRS="$VIDEO_SUBDIRS bwindow"
  1585     VIDEO_DRIVERS="$VIDEO_DRIVERS bwindow/libvideo_bwindow.la"
  1586 }
  1587 
  1588 dnl Set up the QTopia video driver if enabled
  1589 CheckQtopia()
  1590 {
  1591     AC_ARG_ENABLE(video-qtopia,
  1592 [  --enable-video-qtopia   use Qtopia video driver [default=no]],
  1593                   , enable_video_qtopia=no)
  1594     if test x$enable_video = xyes -a x$enable_video_qtopia = xyes; then
  1595         AC_MSG_CHECKING(for Qtopia support)
  1596         video_qtopia=no
  1597         AC_LANG_CPLUSPLUS
  1598         OLD_CXX="$CXXFLAGS"
  1599         CXXFLAGS="-DQT_QWS_EBX -fno-rtti -fno-exceptions -DQT_QWS_CUSTOM -DQWS -I${QPEDIR}/include -I${QTDIR}/include/ -DNO_DEBUG"
  1600         AC_TRY_COMPILE([
  1601          #include <qpe/qpeapplication.h>
  1602         ],[
  1603         ],[
  1604         video_qtopia=yes
  1605         ])
  1606         CXXFLAGS="$OLD_CXX"
  1607         AC_MSG_RESULT($video_qtopia)
  1608         if test x$video_qtopia = xyes; then
  1609             CFLAGS="$CFLAGS -DENABLE_QTOPIA -DQT_QWS_EBX -DQT_QWS_CUSTOM -DQWS -I${QPEDIR}/include -I${QTDIR}/include/ -DNO_DEBUG -fno-rtti -fno-exceptions"
  1610             SDL_LIBS="$SDL_LIBS -L${QPEDIR}/lib -L${QTDIR}/lib/ -lqpe -lqte"
  1611             SDL_CFLAGS="$SDL_CFLAGS -DQWS"	  
  1612             VIDEO_SUBDIRS="$VIDEO_SUBDIRS qtopia"
  1613             VIDEO_DRIVERS="$VIDEO_DRIVERS qtopia/libvideo_qtopia.la"
  1614         else
  1615 	AC_MSG_ERROR([
  1616 *** Failed to find Qtopia includes. Make sure that the QTDIR and QPEDIR
  1617 *** environment variables are set correctly.])
  1618         fi
  1619         AC_LANG_C
  1620     fi
  1621 }
  1622 
  1623 dnl Set up the PicoGUI video driver if enabled
  1624 CheckPicoGUI()
  1625 {
  1626     AC_ARG_ENABLE(video-picogui,
  1627 [  --enable-video-picogui  use PicoGUI video driver [default=no]],
  1628                   , enable_video_picogui=no)
  1629     if test x$enable_video = xyes -a x$enable_video_picogui = xyes; then
  1630         AC_MSG_CHECKING(for PicoGUI support)
  1631         video_picogui=no
  1632         AC_TRY_COMPILE([
  1633          #include <picogui.h>
  1634         ],[
  1635         ],[
  1636         video_picogui=yes
  1637         ])
  1638         AC_MSG_RESULT($video_picogui)
  1639         if test x$video_picogui = xyes; then
  1640 	    SDL_LIBS="$SDL_LIBS -lpgui"
  1641             CFLAGS="$CFLAGS -DENABLE_PICOGUI"
  1642             VIDEO_SUBDIRS="$VIDEO_SUBDIRS picogui"
  1643             VIDEO_DRIVERS="$VIDEO_DRIVERS picogui/libvideo_picogui.la"
  1644         fi
  1645         AC_LANG_C
  1646     fi
  1647 }
  1648 
  1649 dnl Set up the Mac toolbox video driver for Mac OS 7-9
  1650 CheckTOOLBOX()
  1651 {
  1652     CFLAGS="$CFLAGS -DENABLE_TOOLBOX -DENABLE_DRAWSPROCKET"
  1653     VIDEO_SUBDIRS="$VIDEO_SUBDIRS maccommon"
  1654     VIDEO_DRIVERS="$VIDEO_DRIVERS maccommon/libvideo_maccommon.la"
  1655     VIDEO_SUBDIRS="$VIDEO_SUBDIRS macrom"
  1656     VIDEO_DRIVERS="$VIDEO_DRIVERS macrom/libvideo_macrom.la"
  1657     VIDEO_SUBDIRS="$VIDEO_SUBDIRS macdsp"
  1658     VIDEO_DRIVERS="$VIDEO_DRIVERS macdsp/libvideo_macdsp.la"
  1659 }
  1660 
  1661 dnl Set up the Carbon/QuickDraw video driver for Mac OS X (but not Darwin)
  1662 CheckCARBON()
  1663 {
  1664     AC_ARG_ENABLE(video-carbon,
  1665 [  --enable-video-carbon   use Carbon/QuickDraw video driver [default=no]],
  1666                   , enable_video_carbon=no)
  1667   if test x$enable_video = xyes -a x$enable_video_carbon = xyes; then
  1668     AC_MSG_CHECKING(for Carbon framework)
  1669     have_carbon=no
  1670     if test x$have_carbon != xyes; then
  1671         AC_TRY_COMPILE([
  1672           #include <Carbon/Carbon.h>
  1673         ],[
  1674         ],[
  1675         have_carbon=yes
  1676         ])
  1677     fi
  1678     AC_MSG_RESULT($have_carbon)
  1679     if test x$have_carbon = xyes; then
  1680     # "MACOSX" is not an official definition, but it's commonly
  1681     # accepted as a way to differentiate between what runs on X
  1682     # and what runs on older Macs - while in theory "Carbon" defns
  1683     # are consistent between the two, in practice Carbon is still
  1684     # changing. -sts Aug 2000
  1685     mac_autoconf_target_workaround="MAC"
  1686     CFLAGS="$CFLAGS -I/System/Library/Frameworks/Carbon.framework/Headers \
  1687       -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"
  1688     VIDEO_SUBDIRS="$VIDEO_SUBDIRS maccommon"
  1689     VIDEO_DRIVERS="$VIDEO_DRIVERS maccommon/libvideo_maccommon.la"
  1690     VIDEO_SUBDIRS="$VIDEO_SUBDIRS macrom"
  1691     VIDEO_DRIVERS="$VIDEO_DRIVERS macrom/libvideo_macrom.la"
  1692     #VIDEO_SUBDIRS="$VIDEO_SUBDIRS macdsp"
  1693     #VIDEO_DRIVERS="$VIDEO_DRIVERS macdsp/libvideo_macdsp.la"
  1694     fi
  1695   fi
  1696 }
  1697 
  1698 dnl Set up the Cocoa/Quartz video driver for Mac OS X (but not Darwin)
  1699 CheckCOCOA()
  1700 {
  1701     AC_ARG_ENABLE(video-cocoa,
  1702 [  --enable-video-cocoa    use Cocoa/Quartz video driver [default=yes]],
  1703                   , enable_video_cocoa=yes)
  1704   if test x$enable_video = xyes -a x$enable_video_cocoa = xyes; then
  1705     old_CFLAGS="$CFLAGS"
  1706     dnl work around that we don't have Objective-C support in autoconf
  1707     CFLAGS="$CFLAGS -x objective-c"
  1708     AC_MSG_CHECKING(for Cocoa framework)
  1709     have_cocoa=no
  1710     if test x$have_cocoa != xyes; then
  1711         AC_TRY_COMPILE([
  1712           #import <Cocoa/Cocoa.h>
  1713         ],[
  1714         ],[
  1715         have_cocoa=yes
  1716         ])
  1717     fi
  1718     AC_MSG_RESULT($have_cocoa)
  1719     CFLAGS="$old_CFLAGS"
  1720     if test x$have_cocoa = xyes; then
  1721     # "MACOSX" is not an official definition, but it's commonly
  1722     # accepted as a way to differentiate between what runs on X
  1723     # and what runs on older Macs - while in theory "Carbon" defns
  1724     # are consistent between the two, in practice Carbon is still
  1725     # changing. -sts Aug 2000
  1726     mac_autoconf_target_workaround="MAC"
  1727     CFLAGS="$CFLAGS -I/System/Library/Frameworks/Carbon.framework/Headers \
  1728       -I/System/Library/Frameworks/Cocoa.framework/Headers -fpascal-strings \
  1729       -DENABLE_QUARTZ -DMACOSX -DTARGET_API_${mac_autoconf_target_workaround}_CARBON=1 -I\$(top_srcdir)/src/video/quartz"
  1730     VIDEO_SUBDIRS="$VIDEO_SUBDIRS quartz"
  1731     VIDEO_DRIVERS="$VIDEO_DRIVERS quartz/libvideo_quartz.la"
  1732     fi
  1733   fi
  1734 }
  1735 
  1736 dnl Check for the dlfcn.h interface for dynamically loading objects
  1737 CheckDLOPEN()
  1738 {
  1739     AC_ARG_ENABLE(sdl-dlopen,
  1740 [  --enable-sdl-dlopen     use dlopen for shared object loading [default=yes]],
  1741                   , enable_sdl_dlopen=yes)
  1742     if test x$enable_sdl_dlopen = xyes; then
  1743         AC_MSG_CHECKING(for dlopen)
  1744         use_dlopen=no
  1745         AC_TRY_COMPILE([
  1746          #include <dlfcn.h>
  1747         ],[
  1748         ],[
  1749         use_dlopen=yes
  1750         ])
  1751         AC_MSG_RESULT($use_dlopen)
  1752 
  1753         if test x$use_dlopen = xyes; then
  1754             CFLAGS="$CFLAGS -DUSE_DLOPEN"
  1755             AC_CHECK_LIB(c, dlopen, SYSTEM_LIBS="$SYSTEM_LIBS",
  1756                AC_CHECK_LIB(dl, dlopen, SYSTEM_LIBS="$SYSTEM_LIBS -ldl",
  1757                   AC_CHECK_LIB(ltdl, dlopen, SYSTEM_LIBS="$SYSTEM_LIBS -lltdl")))
  1758         fi
  1759     fi
  1760 }
  1761 
  1762 dnl Set up the Atari LDG (shared object loader)
  1763 CheckAtariLdg()
  1764 {
  1765     AC_ARG_ENABLE(atari-ldg,
  1766 [  --enable-atari-ldg      use Atari LDG for shared object loading [default=yes]],
  1767                   , enable_atari_ldg=yes)
  1768     if test x$video_gem = xyes -a x$enable_atari_ldg = xyes; then
  1769         AC_CHECK_HEADER(ldg.h, have_ldg_hdr=yes)
  1770         AC_CHECK_LIB(ldg, ldg_open, have_ldg_lib=yes, have_ldg_lib=no, -lgem)
  1771         if test x$have_ldg_hdr = xyes -a x$have_ldg_lib = xyes; then
  1772             CFLAGS="$CFLAGS -DENABLE_LDG"
  1773             SYSTEM_LIBS="$SYSTEM_LIBS -lldg -lgem"
  1774         fi
  1775     fi
  1776 }
  1777 
  1778 dnl Check for the usbhid(3) library on *BSD
  1779 CheckUSBHID()
  1780 {
  1781     if test x$enable_joystick = xyes; then
  1782         have_libusbhid=no
  1783         have_libusb=no
  1784         AC_CHECK_LIB(usbhid, hid_init, have_libusbhid=yes)
  1785         AC_CHECK_LIB(usb, hid_init, have_libusb=yes)
  1786         if test x$have_libusbhid = xyes; then
  1787             SYSTEM_LIBS="$SYSTEM_LIBS -lusbhid"
  1788         fi
  1789         if test x$have_libusb = xyes; then
  1790             SYSTEM_LIBS="$SYSTEM_LIBS -lusb"
  1791         fi
  1792 
  1793         AC_CHECK_HEADER(usb.h, have_usb_h=yes)
  1794         AC_CHECK_HEADER(usbhid.h, have_usbhid_h=yes)
  1795         AC_CHECK_HEADER(libusb.h, have_libusb_h=yes)
  1796         AC_CHECK_HEADER(libusbhid.h, have_libusbhid_h=yes)
  1797         if test x$have_usb_h = xyes; then
  1798             CFLAGS="$CFLAGS -DHAVE_USB_H"
  1799         fi
  1800         if test x$have_usbhid_h = xyes; then
  1801             CFLAGS="$CFLAGS -DHAVE_USBHID_H"
  1802         fi
  1803         if test x$have_libusb_h = xyes; then
  1804             CFLAGS="$CFLAGS -DHAVE_LIBUSB_H"
  1805         fi
  1806         if test x$have_libusbhid_h = xyes; then
  1807             CFLAGS="$CFLAGS -DHAVE_LIBUSBHID_H"
  1808         fi
  1809 
  1810         AC_MSG_CHECKING(for usbhid)
  1811         have_usbhid=no
  1812         AC_TRY_COMPILE([
  1813           #include <sys/types.h>
  1814           #if defined(HAVE_USB_H)
  1815           #include <usb.h>
  1816           #endif
  1817           #include <dev/usb/usb.h>
  1818           #include <dev/usb/usbhid.h>
  1819           #if defined(HAVE_USBHID_H)
  1820           #include <usbhid.h>
  1821           #elif defined(HAVE_LIBUSB_H)
  1822           #include <libusb.h>
  1823           #elif defined(HAVE_LIBUSBHID_H)
  1824           #include <libusbhid.h>
  1825           #endif
  1826         ],[
  1827           struct report_desc *repdesc;
  1828           struct usb_ctl_report *repbuf;
  1829           hid_kind_t hidkind;
  1830         ],[
  1831         have_usbhid=yes
  1832         ])
  1833         AC_MSG_RESULT($have_usbhid)
  1834 
  1835         if test x$have_usbhid = xyes; then
  1836             AC_MSG_CHECKING(for ucr_data member of usb_ctl_report)
  1837             have_usbhid_ucr_data=no
  1838             AC_TRY_COMPILE([
  1839               #include <sys/types.h>
  1840               #if defined(HAVE_USB_H)
  1841               #include <usb.h>
  1842               #endif
  1843               #include <dev/usb/usb.h>
  1844               #include <dev/usb/usbhid.h>
  1845               #if defined(HAVE_USBHID_H)
  1846               #include <usbhid.h>
  1847               #elif defined(HAVE_LIBUSB_H)
  1848               #include <libusb.h>
  1849               #elif defined(HAVE_LIBUSBHID_H)
  1850               #include <libusbhid.h>
  1851               #endif
  1852             ],[
  1853               struct usb_ctl_report buf;
  1854               if (buf.ucr_data) { }
  1855             ],[
  1856             have_usbhid_ucr_data=yes
  1857             ])
  1858             if test x$have_usbhid_ucr_data = xyes; then
  1859                 CFLAGS="$CFLAGS -DUSBHID_UCR_DATA"
  1860             fi
  1861             AC_MSG_RESULT($have_usbhid_ucr_data)
  1862             
  1863 	    AC_MSG_CHECKING(for new usbhid API)
  1864             have_usbhid_new=no
  1865             AC_TRY_COMPILE([
  1866               #include <sys/types.h>
  1867               #if defined(HAVE_USB_H)
  1868               #include <usb.h>
  1869               #endif
  1870               #include <dev/usb/usb.h>
  1871               #include <dev/usb/usbhid.h>
  1872               #if defined(HAVE_USBHID_H)
  1873               #include <usbhid.h>
  1874               #elif defined(HAVE_LIBUSB_H)
  1875               #include <libusb.h>
  1876               #elif defined(HAVE_LIBUSBHID_H)
  1877               #include <libusbhid.h>
  1878               #endif
  1879             ],[
  1880               report_desc_t d;
  1881 	      hid_start_parse(d, 1, 1);
  1882             ],[
  1883             have_usbhid_new=yes
  1884             ])
  1885             if test x$have_usbhid_new = xyes; then
  1886                 CFLAGS="$CFLAGS -DUSBHID_NEW"
  1887             fi
  1888             AC_MSG_RESULT($have_usbhid_new)
  1889 
  1890             JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS bsd"
  1891             JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS bsd/libjoystick_bsd.la"
  1892         fi
  1893     fi
  1894 }
  1895 
  1896 dnl Check for altivec instruction support using gas syntax
  1897 CheckAltivec()
  1898 {
  1899     AC_MSG_CHECKING(for GCC Altivec instruction support)
  1900     have_gcc_altivec=no
  1901     save_CFLAGS="${CFLAGS}"
  1902     CFLAGS="${CFLAGS} -DGCC_ALTIVEC -DUSE_ALTIVEC_BLITTERS -faltivec"
  1903     AC_TRY_COMPILE([
  1904     vector unsigned int vzero() {
  1905         return vec_splat_u32(0);
  1906     }
  1907     ],[
  1908     ],[
  1909     have_gcc_altivec=yes
  1910     ])
  1911     if test x$have_gcc_altivec = xno; then
  1912         CFLAGS="${save_CFLAGS}"
  1913     fi
  1914     AC_MSG_RESULT($have_gcc_altivec)
  1915 }
  1916 
  1917 dnl Check for a valid linux/version.h
  1918 CheckLinuxVersion()
  1919 {
  1920     AC_CHECK_HEADER(linux/version.h, have_linux_version_h=yes)
  1921     if test x$have_linux_version_h = xyes; then
  1922         CFLAGS="$CFLAGS -DHAVE_LINUX_VERSION_H"
  1923     fi
  1924 }
  1925 
  1926 dnl Check if we want to use RPATH
  1927 CheckRPATH()
  1928 {
  1929     AC_ARG_ENABLE(rpath,
  1930 [  --enable-rpath          use an rpath when linking SDL [default=yes]],
  1931                   , enable_rpath=yes)
  1932 }
  1933 
  1934 case "$target" in
  1935     *-*-linux*|*-*-gnu*|*-*-k*bsd*-gnu)
  1936         case "$target" in
  1937           *-*-linux*) ARCH=linux ;;
  1938           *-*-kfreebsd*-gnu) ARCH=kfreebsd-gnu ;;
  1939           *-*-knetbsd*-gnu) ARCH=knetbsd-gnu ;;
  1940           *-*-kopenbsd*-gnu) ARCH=kopenbsd-gnu ;;
  1941           *-*-gnu*) ARCH=gnu ;; # must be last
  1942         esac
  1943         CheckDummyVideo
  1944         CheckDiskAudio
  1945         CheckDLOPEN
  1946         CheckNASM
  1947         CheckOSS
  1948         CheckALSA
  1949         CheckARTSC
  1950         CheckESD
  1951         CheckNAS
  1952         CheckX11
  1953         CheckNANOX
  1954         CheckDGA
  1955         CheckFBCON
  1956         CheckDirectFB
  1957         CheckPS2GS
  1958         CheckGGI
  1959         CheckSVGA
  1960         CheckAAlib
  1961         CheckQtopia
  1962         CheckPicoGUI
  1963         CheckOpenGL
  1964         CheckInputEvents
  1965         CheckPTHREAD
  1966         CheckSIGACTION
  1967         CheckAltivec
  1968         CheckLinuxVersion
  1969         CheckRPATH
  1970 
  1971         # Set up files for the main() stub
  1972         if test "x$video_qtopia" = "xyes"; then
  1973           SDL_CFLAGS="$SDL_CFLAGS -Dmain=SDL_main"
  1974           SDL_LIBS="-lSDLmain $SDL_LIBS"
  1975         fi
  1976         # Set up files for the audio library
  1977         # We use the OSS and ALSA API's, not the Sun audio API
  1978         #if test x$enable_audio = xyes; then
  1979         #    CFLAGS="$CFLAGS -DSUNAUDIO_SUPPORT"
  1980         #    AUDIO_SUBDIRS="$AUDIO_SUBDIRS sun"
  1981         #    AUDIO_DRIVERS="$AUDIO_DRIVERS sun/libaudio_sun.la"
  1982         #fi
  1983         # Set up files for the joystick library
  1984         if test x$enable_joystick = xyes; then
  1985 	  case $ARCH in
  1986 	    linux)
  1987               JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS linux"
  1988               JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS linux/libjoystick_linux.la"
  1989 	    ;;
  1990 	    gnu)
  1991               JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS dummy"
  1992               JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS dummy/libjoystick_dummy.la"
  1993 	    ;;
  1994 	    k*bsd-gnu)
  1995               JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS bsd"
  1996               JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS bsd/libjoystick_bsd.la"
  1997 	    ;;
  1998 	  esac
  1999         fi
  2000         # Set up files for the cdrom library
  2001         if test x$enable_cdrom = xyes; then
  2002 	  case $ARCH in
  2003 	    linux)
  2004               CDROM_SUBDIRS="$CDROM_SUBDIRS linux"
  2005               CDROM_DRIVERS="$CDROM_DRIVERS linux/libcdrom_linux.la"
  2006 	    ;;
  2007 	    gnu)
  2008               CDROM_SUBDIRS="$CDROM_SUBDIRS dummy"
  2009               CDROM_DRIVERS="$CDROM_DRIVERS dummy/libcdrom_dummy.la"
  2010 	    ;;
  2011 	    kfreebsd-gnu)
  2012               CDROM_SUBDIRS="$CDROM_SUBDIRS freebsd"
  2013               CDROM_DRIVERS="$CDROM_DRIVERS freebsd/libcdrom_freebsd.la"
  2014 	    ;;
  2015 	    knetbsd-gnu|kopenbsd-gnu)
  2016               CDROM_SUBDIRS="$CDROM_SUBDIRS openbsd"
  2017               CDROM_DRIVERS="$CDROM_DRIVERS openbsd/libcdrom_openbsd.la"
  2018 	    ;;
  2019 	  esac
  2020         fi
  2021         # Set up files for the thread library
  2022         if test x$enable_threads = xyes; then
  2023             CopyUnixThreadSource
  2024         fi
  2025         # Set up files for the timer library
  2026         if test x$enable_timers = xyes; then
  2027             COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
  2028         fi
  2029         ;;
  2030     *-*-bsdi*)
  2031         ARCH=bsdi
  2032         CheckDummyVideo
  2033         CheckDiskAudio
  2034         CheckDLOPEN
  2035         CheckNASM
  2036         CheckOSS
  2037         CheckARTSC
  2038         CheckESD
  2039         CheckNAS
  2040         CheckX11
  2041         CheckDGA
  2042         CheckSVGA
  2043         CheckAAlib
  2044         CheckOpenGL
  2045         CheckPTHREAD
  2046         CheckSIGACTION
  2047         CheckRPATH
  2048         # Set up files for the audio library
  2049         # We use the OSS and ALSA API's, not the Sun audio API
  2050         #if test x$enable_audio = xyes; then
  2051         #    CFLAGS="$CFLAGS -DSUNAUDIO_SUPPORT"
  2052         #    AUDIO_SUBDIRS="$AUDIO_SUBDIRS sun"
  2053         #    AUDIO_DRIVERS="$AUDIO_DRIVERS sun/libaudio_sun.la"
  2054         #fi
  2055         # Set up files for the joystick library
  2056         # (No joystick support yet)
  2057         if test x$enable_joystick = xyes; then
  2058             JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS dummy"
  2059             JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS dummy/libjoystick_dummy.la"
  2060         fi
  2061         # Set up files for the cdrom library
  2062         if test x$enable_cdrom = xyes; then
  2063             CDROM_SUBDIRS="$CDROM_SUBDIRS bsdi"
  2064             CDROM_DRIVERS="$CDROM_DRIVERS bsdi/libcdrom_bsdi.la"
  2065         fi
  2066         # Set up files for the thread library
  2067         if test x$enable_threads = xyes; then
  2068             CopyUnixThreadSource
  2069         fi
  2070         # Set up files for the timer library
  2071         if test x$enable_timers = xyes; then
  2072             COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
  2073         fi
  2074         ;;
  2075     *-*-freebsd*)
  2076         ARCH=freebsd
  2077         CheckDummyVideo
  2078         CheckDiskAudio
  2079         CheckDLOPEN
  2080         CheckVGL
  2081         CheckNASM
  2082         CheckOSS
  2083         CheckARTSC
  2084         CheckESD
  2085         CheckNAS
  2086         CheckX11
  2087         CheckDGA
  2088         CheckSVGA
  2089         CheckAAlib
  2090         CheckOpenGL
  2091         CheckPTHREAD
  2092         CheckSIGACTION
  2093         CheckUSBHID
  2094         CheckRPATH
  2095         # Set up files for the audio library
  2096         # We use the OSS and ALSA API's, not the Sun audio API
  2097         #if test x$enable_audio = xyes; then
  2098         #    CFLAGS="$CFLAGS -DSUNAUDIO_SUPPORT"
  2099         #    AUDIO_SUBDIRS="$AUDIO_SUBDIRS sun"
  2100         #    AUDIO_DRIVERS="$AUDIO_DRIVERS sun/libaudio_sun.la"
  2101         #fi
  2102         # Set up files for the cdrom library
  2103         if test x$enable_cdrom = xyes; then
  2104             CDROM_SUBDIRS="$CDROM_SUBDIRS freebsd"
  2105             CDROM_DRIVERS="$CDROM_DRIVERS freebsd/libcdrom_freebsd.la"
  2106         fi
  2107         # Set up files for the thread library
  2108         if test x$enable_threads = xyes; then
  2109             CopyUnixThreadSource
  2110         fi
  2111         # Set up files for the timer library
  2112         if test x$enable_timers = xyes; then
  2113             COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
  2114         fi
  2115         ;;
  2116     *-*-netbsd*)
  2117         ARCH=netbsd
  2118         CheckDummyVideo
  2119         CheckDiskAudio
  2120         CheckDLOPEN
  2121         CheckNASM
  2122         CheckOSS
  2123         CheckARTSC
  2124         CheckESD
  2125         CheckNAS
  2126         CheckX11
  2127         CheckAAlib
  2128         CheckOpenGL
  2129         CheckPTHREAD
  2130         CheckSIGACTION
  2131         CheckUSBHID
  2132         CheckRPATH
  2133         # Set up files for the audio library
  2134         if test x$enable_audio = xyes; then
  2135             CFLAGS="$CFLAGS -DSUNAUDIO_SUPPORT"
  2136             AUDIO_SUBDIRS="$AUDIO_SUBDIRS sun"
  2137             AUDIO_DRIVERS="$AUDIO_DRIVERS sun/libaudio_sun.la"
  2138         fi
  2139         # Set up files for the cdrom library
  2140         if test x$enable_cdrom = xyes; then
  2141             CDROM_SUBDIRS="$CDROM_SUBDIRS openbsd"
  2142             CDROM_DRIVERS="$CDROM_DRIVERS openbsd/libcdrom_openbsd.la"
  2143         fi
  2144         # Set up files for the thread library
  2145         if test x$enable_threads = xyes; then
  2146             if test x$use_pthreads = xyes; then
  2147                 CFLAGS="$CFLAGS -D_POSIX_THREAD_SYSCALL_SOFT=1"
  2148             fi
  2149             CopyUnixThreadSource
  2150         fi
  2151         # Set up files for the timer library
  2152         if test x$enable_timers = xyes; then
  2153             COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
  2154         fi
  2155         # NetBSD does not define "unix"
  2156         CFLAGS="$CFLAGS -Dunix"
  2157         ;;
  2158     *-*-openbsd*)
  2159         ARCH=openbsd
  2160         CheckDummyVideo
  2161         CheckDiskAudio
  2162         CheckDLOPEN
  2163         CheckNASM
  2164         CheckOSS
  2165         CheckARTSC
  2166         CheckESD
  2167         CheckNAS
  2168         CheckX11
  2169         CheckAAlib
  2170         CheckOpenGL
  2171         CheckPTHREAD
  2172         CheckSIGACTION
  2173         CheckUSBHID
  2174         CheckRPATH
  2175         # Set up files for the audio library
  2176         if test x$enable_audio = xyes; then
  2177             CFLAGS="$CFLAGS -DOPENBSD_AUDIO_SUPPORT"
  2178             AUDIO_SUBDIRS="$AUDIO_SUBDIRS openbsd"
  2179             AUDIO_DRIVERS="$AUDIO_DRIVERS openbsd/libaudio_openbsd.la"
  2180         fi
  2181         # OpenBSD needs linking with ossaudio emulation library
  2182         if test x$have_oss = xyes; then
  2183             SYSTEM_LIBS="$SYSTEM_LIBS -lossaudio"
  2184         fi
  2185         # Set up files for the cdrom library
  2186         if test x$enable_cdrom = xyes; then
  2187             CDROM_SUBDIRS="$CDROM_SUBDIRS openbsd"
  2188             CDROM_DRIVERS="$CDROM_DRIVERS openbsd/libcdrom_openbsd.la"
  2189         fi
  2190         # Set up files for the thread library
  2191         if test x$enable_threads = xyes; then
  2192             CopyUnixThreadSource
  2193         fi
  2194         # Set up files for the timer library
  2195         if test x$enable_timers = xyes; then
  2196             COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
  2197         fi
  2198         # OpenBSD does not define "unix"
  2199         CFLAGS="$CFLAGS -Dunix"
  2200         ;;
  2201     *-*-sysv5*)
  2202         ARCH=sysv5
  2203         CheckDummyVideo
  2204         CheckDiskAudio
  2205         CheckDLOPEN
  2206         CheckNASM
  2207         CheckOSS
  2208         CheckARTSC
  2209         CheckESD
  2210         CheckNAS
  2211         CheckX11
  2212         CheckAAlib
  2213         CheckOpenGL
  2214         CheckPTHREAD
  2215         CheckSIGACTION
  2216         CheckRPATH
  2217         # Set up files for the audio library
  2218         if test x$enable_audio = xyes; then
  2219             CFLAGS="$CFLAGS -DSUNAUDIO_SUPPORT"
  2220             AUDIO_SUBDIRS="$AUDIO_SUBDIRS sun"
  2221             AUDIO_DRIVERS="$AUDIO_DRIVERS sun/libaudio_sun.la"
  2222         fi
  2223         # Set up files for the joystick library
  2224         # (No joystick support yet)
  2225         if test x$enable_joystick = xyes; then
  2226             JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS dummy"
  2227             JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS dummy/libjoystick_dummy.la"
  2228         fi
  2229         # Set up files for the cdrom library
  2230         if test x$enable_cdrom = xyes; then
  2231             CDROM_SUBDIRS="$CDROM_SUBDIRS dummy"
  2232             CDROM_DRIVERS="$CDROM_DRIVERS dummy/libcdrom_dummy.la"
  2233         fi
  2234         # Set up files for the thread library
  2235         if test x$enable_threads = xyes; then
  2236             CopyUnixThreadSource
  2237         fi
  2238         # Set up files for the timer library
  2239         if test x$enable_timers = xyes; then
  2240             COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
  2241         fi
  2242         ;;
  2243     *-*-solaris*)
  2244         ARCH=solaris
  2245         CFLAGS="$CFLAGS -D__ELF__" # Fix for nasm on Solaris x86
  2246         CheckDummyVideo
  2247         CheckDiskAudio
  2248         CheckDLOPEN
  2249         CheckNASM
  2250         CheckOSS
  2251         CheckARTSC
  2252         CheckESD
  2253         CheckNAS
  2254         CheckX11
  2255         CheckAAlib
  2256         CheckOpenGL
  2257         CheckPTHREAD
  2258         CheckSIGACTION
  2259         CheckRPATH
  2260         # Set up files for the audio library
  2261         if test x$enable_audio = xyes; then
  2262             CFLAGS="$CFLAGS -DSUNAUDIO_SUPPORT"
  2263             AUDIO_SUBDIRS="$AUDIO_SUBDIRS sun"
  2264             AUDIO_DRIVERS="$AUDIO_DRIVERS sun/libaudio_sun.la"
  2265         fi
  2266         # Set up files for the joystick library
  2267         # (No joystick support yet)
  2268         if test x$enable_joystick = xyes; then
  2269             JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS dummy"
  2270             JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS dummy/libjoystick_dummy.la"
  2271         fi
  2272         # Set up files for the cdrom library
  2273         if test x$enable_cdrom = xyes; then
  2274             CDROM_SUBDIRS="$CDROM_SUBDIRS linux"
  2275             CDROM_DRIVERS="$CDROM_DRIVERS linux/libcdrom_linux.la"
  2276         fi
  2277         # Set up files for the thread library
  2278         if test x$enable_threads = xyes; then
  2279             CopyUnixThreadSource
  2280         fi
  2281         # Set up files for the timer library
  2282         if test x$enable_timers = xyes; then
  2283             COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
  2284         fi
  2285         ;;
  2286     *-*-irix*)
  2287         ARCH=irix
  2288         CheckDummyVideo
  2289         CheckDiskAudio
  2290         CheckDLOPEN
  2291         CheckDMEDIA
  2292         CheckESD
  2293         CheckNAS
  2294         CheckX11
  2295         CheckAAlib
  2296         CheckOpenGL
  2297         CheckPTHREAD
  2298         CheckSIGACTION
  2299         # We use the dmedia audio API, not the Sun audio API
  2300         #if test x$enable_audio = xyes; then
  2301         #    CFLAGS="$CFLAGS -DSUNAUDIO_SUPPORT"
  2302         #    AUDIO_SUBDIRS="$AUDIO_SUBDIRS sun"
  2303         #    AUDIO_DRIVERS="$AUDIO_DRIVERS sun/libaudio_sun.la"
  2304         #fi
  2305         # Set up files for the joystick library
  2306         # (No joystick support yet)
  2307         if test x$enable_joystick = xyes; then
  2308             JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS dummy"
  2309             JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS dummy/libjoystick_dummy.la"
  2310         fi
  2311         # Set up files for the cdrom library
  2312         # (No CD-ROM support yet)
  2313         if test x$enable_cdrom = xyes; then
  2314             CDROM_SUBDIRS="$CDROM_SUBDIRS dummy"
  2315             CDROM_DRIVERS="$CDROM_DRIVERS dummy/libcdrom_dummy.la"
  2316         fi
  2317         # Set up files for the thread library
  2318         if test x$enable_threads = xyes; then
  2319             if test x$use_pthreads = xyes -o x$use_pth = xyes; then
  2320                 CopyUnixThreadSource
  2321             else
  2322                 COPY_ARCH_SRC(src/thread, irix, SDL_systhread.c)
  2323                 COPY_ARCH_SRC(src/thread, irix, SDL_systhread_c.h)
  2324                 COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex.c)
  2325                 COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex_c.h)
  2326                 COPY_ARCH_SRC(src/thread, linux, SDL_syssem.c)
  2327                 COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
  2328                 COPY_ARCH_SRC(src/thread, generic, SDL_syscond.c)
  2329                 COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
  2330             fi
  2331         fi
  2332         # Set up files for the timer library
  2333         if test x$enable_timers = xyes; then
  2334             COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
  2335         fi
  2336         ;;
  2337     *-*-hpux*)
  2338         ARCH=hpux
  2339         CheckDummyVideo
  2340         CheckDiskAudio
  2341         CheckDLOPEN
  2342         CheckOSS
  2343         CheckNAS
  2344         CheckX11
  2345         CheckGGI
  2346         CheckAAlib
  2347         CheckOpenGL
  2348         CheckPTHREAD
  2349         CheckSIGACTION
  2350         # Set up files for the audio library
  2351         if test x$enable_audio = xyes; then
  2352             CFLAGS="$CFLAGS -DSUNAUDIO_SUPPORT"
  2353             AUDIO_SUBDIRS="$AUDIO_SUBDIRS sun"
  2354             AUDIO_DRIVERS="$AUDIO_DRIVERS sun/libaudio_sun.la"
  2355         fi
  2356         # Set up files for the joystick library
  2357         # (No joystick support yet)
  2358         if test x$enable_joystick = xyes; then
  2359             JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS dummy"
  2360             JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS dummy/libjoystick_dummy.la"
  2361         fi
  2362         # Set up files for the cdrom library
  2363         # (No CD-ROM support yet)
  2364         if test x$enable_cdrom = xyes; then
  2365             CDROM_SUBDIRS="$CDROM_SUBDIRS dummy"
  2366             CDROM_DRIVERS="$CDROM_DRIVERS dummy/libcdrom_dummy.la"
  2367         fi
  2368         # Set up files for the thread library
  2369         if test x$enable_threads = xyes; then
  2370             CopyUnixThreadSource
  2371         fi
  2372         # Set up files for the timer library
  2373         if test x$enable_timers = xyes; then
  2374             COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
  2375         fi
  2376         ;;
  2377     *-*-aix*)
  2378         ARCH=aix
  2379         CheckDummyVideo
  2380         CheckDiskAudio
  2381         CheckDLOPEN
  2382         CheckOSS
  2383         CheckNAS
  2384         CheckX11
  2385         CheckGGI
  2386         CheckAAlib
  2387         CheckOpenGL
  2388         CheckPTHREAD
  2389         CheckSIGACTION
  2390         # Set up files for the audio library
  2391         if test x$enable_audio = xyes; then
  2392             AUDIO_SUBDIRS="$AUDIO_SUBDIRS paudio"
  2393             AUDIO_DRIVERS="$AUDIO_DRIVERS paudio/libaudio_paudio.la"
  2394         fi
  2395         # Set up files for the joystick library
  2396         # (No joystick support yet)
  2397         if test x$enable_joystick = xyes; then
  2398             JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS dummy"
  2399             JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS dummy/libjoystick_dummy.la"
  2400         fi
  2401         # Set up files for the cdrom library
  2402         if test x$enable_cdrom = xyes; then
  2403             CDROM_SUBDIRS="$CDROM_SUBDIRS aix"
  2404             CDROM_DRIVERS="$CDROM_DRIVERS aix/libcdrom_aix.la"
  2405         fi
  2406         # Set up files for the thread library
  2407         if test x$enable_threads = xyes; then
  2408             CopyUnixThreadSource
  2409         fi
  2410         # Set up files for the timer library
  2411         if test x$enable_timers = xyes; then
  2412             COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
  2413         fi
  2414         ;;
  2415     *-*-osf*)
  2416         ARCH=osf
  2417         CheckDummyVideo
  2418         CheckDiskAudio
  2419         CheckDLOPEN
  2420         CheckNAS
  2421         CheckX11
  2422         CheckGGI
  2423         CheckAAlib
  2424         CheckOpenGL
  2425         CheckPTHREAD
  2426         CheckSIGACTION
  2427         # Set up files for the audio library
  2428         if test x$enable_audio = xyes; then
  2429             CFLAGS="$CFLAGS -I/usr/include/mme -DMMEAUDIO_SUPPORT"
  2430             SYSTEM_LIBS="$SYSTEM_LIBS -lmme"
  2431             AUDIO_SUBDIRS="$AUDIO_SUBDIRS mme"
  2432             AUDIO_DRIVERS="$AUDIO_DRIVERS mme/libaudio_mme.la"
  2433         fi
  2434         # Set up files for the joystick library
  2435         # (No joystick support yet)
  2436         if test x$enable_joystick = xyes; then
  2437             JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS dummy"
  2438             JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS dummy/libjoystick_dummy.la"
  2439         fi
  2440         # Set up files for the cdrom library
  2441         # (No cdrom support yet)
  2442         if test x$enable_cdrom = xyes; then
  2443             CDROM_SUBDIRS="$CDROM_SUBDIRS osf"
  2444             CDROM_DRIVERS="$CDROM_DRIVERS osf/libcdrom_osf.la"
  2445         fi
  2446         # Set up files for the thread library
  2447         if test x$enable_threads = xyes; then
  2448             CopyUnixThreadSource
  2449         fi
  2450         # Set up files for the timer library
  2451         if test x$enable_timers = xyes; then
  2452             COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
  2453         fi
  2454         ;;
  2455     *-*-qnx*)
  2456         ARCH=qnx
  2457         CheckDummyVideo
  2458         CheckDiskAudio
  2459         # CheckNASM
  2460         CheckDLOPEN
  2461         CheckNAS
  2462         CheckPHOTON
  2463         CheckX11
  2464         CheckOpenGL
  2465         CheckPTHREAD
  2466         CheckSIGACTION
  2467         # Set up files for the audio library
  2468         if test x$enable_audio = xyes; then
  2469             CFLAGS="$CFLAGS -DQNXNTOAUDIO_SUPPORT"
  2470             SYSTEM_LIBS="$SYSTEM_LIBS -lasound"
  2471             AUDIO_SUBDIRS="$AUDIO_SUBDIRS nto"
  2472             AUDIO_DRIVERS="$AUDIO_DRIVERS nto/libaudio_nto.la"
  2473         fi
  2474         # Set up files for the joystick library
  2475         if test x$enable_joystick = xyes; then
  2476         # (No joystick support yet)
  2477             JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS dummy"
  2478             JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS dummy/libjoystick_dummy.la"
  2479         fi
  2480         # Set up files for the cdrom library
  2481         if test x$enable_cdrom = xyes; then
  2482             CDROM_SUBDIRS="$CDROM_SUBDIRS qnx"
  2483             CDROM_DRIVERS="$CDROM_DRIVERS qnx/libcdrom_qnx.la"
  2484         fi
  2485         # Set up files for the thread library
  2486         if test x$enable_threads = xyes; then
  2487             CopyUnixThreadSource
  2488         fi
  2489         # Set up files for the timer library
  2490         if test x$enable_timers = xyes; then
  2491             COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
  2492         fi
  2493         ;;
  2494     *-*-cygwin* | *-*-mingw32*)
  2495         ARCH=win32
  2496         if test "$build" != "$target"; then # cross-compiling
  2497             # Default cross-compile location
  2498             ac_default_prefix=/usr/local/cross-tools/i386-mingw32msvc
  2499         else
  2500             # Look for the location of the tools and install there
  2501             if test "$BUILD_PREFIX" != ""; then
  2502                 ac_default_prefix=$BUILD_PREFIX
  2503             fi
  2504         fi
  2505         CheckDummyVideo
  2506         CheckDiskAudio
  2507         CheckWIN32
  2508         CheckDIRECTX
  2509         CheckNASM
  2510         # Set up files for the audio library
  2511         if test x$enable_audio = xyes; then
  2512             AUDIO_SUBDIRS="$AUDIO_SUBDIRS windib"
  2513             AUDIO_DRIVERS="$AUDIO_DRIVERS windib/libaudio_windib.la"
  2514             if test x$use_directx = xyes; then
  2515                 AUDIO_SUBDIRS="$AUDIO_SUBDIRS windx5"
  2516                 AUDIO_DRIVERS="$AUDIO_DRIVERS windx5/libaudio_windx5.la"
  2517             fi
  2518         fi
  2519         # Set up files for the joystick library
  2520         if test x$enable_joystick = xyes; then
  2521             JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS win32"
  2522             JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS win32/libjoystick_winmm.la"
  2523         fi
  2524         # Set up files for the cdrom library
  2525         if test x$enable_cdrom = xyes; then
  2526             CDROM_SUBDIRS="$CDROM_SUBDIRS win32"
  2527             CDROM_DRIVERS="$CDROM_DRIVERS win32/libcdrom_win32.la"
  2528         fi
  2529         # Set up files for the thread library
  2530         if test x$enable_threads = xyes; then
  2531             COPY_ARCH_SRC(src/thread, win32, SDL_systhread.c)
  2532             COPY_ARCH_SRC(src/thread, win32, SDL_systhread_c.h)
  2533             COPY_ARCH_SRC(src/thread, win32, SDL_sysmutex.c)
  2534             COPY_ARCH_SRC(src/thread, generic, SDL_sysmutex_c.h)
  2535             COPY_ARCH_SRC(src/thread, win32, SDL_syssem.c)
  2536             COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
  2537             COPY_ARCH_SRC(src/thread, generic, SDL_syscond.c)
  2538             COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
  2539         fi
  2540         # Set up files for the timer library
  2541         if test x$enable_timers = xyes; then
  2542             COPY_ARCH_SRC(src/timer, win32, SDL_systimer.c)
  2543         fi
  2544         # The Win32 platform requires special setup
  2545         SDL_CFLAGS="$SDL_CFLAGS -Dmain=SDL_main"
  2546         case "$target" in
  2547             *-*-cygwin*)
  2548                 CFLAGS="$CFLAGS -I/usr/include/mingw -DWIN32 -Uunix -mno-cygwin"
  2549                 SDL_CFLAGS="$SDL_CFLAGS -I/usr/include/mingw -DWIN32 -Uunix -mno-cygwin"
  2550                 LIBS="$LIBS -mno-cygwin"
  2551                 SDL_LIBS="-lmingw32 -lSDLmain $SDL_LIBS -mwindows -mno-cygwin"
  2552                 ;;
  2553             *-*-mingw32*)
  2554                 SDL_LIBS="-lmingw32 -lSDLmain $SDL_LIBS -mwindows"
  2555                 ;;
  2556         esac
  2557         ;;
  2558     *-*-beos*)
  2559         ARCH=beos
  2560         ac_default_prefix=/boot/develop/tools/gnupro
  2561         CheckDummyVideo
  2562         CheckDiskAudio
  2563         CheckNASM
  2564         CheckBWINDOW
  2565         CheckBeGL
  2566         # Set up files for the audio library
  2567         if test x$enable_audio = xyes; then
  2568             AUDIO_SUBDIRS="$AUDIO_SUBDIRS baudio"
  2569             AUDIO_DRIVERS="$AUDIO_DRIVERS baudio/libaudio_baudio.la"
  2570         fi
  2571         # Set up files for the joystick library
  2572         if test x$enable_joystick = xyes; then
  2573             JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS beos"
  2574             JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS beos/libjoystick_beos.la"
  2575         fi
  2576         # Set up files for the cdrom library
  2577         if test x$enable_cdrom = xyes; then
  2578             CDROM_SUBDIRS="$CDROM_SUBDIRS beos"
  2579             CDROM_DRIVERS="$CDROM_DRIVERS beos/libcdrom_beos.la"
  2580         fi
  2581         # Set up files for the thread library
  2582         if test x$enable_threads = xyes; then
  2583             COPY_ARCH_SRC(src/thread, beos, SDL_systhread.c)
  2584             COPY_ARCH_SRC(src/thread, beos, SDL_systhread_c.h)
  2585             COPY_ARCH_SRC(src/thread, generic, SDL_sysmutex.c)
  2586             COPY_ARCH_SRC(src/thread, generic, SDL_sysmutex_c.h)
  2587             COPY_ARCH_SRC(src/thread, beos, SDL_syssem.c)
  2588             COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
  2589             COPY_ARCH_SRC(src/thread, generic, SDL_syscond.c)
  2590             COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
  2591         fi
  2592         # Set up files for the timer library
  2593         if test x$enable_timers = xyes; then
  2594             COPY_ARCH_SRC(src/timer, beos, SDL_systimer.c)
  2595         fi
  2596         # The BeOS platform requires special libraries
  2597         SYSTEM_LIBS="$SYSTEM_LIBS -lroot -lbe -lmedia -lgame -ldevice -ltextencoding"
  2598         ;;
  2599     *-*-macos*)
  2600         # This would be used if cross-compiling to MacOS 9.  No way to
  2601         # use it at present, but Apple is working on a X-to-9 compiler
  2602         # for which this case would be handy.
  2603         ARCH=macos
  2604         CheckDummyVideo
  2605         CheckDiskAudio
  2606         CheckTOOLBOX
  2607         CheckMacGL
  2608         # Set up files for the audio library
  2609         if test x$enable_audio = xyes; then
  2610             AUDIO_SUBDIRS="$AUDIO_SUBDIRS macrom"
  2611             AUDIO_DRIVERS="$AUDIO_DRIVERS macrom/libaudio_macrom.la"
  2612         fi
  2613         # Set up files for the joystick library
  2614         if test x$enable_joystick = xyes; then
  2615             JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS macos"
  2616             JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS macos/libjoystick_macos.la"
  2617         fi
  2618         # Set up files for the cdrom library
  2619         if test x$enable_cdrom = xyes; then
  2620             CDROM_SUBDIRS="$CDROM_SUBDIRS macos"
  2621             CDROM_DRIVERS="$CDROM_DRIVERS macos/libcdrom_macos.la"
  2622         fi
  2623         # Set up files for the thread library
  2624         if test x$enable_threads = xyes; then
  2625             COPY_ARCH_SRC(src/thread, macos, SDL_systhread.c)
  2626             COPY_ARCH_SRC(src/thread, macos, SDL_systhread_c.h)
  2627             COPY_ARCH_SRC(src/thread, generic, SDL_sysmutex.c)
  2628             COPY_ARCH_SRC(src/thread, generic, SDL_sysmutex_c.h)
  2629             COPY_ARCH_SRC(src/thread, macos, SDL_syssem.c)
  2630             COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
  2631             COPY_ARCH_SRC(src/thread, generic, SDL_syscond.c)
  2632             COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
  2633         fi
  2634         # Set up files for the timer library
  2635         if test x$enable_timers = xyes; then
  2636             COPY_ARCH_SRC(src/timer, macos, SDL_systimer.c)
  2637         fi
  2638         # The MacOS platform requires special setup
  2639         SDL_CFLAGS="$SDL_CFLAGS -Dmain=SDL_main"
  2640         SDL_LIBS="-lSDLmain $SDL_LIBS"
  2641         ;;
  2642     *-*-darwin* )
  2643         # This could be either full "Mac OS X", or plain "Darwin" which is
  2644         # just the OS X kernel sans upper layers like Carbon and Cocoa.
  2645         # Next line is broken, and a few files below require Mac OS X (full)
  2646         ARCH=macosx
  2647         CheckDummyVideo
  2648         CheckDiskAudio
  2649         CheckCOCOA
  2650         CheckCARBON
  2651         CheckMacX11
  2652         CheckMacGL
  2653         CheckPTHREAD
  2654         CheckSIGACTION
  2655         CheckAltivec
  2656         # If either the audio or CD driver is used, add the AudioUnit framework
  2657         if test x$enable_audio = xyes -o x$enable_cdrom = xyes; then
  2658             SYSTEM_LIBS="$SYSTEM_LIBS -framework AudioToolbox -framework AudioUnit"
  2659         fi
  2660         # Set up files for the audio library
  2661         if test x$enable_audio = xyes; then
  2662             AUDIO_SUBDIRS="$AUDIO_SUBDIRS macosx"
  2663             AUDIO_DRIVERS="$AUDIO_DRIVERS macosx/libaudio_macosx.la"
  2664             AUDIO_SUBDIRS="$AUDIO_SUBDIRS macrom"
  2665             AUDIO_DRIVERS="$AUDIO_DRIVERS macrom/libaudio_macrom.la"
  2666         fi
  2667         # Set up files for the joystick library
  2668         if test x$enable_joystick = xyes; then
  2669             JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS darwin"
  2670             JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS darwin/libjoystick_darwin.la"
  2671             SYSTEM_LIBS="$SYSTEM_LIBS -framework IOKit"
  2672         fi
  2673         # Set up files for the cdrom library
  2674         if test x$enable_cdrom = xyes; then
  2675             CDROM_SUBDIRS="$CDROM_SUBDIRS macosx"
  2676             CDROM_DRIVERS="$CDROM_DRIVERS macosx/libcdrom_macosx.la"
  2677             SYSTEM_LIBS="$SYSTEM_LIBS -lstdc++"
  2678         fi
  2679         # Set up files for the thread library
  2680         if test x$enable_threads = xyes; then
  2681             CopyUnixThreadSource
  2682         fi
  2683         # Set up files for the timer library
  2684         if test x$enable_timers = xyes; then
  2685             COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
  2686         fi
  2687         # The MacOS X platform requires special setup.
  2688         SDL_LIBS="-lSDLmain $SDL_LIBS"
  2689         if test x$enable_video_cocoa = xyes; then
  2690             SYSTEM_LIBS="$SYSTEM_LIBS -framework Cocoa"
  2691         fi
  2692         if test x$enable_video_carbon = xyes -o x$enable_video_cocoa = xyes; then
  2693             # The Cocoa backend still needs Carbon, and the YUV code QuickTime
  2694             SYSTEM_LIBS="$SYSTEM_LIBS -framework Carbon -framework QuickTime"
  2695         fi
  2696         #if test x$enable_video_carbon = xyes; then
  2697         #    SYSTEM_LIBS="$SYSTEM_LIBS -framework DrawSprocket"
  2698         #fi
  2699         ;;
  2700     *-*-mint*)
  2701         ARCH=mint
  2702         CheckDummyVideo
  2703         CheckDiskAudio
  2704         CheckAtariBiosEvent
  2705         CheckAtariXbiosVideo
  2706         CheckAtariGemVideo
  2707         CheckAtariAudio
  2708         CheckAtariLdg
  2709 		CheckAtariOSMesa
  2710         CheckPTH
  2711         # Set up files for the audio library
  2712         if test x$enable_threads = xyes -a x$enable_pth = xyes; then
  2713             if test x$enable_audio = xyes; then
  2714                 CFLAGS="$CFLAGS -DSUNAUDIO_SUPPORT"
  2715                 AUDIO_SUBDIRS="$AUDIO_SUBDIRS sun"
  2716                 AUDIO_DRIVERS="$AUDIO_DRIVERS sun/libaudio_sun.la"
  2717             fi
  2718         fi
  2719         # Set up files for the joystick library
  2720         if test x$enable_joystick = xyes; then
  2721             JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS mint"
  2722             JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS mint/libjoystick_mint.la"
  2723         fi
  2724         # Set up files for the cdrom library
  2725         if test x$enable_cdrom = xyes; then
  2726             CDROM_SUBDIRS="$CDROM_SUBDIRS mint"
  2727             CDROM_DRIVERS="$CDROM_DRIVERS mint/libcdrom_mint.la"
  2728         fi
  2729         # Set up files for the thread library
  2730         if test x$enable_threads = xyes; then
  2731             CopyUnixThreadSource
  2732         fi
  2733         # Set up files for the timer library
  2734         if test x$enable_timers = xyes; then
  2735             if test x$enable_threads = xyes -a x$enable_pth = xyes; then
  2736                 COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
  2737             else
  2738                 COPY_ARCH_SRC(src/timer, mint, SDL_systimer.c)
  2739             fi
  2740         fi
  2741         # MiNT does not define "unix"
  2742         CFLAGS="$CFLAGS -Dunix"
  2743         ;;
  2744     *-riscos)
  2745         ARCH=riscos
  2746         # Set up files for the video library
  2747         if test x$enable_video = xyes; then
  2748             VIDEO_SUBDIRS="$VIDEO_SUBDIRS riscos"
  2749             VIDEO_DRIVERS="$VIDEO_DRIVERS riscos/libvideo_riscos.la"
  2750         fi
  2751         # Set up files for the audio library
  2752         if test x$enable_audio = xyes; then
  2753             CFLAGS="$CFLAGS -DOSS_SUPPORT"
  2754             AUDIO_SUBDIRS="$AUDIO_SUBDIRS dsp"
  2755             AUDIO_DRIVERS="$AUDIO_DRIVERS dsp/libaudio_dsp.la"
  2756             AUDIO_SUBDIRS="$AUDIO_SUBDIRS dma"
  2757             AUDIO_DRIVERS="$AUDIO_DRIVERS dma/libaudio_dma.la"
  2758         fi
  2759         # Set up files for the joystick library
  2760         if test x$enable_joystick = xyes; then
  2761             JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS riscos"
  2762             JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS riscos/libjoystick_riscos.la"
  2763         fi
  2764         # Set up files for the cdrom library
  2765         if test x$enable_cdrom = xyes; then
  2766             CDROM_SUBDIRS="$CDROM_SUBDIRS dummy"
  2767             CDROM_DRIVERS="$CDROM_DRIVERS dummy/libcdrom_dummy.la"
  2768         fi
  2769         # Set up files for the thread library
  2770         if test x$enable_threads = xyes; then
  2771             COPY_ARCH_SRC(src/thread, riscos, SDL_systhread.c)
  2772             COPY_ARCH_SRC(src/thread, riscos, SDL_systhread_c.h)
  2773             COPY_ARCH_SRC(src/thread, riscos, SDL_sysmutex.c)
  2774             COPY_ARCH_SRC(src/thread, riscos, SDL_sysmutex_c.h)
  2775             COPY_ARCH_SRC(src/thread, riscos, SDL_syssem.c)
  2776             COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
  2777             COPY_ARCH_SRC(src/thread, riscos, SDL_syscond.c)
  2778             COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
  2779         else
  2780             CFLAGS="$CFLAGS -DDISABLE_THREADS"
  2781         fi
  2782         # Set up files for the timer library
  2783         if test x$enable_timers = xyes; then
  2784             COPY_ARCH_SRC(src/timer, riscos, SDL_systimer.c)
  2785         fi
  2786 
  2787         CFLAGS="$CFLAGS -DENABLE_RISCOS"
  2788 
  2789         SYSTEM_LIBS="$SYSTEM_LIBS -ljpeg -ltiff -lpng -lz"
  2790         ;;
  2791     *)
  2792         AC_MSG_ERROR(Unsupported target:  Please add to configure.in)
  2793         ;;
  2794 esac
  2795 AC_SUBST(ARCH)
  2796 
  2797 # Set the conditional variables for this target
  2798 AM_CONDITIONAL(TARGET_LINUX, test $ARCH = linux)
  2799 AM_CONDITIONAL(TARGET_QTOPIA, test "x$video_qtopia" = "xyes")
  2800 AM_CONDITIONAL(TARGET_SOLARIS, test $ARCH = solaris)
  2801 AM_CONDITIONAL(TARGET_IRIX, test $ARCH = irix)
  2802 AM_CONDITIONAL(TARGET_BSDI, test $ARCH = bsdi)
  2803 AM_CONDITIONAL(TARGET_FREEBSD, test $ARCH = freebsd)
  2804 AM_CONDITIONAL(TARGET_NETBSD, test $ARCH = netbsd)
  2805 AM_CONDITIONAL(TARGET_OPENBSD, test $ARCH = openbsd)
  2806 AM_CONDITIONAL(TARGET_AIX, test $ARCH = aix)
  2807 AM_CONDITIONAL(TARGET_WIN32, test $ARCH = win32)
  2808 AM_CONDITIONAL(TARGET_BEOS, test $ARCH = beos)
  2809 AM_CONDITIONAL(TARGET_MACOS, test $ARCH = macos)
  2810 AM_CONDITIONAL(TARGET_MACOSX, test $ARCH = macosx)
  2811 AM_CONDITIONAL(TARGET_QNX, test $ARCH = qnx)
  2812 AM_CONDITIONAL(TARGET_MINT, test $ARCH = mint)
  2813 
  2814 # More automake conditionals
  2815 AM_CONDITIONAL(USE_DIRECTX, test x$use_directx = xyes)
  2816 AM_CONDITIONAL(USE_CLONE, test x$use_clone = xyes)
  2817 AM_CONDITIONAL(HAVE_NASM, test x$use_nasm = xyes)
  2818 AM_CONDITIONAL(USE_COCOA, test x$enable_video_cocoa = xyes)
  2819 AM_CONDITIONAL(USE_CARBON, test x$enable_video_carbon = xyes)
  2820 
  2821 # Set conditional variables for shared and static library selection.
  2822 # These are not used in any Makefile.am but in sdl-config.in.
  2823 AM_CONDITIONAL([ENABLE_SHARED], [test "$enable_shared" = yes])
  2824 AM_CONDITIONAL([ENABLE_STATIC], [test "$enable_static" = yes])
  2825 
  2826 # Set runtime shared library paths as needed
  2827 
  2828 if test "x$enable_rpath" = "xyes"; then
  2829   if test $ARCH = linux -o $ARCH = freebsd -o $ARCH = bsdi; then
  2830     SDL_RLD_FLAGS="-Wl,-rpath,\${exec_prefix}/lib"
  2831   fi
  2832   if test $ARCH = solaris; then
  2833     SDL_RLD_FLAGS="-R\${exec_prefix}/lib"
  2834   fi
  2835 else
  2836   SDL_RLD_FLAGS=""
  2837 fi
  2838 
  2839 case "$ARCH" in
  2840   openbsd | netbsd | bsdi)
  2841     SHARED_SYSTEM_LIBS="$SYSTEM_LIBS"
  2842     ;;
  2843   qnx)
  2844     SHARED_SYSTEM_LIBS="$SYSTEM_LIBS"
  2845     ;;
  2846   macosx)
  2847     SHARED_SYSTEM_LIBS=""
  2848     if test x$enable_video = xyes -a x$enable_video_cocoa = xyes; then
  2849       SHARED_SYSTEM_LIBS="$SHARED_SYSTEM_LIBS -framework Cocoa"
  2850     fi
  2851     if test x$enable_video = xyes -a x$enable_video_carbon = xyes; then
  2852       SHARED_SYSTEM_LIBS="$SHARED_SYSTEM_LIBS -framework Carbon"
  2853     fi
  2854     if test x$enable_video = xyes -a x$enable_video_opengl = xyes; then
  2855       SHARED_SYSTEM_LIBS="$SHARED_SYSTEM_LIBS -framework OpenGL"
  2856     fi
  2857     ;;
  2858   *)
  2859     SHARED_SYSTEM_LIBS=""
  2860     ;;
  2861 esac
  2862 
  2863 case "$ARCH" in
  2864   macosx)
  2865     # Evil hack to allow static linking on Mac OS X
  2866     SDL_STATIC_LIBS="\${exec_prefix}/lib/libSDLmain.a \${exec_prefix}/lib/libSDL.a"
  2867     ;;
  2868   *)
  2869     SDL_STATIC_LIBS="$SDL_LIBS"
  2870     ;;
  2871 esac
  2872 
  2873 
  2874 STATIC_SYSTEM_LIBS="$SYSTEM_LIBS"
  2875 
  2876 dnl Output the video drivers we use
  2877 if test x$enable_video = xtrue; then
  2878     if test "$VIDEO_SUBDIRS" = ""; then
  2879         AC_MSG_ERROR(*** No video drivers are enabled!)
  2880     fi
  2881 fi
  2882 AC_SUBST(AUDIO_SUBDIRS)
  2883 AC_SUBST(AUDIO_DRIVERS)
  2884 AC_SUBST(VIDEO_SUBDIRS)
  2885 AC_SUBST(VIDEO_DRIVERS)
  2886 AC_SUBST(JOYSTICK_SUBDIRS)
  2887 AC_SUBST(JOYSTICK_DRIVERS)
  2888 AC_SUBST(CDROM_SUBDIRS)
  2889 AC_SUBST(CDROM_DRIVERS)
  2890 AC_SUBST(SDL_EXTRADIRS)
  2891 AC_SUBST(SDL_EXTRALIBS)
  2892 
  2893 dnl Expand the cflags and libraries needed by apps using SDL
  2894 AC_SUBST(SDL_CFLAGS)
  2895 AC_SUBST(SDL_LIBS)
  2896 AC_SUBST(SDL_STATIC_LIBS)
  2897 AC_SUBST(SDL_RLD_FLAGS)
  2898 
  2899 dnl Expand the libraries needed for static and dynamic linking
  2900 AC_SUBST(STATIC_SYSTEM_LIBS)
  2901 AC_SUBST(SHARED_SYSTEM_LIBS)
  2902 AC_SUBST(SYSTEM_LIBS)
  2903 
  2904 dnl Expand the include directories for building SDL
  2905 CFLAGS="$CFLAGS -I\$(top_srcdir)/include"
  2906 CFLAGS="$CFLAGS -I\$(top_srcdir)/include/SDL"
  2907 CFLAGS="$CFLAGS -I\$(top_srcdir)/src -I\$(top_srcdir)/src/main/$ARCH"
  2908 CFLAGS="$CFLAGS -I\$(top_srcdir)/src/audio"
  2909 CFLAGS="$CFLAGS -I\$(top_srcdir)/src/video"
  2910 CFLAGS="$CFLAGS -I\$(top_srcdir)/src/video/XFree86/extensions"
  2911 CFLAGS="$CFLAGS -I\$(top_srcdir)/src/events"
  2912 CFLAGS="$CFLAGS -I\$(top_srcdir)/src/joystick"
  2913 CFLAGS="$CFLAGS -I\$(top_srcdir)/src/cdrom"
  2914 CFLAGS="$CFLAGS -I\$(top_srcdir)/src/thread"
  2915 CFLAGS="$CFLAGS -I\$(top_srcdir)/src/timer"
  2916 CFLAGS="$CFLAGS -I\$(top_srcdir)/src/endian"
  2917 CFLAGS="$CFLAGS -I\$(top_srcdir)/src/file"
  2918 CFLAGS="$CFLAGS -I\$(top_builddir)/src/thread"
  2919 CXXFLAGS="$CFLAGS"
  2920 
  2921 
  2922 # Check for darwin at the very end and set up the Objective C compiler
  2923 # We do this here so that we get the full CFLAGS into OBJCFLAGS
  2924 case "$target" in
  2925     *-*-darwin*)
  2926         dnl AC_PROG_OBJC doesn't seem to exist, this is the SDL workaround
  2927         AC_MSG_CHECKING(for an Objective-C compiler)
  2928         OBJC="$CC"
  2929         AC_SUBST(OBJC)
  2930         OBJCFLAGS="$CFLAGS"
  2931         AC_SUBST(OBJCFLAGS)
  2932         dnl _AM_DEPENDENCIES(OBJC) doesn't work, so hard code OBJCDEPMODE here
  2933         dnl _AM_DEPENDENCIES(OBJC)
  2934         dnl Of course, hard coding doesn't work for some versions of automake
  2935         OBJCDEPMODE="depmode=gcc"
  2936         AC_SUBST(OBJCDEPMODE)
  2937         dnl Trying this to satisfy everybody...
  2938         AC_MSG_RESULT(not implemented yet)
  2939         ;;
  2940 esac
  2941 
  2942 # Finally create all the generated files
  2943 dnl Important: Any directory that you want to be in the distcheck should
  2944 dnl            have a file listed here, so that configure generates the
  2945 dnl            subdirectories on the build target.
  2946 AC_OUTPUT([
  2947 Makefile
  2948 docs/Makefile
  2949 docs/html/Makefile
  2950 docs/man3/Makefile
  2951 include/Makefile
  2952 src/Makefile
  2953 src/main/Makefile
  2954 src/main/macos/Makefile
  2955 src/main/macosx/Makefile
  2956 src/main/macosx/Info.plist
  2957 src/audio/Makefile
  2958 src/audio/alsa/Makefile
  2959 src/audio/arts/Makefile
  2960 src/audio/baudio/Makefile
  2961 src/audio/dc/Makefile
  2962 src/audio/disk/Makefile
  2963 src/audio/dma/Makefile
  2964 src/audio/dmedia/Makefile
  2965 src/audio/dsp/Makefile
  2966 src/audio/esd/Makefile
  2967 src/audio/macosx/Makefile
  2968 src/audio/macrom/Makefile
  2969 src/audio/mint/Makefile
  2970 src/audio/mme/Makefile
  2971 src/audio/nas/Makefile
  2972 src/audio/nto/Makefile
  2973 src/audio/openbsd/Makefile
  2974 src/audio/paudio/Makefile
  2975 src/audio/sun/Makefile
  2976 src/audio/ums/Makefile
  2977 src/audio/windib/Makefile
  2978 src/audio/windx5/Makefile
  2979 src/video/Makefile
  2980 src/video/aalib/Makefile
  2981 src/video/ataricommon/Makefile
  2982 src/video/bwindow/Makefile
  2983 src/video/cybergfx/Makefile
  2984 src/video/dc/Makefile
  2985 src/video/dga/Makefile
  2986 src/video/directfb/Makefile
  2987 src/video/dummy/Makefile
  2988 src/video/epoc/Makefile
  2989 src/video/fbcon/Makefile
  2990 src/video/gem/Makefile
  2991 src/video/ggi/Makefile
  2992 src/video/maccommon/Makefile
  2993 src/video/macdsp/Makefile
  2994 src/video/macrom/Makefile
  2995 src/video/nanox/Makefile
  2996 src/video/photon/Makefile
  2997 src/video/picogui/Makefile
  2998 src/video/ps2gs/Makefile
  2999 src/video/qtopia/Makefile
  3000 src/video/quartz/Makefile
  3001 src/video/riscos/Makefile
  3002 src/video/svga/Makefile
  3003 src/video/vgl/Makefile
  3004 src/video/wincommon/Makefile
  3005 src/video/windib/Makefile
  3006 src/video/windx5/Makefile
  3007 src/video/x11/Makefile
  3008 src/video/xbios/Makefile
  3009 src/video/XFree86/Makefile
  3010 src/video/XFree86/extensions/Makefile
  3011 src/video/XFree86/Xinerama/Makefile
  3012 src/video/XFree86/Xv/Makefile
  3013 src/video/XFree86/Xxf86dga/Makefile
  3014 src/video/XFree86/Xxf86vm/Makefile
  3015 src/events/Makefile
  3016 src/joystick/Makefile
  3017 src/joystick/amigaos/Makefile
  3018 src/joystick/beos/Makefile
  3019 src/joystick/bsd/Makefile
  3020 src/joystick/darwin/Makefile
  3021 src/joystick/dc/Makefile
  3022 src/joystick/dummy/Makefile
  3023 src/joystick/linux/Makefile
  3024 src/joystick/macos/Makefile
  3025 src/joystick/mint/Makefile
  3026 src/joystick/riscos/Makefile
  3027 src/joystick/win32/Makefile
  3028 src/cdrom/Makefile
  3029 src/cdrom/aix/Makefile
  3030 src/cdrom/beos/Makefile
  3031 src/cdrom/dc/Makefile
  3032 src/cdrom/dummy/Makefile
  3033 src/cdrom/bsdi/Makefile
  3034 src/cdrom/freebsd/Makefile
  3035 src/cdrom/linux/Makefile
  3036 src/cdrom/macos/Makefile
  3037 src/cdrom/macosx/Makefile
  3038 src/cdrom/mint/Makefile
  3039 src/cdrom/openbsd/Makefile
  3040 src/cdrom/osf/Makefile
  3041 src/cdrom/qnx/Makefile
  3042 src/cdrom/win32/Makefile
  3043 src/thread/Makefile
  3044 src/timer/Makefile
  3045 src/endian/Makefile
  3046 src/file/Makefile
  3047 src/cpuinfo/Makefile
  3048 src/hermes/Makefile
  3049 sdl-config
  3050 SDL.spec
  3051 SDL.qpg
  3052 ], [chmod +x sdl-config])