configure.in
author Sam Lantinga <slouken@libsdl.org>
Sat, 10 Oct 2009 09:03:08 +0000
branchSDL-1.2
changeset 4300 602642738b83
parent 4298 7d60c0ac6aae
child 4308 447fd6ae10cf
permissions -rw-r--r--
Debian patch: 050_altivec_detection.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         save_CFLAGS="$CFLAGS"
   814         have_gcc_altivec=no
   815         have_altivec_h_hdr=no
   816         altivec_CFLAGS="-maltivec"
   817         CFLAGS="$save_CFLAGS $altivec_CFLAGS"
   818 
   819         AC_MSG_CHECKING(for Altivec with GCC altivec.h and -maltivec option)
   820         AC_TRY_COMPILE([
   821         #include <altivec.h>
   822         vector unsigned int vzero() {
   823             return vec_splat_u32(0);
   824         }
   825         ],[
   826         ],[
   827         have_gcc_altivec=yes
   828         have_altivec_h_hdr=yes
   829         ])
   830         AC_MSG_RESULT($have_gcc_altivec)
   831 
   832         if test x$have_gcc_altivec = xno; then
   833             AC_MSG_CHECKING(for Altivec with GCC -maltivec option)
   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 altivec.h and -faltivec option)
   847             altivec_CFLAGS="-faltivec"
   848             CFLAGS="$save_CFLAGS $altivec_CFLAGS"
   849             AC_TRY_COMPILE([
   850             #include <altivec.h>
   851             vector unsigned int vzero() {
   852                 return vec_splat_u32(0);
   853             }
   854             ],[
   855             ],[
   856             have_gcc_altivec=yes
   857             have_altivec_h_hdr=yes
   858             ])
   859             AC_MSG_RESULT($have_gcc_altivec)
   860 	fi
   861 
   862         if test x$have_gcc_altivec = xno; then
   863             AC_MSG_CHECKING(for Altivec with GCC -faltivec option)
   864             AC_TRY_COMPILE([
   865             vector unsigned int vzero() {
   866                 return vec_splat_u32(0);
   867             }
   868             ],[
   869             ],[
   870             have_gcc_altivec=yes
   871             ])
   872             AC_MSG_RESULT($have_gcc_altivec)
   873         fi
   874         CFLAGS="$save_CFLAGS"
   875 
   876         if test x$have_gcc_altivec = xyes; then
   877             AC_DEFINE(SDL_ALTIVEC_BLITTERS)
   878             if test x$have_altivec_h_hdr = xyes; then
   879               AC_DEFINE(HAVE_ALTIVEC_H)
   880             fi
   881             EXTRA_CFLAGS="$EXTRA_CFLAGS $altivec_CFLAGS"
   882         fi
   883     fi
   884 }
   885 
   886 dnl See if GCC's -fvisibility=hidden is supported (gcc4 and later, usually).
   887 dnl  Details of this flag are here: http://gcc.gnu.org/wiki/Visibility
   888 CheckVisibilityHidden()
   889 {
   890     AC_MSG_CHECKING(for GCC -fvisibility=hidden option)
   891     have_gcc_fvisibility=no
   892 
   893     visibility_CFLAGS="-fvisibility=hidden"
   894     save_CFLAGS="$CFLAGS"
   895     CFLAGS="$save_CFLAGS $visibility_CFLAGS -Werror"
   896     AC_TRY_COMPILE([
   897     #if !defined(__GNUC__) || __GNUC__ < 4
   898     #error SDL only uses visibility attributes in GCC 4 or newer
   899     #endif
   900     ],[
   901     ],[
   902     have_gcc_fvisibility=yes
   903     ])
   904     AC_MSG_RESULT($have_gcc_fvisibility)
   905     CFLAGS="$save_CFLAGS"
   906 
   907     if test x$have_gcc_fvisibility = xyes; then
   908         EXTRA_CFLAGS="$EXTRA_CFLAGS $visibility_CFLAGS"
   909     fi
   910 }
   911 
   912 
   913 dnl Do the iPod thing
   914 CheckIPod()
   915 {
   916     AC_ARG_ENABLE(ipod,
   917 AC_HELP_STRING([--enable-ipod], [configure SDL to work with iPodLinux [[default=no]]]),
   918         , enable_ipod=no)
   919 
   920     if test x$enable_ipod = xyes; then
   921         EXTRA_CFLAGS="$EXTRA_CFLAGS -DIPOD"
   922         AC_DEFINE(SDL_VIDEO_DRIVER_IPOD)
   923         SOURCES="$SOURCES $srcdir/src/video/ipod/*.c"
   924     fi
   925 }
   926 
   927 dnl Find the nanox include and library directories
   928 CheckNANOX()
   929 {
   930     AC_ARG_ENABLE(video-nanox,
   931         AC_HELP_STRING([--enable-video-nanox], [use nanox video driver [[default=no]]]),
   932         , enable_video_nanox=no)
   933 
   934     if test x$enable_video = xyes -a x$enable_video_nanox = xyes; then
   935         AC_ARG_ENABLE(nanox-debug,  
   936             AC_HELP_STRING([--enable-nanox-debug], [print debug messages [[default=no]]]),
   937             , enable_nanox_debug=no)
   938         if test x$enable_nanox_debug = xyes; then
   939             EXTRA_CFLAGS="$EXTRA_CFLAGS -DENABLE_NANOX_DEBUG"
   940         fi
   941 
   942         AC_ARG_ENABLE(nanox-share-memory,  
   943             AC_HELP_STRING([--enable-nanox-share-memory], [use share memory [[default=no]]]),
   944             , enable_nanox_share_memory=no)
   945         if test x$enable_nanox_share_memory = xyes; then
   946             EXTRA_CFLAGS="$EXTRA_CFLAGS -DNANOX_SHARE_MEMORY"
   947         fi
   948 
   949         AC_ARG_ENABLE(nanox_direct_fb, 
   950             AC_HELP_STRING([--enable-nanox-direct-fb], [use direct framebuffer access [[default=no]]]),
   951             , enable_nanox_direct_fb=no)
   952         if test x$enable_nanox_direct_fb = xyes; then
   953             EXTRA_CFLAGS="$EXTRA_CFLAGS -DENABLE_NANOX_DIRECT_FB"
   954         fi
   955 
   956         AC_DEFINE(SDL_VIDEO_DRIVER_NANOX)
   957         SOURCES="$SOURCES $srcdir/src/video/nanox/*.c"
   958         EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lnano-X"
   959         have_video=yes
   960     fi
   961 }
   962 
   963 dnl Find the X11 include and library directories
   964 CheckX11()
   965 {
   966     AC_ARG_ENABLE(video-x11,
   967 AC_HELP_STRING([--enable-video-x11], [use X11 video driver [[default=yes]]]),
   968                   , enable_video_x11=yes)
   969     if test x$enable_video = xyes -a x$enable_video_x11 = xyes; then
   970         case "$host" in
   971             *-*-darwin*)
   972                 # This isn't necessary for X11, but fixes GLX detection
   973                 if test "x$x_includes" = xNONE && test "x$x_libraries" = xNONE; then
   974                     x_includes="/usr/X11R6/include"
   975                     x_libraries="/usr/X11R6/lib"
   976                 fi
   977                 ;;
   978         esac
   979         AC_PATH_X
   980         AC_PATH_XTRA
   981         if test x$have_x = xyes; then
   982             # Only allow dynamically loaded X11 if the X11 function pointers
   983             # will not end up in the global namespace, which causes problems
   984             # with other libraries calling X11 functions.
   985             x11_symbols_private=$have_gcc_fvisibility
   986 
   987             AC_ARG_ENABLE(x11-shared,
   988 AC_HELP_STRING([--enable-x11-shared], [dynamically load X11 support [[default=maybe]]]),
   989                           , enable_x11_shared=maybe)
   990 
   991             case "$host" in
   992                 *-*-darwin*) # Latest Mac OS X actually ships with Xrandr/Xrender libs...
   993                     x11_symbols_private=yes
   994                     x11_lib='/usr/X11R6/lib/libX11.6.dylib'
   995                     x11ext_lib='/usr/X11R6/lib/libXext.6.dylib'
   996                     xrender_lib='/usr/X11R6/lib/libXrender.1.dylib'
   997                     xrandr_lib='/usr/X11R6/lib/libXrandr.2.dylib'
   998                     ;;
   999                 *-*-osf*)
  1000                     x11_lib='libX11.so'
  1001                     x11ext_lib='libXext.so'
  1002                     ;;
  1003                 *-*-irix*) # IRIX 6.5 requires that we use /usr/lib32
  1004                     x11_lib='libX11.so'
  1005                     x11ext_lib='libXext.so'
  1006                     ;;
  1007                 *)
  1008                     x11_lib_path=[`echo $X_LIBS | sed 's/.*-L\([^ ]*\).*/\1/'`]
  1009                     for path in $x11_lib_path /usr/$base_libdir /usr/X11/$base_libdir /usr/X11R6/$base_libdir; do
  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                             if test "x$x11_lib" = "x"; then
  1013                                 x11_lib=[`ls -- $path/libX11.so.[0-9]* 2>/dev/null | sort -r | sed 's/.*\/\(.*\)/\1/; q'`]
  1014                             fi
  1015                         fi
  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                             if test "x$x11ext_lib" = "x"; then
  1019                                 x11ext_lib=[`ls -- $path/libXext.so.[0-9]* 2>/dev/null | sort -r | sed 's/.*\/\(.*\)/\1/; q'`]
  1020                             fi
  1021                         fi
  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                             if test "x$xrender_lib" = "x"; then
  1025                                 xrender_lib=[`ls -- $path/libXrender.so.[0-9]* 2>/dev/null | sort -r | sed 's/.*\/\(.*\)/\1/; q'`]
  1026                             fi
  1027                         fi
  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                             if test "x$xrandr_lib" = "x"; then
  1031                                 xrandr_lib=[`ls -- $path/libXrandr.so.[0-9]* 2>/dev/null | sort -r | sed 's/.*\/\(.*\)/\1/; q'`]
  1032                             fi
  1033                         fi
  1034                     done
  1035                     ;;
  1036             esac
  1037 
  1038             X_CFLAGS="$X_CFLAGS -DXTHREADS"
  1039             if test x$ac_cv_func_shmat != xyes; then
  1040                 X_CFLAGS="$X_CFLAGS -DNO_SHARED_MEMORY"
  1041             fi
  1042             CFLAGS="$CFLAGS $X_CFLAGS"
  1043             LDFLAGS="$LDFLAGS $X_LIBS"
  1044 
  1045             AC_DEFINE(SDL_VIDEO_DRIVER_X11)
  1046             SOURCES="$SOURCES $srcdir/src/video/x11/*.c"
  1047             EXTRA_CFLAGS="$EXTRA_CFLAGS $X_CFLAGS"
  1048 
  1049             if test x$enable_x11_shared = xmaybe; then
  1050                 enable_x11_shared=$x11_symbols_private
  1051             fi
  1052             if test x$have_loadso != xyes && \
  1053                test x$enable_x11_shared = xyes; then
  1054                 AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic X11 loading])
  1055                 enable_x11_shared=no
  1056             fi
  1057             if test x$x11_symbols_private != xyes && \
  1058                test x$enable_x11_shared = xyes; then
  1059                 AC_MSG_WARN([You must have gcc4 (-fvisibility=hidden) for dynamic X11 loading])
  1060                 enable_x11_shared=no
  1061             fi
  1062 
  1063             if test x$have_loadso = xyes && \
  1064                test x$enable_x11_shared = xyes && test x$x11_lib != x && test x$x11ext_lib != x; then
  1065                 echo "-- dynamic libX11 -> $x11_lib"
  1066                 echo "-- dynamic libX11ext -> $x11ext_lib"
  1067                 AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_X11_DYNAMIC, "$x11_lib")
  1068                 AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_X11_DYNAMIC_XEXT, "$x11ext_lib")
  1069             else
  1070                 enable_x11_shared=no
  1071                 EXTRA_LDFLAGS="$EXTRA_LDFLAGS $X_LIBS -lX11 -lXext"
  1072             fi
  1073             have_video=yes
  1074 
  1075             AC_ARG_ENABLE(dga,
  1076 AC_HELP_STRING([--enable-dga], [allow use of X11 DGA code [[default=yes]]]),
  1077                           , enable_dga=yes)
  1078             if test x$enable_dga = xyes; then
  1079                 SOURCES="$SOURCES $srcdir/src/video/Xext/Xxf86dga/*.c"
  1080             fi
  1081             AC_ARG_ENABLE(video-dga,
  1082 AC_HELP_STRING([--enable-video-dga], [use DGA 2.0 video driver [[default=yes]]]),
  1083                   , enable_video_dga=yes)
  1084             if test x$enable_dga = xyes -a x$enable_video_dga = xyes; then
  1085                 AC_DEFINE(SDL_VIDEO_DRIVER_DGA)
  1086                 SOURCES="$SOURCES $srcdir/src/video/dga/*.c"
  1087             fi
  1088             AC_ARG_ENABLE(video-x11-dgamouse,
  1089 AC_HELP_STRING([--enable-video-x11-dgamouse], [use X11 DGA for mouse events [[default=yes]]]),
  1090                           , enable_video_x11_dgamouse=yes)
  1091             if test x$enable_dga = xyes -a x$enable_video_x11_dgamouse = xyes; then
  1092                 AC_DEFINE(SDL_VIDEO_DRIVER_X11_DGAMOUSE)
  1093             fi
  1094             AC_ARG_ENABLE(video-x11-vm,
  1095 AC_HELP_STRING([--enable-video-x11-vm], [use X11 VM extension for fullscreen [[default=yes]]]),
  1096                           , enable_video_x11_vm=yes)
  1097             if test x$enable_video_x11_vm = xyes; then
  1098                 AC_DEFINE(SDL_VIDEO_DRIVER_X11_VIDMODE)
  1099                 SOURCES="$SOURCES $srcdir/src/video/Xext/Xxf86vm/*.c"
  1100             fi
  1101             AC_ARG_ENABLE(video-x11-xv,
  1102 AC_HELP_STRING([--enable-video-x11-xv], [use X11 XvImage extension for video [[default=yes]]]),
  1103                           , enable_video_x11_xv=yes)
  1104             if test x$enable_video_x11_xv = xyes; then
  1105                 AC_DEFINE(SDL_VIDEO_DRIVER_X11_XV)
  1106                 SOURCES="$SOURCES $srcdir/src/video/Xext/Xv/*.c"
  1107             fi
  1108             AC_ARG_ENABLE(video-x11-xinerama,
  1109 AC_HELP_STRING([--enable-video-x11-xinerama], [enable X11 Xinerama support [[default=yes]]]),
  1110                             , enable_video_x11_xinerama=yes)
  1111             if test x$enable_video_x11_xinerama = xyes; then
  1112                 AC_DEFINE(SDL_VIDEO_DRIVER_X11_XINERAMA)
  1113                 SOURCES="$SOURCES $srcdir/src/video/Xext/Xinerama/*.c"
  1114             fi
  1115             AC_ARG_ENABLE(video-x11-xme,
  1116 AC_HELP_STRING([--enable-video-x11-xme], [enable Xi Graphics XME for fullscreen [[default=yes]]]),
  1117                             , enable_video_x11_xme=yes)
  1118             if test x$enable_video_x11_xme = xyes; then
  1119                 AC_DEFINE(SDL_VIDEO_DRIVER_X11_XME)
  1120                 SOURCES="$SOURCES $srcdir/src/video/Xext/XME/*.c"
  1121             fi
  1122             AC_ARG_ENABLE(video-x11-xrandr,
  1123 AC_HELP_STRING([--enable-video-x11-xrandr], [enable X11 Xrandr extension for fullscreen [[default=yes]]]),
  1124                             , enable_video_x11_xrandr=yes)
  1125             if test x$enable_video_x11_xrandr = xyes; then
  1126                 definitely_enable_video_x11_xrandr=no
  1127                 AC_CHECK_HEADER(X11/extensions/Xrandr.h,
  1128                                 have_xrandr_h_hdr=yes,
  1129                                 have_xrandr_h_hdr=no,
  1130                                 [#include <X11/Xlib.h>
  1131                                 ])
  1132                 if test x$have_xrandr_h_hdr = xyes; then
  1133                     if test x$enable_x11_shared = xyes && test x$xrandr_lib != x ; then
  1134                         echo "-- dynamic libXrender -> $xrender_lib"
  1135                         echo "-- dynamic libXrandr -> $xrandr_lib"
  1136                         AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_X11_DYNAMIC_XRENDER, "$xrender_lib")
  1137                         AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_X11_DYNAMIC_XRANDR, "$xrandr_lib")
  1138                         definitely_enable_video_x11_xrandr=yes
  1139                     else
  1140                         AC_CHECK_LIB(Xrender, XRenderQueryExtension, have_xrender_lib=yes)
  1141                         AC_CHECK_LIB(Xrandr, XRRQueryExtension, have_xrandr_lib=yes)
  1142                         if test x$have_xrender_lib = xyes && test x$have_xrandr_lib = xyes ; then
  1143                             EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lXrandr -lXrender"
  1144                             definitely_enable_video_x11_xrandr=yes
  1145                         fi
  1146                     fi
  1147                 fi
  1148             fi
  1149             if test x$definitely_enable_video_x11_xrandr = xyes; then
  1150                 AC_DEFINE(SDL_VIDEO_DRIVER_X11_XRANDR)
  1151             fi
  1152         fi
  1153     fi
  1154 }
  1155 
  1156 dnl Check for QNX photon video driver
  1157 CheckPHOTON()
  1158 {
  1159     AC_ARG_ENABLE(video-photon,
  1160 AC_HELP_STRING([--enable-video-photon], [use QNX Photon video driver [[default=yes]]]),
  1161                   , enable_video_photon=yes)
  1162     if test x$enable_video = xyes -a x$enable_video_photon = xyes; then
  1163         AC_MSG_CHECKING(for QNX Photon support)
  1164         video_photon=no
  1165         AC_TRY_COMPILE([
  1166           #include <Ph.h>
  1167           #include <Pt.h>
  1168           #include <photon/Pg.h>
  1169           #include <photon/PdDirect.h>
  1170         ],[
  1171          PgDisplaySettings_t *visual;
  1172         ],[
  1173         video_photon=yes
  1174         ])
  1175         AC_MSG_RESULT($video_photon)
  1176         if test x$video_photon = xyes; then
  1177             AC_DEFINE(SDL_VIDEO_DRIVER_PHOTON)
  1178             SOURCES="$SOURCES $srcdir/src/video/photon/*.c"
  1179             EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lph"
  1180             have_video=yes
  1181 
  1182             CheckOpenGLQNX
  1183         fi
  1184     fi
  1185 }
  1186 
  1187 dnl Set up the BWindow video driver if enabled
  1188 CheckBWINDOW()
  1189 {
  1190     if test x$enable_video = xyes; then
  1191         AC_DEFINE(SDL_VIDEO_DRIVER_BWINDOW)
  1192         SOURCES="$SOURCES $srcdir/src/video/bwindow/*.cc"
  1193         have_video=yes
  1194     fi
  1195 }
  1196 
  1197 dnl Set up the Carbon/QuickDraw video driver for Mac OS X (but not Darwin)
  1198 CheckCARBON()
  1199 {
  1200     AC_ARG_ENABLE(video-carbon,
  1201 AC_HELP_STRING([--enable-video-carbon], [use Carbon/QuickDraw video driver [[default=no]]]),
  1202                   , enable_video_carbon=no)
  1203     if test x$enable_video = xyes -a x$enable_video_carbon = xyes; then
  1204         AC_MSG_CHECKING(for Carbon framework)
  1205         have_carbon=no
  1206         AC_TRY_COMPILE([
  1207           #include <Carbon/Carbon.h>
  1208         ],[
  1209         ],[
  1210         have_carbon=yes
  1211         ])
  1212         AC_MSG_RESULT($have_carbon)
  1213         if test x$have_carbon = xyes; then
  1214             AC_DEFINE(SDL_VIDEO_DRIVER_TOOLBOX)
  1215             SOURCES="$SOURCES $srcdir/src/video/maccommon/*.c"
  1216             SOURCES="$SOURCES $srcdir/src/video/macrom/*.c"
  1217             have_video=yes
  1218         fi
  1219     fi
  1220 }
  1221 
  1222 dnl Set up the Cocoa/Quartz video driver for Mac OS X (but not Darwin)
  1223 CheckCOCOA()
  1224 {
  1225     AC_ARG_ENABLE(video-cocoa,
  1226 AC_HELP_STRING([--enable-video-cocoa], [use Cocoa/Quartz video driver [[default=yes]]]),
  1227                   , enable_video_cocoa=yes)
  1228     if test x$enable_video = xyes -a x$enable_video_cocoa = xyes; then
  1229         save_CFLAGS="$CFLAGS"
  1230         dnl work around that we don't have Objective-C support in autoconf
  1231         CFLAGS="$CFLAGS -x objective-c"
  1232         AC_MSG_CHECKING(for Cocoa framework)
  1233         have_cocoa=no
  1234         AC_TRY_COMPILE([
  1235           #import <Cocoa/Cocoa.h>
  1236         ],[
  1237         ],[
  1238         have_cocoa=yes
  1239         ])
  1240         AC_MSG_RESULT($have_cocoa)
  1241         CFLAGS="$save_CFLAGS"
  1242         if test x$have_cocoa = xyes; then
  1243             AC_DEFINE(SDL_VIDEO_DRIVER_QUARTZ)
  1244             SOURCES="$SOURCES $srcdir/src/video/quartz/*.m"
  1245             have_video=yes
  1246         fi
  1247     fi
  1248 }
  1249 
  1250 dnl Find the framebuffer console includes
  1251 CheckFBCON()
  1252 {
  1253     AC_ARG_ENABLE(video-fbcon,
  1254 AC_HELP_STRING([--enable-video-fbcon], [use framebuffer console video driver [[default=yes]]]),
  1255                   , enable_video_fbcon=yes)
  1256     if test x$enable_video = xyes -a x$enable_video_fbcon = xyes; then
  1257         AC_MSG_CHECKING(for framebuffer console support)
  1258         video_fbcon=no
  1259         AC_TRY_COMPILE([
  1260          #include <linux/fb.h>
  1261          #include <linux/kd.h>
  1262          #include <linux/keyboard.h>
  1263         ],[
  1264         ],[
  1265         video_fbcon=yes
  1266         ])
  1267         AC_MSG_RESULT($video_fbcon)
  1268         if test x$video_fbcon = xyes; then
  1269             AC_CHECK_FUNCS(getpagesize)
  1270             AC_DEFINE(SDL_VIDEO_DRIVER_FBCON)
  1271             SOURCES="$SOURCES $srcdir/src/video/fbcon/*.c"
  1272             have_video=yes
  1273         fi
  1274     fi
  1275 }
  1276 
  1277 dnl Find DirectFB
  1278 CheckDirectFB()
  1279 {
  1280     AC_ARG_ENABLE(video-directfb,
  1281 AC_HELP_STRING([--enable-video-directfb], [use DirectFB video driver [[default=yes]]]),
  1282                   , enable_video_directfb=yes)
  1283     if test x$enable_video = xyes -a x$enable_video_directfb = xyes; then
  1284         video_directfb=no
  1285 
  1286         DIRECTFB_REQUIRED_VERSION=0.9.15
  1287 
  1288         AC_PATH_PROG(DIRECTFBCONFIG, directfb-config, no)
  1289         if test x$DIRECTFBCONFIG = xno; then
  1290             AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
  1291             if test x$PKG_CONFIG != xno; then
  1292                 if $PKG_CONFIG --atleast-pkgconfig-version 0.7 && $PKG_CONFIG --atleast-version $DIRECTFB_REQUIRED_VERSION directfb; then
  1293                     DIRECTFB_CFLAGS=`$PKG_CONFIG --cflags directfb`
  1294                     DIRECTFB_LIBS=`$PKG_CONFIG --libs directfb`
  1295                     video_directfb=yes
  1296                 fi
  1297             fi
  1298         else
  1299             set -- `echo $DIRECTFB_REQUIRED_VERSION | sed 's/\./ /g'`
  1300             NEED_VERSION=`expr $1 \* 10000 + $2 \* 100 + $3`
  1301             set -- `directfb-config --version | sed 's/\./ /g'`
  1302             HAVE_VERSION=`expr $1 \* 10000 + $2 \* 100 + $3`
  1303             if test $HAVE_VERSION -ge $NEED_VERSION; then
  1304                 DIRECTFB_CFLAGS=`$DIRECTFBCONFIG --cflags`
  1305                 DIRECTFB_LIBS=`$DIRECTFBCONFIG --libs`
  1306                 video_directfb=yes
  1307             fi
  1308         fi
  1309         if test x$video_directfb = xyes; then
  1310             # SuSE 11.1 installs directfb-config without directfb-devel
  1311             save_CFLAGS="$CFLAGS"
  1312             CFLAGS="$CFLAGS $DIRECTFB_CFLAGS"
  1313             AC_CHECK_HEADER(directfb.h, have_directfb_hdr=yes, have_directfb_hdr=no)
  1314             CFLAGS="$save_CFLAGS"
  1315             video_directfb=$have_directfb_hdr
  1316         fi
  1317         AC_MSG_CHECKING(for DirectFB $DIRECTFB_REQUIRED_VERSION support)
  1318         AC_MSG_RESULT($video_directfb)
  1319 
  1320         if test x$video_directfb = xyes; then
  1321             AC_DEFINE(SDL_VIDEO_DRIVER_DIRECTFB)
  1322             SOURCES="$SOURCES $srcdir/src/video/directfb/*.c"
  1323             EXTRA_CFLAGS="$EXTRA_CFLAGS $DIRECTFB_CFLAGS"
  1324             EXTRA_LDFLAGS="$EXTRA_LDFLAGS $DIRECTFB_LIBS"
  1325             have_video=yes
  1326         fi
  1327     fi
  1328 }
  1329 
  1330 dnl See if we're running on PlayStation 2 hardware
  1331 CheckPS2GS()
  1332 {
  1333     AC_ARG_ENABLE(video-ps2gs,
  1334 AC_HELP_STRING([--enable-video-ps2gs], [use PlayStation 2 GS video driver [[default=yes]]]),
  1335                   , enable_video_ps2gs=yes)
  1336     if test x$enable_video = xyes -a x$enable_video_ps2gs = xyes; then
  1337         AC_MSG_CHECKING(for PlayStation 2 GS support)
  1338         video_ps2gs=no
  1339         AC_TRY_COMPILE([
  1340          #include <linux/ps2/dev.h>
  1341          #include <linux/ps2/gs.h>
  1342         ],[
  1343         ],[
  1344         video_ps2gs=yes
  1345         ])
  1346         AC_MSG_RESULT($video_ps2gs)
  1347         if test x$video_ps2gs = xyes; then
  1348             AC_DEFINE(SDL_VIDEO_DRIVER_PS2GS)
  1349             SOURCES="$SOURCES $srcdir/src/video/ps2gs/*.c"
  1350             have_video=yes
  1351         fi
  1352     fi
  1353 }
  1354 
  1355 dnl See if we're running on PlayStation 3 Cell hardware
  1356 CheckPS3()
  1357 {
  1358   AC_ARG_ENABLE(video-ps3,
  1359                 AC_HELP_STRING([--enable-video-ps3], [use PlayStation 3 Cell driver [[default=yes]]]),
  1360                 , enable_video_ps3=yes)
  1361   if test x$enable_video = xyes -a x$enable_video_ps3 = xyes; then
  1362     AC_MSG_CHECKING(for PlayStation 3 Cell support)
  1363     video_ps3=no
  1364     AC_TRY_COMPILE([
  1365       #include <linux/fb.h>
  1366       #include <asm/ps3fb.h>
  1367     ],[
  1368     ],[
  1369       video_ps3=yes
  1370     ])
  1371     AC_MSG_RESULT($video_ps3)
  1372     if test x$video_ps3 = xyes; then
  1373       AC_DEFINE(SDL_VIDEO_DRIVER_PS3)
  1374       SOURCES="$SOURCES $srcdir/src/video/ps3/*.c"
  1375       EXTRA_CFLAGS="$EXTRA_CFLAGS -I/opt/cell/sdk/usr/include"
  1376       EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lbilin_scaler_spu -lfb_writer_spu -lyuv2rgb_spu -L/opt/cell/sdk/usr/lib -lspe2"
  1377       have_video=yes
  1378     fi
  1379   fi
  1380 }
  1381 
  1382 dnl Find the GGI includes
  1383 CheckGGI()
  1384 {
  1385     AC_ARG_ENABLE(video-ggi,
  1386 AC_HELP_STRING([--enable-video-ggi], [use GGI video driver [[default=no]]]),
  1387                   , enable_video_ggi=no)
  1388     if test x$enable_video = xyes -a x$enable_video_ggi = xyes; then
  1389         AC_MSG_CHECKING(for GGI support)
  1390         video_ggi=no
  1391         AC_TRY_COMPILE([
  1392          #include <ggi/ggi.h>
  1393          #include <ggi/gii.h>
  1394         ],[
  1395         ],[
  1396         video_ggi=yes
  1397         ])
  1398         AC_MSG_RESULT($video_ggi)
  1399         if test x$video_ggi = xyes; then
  1400             AC_DEFINE(SDL_VIDEO_DRIVER_GGI)
  1401             SOURCES="$SOURCES $srcdir/src/video/ggi/*.c"
  1402             EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lggi -lgii -lgg"
  1403             have_video=yes
  1404         fi
  1405     fi
  1406 }
  1407 
  1408 dnl Find the SVGAlib includes and libraries
  1409 CheckSVGA()
  1410 {
  1411     AC_ARG_ENABLE(video-svga,
  1412 AC_HELP_STRING([--enable-video-svga], [use SVGAlib video driver [[default=yes]]]),
  1413                   , enable_video_svga=yes)
  1414     if test x$enable_video = xyes -a x$enable_video_svga = xyes; then
  1415         AC_MSG_CHECKING(for SVGAlib (1.4.0+) support)
  1416         video_svga=no
  1417         AC_TRY_COMPILE([
  1418          #include <vga.h>
  1419          #include <vgamouse.h>
  1420          #include <vgakeyboard.h>
  1421         ],[
  1422          if ( SCANCODE_RIGHTWIN && SCANCODE_LEFTWIN ) {
  1423              exit(0);
  1424          }
  1425         ],[
  1426         video_svga=yes
  1427         ])
  1428         AC_MSG_RESULT($video_svga)
  1429         if test x$video_svga = xyes; then
  1430             AC_DEFINE(SDL_VIDEO_DRIVER_SVGALIB)
  1431             SOURCES="$SOURCES $srcdir/src/video/svga/*.c"
  1432             EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lvga"
  1433             have_video=yes
  1434         fi
  1435     fi
  1436 }
  1437 
  1438 dnl Find the VGL includes and libraries
  1439 CheckVGL()
  1440 {
  1441     AC_ARG_ENABLE(video-vgl,
  1442 AC_HELP_STRING([--enable-video-vgl], [use VGL video driver [[default=yes]]]),
  1443                   , enable_video_vgl=yes)
  1444     if test x$enable_video = xyes -a x$enable_video_vgl = xyes; then
  1445         AC_MSG_CHECKING(for libVGL support)
  1446         video_vgl=no
  1447         AC_TRY_COMPILE([
  1448          #include <sys/fbio.h>
  1449          #include <sys/consio.h>
  1450          #include <sys/kbio.h>
  1451          #include <vgl.h>
  1452         ],[
  1453          VGLBitmap bitmap;
  1454          bitmap.Type = VIDBUF32;
  1455          bitmap.PixelBytes = 4;
  1456          exit(bitmap.Bitmap);
  1457         ],[
  1458         video_vgl=yes
  1459         ])
  1460         AC_MSG_RESULT($video_vgl)
  1461         if test x$video_vgl = xyes; then
  1462             AC_DEFINE(SDL_VIDEO_DRIVER_VGL)
  1463             SOURCES="$SOURCES $srcdir/src/video/vgl/*.c"
  1464             EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lvgl"
  1465             have_video=yes
  1466         fi
  1467     fi
  1468 }
  1469 
  1470 dnl Set up the wscons video driver if enabled
  1471 CheckWscons()
  1472 {
  1473     AC_ARG_ENABLE(video-wscons,
  1474 AC_HELP_STRING([--enable-video-wscons], [use wscons video driver [[default=yes]]]),
  1475                   , enable_video_wscons=yes)
  1476     if test x$enable_video = xyes -a x$enable_video_wscons = xyes; then
  1477         AC_MSG_CHECKING(for wscons support)
  1478         video_wscons=no
  1479         AC_TRY_COMPILE([
  1480          #include <sys/time.h>
  1481          #include <dev/wscons/wsconsio.h>
  1482          #include <dev/wscons/wsdisplay_usl_io.h>
  1483         ],[
  1484          int wsmode = WSDISPLAYIO_MODE_DUMBFB;
  1485         ],[
  1486         video_wscons=yes
  1487         ])
  1488         AC_MSG_RESULT($video_wscons)
  1489         if test x$video_wscons = xyes; then
  1490             AC_DEFINE(SDL_VIDEO_DRIVER_WSCONS)
  1491             SOURCES="$SOURCES $srcdir/src/video/wscons/*.c"
  1492             have_video=yes
  1493         fi
  1494     fi
  1495 }
  1496 
  1497 
  1498 dnl Find the AAlib includes
  1499 CheckAAlib()
  1500 {
  1501     AC_ARG_ENABLE(video-aalib,
  1502 AC_HELP_STRING([--enable-video-aalib], [use AAlib video driver [[default=no]]]),
  1503                   , enable_video_aalib=no)
  1504     if test x$enable_video = xyes -a x$enable_video_aalib = xyes; then
  1505         AC_MSG_CHECKING(for AAlib support)
  1506         video_aalib=no
  1507         AC_TRY_COMPILE([
  1508          #include <aalib.h>
  1509         ],[
  1510         ],[
  1511         video_aalib=yes
  1512         ])
  1513         AC_MSG_RESULT($video_aalib)
  1514         if test x$video_aalib = xyes; then
  1515             AC_DEFINE(SDL_VIDEO_DRIVER_AALIB)
  1516             SOURCES="$SOURCES $srcdir/src/video/aalib/*.c"
  1517             EXTRA_LDFLAGS="$EXTRA_LDFLAGS -laa"
  1518             have_video=yes
  1519         fi
  1520     fi
  1521 }
  1522 
  1523 dnl Find the libcaca includes
  1524 CheckCaca()
  1525 {
  1526     AC_ARG_ENABLE(video-caca,
  1527 AC_HELP_STRING([--enable-video-caca], [use libcaca video driver [[default=no]]]),
  1528                   , enable_video_caca=no)
  1529     if test x$enable_video = xyes -a x$enable_video_caca = xyes; then
  1530         video_caca=no
  1531         AC_PATH_PROG(CACACONFIG, caca-config, no)
  1532         if test x$CACACONFIG != xno; then
  1533             AC_MSG_CHECKING(for libcaca support)
  1534             CACA_CFLAGS=`$CACACONFIG --cflags`
  1535             CACA_LDFLAGS=`$CACACONFIG --libs`
  1536             save_CFLAGS="$CFLAGS"
  1537             AC_TRY_COMPILE([
  1538              #include <caca.h>
  1539             ],[
  1540             ],[
  1541              video_caca=yes
  1542             ])
  1543             CFLAGS="$save_CFLAGS"
  1544             AC_MSG_RESULT($video_caca)
  1545             if test x$video_caca = xyes; then
  1546                 AC_DEFINE(SDL_VIDEO_DRIVER_CACA)
  1547                 EXTRA_CFLAGS="$EXTRA_CFLAGS $CACA_CFLAGS"
  1548                 EXTRA_LDFLAGS="$EXTRA_LDFLAGS $CACA_LDFLAGS"
  1549                 SOURCES="$SOURCES $srcdir/src/video/caca/*.c"
  1550             fi
  1551         fi
  1552     fi
  1553 }
  1554 
  1555 dnl Set up the QTopia video driver if enabled
  1556 CheckQtopia()
  1557 {
  1558     AC_ARG_ENABLE(video-qtopia,
  1559 AC_HELP_STRING([--enable-video-qtopia], [use Qtopia video driver [[default=no]]]),
  1560                   , enable_video_qtopia=no)
  1561     if test x$enable_video = xyes -a x$enable_video_qtopia = xyes; then
  1562         AC_MSG_CHECKING(for Qtopia support)
  1563         video_qtopia=no
  1564         QTOPIA_FLAGS="-DQT_QWS_EBX -DQT_QWS_CUSTOM -DQWS -I${QPEDIR}/include -I${QTDIR}/include/ -DNO_DEBUG -fno-rtti -fno-exceptions"
  1565         AC_LANG_CPLUSPLUS
  1566         OLD_CXX="$CXXFLAGS"
  1567         CXXFLAGS="$QTOPIA_FLAGS"
  1568         AC_TRY_COMPILE([
  1569          #include <qpe/qpeapplication.h>
  1570         ],[
  1571         ],[
  1572         video_qtopia=yes
  1573         ])
  1574         CXXFLAGS="$OLD_CXX"
  1575         AC_MSG_RESULT($video_qtopia)
  1576         if test x$video_qtopia = xyes; then
  1577             AC_DEFINE(SDL_VIDEO_DRIVER_QTOPIA)
  1578             SOURCES="$SOURCES $srcdir/src/video/qtopia/*.cc"
  1579             SDLMAIN_SOURCES="$srcdir/src/main/qtopia/*.cc"
  1580             EXTRA_CFLAGS="$EXTRA_CFLAGS $QTOPIA_FLAGS"
  1581             SDL_CFLAGS="$SDL_CFLAGS -DQWS -Dmain=SDL_main"
  1582             SDL_LIBS="-lSDLmain $SDL_LIBS -L${QPEDIR}/lib -L${QTDIR}/lib/ -lqpe -lqte"
  1583             have_video=yes
  1584         fi
  1585         AC_LANG_C
  1586     fi
  1587 }
  1588 
  1589 dnl Set up the PicoGUI video driver if enabled
  1590 CheckPicoGUI()
  1591 {
  1592     AC_ARG_ENABLE(video-picogui,
  1593 AC_HELP_STRING([--enable-video-picogui], [use PicoGUI video driver [[default=no]]]),
  1594                   , enable_video_picogui=no)
  1595     if test x$enable_video = xyes -a x$enable_video_picogui = xyes; then
  1596         AC_MSG_CHECKING(for PicoGUI support)
  1597         video_picogui=no
  1598         AC_TRY_COMPILE([
  1599          #include <picogui.h>
  1600         ],[
  1601         ],[
  1602         video_picogui=yes
  1603         ])
  1604         AC_MSG_RESULT($video_picogui)
  1605         if test x$video_picogui = xyes; then
  1606             AC_DEFINE(SDL_VIDEO_DRIVER_PICOGUI)
  1607             SOURCES="$SOURCES $srcdir/src/video/picogui/*.c"
  1608             SDL_LIBS="$SDL_LIBS -lpgui"
  1609             have_video=yes
  1610         fi
  1611     fi
  1612 }
  1613 
  1614 dnl Set up the Atari Bios keyboard driver
  1615 CheckAtariBiosEvent()
  1616 {
  1617     SOURCES="$SOURCES $srcdir/src/video/ataricommon/*.c"
  1618     SOURCES="$SOURCES $srcdir/src/video/ataricommon/*.S"
  1619 }
  1620 
  1621 dnl Set up the Atari Xbios driver
  1622 CheckAtariXbiosVideo()
  1623 {
  1624     AC_ARG_ENABLE(xbios,
  1625 AC_HELP_STRING([--enable-video-xbios], [use Atari Xbios video driver [[default=yes]]]),
  1626                   , enable_video_xbios=yes)
  1627     video_xbios=no
  1628     if test x$enable_video = xyes -a x$enable_video_xbios = xyes; then
  1629         video_xbios=yes
  1630         AC_DEFINE(SDL_VIDEO_DRIVER_XBIOS)
  1631         SOURCES="$SOURCES $srcdir/src/video/xbios/*.c"
  1632         have_video=yes
  1633     fi
  1634 }
  1635 
  1636 dnl Set up the Atari Gem driver
  1637 CheckAtariGemVideo()
  1638 {
  1639     AC_ARG_ENABLE(gem,
  1640 AC_HELP_STRING([--enable-video-gem], [use Atari Gem video driver [[default=yes]]]),
  1641                   , enable_video_gem=yes)
  1642     if test x$enable_video = xyes -a x$enable_video_gem = xyes; then
  1643         video_gem=no
  1644         AC_CHECK_HEADER(gem.h, have_gem_hdr=yes)
  1645         AC_CHECK_LIB(gem, appl_init, have_gem_lib=yes)
  1646         if test x$have_gem_hdr = xyes -a x$have_gem_lib = xyes; then
  1647             video_gem=yes
  1648             AC_DEFINE(SDL_VIDEO_DRIVER_GEM)
  1649             SOURCES="$SOURCES $srcdir/src/video/gem/*.c"
  1650             SDL_LIBS="$SDL_LIBS -lgem"
  1651             have_video=yes
  1652         fi
  1653     fi
  1654 }
  1655 
  1656 dnl rcg04172001 Set up the Null video driver.
  1657 CheckDummyVideo()
  1658 {
  1659     AC_ARG_ENABLE(video-dummy,
  1660 AC_HELP_STRING([--enable-video-dummy], [use dummy video driver [[default=yes]]]),
  1661                   , enable_video_dummy=yes)
  1662     if test x$enable_video_dummy = xyes; then
  1663         AC_DEFINE(SDL_VIDEO_DRIVER_DUMMY)
  1664         SOURCES="$SOURCES $srcdir/src/video/dummy/*.c"
  1665         have_video=yes
  1666     fi
  1667 }
  1668 
  1669 dnl Check to see if OpenGL support is desired
  1670 AC_ARG_ENABLE(video-opengl,
  1671 AC_HELP_STRING([--enable-video-opengl], [include OpenGL context creation [[default=yes]]]),
  1672               , enable_video_opengl=yes)
  1673 
  1674 dnl Find OpenGL
  1675 CheckOpenGLX11()
  1676 {
  1677     if test x$enable_video = xyes -a x$enable_video_opengl = xyes; then
  1678         AC_MSG_CHECKING(for OpenGL (GLX) support)
  1679         video_opengl=no
  1680         AC_TRY_COMPILE([
  1681          #include <GL/gl.h>
  1682          #include <GL/glx.h>
  1683          #include <GL/glu.h>
  1684         ],[
  1685         ],[
  1686         video_opengl=yes
  1687         ])
  1688         AC_MSG_RESULT($video_opengl)
  1689         if test x$video_opengl = xyes; then
  1690             AC_DEFINE(SDL_VIDEO_OPENGL)
  1691             AC_DEFINE(SDL_VIDEO_OPENGL_GLX)
  1692         fi
  1693     fi
  1694 }
  1695 
  1696 dnl Find QNX RtP OpenGL
  1697 CheckOpenGLQNX()
  1698 {
  1699     if test x$enable_video = xyes -a x$enable_video_opengl = xyes; then
  1700         AC_MSG_CHECKING(for OpenGL (Photon) support)
  1701         video_opengl=no
  1702         AC_TRY_COMPILE([
  1703          #include <GL/gl.h>
  1704         ],[
  1705         ],[
  1706         video_opengl=yes
  1707         ])
  1708         AC_MSG_RESULT($video_opengl)
  1709         if test x$video_opengl = xyes; then
  1710             AC_DEFINE(SDL_VIDEO_OPENGL)
  1711             EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lGL"
  1712         fi
  1713     fi
  1714 }
  1715 
  1716 dnl Check for Win32 OpenGL
  1717 CheckWIN32GL()
  1718 {
  1719     if test x$enable_video = xyes -a x$enable_video_opengl = xyes; then
  1720         AC_DEFINE(SDL_VIDEO_OPENGL)
  1721         AC_DEFINE(SDL_VIDEO_OPENGL_WGL)
  1722     fi
  1723 }
  1724 
  1725 dnl Check for BeOS OpenGL
  1726 CheckBeGL()
  1727 {
  1728     if test x$enable_video = xyes -a x$enable_video_opengl = xyes; then
  1729         AC_DEFINE(SDL_VIDEO_OPENGL)
  1730         EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lGL"
  1731     fi
  1732 }
  1733 
  1734 dnl Check for MacOS OpenGL
  1735 CheckMacGL()
  1736 {
  1737     if test x$enable_video = xyes -a x$enable_video_opengl = xyes; then
  1738         AC_DEFINE(SDL_VIDEO_OPENGL)
  1739         case "$host" in
  1740             *-*-darwin*)
  1741                 if test x$enable_video_cocoa = xyes; then
  1742                     EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,OpenGL"
  1743                 fi
  1744                 if test x$enable_video_carbon = xyes; then
  1745                     EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,AGL"
  1746                 fi
  1747         esac
  1748     fi
  1749 }
  1750 
  1751 dnl Check for Mesa offscreen rendering
  1752 CheckAtariOSMesa()
  1753 {
  1754     if test "x$enable_video" = "xyes" -a "x$enable_video_opengl" = "xyes"; then
  1755         AC_CHECK_HEADER(GL/osmesa.h, have_osmesa_hdr=yes)
  1756         AC_CHECK_LIB(OSMesa, OSMesaCreateContext, have_osmesa_lib=yes, have_osmesa_lib=no, -lm)
  1757 
  1758         # Static linking to -lOSMesa
  1759         AC_PATH_PROG(OSMESA_CONFIG, osmesa-config, no)
  1760         if test "x$OSMESA_CONFIG" = "xno" -o "x$enable_atari_ldg" = "xno"; then
  1761             # -lOSMesa is really the static library
  1762             if test "x$have_osmesa_hdr" = "xyes" -a "x$have_osmesa_lib" = "xyes"; then
  1763                 OSMESA_LIBS="-lOSMesa"
  1764             fi
  1765         else
  1766             # -lOSMesa is a loader for OSMesa.ldg
  1767             OSMESA_CFLAGS=`$OSMESA_CONFIG --cflags`
  1768             OSMESA_LIBS=`$OSMESA_CONFIG --libs`
  1769         fi
  1770         AC_DEFINE(SDL_VIDEO_OPENGL)
  1771         AC_DEFINE(SDL_VIDEO_OPENGL_OSMESA)
  1772         SDL_CFLAGS="$SDL_CFLAGS $OSMESA_CFLAGS"
  1773         SDL_LIBS="$SDL_LIBS $OSMESA_LIBS"
  1774 
  1775         AC_ARG_ENABLE(osmesa-shared,
  1776 AC_HELP_STRING([--enable-osmesa-shared], [dynamically load OSMesa OpenGL support [[default=yes]]]),
  1777                               , enable_osmesa_shared=yes)
  1778         if test "x$enable_osmesa_shared" = "xyes" -a "x$enable_atari_ldg" = "xyes"; then
  1779             # Dynamic linking
  1780             if test "x$have_osmesa_hdr" = "xyes"; then
  1781                 AC_DEFINE(SDL_VIDEO_OPENGL_OSMESA_DYNAMIC)
  1782             fi
  1783         fi
  1784     fi
  1785 }
  1786 
  1787 AC_ARG_ENABLE(screensaver,
  1788 AC_HELP_STRING([--enable-screensaver], [enable screensaver by default while any SDL application is running [[default=no]]]),
  1789               , enable_screensaver=no)
  1790 if test x$enable_screensaver = xno; then
  1791     AC_DEFINE(SDL_VIDEO_DISABLE_SCREENSAVER)
  1792 fi
  1793 
  1794 dnl See if we can use the new unified event interface in Linux 2.4
  1795 CheckInputEvents()
  1796 {
  1797     dnl Check for Linux 2.4 unified input event interface support
  1798     AC_ARG_ENABLE(input-events,
  1799 AC_HELP_STRING([--enable-input-events], [use Linux 2.4 unified input interface [[default=yes]]]),
  1800                   , enable_input_events=yes)
  1801     if test x$enable_input_events = xyes; then
  1802         AC_MSG_CHECKING(for Linux 2.4 unified input interface)
  1803         use_input_events=no
  1804         AC_TRY_COMPILE([
  1805           #include <linux/input.h>
  1806         ],[
  1807           #ifndef EVIOCGNAME
  1808           #error EVIOCGNAME() ioctl not available
  1809           #endif
  1810         ],[
  1811         use_input_events=yes
  1812         ])
  1813         AC_MSG_RESULT($use_input_events)
  1814         if test x$use_input_events = xyes; then
  1815             AC_DEFINE(SDL_INPUT_LINUXEV)
  1816         fi
  1817     fi
  1818 }
  1819 
  1820 dnl See if we can use the Touchscreen input library
  1821 CheckTslib()
  1822 {
  1823     AC_ARG_ENABLE(input-tslib,
  1824 AC_HELP_STRING([--enable-input-tslib], [use the Touchscreen library for input [[default=yes]]]),
  1825                   , enable_input_tslib=yes)
  1826     if test x$enable_input_tslib = xyes; then
  1827         AC_MSG_CHECKING(for Touchscreen library support)
  1828         enable_input_tslib=no
  1829         AC_TRY_COMPILE([
  1830           #include "tslib.h"
  1831         ],[
  1832         ],[
  1833         enable_input_tslib=yes
  1834         ])
  1835         AC_MSG_RESULT($enable_input_tslib)
  1836         if test x$enable_input_tslib = xyes; then
  1837             AC_DEFINE(SDL_INPUT_TSLIB)
  1838             EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lts"
  1839         fi
  1840     fi
  1841 }
  1842 
  1843 dnl See if we can use GNU pth library for threads
  1844 CheckPTH()
  1845 {
  1846     dnl Check for pth support
  1847     AC_ARG_ENABLE(pth,
  1848 AC_HELP_STRING([--enable-pth], [use GNU pth library for multi-threading [[default=yes]]]),
  1849                   , enable_pth=yes)
  1850     if test x$enable_threads = xyes -a x$enable_pth = xyes; then
  1851         AC_PATH_PROG(PTH_CONFIG, pth-config, no)
  1852         if test "$PTH_CONFIG" = "no"; then
  1853             use_pth=no
  1854         else
  1855             use_pth=yes
  1856         fi
  1857         AC_MSG_CHECKING(pth)
  1858         AC_MSG_RESULT($use_pth)
  1859         if test "x$use_pth" = xyes; then
  1860             AC_DEFINE(SDL_THREAD_PTH)
  1861             SOURCES="$SOURCES $srcdir/src/thread/pth/*.c"
  1862             SOURCES="$SOURCES $srcdir/src/thread/generic/SDL_syssem.c"
  1863             SDL_CFLAGS="$SDL_CFLAGS `$PTH_CONFIG --cflags`"
  1864             SDL_LIBS="$SDL_LIBS `$PTH_CONFIG --libs --all`"
  1865             have_threads=yes
  1866         fi
  1867     fi
  1868 }
  1869 
  1870 dnl See what type of thread model to use on Linux and Solaris
  1871 CheckPTHREAD()
  1872 {
  1873     dnl Check for pthread support
  1874     AC_ARG_ENABLE(pthreads,
  1875 AC_HELP_STRING([--enable-pthreads], [use POSIX threads for multi-threading [[default=yes]]]),
  1876                   , enable_pthreads=yes)
  1877     dnl This is used on Linux for glibc binary compatibility (Doh!)
  1878     AC_ARG_ENABLE(pthread-sem,
  1879 AC_HELP_STRING([--enable-pthread-sem], [use pthread semaphores [[default=yes]]]),
  1880                   , enable_pthread_sem=yes)
  1881     case "$host" in
  1882         *-*-linux*|*-*-uclinux*)
  1883             pthread_cflags="-D_REENTRANT"
  1884             pthread_lib="-lpthread"
  1885             ;;
  1886         *-*-bsdi*)
  1887             pthread_cflags="-D_REENTRANT -D_THREAD_SAFE"
  1888             pthread_lib=""
  1889             ;;
  1890         *-*-darwin*)
  1891             pthread_cflags="-D_THREAD_SAFE"
  1892 # causes Carbon.p complaints?
  1893 #            pthread_cflags="-D_REENTRANT -D_THREAD_SAFE"
  1894             ;;
  1895         *-*-freebsd*|*-*-dragonfly*)
  1896             pthread_cflags="-D_REENTRANT -D_THREAD_SAFE"
  1897             pthread_lib="-pthread"
  1898             ;;
  1899         *-*-netbsd*)
  1900             pthread_cflags="-D_REENTRANT -D_THREAD_SAFE"
  1901             pthread_lib="-lpthread"
  1902             ;;
  1903         *-*-openbsd*)
  1904             pthread_cflags="-D_REENTRANT"
  1905             pthread_lib="-pthread"
  1906             ;;
  1907         *-*-solaris*)
  1908             pthread_cflags="-D_REENTRANT"
  1909             pthread_lib="-lpthread -lposix4"
  1910             ;;
  1911         *-*-sysv5*)
  1912             pthread_cflags="-D_REENTRANT -Kthread"
  1913             pthread_lib=""
  1914             ;;
  1915         *-*-irix*)
  1916             pthread_cflags="-D_SGI_MP_SOURCE"
  1917             pthread_lib="-lpthread"
  1918             ;;
  1919         *-*-aix*)
  1920             pthread_cflags="-D_REENTRANT -mthreads"
  1921             pthread_lib="-lpthread"
  1922             ;;
  1923         *-*-hpux11*)
  1924             pthread_cflags="-D_REENTRANT"
  1925             pthread_lib="-L/usr/lib -lpthread"
  1926             ;;
  1927         *-*-qnx*)
  1928             pthread_cflags=""
  1929             pthread_lib=""
  1930             ;;
  1931         *-*-osf*)
  1932             pthread_cflags="-D_REENTRANT"
  1933             if test x$ac_cv_prog_gcc = xyes; then
  1934                 pthread_lib="-lpthread -lrt"
  1935             else
  1936                 pthread_lib="-lpthread -lexc -lrt"
  1937             fi
  1938             ;;
  1939         *)
  1940             pthread_cflags="-D_REENTRANT"
  1941             pthread_lib="-lpthread"
  1942             ;;
  1943     esac
  1944     if test x$enable_threads = xyes -a x$enable_pthreads = xyes -a x$enable_ipod != xyes; then
  1945         # Save the original compiler flags and libraries
  1946         ac_save_cflags="$CFLAGS"; ac_save_libs="$LIBS"
  1947         # Add the pthread compiler flags and libraries
  1948         CFLAGS="$CFLAGS $pthread_cflags"; LIBS="$LIBS $pthread_lib"
  1949         # Check to see if we have pthread support on this system
  1950         AC_MSG_CHECKING(for pthreads)
  1951         use_pthreads=no
  1952         AC_TRY_LINK([
  1953          #include <pthread.h>
  1954         ],[
  1955          pthread_attr_t type;
  1956          pthread_attr_init(&type);
  1957         ],[
  1958         use_pthreads=yes
  1959         ])
  1960         AC_MSG_RESULT($use_pthreads)
  1961         # Restore the compiler flags and libraries
  1962         CFLAGS="$ac_save_cflags"; LIBS="$ac_save_libs"
  1963 
  1964         # Do futher testing if we have pthread support...
  1965         if test x$use_pthreads = xyes; then
  1966             AC_DEFINE(SDL_THREAD_PTHREAD)
  1967             EXTRA_CFLAGS="$EXTRA_CFLAGS $pthread_cflags"
  1968             EXTRA_LDFLAGS="$EXTRA_LDFLAGS $pthread_lib"
  1969             SDL_CFLAGS="$SDL_CFLAGS $pthread_cflags"
  1970             SDL_LIBS="$SDL_LIBS $pthread_lib"
  1971 
  1972             # Save the original compiler flags and libraries
  1973             ac_save_cflags="$CFLAGS"; ac_save_libs="$LIBS"
  1974             # Add the pthread compiler flags and libraries
  1975             CFLAGS="$CFLAGS $pthread_cflags"; LIBS="$LIBS $pthread_lib"
  1976 
  1977             # Check to see if recursive mutexes are available
  1978             AC_MSG_CHECKING(for recursive mutexes)
  1979             has_recursive_mutexes=no
  1980             if test x$has_recursive_mutexes = xno; then
  1981                 AC_TRY_COMPILE([
  1982                   #include <pthread.h>
  1983                 ],[
  1984                   pthread_mutexattr_t attr;
  1985                   pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
  1986                 ],[
  1987                 has_recursive_mutexes=yes
  1988                 AC_DEFINE(SDL_THREAD_PTHREAD_RECURSIVE_MUTEX)
  1989                 ])
  1990             fi
  1991             if test x$has_recursive_mutexes = xno; then
  1992                 AC_TRY_COMPILE([
  1993                   #include <pthread.h>
  1994                 ],[
  1995                   pthread_mutexattr_t attr;
  1996                   pthread_mutexattr_setkind_np(&attr, PTHREAD_MUTEX_RECURSIVE_NP);
  1997                 ],[
  1998                 has_recursive_mutexes=yes
  1999                 AC_DEFINE(SDL_THREAD_PTHREAD_RECURSIVE_MUTEX_NP)
  2000                 ])
  2001             fi
  2002             AC_MSG_RESULT($has_recursive_mutexes)
  2003 
  2004             # Check to see if pthread semaphore support is missing
  2005             if test x$enable_pthread_sem = xyes; then
  2006                 AC_MSG_CHECKING(for pthread semaphores)
  2007                 have_pthread_sem=no
  2008                 AC_TRY_COMPILE([
  2009                   #include <pthread.h>
  2010                   #include <semaphore.h>
  2011                 ],[
  2012                 ],[
  2013                 have_pthread_sem=yes
  2014                 ])
  2015                 AC_MSG_RESULT($have_pthread_sem)
  2016             fi
  2017 
  2018             # Restore the compiler flags and libraries
  2019             CFLAGS="$ac_save_cflags"; LIBS="$ac_save_libs"
  2020 
  2021             # Basic thread creation functions
  2022             SOURCES="$SOURCES $srcdir/src/thread/pthread/SDL_systhread.c"
  2023 
  2024             # Semaphores
  2025             # We can fake these with mutexes and condition variables if necessary
  2026             if test x$have_pthread_sem = xyes; then
  2027                 SOURCES="$SOURCES $srcdir/src/thread/pthread/SDL_syssem.c"
  2028             else
  2029                 SOURCES="$SOURCES $srcdir/src/thread/generic/SDL_syssem.c"
  2030             fi
  2031 
  2032             # Mutexes
  2033             # We can fake these with semaphores if necessary
  2034             SOURCES="$SOURCES $srcdir/src/thread/pthread/SDL_sysmutex.c"
  2035 
  2036             # Condition variables
  2037             # We can fake these with semaphores and mutexes if necessary
  2038             SOURCES="$SOURCES $srcdir/src/thread/pthread/SDL_syscond.c"
  2039 
  2040             have_threads=yes
  2041         else
  2042             CheckPTH
  2043         fi
  2044     fi
  2045 }
  2046 
  2047 dnl Determine whether the compiler can produce Win32 executables
  2048 CheckWIN32()
  2049 {
  2050     AC_MSG_CHECKING(Win32 compiler)
  2051     have_win32_gcc=no
  2052     AC_TRY_COMPILE([
  2053      #include <windows.h>
  2054     ],[
  2055     ],[
  2056     have_win32_gcc=yes
  2057     ])
  2058     AC_MSG_RESULT($have_win32_gcc)
  2059     if test x$have_win32_gcc != xyes; then
  2060        AC_MSG_ERROR([
  2061 *** Your compiler ($CC) does not produce Win32 executables!
  2062        ])
  2063     fi
  2064 
  2065     dnl See if the user wants to redirect standard output to files
  2066     AC_ARG_ENABLE(stdio-redirect,
  2067 AC_HELP_STRING([--enable-stdio-redirect], [Redirect STDIO to files on Win32 [[default=yes]]]),
  2068                   , enable_stdio_redirect=yes)
  2069     if test x$enable_stdio_redirect != xyes; then
  2070         EXTRA_CFLAGS="$EXTRA_CFLAGS -DNO_STDIO_REDIRECT"
  2071     fi
  2072 
  2073     if test x$enable_video = xyes; then
  2074         AC_DEFINE(SDL_VIDEO_DRIVER_WINDIB)
  2075         SOURCES="$SOURCES $srcdir/src/video/wincommon/*.c"
  2076         SOURCES="$SOURCES $srcdir/src/video/windib/*.c"
  2077         have_video=yes
  2078     fi
  2079 }
  2080 
  2081 dnl Find the DirectX includes and libraries
  2082 CheckDIRECTX()
  2083 {
  2084     AC_ARG_ENABLE(directx,
  2085 AC_HELP_STRING([--enable-directx], [use DirectX for Win32 audio/video [[default=yes]]]),
  2086                   , enable_directx=yes)
  2087     if test x$enable_directx = xyes; then
  2088         have_directx=no
  2089         AC_CHECK_HEADER(ddraw.h, have_ddraw=yes)
  2090         AC_CHECK_HEADER(dsound.h, have_dsound=yes)
  2091         AC_CHECK_HEADER(dinput.h, use_dinput=yes)
  2092         if test x$have_ddraw = xyes -a x$have_dsound = xyes -a x$use_dinput = xyes; then
  2093             have_directx=yes
  2094         fi
  2095         if test x$enable_video = xyes -a x$have_directx = xyes; then
  2096             AC_DEFINE(SDL_VIDEO_DRIVER_DDRAW)
  2097             SOURCES="$SOURCES $srcdir/src/video/windx5/*.c"
  2098             have_video=yes
  2099         fi
  2100     fi
  2101 }
  2102 
  2103 dnl Check for the dlfcn.h interface for dynamically loading objects
  2104 CheckDLOPEN()
  2105 {
  2106     AC_ARG_ENABLE(sdl-dlopen,
  2107 AC_HELP_STRING([--enable-sdl-dlopen], [use dlopen for shared object loading [[default=yes]]]),
  2108                   , enable_sdl_dlopen=yes)
  2109     if test x$enable_sdl_dlopen = xyes; then
  2110         AC_MSG_CHECKING(for dlopen)
  2111         have_dlopen=no
  2112         AC_TRY_COMPILE([
  2113          #include <dlfcn.h>
  2114         ],[
  2115          #if defined(MAC_OS_X_VERSION_MIN_REQUIRED) && MAC_OS_X_VERSION_MIN_REQUIRED <= 1020
  2116          #error Use dlcompat for Mac OS X 10.2 compatibility
  2117          #endif
  2118         ],[
  2119         have_dlopen=yes
  2120         ])
  2121         AC_MSG_RESULT($have_dlopen)
  2122 
  2123         if test x$have_dlopen = xyes; then
  2124             AC_CHECK_LIB(c, dlopen, EXTRA_LDFLAGS="$EXTRA_LDFLAGS",
  2125                AC_CHECK_LIB(dl, dlopen, EXTRA_LDFLAGS="$EXTRA_LDFLAGS -ldl",
  2126                   AC_CHECK_LIB(ltdl, dlopen, EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lltdl")))
  2127             AC_CHECK_LIB(dl, dlvsym, have_dlvsym=yes)
  2128             if test x$have_dlvsym = xyes; then
  2129                 AC_DEFINE(HAVE_DLVSYM)
  2130             fi
  2131             AC_DEFINE(SDL_LOADSO_DLOPEN)
  2132             SOURCES="$SOURCES $srcdir/src/loadso/dlopen/*.c"
  2133             have_loadso=yes
  2134         fi
  2135     fi
  2136 }
  2137 
  2138 dnl Set up the Atari LDG (shared object loader)
  2139 CheckAtariLdg()
  2140 {
  2141     AC_ARG_ENABLE(atari-ldg,
  2142 AC_HELP_STRING([--enable-atari-ldg], [use Atari LDG for shared object loading [[default=yes]]]),
  2143                   , enable_atari_ldg=yes)
  2144     if test x$video_gem = xyes -a x$enable_atari_ldg = xyes; then
  2145         AC_CHECK_HEADER(ldg.h, have_ldg_hdr=yes)
  2146         AC_CHECK_LIB(ldg, ldg_open, have_ldg_lib=yes, have_ldg_lib=no, -lgem)
  2147         if test x$have_ldg_hdr = xyes -a x$have_ldg_lib = xyes; then
  2148             AC_DEFINE(SDL_LOADSO_LDG)
  2149             SOURCES="$SOURCES $srcdir/src/loadso/mint/*.c"
  2150             SDL_LIBS="$SDL_LIBS -lldg -lgem"
  2151             have_loadso=yes
  2152         fi
  2153     fi
  2154 }
  2155 
  2156 dnl Check for the usbhid(3) library on *BSD
  2157 CheckUSBHID()
  2158 {
  2159     if test x$enable_joystick = xyes; then
  2160         AC_CHECK_LIB(usbhid, hid_init, have_libusbhid=yes)
  2161         if test x$have_libusbhid = xyes; then
  2162             AC_CHECK_HEADER(usbhid.h, [USB_CFLAGS="-DHAVE_USBHID_H"])
  2163             AC_CHECK_HEADER(libusbhid.h, [USB_CFLAGS="-DHAVE_LIBUSBHID_H"])
  2164             USB_LIBS="$USB_LIBS -lusbhid"
  2165         else
  2166             AC_CHECK_HEADER(usb.h, [USB_CFLAGS="-DHAVE_USB_H"])
  2167             AC_CHECK_HEADER(libusb.h, [USB_CFLAGS="-DHAVE_LIBUSB_H"])
  2168             AC_CHECK_LIB(usb, hid_init, [USB_LIBS="$USB_LIBS -lusb"])
  2169         fi
  2170             
  2171         save_CFLAGS="$CFLAGS"
  2172         CFLAGS="$CFLAGS $USB_CFLAGS"
  2173 
  2174         AC_MSG_CHECKING(for usbhid)
  2175         have_usbhid=no
  2176         AC_TRY_COMPILE([
  2177           #include <sys/types.h>
  2178           #if defined(HAVE_USB_H)
  2179           #include <usb.h>
  2180           #endif
  2181           #ifdef __DragonFly__
  2182           # include <bus/usb/usb.h>
  2183           # include <bus/usb/usbhid.h>
  2184           #else
  2185           # include <dev/usb/usb.h>
  2186           # include <dev/usb/usbhid.h>
  2187           #endif
  2188           #if defined(HAVE_USBHID_H)
  2189           #include <usbhid.h>
  2190           #elif defined(HAVE_LIBUSB_H)
  2191           #include <libusb.h>
  2192           #elif defined(HAVE_LIBUSBHID_H)
  2193           #include <libusbhid.h>
  2194           #endif
  2195         ],[
  2196           struct report_desc *repdesc;
  2197           struct usb_ctl_report *repbuf;
  2198           hid_kind_t hidkind;
  2199         ],[
  2200         have_usbhid=yes
  2201         ])
  2202         AC_MSG_RESULT($have_usbhid)
  2203 
  2204         if test x$have_usbhid = xyes; then
  2205             AC_MSG_CHECKING(for ucr_data member of usb_ctl_report)
  2206             have_usbhid_ucr_data=no
  2207             AC_TRY_COMPILE([
  2208               #include <sys/types.h>
  2209               #if defined(HAVE_USB_H)
  2210               #include <usb.h>
  2211               #endif
  2212               #ifdef __DragonFly__
  2213               # include <bus/usb/usb.h>
  2214               # include <bus/usb/usbhid.h>
  2215               #else
  2216               # include <dev/usb/usb.h>
  2217               # include <dev/usb/usbhid.h>
  2218               #endif
  2219               #if defined(HAVE_USBHID_H)
  2220               #include <usbhid.h>
  2221               #elif defined(HAVE_LIBUSB_H)
  2222               #include <libusb.h>
  2223               #elif defined(HAVE_LIBUSBHID_H)
  2224               #include <libusbhid.h>
  2225               #endif
  2226             ],[
  2227               struct usb_ctl_report buf;
  2228               if (buf.ucr_data) { }
  2229             ],[
  2230             have_usbhid_ucr_data=yes
  2231             ])
  2232             if test x$have_usbhid_ucr_data = xyes; then
  2233                 USB_CFLAGS="$USB_CFLAGS -DUSBHID_UCR_DATA"
  2234             fi
  2235             AC_MSG_RESULT($have_usbhid_ucr_data)
  2236             
  2237             AC_MSG_CHECKING(for new usbhid API)
  2238             have_usbhid_new=no
  2239             AC_TRY_COMPILE([
  2240               #include <sys/types.h>
  2241               #if defined(HAVE_USB_H)
  2242               #include <usb.h>
  2243               #endif
  2244               #ifdef __DragonFly__
  2245               #include <bus/usb/usb.h>
  2246               #include <bus/usb/usbhid.h>
  2247               #else
  2248               #include <dev/usb/usb.h>
  2249               #include <dev/usb/usbhid.h>
  2250               #endif
  2251               #if defined(HAVE_USBHID_H)
  2252               #include <usbhid.h>
  2253               #elif defined(HAVE_LIBUSB_H)
  2254               #include <libusb.h>
  2255               #elif defined(HAVE_LIBUSBHID_H)
  2256               #include <libusbhid.h>
  2257               #endif
  2258             ],[
  2259               report_desc_t d;
  2260               hid_start_parse(d, 1, 1);
  2261             ],[
  2262             have_usbhid_new=yes
  2263             ])
  2264             if test x$have_usbhid_new = xyes; then
  2265                 USB_CFLAGS="$USB_CFLAGS -DUSBHID_NEW"
  2266             fi
  2267             AC_MSG_RESULT($have_usbhid_new)
  2268 
  2269             AC_MSG_CHECKING(for struct joystick in machine/joystick.h)
  2270             have_machine_joystick=no
  2271             AC_TRY_COMPILE([
  2272               #include <machine/joystick.h>
  2273             ],[
  2274               struct joystick t;
  2275             ],[
  2276             have_machine_joystick=yes
  2277             ])
  2278             if test x$have_machine_joystick = xyes; then
  2279                 AC_DEFINE(SDL_JOYSTICK_USBHID_MACHINE_JOYSTICK_H)
  2280             fi
  2281             AC_MSG_RESULT($have_machine_joystick)
  2282 
  2283             AC_DEFINE(SDL_JOYSTICK_USBHID)
  2284             SOURCES="$SOURCES $srcdir/src/joystick/bsd/*.c"
  2285             EXTRA_CFLAGS="$EXTRA_CFLAGS $USB_CFLAGS"
  2286             EXTRA_LDFLAGS="$EXTRA_LDFLAGS $USB_LIBS"
  2287             have_joystick=yes
  2288         fi
  2289         CFLAGS="$save_CFLAGS"
  2290     fi
  2291 }
  2292 
  2293 dnl Check for clock_gettime()
  2294 CheckClockGettime()
  2295 {
  2296     AC_ARG_ENABLE(clock_gettime,
  2297 AC_HELP_STRING([--enable-clock_gettime], [use clock_gettime() instead of gettimeofday() on UNIX [[default=no]]]),
  2298                   , enable_clock_gettime=no)
  2299     if test x$enable_clock_gettime = xyes; then
  2300         AC_CHECK_LIB(rt, clock_gettime, have_clock_gettime=yes)
  2301         if test x$have_clock_gettime = xyes; then
  2302             AC_DEFINE(HAVE_CLOCK_GETTIME)
  2303             EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lrt"
  2304         fi
  2305     fi
  2306 }
  2307 
  2308 dnl Check for a valid linux/version.h
  2309 CheckLinuxVersion()
  2310 {
  2311     AC_CHECK_HEADER(linux/version.h, have_linux_version_h=yes)
  2312     if test x$have_linux_version_h = xyes; then
  2313         EXTRA_CFLAGS="$EXTRA_CFLAGS -DHAVE_LINUX_VERSION_H"
  2314     fi
  2315 }
  2316 
  2317 dnl Check if we want to use RPATH
  2318 CheckRPATH()
  2319 {
  2320     AC_ARG_ENABLE(rpath,
  2321 AC_HELP_STRING([--enable-rpath], [use an rpath when linking SDL [[default=yes]]]),
  2322                   , enable_rpath=yes)
  2323 }
  2324 
  2325 dnl Set up the configuration based on the host platform!
  2326 case "$host" in
  2327     arm-*-elf*) # FIXME: Can we get more specific for iPodLinux?
  2328         ARCH=linux
  2329         CheckDummyVideo
  2330         CheckIPod
  2331         # Set up files for the timer library
  2332         if test x$enable_timers = xyes; then
  2333             AC_DEFINE(SDL_TIMER_UNIX)
  2334             SOURCES="$SOURCES $srcdir/src/timer/unix/*.c"
  2335             have_timers=yes
  2336         fi
  2337         ;;
  2338     *-*-linux*|*-*-uclinux*|*-*-gnu*|*-*-k*bsd*-gnu|*-*-bsdi*|*-*-freebsd*|*-*-dragonfly*|*-*-netbsd*|*-*-openbsd*|*-*-sysv5*|*-*-solaris*|*-*-hpux*|*-*-irix*|*-*-aix*|*-*-osf*)
  2339         case "$host" in
  2340             *-*-linux*)         ARCH=linux ;;
  2341             *-*-uclinux*)       ARCH=linux ;;
  2342             *-*-kfreebsd*-gnu)  ARCH=kfreebsd-gnu ;;
  2343             *-*-knetbsd*-gnu)   ARCH=knetbsd-gnu ;;
  2344             *-*-kopenbsd*-gnu)  ARCH=kopenbsd-gnu ;;
  2345             *-*-gnu*)           ARCH=gnu ;; # must be last of the gnu variants
  2346             *-*-bsdi*)          ARCH=bsdi ;;
  2347             *-*-freebsd*)       ARCH=freebsd ;;
  2348             *-*-dragonfly*)     ARCH=freebsd ;;
  2349             *-*-netbsd*)        ARCH=netbsd ;;
  2350             *-*-openbsd*)       ARCH=openbsd ;;
  2351             *-*-sysv5*)         ARCH=sysv5 ;;
  2352             *-*-solaris*)       ARCH=solaris ;;
  2353             *-*-hpux*)          ARCH=hpux ;;
  2354             *-*-irix*)          ARCH=irix ;;
  2355             *-*-aix*)           ARCH=aix ;;
  2356             *-*-osf*)           ARCH=osf ;;
  2357         esac
  2358         CheckVisibilityHidden
  2359         CheckDummyVideo
  2360         CheckDiskAudio
  2361         CheckDummyAudio
  2362         CheckDLOPEN
  2363         CheckNASM
  2364         CheckAltivec
  2365         CheckOSS
  2366         CheckDMEDIA
  2367         CheckMME
  2368         CheckALSA
  2369         CheckARTSC
  2370         CheckESD
  2371         CheckPulseAudio
  2372         CheckNAS
  2373         CheckX11
  2374         CheckNANOX
  2375         CheckFBCON
  2376         CheckDirectFB
  2377         CheckPS2GS
  2378         CheckPS3
  2379         CheckGGI
  2380         CheckSVGA
  2381         CheckVGL
  2382         CheckWscons
  2383         CheckAAlib
  2384         CheckCaca
  2385         CheckQtopia
  2386         CheckPicoGUI
  2387         CheckOpenGLX11
  2388         CheckInputEvents
  2389         CheckTslib
  2390         CheckUSBHID
  2391         CheckPTHREAD
  2392         CheckClockGettime
  2393         CheckLinuxVersion
  2394         CheckRPATH
  2395         # Set up files for the audio library
  2396         if test x$enable_audio = xyes; then
  2397           case $ARCH in
  2398             sysv5|solaris|hpux)
  2399                 AC_DEFINE(SDL_AUDIO_DRIVER_SUNAUDIO)
  2400                 SOURCES="$SOURCES $srcdir/src/audio/sun/*.c"
  2401                 have_audio=yes
  2402             ;;
  2403             netbsd|openbsd)
  2404                 AC_DEFINE(SDL_AUDIO_DRIVER_BSD)
  2405                 SOURCES="$SOURCES $srcdir/src/audio/bsd/*.c"
  2406                 have_audio=yes
  2407             ;;
  2408             aix)
  2409                 AC_DEFINE(SDL_AUDIO_DRIVER_PAUD)
  2410                 SOURCES="$SOURCES $srcdir/src/audio/paudio/*.c"
  2411                 have_audio=yes
  2412             ;;
  2413           esac
  2414         fi
  2415         # Set up files for the joystick library
  2416         if test x$enable_joystick = xyes; then
  2417           case $ARCH in
  2418             linux)
  2419                 AC_DEFINE(SDL_JOYSTICK_LINUX)
  2420                 SOURCES="$SOURCES $srcdir/src/joystick/linux/*.c"
  2421                 have_joystick=yes
  2422             ;;
  2423           esac
  2424         fi
  2425         # Set up files for the cdrom library
  2426         if test x$enable_cdrom = xyes; then
  2427           case $ARCH in
  2428             linux|solaris)
  2429                 AC_DEFINE(SDL_CDROM_LINUX)
  2430                 SOURCES="$SOURCES $srcdir/src/cdrom/linux/*.c"
  2431                 have_cdrom=yes
  2432             ;;
  2433             *freebsd*)
  2434                 AC_DEFINE(SDL_CDROM_FREEBSD)
  2435                 SOURCES="$SOURCES $srcdir/src/cdrom/freebsd/*.c"
  2436                 have_cdrom=yes
  2437             ;;
  2438             *openbsd*|*netbsd*)
  2439                 AC_DEFINE(SDL_CDROM_OPENBSD)
  2440                 SOURCES="$SOURCES $srcdir/src/cdrom/openbsd/*.c"
  2441                 have_cdrom=yes
  2442             ;;
  2443             bsdi)
  2444                 AC_DEFINE(SDL_CDROM_BSDI)
  2445                 SOURCES="$SOURCES $srcdir/src/cdrom/bsdi/*.c"
  2446                 have_cdrom=yes
  2447             ;;
  2448             aix)
  2449                 AC_DEFINE(SDL_CDROM_AIX)
  2450                 SOURCES="$SOURCES $srcdir/src/cdrom/aix/*.c"
  2451                 have_cdrom=yes
  2452             ;;
  2453             osf)
  2454                 AC_DEFINE(SDL_CDROM_OSF)
  2455                 SOURCES="$SOURCES $srcdir/src/cdrom/osf/*.c"
  2456                 have_cdrom=yes
  2457             ;;
  2458           esac
  2459         fi
  2460         # Set up files for the thread library
  2461         if test x$enable_threads = xyes -a x$use_pthreads != xyes -a x$use_pth != xyes -a x$ARCH = xirix; then
  2462             AC_DEFINE(SDL_THREAD_SPROC)
  2463             SOURCES="$SOURCES $srcdir/src/thread/irix/*.c"
  2464             SOURCES="$SOURCES $srcdir/src/thread/generic/SDL_sysmutex.c"
  2465             SOURCES="$SOURCES $srcdir/src/thread/generic/SDL_syscond.c"
  2466             have_threads=yes
  2467         fi
  2468         # Set up files for the timer library
  2469         if test x$enable_timers = xyes; then
  2470             AC_DEFINE(SDL_TIMER_UNIX)
  2471             SOURCES="$SOURCES $srcdir/src/timer/unix/*.c"
  2472             have_timers=yes
  2473         fi
  2474         ;;
  2475     *-*-qnx*)
  2476         ARCH=qnx
  2477         CheckDummyVideo
  2478         CheckDiskAudio
  2479         CheckDummyAudio
  2480         # CheckNASM
  2481         CheckDLOPEN
  2482         CheckNAS
  2483         CheckPHOTON
  2484         CheckX11
  2485         CheckOpenGLX11
  2486         CheckPTHREAD
  2487         # Set up files for the audio library
  2488         if test x$enable_audio = xyes; then
  2489             AC_DEFINE(SDL_AUDIO_DRIVER_QNXNTO)
  2490             SOURCES="$SOURCES $srcdir/src/audio/nto/*.c"
  2491             EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lasound"
  2492             have_audio=yes
  2493         fi
  2494         # Set up files for the cdrom library
  2495         if test x$enable_cdrom = xyes; then
  2496             AC_DEFINE(SDL_CDROM_QNX)
  2497             SOURCES="$SOURCES $srcdir/src/cdrom/qnx/*.c"
  2498             have_cdrom=yes
  2499         fi
  2500         # Set up files for the timer library
  2501         if test x$enable_timers = xyes; then
  2502             AC_DEFINE(SDL_TIMER_UNIX)
  2503             SOURCES="$SOURCES $srcdir/src/timer/unix/*.c"
  2504             have_timers=yes
  2505         fi
  2506         ;;
  2507     *-*-cygwin* | *-*-mingw32*)
  2508         ARCH=win32
  2509         if test "$build" != "$host"; then # cross-compiling
  2510             # Default cross-compile location
  2511             ac_default_prefix=/usr/local/cross-tools/i386-mingw32
  2512         else
  2513             # Look for the location of the tools and install there
  2514             if test "$BUILD_PREFIX" != ""; then
  2515                 ac_default_prefix=$BUILD_PREFIX
  2516             fi
  2517         fi
  2518         CheckDummyVideo
  2519         CheckDiskAudio
  2520         CheckDummyAudio
  2521         CheckWIN32
  2522         CheckWIN32GL
  2523         CheckDIRECTX
  2524         CheckNASM
  2525         # Set up files for the audio library
  2526         if test x$enable_audio = xyes; then
  2527             AC_DEFINE(SDL_AUDIO_DRIVER_WAVEOUT)
  2528             SOURCES="$SOURCES $srcdir/src/audio/windib/*.c"
  2529             if test x$have_directx = xyes; then
  2530                 AC_DEFINE(SDL_AUDIO_DRIVER_DSOUND)
  2531                 SOURCES="$SOURCES $srcdir/src/audio/windx5/*.c"
  2532             fi
  2533             have_audio=yes
  2534         fi
  2535         # Set up files for the joystick library
  2536         if test x$enable_joystick = xyes; then
  2537             AC_DEFINE(SDL_JOYSTICK_WINMM)
  2538             SOURCES="$SOURCES $srcdir/src/joystick/win32/*.c"
  2539             have_joystick=yes
  2540         fi
  2541         # Set up files for the cdrom library
  2542         if test x$enable_cdrom = xyes; then
  2543             AC_DEFINE(SDL_CDROM_WIN32)
  2544             SOURCES="$SOURCES $srcdir/src/cdrom/win32/*.c"
  2545             have_cdrom=yes
  2546         fi
  2547         # Set up files for the thread library
  2548         if test x$enable_threads = xyes; then
  2549             AC_DEFINE(SDL_THREAD_WIN32)
  2550             SOURCES="$SOURCES $srcdir/src/thread/win32/SDL_sysmutex.c"
  2551             SOURCES="$SOURCES $srcdir/src/thread/win32/SDL_syssem.c"
  2552             SOURCES="$SOURCES $srcdir/src/thread/win32/SDL_systhread.c"
  2553             SOURCES="$SOURCES $srcdir/src/thread/generic/SDL_syscond.c"
  2554             have_threads=yes
  2555         fi
  2556         # Set up files for the timer library
  2557         if test x$enable_timers = xyes; then
  2558             AC_DEFINE(SDL_TIMER_WIN32)
  2559             SOURCES="$SOURCES $srcdir/src/timer/win32/*.c"
  2560             have_timers=yes
  2561         fi
  2562         # Set up files for the shared object loading library
  2563         if test x$enable_loadso = xyes; then
  2564             AC_DEFINE(SDL_LOADSO_WIN32)
  2565             SOURCES="$SOURCES $srcdir/src/loadso/win32/*.c"
  2566             have_loadso=yes
  2567         fi
  2568         # Set up the system libraries we need
  2569         EXTRA_LDFLAGS="$EXTRA_LDFLAGS -luser32 -lgdi32 -lwinmm"
  2570         if test x$have_directx = xyes; then
  2571             EXTRA_LDFLAGS="$EXTRA_LDFLAGS -ldxguid -ldinput8"
  2572         fi
  2573         # The Win32 platform requires special setup
  2574         SOURCES="$SOURCES $srcdir/src/main/win32/*.rc"
  2575         SDLMAIN_SOURCES="$srcdir/src/main/win32/*.c"
  2576         SDL_CFLAGS="$SDL_CFLAGS -Dmain=SDL_main"
  2577         SDL_LIBS="-lmingw32 -lSDLmain $SDL_LIBS -mwindows"
  2578         ;;
  2579     *-wince*)
  2580         ARCH=win32
  2581         CheckDummyVideo
  2582         CheckDiskAudio
  2583         CheckDummyAudio
  2584         CheckWIN32
  2585         CheckNASM
  2586         SOURCES="$SOURCES $srcdir/src/video/gapi/*.c"
  2587         EXTRA_CFLAGS="$EXTRA_CFLAGS -D_WIN32_WCE=0x420"
  2588         if test x$enable_audio = xyes; then
  2589             AC_DEFINE(SDL_AUDIO_DRIVER_WAVEOUT)
  2590             SOURCES="$SOURCES $srcdir/src/audio/windib/*.c"
  2591             have_audio=yes
  2592         fi
  2593         # Set up files for the thread library
  2594         if test x$enable_threads = xyes; then
  2595             AC_DEFINE(SDL_THREAD_WIN32)
  2596             SOURCES="$SOURCES $srcdir/src/thread/win32/SDL_sysmutex.c"
  2597             SOURCES="$SOURCES $srcdir/src/thread/win32/SDL_syssem.c"
  2598             SOURCES="$SOURCES $srcdir/src/thread/win32/SDL_systhread.c"
  2599             SOURCES="$SOURCES $srcdir/src/thread/generic/SDL_syscond.c"
  2600             have_threads=yes
  2601         fi
  2602         # Set up files for the timer library
  2603         if test x$enable_timers = xyes; then
  2604             AC_DEFINE(SDL_TIMER_WINCE)
  2605             SOURCES="$SOURCES $srcdir/src/timer/wince/*.c"
  2606             EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lcoredll -lmmtimer"
  2607             have_timers=yes
  2608         fi
  2609         # Set up files for the shared object loading library
  2610         if test x$enable_loadso = xyes; then
  2611             AC_DEFINE(SDL_LOADSO_WIN32)
  2612             SOURCES="$SOURCES $srcdir/src/loadso/win32/*.c"
  2613             have_loadso=yes
  2614         fi
  2615         # Set up the system libraries we need
  2616         EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lcoredll -lcommctrl"
  2617         # The Win32 platform requires special setup
  2618         SDLMAIN_SOURCES="$srcdir/src/main/win32/*.c"
  2619         SDL_CFLAGS="$SDL_CFLAGS -Dmain=SDL_main -D_WIN32_WCE=0x420"
  2620         SDL_LIBS="-lSDLmain $SDL_LIBS"
  2621         ;;
  2622     *-*-beos* | *-*-haiku*)
  2623         ARCH=beos
  2624         ac_default_prefix=/boot/develop/tools/gnupro
  2625         CheckDummyVideo
  2626         CheckDiskAudio
  2627         CheckDummyAudio
  2628         CheckNASM
  2629         CheckBWINDOW
  2630         CheckBeGL
  2631         # Set up files for the audio library
  2632         if test x$enable_audio = xyes; then
  2633             AC_DEFINE(SDL_AUDIO_DRIVER_BAUDIO)
  2634             SOURCES="$SOURCES $srcdir/src/audio/baudio/*.cc"
  2635             have_audio=yes
  2636         fi
  2637         # Set up files for the joystick library
  2638         if test x$enable_joystick = xyes; then
  2639             AC_DEFINE(SDL_JOYSTICK_BEOS)
  2640             SOURCES="$SOURCES $srcdir/src/joystick/beos/*.cc"
  2641             have_joystick=yes
  2642         fi
  2643         # Set up files for the cdrom library
  2644         if test x$enable_cdrom = xyes; then
  2645             AC_DEFINE(SDL_CDROM_BEOS)
  2646             SOURCES="$SOURCES $srcdir/src/cdrom/beos/*.cc"
  2647             have_cdrom=yes
  2648         fi
  2649         # Set up files for the thread library
  2650         if test x$enable_threads = xyes; then
  2651             AC_DEFINE(SDL_THREAD_BEOS)
  2652             SOURCES="$SOURCES $srcdir/src/thread/beos/*.c"
  2653             SOURCES="$SOURCES $srcdir/src/thread/generic/SDL_sysmutex.c"
  2654             SOURCES="$SOURCES $srcdir/src/thread/generic/SDL_syscond.c"
  2655             have_threads=yes
  2656         fi
  2657         # Set up files for the timer library
  2658         if test x$enable_timers = xyes; then
  2659             AC_DEFINE(SDL_TIMER_BEOS)
  2660             SOURCES="$SOURCES $srcdir/src/timer/beos/*.c"
  2661             have_timers=yes
  2662         fi
  2663         # Set up files for the shared object loading library
  2664         if test x$enable_loadso = xyes; then
  2665             case "$host" in
  2666                 *-*-beos*)
  2667                     AC_DEFINE(SDL_LOADSO_BEOS)
  2668                     SOURCES="$SOURCES $srcdir/src/loadso/beos/*.c"
  2669                 ;;
  2670                 *-*-haiku*)
  2671                     AC_DEFINE(SDL_LOADSO_DLOPEN)
  2672                     SOURCES="$SOURCES $srcdir/src/loadso/dlopen/*.c"
  2673                 ;;
  2674             esac    
  2675             have_loadso=yes
  2676         fi
  2677         # The BeOS platform requires special setup.
  2678         SOURCES="$srcdir/src/main/beos/*.cc $SOURCES"
  2679         EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lroot -lbe -lmedia -lgame -ldevice -ltextencoding"
  2680         ;;
  2681     *-*-darwin* )
  2682         # This could be either full "Mac OS X", or plain "Darwin" which is
  2683         # just the OS X kernel sans upper layers like Carbon and Cocoa.
  2684         # Next line is broken, and a few files below require Mac OS X (full)
  2685         ARCH=macosx
  2686 
  2687         # Mac OS X builds with both the Carbon and OSX APIs at the moment
  2688         EXTRA_CFLAGS="$EXTRA_CFLAGS -DTARGET_API_MAC_CARBON"
  2689         EXTRA_CFLAGS="$EXTRA_CFLAGS -DTARGET_API_MAC_OSX"
  2690 
  2691         # HACK: Reset EXTRA_LDFLAGS; the only thing it contains at this point
  2692         # is -lm which is not needed under Mac OS X. But for some reasons it
  2693         # also tends to contain spurious -L switches, which we don't want to
  2694         # use here or in sdl-config. Hence we reset it.
  2695         EXTRA_LDFLAGS=""
  2696 
  2697         CheckVisibilityHidden
  2698         CheckDummyVideo
  2699         CheckDiskAudio
  2700         CheckDummyAudio
  2701         CheckDLOPEN
  2702         CheckNASM
  2703 
  2704         # Set up files for the shared object loading library
  2705         # (this needs to be done before the dynamic X11 check)
  2706         if test x$enable_loadso = xyes -a x$have_dlopen != xyes; then
  2707             AC_DEFINE(SDL_LOADSO_DLCOMPAT)
  2708             SOURCES="$SOURCES $srcdir/src/loadso/macosx/*.c"
  2709             have_loadso=yes
  2710         fi
  2711 
  2712         CheckCOCOA
  2713         CheckCARBON
  2714         CheckX11
  2715         CheckMacGL
  2716         CheckOpenGLX11
  2717         CheckPTHREAD
  2718         CheckAltivec
  2719 
  2720         # Need this or things might misbuild on a G3.
  2721         EXTRA_CFLAGS="$EXTRA_CFLAGS -force_cpusubtype_ALL"
  2722 
  2723         # Set up files for the audio library
  2724         if test x$enable_audio = xyes; then
  2725             AC_DEFINE(SDL_AUDIO_DRIVER_COREAUDIO)
  2726             SOURCES="$SOURCES $srcdir/src/audio/macosx/*.c"
  2727             have_audio=yes
  2728         fi
  2729         # Set up files for the joystick library
  2730         if test x$enable_joystick = xyes; then
  2731             AC_DEFINE(SDL_JOYSTICK_IOKIT)
  2732             SOURCES="$SOURCES $srcdir/src/joystick/darwin/*.c"
  2733             have_joystick=yes
  2734             need_iokit_framework=yes
  2735         fi
  2736         # Set up files for the cdrom library
  2737         if test x$enable_cdrom = xyes; then
  2738             AC_DEFINE(SDL_CDROM_MACOSX)
  2739             SOURCES="$SOURCES $srcdir/src/cdrom/macosx/*.c"
  2740             have_cdrom=yes
  2741         fi
  2742         # Set up files for the timer library
  2743         if test x$enable_timers = xyes; then
  2744             AC_DEFINE(SDL_TIMER_UNIX)
  2745             SOURCES="$SOURCES $srcdir/src/timer/unix/*.c"
  2746             have_timers=yes
  2747         fi
  2748         # The Mac OS X platform requires special setup.
  2749         SDLMAIN_SOURCES="$srcdir/src/main/macosx/*.m"
  2750         EXTRA_CFLAGS="$EXTRA_CFLAGS -fpascal-strings"
  2751         SDL_LIBS="-lSDLmain $SDL_LIBS"
  2752         if test x$enable_video_cocoa = xyes; then
  2753             EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,Cocoa"
  2754             need_iokit_framework=yes
  2755         fi
  2756         if test x$enable_video_carbon = xyes -o x$enable_video_cocoa = xyes; then
  2757             # The Cocoa backend still needs Carbon
  2758             EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,ApplicationServices"
  2759             EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,Carbon"
  2760         fi
  2761         # If either the audio or CD driver is used, add the AudioUnit framework
  2762         if test x$enable_audio = xyes -o x$enable_cdrom = xyes; then
  2763             EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,AudioToolbox -Wl,-framework,AudioUnit"
  2764         fi
  2765         # Some subsystems reference IOKit...
  2766         if test x$need_iokit_framework = xyes; then
  2767             EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,IOKit"
  2768         fi
  2769         ;;
  2770     *-*-mint*)
  2771         ARCH=mint
  2772         CheckDummyVideo
  2773         CheckDiskAudio
  2774         CheckDummyAudio
  2775         CheckAtariBiosEvent
  2776         CheckAtariXbiosVideo
  2777         CheckAtariGemVideo
  2778         CheckAtariAudio
  2779         CheckAtariLdg
  2780         CheckAtariOSMesa
  2781         CheckPTH
  2782         # Set up files for the audio library
  2783         if test x$enable_threads = xyes -a x$enable_pth = xyes; then
  2784             if test x$enable_audio = xyes; then
  2785                 AC_DEFINE(SDL_AUDIO_DRIVER_SUNAUDIO)
  2786                 SOURCES="$SOURCES $srcdir/src/audio/sun/*.c"
  2787                 have_audio=yes
  2788             fi
  2789         fi
  2790         # Set up files for the joystick library
  2791         if test x$enable_joystick = xyes; then
  2792             AC_DEFINE(SDL_JOYSTICK_MINT)
  2793             SOURCES="$SOURCES $srcdir/src/joystick/mint/*.c"
  2794             have_joystick=yes
  2795         fi
  2796         # Set up files for the cdrom library
  2797         if test x$enable_cdrom = xyes; then
  2798             AC_DEFINE(SDL_CDROM_MINT)
  2799             SOURCES="$SOURCES $srcdir/src/cdrom/mint/*.c"
  2800             have_cdrom=yes
  2801         fi
  2802         # Set up files for the timer library
  2803         if test x$enable_timers = xyes; then
  2804             if test x$enable_threads = xyes -a x$enable_pth = xyes; then
  2805                 AC_DEFINE(SDL_TIMER_UNIX)
  2806                 SOURCES="$SOURCES $srcdir/src/timer/unix/*.c"
  2807             else
  2808                 AC_DEFINE(SDL_TIMER_MINT)
  2809                 SOURCES="$SOURCES $srcdir/src/timer/mint/*.c"
  2810                 SOURCES="$SOURCES $srcdir/src/timer/mint/*.S"
  2811             fi
  2812             have_timers=yes
  2813         fi
  2814         ;;
  2815     *-riscos)
  2816         ARCH=riscos
  2817         CheckOSS
  2818         CheckPTHREAD
  2819         # Set up files for the video library
  2820         if test x$enable_video = xyes; then
  2821             AC_DEFINE(SDL_VIDEO_DRIVER_RISCOS)
  2822             SOURCES="$SOURCES $srcdir/src/video/riscos/*.c"
  2823             SOURCES="$SOURCES $srcdir/src/video/riscos/*.S"
  2824             have_video=yes
  2825         fi
  2826         # Set up files for the joystick library
  2827         if test x$enable_joystick = xyes; then
  2828             AC_DEFINE(SDL_JOYSTICK_RISCOS)
  2829             SOURCES="$SOURCES $srcdir/src/joystick/riscos/*.c"
  2830             have_joystick=yes
  2831         fi
  2832         # Set up files for the timer library
  2833         if test x$enable_timers = xyes; then
  2834             AC_DEFINE(SDL_TIMER_RISCOS)
  2835             SOURCES="$SOURCES $srcdir/src/timer/riscos/*.c"
  2836             have_timers=yes
  2837         fi
  2838         # The RISC OS platform requires special setup.
  2839         EXTRA_LDFLAGS="$EXTRA_LDFLAGS -ljpeg -ltiff -lpng -lz"
  2840         ;;
  2841     *)
  2842         AC_MSG_ERROR([
  2843 *** Unsupported host:  Please add to configure.in
  2844         ])
  2845         ;;
  2846 esac
  2847 
  2848 # Verify that we have all the platform specific files we need
  2849 
  2850 if test x$enable_joystick = xyes; then
  2851   if test x$have_joystick != xyes; then
  2852     # Wants joystick subsystem, but doesn't have a platform-specific backend...
  2853     AC_DEFINE(SDL_JOYSTICK_DUMMY)
  2854     SOURCES="$SOURCES $srcdir/src/joystick/dummy/*.c"
  2855   fi
  2856 fi
  2857 if test x$have_cdrom != xyes; then
  2858     if test x$enable_cdrom = xyes; then
  2859         AC_DEFINE(SDL_CDROM_DISABLED)
  2860     fi
  2861     SOURCES="$SOURCES $srcdir/src/cdrom/dummy/*.c"
  2862 fi
  2863 if test x$have_threads != xyes; then
  2864     if test x$enable_threads = xyes; then
  2865         AC_DEFINE(SDL_THREADS_DISABLED)
  2866     fi
  2867     SOURCES="$SOURCES $srcdir/src/thread/generic/*.c"
  2868 fi
  2869 if test x$have_timers != xyes; then
  2870     if test x$enable_timers = xyes; then
  2871         AC_DEFINE(SDL_TIMERS_DISABLED)
  2872     fi
  2873     SOURCES="$SOURCES $srcdir/src/timer/dummy/*.c"
  2874 fi
  2875 if test x$have_loadso != xyes; then
  2876     if test x$enable_loadso = xyes; then
  2877         AC_DEFINE(SDL_LOADSO_DISABLED)
  2878     fi
  2879     SOURCES="$SOURCES $srcdir/src/loadso/dummy/*.c"
  2880 fi
  2881 if test x$SDLMAIN_SOURCES = x; then
  2882     SDLMAIN_SOURCES="$srcdir/src/main/dummy/*.c"
  2883 fi
  2884 
  2885 OBJECTS=`echo $SOURCES | sed 's,[[^ ]]*/\([[^ ]]*\)\.asm,$(objects)/\1.lo,g'`
  2886 OBJECTS=`echo $OBJECTS | sed 's,[[^ ]]*/\([[^ ]]*\)\.cc,$(objects)/\1.lo,g'`
  2887 OBJECTS=`echo $OBJECTS | sed 's,[[^ ]]*/\([[^ ]]*\)\.m,$(objects)/\1.lo,g'`
  2888 OBJECTS=`echo $OBJECTS | sed 's,[[^ ]]*/\([[^ ]]*\)\.c,$(objects)/\1.lo,g'`
  2889 OBJECTS=`echo $OBJECTS | sed 's,[[^ ]]*/\([[^ ]]*\)\.S,$(objects)/\1.lo,g'`
  2890 OBJECTS=`echo $OBJECTS | sed 's,[[^ ]]*/\([[^ ]]*\)\.rc,$(objects)/\1.o,g'`
  2891 
  2892 SDLMAIN_OBJECTS=`echo $SDLMAIN_SOURCES | sed 's,[[^ ]]*/\([[^ ]]*\)\.cc,$(objects)/\1.o,g'`
  2893 SDLMAIN_OBJECTS=`echo $SDLMAIN_OBJECTS | sed 's,[[^ ]]*/\([[^ ]]*\)\.m,$(objects)/\1.o,g'`
  2894 SDLMAIN_OBJECTS=`echo $SDLMAIN_OBJECTS | sed 's,[[^ ]]*/\([[^ ]]*\)\.c,$(objects)/\1.o,g'`
  2895 
  2896 # Set runtime shared library paths as needed
  2897 
  2898 if test "x$enable_rpath" = "xyes"; then
  2899   if test $ARCH = bsdi -o $ARCH = freebsd -o $ARCH = irix -o $ARCH = linux -o $ARCH = netbsd; then
  2900     SDL_RLD_FLAGS="-Wl,-rpath,\${libdir}"
  2901   fi
  2902   if test $ARCH = solaris; then
  2903     SDL_RLD_FLAGS="-R\${libdir}"
  2904   fi
  2905 else
  2906   SDL_RLD_FLAGS=""
  2907 fi
  2908 
  2909 case "$ARCH" in
  2910   macosx)
  2911     if test x$enable_video = xyes -a x$enable_video_cocoa = xyes; then
  2912       SDL_LIBS="$SDL_LIBS -Wl,-framework,Cocoa"
  2913     fi
  2914     if test x$enable_video = xyes -a x$enable_video_carbon = xyes; then
  2915       SDL_LIBS="$SDL_LIBS -Wl,-framework,Carbon"
  2916     fi
  2917     # Evil hack to allow static linking on Mac OS X
  2918     SDL_STATIC_LIBS="\${libdir}/libSDLmain.a \${libdir}/libSDL.a $EXTRA_LDFLAGS"
  2919     ;;
  2920   *)
  2921     SDL_STATIC_LIBS="$SDL_LIBS $EXTRA_LDFLAGS"
  2922     ;;
  2923 esac
  2924 
  2925 dnl Expand the cflags and libraries needed by apps using SDL
  2926 AC_SUBST(SDL_CFLAGS)
  2927 AC_SUBST(SDL_LIBS)
  2928 AC_SUBST(SDL_STATIC_LIBS)
  2929 AC_SUBST(SDL_RLD_FLAGS)
  2930 if test x$enable_shared = xyes; then
  2931     ENABLE_SHARED_TRUE=
  2932     ENABLE_SHARED_FALSE="#"
  2933 else
  2934     ENABLE_SHARED_TRUE="#"
  2935     ENABLE_SHARED_FALSE=
  2936 fi
  2937 if test x$enable_static = xyes; then
  2938     ENABLE_STATIC_TRUE=
  2939     ENABLE_STATIC_FALSE="#"
  2940 else
  2941     ENABLE_STATIC_TRUE="#"
  2942     ENABLE_STATIC_FALSE=
  2943 fi
  2944 AC_SUBST(ENABLE_SHARED_TRUE)
  2945 AC_SUBST(ENABLE_SHARED_FALSE)
  2946 AC_SUBST(ENABLE_STATIC_TRUE)
  2947 AC_SUBST(ENABLE_STATIC_FALSE)
  2948 
  2949 dnl Expand the sources and objects needed to build the library
  2950 AC_SUBST(ac_aux_dir)
  2951 AC_SUBST(INCLUDE)
  2952 AC_SUBST(SOURCES)
  2953 AC_SUBST(OBJECTS)
  2954 AC_SUBST(SDLMAIN_SOURCES)
  2955 AC_SUBST(SDLMAIN_OBJECTS)
  2956 AC_SUBST(BUILD_CFLAGS)
  2957 AC_SUBST(EXTRA_CFLAGS)
  2958 AC_SUBST(BUILD_LDFLAGS)
  2959 AC_SUBST(EXTRA_LDFLAGS)
  2960 AC_SUBST(WINDRES)
  2961 
  2962 AC_OUTPUT([
  2963     Makefile sdl-config SDL.spec SDL.qpg sdl.pc
  2964 ], [
  2965     : >build-deps
  2966     if test x"$MAKE" = x; then MAKE=make; fi; $MAKE depend
  2967 ])