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