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