configure.in
author Ozkan Sezer <sezeroz@gmail.com>
Sun, 14 Oct 2018 23:55:02 +0300
changeset 12328 5ff0dd9cbb69
parent 12258 231245d461a2
child 12390 60f322c5984f
permissions -rw-r--r--
SDL_GetPowerInfo_Hardwired is static in SDL_power.c

.. therefore, comment out its extern declaration in SDL_syspower.h.
     1 dnl Process this file with autoconf to produce a configure script.
     2 AC_INIT(README.txt)
     3 AC_CONFIG_HEADER(include/SDL_config.h)
     4 AC_CONFIG_AUX_DIR(build-scripts)
     5 AC_CONFIG_MACRO_DIR([acinclude])
     6 
     7 dnl Save the CFLAGS to see whether they were passed in or generated
     8 orig_CFLAGS="$CFLAGS"
     9 
    10 dnl Set various version strings - taken gratefully from the GTk sources
    11 #
    12 # Making releases:
    13 # Edit include/SDL_version.h and change the version, then:
    14 #   SDL_MICRO_VERSION += 1;
    15 #   SDL_INTERFACE_AGE += 1;
    16 #   SDL_BINARY_AGE += 1;
    17 # if any functions have been added, set SDL_INTERFACE_AGE to 0.
    18 # if backwards compatibility has been broken,
    19 # set SDL_BINARY_AGE and SDL_INTERFACE_AGE to 0.
    20 #
    21 SDL_MAJOR_VERSION=2
    22 SDL_MINOR_VERSION=0
    23 SDL_MICRO_VERSION=9
    24 SDL_INTERFACE_AGE=0
    25 SDL_BINARY_AGE=9
    26 SDL_VERSION=$SDL_MAJOR_VERSION.$SDL_MINOR_VERSION.$SDL_MICRO_VERSION
    27 
    28 AC_SUBST(SDL_MAJOR_VERSION)
    29 AC_SUBST(SDL_MINOR_VERSION)
    30 AC_SUBST(SDL_MICRO_VERSION)
    31 AC_SUBST(SDL_INTERFACE_AGE)
    32 AC_SUBST(SDL_BINARY_AGE)
    33 AC_SUBST(SDL_VERSION)
    34 
    35 # libtool versioning
    36 LT_INIT([win32-dll])
    37 
    38 LT_RELEASE=$SDL_MAJOR_VERSION.$SDL_MINOR_VERSION
    39 LT_CURRENT=`expr $SDL_MICRO_VERSION - $SDL_INTERFACE_AGE`
    40 LT_REVISION=$SDL_INTERFACE_AGE
    41 LT_AGE=`expr $SDL_BINARY_AGE - $SDL_INTERFACE_AGE`
    42 m4_pattern_allow([^LT_])
    43 
    44 AC_SUBST(LT_RELEASE)
    45 AC_SUBST(LT_CURRENT)
    46 AC_SUBST(LT_REVISION)
    47 AC_SUBST(LT_AGE)
    48 
    49 dnl Detect the canonical build and host environments
    50 dnl AC_CANONICAL_HOST
    51 
    52 dnl Check for tools
    53 AC_PROG_LIBTOOL
    54 AC_PROG_CC
    55 AC_PROG_CXX
    56 AC_PROG_INSTALL
    57 AC_PROG_MAKE_SET
    58 AC_CHECK_TOOL(WINDRES, [windres], [:])
    59 
    60 dnl Make sure that srcdir is a full pathname
    61 case "$host" in
    62     *-*-mingw32*)
    63         # Except on msys, where make can't handle full pathnames (bug 1972)
    64         ;;
    65     *)
    66         srcdir=`cd $srcdir && pwd`
    67         ;;
    68 esac
    69 
    70 dnl Set up the compiler and linker flags
    71 INCLUDE="-I$srcdir/include -idirafter $srcdir/src/video/khronos"
    72 if test x$srcdir != x.; then
    73     INCLUDE="-Iinclude $INCLUDE"
    74 elif test -d .hg; then
    75     AC_MSG_ERROR([
    76 *** When building from Mercurial you should configure and build in a
    77     separate directory so you don't clobber SDL_config.h, SDL_revision.h
    78 ])
    79 fi
    80 BASE_CFLAGS=""
    81 BASE_LDFLAGS=""
    82 case "$host" in
    83     *-*-cygwin*)
    84         # We build SDL on cygwin without the UNIX emulation layer
    85         save_CFLAGS="$CFLAGS"
    86         have_no_cygwin=no
    87         AC_MSG_CHECKING(for GCC -mno-cygwin option)
    88         CFLAGS="$save_CFLAGS -mno-cygwin"
    89 
    90         AC_TRY_COMPILE([
    91         ],[
    92         ],[
    93         have_no_cygwin=yes
    94         ])
    95         AC_MSG_RESULT($have_no_cygwin)
    96         CFLAGS="$save_CFLAGS"
    97 
    98         if test x$have_no_cygwin = xyes; then
    99             BASE_CFLAGS="-mno-cygwin"
   100             BASE_LDFLAGS="-mno-cygwin"
   101         fi
   102         BASE_CFLAGS="$BASE_CFLAGS -I/usr/include/mingw"
   103         ;;
   104 esac
   105 # Uncomment the following line if you want to force SDL and applications
   106 # built with it to be compiled for a particular architecture.
   107 #AX_GCC_ARCHFLAG([no], [BASE_CFLAGS="$BASE_CFLAGS $ax_cv_gcc_archflag]")
   108 BUILD_CFLAGS="$CFLAGS $CPPFLAGS -DUSING_GENERATED_CONFIG_H"
   109 # The default optimization for SDL is -O3 (Bug #31)
   110 if test "x$orig_CFLAGS" = x; then
   111     BUILD_CFLAGS=`echo $BUILD_CFLAGS | sed 's/-O2/-O3/'`
   112 fi
   113 EXTRA_CFLAGS="$INCLUDE $BASE_CFLAGS"
   114 BUILD_LDFLAGS="$LDFLAGS"
   115 EXTRA_LDFLAGS="$BASE_LDFLAGS"
   116 ## These are common directories to find software packages
   117 #for path in /usr/freeware /usr/pkg /usr/X11R6 /usr/local; do
   118 #    if test -d $path/include; then
   119 #        EXTRA_CFLAGS="$EXTRA_CFLAGS -I$path/include"
   120 #    fi
   121 #    if test -d $path/lib; then
   122 #        EXTRA_LDFLAGS="$EXTRA_LDFLAGS -L$path/lib"
   123 #    fi
   124 #done
   125 SDL_CFLAGS="$BASE_CFLAGS"
   126 SDL_LIBS="-lSDL2"
   127 if test "x$BASE_LDFLAGS" != x; then
   128     SDL_LIBS="$SDL_LIBS $BASE_LDFLAGS"
   129 fi
   130 if test "x$EXTRA_CFLAGS" != x; then
   131     CPPFLAGS="$CPPFLAGS $EXTRA_CFLAGS"
   132     CFLAGS="$CFLAGS $EXTRA_CFLAGS"
   133 fi
   134 if test "x$EXTRA_LDFLAGS" != x; then
   135     LDFLAGS="$LDFLAGS $EXTRA_LDFLAGS"
   136 fi
   137 
   138 dnl set this to use on systems that use lib64 instead of lib
   139 base_libdir=`echo \${libdir} | sed 's/.*\/\(.*\)/\1/; q'`
   140 
   141 dnl Function to find a library in the compiler search path
   142 find_lib()
   143 {
   144     gcc_bin_path=[`$CC -print-search-dirs 2>/dev/null | fgrep programs: | sed 's/[^=]*=\(.*\)/\1/' | sed 's/:/ /g'`]
   145     gcc_lib_path=[`$CC -print-search-dirs 2>/dev/null | fgrep libraries: | sed 's/[^=]*=\(.*\)/\1/' | sed 's/:/ /g'`]
   146     env_lib_path=[`echo $LIBS $LDFLAGS $* | sed 's/-L[ ]*//g'`]
   147     if test "$cross_compiling" = yes; then
   148         host_lib_path=""
   149     else
   150         host_lib_path="/usr/$base_libdir /usr/local/$base_libdir"
   151     fi
   152     for path in $env_lib_path $gcc_bin_path $gcc_lib_path $host_lib_path; do
   153         lib=[`ls -- $path/$1 2>/dev/null | sed -e '/\.so\..*\./d' -e 's,.*/,,' | sort | tail -1`]
   154         if test x$lib != x; then
   155             echo $lib
   156             return
   157         fi
   158     done
   159 }
   160 
   161 dnl Check for compiler characteristics
   162 AC_C_CONST
   163 AC_C_INLINE
   164 AC_C_VOLATILE
   165 
   166 dnl See whether we want assertions for debugging/sanity checking SDL itself.
   167 AC_ARG_ENABLE(assertions,
   168 AC_HELP_STRING([--enable-assertions],
   169                [Enable internal sanity checks (auto/disabled/release/enabled/paranoid) [[default=auto]]]),
   170               , enable_assertions=auto)
   171 case "$enable_assertions" in
   172     auto) # Use optimization settings to determine assertion level
   173         ;;
   174     disabled)
   175         AC_DEFINE(SDL_DEFAULT_ASSERT_LEVEL, 0, [ ])
   176         ;;
   177     release)
   178         AC_DEFINE(SDL_DEFAULT_ASSERT_LEVEL, 1, [ ])
   179         ;;
   180     enabled)
   181         AC_DEFINE(SDL_DEFAULT_ASSERT_LEVEL, 2, [ ])
   182         ;;
   183     paranoid)
   184         AC_DEFINE(SDL_DEFAULT_ASSERT_LEVEL, 3, [ ])
   185         ;;
   186     *)
   187         AC_MSG_ERROR([*** unknown assertion level. stop.])
   188         ;;
   189 esac
   190 
   191 dnl See whether we can use gcc style dependency tracking
   192 AC_ARG_ENABLE(dependency-tracking,
   193 AC_HELP_STRING([--enable-dependency-tracking],
   194                [Use gcc -MMD -MT dependency tracking [[default=yes]]]),
   195               , enable_dependency_tracking=yes)
   196 if test x$enable_dependency_tracking = xyes; then
   197     have_gcc_mmd_mt=no
   198     AC_MSG_CHECKING(for GCC -MMD -MT option)
   199     AC_TRY_COMPILE([
   200     #if !defined(__GNUC__) || __GNUC__ < 3
   201     #error Dependency tracking requires GCC 3.0 or newer
   202     #endif
   203     ],[
   204     ],[
   205     have_gcc_mmd_mt=yes
   206     ])
   207     AC_MSG_RESULT($have_gcc_mmd_mt)
   208 
   209     if test x$have_gcc_mmd_mt = xyes; then
   210         DEPENDENCY_TRACKING_OPTIONS="-MMD -MT \$@"
   211     fi
   212 fi
   213 
   214 AC_MSG_CHECKING(for linker option --no-undefined)
   215 have_no_undefined=no
   216 case "$host" in
   217     dnl Skip this on platforms where it is just simply busted.
   218     *-*-openbsd*)
   219         ;;
   220 
   221     *)
   222         save_LDFLAGS="$LDFLAGS"
   223         LDFLAGS="$LDFLAGS -Wl,--no-undefined"
   224         AC_TRY_LINK([
   225         ],[
   226         ],[
   227         have_no_undefined=yes
   228         EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,--no-undefined"
   229         ])
   230         LDFLAGS="$save_LDFLAGS"
   231         ;;
   232 esac
   233 AC_MSG_RESULT($have_no_undefined)
   234 
   235 dnl See whether we are allowed to use the system C library
   236 AC_ARG_ENABLE(libc,
   237 AC_HELP_STRING([--enable-libc], [Use the system C library [[default=yes]]]),
   238               , enable_libc=yes)
   239 if test x$enable_libc = xyes; then
   240     AC_DEFINE(HAVE_LIBC, 1, [ ])
   241 
   242     dnl Check for C library headers
   243     AC_HEADER_STDC
   244     AC_CHECK_HEADERS(sys/types.h stdio.h stdlib.h stddef.h stdarg.h malloc.h memory.h string.h strings.h wchar.h inttypes.h stdint.h limits.h ctype.h math.h float.h iconv.h signal.h)
   245 
   246     dnl Check for typedefs, structures, etc.
   247     AC_TYPE_SIZE_T
   248 
   249     dnl Check for defines
   250     AC_CHECK_DEFINE(M_PI, math.h)
   251 
   252     dnl Checks for library functions.
   253     case "$host" in
   254     *-*-cygwin* | *-*-mingw32*)
   255         ;;
   256     *)
   257         AC_FUNC_ALLOCA
   258         ;;
   259     esac
   260 
   261     AC_FUNC_MEMCMP
   262     if test x$ac_cv_func_memcmp_working = xyes; then
   263         AC_DEFINE(HAVE_MEMCMP, 1, [ ])
   264     fi
   265     AC_FUNC_STRTOD
   266     if test x$ac_cv_func_strtod = xyes; then
   267         AC_DEFINE(HAVE_STRTOD, 1, [ ])
   268     fi
   269     AC_CHECK_FUNC(mprotect,
   270         AC_TRY_COMPILE([
   271           #include <sys/types.h>
   272           #include <sys/mman.h>
   273         ],[
   274         ],[
   275         AC_DEFINE(HAVE_MPROTECT, 1, [ ])
   276         ]),
   277     )
   278     AC_CHECK_FUNCS(malloc calloc realloc free getenv setenv putenv unsetenv qsort abs bcopy memset memcpy memmove wcslen wcscmp strlen strlcpy strlcat _strrev _strupr _strlwr strchr strrchr strstr itoa _ltoa _uitoa _ultoa strtol strtoul _i64toa _ui64toa strtoll strtoull atoi atof strcmp strncmp _stricmp strcasecmp _strnicmp strncasecmp vsscanf vsnprintf fopen64 fseeko fseeko64 sigaction setjmp nanosleep sysconf sysctlbyname getauxval poll)
   279 
   280     AC_CHECK_LIB(m, pow, [LIBS="$LIBS -lm"; EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lm"])
   281     AC_CHECK_FUNCS(acos acosf asin asinf atan atanf atan2 atan2f ceil ceilf copysign copysignf cos cosf exp expf fabs fabsf floor floorf fmod fmodf log logf log10 log10f pow powf scalbn scalbnf sin sinf sqrt sqrtf tan tanf)
   282 
   283     AC_CHECK_LIB(iconv, iconv_open, [LIBS="$LIBS -liconv"; EXTRA_LDFLAGS="$EXTRA_LDFLAGS -liconv"])
   284     AC_CHECK_FUNCS(iconv)
   285 
   286     AC_CHECK_MEMBER(struct sigaction.sa_sigaction,[AC_DEFINE([HAVE_SA_SIGACTION], 1, [ ])], ,[#include <signal.h>])
   287 
   288     dnl Check for additional non-standard headers
   289     AC_CHECK_HEADERS(libunwind.h)
   290 fi
   291 
   292 dnl AC_CHECK_SIZEOF(void*)
   293 
   294 dnl See whether we can use gcc atomic operations on this architecture
   295 AC_ARG_ENABLE(gcc-atomics,
   296 AC_HELP_STRING([--enable-gcc-atomics],
   297                [Use gcc builtin atomics [[default=yes]]]),
   298               , enable_gcc_atomics=yes)
   299 if test x$enable_gcc_atomics = xyes; then
   300     have_gcc_atomics=no
   301     AC_MSG_CHECKING(for GCC builtin atomic operations)
   302     AC_TRY_LINK([
   303     ],[
   304     int a;
   305     void *x, *y, *z;
   306     __sync_lock_test_and_set(&a, 4);
   307     __sync_lock_test_and_set(&x, y);
   308     __sync_fetch_and_add(&a, 1);
   309     __sync_bool_compare_and_swap(&a, 5, 10);
   310     __sync_bool_compare_and_swap(&x, y, z);
   311     ],[
   312     have_gcc_atomics=yes
   313     ])
   314     AC_MSG_RESULT($have_gcc_atomics)
   315 
   316     if test x$have_gcc_atomics = xyes; then
   317         AC_DEFINE(HAVE_GCC_ATOMICS, 1, [ ])
   318     else
   319         # See if we have the minimum operation needed for GCC atomics
   320         AC_TRY_LINK([
   321         ],[
   322         int a;
   323         __sync_lock_test_and_set(&a, 1);
   324         __sync_lock_release(&a);
   325         ],[
   326         have_gcc_sync_lock_test_and_set=yes
   327         ])
   328         if test x$have_gcc_sync_lock_test_and_set = xyes; then
   329             AC_DEFINE(HAVE_GCC_SYNC_LOCK_TEST_AND_SET, 1, [ ])
   330         fi
   331     fi
   332 fi
   333 
   334 # Standard C sources
   335 SOURCES="$SOURCES $srcdir/src/*.c"
   336 SOURCES="$SOURCES $srcdir/src/atomic/*.c"
   337 SOURCES="$SOURCES $srcdir/src/audio/*.c"
   338 SOURCES="$SOURCES $srcdir/src/cpuinfo/*.c"
   339 SOURCES="$SOURCES $srcdir/src/dynapi/*.c"
   340 SOURCES="$SOURCES $srcdir/src/events/*.c"
   341 SOURCES="$SOURCES $srcdir/src/file/*.c"
   342 SOURCES="$SOURCES $srcdir/src/haptic/*.c"
   343 SOURCES="$SOURCES $srcdir/src/joystick/*.c"
   344 SOURCES="$SOURCES $srcdir/src/libm/*.c"
   345 SOURCES="$SOURCES $srcdir/src/power/*.c"
   346 #SOURCES="$SOURCES $srcdir/src/filesystem/*.c"
   347 SOURCES="$SOURCES $srcdir/src/render/*.c"
   348 SOURCES="$SOURCES $srcdir/src/render/*/*.c"
   349 SOURCES="$SOURCES $srcdir/src/sensor/*.c"
   350 SOURCES="$SOURCES $srcdir/src/stdlib/*.c"
   351 SOURCES="$SOURCES $srcdir/src/thread/*.c"
   352 SOURCES="$SOURCES $srcdir/src/timer/*.c"
   353 SOURCES="$SOURCES $srcdir/src/video/*.c"
   354 SOURCES="$SOURCES $srcdir/src/video/yuv2rgb/*.c"
   355 
   356 dnl Enable/disable various subsystems of the SDL library
   357 
   358 AC_ARG_ENABLE(atomic,
   359 AC_HELP_STRING([--enable-atomic], [Enable the atomic operations subsystem [[default=yes]]]),
   360               , enable_atomic=yes)
   361 if test x$enable_atomic != xyes; then
   362     AC_DEFINE(SDL_ATOMIC_DISABLED, 1, [ ])
   363 else
   364     SUMMARY_modules="${SUMMARY_modules} atomic"
   365 fi
   366 AC_ARG_ENABLE(audio,
   367 AC_HELP_STRING([--enable-audio], [Enable the audio subsystem [[default=yes]]]),
   368               , enable_audio=yes)
   369 if test x$enable_audio != xyes; then
   370     AC_DEFINE(SDL_AUDIO_DISABLED, 1, [ ])
   371 else
   372     SUMMARY_modules="${SUMMARY_modules} audio"
   373 fi
   374 AC_ARG_ENABLE(video,
   375 AC_HELP_STRING([--enable-video], [Enable the video subsystem [[default=yes]]]),
   376               , enable_video=yes)
   377 if test x$enable_video != xyes; then
   378     AC_DEFINE(SDL_VIDEO_DISABLED, 1, [ ])
   379 else
   380     SUMMARY_modules="${SUMMARY_modules} video"
   381 fi
   382 AC_ARG_ENABLE(render,
   383 AC_HELP_STRING([--enable-render], [Enable the render subsystem [[default=yes]]]),
   384               , enable_render=yes)
   385 if test x$enable_render != xyes; then
   386     AC_DEFINE(SDL_RENDER_DISABLED, 1, [ ])
   387 else
   388     SUMMARY_modules="${SUMMARY_modules} render"
   389 fi
   390 AC_ARG_ENABLE(events,
   391 AC_HELP_STRING([--enable-events], [Enable the events subsystem [[default=yes]]]),
   392               , enable_events=yes)
   393 if test x$enable_events != xyes; then
   394     AC_DEFINE(SDL_EVENTS_DISABLED, 1, [ ])
   395 else
   396     SUMMARY_modules="${SUMMARY_modules} events"
   397 fi
   398 AC_ARG_ENABLE(joystick,
   399 AC_HELP_STRING([--enable-joystick], [Enable the joystick subsystem [[default=yes]]]),
   400               , enable_joystick=yes)
   401 if test x$enable_joystick != xyes; then
   402     AC_DEFINE(SDL_JOYSTICK_DISABLED, 1, [ ])
   403 else
   404     SUMMARY_modules="${SUMMARY_modules} joystick"
   405 fi
   406 AC_ARG_ENABLE(haptic,
   407 AC_HELP_STRING([--enable-haptic], [Enable the haptic (force feedback) subsystem [[default=yes]]]),
   408               , enable_haptic=yes)
   409 if test x$enable_haptic != xyes; then
   410     AC_DEFINE(SDL_HAPTIC_DISABLED, 1, [ ])
   411 else
   412     SUMMARY_modules="${SUMMARY_modules} haptic"
   413 fi
   414 AC_ARG_ENABLE(sensor,
   415 AC_HELP_STRING([--enable-sensor], [Enable the sensor subsystem [[default=yes]]]),
   416               , enable_sensor=yes)
   417 if test x$enable_sensor != xyes; then
   418     AC_DEFINE(SDL_SENSOR_DISABLED, 1, [ ])
   419 else
   420     SUMMARY_modules="${SUMMARY_modules} sensor"
   421 fi
   422 AC_ARG_ENABLE(power,
   423 AC_HELP_STRING([--enable-power], [Enable the power subsystem [[default=yes]]]),
   424               , enable_power=yes)
   425 if test x$enable_power != xyes; then
   426     AC_DEFINE(SDL_POWER_DISABLED, 1, [ ])
   427 else
   428     SUMMARY_modules="${SUMMARY_modules} power"
   429 fi
   430 AC_ARG_ENABLE(filesystem,
   431 AC_HELP_STRING([--enable-filesystem], [Enable the filesystem subsystem [[default=yes]]]),
   432               , enable_filesystem=yes)
   433 if test x$enable_filesystem != xyes; then
   434     AC_DEFINE(SDL_FILESYSTEM_DISABLED, 1, [ ])
   435 else
   436     SUMMARY_modules="${SUMMARY_modules} filesystem"
   437 fi
   438 AC_ARG_ENABLE(threads,
   439 AC_HELP_STRING([--enable-threads], [Enable the threading subsystem [[default=yes]]]),
   440               , enable_threads=yes)
   441 if test x$enable_threads != xyes; then
   442     AC_DEFINE(SDL_THREADS_DISABLED, 1, [ ])
   443 else
   444     SUMMARY_modules="${SUMMARY_modules} threads"
   445 fi
   446 AC_ARG_ENABLE(timers,
   447 AC_HELP_STRING([--enable-timers], [Enable the timer subsystem [[default=yes]]]),
   448               , enable_timers=yes)
   449 if test x$enable_timers != xyes; then
   450     AC_DEFINE(SDL_TIMERS_DISABLED, 1, [ ])
   451 else
   452     SUMMARY_modules="${SUMMARY_modules} timers"
   453 fi
   454 AC_ARG_ENABLE(file,
   455 AC_HELP_STRING([--enable-file], [Enable the file subsystem [[default=yes]]]),
   456               , enable_file=yes)
   457 if test x$enable_file != xyes; then
   458     AC_DEFINE(SDL_FILE_DISABLED, 1, [ ])
   459 else
   460     SUMMARY_modules="${SUMMARY_modules} file"
   461 fi
   462 AC_ARG_ENABLE(loadso,
   463 AC_HELP_STRING([--enable-loadso], [Enable the shared object loading subsystem [[default=yes]]]),
   464               , enable_loadso=yes)
   465 if test x$enable_loadso != xyes; then
   466     AC_DEFINE(SDL_LOADSO_DISABLED, 1, [ ])
   467 else
   468     SUMMARY_modules="${SUMMARY_modules} loadso"
   469 fi
   470 AC_ARG_ENABLE(cpuinfo,
   471 AC_HELP_STRING([--enable-cpuinfo], [Enable the cpuinfo subsystem [[default=yes]]]),
   472               , enable_cpuinfo=yes)
   473 if test x$enable_cpuinfo != xyes; then
   474     AC_DEFINE(SDL_CPUINFO_DISABLED, 1, [ ])
   475 else
   476     SUMMARY_modules="${SUMMARY_modules} cpuinfo"
   477 fi
   478 AC_ARG_ENABLE(assembly,
   479 AC_HELP_STRING([--enable-assembly], [Enable assembly routines [[default=yes]]]),
   480               , enable_assembly=yes)
   481 if test x$enable_assembly = xyes; then
   482     SUMMARY_modules="${SUMMARY_modules} assembly"
   483 
   484     AC_DEFINE(SDL_ASSEMBLY_ROUTINES, 1, [ ])
   485 
   486     # Make sure that we don't generate floating point code that would
   487     # cause illegal instruction exceptions on older processors
   488     case "$host" in
   489         *-*-darwin*)
   490             # Don't need to worry about Apple hardware, it's all SSE capable
   491             default_ssemath=yes
   492             ;;
   493         *64-*-*)
   494             # x86 64-bit architectures all have SSE instructions
   495             default_ssemath=yes
   496             ;;
   497         *)
   498             default_ssemath=no
   499             ;;
   500     esac
   501     AC_ARG_ENABLE(ssemath,
   502 AC_HELP_STRING([--enable-ssemath], [Allow GCC to use SSE floating point math [[default=maybe]]]),
   503                   , enable_ssemath=$default_ssemath)
   504     if test x$enable_ssemath = xno; then
   505         if test x$have_gcc_sse = xyes -o x$have_gcc_sse2 = xyes -o x$have_gcc_sse3 = xyes; then
   506             EXTRA_CFLAGS="$EXTRA_CFLAGS -mfpmath=387"
   507         fi
   508     fi
   509 
   510     dnl Check for various instruction support
   511     AC_ARG_ENABLE(mmx,
   512 AC_HELP_STRING([--enable-mmx], [use MMX assembly routines [[default=yes]]]),
   513                   , enable_mmx=yes)
   514     if test x$enable_mmx = xyes; then
   515         save_CFLAGS="$CFLAGS"
   516         have_gcc_mmx=no
   517         AC_MSG_CHECKING(for GCC -mmmx option)
   518         mmx_CFLAGS="-mmmx"
   519         CFLAGS="$save_CFLAGS $mmx_CFLAGS"
   520 
   521         AC_TRY_COMPILE([
   522         #ifdef __MINGW32__
   523         #include <_mingw.h>
   524         #ifdef __MINGW64_VERSION_MAJOR
   525         #include <intrin.h>
   526         #else
   527         #include <mmintrin.h>
   528         #endif
   529         #else
   530         #include <mmintrin.h>
   531         #endif
   532         #ifndef __MMX__
   533         #error Assembler CPP flag not enabled
   534         #endif
   535         ],[
   536         ],[
   537         have_gcc_mmx=yes
   538         ])
   539         AC_MSG_RESULT($have_gcc_mmx)
   540         CFLAGS="$save_CFLAGS"
   541 
   542         if test x$have_gcc_mmx = xyes; then
   543             EXTRA_CFLAGS="$EXTRA_CFLAGS $mmx_CFLAGS"
   544             SUMMARY_math="${SUMMARY_math} mmx"
   545         fi
   546     fi
   547 
   548     AC_ARG_ENABLE(3dnow,
   549 AC_HELP_STRING([--enable-3dnow], [use 3DNow! assembly routines [[default=yes]]]),
   550                   , enable_3dnow=yes)
   551     if test x$enable_3dnow = xyes; then
   552         save_CFLAGS="$CFLAGS"
   553         have_gcc_3dnow=no
   554         AC_MSG_CHECKING(for GCC -m3dnow option)
   555         amd3dnow_CFLAGS="-m3dnow"
   556         CFLAGS="$save_CFLAGS $amd3dnow_CFLAGS"
   557 
   558         AC_TRY_LINK([
   559         #include <mm3dnow.h>
   560         #ifndef __3dNOW__
   561         #error Assembler CPP flag not enabled
   562         #endif
   563         ],[
   564         void *p = 0;
   565         _m_prefetch(p);
   566         ],[
   567         have_gcc_3dnow=yes
   568         ])
   569         AC_MSG_RESULT($have_gcc_3dnow)
   570         CFLAGS="$save_CFLAGS"
   571 
   572         if test x$have_gcc_3dnow = xyes; then
   573             EXTRA_CFLAGS="$EXTRA_CFLAGS $amd3dnow_CFLAGS"
   574             SUMMARY_math="${SUMMARY_math} 3dnow"
   575         fi
   576     fi
   577 
   578     AC_ARG_ENABLE(sse,
   579 AC_HELP_STRING([--enable-sse], [use SSE assembly routines [[default=yes]]]),
   580                   , enable_sse=yes)
   581     if test x$enable_sse = xyes; then
   582         save_CFLAGS="$CFLAGS"
   583         have_gcc_sse=no
   584         AC_MSG_CHECKING(for GCC -msse option)
   585         sse_CFLAGS="-msse"
   586         CFLAGS="$save_CFLAGS $sse_CFLAGS"
   587 
   588         AC_TRY_COMPILE([
   589         #ifdef __MINGW32__
   590         #include <_mingw.h>
   591         #ifdef __MINGW64_VERSION_MAJOR
   592         #include <intrin.h>
   593         #else
   594         #include <xmmintrin.h>
   595         #endif
   596         #else
   597         #include <xmmintrin.h>
   598         #endif
   599         #ifndef __SSE__
   600         #error Assembler CPP flag not enabled
   601         #endif
   602         ],[
   603         ],[
   604         have_gcc_sse=yes
   605         ])
   606         AC_MSG_RESULT($have_gcc_sse)
   607         CFLAGS="$save_CFLAGS"
   608 
   609         if test x$have_gcc_sse = xyes; then
   610             EXTRA_CFLAGS="$EXTRA_CFLAGS $sse_CFLAGS"
   611             SUMMARY_math="${SUMMARY_math} sse"
   612         fi
   613     fi
   614 
   615     AC_ARG_ENABLE(sse2,
   616 AC_HELP_STRING([--enable-sse2], [use SSE2 assembly routines [[default=maybe]]]),
   617                   , enable_sse2=$default_ssemath)
   618     if test x$enable_sse2 = xyes; then
   619         save_CFLAGS="$CFLAGS"
   620         have_gcc_sse2=no
   621         AC_MSG_CHECKING(for GCC -msse2 option)
   622         sse2_CFLAGS="-msse2"
   623         CFLAGS="$save_CFLAGS $sse2_CFLAGS"
   624 
   625         AC_TRY_COMPILE([
   626         #ifdef __MINGW32__
   627         #include <_mingw.h>
   628         #ifdef __MINGW64_VERSION_MAJOR
   629         #include <intrin.h>
   630         #else
   631         #include <emmintrin.h>
   632         #endif
   633         #else
   634         #include <emmintrin.h>
   635         #endif
   636         #ifndef __SSE2__
   637         #error Assembler CPP flag not enabled
   638         #endif
   639         ],[
   640         ],[
   641         have_gcc_sse2=yes
   642         ])
   643         AC_MSG_RESULT($have_gcc_sse2)
   644         CFLAGS="$save_CFLAGS"
   645 
   646         if test x$have_gcc_sse2 = xyes; then
   647             EXTRA_CFLAGS="$EXTRA_CFLAGS $sse2_CFLAGS"
   648             SUMMARY_math="${SUMMARY_math} sse2"
   649         fi
   650     fi
   651 
   652     AC_ARG_ENABLE(sse3,
   653 AC_HELP_STRING([--enable-sse3], [use SSE3 assembly routines [[default=maybe]]]),
   654                   , enable_sse3=$default_ssemath)
   655     if test x$enable_sse3 = xyes; then
   656         save_CFLAGS="$CFLAGS"
   657         have_gcc_sse3=no
   658         AC_MSG_CHECKING(for GCC -msse3 option)
   659         sse3_CFLAGS="-msse3"
   660         CFLAGS="$save_CFLAGS $sse3_CFLAGS"
   661 
   662         AC_TRY_COMPILE([
   663         #ifdef __MINGW32__
   664         #include <_mingw.h>
   665         #ifdef __MINGW64_VERSION_MAJOR
   666         #include <intrin.h>
   667         #else
   668         #include <pmmintrin.h>
   669         #endif
   670         #else
   671         #include <pmmintrin.h>
   672         #endif
   673         #ifndef __SSE2__
   674         #error Assembler CPP flag not enabled
   675         #endif
   676         ],[
   677         ],[
   678         have_gcc_sse3=yes
   679         ])
   680         AC_MSG_RESULT($have_gcc_sse3)
   681         CFLAGS="$save_CFLAGS"
   682 
   683         if test x$have_gcc_sse3 = xyes; then
   684             EXTRA_CFLAGS="$EXTRA_CFLAGS $sse3_CFLAGS"
   685             SUMMARY_math="${SUMMARY_math} sse3"
   686         fi
   687     fi
   688 
   689     AC_CHECK_HEADER(immintrin.h,
   690                     have_immintrin_h_hdr=yes,
   691                     have_immintrin_h_hdr=no)
   692     if test x$have_immintrin_h_hdr = xyes; then
   693         AC_DEFINE(HAVE_IMMINTRIN_H, 1, [ ])
   694     fi
   695 
   696     AC_ARG_ENABLE(altivec,
   697 AC_HELP_STRING([--enable-altivec], [use Altivec assembly routines [[default=yes]]]),
   698                   , enable_altivec=yes)
   699     if test x$enable_altivec = xyes; then
   700         save_CFLAGS="$CFLAGS"
   701         have_gcc_altivec=no
   702         have_altivec_h_hdr=no
   703         altivec_CFLAGS="-maltivec"
   704         CFLAGS="$save_CFLAGS $altivec_CFLAGS"
   705 
   706         AC_MSG_CHECKING(for Altivec with GCC altivec.h and -maltivec option)
   707         AC_TRY_COMPILE([
   708         #include <altivec.h>
   709         vector unsigned int vzero() {
   710             return vec_splat_u32(0);
   711         }
   712         ],[
   713         ],[
   714         have_gcc_altivec=yes
   715         have_altivec_h_hdr=yes
   716         ])
   717         AC_MSG_RESULT($have_gcc_altivec)
   718 
   719         if test x$have_gcc_altivec = xno; then
   720             AC_MSG_CHECKING(for Altivec with GCC -maltivec option)
   721             AC_TRY_COMPILE([
   722             vector unsigned int vzero() {
   723                 return vec_splat_u32(0);
   724             }
   725             ],[
   726             ],[
   727             have_gcc_altivec=yes
   728             ])
   729             AC_MSG_RESULT($have_gcc_altivec)
   730         fi
   731 
   732         if test x$have_gcc_altivec = xno; then
   733             AC_MSG_CHECKING(for Altivec with GCC altivec.h and -faltivec option)
   734             altivec_CFLAGS="-faltivec"
   735             CFLAGS="$save_CFLAGS $altivec_CFLAGS"
   736             AC_TRY_COMPILE([
   737             #include <altivec.h>
   738             vector unsigned int vzero() {
   739                 return vec_splat_u32(0);
   740             }
   741             ],[
   742             ],[
   743             have_gcc_altivec=yes
   744             have_altivec_h_hdr=yes
   745             ])
   746             AC_MSG_RESULT($have_gcc_altivec)
   747         fi
   748 
   749         if test x$have_gcc_altivec = xno; then
   750             AC_MSG_CHECKING(for Altivec with GCC -faltivec option)
   751             AC_TRY_COMPILE([
   752             vector unsigned int vzero() {
   753                 return vec_splat_u32(0);
   754             }
   755             ],[
   756             ],[
   757             have_gcc_altivec=yes
   758             ])
   759             AC_MSG_RESULT($have_gcc_altivec)
   760         fi
   761         CFLAGS="$save_CFLAGS"
   762 
   763         if test x$have_gcc_altivec = xyes; then
   764             AC_DEFINE(SDL_ALTIVEC_BLITTERS, 1, [ ])
   765             if test x$have_altivec_h_hdr = xyes; then
   766               AC_DEFINE(HAVE_ALTIVEC_H, 1, [ ])
   767             fi
   768             EXTRA_CFLAGS="$EXTRA_CFLAGS $altivec_CFLAGS"
   769             SUMMARY_math="${SUMMARY_math} altivec"
   770         fi
   771     fi
   772 fi
   773 
   774 dnl See if the OSS audio interface is supported
   775 CheckOSS()
   776 {
   777     AC_ARG_ENABLE(oss,
   778 AC_HELP_STRING([--enable-oss], [support the OSS audio API [[default=maybe]]]),
   779                   , enable_oss=maybe)
   780 
   781     # OpenBSD "has" OSS, but it's not really for app use. They want you to
   782     #  use sndio instead. So on there, we default to disabled. You can force
   783     #  it on if you really want, though.
   784     if test x$enable_oss = xmaybe; then
   785         enable_oss=yes
   786         case "$host" in
   787             *-*-openbsd*)
   788                 enable_oss=no;;
   789         esac
   790     fi
   791 
   792     if test x$enable_audio = xyes -a x$enable_oss = xyes; then
   793         AC_MSG_CHECKING(for OSS audio support)
   794         have_oss=no
   795         if test x$have_oss != xyes; then
   796             AC_TRY_COMPILE([
   797               #include <sys/soundcard.h>
   798             ],[
   799               int arg = SNDCTL_DSP_SETFRAGMENT;
   800             ],[
   801             have_oss=yes
   802             ])
   803         fi
   804         if test x$have_oss != xyes; then
   805             AC_TRY_COMPILE([
   806               #include <soundcard.h>
   807             ],[
   808               int arg = SNDCTL_DSP_SETFRAGMENT;
   809             ],[
   810             have_oss=yes
   811             AC_DEFINE(SDL_AUDIO_DRIVER_OSS_SOUNDCARD_H, 1, [ ])
   812             ])
   813         fi
   814         AC_MSG_RESULT($have_oss)
   815         if test x$have_oss = xyes; then
   816             SUMMARY_audio="${SUMMARY_audio} oss"
   817             AC_DEFINE(SDL_AUDIO_DRIVER_OSS, 1, [ ])
   818             SOURCES="$SOURCES $srcdir/src/audio/dsp/*.c"
   819             have_audio=yes
   820 
   821             # We may need to link with ossaudio emulation library
   822             case "$host" in
   823                 *-*-openbsd*|*-*-netbsd*)
   824                     EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lossaudio";;
   825             esac
   826         fi
   827     fi
   828 }
   829 
   830 dnl See if the ALSA audio interface is supported
   831 CheckALSA()
   832 {
   833     AC_ARG_ENABLE(alsa,
   834 AC_HELP_STRING([--enable-alsa], [support the ALSA audio API [[default=yes]]]),
   835                   , enable_alsa=yes)
   836     if test x$enable_audio = xyes -a x$enable_alsa = xyes; then
   837         AM_PATH_ALSA(1.0.11, have_alsa=yes, have_alsa=no)
   838         # Restore all flags from before the ALSA detection runs
   839         CFLAGS="$alsa_save_CFLAGS"
   840         LDFLAGS="$alsa_save_LDFLAGS"
   841         LIBS="$alsa_save_LIBS"
   842         if test x$have_alsa = xyes; then
   843             AC_ARG_ENABLE(alsa-shared,
   844 AC_HELP_STRING([--enable-alsa-shared], [dynamically load ALSA audio support [[default=yes]]]),
   845                           , enable_alsa_shared=yes)
   846             alsa_lib=[`find_lib "libasound.so.*" "$ALSA_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`]
   847 
   848             AC_DEFINE(SDL_AUDIO_DRIVER_ALSA, 1, [ ])
   849             SOURCES="$SOURCES $srcdir/src/audio/alsa/*.c"
   850             EXTRA_CFLAGS="$EXTRA_CFLAGS $ALSA_CFLAGS"
   851             if test x$have_loadso != xyes && \
   852                test x$enable_alsa_shared = xyes; then
   853                 AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic ALSA loading])
   854             fi
   855             if test x$have_loadso = xyes && \
   856                test x$enable_alsa_shared = xyes && test x$alsa_lib != x; then
   857                 echo "-- dynamic libasound -> $alsa_lib"
   858                 AC_DEFINE_UNQUOTED(SDL_AUDIO_DRIVER_ALSA_DYNAMIC, "$alsa_lib", [ ])
   859                 SUMMARY_audio="${SUMMARY_audio} alsa(dynamic)"
   860             else
   861                 EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ALSA_LIBS"
   862                 SUMMARY_audio="${SUMMARY_audio} alsa"
   863             fi
   864             have_audio=yes
   865         fi
   866     fi
   867 }
   868 
   869 dnl Find JACK Audio
   870 CheckJACK()
   871 {
   872     AC_ARG_ENABLE(jack,
   873 AC_HELP_STRING([--enable-jack], [use JACK audio [[default=yes]]]),
   874                   , enable_jack=yes)
   875     if test x$enable_audio = xyes -a x$enable_jack = xyes; then
   876         audio_jack=no
   877 
   878         JACK_REQUIRED_VERSION=0.125
   879 
   880         AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
   881         AC_MSG_CHECKING(for JACK $JACK_REQUIRED_VERSION support)
   882         if test x$PKG_CONFIG != xno; then
   883         if $PKG_CONFIG --atleast-pkgconfig-version 0.7 && $PKG_CONFIG --atleast-version $JACK_REQUIRED_VERSION jack; then
   884                 JACK_CFLAGS=`$PKG_CONFIG --cflags jack`
   885                 JACK_LIBS=`$PKG_CONFIG --libs jack`
   886                 audio_jack=yes
   887             fi
   888         fi
   889         AC_MSG_RESULT($audio_jack)
   890 
   891         if test x$audio_jack = xyes; then
   892             AC_ARG_ENABLE(jack-shared,
   893 AC_HELP_STRING([--enable-jack-shared], [dynamically load JACK audio support [[default=yes]]]),
   894                           , enable_jack_shared=yes)
   895             jack_lib=[`find_lib "libjack.so.*" "$JACK_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`]
   896 
   897             AC_DEFINE(SDL_AUDIO_DRIVER_JACK, 1, [ ])
   898             SOURCES="$SOURCES $srcdir/src/audio/jack/*.c"
   899             EXTRA_CFLAGS="$EXTRA_CFLAGS $JACK_CFLAGS"
   900             if test x$have_loadso != xyes && \
   901                test x$enable_jack_shared = xyes; then
   902                 AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic JACK audio loading])
   903             fi
   904             if test x$have_loadso = xyes && \
   905                test x$enable_jack_shared = xyes && test x$jack_lib != x; then
   906                 echo "-- dynamic libjack -> $jack_lib"
   907                 AC_DEFINE_UNQUOTED(SDL_AUDIO_DRIVER_JACK_DYNAMIC, "$jack_lib", [ ])
   908                 SUMMARY_audio="${SUMMARY_audio} jack(dynamic)"
   909 
   910                 case "$host" in
   911                     # On Solaris, jack must be linked deferred explicitly
   912                     # to prevent undefined symbol failures.
   913                     *-*-solaris*)
   914                         JACK_LIBS=`echo $JACK_LIBS | sed 's/\-l/-Wl,-l/g'`
   915                         EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-zdeferred $JACK_LIBS -Wl,-znodeferred"
   916                 esac
   917             else
   918                 EXTRA_LDFLAGS="$EXTRA_LDFLAGS $JACK_LIBS"
   919                 SUMMARY_audio="${SUMMARY_audio} jack"
   920             fi
   921             have_audio=yes
   922         fi
   923     fi
   924 }
   925 
   926 dnl Find the ESD includes and libraries
   927 CheckESD()
   928 {
   929     AC_ARG_ENABLE(esd,
   930 AC_HELP_STRING([--enable-esd], [support the Enlightened Sound Daemon [[default=yes]]]),
   931                   , enable_esd=yes)
   932     if test x$enable_audio = xyes -a x$enable_esd = xyes; then
   933         AM_PATH_ESD(0.2.8, have_esd=yes, have_esd=no)
   934         if test x$have_esd = xyes; then
   935             AC_ARG_ENABLE(esd-shared,
   936 AC_HELP_STRING([--enable-esd-shared], [dynamically load ESD audio support [[default=yes]]]),
   937                           , enable_esd_shared=yes)
   938             esd_lib=[`find_lib "libesd.so.*" "$ESD_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`]
   939 
   940             AC_DEFINE(SDL_AUDIO_DRIVER_ESD, 1, [ ])
   941             SOURCES="$SOURCES $srcdir/src/audio/esd/*.c"
   942             EXTRA_CFLAGS="$EXTRA_CFLAGS $ESD_CFLAGS"
   943             if test x$have_loadso != xyes && \
   944                test x$enable_esd_shared = xyes; then
   945                 AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic ESD loading])
   946             fi
   947             if test x$have_loadso = xyes && \
   948                test x$enable_esd_shared = xyes && test x$esd_lib != x; then
   949                 echo "-- dynamic libesd -> $esd_lib"
   950                 AC_DEFINE_UNQUOTED(SDL_AUDIO_DRIVER_ESD_DYNAMIC, "$esd_lib", [ ])
   951                 SUMMARY_audio="${SUMMARY_audio} esd(dynamic)"
   952             else
   953                 EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ESD_LIBS"
   954                 SUMMARY_audio="${SUMMARY_audio} esd"
   955             fi
   956             have_audio=yes
   957         fi
   958     fi
   959 }
   960 
   961 dnl Find PulseAudio
   962 CheckPulseAudio()
   963 {
   964     AC_ARG_ENABLE(pulseaudio,
   965 AC_HELP_STRING([--enable-pulseaudio], [use PulseAudio [[default=yes]]]),
   966                   , enable_pulseaudio=yes)
   967     if test x$enable_audio = xyes -a x$enable_pulseaudio = xyes; then
   968         audio_pulseaudio=no
   969 
   970         PULSEAUDIO_REQUIRED_VERSION=0.9
   971 
   972         AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
   973         AC_MSG_CHECKING(for PulseAudio $PULSEAUDIO_REQUIRED_VERSION support)
   974         if test x$PKG_CONFIG != xno; then
   975             if $PKG_CONFIG --atleast-pkgconfig-version 0.7 && $PKG_CONFIG --atleast-version $PULSEAUDIO_REQUIRED_VERSION libpulse-simple; then
   976                 PULSEAUDIO_CFLAGS=`$PKG_CONFIG --cflags libpulse-simple`
   977                 PULSEAUDIO_LIBS=`$PKG_CONFIG --libs libpulse-simple`
   978                 audio_pulseaudio=yes
   979             fi
   980         fi
   981         AC_MSG_RESULT($audio_pulseaudio)
   982 
   983         if test x$audio_pulseaudio = xyes; then
   984             AC_ARG_ENABLE(pulseaudio-shared,
   985 AC_HELP_STRING([--enable-pulseaudio-shared], [dynamically load PulseAudio support [[default=yes]]]),
   986                           , enable_pulseaudio_shared=yes)
   987             pulseaudio_lib=[`find_lib "libpulse-simple.so.*" "$PULSEAUDIO_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`]
   988 
   989             AC_DEFINE(SDL_AUDIO_DRIVER_PULSEAUDIO, 1, [ ])
   990             SOURCES="$SOURCES $srcdir/src/audio/pulseaudio/*.c"
   991             EXTRA_CFLAGS="$EXTRA_CFLAGS $PULSEAUDIO_CFLAGS"
   992             if test x$have_loadso != xyes && \
   993                test x$enable_pulseaudio_shared = xyes; then
   994                 AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic PulseAudio loading])
   995             fi
   996             if test x$have_loadso = xyes && \
   997                test x$enable_pulseaudio_shared = xyes && test x$pulseaudio_lib != x; then
   998                 echo "-- dynamic libpulse-simple -> $pulseaudio_lib"
   999                 AC_DEFINE_UNQUOTED(SDL_AUDIO_DRIVER_PULSEAUDIO_DYNAMIC, "$pulseaudio_lib", [ ])
  1000                 SUMMARY_audio="${SUMMARY_audio} pulse(dynamic)"
  1001 
  1002                 case "$host" in
  1003                     # On Solaris, pulseaudio must be linked deferred explicitly
  1004                     # to prevent undefined symbol failures.
  1005                     *-*-solaris*)
  1006                         PULSEAUDIO_LIBS=`echo $PULSEAUDIO_LIBS | sed 's/\-l/-Wl,-l/g'`
  1007                         EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-zdeferred $PULSEAUDIO_LIBS -Wl,-znodeferred"
  1008                 esac
  1009             else
  1010                 EXTRA_LDFLAGS="$EXTRA_LDFLAGS $PULSEAUDIO_LIBS"
  1011                 SUMMARY_audio="${SUMMARY_audio} pulse"
  1012             fi
  1013             have_audio=yes
  1014         fi
  1015     fi
  1016 }
  1017 
  1018 CheckARTSC()
  1019 {
  1020     AC_ARG_ENABLE(arts,
  1021 AC_HELP_STRING([--enable-arts], [support the Analog Real Time Synthesizer [[default=yes]]]),
  1022                   , enable_arts=yes)
  1023     if test x$enable_audio = xyes -a x$enable_arts = xyes; then
  1024         AC_PATH_PROG(ARTSCONFIG, artsc-config)
  1025         if test x$ARTSCONFIG = x -o x$ARTSCONFIG = x'"$ARTSCONFIG"'; then
  1026             : # arts isn't installed
  1027         else
  1028             ARTS_CFLAGS=`$ARTSCONFIG --cflags`
  1029             ARTS_LIBS=`$ARTSCONFIG --libs`
  1030             AC_MSG_CHECKING(for aRts development environment)
  1031             audio_arts=no
  1032             save_CFLAGS="$CFLAGS"
  1033             CFLAGS="$CFLAGS $ARTS_CFLAGS"
  1034             AC_TRY_COMPILE([
  1035              #include <artsc.h>
  1036             ],[
  1037              arts_stream_t stream;
  1038             ],[
  1039             audio_arts=yes
  1040             ])
  1041             CFLAGS="$save_CFLAGS"
  1042             AC_MSG_RESULT($audio_arts)
  1043             if test x$audio_arts = xyes; then
  1044                 AC_ARG_ENABLE(arts-shared,
  1045 AC_HELP_STRING([--enable-arts-shared], [dynamically load aRts audio support [[default=yes]]]),
  1046                               , enable_arts_shared=yes)
  1047                 arts_lib=[`find_lib "libartsc.so.*" "$ARTS_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`]
  1048 
  1049                 AC_DEFINE(SDL_AUDIO_DRIVER_ARTS, 1, [ ])
  1050                 SOURCES="$SOURCES $srcdir/src/audio/arts/*.c"
  1051                 EXTRA_CFLAGS="$EXTRA_CFLAGS $ARTS_CFLAGS"
  1052                 if test x$have_loadso != xyes && \
  1053                    test x$enable_arts_shared = xyes; then
  1054                     AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic ARTS loading])
  1055                 fi
  1056                 if test x$have_loadso = xyes && \
  1057                    test x$enable_arts_shared = xyes && test x$arts_lib != x; then
  1058                     echo "-- dynamic libartsc -> $arts_lib"
  1059                     AC_DEFINE_UNQUOTED(SDL_AUDIO_DRIVER_ARTS_DYNAMIC, "$arts_lib", [ ])
  1060                     SUMMARY_audio="${SUMMARY_audio} arts(dynamic)"
  1061                 else
  1062                     EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ARTS_LIBS"
  1063                     SUMMARY_audio="${SUMMARY_audio} arts"
  1064                 fi
  1065                 have_audio=yes
  1066             fi
  1067         fi
  1068     fi
  1069 }
  1070 
  1071 dnl See if the NAS audio interface is supported
  1072 CheckNAS()
  1073 {
  1074     AC_ARG_ENABLE(nas,
  1075 AC_HELP_STRING([--enable-nas], [support the NAS audio API [[default=yes]]]),
  1076                   , enable_nas=yes)
  1077     if test x$enable_audio = xyes -a x$enable_nas = xyes; then
  1078         AC_CHECK_HEADER(audio/audiolib.h, have_nas_hdr=yes)
  1079         AC_CHECK_LIB(audio, AuOpenServer, have_nas_lib=yes)
  1080 
  1081         AC_MSG_CHECKING(for NAS audio support)
  1082         have_nas=no
  1083 
  1084         if test x$have_nas_hdr = xyes -a x$have_nas_lib = xyes; then
  1085             have_nas=yes
  1086             NAS_LIBS="-laudio"
  1087 
  1088         elif test -r /usr/X11R6/include/audio/audiolib.h; then
  1089             have_nas=yes
  1090             NAS_CFLAGS="-I/usr/X11R6/include/"
  1091             NAS_LIBS="-L/usr/X11R6/lib -laudio -lXt"
  1092 
  1093         fi
  1094 
  1095         AC_MSG_RESULT($have_nas)
  1096 
  1097         if test x$have_nas = xyes; then
  1098             AC_ARG_ENABLE(nas-shared,
  1099 AC_HELP_STRING([--enable-nas-shared], [dynamically load NAS audio support [[default=yes]]]),
  1100                           , enable_nas_shared=yes)
  1101             nas_lib=[`find_lib "libaudio.so.*" "$NAS_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`]
  1102 
  1103             if test x$have_loadso != xyes && \
  1104                test x$enable_nas_shared = xyes; then
  1105                 AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic NAS loading])
  1106             fi
  1107             if test x$have_loadso = xyes && \
  1108                test x$enable_nas_shared = xyes && test x$nas_lib != x; then
  1109                 echo "-- dynamic libaudio -> $nas_lib"
  1110                 AC_DEFINE_UNQUOTED(SDL_AUDIO_DRIVER_NAS_DYNAMIC, "$nas_lib", [ ])
  1111                 SUMMARY_audio="${SUMMARY_audio} nas(dynamic)"
  1112             else
  1113                 EXTRA_LDFLAGS="$EXTRA_LDFLAGS $NAS_LIBS"
  1114                 SUMMARY_audio="${SUMMARY_audio} nas"
  1115             fi
  1116 
  1117             AC_DEFINE(SDL_AUDIO_DRIVER_NAS, 1, [ ])
  1118             SOURCES="$SOURCES $srcdir/src/audio/nas/*.c"
  1119             EXTRA_CFLAGS="$EXTRA_CFLAGS $NAS_CFLAGS"
  1120             have_audio=yes
  1121         fi
  1122     fi
  1123 }
  1124 
  1125 dnl See if the sndio audio interface is supported
  1126 CheckSNDIO()
  1127 {
  1128     AC_ARG_ENABLE(sndio,
  1129 AC_HELP_STRING([--enable-sndio], [support the sndio audio API [[default=yes]]]),
  1130                   , enable_sndio=yes)
  1131     if test x$enable_audio = xyes -a x$enable_sndio = xyes; then
  1132         AC_CHECK_HEADER(sndio.h, have_sndio_hdr=yes)
  1133         AC_CHECK_LIB(sndio, sio_open, have_sndio_lib=yes)
  1134 
  1135         AC_MSG_CHECKING(for sndio audio support)
  1136         have_sndio=no
  1137 
  1138         if test x$have_sndio_hdr = xyes -a x$have_sndio_lib = xyes; then
  1139             have_sndio=yes
  1140             SNDIO_LIBS="-lsndio"
  1141         fi
  1142 
  1143         AC_MSG_RESULT($have_sndio)
  1144 
  1145         if test x$have_sndio = xyes; then
  1146             AC_ARG_ENABLE(sndio-shared,
  1147 AC_HELP_STRING([--enable-sndio-shared], [dynamically load sndio audio support [[default=yes]]]),
  1148                           , enable_sndio_shared=yes)
  1149             sndio_lib=[`find_lib "libsndio.so.*" "$SNDIO_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`]
  1150 
  1151             if test x$have_loadso != xyes && \
  1152                test x$enable_sndio_shared = xyes; then
  1153                 AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic sndio loading])
  1154             fi
  1155             if test x$have_loadso = xyes && \
  1156                test x$enable_sndio_shared = xyes && test x$sndio_lib != x; then
  1157                 echo "-- dynamic libsndio -> $sndio_lib"
  1158                 AC_DEFINE_UNQUOTED(SDL_AUDIO_DRIVER_SNDIO_DYNAMIC, "$sndio_lib", [ ])
  1159                 SUMMARY_audio="${SUMMARY_audio} sndio(dynamic)"
  1160             else
  1161                 EXTRA_LDFLAGS="$EXTRA_LDFLAGS $SNDIO_LIBS"
  1162                 SUMMARY_audio="${SUMMARY_audio} sndio"
  1163             fi
  1164 
  1165             AC_DEFINE(SDL_AUDIO_DRIVER_SNDIO, 1, [ ])
  1166             SOURCES="$SOURCES $srcdir/src/audio/sndio/*.c"
  1167             EXTRA_CFLAGS="$EXTRA_CFLAGS $SNDIO_CFLAGS"
  1168             have_audio=yes
  1169         fi
  1170     fi
  1171 }
  1172 
  1173 dnl Find FusionSound
  1174 CheckFusionSound()
  1175 {
  1176     AC_ARG_ENABLE(fusionsound,
  1177 AC_HELP_STRING([--enable-fusionsound], [use FusionSound audio driver [[default=no]]]),
  1178                   , enable_fusionsound=no)
  1179     if test x$enable_audio = xyes -a x$enable_fusionsound = xyes; then
  1180         fusionsound=no
  1181 
  1182         FUSIONSOUND_REQUIRED_VERSION=1.1.1
  1183 
  1184         AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
  1185         AC_MSG_CHECKING(for FusionSound $FUSIONSOUND_REQUIRED_VERSION support)
  1186         if test x$PKG_CONFIG != xno; then
  1187             if $PKG_CONFIG --atleast-pkgconfig-version 0.7 && $PKG_CONFIG --atleast-version $FUSIONSOUND_REQUIRED_VERSION fusionsound; then
  1188                 FUSIONSOUND_CFLAGS=`$PKG_CONFIG --cflags fusionsound`
  1189                 FUSIONSOUND_LIBS=`$PKG_CONFIG --libs fusionsound`
  1190                 fusionsound=yes
  1191             fi
  1192         fi
  1193         AC_MSG_RESULT($fusionsound)
  1194 
  1195         if test x$fusionsound = xyes; then
  1196             AC_DEFINE(SDL_AUDIO_DRIVER_FUSIONSOUND, 1, [ ])
  1197             SOURCES="$SOURCES $srcdir/src/audio/fusionsound/*.c"
  1198             EXTRA_CFLAGS="$EXTRA_CFLAGS $FUSIONSOUND_CFLAGS"
  1199             
  1200             AC_ARG_ENABLE(fusionsound-shared,
  1201 AC_HELP_STRING([--enable-fusionsound-shared], [dynamically load fusionsound audio support [[default=yes]]]),
  1202                           , enable_fusionsound_shared=yes)
  1203             fusionsound_shared=no
  1204             AC_MSG_CHECKING(for FusionSound dynamic loading support)
  1205             if test x$have_loadso != xyes && \
  1206                test x$enable_fusionsound_shared = xyes; then
  1207                 AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic fusionsound loading])
  1208             fi
  1209             if test x$have_loadso = xyes && \
  1210                test x$enable_fusionsound_shared = xyes; then
  1211                 AC_DEFINE_UNQUOTED(SDL_AUDIO_DRIVER_FUSIONSOUND_DYNAMIC, "libfusionsound.so", [ ])
  1212                 fusionsound_shared=yes
  1213                 SUMMARY_audio="${SUMMARY_audio} fusionsound(dynamic)"
  1214             else
  1215                 EXTRA_LDFLAGS="$EXTRA_LDFLAGS $FUSIONSOUND_LIBS"
  1216                 SUMMARY_audio="${SUMMARY_audio} fusionsound"
  1217             fi
  1218             AC_MSG_RESULT($fusionsound_shared)
  1219             
  1220             have_audio=yes
  1221         fi
  1222     fi
  1223 }
  1224 
  1225 dnl rcg07142001 See if the user wants the disk writer audio driver...
  1226 CheckDiskAudio()
  1227 {
  1228     AC_ARG_ENABLE(diskaudio,
  1229 AC_HELP_STRING([--enable-diskaudio], [support the disk writer audio driver [[default=yes]]]),
  1230                   , enable_diskaudio=yes)
  1231     if test x$enable_audio = xyes -a x$enable_diskaudio = xyes; then
  1232         AC_DEFINE(SDL_AUDIO_DRIVER_DISK, 1, [ ])
  1233         SOURCES="$SOURCES $srcdir/src/audio/disk/*.c"
  1234         SUMMARY_audio="${SUMMARY_audio} disk"
  1235     fi
  1236 }
  1237 
  1238 dnl rcg03142006 See if the user wants the dummy audio driver...
  1239 CheckDummyAudio()
  1240 {
  1241     AC_ARG_ENABLE(dummyaudio,
  1242 AC_HELP_STRING([--enable-dummyaudio], [support the dummy audio driver [[default=yes]]]),
  1243                   , enable_dummyaudio=yes)
  1244     if test x$enable_audio = xyes -a x$enable_dummyaudio = xyes; then
  1245         AC_DEFINE(SDL_AUDIO_DRIVER_DUMMY, 1, [ ])
  1246         SOURCES="$SOURCES $srcdir/src/audio/dummy/*.c"
  1247         SUMMARY_audio="${SUMMARY_audio} dummy"
  1248     fi
  1249 }
  1250 
  1251 dnl See if libsamplerate is available
  1252 CheckLibSampleRate()
  1253 {
  1254     AC_ARG_ENABLE(libsamplerate,
  1255 AC_HELP_STRING([--enable-libsamplerate], [use libsamplerate for audio rate conversion [[default=yes]]]),
  1256                   , enable_libsamplerate=yes)
  1257     if test x$enable_libsamplerate = xyes; then
  1258         AC_CHECK_HEADER(samplerate.h,
  1259                         have_samplerate_h_hdr=yes,
  1260                         have_samplerate_h_hdr=no)
  1261         if test x$have_samplerate_h_hdr = xyes; then
  1262             AC_DEFINE(HAVE_LIBSAMPLERATE_H, 1, [ ])
  1263 
  1264             AC_ARG_ENABLE(libsamplerate-shared,
  1265 AC_HELP_STRING([--enable-libsamplerate-shared], [dynamically load libsamplerate [[default=yes]]]),
  1266                           , enable_libsamplerate_shared=yes)
  1267 
  1268             samplerate_lib=[`find_lib "libsamplerate.so.*" "" | sed 's/.*\/\(.*\)/\1/; q'`]
  1269 
  1270             if test x$have_loadso != xyes && \
  1271                test x$enable_libsamplerate_shared = xyes; then
  1272                 AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic libsamplerate loading])
  1273             fi
  1274             if test x$have_loadso = xyes && \
  1275                test x$enable_libsamplerate_shared = xyes && test x$samplerate_lib != x; then
  1276                 echo "-- dynamic libsamplerate -> $samplerate_lib"
  1277                 AC_DEFINE_UNQUOTED(SDL_LIBSAMPLERATE_DYNAMIC, "$samplerate_lib", [ ])
  1278             else
  1279                 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lsamplerate"
  1280             fi
  1281         fi
  1282     fi
  1283 }
  1284 
  1285 dnl See if GCC's -fvisibility=hidden is supported (gcc4 and later, usually).
  1286 dnl  Details of this flag are here: http://gcc.gnu.org/wiki/Visibility
  1287 CheckVisibilityHidden()
  1288 {
  1289     AC_MSG_CHECKING(for GCC -fvisibility=hidden option)
  1290     have_gcc_fvisibility=no
  1291 
  1292     visibility_CFLAGS="-fvisibility=hidden"
  1293     save_CFLAGS="$CFLAGS"
  1294     CFLAGS="$save_CFLAGS $visibility_CFLAGS -Werror"
  1295     AC_TRY_COMPILE([
  1296     #if !defined(__GNUC__) || __GNUC__ < 4
  1297     #error SDL only uses visibility attributes in GCC 4 or newer
  1298     #endif
  1299     ],[
  1300     ],[
  1301     have_gcc_fvisibility=yes
  1302     ])
  1303     AC_MSG_RESULT($have_gcc_fvisibility)
  1304     CFLAGS="$save_CFLAGS"
  1305 
  1306     if test x$have_gcc_fvisibility = xyes; then
  1307         EXTRA_CFLAGS="$EXTRA_CFLAGS $visibility_CFLAGS"
  1308     fi
  1309 }
  1310 
  1311 dnl See if GCC's -mpreferred-stack-boundary is supported.
  1312 dnl  Reference: http://bugzilla.libsdl.org/show_bug.cgi?id=1296
  1313 CheckStackBoundary()
  1314 {
  1315     AC_MSG_CHECKING(for GCC -mpreferred-stack-boundary option)
  1316     have_gcc_preferred_stack_boundary=no
  1317 
  1318     save_CFLAGS="$CFLAGS"
  1319     CFLAGS="$save_CFLAGS -mpreferred-stack-boundary=2"
  1320     AC_TRY_COMPILE([
  1321     int x = 0;
  1322     ],[
  1323     ],[
  1324     have_gcc_preferred_stack_boundary=yes
  1325     ])
  1326     AC_MSG_RESULT($have_gcc_preferred_stack_boundary)
  1327     CFLAGS="$save_CFLAGS"
  1328 
  1329     if test x$have_gcc_preferred_stack_boundary = xyes; then
  1330         EXTRA_CFLAGS="$EXTRA_CFLAGS -mpreferred-stack-boundary=2"
  1331     fi
  1332 }
  1333 
  1334 dnl See if GCC's -Wdeclaration-after-statement is supported.
  1335 dnl  This lets us catch things that would fail on a C89 compiler when using
  1336 dnl  a modern GCC.
  1337 CheckDeclarationAfterStatement()
  1338 {
  1339     AC_MSG_CHECKING(for GCC -Wdeclaration-after-statement option)
  1340     have_gcc_declaration_after_statement=no
  1341 
  1342     save_CFLAGS="$CFLAGS"
  1343     CFLAGS="$save_CFLAGS -Wdeclaration-after-statement -Werror=declaration-after-statement"
  1344     AC_TRY_COMPILE([
  1345     int x = 0;
  1346     ],[
  1347     ],[
  1348     have_gcc_declaration_after_statement=yes
  1349     ])
  1350     AC_MSG_RESULT($have_gcc_declaration_after_statement)
  1351     CFLAGS="$save_CFLAGS"
  1352 
  1353     if test x$have_gcc_declaration_after_statement = xyes; then
  1354         EXTRA_CFLAGS="$EXTRA_CFLAGS -Wdeclaration-after-statement -Werror=declaration-after-statement"
  1355     fi
  1356 }
  1357 
  1358 dnl See if GCC's -Wall is supported.
  1359 CheckWarnAll()
  1360 {
  1361     AC_MSG_CHECKING(for GCC -Wall option)
  1362     have_gcc_Wall=no
  1363 
  1364     save_CFLAGS="$CFLAGS"
  1365     CFLAGS="$save_CFLAGS -Wall"
  1366     AC_TRY_COMPILE([
  1367     int x = 0;
  1368     ],[
  1369     ],[
  1370     have_gcc_Wall=yes
  1371     ])
  1372     AC_MSG_RESULT($have_gcc_Wall)
  1373     CFLAGS="$save_CFLAGS"
  1374 
  1375     if test x$have_gcc_Wall = xyes; then
  1376         EXTRA_CFLAGS="$EXTRA_CFLAGS -Wall"
  1377 
  1378         dnl Haiku headers use multicharacter constants all over the place. Ignore these warnings when using -Wall.
  1379         AC_MSG_CHECKING(for necessary GCC -Wno-multichar option)
  1380         need_gcc_Wno_multichar=no
  1381         case "$host" in
  1382             *-*-haiku*)
  1383                 need_gcc_Wno_multichar=yes
  1384                 ;;
  1385         esac
  1386         AC_MSG_RESULT($need_gcc_Wno_multichar)
  1387         if test x$need_gcc_Wno_multichar = xyes; then
  1388             EXTRA_CFLAGS="$EXTRA_CFLAGS -Wno-multichar"
  1389         fi
  1390     fi
  1391 }
  1392 
  1393 dnl Check for Wayland
  1394 CheckWayland()
  1395 {
  1396     AC_ARG_ENABLE(video-wayland,
  1397 AC_HELP_STRING([--enable-video-wayland], [use Wayland video driver [[default=yes]]]),
  1398                   ,enable_video_wayland=yes)
  1399 
  1400     AC_ARG_ENABLE(video-wayland-qt-touch,
  1401 AC_HELP_STRING([--enable-video-wayland-qt-touch], [QtWayland server support for Wayland video driver [[default=yes]]]),
  1402                   ,enable_video_wayland_qt_touch=yes)
  1403 
  1404     if test x$enable_video = xyes -a x$enable_video_wayland = xyes; then
  1405         AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
  1406         AC_MSG_CHECKING(for Wayland support)
  1407         video_wayland=no
  1408         if  test x$PKG_CONFIG != xno && \
  1409             test x$video_opengl_egl = xyes && \
  1410             test x$video_opengles_v2 = xyes; then
  1411             if $PKG_CONFIG --exists wayland-client wayland-scanner wayland-protocols wayland-egl wayland-cursor egl xkbcommon ; then
  1412                 WAYLAND_CFLAGS=`$PKG_CONFIG --cflags wayland-client wayland-egl wayland-cursor xkbcommon`
  1413                 WAYLAND_LIBS=`$PKG_CONFIG --libs wayland-client wayland-egl wayland-cursor xkbcommon`
  1414                 WAYLAND_SCANNER=`$PKG_CONFIG --variable=wayland_scanner wayland-scanner`
  1415                 video_wayland=yes
  1416             fi
  1417         fi
  1418         AC_MSG_RESULT($video_wayland)
  1419 
  1420         if test x$video_wayland = xyes; then
  1421             AC_DEFINE(SDL_VIDEO_DRIVER_WAYLAND, 1, [ ])
  1422             if test x$enable_video_wayland_qt_touch = xyes; then
  1423                 AC_DEFINE(SDL_VIDEO_DRIVER_WAYLAND_QT_TOUCH, 1, [ ])
  1424             fi
  1425 
  1426             WAYLAND_SOURCES="$srcdir/src/video/wayland/*.c"
  1427             SOURCES="$SOURCES $WAYLAND_SOURCES"
  1428             EXTRA_CFLAGS="$EXTRA_CFLAGS $WAYLAND_CFLAGS -I\$(gen)"
  1429             AC_ARG_ENABLE(wayland-shared,
  1430 AC_HELP_STRING([--enable-wayland-shared], [dynamically load Wayland support [[default=maybe]]]),
  1431                           , enable_wayland_shared=maybe)
  1432 
  1433             dnl FIXME: Do BSD and OS X need special cases?
  1434             case "$host" in
  1435                 *)
  1436                     wayland_client_lib=[`find_lib "libwayland-client.so.*" "$WAYLAND_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`]
  1437                     wayland_egl_lib=[`find_lib "libwayland-egl.so.*" "$WAYLAND_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`]
  1438                     if test x$wayland_egl_lib = x; then
  1439                         dnl This works in Ubuntu 13.10, maybe others
  1440                         wayland_egl_lib=[`find_lib "mesa-egl/libwayland-egl.so.*" "$WAYLAND_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`]
  1441                     fi
  1442                     wayland_cursor_lib=[`find_lib "libwayland-cursor.so.*" "$WAYLAND_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`]
  1443                     xkbcommon_lib=[`find_lib "libxkbcommon.so.*" "$WAYLAND_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`]
  1444                     ;;
  1445             esac
  1446 
  1447             if test x$enable_wayland_shared = xmaybe; then
  1448                 enable_wayland_shared=yes
  1449             fi
  1450             if test x$have_loadso != xyes && \
  1451                test x$enable_wayland_shared = xyes; then
  1452                 AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic Wayland loading])
  1453                 enable_wayland_shared=no
  1454             fi
  1455             if test x$have_loadso = xyes && \
  1456                test x$enable_wayland_shared = xyes && \
  1457                test x$wayland_client_lib != x && \
  1458                test x$wayland_egl_lib != x && \
  1459                test x$wayland_cursor_lib != x && \
  1460                test x$xkbcommon_lib != x; then
  1461                 echo "-- dynamic libwayland-client -> $wayland_client_lib"
  1462                 echo "-- dynamic libwayland-egl -> $wayland_egl_lib"
  1463                 echo "-- dynamic libwayland-cursor -> $wayland_cursor_lib"
  1464                 echo "-- dynamic libxkbcommon -> $xkbcommon_lib"
  1465                 AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC, "$wayland_client_lib", [ ])
  1466                 AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_EGL, "$wayland_egl_lib", [ ])
  1467                 AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_CURSOR, "$wayland_cursor_lib", [ ])
  1468                 AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_XKBCOMMON, "$xkbcommon_lib", [ ])
  1469                 SUMMARY_video="${SUMMARY_video} wayland(dynamic)"
  1470             else
  1471                 enable_wayland_shared=no
  1472                 EXTRA_LDFLAGS="$EXTRA_LDFLAGS $WAYLAND_LIBS"
  1473                 SUMMARY_video="${SUMMARY_video} wayland"
  1474             fi
  1475             have_video=yes
  1476         fi
  1477     fi
  1478 }
  1479 
  1480 dnl Check for Mir
  1481 CheckMir()
  1482 {
  1483     AC_ARG_ENABLE(video-mir,
  1484 AC_HELP_STRING([--enable-video-mir], [use Mir video driver [[default=no]]]),
  1485                   ,enable_video_mir=no)
  1486 
  1487     if test x$enable_video = xyes -a x$enable_video_mir = xyes; then
  1488         AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
  1489         AC_MSG_CHECKING(for Mir support)
  1490         video_mir=no
  1491         if test x$PKG_CONFIG != xno; then
  1492             if $PKG_CONFIG --exists mirclient egl xkbcommon ; then
  1493                 MIR_CFLAGS=`$PKG_CONFIG --cflags mirclient egl xkbcommon`
  1494                 MIR_LIBS=`$PKG_CONFIG --libs mirclient egl xkbcommon`
  1495                 save_CFLAGS="$CFLAGS"
  1496                 CFLAGS="$save_CFLAGS $MIR_CFLAGS"
  1497 
  1498                 dnl This will disable Mir if >= v0.26 is not available
  1499                 AC_TRY_COMPILE([
  1500                 #include <mir_toolkit/mir_client_library.h>
  1501                 ],[
  1502                     MirWindowAttrib attrib = mir_window_attrib_state
  1503                 ],[
  1504                 video_mir=yes
  1505                 ])
  1506                 CFLAGS="$save_CFLAGS"
  1507             fi
  1508         fi
  1509         AC_MSG_RESULT($video_mir)
  1510 
  1511         if test x$video_mir = xyes; then
  1512             AC_DEFINE(SDL_VIDEO_DRIVER_MIR, 1, [ ])
  1513             SOURCES="$SOURCES $srcdir/src/video/mir/*.c"
  1514             EXTRA_CFLAGS="$EXTRA_CFLAGS $MIR_CFLAGS"
  1515             AC_ARG_ENABLE(mir-shared,
  1516 AC_HELP_STRING([--enable-mir-shared], [dynamically load Mir support [[default=maybe]]]),
  1517                           , enable_mir_shared=maybe)
  1518 
  1519             dnl FIXME: Do BSD and OS X need special cases?
  1520             case "$host" in
  1521                 *)
  1522                     mirclient_lib=[`find_lib "libmirclient.so.*" "$MIR_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`]
  1523                     xkbcommon_lib=[`find_lib "libxkbcommon.so.*" "$MIR_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`]
  1524                     ;;
  1525             esac
  1526 
  1527             if test x$enable_mir_shared = xmaybe; then
  1528                 enable_mir_shared=yes
  1529             fi
  1530             if test x$have_loadso != xyes && \
  1531                test x$enable_mir_shared = xyes; then
  1532                 AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic Mir loading])
  1533                 enable_mir_shared=no
  1534             fi
  1535             if test x$have_loadso = xyes && \
  1536                test x$enable_mir_shared = xyes && \
  1537                test x$mirclient_lib != x && \
  1538                test x$xkbcommon_lib != x; then
  1539                 echo "-- dynamic libmirclient -> $mirclient_lib"
  1540                 echo "-- dynamic libxkbcommon -> $xkbcommon_lib"
  1541                 AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_MIR_DYNAMIC, "$mirclient_lib", [ ])
  1542                 AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_MIR_DYNAMIC_XKBCOMMON, "$xkbcommon_lib", [ ])
  1543                 SUMMARY_video="${SUMMARY_video} mir(dynamic)"
  1544             else
  1545                 enable_mir_shared=no
  1546                 EXTRA_LDFLAGS="$EXTRA_LDFLAGS $MIR_LIBS"
  1547                 SUMMARY_video="${SUMMARY_video} mir"
  1548             fi
  1549             have_video=yes
  1550         fi
  1551     fi
  1552 }
  1553 
  1554 dnl Check for Native Client stuff
  1555 CheckNativeClient()
  1556 {
  1557         AC_TRY_COMPILE([
  1558           #if !defined(__native_client__)
  1559           #error "NO NACL"
  1560           #endif
  1561         ],[
  1562         ],[
  1563         AC_DEFINE(SDL_VIDEO_DRIVER_NACL, 1, [ ])
  1564         AC_DEFINE(SDL_AUDIO_DRIVER_NACL, 1, [ ])
  1565         AC_DEFINE(HAVE_POW, 1, [ ])
  1566         AC_DEFINE(HAVE_OPENGLES2, 1, [ ])
  1567         AC_DEFINE(SDL_VIDEO_OPENGL_ES2, 1, [ ])
  1568         AC_DEFINE(SDL_VIDEO_RENDER_OGL_ES2, 1, [ ])
  1569 
  1570         SDL_LIBS="-lppapi_simple -lppapi_gles2 $SDL_LIBS"
  1571 
  1572         SDLMAIN_SOURCES="$srcdir/src/main/nacl/*.c"
  1573         SOURCES="$SOURCES $srcdir/src/audio/nacl/*.c"
  1574         SUMMARY_audio="${SUMMARY_audio} nacl"
  1575         SOURCES="$SOURCES $srcdir/src/video/nacl/*.c"
  1576         SUMMARY_video="${SUMMARY_video} nacl opengles2"
  1577         ])
  1578 }
  1579 
  1580 
  1581 CheckRPI()
  1582 {
  1583     AC_ARG_ENABLE(video-rpi,
  1584 AC_HELP_STRING([--enable-video-rpi], [use Raspberry Pi video driver [[default=yes]]]),
  1585                   , enable_video_rpi=yes)
  1586     if test x$enable_video = xyes -a x$enable_video_rpi = xyes; then
  1587         AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
  1588         if test x$PKG_CONFIG != xno && $PKG_CONFIG --exists bcm_host; then
  1589             RPI_CFLAGS=`$PKG_CONFIG --cflags bcm_host brcmegl`
  1590             RPI_LDFLAGS=`$PKG_CONFIG --libs bcm_host brcmegl`
  1591         elif test x$ARCH = xnetbsd; then
  1592             RPI_CFLAGS="-I/usr/pkg/include -I/usr/pkg/include/interface/vcos/pthreads -I/usr/pkg/include/interface/vmcs_host/linux"
  1593             RPI_LDFLAGS="-Wl,-R/usr/pkg/lib -L/usr/pkg/lib -lbcm_host"
  1594         else
  1595             RPI_CFLAGS="-I/opt/vc/include -I/opt/vc/include/interface/vcos/pthreads -I/opt/vc/include/interface/vmcs_host/linux"
  1596             RPI_LDFLAGS="-Wl,-rpath,/opt/vc/lib -L/opt/vc/lib -lbcm_host"
  1597         fi
  1598 
  1599         # Save the original compiler flags and libraries
  1600         ac_save_cflags="$CFLAGS"; ac_save_libs="$LIBS"
  1601 
  1602         # Add the Raspberry Pi compiler flags and libraries
  1603         CFLAGS="$CFLAGS $RPI_CFLAGS"; LIBS="$LIBS $RPI_LDFLAGS"
  1604 
  1605         AC_MSG_CHECKING(for Raspberry Pi)
  1606         have_video_rpi=no
  1607         AC_TRY_LINK([
  1608           #include <bcm_host.h>
  1609         ],[
  1610           bcm_host_init();
  1611         ],[
  1612         have_video_rpi=yes
  1613         ],[
  1614         ])
  1615         AC_MSG_RESULT($have_video_rpi)
  1616 
  1617         # Restore the compiler flags and libraries
  1618         CFLAGS="$ac_save_cflags"; LIBS="$ac_save_libs"
  1619         
  1620         if test x$have_video_rpi = xyes; then
  1621             CFLAGS="$CFLAGS $RPI_CFLAGS"
  1622             SDL_CFLAGS="$SDL_CFLAGS $RPI_CFLAGS"
  1623             EXTRA_CFLAGS="$EXTRA_CFLAGS $RPI_CFLAGS"
  1624             EXTRA_LDFLAGS="$EXTRA_LDFLAGS $RPI_LDFLAGS"
  1625             SOURCES="$SOURCES $srcdir/src/video/raspberry/*.c"
  1626             AC_DEFINE(SDL_VIDEO_DRIVER_RPI, 1, [ ])
  1627             SUMMARY_video="${SUMMARY_video} rpi"
  1628         fi
  1629     fi
  1630 }
  1631 
  1632 dnl Find the X11 include and library directories
  1633 CheckX11()
  1634 {
  1635     AC_ARG_ENABLE(video-x11,
  1636 AC_HELP_STRING([--enable-video-x11], [use X11 video driver [[default=yes]]]),
  1637                   , enable_video_x11=yes)
  1638     if test x$enable_video = xyes -a x$enable_video_x11 = xyes; then
  1639         case "$host" in
  1640             *-*-darwin*)
  1641                 # This isn't necessary for X11, but fixes GLX detection
  1642                 if test "x$x_includes" = xNONE && \
  1643                    test "x$x_libraries" = xNONE && \
  1644                    test -d /usr/X11R6/include && \
  1645                    test -d /usr/X11R6/lib; then
  1646                     x_includes="/usr/X11R6/include"
  1647                     x_libraries="/usr/X11R6/lib"
  1648                 fi
  1649                 ;;
  1650         esac
  1651         AC_PATH_X
  1652         AC_PATH_XTRA
  1653         if test x$have_x = xyes; then
  1654             AC_ARG_ENABLE(x11-shared,
  1655 AC_HELP_STRING([--enable-x11-shared], [dynamically load X11 support [[default=maybe]]]),
  1656                           , enable_x11_shared=maybe)
  1657 
  1658             case "$host" in
  1659                 *-*-darwin*)
  1660                     x11_lib='/usr/X11R6/lib/libX11.6.dylib'
  1661                     x11ext_lib='/usr/X11R6/lib/libXext.6.dylib'
  1662                     xcursor_lib='/usr/X11R6/lib/libXcursor.1.dylib'
  1663                     xinerama_lib='/usr/X11R6/lib/libXinerama.1.dylib'
  1664                     xinput_lib='/usr/X11R6/lib/libXi.6.dylib'
  1665                     xrandr_lib='/usr/X11R6/lib/libXrandr.2.dylib'
  1666                     xrender_lib='/usr/X11R6/lib/libXrender.1.dylib'
  1667                     xss_lib='/usr/X11R6/lib/libXss.1.dylib'
  1668                     xvidmode_lib='/usr/X11R6/lib/libXxf86vm.1.dylib'
  1669                     ;;
  1670                 *-*-openbsd*)
  1671                     x11_lib='libX11.so'
  1672                     x11ext_lib='libXext.so'
  1673                     xcursor_lib='libXcursor.so'
  1674                     xinerama_lib='libXinerama.so'
  1675                     xinput_lib='libXi.so'
  1676                     xrandr_lib='libXrandr.so'
  1677                     xrender_lib='libXrender.so'
  1678                     xss_lib='libXss.so'
  1679                     xvidmode_lib='libXxf86vm.so'
  1680                     ;;
  1681                 *)
  1682                     x11_lib=[`find_lib "libX11.so.*" "$X_LIBS -L/usr/X11/$base_libdir -L/usr/X11R6/$base_libdir" | sed 's/.*\/\(.*\)/\1/; q'`]
  1683                     x11ext_lib=[`find_lib "libXext.so.*" "$X_LIBS -L/usr/X11/$base_libdir -L/usr/X11R6/$base_libdir" | sed 's/.*\/\(.*\)/\1/; q'`]
  1684                     xcursor_lib=[`find_lib "libXcursor.so.*" "$X_LIBS -L/usr/X11/$base_libdir -L/usr/X11R6/$base_libdir" | sed 's/.*\/\(.*\)/\1/; q'`]
  1685                     xinerama_lib=[`find_lib "libXinerama.so.*" "$X_LIBS -L/usr/X11/$base_libdir -L/usr/X11R6/$base_libdir" | sed 's/.*\/\(.*\)/\1/; q'`]
  1686                     xinput_lib=[`find_lib "libXi.so.*" "$X_LIBS -L/usr/X11/$base_libdir -L/usr/X11R6/$base_libdir" | sed 's/.*\/\(.*\)/\1/; q'`]
  1687                     xrandr_lib=[`find_lib "libXrandr.so.*" "$X_LIBS -L/usr/X11/$base_libdir -L/usr/X11R6/$base_libdir" | sed 's/.*\/\(.*\)/\1/; q'`]
  1688                     xrender_lib=[`find_lib "libXrender.so.*" "$X_LIBS -L/usr/X11/$base_libdir -L/usr/X11R6/$base_libdir" | sed 's/.*\/\(.*\)/\1/; q'`]
  1689                     xss_lib=[`find_lib "libXss.so.*" "$X_LIBS -L/usr/X11/$base_libdir -L/usr/X11R6/$base_libdir" | sed 's/.*\/\(.*\)/\1/; q'`]
  1690                     xvidmode_lib=[`find_lib "libXxf86vm.so.*" "$X_LIBS -L/usr/X11/$base_libdir -L/usr/X11R6/$base_libdir" | sed 's/.*\/\(.*\)/\1/; q'`]
  1691                     ;;
  1692             esac
  1693 
  1694             if test x$ac_cv_func_shmat != xyes; then
  1695                 X_CFLAGS="$X_CFLAGS -DNO_SHARED_MEMORY"
  1696             fi
  1697             CFLAGS="$CFLAGS $X_CFLAGS"
  1698             LDFLAGS="$LDFLAGS $X_LIBS"
  1699 
  1700             AC_CHECK_HEADER(X11/extensions/Xext.h,
  1701                             have_xext_h_hdr=yes,
  1702                             have_xext_h_hdr=no,
  1703                             [#include <X11/Xlib.h>
  1704                              #include <X11/Xproto.h>
  1705                             ])
  1706             if test x$have_xext_h_hdr != xyes; then
  1707                AC_MSG_ERROR([
  1708 *** Missing Xext.h, maybe you need to install the libxext-dev package?
  1709                ])
  1710             fi
  1711 
  1712             AC_DEFINE(SDL_VIDEO_DRIVER_X11, 1, [ ])
  1713             SOURCES="$SOURCES $srcdir/src/video/x11/*.c"
  1714             EXTRA_CFLAGS="$EXTRA_CFLAGS $X_CFLAGS"
  1715 
  1716             # Needed so SDL applications can include SDL_syswm.h
  1717             SDL_CFLAGS="$SDL_CFLAGS $X_CFLAGS"
  1718 
  1719             if test x$enable_x11_shared = xmaybe; then
  1720                 enable_x11_shared=yes
  1721             fi
  1722             if test x$have_loadso != xyes && \
  1723                test x$enable_x11_shared = xyes; then
  1724                 AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic X11 loading])
  1725                 enable_x11_shared=no
  1726             fi
  1727             if test x$have_loadso = xyes && \
  1728                test x$enable_x11_shared = xyes && test x$x11_lib != x && test x$x11ext_lib != x; then
  1729                 echo "-- dynamic libX11 -> $x11_lib"
  1730                 echo "-- dynamic libX11ext -> $x11ext_lib"
  1731                 AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_X11_DYNAMIC, "$x11_lib", [ ])
  1732                 AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_X11_DYNAMIC_XEXT, "$x11ext_lib", [ ])
  1733                 SUMMARY_video="${SUMMARY_video} x11(dynamic)"
  1734             else
  1735                 enable_x11_shared=no
  1736                 EXTRA_LDFLAGS="$EXTRA_LDFLAGS $X_LIBS -lX11 -lXext"
  1737                 SUMMARY_video="${SUMMARY_video} x11"
  1738             fi
  1739             have_video=yes
  1740 
  1741             AC_MSG_CHECKING(for const parameter to XextAddDisplay)
  1742             have_const_param_XextAddDisplay=no
  1743             AC_TRY_COMPILE([
  1744               #include <X11/Xlib.h>
  1745               #include <X11/Xproto.h>
  1746               #include <X11/extensions/Xext.h>
  1747               #include <X11/extensions/extutil.h>
  1748               extern XExtDisplayInfo* XextAddDisplay(XExtensionInfo* a,Display* b,_Xconst char* c,XExtensionHooks* d,int e,XPointer f);
  1749             ],[
  1750             ],[
  1751             have_const_param_XextAddDisplay=yes
  1752             AC_DEFINE([SDL_VIDEO_DRIVER_X11_CONST_PARAM_XEXTADDDISPLAY], 1, [ ])
  1753             ])
  1754             AC_MSG_RESULT($have_const_param_XextAddDisplay)
  1755 
  1756             dnl AC_CHECK_LIB(X11, XGetEventData, AC_DEFINE(SDL_VIDEO_DRIVER_X11_SUPPORTS_GENERIC_EVENTS, 1, [Have XGenericEvent]))
  1757             AC_MSG_CHECKING([for XGenericEvent])
  1758             have_XGenericEvent=no
  1759             AC_TRY_COMPILE([
  1760                 #include <X11/Xlib.h>
  1761             ],[
  1762 Display *display;
  1763 XEvent event;
  1764 XGenericEventCookie *cookie = &event.xcookie;
  1765 XNextEvent(display, &event);
  1766 XGetEventData(display, cookie);
  1767 XFreeEventData(display, cookie);
  1768             ],[
  1769                 have_XGenericEvent=yes
  1770                 AC_DEFINE([SDL_VIDEO_DRIVER_X11_SUPPORTS_GENERIC_EVENTS], 1, [ ])
  1771             ])
  1772             AC_MSG_RESULT($have_XGenericEvent)
  1773 
  1774             AC_CHECK_LIB(X11, XkbKeycodeToKeysym, AC_DEFINE(SDL_VIDEO_DRIVER_X11_HAS_XKBKEYCODETOKEYSYM, 1, [Have XkbKeycodeToKeysym]))
  1775 
  1776             AC_ARG_ENABLE(video-x11-xcursor,
  1777 AC_HELP_STRING([--enable-video-x11-xcursor], [enable X11 Xcursor support [[default=yes]]]),
  1778                             , enable_video_x11_xcursor=yes)
  1779             if test x$enable_video_x11_xcursor = xyes; then
  1780                 definitely_enable_video_x11_xcursor=no
  1781                 AC_CHECK_HEADER(X11/Xcursor/Xcursor.h,
  1782                                 have_xcursor_h_hdr=yes,
  1783                                 have_xcursor_h_hdr=no,
  1784                                 [#include <X11/Xlib.h>
  1785                                 ])
  1786                 if test x$have_xcursor_h_hdr = xyes; then
  1787                     if test x$enable_x11_shared = xyes && test x$xcursor_lib != x ; then
  1788                         echo "-- dynamic libXcursor -> $xcursor_lib"
  1789                         AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_X11_DYNAMIC_XCURSOR, "$xcursor_lib", [ ])
  1790                         definitely_enable_video_x11_xcursor=yes
  1791                     else
  1792                         AC_CHECK_LIB(Xcursor, XcursorImageCreate, have_xcursor_lib=yes)
  1793                         if test x$have_xcursor_lib = xyes ; then
  1794                             EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lXcursor"
  1795                             definitely_enable_video_x11_xcursor=yes
  1796                         fi
  1797                     fi
  1798                 fi
  1799             fi
  1800             if test x$definitely_enable_video_x11_xcursor = xyes; then
  1801                 AC_DEFINE(SDL_VIDEO_DRIVER_X11_XCURSOR, 1, [ ])
  1802                 SUMMARY_video_x11="${SUMMARY_video_x11} xcursor"
  1803             fi
  1804             AC_ARG_ENABLE(video-x11-xdbe,
  1805 AC_HELP_STRING([--enable-video-x11-xdbe], [enable X11 Xdbe support [[default=yes]]]),
  1806                             , enable_video_x11_xdbe=yes)
  1807             if test x$enable_video_x11_xdbe = xyes; then
  1808                 AC_CHECK_HEADER(X11/extensions/Xdbe.h,
  1809                                 have_dbe_h_hdr=yes,
  1810                                 have_dbe_h_hdr=no,
  1811                                 [#include <X11/Xlib.h>
  1812                                 ])
  1813                 if test x$have_dbe_h_hdr = xyes; then
  1814                     AC_DEFINE(SDL_VIDEO_DRIVER_X11_XDBE, 1, [ ])
  1815                     SUMMARY_video_x11="${SUMMARY_video_x11} xdbe"
  1816                 fi
  1817             fi
  1818             AC_ARG_ENABLE(video-x11-xinerama,
  1819 AC_HELP_STRING([--enable-video-x11-xinerama], [enable X11 Xinerama support [[default=yes]]]),
  1820                             , enable_video_x11_xinerama=yes)
  1821             if test x$enable_video_x11_xinerama = xyes; then
  1822                 definitely_enable_video_x11_xinerama=no
  1823                 AC_CHECK_HEADER(X11/extensions/Xinerama.h,
  1824                                 have_xinerama_h_hdr=yes,
  1825                                 have_xinerama_h_hdr=no,
  1826                                 [#include <X11/Xlib.h>
  1827                                 ])
  1828                 if test x$have_xinerama_h_hdr = xyes; then
  1829                     if test x$enable_x11_shared = xyes && test x$xinerama_lib != x ; then
  1830                         echo "-- dynamic libXinerama -> $xinerama_lib"
  1831                         AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_X11_DYNAMIC_XINERAMA, "$xinerama_lib", [ ])
  1832                         definitely_enable_video_x11_xinerama=yes
  1833                     else
  1834                         AC_CHECK_LIB(Xinerama, XineramaQueryExtension, have_xinerama_lib=yes)
  1835                         if test x$have_xinerama_lib = xyes ; then
  1836                             EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lXinerama"
  1837                             definitely_enable_video_x11_xinerama=yes
  1838                         fi
  1839                     fi
  1840                 fi
  1841             fi
  1842             if test x$definitely_enable_video_x11_xinerama = xyes; then
  1843                 AC_DEFINE(SDL_VIDEO_DRIVER_X11_XINERAMA, 1, [ ])
  1844                 SUMMARY_video_x11="${SUMMARY_video_x11} xinerama"
  1845             fi
  1846             AC_ARG_ENABLE(video-x11-xinput,
  1847 AC_HELP_STRING([--enable-video-x11-xinput], [enable X11 XInput extension for manymouse, tablets, etc [[default=yes]]]),
  1848                             , enable_video_x11_xinput=yes)
  1849             if test x$enable_video_x11_xinput = xyes; then
  1850                 definitely_enable_video_x11_xinput=no
  1851                 AC_CHECK_HEADER(X11/extensions/XInput2.h,
  1852                                 have_xinput_h_hdr=yes,
  1853                                 have_xinput_h_hdr=no,
  1854                                 [#include <X11/Xlib.h>
  1855                                 ])
  1856                 if test x$have_xinput_h_hdr = xyes; then
  1857                     if test x$enable_x11_shared = xyes && test x$xinput_lib != x ; then
  1858                         echo "-- dynamic libXi -> $xinput_lib"
  1859                         AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_X11_DYNAMIC_XINPUT2, "$xinput_lib", [ ])
  1860                         definitely_enable_video_x11_xinput=yes
  1861                     else
  1862                         AC_CHECK_LIB(Xi, XOpenDevice, have_xinput_lib=yes)
  1863                         if test x$have_xinput_lib = xyes ; then
  1864                             EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lXi"
  1865                             definitely_enable_video_x11_xinput=yes
  1866                         fi
  1867                     fi
  1868                 fi
  1869             fi
  1870             if test x$definitely_enable_video_x11_xinput = xyes; then
  1871                 SUMMARY_video_x11="${SUMMARY_video_x11} xinput2"
  1872                 AC_DEFINE(SDL_VIDEO_DRIVER_X11_XINPUT2, 1, [ ])
  1873                 AC_MSG_CHECKING(for xinput2 multitouch)
  1874                 have_xinput2_multitouch=no
  1875                 AC_TRY_COMPILE([
  1876                     #include <X11/Xlib.h>
  1877                     #include <X11/Xproto.h>
  1878                     #include <X11/extensions/XInput2.h>
  1879                     ],[
  1880 int event_type = XI_TouchBegin;
  1881 XITouchClassInfo *t;
  1882                     ],[
  1883                     have_xinput2_multitouch=yes
  1884                     AC_DEFINE([SDL_VIDEO_DRIVER_X11_XINPUT2_SUPPORTS_MULTITOUCH], 1, [])
  1885                     SUMMARY_video_x11="${SUMMARY_video_x11} xinput2_multitouch"
  1886                     ])
  1887                 AC_MSG_RESULT($have_xinput2_multitouch)
  1888             fi
  1889             AC_ARG_ENABLE(video-x11-xrandr,
  1890 AC_HELP_STRING([--enable-video-x11-xrandr], [enable X11 Xrandr extension for fullscreen [[default=yes]]]),
  1891                             , enable_video_x11_xrandr=yes)
  1892             if test x$enable_video_x11_xrandr = xyes; then
  1893                 dnl XRRScreenResources is only present in Xrandr >= 1.2, we use that as a test.
  1894                 definitely_enable_video_x11_xrandr=no
  1895                 have_xrandr_h_hdr=no
  1896                 AC_TRY_COMPILE([
  1897                 #include <X11/Xlib.h>
  1898                 #include <X11/extensions/Xrandr.h>
  1899                 ],[
  1900                 XRRScreenResources *res = NULL;
  1901                 ],[
  1902                 have_xrandr_h_hdr=yes
  1903                 ])
  1904                 if test x$have_xrandr_h_hdr = xyes; then
  1905                     if test x$enable_x11_shared = xyes && test x$xrandr_lib != x ; then
  1906                         echo "-- dynamic libXrandr -> $xrandr_lib"
  1907                         AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_X11_DYNAMIC_XRANDR, "$xrandr_lib", [ ])
  1908                         definitely_enable_video_x11_xrandr=yes
  1909                     else
  1910                         AC_CHECK_LIB(Xrandr, XRRQueryExtension, have_xrandr_lib=yes)
  1911                         if test x$have_xrandr_lib = xyes ; then
  1912                             EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lXrandr"
  1913                             definitely_enable_video_x11_xrandr=yes
  1914                         fi
  1915                     fi
  1916                 fi
  1917             fi
  1918             if test x$definitely_enable_video_x11_xrandr = xyes; then
  1919                 AC_DEFINE(SDL_VIDEO_DRIVER_X11_XRANDR, 1, [ ])
  1920                 SUMMARY_video_x11="${SUMMARY_video_x11} xrandr"
  1921             fi
  1922             AC_ARG_ENABLE(video-x11-scrnsaver,
  1923 AC_HELP_STRING([--enable-video-x11-scrnsaver], [enable X11 screensaver extension [[default=yes]]]),
  1924                             , enable_video_x11_scrnsaver=yes)
  1925             if test x$enable_video_x11_scrnsaver = xyes; then
  1926                 AC_CHECK_HEADER(X11/extensions/scrnsaver.h,
  1927                                 have_scrnsaver_h_hdr=yes,
  1928                                 have_scrnsaver_h_hdr=no,
  1929                                 [#include <X11/Xlib.h>
  1930                                 ])
  1931                 if test x$have_scrnsaver_h_hdr = xyes; then
  1932                     if test x$enable_x11_shared = xyes && test x$xss_lib != x ; then
  1933                         echo "-- dynamic libXss -> $xss_lib"
  1934                         AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_X11_DYNAMIC_XSS, "$xss_lib", [ ])
  1935                         definitely_enable_video_x11_scrnsaver=yes
  1936                     else
  1937                         AC_CHECK_LIB(Xss, XScreenSaverSuspend, have_xss_lib=yes)
  1938                         if test x$have_xss_lib = xyes ; then
  1939                             EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lXss"
  1940                             definitely_enable_video_x11_scrnsaver=yes
  1941                         fi
  1942                     fi
  1943                 fi
  1944             fi
  1945             if test x$definitely_enable_video_x11_scrnsaver = xyes; then
  1946                 AC_DEFINE(SDL_VIDEO_DRIVER_X11_XSCRNSAVER, 1, [ ])
  1947                 SUMMARY_video_x11="${SUMMARY_video_x11} xscrnsaver"
  1948             fi
  1949             AC_ARG_ENABLE(video-x11-xshape,
  1950 AC_HELP_STRING([--enable-video-x11-xshape], [enable X11 XShape support [[default=yes]]]),
  1951                             , enable_video_x11_xshape=yes)
  1952             if test x$enable_video_x11_xshape = xyes; then
  1953                 AC_CHECK_HEADER(X11/extensions/shape.h,
  1954                                 have_shape_h_hdr=yes,
  1955                                 have_shape_h_hdr=no,
  1956                                 [#include <X11/Xlib.h>
  1957                                 ])
  1958                 if test x$have_shape_h_hdr = xyes; then
  1959                     AC_DEFINE(SDL_VIDEO_DRIVER_X11_XSHAPE, 1, [ ])
  1960                     SUMMARY_video_x11="${SUMMARY_video_x11} xshape"
  1961                 fi
  1962             fi
  1963             AC_ARG_ENABLE(video-x11-vm,
  1964 AC_HELP_STRING([--enable-video-x11-vm], [use X11 VM extension for fullscreen [[default=yes]]]),
  1965                             , enable_video_x11_vm=yes)
  1966             if test x$enable_video_x11_vm = xyes; then
  1967                 definitely_enable_video_x11_vm=no
  1968                 AC_CHECK_HEADER(X11/extensions/xf86vmode.h,
  1969                                 have_vm_h_hdr=yes,
  1970                                 have_vm_h_hdr=no,
  1971                                 [#include <X11/Xlib.h>
  1972                                 ])
  1973                 if test x$have_vm_h_hdr = xyes; then
  1974                     if test x$enable_x11_shared = xyes && test x$xvidmode_lib != x ; then
  1975                         echo "-- dynamic libXxf86vm -> $xvidmode_lib"
  1976                         AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_X11_DYNAMIC_XVIDMODE, "$xvidmode_lib", [ ])
  1977                         definitely_enable_video_x11_vm=yes
  1978                     else
  1979                         AC_CHECK_LIB(Xxf86vm, XF86VidModeQueryVersion, have_vm_lib=yes)
  1980                         if test x$have_vm_lib = xyes ; then
  1981                             EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lXxf86vm"
  1982                             definitely_enable_video_x11_vm=yes
  1983                         fi
  1984                     fi
  1985                 fi
  1986             fi
  1987             if test x$definitely_enable_video_x11_vm = xyes; then
  1988                 AC_DEFINE(SDL_VIDEO_DRIVER_X11_XVIDMODE, 1, [ ])
  1989                 SUMMARY_video_x11="${SUMMARY_video_x11} xvidmode"
  1990             fi
  1991         fi
  1992     fi
  1993 }
  1994 
  1995 dnl Set up the Vivante video driver if enabled
  1996 CheckVivanteVideo()
  1997 {
  1998     AC_ARG_ENABLE(video-vivante,
  1999 AC_HELP_STRING([--enable-video-vivante], [use Vivante EGL video driver [[default=yes]]]),
  2000                   , enable_video_vivante=yes)
  2001     if test x$enable_video = xyes -a x$enable_video_vivante = xyes; then
  2002         AC_MSG_CHECKING(for Vivante VDK API)
  2003         have_vivante_vdk=no
  2004         AC_TRY_COMPILE([
  2005           #define LINUX
  2006           #define EGL_API_FB
  2007           #include <gc_vdk.h>
  2008         ],[
  2009         ],[
  2010         have_vivante_vdk=yes
  2011         ])
  2012         AC_MSG_RESULT($have_vivante_vdk)
  2013 
  2014         AC_MSG_CHECKING(for Vivante FB API)
  2015         have_vivante_egl=no
  2016         AC_TRY_COMPILE([
  2017           #define LINUX
  2018           #define EGL_API_FB
  2019           #include <EGL/eglvivante.h>
  2020         ],[
  2021         ],[
  2022         have_vivante_egl=yes
  2023         ])
  2024         AC_MSG_RESULT($have_vivante_egl)
  2025 
  2026         if test x$have_vivante_vdk = xyes -o x$have_vivante_egl = xyes; then
  2027             AC_DEFINE(SDL_VIDEO_DRIVER_VIVANTE, 1, [ ])
  2028             EXTRA_CFLAGS="$EXTRA_CFLAGS -DLINUX -DEGL_API_FB"
  2029             if test x$have_vivante_vdk = xyes; then
  2030                 AC_DEFINE(SDL_VIDEO_DRIVER_VIVANTE_VDK, 1, [ ])
  2031                 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lVDK"
  2032             fi
  2033             SOURCES="$SOURCES $srcdir/src/video/vivante/*.c"
  2034             SUMMARY_video="${SUMMARY_video} vivante"
  2035             have_video=yes
  2036         fi
  2037     fi
  2038 }
  2039 
  2040 dnl Set up the Haiku video driver if enabled
  2041 CheckHaikuVideo()
  2042 {
  2043     if test x$enable_video = xyes; then
  2044         AC_DEFINE(SDL_VIDEO_DRIVER_HAIKU, 1, [ ])
  2045         SOURCES="$SOURCES $srcdir/src/video/haiku/*.cc"
  2046         have_video=yes
  2047         SUMMARY_video="${SUMMARY_video} haiku"
  2048     fi
  2049 }
  2050 
  2051 dnl Set up the Cocoa video driver for Mac OS X (but not Darwin)
  2052 CheckCOCOA()
  2053 {
  2054     AC_ARG_ENABLE(video-cocoa,
  2055 AC_HELP_STRING([--enable-video-cocoa], [use Cocoa video driver [[default=yes]]]),
  2056                   , enable_video_cocoa=yes)
  2057     if test x$enable_video = xyes -a x$enable_video_cocoa = xyes; then
  2058         save_CFLAGS="$CFLAGS"
  2059         dnl Work around that we don't have Objective-C support in autoconf
  2060         CFLAGS="$CFLAGS -x objective-c"
  2061         AC_MSG_CHECKING(for Cocoa framework)
  2062         have_cocoa=no
  2063         AC_TRY_COMPILE([
  2064           #import <Cocoa/Cocoa.h>
  2065         ],[
  2066         ],[
  2067         have_cocoa=yes
  2068         ])
  2069         AC_MSG_RESULT($have_cocoa)
  2070         CFLAGS="$save_CFLAGS"
  2071         if test x$have_cocoa = xyes; then
  2072             AC_DEFINE(SDL_VIDEO_DRIVER_COCOA, 1, [ ])
  2073             SOURCES="$SOURCES $srcdir/src/video/cocoa/*.m"
  2074             SUMMARY_video="${SUMMARY_video} cocoa"
  2075             have_video=yes
  2076         fi
  2077     fi
  2078 }
  2079 
  2080 CheckMETAL()
  2081 {
  2082     AC_ARG_ENABLE(render-metal,
  2083 AC_HELP_STRING([--enable-render-metal], [enable the Metal render driver [[default=yes]]]),
  2084                                 , enable_render_metal=yes)
  2085     if test x$enable_render = xyes -a x$enable_render_metal = xyes; then
  2086         save_CFLAGS="$CFLAGS"
  2087         dnl Work around that we don't have Objective-C support in autoconf
  2088         CFLAGS="$CFLAGS -x objective-c"
  2089         AC_MSG_CHECKING(for Metal framework)
  2090         have_metal=no
  2091         AC_TRY_COMPILE([
  2092           #import <Cocoa/Cocoa.h>
  2093           #import <Metal/Metal.h>
  2094           #import <QuartzCore/CAMetalLayer.h>
  2095 
  2096           #if !TARGET_CPU_X86_64
  2097           #error Metal doesn't work on this configuration
  2098           #endif
  2099         ],[
  2100         ],[
  2101         have_metal=yes
  2102         ])
  2103         CFLAGS="$save_CFLAGS"
  2104         AC_MSG_RESULT($have_metal)
  2105         if test x$have_metal = xyes; then
  2106             AC_DEFINE(SDL_VIDEO_RENDER_METAL, 1, [ ])
  2107             SOURCES="$SOURCES $srcdir/src/render/metal/*.m"
  2108             SUMMARY_video="${SUMMARY_video} metal"
  2109         else
  2110             enable_render_metal=no
  2111         fi
  2112     fi
  2113 }
  2114 
  2115 
  2116 dnl Find DirectFB
  2117 CheckDirectFB()
  2118 {
  2119     AC_ARG_ENABLE(video-directfb,
  2120 AC_HELP_STRING([--enable-video-directfb], [use DirectFB video driver [[default=no]]]),
  2121                   , enable_video_directfb=no)
  2122     if test x$enable_video = xyes -a x$enable_video_directfb = xyes; then
  2123         video_directfb=no
  2124 
  2125         DIRECTFB_REQUIRED_VERSION=1.0.0
  2126         AC_PATH_PROGS(DIRECTFBCONFIG, directfb-config, no, [$prefix/bin:$PATH])
  2127         if test x$DIRECTFBCONFIG = xno; then
  2128             AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
  2129             if test x$PKG_CONFIG != xno; then
  2130                 if $PKG_CONFIG --atleast-pkgconfig-version 0.7 && $PKG_CONFIG --atleast-version $DIRECTFB_REQUIRED_VERSION directfb; then
  2131                     DIRECTFB_CFLAGS=`$PKG_CONFIG --cflags directfb`
  2132                     DIRECTFB_LIBS=`$PKG_CONFIG --libs directfb`
  2133                     DIRECTFB_PREFIX=`$PKG_CONFIG --variable=prefix directfb`
  2134                     video_directfb=yes
  2135                 fi
  2136             fi
  2137         else
  2138             set -- `echo $DIRECTFB_REQUIRED_VERSION | sed 's/\./ /g'`
  2139             NEED_VERSION=`expr $1 \* 10000 + $2 \* 100 + $3`
  2140             set -- `$DIRECTFBCONFIG --version | sed 's/\./ /g'`
  2141             HAVE_VERSION=`expr $1 \* 10000 + $2 \* 100 + $3`
  2142             if test $HAVE_VERSION -ge $NEED_VERSION; then
  2143                 DIRECTFB_CFLAGS=`$DIRECTFBCONFIG --cflags`
  2144                 DIRECTFB_LIBS=`$DIRECTFBCONFIG --libs`
  2145                 DIRECTFB_PREFIX=`$DIRECTFBCONFIG --prefix`
  2146                 video_directfb=yes
  2147             fi
  2148         fi
  2149         if test x$video_directfb = xyes; then
  2150             # SuSE 11.1 installs directfb-config without directfb-devel
  2151             save_CPPFLAGS="$CPPFLAGS"
  2152             CPPFLAGS="$CPPFLAGS $DIRECTFB_CFLAGS"
  2153             AC_CHECK_HEADER(directfb.h, have_directfb_hdr=yes, have_directfb_hdr=no)
  2154             CPPFLAGS="$save_CPPFLAGS"
  2155             video_directfb=$have_directfb_hdr
  2156         fi
  2157         AC_MSG_CHECKING(for DirectFB $DIRECTFB_REQUIRED_VERSION support)
  2158         AC_MSG_RESULT($video_directfb)
  2159 
  2160         if test x$video_directfb = xyes; then
  2161             AC_ARG_ENABLE(directfb-shared,
  2162 AC_HELP_STRING([--enable-directfb-shared], [dynamically load directfb support [[default=yes]]]),
  2163                               , enable_directfb_shared=yes)
  2164 
  2165             AC_DEFINE(SDL_VIDEO_DRIVER_DIRECTFB, 1, [ ])
  2166             AC_DEFINE(SDL_VIDEO_RENDER_DIRECTFB, 1, [ ])
  2167             SOURCES="$SOURCES $srcdir/src/video/directfb/*.c"
  2168             EXTRA_CFLAGS="$EXTRA_CFLAGS $DIRECTFB_CFLAGS"
  2169 
  2170             AC_MSG_CHECKING(for directfb dynamic loading support)
  2171             directfb_shared=no
  2172             directfb_lib=[`find_lib "libdirectfb*.so.*" "$DIRECTFB_LIBS"`]
  2173             # | sed 's/.*\/\(.*\)/\1/; q'`]
  2174 AC_MSG_WARN("directfb $directfb_lib")
  2175             if test x$have_loadso != xyes && \
  2176                test x$enable_directfb_shared = xyes; then
  2177                 AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic directfb loading])
  2178             fi
  2179             if test x$have_loadso = xyes && \
  2180                test x$enable_directfb_shared = xyes && test x$directfb_lib != x; then
  2181                 directfb_shared=yes
  2182                 echo "-- $directfb_lib_spec -> $directfb_lib"
  2183                 AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_DIRECTFB_DYNAMIC, "$directfb_lib", [ ])
  2184                 SUMMARY_video="${SUMMARY_video} directfb(dynamic)"
  2185             else
  2186                 EXTRA_LDFLAGS="$EXTRA_LDFLAGS $DIRECTFB_LIBS"
  2187                 SUMMARY_video="${SUMMARY_video} directfb"
  2188             fi
  2189             AC_MSG_RESULT($directfb_shared)
  2190             SDL_CFLAGS="$SDL_CFLAGS $DIRECTFB_CFLAGS"
  2191             have_video=yes
  2192         fi
  2193     fi
  2194 }
  2195 
  2196 dnl Find KMSDRM
  2197 CheckKMSDRM()
  2198 {
  2199     AC_ARG_ENABLE(video-kmsdrm,
  2200 AC_HELP_STRING([--enable-video-kmsdrm], [use KMSDRM video driver [[default=no]]]),
  2201                   , enable_video_kmsdrm=no)
  2202 
  2203     if test x$enable_video = xyes -a x$enable_video_kmsdrm = xyes; then
  2204         video_kmsdrm=no
  2205         libdrm_avail=no
  2206         libgbm_avail=no
  2207 
  2208         LIBDRM_REQUIRED_VERSION=2.4.46
  2209         LIBGBM_REQUIRED_VERSION=9.0.0
  2210 
  2211         AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
  2212         if test x$PKG_CONFIG != xno; then
  2213             if $PKG_CONFIG --atleast-pkgconfig-version 0.7; then
  2214                 if $PKG_CONFIG --atleast-version $LIBDRM_REQUIRED_VERSION libdrm; then
  2215                     LIBDRM_CFLAGS=`$PKG_CONFIG --cflags libdrm`
  2216                     LIBDRM_LIBS=`$PKG_CONFIG --libs libdrm`
  2217                     LIBDRM_PREFIX=`$PKG_CONFIG --variable=prefix libdrm`
  2218                     libdrm_avail=yes
  2219                 fi
  2220                 if $PKG_CONFIG --atleast-version $LIBGBM_REQUIRED_VERSION gbm; then
  2221                     LIBGBM_CFLAGS=`$PKG_CONFIG --cflags gbm`
  2222                     LIBGBM_LIBS=`$PKG_CONFIG --libs gbm`
  2223                     LIBGBM_PREFIX=`$PKG_CONFIG --variable=prefix gbm`
  2224                     libgbm_avail=yes
  2225                 fi
  2226                 if test x$libdrm_avail = xyes -a x$libgbm_avail = xyes; then
  2227                     video_kmsdrm=yes
  2228                 fi
  2229  
  2230                 AC_MSG_CHECKING(for libdrm $LIBDRM_REQUIRED_VERSION library for kmsdrm support)
  2231                 AC_MSG_RESULT($libdrm_avail)
  2232                 AC_MSG_CHECKING(for libgbm $LIBGBM_REQUIRED_VERSION library for kmsdrm support)
  2233                 AC_MSG_RESULT($libgbm_avail)
  2234 
  2235                 if test x$video_kmsdrm = xyes; then
  2236                     AC_ARG_ENABLE(kmsdrm-shared,
  2237 AC_HELP_STRING([--enable-kmsdrm-shared], [dynamically load kmsdrm support [[default=yes]]]),
  2238                               , enable_kmsdrm_shared=yes)
  2239 
  2240                     AC_DEFINE(SDL_VIDEO_DRIVER_KMSDRM, 1, [ ])
  2241                     SOURCES="$SOURCES $srcdir/src/video/kmsdrm/*.c"
  2242                     EXTRA_CFLAGS="$EXTRA_CFLAGS $LIBDRM_CFLAGS $LIBGBM_CFLAGS"
  2243 
  2244                     AC_MSG_CHECKING(for kmsdrm dynamic loading support)
  2245                     kmsdrm_shared=no
  2246                     drm_lib=[`find_lib "libdrm.so.*" "$DRM_LIBS"`]
  2247                     gbm_lib=[`find_lib "libgbm.so.*" "$DRM_LIBS"`]
  2248                     if test x$have_loadso != xyes && \
  2249                        test x$enable_kmsdrm_shared = xyes; then
  2250                         AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic kmsdrm loading])
  2251                     fi
  2252                     if test x$have_loadso = xyes && \
  2253                        test x$enable_kmsdrm_shared = xyes && test x$drm_lib != x && test x$gbm_lib != x; then
  2254                         kmsdrm_shared=yes
  2255                         AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_KMSDRM_DYNAMIC, "$drm_lib", [ ])
  2256                         AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_KMSDRM_DYNAMIC_GBM, "$gbm_lib", [ ])
  2257                         AC_DEFINE_UNQUOTED(HAVE_KMSDRM_SHARED, "TRUE", [ ])
  2258                         SUMMARY_video="${SUMMARY_video} kmsdrm(dynamic)"
  2259                     else
  2260                         EXTRA_LDFLAGS="$EXTRA_LDFLAGS $LIBDRM_LIBS $LIBGBM_LIBS"
  2261                         SUMMARY_video="${SUMMARY_video} kmsdrm"
  2262                     fi
  2263                     AC_MSG_RESULT($kmsdrm_shared)
  2264                     have_video=yes
  2265                 fi
  2266             fi
  2267         fi
  2268     fi
  2269 }
  2270 
  2271 dnl rcg04172001 Set up the Null video driver.
  2272 CheckDummyVideo()
  2273 {
  2274     AC_ARG_ENABLE(video-dummy,
  2275 AC_HELP_STRING([--enable-video-dummy], [use dummy video driver [[default=yes]]]),
  2276                   , enable_video_dummy=yes)
  2277     if test x$enable_video_dummy = xyes; then
  2278         AC_DEFINE(SDL_VIDEO_DRIVER_DUMMY, 1, [ ])
  2279         SOURCES="$SOURCES $srcdir/src/video/dummy/*.c"
  2280         have_video=yes
  2281         SUMMARY_video="${SUMMARY_video} dummy"
  2282     fi
  2283 }
  2284 
  2285 dnl Set up the QNX video driver if enabled
  2286 CheckQNXVideo()
  2287 {
  2288     if test x$enable_video = xyes; then
  2289         AC_DEFINE(SDL_VIDEO_DRIVER_QNX, 1, [ ])
  2290         SOURCES="$SOURCES $srcdir/src/video/qnx/*.c"
  2291         have_video=yes
  2292         EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lscreen -lEGL -lGLESv2"
  2293         SUMMARY_video="${SUMMARY_video} qnx"
  2294     fi
  2295 }
  2296 
  2297 dnl Set up the QNX audio driver if enabled
  2298 CheckQNXAudio()
  2299 {
  2300     if test x$enable_audio = xyes; then
  2301         AC_DEFINE(SDL_AUDIO_DRIVER_QSA, 1, [ ])
  2302         SOURCES="$SOURCES $srcdir/src/audio/qsa/*.c"
  2303         have_audio=yes
  2304         EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lasound"
  2305         SUMMARY_audio="${SUMMARY_audio} qsa"
  2306     fi
  2307 }
  2308 
  2309 dnl Check to see if OpenGL support is desired
  2310 AC_ARG_ENABLE(video-opengl,
  2311 AC_HELP_STRING([--enable-video-opengl], [include OpenGL support [[default=yes]]]),
  2312               , enable_video_opengl=yes)
  2313 
  2314 dnl Find OpenGL
  2315 CheckOpenGLX11()
  2316 {
  2317     if test x$enable_video = xyes -a x$enable_video_opengl = xyes; then
  2318         AC_MSG_CHECKING(for OpenGL (GLX) support)
  2319         video_opengl=no
  2320         AC_TRY_COMPILE([
  2321          #include <GL/gl.h>
  2322          #include <GL/glx.h>
  2323         ],[
  2324         ],[
  2325         video_opengl=yes
  2326         ])
  2327         AC_MSG_RESULT($video_opengl)
  2328         if test x$video_opengl = xyes; then
  2329             AC_DEFINE(SDL_VIDEO_OPENGL, 1, [ ])
  2330             AC_DEFINE(SDL_VIDEO_OPENGL_GLX, 1, [ ])
  2331             AC_DEFINE(SDL_VIDEO_RENDER_OGL, 1, [ ])
  2332             SUMMARY_video="${SUMMARY_video} opengl"
  2333         fi
  2334     fi
  2335 }
  2336 
  2337 dnl Check to see if OpenGL ES support is desired
  2338 AC_ARG_ENABLE(video-opengles,
  2339 AC_HELP_STRING([--enable-video-opengles], [include OpenGL ES support [[default=yes]]]),
  2340               , enable_video_opengles=yes)
  2341 AC_ARG_ENABLE(video-opengles1,
  2342 AC_HELP_STRING([--enable-video-opengles1], [include OpenGL ES 1.1 support [[default=yes]]]),
  2343               , enable_video_opengles1=yes)
  2344 AC_ARG_ENABLE(video-opengles2,
  2345 AC_HELP_STRING([--enable-video-opengles2], [include OpenGL ES 2.0 support [[default=yes]]]),
  2346               , enable_video_opengles2=yes)
  2347 
  2348 dnl Find OpenGL ES
  2349 CheckOpenGLESX11()
  2350 {
  2351     if test x$enable_video = xyes -a x$enable_video_opengles = xyes; then
  2352         AC_MSG_CHECKING(for EGL support)
  2353         video_opengl_egl=no
  2354         AC_TRY_COMPILE([
  2355           #define LINUX
  2356           #define EGL_API_FB
  2357           #include <EGL/egl.h>
  2358           #include <EGL/eglext.h>
  2359         ],[
  2360         ],[
  2361         video_opengl_egl=yes
  2362         ])
  2363         AC_MSG_RESULT($video_opengl_egl)
  2364         if test x$video_opengl_egl = xyes; then
  2365             AC_DEFINE(SDL_VIDEO_OPENGL_EGL, 1, [ ])
  2366         fi
  2367             
  2368         if test x$enable_video_opengles1 = xyes; then
  2369             AC_MSG_CHECKING(for OpenGL ES v1 headers)
  2370             video_opengles_v1=no
  2371             AC_TRY_COMPILE([
  2372              #include <GLES/gl.h>
  2373              #include <GLES/glext.h>
  2374             ],[
  2375             ],[
  2376             video_opengles_v1=yes
  2377             ])
  2378             AC_MSG_RESULT($video_opengles_v1)
  2379             if test x$video_opengles_v1 = xyes; then
  2380                 AC_DEFINE(SDL_VIDEO_OPENGL_ES, 1, [ ])
  2381                 AC_DEFINE(SDL_VIDEO_RENDER_OGL_ES, 1, [ ])
  2382                 SUMMARY_video="${SUMMARY_video} opengl_es1"
  2383             fi
  2384         fi
  2385         
  2386         if test x$enable_video_opengles2 = xyes; then
  2387             AC_MSG_CHECKING(for OpenGL ES v2 headers)
  2388             video_opengles_v2=no
  2389             AC_TRY_COMPILE([
  2390              #include <GLES2/gl2.h>
  2391              #include <GLES2/gl2ext.h>
  2392             ],[
  2393             ],[
  2394             video_opengles_v2=yes
  2395             ])
  2396             AC_MSG_RESULT($video_opengles_v2)
  2397             if test x$video_opengles_v2 = xyes; then
  2398                 AC_DEFINE(SDL_VIDEO_OPENGL_ES2, 1, [ ])
  2399                 AC_DEFINE(SDL_VIDEO_RENDER_OGL_ES2, 1, [ ])
  2400                 SUMMARY_video="${SUMMARY_video} opengl_es2"
  2401             fi
  2402         fi
  2403     fi
  2404 }
  2405 
  2406 dnl Check for Windows OpenGL
  2407 CheckWINDOWSGL()
  2408 {
  2409     if test x$enable_video = xyes -a x$enable_video_opengl = xyes; then
  2410         AC_DEFINE(SDL_VIDEO_OPENGL, 1, [ ])
  2411         AC_DEFINE(SDL_VIDEO_OPENGL_WGL, 1, [ ])
  2412         AC_DEFINE(SDL_VIDEO_RENDER_OGL, 1, [ ])
  2413         SUMMARY_video="${SUMMARY_video} opengl"
  2414     fi
  2415 }
  2416 
  2417 dnl Check for Windows OpenGL
  2418 CheckWINDOWSGLES()
  2419 {
  2420     if test x$enable_video = xyes -a x$enable_video_opengles = xyes; then
  2421 
  2422         AC_MSG_CHECKING(for EGL support)
  2423         video_opengl_egl=no
  2424         AC_TRY_COMPILE([
  2425          #include <EGL/egl.h>
  2426         ],[
  2427         ],[
  2428         video_opengl_egl=yes
  2429         ])
  2430         AC_MSG_RESULT($video_opengl_egl)
  2431         if test x$video_opengl_egl = xyes; then
  2432             AC_DEFINE(SDL_VIDEO_OPENGL, 1, [ ])
  2433             AC_DEFINE(SDL_VIDEO_OPENGL_EGL, 1, [ ])
  2434             SUMMARY_video="${SUMMARY_video} opengl_es1"
  2435         fi
  2436        
  2437         AC_MSG_CHECKING(for OpenGL ES v2 headers)
  2438         video_opengles_v2=no
  2439         AC_TRY_COMPILE([
  2440          #include <GLES2/gl2.h>
  2441          #include <GLES2/gl2ext.h>
  2442         ],[
  2443         ],[
  2444         video_opengles_v2=yes
  2445         ])
  2446         AC_MSG_RESULT($video_opengles_v2)
  2447         if test x$video_opengles_v2 = xyes; then
  2448             AC_DEFINE(SDL_VIDEO_OPENGL, 1, [ ])
  2449             AC_DEFINE(SDL_VIDEO_OPENGL_ES2, 1, [ ])
  2450             AC_DEFINE(SDL_VIDEO_RENDER_OGL_ES2, 1, [ ])
  2451             SUMMARY_video="${SUMMARY_video} opengl_es2"
  2452         fi
  2453     fi
  2454 }
  2455 
  2456 dnl Check for Haiku OpenGL
  2457 CheckHaikuGL()
  2458 {
  2459     if test x$enable_video = xyes -a x$enable_video_opengl = xyes; then
  2460         AC_DEFINE(SDL_VIDEO_OPENGL, 1, [ ])
  2461         AC_DEFINE(SDL_VIDEO_OPENGL_HAIKU, 1, [ ])
  2462         AC_DEFINE(SDL_VIDEO_RENDER_OGL, 1, [ ])
  2463         EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lGL"
  2464         SUMMARY_video="${SUMMARY_video} opengl"
  2465     fi
  2466 }
  2467 
  2468 dnl Check for MacOS OpenGL
  2469 CheckMacGL()
  2470 {
  2471     if test x$enable_video = xyes -a x$enable_video_opengl = xyes; then
  2472         AC_DEFINE(SDL_VIDEO_OPENGL, 1, [ ])
  2473         AC_DEFINE(SDL_VIDEO_OPENGL_CGL, 1, [ ])
  2474         AC_DEFINE(SDL_VIDEO_RENDER_OGL, 1, [ ])
  2475         SUMMARY_video="${SUMMARY_video} opengl"
  2476     fi
  2477 }
  2478 
  2479 dnl Check for MacOS OpenGLES
  2480 CheckMacGLES()
  2481 {
  2482     if test x$enable_video = xyes -a x$enable_video_opengles = xyes; then
  2483         video_opengl_egl=yes
  2484         AC_DEFINE(SDL_VIDEO_OPENGL_EGL, 1, [ ])
  2485         video_opengles_v2=yes
  2486         AC_DEFINE(SDL_VIDEO_OPENGL_ES2, 1, [ ])
  2487         AC_DEFINE(SDL_VIDEO_RENDER_OGL_ES2, 1, [ ])
  2488         SUMMARY_video="${SUMMARY_video} opengl_es2"
  2489     fi
  2490 }
  2491 
  2492 CheckEmscriptenGLES()
  2493 {
  2494     if test x$enable_video = xyes -a x$enable_video_opengles = xyes; then
  2495         AC_MSG_CHECKING(for EGL support)
  2496         video_opengl_egl=no
  2497         AC_TRY_COMPILE([
  2498          #include <EGL/egl.h>
  2499         ],[
  2500         ],[
  2501         video_opengl_egl=yes
  2502         ])
  2503         AC_MSG_RESULT($video_opengl_egl)
  2504         if test x$video_opengl_egl = xyes; then
  2505             AC_DEFINE(SDL_VIDEO_OPENGL_EGL, 1, [ ])
  2506         fi
  2507 
  2508         AC_MSG_CHECKING(for OpenGL ES v2 headers)
  2509         video_opengles_v2=no
  2510         AC_TRY_COMPILE([
  2511          #include <GLES2/gl2.h>
  2512          #include <GLES2/gl2ext.h>
  2513         ],[
  2514         ],[
  2515         video_opengles_v2=yes
  2516         ])
  2517         AC_MSG_RESULT($video_opengles_v2)
  2518         if test x$video_opengles_v2 = xyes; then
  2519             AC_DEFINE(SDL_VIDEO_OPENGL_ES2, 1, [ ])
  2520             AC_DEFINE(SDL_VIDEO_RENDER_OGL_ES2, 1, [ ])
  2521             SUMMARY_video="${SUMMARY_video} opengl_es2"
  2522         fi
  2523     fi
  2524 }
  2525 
  2526 dnl Check to see if Vulkan support is desired
  2527 AC_ARG_ENABLE(video-vulkan,
  2528 AC_HELP_STRING([--enable-video-vulkan], [include Vulkan support [[default=yes]]]),
  2529               , enable_video_vulkan=yes)
  2530 
  2531 dnl Find Vulkan Header
  2532 CheckVulkan()
  2533 {
  2534     if test x$enable_video = xyes -a x$enable_video_vulkan = xyes; then
  2535         case "$host" in
  2536             *-*-android*)
  2537                 AC_TRY_COMPILE([
  2538                   #if defined(__ARM_ARCH) && __ARM_ARCH < 7
  2539                   #error Vulkan doesn't work on this configuration
  2540                   #endif
  2541                 ],[
  2542                 ],[
  2543                 ],[
  2544                     enable_video_vulkan=no
  2545                 ])
  2546                 ;;
  2547             *-*-darwin*)
  2548                 save_CFLAGS="$CFLAGS"
  2549                 dnl Work around that we don't have Objective-C support in autoconf
  2550                 CFLAGS="$CFLAGS -x objective-c"
  2551                 AC_TRY_COMPILE([
  2552                   #include <Cocoa/Cocoa.h>
  2553                   #include <Metal/Metal.h>
  2554                   #include <QuartzCore/CAMetalLayer.h>
  2555 
  2556                   #if !TARGET_CPU_X86_64
  2557                   #error Vulkan doesn't work on this configuration
  2558                   #endif
  2559                 ],[
  2560                 ],[
  2561                 ],[
  2562                     enable_video_vulkan=no
  2563                 ])
  2564                 CFLAGS="$save_CFLAGS"
  2565                 ;;
  2566             *)
  2567                 ;;
  2568         esac
  2569         if test x$enable_video_vulkan = xno; then
  2570             # For reasons I am totally unable to see, I get an undefined macro error if
  2571             # I put this in the AC_TRY_COMPILE.
  2572             AC_MSG_WARN([Vulkan does not work on this configuration.])
  2573         fi
  2574     fi
  2575     if test x$enable_video_vulkan = xyes; then
  2576         AC_DEFINE(SDL_VIDEO_VULKAN, 1, [ ])
  2577         SUMMARY_video="${SUMMARY_video} vulkan"
  2578     fi
  2579 }
  2580 
  2581 dnl See if we can use the new unified event interface in Linux 2.4
  2582 CheckInputEvents()
  2583 {
  2584     dnl Check for Linux 2.4 unified input event interface support
  2585         AC_MSG_CHECKING(for Linux 2.4 unified input interface)
  2586         use_input_events=no
  2587         AC_TRY_COMPILE([
  2588           #include <linux/input.h>
  2589         ],[
  2590           #ifndef EVIOCGNAME
  2591           #error EVIOCGNAME() ioctl not available
  2592           #endif
  2593         ],[
  2594         use_input_events=yes
  2595         ])
  2596         AC_MSG_RESULT($use_input_events)
  2597         if test x$use_input_events = xyes; then
  2598             AC_DEFINE(SDL_INPUT_LINUXEV, 1, [ ])
  2599             SUMMARY_input="${SUMMARY_input} linuxev"
  2600         fi
  2601 }
  2602 
  2603 dnl See if we can use the kernel kd.h header
  2604 CheckInputKD()
  2605 {
  2606 
  2607     AC_MSG_CHECKING(for Linux kd.h)
  2608     use_input_kd=no
  2609     AC_TRY_COMPILE([
  2610       #include <linux/kd.h>
  2611       #include <linux/keyboard.h>
  2612     ],[
  2613         struct kbentry kbe;
  2614         kbe.kb_table = KG_CTRL;
  2615         ioctl(0, KDGKBENT, &kbe);
  2616     ],[
  2617     use_input_kd=yes
  2618     ])
  2619     AC_MSG_RESULT($use_input_kd)
  2620     if test x$use_input_kd = xyes; then
  2621         AC_DEFINE(SDL_INPUT_LINUXKD, 1, [ ])
  2622         SUMMARY_input="${SUMMARY_input} linuxkd"
  2623     fi
  2624 }
  2625 
  2626 dnl See if the platform offers libudev for device enumeration and hotplugging.
  2627 CheckLibUDev()
  2628 {
  2629     AC_ARG_ENABLE(libudev,
  2630 AC_HELP_STRING([--enable-libudev], [enable libudev support [[default=yes]]]),
  2631                         , enable_libudev=yes)
  2632     if test x$enable_libudev = xyes; then
  2633         AC_CHECK_HEADER(libudev.h,
  2634                         have_libudev_h_hdr=yes,
  2635                         have_libudev_h_hdr=no)
  2636         if test x$have_libudev_h_hdr = xyes; then
  2637             AC_DEFINE(HAVE_LIBUDEV_H, 1, [ ])
  2638 
  2639             udev_lib=[`find_lib "libudev.so.*" "" | sed 's/.*\/\(.*\)/\1/; q'`]
  2640             if test x$udev_lib != x; then
  2641                 echo "-- dynamic udev -> $udev_lib"
  2642                 AC_DEFINE_UNQUOTED(SDL_UDEV_DYNAMIC, "$udev_lib", [ ])
  2643             fi
  2644         fi
  2645     fi
  2646 }
  2647 
  2648 dnl See if the platform offers libdbus for various IPC techniques.
  2649 CheckDBus()
  2650 {
  2651     AC_ARG_ENABLE(dbus,
  2652 AC_HELP_STRING([--enable-dbus], [enable D-Bus support [[default=yes]]]),
  2653                         , enable_dbus=yes)
  2654     if test x$enable_dbus = xyes; then
  2655         AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
  2656         if test x$PKG_CONFIG != xno; then
  2657             DBUS_CFLAGS=`$PKG_CONFIG --cflags dbus-1`
  2658             save_CFLAGS="$CFLAGS"
  2659             CFLAGS="$save_CFLAGS $DBUS_CFLAGS"
  2660             AC_CHECK_HEADER(dbus/dbus.h,
  2661                             have_dbus_dbus_h_hdr=yes,
  2662                             have_dbus_dbus_h_hdr=no)
  2663             CFLAGS="$save_CFLAGS"
  2664             if test x$have_dbus_dbus_h_hdr = xyes; then
  2665                 AC_DEFINE(HAVE_DBUS_DBUS_H, 1, [ ])
  2666                 EXTRA_CFLAGS="$EXTRA_CFLAGS $DBUS_CFLAGS"
  2667                 SOURCES="$SOURCES $srcdir/src/core/linux/SDL_dbus.c"
  2668             fi
  2669         fi
  2670     fi
  2671 }
  2672 
  2673 dnl See if the platform wanna IME support.
  2674 CheckIME()
  2675 {
  2676     AC_ARG_ENABLE(ime,
  2677 AC_HELP_STRING([--enable-ime], [enable IME support [[default=yes]]]),
  2678                   , enable_ime=yes)
  2679     if test x$enable_ime = xyes; then
  2680         AC_DEFINE(SDL_USE_IME, 1, [ ])
  2681             SOURCES="$SOURCES $srcdir/src/core/linux/SDL_ime.c"
  2682     fi
  2683 }
  2684 
  2685 dnl See if the platform has libibus IME support.
  2686 CheckIBus()
  2687 {
  2688     AC_ARG_ENABLE(ibus,
  2689 AC_HELP_STRING([--enable-ibus], [enable IBus support [[default=yes]]]),
  2690                   , enable_ibus=yes)
  2691     if test x$enable_ibus = xyes; then
  2692         AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
  2693         if test x$PKG_CONFIG != xno; then
  2694             IBUS_CFLAGS=`$PKG_CONFIG --cflags ibus-1.0`
  2695             save_CFLAGS="$CFLAGS"
  2696             CFLAGS="$save_CFLAGS $IBUS_CFLAGS"
  2697             AC_CHECK_HEADER(ibus-1.0/ibus.h,
  2698                             have_ibus_ibus_h_hdr=yes,
  2699                             have_ibus_ibus_h_hdr=no)
  2700             AC_CHECK_HEADER(sys/inotify.h,
  2701                             have_inotify_inotify_h_hdr=yes,
  2702                             have_inotify_inotify_h_hdr=no)
  2703             CFLAGS="$save_CFLAGS"
  2704             if test x$have_ibus_ibus_h_hdr = xyes; then
  2705                 if test x$enable_ime != xyes; then
  2706                     AC_MSG_WARN([IME support is required for IBus.])
  2707                     have_ibus_ibus_h_hdr=no
  2708                 elif test x$enable_dbus != xyes; then
  2709                     AC_MSG_WARN([DBus support is required for IBus.])
  2710                     have_ibus_ibus_h_hdr=no
  2711                 elif test x$have_inotify_inotify_h_hdr != xyes; then
  2712                     AC_MSG_WARN([INotify support is required for IBus.])
  2713                     have_ibus_ibus_h_hdr=no
  2714                 else
  2715                     AC_DEFINE(HAVE_IBUS_IBUS_H, 1, [ ])
  2716                     EXTRA_CFLAGS="$EXTRA_CFLAGS $IBUS_CFLAGS"
  2717                     SOURCES="$SOURCES $srcdir/src/core/linux/SDL_ibus.c"
  2718                fi
  2719             fi
  2720         fi
  2721     fi
  2722 }
  2723 
  2724 dnl See if the platform has fcitx IME support.
  2725 CheckFcitx()
  2726 {
  2727     AC_ARG_ENABLE(fcitx,
  2728 AC_HELP_STRING([--enable-fcitx], [enable fcitx support [[default=yes]]]),
  2729                   , enable_fcitx=yes)
  2730     if test x$enable_fcitx = xyes; then
  2731         AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
  2732         if test x$PKG_CONFIG != xno; then
  2733             FCITX_CFLAGS=`$PKG_CONFIG --cflags fcitx`
  2734             CFLAGS="$CFLAGS $FCITX_CFLAGS"
  2735             AC_CHECK_HEADER(fcitx/frontend.h,
  2736                             have_fcitx_frontend_h_hdr=yes,
  2737                             have_fcitx_frontend_h_hdr=no)
  2738             CFLAGS="$save_CFLAGS"
  2739             if test x$have_fcitx_frontend_h_hdr = xyes; then
  2740                 if test x$enable_ime != xyes; then
  2741                     AC_MSG_WARN([IME support is required for fcitx.])
  2742                     have_fcitx_frontend_h_hdr=no
  2743                 elif test x$enable_dbus != xyes; then
  2744                     AC_MSG_WARN([DBus support is required for fcitx.])
  2745                     have_fcitx_frontend_h_hdr=no
  2746                 else
  2747                     AC_DEFINE(HAVE_FCITX_FRONTEND_H, 1, [ ])
  2748                     EXTRA_CFLAGS="$EXTRA_CFLAGS $FCITX_CFLAGS"
  2749                     SOURCES="$SOURCES $srcdir/src/core/linux/SDL_fcitx.c"
  2750                fi
  2751             fi
  2752         fi
  2753     fi
  2754 }
  2755 
  2756 dnl See if we can use the Touchscreen input library
  2757 CheckTslib()
  2758 {
  2759     AC_ARG_ENABLE(input-tslib,
  2760 AC_HELP_STRING([--enable-input-tslib], [use the Touchscreen library for input [[default=yes]]]),
  2761                   , enable_input_tslib=yes)
  2762     if test x$enable_input_tslib = xyes; then
  2763         AC_MSG_CHECKING(for Touchscreen library support)
  2764         enable_input_tslib=no
  2765         AC_TRY_COMPILE([
  2766           #include "tslib.h"
  2767         ],[
  2768         ],[
  2769         enable_input_tslib=yes
  2770         ])
  2771         AC_MSG_RESULT($enable_input_tslib)
  2772         if test x$enable_input_tslib = xyes; then
  2773             AC_DEFINE(SDL_INPUT_TSLIB, 1, [ ])
  2774             EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lts"
  2775             SUMMARY_input="${SUMMARY_input} ts"
  2776         fi
  2777     fi
  2778 }
  2779 
  2780 dnl See what type of thread model to use on Linux and Solaris
  2781 CheckPTHREAD()
  2782 {
  2783     dnl Check for pthread support
  2784     AC_ARG_ENABLE(pthreads,
  2785 AC_HELP_STRING([--enable-pthreads], [use POSIX threads for multi-threading [[default=yes]]]),
  2786                   , enable_pthreads=yes)
  2787     dnl This is used on Linux for glibc binary compatibility (Doh!)
  2788     AC_ARG_ENABLE(pthread-sem,
  2789 AC_HELP_STRING([--enable-pthread-sem], [use pthread semaphores [[default=yes]]]),
  2790                   , enable_pthread_sem=yes)
  2791     case "$host" in
  2792          *-*-android*)
  2793             pthread_cflags="-D_REENTRANT -D_THREAD_SAFE"
  2794             pthread_lib=""
  2795             ;;
  2796         *-*-linux*|*-*-uclinux*)
  2797             pthread_cflags="-D_REENTRANT"
  2798             pthread_lib="-lpthread"
  2799             ;;
  2800         *-*-bsdi*)
  2801             pthread_cflags="-D_REENTRANT -D_THREAD_SAFE"
  2802             pthread_lib=""
  2803             ;;
  2804         *-*-darwin*)
  2805             pthread_cflags="-D_THREAD_SAFE"
  2806 # causes Carbon.p complaints?
  2807 #            pthread_cflags="-D_REENTRANT -D_THREAD_SAFE"
  2808             ;;
  2809         *-*-freebsd*|*-*-dragonfly*)
  2810             pthread_cflags="-D_REENTRANT -D_THREAD_SAFE"
  2811             pthread_lib="-pthread"
  2812             ;;
  2813         *-*-netbsd*)
  2814             pthread_cflags="-D_REENTRANT -D_THREAD_SAFE"
  2815             pthread_lib="-lpthread"
  2816             ;;
  2817         *-*-openbsd*)
  2818             pthread_cflags="-D_REENTRANT"
  2819             pthread_lib="-pthread"
  2820             ;;
  2821         *-*-solaris2.9)
  2822             # From Solaris 9+, posix4's preferred name is rt.
  2823             pthread_cflags="-D_REENTRANT"
  2824             pthread_lib="-lpthread -lrt"
  2825             ;;
  2826         *-*-solaris2.10)
  2827             # Solaris 10+ merged pthread into libc.
  2828             pthread_cflags="-D_REENTRANT"
  2829             pthread_lib="-lrt"
  2830             ;;
  2831         *-*-solaris*)
  2832             # Solaris 11+ merged rt into libc.
  2833             pthread_cflags="-D_REENTRANT"
  2834             pthread_lib=""
  2835             ;;
  2836         *-*-sysv5*)
  2837             pthread_cflags="-D_REENTRANT -Kthread"
  2838             pthread_lib=""
  2839             ;;
  2840         *-*-aix*)
  2841             pthread_cflags="-D_REENTRANT -mthreads"
  2842             pthread_lib="-lpthread"
  2843             ;;
  2844         *-*-hpux11*)
  2845             pthread_cflags="-D_REENTRANT"
  2846             pthread_lib="-L/usr/lib -lpthread"
  2847             ;;
  2848         *-*-haiku*)
  2849             pthread_cflags="-D_REENTRANT"
  2850             pthread_lib=""
  2851             ;;
  2852         *-*-nto*)
  2853             pthread_cflags="-D_REENTRANT"
  2854             pthread_lib=""
  2855             ;;
  2856         *)
  2857             pthread_cflags="-D_REENTRANT"
  2858             pthread_lib="-lpthread"
  2859             ;;
  2860     esac
  2861     if test x$enable_threads = xyes -a x$enable_pthreads = xyes; then
  2862         # Save the original compiler flags and libraries
  2863         ac_save_cflags="$CFLAGS"; ac_save_libs="$LIBS"
  2864         # Add the pthread compiler flags and libraries
  2865         CFLAGS="$CFLAGS $pthread_cflags"; LIBS="$LIBS $pthread_lib"
  2866         # Check to see if we have pthread support on this system
  2867         AC_MSG_CHECKING(for pthreads)
  2868         use_pthreads=no
  2869         AC_TRY_LINK([
  2870          #include <pthread.h>
  2871         ],[
  2872          pthread_attr_t type;
  2873          pthread_attr_init(&type);
  2874         ],[
  2875         use_pthreads=yes
  2876         ])
  2877         AC_MSG_RESULT($use_pthreads)
  2878         # Restore the compiler flags and libraries
  2879         CFLAGS="$ac_save_cflags"; LIBS="$ac_save_libs"
  2880 
  2881         # Do futher testing if we have pthread support...
  2882         if test x$use_pthreads = xyes; then
  2883             AC_DEFINE(SDL_THREAD_PTHREAD, 1, [ ])
  2884             EXTRA_CFLAGS="$EXTRA_CFLAGS $pthread_cflags"
  2885             EXTRA_LDFLAGS="$EXTRA_LDFLAGS $pthread_lib"
  2886             SDL_CFLAGS="$SDL_CFLAGS $pthread_cflags"
  2887 
  2888             # Save the original compiler flags and libraries
  2889             ac_save_cflags="$CFLAGS"; ac_save_libs="$LIBS"
  2890             # Add the pthread compiler flags and libraries
  2891             CFLAGS="$CFLAGS $pthread_cflags"; LIBS="$LIBS $pthread_lib"
  2892 
  2893             # Check to see if recursive mutexes are available
  2894             AC_MSG_CHECKING(for recursive mutexes)
  2895             has_recursive_mutexes=no
  2896             if test x$has_recursive_mutexes = xno; then
  2897                 AC_TRY_LINK([
  2898                   #define _GNU_SOURCE 1
  2899                   #include <pthread.h>
  2900                 ],[
  2901                   pthread_mutexattr_t attr;
  2902                   pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
  2903                 ],[
  2904                 has_recursive_mutexes=yes
  2905                 AC_DEFINE(SDL_THREAD_PTHREAD_RECURSIVE_MUTEX, 1, [ ])
  2906                 ])
  2907             fi
  2908             if test x$has_recursive_mutexes = xno; then
  2909                 AC_TRY_LINK([
  2910                   #define _GNU_SOURCE 1
  2911                   #include <pthread.h>
  2912                 ],[
  2913                   pthread_mutexattr_t attr;
  2914                   pthread_mutexattr_setkind_np(&attr, PTHREAD_MUTEX_RECURSIVE_NP);
  2915                 ],[
  2916                 has_recursive_mutexes=yes
  2917                 AC_DEFINE(SDL_THREAD_PTHREAD_RECURSIVE_MUTEX_NP, 1, [ ])
  2918                 ])
  2919             fi
  2920             AC_MSG_RESULT($has_recursive_mutexes)
  2921 
  2922             # Check to see if pthread semaphore support is missing
  2923             if test x$enable_pthread_sem = xyes; then
  2924                 AC_MSG_CHECKING(for pthread semaphores)
  2925                 have_pthread_sem=no
  2926                 AC_TRY_COMPILE([
  2927                   #include <pthread.h>
  2928                   #include <semaphore.h>
  2929                 ],[
  2930                 ],[
  2931                 have_pthread_sem=yes
  2932                 ])
  2933                 AC_MSG_RESULT($have_pthread_sem)
  2934             fi
  2935             if test x$have_pthread_sem = xyes; then
  2936                 AC_MSG_CHECKING(for sem_timedwait)
  2937                 have_sem_timedwait=no
  2938                 AC_TRY_LINK([
  2939                   #include <pthread.h>
  2940                   #include <semaphore.h>
  2941                 ],[
  2942                   sem_timedwait(NULL, NULL);
  2943                 ],[
  2944                 have_sem_timedwait=yes
  2945                 AC_DEFINE([HAVE_SEM_TIMEDWAIT], 1, [ ])
  2946                 ])
  2947                 AC_MSG_RESULT($have_sem_timedwait)
  2948             fi
  2949 
  2950             AC_CHECK_HEADER(pthread_np.h, have_pthread_np_h=yes, have_pthread_np_h=no, [ #include <pthread.h> ])
  2951             if test x$have_pthread_np_h = xyes; then
  2952                 AC_DEFINE(HAVE_PTHREAD_NP_H, 1, [ ])
  2953             fi
  2954 
  2955             # Check to see if pthread naming is available
  2956             AC_MSG_CHECKING(for pthread_setname_np)
  2957             AC_TRY_LINK_FUNC(pthread_setname_np, [
  2958               has_pthread_setname_np=yes
  2959               AC_DEFINE(HAVE_PTHREAD_SETNAME_NP, 1, [ ])
  2960             ],[
  2961               has_pthread_setname_np=no
  2962             ])
  2963             AC_MSG_RESULT($has_pthread_setname_np)
  2964 
  2965             AC_MSG_CHECKING(for pthread_set_name_np)
  2966             AC_TRY_LINK_FUNC(pthread_set_name_np, [
  2967               has_pthread_set_name_np=yes
  2968               AC_DEFINE(HAVE_PTHREAD_SET_NAME_NP, 1, [ ])
  2969             ],[
  2970               has_pthread_set_name_np=no
  2971             ])
  2972             AC_MSG_RESULT($has_pthread_set_name_np)
  2973 
  2974             # Restore the compiler flags and libraries
  2975             CFLAGS="$ac_save_cflags"; LIBS="$ac_save_libs"
  2976 
  2977             # Basic thread creation functions
  2978             SOURCES="$SOURCES $srcdir/src/thread/pthread/SDL_systhread.c"
  2979 
  2980             # Semaphores
  2981             # We can fake these with mutexes and condition variables if necessary
  2982             if test x$have_pthread_sem = xyes; then
  2983                 SOURCES="$SOURCES $srcdir/src/thread/pthread/SDL_syssem.c"
  2984             else
  2985                 SOURCES="$SOURCES $srcdir/src/thread/generic/SDL_syssem.c"
  2986             fi
  2987 
  2988             # Mutexes
  2989             # We can fake these with semaphores if necessary
  2990             SOURCES="$SOURCES $srcdir/src/thread/pthread/SDL_sysmutex.c"
  2991 
  2992             # Condition variables
  2993             # We can fake these with semaphores and mutexes if necessary
  2994             SOURCES="$SOURCES $srcdir/src/thread/pthread/SDL_syscond.c"
  2995 
  2996             # Thread local storage
  2997             SOURCES="$SOURCES $srcdir/src/thread/pthread/SDL_systls.c"
  2998 
  2999             have_threads=yes
  3000         fi
  3001     fi
  3002 }
  3003 
  3004 dnl Determine whether the compiler can produce Windows executables
  3005 CheckWINDOWS()
  3006 {
  3007     AC_MSG_CHECKING(Windows compiler)
  3008     have_win32_gcc=no
  3009     AC_TRY_COMPILE([
  3010      #include <windows.h>
  3011     ],[
  3012     ],[
  3013     have_win32_gcc=yes
  3014     ])
  3015     AC_MSG_RESULT($have_win32_gcc)
  3016     if test x$have_win32_gcc != xyes; then
  3017        AC_MSG_ERROR([
  3018 *** Your compiler ($CC) does not produce Windows executables!
  3019        ])
  3020     fi
  3021 
  3022     AC_MSG_CHECKING(Windows CE)
  3023     have_wince=no
  3024     AC_TRY_COMPILE([
  3025 #if !defined(_WIN32_WCE) && !defined(__MINGW32CE__)
  3026 #error This is not Windows CE
  3027 #endif
  3028     ],[
  3029     ],[
  3030     have_wince=yes
  3031        AC_MSG_ERROR([
  3032 *** Sorry, Windows CE is no longer supported.
  3033        ])
  3034     ])
  3035     AC_MSG_RESULT($have_wince)
  3036 
  3037     # This fixes Windows stack alignment with newer GCC
  3038     CheckStackBoundary
  3039 }
  3040 
  3041 dnl Find the DirectX includes and libraries
  3042 CheckDIRECTX()
  3043 {
  3044     AC_ARG_ENABLE(directx,
  3045 AC_HELP_STRING([--enable-directx], [use DirectX for Windows audio/video [[default=yes]]]),
  3046                   , enable_directx=yes)
  3047     if test x$enable_directx = xyes; then
  3048         AC_CHECK_HEADER(d3d9.h, have_d3d=yes)
  3049         AC_CHECK_HEADER(d3d11_1.h, have_d3d11=yes)
  3050         AC_CHECK_HEADER(ddraw.h, have_ddraw=yes)
  3051         AC_CHECK_HEADER(dsound.h, have_dsound=yes)
  3052         AC_CHECK_HEADER(dinput.h, have_dinput=yes)
  3053         AC_CHECK_HEADER(dxgi.h, have_dxgi=yes)
  3054         AC_CHECK_HEADER(xinput.h, have_xinput=yes)
  3055         AC_TRY_COMPILE([
  3056 #include <windows.h>
  3057 #include <xinput.h>
  3058 XINPUT_GAMEPAD_EX x1;
  3059         ],[],[have_xinput_gamepadex=yes])
  3060         AC_TRY_COMPILE([
  3061 #include <windows.h>
  3062 #include <xinput.h>
  3063 XINPUT_STATE_EX s1;
  3064         ],[],[have_xinput_stateex=yes])
  3065 
  3066         if test x$have_ddraw = xyes; then
  3067             AC_DEFINE(HAVE_DDRAW_H, 1, [ ])
  3068         fi
  3069         if test x$have_dinput = xyes; then
  3070             AC_DEFINE(HAVE_DINPUT_H, 1, [ ])
  3071         fi
  3072         if test x$have_dsound = xyes; then
  3073             AC_DEFINE(HAVE_DSOUND_H, 1, [ ])
  3074         fi
  3075         if test x$have_dxgi = xyes; then
  3076             AC_DEFINE(HAVE_DXGI_H, 1, [ ])
  3077         fi
  3078         if test x$have_xinput = xyes; then
  3079             AC_DEFINE(HAVE_XINPUT_H, 1, [ ])
  3080         fi
  3081         if test x$have_xinput_gamepadex = xyes; then
  3082             AC_DEFINE(HAVE_XINPUT_GAMEPAD_EX, 1, [ ])
  3083         fi
  3084         if test x$have_xinput_stateex = xyes; then
  3085             AC_DEFINE(HAVE_XINPUT_STATE_EX, 1, [ ])
  3086         fi
  3087 
  3088         SUMMARY_video="${SUMMARY_video} directx"
  3089         SUMMARY_audio="${SUMMARY_audio} directx"
  3090 
  3091         # FIXME: latest Cygwin finds dinput headers, but we die on other win32 headers.
  3092         # FIXME:  ...so force it off for now.
  3093         case "$host" in
  3094             *-*-cygwin*)
  3095             have_dinput=false
  3096             ;;
  3097         esac
  3098     fi
  3099 
  3100     AC_CHECK_HEADER(mmdeviceapi.h, have_wasapi=yes)
  3101     if test x$have_wasapi = xyes; then
  3102         AC_DEFINE(HAVE_MMDEVICEAPI_H,1,[])
  3103     fi
  3104     AC_CHECK_HEADER(audioclient.h,,have_wasapi=no)
  3105     if test x$have_wasapi = xyes; then
  3106         AC_DEFINE(HAVE_AUDIOCLIENT_H,1,[])
  3107     fi
  3108 
  3109     AC_CHECK_HEADER(endpointvolume.h,AC_DEFINE(HAVE_ENDPOINTVOLUME_H,1,[]))
  3110 
  3111     AC_ARG_ENABLE(wasapi,
  3112 AC_HELP_STRING([--enable-wasapi], [use the Windows WASAPI audio driver [[default=yes]]]),
  3113                                 , enable_wasapi=yes)
  3114 }
  3115 
  3116 dnl Check for the dlfcn.h interface for dynamically loading objects
  3117 CheckDLOPEN()
  3118 {
  3119     AC_ARG_ENABLE(sdl-dlopen,
  3120 AC_HELP_STRING([--enable-sdl-dlopen], [use dlopen for shared object loading [[default=yes]]]),
  3121                   , enable_sdl_dlopen=yes)
  3122     if test x$enable_sdl_dlopen = xyes; then
  3123         AC_MSG_CHECKING(for dlopen)
  3124         have_dlopen=no
  3125         AC_TRY_COMPILE([
  3126          #include <dlfcn.h>
  3127         ],[
  3128          void *handle = dlopen("", RTLD_NOW);
  3129          const char *loaderror = (char *) dlerror();
  3130         ],[
  3131         have_dlopen=yes
  3132         ])
  3133         AC_MSG_RESULT($have_dlopen)
  3134 
  3135         if test x$have_dlopen = xyes; then
  3136             AC_CHECK_LIB(c, dlopen, EXTRA_LDFLAGS="$EXTRA_LDFLAGS",
  3137                AC_CHECK_LIB(dl, dlopen, EXTRA_LDFLAGS="$EXTRA_LDFLAGS -ldl",
  3138                   AC_CHECK_LIB(ltdl, dlopen, EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lltdl")))
  3139             AC_DEFINE(SDL_LOADSO_DLOPEN, 1, [ ])
  3140             SOURCES="$SOURCES $srcdir/src/loadso/dlopen/*.c"
  3141             have_loadso=yes
  3142         fi
  3143     fi
  3144 }
  3145 
  3146 dnl Check for the usbhid(3) library on *BSD
  3147 CheckUSBHID()
  3148 {
  3149     case "$host" in
  3150         *-*-*bsd*)
  3151             if test x$enable_joystick = xyes; then
  3152                 AC_CHECK_LIB(usbhid, hid_init, have_libusbhid=yes)
  3153                 if test x$have_libusbhid = xyes; then
  3154                     AC_CHECK_HEADER(usbhid.h, [USB_CFLAGS="-DHAVE_USBHID_H"])
  3155                     AC_CHECK_HEADER(libusbhid.h, [USB_CFLAGS="-DHAVE_LIBUSBHID_H"])
  3156                     USB_LIBS="$USB_LIBS -lusbhid"
  3157                 else
  3158                     AC_CHECK_HEADER(usb.h, [USB_CFLAGS="-DHAVE_USB_H"])
  3159                     AC_CHECK_HEADER(libusb.h, [USB_CFLAGS="-DHAVE_LIBUSB_H"])
  3160                     AC_CHECK_LIB(usb, hid_init, [USB_LIBS="$USB_LIBS -lusb"])
  3161                 fi
  3162                     
  3163                 save_CFLAGS="$CFLAGS"
  3164                 CFLAGS="$CFLAGS $USB_CFLAGS"
  3165 
  3166                 AC_MSG_CHECKING(for usbhid)
  3167                 have_usbhid=no
  3168                 AC_TRY_COMPILE([
  3169                   #include <sys/types.h>
  3170                   #if defined(HAVE_USB_H)
  3171                   #include <usb.h>
  3172                   #endif
  3173                   #ifdef __DragonFly__
  3174                   # include <bus/usb/usb.h>
  3175                   # include <bus/usb/usbhid.h>
  3176                   #else
  3177                   # include <dev/usb/usb.h>
  3178                   # include <dev/usb/usbhid.h>
  3179                   #endif
  3180                   #if defined(HAVE_USBHID_H)
  3181                   #include <usbhid.h>
  3182                   #elif defined(HAVE_LIBUSB_H)
  3183                   #include <libusb.h>
  3184                   #elif defined(HAVE_LIBUSBHID_H)
  3185                   #include <libusbhid.h>
  3186                   #endif
  3187                 ],[
  3188                   struct report_desc *repdesc;
  3189                   struct usb_ctl_report *repbuf;
  3190                   hid_kind_t hidkind;
  3191                 ],[
  3192                 have_usbhid=yes
  3193                 ])
  3194                 AC_MSG_RESULT($have_usbhid)
  3195 
  3196                 if test x$have_usbhid = xyes; then
  3197                     AC_MSG_CHECKING(for ucr_data member of usb_ctl_report)
  3198                     have_usbhid_ucr_data=no
  3199                     AC_TRY_COMPILE([
  3200                       #include <sys/types.h>
  3201                       #if defined(HAVE_USB_H)
  3202                       #include <usb.h>
  3203                       #endif
  3204                       #ifdef __DragonFly__
  3205                       # include <bus/usb/usb.h>
  3206                       # include <bus/usb/usbhid.h>
  3207                       #else
  3208                       # include <dev/usb/usb.h>
  3209                       # include <dev/usb/usbhid.h>
  3210                       #endif
  3211                       #if defined(HAVE_USBHID_H)
  3212                       #include <usbhid.h>
  3213                       #elif defined(HAVE_LIBUSB_H)
  3214                       #include <libusb.h>
  3215                       #elif defined(HAVE_LIBUSBHID_H)
  3216                       #include <libusbhid.h>
  3217                       #endif
  3218                     ],[
  3219                       struct usb_ctl_report buf;
  3220                       if (buf.ucr_data) { }
  3221                     ],[
  3222                     have_usbhid_ucr_data=yes
  3223                     ])
  3224                     if test x$have_usbhid_ucr_data = xyes; then
  3225                         USB_CFLAGS="$USB_CFLAGS -DUSBHID_UCR_DATA"
  3226                     fi
  3227                     AC_MSG_RESULT($have_usbhid_ucr_data)
  3228                     
  3229                     AC_MSG_CHECKING(for new usbhid API)
  3230                     have_usbhid_new=no
  3231                     AC_TRY_COMPILE([
  3232                       #include <sys/types.h>
  3233                       #if defined(HAVE_USB_H)
  3234                       #include <usb.h>
  3235                       #endif
  3236                       #ifdef __DragonFly__
  3237                       #include <bus/usb/usb.h>
  3238                       #include <bus/usb/usbhid.h>
  3239                       #else
  3240                       #include <dev/usb/usb.h>
  3241                       #include <dev/usb/usbhid.h>
  3242                       #endif
  3243                       #if defined(HAVE_USBHID_H)
  3244                       #include <usbhid.h>
  3245                       #elif defined(HAVE_LIBUSB_H)
  3246                       #include <libusb.h>
  3247                       #elif defined(HAVE_LIBUSBHID_H)
  3248                       #include <libusbhid.h>
  3249                       #endif
  3250                     ],[
  3251                       report_desc_t d;
  3252                       hid_start_parse(d, 1, 1);
  3253                     ],[
  3254                     have_usbhid_new=yes
  3255                     ])
  3256                     if test x$have_usbhid_new = xyes; then
  3257                         USB_CFLAGS="$USB_CFLAGS -DUSBHID_NEW"
  3258                     fi
  3259                     AC_MSG_RESULT($have_usbhid_new)
  3260 
  3261                     AC_MSG_CHECKING(for struct joystick in machine/joystick.h)
  3262                     have_machine_joystick=no
  3263                     AC_TRY_COMPILE([
  3264                       #include <machine/joystick.h>
  3265                     ],[
  3266                       struct joystick t;
  3267                     ],[
  3268                     have_machine_joystick=yes
  3269                     ])
  3270                     if test x$have_machine_joystick = xyes; then
  3271                         AC_DEFINE(SDL_JOYSTICK_USBHID_MACHINE_JOYSTICK_H, 1, [ ])
  3272                     fi
  3273                     AC_MSG_RESULT($have_machine_joystick)
  3274 
  3275                     AC_DEFINE(SDL_JOYSTICK_USBHID, 1, [ ])
  3276                     SOURCES="$SOURCES $srcdir/src/joystick/bsd/*.c"
  3277                     EXTRA_CFLAGS="$EXTRA_CFLAGS $USB_CFLAGS"
  3278                     EXTRA_LDFLAGS="$EXTRA_LDFLAGS $USB_LIBS"
  3279                     have_joystick=yes
  3280                 fi
  3281                 CFLAGS="$save_CFLAGS"
  3282             fi
  3283         ;;
  3284     esac
  3285 }
  3286 
  3287 dnl Check for HIDAPI joystick drivers
  3288 CheckHIDAPI()
  3289 {
  3290     # The hidraw support doesn't catch Xbox, PS4 and Nintendo controllers,
  3291     # so we'll just use libusb when it's available.
  3292     #
  3293     # Except that libusb requires root permissions to open devices, so that's not generally useful, and we'll disable this by default.
  3294     AC_ARG_ENABLE(hidapi,
  3295 AC_HELP_STRING([--enable-hidapi], [use HIDAPI for low level joystick drivers [[default=no]]]),
  3296                   , enable_hidapi=no)
  3297     if test x$enable_joystick = xyes -a x$enable_hidapi = xyes; then
  3298         hidapi_support=no
  3299         AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
  3300         if test x$PKG_CONFIG != xno; then
  3301             LIBUSB_CFLAGS=`$PKG_CONFIG --cflags libusb-1.0`
  3302             LIBUSB_LDFLAGS=`$PKG_CONFIG --libs libusb-1.0`
  3303             save_CFLAGS="$CFLAGS"
  3304             CFLAGS="$save_CFLAGS $LIBUSB_CFLAGS"
  3305             AC_CHECK_HEADER(libusb.h, have_libusb_h=yes)
  3306             CFLAGS="$save_CFLAGS"
  3307         fi
  3308         if test x$have_libusb_h = xyes; then
  3309             hidapi_support=yes
  3310             AC_DEFINE(SDL_JOYSTICK_HIDAPI, 1, [ ])
  3311             EXTRA_CFLAGS="$EXTRA_CFLAGS -I$srcdir/src/hidapi/hidapi"
  3312             SOURCES="$SOURCES $srcdir/src/joystick/hidapi/*.c"
  3313             SOURCES="$SOURCES $srcdir/src/hidapi/libusb/hid.c"
  3314             EXTRA_CFLAGS="$EXTRA_CFLAGS $LIBUSB_CFLAGS"
  3315             EXTRA_LDFLAGS="$EXTRA_LDFLAGS $LIBUSB_LDFLAGS"
  3316         fi
  3317         AC_MSG_CHECKING(for hidapi support)
  3318         AC_MSG_RESULT($hidapi_support)
  3319     fi
  3320 }
  3321 
  3322 dnl Check for clock_gettime()
  3323 CheckClockGettime()
  3324 {
  3325     AC_ARG_ENABLE(clock_gettime,
  3326 AC_HELP_STRING([--enable-clock_gettime], [use clock_gettime() instead of gettimeofday() on UNIX [[default=yes]]]),
  3327                   , enable_clock_gettime=yes)
  3328     if test x$enable_clock_gettime = xyes; then
  3329         AC_CHECK_LIB(rt, clock_gettime, have_clock_gettime=yes)
  3330         if test x$have_clock_gettime = xyes; then
  3331             AC_DEFINE(HAVE_CLOCK_GETTIME, 1, [ ])
  3332             EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lrt"
  3333         else
  3334             AC_CHECK_LIB(c, clock_gettime, have_clock_gettime=yes)
  3335             if test x$have_clock_gettime = xyes; then
  3336                AC_DEFINE(HAVE_CLOCK_GETTIME, 1, [ ])
  3337                EXTRA_LDFLAGS="$EXTRA_LDFLAGS"
  3338             fi
  3339         fi
  3340     fi
  3341 }
  3342 
  3343 dnl Check for a valid linux/version.h
  3344 CheckLinuxVersion()
  3345 {
  3346     AC_CHECK_HEADER(linux/version.h, have_linux_version_h=yes)
  3347     if test x$have_linux_version_h = xyes; then
  3348         EXTRA_CFLAGS="$EXTRA_CFLAGS -DHAVE_LINUX_VERSION_H"
  3349     fi
  3350 }
  3351 
  3352 dnl Check if we want to use RPATH
  3353 CheckRPATH()
  3354 {
  3355     AC_ARG_ENABLE(rpath,
  3356 AC_HELP_STRING([--enable-rpath], [use an rpath when linking SDL [[default=yes]]]),
  3357                   , enable_rpath=yes)
  3358 }
  3359 
  3360 dnl Do this on all platforms, before everything else (other things might want to override it).
  3361 CheckWarnAll
  3362 
  3363 dnl Set up the configuration based on the host platform!
  3364 case "$host" in
  3365     *-*-linux*|*-*-uclinux*|*-*-gnu*|*-*-k*bsd*-gnu|*-*-bsdi*|*-*-freebsd*|*-*-dragonfly*|*-*-netbsd*|*-*-openbsd*|*-*-sysv5*|*-*-solaris*|*-*-hpux*|*-*-aix*|*-*-minix*|*-*-nto*)
  3366         case "$host" in
  3367             *-*-android*)
  3368                 # Android
  3369                 ARCH=android
  3370                 ANDROID_CFLAGS="-DGL_GLEXT_PROTOTYPES"
  3371                 CFLAGS="$CFLAGS $ANDROID_CFLAGS"
  3372                 SDL_CFLAGS="$SDL_CFLAGS $ANDROID_CFLAGS"
  3373                 EXTRA_CFLAGS="$EXTRA_CFLAGS $ANDROID_CFLAGS"
  3374                 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -ldl -lGLESv1_CM -lGLESv2 -llog -landroid"
  3375                 SDLMAIN_SOURCES="$srcdir/src/main/android/*.c"
  3376 
  3377                 if test x$enable_video = xyes; then
  3378                     SOURCES="$SOURCES $srcdir/src/core/android/*.c $srcdir/src/video/android/*.c"
  3379                     # FIXME: confdefs? Not AC_DEFINE?
  3380                     $as_echo "#define SDL_VIDEO_DRIVER_ANDROID 1" >>confdefs.h
  3381                     SUMMARY_video="${SUMMARY_video} android"
  3382                 fi
  3383                 ;;
  3384             *-*-linux*)         ARCH=linux ;;
  3385             *-*-uclinux*)       ARCH=linux ;;
  3386             *-*-kfreebsd*-gnu)  ARCH=kfreebsd-gnu ;;
  3387             *-*-knetbsd*-gnu)   ARCH=knetbsd-gnu ;;
  3388             *-*-kopenbsd*-gnu)  ARCH=kopenbsd-gnu ;;
  3389             *-*-gnu*)           ARCH=gnu ;; # must be last of the gnu variants
  3390             *-*-bsdi*)          ARCH=bsdi ;;
  3391             *-*-freebsd*)       ARCH=freebsd ;;
  3392             *-*-dragonfly*)     ARCH=freebsd ;;
  3393             *-*-netbsd*)        ARCH=netbsd ;;
  3394             *-*-openbsd*)       ARCH=openbsd ;;
  3395             *-*-sysv5*)         ARCH=sysv5 ;;
  3396             *-*-solaris*)       ARCH=solaris ;;
  3397             *-*-hpux*)          ARCH=hpux ;;
  3398             *-*-aix*)           ARCH=aix ;;
  3399             *-*-minix*)         ARCH=minix ;;
  3400             *-*-nto*)           ARCH=nto
  3401                 CheckQNXVideo
  3402                 ;;
  3403         esac
  3404         CheckVisibilityHidden
  3405         CheckDeclarationAfterStatement
  3406         CheckDummyVideo
  3407         CheckDiskAudio
  3408         CheckDummyAudio
  3409         CheckDLOPEN
  3410         CheckOSS
  3411         CheckALSA
  3412         CheckPulseAudio
  3413         CheckJACK
  3414         CheckARTSC
  3415         CheckESD
  3416         CheckNAS
  3417         CheckSNDIO
  3418         CheckFusionSound
  3419         CheckLibSampleRate
  3420         # Need to check for Raspberry PI first and add platform specific compiler flags, otherwise the test for GLES fails!
  3421         CheckRPI
  3422         CheckX11
  3423         CheckDirectFB
  3424         CheckKMSDRM
  3425         CheckOpenGLX11
  3426         CheckOpenGLESX11
  3427         CheckVulkan
  3428         CheckMir
  3429         CheckWayland
  3430         CheckLibUDev
  3431         CheckDBus
  3432         CheckIME
  3433         CheckIBus
  3434         CheckFcitx
  3435         case $ARCH in
  3436           linux)
  3437               CheckInputEvents
  3438               CheckInputKD
  3439           ;;
  3440         esac
  3441         CheckTslib
  3442         CheckUSBHID
  3443         CheckHIDAPI
  3444         CheckPTHREAD
  3445         CheckClockGettime
  3446         CheckLinuxVersion
  3447         CheckRPATH
  3448         CheckVivanteVideo
  3449 
  3450         # Set up files for the audio library
  3451         if test x$enable_audio = xyes; then
  3452           case $ARCH in
  3453             sysv5|solaris|hpux)
  3454                 AC_DEFINE(SDL_AUDIO_DRIVER_SUNAUDIO, 1, [ ])
  3455                 SOURCES="$SOURCES $srcdir/src/audio/sun/*.c"
  3456                 SUMMARY_audio="${SUMMARY_audio} sun"
  3457                 have_audio=yes
  3458             ;;
  3459             netbsd)  # Don't use this on OpenBSD, it's busted.
  3460                 AC_DEFINE(SDL_AUDIO_DRIVER_NETBSD, 1, [ ])
  3461                 SOURCES="$SOURCES $srcdir/src/audio/netbsd/*.c"
  3462                 SUMMARY_audio="${SUMMARY_audio} netbsd"
  3463                 have_audio=yes
  3464             ;;
  3465             aix)
  3466                 AC_DEFINE(SDL_AUDIO_DRIVER_PAUDIO, 1, [ ])
  3467                 SOURCES="$SOURCES $srcdir/src/audio/paudio/*.c"
  3468                 SUMMARY_audio="${SUMMARY_audio} paudio"
  3469                 have_audio=yes
  3470             ;;
  3471             android)
  3472                 AC_DEFINE(SDL_AUDIO_DRIVER_ANDROID, 1, [ ])
  3473                 SOURCES="$SOURCES $srcdir/src/audio/android/*.c"
  3474                 SUMMARY_audio="${SUMMARY_audio} android"
  3475                 have_audio=yes
  3476             ;;
  3477             nto)
  3478                 CheckQNXAudio
  3479             ;;
  3480           esac
  3481         fi
  3482         # Set up files for the joystick library
  3483         if test x$enable_joystick = xyes; then
  3484           case $ARCH in
  3485             linux)
  3486                 AC_DEFINE(SDL_JOYSTICK_LINUX, 1, [ ])
  3487                 SOURCES="$SOURCES $srcdir/src/joystick/linux/*.c"
  3488                 SOURCES="$SOURCES $srcdir/src/joystick/steam/*.c"
  3489                 have_joystick=yes
  3490             ;;
  3491             android)
  3492                 AC_DEFINE(SDL_JOYSTICK_ANDROID, 1, [ ])
  3493                 SOURCES="$SOURCES $srcdir/src/joystick/android/*.c"
  3494                 SOURCES="$SOURCES $srcdir/src/joystick/steam/*.c"
  3495                 have_joystick=yes
  3496             ;;
  3497           esac
  3498         fi
  3499         # Set up files for the haptic library
  3500         if test x$enable_haptic = xyes; then
  3501           case $ARCH in
  3502             linux)
  3503                 if test x$use_input_events = xyes; then
  3504                     AC_DEFINE(SDL_HAPTIC_LINUX, 1, [ ])
  3505                     SOURCES="$SOURCES $srcdir/src/haptic/linux/*.c"
  3506                     have_haptic=yes
  3507                 fi
  3508             ;;
  3509             android)
  3510                 AC_DEFINE(SDL_HAPTIC_ANDROID, 1, [ ])
  3511                 SOURCES="$SOURCES $srcdir/src/haptic/android/*.c"
  3512                 have_haptic=yes
  3513             ;;
  3514           esac
  3515         fi
  3516         # Set up files for the sensor library
  3517         if test x$enable_sensor = xyes; then
  3518           case $ARCH in
  3519             android)
  3520                 AC_DEFINE(SDL_SENSOR_ANDROID, 1, [ ])
  3521                 SOURCES="$SOURCES $srcdir/src/sensor/android/*.c"
  3522                 have_sensor=yes
  3523             ;;
  3524           esac
  3525         fi
  3526         # Set up files for the power library
  3527         if test x$enable_power = xyes; then
  3528              case $ARCH in
  3529                linux)
  3530                    AC_DEFINE(SDL_POWER_LINUX, 1, [ ])
  3531                    SOURCES="$SOURCES $srcdir/src/power/linux/*.c"
  3532                    have_power=yes
  3533                ;;
  3534                android)
  3535                    AC_DEFINE(SDL_POWER_ANDROID, 1, [ ])
  3536                    SOURCES="$SOURCES $srcdir/src/power/android/*.c"
  3537                    have_power=yes
  3538                ;;
  3539              esac
  3540         fi
  3541         # Set up files for the filesystem library
  3542         if test x$enable_filesystem = xyes; then
  3543              case $ARCH in
  3544                android)
  3545                    AC_DEFINE(SDL_FILESYSTEM_ANDROID, 1, [ ])
  3546                    SOURCES="$SOURCES $srcdir/src/filesystem/android/*.c"
  3547                    have_filesystem=yes
  3548                ;;
  3549                *)
  3550                    AC_DEFINE(SDL_FILESYSTEM_UNIX, 1, [ ])
  3551                    SOURCES="$SOURCES $srcdir/src/filesystem/unix/*.c"
  3552                    have_filesystem=yes
  3553                ;;
  3554              esac
  3555         fi
  3556         # Set up files for the timer library
  3557         if test x$enable_timers = xyes; then
  3558             AC_DEFINE(SDL_TIMER_UNIX, 1, [ ])
  3559             SOURCES="$SOURCES $srcdir/src/timer/unix/*.c"
  3560             have_timers=yes
  3561         fi
  3562         # Set up files for udev hotplugging support
  3563         if test x$enable_libudev = xyes && test x$have_libudev_h_hdr = xyes; then
  3564             SOURCES="$SOURCES $srcdir/src/core/linux/SDL_udev.c"               
  3565         fi
  3566         # Set up files for evdev input
  3567         if test x$use_input_events = xyes; then
  3568             SOURCES="$SOURCES $srcdir/src/core/linux/SDL_evdev*.c"
  3569         fi       
  3570         # Set up other core UNIX files
  3571         SOURCES="$SOURCES $srcdir/src/core/unix/*.c"
  3572         ;;
  3573     *-*-cygwin* | *-*-mingw32*)
  3574         ARCH=win32
  3575         if test "$build" != "$host"; then # cross-compiling
  3576             # Default cross-compile location
  3577             ac_default_prefix=/usr/local/cross-tools/$host
  3578         else
  3579             # Look for the location of the tools and install there
  3580             if test "$BUILD_PREFIX" != ""; then
  3581                 ac_default_prefix=$BUILD_PREFIX
  3582             fi
  3583         fi
  3584         CheckDeclarationAfterStatement
  3585         CheckDummyVideo
  3586         CheckDiskAudio
  3587         CheckDummyAudio
  3588         CheckWINDOWS
  3589         CheckWINDOWSGL
  3590         CheckWINDOWSGLES
  3591         CheckVulkan
  3592         CheckDIRECTX
  3593 
  3594         # Set up the core platform files
  3595         SOURCES="$SOURCES $srcdir/src/core/windows/*.c"
  3596 
  3597         # Set up files for the video library
  3598         if test x$enable_video = xyes; then
  3599             AC_DEFINE(SDL_VIDEO_DRIVER_WINDOWS, 1, [ ])
  3600             SOURCES="$SOURCES $srcdir/src/video/windows/*.c"
  3601             have_video=yes
  3602             AC_ARG_ENABLE(render-d3d,
  3603 AC_HELP_STRING([--enable-render-d3d], [enable the Direct3D render driver [[default=yes]]]),
  3604                                 , enable_render_d3d=yes)
  3605             if test x$enable_render_d3d = xyes -a x$have_d3d = xyes; then
  3606                 AC_DEFINE(SDL_VIDEO_RENDER_D3D, 1, [ ])
  3607             fi
  3608             if test x$enable_render_d3d = xyes -a x$have_d3d11 = xyes; then
  3609                 AC_DEFINE(SDL_VIDEO_RENDER_D3D11, 1, [ ])
  3610             fi
  3611         fi
  3612         # Set up files for the audio library
  3613         if test x$enable_audio = xyes; then
  3614             AC_DEFINE(SDL_AUDIO_DRIVER_WINMM, 1, [ ])
  3615             SOURCES="$SOURCES $srcdir/src/audio/winmm/*.c"
  3616             if test x$have_dsound = xyes; then
  3617                 AC_DEFINE(SDL_AUDIO_DRIVER_DSOUND, 1, [ ])
  3618                 SOURCES="$SOURCES $srcdir/src/audio/directsound/*.c"
  3619             fi
  3620             if test x$have_wasapi = xyes -a x$enable_wasapi = xyes; then
  3621                 AC_DEFINE(SDL_AUDIO_DRIVER_WASAPI, 1, [ ])
  3622                 SUMMARY_audio="${SUMMARY_audio} wasapi"
  3623                 SOURCES="$SOURCES $srcdir/src/audio/wasapi/*.c"
  3624             fi
  3625             have_audio=yes
  3626         fi
  3627         # Set up files for the joystick library
  3628         if test x$enable_joystick = xyes; then
  3629             if test x$have_dinput = xyes -o x$have_xinput = xyes; then
  3630                 if test x$have_xinput = xyes; then
  3631                     AC_DEFINE(SDL_JOYSTICK_XINPUT, 1, [ ])
  3632                 fi
  3633                 if test x$have_dinput = xyes; then
  3634                     AC_DEFINE(SDL_JOYSTICK_DINPUT, 1, [ ])
  3635                     EXTRA_LDFLAGS="$EXTRA_LDFLAGS -ldinput8 -ldxguid -ldxerr8"
  3636                 fi
  3637             else
  3638                 AC_DEFINE(SDL_JOYSTICK_WINMM, 1, [ ])
  3639             fi
  3640             AC_DEFINE(SDL_JOYSTICK_HIDAPI, 1, [ ])
  3641             SOURCES="$SOURCES $srcdir/src/joystick/windows/*.c"
  3642             SOURCES="$SOURCES $srcdir/src/joystick/hidapi/*.c"
  3643             SOURCES="$SOURCES $srcdir/src/hidapi/windows/hid.c"
  3644             EXTRA_CFLAGS="$EXTRA_CFLAGS -I$srcdir/src/hidapi/hidapi"
  3645             have_joystick=yes
  3646         fi
  3647         if test x$enable_haptic = xyes; then
  3648             if test x$have_dinput = xyes -o x$have_xinput = xyes; then
  3649                 if test x$have_xinput = xyes; then
  3650                     AC_DEFINE(SDL_HAPTIC_XINPUT, 1, [ ])
  3651                 fi
  3652                 if test x$have_dinput = xyes; then
  3653                     AC_DEFINE(SDL_HAPTIC_DINPUT, 1, [ ])
  3654                 fi
  3655                 SOURCES="$SOURCES $srcdir/src/haptic/windows/*.c"
  3656                 have_haptic=yes
  3657             fi
  3658         fi
  3659         if test x$enable_power = xyes; then
  3660             AC_DEFINE(SDL_POWER_WINDOWS, 1, [ ])
  3661             SOURCES="$SOURCES $srcdir/src/power/windows/SDL_syspower.c"
  3662             have_power=yes
  3663         fi
  3664         if test x$enable_filesystem = xyes; then
  3665             AC_DEFINE(SDL_FILESYSTEM_WINDOWS, 1, [ ])
  3666             SOURCES="$SOURCES $srcdir/src/filesystem/windows/SDL_sysfilesystem.c"
  3667             have_filesystem=yes
  3668         fi
  3669         # Set up files for the thread library
  3670         if test x$enable_threads = xyes; then
  3671             AC_DEFINE(SDL_THREAD_WINDOWS, 1, [ ])
  3672             SOURCES="$SOURCES $srcdir/src/thread/windows/*.c"
  3673             SOURCES="$SOURCES $srcdir/src/thread/generic/SDL_syscond.c"
  3674             have_threads=yes
  3675         fi
  3676         # Set up files for the timer library
  3677         if test x$enable_timers = xyes; then
  3678             AC_DEFINE(SDL_TIMER_WINDOWS, 1, [ ])
  3679             SOURCES="$SOURCES $srcdir/src/timer/windows/*.c"
  3680             have_timers=yes
  3681         fi
  3682         # Set up files for the shared object loading library
  3683         if test x$enable_loadso = xyes; then
  3684             AC_DEFINE(SDL_LOADSO_WINDOWS, 1, [ ])
  3685             SOURCES="$SOURCES $srcdir/src/loadso/windows/*.c"
  3686             have_loadso=yes
  3687         fi
  3688         # Set up the system libraries we need
  3689         if test -f /lib/w32api/libuuid.a; then
  3690             LIBUUID=/lib/w32api/libuuid.a
  3691         else
  3692             LIBUUID=-luuid
  3693         fi
  3694         EXTRA_LDFLAGS="$EXTRA_LDFLAGS -luser32 -lgdi32 -lwinmm -limm32 -lole32 -loleaut32 -lshell32 -lsetupapi -lversion $LIBUUID -static-libgcc"
  3695         # The Windows platform requires special setup
  3696         VERSION_SOURCES="$srcdir/src/main/windows/*.rc"
  3697         SDLMAIN_SOURCES="$srcdir/src/main/windows/*.c"
  3698         SDL_CFLAGS="$SDL_CFLAGS -Dmain=SDL_main"
  3699         SDL_LIBS="-lSDL2main $SDL_LIBS -mwindows"
  3700 
  3701         # Check to see if this is a mingw or cygwin build
  3702         have_mingw32=
  3703         AC_CHECK_LIB(mingw32, main, [have_mingw32=yes])
  3704         if test x$have_mingw32 = xyes; then
  3705             SDL_LIBS="-lmingw32 $SDL_LIBS"
  3706         else
  3707             SDL_LIBS="-lcygwin $SDL_LIBS"
  3708         fi
  3709         ;;
  3710 
  3711     dnl BeOS support removed after SDL 2.0.1. Haiku still works.  --ryan.
  3712     *-*-beos*)
  3713         AC_MSG_ERROR([
  3714 *** BeOS support has been removed as of SDL 2.0.2.
  3715         ])
  3716         ;;
  3717 
  3718     *-*-haiku*)
  3719         ARCH=haiku
  3720         ac_default_prefix=/boot/system
  3721         CheckDummyVideo
  3722         CheckDiskAudio
  3723         CheckDummyAudio
  3724         CheckDLOPEN
  3725         CheckHaikuVideo
  3726         CheckHaikuGL
  3727         CheckPTHREAD
  3728 
  3729         # Set up files for the audio library
  3730         if test x$enable_audio = xyes; then
  3731             AC_DEFINE(SDL_AUDIO_DRIVER_HAIKU, 1, [ ])
  3732             SOURCES="$SOURCES $srcdir/src/audio/haiku/*.cc"
  3733             SUMMARY_audio="${SUMMARY_audio} haiku"
  3734             have_audio=yes
  3735         fi
  3736         # Set up files for the joystick library
  3737         if test x$enable_joystick = xyes; then
  3738             AC_DEFINE(SDL_JOYSTICK_HAIKU, 1, [ ])
  3739             SOURCES="$SOURCES $srcdir/src/joystick/haiku/*.cc"
  3740             have_joystick=yes
  3741         fi
  3742         # Set up files for the timer library
  3743         if test x$enable_timers = xyes; then
  3744             AC_DEFINE(SDL_TIMER_HAIKU, 1, [ ])
  3745             SOURCES="$SOURCES $srcdir/src/timer/haiku/*.c"
  3746             have_timers=yes
  3747         fi
  3748         # Set up files for the system power library
  3749         if test x$enable_power = xyes; then
  3750             AC_DEFINE(SDL_POWER_HAIKU, 1, [ ])
  3751             SOURCES="$SOURCES $srcdir/src/power/haiku/*.c"
  3752             have_power=yes
  3753         fi
  3754         # Set up files for the system filesystem library
  3755         if test x$enable_filesystem = xyes; then
  3756             AC_DEFINE(SDL_FILESYSTEM_HAIKU, 1, [ ])
  3757             SOURCES="$SOURCES $srcdir/src/filesystem/haiku/*.cc"
  3758             have_filesystem=yes
  3759         fi
  3760         # The Haiku platform requires special setup.
  3761         SOURCES="$srcdir/src/main/haiku/*.cc $SOURCES"
  3762         EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lroot -lbe -lmedia -lgame -ldevice -ltextencoding"
  3763         # Haiku's x86 spins use libstdc++.r4.so (for binary compat?), but
  3764         #  other spins, like x86-64, use a more standard "libstdc++.so.*"
  3765         AC_CHECK_FILE("/boot/system/lib/libstdc++.r4.so", EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lstdc++.r4", EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lstdc++")
  3766         ;;
  3767     arm*-apple-darwin*|*-ios-*)
  3768         ARCH=ios
  3769 
  3770         CheckVisibilityHidden
  3771         CheckDeclarationAfterStatement
  3772         CheckDummyVideo
  3773         CheckDiskAudio
  3774         CheckDummyAudio
  3775         CheckDLOPEN
  3776         CheckMETAL
  3777         CheckVulkan
  3778         CheckPTHREAD
  3779 
  3780         # Set up files for the audio library
  3781         if test x$enable_audio = xyes; then
  3782             AC_DEFINE(SDL_AUDIO_DRIVER_COREAUDIO, 1, [ ])
  3783             SOURCES="$SOURCES $srcdir/src/audio/coreaudio/*.m"
  3784             SUMMARY_audio="${SUMMARY_audio} coreaudio"
  3785             have_audio=yes
  3786         fi
  3787         # Set up files for the joystick library
  3788         if test x$enable_joystick = xyes; then
  3789             AC_DEFINE(SDL_JOYSTICK_MFI, 1, [ ])
  3790             SOURCES="$SOURCES $srcdir/src/joystick/iphoneos/*.m"
  3791             SOURCES="$SOURCES $srcdir/src/joystick/steam/*.c"
  3792             have_joystick=yes
  3793         fi
  3794         # Set up files for the haptic library
  3795         #if test x$enable_haptic = xyes; then
  3796         #    SOURCES="$SOURCES $srcdir/src/haptic/darwin/*.c"
  3797         #    have_haptic=yes
  3798         #    EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,ForceFeedback"
  3799         #fi
  3800         # Set up files for the power library
  3801         if test x$enable_power = xyes; then
  3802             AC_DEFINE(SDL_POWER_UIKIT, 1, [ ])
  3803             SOURCES="$SOURCES $srcdir/src/power/uikit/*.m"
  3804             have_power=yes
  3805         fi
  3806         # Set up files for the filesystem library
  3807         if test x$enable_filesystem = xyes; then
  3808             SOURCES="$SOURCES $srcdir/src/filesystem/cocoa/*.m"
  3809             have_filesystem=yes
  3810         fi
  3811         # Set up additional files for the file library
  3812         if test x$enable_file = xyes; then
  3813             AC_DEFINE(SDL_FILESYSTEM_COCOA, 1, [ ])
  3814             SOURCES="$SOURCES $srcdir/src/file/cocoa/*.m"
  3815         fi
  3816         # Set up files for the timer library
  3817         if test x$enable_timers = xyes; then
  3818             AC_DEFINE(SDL_TIMER_UNIX, 1, [ ])
  3819             SOURCES="$SOURCES $srcdir/src/timer/unix/*.c"
  3820             have_timers=yes
  3821         fi
  3822         # Set up other core UNIX files
  3823         SOURCES="$SOURCES $srcdir/src/core/unix/*.c"
  3824         # The iOS platform requires special setup.
  3825         AC_DEFINE(SDL_VIDEO_DRIVER_UIKIT, 1, [ ])
  3826         AC_DEFINE(SDL_VIDEO_OPENGL_ES2, 1, [ ])
  3827         AC_DEFINE(SDL_VIDEO_OPENGL_ES, 1, [ ])
  3828         AC_DEFINE(SDL_VIDEO_RENDER_OGL_ES, 1, [ ])
  3829         AC_DEFINE(SDL_VIDEO_RENDER_OGL_ES2, 1, [ ])
  3830         SOURCES="$SOURCES $srcdir/src/video/uikit/*.m"
  3831         EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lm -liconv -lobjc"
  3832         EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,AVFoundation"
  3833         EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,AudioToolbox"
  3834         EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,CoreAudio"
  3835         EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,CoreGraphics"
  3836         EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,CoreMotion"
  3837         EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,Foundation"
  3838         EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,GameController"
  3839         EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,OpenGLES"
  3840         EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,QuartzCore"
  3841         EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,UIKit"
  3842 
  3843         if test x$enable_render = xyes -a x$enable_render_metal = xyes; then
  3844             EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,Metal"
  3845         fi
  3846         ;;
  3847     *-*-darwin* )
  3848         # This could be either full "Mac OS X", or plain "Darwin" which is
  3849         # just the OS X kernel sans upper layers like Carbon and Cocoa.
  3850         # Next line is broken, and a few files below require Mac OS X (full)
  3851         ARCH=macosx
  3852 
  3853         # Mac OS X builds with both the Carbon and OSX APIs at the moment
  3854         EXTRA_CFLAGS="$EXTRA_CFLAGS -DTARGET_API_MAC_CARBON"
  3855         EXTRA_CFLAGS="$EXTRA_CFLAGS -DTARGET_API_MAC_OSX"
  3856 
  3857         CheckVisibilityHidden
  3858         CheckDeclarationAfterStatement
  3859         CheckDummyVideo
  3860         CheckDiskAudio
  3861         CheckDummyAudio
  3862         CheckDLOPEN
  3863         CheckCOCOA
  3864         CheckMETAL
  3865         CheckX11
  3866         CheckMacGL
  3867         CheckMacGLES
  3868         CheckOpenGLX11
  3869         CheckVulkan
  3870         CheckPTHREAD
  3871 
  3872         # Set up files for the audio library
  3873         if test x$enable_audio = xyes; then
  3874             AC_DEFINE(SDL_AUDIO_DRIVER_COREAUDIO, 1, [ ])
  3875             SOURCES="$SOURCES $srcdir/src/audio/coreaudio/*.m"
  3876             EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,CoreAudio -Wl,-framework,AudioToolbox"
  3877             SUMMARY_audio="${SUMMARY_audio} coreaudio"
  3878             have_audio=yes
  3879         fi
  3880         # Set up files for the joystick library
  3881         if test x$enable_joystick = xyes; then
  3882             AC_DEFINE(SDL_JOYSTICK_IOKIT, 1, [ ])
  3883             AC_DEFINE(SDL_JOYSTICK_HIDAPI, 1, [ ])
  3884             SOURCES="$SOURCES $srcdir/src/joystick/darwin/*.c"
  3885             SOURCES="$SOURCES $srcdir/src/joystick/hidapi/*.c"
  3886             SOURCES="$SOURCES $srcdir/src/hidapi/mac/hid.c"
  3887             EXTRA_CFLAGS="$EXTRA_CFLAGS -I$srcdir/src/hidapi/hidapi"
  3888             have_joystick=yes
  3889         fi
  3890         # Set up files for the haptic library
  3891         if test x$enable_haptic = xyes; then
  3892             AC_DEFINE(SDL_HAPTIC_IOKIT, 1, [ ])
  3893             SOURCES="$SOURCES $srcdir/src/haptic/darwin/*.c"
  3894             EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,ForceFeedback"
  3895             have_haptic=yes
  3896         fi
  3897         # Set up files for the power library
  3898         if test x$enable_power = xyes; then
  3899             AC_DEFINE(SDL_POWER_MACOSX, 1, [ ])
  3900             SOURCES="$SOURCES $srcdir/src/power/macosx/*.c"
  3901             have_power=yes
  3902         fi
  3903         # Set up files for the filesystem library
  3904         if test x$enable_filesystem = xyes; then
  3905             AC_DEFINE(SDL_FILESYSTEM_COCOA, 1, [ ])
  3906             SOURCES="$SOURCES $srcdir/src/filesystem/cocoa/*.m"
  3907             have_filesystem=yes
  3908         fi
  3909         # Set up files for the timer library
  3910         if test x$enable_timers = xyes; then
  3911             AC_DEFINE(SDL_TIMER_UNIX, 1, [ ])
  3912             SOURCES="$SOURCES $srcdir/src/timer/unix/*.c"
  3913             have_timers=yes
  3914         fi
  3915         # Set up additional files for the file library
  3916         if test x$enable_file = xyes; then
  3917             SOURCES="$SOURCES $srcdir/src/file/cocoa/*.m"
  3918         fi
  3919         # Set up other core UNIX files
  3920         SOURCES="$SOURCES $srcdir/src/core/unix/*.c"
  3921         # The Mac OS X platform requires special setup.
  3922         EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lobjc"
  3923         EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,CoreVideo"
  3924         EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,Cocoa"
  3925         EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,Carbon"
  3926         EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,IOKit"
  3927 
  3928         if test x$enable_render = xyes -a x$enable_render_metal = xyes; then
  3929             EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-weak_framework,QuartzCore -Wl,-weak_framework,Metal"
  3930         fi
  3931         ;;
  3932     *-nacl|*-pnacl)
  3933         ARCH=nacl
  3934         CheckNativeClient
  3935         CheckDummyAudio
  3936         CheckDummyVideo
  3937         CheckInputEvents
  3938         CheckPTHREAD
  3939         
  3940         # Set up files for the timer library
  3941         if test x$enable_timers = xyes; then
  3942             AC_DEFINE(SDL_TIMER_UNIX, 1, [ ])
  3943             SOURCES="$SOURCES $srcdir/src/timer/unix/*.c"
  3944             have_timers=yes
  3945         fi
  3946         
  3947         if test x$enable_filesystem = xyes; then
  3948             AC_DEFINE(SDL_FILESYSTEM_NACL, 1, [ ])
  3949             SOURCES="$SOURCES $srcdir/src/filesystem/nacl/*.c"
  3950             have_filesystem=yes
  3951         fi
  3952         ;;
  3953     *-*-emscripten* )
  3954         if test x$enable_video = xyes; then
  3955             AC_DEFINE(SDL_VIDEO_DRIVER_EMSCRIPTEN, 1, [ ])
  3956             SOURCES="$SOURCES $srcdir/src/video/emscripten/*.c"
  3957             have_video=yes
  3958             SUMMARY_video="${SUMMARY_video} emscripten"
  3959         fi
  3960 
  3961         if test x$enable_audio = xyes; then
  3962             AC_DEFINE(SDL_AUDIO_DRIVER_EMSCRIPTEN, 1, [ ])
  3963             SOURCES="$SOURCES $srcdir/src/audio/emscripten/*.c"
  3964             have_audio=yes
  3965             SUMMARY_audio="${SUMMARY_audio} emscripten"
  3966         fi
  3967 
  3968         CheckVisibilityHidden
  3969         CheckDeclarationAfterStatement
  3970         CheckDummyVideo
  3971         CheckDiskAudio
  3972         CheckDummyAudio
  3973         CheckDLOPEN
  3974         CheckClockGettime
  3975         CheckEmscriptenGLES
  3976 
  3977          # Set up files for the power library
  3978         if test x$enable_power = xyes; then
  3979             AC_DEFINE(SDL_POWER_EMSCRIPTEN, 1, [ ])
  3980             SOURCES="$SOURCES $srcdir/src/power/emscripten/*.c"
  3981             have_power=yes
  3982         fi
  3983         
  3984         # Set up files for the power library
  3985         if test x$enable_joystick = xyes; then
  3986             AC_DEFINE(SDL_JOYSTICK_EMSCRIPTEN, 1, [ ])
  3987             SOURCES="$SOURCES $srcdir/src/joystick/emscripten/*.c"
  3988             have_joystick=yes
  3989         fi
  3990 
  3991         # Set up files for the filesystem library
  3992         if test x$enable_filesystem = xyes; then
  3993             AC_DEFINE(SDL_FILESYSTEM_EMSCRIPTEN, 1, [ ])
  3994             SOURCES="$SOURCES $srcdir/src/filesystem/emscripten/*.c"
  3995             have_filesystem=yes
  3996         fi
  3997         # Set up files for the timer library
  3998         if test x$enable_timers = xyes; then
  3999             AC_DEFINE(SDL_TIMER_UNIX, 1, [ ])
  4000             SOURCES="$SOURCES $srcdir/src/timer/unix/*.c"
  4001             have_timers=yes
  4002         fi
  4003         ;;
  4004     *)
  4005         AC_MSG_ERROR([
  4006 *** Unsupported host:  Please add to configure.in
  4007         ])
  4008         ;;
  4009 esac
  4010 
  4011 # Verify that we have all the platform specific files we need
  4012 
  4013 if test x$have_joystick != xyes; then
  4014     if test x$enable_joystick = xyes; then
  4015         AC_DEFINE(SDL_JOYSTICK_DUMMY, 1, [ ])
  4016     fi
  4017     SOURCES="$SOURCES $srcdir/src/joystick/dummy/*.c"
  4018 fi
  4019 if test x$have_haptic != xyes; then
  4020     if test x$enable_haptic = xyes; then
  4021         AC_DEFINE(SDL_HAPTIC_DUMMY, 1, [ ])
  4022     fi
  4023     SOURCES="$SOURCES $srcdir/src/haptic/dummy/*.c"
  4024 fi
  4025 if test x$have_sensor != xyes; then
  4026     if test x$enable_sensor = xyes; then
  4027         AC_DEFINE(SDL_SENSOR_DUMMY, 1, [ ])
  4028     fi
  4029     SOURCES="$SOURCES $srcdir/src/sensor/dummy/*.c"
  4030 fi
  4031 if test x$have_threads != xyes; then
  4032     if test x$enable_threads = xyes; then
  4033         AC_DEFINE(SDL_THREADS_DISABLED, 1, [ ])
  4034     fi
  4035     SOURCES="$SOURCES $srcdir/src/thread/generic/*.c"
  4036 fi
  4037 if test x$have_timers != xyes; then
  4038     if test x$enable_timers = xyes; then
  4039         AC_DEFINE(SDL_TIMERS_DISABLED, 1, [ ])
  4040     fi
  4041     SOURCES="$SOURCES $srcdir/src/timer/dummy/*.c"
  4042 fi
  4043 if test x$have_filesystem != xyes; then
  4044     if test x$enable_filesystem = xyes; then
  4045         AC_DEFINE(SDL_FILESYSTEM_DISABLED, 1, [ ])
  4046     fi
  4047     SOURCES="$SOURCES $srcdir/src/filesystem/dummy/*.c"
  4048 fi
  4049 if test x$have_loadso != xyes; then
  4050     if test x$enable_loadso = xyes; then
  4051         AC_DEFINE(SDL_LOADSO_DISABLED, 1, [ ])
  4052     fi
  4053     SOURCES="$SOURCES $srcdir/src/loadso/dummy/*.c"
  4054 fi
  4055 if test x$SDLMAIN_SOURCES = x; then
  4056     SDLMAIN_SOURCES="$srcdir/src/main/dummy/*.c"
  4057 fi
  4058 SDLTEST_SOURCES="$srcdir/src/test/*.c"
  4059 
  4060 if test x$video_wayland = xyes; then
  4061     WAYLAND_PROTOCOLS=`cd $srcdir/wayland-protocols ; for p in *.xml ; do echo -n "\$p" |sed 's,\\.xml\$, ,g' ; done`
  4062     WAYLAND_PROTOCOLS_SOURCES=`for p in $WAYLAND_PROTOCOLS ; do echo -n "\\$(gen)/\$p-protocol.c " ; done`
  4063     WAYLAND_PROTOCOLS_HEADERS=`for p in $WAYLAND_PROTOCOLS ; do echo -n "\\$(gen)/\$p-client-protocol.h " ; done`
  4064     GEN_SOURCES="$GEN_SOURCES $WAYLAND_PROTOCOLS_SOURCES"
  4065     GEN_HEADERS="$GEN_HEADERS $WAYLAND_PROTOCOLS_HEADERS"
  4066 
  4067     WAYLAND_PROTOCOLS_DEPENDS=`for p in $WAYLAND_PROTOCOLS ; do\
  4068         echo ;\
  4069         echo "\\$(gen)/\$p-client-protocol.h: \\$(srcdir)/wayland-protocols/\$p.xml" ;\
  4070         echo "	@\\$(SHELL) \\$(auxdir)/mkinstalldirs \\$(gen)" ;\
  4071         echo "	\\$(RUN_CMD_GEN)\\$(WAYLAND_SCANNER) client-header \\$< \\$@" ;\
  4072         echo ;\
  4073         echo "\\$(gen)/\$p-protocol.c: \\$(srcdir)/wayland-protocols/\$p.xml" ;\
  4074         echo "	@\\$(SHELL) \\$(auxdir)/mkinstalldirs \\$(gen)" ;\
  4075         echo "	\\$(RUN_CMD_GEN)\\$(WAYLAND_SCANNER) code \\$< \\$@" ;\
  4076         echo ;\
  4077         echo "\\$(objects)/\$p-protocol.lo: \\$(gen)/\$p-protocol.c \\$(gen)/\$p-client-protocol.h" ;\
  4078         echo "	\\$(RUN_CMD_CC)\\$(LIBTOOL) --tag=CC --mode=compile \\$(CC) \\$(CFLAGS) \\$(EXTRA_CFLAGS) $DEPENDENCY_TRACKING_OPTIONS -c \\$< -o \\$@" ;\
  4079         done ;\
  4080         echo ;\
  4081         for s in $WAYLAND_SOURCES ; do echo -n "\$s:" ; for p in $WAYLAND_PROTOCOLS ; do echo -n " \\$(gen)/\$p-client-protocol.h" ; done ; echo ; done ; echo`
  4082 fi
  4083 
  4084 OBJECTS=`echo $SOURCES`
  4085 DEPENDS=`echo $SOURCES | tr ' ' '\n'`
  4086 for EXT in asm cc m c S; do
  4087     OBJECTS=`echo "$OBJECTS" | sed 's,[[^ ]]*/\([[^ ]]*\)\.'$EXT',$(objects)/\1.lo,g'`
  4088     DEPENDS=`echo "$DEPENDS" | sed "s,^\\([[^ ]]*\\)/\\([[^ ]]*\\)\\.$EXT\\$,\\\\
  4089 \\$(objects)/\\2.lo: \\1/\\2.$EXT\\\\
  4090 	\\$(RUN_CMD_CC)\\$(LIBTOOL) --tag=CC --mode=compile \\$(CC) \\$(CFLAGS) \\$(EXTRA_CFLAGS) $DEPENDENCY_TRACKING_OPTIONS -c \\$< -o \\$@,g"`
  4091 done
  4092 
  4093 GEN_OBJECTS=`echo "$GEN_SOURCES" | sed 's,[[^ ]]*/\([[^ ]]*\)\.c,$(objects)/\1.lo,g'`
  4094 
  4095 VERSION_OBJECTS=`echo $VERSION_SOURCES`
  4096 VERSION_DEPENDS=`echo $VERSION_SOURCES`
  4097 VERSION_OBJECTS=`echo "$VERSION_OBJECTS" | sed 's,[[^ ]]*/\([[^ ]]*\)\.rc,$(objects)/\1.o,g'`
  4098 VERSION_DEPENDS=`echo "$VERSION_DEPENDS" | sed "s,\\([[^ ]]*\\)/\\([[^ ]]*\\)\\.rc,\\\\
  4099 \\$(objects)/\\2.o: \\1/\\2.rc\\\\
  4100 	\\$(WINDRES) \\$< \\$@,g"`
  4101 
  4102 SDLMAIN_OBJECTS=`echo $SDLMAIN_SOURCES`
  4103 SDLMAIN_DEPENDS=`echo $SDLMAIN_SOURCES`
  4104 SDLMAIN_OBJECTS=`echo "$SDLMAIN_OBJECTS" | sed 's,[[^ ]]*/\([[^ ]]*\)\.c,$(objects)/\1.lo,g'`
  4105 SDLMAIN_DEPENDS=`echo "$SDLMAIN_DEPENDS" | sed "s,\\([[^ ]]*\\)/\\([[^ ]]*\\)\\.c,\\\\
  4106 \\$(objects)/\\2.lo: \\1/\\2.c\\\\
  4107 	\\$(RUN_CMD_CC)\\$(LIBTOOL) --tag=CC --mode=compile \\$(CC) \\$(CFLAGS) \\$(EXTRA_CFLAGS) $DEPENDENCY_TRACKING_OPTIONS -c \\$< -o \\$@,g"`
  4108 
  4109 SDLTEST_OBJECTS=`echo $SDLTEST_SOURCES`
  4110 SDLTEST_DEPENDS=`echo $SDLTEST_SOURCES`
  4111 SDLTEST_OBJECTS=`echo "$SDLTEST_OBJECTS" | sed 's,[[^ ]]*/\([[^ ]]*\)\.c,$(objects)/\1.lo,g'`
  4112 SDLTEST_DEPENDS=`echo "$SDLTEST_DEPENDS" | sed "s,\\([[^ ]]*\\)/\\([[^ ]]*\\)\\.c,\\\\
  4113 \\$(objects)/\\2.lo: \\1/\\2.c\\\\
  4114 	\\$(RUN_CMD_CC)\\$(LIBTOOL) --tag=CC --mode=compile \\$(CC) \\$(CFLAGS) \\$(EXTRA_CFLAGS) $DEPENDENCY_TRACKING_OPTIONS -c \\$< -o \\$@,g"`
  4115 
  4116 # Set runtime shared library paths as needed
  4117 
  4118 if test "x$enable_rpath" = "xyes"; then
  4119   if test $ARCH = bsdi -o $ARCH = freebsd -o $ARCH = linux -o $ARCH = netbsd; then
  4120     SDL_RLD_FLAGS="-Wl,-rpath,\${libdir}"
  4121 
  4122     AC_MSG_CHECKING(for linker option --enable-new-dtags)
  4123     have_enable_new_dtags=no
  4124     save_LDFLAGS="$LDFLAGS"
  4125     LDFLAGS="$LDFLAGS -Wl,--enable-new-dtags"
  4126     AC_TRY_LINK([
  4127     ],[
  4128     ],[
  4129     have_enable_new_dtags=yes
  4130     SDL_RLD_FLAGS="$SDL_RLD_FLAGS -Wl,--enable-new-dtags"
  4131     ])
  4132     LDFLAGS="$save_LDFLAGS"
  4133     AC_MSG_RESULT($have_enable_new_dtags)
  4134   fi
  4135   if test $ARCH = solaris; then
  4136     SDL_RLD_FLAGS="-R\${libdir}"
  4137   fi
  4138 else
  4139   SDL_RLD_FLAGS=""
  4140 fi
  4141 
  4142 SDL_STATIC_LIBS="$SDL_LIBS $EXTRA_LDFLAGS"
  4143 
  4144 dnl Expand the cflags and libraries needed by apps using SDL
  4145 AC_SUBST(SDL_CFLAGS)
  4146 AC_SUBST(SDL_LIBS)
  4147 AC_SUBST(SDL_STATIC_LIBS)
  4148 AC_SUBST(SDL_RLD_FLAGS)
  4149 if test x$enable_shared = xyes; then
  4150     ENABLE_SHARED_TRUE=
  4151     ENABLE_SHARED_FALSE="#"
  4152 else
  4153     ENABLE_SHARED_TRUE="#"
  4154     ENABLE_SHARED_FALSE=
  4155 fi
  4156 if test x$enable_static = xyes; then
  4157     ENABLE_STATIC_TRUE=
  4158     ENABLE_STATIC_FALSE="#"
  4159 else
  4160     ENABLE_STATIC_TRUE="#"
  4161     ENABLE_STATIC_FALSE=
  4162 fi
  4163 AC_SUBST(ENABLE_SHARED_TRUE)
  4164 AC_SUBST(ENABLE_SHARED_FALSE)
  4165 AC_SUBST(ENABLE_STATIC_TRUE)
  4166 AC_SUBST(ENABLE_STATIC_FALSE)
  4167 
  4168 dnl Expand the sources and objects needed to build the library
  4169 AC_SUBST(ac_aux_dir)
  4170 AC_SUBST(INCLUDE)
  4171 AC_SUBST(OBJECTS)
  4172 AC_SUBST(GEN_HEADERS)
  4173 AC_SUBST(GEN_OBJECTS)
  4174 AC_SUBST(VERSION_OBJECTS)
  4175 AC_SUBST(SDLMAIN_OBJECTS)
  4176 AC_SUBST(SDLTEST_OBJECTS)
  4177 AC_SUBST(BUILD_CFLAGS)
  4178 AC_SUBST(EXTRA_CFLAGS)
  4179 AC_SUBST(BUILD_LDFLAGS)
  4180 AC_SUBST(EXTRA_LDFLAGS)
  4181 AC_SUBST(WINDRES)
  4182 AC_SUBST(WAYLAND_SCANNER)
  4183 
  4184 cat >Makefile.rules <<__EOF__
  4185 
  4186 # Build rules for objects
  4187 -include \$(OBJECTS:.lo=.d)
  4188 
  4189 # Special dependency for SDL.c, since it depends on SDL_revision.h
  4190 $srcdir/src/SDL.c: update-revision
  4191 $DEPENDS
  4192 $VERSION_DEPENDS
  4193 $SDLMAIN_DEPENDS
  4194 $SDLTEST_DEPENDS
  4195 $WAYLAND_PROTOCOLS_DEPENDS
  4196 __EOF__
  4197 
  4198 AC_CONFIG_FILES([
  4199     Makefile:Makefile.in:Makefile.rules sdl2-config sdl2-config.cmake SDL2.spec sdl2.pc
  4200 ])
  4201 AC_CONFIG_COMMANDS([sdl2_config],[chmod a+x sdl2-config])
  4202 
  4203 SUMMARY="SDL2 Configure Summary:\n"
  4204 if test x$enable_shared = xyes; then
  4205     SUMMARY="${SUMMARY}Building Shared Libraries\n"
  4206 fi
  4207 if test x$enable_static = xyes; then
  4208     SUMMARY="${SUMMARY}Building Static Libraries\n"
  4209 fi
  4210 SUMMARY="${SUMMARY}Enabled modules :${SUMMARY_modules}\n"
  4211 SUMMARY="${SUMMARY}Assembly Math   :${SUMMARY_math}\n" 
  4212 SUMMARY="${SUMMARY}Audio drivers   :${SUMMARY_audio}\n"
  4213 SUMMARY="${SUMMARY}Video drivers   :${SUMMARY_video}\n"
  4214 if test x$have_x = xyes; then
  4215     SUMMARY="${SUMMARY}X11 libraries   :${SUMMARY_video_x11}\n"
  4216 fi
  4217 SUMMARY="${SUMMARY}Input drivers   :${SUMMARY_input}\n"
  4218 if test x$have_samplerate_h_hdr = xyes; then
  4219     SUMMARY="${SUMMARY}Using libsamplerate : YES\n"
  4220 else
  4221     SUMMARY="${SUMMARY}Using libsamplerate : NO\n"
  4222 fi
  4223 if test x$have_libudev_h_hdr = xyes; then
  4224     SUMMARY="${SUMMARY}Using libudev       : YES\n"
  4225 else
  4226     SUMMARY="${SUMMARY}Using libudev       : NO\n"
  4227 fi
  4228 if test x$have_dbus_dbus_h_hdr = xyes; then
  4229     SUMMARY="${SUMMARY}Using dbus          : YES\n"
  4230 else
  4231     SUMMARY="${SUMMARY}Using dbus          : NO\n"
  4232 fi
  4233 if test x$enable_ime = xyes; then
  4234     SUMMARY="${SUMMARY}Using ime           : YES\n"
  4235 else
  4236     SUMMARY="${SUMMARY}Using ime           : NO\n"
  4237 fi
  4238 if test x$have_ibus_ibus_h_hdr = xyes; then
  4239     SUMMARY="${SUMMARY}Using ibus          : YES\n"
  4240 else
  4241     SUMMARY="${SUMMARY}Using ibus          : NO\n"
  4242 fi
  4243 if test x$have_fcitx_frontend_h_hdr = xyes; then
  4244     SUMMARY="${SUMMARY}Using fcitx         : YES\n"
  4245 else
  4246     SUMMARY="${SUMMARY}Using fcitx         : NO\n"
  4247 fi
  4248 AC_CONFIG_COMMANDS([summary], [echo -en "$SUMMARY"], [SUMMARY="$SUMMARY"])
  4249 
  4250 AC_OUTPUT