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