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