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