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