configure.in
author Sam Lantinga
Sat, 16 Jun 2001 01:51:42 +0000
changeset 68 ac6645260d31
parent 53 25dfe480c75e
child 70 f590dd383b5d
permissions -rw-r--r--
Added an audio driver that writes to disk (thanks Ryan!)
     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=1
    18 SDL_INTERFACE_AGE=1
    19 SDL_BINARY_AGE=1
    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 case "$target" in
    56     *-*-beos*)
    57         AC_PROG_CXX
    58         ;;
    59     *-*-aix*)
    60         AC_PROG_CXX
    61         ;;
    62     # This is stupid, but necessary on some versions of Linux (joysticks)
    63     *-*-linux*)
    64         AC_PROG_CXX
    65         ;;
    66     *-*-darwin*)
    67         OBJC="???"
    68         AC_SUBST(OBJC)
    69         ;;
    70 esac
    71 AC_PROG_INSTALL
    72 AC_FUNC_ALLOCA
    73 
    74 dnl The alpha architecture needs special flags for binary portability
    75 case "$target" in
    76     alpha*-*-linux*)
    77         if test x$ac_cv_prog_gcc = xyes; then
    78             CFLAGS="$CFLAGS -mcpu=ev4 -Wa,-mall"
    79         fi
    80         ;;
    81 esac
    82 
    83 dnl Add compiler-specific optimization flags
    84 
    85 dnl See if the user wants aggressive optimizations of the code
    86 AC_ARG_ENABLE(debug,
    87 [  --enable-debug          Disable aggressive optimizations [default=yes]],
    88               , enable_debug=yes)
    89 if test x$enable_debug != xyes; then
    90     if test x$ac_cv_prog_gcc = xyes; then
    91         CFLAGS="$CFLAGS -fexpensive-optimizations"
    92         # Ack! This breaks the MMX YV12 conversion on gcc 2.95.2
    93         # CFLAGS="$CFLAGS -fomit-frame-pointer"
    94     fi
    95     case "$target" in
    96         i486-*-*)
    97             if test x$ac_cv_prog_gcc = xyes; then
    98                 CFLAGS="$CFLAGS -march=486"
    99             fi
   100             ;;
   101         i?86-*-*)
   102             if test x$ac_cv_prog_gcc = xyes; then
   103                 CFLAGS="$CFLAGS -march=pentium -mcpu=pentiumpro"
   104             fi
   105             ;;
   106         *-*-osf*)
   107             if test x$ac_cv_prog_gcc != xyes; then
   108                 CFLAGS="-g3 -fast -arch host"
   109             fi
   110             ;;
   111     esac
   112 fi
   113 
   114 dnl Add verbose warnings by default, and allow ANSI compliance checking
   115 AC_ARG_ENABLE(strict-ansi,
   116 [  --enable-strict-ansi    Enable strict ANSI compliance build [default=no]],
   117               , enable_strict_ansi=no)
   118 if test x$ac_cv_prog_gcc = xyes; then
   119     CFLAGS="$CFLAGS -Wall"
   120     if test x$enable_strict_ansi = xyes; then
   121         CFLAGS="$CFLAGS -ansi -pedantic -D_XOPEN_SOURCE"
   122     fi
   123 fi
   124 
   125 dnl Initialize the compiler and linker flags for SDL applications
   126 
   127 SDL_CFLAGS=""
   128 SDL_LIBS="-lSDL"
   129 
   130 dnl Add the math library for the new gamma correction support
   131 
   132 case "$target" in
   133     *-*-cygwin* | *-*-mingw32*)
   134         MATHLIB=""
   135         ;;
   136     *-*-beos*)
   137         MATHLIB=""
   138         ;;
   139     *-*-darwin*)
   140         MATHLIB=""
   141         ;;
   142     *)
   143         MATHLIB="-lm"
   144         ;;
   145 esac
   146 SYSTEM_LIBS="$SYSTEM_LIBS $MATHLIB"
   147 
   148 dnl Enable/disable various subsystems of the SDL library
   149 
   150 AC_ARG_ENABLE(audio,
   151 [  --enable-audio          Enable the audio subsystem [default=yes]],
   152               , enable_audio=yes)
   153 if test x$enable_audio = xyes; then
   154     SDL_EXTRADIRS="$SDL_EXTRADIRS audio"
   155     SDL_EXTRALIBS="$SDL_EXTRALIBS audio/libaudio.la"
   156 else
   157     CFLAGS="$CFLAGS -DDISABLE_AUDIO"
   158 fi
   159 AC_ARG_ENABLE(video,
   160 [  --enable-video          Enable the video subsystem [default=yes]],
   161               , enable_video=yes)
   162 if test x$enable_video = xyes; then
   163     SDL_EXTRADIRS="$SDL_EXTRADIRS video"
   164     SDL_EXTRALIBS="$SDL_EXTRALIBS video/libvideo.la"
   165 else
   166     CFLAGS="$CFLAGS -DDISABLE_VIDEO"
   167 fi
   168 AC_ARG_ENABLE(events,
   169 [  --enable-events         Enable the events subsystem [default=yes]],
   170               , enable_events=yes)
   171 if test x$enable_video = xyes -a x$enable_events = xyes; then
   172     SDL_EXTRADIRS="$SDL_EXTRADIRS events"
   173     SDL_EXTRALIBS="$SDL_EXTRALIBS events/libevents.la"
   174 else
   175     CFLAGS="$CFLAGS -DDISABLE_EVENTS"
   176 fi
   177 AC_ARG_ENABLE(joystick,
   178 [  --enable-joystick       Enable the joystick subsystem [default=yes]],
   179               , enable_joystick=yes)
   180 if test x$enable_joystick = xyes; then
   181     SDL_EXTRADIRS="$SDL_EXTRADIRS joystick"
   182     SDL_EXTRALIBS="$SDL_EXTRALIBS joystick/libjoystick.la"
   183 else
   184     CFLAGS="$CFLAGS -DDISABLE_JOYSTICK"
   185 fi
   186 AC_ARG_ENABLE(cdrom,
   187 [  --enable-cdrom          Enable the cdrom subsystem [default=yes]],
   188               , enable_cdrom=yes)
   189 if test x$enable_cdrom = xyes; then
   190     SDL_EXTRADIRS="$SDL_EXTRADIRS cdrom"
   191     SDL_EXTRALIBS="$SDL_EXTRALIBS cdrom/libcdrom.la"
   192 else
   193     CFLAGS="$CFLAGS -DDISABLE_CDROM"
   194 fi
   195 AC_ARG_ENABLE(threads,
   196 [  --enable-threads        Enable the threading subsystem [default=yes]],
   197               , enable_threads=yes)
   198 SDL_EXTRADIRS="$SDL_EXTRADIRS thread"
   199 SDL_EXTRALIBS="$SDL_EXTRALIBS thread/libthread.la"
   200 if test x$enable_threads != xyes; then
   201     CFLAGS="$CFLAGS -DDISABLE_THREADS"
   202     COPY_ARCH_SRC(src/thread, generic, SDL_systhread.c)
   203     COPY_ARCH_SRC(src/thread, generic, SDL_systhread_c.h)
   204     COPY_ARCH_SRC(src/thread, generic, SDL_sysmutex.c)
   205     COPY_ARCH_SRC(src/thread, generic, SDL_sysmutex_c.h)
   206     COPY_ARCH_SRC(src/thread, generic, SDL_syssem.c)
   207     COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
   208     COPY_ARCH_SRC(src/thread, generic, SDL_syscond.c)
   209     COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
   210 fi
   211 AC_ARG_ENABLE(timers,
   212 [  --enable-timers         Enable the timer subsystem [default=yes]],
   213               , enable_timers=yes)
   214 if test x$enable_timers = xyes; then
   215     SDL_EXTRADIRS="$SDL_EXTRADIRS timer"
   216     SDL_EXTRALIBS="$SDL_EXTRALIBS timer/libtimer.la"
   217 else
   218     CFLAGS="$CFLAGS -DDISABLE_TIMERS"
   219 fi
   220 AC_ARG_ENABLE(endian,
   221 [  --enable-endian         Enable the endian subsystem [default=yes]],
   222               , enable_endian=yes)
   223 if test x$enable_endian = xyes; then
   224     SDL_EXTRADIRS="$SDL_EXTRADIRS endian"
   225     SDL_EXTRALIBS="$SDL_EXTRALIBS endian/libendian.la"
   226 else
   227     CFLAGS="$CFLAGS -DDISABLE_ENDIAN"
   228 fi
   229 AC_ARG_ENABLE(file,
   230 [  --enable-file           Enable the file subsystem [default=yes]],
   231               , enable_file=yes)
   232 if test x$enable_file = xyes; then
   233     SDL_EXTRADIRS="$SDL_EXTRADIRS file"
   234     SDL_EXTRALIBS="$SDL_EXTRALIBS file/libfile.la"
   235 else
   236     CFLAGS="$CFLAGS -DDISABLE_FILE"
   237 fi
   238 
   239 dnl See if the OSS audio interface is supported
   240 CheckOSS()
   241 {
   242     AC_ARG_ENABLE(oss,
   243 [  --enable-oss            support the OSS audio API [default=yes]],
   244                   , enable_oss=yes)
   245     if test x$enable_audio = xyes -a x$enable_oss = xyes; then
   246         AC_MSG_CHECKING(for OSS audio support)
   247         have_oss=no
   248         AC_TRY_COMPILE([
   249           #include <sys/soundcard.h>
   250         ],[
   251           int arg = SNDCTL_DSP_SETFRAGMENT;
   252         ],[
   253         have_oss=yes
   254         ])
   255         AC_MSG_RESULT($have_oss)
   256         if test x$have_oss = xyes; then
   257             CFLAGS="$CFLAGS -DOSS_SUPPORT"
   258             AUDIO_SUBDIRS="$AUDIO_SUBDIRS dsp"
   259             AUDIO_DRIVERS="$AUDIO_DRIVERS dsp/libaudio_dsp.la"
   260             AUDIO_SUBDIRS="$AUDIO_SUBDIRS dma"
   261             AUDIO_DRIVERS="$AUDIO_DRIVERS dma/libaudio_dma.la"
   262         fi
   263     fi
   264 }
   265 
   266 dnl See if the ALSA audio interface is supported
   267 CheckALSA()
   268 {
   269     AC_ARG_ENABLE(alsa,
   270 [  --enable-alsa           support the ALSA audio API [default=yes]],
   271                   , enable_alsa=yes)
   272     if test x$enable_audio = xyes -a x$enable_alsa = xyes; then
   273         have_alsa=no
   274         AC_CHECK_HEADER(sys/asoundlib.h, have_alsa_hdr=yes)
   275         AC_CHECK_LIB(asound, snd_pcm_open, have_alsa_lib=yes)
   276         if test x$have_alsa_hdr = xyes -a x$have_alsa_lib = xyes; then
   277             CFLAGS="$CFLAGS -DALSA_SUPPORT"
   278             SYSTEM_LIBS="$SYSTEM_LIBS -lasound"
   279             AUDIO_SUBDIRS="$AUDIO_SUBDIRS alsa"
   280             AUDIO_DRIVERS="$AUDIO_DRIVERS alsa/libaudio_alsa.la"
   281         fi
   282     fi
   283 }
   284 
   285 dnl Check whether we want to use OpenBSD native audio or not
   286 CheckOPENBSDAUDIO()
   287 {
   288     AC_ARG_ENABLE(openbsdaudio,
   289 [  --enable-openbsdaudio   OpenBSD native audio support [default=no]],
   290                   , enable_openbsdaudio=no)
   291     if test x$enable_audio = xyes -a x$enable_openbsdaudio = xyes; then
   292         SYSTEM_LIBS="$SYSTEM_LIBS $ESD_LIBS"
   293         AUDIO_SUBDIRS="$AUDIO_SUBDIRS openbsd"
   294         AUDIO_DRIVERS="$AUDIO_DRIVERS openbsd/libaudio_openbsd.la"
   295     fi
   296 }
   297 
   298 dnl Find the ESD includes and libraries
   299 CheckESD()
   300 {
   301     AC_ARG_ENABLE(esd,
   302 [  --enable-esd            support the Enlightened Sound Daemon [default=yes]],
   303                   , enable_esd=yes)
   304     if test x$enable_audio = xyes -a x$enable_esd = xyes; then
   305         AM_PATH_ESD(0.2.8, [
   306             CFLAGS="$CFLAGS -DESD_SUPPORT $ESD_CFLAGS"
   307             SYSTEM_LIBS="$SYSTEM_LIBS $ESD_LIBS"
   308             AUDIO_SUBDIRS="$AUDIO_SUBDIRS esd"
   309             AUDIO_DRIVERS="$AUDIO_DRIVERS esd/libaudio_esd.la"
   310         ])
   311     fi
   312 }
   313 
   314 CheckARTSC()
   315 {
   316     AC_ARG_ENABLE(arts,
   317 [  --enable-arts           support the Analog Real Time Synthesizer [default=yes]],
   318                   , enable_arts=yes)
   319     if test x$enable_audio = xyes -a x$enable_arts = xyes; then
   320         AC_PATH_PROG(ARTSCCONFIG, artsc-config)
   321         if test x$ARTSCCONFIG = x -o x$ARTSCCONFIG = x'"$ARTSCCONFIG"'; then
   322             : # arts isn't installed
   323         else
   324             ARTSC_CFLAGS=`$ARTSCCONFIG --cflags`
   325             ARTSC_LIBS=`$ARTSCCONFIG --libs`
   326             AC_MSG_CHECKING(for aRts development environment)
   327             audio_arts=no
   328             save_CFLAGS="$CFLAGS"
   329             CFLAGS="$CFLAGS $ARTSC_CFLAGS"
   330             AC_TRY_COMPILE([
   331              #include <artsc.h>
   332             ],[
   333              arts_stream_t stream;
   334             ],[
   335             audio_arts=yes
   336             ])
   337             CFLAGS="$save_CFLAGS"
   338             AC_MSG_RESULT($audio_arts)
   339             if test x$audio_arts = xyes; then
   340                 CFLAGS="$CFLAGS -DARTSC_SUPPORT $ARTSC_CFLAGS"
   341                 SYSTEM_LIBS="$SYSTEM_LIBS $ARTSC_LIBS"
   342                 AUDIO_SUBDIRS="$AUDIO_SUBDIRS arts"
   343                 AUDIO_DRIVERS="$AUDIO_DRIVERS arts/libaudio_arts.la"
   344             fi
   345         fi
   346     fi
   347 }
   348 
   349 dnl See if the NAS audio interface is supported
   350 CheckNAS()
   351 {
   352     AC_ARG_ENABLE(nas,
   353 [  --enable-nas		  support the NAS audio API [default=yes]],
   354                   , enable_nas=yes)
   355     if test x$enable_audio = xyes -a x$enable_nas = xyes; then
   356         AC_MSG_CHECKING(for NAS audio support)
   357         have_nas=no
   358         if test -r /usr/X11R6/include/audio/audiolib.h; then
   359             have_nas=yes
   360         fi
   361         AC_MSG_RESULT($have_nas)
   362         if test x$have_nas = xyes; then
   363             CFLAGS="$CFLAGS -DNAS_SUPPORT"
   364             SYSTEM_LIBS="$SYSTEM_LIBS -laudio -lXt"
   365             AUDIO_SUBDIRS="$AUDIO_SUBDIRS nas"
   366             AUDIO_DRIVERS="$AUDIO_DRIVERS nas/libaudio_nas.la"
   367         fi
   368     fi
   369 }
   370 
   371 
   372 dnl rcg07142001 See if the user wants the disk writer audio driver...
   373 CheckDiskAudio()
   374 {
   375     AC_ARG_ENABLE(diskaudio,
   376 [  --enable-diskaudio  	  support the disk writer audio driver [default=no]],
   377                   , enable_diskaudio=no)
   378     if test x$enable_audio = xyes -a x$enable_diskaudio = xyes; then
   379         CFLAGS="$CFLAGS -DDISKAUD_SUPPORT"
   380         AUDIO_SUBDIRS="$AUDIO_SUBDIRS disk"
   381         AUDIO_DRIVERS="$AUDIO_DRIVERS disk/libaudio_disk.la"
   382     fi
   383 }
   384 
   385 
   386 dnl See if we can use x86 assembly blitters
   387 CheckNASM()
   388 {
   389     dnl Make sure we are running on an x86 platform
   390     case $target in
   391         i?86*)
   392             ;;
   393         *)
   394         # Nope, bail early.
   395             return
   396             ;;
   397     esac
   398     dnl Check for NASM (for assembly blit routines)
   399     AC_ARG_ENABLE(nasm,
   400 [  --enable-nasm           use nasm assembly blitters on x86 [default=yes]],
   401                   , enable_nasm=yes)
   402     if test x$enable_video = xyes -a x$enable_nasm = xyes; then
   403         AC_PATH_PROG(NASM, nasm)
   404         if test x$NASM = x -o x$NASM = x'"$NASM"'; then
   405             : # nasm isn't installed
   406         else
   407             CFLAGS="$CFLAGS -DUSE_ASMBLIT -I$srcdir/hermes"
   408             case $ARCH in
   409               win32)
   410                   NASMFLAGS="-f win32"
   411                   ;;
   412               *)
   413                   NASMFLAGS="-f elf"
   414                   ;;
   415             esac
   416             AC_SUBST(NASMFLAGS)
   417             CFLAGS="$CFLAGS -I\$(top_srcdir)/src/hermes"
   418             SDL_EXTRADIRS="$SDL_EXTRADIRS hermes"
   419             SDL_EXTRALIBS="$SDL_EXTRALIBS hermes/libhermes.la"
   420         fi
   421     fi
   422 }
   423 
   424 dnl Find the nanox include and library directories
   425 CheckNANOX()
   426 {
   427 	AC_ARG_ENABLE(video-nanox,
   428 		[  --enable-video-nanox use nanox video driver [default=no]],
   429 	        , enable_video_nanox=no)
   430 	AC_ARG_ENABLE(nanox-debug,  
   431 		[  --enable-nanox-debug print debug messages [default=no]],
   432 		, enable_nanox_debug=no)
   433 	AC_ARG_ENABLE(nanox-share-memory,  
   434 		[  --enable-nanox-share-memory use share memory [default=no]],
   435 		, enable_nanox_share_memory=no)
   436 
   437 	AC_ARG_WITH(nanox_pixel_type, 
   438 		[  --with-nanox-pixel-type=[rgb/0888/888/565/555/332/pal]])
   439 
   440 	if test x$enable_video = xyes -a x$enable_video_nanox = xyes; then
   441 		if test x$enable_nanox_debug = xyes; then
   442 			CFLAGS="$CFLAGS -DENABLE_NANOX_DEBUG"
   443 		fi
   444 
   445 		if test x$enable_nanox_share_memory = xyes; then
   446 			CFLAGS="$CFLAGS -DNANOX_SHARE_MEMORY"
   447 		fi
   448 
   449 		case "$with_nanox_pixel_type" in
   450 			 rgb) CFLAGS="$CFLAGS -DNANOX_PIXEL_RGB" ;;
   451 			0888) CFLAGS="$CFLAGS -DNANOX_PIXEL_0888" ;;
   452 			 888) CFLAGS="$CFLAGS -DNANOX_PIXEL_888"  ;;
   453 			 565) CFLAGS="$CFLAGS -DNANOX_PIXEL_565"  ;;
   454 			 555) CFLAGS="$CFLAGS -DNANOX_PIXEL_555"  ;;
   455 			 332) CFLAGS="$CFLAGS -DNANOX_PIXEL_332"  ;;
   456 			 pal) CFLAGS="$CFLAGS -DNANOX_PIXEL_PAL"  ;;
   457 			   *) AC_MSG_ERROR([Invalid nanox_pixel_type]);;
   458 		esac
   459 
   460 		CFLAGS="$CFLAGS $X_CFLAGS -DENABLE_NANOX"
   461 		SYSTEM_LIBS="$SYSTEM_LIBS -lnano-X"
   462 		VIDEO_SUBDIRS="$VIDEO_SUBDIRS nanox"
   463 		VIDEO_DRIVERS="$VIDEO_DRIVERS nanox/libvideo_nanox.la"
   464 	fi
   465 }
   466 
   467 dnl Find the X11 include and library directories
   468 CheckX11()
   469 {
   470     AC_ARG_ENABLE(video-x11,
   471 [  --enable-video-x11      use X11 video driver [default=yes]],
   472                   , enable_video_x11=yes)
   473     if test x$enable_video = xyes -a x$enable_video_x11 = xyes; then
   474         AC_PATH_X
   475         AC_PATH_XTRA
   476         if test x$have_x = xyes; then
   477             CFLAGS="$CFLAGS $X_CFLAGS -DENABLE_X11"
   478             if test x$ac_cv_func_shmat != xyes; then
   479                 CFLAGS="$CFLAGS -DNO_SHARED_MEMORY"
   480             fi
   481             SYSTEM_LIBS="$SYSTEM_LIBS $X_LIBS -lX11 -lXext"
   482             VIDEO_SUBDIRS="$VIDEO_SUBDIRS x11"
   483             VIDEO_DRIVERS="$VIDEO_DRIVERS x11/libvideo_x11.la"
   484 
   485             AC_ARG_ENABLE(video-x11-vm,
   486 [  --enable-video-x11-vm   use X11 VM extension for fullscreen [default=yes]],
   487                           , enable_video_x11_vm=yes)
   488             if test x$enable_video_x11_vm = xyes; then
   489                 AC_MSG_CHECKING(for XFree86 VidMode 1.0 support)
   490                 video_x11_vm=no
   491                 AC_TRY_COMPILE([
   492                  #include <X11/Xlib.h>
   493                  #include <X11/extensions/xf86vmode.h>
   494                 ],[
   495                 ],[
   496                 video_x11_vm=yes
   497                 ])
   498                 AC_MSG_RESULT($video_x11_vm)
   499                 if test x$video_x11_vm = xyes; then
   500                     CFLAGS="$CFLAGS -DXFREE86_VM"
   501                     # Check for nasty XFree86 4.0/Glide hack
   502                     AC_ARG_ENABLE(xfree86_glidehack,
   503 [  --enable-xfree86-glidehack Alternate vidmode lib for old Glide [default=no]],
   504                                   , enable_xfreeglidehack=no)
   505                     if test x$enable_xfree86_glidehack = xyes; then
   506                         ac_save_libs="$LIBS"
   507                         LIBS="$LIBS $X_LIBS -lX11 -lXext"
   508                         if test x$xfree86_glidehack = x; then
   509                             AC_CHECK_LIB(Xxf86vm, XF40VidModeQueryExtension, xfree86_glidehack=Xxf86vm)
   510                         fi
   511                         if test x$xfree86_glidehack = x; then
   512                             AC_CHECK_LIB(Xxf86vm40, XF40VidModeQueryExtension, xfree86_glidehack=Xxf86vm40)
   513                         fi
   514                         LIBS="$ac_save_libs"
   515                     fi
   516                     if test x$xfree86_glidehack != x; then
   517                         CFLAGS="$CFLAGS -DXFREE86_VM_DYNAMIC_HACK"
   518                         SYSTEM_LIBS="$SYSTEM_LIBS -l$xfree86_glidehack"
   519                     else
   520                         SYSTEM_LIBS="$SYSTEM_LIBS -lXxf86vm"
   521                     fi
   522                     AC_MSG_CHECKING(for XFree86 VidMode gamma support)
   523                     video_x11_vmgamma=no
   524                     AC_TRY_COMPILE([
   525                      #include <X11/Xlib.h>
   526                      #include <X11/extensions/xf86vmode.h>
   527                     ],[
   528                      XF86VidModeGamma gamma;
   529                     ],[
   530                     video_x11_vmgamma=yes
   531                     ])
   532                     AC_MSG_RESULT($video_x11_vmgamma)
   533                     if test x$video_x11_vmgamma = xyes; then
   534                         CFLAGS="$CFLAGS -DXFREE86_VMGAMMA"
   535                     fi
   536                 fi
   537             fi
   538             AC_ARG_ENABLE(dga,
   539 [  --enable-dga            allow use of X11 DGA code [default=yes]],
   540                           , enable_dga=yes)
   541             AC_ARG_ENABLE(video-x11-dgamouse,
   542 [  --enable-video-x11-dgamouse  use X11 DGA for mouse events [default=yes]],
   543                           , enable_video_x11_dgamouse=yes)
   544             if test x$enable_dga = xyes; then
   545                 AC_MSG_CHECKING(for XFree86 DGA 1.0 support)
   546                 video_x11_dga=no
   547                 AC_TRY_COMPILE([
   548                  #include <X11/Xlib.h>
   549                  #include <X11/extensions/xf86dga.h>
   550                 ],[
   551                 ],[
   552                 video_x11_dga=yes
   553                 ])
   554                 AC_MSG_RESULT($video_x11_dga)
   555                 if test x$video_x11_dga = xyes; then
   556                     CFLAGS="$CFLAGS -DXFREE86_DGAMOUSE"
   557                     if test x$enable_video_x11_dgamouse = xyes; then
   558                         CFLAGS="$CFLAGS -DDEFAULT_DGAMOUSE"
   559                     fi
   560                     SYSTEM_LIBS="$SYSTEM_LIBS -lXxf86dga"
   561                 fi
   562             fi
   563             AC_ARG_ENABLE(video-x11-xv,
   564 [  --enable-video-x11-xv   use X11 XvImage extension for video [default=yes]],
   565                           , enable_video_x11_xv=yes)
   566             if test x$enable_video_x11_xv = xyes; then
   567                 AC_MSG_CHECKING(for XFree86 XvImage support)
   568                 video_x11_xv=no
   569                 AC_TRY_COMPILE([
   570                  #include <X11/Xlib.h>
   571                  #include <sys/ipc.h>
   572                  #include <sys/shm.h>
   573                  #include <X11/extensions/XShm.h>
   574                  #include <X11/extensions/Xvlib.h>
   575                 ],[
   576                  XvImage *image;
   577                 ],[
   578                 video_x11_xv=yes
   579                 ])
   580                 AC_MSG_RESULT($video_x11_xv)
   581                 if test x$video_x11_xv = xyes; then
   582                     CFLAGS="$CFLAGS -DXFREE86_XV"
   583                     SYSTEM_LIBS="$SYSTEM_LIBS -lXv"
   584                 fi
   585             fi
   586         fi
   587     fi
   588 }
   589 CheckPHOTON()
   590 {
   591     AC_ARG_ENABLE(video-photon,
   592 [  --enable-video-photon   use QNX Photonvideo driver [default=yes]],
   593                   , enable_video_photon=yes)
   594     if test x$enable_video = xyes -a x$enable_video_photon = xyes; then
   595         AC_MSG_CHECKING(for QNX Photon support)
   596         video_photon=no
   597         AC_TRY_COMPILE([
   598           #include <Ph.h>
   599           #include <Pt.h>
   600           #include <photon/Pg.h>
   601           #include <photon/PdDirect.h>
   602         ],[
   603          PgDisplaySettings_t *visual;
   604         ],[
   605         video_photon=yes
   606         ])
   607         AC_MSG_RESULT($video_photon)
   608         if test x$video_photon = xyes; then
   609             CFLAGS="$CFLAGS -DENABLE_PHOTON"
   610             SYSTEM_LIBS="$SYSTEM_LIBS -lph"
   611             VIDEO_SUBDIRS="$VIDEO_SUBDIRS photon"
   612             VIDEO_DRIVERS="$VIDEO_DRIVERS photon/libvideo_photon.la"
   613         fi
   614     fi
   615 }
   616 
   617 dnl Find the X11 DGA 2.0 include and library directories
   618 CheckDGA()
   619 {
   620     AC_ARG_ENABLE(video-dga,
   621 [  --enable-video-dga      use DGA 2.0 video driver [default=yes]],
   622                   , enable_video_dga=yes)
   623     if test x$video_x11_dga = xyes -a x$enable_video_dga = xyes; then
   624         AC_MSG_CHECKING(for XFree86 DGA 2.0 support)
   625         video_x11_dga2=no
   626         AC_TRY_COMPILE([
   627          #include <X11/Xlib.h>
   628          #include <X11/extensions/xf86dga.h>
   629         ],[
   630          XDGAEvent xevent;
   631         ],[
   632         video_x11_dga2=yes
   633         ])
   634         AC_MSG_RESULT($video_x11_dga2)
   635         if test x$video_x11_dga2 = xyes; then
   636             CFLAGS="$CFLAGS -DENABLE_DGA"
   637             VIDEO_SUBDIRS="$VIDEO_SUBDIRS dga"
   638             VIDEO_DRIVERS="$VIDEO_DRIVERS dga/libvideo_dga.la"
   639         fi
   640     fi
   641 }
   642 
   643 dnl Find the framebuffer console includes
   644 CheckFBCON()
   645 {
   646     AC_ARG_ENABLE(video-fbcon,
   647 [  --enable-video-fbcon    use framebuffer console video driver [default=yes]],
   648                   , enable_video_fbcon=yes)
   649     if test x$enable_video = xyes -a x$enable_video_fbcon = xyes; then
   650         AC_MSG_CHECKING(for framebuffer console support)
   651         video_fbcon=no
   652         AC_TRY_COMPILE([
   653          #include <linux/fb.h>
   654          #include <linux/kd.h>
   655          #include <linux/keyboard.h>
   656         ],[
   657         ],[
   658         video_fbcon=yes
   659         ])
   660         AC_MSG_RESULT($video_fbcon)
   661         if test x$video_fbcon = xyes; then
   662             CFLAGS="$CFLAGS -DENABLE_FBCON"
   663             VIDEO_SUBDIRS="$VIDEO_SUBDIRS fbcon"
   664             VIDEO_DRIVERS="$VIDEO_DRIVERS fbcon/libvideo_fbcon.la"
   665         fi
   666     fi
   667 }
   668 
   669 dnl Find the GGI includes
   670 CheckGGI()
   671 {
   672     AC_ARG_ENABLE(video-ggi,
   673 [  --enable-video-ggi      use GGI video driver [default=no]],
   674                   , enable_video_ggi=no)
   675     if test x$enable_video = xyes -a x$enable_video_ggi = xyes; then
   676         AC_MSG_CHECKING(for GGI support)
   677         video_ggi=no
   678         AC_TRY_COMPILE([
   679          #include <ggi/ggi.h>
   680          #include <ggi/gii.h>
   681         ],[
   682         ],[
   683         video_ggi=yes
   684         ])
   685         AC_MSG_RESULT($video_ggi)
   686         if test x$video_ggi = xyes; then
   687             CFLAGS="$CFLAGS $X_CFLAGS -DENABLE_GGI"
   688             SYSTEM_LIBS="$SYSTEM_LIBS -lggi -lgii -lgg"
   689 
   690             VIDEO_SUBDIRS="$VIDEO_SUBDIRS ggi"
   691             VIDEO_DRIVERS="$VIDEO_DRIVERS ggi/libvideo_ggi.la"
   692         fi
   693     fi
   694 }
   695 
   696 dnl Find the SVGAlib includes and libraries
   697 CheckSVGA()
   698 {
   699     AC_ARG_ENABLE(video-svga,
   700 [  --enable-video-svga     use SVGAlib video driver [default=no]],
   701                   , enable_video_svga=no)
   702     if test x$enable_video = xyes -a x$enable_video_svga = xyes; then
   703         AC_MSG_CHECKING(for SVGAlib (1.4.0+) support)
   704         video_svga=no
   705         AC_TRY_COMPILE([
   706          #include <vga.h>
   707          #include <vgamouse.h>
   708          #include <vgakeyboard.h>
   709         ],[
   710          if ( SCANCODE_RIGHTWIN && SCANCODE_LEFTWIN ) {
   711              exit(0);
   712          }
   713         ],[
   714         video_svga=yes
   715         ])
   716         AC_MSG_RESULT($video_svga)
   717         if test x$video_svga = xyes; then
   718             CFLAGS="$CFLAGS -DENABLE_SVGALIB"
   719             SYSTEM_LIBS="$SYSTEM_LIBS -lvga"
   720 
   721             VIDEO_SUBDIRS="$VIDEO_SUBDIRS svga"
   722             VIDEO_DRIVERS="$VIDEO_DRIVERS svga/libvideo_svga.la"
   723         fi
   724     fi
   725 }
   726 
   727 dnl Find the AAlib includes
   728 CheckAAlib()
   729 {
   730     AC_ARG_ENABLE(video-aalib,
   731 [  --enable-video-aalib    use AAlib video driver [default=no]],
   732                   , enable_video_aalib=no)
   733     if test x$enable_video = xyes -a x$enable_video_aalib = xyes; then
   734         AC_MSG_CHECKING(for AAlib support)
   735         video_aalib=no
   736         AC_TRY_COMPILE([
   737          #include <aalib.h>
   738         ],[
   739         ],[
   740         video_aalib=yes
   741         ])
   742         AC_MSG_RESULT($video_aalib)
   743         if test x$video_aalib = xyes; then
   744             CFLAGS="$CFLAGS -DENABLE_AALIB"
   745             SYSTEM_LIBS="$SYSTEM_LIBS -laa"
   746 
   747             VIDEO_SUBDIRS="$VIDEO_SUBDIRS aalib"
   748             VIDEO_DRIVERS="$VIDEO_DRIVERS aalib/libvideo_aa.la"
   749         fi
   750     fi
   751 }
   752 
   753 dnl rcg04172001 Set up the Null video driver.
   754 CheckDummyVideo()
   755 {
   756     AC_ARG_ENABLE(video-dummy,
   757 [  --enable-video-dummy    use dummy video driver [default=no]],
   758                   , enable_video_dummy=no)
   759     if test x$enable_video_dummy = xyes; then
   760       CFLAGS="$CFLAGS -DENABLE_DUMMYVIDEO"
   761       VIDEO_SUBDIRS="$VIDEO_SUBDIRS dummy"
   762       VIDEO_DRIVERS="$VIDEO_DRIVERS dummy/libvideo_null.la"
   763     fi
   764 }
   765 
   766 dnl Check to see if OpenGL support is desired
   767 AC_ARG_ENABLE(video-opengl,
   768 [  --enable-video-opengl   include OpenGL context creation [default=yes]],
   769               , enable_video_opengl=yes)
   770 
   771 dnl Find OpenGL
   772 CheckOpenGL()
   773 {
   774     if test x$enable_video = xyes -a x$enable_video_opengl = xyes; then
   775         AC_MSG_CHECKING(for OpenGL (GLX) support)
   776         video_opengl=no
   777         AC_TRY_COMPILE([
   778          #include <GL/gl.h>
   779          #include <GL/glx.h>
   780          #include <dlfcn.h> /* For loading extensions */
   781         ],[
   782         ],[
   783         video_opengl=yes
   784         ])
   785         AC_MSG_RESULT($video_opengl)
   786         if test x$video_opengl = xyes; then
   787             CFLAGS="$CFLAGS -DHAVE_OPENGL"
   788             AC_CHECK_LIB(dl, dlopen, SYSTEM_LIBS="$SYSTEM_LIBS -ldl")
   789         fi
   790     fi
   791 }
   792 
   793 dnl Check for BeOS OpenGL
   794 CheckBeGL()
   795 {
   796     if test x$enable_video = xyes -a x$enable_video_opengl = xyes; then
   797         CFLAGS="$CFLAGS -DHAVE_OPENGL"
   798         SYSTEM_LIBS="$SYSTEM_LIBS -lGL"
   799     fi
   800 }
   801 
   802 dnl Check for MacOS OpenGL
   803 CheckMacGL()
   804 {
   805     if test x$enable_video = xyes -a x$enable_video_opengl = xyes; then
   806         CFLAGS="$CFLAGS -DHAVE_OPENGL"
   807         case "$target" in
   808             *-*-darwin*)
   809                 SDL_LIBS="$SDL_LIBS -framework OpenGL -framework AGL"
   810         esac
   811     fi
   812 }
   813 
   814 dnl See if we can use the new unified event interface in Linux 2.4
   815 CheckInputEvents()
   816 {
   817     dnl Check for Linux 2.4 unified input event interface support
   818     AC_ARG_ENABLE(input-events,
   819 [  --enable-input-events   use Linux 2.4 unified input interface [default=no]],
   820                   , enable_input_events=no)
   821     if test x$enable_input_events = xyes; then
   822         AC_MSG_CHECKING(for Linux 2.4 unified input interface)
   823         use_input_events=no
   824         AC_TRY_COMPILE([
   825           #include <linux/input.h>
   826         ],[
   827           #ifndef EVIOCGNAME
   828           #error EVIOCGNAME() ioctl not available
   829           #endif
   830         ],[
   831         use_input_events=yes
   832         ])
   833         AC_MSG_RESULT($use_input_events)
   834         if test x$use_input_events = xyes; then
   835             CFLAGS="$CFLAGS -DUSE_INPUT_EVENTS"
   836         fi
   837     fi
   838 }
   839 
   840 dnl See what type of thread model to use on Linux and Solaris
   841 CheckPTHREAD()
   842 {
   843     dnl Check for pthread support
   844     AC_ARG_ENABLE(pthreads,
   845 [  --enable-pthreads       use POSIX threads for multi-threading [default=yes]],
   846                   , enable_pthreads=yes)
   847     dnl This is used on Linux for glibc binary compatibility (Doh!)
   848     AC_ARG_ENABLE(pthread-sem,
   849 [    --enable-pthread-sem  use pthread semaphores [default=yes]],
   850                   , enable_pthread_sem=yes)
   851     ac_save_libs="$LIBS"
   852     case "$target" in
   853         *-*-bsdi*)
   854             pthread_cflags="-D_REENTRANT -D_THREAD_SAFE"
   855             pthread_lib=""
   856             ;;
   857         *-*-darwin*)
   858             pthread_cflags="-D_THREAD_SAFE"
   859 # causes Carbon.p complaints?
   860 #            pthread_cflags="-D_REENTRANT -D_THREAD_SAFE"
   861             ;;
   862         *-*-freebsd*)
   863             pthread_cflags="-D_REENTRANT -D_THREAD_SAFE"
   864             pthread_lib="-pthread"
   865             ;;
   866         *-*-netbsd*)
   867             pthread_cflags="-I/usr/pkg/include -D_REENTRANT"
   868             pthread_lib="-L/usr/pkg/lib -lpthread -lsem"
   869             ;;
   870         *-*-openbsd*)
   871             pthread_cflags="-D_REENTRANT"
   872             pthread_lib="-pthread"
   873             ;;
   874         *-*-solaris*)
   875             pthread_cflags="-D_REENTRANT"
   876             pthread_lib="-lpthread -lposix4"
   877             ;;
   878         *-*-sysv5*)
   879             pthread_cflags="-D_REENTRANT -Kthread"
   880             pthread_lib=""
   881             ;;
   882         *-*-irix*)
   883             pthread_cflags="-D_SGI_MP_SOURCE"
   884             pthread_lib="-lpthread"
   885             ;;
   886         *-*-aix*)
   887             pthread_cflags="-D_REENTRANT -mthreads"
   888             pthread_lib="-lpthread"
   889             ;;
   890         *-*-qnx*)
   891             pthread_cflags=""
   892             pthread_lib=""
   893             ;;
   894         *)
   895             pthread_cflags="-D_REENTRANT"
   896             pthread_lib="-lpthread"
   897             ;;
   898     esac
   899     LIBS="$LIBS $pthread_lib"
   900     if test x$enable_threads = xyes -a x$enable_pthreads = xyes; then
   901         AC_MSG_CHECKING(for pthreads)
   902         use_pthreads=no
   903         AC_TRY_LINK([
   904          #include <pthread.h>
   905         ],[
   906          pthread_attr_t type;
   907          pthread_attr_init(&type);
   908         ],[
   909         use_pthreads=yes
   910         ])
   911         AC_MSG_RESULT($use_pthreads)
   912         if test x$use_pthreads = xyes; then
   913             CFLAGS="$CFLAGS $pthread_cflags -DSDL_USE_PTHREADS"
   914             SDL_CFLAGS="$SDL_CFLAGS $pthread_cflags"
   915             SDL_LIBS="$SDL_LIBS $pthread_lib"
   916 
   917             # Check to see if recursive mutexes are available
   918             AC_MSG_CHECKING(for recursive mutexes)
   919             has_recursive_mutexes=no
   920             AC_TRY_LINK([
   921               #include <pthread.h>
   922             ],[
   923               pthread_mutexattr_t attr;
   924               #ifdef linux
   925               pthread_mutexattr_setkind_np(&attr, PTHREAD_MUTEX_RECURSIVE_NP);
   926               #else
   927               pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
   928               #endif
   929             ],[
   930             has_recursive_mutexes=yes
   931             ])
   932             # Some systems have broken recursive mutex implementations
   933             case "$target" in
   934                 *-*-solaris*)
   935                     has_recursive_mutexes=no
   936                     ;;
   937             esac
   938             AC_MSG_RESULT($has_recursive_mutexes)
   939             if test x$has_recursive_mutexes != xyes; then
   940                 CFLAGS="$CFLAGS -DPTHREAD_NO_RECURSIVE_MUTEX"
   941             fi
   942 
   943             # Check to see if this is broken glibc 2.0 pthreads
   944             case "$target" in
   945                 *-*-linux*)
   946                     AC_MSG_CHECKING(for broken glibc 2.0 pthreads)
   947                     glibc20_pthreads=no
   948                     AC_TRY_COMPILE([
   949                       #include <features.h>
   950                       #if (__GLIBC__ == 2) && (__GLIBC_MINOR__ == 0)
   951                       #warning Working around a bug in glibc 2.0 pthreads
   952                       #else
   953                       #error pthread implementation okay
   954                       #endif /* glibc 2.0 */
   955                     ],[
   956                     ],[
   957                     glibc20_pthreads=yes
   958                     ])
   959                     AC_MSG_RESULT($glibc20_pthreads)
   960             esac
   961         fi
   962     fi
   963     LIBS="$ac_save_libs"
   964 
   965     AC_MSG_CHECKING(whether semun is defined in /usr/include/sys/sem.h)
   966     have_semun=no
   967     AC_TRY_COMPILE([
   968       #include <sys/types.h>
   969       #include <sys/sem.h>
   970     ],[
   971       union semun t;
   972     ],[
   973     have_semun=yes
   974     ])
   975     AC_MSG_RESULT($have_semun)
   976     if test x$have_semun = xyes; then
   977         CFLAGS="$CFLAGS -DHAVE_SEMUN"
   978     fi
   979 
   980     # See if we can use clone() on Linux directly
   981     use_clone=no
   982     if test x$enable_threads = xyes -a x$use_pthreads != xyes; then
   983         case "$target" in
   984             *-*-linux*)
   985                 use_clone=yes
   986                 ;;
   987             *)
   988                 CFLAGS="$CFLAGS -DFORK_HACK"
   989                 ;;
   990         esac
   991     fi
   992     AM_CONDITIONAL(USE_CLONE, test x$use_clone = xyes)
   993 }
   994 
   995 dnl Determine whether the compiler can produce Win32 executables
   996 CheckWIN32()
   997 {
   998     AC_MSG_CHECKING(Win32 compiler)
   999     have_win32_gcc=no
  1000     AC_TRY_COMPILE([
  1001      #include <windows.h>
  1002     ],[
  1003     ],[
  1004     have_win32_gcc=yes
  1005     ])
  1006     AC_MSG_RESULT($have_win32_gcc)
  1007     if test x$have_win32_gcc != xyes; then
  1008        AC_MSG_ERROR([
  1009 *** Your compiler ($CC) does not produce Win32 executables!
  1010        ])
  1011     fi
  1012 
  1013     dnl See if the user wants to redirect standard output to files
  1014     AC_ARG_ENABLE(stdio-redirect,
  1015 [  --enable-stdio-redirect Redirect STDIO to files on Win32 [default=yes]],
  1016                   , enable_stdio_redirect=yes)
  1017     if test x$enable_stdio_redirect != xyes; then
  1018         CFLAGS="$CFLAGS -DNO_STDIO_REDIRECT"
  1019     fi
  1020 }
  1021 
  1022 dnl Find the DirectX includes and libraries
  1023 CheckDIRECTX()
  1024 {
  1025     AC_ARG_ENABLE(directx,
  1026 [  --enable-directx        use DirectX for Win32 audio/video [default=yes]],
  1027                   , enable_directx=yes)
  1028     if test x$enable_directx = xyes; then
  1029         AC_MSG_CHECKING(for DirectX headers and libraries)
  1030         use_directx=no
  1031         AC_TRY_COMPILE([
  1032          #include "src/video/windx5/directx.h"
  1033         ],[
  1034         ],[
  1035         use_directx=yes
  1036         ])
  1037         AC_MSG_RESULT($use_directx)
  1038     fi
  1039     AM_CONDITIONAL(USE_DIRECTX, test x$use_directx = xyes)
  1040 
  1041     CFLAGS="$CFLAGS -I\$(top_srcdir)/src/video/wincommon"
  1042     SYSTEM_LIBS="$SYSTEM_LIBS -luser32 -lgdi32 -lwinmm"
  1043     VIDEO_SUBDIRS="$VIDEO_SUBDIRS wincommon"
  1044     VIDEO_DRIVERS="$VIDEO_DRIVERS wincommon/libvideo_wincommon.la"
  1045     # Enable the DIB driver
  1046     CFLAGS="$CFLAGS -DENABLE_WINDIB"
  1047     VIDEO_SUBDIRS="$VIDEO_SUBDIRS windib"
  1048     VIDEO_DRIVERS="$VIDEO_DRIVERS windib/libvideo_windib.la"
  1049     # See if we should enable the DirectX driver
  1050     if test x$use_directx = xyes; then
  1051         CFLAGS="$CFLAGS -DENABLE_DIRECTX"
  1052         SYSTEM_LIBS="$SYSTEM_LIBS -ldxguid"
  1053         VIDEO_SUBDIRS="$VIDEO_SUBDIRS windx5"
  1054         VIDEO_DRIVERS="$VIDEO_DRIVERS windx5/libvideo_windx5.la"
  1055     fi
  1056 }
  1057 
  1058 dnl Set up the BWindow video driver on BeOS
  1059 CheckBWINDOW()
  1060 {
  1061     CFLAGS="$CFLAGS -DENABLE_BWINDOW"
  1062     VIDEO_SUBDIRS="$VIDEO_SUBDIRS bwindow"
  1063     VIDEO_DRIVERS="$VIDEO_DRIVERS bwindow/libvideo_bwindow.la"
  1064 }
  1065 
  1066 dnl Set up the Mac toolbox video driver for Mac OS 7-9
  1067 CheckTOOLBOX()
  1068 {
  1069     VIDEO_SUBDIRS="$VIDEO_SUBDIRS maccommon"
  1070     VIDEO_DRIVERS="$VIDEO_DRIVERS maccommon/libvideo_maccommon.la"
  1071     VIDEO_SUBDIRS="$VIDEO_SUBDIRS macrom"
  1072     VIDEO_DRIVERS="$VIDEO_DRIVERS macrom/libvideo_macrom.la"
  1073 }
  1074 
  1075 dnl Set up the Mac toolbox video driver for Mac OS X
  1076 CheckCARBON()
  1077 {
  1078     # "MACOSX" is not an official definition, but it's commonly
  1079     # accepted as a way to differentiate between what runs on X
  1080     # and what runs on older Macs - while in theory "Carbon" defns
  1081     # are consistent between the two, in practice Carbon is still
  1082     # changing. -sts Aug 2000
  1083     mac_autoconf_target_workaround="MAC"
  1084     CFLAGS="$CFLAGS -I/System/Library/Frameworks/Carbon.framework/Headers \
  1085       -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"
  1086     VIDEO_SUBDIRS="$VIDEO_SUBDIRS maccommon"
  1087     VIDEO_DRIVERS="$VIDEO_DRIVERS maccommon/libvideo_maccommon.la"
  1088     VIDEO_SUBDIRS="$VIDEO_SUBDIRS macrom"
  1089     VIDEO_DRIVERS="$VIDEO_DRIVERS macrom/libvideo_macrom.la"
  1090 }
  1091 
  1092 dnl Set up the kernel statistics library for Solaris
  1093 CheckKSTAT()
  1094 {
  1095     CFLAGS="$CFLAGS -DHAVE_KSTAT"
  1096     SYSTEM_LIBS="$SYSTEM_LIBS -lkstat"
  1097 }
  1098 
  1099 case "$target" in
  1100     *-*-linux*)
  1101         ARCH=linux
  1102         CheckDummyVideo
  1103         CheckDiskAudio
  1104         CheckNASM
  1105         CheckOSS
  1106         CheckALSA
  1107         CheckARTSC
  1108         CheckESD
  1109         CheckNAS
  1110         CheckX11
  1111         CheckNANOX
  1112         CheckDGA
  1113         CheckFBCON
  1114         CheckGGI
  1115         CheckSVGA
  1116         CheckAAlib
  1117         CheckOpenGL
  1118         CheckInputEvents
  1119         CheckPTHREAD
  1120         # Set up files for the main() stub
  1121         COPY_ARCH_SRC(src/main, linux, SDL_main.c)
  1122         # Set up files for the audio library
  1123         # We use the OSS and ALSA API's, not the Sun audio API
  1124         #if test x$enable_audio = xyes; then
  1125         #    AUDIO_SUBDIRS="$AUDIO_SUBDIRS sun"
  1126         #    AUDIO_DRIVERS="$AUDIO_DRIVERS sun/libaudio_sun.la"
  1127         #fi
  1128         # Set up files for the joystick library
  1129         if test x$enable_joystick = xyes; then
  1130             JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS linux"
  1131             JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS linux/libjoystick_linux.la"
  1132         fi
  1133         # Set up files for the cdrom library
  1134         if test x$enable_cdrom = xyes; then
  1135             COPY_ARCH_SRC(src/cdrom, linux, SDL_syscdrom.c)
  1136         fi
  1137         # Set up files for the thread library
  1138         if test x$enable_threads = xyes; then
  1139             if test x$use_pthreads != xyes; then
  1140                 COPY_ARCH_SRC(src/thread, linux, clone.S)
  1141             fi
  1142             COPY_ARCH_SRC(src/thread, linux, SDL_systhread.c)
  1143             COPY_ARCH_SRC(src/thread, linux, SDL_systhread_c.h)
  1144             if test x$use_pthreads = xyes -a x$enable_pthread_sem != xyes; then
  1145                 COPY_ARCH_SRC(src/thread, generic, SDL_syssem.c)
  1146             else
  1147                 COPY_ARCH_SRC(src/thread, linux, SDL_syssem.c)
  1148             fi
  1149             COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
  1150             if test x$glibc20_pthreads = xyes; then
  1151                 COPY_ARCH_SRC(src/thread, generic, SDL_sysmutex.c)
  1152                 COPY_ARCH_SRC(src/thread, generic, SDL_sysmutex_c.h)
  1153                 COPY_ARCH_SRC(src/thread, generic, SDL_syscond.c)
  1154                 COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
  1155             else
  1156                 COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex.c)
  1157                 COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex_c.h)
  1158                 COPY_ARCH_SRC(src/thread, linux, SDL_syscond.c)
  1159                 COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
  1160             fi
  1161         fi
  1162         # Set up files for the timer library
  1163         if test x$enable_timers = xyes; then
  1164             COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
  1165         fi
  1166         ;;
  1167     *-*-bsdi*)
  1168         ARCH=bsdi
  1169         CheckDummyVideo
  1170         CheckDiskAudio
  1171         CheckNASM
  1172         CheckOSS
  1173         CheckARTSC
  1174         CheckESD
  1175         CheckNAS
  1176         CheckX11
  1177         CheckDGA
  1178         CheckSVGA
  1179         CheckAAlib
  1180         CheckOpenGL
  1181         CheckPTHREAD
  1182         # Set up files for the main() stub
  1183         COPY_ARCH_SRC(src/main, linux, SDL_main.c)
  1184         # Set up files for the joystick library
  1185         # (No joystick support yet)
  1186         if test x$enable_joystick = xyes; then
  1187             JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS dummy"
  1188             JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS dummy/libjoystick_dummy.la"
  1189         fi
  1190         # Set up files for the cdrom library
  1191         # (No cdrom support yet)
  1192         if test x$enable_cdrom = xyes; then
  1193             COPY_ARCH_SRC(src/cdrom, dummy, SDL_syscdrom.c)
  1194         fi
  1195         # Set up files for the thread library
  1196         if test x$enable_threads = xyes; then
  1197             COPY_ARCH_SRC(src/thread, linux, SDL_systhread.c)
  1198             COPY_ARCH_SRC(src/thread, linux, SDL_systhread_c.h)
  1199             COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex.c)
  1200             COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex_c.h)
  1201             COPY_ARCH_SRC(src/thread, generic, SDL_syssem.c)
  1202             COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
  1203             COPY_ARCH_SRC(src/thread, linux, SDL_syscond.c)
  1204             COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
  1205         fi
  1206         # Set up files for the timer library
  1207         if test x$enable_timers = xyes; then
  1208             COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
  1209         fi
  1210         ;;
  1211     *-*-freebsd*)
  1212         ARCH=freebsd
  1213         CheckDummyVideo
  1214         CheckDiskAudio
  1215         CheckNASM
  1216         CheckOSS
  1217         CheckARTSC
  1218         CheckESD
  1219         CheckNAS
  1220         CheckX11
  1221         CheckDGA
  1222         CheckSVGA
  1223         CheckAAlib
  1224         CheckOpenGL
  1225         CheckPTHREAD
  1226         # Set up files for the main() stub
  1227         COPY_ARCH_SRC(src/main, linux, SDL_main.c)
  1228         # Set up files for the audio library
  1229         # We use the OSS and ALSA API's, not the Sun audio API
  1230         #if test x$enable_audio = xyes; then
  1231         #    AUDIO_SUBDIRS="$AUDIO_SUBDIRS sun"
  1232         #    AUDIO_DRIVERS="$AUDIO_DRIVERS sun/libaudio_sun.la"
  1233         #fi
  1234         # Set up files for the joystick library
  1235         # (No joystick support yet)
  1236         if test x$enable_joystick = xyes; then
  1237             JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS dummy"
  1238             JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS dummy/libjoystick_dummy.la"
  1239         fi
  1240         # Set up files for the cdrom library
  1241         if test x$enable_cdrom = xyes; then
  1242             COPY_ARCH_SRC(src/cdrom, freebsd, SDL_syscdrom.c)
  1243         fi
  1244         # Set up files for the thread library
  1245         if test x$enable_threads = xyes; then
  1246             COPY_ARCH_SRC(src/thread, linux, SDL_systhread.c)
  1247             COPY_ARCH_SRC(src/thread, linux, SDL_systhread_c.h)
  1248             COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex.c)
  1249             COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex_c.h)
  1250             if test x$use_pthreads = xyes -a x$enable_pthread_sem != xyes; then
  1251                 COPY_ARCH_SRC(src/thread, generic, SDL_syssem.c)
  1252             else
  1253                 COPY_ARCH_SRC(src/thread, linux, SDL_syssem.c)
  1254             fi
  1255             COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
  1256             COPY_ARCH_SRC(src/thread, linux, SDL_syscond.c)
  1257             COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
  1258         fi
  1259         # Set up files for the timer library
  1260         if test x$enable_timers = xyes; then
  1261             COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
  1262         fi
  1263         ;;
  1264     *-*-netbsd*)
  1265         ARCH=netbsd
  1266         CheckDummyVideo
  1267         CheckDiskAudio
  1268         CheckNASM
  1269         CheckOSS
  1270         CheckARTSC
  1271         CheckESD
  1272         CheckNAS
  1273         CheckX11
  1274         CheckAAlib
  1275         CheckOpenGL
  1276         CheckPTHREAD
  1277         # Set up files for the main() stub
  1278         COPY_ARCH_SRC(src/main, linux, SDL_main.c)
  1279         # Set up files for the audio library
  1280         if test x$enable_audio = xyes; then
  1281             AUDIO_SUBDIRS="$AUDIO_SUBDIRS sun"
  1282             AUDIO_DRIVERS="$AUDIO_DRIVERS sun/libaudio_sun.la"
  1283         fi
  1284         # Set up files for the joystick library
  1285         # (No joystick support yet)
  1286         if test x$enable_joystick = xyes; then
  1287             JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS dummy"
  1288             JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS dummy/libjoystick_dummy.la"
  1289         fi
  1290         # Set up files for the cdrom library
  1291         if test x$enable_cdrom = xyes; then
  1292             COPY_ARCH_SRC(src/cdrom, openbsd, SDL_syscdrom.c)
  1293         fi
  1294         # Set up files for the thread library
  1295         if test x$enable_threads = xyes; then
  1296             COPY_ARCH_SRC(src/thread, linux, SDL_systhread.c)
  1297             COPY_ARCH_SRC(src/thread, linux, SDL_systhread_c.h)
  1298             COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex.c)
  1299             COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex_c.h)
  1300             if test x$use_pthreads = xyes -a x$enable_pthread_sem != xyes; then
  1301                 COPY_ARCH_SRC(src/thread, generic, SDL_syssem.c)
  1302             else
  1303                 COPY_ARCH_SRC(src/thread, linux, SDL_syssem.c)
  1304             fi
  1305             COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
  1306             COPY_ARCH_SRC(src/thread, linux, SDL_syscond.c)
  1307             COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
  1308         fi
  1309         # Set up files for the timer library
  1310         if test x$enable_timers = xyes; then
  1311             COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
  1312         fi
  1313         # NetBSD does not define "unix"
  1314         CFLAGS="$CFLAGS -Dunix -D_POSIX_THREAD_SYSCALL_SOFT=1"
  1315         ;;
  1316     *-*-openbsd*)
  1317         ARCH=openbsd
  1318         CheckDummyVideo
  1319         CheckDiskAudio
  1320         CheckNASM
  1321         CheckOSS
  1322         CheckARTSC
  1323         CheckESD
  1324         CheckNAS
  1325         CheckX11
  1326         CheckAAlib
  1327         CheckOpenGL
  1328         CheckPTHREAD
  1329         # Set up files for the main() stub
  1330         COPY_ARCH_SRC(src/main, linux, SDL_main.c)
  1331         # Set up files for the audio library
  1332         CheckOPENBSDAUDIO
  1333         # Set up files for the joystick library
  1334         # (No joystick support yet)
  1335         if test x$enable_joystick = xyes; then
  1336             JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS dummy"
  1337             JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS dummy/libjoystick_dummy.la"
  1338         fi
  1339         # Set up files for the cdrom library
  1340         if test x$enable_cdrom = xyes; then
  1341             COPY_ARCH_SRC(src/cdrom, openbsd, SDL_syscdrom.c)
  1342         fi
  1343         # Set up files for the thread library
  1344         if test x$enable_threads = xyes; then
  1345             COPY_ARCH_SRC(src/thread, linux, SDL_systhread.c)
  1346             COPY_ARCH_SRC(src/thread, linux, SDL_systhread_c.h)
  1347             COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex.c)
  1348             COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex_c.h)
  1349             if test x$use_pthreads = xyes -a x$enable_pthread_sem != xyes; then
  1350                 COPY_ARCH_SRC(src/thread, generic, SDL_syssem.c)
  1351             else
  1352                 COPY_ARCH_SRC(src/thread, linux, SDL_syssem.c)
  1353             fi
  1354             COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
  1355             COPY_ARCH_SRC(src/thread, linux, SDL_syscond.c)
  1356             COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
  1357         fi
  1358         # Set up files for the timer library
  1359         if test x$enable_timers = xyes; then
  1360             COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
  1361         fi
  1362         # OpenBSD does not define "unix"
  1363         CFLAGS="$CFLAGS -Dunix"
  1364         ;;
  1365     *-*-sysv5*)
  1366         ARCH=sysv5
  1367         CheckDummyVideo
  1368         CheckDiskAudio
  1369         CheckNASM
  1370         CheckOSS
  1371         CheckARTSC
  1372         CheckESD
  1373         CheckNAS
  1374         CheckX11
  1375         CheckAAlib
  1376         CheckOpenGL
  1377         CheckPTHREAD
  1378         CheckKSTAT
  1379         # Set up files for the main() stub
  1380         COPY_ARCH_SRC(src/main, linux, SDL_main.c)
  1381         # Set up files for the audio library
  1382         if test x$enable_audio = xyes; then
  1383             AUDIO_SUBDIRS="$AUDIO_SUBDIRS sun"
  1384             AUDIO_DRIVERS="$AUDIO_DRIVERS sun/libaudio_sun.la"
  1385         fi
  1386         # Set up files for the joystick library
  1387         # (No joystick support yet)
  1388         if test x$enable_joystick = xyes; then
  1389             JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS dummy"
  1390             JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS dummy/libjoystick_dummy.la"
  1391         fi
  1392         # Set up files for the cdrom library
  1393         if test x$enable_cdrom = xyes; then
  1394             COPY_ARCH_SRC(src/cdrom, dummy, SDL_syscdrom.c)
  1395         fi
  1396         # Set up files for the thread library
  1397         if test x$enable_threads = xyes; then
  1398             COPY_ARCH_SRC(src/thread, generic, SDL_systhread.c)
  1399             COPY_ARCH_SRC(src/thread, generic, SDL_systhread_c.h)
  1400             COPY_ARCH_SRC(src/thread, generic, SDL_sysmutex.c)
  1401             COPY_ARCH_SRC(src/thread, generic, SDL_sysmutex_c.h)
  1402             COPY_ARCH_SRC(src/thread, generic, SDL_syssem.c)
  1403             COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
  1404             COPY_ARCH_SRC(src/thread, generic, SDL_syscond.c)
  1405             COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
  1406         fi
  1407         # Set up files for the timer library
  1408         if test x$enable_timers = xyes; then
  1409             COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
  1410         fi
  1411         ;;
  1412     *-*-solaris*)
  1413         ARCH=solaris
  1414         CFLAGS="$CFLAGS -D__ELF__" # Fix for nasm on Solaris x86
  1415         CheckDummyVideo
  1416         CheckDiskAudio
  1417         CheckNASM
  1418         CheckOSS
  1419         CheckARTSC
  1420         CheckESD
  1421         CheckNAS
  1422         CheckX11
  1423         CheckAAlib
  1424         CheckOpenGL
  1425         CheckPTHREAD
  1426         CheckKSTAT
  1427         # Set up files for the main() stub
  1428         COPY_ARCH_SRC(src/main, linux, SDL_main.c)
  1429         # Set up files for the audio library
  1430         if test x$enable_audio = xyes; then
  1431             AUDIO_SUBDIRS="$AUDIO_SUBDIRS sun"
  1432             AUDIO_DRIVERS="$AUDIO_DRIVERS sun/libaudio_sun.la"
  1433         fi
  1434         # Set up files for the joystick library
  1435         # (No joystick support yet)
  1436         if test x$enable_joystick = xyes; then
  1437             JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS dummy"
  1438             JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS dummy/libjoystick_dummy.la"
  1439         fi
  1440         # Set up files for the cdrom library
  1441         if test x$enable_cdrom = xyes; then
  1442             COPY_ARCH_SRC(src/cdrom, linux, SDL_syscdrom.c)
  1443         fi
  1444         # Set up files for the thread library
  1445         if test x$enable_threads = xyes; then
  1446             COPY_ARCH_SRC(src/thread, linux, SDL_systhread.c)
  1447             COPY_ARCH_SRC(src/thread, linux, SDL_systhread_c.h)
  1448             COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex.c)
  1449             COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex_c.h)
  1450             COPY_ARCH_SRC(src/thread, linux, SDL_syssem.c)
  1451             COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
  1452             COPY_ARCH_SRC(src/thread, generic, SDL_syscond.c)
  1453             COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
  1454         fi
  1455         # Set up files for the timer library
  1456         if test x$enable_timers = xyes; then
  1457             COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
  1458         fi
  1459         ;;
  1460     *-*-irix*)
  1461         ARCH=irix
  1462         CheckDummyVideo
  1463         CheckDiskAudio
  1464         CheckNAS
  1465         CheckX11
  1466         CheckAAlib
  1467         CheckOpenGL
  1468         CheckPTHREAD
  1469         # Set up files for the main() stub
  1470         COPY_ARCH_SRC(src/main, linux, SDL_main.c)
  1471         # Set up files for the audio library
  1472         if test x$enable_audio = xyes; then
  1473             AUDIO_SUBDIRS="$AUDIO_SUBDIRS dmedia"
  1474             AUDIO_DRIVERS="$AUDIO_DRIVERS dmedia/libaudio_dmedia.la"
  1475             LIBS="$LIBS -laudio"
  1476         fi
  1477         # Set up files for the joystick library
  1478         # (No joystick support yet)
  1479         if test x$enable_joystick = xyes; then
  1480             JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS dummy"
  1481             JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS dummy/libjoystick_dummy.la"
  1482         fi
  1483         # Set up files for the cdrom library
  1484         # (No CD-ROM support yet)
  1485         if test x$enable_cdrom = xyes; then
  1486             COPY_ARCH_SRC(src/cdrom, dummy, SDL_syscdrom.c)
  1487         fi
  1488         # Set up files for the thread library
  1489         if test x$enable_threads = xyes; then
  1490             if test x$use_pthreads = xyes; then
  1491                 COPY_ARCH_SRC(src/thread, linux, SDL_systhread.c)
  1492                 COPY_ARCH_SRC(src/thread, linux, SDL_systhread_c.h)
  1493                 COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex.c)
  1494                 COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex_c.h)
  1495                 if test x$enable_pthread_sem != xyes; then
  1496                     COPY_ARCH_SRC(src/thread, generic, SDL_syssem.c)
  1497                 else
  1498                     COPY_ARCH_SRC(src/thread, linux, SDL_syssem.c)
  1499                 fi
  1500                 COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
  1501                 COPY_ARCH_SRC(src/thread, linux, SDL_syscond.c)
  1502                 COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
  1503             else
  1504                 COPY_ARCH_SRC(src/thread, irix, SDL_systhread.c)
  1505                 COPY_ARCH_SRC(src/thread, irix, SDL_systhread_c.h)
  1506                 COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex.c)
  1507                 COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex_c.h)
  1508                 COPY_ARCH_SRC(src/thread, linux, SDL_syssem.c)
  1509                 COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
  1510                 COPY_ARCH_SRC(src/thread, generic, SDL_syscond.c)
  1511                 COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
  1512             fi
  1513         fi
  1514         # Set up files for the timer library
  1515         if test x$enable_timers = xyes; then
  1516             COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
  1517         fi
  1518         ;;
  1519     *-*-hpux*)
  1520         ARCH=hpux
  1521         CheckDummyVideo
  1522         CheckDiskAudio
  1523         CheckOSS
  1524         CheckNAS
  1525         CheckX11
  1526         CheckGGI
  1527         CheckAAlib
  1528         CheckOpenGL
  1529         CheckPTHREAD
  1530         # Set up files for the main() stub
  1531         COPY_ARCH_SRC(src/main, linux, SDL_main.c)
  1532         # Set up files for the audio library
  1533         if test x$enable_audio = xyes; then
  1534             AUDIO_SUBDIRS="$AUDIO_SUBDIRS sun"
  1535             AUDIO_DRIVERS="$AUDIO_DRIVERS sun/libaudio_sun.la"
  1536         fi
  1537         # Set up files for the joystick library
  1538         # (No joystick support yet)
  1539         if test x$enable_joystick = xyes; then
  1540             JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS dummy"
  1541             JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS dummy/libjoystick_dummy.la"
  1542         fi
  1543         # Set up files for the cdrom library
  1544         # (No CD-ROM support yet)
  1545         if test x$enable_cdrom = xyes; then
  1546             COPY_ARCH_SRC(src/cdrom, dummy, SDL_syscdrom.c)
  1547         fi
  1548         # Set up files for the thread library
  1549         if test x$enable_threads = xyes; then
  1550             COPY_ARCH_SRC(src/thread, linux, SDL_systhread.c)
  1551             COPY_ARCH_SRC(src/thread, linux, SDL_systhread_c.h)
  1552             COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex.c)
  1553             COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex_c.h)
  1554             COPY_ARCH_SRC(src/thread, linux, SDL_syssem.c)
  1555             COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
  1556             COPY_ARCH_SRC(src/thread, linux, SDL_syscond.c)
  1557             COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
  1558         fi
  1559         # Set up files for the timer library
  1560         if test x$enable_timers = xyes; then
  1561             COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
  1562         fi
  1563         ;;
  1564     *-*-aix*)
  1565         ARCH=aix
  1566         CheckDummyVideo
  1567         CheckDiskAudio
  1568         CheckOSS
  1569         CheckNAS
  1570         CheckX11
  1571         CheckGGI
  1572         CheckAAlib
  1573         CheckOpenGL
  1574         CheckPTHREAD
  1575         # Set up files for the main() stub
  1576         COPY_ARCH_SRC(src/main, linux, SDL_main.c)
  1577         # Set up files for the audio library
  1578         if test x$enable_audio = xyes; then
  1579             AUDIO_SUBDIRS="$AUDIO_SUBDIRS paudio"
  1580             AUDIO_DRIVERS="$AUDIO_DRIVERS paudio/libaudio_paudio.la"
  1581         fi
  1582         # Set up files for the joystick library
  1583         # (No joystick support yet)
  1584         if test x$enable_joystick = xyes; then
  1585             JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS dummy"
  1586             JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS dummy/libjoystick_dummy.la"
  1587         fi
  1588         # Set up files for the cdrom library
  1589         if test x$enable_cdrom = xyes; then
  1590             COPY_ARCH_SRC(src/cdrom, aix, SDL_syscdrom.c)
  1591         fi
  1592         # Set up files for the thread library
  1593         if test x$enable_threads = xyes; then
  1594             COPY_ARCH_SRC(src/thread, linux, SDL_systhread.c)
  1595             COPY_ARCH_SRC(src/thread, linux, SDL_systhread_c.h)
  1596             COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex.c)
  1597             COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex_c.h)
  1598             COPY_ARCH_SRC(src/thread, linux, SDL_syssem.c)
  1599             COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
  1600             COPY_ARCH_SRC(src/thread, linux, SDL_syscond.c)
  1601             COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
  1602         fi
  1603         # Set up files for the timer library
  1604         if test x$enable_timers = xyes; then
  1605             COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
  1606         fi
  1607         ;;
  1608     *-*-osf*)
  1609         ARCH=osf
  1610         CheckDummyVideo
  1611         CheckDiskAudio
  1612         CheckNAS
  1613         CheckX11
  1614         CheckGGI
  1615         CheckAAlib
  1616         CheckOpenGL
  1617         CheckPTHREAD
  1618         # Set up files for the main() stub
  1619         COPY_ARCH_SRC(src/main, linux, SDL_main.c)
  1620         # Set up files for the audio library
  1621         if test x$enable_audio = xyes; then
  1622             AUDIO_SUBDIRS="$AUDIO_SUBDIRS sun"
  1623             AUDIO_DRIVERS="$AUDIO_DRIVERS sun/libaudio_sun.la"
  1624         fi
  1625         # Set up files for the joystick library
  1626         # (No joystick support yet)
  1627         if test x$enable_joystick = xyes; then
  1628             JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS dummy"
  1629             JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS dummy/libjoystick_dummy.la"
  1630         fi
  1631         # Set up files for the cdrom library
  1632         # (No cdrom support yet)
  1633         if test x$enable_cdrom = xyes; then
  1634             COPY_ARCH_SRC(src/cdrom, dummy, SDL_syscdrom.c)
  1635         fi
  1636         # Set up files for the thread library
  1637         if test x$enable_threads = xyes; then
  1638             COPY_ARCH_SRC(src/thread, linux, SDL_systhread.c)
  1639             COPY_ARCH_SRC(src/thread, linux, SDL_systhread_c.h)
  1640             COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex.c)
  1641             COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex_c.h)
  1642             COPY_ARCH_SRC(src/thread, generic, SDL_syssem.c)
  1643             COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
  1644             COPY_ARCH_SRC(src/thread, linux, SDL_syscond.c)
  1645             COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
  1646         fi
  1647         # Set up files for the timer library
  1648         if test x$enable_timers = xyes; then
  1649             COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
  1650         fi
  1651         ;;
  1652     *-*-qnx*)
  1653         ARCH=qnx
  1654         CheckDummyVideo
  1655         CheckDiskAudio
  1656         CheckNAS
  1657         CheckPHOTON
  1658         CheckX11
  1659         CheckOpenGL
  1660         CheckPTHREAD
  1661         # Set up files for the main() stub
  1662         COPY_ARCH_SRC(src/main, linux, SDL_main.c)
  1663         # Set up files for the audio library
  1664         if test x$enable_audio = xyes; then
  1665             CFLAGS="$CFLAGS -DALSA_SUPPORT"
  1666             SYSTEM_LIBS="$SYSTEM_LIBS -lasound"
  1667             AUDIO_SUBDIRS="$AUDIO_SUBDIRS nto"
  1668             AUDIO_DRIVERS="$AUDIO_DRIVERS nto/libaudio_nto.la"
  1669             AUDIO_SUBDIRS="$AUDIO_SUBDIRS sun"
  1670             AUDIO_DRIVERS="$AUDIO_DRIVERS sun/libaudio_sun.la"
  1671         fi
  1672         # Set up files for the joystick library
  1673         if test x$enable_joystick = xyes; then
  1674         # (No joystick support yet)
  1675             JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS dummy"
  1676             JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS dummy/libjoystick_dummy.la"
  1677         fi
  1678         # Set up files for the cdrom library
  1679         if test x$enable_cdrom = xyes; then
  1680             COPY_ARCH_SRC(src/cdrom, qnx, SDL_syscdrom.c)
  1681         fi
  1682         # Set up files for the thread library
  1683         if test x$enable_threads = xyes; then
  1684             COPY_ARCH_SRC(src/thread, linux, SDL_systhread.c)
  1685             COPY_ARCH_SRC(src/thread, linux, SDL_systhread_c.h)
  1686             COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex.c)
  1687             COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex_c.h)
  1688             COPY_ARCH_SRC(src/thread, linux, SDL_syssem.c)
  1689             COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
  1690             COPY_ARCH_SRC(src/thread, linux, SDL_syscond.c)
  1691             COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
  1692         fi
  1693         # Set up files for the timer library
  1694         if test x$enable_timers = xyes; then
  1695             COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
  1696         fi
  1697         ;;
  1698     *-*-cygwin* | *-*-mingw32*)
  1699         ARCH=win32
  1700         if test "$build" != "$target"; then # cross-compiling
  1701             # Default cross-compile location
  1702             ac_default_prefix=/usr/local/cross-tools/i386-mingw32msvc
  1703         else
  1704             # Look for the location of the tools and install there
  1705             if [ "$BUILD_PREFIX" != "" ]; then
  1706                 ac_default_prefix=$BUILD_PREFIX
  1707             fi
  1708         fi
  1709         CheckDummyVideo
  1710         CheckDiskAudio
  1711         CheckWIN32
  1712         CheckDIRECTX
  1713         CheckNASM
  1714         # Set up files for the main() stub
  1715         COPY_ARCH_SRC(src/main, win32, SDL_main.c)
  1716         # Set up files for the audio library
  1717         if test x$enable_audio = xyes; then
  1718             AUDIO_SUBDIRS="$AUDIO_SUBDIRS windib"
  1719             AUDIO_DRIVERS="$AUDIO_DRIVERS windib/libaudio_windib.la"
  1720             if test x$use_directx = xyes; then
  1721                 AUDIO_SUBDIRS="$AUDIO_SUBDIRS windx5"
  1722                 AUDIO_DRIVERS="$AUDIO_DRIVERS windx5/libaudio_windx5.la"
  1723             fi
  1724         fi
  1725         # Set up files for the joystick library
  1726         if test x$enable_joystick = xyes; then
  1727             JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS win32"
  1728             JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS win32/libjoystick_winmm.la"
  1729         fi
  1730         # Set up files for the cdrom library
  1731         if test x$enable_cdrom = xyes; then
  1732             COPY_ARCH_SRC(src/cdrom, win32, SDL_syscdrom.c)
  1733         fi
  1734         # Set up files for the thread library
  1735         if test x$enable_threads = xyes; then
  1736             COPY_ARCH_SRC(src/thread, win32, SDL_systhread.c)
  1737             COPY_ARCH_SRC(src/thread, win32, SDL_systhread_c.h)
  1738             COPY_ARCH_SRC(src/thread, win32, SDL_sysmutex.c)
  1739             COPY_ARCH_SRC(src/thread, generic, SDL_sysmutex_c.h)
  1740             COPY_ARCH_SRC(src/thread, win32, SDL_syssem.c)
  1741             COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
  1742             COPY_ARCH_SRC(src/thread, generic, SDL_syscond.c)
  1743             COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
  1744         fi
  1745         # Set up files for the timer library
  1746         if test x$enable_timers = xyes; then
  1747             COPY_ARCH_SRC(src/timer, win32, SDL_systimer.c)
  1748         fi
  1749         # The Win32 platform requires special setup
  1750         SDL_CFLAGS="$SDL_CFLAGS -Dmain=SDL_main"
  1751         case "$target" in
  1752             *-*-cygwin*)
  1753                 CFLAGS="$CFLAGS -I/usr/include/mingw -DWIN32 -Uunix"
  1754                 SDL_CFLAGS="$SDL_CFLAGS -I/usr/include/mingw -DWIN32 -Uunix"
  1755                 LIBS="$LIBS -mno-cygwin"
  1756                 SDL_LIBS="-lmingw32 -lSDLmain $SDL_LIBS -mwindows -mno-cygwin"
  1757                 ;;
  1758             *-*-mingw32*)
  1759                 SDL_LIBS="-lmingw32 -lSDLmain $SDL_LIBS -mwindows"
  1760                 ;;
  1761         esac
  1762         ;;
  1763     *-*-beos*)
  1764         ARCH=beos
  1765         ac_default_prefix=/boot/develop/tools/gnupro
  1766         CheckDummyVideo
  1767         CheckDiskAudio
  1768         CheckNASM
  1769         CheckBWINDOW
  1770         CheckBeGL
  1771         # Set up files for the main() stub
  1772         COPY_ARCH_SRC(src/main, linux, SDL_main.c)
  1773         COPY_ARCH_SRC(src/main, beos, SDL_BeApp.cc)
  1774         COPY_ARCH_SRC(src/main, beos, SDL_BeApp.h)
  1775         # Set up files for the audio library
  1776         if test x$enable_audio = xyes; then
  1777             AUDIO_SUBDIRS="$AUDIO_SUBDIRS baudio"
  1778             AUDIO_DRIVERS="$AUDIO_DRIVERS baudio/libaudio_baudio.la"
  1779         fi
  1780         # Set up files for the joystick library
  1781         if test x$enable_joystick = xyes; then
  1782             JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS beos"
  1783             JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS beos/libjoystick_beos.la"
  1784         fi
  1785         # Set up files for the cdrom library
  1786         if test x$enable_cdrom = xyes; then
  1787             COPY_ARCH_SRC(src/cdrom, beos, SDL_syscdrom.c)
  1788         fi
  1789         # Set up files for the thread library
  1790         if test x$enable_threads = xyes; then
  1791             COPY_ARCH_SRC(src/thread, beos, SDL_systhread.c)
  1792             COPY_ARCH_SRC(src/thread, beos, SDL_systhread_c.h)
  1793             COPY_ARCH_SRC(src/thread, generic, SDL_sysmutex.c)
  1794             COPY_ARCH_SRC(src/thread, generic, SDL_sysmutex_c.h)
  1795             COPY_ARCH_SRC(src/thread, beos, SDL_syssem.c)
  1796             COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
  1797             COPY_ARCH_SRC(src/thread, generic, SDL_syscond.c)
  1798             COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
  1799         fi
  1800         # Set up files for the timer library
  1801         if test x$enable_timers = xyes; then
  1802             COPY_ARCH_SRC(src/timer, beos, SDL_systimer.c)
  1803         fi
  1804         # The BeOS platform requires special libraries
  1805         SYSTEM_LIBS="$SYSTEM_LIBS -lroot -lbe -lmedia -lgame -ldevice -ltextencoding"
  1806         ;;
  1807     *-*-macos*)
  1808         # This would be used if cross-compiling to MacOS 9.  No way to
  1809         # use it at present, but Apple is working on a X-to-9 compiler
  1810         # for which this case would be handy.
  1811         ARCH=macos
  1812         CheckDummyVideo
  1813         CheckDiskAudio
  1814         CheckTOOLBOX
  1815         CheckMacGL
  1816         # Set up files for the main() stub
  1817         COPY_ARCH_SRC(src/main, macos, SDL_main.c)
  1818         # Set up files for the audio library
  1819         if test x$enable_audio = xyes; then
  1820             AUDIO_SUBDIRS="$AUDIO_SUBDIRS macrom"
  1821             AUDIO_DRIVERS="$AUDIO_DRIVERS macrom/libaudio_macrom.la"
  1822         fi
  1823         # Set up files for the joystick library
  1824         if test x$enable_joystick = xyes; then
  1825             JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS macos"
  1826             JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS macos/libjoystick_macos.la"
  1827         fi
  1828         # Set up files for the cdrom library
  1829         if test x$enable_cdrom = xyes; then
  1830             COPY_ARCH_SRC(src/cdrom, macos, SDL_syscdrom.c)
  1831         fi
  1832         # Set up files for the thread library
  1833         if test x$enable_threads = xyes; then
  1834             COPY_ARCH_SRC(src/thread, macos, SDL_systhread.c)
  1835             COPY_ARCH_SRC(src/thread, macos, SDL_systhread_c.h)
  1836             COPY_ARCH_SRC(src/thread, generic, SDL_sysmutex.c)
  1837             COPY_ARCH_SRC(src/thread, generic, SDL_sysmutex_c.h)
  1838             COPY_ARCH_SRC(src/thread, macos, SDL_syssem.c)
  1839             COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
  1840             COPY_ARCH_SRC(src/thread, generic, SDL_syscond.c)
  1841             COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
  1842         fi
  1843         # Set up files for the timer library
  1844         if test x$enable_timers = xyes; then
  1845             COPY_ARCH_SRC(src/timer, macos, SDL_systimer.c)
  1846         fi
  1847         # The MacOS platform requires special setup
  1848         SDL_CFLAGS="$SDL_CFLAGS -Dmain=SDL_main"
  1849         SDL_LIBS="-lSDLmain $SDL_LIBS"
  1850         ;;
  1851     *-*-darwin* )
  1852         # Strictly speaking, we want "Mac OS X", not "Darwin", which is
  1853         # just the OS X kernel sans upper layers like Carbon.  But
  1854         # config.guess comes back with "darwin", so go with the flow.
  1855         ARCH=macos
  1856         CheckDummyVideo
  1857         CheckDiskAudio
  1858         CheckCARBON
  1859         CheckMacGL
  1860         CheckPTHREAD
  1861         # Set up files for the main() stub
  1862         # COPY_ARCH_SRC(src/main, macos, SDL_main.c)
  1863         COPY_ARCH_SRC(src/main, linux, SDL_main.c)
  1864         # Set up files for the audio library
  1865         if test x$enable_audio = xyes; then
  1866             AUDIO_SUBDIRS="$AUDIO_SUBDIRS macrom"
  1867             AUDIO_DRIVERS="$AUDIO_DRIVERS macrom/libaudio_macrom.la"
  1868         fi
  1869         # Set up files for the joystick library
  1870         if test x$enable_joystick = xyes; then
  1871             JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS dummy"
  1872             JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS dummy/libjoystick_dummy.la"
  1873         fi
  1874         # Set up files for the cdrom library
  1875         if test x$enable_cdrom = xyes; then
  1876             COPY_ARCH_SRC(src/cdrom, dummy, SDL_syscdrom.c)
  1877         fi
  1878         # Set up files for the thread library
  1879         if test x$enable_threads = xyes; then
  1880             COPY_ARCH_SRC(src/thread, linux, SDL_systhread.c)
  1881             COPY_ARCH_SRC(src/thread, linux, SDL_systhread_c.h)
  1882             COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex.c)
  1883             COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex_c.h)
  1884             if test x$use_pthreads = xyes -a x$enable_pthread_sem != xyes; then
  1885                 COPY_ARCH_SRC(src/thread, generic, SDL_syssem.c)
  1886             else
  1887                 COPY_ARCH_SRC(src/thread, linux, SDL_syssem.c)
  1888             fi
  1889             COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
  1890             COPY_ARCH_SRC(src/thread, generic, SDL_syscond.c)
  1891             COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
  1892         fi
  1893         # Set up files for the timer library
  1894         if test x$enable_timers = xyes; then
  1895             COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
  1896         fi
  1897         # The MacOS X platform requires special setup
  1898         SDL_CFLAGS="$SDL_CFLAGS -F/System/Library/Frameworks/Carbon.framework"
  1899         SDL_LIBS="-lSDLmain $SDL_LIBS -framework Carbon"
  1900         ;;
  1901     *)
  1902         AC_MSG_ERROR(Unsupported target:  Please add to configure.in)
  1903         ;;
  1904 esac
  1905 AC_SUBST(ARCH)
  1906 
  1907 # Set the conditional variables for this target
  1908 AM_CONDITIONAL(TARGET_LINUX, test $ARCH = linux)
  1909 AM_CONDITIONAL(TARGET_SOLARIS, test $ARCH = solaris)
  1910 AM_CONDITIONAL(TARGET_IRIX, test $ARCH = irix)
  1911 AM_CONDITIONAL(TARGET_BSDI, test $ARCH = bsdi)
  1912 AM_CONDITIONAL(TARGET_FREEBSD, test $ARCH = freebsd)
  1913 AM_CONDITIONAL(TARGET_NETBSD, test $ARCH = netbsd)
  1914 AM_CONDITIONAL(TARGET_OPENBSD, test $ARCH = openbsd)
  1915 AM_CONDITIONAL(TARGET_AIX, test $ARCH = aix)
  1916 AM_CONDITIONAL(TARGET_WIN32, test $ARCH = win32)
  1917 AM_CONDITIONAL(TARGET_BEOS, test $ARCH = beos)
  1918 AM_CONDITIONAL(TARGET_MACOS, test $ARCH = macos)
  1919 
  1920 # Set conditional variables for shared and static library selection.
  1921 # These are not used in any Makefile.am but in sdl-config.in.
  1922 AM_CONDITIONAL([ENABLE_SHARED], [test "$enable_shared" = yes])
  1923 AM_CONDITIONAL([ENABLE_STATIC], [test "$enable_static" = yes])
  1924 
  1925 # Set runtime shared library paths as needed
  1926 
  1927 if test $ARCH = linux -o $ARCH = freebsd -o $ARCH = bsdi; then
  1928   SDL_RLD_FLAGS="-Wl,-rpath,\${exec_prefix}/lib"
  1929 fi
  1930 
  1931 if test $ARCH = solaris; then
  1932   SDL_RLD_FLAGS="-R\${exec_prefix}/lib"
  1933 fi
  1934 
  1935 if test $ARCH = openbsd; then
  1936   SDL_RLD_FLAGS="-L${X11BASE}/lib -Wl,-rpath,\${exec_prefix}/lib -Wl,-rpath,${X11BASE}/lib"
  1937 fi
  1938 
  1939 dnl Output the video drivers we use
  1940 if test x$enable_video = xtrue; then
  1941     if test "$VIDEO_SUBDIRS" = ""; then
  1942         AC_MSG_ERROR(*** No video drivers are enabled!)
  1943     fi
  1944 fi
  1945 AC_SUBST(AUDIO_SUBDIRS)
  1946 AC_SUBST(AUDIO_DRIVERS)
  1947 AC_SUBST(VIDEO_SUBDIRS)
  1948 AC_SUBST(VIDEO_DRIVERS)
  1949 AC_SUBST(JOYSTICK_SUBDIRS)
  1950 AC_SUBST(JOYSTICK_DRIVERS)
  1951 AC_SUBST(SDL_EXTRADIRS)
  1952 AC_SUBST(SDL_EXTRALIBS)
  1953 AC_SUBST(SYSTEM_LIBS)
  1954 
  1955 dnl Expand the cflags and libraries needed by apps using SDL
  1956 AC_SUBST(SDL_CFLAGS)
  1957 AC_SUBST(SDL_LIBS)
  1958 AC_SUBST(SDL_RLD_FLAGS)
  1959 
  1960 dnl Expand the libraries needed for static linking
  1961 AC_SUBST(SYSTEM_LIBS)
  1962 dnl Expand the include directories for building SDL
  1963 CFLAGS="$CFLAGS -I\$(top_srcdir)/include"
  1964 CFLAGS="$CFLAGS -I\$(top_srcdir)/include/SDL"
  1965 CFLAGS="$CFLAGS -I\$(top_srcdir)/src -I\$(top_srcdir)/src/$ARCH"
  1966 CFLAGS="$CFLAGS -I\$(top_srcdir)/src/main"
  1967 CFLAGS="$CFLAGS -I\$(top_srcdir)/src/audio"
  1968 CFLAGS="$CFLAGS -I\$(top_srcdir)/src/video"
  1969 CFLAGS="$CFLAGS -I\$(top_srcdir)/src/events"
  1970 CFLAGS="$CFLAGS -I\$(top_srcdir)/src/joystick"
  1971 CFLAGS="$CFLAGS -I\$(top_srcdir)/src/cdrom"
  1972 CFLAGS="$CFLAGS -I\$(top_srcdir)/src/thread"
  1973 CFLAGS="$CFLAGS -I\$(top_srcdir)/src/timer"
  1974 CFLAGS="$CFLAGS -I\$(top_srcdir)/src/endian"
  1975 CFLAGS="$CFLAGS -I\$(top_srcdir)/src/file"
  1976 CXXFLAGS="$CFLAGS"
  1977 
  1978 # Finally create all the generated files
  1979 dnl Important: Any directory that you want to be in the distcheck should
  1980 dnl            have a file listed here, so that configure generates the
  1981 dnl            subdirectories on the build target.
  1982 AC_OUTPUT([
  1983 Makefile
  1984 docs/Makefile
  1985 docs/html/Makefile
  1986 docs/man3/Makefile
  1987 include/Makefile
  1988 src/Makefile
  1989 src/main/Makefile
  1990 src/audio/Makefile
  1991 src/audio/alsa/Makefile
  1992 src/audio/arts/Makefile
  1993 src/audio/baudio/Makefile
  1994 src/audio/dma/Makefile
  1995 src/audio/dmedia/Makefile
  1996 src/audio/dsp/Makefile
  1997 src/audio/esd/Makefile
  1998 src/audio/macrom/Makefile
  1999 src/audio/nas/Makefile
  2000 src/audio/nto/Makefile
  2001 src/audio/openbsd/Makefile
  2002 src/audio/paudio/Makefile
  2003 src/audio/sun/Makefile
  2004 src/audio/ums/Makefile
  2005 src/audio/windib/Makefile
  2006 src/audio/windx5/Makefile
  2007 src/audio/disk/Makefile
  2008 src/video/Makefile
  2009 src/video/cybergfx/Makefile
  2010 src/video/x11/Makefile
  2011 src/video/dga/Makefile
  2012 src/video/nanox/Makefile
  2013 src/video/fbcon/Makefile
  2014 src/video/ggi/Makefile
  2015 src/video/maccommon/Makefile
  2016 src/video/macdsp/Makefile
  2017 src/video/macrom/Makefile
  2018 src/video/quartz/Makefile
  2019 src/video/svga/Makefile
  2020 src/video/aalib/Makefile
  2021 src/video/wincommon/Makefile
  2022 src/video/windib/Makefile
  2023 src/video/windx5/Makefile
  2024 src/video/bwindow/Makefile
  2025 src/video/photon/Makefile
  2026 src/video/dummy/Makefile
  2027 src/events/Makefile
  2028 src/joystick/Makefile
  2029 src/joystick/amigaos/Makefile
  2030 src/joystick/beos/Makefile
  2031 src/joystick/dummy/Makefile
  2032 src/joystick/linux/Makefile
  2033 src/joystick/macos/Makefile
  2034 src/joystick/win32/Makefile
  2035 src/cdrom/Makefile
  2036 src/thread/Makefile
  2037 src/timer/Makefile
  2038 src/endian/Makefile
  2039 src/file/Makefile
  2040 src/hermes/Makefile
  2041 sdl-config
  2042 SDL.spec
  2043 ], [chmod +x sdl-config])