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