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