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