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