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