configure.in
author Sam Lantinga <slouken@libsdl.org>
Mon, 20 Jan 2003 01:37:07 +0000
changeset 570 04d6411da49d
parent 567 969fbd4dcd4e
child 582 16cc97387d52
permissions -rw-r--r--
ate: Thu, 16 Jan 2003 13:48:31 +0200
From: "Mike Gorchak"

added support for checking libtool's version of libdl for dlopen.
     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=6
    18 SDL_INTERFACE_AGE=6
    19 SDL_BINARY_AGE=6
    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_SYSTEM
    42 
    43 dnl Setup for automake
    44 AM_INIT_AUTOMAKE(SDL, $SDL_VERSION)
    45 
    46 dnl Check for tools
    47 
    48 AC_LIBTOOL_WIN32_DLL
    49 AM_PROG_LIBTOOL
    50 AC_PROG_MAKE_SET
    51 AC_PROG_CC
    52 AC_C_INLINE
    53 AC_C_CONST
    54 AC_PROG_CXX
    55 AC_PROG_INSTALL
    56 AC_FUNC_ALLOCA
    57 ASFLAGS=""
    58 AC_SUBST(ASFLAGS)
    59 CCAS="$CC"
    60 AC_SUBST(CCAS)
    61 CCASFLAGS=""
    62 AC_SUBST(CCASFLAGS)
    63 
    64 dnl The alpha architecture needs special flags for binary portability
    65 case "$target" in
    66     alpha*-*-linux*)
    67         if test x$ac_cv_prog_gcc = xyes; then
    68             CFLAGS="$CFLAGS -mcpu=ev4 -Wa,-mall"
    69         fi
    70         ;;
    71 esac
    72 
    73 dnl Add compiler-specific optimization flags
    74 
    75 dnl See if the user wants aggressive optimizations of the code
    76 AC_ARG_ENABLE(debug,
    77 [  --enable-debug          Disable aggressive optimizations [default=yes]],
    78               , enable_debug=yes)
    79 if test x$enable_debug != xyes; then
    80     if test x$ac_cv_prog_gcc = xyes; then
    81         CFLAGS="$CFLAGS -fexpensive-optimizations"
    82         # Ack! This breaks the MMX YV12 conversion on gcc 2.95.2
    83         # CFLAGS="$CFLAGS -fomit-frame-pointer"
    84     fi
    85     case "$target" in
    86         i486-*-*)
    87             if test x$ac_cv_prog_gcc = xyes; then
    88                 CFLAGS="$CFLAGS -march=486"
    89             fi
    90             ;;
    91         i?86-*-*)
    92             if test x$ac_cv_prog_gcc = xyes; then
    93                 CFLAGS="$CFLAGS -march=pentium -mcpu=pentiumpro"
    94             fi
    95             ;;
    96         *-*-osf*)
    97             if test x$ac_cv_prog_gcc != xyes; then
    98                 CFLAGS="-g3 -fast -arch host"
    99             fi
   100             ;;
   101     esac
   102 fi
   103 
   104 dnl Add verbose warnings by default, and allow ANSI compliance checking
   105 AC_ARG_ENABLE(strict-ansi,
   106 [  --enable-strict-ansi    Enable strict ANSI compliance build [default=no]],
   107               , enable_strict_ansi=no)
   108 if test x$ac_cv_prog_gcc = xyes; then
   109     CFLAGS="$CFLAGS -Wall"
   110     if test x$enable_strict_ansi = xyes; then
   111         CFLAGS="$CFLAGS -ansi -pedantic -D_XOPEN_SOURCE"
   112     fi
   113 fi
   114 
   115 dnl Initialize the compiler and linker flags for SDL applications
   116 
   117 SDL_CFLAGS=""
   118 SDL_LIBS="-lSDL"
   119 
   120 dnl Add the math library for the new gamma correction support
   121 
   122 case "$target" in
   123     *-*-cygwin* | *-*-mingw32*)
   124         MATHLIB=""
   125         ;;
   126     *-*-beos*)
   127         MATHLIB=""
   128         ;;
   129     *-*-darwin*)
   130         MATHLIB=""
   131         ;;
   132     *)
   133         MATHLIB="-lm"
   134         ;;
   135 esac
   136 SYSTEM_LIBS="$SYSTEM_LIBS $MATHLIB"
   137 
   138 dnl Enable/disable various subsystems of the SDL library
   139 
   140 AC_ARG_ENABLE(audio,
   141 [  --enable-audio          Enable the audio subsystem [default=yes]],
   142               , enable_audio=yes)
   143 if test x$enable_audio = xyes; then
   144     SDL_EXTRADIRS="$SDL_EXTRADIRS audio"
   145     SDL_EXTRALIBS="$SDL_EXTRALIBS audio/libaudio.la"
   146 else
   147     CFLAGS="$CFLAGS -DDISABLE_AUDIO"
   148 fi
   149 AC_ARG_ENABLE(video,
   150 [  --enable-video          Enable the video subsystem [default=yes]],
   151               , enable_video=yes)
   152 if test x$enable_video = xyes; then
   153     SDL_EXTRADIRS="$SDL_EXTRADIRS video"
   154     SDL_EXTRALIBS="$SDL_EXTRALIBS video/libvideo.la"
   155 else
   156     CFLAGS="$CFLAGS -DDISABLE_VIDEO"
   157 fi
   158 AC_ARG_ENABLE(events,
   159 [  --enable-events         Enable the events subsystem [default=yes]],
   160               , enable_events=yes)
   161 if test x$enable_video = xyes -a x$enable_events = xyes; then
   162     SDL_EXTRADIRS="$SDL_EXTRADIRS events"
   163     SDL_EXTRALIBS="$SDL_EXTRALIBS events/libevents.la"
   164 else
   165     CFLAGS="$CFLAGS -DDISABLE_EVENTS"
   166 fi
   167 AC_ARG_ENABLE(joystick,
   168 [  --enable-joystick       Enable the joystick subsystem [default=yes]],
   169               , enable_joystick=yes)
   170 if test x$enable_joystick = xyes; then
   171     SDL_EXTRADIRS="$SDL_EXTRADIRS joystick"
   172     SDL_EXTRALIBS="$SDL_EXTRALIBS joystick/libjoystick.la"
   173 else
   174     CFLAGS="$CFLAGS -DDISABLE_JOYSTICK"
   175 fi
   176 AC_ARG_ENABLE(cdrom,
   177 [  --enable-cdrom          Enable the cdrom subsystem [default=yes]],
   178               , enable_cdrom=yes)
   179 if test x$enable_cdrom = xyes; then
   180     SDL_EXTRADIRS="$SDL_EXTRADIRS cdrom"
   181     SDL_EXTRALIBS="$SDL_EXTRALIBS cdrom/libcdrom.la"
   182 else
   183     CFLAGS="$CFLAGS -DDISABLE_CDROM"
   184 fi
   185 AC_ARG_ENABLE(threads,
   186 [  --enable-threads        Enable the threading subsystem [default=yes]],
   187               , enable_threads=yes)
   188 SDL_EXTRADIRS="$SDL_EXTRADIRS thread"
   189 SDL_EXTRALIBS="$SDL_EXTRALIBS thread/libthread.la"
   190 if test x$enable_threads != xyes; then
   191     CFLAGS="$CFLAGS -DDISABLE_THREADS"
   192     COPY_ARCH_SRC(src/thread, generic, SDL_systhread.c)
   193     COPY_ARCH_SRC(src/thread, generic, SDL_systhread_c.h)
   194     COPY_ARCH_SRC(src/thread, generic, SDL_sysmutex.c)
   195     COPY_ARCH_SRC(src/thread, generic, SDL_sysmutex_c.h)
   196     COPY_ARCH_SRC(src/thread, generic, SDL_syssem.c)
   197     COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
   198     COPY_ARCH_SRC(src/thread, generic, SDL_syscond.c)
   199     COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
   200 fi
   201 AC_ARG_ENABLE(timers,
   202 [  --enable-timers         Enable the timer subsystem [default=yes]],
   203               , enable_timers=yes)
   204 if test x$enable_timers = xyes; then
   205     SDL_EXTRADIRS="$SDL_EXTRADIRS timer"
   206     SDL_EXTRALIBS="$SDL_EXTRALIBS timer/libtimer.la"
   207 else
   208     CFLAGS="$CFLAGS -DDISABLE_TIMERS"
   209 fi
   210 AC_ARG_ENABLE(endian,
   211 [  --enable-endian         Enable the endian subsystem [default=yes]],
   212               , enable_endian=yes)
   213 if test x$enable_endian = xyes; then
   214     SDL_EXTRADIRS="$SDL_EXTRADIRS endian"
   215     SDL_EXTRALIBS="$SDL_EXTRALIBS endian/libendian.la"
   216 else
   217     CFLAGS="$CFLAGS -DDISABLE_ENDIAN"
   218 fi
   219 AC_ARG_ENABLE(file,
   220 [  --enable-file           Enable the file subsystem [default=yes]],
   221               , enable_file=yes)
   222 if test x$enable_file = xyes; then
   223     SDL_EXTRADIRS="$SDL_EXTRADIRS file"
   224     SDL_EXTRALIBS="$SDL_EXTRALIBS file/libfile.la"
   225 else
   226     CFLAGS="$CFLAGS -DDISABLE_FILE"
   227 fi
   228 
   229 dnl See if the OSS audio interface is supported
   230 CheckOSS()
   231 {
   232     AC_ARG_ENABLE(oss,
   233 [  --enable-oss            support the OSS audio API [default=yes]],
   234                   , enable_oss=yes)
   235     if test x$enable_audio = xyes -a x$enable_oss = xyes; then
   236         AC_MSG_CHECKING(for OSS audio support)
   237         have_oss=no
   238         if test x$have_oss != xyes; then
   239             AC_TRY_COMPILE([
   240               #include <sys/soundcard.h>
   241             ],[
   242               int arg = SNDCTL_DSP_SETFRAGMENT;
   243             ],[
   244             have_oss=yes
   245             ])
   246         fi
   247         if test x$have_oss != xyes; then
   248             AC_TRY_COMPILE([
   249               #include <soundcard.h>
   250             ],[
   251               int arg = SNDCTL_DSP_SETFRAGMENT;
   252             ],[
   253             have_oss=yes
   254             CFLAGS="$CFLAGS -DOSS_USE_SOUNDCARD_H"
   255             ])
   256         fi
   257         AC_MSG_RESULT($have_oss)
   258         if test x$have_oss = xyes; then
   259             CFLAGS="$CFLAGS -DOSS_SUPPORT"
   260             AUDIO_SUBDIRS="$AUDIO_SUBDIRS dsp"
   261             AUDIO_DRIVERS="$AUDIO_DRIVERS dsp/libaudio_dsp.la"
   262             AUDIO_SUBDIRS="$AUDIO_SUBDIRS dma"
   263             AUDIO_DRIVERS="$AUDIO_DRIVERS dma/libaudio_dma.la"
   264         fi
   265     fi
   266 }
   267 
   268 dnl See if the ALSA audio interface is supported
   269 CheckALSA()
   270 {
   271     AC_ARG_ENABLE(alsa,
   272 [  --enable-alsa           support the ALSA audio API [default=yes]],
   273                   , enable_alsa=yes)
   274     if test x$enable_audio = xyes -a x$enable_alsa = xyes; then
   275         AC_MSG_CHECKING(for ALSA audio support)
   276         have_alsa=no
   277         AC_TRY_COMPILE([
   278           #include <alsa/asoundlib.h>
   279         ],[
   280           #if SND_LIB_VERSION < ((0<<16)|(9<<8)|0)
   281           #error Your version of ALSA is too old
   282           #endif
   283           snd_pcm_t *pcm_handle;
   284         ],[
   285         AC_CHECK_LIB(asound, snd_pcm_open, have_alsa=yes)
   286         ])
   287         if test x$have_alsa = xyes; then
   288             CFLAGS="$CFLAGS -DALSA_SUPPORT"
   289             SYSTEM_LIBS="$SYSTEM_LIBS -lasound"
   290             AUDIO_SUBDIRS="$AUDIO_SUBDIRS alsa"
   291             AUDIO_DRIVERS="$AUDIO_DRIVERS alsa/libaudio_alsa.la"
   292         else
   293             AC_MSG_RESULT($have_alsa)
   294         fi
   295     fi
   296 }
   297 
   298 dnl Check whether we want to use IRIX 6.5+ native audio or not
   299 CheckDMEDIA()
   300 {
   301     if test x$enable_audio = xyes; then
   302         AC_MSG_CHECKING(for dmedia audio support)
   303         have_dmedia=no
   304         AC_TRY_COMPILE([
   305           #include <dmedia/audio.h>
   306         ],[
   307           ALport audio_port;
   308         ],[
   309         have_dmedia=yes
   310         ])
   311         # Set up files for the audio library
   312         if test x$have_dmedia = xyes; then
   313             CFLAGS="$CFLAGS -DDMEDIA_SUPPORT"
   314             AUDIO_SUBDIRS="$AUDIO_SUBDIRS dmedia"
   315             AUDIO_DRIVERS="$AUDIO_DRIVERS dmedia/libaudio_dmedia.la"
   316             SYSTEM_LIBS="$SYSTEM_LIBS -laudio"
   317         fi
   318     fi
   319 }
   320 
   321 dnl Find the ESD includes and libraries
   322 CheckESD()
   323 {
   324     AC_ARG_ENABLE(esd,
   325 [  --enable-esd            support the Enlightened Sound Daemon [default=yes]],
   326                   , enable_esd=yes)
   327     if test x$enable_audio = xyes -a x$enable_esd = xyes; then
   328         use_esd=no
   329         AM_PATH_ESD(0.2.8, use_esd=yes)
   330         if test x$use_esd = xyes; then
   331             AC_ARG_ENABLE(esd-shared,
   332 [  --enable-esd-shared     dynamically load ESD audio support [default=no]],
   333                           , enable_esd_shared=no)
   334             esd_lib_spec=`echo $ESD_LIBS | sed 's/.*-L\([[^ ]]*\).*/\1\/libesd.so.*/'`
   335             esd_lib=`ls $esd_lib_spec | head -1 | sed 's/.*\/\(.*\)/\1/'`
   336             echo "-- $esd_lib_spec -> $esd_lib"
   337             if test x$enable_dlopen != xyes && \
   338                test x$enable_esd_shared = xyes; then
   339                 AC_MSG_ERROR([You must have dlopen() support and use the --enable-dlopen option])
   340             fi
   341             if test x$enable_dlopen = xyes && \
   342                test x$enable_esd_shared = xyes && test x$esd_lib != x; then
   343                 CFLAGS="$CFLAGS -DESD_SUPPORT -DESD_DYNAMIC=\$(esd_lib) $ESD_CFLAGS"
   344                 AC_SUBST(esd_lib)
   345             else
   346                 CFLAGS="$CFLAGS -DESD_SUPPORT $ESD_CFLAGS"
   347                 SYSTEM_LIBS="$SYSTEM_LIBS $ESD_LIBS"
   348             fi
   349             AUDIO_SUBDIRS="$AUDIO_SUBDIRS esd"
   350             AUDIO_DRIVERS="$AUDIO_DRIVERS esd/libaudio_esd.la"
   351         fi
   352     fi
   353 }
   354 
   355 CheckARTSC()
   356 {
   357     AC_ARG_ENABLE(arts,
   358 [  --enable-arts           support the Analog Real Time Synthesizer [default=yes]],
   359                   , enable_arts=yes)
   360     if test x$enable_audio = xyes -a x$enable_arts = xyes; then
   361         AC_PATH_PROG(ARTSCCONFIG, artsc-config)
   362         if test x$ARTSCCONFIG = x -o x$ARTSCCONFIG = x'"$ARTSCCONFIG"'; then
   363             : # arts isn't installed
   364         else
   365             ARTSC_CFLAGS=`$ARTSCCONFIG --cflags`
   366             ARTSC_LIBS=`$ARTSCCONFIG --libs`
   367             AC_MSG_CHECKING(for aRts development environment)
   368             audio_arts=no
   369             save_CFLAGS="$CFLAGS"
   370             CFLAGS="$CFLAGS $ARTSC_CFLAGS"
   371             AC_TRY_COMPILE([
   372              #include <artsc.h>
   373             ],[
   374              arts_stream_t stream;
   375             ],[
   376             audio_arts=yes
   377             ])
   378             CFLAGS="$save_CFLAGS"
   379             AC_MSG_RESULT($audio_arts)
   380             if test x$audio_arts = xyes; then
   381                 AC_ARG_ENABLE(arts-shared,
   382 [  --enable-arts-shared     dynamically load aRts audio support [default=no]],
   383                               , enable_arts_shared=no)
   384                 arts_lib_spec=`echo $ARTSC_LIBS | sed 's/.*-L\([[^ ]]*\).*/\1\/libartsc.so.*/'`
   385                 arts_lib=`ls $arts_lib_spec | head -1 | sed 's/.*\/\(.*\)/\1/'`
   386                 echo "-- $arts_lib_spec -> $arts_lib"
   387                 if test x$enable_dlopen != xyes && \
   388                    test x$enable_arts_shared = xyes; then
   389                     AC_MSG_ERROR([You must have dlopen() support and use the --enable-dlopen option])
   390                 fi
   391                 if test x$enable_dlopen = xyes && \
   392                    test x$enable_arts_shared = xyes && test x$arts_lib != x; then
   393                     CFLAGS="$CFLAGS -DARTSC_SUPPORT -DARTSC_DYNAMIC=\$(arts_lib) $ARTSC_CFLAGS"
   394                     AC_SUBST(arts_lib)
   395                 else
   396                     CFLAGS="$CFLAGS -DARTSC_SUPPORT $ARTSC_CFLAGS"
   397                     SYSTEM_LIBS="$SYSTEM_LIBS $ARTSC_LIBS"
   398                 fi
   399                 AUDIO_SUBDIRS="$AUDIO_SUBDIRS arts"
   400                 AUDIO_DRIVERS="$AUDIO_DRIVERS arts/libaudio_arts.la"
   401             fi
   402         fi
   403     fi
   404 }
   405 
   406 dnl See if the NAS audio interface is supported
   407 CheckNAS()
   408 {
   409     AC_ARG_ENABLE(nas,
   410 [  --enable-nas                  support the NAS audio API [default=yes]],
   411                   , enable_nas=yes)
   412     if test x$enable_audio = xyes -a x$enable_nas = xyes; then
   413         AC_MSG_CHECKING(for NAS audio support)
   414         have_nas=no
   415         if test -r /usr/X11R6/include/audio/audiolib.h; then
   416             have_nas=yes
   417         fi
   418         AC_MSG_RESULT($have_nas)
   419         if test x$have_nas = xyes; then
   420             CFLAGS="$CFLAGS -DNAS_SUPPORT"
   421             SYSTEM_LIBS="$SYSTEM_LIBS -laudio -lXt"
   422             AUDIO_SUBDIRS="$AUDIO_SUBDIRS nas"
   423             AUDIO_DRIVERS="$AUDIO_DRIVERS nas/libaudio_nas.la"
   424         fi
   425     fi
   426 }
   427 
   428 dnl rcg07142001 See if the user wants the disk writer audio driver...
   429 CheckDiskAudio()
   430 {
   431     AC_ARG_ENABLE(diskaudio,
   432 [  --enable-diskaudio            support the disk writer audio driver [default=yes]],
   433                   , enable_diskaudio=yes)
   434     if test x$enable_audio = xyes -a x$enable_diskaudio = xyes; then
   435         CFLAGS="$CFLAGS -DDISKAUD_SUPPORT"
   436         AUDIO_SUBDIRS="$AUDIO_SUBDIRS disk"
   437         AUDIO_DRIVERS="$AUDIO_DRIVERS disk/libaudio_disk.la"
   438     fi
   439 }
   440 
   441 dnl Set up the Atari Audio driver
   442 CheckAtariAudio()
   443 {
   444     AC_ARG_ENABLE(mintaudio,
   445 [  --enable-mintaudio      support Atari audio driver [default=yes]],
   446                   , enable_mintaudio=yes)
   447     if test x$enable_audio = xyes -a x$enable_mintaudio = xyes; then
   448         mintaudio=no
   449         AC_CHECK_HEADER(mint/falcon.h, have_mint_falcon_hdr=yes)
   450         if test x$have_mint_falcon_hdr = xyes; then
   451             mintaudio=yes
   452             CFLAGS="$CFLAGS -DMINTAUDIO_SUPPORT"
   453             AUDIO_SUBDIRS="$AUDIO_SUBDIRS mint"
   454             AUDIO_DRIVERS="$AUDIO_DRIVERS mint/libaudio_mintaudio.la"
   455         fi
   456     fi
   457 }
   458 
   459 dnl See if we can use x86 assembly blitters
   460 # NASM is available from: http://nasm.octium.net/
   461 CheckNASM()
   462 {
   463     dnl Make sure we are running on an x86 platform
   464     case $target in
   465         i?86*)
   466             ;;
   467         *)
   468         # Nope, bail early.
   469             return
   470             ;;
   471     esac
   472     dnl Check for NASM (for assembly blit routines)
   473     AC_ARG_ENABLE(nasm,
   474 [  --enable-nasm           use nasm assembly blitters on x86 [default=yes]],
   475                   , enable_nasm=yes)
   476     if test x$enable_video = xyes -a x$enable_nasm = xyes; then
   477         AC_PATH_PROG(NASM, nasm)
   478         if test x$NASM = x -o x$NASM = x'"$NASM"'; then
   479             : # nasm isn't installed
   480         else
   481             CFLAGS="$CFLAGS -DUSE_ASMBLIT -I$srcdir/hermes"
   482             case $ARCH in
   483               win32)
   484                   NASMFLAGS="-f win32"
   485                   ;;
   486               openbsd)
   487                   NASMFLAGS="-f aoutb"
   488                   ;;
   489               *)
   490                   NASMFLAGS="-f elf"
   491                   ;;
   492             esac
   493             AC_SUBST(NASMFLAGS)
   494             CFLAGS="$CFLAGS -I\$(top_srcdir)/src/hermes"
   495             SDL_EXTRADIRS="$SDL_EXTRADIRS hermes"
   496             SDL_EXTRALIBS="$SDL_EXTRALIBS hermes/libhermes.la"
   497         fi
   498     fi
   499 }
   500 
   501 dnl Find the nanox include and library directories
   502 CheckNANOX()
   503 {
   504     AC_ARG_ENABLE(video-nanox,
   505         [  --enable-video-nanox use nanox video driver [default=no]],
   506         , enable_video_nanox=no)
   507     AC_ARG_ENABLE(nanox-debug,  
   508         [  --enable-nanox-debug print debug messages [default=no]],
   509         , enable_nanox_debug=no)
   510     AC_ARG_ENABLE(nanox-share-memory,  
   511         [  --enable-nanox-share-memory use share memory [default=no]],
   512         , enable_nanox_share_memory=no)
   513     AC_ARG_ENABLE(nanox_direct_fb, 
   514         [  --enable-nanox-direct-fb use direct framebuffer access [default=no]],
   515         , enable_nanox_direct_fb=no)
   516 
   517     if test x$enable_video = xyes -a x$enable_video_nanox = xyes; then
   518         if test x$enable_nanox_debug = xyes; then
   519             CFLAGS="$CFLAGS -DENABLE_NANOX_DEBUG"
   520         fi
   521 
   522         if test x$enable_nanox_share_memory = xyes; then
   523             CFLAGS="$CFLAGS -DNANOX_SHARE_MEMORY"
   524         fi
   525 
   526         if test x$enable_nanox_direct_fb = xyes; then
   527             CFLAGS="$CFLAGS -DENABLE_NANOX_DIRECT_FB"
   528         fi
   529 
   530         CFLAGS="$CFLAGS $X_CFLAGS -DENABLE_NANOX"
   531         SYSTEM_LIBS="$SYSTEM_LIBS -lnano-X"
   532         VIDEO_SUBDIRS="$VIDEO_SUBDIRS nanox"
   533         VIDEO_DRIVERS="$VIDEO_DRIVERS nanox/libvideo_nanox.la"
   534     fi
   535 }
   536 
   537 dnl Find the X11 include and library directories
   538 CheckX11()
   539 {
   540     AC_ARG_ENABLE(video-x11,
   541 [  --enable-video-x11      use X11 video driver [default=yes]],
   542                   , enable_video_x11=yes)
   543     if test x$enable_video = xyes -a x$enable_video_x11 = xyes; then
   544         AC_PATH_X
   545         AC_PATH_XTRA
   546         if test x$have_x = xyes; then
   547             CFLAGS="$CFLAGS $X_CFLAGS -DENABLE_X11 -I$srcdir/include -I$srcdir/src/video"
   548             if test x$ac_cv_func_shmat != xyes; then
   549                 CFLAGS="$CFLAGS -DNO_SHARED_MEMORY"
   550             fi
   551             SYSTEM_LIBS="$SYSTEM_LIBS $X_LIBS -lX11 -lXext"
   552             VIDEO_SUBDIRS="$VIDEO_SUBDIRS x11"
   553             VIDEO_DRIVERS="$VIDEO_DRIVERS x11/libvideo_x11.la"
   554 
   555             AC_ARG_ENABLE(video-x11-vm,
   556 [  --enable-video-x11-vm   use X11 VM extension for fullscreen [default=yes]],
   557                           , enable_video_x11_vm=yes)
   558             if test x$enable_video_x11_vm = xyes; then
   559                 AC_MSG_CHECKING(for XFree86 VidMode 1.0 support)
   560                 video_x11_vm=no
   561                 AC_TRY_COMPILE([
   562                  #include <X11/Xlib.h>
   563                  #include <XFree86/extensions/xf86vmode.h>
   564                 ],[
   565                 ],[
   566                 video_x11_vm=yes
   567                 ])
   568                 AC_MSG_RESULT($video_x11_vm)
   569                 if test x$video_x11_vm = xyes; then
   570                     CFLAGS="$CFLAGS -DXFREE86_VM"
   571                     VIDEO_SUBDIRS="$VIDEO_SUBDIRS XFree86/Xxf86vm"
   572                     VIDEO_DRIVERS="$VIDEO_DRIVERS XFree86/Xxf86vm/libXFree86_Xxf86vm.la"
   573                     AC_MSG_CHECKING(for XFree86 VidMode gamma support)
   574                     video_x11_vmgamma=no
   575                     AC_TRY_COMPILE([
   576                      #include <X11/Xlib.h>
   577                      #include <XFree86/extensions/xf86vmode.h>
   578                     ],[
   579                      SDL_NAME(XF86VidModeGamma) gamma;
   580                     ],[
   581                     video_x11_vmgamma=yes
   582                     ])
   583                     AC_MSG_RESULT($video_x11_vmgamma)
   584                     if test x$video_x11_vmgamma = xyes; then
   585                         CFLAGS="$CFLAGS -DXFREE86_VMGAMMA"
   586                     fi
   587                 fi
   588             fi
   589             AC_ARG_ENABLE(dga,
   590 [  --enable-dga            allow use of X11 DGA code [default=yes]],
   591                           , enable_dga=yes)
   592             AC_ARG_ENABLE(video-x11-dgamouse,
   593 [  --enable-video-x11-dgamouse  use X11 DGA for mouse events [default=yes]],
   594                           , enable_video_x11_dgamouse=yes)
   595             if test x$enable_dga = xyes; then
   596                 AC_MSG_CHECKING(for XFree86 DGA 1.0 support)
   597                 video_x11_dga=no
   598                 AC_TRY_COMPILE([
   599                  #include <X11/Xlib.h>
   600                  #include <XFree86/extensions/xf86dga.h>
   601                 ],[
   602                 ],[
   603                 video_x11_dga=yes
   604                 ])
   605                 AC_MSG_RESULT($video_x11_dga)
   606                 if test x$video_x11_dga = xyes; then
   607                     CFLAGS="$CFLAGS -DXFREE86_DGAMOUSE"
   608                     if test x$enable_video_x11_dgamouse = xyes; then
   609                         CFLAGS="$CFLAGS -DDEFAULT_DGAMOUSE"
   610                     fi
   611                     VIDEO_SUBDIRS="$VIDEO_SUBDIRS XFree86/Xxf86dga"
   612                     VIDEO_DRIVERS="$VIDEO_DRIVERS XFree86/Xxf86dga/libXFree86_Xxf86dga.la"
   613                 fi
   614             fi
   615             AC_ARG_ENABLE(video-x11-xv,
   616 [  --enable-video-x11-xv   use X11 XvImage extension for video [default=yes]],
   617                           , enable_video_x11_xv=yes)
   618             if test x$enable_video_x11_xv = xyes; then
   619                 AC_MSG_CHECKING(for XFree86 XvImage support)
   620                 video_x11_xv=no
   621                 AC_TRY_COMPILE([
   622                  #include <X11/Xlib.h>
   623                  #include <sys/ipc.h>
   624                  #include <sys/shm.h>
   625                  #include <X11/extensions/XShm.h>
   626                  #include <XFree86/extensions/Xvlib.h>
   627                 ],[
   628                  SDL_NAME(XvImage) *image;
   629                 ],[
   630                 video_x11_xv=yes
   631                 ])
   632                 AC_MSG_RESULT($video_x11_xv)
   633                 if test x$video_x11_xv = xyes; then
   634                     CFLAGS="$CFLAGS -DXFREE86_XV"
   635                     VIDEO_SUBDIRS="$VIDEO_SUBDIRS XFree86/Xv"
   636                     VIDEO_DRIVERS="$VIDEO_DRIVERS XFree86/Xv/libXFree86_Xv.la"
   637                 fi
   638             fi
   639             AC_ARG_ENABLE(video-x11-xinerama,
   640 [  --enable-video-x11-xinerama   enable X11 Xinerama support [default=yes]],
   641                             , enable_video_x11_xinerama=yes)
   642             if test x$enable_video_x11_xinerama = xyes; then
   643                 AC_MSG_CHECKING(for X11 Xinerama support)
   644                 video_x11_xinerama=no
   645                 AC_TRY_COMPILE([
   646                  #include <X11/Xlib.h>
   647                  #include <XFree86/extensions/Xinerama.h>
   648                 ],[
   649                  SDL_NAME(XineramaScreenInfo) *xinerama;
   650                 ],[
   651                 video_x11_xinerama=yes
   652                 ])
   653                 AC_MSG_RESULT($video_x11_xinerama)
   654                 if test x$video_x11_xinerama = xyes; then
   655                     CFLAGS="$CFLAGS -DHAVE_XINERAMA"
   656                     VIDEO_SUBDIRS="$VIDEO_SUBDIRS XFree86/Xinerama"
   657                     VIDEO_DRIVERS="$VIDEO_DRIVERS XFree86/Xinerama/libXFree86_Xinerama.la"
   658                 fi
   659             fi
   660             AC_ARG_ENABLE(video-x11-xme,
   661 [  --enable-video-x11-xme  enable Xi Graphics XME for fullscreen [default=yes]],
   662                             , enable_video_x11_xme=yes)
   663             if test x$enable_video_x11_xme = xyes; then
   664                 AC_MSG_CHECKING(for Xi Graphics XiGMiscExtension support)
   665                 video_x11_xme=no
   666                 AC_TRY_COMPILE([
   667                  #include <X11/Xlib.h>
   668                  #include <X11/extensions/xme.h>
   669                 ],[
   670                  XiGMiscResolutionInfo *resolutions;
   671                 ],[
   672                 video_x11_xme=yes
   673                 ])
   674                 AC_MSG_RESULT($video_x11_xme)
   675                 if test x$video_x11_xme = xyes; then
   676                     CFLAGS="$CFLAGS -DHAVE_XIGXME"
   677                     SYSTEM_LIBS="$SYSTEM_LIBS -lxme"
   678                 fi
   679             fi
   680         fi
   681     fi
   682 }
   683 
   684 dnl Find the X11 DGA 2.0 include and library directories
   685 CheckDGA()
   686 {
   687     AC_ARG_ENABLE(video-dga,
   688 [  --enable-video-dga      use DGA 2.0 video driver [default=yes]],
   689                   , enable_video_dga=yes)
   690     if test x$video_x11_dga = xyes -a x$enable_video_dga = xyes; then
   691         save_CFLAGS="$CFLAGS"; CFLAGS="$CFLAGS -Isrc/video"
   692         AC_MSG_CHECKING(for XFree86 DGA 2.0 support)
   693         video_x11_dga2=no
   694         AC_TRY_COMPILE([
   695          #include <X11/Xlib.h>
   696          #include <XFree86/extensions/xf86dga.h>
   697         ],[
   698          SDL_NAME(XDGAEvent) xevent;
   699         ],[
   700         video_x11_dga2=yes
   701         ])
   702         AC_MSG_RESULT($video_x11_dga2)
   703         if test x$video_x11_dga2 = xyes; then
   704             CFLAGS="$CFLAGS -DENABLE_DGA"
   705             VIDEO_SUBDIRS="$VIDEO_SUBDIRS dga"
   706             VIDEO_DRIVERS="$VIDEO_DRIVERS dga/libvideo_dga.la"
   707         fi
   708     fi
   709 }
   710 
   711 CheckPHOTON()
   712 {
   713     AC_ARG_ENABLE(video-photon,
   714 [  --enable-video-photon   use QNX Photon video driver [default=yes]],
   715                   , enable_video_photon=yes)
   716     if test x$enable_video = xyes -a x$enable_video_photon = xyes; then
   717         AC_MSG_CHECKING(for QNX Photon support)
   718         video_photon=no
   719         AC_TRY_COMPILE([
   720           #include <Ph.h>
   721           #include <Pt.h>
   722           #include <photon/Pg.h>
   723           #include <photon/PdDirect.h>
   724         ],[
   725          PgDisplaySettings_t *visual;
   726         ],[
   727         video_photon=yes
   728         ])
   729         AC_MSG_RESULT($video_photon)
   730         if test x$video_photon = xyes; then
   731             CFLAGS="$CFLAGS -DENABLE_PHOTON"
   732             SYSTEM_LIBS="$SYSTEM_LIBS -lph"
   733             VIDEO_SUBDIRS="$VIDEO_SUBDIRS photon"
   734             VIDEO_DRIVERS="$VIDEO_DRIVERS photon/libvideo_photon.la"
   735             CheckOpenGLQNX
   736         fi
   737     fi
   738 }
   739 
   740 dnl Find the framebuffer console includes
   741 CheckFBCON()
   742 {
   743     AC_ARG_ENABLE(video-fbcon,
   744 [  --enable-video-fbcon    use framebuffer console video driver [default=yes]],
   745                   , enable_video_fbcon=yes)
   746     if test x$enable_video = xyes -a x$enable_video_fbcon = xyes; then
   747         AC_MSG_CHECKING(for framebuffer console support)
   748         video_fbcon=no
   749         AC_TRY_COMPILE([
   750          #include <linux/fb.h>
   751          #include <linux/kd.h>
   752          #include <linux/keyboard.h>
   753         ],[
   754         ],[
   755         video_fbcon=yes
   756         ])
   757         AC_MSG_RESULT($video_fbcon)
   758         if test x$video_fbcon = xyes; then
   759             CFLAGS="$CFLAGS -DENABLE_FBCON"
   760             VIDEO_SUBDIRS="$VIDEO_SUBDIRS fbcon"
   761             VIDEO_DRIVERS="$VIDEO_DRIVERS fbcon/libvideo_fbcon.la"
   762         fi
   763     fi
   764 }
   765 
   766 dnl Find DirectFB
   767 CheckDirectFB()
   768 {
   769     AC_ARG_ENABLE(video-directfb,
   770 [  --enable-video-directfb    use DirectFB video driver [default=yes]],
   771                   , enable_video_directfb=yes)
   772     if test x$enable_video = xyes -a x$enable_video_directfb = xyes; then
   773         video_directfb=no
   774 
   775         AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
   776         if test x$PKG_CONFIG = xno ; then
   777             AC_MSG_WARN([*** pkg-config is required to build the DirectFB video driver.])
   778         else
   779             AC_MSG_CHECKING(for DirectFB support)
   780 
   781             if ! $PKG_CONFIG --atleast-pkgconfig-version 0.7 ; then
   782                 AC_MSG_ERROR([*** pkg-config too old; version 0.7 or better required.])
   783             fi
   784 
   785             DIRECTFB_REQUIRED_VERSION=0.9.15
   786 
   787             if $PKG_CONFIG --atleast-version $DIRECTFB_REQUIRED_VERSION directfb ; then
   788                 DIRECTFB_CFLAGS=`$PKG_CONFIG --cflags directfb`
   789                 DIRECTFB_LIBS=`$PKG_CONFIG --libs directfb`
   790                 video_directfb=yes
   791             fi
   792         fi
   793 
   794         AC_MSG_RESULT($video_directfb)
   795         if test x$video_directfb = xyes; then
   796             CFLAGS="$CFLAGS -DENABLE_DIRECTFB"
   797             VIDEO_SUBDIRS="$VIDEO_SUBDIRS directfb"
   798             VIDEO_DRIVERS="$VIDEO_DRIVERS directfb/libvideo_directfb.la"
   799 
   800             AC_SUBST(DIRECTFB_CFLAGS)
   801             AC_SUBST(DIRECTFB_LIBS)
   802         fi
   803     fi
   804 }
   805 
   806 dnl See if we're running on PlayStation 2 hardware
   807 CheckPS2GS()
   808 {
   809     AC_ARG_ENABLE(video-ps2gs,
   810 [  --enable-video-ps2gs    use PlayStation 2 GS video driver [default=yes]],
   811                   , enable_video_ps2gs=yes)
   812     if test x$enable_video = xyes -a x$enable_video_ps2gs = xyes; then
   813         AC_MSG_CHECKING(for PlayStation 2 GS support)
   814         video_ps2gs=no
   815         AC_TRY_COMPILE([
   816          #include <linux/ps2/dev.h>
   817          #include <linux/ps2/gs.h>
   818         ],[
   819         ],[
   820         video_ps2gs=yes
   821         ])
   822         AC_MSG_RESULT($video_ps2gs)
   823         if test x$video_ps2gs = xyes; then
   824             CFLAGS="$CFLAGS -DENABLE_PS2GS"
   825             VIDEO_SUBDIRS="$VIDEO_SUBDIRS ps2gs"
   826             VIDEO_DRIVERS="$VIDEO_DRIVERS ps2gs/libvideo_ps2gs.la"
   827         fi
   828     fi
   829 }
   830 
   831 dnl Find the GGI includes
   832 CheckGGI()
   833 {
   834     AC_ARG_ENABLE(video-ggi,
   835 [  --enable-video-ggi      use GGI video driver [default=no]],
   836                   , enable_video_ggi=no)
   837     if test x$enable_video = xyes -a x$enable_video_ggi = xyes; then
   838         AC_MSG_CHECKING(for GGI support)
   839         video_ggi=no
   840         AC_TRY_COMPILE([
   841          #include <ggi/ggi.h>
   842          #include <ggi/gii.h>
   843         ],[
   844         ],[
   845         video_ggi=yes
   846         ])
   847         AC_MSG_RESULT($video_ggi)
   848         if test x$video_ggi = xyes; then
   849             CFLAGS="$CFLAGS $X_CFLAGS -DENABLE_GGI"
   850             SYSTEM_LIBS="$SYSTEM_LIBS -lggi -lgii -lgg"
   851 
   852             VIDEO_SUBDIRS="$VIDEO_SUBDIRS ggi"
   853             VIDEO_DRIVERS="$VIDEO_DRIVERS ggi/libvideo_ggi.la"
   854         fi
   855     fi
   856 }
   857 
   858 dnl Find the SVGAlib includes and libraries
   859 CheckSVGA()
   860 {
   861     AC_ARG_ENABLE(video-svga,
   862 [  --enable-video-svga     use SVGAlib video driver [default=no]],
   863                   , enable_video_svga=no)
   864     if test x$enable_video = xyes -a x$enable_video_svga = xyes; then
   865         AC_MSG_CHECKING(for SVGAlib (1.4.0+) support)
   866         video_svga=no
   867         AC_TRY_COMPILE([
   868          #include <vga.h>
   869          #include <vgamouse.h>
   870          #include <vgakeyboard.h>
   871         ],[
   872          if ( SCANCODE_RIGHTWIN && SCANCODE_LEFTWIN ) {
   873              exit(0);
   874          }
   875         ],[
   876         video_svga=yes
   877         ])
   878         AC_MSG_RESULT($video_svga)
   879         if test x$video_svga = xyes; then
   880             CFLAGS="$CFLAGS -DENABLE_SVGALIB"
   881             SYSTEM_LIBS="$SYSTEM_LIBS -lvga"
   882 
   883             VIDEO_SUBDIRS="$VIDEO_SUBDIRS svga"
   884             VIDEO_DRIVERS="$VIDEO_DRIVERS svga/libvideo_svga.la"
   885         fi
   886     fi
   887 }
   888 
   889 dnl Find the VGL includes and libraries
   890 CheckVGL()
   891 {
   892     AC_ARG_ENABLE(video-vgl,
   893 [  --enable-video-vgl     use VGL video driver [default=no]],
   894                   , enable_video_vgl=no)
   895     if test x$enable_video = xyes -a x$enable_video_vgl = xyes; then
   896         AC_MSG_CHECKING(for libVGL support)
   897         video_vgl=no
   898         AC_TRY_COMPILE([
   899          #include <sys/fbio.h>
   900          #include <sys/consio.h>
   901          #include <sys/kbio.h>
   902          #include <vgl.h>
   903         ],[
   904          VGLBitmap bitmap;
   905          exit(bitmap.Bitmap);
   906         ],[
   907         video_vgl=yes
   908         ])
   909         AC_MSG_RESULT($video_vgl)
   910         if test x$video_vgl = xyes; then
   911             CFLAGS="$CFLAGS -DENABLE_VGL"
   912             SYSTEM_LIBS="$SYSTEM_LIBS -lvgl"
   913 
   914             VIDEO_SUBDIRS="$VIDEO_SUBDIRS vgl"
   915             VIDEO_DRIVERS="$VIDEO_DRIVERS vgl/libvideo_vgl.la"
   916         fi
   917     fi
   918 }
   919 
   920 dnl Find the AAlib includes
   921 CheckAAlib()
   922 {
   923     AC_ARG_ENABLE(video-aalib,
   924 [  --enable-video-aalib    use AAlib video driver [default=no]],
   925                   , enable_video_aalib=no)
   926     if test x$enable_video = xyes -a x$enable_video_aalib = xyes; then
   927         AC_MSG_CHECKING(for AAlib support)
   928         video_aalib=no
   929         AC_TRY_COMPILE([
   930          #include <aalib.h>
   931         ],[
   932         ],[
   933         video_aalib=yes
   934         ])
   935         AC_MSG_RESULT($video_aalib)
   936         if test x$video_aalib = xyes; then
   937             CFLAGS="$CFLAGS -DENABLE_AALIB"
   938             SYSTEM_LIBS="$SYSTEM_LIBS -laa"
   939 
   940             VIDEO_SUBDIRS="$VIDEO_SUBDIRS aalib"
   941             VIDEO_DRIVERS="$VIDEO_DRIVERS aalib/libvideo_aa.la"
   942         fi
   943     fi
   944 }
   945 
   946 dnl Set up the Atari Xbios driver
   947 CheckAtariXbiosVideo()
   948 {
   949     AC_ARG_ENABLE(xbios,
   950 [  --enable-video-xbios    use Atari Xbios video driver [default=yes]],
   951                   , enable_video_xbios=yes)
   952     video_xbios=no
   953     if test x$enable_video = xyes -a x$enable_video_xbios = xyes; then
   954         video_xbios=yes
   955         CFLAGS="$CFLAGS -DENABLE_XBIOS"
   956         VIDEO_SUBDIRS="$VIDEO_SUBDIRS xbios"
   957         VIDEO_DRIVERS="$VIDEO_DRIVERS xbios/libvideo_xbios.la"
   958     fi
   959 }
   960 
   961 dnl Set up the Atari Gem driver
   962 CheckAtariGemVideo()
   963 {
   964     AC_ARG_ENABLE(gem,
   965 [  --enable-video-gem      use Atari Gem video driver [default=yes]],
   966                   , enable_video_gem=yes)
   967     if test x$enable_video = xyes -a x$enable_video_gem = xyes; then
   968         video_gem=no
   969         AC_CHECK_HEADER(gem.h, have_gem_hdr=yes)
   970         AC_CHECK_LIB(gem, appl_init, have_gem_lib=yes)
   971         if test x$have_gem_hdr = xyes -a x$have_gem_lib = xyes; then
   972             video_gem=yes
   973             CFLAGS="$CFLAGS -DENABLE_GEM"
   974             SYSTEM_LIBS="$SYSTEM_LIBS -lgem"
   975             VIDEO_SUBDIRS="$VIDEO_SUBDIRS gem"
   976             VIDEO_DRIVERS="$VIDEO_DRIVERS gem/libvideo_gem.la"
   977         fi
   978     fi
   979 }
   980 
   981 dnl Set up the Atari Bios keyboard driver
   982 CheckAtariBiosEvent()
   983 {
   984     CFLAGS="$CFLAGS -I\$(top_srcdir)/src/video/ataricommon"
   985     VIDEO_SUBDIRS="$VIDEO_SUBDIRS ataricommon"
   986     VIDEO_DRIVERS="$VIDEO_DRIVERS ataricommon/libvideo_ataricommon.la"
   987 }
   988 
   989 dnl rcg04172001 Set up the Null video driver.
   990 CheckDummyVideo()
   991 {
   992     AC_ARG_ENABLE(video-dummy,
   993 [  --enable-video-dummy    use dummy video driver [default=yes]],
   994                   , enable_video_dummy=yes)
   995     if test x$enable_video_dummy = xyes; then
   996       CFLAGS="$CFLAGS -DENABLE_DUMMYVIDEO"
   997       VIDEO_SUBDIRS="$VIDEO_SUBDIRS dummy"
   998       VIDEO_DRIVERS="$VIDEO_DRIVERS dummy/libvideo_null.la"
   999     fi
  1000 }
  1001 
  1002 dnl Check to see if OpenGL support is desired
  1003 AC_ARG_ENABLE(video-opengl,
  1004 [  --enable-video-opengl   include OpenGL context creation [default=yes]],
  1005               , enable_video_opengl=yes)
  1006 
  1007 dnl Find OpenGL
  1008 CheckOpenGL()
  1009 {
  1010     if test x$enable_video = xyes -a x$enable_video_opengl = xyes; then
  1011         AC_MSG_CHECKING(for OpenGL (GLX) support)
  1012         video_opengl=no
  1013         AC_TRY_COMPILE([
  1014          #include <GL/gl.h>
  1015          #include <GL/glx.h>
  1016          #include <dlfcn.h> /* For loading extensions */
  1017         ],[
  1018         ],[
  1019         video_opengl=yes
  1020         ])
  1021         AC_MSG_RESULT($video_opengl)
  1022         if test x$video_opengl = xyes; then
  1023             CFLAGS="$CFLAGS -DHAVE_OPENGL"
  1024             if test x$use_dlopen != xyes; then
  1025                 AC_CHECK_LIB(dl, dlopen, SYSTEM_LIBS="$SYSTEM_LIBS -ldl")
  1026             fi
  1027         fi
  1028     fi
  1029 }
  1030 
  1031 dnl Find QNX RtP OpenGL
  1032 CheckOpenGLQNX()
  1033 {
  1034     if test x$enable_video = xyes -a x$enable_video_opengl = xyes; then
  1035         AC_MSG_CHECKING(for OpenGL (Photon) support)
  1036         video_opengl=no
  1037         AC_TRY_COMPILE([
  1038          #include <GL/gl.h>
  1039         ],[
  1040         ],[
  1041         video_opengl=yes
  1042         ])
  1043         AC_MSG_RESULT($video_opengl)
  1044         if test x$video_opengl = xyes; then
  1045             CFLAGS="$CFLAGS -DHAVE_OPENGL"
  1046             SYSTEM_LIBS="$SYSTEM_LIBS -lGL"
  1047             if test x$use_dlopen != xyes; then
  1048                 AC_CHECK_LIB(ltdl, dlopen, SYSTEM_LIBS="$SYSTEM_LIBS -lltdl")
  1049             fi
  1050         fi
  1051     fi
  1052 }
  1053 
  1054 dnl Check for BeOS OpenGL
  1055 CheckBeGL()
  1056 {
  1057     if test x$enable_video = xyes -a x$enable_video_opengl = xyes; then
  1058         CFLAGS="$CFLAGS -DHAVE_OPENGL"
  1059         SYSTEM_LIBS="$SYSTEM_LIBS -lGL"
  1060     fi
  1061 }
  1062 
  1063 dnl Check for MacOS OpenGL
  1064 CheckMacGL()
  1065 {
  1066     if test x$enable_video = xyes -a x$enable_video_opengl = xyes; then
  1067         CFLAGS="$CFLAGS -DHAVE_OPENGL"
  1068         case "$target" in
  1069             *-*-darwin*)
  1070                 SYSTEM_LIBS="$SYSTEM_LIBS -framework OpenGL -framework AGL"
  1071         esac
  1072     fi
  1073 }
  1074 
  1075 dnl See if we can use the new unified event interface in Linux 2.4
  1076 CheckInputEvents()
  1077 {
  1078     dnl Check for Linux 2.4 unified input event interface support
  1079     AC_ARG_ENABLE(input-events,
  1080 [  --enable-input-events   use Linux 2.4 unified input interface [default=yes]],
  1081                   , enable_input_events=yes)
  1082     if test x$enable_input_events = xyes; then
  1083         AC_MSG_CHECKING(for Linux 2.4 unified input interface)
  1084         use_input_events=no
  1085         AC_TRY_COMPILE([
  1086           #include <linux/input.h>
  1087         ],[
  1088           #ifndef EVIOCGNAME
  1089           #error EVIOCGNAME() ioctl not available
  1090           #endif
  1091         ],[
  1092         use_input_events=yes
  1093         ])
  1094         AC_MSG_RESULT($use_input_events)
  1095         if test x$use_input_events = xyes; then
  1096             CFLAGS="$CFLAGS -DUSE_INPUT_EVENTS"
  1097         fi
  1098     fi
  1099 }
  1100 
  1101 dnl See if we can use GNU pth library for threads
  1102 CheckPTH()
  1103 {
  1104     dnl Check for pth support
  1105     AC_ARG_ENABLE(pth,
  1106 [  --enable-pth            use GNU pth library for multi-threading [default=yes]],
  1107                   , enable_pth=yes)
  1108     if test x$enable_threads = xyes -a x$enable_pth = xyes; then
  1109         AC_PATH_PROG(PTH_CONFIG, pth-config, no)
  1110         if test "$PTH_CONFIG" = "no"; then
  1111             use_pth=no
  1112         else
  1113             PTH_CFLAGS=`$PTH_CONFIG --cflags`
  1114             PTH_LIBS=`$PTH_CONFIG --libs --all`
  1115             SDL_CFLAGS="$SDL_CFLAGS $PTH_CFLAGS"
  1116             SDL_LIBS="$SDL_LIBS $PTH_LIBS"
  1117             CFLAGS="$CFLAGS -DENABLE_PTH"
  1118             use_pth=yes
  1119         fi
  1120         AC_MSG_CHECKING(pth)
  1121         if test "x$use_pth" = xyes; then
  1122             AC_MSG_RESULT(yes)
  1123         else
  1124             AC_MSG_RESULT(no)
  1125         fi
  1126     fi
  1127 }
  1128 
  1129 dnl See what type of thread model to use on Linux and Solaris
  1130 CheckPTHREAD()
  1131 {
  1132     dnl Check for pthread support
  1133     AC_ARG_ENABLE(pthreads,
  1134 [  --enable-pthreads       use POSIX threads for multi-threading [default=yes]],
  1135                   , enable_pthreads=yes)
  1136     dnl This is used on Linux for glibc binary compatibility (Doh!)
  1137     AC_ARG_ENABLE(pthread-sem,
  1138 [  --enable-pthread-sem    use pthread semaphores [default=yes]],
  1139                   , enable_pthread_sem=yes)
  1140     case "$target" in
  1141         *-*-bsdi*)
  1142             pthread_cflags="-D_REENTRANT -D_THREAD_SAFE"
  1143             pthread_lib=""
  1144             ;;
  1145         *-*-darwin*)
  1146             pthread_cflags="-D_THREAD_SAFE"
  1147 # causes Carbon.p complaints?
  1148 #            pthread_cflags="-D_REENTRANT -D_THREAD_SAFE"
  1149             ;;
  1150         *-*-freebsd*)
  1151             pthread_cflags="-D_REENTRANT -D_THREAD_SAFE"
  1152             pthread_lib="-pthread"
  1153             ;;
  1154         *-*-netbsd*)
  1155             pthread_cflags="-I/usr/pkg/include -D_REENTRANT"
  1156             pthread_lib="-L/usr/pkg/lib -lpthread -lsem"
  1157             ;;
  1158         *-*-openbsd*)
  1159             pthread_cflags="-D_REENTRANT"
  1160             pthread_lib="-pthread"
  1161             ;;
  1162         *-*-solaris*)
  1163             pthread_cflags="-D_REENTRANT"
  1164             pthread_lib="-lpthread -lposix4"
  1165             ;;
  1166         *-*-sysv5*)
  1167             pthread_cflags="-D_REENTRANT -Kthread"
  1168             pthread_lib=""
  1169             ;;
  1170         *-*-irix*)
  1171             pthread_cflags="-D_SGI_MP_SOURCE"
  1172             pthread_lib="-lpthread"
  1173             ;;
  1174         *-*-aix*)
  1175             pthread_cflags="-D_REENTRANT -mthreads"
  1176             pthread_lib="-lpthread"
  1177             ;;
  1178         *-*-hpux11*)
  1179             pthread_cflags="-D_REENTRANT"
  1180             pthread_lib="-L/usr/lib -lpthread"
  1181             ;;
  1182         *-*-qnx*)
  1183             pthread_cflags=""
  1184             pthread_lib=""
  1185             ;;
  1186         *)
  1187             pthread_cflags="-D_REENTRANT"
  1188             pthread_lib="-lpthread"
  1189             ;;
  1190     esac
  1191     if test x$enable_threads = xyes -a x$enable_pthreads = xyes; then
  1192         # Save the original compiler flags and libraries
  1193         ac_save_cflags="$CFLAGS"; ac_save_libs="$LIBS"
  1194         # Add the pthread compiler flags and libraries
  1195         CFLAGS="$CFLAGS $pthread_cflags"; LIBS="$LIBS $pthread_lib"
  1196         # Check to see if we have pthread support on this system
  1197         AC_MSG_CHECKING(for pthreads)
  1198         use_pthreads=no
  1199         AC_TRY_LINK([
  1200          #include <pthread.h>
  1201         ],[
  1202          pthread_attr_t type;
  1203          pthread_attr_init(&type);
  1204         ],[
  1205         use_pthreads=yes
  1206         ])
  1207         AC_MSG_RESULT($use_pthreads)
  1208         # Restore the compiler flags and libraries
  1209         CFLAGS="$ac_save_cflags"; LIBS="$ac_save_libs"
  1210         # Do futher testing if we have pthread support...
  1211         if test x$use_pthreads = xyes; then
  1212             CFLAGS="$CFLAGS $pthread_cflags -DSDL_USE_PTHREADS"
  1213             SDL_CFLAGS="$SDL_CFLAGS $pthread_cflags"
  1214             SDL_LIBS="$SDL_LIBS $pthread_lib"
  1215 
  1216             # Check to see if recursive mutexes are available
  1217             AC_MSG_CHECKING(for recursive mutexes)
  1218             has_recursive_mutexes=no
  1219             AC_TRY_LINK([
  1220               #include <pthread.h>
  1221             ],[
  1222               pthread_mutexattr_t attr;
  1223               #if defined(linux) && !(defined(__arm__) && defined(QWS))
  1224               pthread_mutexattr_setkind_np(&attr, PTHREAD_MUTEX_RECURSIVE_NP);
  1225               #else
  1226               pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
  1227               #endif
  1228             ],[
  1229             has_recursive_mutexes=yes
  1230             ])
  1231             # Some systems have broken recursive mutex implementations
  1232             case "$target" in
  1233                 *-*-darwin*)
  1234                     has_recursive_mutexes=no
  1235                     ;;
  1236                 *-*-solaris*)
  1237                     has_recursive_mutexes=no
  1238                     ;;
  1239             esac
  1240             AC_MSG_RESULT($has_recursive_mutexes)
  1241             if test x$has_recursive_mutexes != xyes; then
  1242                 CFLAGS="$CFLAGS -DPTHREAD_NO_RECURSIVE_MUTEX"
  1243             fi
  1244 
  1245             # Check to see if pthread semaphore support is missing
  1246             if test x$enable_pthread_sem = xyes; then
  1247                 AC_MSG_CHECKING(for pthread semaphores)
  1248                 have_pthread_sem=no
  1249                 AC_TRY_COMPILE([
  1250                   #include <pthread.h>
  1251                   #include <semaphore.h>
  1252                 ],[
  1253                 ],[
  1254                 have_pthread_sem=yes
  1255                 ])
  1256                 AC_MSG_RESULT($have_pthread_sem)
  1257             fi
  1258 
  1259             # Check to see if this is broken glibc 2.0 pthreads
  1260             case "$target" in
  1261                 *-*-linux*)
  1262                     AC_MSG_CHECKING(for broken glibc 2.0 pthreads)
  1263                     glibc20_pthreads=no
  1264                     AC_TRY_COMPILE([
  1265                       #include <features.h>
  1266                       #if (__GLIBC__ == 2) && (__GLIBC_MINOR__ == 0)
  1267                       #warning Working around a bug in glibc 2.0 pthreads
  1268                       #else
  1269                       #error pthread implementation okay
  1270                       #endif /* glibc 2.0 */
  1271                     ],[
  1272                     ],[
  1273                     glibc20_pthreads=yes
  1274                     ])
  1275                     AC_MSG_RESULT($glibc20_pthreads)
  1276             esac
  1277         fi
  1278     fi
  1279 
  1280     AC_MSG_CHECKING(whether semun is defined in /usr/include/sys/sem.h)
  1281     have_semun=no
  1282     AC_TRY_COMPILE([
  1283       #include <sys/types.h>
  1284       #include <sys/sem.h>
  1285     ],[
  1286       union semun t;
  1287     ],[
  1288     have_semun=yes
  1289     ])
  1290     AC_MSG_RESULT($have_semun)
  1291     if test x$have_semun = xyes; then
  1292         CFLAGS="$CFLAGS -DHAVE_SEMUN"
  1293     fi
  1294 
  1295     # See if we can use GNU Pth or clone() on Linux directly
  1296     if test x$enable_threads = xyes -a x$use_pthreads != xyes; then
  1297         CheckPTH
  1298         if test x$use_pth != xyes; then
  1299             case "$target" in
  1300                 *-*-linux*)
  1301                     use_clone=yes
  1302                     ;;
  1303             esac
  1304         fi
  1305     fi
  1306 }
  1307 
  1308 # Note that we need to have either semaphores or to have mutexes and
  1309 # condition variables to implement all thread synchronization primitives
  1310 CopyUnixThreadSource()
  1311 {
  1312     if test x$use_pthreads = xyes -o x$use_clone = xyes; then
  1313         # Basic thread creation functions
  1314         COPY_ARCH_SRC(src/thread, linux, SDL_systhread.c)
  1315         if test x$use_clone = xyes; then
  1316             COPY_ARCH_SRC(src/thread, linux, clone.S)
  1317         fi
  1318         COPY_ARCH_SRC(src/thread, linux, SDL_systhread_c.h)
  1319 
  1320         # Semaphores
  1321         # We can fake these with mutexes and condition variables if necessary
  1322         if test x$use_pthreads = xyes -a x$have_pthread_sem != xyes; then
  1323             COPY_ARCH_SRC(src/thread, generic, SDL_syssem.c)
  1324         else
  1325             COPY_ARCH_SRC(src/thread, linux, SDL_syssem.c)
  1326         fi
  1327         COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
  1328 
  1329         # Mutexes
  1330         # We can fake these with semaphores if necessary
  1331         case "$target" in
  1332             *-*-bsdi*)
  1333                 COPY_ARCH_SRC(src/thread, bsdi, SDL_syssem.c)
  1334                 COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
  1335                 ;;
  1336             *)
  1337                 if test x$glibc20_pthreads = xyes; then
  1338                     COPY_ARCH_SRC(src/thread, generic, SDL_sysmutex.c)
  1339                     COPY_ARCH_SRC(src/thread, generic, SDL_sysmutex_c.h)
  1340                 else
  1341                     COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex.c)
  1342                     COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex_c.h)
  1343                 fi
  1344                 ;;
  1345         esac
  1346 
  1347         # Condition variables
  1348         # We can fake these with semaphores and mutexes if necessary
  1349         if test x$glibc20_pthreads = xyes -o x$has_recursive_mutexes != xyes; then
  1350             COPY_ARCH_SRC(src/thread, generic, SDL_syscond.c)
  1351         else
  1352             COPY_ARCH_SRC(src/thread, linux, SDL_syscond.c)
  1353         fi
  1354         COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
  1355 
  1356     elif test x$use_pth = xyes; then
  1357         COPY_ARCH_SRC(src/thread, pth, SDL_systhread.c)
  1358         COPY_ARCH_SRC(src/thread, pth, SDL_systhread_c.h)
  1359         COPY_ARCH_SRC(src/thread, pth, SDL_sysmutex.c)
  1360         COPY_ARCH_SRC(src/thread, pth, SDL_sysmutex_c.h)
  1361         COPY_ARCH_SRC(src/thread, pth, SDL_syscond.c)
  1362         COPY_ARCH_SRC(src/thread, pth, SDL_syscond_c.h)
  1363         COPY_ARCH_SRC(src/thread, generic, SDL_syssem.c)
  1364         COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
  1365     else
  1366        AC_MSG_ERROR([
  1367 *** No thread support detected
  1368        ])
  1369     fi
  1370 }
  1371 
  1372 dnl Determine whether the compiler can produce Win32 executables
  1373 CheckWIN32()
  1374 {
  1375     AC_MSG_CHECKING(Win32 compiler)
  1376     have_win32_gcc=no
  1377     AC_TRY_COMPILE([
  1378      #include <windows.h>
  1379     ],[
  1380     ],[
  1381     have_win32_gcc=yes
  1382     ])
  1383     AC_MSG_RESULT($have_win32_gcc)
  1384     if test x$have_win32_gcc != xyes; then
  1385        AC_MSG_ERROR([
  1386 *** Your compiler ($CC) does not produce Win32 executables!
  1387        ])
  1388     fi
  1389 
  1390     dnl See if the user wants to redirect standard output to files
  1391     AC_ARG_ENABLE(stdio-redirect,
  1392 [  --enable-stdio-redirect Redirect STDIO to files on Win32 [default=yes]],
  1393                   , enable_stdio_redirect=yes)
  1394     if test x$enable_stdio_redirect != xyes; then
  1395         CFLAGS="$CFLAGS -DNO_STDIO_REDIRECT"
  1396     fi
  1397 }
  1398 
  1399 dnl Find the DirectX includes and libraries
  1400 CheckDIRECTX()
  1401 {
  1402     AC_ARG_ENABLE(directx,
  1403 [  --enable-directx        use DirectX for Win32 audio/video [default=yes]],
  1404                   , enable_directx=yes)
  1405     if test x$enable_directx = xyes; then
  1406         AC_MSG_CHECKING(for DirectX headers and libraries)
  1407         use_directx=no
  1408         AC_TRY_COMPILE([
  1409          #include "src/video/windx5/directx.h"
  1410         ],[
  1411         ],[
  1412         use_directx=yes
  1413         ])
  1414         AC_MSG_RESULT($use_directx)
  1415     fi
  1416 
  1417     CFLAGS="$CFLAGS -I\$(top_srcdir)/src/video/wincommon"
  1418     SYSTEM_LIBS="$SYSTEM_LIBS -luser32 -lgdi32 -lwinmm"
  1419     VIDEO_SUBDIRS="$VIDEO_SUBDIRS wincommon"
  1420     VIDEO_DRIVERS="$VIDEO_DRIVERS wincommon/libvideo_wincommon.la"
  1421     # Enable the DIB driver
  1422     CFLAGS="$CFLAGS -DENABLE_WINDIB"
  1423     VIDEO_SUBDIRS="$VIDEO_SUBDIRS windib"
  1424     VIDEO_DRIVERS="$VIDEO_DRIVERS windib/libvideo_windib.la"
  1425     # See if we should enable the DirectX driver
  1426     if test x$use_directx = xyes; then
  1427         CFLAGS="$CFLAGS -DENABLE_DIRECTX"
  1428         SYSTEM_LIBS="$SYSTEM_LIBS -ldxguid"
  1429         VIDEO_SUBDIRS="$VIDEO_SUBDIRS windx5"
  1430         VIDEO_DRIVERS="$VIDEO_DRIVERS windx5/libvideo_windx5.la"
  1431     fi
  1432 }
  1433 
  1434 dnl Set up the BWindow video driver on BeOS
  1435 CheckBWINDOW()
  1436 {
  1437     CFLAGS="$CFLAGS -DENABLE_BWINDOW"
  1438     VIDEO_SUBDIRS="$VIDEO_SUBDIRS bwindow"
  1439     VIDEO_DRIVERS="$VIDEO_DRIVERS bwindow/libvideo_bwindow.la"
  1440 }
  1441 
  1442 dnl Set up the QTopia video driver if enabled
  1443 CheckQtopia()
  1444 {
  1445     AC_ARG_ENABLE(video-qtopia,
  1446 [  --enable-video-qtopia   use Qtopia video driver [default=no]],
  1447                   , enable_video_qtopia=no)
  1448     if test x$enable_video = xyes -a x$enable_video_qtopia = xyes; then
  1449         AC_MSG_CHECKING(for Qtopia support)
  1450         video_qtopia=no
  1451         AC_LANG_CPLUSPLUS
  1452         OLD_CXX="$CXXFLAGS"
  1453         CXXFLAGS="-DQT_QWS_EBX -fno-rtti -fno-exceptions -DQT_QWS_CUSTOM -DQWS -I${QPEDIR}/include -I${QTDIR}/include/ -DNO_DEBUG"
  1454         AC_TRY_COMPILE([
  1455          #include <qpe/qpeapplication.h>
  1456         ],[
  1457         ],[
  1458         video_qtopia=yes
  1459         ])
  1460         CXXFLAGS="$OLD_CXX"
  1461         AC_MSG_RESULT($video_qtopia)
  1462         if test x$video_qtopia = xyes; then
  1463             CFLAGS="$CFLAGS -DENABLE_QTOPIA -DQT_QWS_EBX -DQT_QWS_CUSTOM -DQWS -I${QPEDIR}/include -I${QTDIR}/include/ -DNO_DEBUG -fno-rtti -fno-exceptions"
  1464             SDL_LIBS="$SDL_LIBS -L${QPEDIR}/lib -L${QTDIR}/lib/ -lqpe -lqte"
  1465             SDL_CFLAGS="$SDL_CFLAGS -DQWS"	  
  1466             VIDEO_SUBDIRS="$VIDEO_SUBDIRS qtopia"
  1467             VIDEO_DRIVERS="$VIDEO_DRIVERS qtopia/libvideo_qtopia.la"
  1468         else
  1469 	AC_MSG_ERROR([
  1470 *** Failed to find Qtopia includes. Make sure that the QTDIR and QPEDIR
  1471 *** environment variables are set correctly.])
  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", AC_CHECK_LIB(ltdl, dlopen, SYSTEM_LIBS="$SYSTEM_LIBS -lltdl"))
  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             if test x$enable_threads = xyes -a x$enable_pth = xyes; then
  2448                 COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
  2449             else
  2450                 COPY_ARCH_SRC(src/timer, mint, SDL_systimer.c)
  2451                 COPY_ARCH_SRC(src/timer, mint, SDL_vbltimer.S)
  2452                 COPY_ARCH_SRC(src/timer, mint, SDL_vbltimer_s.h)
  2453             fi
  2454         fi
  2455         # MiNT does not define "unix"
  2456         CFLAGS="$CFLAGS -Dunix"
  2457         ;;
  2458     *)
  2459         AC_MSG_ERROR(Unsupported target:  Please add to configure.in)
  2460         ;;
  2461 esac
  2462 AC_SUBST(ARCH)
  2463 
  2464 # Set the conditional variables for this target
  2465 AM_CONDITIONAL(TARGET_LINUX, test $ARCH = linux)
  2466 AM_CONDITIONAL(TARGET_QTOPIA, test "x$video_qtopia" = "xyes")
  2467 AM_CONDITIONAL(TARGET_SOLARIS, test $ARCH = solaris)
  2468 AM_CONDITIONAL(TARGET_IRIX, test $ARCH = irix)
  2469 AM_CONDITIONAL(TARGET_BSDI, test $ARCH = bsdi)
  2470 AM_CONDITIONAL(TARGET_FREEBSD, test $ARCH = freebsd)
  2471 AM_CONDITIONAL(TARGET_NETBSD, test $ARCH = netbsd)
  2472 AM_CONDITIONAL(TARGET_OPENBSD, test $ARCH = openbsd)
  2473 AM_CONDITIONAL(TARGET_AIX, test $ARCH = aix)
  2474 AM_CONDITIONAL(TARGET_WIN32, test $ARCH = win32)
  2475 AM_CONDITIONAL(TARGET_BEOS, test $ARCH = beos)
  2476 AM_CONDITIONAL(TARGET_MACOS, test $ARCH = macos)
  2477 AM_CONDITIONAL(TARGET_MACOSX, test $ARCH = macosx)
  2478 AM_CONDITIONAL(TARGET_QNX, test $ARCH = qnx)
  2479 AM_CONDITIONAL(TARGET_MINT, test $ARCH = mint)
  2480 
  2481 # More automake conditionals
  2482 AM_CONDITIONAL(USE_DIRECTX, test x$use_directx = xyes)
  2483 AM_CONDITIONAL(USE_CLONE, test x$use_clone = xyes)
  2484 
  2485 # Set conditional variables for shared and static library selection.
  2486 # These are not used in any Makefile.am but in sdl-config.in.
  2487 AM_CONDITIONAL([ENABLE_SHARED], [test "$enable_shared" = yes])
  2488 AM_CONDITIONAL([ENABLE_STATIC], [test "$enable_static" = yes])
  2489 
  2490 # Set runtime shared library paths as needed
  2491 
  2492 if test $ARCH = linux -o $ARCH = freebsd -o $ARCH = bsdi; then
  2493   SDL_RLD_FLAGS="-Wl,-rpath,\${exec_prefix}/lib"
  2494 fi
  2495 if test $ARCH = solaris; then
  2496   SDL_RLD_FLAGS="-R\${exec_prefix}/lib"
  2497 fi
  2498 
  2499 case "$ARCH" in
  2500   openbsd | netbsd | bsdi)
  2501     SHARED_SYSTEM_LIBS="$SYSTEM_LIBS"
  2502     ;;
  2503   macosx)
  2504     SHARED_SYSTEM_LIBS="-framework Cocoa"
  2505     if test x$enable_video = xyes -a x$enable_video_opengl = xyes; then
  2506       SHARED_SYSTEM_LIBS="$SHARED_SYSTEM_LIBS -framework OpenGL"
  2507     fi
  2508     ;;
  2509   *)
  2510     SHARED_SYSTEM_LIBS=""
  2511     ;;
  2512 esac
  2513 
  2514 STATIC_SYSTEM_LIBS="$SYSTEM_LIBS"
  2515 
  2516 dnl Output the video drivers we use
  2517 if test x$enable_video = xtrue; then
  2518     if test "$VIDEO_SUBDIRS" = ""; then
  2519         AC_MSG_ERROR(*** No video drivers are enabled!)
  2520     fi
  2521 fi
  2522 AC_SUBST(AUDIO_SUBDIRS)
  2523 AC_SUBST(AUDIO_DRIVERS)
  2524 AC_SUBST(VIDEO_SUBDIRS)
  2525 AC_SUBST(VIDEO_DRIVERS)
  2526 AC_SUBST(JOYSTICK_SUBDIRS)
  2527 AC_SUBST(JOYSTICK_DRIVERS)
  2528 AC_SUBST(CDROM_SUBDIRS)
  2529 AC_SUBST(CDROM_DRIVERS)
  2530 AC_SUBST(SDL_EXTRADIRS)
  2531 AC_SUBST(SDL_EXTRALIBS)
  2532 
  2533 dnl Expand the cflags and libraries needed by apps using SDL
  2534 AC_SUBST(SDL_CFLAGS)
  2535 AC_SUBST(SDL_LIBS)
  2536 AC_SUBST(SDL_RLD_FLAGS)
  2537 
  2538 dnl Expand the libraries needed for static and dynamic linking
  2539 AC_SUBST(STATIC_SYSTEM_LIBS)
  2540 AC_SUBST(SHARED_SYSTEM_LIBS)
  2541 AC_SUBST(SYSTEM_LIBS)
  2542 
  2543 dnl Expand the include directories for building SDL
  2544 CFLAGS="$CFLAGS -I\$(top_srcdir)/include"
  2545 CFLAGS="$CFLAGS -I\$(top_srcdir)/include/SDL"
  2546 CFLAGS="$CFLAGS -I\$(top_srcdir)/src -I\$(top_srcdir)/src/$ARCH"
  2547 CFLAGS="$CFLAGS -I\$(top_srcdir)/src/main"
  2548 CFLAGS="$CFLAGS -I\$(top_srcdir)/src/audio"
  2549 CFLAGS="$CFLAGS -I\$(top_srcdir)/src/video"
  2550 CFLAGS="$CFLAGS -I\$(top_srcdir)/src/video/XFree86/extensions"
  2551 CFLAGS="$CFLAGS -I\$(top_srcdir)/src/events"
  2552 CFLAGS="$CFLAGS -I\$(top_srcdir)/src/joystick"
  2553 CFLAGS="$CFLAGS -I\$(top_srcdir)/src/cdrom"
  2554 CFLAGS="$CFLAGS -I\$(top_srcdir)/src/thread"
  2555 CFLAGS="$CFLAGS -I\$(top_srcdir)/src/timer"
  2556 CFLAGS="$CFLAGS -I\$(top_srcdir)/src/endian"
  2557 CFLAGS="$CFLAGS -I\$(top_srcdir)/src/file"
  2558 CXXFLAGS="$CFLAGS"
  2559 
  2560 
  2561 # Check for darwin at the very end and set up the Objective C compiler
  2562 # We do this here so that we get the full CFLAGS into OBJCFLAGS
  2563 case "$target" in
  2564     *-*-darwin*)
  2565         OBJC="cc"
  2566         OBJCFLAGS="$CFLAGS"
  2567         OBJCDEPMODE="$CCDEPMODE"
  2568         AC_SUBST(OBJC)
  2569         AC_SUBST(OBJCFLAGS)
  2570         AC_SUBST(OBJCDEPMODE)
  2571         ;;
  2572 esac
  2573 
  2574 # Finally create all the generated files
  2575 dnl Important: Any directory that you want to be in the distcheck should
  2576 dnl            have a file listed here, so that configure generates the
  2577 dnl            subdirectories on the build target.
  2578 AC_OUTPUT([
  2579 Makefile
  2580 docs/Makefile
  2581 docs/html/Makefile
  2582 docs/man3/Makefile
  2583 include/Makefile
  2584 src/Makefile
  2585 src/main/Makefile
  2586 src/main/macosx/Makefile
  2587 src/main/macosx/Info.plist
  2588 src/audio/Makefile
  2589 src/audio/alsa/Makefile
  2590 src/audio/arts/Makefile
  2591 src/audio/baudio/Makefile
  2592 src/audio/dc/Makefile
  2593 src/audio/dma/Makefile
  2594 src/audio/dmedia/Makefile
  2595 src/audio/dsp/Makefile
  2596 src/audio/esd/Makefile
  2597 src/audio/macrom/Makefile
  2598 src/audio/nas/Makefile
  2599 src/audio/nto/Makefile
  2600 src/audio/openbsd/Makefile
  2601 src/audio/paudio/Makefile
  2602 src/audio/sun/Makefile
  2603 src/audio/ums/Makefile
  2604 src/audio/windib/Makefile
  2605 src/audio/windx5/Makefile
  2606 src/audio/disk/Makefile
  2607 src/audio/mint/Makefile
  2608 src/video/Makefile
  2609 src/video/XFree86/Makefile
  2610 src/video/XFree86/extensions/Makefile
  2611 src/video/XFree86/Xinerama/Makefile
  2612 src/video/XFree86/Xv/Makefile
  2613 src/video/XFree86/Xxf86dga/Makefile
  2614 src/video/XFree86/Xxf86vm/Makefile
  2615 src/video/cybergfx/Makefile
  2616 src/video/x11/Makefile
  2617 src/video/dga/Makefile
  2618 src/video/nanox/Makefile
  2619 src/video/fbcon/Makefile
  2620 src/video/directfb/Makefile
  2621 src/video/ps2gs/Makefile
  2622 src/video/ggi/Makefile
  2623 src/video/maccommon/Makefile
  2624 src/video/macdsp/Makefile
  2625 src/video/macrom/Makefile
  2626 src/video/quartz/Makefile
  2627 src/video/svga/Makefile
  2628 src/video/vgl/Makefile
  2629 src/video/aalib/Makefile
  2630 src/video/wincommon/Makefile
  2631 src/video/windib/Makefile
  2632 src/video/windx5/Makefile
  2633 src/video/bwindow/Makefile
  2634 src/video/photon/Makefile
  2635 src/video/epoc/Makefile
  2636 src/video/dummy/Makefile
  2637 src/video/ataricommon/Makefile
  2638 src/video/xbios/Makefile
  2639 src/video/gem/Makefile
  2640 src/video/dc/Makefile
  2641 src/video/qtopia/Makefile
  2642 src/video/picogui/Makefile
  2643 src/events/Makefile
  2644 src/joystick/Makefile
  2645 src/joystick/amigaos/Makefile
  2646 src/joystick/beos/Makefile
  2647 src/joystick/bsd/Makefile
  2648 src/joystick/darwin/Makefile
  2649 src/joystick/dc/Makefile
  2650 src/joystick/dummy/Makefile
  2651 src/joystick/linux/Makefile
  2652 src/joystick/macos/Makefile
  2653 src/joystick/mint/Makefile
  2654 src/joystick/win32/Makefile
  2655 src/cdrom/Makefile
  2656 src/cdrom/aix/Makefile
  2657 src/cdrom/beos/Makefile
  2658 src/cdrom/dc/Makefile
  2659 src/cdrom/dummy/Makefile
  2660 src/cdrom/bsdi/Makefile
  2661 src/cdrom/freebsd/Makefile
  2662 src/cdrom/linux/Makefile
  2663 src/cdrom/macos/Makefile
  2664 src/cdrom/openbsd/Makefile
  2665 src/cdrom/qnx/Makefile
  2666 src/cdrom/win32/Makefile
  2667 src/thread/Makefile
  2668 src/timer/Makefile
  2669 src/endian/Makefile
  2670 src/file/Makefile
  2671 src/hermes/Makefile
  2672 sdl-config
  2673 SDL.spec
  2674 ], [chmod +x sdl-config])