configure.in
author Ryan C. Gordon <icculus@icculus.org>
Thu, 12 Jan 2006 22:46:36 +0000
changeset 1242 caf0328c8058
parent 1222 09c1408645df
child 1243 08c730212ca2
permissions -rw-r--r--
Add XME hooks to X11 driver instead of relying on libxme...libxme hasn't
changed in five years, and it's a small .c file that just calls into the X11
dependencies we already use elsewhere. Including it directly allows us to
make use of the dynamic X11 code.

Fixes Bugzilla #41.

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