configure.in
author Sam Lantinga <slouken@libsdl.org>
Mon, 20 May 2002 18:36:48 +0000
changeset 378 6089cd59e3ca
parent 371 db0cc6034336
child 381 bc1401311390
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.9
   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 case "$target" in
  1449     *-*-linux*)
  1450         ARCH=linux
  1451         CheckDummyVideo
  1452         CheckDiskAudio
  1453         CheckDLOPEN
  1454         CheckNASM
  1455         CheckOSS
  1456         CheckALSA
  1457         CheckARTSC
  1458         CheckESD
  1459         CheckNAS
  1460         CheckX11
  1461         CheckNANOX
  1462         CheckDGA
  1463         CheckFBCON
  1464         CheckDirectFB
  1465         CheckPS2GS
  1466         CheckGGI
  1467         CheckSVGA
  1468         CheckAAlib
  1469         CheckQtopia
  1470         CheckOpenGL
  1471         CheckInputEvents
  1472         CheckPTHREAD
  1473         # Set up files for the main() stub
  1474         if test "x$video_qtopia" = "xyes"; then
  1475           COPY_ARCH_SRC(src/main, linux, SDL_Qtopia_main.cc)
  1476           SDL_CFLAGS="$SDL_CFLAGS -Dmain=SDL_main"
  1477           SDL_LIBS="-lSDLmain $SDL_LIBS"
  1478         else
  1479           COPY_ARCH_SRC(src/main, linux, SDL_main.c)
  1480         fi
  1481         # Set up files for the audio library
  1482         # We use the OSS and ALSA API's, not the Sun audio API
  1483         #if test x$enable_audio = xyes; then
  1484         #    CFLAGS="$CFLAGS -DSUNAUDIO_SUPPORT"
  1485         #    AUDIO_SUBDIRS="$AUDIO_SUBDIRS sun"
  1486         #    AUDIO_DRIVERS="$AUDIO_DRIVERS sun/libaudio_sun.la"
  1487         #fi
  1488         # Set up files for the joystick library
  1489         if test x$enable_joystick = xyes; then
  1490             JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS linux"
  1491             JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS linux/libjoystick_linux.la"
  1492         fi
  1493         # Set up files for the cdrom library
  1494         if test x$enable_cdrom = xyes; then
  1495             CDROM_SUBDIRS="$CDROM_SUBDIRS linux"
  1496             CDROM_DRIVERS="$CDROM_DRIVERS linux/libcdrom_linux.la"
  1497         fi
  1498         # Set up files for the thread library
  1499         if test x$enable_threads = xyes; then
  1500             if test x$use_pthreads != xyes; then
  1501                 COPY_ARCH_SRC(src/thread, linux, clone.S)
  1502             fi
  1503             COPY_ARCH_SRC(src/thread, linux, SDL_systhread.c)
  1504             COPY_ARCH_SRC(src/thread, linux, SDL_systhread_c.h)
  1505             if test x$use_pthreads = xyes -a x$have_pthread_sem != xyes; then
  1506                 COPY_ARCH_SRC(src/thread, generic, SDL_syssem.c)
  1507             else
  1508                 COPY_ARCH_SRC(src/thread, linux, SDL_syssem.c)
  1509             fi
  1510             COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
  1511             if test x$glibc20_pthreads = xyes; then
  1512                 COPY_ARCH_SRC(src/thread, generic, SDL_sysmutex.c)
  1513                 COPY_ARCH_SRC(src/thread, generic, SDL_sysmutex_c.h)
  1514                 COPY_ARCH_SRC(src/thread, generic, SDL_syscond.c)
  1515                 COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
  1516             else
  1517                 COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex.c)
  1518                 COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex_c.h)
  1519                 if test x$has_recursive_mutexes != xyes; then
  1520                     COPY_ARCH_SRC(src/thread, generic, SDL_syscond.c)
  1521                 else
  1522                     COPY_ARCH_SRC(src/thread, linux, SDL_syscond.c)
  1523                 fi
  1524                 COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
  1525             fi
  1526         fi
  1527         # Set up files for the timer library
  1528         if test x$enable_timers = xyes; then
  1529             COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
  1530         fi
  1531         ;;
  1532     *-*-bsdi*)
  1533         ARCH=bsdi
  1534         CheckDummyVideo
  1535         CheckDiskAudio
  1536         CheckDLOPEN
  1537         CheckNASM
  1538         CheckOSS
  1539         CheckARTSC
  1540         CheckESD
  1541         CheckNAS
  1542         CheckX11
  1543         CheckDGA
  1544         CheckSVGA
  1545         CheckAAlib
  1546         CheckOpenGL
  1547         CheckPTHREAD
  1548         # Set up files for the main() stub
  1549         COPY_ARCH_SRC(src/main, linux, SDL_main.c)
  1550         # Set up files for the audio library
  1551         # We use the OSS and ALSA API's, not the Sun audio API
  1552         #if test x$enable_audio = xyes; then
  1553         #    CFLAGS="$CFLAGS -DSUNAUDIO_SUPPORT"
  1554         #    AUDIO_SUBDIRS="$AUDIO_SUBDIRS sun"
  1555         #    AUDIO_DRIVERS="$AUDIO_DRIVERS sun/libaudio_sun.la"
  1556         #fi
  1557         # Set up files for the joystick library
  1558         # (No joystick support yet)
  1559         if test x$enable_joystick = xyes; then
  1560             JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS dummy"
  1561             JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS dummy/libjoystick_dummy.la"
  1562         fi
  1563         # Set up files for the cdrom library
  1564         if test x$enable_cdrom = xyes; then
  1565             CDROM_SUBDIRS="$CDROM_SUBDIRS bsdi"
  1566             CDROM_DRIVERS="$CDROM_DRIVERS bsdi/libcdrom_bsdi.la"
  1567         fi
  1568         # Set up files for the thread library
  1569         if test x$enable_threads = xyes; then
  1570             COPY_ARCH_SRC(src/thread, linux, SDL_systhread.c)
  1571             COPY_ARCH_SRC(src/thread, linux, SDL_systhread_c.h)
  1572             COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex.c)
  1573             COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex_c.h)
  1574             COPY_ARCH_SRC(src/thread, bsdi, SDL_syssem.c)
  1575             COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
  1576             COPY_ARCH_SRC(src/thread, linux, SDL_syscond.c)
  1577             COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
  1578         fi
  1579         # Set up files for the timer library
  1580         if test x$enable_timers = xyes; then
  1581             COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
  1582         fi
  1583         ;;
  1584     *-*-freebsd*)
  1585         ARCH=freebsd
  1586         CheckDummyVideo
  1587         CheckDiskAudio
  1588         CheckDLOPEN
  1589         CheckVGL
  1590         CheckNASM
  1591         CheckOSS
  1592         CheckARTSC
  1593         CheckESD
  1594         CheckNAS
  1595         CheckX11
  1596         CheckDGA
  1597         CheckSVGA
  1598         CheckAAlib
  1599         CheckOpenGL
  1600         CheckPTHREAD
  1601         # Set up files for the main() stub
  1602         COPY_ARCH_SRC(src/main, linux, SDL_main.c)
  1603         # Set up files for the audio library
  1604         # We use the OSS and ALSA API's, not the Sun audio API
  1605         #if test x$enable_audio = xyes; then
  1606         #    CFLAGS="$CFLAGS -DSUNAUDIO_SUPPORT"
  1607         #    AUDIO_SUBDIRS="$AUDIO_SUBDIRS sun"
  1608         #    AUDIO_DRIVERS="$AUDIO_DRIVERS sun/libaudio_sun.la"
  1609         #fi
  1610         # Set up files for the joystick library
  1611         if test x$enable_joystick = xyes; then
  1612             JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS bsd"
  1613             JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS bsd/libjoystick_bsd.la"
  1614             SYSTEM_LIBS="$SYSTEM_LIBS -lusb"
  1615         fi
  1616         # Set up files for the cdrom library
  1617         if test x$enable_cdrom = xyes; then
  1618             CDROM_SUBDIRS="$CDROM_SUBDIRS freebsd"
  1619             CDROM_DRIVERS="$CDROM_DRIVERS freebsd/libcdrom_freebsd.la"
  1620         fi
  1621         # Set up files for the thread library
  1622         if test x$enable_threads = xyes; then
  1623             COPY_ARCH_SRC(src/thread, linux, SDL_systhread.c)
  1624             COPY_ARCH_SRC(src/thread, linux, SDL_systhread_c.h)
  1625             COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex.c)
  1626             COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex_c.h)
  1627             if test x$use_pthreads = xyes -a x$have_pthread_sem != xyes; then
  1628                 COPY_ARCH_SRC(src/thread, generic, SDL_syssem.c)
  1629             else
  1630                 COPY_ARCH_SRC(src/thread, linux, SDL_syssem.c)
  1631             fi
  1632             COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
  1633             COPY_ARCH_SRC(src/thread, linux, SDL_syscond.c)
  1634             COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
  1635         fi
  1636         # Set up files for the timer library
  1637         if test x$enable_timers = xyes; then
  1638             COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
  1639         fi
  1640         ;;
  1641     *-*-netbsd*)
  1642         ARCH=netbsd
  1643         CheckDummyVideo
  1644         CheckDiskAudio
  1645         CheckDLOPEN
  1646         CheckNASM
  1647         CheckOSS
  1648         CheckARTSC
  1649         CheckESD
  1650         CheckNAS
  1651         CheckX11
  1652         CheckAAlib
  1653         CheckOpenGL
  1654         CheckPTHREAD
  1655         # Set up files for the main() stub
  1656         COPY_ARCH_SRC(src/main, linux, SDL_main.c)
  1657         # Set up files for the audio library
  1658         if test x$enable_audio = xyes; then
  1659             CFLAGS="$CFLAGS -DSUNAUDIO_SUPPORT"
  1660             AUDIO_SUBDIRS="$AUDIO_SUBDIRS sun"
  1661             AUDIO_DRIVERS="$AUDIO_DRIVERS sun/libaudio_sun.la"
  1662         fi
  1663         # Set up files for the joystick library
  1664         if test x$enable_joystick = xyes; then
  1665             JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS bsd"
  1666             JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS bsd/libjoystick_bsd.la"
  1667             SYSTEM_LIBS="$SYSTEM_LIBS -lusb"
  1668         fi
  1669         # Set up files for the cdrom library
  1670         if test x$enable_cdrom = xyes; then
  1671             CDROM_SUBDIRS="$CDROM_SUBDIRS openbsd"
  1672             CDROM_DRIVERS="$CDROM_DRIVERS openbsd/libcdrom_openbsd.la"
  1673         fi
  1674         # Set up files for the thread library
  1675         if test x$enable_threads = xyes; then
  1676             COPY_ARCH_SRC(src/thread, linux, SDL_systhread.c)
  1677             COPY_ARCH_SRC(src/thread, linux, SDL_systhread_c.h)
  1678             COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex.c)
  1679             COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex_c.h)
  1680             if test x$use_pthreads = xyes -a x$have_pthread_sem != xyes; then
  1681                 COPY_ARCH_SRC(src/thread, generic, SDL_syssem.c)
  1682             else
  1683                 COPY_ARCH_SRC(src/thread, linux, SDL_syssem.c)
  1684             fi
  1685             COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
  1686             COPY_ARCH_SRC(src/thread, linux, SDL_syscond.c)
  1687             COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
  1688         fi
  1689         # Set up files for the timer library
  1690         if test x$enable_timers = xyes; then
  1691             COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
  1692         fi
  1693         # NetBSD does not define "unix"
  1694         CFLAGS="$CFLAGS -Dunix -D_POSIX_THREAD_SYSCALL_SOFT=1"
  1695         ;;
  1696     *-*-openbsd*)
  1697         ARCH=openbsd
  1698         CheckDummyVideo
  1699         CheckDiskAudio
  1700         CheckDLOPEN
  1701         CheckNASM
  1702         CheckOSS
  1703         CheckARTSC
  1704         CheckESD
  1705         CheckNAS
  1706         CheckX11
  1707         CheckAAlib
  1708         CheckOpenGL
  1709         CheckPTHREAD
  1710         # Set up files for the main() stub
  1711         COPY_ARCH_SRC(src/main, linux, SDL_main.c)
  1712         # Set up files for the audio library
  1713         if test x$enable_audio = xyes; then
  1714             CFLAGS="$CFLAGS -DOPENBSD_AUDIO_SUPPORT"
  1715             AUDIO_SUBDIRS="$AUDIO_SUBDIRS openbsd"
  1716             AUDIO_DRIVERS="$AUDIO_DRIVERS openbsd/libaudio_openbsd.la"
  1717         fi
  1718         # OpenBSD needs linking with ossaudio emulation library
  1719         if test x$have_oss = xyes; then
  1720             SYSTEM_LIBS="$SYSTEM_LIBS -lossaudio"
  1721         fi
  1722         # Set up files for the joystick library
  1723         if test x$enable_joystick = xyes; then
  1724             JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS bsd"
  1725             JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS bsd/libjoystick_bsd.la"
  1726             SYSTEM_LIBS="$SYSTEM_LIBS -lusbhid"
  1727         fi
  1728         # Set up files for the cdrom library
  1729         if test x$enable_cdrom = xyes; then
  1730             CDROM_SUBDIRS="$CDROM_SUBDIRS openbsd"
  1731             CDROM_DRIVERS="$CDROM_DRIVERS openbsd/libcdrom_openbsd.la"
  1732         fi
  1733         # Set up files for the thread library
  1734         if test x$enable_threads = xyes; then
  1735             COPY_ARCH_SRC(src/thread, linux, SDL_systhread.c)
  1736             COPY_ARCH_SRC(src/thread, linux, SDL_systhread_c.h)
  1737             COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex.c)
  1738             COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex_c.h)
  1739             if test x$use_pthreads = xyes -a x$have_pthread_sem != xyes; then
  1740                 COPY_ARCH_SRC(src/thread, generic, SDL_syssem.c)
  1741             else
  1742                 COPY_ARCH_SRC(src/thread, linux, SDL_syssem.c)
  1743             fi
  1744             COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
  1745             COPY_ARCH_SRC(src/thread, linux, SDL_syscond.c)
  1746             COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
  1747         fi
  1748         # Set up files for the timer library
  1749         if test x$enable_timers = xyes; then
  1750             COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
  1751         fi
  1752         # OpenBSD does not define "unix"
  1753         CFLAGS="$CFLAGS -Dunix"
  1754         ;;
  1755     *-*-sysv5*)
  1756         ARCH=sysv5
  1757         CheckDummyVideo
  1758         CheckDiskAudio
  1759         CheckDLOPEN
  1760         CheckNASM
  1761         CheckOSS
  1762         CheckARTSC
  1763         CheckESD
  1764         CheckNAS
  1765         CheckX11
  1766         CheckAAlib
  1767         CheckOpenGL
  1768         CheckPTHREAD
  1769         # Set up files for the main() stub
  1770         COPY_ARCH_SRC(src/main, linux, SDL_main.c)
  1771         # Set up files for the audio library
  1772         if test x$enable_audio = xyes; then
  1773             CFLAGS="$CFLAGS -DSUNAUDIO_SUPPORT"
  1774             AUDIO_SUBDIRS="$AUDIO_SUBDIRS sun"
  1775             AUDIO_DRIVERS="$AUDIO_DRIVERS sun/libaudio_sun.la"
  1776         fi
  1777         # Set up files for the joystick library
  1778         # (No joystick support yet)
  1779         if test x$enable_joystick = xyes; then
  1780             JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS dummy"
  1781             JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS dummy/libjoystick_dummy.la"
  1782         fi
  1783         # Set up files for the cdrom library
  1784         if test x$enable_cdrom = xyes; then
  1785             CDROM_SUBDIRS="$CDROM_SUBDIRS dummy"
  1786             CDROM_DRIVERS="$CDROM_DRIVERS dummy/libcdrom_dummy.la"
  1787         fi
  1788         # Set up files for the thread library
  1789         if test x$enable_threads = xyes; then
  1790             COPY_ARCH_SRC(src/thread, generic, SDL_systhread.c)
  1791             COPY_ARCH_SRC(src/thread, generic, SDL_systhread_c.h)
  1792             COPY_ARCH_SRC(src/thread, generic, SDL_sysmutex.c)
  1793             COPY_ARCH_SRC(src/thread, generic, SDL_sysmutex_c.h)
  1794             COPY_ARCH_SRC(src/thread, generic, SDL_syssem.c)
  1795             COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
  1796             COPY_ARCH_SRC(src/thread, generic, SDL_syscond.c)
  1797             COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
  1798         fi
  1799         # Set up files for the timer library
  1800         if test x$enable_timers = xyes; then
  1801             COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
  1802         fi
  1803         ;;
  1804     *-*-solaris*)
  1805         ARCH=solaris
  1806         CFLAGS="$CFLAGS -D__ELF__" # Fix for nasm on Solaris x86
  1807         CheckDummyVideo
  1808         CheckDiskAudio
  1809         CheckDLOPEN
  1810         CheckNASM
  1811         CheckOSS
  1812         CheckARTSC
  1813         CheckESD
  1814         CheckNAS
  1815         CheckX11
  1816         CheckAAlib
  1817         CheckOpenGL
  1818         CheckPTHREAD
  1819         # Set up files for the main() stub
  1820         COPY_ARCH_SRC(src/main, linux, SDL_main.c)
  1821         # Set up files for the audio library
  1822         if test x$enable_audio = xyes; then
  1823             CFLAGS="$CFLAGS -DSUNAUDIO_SUPPORT"
  1824             AUDIO_SUBDIRS="$AUDIO_SUBDIRS sun"
  1825             AUDIO_DRIVERS="$AUDIO_DRIVERS sun/libaudio_sun.la"
  1826         fi
  1827         # Set up files for the joystick library
  1828         # (No joystick support yet)
  1829         if test x$enable_joystick = xyes; then
  1830             JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS dummy"
  1831             JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS dummy/libjoystick_dummy.la"
  1832         fi
  1833         # Set up files for the cdrom library
  1834         if test x$enable_cdrom = xyes; then
  1835             CDROM_SUBDIRS="$CDROM_SUBDIRS linux"
  1836             CDROM_DRIVERS="$CDROM_DRIVERS linux/libcdrom_linux.la"
  1837         fi
  1838         # Set up files for the thread library
  1839         if test x$enable_threads = xyes; then
  1840             COPY_ARCH_SRC(src/thread, linux, SDL_systhread.c)
  1841             COPY_ARCH_SRC(src/thread, linux, SDL_systhread_c.h)
  1842             COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex.c)
  1843             COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex_c.h)
  1844             COPY_ARCH_SRC(src/thread, linux, SDL_syssem.c)
  1845             COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
  1846             COPY_ARCH_SRC(src/thread, generic, SDL_syscond.c)
  1847             COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
  1848         fi
  1849         # Set up files for the timer library
  1850         if test x$enable_timers = xyes; then
  1851             COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
  1852         fi
  1853         ;;
  1854     *-*-irix*)
  1855         ARCH=irix
  1856         CheckDummyVideo
  1857         CheckDiskAudio
  1858         CheckDLOPEN
  1859         CheckDMEDIA
  1860         CheckESD
  1861         CheckNAS
  1862         CheckX11
  1863         CheckAAlib
  1864         CheckOpenGL
  1865         CheckPTHREAD
  1866         # Set up files for the main() stub
  1867         COPY_ARCH_SRC(src/main, linux, SDL_main.c)
  1868         # We use the dmedia audio API, not the Sun audio API
  1869         #if test x$enable_audio = xyes; then
  1870         #    CFLAGS="$CFLAGS -DSUNAUDIO_SUPPORT"
  1871         #    AUDIO_SUBDIRS="$AUDIO_SUBDIRS sun"
  1872         #    AUDIO_DRIVERS="$AUDIO_DRIVERS sun/libaudio_sun.la"
  1873         #fi
  1874         # Set up files for the joystick library
  1875         # (No joystick support yet)
  1876         if test x$enable_joystick = xyes; then
  1877             JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS dummy"
  1878             JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS dummy/libjoystick_dummy.la"
  1879         fi
  1880         # Set up files for the cdrom library
  1881         # (No CD-ROM support yet)
  1882         if test x$enable_cdrom = xyes; then
  1883             CDROM_SUBDIRS="$CDROM_SUBDIRS dummy"
  1884             CDROM_DRIVERS="$CDROM_DRIVERS dummy/libcdrom_dummy.la"
  1885         fi
  1886         # Set up files for the thread library
  1887         if test x$enable_threads = xyes; then
  1888             if test x$use_pthreads = xyes; then
  1889                 COPY_ARCH_SRC(src/thread, linux, SDL_systhread.c)
  1890                 COPY_ARCH_SRC(src/thread, linux, SDL_systhread_c.h)
  1891                 COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex.c)
  1892                 COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex_c.h)
  1893                 if test x$have_pthread_sem != xyes; then
  1894                     COPY_ARCH_SRC(src/thread, generic, SDL_syssem.c)
  1895                 else
  1896                     COPY_ARCH_SRC(src/thread, linux, SDL_syssem.c)
  1897                 fi
  1898                 COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
  1899                 COPY_ARCH_SRC(src/thread, linux, SDL_syscond.c)
  1900                 COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
  1901             else
  1902                 COPY_ARCH_SRC(src/thread, irix, SDL_systhread.c)
  1903                 COPY_ARCH_SRC(src/thread, irix, SDL_systhread_c.h)
  1904                 COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex.c)
  1905                 COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex_c.h)
  1906                 COPY_ARCH_SRC(src/thread, linux, SDL_syssem.c)
  1907                 COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
  1908                 COPY_ARCH_SRC(src/thread, generic, SDL_syscond.c)
  1909                 COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
  1910             fi
  1911         fi
  1912         # Set up files for the timer library
  1913         if test x$enable_timers = xyes; then
  1914             COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
  1915         fi
  1916         ;;
  1917     *-*-hpux*)
  1918         ARCH=hpux
  1919         CheckDummyVideo
  1920         CheckDiskAudio
  1921         CheckDLOPEN
  1922         CheckOSS
  1923         CheckNAS
  1924         CheckX11
  1925         CheckGGI
  1926         CheckAAlib
  1927         CheckOpenGL
  1928         CheckPTHREAD
  1929         # Set up files for the main() stub
  1930         COPY_ARCH_SRC(src/main, linux, SDL_main.c)
  1931         # Set up files for the audio library
  1932         if test x$enable_audio = xyes; then
  1933             CFLAGS="$CFLAGS -DSUNAUDIO_SUPPORT"
  1934             AUDIO_SUBDIRS="$AUDIO_SUBDIRS sun"
  1935             AUDIO_DRIVERS="$AUDIO_DRIVERS sun/libaudio_sun.la"
  1936         fi
  1937         # Set up files for the joystick library
  1938         # (No joystick support yet)
  1939         if test x$enable_joystick = xyes; then
  1940             JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS dummy"
  1941             JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS dummy/libjoystick_dummy.la"
  1942         fi
  1943         # Set up files for the cdrom library
  1944         # (No CD-ROM support yet)
  1945         if test x$enable_cdrom = xyes; then
  1946             CDROM_SUBDIRS="$CDROM_SUBDIRS dummy"
  1947             CDROM_DRIVERS="$CDROM_DRIVERS dummy/libcdrom_dummy.la"
  1948         fi
  1949         # Set up files for the thread library
  1950         if test x$enable_threads = xyes; then
  1951             COPY_ARCH_SRC(src/thread, linux, SDL_systhread.c)
  1952             COPY_ARCH_SRC(src/thread, linux, SDL_systhread_c.h)
  1953             COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex.c)
  1954             COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex_c.h)
  1955             COPY_ARCH_SRC(src/thread, linux, SDL_syssem.c)
  1956             COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
  1957             COPY_ARCH_SRC(src/thread, linux, SDL_syscond.c)
  1958             COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
  1959         fi
  1960         # Set up files for the timer library
  1961         if test x$enable_timers = xyes; then
  1962             COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
  1963         fi
  1964         ;;
  1965     *-*-aix*)
  1966         ARCH=aix
  1967         CheckDummyVideo
  1968         CheckDiskAudio
  1969         CheckDLOPEN
  1970         CheckOSS
  1971         CheckNAS
  1972         CheckX11
  1973         CheckGGI
  1974         CheckAAlib
  1975         CheckOpenGL
  1976         CheckPTHREAD
  1977         # Set up files for the main() stub
  1978         COPY_ARCH_SRC(src/main, linux, SDL_main.c)
  1979         # Set up files for the audio library
  1980         if test x$enable_audio = xyes; then
  1981             AUDIO_SUBDIRS="$AUDIO_SUBDIRS paudio"
  1982             AUDIO_DRIVERS="$AUDIO_DRIVERS paudio/libaudio_paudio.la"
  1983         fi
  1984         # Set up files for the joystick library
  1985         # (No joystick support yet)
  1986         if test x$enable_joystick = xyes; then
  1987             JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS dummy"
  1988             JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS dummy/libjoystick_dummy.la"
  1989         fi
  1990         # Set up files for the cdrom library
  1991         if test x$enable_cdrom = xyes; then
  1992             CDROM_SUBDIRS="$CDROM_SUBDIRS aix"
  1993             CDROM_DRIVERS="$CDROM_DRIVERS aix/libcdrom_aix.la"
  1994         fi
  1995         # Set up files for the thread library
  1996         if test x$enable_threads = xyes; then
  1997             COPY_ARCH_SRC(src/thread, linux, SDL_systhread.c)
  1998             COPY_ARCH_SRC(src/thread, linux, SDL_systhread_c.h)
  1999             COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex.c)
  2000             COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex_c.h)
  2001             COPY_ARCH_SRC(src/thread, linux, SDL_syssem.c)
  2002             COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
  2003             COPY_ARCH_SRC(src/thread, linux, SDL_syscond.c)
  2004             COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
  2005         fi
  2006         # Set up files for the timer library
  2007         if test x$enable_timers = xyes; then
  2008             COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
  2009         fi
  2010         ;;
  2011     *-*-osf*)
  2012         ARCH=osf
  2013         CheckDummyVideo
  2014         CheckDiskAudio
  2015         CheckDLOPEN
  2016         CheckNAS
  2017         CheckX11
  2018         CheckGGI
  2019         CheckAAlib
  2020         CheckOpenGL
  2021         CheckPTHREAD
  2022         # Set up files for the main() stub
  2023         COPY_ARCH_SRC(src/main, linux, SDL_main.c)
  2024         # Set up files for the audio library
  2025         if test x$enable_audio = xyes; then
  2026             CFLAGS="$CFLAGS -DSUNAUDIO_SUPPORT"
  2027             AUDIO_SUBDIRS="$AUDIO_SUBDIRS sun"
  2028             AUDIO_DRIVERS="$AUDIO_DRIVERS sun/libaudio_sun.la"
  2029         fi
  2030         # Set up files for the joystick library
  2031         # (No joystick support yet)
  2032         if test x$enable_joystick = xyes; then
  2033             JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS dummy"
  2034             JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS dummy/libjoystick_dummy.la"
  2035         fi
  2036         # Set up files for the cdrom library
  2037         # (No cdrom support yet)
  2038         if test x$enable_cdrom = xyes; then
  2039             CDROM_SUBDIRS="$CDROM_SUBDIRS dummy"
  2040             CDROM_DRIVERS="$CDROM_DRIVERS dummy/libcdrom_dummy.la"
  2041         fi
  2042         # Set up files for the thread library
  2043         if test x$enable_threads = xyes; then
  2044             COPY_ARCH_SRC(src/thread, linux, SDL_systhread.c)
  2045             COPY_ARCH_SRC(src/thread, linux, SDL_systhread_c.h)
  2046             COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex.c)
  2047             COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex_c.h)
  2048             COPY_ARCH_SRC(src/thread, generic, SDL_syssem.c)
  2049             COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
  2050             COPY_ARCH_SRC(src/thread, linux, SDL_syscond.c)
  2051             COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
  2052         fi
  2053         # Set up files for the timer library
  2054         if test x$enable_timers = xyes; then
  2055             COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
  2056         fi
  2057         ;;
  2058     *-*-qnx*)
  2059         ARCH=qnx
  2060         CheckDummyVideo
  2061         CheckDiskAudio
  2062         CheckDLOPEN
  2063         CheckNAS
  2064         CheckPHOTON
  2065         CheckX11
  2066         CheckOpenGL
  2067         CheckPTHREAD
  2068         # Set up files for the main() stub
  2069         COPY_ARCH_SRC(src/main, linux, SDL_main.c)
  2070         # Set up files for the audio library
  2071         if test x$enable_audio = xyes; then
  2072             CFLAGS="$CFLAGS -DALSA_SUPPORT"
  2073             SYSTEM_LIBS="$SYSTEM_LIBS -lasound"
  2074             AUDIO_SUBDIRS="$AUDIO_SUBDIRS nto"
  2075             AUDIO_DRIVERS="$AUDIO_DRIVERS nto/libaudio_nto.la"
  2076         fi
  2077         # Set up files for the joystick library
  2078         if test x$enable_joystick = xyes; then
  2079         # (No joystick support yet)
  2080             JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS dummy"
  2081             JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS dummy/libjoystick_dummy.la"
  2082         fi
  2083         # Set up files for the cdrom library
  2084         if test x$enable_cdrom = xyes; then
  2085             CDROM_SUBDIRS="$CDROM_SUBDIRS qnx"
  2086             CDROM_DRIVERS="$CDROM_DRIVERS qnx/libcdrom_qnx.la"
  2087         fi
  2088         # Set up files for the thread library
  2089         if test x$enable_threads = xyes; then
  2090             COPY_ARCH_SRC(src/thread, linux, SDL_systhread.c)
  2091             COPY_ARCH_SRC(src/thread, linux, SDL_systhread_c.h)
  2092             COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex.c)
  2093             COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex_c.h)
  2094             COPY_ARCH_SRC(src/thread, linux, SDL_syssem.c)
  2095             COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
  2096             COPY_ARCH_SRC(src/thread, linux, SDL_syscond.c)
  2097             COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
  2098         fi
  2099         # Set up files for the timer library
  2100         if test x$enable_timers = xyes; then
  2101             COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
  2102         fi
  2103         ;;
  2104     *-*-cygwin* | *-*-mingw32*)
  2105         ARCH=win32
  2106         if test "$build" != "$target"; then # cross-compiling
  2107             # Default cross-compile location
  2108             ac_default_prefix=/usr/local/cross-tools/i386-mingw32msvc
  2109         else
  2110             # Look for the location of the tools and install there
  2111             if [ "$BUILD_PREFIX" != "" ]; then
  2112                 ac_default_prefix=$BUILD_PREFIX
  2113             fi
  2114         fi
  2115         CheckDummyVideo
  2116         CheckDiskAudio
  2117         CheckWIN32
  2118         CheckDIRECTX
  2119         CheckNASM
  2120         # Set up files for the main() stub
  2121         COPY_ARCH_SRC(src/main, win32, SDL_main.c)
  2122         # Set up files for the audio library
  2123         if test x$enable_audio = xyes; then
  2124             AUDIO_SUBDIRS="$AUDIO_SUBDIRS windib"
  2125             AUDIO_DRIVERS="$AUDIO_DRIVERS windib/libaudio_windib.la"
  2126             if test x$use_directx = xyes; then
  2127                 AUDIO_SUBDIRS="$AUDIO_SUBDIRS windx5"
  2128                 AUDIO_DRIVERS="$AUDIO_DRIVERS windx5/libaudio_windx5.la"
  2129             fi
  2130         fi
  2131         # Set up files for the joystick library
  2132         if test x$enable_joystick = xyes; then
  2133             JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS win32"
  2134             JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS win32/libjoystick_winmm.la"
  2135         fi
  2136         # Set up files for the cdrom library
  2137         if test x$enable_cdrom = xyes; then
  2138             CDROM_SUBDIRS="$CDROM_SUBDIRS win32"
  2139             CDROM_DRIVERS="$CDROM_DRIVERS win32/libcdrom_win32.la"
  2140         fi
  2141         # Set up files for the thread library
  2142         if test x$enable_threads = xyes; then
  2143             COPY_ARCH_SRC(src/thread, win32, SDL_systhread.c)
  2144             COPY_ARCH_SRC(src/thread, win32, SDL_systhread_c.h)
  2145             COPY_ARCH_SRC(src/thread, win32, SDL_sysmutex.c)
  2146             COPY_ARCH_SRC(src/thread, generic, SDL_sysmutex_c.h)
  2147             COPY_ARCH_SRC(src/thread, win32, SDL_syssem.c)
  2148             COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
  2149             COPY_ARCH_SRC(src/thread, generic, SDL_syscond.c)
  2150             COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
  2151         fi
  2152         # Set up files for the timer library
  2153         if test x$enable_timers = xyes; then
  2154             COPY_ARCH_SRC(src/timer, win32, SDL_systimer.c)
  2155         fi
  2156         # The Win32 platform requires special setup
  2157         SDL_CFLAGS="$SDL_CFLAGS -Dmain=SDL_main"
  2158         case "$target" in
  2159             *-*-cygwin*)
  2160                 CFLAGS="$CFLAGS -I/usr/include/mingw -DWIN32 -Uunix -mno-cygwin"
  2161                 SDL_CFLAGS="$SDL_CFLAGS -I/usr/include/mingw -DWIN32 -Uunix -mno-cygwin"
  2162                 LIBS="$LIBS -mno-cygwin"
  2163                 SDL_LIBS="-lmingw32 -lSDLmain $SDL_LIBS -mwindows -mno-cygwin"
  2164                 ;;
  2165             *-*-mingw32*)
  2166                 SDL_LIBS="-lmingw32 -lSDLmain $SDL_LIBS -mwindows"
  2167                 ;;
  2168         esac
  2169         ;;
  2170     *-*-beos*)
  2171         ARCH=beos
  2172         ac_default_prefix=/boot/develop/tools/gnupro
  2173         CheckDummyVideo
  2174         CheckDiskAudio
  2175         CheckNASM
  2176         CheckBWINDOW
  2177         CheckBeGL
  2178         # Set up files for the main() stub
  2179         COPY_ARCH_SRC(src/main, linux, SDL_main.c)
  2180         COPY_ARCH_SRC(src/main, beos, SDL_BeApp.cc)
  2181         COPY_ARCH_SRC(src/main, beos, SDL_BeApp.h)
  2182         # Set up files for the audio library
  2183         if test x$enable_audio = xyes; then
  2184             AUDIO_SUBDIRS="$AUDIO_SUBDIRS baudio"
  2185             AUDIO_DRIVERS="$AUDIO_DRIVERS baudio/libaudio_baudio.la"
  2186         fi
  2187         # Set up files for the joystick library
  2188         if test x$enable_joystick = xyes; then
  2189             JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS beos"
  2190             JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS beos/libjoystick_beos.la"
  2191         fi
  2192         # Set up files for the cdrom library
  2193         if test x$enable_cdrom = xyes; then
  2194             CDROM_SUBDIRS="$CDROM_SUBDIRS beos"
  2195             CDROM_DRIVERS="$CDROM_DRIVERS beos/libcdrom_beos.la"
  2196         fi
  2197         # Set up files for the thread library
  2198         if test x$enable_threads = xyes; then
  2199             COPY_ARCH_SRC(src/thread, beos, SDL_systhread.c)
  2200             COPY_ARCH_SRC(src/thread, beos, SDL_systhread_c.h)
  2201             COPY_ARCH_SRC(src/thread, generic, SDL_sysmutex.c)
  2202             COPY_ARCH_SRC(src/thread, generic, SDL_sysmutex_c.h)
  2203             COPY_ARCH_SRC(src/thread, beos, SDL_syssem.c)
  2204             COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
  2205             COPY_ARCH_SRC(src/thread, generic, SDL_syscond.c)
  2206             COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
  2207         fi
  2208         # Set up files for the timer library
  2209         if test x$enable_timers = xyes; then
  2210             COPY_ARCH_SRC(src/timer, beos, SDL_systimer.c)
  2211         fi
  2212         # The BeOS platform requires special libraries
  2213         SYSTEM_LIBS="$SYSTEM_LIBS -lroot -lbe -lmedia -lgame -ldevice -ltextencoding"
  2214         ;;
  2215     *-*-macos*)
  2216         # This would be used if cross-compiling to MacOS 9.  No way to
  2217         # use it at present, but Apple is working on a X-to-9 compiler
  2218         # for which this case would be handy.
  2219         ARCH=macos
  2220         CheckDummyVideo
  2221         CheckDiskAudio
  2222         CheckTOOLBOX
  2223         CheckMacGL
  2224         # Set up files for the main() stub
  2225         COPY_ARCH_SRC(src/main, macos, SDL_main.c)
  2226         # Set up files for the audio library
  2227         if test x$enable_audio = xyes; then
  2228             AUDIO_SUBDIRS="$AUDIO_SUBDIRS macrom"
  2229             AUDIO_DRIVERS="$AUDIO_DRIVERS macrom/libaudio_macrom.la"
  2230         fi
  2231         # Set up files for the joystick library
  2232         if test x$enable_joystick = xyes; then
  2233             JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS macos"
  2234             JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS macos/libjoystick_macos.la"
  2235         fi
  2236         # Set up files for the cdrom library
  2237         if test x$enable_cdrom = xyes; then
  2238             CDROM_SUBDIRS="$CDROM_SUBDIRS macos"
  2239             CDROM_DRIVERS="$CDROM_DRIVERS macos/libcdrom_macos.la"
  2240         fi
  2241         # Set up files for the thread library
  2242         if test x$enable_threads = xyes; then
  2243             COPY_ARCH_SRC(src/thread, macos, SDL_systhread.c)
  2244             COPY_ARCH_SRC(src/thread, macos, SDL_systhread_c.h)
  2245             COPY_ARCH_SRC(src/thread, generic, SDL_sysmutex.c)
  2246             COPY_ARCH_SRC(src/thread, generic, SDL_sysmutex_c.h)
  2247             COPY_ARCH_SRC(src/thread, macos, SDL_syssem.c)
  2248             COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
  2249             COPY_ARCH_SRC(src/thread, generic, SDL_syscond.c)
  2250             COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
  2251         fi
  2252         # Set up files for the timer library
  2253         if test x$enable_timers = xyes; then
  2254             COPY_ARCH_SRC(src/timer, macos, SDL_systimer.c)
  2255         fi
  2256         # The MacOS platform requires special setup
  2257         SDL_CFLAGS="$SDL_CFLAGS -Dmain=SDL_main"
  2258         SDL_LIBS="-lSDLmain $SDL_LIBS"
  2259         ;;
  2260     *-*-darwin* )
  2261         # Strictly speaking, we want "Mac OS X", not "Darwin", which is
  2262         # just the OS X kernel sans upper layers like Carbon and Cocoa.
  2263         # But config.guess comes back with "darwin", so go with the flow.
  2264         ARCH=macosx
  2265         CheckDummyVideo
  2266         CheckDiskAudio
  2267         CheckQUARTZ
  2268         CheckMacGL
  2269         CheckPTHREAD
  2270         # Set up files for the main() stub
  2271         COPY_ARCH_SRC(src/main, macosx, SDLMain.m)
  2272         COPY_ARCH_SRC(src/main, macosx, SDLMain.h)
  2273         # Set up files for the audio library
  2274         if test x$enable_audio = xyes; then
  2275             AUDIO_SUBDIRS="$AUDIO_SUBDIRS macrom"
  2276             AUDIO_DRIVERS="$AUDIO_DRIVERS macrom/libaudio_macrom.la"
  2277         fi
  2278         # Set up files for the joystick library
  2279         if test x$enable_joystick = xyes; then
  2280             JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS darwin"
  2281             JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS darwin/libjoystick_darwin.la"
  2282             SDL_LIBS="$SDL_LIBS -framework IOKit"
  2283         fi
  2284         # Set up files for the cdrom library
  2285         if test x$enable_cdrom = xyes; then
  2286             CDROM_SUBDIRS="$CDROM_SUBDIRS dummy"
  2287             CDROM_DRIVERS="$CDROM_DRIVERS dummy/libcdrom_dummy.la"
  2288         fi
  2289         # Set up files for the thread library
  2290         if test x$enable_threads = xyes; then
  2291             COPY_ARCH_SRC(src/thread, linux, SDL_systhread.c)
  2292             COPY_ARCH_SRC(src/thread, linux, SDL_systhread_c.h)
  2293             COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex.c)
  2294             COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex_c.h)
  2295             if test x$use_pthreads = xyes -a x$have_pthread_sem != xyes; then
  2296                 COPY_ARCH_SRC(src/thread, generic, SDL_syssem.c)
  2297             else
  2298                 COPY_ARCH_SRC(src/thread, linux, SDL_syssem.c)
  2299             fi
  2300             COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
  2301             COPY_ARCH_SRC(src/thread, generic, SDL_syscond.c)
  2302             COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
  2303         fi
  2304         # Set up files for the timer library
  2305         if test x$enable_timers = xyes; then
  2306             COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
  2307         fi
  2308         # The MacOS X platform requires special setup
  2309         SDL_CFLAGS="$SDL_CFLAGS -F/System/Library/Frameworks/Carbon.framework -F/System/Library/Frameworks/Cocoa.framework"
  2310         SDL_LIBS="-lSDLmain $SDL_LIBS -framework Carbon -framework Cocoa"
  2311         ;;
  2312     *-*-mint*)
  2313         ARCH=mint
  2314         CheckDummyVideo
  2315         CheckDiskAudio
  2316         CheckAtariBiosEvent
  2317         CheckAtariXbiosVideo
  2318         CheckAtariGemVideo
  2319         CheckPTH
  2320         # Set up files for the main() stub
  2321         COPY_ARCH_SRC(src/main, linux, SDL_main.c)
  2322         # Set up files for the audio library
  2323         if test x$enable_audio = xyes; then
  2324             AUDIO_SUBDIRS="$AUDIO_SUBDIRS sun"
  2325             AUDIO_DRIVERS="$AUDIO_DRIVERS sun/libaudio_sun.la"
  2326         fi
  2327         # Set up files for the joystick library
  2328         if test x$enable_joystick = xyes; then
  2329             JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS mint"
  2330             JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS mint/libjoystick_mint.la"
  2331         fi
  2332         # Set up files for the cdrom library
  2333         if test x$enable_cdrom = xyes; then
  2334             CDROM_SUBDIRS="$CDROM_SUBDIRS dummy"
  2335             CDROM_DRIVERS="$CDROM_DRIVERS dummy/libcdrom_dummy.la"
  2336         fi
  2337         # Set up files for the thread library
  2338         if test x$enable_threads = xyes; then
  2339             if test x$enable_pth = xyes; then
  2340                 COPY_ARCH_SRC(src/thread, pth, SDL_systhread.c)
  2341                 COPY_ARCH_SRC(src/thread, pth, SDL_systhread_c.h)
  2342                 COPY_ARCH_SRC(src/thread, pth, SDL_sysmutex.c)
  2343                 COPY_ARCH_SRC(src/thread, pth, SDL_sysmutex_c.h)
  2344                 COPY_ARCH_SRC(src/thread, pth, SDL_syscond.c)
  2345                 COPY_ARCH_SRC(src/thread, pth, SDL_syscond_c.h)
  2346             else
  2347                 COPY_ARCH_SRC(src/thread, generic, SDL_systhread.c)
  2348                 COPY_ARCH_SRC(src/thread, generic, SDL_systhread_c.h)
  2349                 COPY_ARCH_SRC(src/thread, generic, SDL_sysmutex.c)
  2350                 COPY_ARCH_SRC(src/thread, generic, SDL_sysmutex_c.h)
  2351                 COPY_ARCH_SRC(src/thread, generic, SDL_syscond.c)
  2352                 COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
  2353             fi
  2354             COPY_ARCH_SRC(src/thread, generic, SDL_syssem.c)
  2355             COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
  2356         fi
  2357         # Set up files for the timer library
  2358         if test x$enable_timers = xyes; then
  2359             COPY_ARCH_SRC(src/timer, mint, SDL_systimer.c)
  2360             COPY_ARCH_SRC(src/timer, mint, SDL_vbltimer.S)
  2361             COPY_ARCH_SRC(src/timer, mint, SDL_vbltimer_s.h)
  2362         fi
  2363         # MiNT does not define "unix"
  2364         CFLAGS="$CFLAGS -Dunix"
  2365         ;;
  2366     *)
  2367         AC_MSG_ERROR(Unsupported target:  Please add to configure.in)
  2368         ;;
  2369 esac
  2370 AC_SUBST(ARCH)
  2371 
  2372 # Set the conditional variables for this target
  2373 AM_CONDITIONAL(TARGET_LINUX, test $ARCH = linux)
  2374 AM_CONDITIONAL(TARGET_QTOPIA, test "x$video_qtopia" = "xyes")
  2375 AM_CONDITIONAL(TARGET_SOLARIS, test $ARCH = solaris)
  2376 AM_CONDITIONAL(TARGET_IRIX, test $ARCH = irix)
  2377 AM_CONDITIONAL(TARGET_BSDI, test $ARCH = bsdi)
  2378 AM_CONDITIONAL(TARGET_FREEBSD, test $ARCH = freebsd)
  2379 AM_CONDITIONAL(TARGET_NETBSD, test $ARCH = netbsd)
  2380 AM_CONDITIONAL(TARGET_OPENBSD, test $ARCH = openbsd)
  2381 AM_CONDITIONAL(TARGET_AIX, test $ARCH = aix)
  2382 AM_CONDITIONAL(TARGET_WIN32, test $ARCH = win32)
  2383 AM_CONDITIONAL(TARGET_BEOS, test $ARCH = beos)
  2384 AM_CONDITIONAL(TARGET_MACOS, test $ARCH = macos)
  2385 AM_CONDITIONAL(TARGET_MACOSX, test $ARCH = macosx)
  2386 AM_CONDITIONAL(TARGET_QNX, test $ARCH = qnx)
  2387 AM_CONDITIONAL(TARGET_MINT, test $ARCH = mint)
  2388 
  2389 # Set conditional variables for shared and static library selection.
  2390 # These are not used in any Makefile.am but in sdl-config.in.
  2391 AM_CONDITIONAL([ENABLE_SHARED], [test "$enable_shared" = yes])
  2392 AM_CONDITIONAL([ENABLE_STATIC], [test "$enable_static" = yes])
  2393 
  2394 # Set runtime shared library paths as needed
  2395 
  2396 if test $ARCH = linux -o $ARCH = freebsd -o $ARCH = bsdi; then
  2397   SDL_RLD_FLAGS="-Wl,-rpath,\${exec_prefix}/lib"
  2398 fi
  2399 if test $ARCH = solaris; then
  2400   SDL_RLD_FLAGS="-R\${exec_prefix}/lib"
  2401 fi
  2402 if test $ARCH = openbsd -o $ARCH = bsdi; then
  2403     SHARED_SYSTEM_LIBS="$SYSTEM_LIBS"
  2404 else
  2405     SHARED_SYSTEM_LIBS=""
  2406 fi
  2407 STATIC_SYSTEM_LIBS="$SYSTEM_LIBS"
  2408 
  2409 dnl Output the video drivers we use
  2410 if test x$enable_video = xtrue; then
  2411     if test "$VIDEO_SUBDIRS" = ""; then
  2412         AC_MSG_ERROR(*** No video drivers are enabled!)
  2413     fi
  2414 fi
  2415 AC_SUBST(AUDIO_SUBDIRS)
  2416 AC_SUBST(AUDIO_DRIVERS)
  2417 AC_SUBST(VIDEO_SUBDIRS)
  2418 AC_SUBST(VIDEO_DRIVERS)
  2419 AC_SUBST(JOYSTICK_SUBDIRS)
  2420 AC_SUBST(JOYSTICK_DRIVERS)
  2421 AC_SUBST(CDROM_SUBDIRS)
  2422 AC_SUBST(CDROM_DRIVERS)
  2423 AC_SUBST(SDL_EXTRADIRS)
  2424 AC_SUBST(SDL_EXTRALIBS)
  2425 
  2426 dnl Expand the cflags and libraries needed by apps using SDL
  2427 AC_SUBST(SDL_CFLAGS)
  2428 AC_SUBST(SDL_LIBS)
  2429 AC_SUBST(SDL_RLD_FLAGS)
  2430 
  2431 dnl Expand the libraries needed for static and dynamic linking
  2432 AC_SUBST(STATIC_SYSTEM_LIBS)
  2433 AC_SUBST(SHARED_SYSTEM_LIBS)
  2434 AC_SUBST(SYSTEM_LIBS)
  2435 
  2436 dnl Expand the include directories for building SDL
  2437 CFLAGS="$CFLAGS -I\$(top_srcdir)/include"
  2438 CFLAGS="$CFLAGS -I\$(top_srcdir)/include/SDL"
  2439 CFLAGS="$CFLAGS -I\$(top_srcdir)/src -I\$(top_srcdir)/src/$ARCH"
  2440 CFLAGS="$CFLAGS -I\$(top_srcdir)/src/main"
  2441 CFLAGS="$CFLAGS -I\$(top_srcdir)/src/audio"
  2442 CFLAGS="$CFLAGS -I\$(top_srcdir)/src/video"
  2443 CFLAGS="$CFLAGS -I\$(top_srcdir)/src/video/XFree86/extensions"
  2444 CFLAGS="$CFLAGS -I\$(top_srcdir)/src/events"
  2445 CFLAGS="$CFLAGS -I\$(top_srcdir)/src/joystick"
  2446 CFLAGS="$CFLAGS -I\$(top_srcdir)/src/cdrom"
  2447 CFLAGS="$CFLAGS -I\$(top_srcdir)/src/thread"
  2448 CFLAGS="$CFLAGS -I\$(top_srcdir)/src/timer"
  2449 CFLAGS="$CFLAGS -I\$(top_srcdir)/src/endian"
  2450 CFLAGS="$CFLAGS -I\$(top_srcdir)/src/file"
  2451 CXXFLAGS="$CFLAGS"
  2452 
  2453 
  2454 # Check for darwin at the very end and set up the Objective C compiler
  2455 # We do this here so that we get the full CFLAGS into OBJCFLAGS
  2456 case "$target" in
  2457     *-*-darwin*)
  2458         OBJC="cc"
  2459         OBJCFLAGS="$CFLAGS"
  2460         OBJCDEPMODE="$CCDEPMODE"
  2461         AC_SUBST(OBJC)
  2462         AC_SUBST(OBJCFLAGS)
  2463         AC_SUBST(OBJCDEPMODE)
  2464         ;;
  2465 esac
  2466 
  2467 # Finally create all the generated files
  2468 dnl Important: Any directory that you want to be in the distcheck should
  2469 dnl            have a file listed here, so that configure generates the
  2470 dnl            subdirectories on the build target.
  2471 AC_OUTPUT([
  2472 Makefile
  2473 docs/Makefile
  2474 docs/html/Makefile
  2475 docs/man3/Makefile
  2476 include/Makefile
  2477 src/Makefile
  2478 src/main/Makefile
  2479 src/main/macosx/Makefile
  2480 src/main/macosx/Info.plist
  2481 src/audio/Makefile
  2482 src/audio/alsa/Makefile
  2483 src/audio/arts/Makefile
  2484 src/audio/baudio/Makefile
  2485 src/audio/dma/Makefile
  2486 src/audio/dmedia/Makefile
  2487 src/audio/dsp/Makefile
  2488 src/audio/esd/Makefile
  2489 src/audio/macrom/Makefile
  2490 src/audio/nas/Makefile
  2491 src/audio/nto/Makefile
  2492 src/audio/openbsd/Makefile
  2493 src/audio/paudio/Makefile
  2494 src/audio/sun/Makefile
  2495 src/audio/ums/Makefile
  2496 src/audio/windib/Makefile
  2497 src/audio/windx5/Makefile
  2498 src/audio/disk/Makefile
  2499 src/video/Makefile
  2500 src/video/XFree86/Makefile
  2501 src/video/XFree86/extensions/Makefile
  2502 src/video/XFree86/Xinerama/Makefile
  2503 src/video/XFree86/Xv/Makefile
  2504 src/video/XFree86/Xxf86dga/Makefile
  2505 src/video/XFree86/Xxf86vm/Makefile
  2506 src/video/cybergfx/Makefile
  2507 src/video/x11/Makefile
  2508 src/video/dga/Makefile
  2509 src/video/nanox/Makefile
  2510 src/video/fbcon/Makefile
  2511 src/video/directfb/Makefile
  2512 src/video/ps2gs/Makefile
  2513 src/video/ggi/Makefile
  2514 src/video/maccommon/Makefile
  2515 src/video/macdsp/Makefile
  2516 src/video/macrom/Makefile
  2517 src/video/quartz/Makefile
  2518 src/video/svga/Makefile
  2519 src/video/vgl/Makefile
  2520 src/video/aalib/Makefile
  2521 src/video/wincommon/Makefile
  2522 src/video/windib/Makefile
  2523 src/video/windx5/Makefile
  2524 src/video/bwindow/Makefile
  2525 src/video/photon/Makefile
  2526 src/video/epoc/Makefile
  2527 src/video/dummy/Makefile
  2528 src/video/ataricommon/Makefile
  2529 src/video/xbios/Makefile
  2530 src/video/gem/Makefile
  2531 src/video/qtopia/Makefile
  2532 src/events/Makefile
  2533 src/joystick/Makefile
  2534 src/joystick/amigaos/Makefile
  2535 src/joystick/beos/Makefile
  2536 src/joystick/bsd/Makefile
  2537 src/joystick/darwin/Makefile
  2538 src/joystick/dummy/Makefile
  2539 src/joystick/linux/Makefile
  2540 src/joystick/macos/Makefile
  2541 src/joystick/mint/Makefile
  2542 src/joystick/win32/Makefile
  2543 src/cdrom/Makefile
  2544 src/cdrom/aix/Makefile
  2545 src/cdrom/beos/Makefile
  2546 src/cdrom/dummy/Makefile
  2547 src/cdrom/bsdi/Makefile
  2548 src/cdrom/freebsd/Makefile
  2549 src/cdrom/linux/Makefile
  2550 src/cdrom/macos/Makefile
  2551 src/cdrom/openbsd/Makefile
  2552 src/cdrom/qnx/Makefile
  2553 src/cdrom/win32/Makefile
  2554 src/thread/Makefile
  2555 src/timer/Makefile
  2556 src/endian/Makefile
  2557 src/file/Makefile
  2558 src/hermes/Makefile
  2559 sdl-config
  2560 SDL.spec
  2561 ], [chmod +x sdl-config])