configure.in
author Sam Lantinga <slouken@libsdl.org>
Tue, 03 Mar 2009 04:21:51 +0000
changeset 3083 0bc41e0361d3
parent 3082 1c85c44557de
child 3085 4800979de337
permissions -rw-r--r--
Date: Mon, 2 Mar 2009 16:27:42 +0200
From: "Mike Gorchak"
Subject: About QNX support in SDL 1.3

Right now I'm working on QNX SDL 1.3 drivers implementation and looks like a
lot of code must be completely reworked. But I'm ready for it :) Also I want
to add QNX Graphics Framework SDL driver, which is fullscreen graphics
framework, with support of hardware accelerated OpenGL ES implementations.
This Graphics Framework (called GF in QNX) could also use QNX Photon (window
manager GUI) as window manager.

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