configure.in
author Sam Lantinga <slouken@libsdl.org>
Thu, 06 May 2004 15:55:06 +0000
changeset 886 05c551e5bc64
parent 884 20d3a599f601
child 935 f8d5ddc7aef1
permissions -rw-r--r--
Date: Sat, 24 Apr 2004 15:13:32 +0300
From: "Mike Gorchak"
Subject: SDL updates for the QNX6

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