configure.in
author Ryan C. Gordon <icculus@icculus.org>
Thu, 08 Sep 2005 06:16:14 +0000
changeset 1133 609c060fd2a2
parent 1127 fb8818ee9112
child 1136 d16c010d5d98
permissions -rw-r--r--
The MacOSX Carbon/Cocoa/X11 all in one library patch. Relevant emails:


To: SDL Developers <sdl@libsdl.org>
From: =?ISO-8859-1?Q?Anders_F_Bj=F6rklund?= <afb@algonet.se>
Date: Mon, 30 May 2005 23:29:04 +0200
Subject: [SDL] Mac OS X Video Drivers [patch]

I've updated/added the Carbon and X11 video drivers
to the Mac OS X port of SDL 1.2 (the CVS version),
and made the Cocoa driver and runtime *optional*.

The default is still Cocoa, and the "Quartz" driver.
But you can now also use "toolbox" for Carbon, and
"x11" for running with Apple's (or other) X11 server:

export SDL_VIDEODRIVER=x11
export SDL_VIDEO_GL_DRIVER=/usr/X11R6/lib/libGL.dylib

It also checks if the frameworks are available, by a:
#include <Carbon/Carbon.h> or #import <Cocoa/Cocoa.h>
(this should make it configure on plain Darwin as well?)


Here are the new configure targets:
--enable-video-cocoa use Cocoa/Quartz video driver default=yes
--enable-video-carbon use Carbon/QuickDraw video driver default=yes
--enable-video-x11 use X11 video driver default=no

./configure --enable-video-cocoa --enable-video-carbon
--enable-video-x11 \
--x-includes=/usr/X11R6/include --x-libraries=/usr/X11R6/lib

The Carbon version is just an updated version of the old
SDL driver for Mac OS 9, and could probably be improved...
(but it does work, including the Carbon version of SDLmain)

If you disable cocoa, you can run with -framework Carbon only,
and the C version of SDL_main.c. And if you disable carbon too,
you can still use the X11 version which doesn't require SDLmain.

I updated the DrawSprocket version, but did not include it.
(no blitters or VRAM GWorlds etc. available on OS X anyway)
Besides for Mac OS 9, I don't think there's any use for it ?

And note that any performance on Mac OS X equals OpenGL anyway...
You can get "fair" software SDL results on captured CG displays,
but for decent frame rates you need to be using GL for rendering.


Finally, here is the patch itself:
http://www.algonet.se/~afb/SDL-12CVS-macvideo.patch

--anders

PS. It says "video", but as usual it applies to mouse/keyboard too.


------


To: A list for developers using the SDL library <sdl@libsdl.org>
From: =?ISO-8859-1?Q?Anders_F_Bj=F6rklund?= <afb@algonet.se>
Date: Sun, 4 Sep 2005 10:02:15 +0200
Subject: [SDL] Updated Mac patch

Updated the previous Mac patch to disable Carbon by default.
Also "fixed" the SDL.spec again, so that it builds on Darwin.

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