configure.in
author Sam Lantinga <slouken@libsdl.org>
Tue, 13 Oct 2009 04:23:34 +0000
branchSDL-1.2
changeset 4326 a156aea07417
parent 4325 df4108bfbe1e
child 4327 2b6e3b42f80f
permissions -rw-r--r--
We don't need dlvsym() for ALSA anymore, yay!
     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_DEFINE(SDL_LOADSO_DLOPEN)
  2129             SOURCES="$SOURCES $srcdir/src/loadso/dlopen/*.c"
  2130             have_loadso=yes
  2131         fi
  2132     fi
  2133 }
  2134 
  2135 dnl Set up the Atari LDG (shared object loader)
  2136 CheckAtariLdg()
  2137 {
  2138     AC_ARG_ENABLE(atari-ldg,
  2139 AC_HELP_STRING([--enable-atari-ldg], [use Atari LDG for shared object loading [[default=yes]]]),
  2140                   , enable_atari_ldg=yes)
  2141     if test x$video_gem = xyes -a x$enable_atari_ldg = xyes; then
  2142         AC_CHECK_HEADER(ldg.h, have_ldg_hdr=yes)
  2143         AC_CHECK_LIB(ldg, ldg_open, have_ldg_lib=yes, have_ldg_lib=no, -lgem)
  2144         if test x$have_ldg_hdr = xyes -a x$have_ldg_lib = xyes; then
  2145             AC_DEFINE(SDL_LOADSO_LDG)
  2146             SOURCES="$SOURCES $srcdir/src/loadso/mint/*.c"
  2147             SDL_LIBS="$SDL_LIBS -lldg -lgem"
  2148             have_loadso=yes
  2149         fi
  2150     fi
  2151 }
  2152 
  2153 dnl Check for the usbhid(3) library on *BSD
  2154 CheckUSBHID()
  2155 {
  2156     if test x$enable_joystick = xyes; then
  2157         AC_CHECK_LIB(usbhid, hid_init, have_libusbhid=yes)
  2158         if test x$have_libusbhid = xyes; then
  2159             AC_CHECK_HEADER(usbhid.h, [USB_CFLAGS="-DHAVE_USBHID_H"])
  2160             AC_CHECK_HEADER(libusbhid.h, [USB_CFLAGS="-DHAVE_LIBUSBHID_H"])
  2161             USB_LIBS="$USB_LIBS -lusbhid"
  2162         else
  2163             AC_CHECK_HEADER(usb.h, [USB_CFLAGS="-DHAVE_USB_H"])
  2164             AC_CHECK_HEADER(libusb.h, [USB_CFLAGS="-DHAVE_LIBUSB_H"])
  2165             AC_CHECK_LIB(usb, hid_init, [USB_LIBS="$USB_LIBS -lusb"])
  2166         fi
  2167             
  2168         save_CFLAGS="$CFLAGS"
  2169         CFLAGS="$CFLAGS $USB_CFLAGS"
  2170 
  2171         AC_MSG_CHECKING(for usbhid)
  2172         have_usbhid=no
  2173         AC_TRY_COMPILE([
  2174           #include <sys/types.h>
  2175           #if defined(HAVE_USB_H)
  2176           #include <usb.h>
  2177           #endif
  2178           #ifdef __DragonFly__
  2179           # include <bus/usb/usb.h>
  2180           # include <bus/usb/usbhid.h>
  2181           #else
  2182           # include <dev/usb/usb.h>
  2183           # include <dev/usb/usbhid.h>
  2184           #endif
  2185           #if defined(HAVE_USBHID_H)
  2186           #include <usbhid.h>
  2187           #elif defined(HAVE_LIBUSB_H)
  2188           #include <libusb.h>
  2189           #elif defined(HAVE_LIBUSBHID_H)
  2190           #include <libusbhid.h>
  2191           #endif
  2192         ],[
  2193           struct report_desc *repdesc;
  2194           struct usb_ctl_report *repbuf;
  2195           hid_kind_t hidkind;
  2196         ],[
  2197         have_usbhid=yes
  2198         ])
  2199         AC_MSG_RESULT($have_usbhid)
  2200 
  2201         if test x$have_usbhid = xyes; then
  2202             AC_MSG_CHECKING(for ucr_data member of usb_ctl_report)
  2203             have_usbhid_ucr_data=no
  2204             AC_TRY_COMPILE([
  2205               #include <sys/types.h>
  2206               #if defined(HAVE_USB_H)
  2207               #include <usb.h>
  2208               #endif
  2209               #ifdef __DragonFly__
  2210               # include <bus/usb/usb.h>
  2211               # include <bus/usb/usbhid.h>
  2212               #else
  2213               # include <dev/usb/usb.h>
  2214               # include <dev/usb/usbhid.h>
  2215               #endif
  2216               #if defined(HAVE_USBHID_H)
  2217               #include <usbhid.h>
  2218               #elif defined(HAVE_LIBUSB_H)
  2219               #include <libusb.h>
  2220               #elif defined(HAVE_LIBUSBHID_H)
  2221               #include <libusbhid.h>
  2222               #endif
  2223             ],[
  2224               struct usb_ctl_report buf;
  2225               if (buf.ucr_data) { }
  2226             ],[
  2227             have_usbhid_ucr_data=yes
  2228             ])
  2229             if test x$have_usbhid_ucr_data = xyes; then
  2230                 USB_CFLAGS="$USB_CFLAGS -DUSBHID_UCR_DATA"
  2231             fi
  2232             AC_MSG_RESULT($have_usbhid_ucr_data)
  2233             
  2234             AC_MSG_CHECKING(for new usbhid API)
  2235             have_usbhid_new=no
  2236             AC_TRY_COMPILE([
  2237               #include <sys/types.h>
  2238               #if defined(HAVE_USB_H)
  2239               #include <usb.h>
  2240               #endif
  2241               #ifdef __DragonFly__
  2242               #include <bus/usb/usb.h>
  2243               #include <bus/usb/usbhid.h>
  2244               #else
  2245               #include <dev/usb/usb.h>
  2246               #include <dev/usb/usbhid.h>
  2247               #endif
  2248               #if defined(HAVE_USBHID_H)
  2249               #include <usbhid.h>
  2250               #elif defined(HAVE_LIBUSB_H)
  2251               #include <libusb.h>
  2252               #elif defined(HAVE_LIBUSBHID_H)
  2253               #include <libusbhid.h>
  2254               #endif
  2255             ],[
  2256               report_desc_t d;
  2257               hid_start_parse(d, 1, 1);
  2258             ],[
  2259             have_usbhid_new=yes
  2260             ])
  2261             if test x$have_usbhid_new = xyes; then
  2262                 USB_CFLAGS="$USB_CFLAGS -DUSBHID_NEW"
  2263             fi
  2264             AC_MSG_RESULT($have_usbhid_new)
  2265 
  2266             AC_MSG_CHECKING(for struct joystick in machine/joystick.h)
  2267             have_machine_joystick=no
  2268             AC_TRY_COMPILE([
  2269               #include <machine/joystick.h>
  2270             ],[
  2271               struct joystick t;
  2272             ],[
  2273             have_machine_joystick=yes
  2274             ])
  2275             if test x$have_machine_joystick = xyes; then
  2276                 AC_DEFINE(SDL_JOYSTICK_USBHID_MACHINE_JOYSTICK_H)
  2277             fi
  2278             AC_MSG_RESULT($have_machine_joystick)
  2279 
  2280             AC_DEFINE(SDL_JOYSTICK_USBHID)
  2281             SOURCES="$SOURCES $srcdir/src/joystick/bsd/*.c"
  2282             EXTRA_CFLAGS="$EXTRA_CFLAGS $USB_CFLAGS"
  2283             EXTRA_LDFLAGS="$EXTRA_LDFLAGS $USB_LIBS"
  2284             have_joystick=yes
  2285         fi
  2286         CFLAGS="$save_CFLAGS"
  2287     fi
  2288 }
  2289 
  2290 dnl Check for clock_gettime()
  2291 CheckClockGettime()
  2292 {
  2293     AC_ARG_ENABLE(clock_gettime,
  2294 AC_HELP_STRING([--enable-clock_gettime], [use clock_gettime() instead of gettimeofday() on UNIX [[default=no]]]),
  2295                   , enable_clock_gettime=no)
  2296     if test x$enable_clock_gettime = xyes; then
  2297         AC_CHECK_LIB(rt, clock_gettime, have_clock_gettime=yes)
  2298         if test x$have_clock_gettime = xyes; then
  2299             AC_DEFINE(HAVE_CLOCK_GETTIME)
  2300             EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lrt"
  2301         fi
  2302     fi
  2303 }
  2304 
  2305 dnl Check for a valid linux/version.h
  2306 CheckLinuxVersion()
  2307 {
  2308     AC_CHECK_HEADER(linux/version.h, have_linux_version_h=yes)
  2309     if test x$have_linux_version_h = xyes; then
  2310         EXTRA_CFLAGS="$EXTRA_CFLAGS -DHAVE_LINUX_VERSION_H"
  2311     fi
  2312 }
  2313 
  2314 dnl Check if we want to use RPATH
  2315 CheckRPATH()
  2316 {
  2317     AC_ARG_ENABLE(rpath,
  2318 AC_HELP_STRING([--enable-rpath], [use an rpath when linking SDL [[default=yes]]]),
  2319                   , enable_rpath=yes)
  2320 }
  2321 
  2322 dnl Set up the configuration based on the host platform!
  2323 case "$host" in
  2324     arm-*-elf*) # FIXME: Can we get more specific for iPodLinux?
  2325         ARCH=linux
  2326         CheckDummyVideo
  2327         CheckIPod
  2328         # Set up files for the timer library
  2329         if test x$enable_timers = xyes; then
  2330             AC_DEFINE(SDL_TIMER_UNIX)
  2331             SOURCES="$SOURCES $srcdir/src/timer/unix/*.c"
  2332             have_timers=yes
  2333         fi
  2334         ;;
  2335     *-*-linux*|*-*-uclinux*|*-*-gnu*|*-*-k*bsd*-gnu|*-*-bsdi*|*-*-freebsd*|*-*-dragonfly*|*-*-netbsd*|*-*-openbsd*|*-*-sysv5*|*-*-solaris*|*-*-hpux*|*-*-irix*|*-*-aix*|*-*-osf*)
  2336         case "$host" in
  2337             *-*-linux*)         ARCH=linux ;;
  2338             *-*-uclinux*)       ARCH=linux ;;
  2339             *-*-kfreebsd*-gnu)  ARCH=kfreebsd-gnu ;;
  2340             *-*-knetbsd*-gnu)   ARCH=knetbsd-gnu ;;
  2341             *-*-kopenbsd*-gnu)  ARCH=kopenbsd-gnu ;;
  2342             *-*-gnu*)           ARCH=gnu ;; # must be last of the gnu variants
  2343             *-*-bsdi*)          ARCH=bsdi ;;
  2344             *-*-freebsd*)       ARCH=freebsd ;;
  2345             *-*-dragonfly*)     ARCH=freebsd ;;
  2346             *-*-netbsd*)        ARCH=netbsd ;;
  2347             *-*-openbsd*)       ARCH=openbsd ;;
  2348             *-*-sysv5*)         ARCH=sysv5 ;;
  2349             *-*-solaris*)       ARCH=solaris ;;
  2350             *-*-hpux*)          ARCH=hpux ;;
  2351             *-*-irix*)          ARCH=irix ;;
  2352             *-*-aix*)           ARCH=aix ;;
  2353             *-*-osf*)           ARCH=osf ;;
  2354         esac
  2355         CheckVisibilityHidden
  2356         CheckDummyVideo
  2357         CheckDiskAudio
  2358         CheckDummyAudio
  2359         CheckDLOPEN
  2360         CheckNASM
  2361         CheckAltivec
  2362         CheckOSS
  2363         CheckDMEDIA
  2364         CheckMME
  2365         CheckALSA
  2366         CheckARTSC
  2367         CheckESD
  2368         CheckPulseAudio
  2369         CheckNAS
  2370         CheckX11
  2371         CheckNANOX
  2372         CheckFBCON
  2373         CheckDirectFB
  2374         CheckPS2GS
  2375         CheckPS3
  2376         CheckGGI
  2377         CheckSVGA
  2378         CheckVGL
  2379         CheckWscons
  2380         CheckAAlib
  2381         CheckCaca
  2382         CheckQtopia
  2383         CheckPicoGUI
  2384         CheckOpenGLX11
  2385         CheckInputEvents
  2386         CheckTslib
  2387         CheckUSBHID
  2388         CheckPTHREAD
  2389         CheckClockGettime
  2390         CheckLinuxVersion
  2391         CheckRPATH
  2392         # Set up files for the audio library
  2393         if test x$enable_audio = xyes; then
  2394           case $ARCH in
  2395             sysv5|solaris|hpux)
  2396                 AC_DEFINE(SDL_AUDIO_DRIVER_SUNAUDIO)
  2397                 SOURCES="$SOURCES $srcdir/src/audio/sun/*.c"
  2398                 have_audio=yes
  2399             ;;
  2400             netbsd|openbsd)
  2401                 AC_DEFINE(SDL_AUDIO_DRIVER_BSD)
  2402                 SOURCES="$SOURCES $srcdir/src/audio/bsd/*.c"
  2403                 have_audio=yes
  2404             ;;
  2405             aix)
  2406                 AC_DEFINE(SDL_AUDIO_DRIVER_PAUD)
  2407                 SOURCES="$SOURCES $srcdir/src/audio/paudio/*.c"
  2408                 have_audio=yes
  2409             ;;
  2410           esac
  2411         fi
  2412         # Set up files for the joystick library
  2413         if test x$enable_joystick = xyes; then
  2414           case $ARCH in
  2415             linux)
  2416                 AC_DEFINE(SDL_JOYSTICK_LINUX)
  2417                 SOURCES="$SOURCES $srcdir/src/joystick/linux/*.c"
  2418                 have_joystick=yes
  2419             ;;
  2420           esac
  2421         fi
  2422         # Set up files for the cdrom library
  2423         if test x$enable_cdrom = xyes; then
  2424           case $ARCH in
  2425             linux|solaris)
  2426                 AC_DEFINE(SDL_CDROM_LINUX)
  2427                 SOURCES="$SOURCES $srcdir/src/cdrom/linux/*.c"
  2428                 have_cdrom=yes
  2429             ;;
  2430             *freebsd*)
  2431                 AC_DEFINE(SDL_CDROM_FREEBSD)
  2432                 SOURCES="$SOURCES $srcdir/src/cdrom/freebsd/*.c"
  2433                 have_cdrom=yes
  2434             ;;
  2435             *openbsd*|*netbsd*)
  2436                 AC_DEFINE(SDL_CDROM_OPENBSD)
  2437                 SOURCES="$SOURCES $srcdir/src/cdrom/openbsd/*.c"
  2438                 have_cdrom=yes
  2439             ;;
  2440             bsdi)
  2441                 AC_DEFINE(SDL_CDROM_BSDI)
  2442                 SOURCES="$SOURCES $srcdir/src/cdrom/bsdi/*.c"
  2443                 have_cdrom=yes
  2444             ;;
  2445             aix)
  2446                 AC_DEFINE(SDL_CDROM_AIX)
  2447                 SOURCES="$SOURCES $srcdir/src/cdrom/aix/*.c"
  2448                 have_cdrom=yes
  2449             ;;
  2450             osf)
  2451                 AC_DEFINE(SDL_CDROM_OSF)
  2452                 SOURCES="$SOURCES $srcdir/src/cdrom/osf/*.c"
  2453                 have_cdrom=yes
  2454             ;;
  2455           esac
  2456         fi
  2457         # Set up files for the thread library
  2458         if test x$enable_threads = xyes -a x$use_pthreads != xyes -a x$use_pth != xyes -a x$ARCH = xirix; then
  2459             AC_DEFINE(SDL_THREAD_SPROC)
  2460             SOURCES="$SOURCES $srcdir/src/thread/irix/*.c"
  2461             SOURCES="$SOURCES $srcdir/src/thread/generic/SDL_sysmutex.c"
  2462             SOURCES="$SOURCES $srcdir/src/thread/generic/SDL_syscond.c"
  2463             have_threads=yes
  2464         fi
  2465         # Set up files for the timer library
  2466         if test x$enable_timers = xyes; then
  2467             AC_DEFINE(SDL_TIMER_UNIX)
  2468             SOURCES="$SOURCES $srcdir/src/timer/unix/*.c"
  2469             have_timers=yes
  2470         fi
  2471         ;;
  2472     *-*-qnx*)
  2473         ARCH=qnx
  2474         CheckDummyVideo
  2475         CheckDiskAudio
  2476         CheckDummyAudio
  2477         # CheckNASM
  2478         CheckDLOPEN
  2479         CheckNAS
  2480         CheckPHOTON
  2481         CheckX11
  2482         CheckOpenGLX11
  2483         CheckPTHREAD
  2484         # Set up files for the audio library
  2485         if test x$enable_audio = xyes; then
  2486             AC_DEFINE(SDL_AUDIO_DRIVER_QNXNTO)
  2487             SOURCES="$SOURCES $srcdir/src/audio/nto/*.c"
  2488             EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lasound"
  2489             have_audio=yes
  2490         fi
  2491         # Set up files for the cdrom library
  2492         if test x$enable_cdrom = xyes; then
  2493             AC_DEFINE(SDL_CDROM_QNX)
  2494             SOURCES="$SOURCES $srcdir/src/cdrom/qnx/*.c"
  2495             have_cdrom=yes
  2496         fi
  2497         # Set up files for the timer library
  2498         if test x$enable_timers = xyes; then
  2499             AC_DEFINE(SDL_TIMER_UNIX)
  2500             SOURCES="$SOURCES $srcdir/src/timer/unix/*.c"
  2501             have_timers=yes
  2502         fi
  2503         ;;
  2504     *-*-cygwin* | *-*-mingw32*)
  2505         ARCH=win32
  2506         if test "$build" != "$host"; then # cross-compiling
  2507             # Default cross-compile location
  2508             ac_default_prefix=/usr/local/cross-tools/i386-mingw32
  2509         else
  2510             # Look for the location of the tools and install there
  2511             if test "$BUILD_PREFIX" != ""; then
  2512                 ac_default_prefix=$BUILD_PREFIX
  2513             fi
  2514         fi
  2515         CheckDummyVideo
  2516         CheckDiskAudio
  2517         CheckDummyAudio
  2518         CheckWIN32
  2519         CheckWIN32GL
  2520         CheckDIRECTX
  2521         CheckNASM
  2522         # Set up files for the audio library
  2523         if test x$enable_audio = xyes; then
  2524             AC_DEFINE(SDL_AUDIO_DRIVER_WAVEOUT)
  2525             SOURCES="$SOURCES $srcdir/src/audio/windib/*.c"
  2526             if test x$have_directx = xyes; then
  2527                 AC_DEFINE(SDL_AUDIO_DRIVER_DSOUND)
  2528                 SOURCES="$SOURCES $srcdir/src/audio/windx5/*.c"
  2529             fi
  2530             have_audio=yes
  2531         fi
  2532         # Set up files for the joystick library
  2533         if test x$enable_joystick = xyes; then
  2534             AC_DEFINE(SDL_JOYSTICK_WINMM)
  2535             SOURCES="$SOURCES $srcdir/src/joystick/win32/*.c"
  2536             have_joystick=yes
  2537         fi
  2538         # Set up files for the cdrom library
  2539         if test x$enable_cdrom = xyes; then
  2540             AC_DEFINE(SDL_CDROM_WIN32)
  2541             SOURCES="$SOURCES $srcdir/src/cdrom/win32/*.c"
  2542             have_cdrom=yes
  2543         fi
  2544         # Set up files for the thread library
  2545         if test x$enable_threads = xyes; then
  2546             AC_DEFINE(SDL_THREAD_WIN32)
  2547             SOURCES="$SOURCES $srcdir/src/thread/win32/SDL_sysmutex.c"
  2548             SOURCES="$SOURCES $srcdir/src/thread/win32/SDL_syssem.c"
  2549             SOURCES="$SOURCES $srcdir/src/thread/win32/SDL_systhread.c"
  2550             SOURCES="$SOURCES $srcdir/src/thread/generic/SDL_syscond.c"
  2551             have_threads=yes
  2552         fi
  2553         # Set up files for the timer library
  2554         if test x$enable_timers = xyes; then
  2555             AC_DEFINE(SDL_TIMER_WIN32)
  2556             SOURCES="$SOURCES $srcdir/src/timer/win32/*.c"
  2557             have_timers=yes
  2558         fi
  2559         # Set up files for the shared object loading library
  2560         if test x$enable_loadso = xyes; then
  2561             AC_DEFINE(SDL_LOADSO_WIN32)
  2562             SOURCES="$SOURCES $srcdir/src/loadso/win32/*.c"
  2563             have_loadso=yes
  2564         fi
  2565         # Set up the system libraries we need
  2566         EXTRA_LDFLAGS="$EXTRA_LDFLAGS -luser32 -lgdi32 -lwinmm"
  2567         if test x$have_directx = xyes; then
  2568             EXTRA_LDFLAGS="$EXTRA_LDFLAGS -ldxguid -ldinput8"
  2569         fi
  2570         # The Win32 platform requires special setup
  2571         SOURCES="$SOURCES $srcdir/src/main/win32/*.rc"
  2572         SDLMAIN_SOURCES="$srcdir/src/main/win32/*.c"
  2573         SDL_CFLAGS="$SDL_CFLAGS -Dmain=SDL_main"
  2574         SDL_LIBS="-lmingw32 -lSDLmain $SDL_LIBS -mwindows"
  2575         ;;
  2576     *-wince*)
  2577         ARCH=win32
  2578         CheckDummyVideo
  2579         CheckDiskAudio
  2580         CheckDummyAudio
  2581         CheckWIN32
  2582         CheckNASM
  2583         SOURCES="$SOURCES $srcdir/src/video/gapi/*.c"
  2584         EXTRA_CFLAGS="$EXTRA_CFLAGS -D_WIN32_WCE=0x420"
  2585         if test x$enable_audio = xyes; then
  2586             AC_DEFINE(SDL_AUDIO_DRIVER_WAVEOUT)
  2587             SOURCES="$SOURCES $srcdir/src/audio/windib/*.c"
  2588             have_audio=yes
  2589         fi
  2590         # Set up files for the thread library
  2591         if test x$enable_threads = xyes; then
  2592             AC_DEFINE(SDL_THREAD_WIN32)
  2593             SOURCES="$SOURCES $srcdir/src/thread/win32/SDL_sysmutex.c"
  2594             SOURCES="$SOURCES $srcdir/src/thread/win32/SDL_syssem.c"
  2595             SOURCES="$SOURCES $srcdir/src/thread/win32/SDL_systhread.c"
  2596             SOURCES="$SOURCES $srcdir/src/thread/generic/SDL_syscond.c"
  2597             have_threads=yes
  2598         fi
  2599         # Set up files for the timer library
  2600         if test x$enable_timers = xyes; then
  2601             AC_DEFINE(SDL_TIMER_WINCE)
  2602             SOURCES="$SOURCES $srcdir/src/timer/wince/*.c"
  2603             EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lcoredll -lmmtimer"
  2604             have_timers=yes
  2605         fi
  2606         # Set up files for the shared object loading library
  2607         if test x$enable_loadso = xyes; then
  2608             AC_DEFINE(SDL_LOADSO_WIN32)
  2609             SOURCES="$SOURCES $srcdir/src/loadso/win32/*.c"
  2610             have_loadso=yes
  2611         fi
  2612         # Set up the system libraries we need
  2613         EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lcoredll -lcommctrl"
  2614         # The Win32 platform requires special setup
  2615         SDLMAIN_SOURCES="$srcdir/src/main/win32/*.c"
  2616         SDL_CFLAGS="$SDL_CFLAGS -Dmain=SDL_main -D_WIN32_WCE=0x420"
  2617         SDL_LIBS="-lSDLmain $SDL_LIBS"
  2618         ;;
  2619     *-*-beos* | *-*-haiku*)
  2620         ARCH=beos
  2621         ac_default_prefix=/boot/develop/tools/gnupro
  2622         CheckDummyVideo
  2623         CheckDiskAudio
  2624         CheckDummyAudio
  2625         CheckNASM
  2626         CheckBWINDOW
  2627         CheckBeGL
  2628         # Set up files for the audio library
  2629         if test x$enable_audio = xyes; then
  2630             AC_DEFINE(SDL_AUDIO_DRIVER_BAUDIO)
  2631             SOURCES="$SOURCES $srcdir/src/audio/baudio/*.cc"
  2632             have_audio=yes
  2633         fi
  2634         # Set up files for the joystick library
  2635         if test x$enable_joystick = xyes; then
  2636             AC_DEFINE(SDL_JOYSTICK_BEOS)
  2637             SOURCES="$SOURCES $srcdir/src/joystick/beos/*.cc"
  2638             have_joystick=yes
  2639         fi
  2640         # Set up files for the cdrom library
  2641         if test x$enable_cdrom = xyes; then
  2642             AC_DEFINE(SDL_CDROM_BEOS)
  2643             SOURCES="$SOURCES $srcdir/src/cdrom/beos/*.cc"
  2644             have_cdrom=yes
  2645         fi
  2646         # Set up files for the thread library
  2647         if test x$enable_threads = xyes; then
  2648             AC_DEFINE(SDL_THREAD_BEOS)
  2649             SOURCES="$SOURCES $srcdir/src/thread/beos/*.c"
  2650             SOURCES="$SOURCES $srcdir/src/thread/generic/SDL_sysmutex.c"
  2651             SOURCES="$SOURCES $srcdir/src/thread/generic/SDL_syscond.c"
  2652             have_threads=yes
  2653         fi
  2654         # Set up files for the timer library
  2655         if test x$enable_timers = xyes; then
  2656             AC_DEFINE(SDL_TIMER_BEOS)
  2657             SOURCES="$SOURCES $srcdir/src/timer/beos/*.c"
  2658             have_timers=yes
  2659         fi
  2660         # Set up files for the shared object loading library
  2661         if test x$enable_loadso = xyes; then
  2662             case "$host" in
  2663                 *-*-beos*)
  2664                     AC_DEFINE(SDL_LOADSO_BEOS)
  2665                     SOURCES="$SOURCES $srcdir/src/loadso/beos/*.c"
  2666                 ;;
  2667                 *-*-haiku*)
  2668                     AC_DEFINE(SDL_LOADSO_DLOPEN)
  2669                     SOURCES="$SOURCES $srcdir/src/loadso/dlopen/*.c"
  2670                 ;;
  2671             esac    
  2672             have_loadso=yes
  2673         fi
  2674         # The BeOS platform requires special setup.
  2675         SOURCES="$srcdir/src/main/beos/*.cc $SOURCES"
  2676         EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lroot -lbe -lmedia -lgame -ldevice -ltextencoding"
  2677         ;;
  2678     *-*-darwin* )
  2679         # This could be either full "Mac OS X", or plain "Darwin" which is
  2680         # just the OS X kernel sans upper layers like Carbon and Cocoa.
  2681         # Next line is broken, and a few files below require Mac OS X (full)
  2682         ARCH=macosx
  2683 
  2684         # Mac OS X builds with both the Carbon and OSX APIs at the moment
  2685         EXTRA_CFLAGS="$EXTRA_CFLAGS -DTARGET_API_MAC_CARBON"
  2686         EXTRA_CFLAGS="$EXTRA_CFLAGS -DTARGET_API_MAC_OSX"
  2687 
  2688         # HACK: Reset EXTRA_LDFLAGS; the only thing it contains at this point
  2689         # is -lm which is not needed under Mac OS X. But for some reasons it
  2690         # also tends to contain spurious -L switches, which we don't want to
  2691         # use here or in sdl-config. Hence we reset it.
  2692         EXTRA_LDFLAGS=""
  2693 
  2694         CheckVisibilityHidden
  2695         CheckDummyVideo
  2696         CheckDiskAudio
  2697         CheckDummyAudio
  2698         CheckDLOPEN
  2699         CheckNASM
  2700 
  2701         # Set up files for the shared object loading library
  2702         # (this needs to be done before the dynamic X11 check)
  2703         if test x$enable_loadso = xyes -a x$have_dlopen != xyes; then
  2704             AC_DEFINE(SDL_LOADSO_DLCOMPAT)
  2705             SOURCES="$SOURCES $srcdir/src/loadso/macosx/*.c"
  2706             have_loadso=yes
  2707         fi
  2708 
  2709         CheckCOCOA
  2710         CheckCARBON
  2711         CheckX11
  2712         CheckMacGL
  2713         CheckOpenGLX11
  2714         CheckPTHREAD
  2715         CheckAltivec
  2716 
  2717         # Need this or things might misbuild on a G3.
  2718         EXTRA_CFLAGS="$EXTRA_CFLAGS -force_cpusubtype_ALL"
  2719 
  2720         # Set up files for the audio library
  2721         if test x$enable_audio = xyes; then
  2722             AC_DEFINE(SDL_AUDIO_DRIVER_COREAUDIO)
  2723             SOURCES="$SOURCES $srcdir/src/audio/macosx/*.c"
  2724             have_audio=yes
  2725         fi
  2726         # Set up files for the joystick library
  2727         if test x$enable_joystick = xyes; then
  2728             AC_DEFINE(SDL_JOYSTICK_IOKIT)
  2729             SOURCES="$SOURCES $srcdir/src/joystick/darwin/*.c"
  2730             have_joystick=yes
  2731             need_iokit_framework=yes
  2732         fi
  2733         # Set up files for the cdrom library
  2734         if test x$enable_cdrom = xyes; then
  2735             AC_DEFINE(SDL_CDROM_MACOSX)
  2736             SOURCES="$SOURCES $srcdir/src/cdrom/macosx/*.c"
  2737             have_cdrom=yes
  2738         fi
  2739         # Set up files for the timer library
  2740         if test x$enable_timers = xyes; then
  2741             AC_DEFINE(SDL_TIMER_UNIX)
  2742             SOURCES="$SOURCES $srcdir/src/timer/unix/*.c"
  2743             have_timers=yes
  2744         fi
  2745         # The Mac OS X platform requires special setup.
  2746         SDLMAIN_SOURCES="$srcdir/src/main/macosx/*.m"
  2747         EXTRA_CFLAGS="$EXTRA_CFLAGS -fpascal-strings"
  2748         SDL_LIBS="-lSDLmain $SDL_LIBS"
  2749         if test x$enable_video_cocoa = xyes; then
  2750             EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,Cocoa"
  2751             need_iokit_framework=yes
  2752         fi
  2753         if test x$enable_video_carbon = xyes -o x$enable_video_cocoa = xyes; then
  2754             # The Cocoa backend still needs Carbon
  2755             EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,ApplicationServices"
  2756             EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,Carbon"
  2757         fi
  2758         # If either the audio or CD driver is used, add the AudioUnit framework
  2759         if test x$enable_audio = xyes -o x$enable_cdrom = xyes; then
  2760             EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,AudioToolbox -Wl,-framework,AudioUnit"
  2761         fi
  2762         # Some subsystems reference IOKit...
  2763         if test x$need_iokit_framework = xyes; then
  2764             EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,IOKit"
  2765         fi
  2766         ;;
  2767     *-*-mint*)
  2768         ARCH=mint
  2769         CheckDummyVideo
  2770         CheckDiskAudio
  2771         CheckDummyAudio
  2772         CheckAtariBiosEvent
  2773         CheckAtariXbiosVideo
  2774         CheckAtariGemVideo
  2775         CheckAtariAudio
  2776         CheckAtariLdg
  2777         CheckAtariOSMesa
  2778         CheckPTH
  2779         # Set up files for the audio library
  2780         if test x$enable_threads = xyes -a x$enable_pth = xyes; then
  2781             if test x$enable_audio = xyes; then
  2782                 AC_DEFINE(SDL_AUDIO_DRIVER_SUNAUDIO)
  2783                 SOURCES="$SOURCES $srcdir/src/audio/sun/*.c"
  2784                 have_audio=yes
  2785             fi
  2786         fi
  2787         # Set up files for the joystick library
  2788         if test x$enable_joystick = xyes; then
  2789             AC_DEFINE(SDL_JOYSTICK_MINT)
  2790             SOURCES="$SOURCES $srcdir/src/joystick/mint/*.c"
  2791             have_joystick=yes
  2792         fi
  2793         # Set up files for the cdrom library
  2794         if test x$enable_cdrom = xyes; then
  2795             AC_DEFINE(SDL_CDROM_MINT)
  2796             SOURCES="$SOURCES $srcdir/src/cdrom/mint/*.c"
  2797             have_cdrom=yes
  2798         fi
  2799         # Set up files for the timer library
  2800         if test x$enable_timers = xyes; then
  2801             if test x$enable_threads = xyes -a x$enable_pth = xyes; then
  2802                 AC_DEFINE(SDL_TIMER_UNIX)
  2803                 SOURCES="$SOURCES $srcdir/src/timer/unix/*.c"
  2804             else
  2805                 AC_DEFINE(SDL_TIMER_MINT)
  2806                 SOURCES="$SOURCES $srcdir/src/timer/mint/*.c"
  2807                 SOURCES="$SOURCES $srcdir/src/timer/mint/*.S"
  2808             fi
  2809             have_timers=yes
  2810         fi
  2811         ;;
  2812     *-riscos)
  2813         ARCH=riscos
  2814         CheckOSS
  2815         CheckPTHREAD
  2816         # Set up files for the video library
  2817         if test x$enable_video = xyes; then
  2818             AC_DEFINE(SDL_VIDEO_DRIVER_RISCOS)
  2819             SOURCES="$SOURCES $srcdir/src/video/riscos/*.c"
  2820             SOURCES="$SOURCES $srcdir/src/video/riscos/*.S"
  2821             have_video=yes
  2822         fi
  2823         # Set up files for the joystick library
  2824         if test x$enable_joystick = xyes; then
  2825             AC_DEFINE(SDL_JOYSTICK_RISCOS)
  2826             SOURCES="$SOURCES $srcdir/src/joystick/riscos/*.c"
  2827             have_joystick=yes
  2828         fi
  2829         # Set up files for the timer library
  2830         if test x$enable_timers = xyes; then
  2831             AC_DEFINE(SDL_TIMER_RISCOS)
  2832             SOURCES="$SOURCES $srcdir/src/timer/riscos/*.c"
  2833             have_timers=yes
  2834         fi
  2835         # The RISC OS platform requires special setup.
  2836         EXTRA_LDFLAGS="$EXTRA_LDFLAGS -ljpeg -ltiff -lpng -lz"
  2837         ;;
  2838     *)
  2839         AC_MSG_ERROR([
  2840 *** Unsupported host:  Please add to configure.in
  2841         ])
  2842         ;;
  2843 esac
  2844 
  2845 # Verify that we have all the platform specific files we need
  2846 
  2847 if test x$enable_joystick = xyes; then
  2848   if test x$have_joystick != xyes; then
  2849     # Wants joystick subsystem, but doesn't have a platform-specific backend...
  2850     AC_DEFINE(SDL_JOYSTICK_DUMMY)
  2851     SOURCES="$SOURCES $srcdir/src/joystick/dummy/*.c"
  2852   fi
  2853 fi
  2854 if test x$have_cdrom != xyes; then
  2855     if test x$enable_cdrom = xyes; then
  2856         AC_DEFINE(SDL_CDROM_DISABLED)
  2857     fi
  2858     SOURCES="$SOURCES $srcdir/src/cdrom/dummy/*.c"
  2859 fi
  2860 if test x$have_threads != xyes; then
  2861     if test x$enable_threads = xyes; then
  2862         AC_DEFINE(SDL_THREADS_DISABLED)
  2863     fi
  2864     SOURCES="$SOURCES $srcdir/src/thread/generic/*.c"
  2865 fi
  2866 if test x$have_timers != xyes; then
  2867     if test x$enable_timers = xyes; then
  2868         AC_DEFINE(SDL_TIMERS_DISABLED)
  2869     fi
  2870     SOURCES="$SOURCES $srcdir/src/timer/dummy/*.c"
  2871 fi
  2872 if test x$have_loadso != xyes; then
  2873     if test x$enable_loadso = xyes; then
  2874         AC_DEFINE(SDL_LOADSO_DISABLED)
  2875     fi
  2876     SOURCES="$SOURCES $srcdir/src/loadso/dummy/*.c"
  2877 fi
  2878 if test x$SDLMAIN_SOURCES = x; then
  2879     SDLMAIN_SOURCES="$srcdir/src/main/dummy/*.c"
  2880 fi
  2881 
  2882 OBJECTS=`echo $SOURCES | sed 's,[[^ ]]*/\([[^ ]]*\)\.asm,$(objects)/\1.lo,g'`
  2883 OBJECTS=`echo $OBJECTS | sed 's,[[^ ]]*/\([[^ ]]*\)\.cc,$(objects)/\1.lo,g'`
  2884 OBJECTS=`echo $OBJECTS | sed 's,[[^ ]]*/\([[^ ]]*\)\.m,$(objects)/\1.lo,g'`
  2885 OBJECTS=`echo $OBJECTS | sed 's,[[^ ]]*/\([[^ ]]*\)\.c,$(objects)/\1.lo,g'`
  2886 OBJECTS=`echo $OBJECTS | sed 's,[[^ ]]*/\([[^ ]]*\)\.S,$(objects)/\1.lo,g'`
  2887 OBJECTS=`echo $OBJECTS | sed 's,[[^ ]]*/\([[^ ]]*\)\.rc,$(objects)/\1.o,g'`
  2888 
  2889 SDLMAIN_OBJECTS=`echo $SDLMAIN_SOURCES | sed 's,[[^ ]]*/\([[^ ]]*\)\.cc,$(objects)/\1.o,g'`
  2890 SDLMAIN_OBJECTS=`echo $SDLMAIN_OBJECTS | sed 's,[[^ ]]*/\([[^ ]]*\)\.m,$(objects)/\1.o,g'`
  2891 SDLMAIN_OBJECTS=`echo $SDLMAIN_OBJECTS | sed 's,[[^ ]]*/\([[^ ]]*\)\.c,$(objects)/\1.o,g'`
  2892 
  2893 # Set runtime shared library paths as needed
  2894 
  2895 if test "x$enable_rpath" = "xyes"; then
  2896   if test $ARCH = bsdi -o $ARCH = freebsd -o $ARCH = irix -o $ARCH = linux -o $ARCH = netbsd; then
  2897     SDL_RLD_FLAGS="-Wl,-rpath,\${libdir}"
  2898   fi
  2899   if test $ARCH = solaris; then
  2900     SDL_RLD_FLAGS="-R\${libdir}"
  2901   fi
  2902 else
  2903   SDL_RLD_FLAGS=""
  2904 fi
  2905 
  2906 case "$ARCH" in
  2907   macosx)
  2908     if test x$enable_video = xyes -a x$enable_video_cocoa = xyes; then
  2909       SDL_LIBS="$SDL_LIBS -Wl,-framework,Cocoa"
  2910     fi
  2911     if test x$enable_video = xyes -a x$enable_video_carbon = xyes; then
  2912       SDL_LIBS="$SDL_LIBS -Wl,-framework,Carbon"
  2913     fi
  2914     # Evil hack to allow static linking on Mac OS X
  2915     SDL_STATIC_LIBS="\${libdir}/libSDLmain.a \${libdir}/libSDL.a $EXTRA_LDFLAGS"
  2916     ;;
  2917   *)
  2918     SDL_STATIC_LIBS="$SDL_LIBS $EXTRA_LDFLAGS"
  2919     ;;
  2920 esac
  2921 
  2922 dnl Expand the cflags and libraries needed by apps using SDL
  2923 AC_SUBST(SDL_CFLAGS)
  2924 AC_SUBST(SDL_LIBS)
  2925 AC_SUBST(SDL_STATIC_LIBS)
  2926 AC_SUBST(SDL_RLD_FLAGS)
  2927 if test x$enable_shared = xyes; then
  2928     ENABLE_SHARED_TRUE=
  2929     ENABLE_SHARED_FALSE="#"
  2930 else
  2931     ENABLE_SHARED_TRUE="#"
  2932     ENABLE_SHARED_FALSE=
  2933 fi
  2934 if test x$enable_static = xyes; then
  2935     ENABLE_STATIC_TRUE=
  2936     ENABLE_STATIC_FALSE="#"
  2937 else
  2938     ENABLE_STATIC_TRUE="#"
  2939     ENABLE_STATIC_FALSE=
  2940 fi
  2941 AC_SUBST(ENABLE_SHARED_TRUE)
  2942 AC_SUBST(ENABLE_SHARED_FALSE)
  2943 AC_SUBST(ENABLE_STATIC_TRUE)
  2944 AC_SUBST(ENABLE_STATIC_FALSE)
  2945 
  2946 dnl Expand the sources and objects needed to build the library
  2947 AC_SUBST(ac_aux_dir)
  2948 AC_SUBST(INCLUDE)
  2949 AC_SUBST(SOURCES)
  2950 AC_SUBST(OBJECTS)
  2951 AC_SUBST(SDLMAIN_SOURCES)
  2952 AC_SUBST(SDLMAIN_OBJECTS)
  2953 AC_SUBST(BUILD_CFLAGS)
  2954 AC_SUBST(EXTRA_CFLAGS)
  2955 AC_SUBST(BUILD_LDFLAGS)
  2956 AC_SUBST(EXTRA_LDFLAGS)
  2957 AC_SUBST(WINDRES)
  2958 
  2959 AC_OUTPUT([
  2960     Makefile sdl-config SDL.spec SDL.qpg sdl.pc
  2961 ], [
  2962     : >build-deps
  2963     if test x"$MAKE" = x; then MAKE=make; fi; $MAKE depend
  2964 ])