configure.in
author Ryan C. Gordon <icculus@icculus.org>
Sat, 07 Oct 2006 06:18:15 +0000
branchSDL-ryan-multiple-audio-device
changeset 3823 c562b1a12f82
parent 3785 da2ea0694d11
child 3825 76c5a414b996
permissions -rw-r--r--
Look for NAS libraries in normal paths (where Ubuntu installs them).
     1 dnl Process this file with autoconf to produce a configure script.
     2 AC_INIT(README)
     3 AC_CONFIG_HEADER(include/SDL_config.h)
     4 AC_GNU_SOURCE
     5 
     6 dnl Set various version strings - taken gratefully from the GTk sources
     7 #
     8 # Making releases:
     9 # Edit include/SDL/SDL_version.h and change the version, then:
    10 #   SDL_MICRO_VERSION += 1;
    11 #   SDL_INTERFACE_AGE += 1;
    12 #   SDL_BINARY_AGE += 1;
    13 # if any functions have been added, set SDL_INTERFACE_AGE to 0.
    14 # if backwards compatibility has been broken,
    15 # set SDL_BINARY_AGE and SDL_INTERFACE_AGE to 0.
    16 #
    17 SDL_MAJOR_VERSION=1
    18 SDL_MINOR_VERSION=3
    19 SDL_MICRO_VERSION=0
    20 SDL_INTERFACE_AGE=0
    21 SDL_BINARY_AGE=0
    22 SDL_VERSION=$SDL_MAJOR_VERSION.$SDL_MINOR_VERSION.$SDL_MICRO_VERSION
    23 
    24 AC_SUBST(SDL_MAJOR_VERSION)
    25 AC_SUBST(SDL_MINOR_VERSION)
    26 AC_SUBST(SDL_MICRO_VERSION)
    27 AC_SUBST(SDL_INTERFACE_AGE)
    28 AC_SUBST(SDL_BINARY_AGE)
    29 AC_SUBST(SDL_VERSION)
    30 
    31 # libtool versioning
    32 LT_RELEASE=$SDL_MAJOR_VERSION.$SDL_MINOR_VERSION
    33 LT_CURRENT=`expr $SDL_MICRO_VERSION - $SDL_INTERFACE_AGE`
    34 LT_REVISION=$SDL_INTERFACE_AGE
    35 LT_AGE=`expr $SDL_BINARY_AGE - $SDL_INTERFACE_AGE`
    36 
    37 AC_SUBST(LT_RELEASE)
    38 AC_SUBST(LT_CURRENT)
    39 AC_SUBST(LT_REVISION)
    40 AC_SUBST(LT_AGE)
    41 
    42 dnl Detect the canonical build and host environments
    43 AC_CONFIG_AUX_DIRS($srcdir/build-scripts)
    44 AC_CANONICAL_HOST
    45 AC_C_BIGENDIAN
    46 if test x$ac_cv_c_bigendian = xyes; then
    47     AC_DEFINE(SDL_BYTEORDER, 4321)
    48 else
    49     AC_DEFINE(SDL_BYTEORDER, 1234)
    50 fi
    51 
    52 dnl Set up the compiler and linker flags
    53 INCLUDE="-I$srcdir/include"
    54 if test x$srcdir != x.; then
    55     # Remove SDL_config.h from the source directory, since it's the
    56     # default one, and we want to include the one that we generate.
    57     if test -f $srcdir/include/SDL_config.h; then
    58         rm $srcdir/include/SDL_config.h
    59     fi
    60     INCLUDE="-Iinclude $INCLUDE"
    61 fi
    62 case "$host" in
    63     *-*-cygwin*)
    64         # We build SDL on cygwin without the UNIX emulation layer
    65         BASE_CFLAGS="-I/usr/include/mingw -mno-cygwin"
    66         BASE_LDFLAGS="-mno-cygwin"
    67         ;;
    68     *)
    69         BASE_CFLAGS="-D_GNU_SOURCE=1"
    70         BASE_LDFLAGS=""
    71         ;;
    72 esac
    73 BUILD_CFLAGS="$CFLAGS $CPPFLAGS"
    74 EXTRA_CFLAGS="$INCLUDE $BASE_CFLAGS"
    75 BUILD_LDFLAGS="$LDFLAGS"
    76 EXTRA_LDFLAGS="$BASE_LDFLAGS"
    77 # I can't remember why I added this.  I'm sure it'll come to me...
    78 #for path in /usr/local; do
    79 #    if test -d $path/include; then
    80 #        EXTRA_CFLAGS="$EXTRA_CFLAGS -I$path/include"
    81 #    fi
    82 #    if test -d $path/lib; then
    83 #        EXTRA_LDFLAGS="$EXTRA_LDFLAGS -L$path/lib"
    84 #    fi
    85 #done
    86 SDL_CFLAGS="$BASE_CFLAGS"
    87 SDL_LIBS="-lSDL $BASE_LDFLAGS"
    88 CPPFLAGS="$CPPFLAGS $EXTRA_CFLAGS"
    89 CFLAGS="$CFLAGS $EXTRA_CFLAGS"
    90 LDFLAGS="$LDFLAGS $EXTRA_LDFLAGS"
    91 
    92 dnl Check for tools
    93 AC_LIBTOOL_WIN32_DLL
    94 AC_PROG_LIBTOOL
    95 AC_PROG_CC
    96 AC_PROG_CXX
    97 AC_PROG_INSTALL
    98 AC_PROG_MAKE_SET
    99 
   100 dnl Check for compiler characteristics
   101 AC_C_CONST
   102 AC_C_INLINE
   103 AC_C_VOLATILE
   104 
   105 dnl See whether we are allowed to use the system C library
   106 AC_ARG_ENABLE(libc,
   107 AC_HELP_STRING([--enable-libc], [Use the system C library [[default=yes]]]),
   108               , enable_libc=yes)
   109 if test x$enable_libc = xyes; then
   110     AC_DEFINE(HAVE_LIBC)
   111 
   112     dnl Check for C library headers
   113     AC_HEADER_STDC
   114     AC_CHECK_HEADERS(sys/types.h stdio.h stdlib.h stddef.h stdarg.h malloc.h memory.h string.h strings.h inttypes.h stdint.h ctype.h math.h iconv.h signal.h)
   115 
   116     dnl Check for typedefs, structures, etc.
   117     AC_TYPE_SIZE_T
   118     if test x$ac_cv_header_inttypes_h = xyes -o x$ac_cv_header_stdint_h = xyes; then
   119         AC_CHECK_TYPE(int64_t)
   120         if test x$ac_cv_type_int64_t = xyes; then
   121             AC_DEFINE(SDL_HAS_64BIT_TYPE)
   122         fi
   123         have_inttypes=yes
   124     fi
   125 
   126     dnl Checks for library functions.
   127     AC_FUNC_ALLOCA
   128     AC_FUNC_MEMCMP
   129     if test x$ac_cv_func_memcmp_working = xyes; then
   130         AC_DEFINE(HAVE_MEMCMP)
   131     fi
   132     AC_FUNC_STRTOD
   133     if test x$ac_cv_func_strtod = xyes; then
   134         AC_DEFINE(HAVE_STRTOD)
   135     fi
   136     AC_CHECK_FUNCS(malloc calloc realloc free getenv putenv unsetenv qsort abs bcopy memset memcpy memmove strlen strlcpy strlcat strdup _strrev _strupr _strlwr strchr strrchr strstr itoa _ltoa _uitoa _ultoa strtol strtoul _i64toa _ui64toa strtoll strtoull atoi atof strcmp strncmp _stricmp strcasecmp _strnicmp strncasecmp sscanf snprintf vsnprintf iconv sigaction setjmp nanosleep)
   137 
   138     AC_CHECK_LIB(iconv, libiconv_open, [EXTRA_LDFLAGS="$EXTRA_LDFLAGS -liconv"])
   139     AC_CHECK_LIB(m, pow, [EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lm"])
   140 fi
   141 
   142 if test x$have_inttypes != xyes; then
   143     AC_CHECK_SIZEOF(char, 1)
   144     AC_CHECK_SIZEOF(short, 2)
   145     AC_CHECK_SIZEOF(int, 4)
   146     AC_CHECK_SIZEOF(long, 4)
   147     AC_CHECK_SIZEOF(long long, 8)
   148     if test x$ac_cv_sizeof_char = x1; then
   149         AC_DEFINE(int8_t, signed char)
   150         AC_DEFINE(uint8_t, unsigned char)
   151     fi
   152     if test x$ac_cv_sizeof_short = x2; then
   153         AC_DEFINE(int16_t, signed short)
   154         AC_DEFINE(uint16_t, unsigned short)
   155     else
   156         if test x$ac_cv_sizeof_int = x2; then
   157             AC_DEFINE(int16_t, signed int)
   158             AC_DEFINE(uint16_t, unsigned int)
   159         fi
   160     fi
   161     if test x$ac_cv_sizeof_int = x4; then
   162         AC_DEFINE(int32_t, signed int)
   163         AC_DEFINE(uint32_t, unsigned int)
   164     else
   165         if test x$ac_cv_sizeof_long = x4; then
   166             AC_DEFINE(int32_t, signed long)
   167             AC_DEFINE(uint32_t, unsigned long)
   168         fi
   169     fi
   170     if test x$ac_cv_sizeof_long = x8; then
   171         AC_DEFINE(int64_t, signed long)
   172         AC_DEFINE(uint64_t, unsigned long)
   173         AC_DEFINE(SDL_HAS_64BIT_TYPE)
   174     else
   175         if test x$ac_cv_sizeof_long_long = x8; then
   176             AC_DEFINE(int64_t, signed long long)
   177             AC_DEFINE(uint64_t, unsigned long long)
   178             AC_DEFINE(SDL_HAS_64BIT_TYPE)
   179         fi
   180     fi
   181     AC_DEFINE(size_t, unsigned int)
   182     AC_DEFINE(uintptr_t, unsigned long)
   183 fi
   184 
   185 # Standard C sources
   186 SOURCES="$SOURCES $srcdir/src/*.c"
   187 SOURCES="$SOURCES $srcdir/src/audio/*.c"
   188 SOURCES="$SOURCES $srcdir/src/cdrom/*.c"
   189 SOURCES="$SOURCES $srcdir/src/cpuinfo/*.c"
   190 SOURCES="$SOURCES $srcdir/src/events/*.c"
   191 SOURCES="$SOURCES $srcdir/src/file/*.c"
   192 SOURCES="$SOURCES $srcdir/src/joystick/*.c"
   193 SOURCES="$SOURCES $srcdir/src/stdlib/*.c"
   194 SOURCES="$SOURCES $srcdir/src/thread/*.c"
   195 SOURCES="$SOURCES $srcdir/src/timer/*.c"
   196 SOURCES="$SOURCES $srcdir/src/video/*.c"
   197 
   198 dnl Enable/disable various subsystems of the SDL library
   199 
   200 AC_ARG_ENABLE(audio,
   201 AC_HELP_STRING([--enable-audio], [Enable the audio subsystem [[default=yes]]]),
   202               , enable_audio=yes)
   203 if test x$enable_audio != xyes; then
   204     AC_DEFINE(SDL_AUDIO_DISABLED)
   205 fi
   206 AC_ARG_ENABLE(video,
   207 AC_HELP_STRING([--enable-video], [Enable the video subsystem [[default=yes]]]),
   208               , enable_video=yes)
   209 if test x$enable_video != xyes; then
   210     AC_DEFINE(SDL_VIDEO_DISABLED)
   211 fi
   212 AC_ARG_ENABLE(events,
   213 AC_HELP_STRING([--enable-events], [Enable the events subsystem [[default=yes]]]),
   214               , enable_events=yes)
   215 if test x$enable_events != xyes; then
   216     AC_DEFINE(SDL_EVENTS_DISABLED)
   217 fi
   218 AC_ARG_ENABLE(joystick,
   219 AC_HELP_STRING([--enable-joystick], [Enable the joystick subsystem [[default=yes]]]),
   220               , enable_joystick=yes)
   221 if test x$enable_joystick != xyes; then
   222     AC_DEFINE(SDL_JOYSTICK_DISABLED)
   223 fi
   224 AC_ARG_ENABLE(cdrom,
   225 AC_HELP_STRING([--enable-cdrom], [Enable the cdrom subsystem [[default=yes]]]),
   226               , enable_cdrom=yes)
   227 if test x$enable_cdrom != xyes; then
   228     AC_DEFINE(SDL_CDROM_DISABLED)
   229 fi
   230 AC_ARG_ENABLE(threads,
   231 AC_HELP_STRING([--enable-threads], [Enable the threading subsystem [[default=yes]]]),
   232               , enable_threads=yes)
   233 if test x$enable_threads != xyes; then
   234     AC_DEFINE(SDL_THREADS_DISABLED)
   235 fi
   236 AC_ARG_ENABLE(timers,
   237 AC_HELP_STRING([--enable-timers], [Enable the timer subsystem [[default=yes]]]),
   238               , enable_timers=yes)
   239 if test x$enable_timers != xyes; then
   240     AC_DEFINE(SDL_TIMERS_DISABLED)
   241 fi
   242 AC_ARG_ENABLE(file,
   243 AC_HELP_STRING([--enable-file], [Enable the file subsystem [[default=yes]]]),
   244               , enable_file=yes)
   245 if test x$enable_file != xyes; then
   246     AC_DEFINE(SDL_FILE_DISABLED)
   247 fi
   248 AC_ARG_ENABLE(loadso,
   249 AC_HELP_STRING([--enable-loadso], [Enable the shared object loading subsystem [[default=yes]]]),
   250               , enable_loadso=yes)
   251 if test x$enable_loadso != xyes; then
   252     AC_DEFINE(SDL_LOADSO_DISABLED)
   253 fi
   254 AC_ARG_ENABLE(cpuinfo,
   255 AC_HELP_STRING([--enable-cpuinfo], [Enable the cpuinfo subsystem [[default=yes]]]),
   256               , enable_cpuinfo=yes)
   257 if test x$enable_cpuinfo != xyes; then
   258     AC_DEFINE(SDL_CPUINFO_DISABLED)
   259 fi
   260 AC_ARG_ENABLE(assembly,
   261 AC_HELP_STRING([--enable-assembly], [Enable assembly routines [[default=yes]]]),
   262               , enable_assembly=yes)
   263 if test x$enable_assembly = xyes; then
   264     AC_DEFINE(SDL_ASSEMBLY_ROUTINES)
   265 fi
   266 
   267 dnl See if the OSS audio interface is supported
   268 CheckOSS()
   269 {
   270     AC_ARG_ENABLE(oss,
   271 AC_HELP_STRING([--enable-oss], [support the OSS audio API [[default=yes]]]),
   272                   , enable_oss=yes)
   273     if test x$enable_audio = xyes -a x$enable_oss = xyes; then
   274         AC_MSG_CHECKING(for OSS audio support)
   275         have_oss=no
   276         if test x$have_oss != xyes; then
   277             AC_TRY_COMPILE([
   278               #include <sys/soundcard.h>
   279             ],[
   280               int arg = SNDCTL_DSP_SETFRAGMENT;
   281             ],[
   282             have_oss=yes
   283             ])
   284         fi
   285         if test x$have_oss != xyes; then
   286             AC_TRY_COMPILE([
   287               #include <soundcard.h>
   288             ],[
   289               int arg = SNDCTL_DSP_SETFRAGMENT;
   290             ],[
   291             have_oss=yes
   292             AC_DEFINE(SDL_AUDIO_DRIVER_OSS_SOUNDCARD_H)
   293             ])
   294         fi
   295         AC_MSG_RESULT($have_oss)
   296         if test x$have_oss = xyes; then
   297             AC_DEFINE(SDL_AUDIO_DRIVER_OSS)
   298             SOURCES="$SOURCES $srcdir/src/audio/dsp/*.c"
   299             SOURCES="$SOURCES $srcdir/src/audio/dma/*.c"
   300             have_audio=yes
   301 
   302             # We may need to link with ossaudio emulation library
   303             case "$host" in
   304                 *-*-openbsd*|*-*-netbsd*)
   305                     EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lossaudio";;
   306             esac
   307         fi
   308     fi
   309 }
   310 
   311 dnl See if the ALSA audio interface is supported
   312 CheckALSA()
   313 {
   314     AC_ARG_ENABLE(alsa,
   315 AC_HELP_STRING([--enable-alsa], [support the ALSA audio API [[default=yes]]]),
   316                   , enable_alsa=yes)
   317     if test x$enable_audio = xyes -a x$enable_alsa = xyes; then
   318         AM_PATH_ALSA(0.9.0, have_alsa=yes, have_alsa=no)
   319         # Restore all flags from before the ALSA detection runs
   320         CFLAGS="$alsa_save_CFLAGS"
   321         LDFLAGS="$alsa_save_LDFLAGS"
   322         LIBS="$alsa_save_LIBS"
   323         if test x$have_alsa = xyes; then
   324             AC_ARG_ENABLE(alsa-shared,
   325 AC_HELP_STRING([--enable-alsa-shared], [dynamically load ALSA audio support [[default=yes]]]),
   326                           , enable_alsa_shared=yes)
   327             if test "x`echo $ALSA_LIBS | grep -- -L`" = "x"; then
   328                 if test "x`ls /lib/libasound.so.* 2> /dev/null`" != "x"; then
   329                     ALSA_LIBS="-L/lib $ALSA_LIBS"
   330                 elif test "x`ls /usr/lib/libasound.so.* 2> /dev/null`" != "x"; then
   331                     ALSA_LIBS="-L/usr/lib $ALSA_LIBS"
   332                 elif test "x`ls /usr/local/lib/libasound.so.* 2> /dev/null`" != "x"; then
   333                     ALSA_LIBS="-L/usr/local/lib $ALSA_LIBS"
   334                 fi
   335             fi
   336             alsa_lib_spec=`echo $ALSA_LIBS | sed 's/.*-L\([[^ ]]*\).*/\1\/libasound.so.*/'`
   337             alsa_lib=`ls -- $alsa_lib_spec | sed 's/.*\/\(.*\)/\1/; q'`
   338             echo "-- $alsa_lib_spec -> $alsa_lib"
   339 
   340             AC_DEFINE(SDL_AUDIO_DRIVER_ALSA)
   341             SOURCES="$SOURCES $srcdir/src/audio/alsa/*.c"
   342             EXTRA_CFLAGS="$EXTRA_CFLAGS $ALSA_CFLAGS"
   343             if test x$have_loadso != xyes && \
   344                test x$enable_alsa_shared = xyes; then
   345                 AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic ALSA loading])
   346             fi
   347             if test x$have_loadso = xyes && \
   348                test x$enable_alsa_shared = xyes && test x$alsa_lib != x; then
   349                 AC_DEFINE_UNQUOTED(SDL_AUDIO_DRIVER_ALSA_DYNAMIC, "$alsa_lib")
   350             else
   351                 EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ALSA_LIBS"
   352             fi
   353             have_audio=yes
   354         fi
   355     fi
   356 }
   357 
   358 dnl Check whether we want to use IRIX 6.5+ native audio or not
   359 CheckDMEDIA()
   360 {
   361     if test x$enable_audio = xyes; then
   362         AC_MSG_CHECKING(for dmedia audio support)
   363         have_dmedia=no
   364         AC_TRY_COMPILE([
   365           #include <dmedia/audio.h>
   366         ],[
   367           ALport audio_port;
   368         ],[
   369         have_dmedia=yes
   370         ])
   371         AC_MSG_RESULT($have_dmedia)
   372         # Set up files for the audio library
   373         if test x$have_dmedia = xyes; then
   374             AC_DEFINE(SDL_AUDIO_DRIVER_DMEDIA)
   375             SOURCES="$SOURCES $srcdir/src/audio/dmedia/*.c"
   376             EXTRA_LDFLAGS="$EXTRA_LDFLAGS -laudio"
   377             have_audio=yes
   378         fi
   379     fi
   380 }
   381 
   382 dnl Check whether we want to use Tru64 UNIX native audio or not
   383 CheckMME()
   384 {
   385     dnl Make sure we are running on an Tru64 UNIX
   386     case $ARCH in
   387         osf)
   388             ;;
   389         *)
   390             return
   391             ;;
   392     esac
   393     if test x$enable_audio = xyes; then
   394         AC_MSG_CHECKING(for MME audio support)
   395         MME_CFLAGS="-I/usr/include/mme"
   396         MME_LIBS="-lmme"
   397         have_mme=no
   398         save_CFLAGS="$CFLAGS"
   399         CFLAGS="$CFLAGS $MME_CFLAGS"
   400         AC_TRY_COMPILE([
   401           #include <mme_api.h>
   402         ],[
   403           HWAVEOUT sound;
   404         ],[
   405         have_mme=yes
   406         ])
   407         CFLAGS="$save_CFLAGS"
   408         AC_MSG_RESULT($have_mme)
   409         # Set up files for the audio library
   410         if test x$have_mme = xyes; then
   411             AC_DEFINE(SDL_AUDIO_DRIVER_MMEAUDIO)
   412             SOURCES="$SOURCES $srcdir/src/audio/mme/*.c"
   413             EXTRA_CFLAGS="$EXTRA_CFLAGS $MME_CFLAGS"
   414             EXTRA_LDFLAGS="$EXTRA_LDFLAGS $MME_LIBS"
   415             have_audio=yes
   416         fi
   417     fi
   418 }
   419 
   420 dnl Find the ESD includes and libraries
   421 CheckESD()
   422 {
   423     AC_ARG_ENABLE(esd,
   424 AC_HELP_STRING([--enable-esd], [support the Enlightened Sound Daemon [[default=yes]]]),
   425                   , enable_esd=yes)
   426     if test x$enable_audio = xyes -a x$enable_esd = xyes; then
   427         AM_PATH_ESD(0.2.8, have_esd=yes, have_esd=no)
   428         if test x$have_esd = xyes; then
   429             AC_ARG_ENABLE(esd-shared,
   430 AC_HELP_STRING([--enable-esd-shared], [dynamically load ESD audio support [[default=yes]]]),
   431                           , enable_esd_shared=yes)
   432             esd_lib_spec=`echo $ESD_LIBS | sed 's/.*-L\([[^ ]]*\).*/\1\/libesd.so.*/'`
   433             esd_lib=`ls -- $esd_lib_spec | sed 's/.*\/\(.*\)/\1/; q'`
   434             echo "-- $esd_lib_spec -> $esd_lib"
   435 
   436             AC_DEFINE(SDL_AUDIO_DRIVER_ESD)
   437             SOURCES="$SOURCES $srcdir/src/audio/esd/*.c"
   438             EXTRA_CFLAGS="$EXTRA_CFLAGS $ESD_CFLAGS"
   439             if test x$have_loadso != xyes && \
   440                test x$enable_esd_shared = xyes; then
   441                 AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic ESD loading])
   442             fi
   443             if test x$have_loadso = xyes && \
   444                test x$enable_esd_shared = xyes && test x$esd_lib != x; then
   445                 AC_DEFINE_UNQUOTED(SDL_AUDIO_DRIVER_ESD_DYNAMIC, "$esd_lib")
   446             else
   447                 EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ESD_LIBS"
   448             fi
   449             have_audio=yes
   450         fi
   451     fi
   452 }
   453 
   454 CheckARTSC()
   455 {
   456     AC_ARG_ENABLE(arts,
   457 AC_HELP_STRING([--enable-arts], [support the Analog Real Time Synthesizer [[default=yes]]]),
   458                   , enable_arts=yes)
   459     if test x$enable_audio = xyes -a x$enable_arts = xyes; then
   460         AC_PATH_PROG(ARTSCONFIG, artsc-config)
   461         if test x$ARTSCONFIG = x -o x$ARTSCONFIG = x'"$ARTSCONFIG"'; then
   462             : # arts isn't installed
   463         else
   464             ARTS_CFLAGS=`$ARTSCONFIG --cflags`
   465             ARTS_LIBS=`$ARTSCONFIG --libs`
   466             ARTS_PREFIX=`$ARTSCONFIG --arts-prefix`
   467             AC_MSG_CHECKING(for aRts development environment)
   468             audio_arts=no
   469             save_CFLAGS="$CFLAGS"
   470             CFLAGS="$CFLAGS $ARTS_CFLAGS"
   471             AC_TRY_COMPILE([
   472              #include <artsc.h>
   473             ],[
   474              arts_stream_t stream;
   475             ],[
   476             audio_arts=yes
   477             ])
   478             CFLAGS="$save_CFLAGS"
   479             AC_MSG_RESULT($audio_arts)
   480             if test x$audio_arts = xyes; then
   481                 AC_ARG_ENABLE(arts-shared,
   482 AC_HELP_STRING([--enable-arts-shared], [dynamically load aRts audio support [[default=yes]]]),
   483                               , enable_arts_shared=yes)
   484                 arts_lib_spec="$ARTS_PREFIX/lib/libartsc.so.*"
   485                 arts_lib=`ls -- $arts_lib_spec | sed 's/.*\/\(.*\)/\1/; q'`
   486                 echo "-- $arts_lib_spec -> $arts_lib"
   487 
   488                 AC_DEFINE(SDL_AUDIO_DRIVER_ARTS)
   489                 SOURCES="$SOURCES $srcdir/src/audio/arts/*.c"
   490                 EXTRA_CFLAGS="$EXTRA_CFLAGS $ARTS_CFLAGS"
   491                 if test x$have_loadso != xyes && \
   492                    test x$enable_arts_shared = xyes; then
   493                     AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic ARTS loading])
   494                 fi
   495                 if test x$have_loadso = xyes && \
   496                    test x$enable_arts_shared = xyes && test x$arts_lib != x; then
   497                     AC_DEFINE_UNQUOTED(SDL_AUDIO_DRIVER_ARTS_DYNAMIC, "$arts_lib")
   498                 else
   499                     EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ARTS_LIBS"
   500                 fi
   501                 have_audio=yes
   502             fi
   503         fi
   504     fi
   505 }
   506 
   507 dnl See if the NAS audio interface is supported
   508 CheckNAS()
   509 {
   510     AC_ARG_ENABLE(nas,
   511 AC_HELP_STRING([--enable-nas], [support the NAS audio API [[default=yes]]]),
   512                   , enable_nas=yes)
   513     if test x$enable_audio = xyes -a x$enable_nas = xyes; then
   514         AC_MSG_CHECKING(for NAS audio support)
   515         have_nas=no
   516         AC_CHECK_HEADER(audio/audiolib.h, have_nas_hdr=yes)
   517         AC_CHECK_LIB(audio, AuOpenServer, have_nas_lib=yes)
   518 
   519         if test x$have_nas_hdr = xyes -a x$have_nas_lib = xyes; then
   520             have_nas=yes
   521             NAS_LIBS="-laudio"
   522 
   523         elif test -r /usr/X11R6/include/audio/audiolib.h; then
   524             have_nas=yes
   525             NAS_CFLAGS="-I/usr/X11R6/include/"
   526             NAS_LIBS="-L/usr/X11R6/lib -laudio -lXt"
   527 
   528         dnl On IRIX, the NAS includes are in a different directory,
   529         dnl and libnas must be explicitly linked in
   530 
   531         elif test -r /usr/freeware/include/nas/audiolib.h; then
   532             have_nas=yes
   533             NAS_LIBS="-lnas -lXt"
   534         fi
   535         AC_MSG_RESULT($have_nas)
   536         if test x$have_nas = xyes; then
   537             AC_DEFINE(SDL_AUDIO_DRIVER_NAS)
   538             SOURCES="$SOURCES $srcdir/src/audio/nas/*.c"
   539             EXTRA_CFLAGS="$EXTRA_CFLAGS $NAS_CFLAGS"
   540             EXTRA_LDFLAGS="$EXTRA_LDFLAGS $NAS_LIBS"
   541             have_audio=yes
   542         fi
   543     fi
   544 }
   545 
   546 dnl rcg07142001 See if the user wants the disk writer audio driver...
   547 CheckDiskAudio()
   548 {
   549     AC_ARG_ENABLE(diskaudio,
   550 AC_HELP_STRING([--enable-diskaudio], [support the disk writer audio driver [[default=yes]]]),
   551                   , enable_diskaudio=yes)
   552     if test x$enable_audio = xyes -a x$enable_diskaudio = xyes; then
   553         AC_DEFINE(SDL_AUDIO_DRIVER_DISK)
   554         SOURCES="$SOURCES $srcdir/src/audio/disk/*.c"
   555     fi
   556 }
   557 
   558 dnl rcg03142006 See if the user wants the dummy audio driver...
   559 CheckDummyAudio()
   560 {
   561     AC_ARG_ENABLE(dummyaudio,
   562 AC_HELP_STRING([--enable-dummyaudio], [support the dummy audio driver [[default=yes]]]),
   563                   , enable_dummyaudio=yes)
   564     if test x$enable_audio = xyes -a x$enable_dummyaudio = xyes; then
   565         AC_DEFINE(SDL_AUDIO_DRIVER_DUMMY)
   566         SOURCES="$SOURCES $srcdir/src/audio/dummy/*.c"
   567     fi
   568 }
   569 
   570 dnl Set up the Atari Audio driver
   571 CheckAtariAudio()
   572 {
   573     AC_ARG_ENABLE(mintaudio,
   574 AC_HELP_STRING([--enable-mintaudio], [support Atari audio driver [[default=yes]]]),
   575                   , enable_mintaudio=yes)
   576     if test x$enable_audio = xyes -a x$enable_mintaudio = xyes; then
   577         mintaudio=no
   578         AC_CHECK_HEADER(mint/falcon.h, have_mint_falcon_hdr=yes)
   579         if test x$have_mint_falcon_hdr = xyes; then
   580             mintaudio=yes
   581             AC_DEFINE(SDL_AUDIO_DRIVER_MINT)
   582             SOURCES="$SOURCES $srcdir/src/audio/mint/*.c"
   583             SOURCES="$SOURCES $srcdir/src/audio/mint/*.S"
   584             have_audio=yes
   585         fi
   586     fi
   587 }
   588 
   589 dnl See if we can use x86 assembly blitters
   590 # NASM is available from: http://nasm.sourceforge.net
   591 CheckNASM()
   592 {
   593     dnl Make sure we are running on an x86 platform
   594     case $host in
   595         i?86*)
   596             ;;
   597         *)
   598         # Nope, bail early.
   599             return
   600             ;;
   601     esac
   602     dnl Check for NASM (for assembly blit routines)
   603     AC_ARG_ENABLE(nasm,
   604 AC_HELP_STRING([--enable-nasm], [use nasm assembly blitters on x86 [[default=yes]]]),
   605                   , enable_nasm=yes)
   606     if test x$enable_video = xyes -a x$enable_assembly = xyes -a x$enable_nasm = xyes; then
   607         AC_PATH_PROG(NASM, yasm)
   608         if test "x$NASM" = x -o "x$NASM" = x'"$NASM"'; then
   609             AC_PATH_PROG(NASM, nasm)
   610         fi
   611         if test "x$NASM" != x -a "x$NASM" != x'"$NASM"'; then
   612             AC_DEFINE(SDL_HERMES_BLITTERS)
   613             SOURCES="$SOURCES $srcdir/src/hermes/*.asm"
   614             if test x"$NASMFLAGS" = x; then
   615                 case $ARCH in
   616                   win32)
   617                       NASMFLAGS="-f win32"
   618                       ;;
   619                   openbsd)
   620                       NASMFLAGS="-f aoutb"
   621                       ;;
   622                   macosx)
   623                       NASMFLAGS="-f macho"
   624                       ;;
   625                   *)
   626                       NASMFLAGS="-f elf"
   627                       ;;
   628                 esac
   629             fi
   630             NASMFLAGS="$NASMFLAGS -i $srcdir/src/hermes/"
   631 
   632             dnl See if hidden visibility is supported
   633             echo "GLOBAL _bar:function hidden" > nasm_vis.asm
   634             echo "_bar:" >>nasm_vis.asm
   635             if $NASM $NASMFLAGS nasm_vis.asm -o nasm_vis.o >&AS_MESSAGE_LOG_FD 2>&1; then
   636                 NASMFLAGS="$NASMFLAGS -DHIDDEN_VISIBILITY"
   637             fi
   638             rm -f nasm_vis.asm nasm_vis.o
   639 
   640             AC_SUBST(NASM)
   641             AC_SUBST(NASMFLAGS)
   642 
   643             case "$host" in
   644                 # this line is needed for QNX, because it's not defined the __ELF__
   645                 *-*-qnx*)
   646                      EXTRA_CFLAGS="$EXTRA_CFLAGS -D__ELF__";;
   647                 *-*-solaris*)
   648                      EXTRA_CFLAGS="$EXTRA_CFLAGS -D__ELF__";;
   649             esac
   650         fi
   651     fi
   652 }
   653 
   654 dnl Check for altivec instruction support using gas syntax
   655 CheckAltivec()
   656 {
   657     AC_ARG_ENABLE(altivec,
   658 AC_HELP_STRING([--enable-altivec], [use altivec assembly blitters on PPC [[default=yes]]]),
   659                   , enable_altivec=yes)
   660     if test x$enable_video = xyes -a x$enable_assembly = xyes -a x$enable_altivec = xyes; then
   661         have_altivec_h_hdr=no
   662         AC_CHECK_HEADER(altivec.h, have_altivec_h_hdr=yes)
   663 
   664         save_CFLAGS="$CFLAGS"
   665         have_gcc_altivec=no
   666         AC_MSG_CHECKING(for Altivec with GCC -maltivec option)
   667         altivec_CFLAGS="-maltivec"
   668         CFLAGS="$save_CFLAGS $altivec_CFLAGS"
   669 
   670         if test x$have_altivec_h_hdr = xyes; then
   671           AC_TRY_COMPILE([
   672           #include <altivec.h>
   673           vector unsigned int vzero() {
   674               return vec_splat_u32(0);
   675           }
   676           ],[
   677           ],[
   678           have_gcc_altivec=yes
   679           ])
   680           AC_MSG_RESULT($have_gcc_altivec)
   681         else
   682           AC_TRY_COMPILE([
   683           vector unsigned int vzero() {
   684               return vec_splat_u32(0);
   685           }
   686           ],[
   687           ],[
   688           have_gcc_altivec=yes
   689           ])
   690           AC_MSG_RESULT($have_gcc_altivec)
   691         fi
   692 
   693         if test x$have_gcc_altivec = xno; then
   694             AC_MSG_CHECKING(for Altivec with GCC -faltivec option)
   695             altivec_CFLAGS="-faltivec"
   696             CFLAGS="$save_CFLAGS $altivec_CFLAGS"
   697             if test x$have_altivec_h_hdr = xyes; then
   698               AC_TRY_COMPILE([
   699               #include <altivec.h>
   700               vector unsigned int vzero() {
   701                   return vec_splat_u32(0);
   702               }
   703               ],[
   704               ],[
   705               have_gcc_altivec=yes
   706               ])
   707               AC_MSG_RESULT($have_gcc_altivec)
   708             else
   709               AC_TRY_COMPILE([
   710               vector unsigned int vzero() {
   711                   return vec_splat_u32(0);
   712               }
   713               ],[
   714               ],[
   715               have_gcc_altivec=yes
   716               ])
   717               AC_MSG_RESULT($have_gcc_altivec)
   718             fi
   719         fi
   720         CFLAGS="$save_CFLAGS"
   721 
   722         if test x$have_gcc_altivec = xyes; then
   723             AC_DEFINE(SDL_ALTIVEC_BLITTERS)
   724             if test x$have_altivec_h_hdr = xyes; then
   725               AC_DEFINE(HAVE_ALTIVEC_H)
   726             fi
   727             EXTRA_CFLAGS="$EXTRA_CFLAGS $altivec_CFLAGS"
   728         fi
   729     fi
   730 }
   731 
   732 dnl See if GCC's -fvisibility=hidden is supported (gcc4 and later, usually).
   733 dnl  Details of this flag are here: http://gcc.gnu.org/wiki/Visibility
   734 CheckVisibilityHidden()
   735 {
   736     AC_MSG_CHECKING(for GCC -fvisibility=hidden option)
   737     have_gcc_fvisibility=no
   738 
   739     visibility_CFLAGS="-fvisibility=hidden"
   740     save_CFLAGS="$CFLAGS"
   741     CFLAGS="$save_CFLAGS $visibility_CFLAGS"
   742     AC_TRY_COMPILE([
   743     #if !defined(__GNUC__) || __GNUC__ < 4
   744     #error SDL only uses visibility attributes in GCC 4 or newer
   745     #endif
   746     ],[
   747     ],[
   748     have_gcc_fvisibility=yes
   749     ])
   750     AC_MSG_RESULT($have_gcc_fvisibility)
   751     CFLAGS="$save_CFLAGS"
   752 
   753     if test x$have_gcc_fvisibility = xyes; then
   754         EXTRA_CFLAGS="$EXTRA_CFLAGS $visibility_CFLAGS"
   755     fi
   756 }
   757 
   758 
   759 dnl Do the iPod thing
   760 CheckIPod()
   761 {
   762     AC_ARG_ENABLE(ipod,
   763 AC_HELP_STRING([--enable-ipod], [configure SDL to work with iPodLinux [default=yes on arm-elf]]),
   764         , enable_ipod=yes)
   765 
   766     if test x$enable_ipod = xyes; then
   767         EXTRA_CFLAGS="$EXTRA_CFLAGS -DIPOD"
   768         AC_DEFINE(SDL_VIDEO_DRIVER_IPOD)
   769         SOURCES="$SOURCES $srcdir/src/video/ipod/*.c"
   770     fi
   771 }
   772 
   773 dnl Find the nanox include and library directories
   774 CheckNANOX()
   775 {
   776     AC_ARG_ENABLE(video-nanox,
   777         AC_HELP_STRING([--enable-video-nanox], [use nanox video driver [[default=no]]]),
   778         , enable_video_nanox=no)
   779 
   780     if test x$enable_video = xyes -a x$enable_video_nanox = xyes; then
   781         AC_ARG_ENABLE(nanox-debug,  
   782             AC_HELP_STRING([--enable-nanox-debug], [print debug messages [[default=no]]]),
   783             , enable_nanox_debug=no)
   784         if test x$enable_nanox_debug = xyes; then
   785             EXTRA_CFLAGS="$EXTRA_CFLAGS -DENABLE_NANOX_DEBUG"
   786         fi
   787 
   788         AC_ARG_ENABLE(nanox-share-memory,  
   789             AC_HELP_STRING([--enable-nanox-share-memory], [use share memory [[default=no]]]),
   790             , enable_nanox_share_memory=no)
   791         if test x$enable_nanox_share_memory = xyes; then
   792             EXTRA_CFLAGS="$EXTRA_CFLAGS -DNANOX_SHARE_MEMORY"
   793         fi
   794 
   795         AC_ARG_ENABLE(nanox_direct_fb, 
   796             AC_HELP_STRING([--enable-nanox-direct-fb], [use direct framebuffer access [[default=no]]]),
   797             , enable_nanox_direct_fb=no)
   798         if test x$enable_nanox_direct_fb = xyes; then
   799             EXTRA_CFLAGS="$EXTRA_CFLAGS -DENABLE_NANOX_DIRECT_FB"
   800         fi
   801 
   802         AC_DEFINE(SDL_VIDEO_DRIVER_NANOX)
   803         SOURCES="$SOURCES $srcdir/src/video/nanox/*.c"
   804         EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lnano-X"
   805         have_video=yes
   806     fi
   807 }
   808 
   809 dnl Find the X11 include and library directories
   810 CheckX11()
   811 {
   812     AC_ARG_ENABLE(video-x11,
   813 AC_HELP_STRING([--enable-video-x11], [use X11 video driver [[default=yes]]]),
   814                   , enable_video_x11=yes)
   815     if test x$enable_video = xyes -a x$enable_video_x11 = xyes; then
   816         case "$host" in
   817             *-*-darwin*)
   818                 # This isn't necessary for X11, but fixes GLX detection
   819                 if test "x$x_includes" = xNONE && test "x$x_libraries" = xNONE; then
   820                     x_includes="/usr/X11R6/include"
   821                     x_libraries="/usr/X11R6/lib"
   822                 fi
   823                 ;;
   824         esac
   825         AC_PATH_X
   826         AC_PATH_XTRA
   827         if test x$have_x = xyes; then
   828             # Only allow dynamically loaded X11 if the X11 function pointers
   829             # will not end up in the global namespace, which causes problems
   830             # with other libraries calling X11 functions.
   831             x11_symbols_private=$have_gcc_fvisibility
   832 
   833             AC_ARG_ENABLE(x11-shared,
   834 AC_HELP_STRING([--enable-x11-shared], [dynamically load X11 support [[default=maybe]]]),
   835                           , enable_x11_shared=maybe)
   836 
   837             case "$host" in
   838                 *-*-darwin*) # Latest Mac OS X actually ships with Xrandr/Xrender libs...
   839                     x11_symbols_private=yes
   840                     x11_lib='/usr/X11R6/lib/libX11.6.dylib'
   841                     x11ext_lib='/usr/X11R6/lib/libXext.6.dylib'
   842                     xrender_lib='/usr/X11R6/lib/libXrender.1.dylib'
   843                     xrandr_lib='/usr/X11R6/lib/libXrandr.2.dylib'
   844                     ;;
   845                 *-*-osf*)
   846                     x11_lib='libX11.so'
   847                     x11ext_lib='libXext.so'
   848                     ;;
   849                 *-*-irix*) # IRIX 6.5 requires that we use /usr/lib32
   850                     x11_lib='libX11.so'
   851                     x11ext_lib='libXext.so'
   852                     ;;
   853                 *)
   854                     x11_lib_spec=[`echo $X_LIBS | sed 's/.*-L\([^ ]*\).*/\1/'`]
   855                     for path in $x11_lib_path /usr/lib /usr/X11/lib /usr/X11R6/lib; do
   856                         if test "x$x11_lib" = "x"; then
   857                             x11_lib=[`ls -- $path/libX11.so.[0-9] 2>/dev/null | sort -r | sed 's/.*\/\(.*\)/\1/; q'`]
   858                             if test "x$x11_lib" = "x"; then
   859                                 x11_lib=[`ls -- $path/libX11.so.[0-9]* 2>/dev/null | sort -r | sed 's/.*\/\(.*\)/\1/; q'`]
   860                             fi
   861                         fi
   862                         if test "x$x11ext_lib" = "x"; then
   863                             x11ext_lib=[`ls -- $path/libXext.so.[0-9] 2>/dev/null | sort -r | sed 's/.*\/\(.*\)/\1/; q'`]
   864                             if test "x$x11ext_lib" = "x"; then
   865                                 x11ext_lib=[`ls -- $path/libXext.so.[0-9]* 2>/dev/null | sort -r | sed 's/.*\/\(.*\)/\1/; q'`]
   866                             fi
   867                         fi
   868                         if test "x$xrender_lib" = "x"; then
   869                             xrender_lib=[`ls -- $path/libXrender.so.[0-9] 2>/dev/null | sort -r | sed 's/.*\/\(.*\)/\1/; q'`]
   870                             if test "x$xrender_lib" = "x"; then
   871                                 xrender_lib=[`ls -- $path/libXrender.so.[0-9]* 2>/dev/null | sort -r | sed 's/.*\/\(.*\)/\1/; q'`]
   872                             fi
   873                         fi
   874                         if test "x$xrandr_lib" = "x"; then
   875                             xrandr_lib=[`ls -- $path/libXrandr.so.[0-9] 2>/dev/null | sort -r | sed 's/.*\/\(.*\)/\1/; q'`]
   876                             if test "x$xrandr_lib" = "x"; then
   877                                 xrandr_lib=[`ls -- $path/libXrandr.so.[0-9]* 2>/dev/null | sort -r | sed 's/.*\/\(.*\)/\1/; q'`]
   878                             fi
   879                         fi
   880                     done
   881                     ;;
   882             esac
   883 
   884             X_CFLAGS="$X_CFLAGS -DXTHREADS"
   885             if test x$ac_cv_func_shmat != xyes; then
   886                 X_CFLAGS="$X_CFLAGS -DNO_SHARED_MEMORY"
   887             fi
   888             CFLAGS="$CFLAGS $X_CFLAGS"
   889             LDFLAGS="$LDFLAGS $X_LIBS"
   890 
   891             AC_DEFINE(SDL_VIDEO_DRIVER_X11)
   892             SOURCES="$SOURCES $srcdir/src/video/x11/*.c"
   893             EXTRA_CFLAGS="$EXTRA_CFLAGS $X_CFLAGS"
   894 
   895             if test x$enable_x11_shared = xmaybe; then
   896                 enable_x11_shared=$x11_symbols_private
   897             fi
   898             if test x$have_loadso != xyes && \
   899                test x$enable_x11_shared = xyes; then
   900                 AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic X11 loading])
   901                 enable_x11_shared=no
   902             fi
   903             if test x$x11_symbols_private != xyes && \
   904                test x$enable_x11_shared = xyes; then
   905                 AC_MSG_WARN([You must have gcc4 (-fvisibility=hidden) for dynamic X11 loading])
   906                 enable_x11_shared=no
   907             fi
   908 
   909             if test x$have_loadso = xyes && \
   910                test x$enable_x11_shared = xyes && test x$x11_lib != x && test x$x11ext_lib != x; then
   911                 echo "-- dynamic libX11 -> $x11_lib"
   912                 echo "-- dynamic libX11ext -> $x11ext_lib"
   913                 AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_X11_DYNAMIC, "$x11_lib")
   914                 AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_X11_DYNAMIC_XEXT, "$x11ext_lib")
   915             else
   916                 enable_x11_shared=no
   917                 EXTRA_LDFLAGS="$EXTRA_LDFLAGS $X_LIBS -lX11 -lXext"
   918             fi
   919             have_video=yes
   920 
   921             AC_ARG_ENABLE(video-x11-vm,
   922 AC_HELP_STRING([--enable-video-x11-vm], [use X11 VM extension for fullscreen [[default=yes]]]),
   923                           , enable_video_x11_vm=yes)
   924             if test x$enable_video_x11_vm = xyes; then
   925                 AC_DEFINE(SDL_VIDEO_DRIVER_X11_VIDMODE)
   926                 SOURCES="$SOURCES $srcdir/src/video/Xext/Xxf86vm/*.c"
   927             fi
   928             AC_ARG_ENABLE(video-x11-xv,
   929 AC_HELP_STRING([--enable-video-x11-xv], [use X11 XvImage extension for video [[default=yes]]]),
   930                           , enable_video_x11_xv=yes)
   931             if test x$enable_video_x11_xv = xyes; then
   932                 AC_DEFINE(SDL_VIDEO_DRIVER_X11_XV)
   933                 SOURCES="$SOURCES $srcdir/src/video/Xext/Xv/*.c"
   934             fi
   935             AC_ARG_ENABLE(video-x11-xinerama,
   936 AC_HELP_STRING([--enable-video-x11-xinerama], [enable X11 Xinerama support [[default=yes]]]),
   937                             , enable_video_x11_xinerama=yes)
   938             if test x$enable_video_x11_xinerama = xyes; then
   939                 AC_DEFINE(SDL_VIDEO_DRIVER_X11_XINERAMA)
   940                 SOURCES="$SOURCES $srcdir/src/video/Xext/Xinerama/*.c"
   941             fi
   942             AC_ARG_ENABLE(video-x11-xme,
   943 AC_HELP_STRING([--enable-video-x11-xme], [enable Xi Graphics XME for fullscreen [[default=yes]]]),
   944                             , enable_video_x11_xme=yes)
   945             if test x$enable_video_x11_xme = xyes; then
   946                 AC_DEFINE(SDL_VIDEO_DRIVER_X11_XME)
   947                 SOURCES="$SOURCES $srcdir/src/video/Xext/XME/*.c"
   948             fi
   949             AC_ARG_ENABLE(video-x11-xrandr,
   950 AC_HELP_STRING([--enable-video-x11-xrandr], [enable X11 Xrandr extension for fullscreen [[default=yes]]]),
   951                             , enable_video_x11_xrandr=yes)
   952             if test x$enable_video_x11_xrandr = xyes; then
   953                 definitely_enable_video_x11_xrandr=no
   954                 AC_CHECK_HEADER(X11/extensions/Xrandr.h,
   955                                 have_xrandr_h_hdr=yes,
   956                                 have_xrandr_h_hdr=no,
   957                                 [#include <X11/Xlib.h>
   958                                 ])
   959                 if test x$have_xrandr_h_hdr = xyes; then
   960                     if test x$enable_x11_shared = xyes && test x$xrandr_lib != x ; then
   961                         echo "-- dynamic libXrender -> $xrender_lib"
   962                         echo "-- dynamic libXrandr -> $xrandr_lib"
   963                         AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_X11_DYNAMIC_XRENDER, "$xrender_lib")
   964                         AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_X11_DYNAMIC_XRANDR, "$xrandr_lib")
   965                         definitely_enable_video_x11_xrandr=yes
   966                     else
   967                         AC_CHECK_LIB(Xrender, XRenderQueryExtension, have_xrender_lib=yes)
   968                         AC_CHECK_LIB(Xrandr, XRRQueryExtension, have_xrandr_lib=yes)
   969                         if test x$have_xrender_lib = xyes && test x$have_xrandr_lib = xyes ; then
   970                             EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lXrandr -lXrender"
   971                             definitely_enable_video_x11_xrandr=yes
   972                         fi
   973                     fi
   974                 fi
   975             fi
   976             if test x$definitely_enable_video_x11_xrandr = xyes; then
   977                 AC_DEFINE(SDL_VIDEO_DRIVER_X11_XRANDR)
   978             fi
   979             AC_ARG_ENABLE(video-x11-dpms,
   980 AC_HELP_STRING([--enable-video-x11-dpms], [enable X11 DPMS extension [[default=yes]]]),
   981                             , enable_video_x11_dpms=yes)
   982             if test x$enable_video_x11_dpms = xyes; then
   983                 AC_CHECK_HEADER(X11/extensions/dpms.h,
   984                                 have_dpms_h_hdr=yes,
   985                                 have_dpms_h_hdr=no,
   986                                 [#include <X11/Xlib.h>
   987                                 ])
   988                 if test x$have_dpms_h_hdr = xyes; then
   989                     AC_DEFINE(SDL_VIDEO_DRIVER_X11_DPMS)
   990                 fi
   991             fi
   992         fi
   993     fi
   994 }
   995 
   996 dnl Check for QNX photon video driver
   997 CheckPHOTON()
   998 {
   999     AC_ARG_ENABLE(video-photon,
  1000 AC_HELP_STRING([--enable-video-photon], [use QNX Photon video driver [[default=yes]]]),
  1001                   , enable_video_photon=yes)
  1002     if test x$enable_video = xyes -a x$enable_video_photon = xyes; then
  1003         AC_MSG_CHECKING(for QNX Photon support)
  1004         video_photon=no
  1005         AC_TRY_COMPILE([
  1006           #include <Ph.h>
  1007           #include <Pt.h>
  1008           #include <photon/Pg.h>
  1009           #include <photon/PdDirect.h>
  1010         ],[
  1011          PgDisplaySettings_t *visual;
  1012         ],[
  1013         video_photon=yes
  1014         ])
  1015         AC_MSG_RESULT($video_photon)
  1016         if test x$video_photon = xyes; then
  1017             AC_DEFINE(SDL_VIDEO_DRIVER_PHOTON)
  1018             SOURCES="$SOURCES $srcdir/src/video/photon/*.c"
  1019             EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lph"
  1020             have_video=yes
  1021 
  1022             CheckOpenGLQNX
  1023         fi
  1024     fi
  1025 }
  1026 
  1027 dnl Set up the BWindow video driver if enabled
  1028 CheckBWINDOW()
  1029 {
  1030     if test x$enable_video = xyes; then
  1031         AC_DEFINE(SDL_VIDEO_DRIVER_BWINDOW)
  1032         SOURCES="$SOURCES $srcdir/src/video/bwindow/*.cc"
  1033         have_video=yes
  1034     fi
  1035 }
  1036 
  1037 dnl Set up the Cocoa video driver for Mac OS X (but not Darwin)
  1038 CheckCOCOA()
  1039 {
  1040     AC_ARG_ENABLE(video-cocoa,
  1041 AC_HELP_STRING([--enable-video-cocoa], [use Cocoa video driver [[default=yes]]]),
  1042                   , enable_video_cocoa=yes)
  1043     if test x$enable_video = xyes -a x$enable_video_cocoa = xyes; then
  1044         save_CFLAGS="$CFLAGS"
  1045         dnl work around that we don't have Objective-C support in autoconf
  1046         CFLAGS="$CFLAGS -x objective-c"
  1047         AC_MSG_CHECKING(for Cocoa framework)
  1048         have_cocoa=no
  1049         AC_TRY_COMPILE([
  1050           #import <Cocoa/Cocoa.h>
  1051         ],[
  1052         ],[
  1053         have_cocoa=yes
  1054         ])
  1055         AC_MSG_RESULT($have_cocoa)
  1056         CFLAGS="$save_CFLAGS"
  1057         if test x$have_cocoa = xyes; then
  1058             AC_DEFINE(SDL_VIDEO_DRIVER_COCOA)
  1059             SOURCES="$SOURCES $srcdir/src/video/cocoa/*.m"
  1060             have_video=yes
  1061         fi
  1062     fi
  1063 }
  1064 
  1065 dnl Find the framebuffer console includes
  1066 CheckFBCON()
  1067 {
  1068     AC_ARG_ENABLE(video-fbcon,
  1069 AC_HELP_STRING([--enable-video-fbcon], [use framebuffer console video driver [[default=no]]]),
  1070                   , enable_video_fbcon=no)
  1071     if test x$enable_video = xyes -a x$enable_video_fbcon = xyes; then
  1072         AC_MSG_CHECKING(for framebuffer console support)
  1073         video_fbcon=no
  1074         AC_TRY_COMPILE([
  1075          #include <linux/fb.h>
  1076          #include <linux/kd.h>
  1077          #include <linux/keyboard.h>
  1078         ],[
  1079         ],[
  1080         video_fbcon=yes
  1081         ])
  1082         AC_MSG_RESULT($video_fbcon)
  1083         if test x$video_fbcon = xyes; then
  1084             AC_DEFINE(SDL_VIDEO_DRIVER_FBCON)
  1085             SOURCES="$SOURCES $srcdir/src/video/fbcon/*.c"
  1086             have_video=yes
  1087         fi
  1088     fi
  1089 }
  1090 
  1091 dnl Find DirectFB
  1092 CheckDirectFB()
  1093 {
  1094     AC_ARG_ENABLE(video-directfb,
  1095 AC_HELP_STRING([--enable-video-directfb], [use DirectFB video driver [[default=yes]]]),
  1096                   , enable_video_directfb=yes)
  1097     if test x$enable_video = xyes -a x$enable_video_directfb = xyes; then
  1098         video_directfb=no
  1099 
  1100         DIRECTFB_REQUIRED_VERSION=0.9.15
  1101 
  1102         AC_PATH_PROG(DIRECTFBCONFIG, directfb-config, no)
  1103         if test x$DIRECTFBCONFIG = xno; then
  1104             AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
  1105             AC_MSG_CHECKING(for DirectFB $DIRECTFB_REQUIRED_VERSION support)
  1106             if test x$PKG_CONFIG != xno; then
  1107                 if $PKG_CONFIG --atleast-pkgconfig-version 0.7 && $PKG_CONFIG --atleast-version $DIRECTFB_REQUIRED_VERSION directfb; then
  1108                     DIRECTFB_CFLAGS=`$PKG_CONFIG --cflags directfb`
  1109                     DIRECTFB_LIBS=`$PKG_CONFIG --libs directfb`
  1110                     video_directfb=yes
  1111                 fi
  1112             fi
  1113             AC_MSG_RESULT($video_directfb)
  1114         else
  1115             AC_MSG_CHECKING(for DirectFB $DIRECTFB_REQUIRED_VERSION support)
  1116             set -- `echo $DIRECTFB_REQUIRED_VERSION | sed 's/\./ /g'`
  1117             NEED_VERSION=`expr $1 \* 10000 + $2 \* 100 + $3`
  1118             set -- `directfb-config --version | sed 's/\./ /g'`
  1119             HAVE_VERSION=`expr $1 \* 10000 + $2 \* 100 + $3`
  1120             if test $HAVE_VERSION -ge $NEED_VERSION; then
  1121                 DIRECTFB_CFLAGS=`$DIRECTFBCONFIG --cflags`
  1122                 DIRECTFB_LIBS=`$DIRECTFBCONFIG --libs`
  1123                 video_directfb=yes
  1124             fi
  1125             AC_MSG_RESULT($video_directfb)
  1126         fi
  1127 
  1128         if test x$video_directfb = xyes; then
  1129             AC_DEFINE(SDL_VIDEO_DRIVER_DIRECTFB)
  1130             SOURCES="$SOURCES $srcdir/src/video/directfb/*.c"
  1131             EXTRA_CFLAGS="$EXTRA_CFLAGS $DIRECTFB_CFLAGS"
  1132             EXTRA_LDFLAGS="$EXTRA_LDFLAGS $DIRECTFB_LIBS"
  1133             have_video=yes
  1134         fi
  1135     fi
  1136 }
  1137 
  1138 dnl See if we're running on PlayStation 2 hardware
  1139 CheckPS2GS()
  1140 {
  1141     AC_ARG_ENABLE(video-ps2gs,
  1142 AC_HELP_STRING([--enable-video-ps2gs], [use PlayStation 2 GS video driver [[default=yes]]]),
  1143                   , enable_video_ps2gs=yes)
  1144     if test x$enable_video = xyes -a x$enable_video_ps2gs = xyes; then
  1145         AC_MSG_CHECKING(for PlayStation 2 GS support)
  1146         video_ps2gs=no
  1147         AC_TRY_COMPILE([
  1148          #include <linux/ps2/dev.h>
  1149          #include <linux/ps2/gs.h>
  1150         ],[
  1151         ],[
  1152         video_ps2gs=yes
  1153         ])
  1154         AC_MSG_RESULT($video_ps2gs)
  1155         if test x$video_ps2gs = xyes; then
  1156             AC_DEFINE(SDL_VIDEO_DRIVER_PS2GS)
  1157             SOURCES="$SOURCES $srcdir/src/video/ps2gs/*.c"
  1158             have_video=yes
  1159         fi
  1160     fi
  1161 }
  1162 
  1163 dnl Find the SVGAlib includes and libraries
  1164 CheckSVGA()
  1165 {
  1166     AC_ARG_ENABLE(video-svga,
  1167 AC_HELP_STRING([--enable-video-svga], [use SVGAlib video driver [[default=yes]]]),
  1168                   , enable_video_svga=yes)
  1169     if test x$enable_video = xyes -a x$enable_video_svga = xyes; then
  1170         AC_MSG_CHECKING(for SVGAlib (1.4.0+) support)
  1171         video_svga=no
  1172         AC_TRY_COMPILE([
  1173          #include <vga.h>
  1174          #include <vgamouse.h>
  1175          #include <vgakeyboard.h>
  1176         ],[
  1177          if ( SCANCODE_RIGHTWIN && SCANCODE_LEFTWIN ) {
  1178              exit(0);
  1179          }
  1180         ],[
  1181         video_svga=yes
  1182         ])
  1183         AC_MSG_RESULT($video_svga)
  1184         if test x$video_svga = xyes; then
  1185             AC_DEFINE(SDL_VIDEO_DRIVER_SVGALIB)
  1186             SOURCES="$SOURCES $srcdir/src/video/svga/*.c"
  1187             EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lvga"
  1188             have_video=yes
  1189         fi
  1190     fi
  1191 }
  1192 
  1193 dnl Find the VGL includes and libraries
  1194 CheckVGL()
  1195 {
  1196     AC_ARG_ENABLE(video-vgl,
  1197 AC_HELP_STRING([--enable-video-vgl], [use VGL video driver [[default=yes]]]),
  1198                   , enable_video_vgl=yes)
  1199     if test x$enable_video = xyes -a x$enable_video_vgl = xyes; then
  1200         AC_MSG_CHECKING(for libVGL support)
  1201         video_vgl=no
  1202         AC_TRY_COMPILE([
  1203          #include <sys/fbio.h>
  1204          #include <sys/consio.h>
  1205          #include <sys/kbio.h>
  1206          #include <vgl.h>
  1207         ],[
  1208          VGLBitmap bitmap;
  1209          bitmap.Type = VIDBUF32;
  1210          bitmap.PixelBytes = 4;
  1211          exit(bitmap.Bitmap);
  1212         ],[
  1213         video_vgl=yes
  1214         ])
  1215         AC_MSG_RESULT($video_vgl)
  1216         if test x$video_vgl = xyes; then
  1217             AC_DEFINE(SDL_VIDEO_DRIVER_VGL)
  1218             SOURCES="$SOURCES $srcdir/src/video/vgl/*.c"
  1219             EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lvgl"
  1220             have_video=yes
  1221         fi
  1222     fi
  1223 }
  1224 
  1225 dnl Set up the wscons video driver if enabled
  1226 CheckWscons()
  1227 {
  1228     AC_ARG_ENABLE(video-wscons,
  1229 AC_HELP_STRING([--enable-video-wscons], [use wscons video driver [[default=yes]]]),
  1230                   , enable_video_wscons=yes)
  1231     if test x$enable_video = xyes -a x$enable_video_wscons = xyes; then
  1232         AC_MSG_CHECKING(for wscons support)
  1233         video_wscons=no
  1234         AC_TRY_COMPILE([
  1235          #include <sys/time.h>
  1236          #include <dev/wscons/wsconsio.h>
  1237          #include <dev/wscons/wsdisplay_usl_io.h>
  1238         ],[
  1239          int wsmode = WSDISPLAYIO_MODE_DUMBFB;
  1240         ],[
  1241         video_wscons=yes
  1242         ])
  1243         AC_MSG_RESULT($video_wscons)
  1244         if test x$video_wscons = xyes; then
  1245             AC_DEFINE(SDL_VIDEO_DRIVER_WSCONS)
  1246             SOURCES="$SOURCES $srcdir/src/video/wscons/*.c"
  1247             have_video=yes
  1248         fi
  1249     fi
  1250 }
  1251 
  1252 dnl Set up the Atari Bios keyboard driver
  1253 CheckAtariBiosEvent()
  1254 {
  1255     SOURCES="$SOURCES $srcdir/src/video/ataricommon/*.c"
  1256     SOURCES="$SOURCES $srcdir/src/video/ataricommon/*.S"
  1257 }
  1258 
  1259 dnl Set up the Atari Xbios driver
  1260 CheckAtariXbiosVideo()
  1261 {
  1262     AC_ARG_ENABLE(xbios,
  1263 AC_HELP_STRING([--enable-video-xbios], [use Atari Xbios video driver [[default=yes]]]),
  1264                   , enable_video_xbios=yes)
  1265     video_xbios=no
  1266     if test x$enable_video = xyes -a x$enable_video_xbios = xyes; then
  1267         video_xbios=yes
  1268         AC_DEFINE(SDL_VIDEO_DRIVER_XBIOS)
  1269         SOURCES="$SOURCES $srcdir/src/video/xbios/*.c"
  1270         have_video=yes
  1271     fi
  1272 }
  1273 
  1274 dnl Set up the Atari Gem driver
  1275 CheckAtariGemVideo()
  1276 {
  1277     AC_ARG_ENABLE(gem,
  1278 AC_HELP_STRING([--enable-video-gem], [use Atari Gem video driver [[default=yes]]]),
  1279                   , enable_video_gem=yes)
  1280     if test x$enable_video = xyes -a x$enable_video_gem = xyes; then
  1281         video_gem=no
  1282         AC_CHECK_HEADER(gem.h, have_gem_hdr=yes)
  1283         AC_CHECK_LIB(gem, appl_init, have_gem_lib=yes)
  1284         if test x$have_gem_hdr = xyes -a x$have_gem_lib = xyes; then
  1285             video_gem=yes
  1286             AC_DEFINE(SDL_VIDEO_DRIVER_GEM)
  1287             SOURCES="$SOURCES $srcdir/src/video/gem/*.c"
  1288             SDL_LIBS="$SDL_LIBS -lgem"
  1289             have_video=yes
  1290         fi
  1291     fi
  1292 }
  1293 
  1294 dnl rcg04172001 Set up the Null video driver.
  1295 CheckDummyVideo()
  1296 {
  1297     AC_ARG_ENABLE(video-dummy,
  1298 AC_HELP_STRING([--enable-video-dummy], [use dummy video driver [[default=yes]]]),
  1299                   , enable_video_dummy=yes)
  1300     if test x$enable_video_dummy = xyes; then
  1301         AC_DEFINE(SDL_VIDEO_DRIVER_DUMMY)
  1302         SOURCES="$SOURCES $srcdir/src/video/dummy/*.c"
  1303         have_video=yes
  1304     fi
  1305 }
  1306 
  1307 dnl Check to see if OpenGL support is desired
  1308 AC_ARG_ENABLE(video-opengl,
  1309 AC_HELP_STRING([--enable-video-opengl], [include OpenGL support [[default=yes]]]),
  1310               , enable_video_opengl=yes)
  1311 
  1312 dnl Find OpenGL
  1313 CheckOpenGLX11()
  1314 {
  1315     if test x$enable_video = xyes -a x$enable_video_opengl = xyes; then
  1316         AC_MSG_CHECKING(for OpenGL (GLX) support)
  1317         video_opengl=no
  1318         AC_TRY_COMPILE([
  1319          #include <GL/gl.h>
  1320          #include <GL/glx.h>
  1321         ],[
  1322         ],[
  1323         video_opengl=yes
  1324         ])
  1325         AC_MSG_RESULT($video_opengl)
  1326         if test x$video_opengl = xyes; then
  1327             AC_DEFINE(SDL_VIDEO_OPENGL)
  1328             AC_DEFINE(SDL_VIDEO_OPENGL_GLX)
  1329             AC_DEFINE(SDL_VIDEO_RENDER_OGL)
  1330         fi
  1331     fi
  1332 }
  1333 
  1334 dnl Find QNX RtP OpenGL
  1335 CheckOpenGLQNX()
  1336 {
  1337     if test x$enable_video = xyes -a x$enable_video_opengl = xyes; then
  1338         AC_MSG_CHECKING(for OpenGL (Photon) support)
  1339         video_opengl=no
  1340         AC_TRY_COMPILE([
  1341          #include <GL/gl.h>
  1342         ],[
  1343         ],[
  1344         video_opengl=yes
  1345         ])
  1346         AC_MSG_RESULT($video_opengl)
  1347         if test x$video_opengl = xyes; then
  1348             AC_DEFINE(SDL_VIDEO_OPENGL)
  1349             AC_DEFINE(SDL_VIDEO_RENDER_OGL)
  1350             EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lGL"
  1351         fi
  1352     fi
  1353 }
  1354 
  1355 dnl Check for Win32 OpenGL
  1356 CheckWIN32GL()
  1357 {
  1358     if test x$enable_video = xyes -a x$enable_video_opengl = xyes; then
  1359         AC_DEFINE(SDL_VIDEO_OPENGL)
  1360         AC_DEFINE(SDL_VIDEO_OPENGL_WGL)
  1361         AC_DEFINE(SDL_VIDEO_RENDER_OGL)
  1362     fi
  1363 }
  1364 
  1365 dnl Check for BeOS OpenGL
  1366 CheckBeGL()
  1367 {
  1368     if test x$enable_video = xyes -a x$enable_video_opengl = xyes; then
  1369         AC_DEFINE(SDL_VIDEO_OPENGL)
  1370         AC_DEFINE(SDL_VIDEO_OPENGL_BGL)
  1371         AC_DEFINE(SDL_VIDEO_RENDER_OGL)
  1372         EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lGL"
  1373     fi
  1374 }
  1375 
  1376 dnl Check for MacOS OpenGL
  1377 CheckMacGL()
  1378 {
  1379     if test x$enable_video = xyes -a x$enable_video_opengl = xyes; then
  1380         AC_DEFINE(SDL_VIDEO_OPENGL)
  1381         AC_DEFINE(SDL_VIDEO_OPENGL_CGL)
  1382         AC_DEFINE(SDL_VIDEO_RENDER_OGL)
  1383         case "$host" in
  1384             *-*-darwin*)
  1385                 if test x$enable_video_cocoa = xyes; then
  1386                     EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,OpenGL"
  1387                 fi
  1388         esac
  1389     fi
  1390 }
  1391 
  1392 dnl Check for Mesa offscreen rendering
  1393 CheckAtariOSMesa()
  1394 {
  1395     if test "x$enable_video" = "xyes" -a "x$enable_video_opengl" = "xyes"; then
  1396         AC_CHECK_HEADER(GL/osmesa.h, have_osmesa_hdr=yes)
  1397         AC_CHECK_LIB(OSMesa, OSMesaCreateContext, have_osmesa_lib=yes, have_osmesa_lib=no, -lm)
  1398 
  1399         # Static linking to -lOSMesa
  1400         AC_PATH_PROG(OSMESA_CONFIG, osmesa-config, no)
  1401         if test "x$OSMESA_CONFIG" = "xno" -o "x$enable_atari_ldg" = "xno"; then
  1402             # -lOSMesa is really the static library
  1403             if test "x$have_osmesa_hdr" = "xyes" -a "x$have_osmesa_lib" = "xyes"; then
  1404                 OSMESA_LIBS="-lOSMesa"
  1405             fi
  1406         else
  1407             # -lOSMesa is a loader for OSMesa.ldg
  1408             OSMESA_CFLAGS=`$OSMESA_CONFIG --cflags`
  1409             OSMESA_LIBS=`$OSMESA_CONFIG --libs`
  1410         fi
  1411         AC_DEFINE(SDL_VIDEO_OPENGL)
  1412         AC_DEFINE(SDL_VIDEO_OPENGL_OSMESA)
  1413         AC_DEFINE(SDL_VIDEO_RENDER_OGL)
  1414         SDL_CFLAGS="$SDL_CFLAGS $OSMESA_CFLAGS"
  1415         SDL_LIBS="$SDL_LIBS $OSMESA_LIBS"
  1416 
  1417         AC_ARG_ENABLE(osmesa-shared,
  1418 AC_HELP_STRING([--enable-osmesa-shared], [dynamically load OSMesa OpenGL support [[default=yes]]]),
  1419                               , enable_osmesa_shared=yes)
  1420         if test "x$enable_osmesa_shared" = "xyes" -a "x$enable_atari_ldg" = "xyes"; then
  1421             # Dynamic linking
  1422             if test "x$have_osmesa_hdr" = "xyes"; then
  1423                 AC_DEFINE(SDL_VIDEO_OPENGL_OSMESA_DYNAMIC)
  1424             fi
  1425         fi
  1426     fi
  1427 }
  1428 
  1429 dnl See if we can use the new unified event interface in Linux 2.4
  1430 CheckInputEvents()
  1431 {
  1432     dnl Check for Linux 2.4 unified input event interface support
  1433     AC_ARG_ENABLE(input-events,
  1434 AC_HELP_STRING([--enable-input-events], [use Linux 2.4 unified input interface [[default=yes]]]),
  1435                   , enable_input_events=yes)
  1436     if test x$enable_input_events = xyes; then
  1437         AC_MSG_CHECKING(for Linux 2.4 unified input interface)
  1438         use_input_events=no
  1439         AC_TRY_COMPILE([
  1440           #include <linux/input.h>
  1441         ],[
  1442           #ifndef EVIOCGNAME
  1443           #error EVIOCGNAME() ioctl not available
  1444           #endif
  1445         ],[
  1446         use_input_events=yes
  1447         ])
  1448         AC_MSG_RESULT($use_input_events)
  1449         if test x$use_input_events = xyes; then
  1450             AC_DEFINE(SDL_INPUT_LINUXEV)
  1451         fi
  1452     fi
  1453 }
  1454 
  1455 dnl See if we can use the Touchscreen input library
  1456 CheckTslib()
  1457 {
  1458     AC_ARG_ENABLE(input-tslib,
  1459 AC_HELP_STRING([--enable-input-tslib], [use the Touchscreen library for input [[default=yes]]]),
  1460                   , enable_input_tslib=yes)
  1461     if test x$enable_input_tslib = xyes; then
  1462         AC_MSG_CHECKING(for Touchscreen library support)
  1463         enable_input_tslib=no
  1464         AC_TRY_COMPILE([
  1465           #include "tslib.h"
  1466         ],[
  1467         ],[
  1468         enable_input_tslib=yes
  1469         ])
  1470         AC_MSG_RESULT($enable_input_tslib)
  1471         if test x$enable_input_tslib = xyes; then
  1472             AC_DEFINE(SDL_INPUT_TSLIB)
  1473             EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lts"
  1474         fi
  1475     fi
  1476 }
  1477 
  1478 dnl See if we can use GNU pth library for threads
  1479 CheckPTH()
  1480 {
  1481     dnl Check for pth support
  1482     AC_ARG_ENABLE(pth,
  1483 AC_HELP_STRING([--enable-pth], [use GNU pth library for multi-threading [[default=yes]]]),
  1484                   , enable_pth=yes)
  1485     if test x$enable_threads = xyes -a x$enable_pth = xyes; then
  1486         AC_PATH_PROG(PTH_CONFIG, pth-config, no)
  1487         if test "$PTH_CONFIG" = "no"; then
  1488             use_pth=no
  1489         else
  1490             use_pth=yes
  1491         fi
  1492         AC_MSG_CHECKING(pth)
  1493         AC_MSG_RESULT($use_pth)
  1494         if test "x$use_pth" = xyes; then
  1495             AC_DEFINE(SDL_THREAD_PTH)
  1496             SOURCES="$SOURCES $srcdir/src/thread/pth/*.c"
  1497             SOURCES="$SOURCES $srcdir/src/thread/generic/SDL_syssem.c"
  1498             SDL_CFLAGS="$SDL_CFLAGS `$PTH_CONFIG --cflags`"
  1499             SDL_LIBS="$SDL_LIBS `$PTH_CONFIG --libs --all`"
  1500             have_threads=yes
  1501         fi
  1502     fi
  1503 }
  1504 
  1505 dnl See what type of thread model to use on Linux and Solaris
  1506 CheckPTHREAD()
  1507 {
  1508     dnl Check for pthread support
  1509     AC_ARG_ENABLE(pthreads,
  1510 AC_HELP_STRING([--enable-pthreads], [use POSIX threads for multi-threading [[default=yes]]]),
  1511                   , enable_pthreads=yes)
  1512     dnl This is used on Linux for glibc binary compatibility (Doh!)
  1513     AC_ARG_ENABLE(pthread-sem,
  1514 AC_HELP_STRING([--enable-pthread-sem], [use pthread semaphores [[default=yes]]]),
  1515                   , enable_pthread_sem=yes)
  1516     case "$host" in
  1517         *-*-linux*|*-*-uclinux*)
  1518             pthread_cflags="-D_REENTRANT"
  1519             pthread_lib="-lpthread"
  1520             ;;
  1521         *-*-bsdi*)
  1522             pthread_cflags="-D_REENTRANT -D_THREAD_SAFE"
  1523             pthread_lib=""
  1524             ;;
  1525         *-*-darwin*)
  1526             pthread_cflags="-D_THREAD_SAFE"
  1527 # causes Carbon.p complaints?
  1528 #            pthread_cflags="-D_REENTRANT -D_THREAD_SAFE"
  1529             ;;
  1530         *-*-freebsd*|*-*-dragonfly*)
  1531             pthread_cflags="-D_REENTRANT -D_THREAD_SAFE"
  1532             pthread_lib="-pthread"
  1533             ;;
  1534         *-*-netbsd*)
  1535             pthread_cflags="-D_REENTRANT -D_THREAD_SAFE"
  1536             pthread_lib="-L/usr/lib -lpthread"
  1537             ;;
  1538         *-*-openbsd*)
  1539             pthread_cflags="-D_REENTRANT"
  1540             pthread_lib="-pthread"
  1541             ;;
  1542         *-*-solaris*)
  1543             pthread_cflags="-D_REENTRANT"
  1544             pthread_lib="-lpthread -lposix4"
  1545             ;;
  1546         *-*-sysv5*)
  1547             pthread_cflags="-D_REENTRANT -Kthread"
  1548             pthread_lib=""
  1549             ;;
  1550         *-*-irix*)
  1551             pthread_cflags="-D_SGI_MP_SOURCE"
  1552             pthread_lib="-lpthread"
  1553             ;;
  1554         *-*-aix*)
  1555             pthread_cflags="-D_REENTRANT -mthreads"
  1556             pthread_lib="-lpthread"
  1557             ;;
  1558         *-*-hpux11*)
  1559             pthread_cflags="-D_REENTRANT"
  1560             pthread_lib="-L/usr/lib -lpthread"
  1561             ;;
  1562         *-*-qnx*)
  1563             pthread_cflags=""
  1564             pthread_lib=""
  1565             ;;
  1566         *-*-osf*)
  1567             pthread_cflags="-D_REENTRANT"
  1568             if test x$ac_cv_prog_gcc = xyes; then
  1569                 pthread_lib="-lpthread -lrt"
  1570             else
  1571                 pthread_lib="-lpthread -lexc -lrt"
  1572             fi
  1573             ;;
  1574         *)
  1575             pthread_cflags="-D_REENTRANT"
  1576             pthread_lib="-lpthread"
  1577             ;;
  1578     esac
  1579     if test x$enable_threads = xyes -a x$enable_pthreads = xyes -a x$enable_ipod != xyes; then
  1580         # Save the original compiler flags and libraries
  1581         ac_save_cflags="$CFLAGS"; ac_save_libs="$LIBS"
  1582         # Add the pthread compiler flags and libraries
  1583         CFLAGS="$CFLAGS $pthread_cflags"; LIBS="$LIBS $pthread_lib"
  1584         # Check to see if we have pthread support on this system
  1585         AC_MSG_CHECKING(for pthreads)
  1586         use_pthreads=no
  1587         AC_TRY_LINK([
  1588          #include <pthread.h>
  1589         ],[
  1590          pthread_attr_t type;
  1591          pthread_attr_init(&type);
  1592         ],[
  1593         use_pthreads=yes
  1594         ])
  1595         AC_MSG_RESULT($use_pthreads)
  1596         # Restore the compiler flags and libraries
  1597         CFLAGS="$ac_save_cflags"; LIBS="$ac_save_libs"
  1598 
  1599         # Do futher testing if we have pthread support...
  1600         if test x$use_pthreads = xyes; then
  1601             AC_DEFINE(SDL_THREAD_PTHREAD)
  1602             EXTRA_CFLAGS="$EXTRA_CFLAGS $pthread_cflags"
  1603             EXTRA_LDFLAGS="$EXTRA_LDFLAGS $pthread_lib"
  1604             SDL_CFLAGS="$SDL_CFLAGS $pthread_cflags"
  1605             SDL_LIBS="$SDL_LIBS $pthread_lib"
  1606 
  1607             # Save the original compiler flags and libraries
  1608             ac_save_cflags="$CFLAGS"; ac_save_libs="$LIBS"
  1609             # Add the pthread compiler flags and libraries
  1610             CFLAGS="$CFLAGS $pthread_cflags"; LIBS="$LIBS $pthread_lib"
  1611 
  1612             # Check to see if recursive mutexes are available
  1613             AC_MSG_CHECKING(for recursive mutexes)
  1614             has_recursive_mutexes=no
  1615             if test x$has_recursive_mutexes = xno; then
  1616                 AC_TRY_COMPILE([
  1617                   #include <pthread.h>
  1618                 ],[
  1619                   pthread_mutexattr_t attr;
  1620                   pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
  1621                 ],[
  1622                 has_recursive_mutexes=yes
  1623                 AC_DEFINE(SDL_THREAD_PTHREAD_RECURSIVE_MUTEX)
  1624                 ])
  1625             fi
  1626             if test x$has_recursive_mutexes = xno; then
  1627                 AC_TRY_COMPILE([
  1628                   #include <pthread.h>
  1629                 ],[
  1630                   pthread_mutexattr_t attr;
  1631                   pthread_mutexattr_setkind_np(&attr, PTHREAD_MUTEX_RECURSIVE_NP);
  1632                 ],[
  1633                 has_recursive_mutexes=yes
  1634                 AC_DEFINE(SDL_THREAD_PTHREAD_RECURSIVE_MUTEX_NP)
  1635                 ])
  1636             fi
  1637             AC_MSG_RESULT($has_recursive_mutexes)
  1638 
  1639             # Check to see if pthread semaphore support is missing
  1640             if test x$enable_pthread_sem = xyes; then
  1641                 AC_MSG_CHECKING(for pthread semaphores)
  1642                 have_pthread_sem=no
  1643                 AC_TRY_COMPILE([
  1644                   #include <pthread.h>
  1645                   #include <semaphore.h>
  1646                 ],[
  1647                 ],[
  1648                 have_pthread_sem=yes
  1649                 ])
  1650                 AC_MSG_RESULT($have_pthread_sem)
  1651             fi
  1652 
  1653             # Restore the compiler flags and libraries
  1654             CFLAGS="$ac_save_cflags"; LIBS="$ac_save_libs"
  1655 
  1656             # Basic thread creation functions
  1657             SOURCES="$SOURCES $srcdir/src/thread/pthread/SDL_systhread.c"
  1658 
  1659             # Semaphores
  1660             # We can fake these with mutexes and condition variables if necessary
  1661             if test x$have_pthread_sem = xyes; then
  1662                 SOURCES="$SOURCES $srcdir/src/thread/pthread/SDL_syssem.c"
  1663             else
  1664                 SOURCES="$SOURCES $srcdir/src/thread/generic/SDL_syssem.c"
  1665             fi
  1666 
  1667             # Mutexes
  1668             # We can fake these with semaphores if necessary
  1669             SOURCES="$SOURCES $srcdir/src/thread/pthread/SDL_sysmutex.c"
  1670 
  1671             # Condition variables
  1672             # We can fake these with semaphores and mutexes if necessary
  1673             SOURCES="$SOURCES $srcdir/src/thread/pthread/SDL_syscond.c"
  1674 
  1675             have_threads=yes
  1676         else
  1677             CheckPTH
  1678         fi
  1679     fi
  1680 }
  1681 
  1682 dnl Determine whether the compiler can produce Win32 executables
  1683 CheckWIN32()
  1684 {
  1685     AC_MSG_CHECKING(Win32 compiler)
  1686     have_win32_gcc=no
  1687     AC_TRY_COMPILE([
  1688      #include <windows.h>
  1689     ],[
  1690     ],[
  1691     have_win32_gcc=yes
  1692     ])
  1693     AC_MSG_RESULT($have_win32_gcc)
  1694     if test x$have_win32_gcc != xyes; then
  1695        AC_MSG_ERROR([
  1696 *** Your compiler ($CC) does not produce Win32 executables!
  1697        ])
  1698     fi
  1699 
  1700     dnl See if the user wants to redirect standard output to files
  1701     AC_ARG_ENABLE(stdio-redirect,
  1702 AC_HELP_STRING([--enable-stdio-redirect], [Redirect STDIO to files on Win32 [[default=yes]]]),
  1703                   , enable_stdio_redirect=yes)
  1704     if test x$enable_stdio_redirect != xyes; then
  1705         EXTRA_CFLAGS="$EXTRA_CFLAGS -DNO_STDIO_REDIRECT"
  1706     fi
  1707 }
  1708 
  1709 dnl Find the DirectX includes and libraries
  1710 CheckDIRECTX()
  1711 {
  1712     AC_ARG_ENABLE(directx,
  1713 AC_HELP_STRING([--enable-directx], [use DirectX for Win32 audio/video [[default=yes]]]),
  1714                   , enable_directx=yes)
  1715     if test x$enable_directx = xyes; then
  1716         AC_CHECK_HEADER(d3d9.h, have_d3d=yes)
  1717         AC_CHECK_HEADER(dsound.h, have_dsound=yes)
  1718         AC_CHECK_HEADER(dinput.h, use_dinput=yes)
  1719     fi
  1720 }
  1721 
  1722 dnl Check for the dlfcn.h interface for dynamically loading objects
  1723 CheckDLOPEN()
  1724 {
  1725     AC_ARG_ENABLE(sdl-dlopen,
  1726 AC_HELP_STRING([--enable-sdl-dlopen], [use dlopen for shared object loading [[default=yes]]]),
  1727                   , enable_sdl_dlopen=yes)
  1728     if test x$enable_sdl_dlopen = xyes; then
  1729         AC_MSG_CHECKING(for dlopen)
  1730         have_dlopen=no
  1731         AC_TRY_COMPILE([
  1732          #include <dlfcn.h>
  1733         ],[
  1734          #if defined(MAC_OS_X_VERSION_MIN_REQUIRED) && MAC_OS_X_VERSION_MIN_REQUIRED <= 1020
  1735          #error Use dlcompat for Mac OS X 10.2 compatibility
  1736          #endif
  1737         ],[
  1738         have_dlopen=yes
  1739         ])
  1740         AC_MSG_RESULT($have_dlopen)
  1741 
  1742         if test x$have_dlopen = xyes; then
  1743             AC_CHECK_LIB(c, dlopen, EXTRA_LDFLAGS="$EXTRA_LDFLAGS",
  1744                AC_CHECK_LIB(dl, dlopen, EXTRA_LDFLAGS="$EXTRA_LDFLAGS -ldl",
  1745                   AC_CHECK_LIB(ltdl, dlopen, EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lltdl")))
  1746             AC_CHECK_LIB(dl, dlvsym, have_dlvsym=yes)
  1747             if test x$have_dlvsym = xyes; then
  1748                 AC_DEFINE(HAVE_DLVSYM)
  1749             fi
  1750             AC_DEFINE(SDL_LOADSO_DLOPEN)
  1751             SOURCES="$SOURCES $srcdir/src/loadso/dlopen/*.c"
  1752             have_loadso=yes
  1753         fi
  1754     fi
  1755 }
  1756 
  1757 dnl Set up the Atari LDG (shared object loader)
  1758 CheckAtariLdg()
  1759 {
  1760     AC_ARG_ENABLE(atari-ldg,
  1761 AC_HELP_STRING([--enable-atari-ldg], [use Atari LDG for shared object loading [[default=yes]]]),
  1762                   , enable_atari_ldg=yes)
  1763     if test x$video_gem = xyes -a x$enable_atari_ldg = xyes; then
  1764         AC_CHECK_HEADER(ldg.h, have_ldg_hdr=yes)
  1765         AC_CHECK_LIB(ldg, ldg_open, have_ldg_lib=yes, have_ldg_lib=no, -lgem)
  1766         if test x$have_ldg_hdr = xyes -a x$have_ldg_lib = xyes; then
  1767             AC_DEFINE(SDL_LOADSO_LDG)
  1768             SOURCES="$SOURCES $srcdir/src/loadso/mint/*.c"
  1769             SDL_LIBS="$SDL_LIBS -lldg -lgem"
  1770             have_loadso=yes
  1771         fi
  1772     fi
  1773 }
  1774 
  1775 dnl Check for the usbhid(3) library on *BSD
  1776 CheckUSBHID()
  1777 {
  1778     if test x$enable_joystick = xyes; then
  1779         AC_CHECK_LIB(usbhid, hid_init, have_libusbhid=yes)
  1780         if test x$have_libusbhid = xyes; then
  1781             AC_CHECK_HEADER(usbhid.h, [USB_CFLAGS="-DHAVE_USBHID_H"])
  1782             AC_CHECK_HEADER(libusbhid.h, [USB_CFLAGS="-DHAVE_LIBUSBHID_H"])
  1783             USB_LIBS="$USB_LIBS -lusbhid"
  1784         else
  1785             AC_CHECK_HEADER(usb.h, [USB_CFLAGS="-DHAVE_USB_H"])
  1786             AC_CHECK_HEADER(libusb.h, [USB_CFLAGS="-DHAVE_LIBUSB_H"])
  1787             AC_CHECK_LIB(usb, hid_init, [USB_LIBS="$USB_LIBS -lusb"])
  1788         fi
  1789             
  1790         save_CFLAGS="$CFLAGS"
  1791         CFLAGS="$CFLAGS $USB_CFLAGS"
  1792 
  1793         AC_MSG_CHECKING(for usbhid)
  1794         have_usbhid=no
  1795         AC_TRY_COMPILE([
  1796           #include <sys/types.h>
  1797           #if defined(HAVE_USB_H)
  1798           #include <usb.h>
  1799           #endif
  1800           #ifdef __DragonFly__
  1801           # include <bus/usb/usb.h>
  1802           # include <bus/usb/usbhid.h>
  1803           #else
  1804           # include <dev/usb/usb.h>
  1805           # include <dev/usb/usbhid.h>
  1806           #endif
  1807           #if defined(HAVE_USBHID_H)
  1808           #include <usbhid.h>
  1809           #elif defined(HAVE_LIBUSB_H)
  1810           #include <libusb.h>
  1811           #elif defined(HAVE_LIBUSBHID_H)
  1812           #include <libusbhid.h>
  1813           #endif
  1814         ],[
  1815           struct report_desc *repdesc;
  1816           struct usb_ctl_report *repbuf;
  1817           hid_kind_t hidkind;
  1818         ],[
  1819         have_usbhid=yes
  1820         ])
  1821         AC_MSG_RESULT($have_usbhid)
  1822 
  1823         if test x$have_usbhid = xyes; then
  1824             AC_MSG_CHECKING(for ucr_data member of usb_ctl_report)
  1825             have_usbhid_ucr_data=no
  1826             AC_TRY_COMPILE([
  1827               #include <sys/types.h>
  1828               #if defined(HAVE_USB_H)
  1829               #include <usb.h>
  1830               #endif
  1831               #ifdef __DragonFly__
  1832               # include <bus/usb/usb.h>
  1833               # include <bus/usb/usbhid.h>
  1834               #else
  1835               # include <dev/usb/usb.h>
  1836               # include <dev/usb/usbhid.h>
  1837               #endif
  1838               #if defined(HAVE_USBHID_H)
  1839               #include <usbhid.h>
  1840               #elif defined(HAVE_LIBUSB_H)
  1841               #include <libusb.h>
  1842               #elif defined(HAVE_LIBUSBHID_H)
  1843               #include <libusbhid.h>
  1844               #endif
  1845             ],[
  1846               struct usb_ctl_report buf;
  1847               if (buf.ucr_data) { }
  1848             ],[
  1849             have_usbhid_ucr_data=yes
  1850             ])
  1851             if test x$have_usbhid_ucr_data = xyes; then
  1852                 USB_CFLAGS="$USB_CFLAGS -DUSBHID_UCR_DATA"
  1853             fi
  1854             AC_MSG_RESULT($have_usbhid_ucr_data)
  1855             
  1856             AC_MSG_CHECKING(for new usbhid API)
  1857             have_usbhid_new=no
  1858             AC_TRY_COMPILE([
  1859               #include <sys/types.h>
  1860               #if defined(HAVE_USB_H)
  1861               #include <usb.h>
  1862               #endif
  1863               #include <dev/usb/usb.h>
  1864               #include <dev/usb/usbhid.h>
  1865               #if defined(HAVE_USBHID_H)
  1866               #include <usbhid.h>
  1867               #elif defined(HAVE_LIBUSB_H)
  1868               #include <libusb.h>
  1869               #elif defined(HAVE_LIBUSBHID_H)
  1870               #include <libusbhid.h>
  1871               #endif
  1872             ],[
  1873               report_desc_t d;
  1874               hid_start_parse(d, 1, 1);
  1875             ],[
  1876             have_usbhid_new=yes
  1877             ])
  1878             if test x$have_usbhid_new = xyes; then
  1879                 USB_CFLAGS="$USB_CFLAGS -DUSBHID_NEW"
  1880             fi
  1881             AC_MSG_RESULT($have_usbhid_new)
  1882 
  1883             AC_MSG_CHECKING(for struct joystick in machine/joystick.h)
  1884             have_machine_joystick=no
  1885             AC_TRY_COMPILE([
  1886               #include <machine/joystick.h>
  1887             ],[
  1888               struct joystick t;
  1889             ],[
  1890             have_machine_joystick=yes
  1891             ])
  1892             if test x$have_machine_joystick = xyes; then
  1893                 AC_DEFINE(SDL_JOYSTICK_USBHID_MACHINE_JOYSTICK_H)
  1894             fi
  1895             AC_MSG_RESULT($have_machine_joystick)
  1896 
  1897             AC_DEFINE(SDL_JOYSTICK_USBHID)
  1898             SOURCES="$SOURCES $srcdir/src/joystick/bsd/*.c"
  1899             EXTRA_CFLAGS="$EXTRA_CFLAGS $USB_CFLAGS"
  1900             EXTRA_LDFLAGS="$EXTRA_LDFLAGS $USB_LIBS"
  1901             have_joystick=yes
  1902         fi
  1903         CFLAGS="$save_CFLAGS"
  1904     fi
  1905 }
  1906 
  1907 dnl Check for clock_gettime()
  1908 CheckClockGettime()
  1909 {
  1910     AC_ARG_ENABLE(clock_gettime,
  1911 AC_HELP_STRING([--enable-clock_gettime], [use clock_gettime() instead of gettimeofday() on UNIX [[default=no]]]),
  1912                   , enable_clock_gettime=no)
  1913     if test x$enable_clock_gettime = xyes; then
  1914         AC_CHECK_LIB(rt, clock_gettime, have_clock_gettime=yes)
  1915         if test x$have_clock_gettime = xyes; then
  1916             AC_DEFINE(HAVE_CLOCK_GETTIME)
  1917             EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lrt"
  1918         fi
  1919     fi
  1920 }
  1921 
  1922 dnl Check for a valid linux/version.h
  1923 CheckLinuxVersion()
  1924 {
  1925     AC_CHECK_HEADER(linux/version.h, have_linux_version_h=yes)
  1926     if test x$have_linux_version_h = xyes; then
  1927         EXTRA_CFLAGS="$EXTRA_CFLAGS -DHAVE_LINUX_VERSION_H"
  1928     fi
  1929 }
  1930 
  1931 dnl Check if we want to use RPATH
  1932 CheckRPATH()
  1933 {
  1934     AC_ARG_ENABLE(rpath,
  1935 AC_HELP_STRING([--enable-rpath], [use an rpath when linking SDL [[default=yes]]]),
  1936                   , enable_rpath=yes)
  1937 }
  1938 
  1939 dnl Set up the configuration based on the host platform!
  1940 case "$host" in
  1941     arm-*-elf*) # FIXME: Can we get more specific for iPodLinux?
  1942         ARCH=linux
  1943         CheckDummyVideo
  1944         CheckIPod
  1945         # Set up files for the timer library
  1946         if test x$enable_timers = xyes; then
  1947             AC_DEFINE(SDL_TIMER_UNIX)
  1948             SOURCES="$SOURCES $srcdir/src/timer/unix/*.c"
  1949             have_timers=yes
  1950         fi
  1951         ;;
  1952     *-*-linux*|*-*-uclinux*|*-*-gnu*|*-*-k*bsd*-gnu|*-*-bsdi*|*-*-freebsd*|*-*-dragonfly*|*-*-netbsd*|*-*-openbsd*|*-*-sysv5*|*-*-solaris*|*-*-hpux*|*-*-irix*|*-*-aix*|*-*-osf*)
  1953         case "$host" in
  1954             *-*-linux*)         ARCH=linux ;;
  1955             *-*-uclinux*)       ARCH=linux ;;
  1956             *-*-kfreebsd*-gnu)  ARCH=kfreebsd-gnu ;;
  1957             *-*-knetbsd*-gnu)   ARCH=knetbsd-gnu ;;
  1958             *-*-kopenbsd*-gnu)  ARCH=kopenbsd-gnu ;;
  1959             *-*-gnu*)           ARCH=gnu ;; # must be last of the gnu variants
  1960             *-*-bsdi*)          ARCH=bsdi ;;
  1961             *-*-freebsd*)       ARCH=freebsd ;;
  1962             *-*-dragonfly*)     ARCH=freebsd ;;
  1963             *-*-netbsd*)        ARCH=netbsd ;;
  1964             *-*-openbsd*)       ARCH=openbsd ;;
  1965             *-*-sysv5*)         ARCH=sysv5 ;;
  1966             *-*-solaris*)       ARCH=solaris ;;
  1967             *-*-hpux*)          ARCH=hpux ;;
  1968             *-*-irix*)          ARCH=irix ;;
  1969             *-*-aix*)           ARCH=aix ;;
  1970             *-*-osf*)           ARCH=osf ;;
  1971         esac
  1972         CheckVisibilityHidden
  1973         CheckDummyVideo
  1974         CheckDiskAudio
  1975         CheckDummyAudio
  1976         CheckDLOPEN
  1977         CheckNASM
  1978         CheckAltivec
  1979         CheckOSS
  1980         CheckDMEDIA
  1981         CheckMME
  1982         CheckALSA
  1983         CheckARTSC
  1984         CheckESD
  1985         CheckNAS
  1986         CheckX11
  1987         CheckNANOX
  1988         CheckFBCON
  1989         CheckDirectFB
  1990         CheckPS2GS
  1991         CheckSVGA
  1992         CheckVGL
  1993         CheckWscons
  1994         CheckOpenGLX11
  1995         CheckInputEvents
  1996         CheckTslib
  1997         CheckUSBHID
  1998         CheckPTHREAD
  1999         CheckClockGettime
  2000         CheckLinuxVersion
  2001         CheckRPATH
  2002         # Set up files for the audio library
  2003         if test x$enable_audio = xyes; then
  2004           case $ARCH in
  2005             sysv5|solaris|hpux)
  2006                 AC_DEFINE(SDL_AUDIO_DRIVER_SUNAUDIO)
  2007                 SOURCES="$SOURCES $srcdir/src/audio/sun/*.c"
  2008                 have_audio=yes
  2009             ;;
  2010             netbsd|openbsd)
  2011                 AC_DEFINE(SDL_AUDIO_DRIVER_BSD)
  2012                 SOURCES="$SOURCES $srcdir/src/audio/bsd/*.c"
  2013                 have_audio=yes
  2014             ;;
  2015             aix)
  2016                 AC_DEFINE(SDL_AUDIO_DRIVER_PAUD)
  2017                 SOURCES="$SOURCES $srcdir/src/audio/paudio/*.c"
  2018                 have_audio=yes
  2019             ;;
  2020           esac
  2021         fi
  2022         # Set up files for the joystick library
  2023         if test x$enable_joystick = xyes; then
  2024           case $ARCH in
  2025             linux)
  2026                 AC_DEFINE(SDL_JOYSTICK_LINUX)
  2027                 SOURCES="$SOURCES $srcdir/src/joystick/linux/*.c"
  2028                 have_joystick=yes
  2029             ;;
  2030           esac
  2031         fi
  2032         # Set up files for the cdrom library
  2033         if test x$enable_cdrom = xyes; then
  2034           case $ARCH in
  2035             linux|solaris)
  2036                 AC_DEFINE(SDL_CDROM_LINUX)
  2037                 SOURCES="$SOURCES $srcdir/src/cdrom/linux/*.c"
  2038                 have_cdrom=yes
  2039             ;;
  2040             *freebsd*)
  2041                 AC_DEFINE(SDL_CDROM_FREEBSD)
  2042                 SOURCES="$SOURCES $srcdir/src/cdrom/freebsd/*.c"
  2043                 have_cdrom=yes
  2044             ;;
  2045             *openbsd*|*netbsd*)
  2046                 AC_DEFINE(SDL_CDROM_OPENBSD)
  2047                 SOURCES="$SOURCES $srcdir/src/cdrom/openbsd/*.c"
  2048                 have_cdrom=yes
  2049             ;;
  2050             bsdi)
  2051                 AC_DEFINE(SDL_CDROM_BSDI)
  2052                 SOURCES="$SOURCES $srcdir/src/cdrom/bsdi/*.c"
  2053                 have_cdrom=yes
  2054             ;;
  2055             aix)
  2056                 AC_DEFINE(SDL_CDROM_AIX)
  2057                 SOURCES="$SOURCES $srcdir/src/cdrom/aix/*.c"
  2058                 have_cdrom=yes
  2059             ;;
  2060             osf)
  2061                 AC_DEFINE(SDL_CDROM_OSF)
  2062                 SOURCES="$SOURCES $srcdir/src/cdrom/osf/*.c"
  2063                 have_cdrom=yes
  2064             ;;
  2065           esac
  2066         fi
  2067         # Set up files for the thread library
  2068         if test x$enable_threads = xyes -a x$use_pthreads != xyes -a x$use_pth != xyes -a x$ARCH = xirix; then
  2069             AC_DEFINE(SDL_THREAD_SPROC)
  2070             SOURCES="$SOURCES $srcdir/src/thread/irix/*.c"
  2071             SOURCES="$SOURCES $srcdir/src/thread/generic/SDL_sysmutex.c"
  2072             SOURCES="$SOURCES $srcdir/src/thread/generic/SDL_syscond.c"
  2073             have_threads=yes
  2074         fi
  2075         # Set up files for the timer library
  2076         if test x$enable_timers = xyes; then
  2077             AC_DEFINE(SDL_TIMER_UNIX)
  2078             SOURCES="$SOURCES $srcdir/src/timer/unix/*.c"
  2079             have_timers=yes
  2080         fi
  2081         ;;
  2082     *-*-qnx*)
  2083         ARCH=qnx
  2084         CheckDummyVideo
  2085         CheckDiskAudio
  2086         CheckDummyAudio
  2087         # CheckNASM
  2088         CheckDLOPEN
  2089         CheckNAS
  2090         CheckPHOTON
  2091         CheckX11
  2092         CheckOpenGLX11
  2093         CheckPTHREAD
  2094         # Set up files for the audio library
  2095         if test x$enable_audio = xyes; then
  2096             AC_DEFINE(SDL_AUDIO_DRIVER_QNXNTO)
  2097             SOURCES="$SOURCES $srcdir/src/audio/nto/*.c"
  2098             EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lasound"
  2099             have_audio=yes
  2100         fi
  2101         # Set up files for the cdrom library
  2102         if test x$enable_cdrom = xyes; then
  2103             AC_DEFINE(SDL_CDROM_QNX)
  2104             SOURCES="$SOURCES $srcdir/src/cdrom/qnx/*.c"
  2105             have_cdrom=yes
  2106         fi
  2107         # Set up files for the timer library
  2108         if test x$enable_timers = xyes; then
  2109             AC_DEFINE(SDL_TIMER_UNIX)
  2110             SOURCES="$SOURCES $srcdir/src/timer/unix/*.c"
  2111             have_timers=yes
  2112         fi
  2113         ;;
  2114     *-*-cygwin* | *-*-mingw32*)
  2115         ARCH=win32
  2116         if test "$build" != "$host"; then # cross-compiling
  2117             # Default cross-compile location
  2118             ac_default_prefix=/usr/local/cross-tools/i386-mingw32msvc
  2119         else
  2120             # Look for the location of the tools and install there
  2121             if test "$BUILD_PREFIX" != ""; then
  2122                 ac_default_prefix=$BUILD_PREFIX
  2123             fi
  2124         fi
  2125         CheckDummyVideo
  2126         CheckDiskAudio
  2127         CheckDummyAudio
  2128         CheckWIN32
  2129         CheckWIN32GL
  2130         CheckDIRECTX
  2131         CheckNASM
  2132         # Set up files for the video library
  2133         if test x$enable_video = xyes; then
  2134             AC_DEFINE(SDL_VIDEO_DRIVER_WIN32)
  2135             SOURCES="$SOURCES $srcdir/src/video/win32/*.c"
  2136             have_video=yes
  2137             AC_ARG_ENABLE(render-gdi,
  2138 AC_HELP_STRING([--enable-render-gdi], [enable the GDI render driver [[default=yes]]]),
  2139                                 , enable_render_gdi=yes)
  2140             if test x$enable_render_gdi = xyes; then
  2141                 AC_DEFINE(SDL_VIDEO_RENDER_GDI)
  2142             fi
  2143             AC_ARG_ENABLE(render-d3d,
  2144 AC_HELP_STRING([--enable-render-d3d], [enable the Direct3D render driver [[default=yes]]]),
  2145                                 , enable_render_d3d=yes)
  2146             if test x$enable_render_d3d = xyes -a x$have_d3d = xyes; then
  2147                 AC_DEFINE(SDL_VIDEO_RENDER_D3D)
  2148             fi
  2149         fi
  2150         # Set up files for the audio library
  2151         if test x$enable_audio = xyes; then
  2152             AC_DEFINE(SDL_AUDIO_DRIVER_WAVEOUT)
  2153             SOURCES="$SOURCES $srcdir/src/audio/windib/*.c"
  2154             if test x$have_dsound = xyes; then
  2155                 AC_DEFINE(SDL_AUDIO_DRIVER_DSOUND)
  2156                 SOURCES="$SOURCES $srcdir/src/audio/windx5/*.c"
  2157             fi
  2158             have_audio=yes
  2159         fi
  2160         # Set up files for the joystick library
  2161         if test x$enable_joystick = xyes; then
  2162             if test x$have_dinput = xyes; then
  2163                 AC_DEFINE(SDL_JOYSTICK_DINPUT)
  2164                 SOURCES="$SOURCES $srcdir/src/joystick/win32/SDL_dxjoystick.c"
  2165             else
  2166                 AC_DEFINE(SDL_JOYSTICK_WINMM)
  2167                 SOURCES="$SOURCES $srcdir/src/joystick/win32/SDL_mmjoystick.c"
  2168             fi
  2169             have_joystick=yes
  2170         fi
  2171         # Set up files for the cdrom library
  2172         if test x$enable_cdrom = xyes; then
  2173             AC_DEFINE(SDL_CDROM_WIN32)
  2174             SOURCES="$SOURCES $srcdir/src/cdrom/win32/*.c"
  2175             have_cdrom=yes
  2176         fi
  2177         # Set up files for the thread library
  2178         if test x$enable_threads = xyes; then
  2179             AC_DEFINE(SDL_THREAD_WIN32)
  2180             SOURCES="$SOURCES $srcdir/src/thread/win32/SDL_sysmutex.c"
  2181             SOURCES="$SOURCES $srcdir/src/thread/win32/SDL_syssem.c"
  2182             SOURCES="$SOURCES $srcdir/src/thread/win32/SDL_systhread.c"
  2183             SOURCES="$SOURCES $srcdir/src/thread/generic/SDL_syscond.c"
  2184             have_threads=yes
  2185         fi
  2186         # Set up files for the timer library
  2187         if test x$enable_timers = xyes; then
  2188             AC_DEFINE(SDL_TIMER_WIN32)
  2189             SOURCES="$SOURCES $srcdir/src/timer/win32/*.c"
  2190             have_timers=yes
  2191         fi
  2192         # Set up files for the shared object loading library
  2193         if test x$enable_loadso = xyes; then
  2194             AC_DEFINE(SDL_LOADSO_WIN32)
  2195             SOURCES="$SOURCES $srcdir/src/loadso/win32/*.c"
  2196             have_loadso=yes
  2197         fi
  2198         # Set up the system libraries we need
  2199         EXTRA_LDFLAGS="$EXTRA_LDFLAGS -luser32 -lgdi32 -lmsimg32 -lwinmm"
  2200         # The Win32 platform requires special setup
  2201         SDLMAIN_SOURCES="$srcdir/src/main/win32/*.c"
  2202         SDL_CFLAGS="$SDL_CFLAGS -Dmain=SDL_main"
  2203         SDL_LIBS="-lmingw32 -lSDLmain $SDL_LIBS -mwindows"
  2204         ;;
  2205     *-*-beos*)
  2206         ARCH=beos
  2207         ac_default_prefix=/boot/develop/tools/gnupro
  2208         CheckDummyVideo
  2209         CheckDiskAudio
  2210         CheckDummyAudio
  2211         CheckNASM
  2212         CheckBWINDOW
  2213         CheckBeGL
  2214         # Set up files for the audio library
  2215         if test x$enable_audio = xyes; then
  2216             AC_DEFINE(SDL_AUDIO_DRIVER_BAUDIO)
  2217             SOURCES="$SOURCES $srcdir/src/audio/baudio/*.cc"
  2218             have_audio=yes
  2219         fi
  2220         # Set up files for the joystick library
  2221         if test x$enable_joystick = xyes; then
  2222             AC_DEFINE(SDL_JOYSTICK_BEOS)
  2223             SOURCES="$SOURCES $srcdir/src/joystick/beos/*.cc"
  2224             have_joystick=yes
  2225         fi
  2226         # Set up files for the cdrom library
  2227         if test x$enable_cdrom = xyes; then
  2228             AC_DEFINE(SDL_CDROM_BEOS)
  2229             SOURCES="$SOURCES $srcdir/src/cdrom/beos/*.cc"
  2230             have_cdrom=yes
  2231         fi
  2232         # Set up files for the thread library
  2233         if test x$enable_threads = xyes; then
  2234             AC_DEFINE(SDL_THREAD_BEOS)
  2235             SOURCES="$SOURCES $srcdir/src/thread/beos/*.c"
  2236             SOURCES="$SOURCES $srcdir/src/thread/generic/SDL_sysmutex.c"
  2237             SOURCES="$SOURCES $srcdir/src/thread/generic/SDL_syscond.c"
  2238             have_threads=yes
  2239         fi
  2240         # Set up files for the timer library
  2241         if test x$enable_timers = xyes; then
  2242             AC_DEFINE(SDL_TIMER_BEOS)
  2243             SOURCES="$SOURCES $srcdir/src/timer/beos/*.c"
  2244             have_timers=yes
  2245         fi
  2246         # Set up files for the shared object loading library
  2247         if test x$enable_loadso = xyes; then
  2248             AC_DEFINE(SDL_LOADSO_BEOS)
  2249             SOURCES="$SOURCES $srcdir/src/loadso/beos/*.c"
  2250             have_loadso=yes
  2251         fi
  2252         # The BeOS platform requires special setup.
  2253         SOURCES="$srcdir/src/main/beos/*.cc $SOURCES"
  2254         EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lroot -lbe -lmedia -lgame -ldevice -ltextencoding"
  2255         ;;
  2256     *-*-darwin* )
  2257         # This could be either full "Mac OS X", or plain "Darwin" which is
  2258         # just the OS X kernel sans upper layers like Carbon and Cocoa.
  2259         # Next line is broken, and a few files below require Mac OS X (full)
  2260         ARCH=macosx
  2261 
  2262         # Mac OS X builds with both the Carbon and OSX APIs at the moment
  2263         EXTRA_CFLAGS="$EXTRA_CFLAGS -DTARGET_API_MAC_CARBON"
  2264         EXTRA_CFLAGS="$EXTRA_CFLAGS -DTARGET_API_MAC_OSX"
  2265 
  2266         # HACK: Reset EXTRA_LDFLAGS; the only thing it contains at this point
  2267         # is -lm which is not needed under Mac OS X. But for some reasons it
  2268         # also tends to contain spurious -L switches, which we don't want to
  2269         # use here or in sdl-config. Hence we reset it.
  2270         EXTRA_LDFLAGS=""
  2271 
  2272         CheckVisibilityHidden
  2273         CheckDummyVideo
  2274         CheckDiskAudio
  2275         CheckDummyAudio
  2276         CheckDLOPEN
  2277 
  2278         # Temporarily disabled:
  2279         # ld: mmxp2_32.o has external relocation entries in non-writable section (__TEXT,__text) for symbols: _mmxreturn
  2280         #CheckNASM
  2281 
  2282         # Set up files for the shared object loading library
  2283         # (this needs to be done before the dynamic X11 check)
  2284         if test x$enable_loadso = xyes -a x$have_dlopen != xyes; then
  2285             AC_DEFINE(SDL_LOADSO_DLCOMPAT)
  2286             SOURCES="$SOURCES $srcdir/src/loadso/macosx/*.c"
  2287             have_loadso=yes
  2288         fi
  2289 
  2290         CheckCOCOA
  2291         CheckX11
  2292         CheckMacGL
  2293         CheckOpenGLX11
  2294         CheckPTHREAD
  2295         CheckAltivec
  2296 
  2297         # Need this or things might misbuild on a G3.
  2298         EXTRA_CFLAGS="$EXTRA_CFLAGS -force_cpusubtype_ALL"
  2299 
  2300         # Set up files for the audio library
  2301         if test x$enable_audio = xyes; then
  2302             AC_DEFINE(SDL_AUDIO_DRIVER_COREAUDIO)
  2303             SOURCES="$SOURCES $srcdir/src/audio/macosx/*.c"
  2304             AC_DEFINE(SDL_AUDIO_DRIVER_SNDMGR)
  2305             SOURCES="$SOURCES $srcdir/src/audio/macrom/*.c"
  2306             have_audio=yes
  2307         fi
  2308         # Set up files for the joystick library
  2309         if test x$enable_joystick = xyes; then
  2310             AC_DEFINE(SDL_JOYSTICK_IOKIT)
  2311             SOURCES="$SOURCES $srcdir/src/joystick/darwin/*.c"
  2312             EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,IOKit"
  2313             have_joystick=yes
  2314         fi
  2315         # Set up files for the cdrom library
  2316         if test x$enable_cdrom = xyes; then
  2317             AC_DEFINE(SDL_CDROM_MACOSX)
  2318             SOURCES="$SOURCES $srcdir/src/cdrom/macosx/*.c"
  2319             have_cdrom=yes
  2320         fi
  2321         # Set up files for the timer library
  2322         if test x$enable_timers = xyes; then
  2323             AC_DEFINE(SDL_TIMER_UNIX)
  2324             SOURCES="$SOURCES $srcdir/src/timer/unix/*.c"
  2325             have_timers=yes
  2326         fi
  2327         # The Mac OS X platform requires special setup.
  2328         EXTRA_CFLAGS="$EXTRA_CFLAGS -fpascal-strings"
  2329         EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,Cocoa"
  2330         EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,Carbon"
  2331         # If either the audio or CD driver is used, add the AudioUnit framework
  2332         if test x$enable_audio = xyes -o x$enable_cdrom = xyes; then
  2333             EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,CoreAudio -framework,AudioToolbox -Wl,-framework,AudioUnit"
  2334         fi
  2335         ;;
  2336     *-*-mint*)
  2337         ARCH=mint
  2338         CheckDummyVideo
  2339         CheckDiskAudio
  2340         CheckDummyAudio
  2341         CheckAtariBiosEvent
  2342         CheckAtariXbiosVideo
  2343         CheckAtariGemVideo
  2344         CheckAtariAudio
  2345         CheckAtariLdg
  2346         CheckAtariOSMesa
  2347         CheckPTH
  2348         # Set up files for the audio library
  2349         if test x$enable_threads = xyes -a x$enable_pth = xyes; then
  2350             if test x$enable_audio = xyes; then
  2351                 AC_DEFINE(SDL_AUDIO_DRIVER_SUNAUDIO)
  2352                 SOURCES="$SOURCES $srcdir/src/audio/sun/*.c"
  2353                 have_audio=yes
  2354             fi
  2355         fi
  2356         # Set up files for the joystick library
  2357         if test x$enable_joystick = xyes; then
  2358             AC_DEFINE(SDL_JOYSTICK_MINT)
  2359             SOURCES="$SOURCES $srcdir/src/joystick/mint/*.c"
  2360             have_joystick=yes
  2361         fi
  2362         # Set up files for the cdrom library
  2363         if test x$enable_cdrom = xyes; then
  2364             AC_DEFINE(SDL_CDROM_MINT)
  2365             SOURCES="$SOURCES $srcdir/src/cdrom/mint/*.c"
  2366             have_cdrom=yes
  2367         fi
  2368         # Set up files for the timer library
  2369         if test x$enable_timers = xyes; then
  2370             if test x$enable_threads = xyes -a x$enable_pth = xyes; then
  2371                 AC_DEFINE(SDL_TIMER_UNIX)
  2372                 SOURCES="$SOURCES $srcdir/src/timer/unix/*.c"
  2373             else
  2374                 AC_DEFINE(SDL_TIMER_MINT)
  2375                 SOURCES="$SOURCES $srcdir/src/timer/mint/*.c"
  2376                 SOURCES="$SOURCES $srcdir/src/timer/mint/*.S"
  2377             fi
  2378             have_timers=yes
  2379         fi
  2380         ;;
  2381     *-riscos)
  2382         ARCH=riscos
  2383         CheckOSS
  2384         CheckPTHREAD
  2385         # Set up files for the video library
  2386         if test x$enable_video = xyes; then
  2387             AC_DEFINE(SDL_VIDEO_DRIVER_RISCOS)
  2388             SOURCES="$SOURCES $srcdir/src/video/riscos/*.c"
  2389             SOURCES="$SOURCES $srcdir/src/video/riscos/*.S"
  2390             have_video=yes
  2391         fi
  2392         # Set up files for the joystick library
  2393         if test x$enable_joystick = xyes; then
  2394             AC_DEFINE(SDL_JOYSTICK_RISCOS)
  2395             SOURCES="$SOURCES $srcdir/src/joystick/riscos/*.c"
  2396             have_joystick=yes
  2397         fi
  2398         # Set up files for the timer library
  2399         if test x$enable_timers = xyes; then
  2400             AC_DEFINE(SDL_TIMER_RISCOS)
  2401             SOURCES="$SOURCES $srcdir/src/timer/riscos/*.c"
  2402             have_timers=yes
  2403         fi
  2404         # The RISC OS platform requires special setup.
  2405         EXTRA_LDFLAGS="$EXTRA_LDFLAGS -ljpeg -ltiff -lpng -lz"
  2406         ;;
  2407     *)
  2408         AC_MSG_ERROR([
  2409 *** Unsupported host:  Please add to configure.in
  2410         ])
  2411         ;;
  2412 esac
  2413 
  2414 # Verify that we have all the platform specific files we need
  2415 if test x$have_joystick != xyes; then
  2416     if test x$enable_joystick = xyes; then
  2417         AC_DEFINE(SDL_JOYSTICK_DISABLED)
  2418     fi
  2419     SOURCES="$SOURCES $srcdir/src/joystick/dummy/*.c"
  2420 fi
  2421 if test x$have_cdrom != xyes; then
  2422     if test x$enable_cdrom = xyes; then
  2423         AC_DEFINE(SDL_CDROM_DISABLED)
  2424     fi
  2425     SOURCES="$SOURCES $srcdir/src/cdrom/dummy/*.c"
  2426 fi
  2427 if test x$have_threads != xyes; then
  2428     if test x$enable_threads = xyes; then
  2429         AC_DEFINE(SDL_THREADS_DISABLED)
  2430     fi
  2431     SOURCES="$SOURCES $srcdir/src/thread/generic/*.c"
  2432 fi
  2433 if test x$have_timers != xyes; then
  2434     if test x$enable_timers = xyes; then
  2435         AC_DEFINE(SDL_TIMERS_DISABLED)
  2436     fi
  2437     SOURCES="$SOURCES $srcdir/src/timer/dummy/*.c"
  2438 fi
  2439 if test x$have_loadso != xyes; then
  2440     if test x$enable_loadso = xyes; then
  2441         AC_DEFINE(SDL_LOADSO_DISABLED)
  2442     fi
  2443     SOURCES="$SOURCES $srcdir/src/loadso/dummy/*.c"
  2444 fi
  2445 if test x$SDLMAIN_SOURCES = x; then
  2446     SDLMAIN_SOURCES="$srcdir/src/main/dummy/*.c"
  2447 fi
  2448 
  2449 OBJECTS=`echo $SOURCES | sed 's,[[^ ]]*/\([[^ ]]*\)\.asm,$(objects)/\1.lo,g'`
  2450 OBJECTS=`echo $OBJECTS | sed 's,[[^ ]]*/\([[^ ]]*\)\.cc,$(objects)/\1.lo,g'`
  2451 OBJECTS=`echo $OBJECTS | sed 's,[[^ ]]*/\([[^ ]]*\)\.m,$(objects)/\1.lo,g'`
  2452 OBJECTS=`echo $OBJECTS | sed 's,[[^ ]]*/\([[^ ]]*\)\.c,$(objects)/\1.lo,g'`
  2453 OBJECTS=`echo $OBJECTS | sed 's,[[^ ]]*/\([[^ ]]*\)\.S,$(objects)/\1.lo,g'`
  2454 
  2455 SDLMAIN_OBJECTS=`echo $SDLMAIN_SOURCES | sed 's,[[^ ]]*/\([[^ ]]*\)\.cc,$(objects)/\1.o,g'`
  2456 SDLMAIN_OBJECTS=`echo $SDLMAIN_OBJECTS | sed 's,[[^ ]]*/\([[^ ]]*\)\.c,$(objects)/\1.o,g'`
  2457 
  2458 # Set runtime shared library paths as needed
  2459 
  2460 if test "x$enable_rpath" = "xyes"; then
  2461   if test $ARCH = bsdi -o $ARCH = freebsd -o $ARCH = irix -o $ARCH = linux -o $ARCH = netbsd; then
  2462     SDL_RLD_FLAGS="-Wl,-rpath,\${libdir}"
  2463   fi
  2464   if test $ARCH = solaris; then
  2465     SDL_RLD_FLAGS="-R\${libdir}"
  2466   fi
  2467 else
  2468   SDL_RLD_FLAGS=""
  2469 fi
  2470 
  2471 case "$ARCH" in
  2472   macosx)
  2473     # Evil hack to allow static linking on Mac OS X
  2474     SDL_STATIC_LIBS="\${libdir}/libSDL.a $EXTRA_LDFLAGS"
  2475     ;;
  2476   *)
  2477     SDL_STATIC_LIBS="$SDL_LIBS"
  2478     ;;
  2479 esac
  2480 
  2481 dnl Expand the cflags and libraries needed by apps using SDL
  2482 AC_SUBST(SDL_CFLAGS)
  2483 AC_SUBST(SDL_LIBS)
  2484 AC_SUBST(SDL_STATIC_LIBS)
  2485 AC_SUBST(SDL_RLD_FLAGS)
  2486 if test x$enable_shared = xyes; then
  2487     ENABLE_SHARED_TRUE=
  2488     ENABLE_SHARED_FALSE="#"
  2489 else
  2490     ENABLE_SHARED_TRUE="#"
  2491     ENABLE_SHARED_FALSE=
  2492 fi
  2493 if test x$enable_static = xyes; then
  2494     ENABLE_STATIC_TRUE=
  2495     ENABLE_STATIC_FALSE="#"
  2496 else
  2497     ENABLE_STATIC_TRUE="#"
  2498     ENABLE_STATIC_FALSE=
  2499 fi
  2500 AC_SUBST(ENABLE_SHARED_TRUE)
  2501 AC_SUBST(ENABLE_SHARED_FALSE)
  2502 AC_SUBST(ENABLE_STATIC_TRUE)
  2503 AC_SUBST(ENABLE_STATIC_FALSE)
  2504 
  2505 dnl Expand the sources and objects needed to build the library
  2506 AC_SUBST(ac_aux_dir)
  2507 AC_SUBST(INCLUDE)
  2508 AC_SUBST(SOURCES)
  2509 AC_SUBST(OBJECTS)
  2510 AC_SUBST(SDLMAIN_SOURCES)
  2511 AC_SUBST(SDLMAIN_OBJECTS)
  2512 AC_SUBST(BUILD_CFLAGS)
  2513 AC_SUBST(EXTRA_CFLAGS)
  2514 AC_SUBST(BUILD_LDFLAGS)
  2515 AC_SUBST(EXTRA_LDFLAGS)
  2516 
  2517 AC_OUTPUT([
  2518     Makefile sdl-config SDL.spec SDL.qpg sdl.pc
  2519 ], [
  2520     : >build-deps
  2521     if test x"$MAKE" = x; then MAKE=make; fi; $MAKE depend
  2522 ])