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