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