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