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