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