configure.in
上传用户:sun1608
上传日期:2007-02-02
资源大小:6116k
文件大小:90k
源码类别:

流媒体/Mpeg4/MP4

开发平台:

Visual C++

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