configure.in: Rename to configure.ac to fix an 'aclocal' warning
authorHugh McMaster <hugh.mcmaster@outlook.com>
Mon, 25 Mar 2019 23:01:32 +1100
changeset 1267395689b6959db
parent 12672 d5b4d374a312
child 12674 e2d1f4e9c323
configure.in: Rename to configure.ac to fix an 'aclocal' warning

Also rename references in related files.
CMakeLists.txt
Makefile.in
configure.ac
configure.in
     1.1 --- a/CMakeLists.txt	Wed Mar 27 08:17:05 2019 -0700
     1.2 +++ b/CMakeLists.txt	Mon Mar 25 23:01:32 2019 +1100
     1.3 @@ -771,7 +771,7 @@
     1.4    file(GLOB POWER_SOURCES ${SDL2_SOURCE_DIR}/src/power/*.c)
     1.5    set(SOURCE_FILES ${SOURCE_FILES} ${POWER_SOURCES})
     1.6  endif()
     1.7 -# TODO: in configure.in, the test for LOADSO and SDL_DLOPEN is a bit weird:
     1.8 +# TODO: in configure.ac, the test for LOADSO and SDL_DLOPEN is a bit weird:
     1.9  # if LOADSO is not wanted, SDL_LOADSO_DISABLED is set
    1.10  # If however on Unix or APPLE dlopen() is detected via CheckDLOPEN(),
    1.11  # SDL_LOADSO_DISABLED will not be set, regardless of the LOADSO settings
    1.12 @@ -1301,7 +1301,7 @@
    1.13    # Libraries for Win32 native and MinGW
    1.14    list(APPEND EXTRA_LIBS user32 gdi32 winmm imm32 ole32 oleaut32 version uuid advapi32 shell32)
    1.15  
    1.16 -  # TODO: in configure.in the check for timers is set on
    1.17 +  # TODO: in configure.ac the check for timers is set on
    1.18    # cygwin | mingw32* - does this include mingw32CE?
    1.19    if(SDL_TIMERS)
    1.20      set(SDL_TIMER_WINDOWS 1)
    1.21 @@ -1569,7 +1569,7 @@
    1.22  endif()
    1.23  
    1.24  # Dummies
    1.25 -# configure.in does it differently:
    1.26 +# configure.ac does it differently:
    1.27  # if not have X
    1.28  #   if enable_X {  SDL_X_DISABLED = 1 }
    1.29  #   [add dummy sources]
     2.1 --- a/Makefile.in	Wed Mar 27 08:17:05 2019 -0700
     2.2 +++ b/Makefile.in	Mon Mar 25 23:01:32 2019 +1100
     2.3 @@ -44,7 +44,7 @@
     2.4  
     2.5  WAYLAND_SCANNER = @WAYLAND_SCANNER@
     2.6  
     2.7 -SRC_DIST = *.txt acinclude Android.mk autogen.sh android-project build-scripts cmake cmake_uninstall.cmake.in configure configure.in debian docs include Makefile.* sdl2-config.cmake.in sdl2-config.in sdl2.m4 sdl2.pc.in SDL2.spec.in SDL2Config.cmake src test VisualC.html VisualC VisualC-WinRT Xcode Xcode-iOS wayland-protocols
     2.8 +SRC_DIST = *.txt acinclude Android.mk autogen.sh android-project build-scripts cmake cmake_uninstall.cmake.in configure configure.ac debian docs include Makefile.* sdl2-config.cmake.in sdl2-config.in sdl2.m4 sdl2.pc.in SDL2.spec.in SDL2Config.cmake src test VisualC.html VisualC VisualC-WinRT Xcode Xcode-iOS wayland-protocols
     2.9  GEN_DIST = SDL2.spec
    2.10  
    2.11  ifneq ($V,1)
    2.12 @@ -127,7 +127,7 @@
    2.13  
    2.14  all: $(srcdir)/configure Makefile $(objects)/$(TARGET) $(objects)/$(SDLMAIN_TARGET) $(objects)/$(SDLTEST_TARGET)
    2.15  
    2.16 -$(srcdir)/configure: $(srcdir)/configure.in
    2.17 +$(srcdir)/configure: $(srcdir)/configure.ac
    2.18  	@echo "Warning, configure is out of date, please re-run autogen.sh"
    2.19  
    2.20  Makefile: $(srcdir)/Makefile.in
     3.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/configure.ac	Mon Mar 25 23:01:32 2019 +1100
     3.3 @@ -0,0 +1,4160 @@
     3.4 +dnl Process this file with autoconf to produce a configure script.
     3.5 +AC_INIT(README.txt)
     3.6 +AC_CONFIG_HEADER(include/SDL_config.h)
     3.7 +AC_CONFIG_AUX_DIR(build-scripts)
     3.8 +AC_CONFIG_MACRO_DIR([acinclude])
     3.9 +
    3.10 +dnl Save the CFLAGS to see whether they were passed in or generated
    3.11 +orig_CFLAGS="$CFLAGS"
    3.12 +
    3.13 +dnl Set various version strings - taken gratefully from the GTk sources
    3.14 +#
    3.15 +# Making releases:
    3.16 +# Edit include/SDL_version.h and change the version, then:
    3.17 +#   SDL_MICRO_VERSION += 1;
    3.18 +#   SDL_INTERFACE_AGE += 1;
    3.19 +#   SDL_BINARY_AGE += 1;
    3.20 +# if any functions have been added, set SDL_INTERFACE_AGE to 0.
    3.21 +# if backwards compatibility has been broken,
    3.22 +# set SDL_BINARY_AGE and SDL_INTERFACE_AGE to 0.
    3.23 +#
    3.24 +SDL_MAJOR_VERSION=2
    3.25 +SDL_MINOR_VERSION=0
    3.26 +SDL_MICRO_VERSION=9
    3.27 +SDL_INTERFACE_AGE=0
    3.28 +SDL_BINARY_AGE=9
    3.29 +SDL_VERSION=$SDL_MAJOR_VERSION.$SDL_MINOR_VERSION.$SDL_MICRO_VERSION
    3.30 +
    3.31 +AC_SUBST(SDL_MAJOR_VERSION)
    3.32 +AC_SUBST(SDL_MINOR_VERSION)
    3.33 +AC_SUBST(SDL_MICRO_VERSION)
    3.34 +AC_SUBST(SDL_INTERFACE_AGE)
    3.35 +AC_SUBST(SDL_BINARY_AGE)
    3.36 +AC_SUBST(SDL_VERSION)
    3.37 +
    3.38 +# libtool versioning
    3.39 +LT_INIT([win32-dll])
    3.40 +
    3.41 +LT_RELEASE=$SDL_MAJOR_VERSION.$SDL_MINOR_VERSION
    3.42 +LT_CURRENT=`expr $SDL_MICRO_VERSION - $SDL_INTERFACE_AGE`
    3.43 +LT_REVISION=$SDL_INTERFACE_AGE
    3.44 +LT_AGE=`expr $SDL_BINARY_AGE - $SDL_INTERFACE_AGE`
    3.45 +m4_pattern_allow([^LT_])
    3.46 +
    3.47 +AC_SUBST(LT_RELEASE)
    3.48 +AC_SUBST(LT_CURRENT)
    3.49 +AC_SUBST(LT_REVISION)
    3.50 +AC_SUBST(LT_AGE)
    3.51 +
    3.52 +dnl Detect the canonical build and host environments
    3.53 +dnl AC_CANONICAL_HOST
    3.54 +
    3.55 +dnl Check for tools
    3.56 +AC_PROG_LIBTOOL
    3.57 +AC_PROG_CC
    3.58 +AC_PROG_CXX
    3.59 +AC_PROG_INSTALL
    3.60 +AC_PROG_MAKE_SET
    3.61 +AC_CHECK_TOOL(WINDRES, [windres], [:])
    3.62 +PKG_PROG_PKG_CONFIG
    3.63 +
    3.64 +dnl Make sure that srcdir is a full pathname
    3.65 +case "$host" in
    3.66 +    *-*-mingw32*)
    3.67 +        # Except on msys, where make can't handle full pathnames (bug 1972)
    3.68 +        ;;
    3.69 +    *)
    3.70 +        srcdir=`cd $srcdir && pwd`
    3.71 +        ;;
    3.72 +esac
    3.73 +
    3.74 +dnl Set up the compiler and linker flags
    3.75 +INCLUDE="-I$srcdir/include -idirafter $srcdir/src/video/khronos"
    3.76 +if test x$srcdir != x.; then
    3.77 +    INCLUDE="-Iinclude $INCLUDE"
    3.78 +elif test -d .hg; then
    3.79 +    AC_MSG_ERROR([
    3.80 +*** When building from Mercurial you should configure and build in a
    3.81 +    separate directory so you don't clobber SDL_config.h, SDL_revision.h
    3.82 +])
    3.83 +fi
    3.84 +BASE_CFLAGS=""
    3.85 +BASE_LDFLAGS=""
    3.86 +case "$host" in
    3.87 +    *-*-cygwin*)
    3.88 +        # We build SDL on cygwin without the UNIX emulation layer
    3.89 +        save_CFLAGS="$CFLAGS"
    3.90 +        have_no_cygwin=no
    3.91 +        AC_MSG_CHECKING(for GCC -mno-cygwin option)
    3.92 +        CFLAGS="$save_CFLAGS -mno-cygwin"
    3.93 +
    3.94 +        AC_TRY_COMPILE([
    3.95 +        ],[
    3.96 +        ],[
    3.97 +        have_no_cygwin=yes
    3.98 +        ])
    3.99 +        AC_MSG_RESULT($have_no_cygwin)
   3.100 +        CFLAGS="$save_CFLAGS"
   3.101 +
   3.102 +        if test x$have_no_cygwin = xyes; then
   3.103 +            BASE_CFLAGS="-mno-cygwin"
   3.104 +            BASE_LDFLAGS="-mno-cygwin"
   3.105 +        fi
   3.106 +        BASE_CFLAGS="$BASE_CFLAGS -I/usr/include/mingw"
   3.107 +        ;;
   3.108 +esac
   3.109 +# Uncomment the following line if you want to force SDL and applications
   3.110 +# built with it to be compiled for a particular architecture.
   3.111 +#AX_GCC_ARCHFLAG([no], [BASE_CFLAGS="$BASE_CFLAGS $ax_cv_gcc_archflag]")
   3.112 +BUILD_CFLAGS="$CFLAGS $CPPFLAGS -DUSING_GENERATED_CONFIG_H"
   3.113 +# The default optimization for SDL is -O3 (Bug #31)
   3.114 +if test "x$orig_CFLAGS" = x; then
   3.115 +    BUILD_CFLAGS=`echo $BUILD_CFLAGS | sed 's/-O2/-O3/'`
   3.116 +fi
   3.117 +EXTRA_CFLAGS="$INCLUDE $BASE_CFLAGS"
   3.118 +BUILD_LDFLAGS="$LDFLAGS"
   3.119 +EXTRA_LDFLAGS="$BASE_LDFLAGS"
   3.120 +## These are common directories to find software packages
   3.121 +#for path in /usr/freeware /usr/pkg /usr/X11R6 /usr/local; do
   3.122 +#    if test -d $path/include; then
   3.123 +#        EXTRA_CFLAGS="$EXTRA_CFLAGS -I$path/include"
   3.124 +#    fi
   3.125 +#    if test -d $path/lib; then
   3.126 +#        EXTRA_LDFLAGS="$EXTRA_LDFLAGS -L$path/lib"
   3.127 +#    fi
   3.128 +#done
   3.129 +SDL_CFLAGS="$BASE_CFLAGS"
   3.130 +SDL_LIBS="-lSDL2"
   3.131 +if test "x$BASE_LDFLAGS" != x; then
   3.132 +    SDL_LIBS="$SDL_LIBS $BASE_LDFLAGS"
   3.133 +fi
   3.134 +if test "x$EXTRA_CFLAGS" != x; then
   3.135 +    CPPFLAGS="$CPPFLAGS $EXTRA_CFLAGS"
   3.136 +    CFLAGS="$CFLAGS $EXTRA_CFLAGS"
   3.137 +fi
   3.138 +if test "x$EXTRA_LDFLAGS" != x; then
   3.139 +    LDFLAGS="$LDFLAGS $EXTRA_LDFLAGS"
   3.140 +fi
   3.141 +
   3.142 +dnl set this to use on systems that use lib64 instead of lib
   3.143 +base_libdir=`echo \${libdir} | sed 's/.*\/\(.*\)/\1/; q'`
   3.144 +
   3.145 +dnl Function to find a library in the compiler search path
   3.146 +find_lib()
   3.147 +{
   3.148 +    gcc_bin_path=[`$CC -print-search-dirs 2>/dev/null | fgrep programs: | sed 's/[^=]*=\(.*\)/\1/' | sed 's/:/ /g'`]
   3.149 +    gcc_lib_path=[`$CC -print-search-dirs 2>/dev/null | fgrep libraries: | sed 's/[^=]*=\(.*\)/\1/' | sed 's/:/ /g'`]
   3.150 +    env_lib_path=[`echo $LIBS $LDFLAGS $* | sed 's/-L[ ]*//g'`]
   3.151 +    if test "$cross_compiling" = yes; then
   3.152 +        host_lib_path=""
   3.153 +    else
   3.154 +        host_lib_path="/usr/$base_libdir /usr/local/$base_libdir"
   3.155 +    fi
   3.156 +    for path in $env_lib_path $gcc_bin_path $gcc_lib_path $host_lib_path; do
   3.157 +        lib=[`ls -- $path/$1 2>/dev/null | sed -e '/\.so\..*\./d' -e 's,.*/,,' | sort | tail -1`]
   3.158 +        if test x$lib != x; then
   3.159 +            echo $lib
   3.160 +            return
   3.161 +        fi
   3.162 +    done
   3.163 +    # Try again, this time allowing more than one version digit after the .so
   3.164 +    for path in $env_lib_path $gcc_bin_path $gcc_lib_path $host_lib_path; do
   3.165 +        lib=[`ls -- $path/$1 2>/dev/null | sed -e 's,.*/,,' | sort | tail -1`]
   3.166 +        if test x$lib != x; then
   3.167 +            echo $lib
   3.168 +            return
   3.169 +        fi
   3.170 +    done
   3.171 +}
   3.172 +
   3.173 +dnl Check for compiler characteristics
   3.174 +AC_C_CONST
   3.175 +AC_C_INLINE
   3.176 +AC_C_VOLATILE
   3.177 +
   3.178 +dnl See whether we want assertions for debugging/sanity checking SDL itself.
   3.179 +AC_ARG_ENABLE(assertions,
   3.180 +AS_HELP_STRING([--enable-assertions],
   3.181 +               [Enable internal sanity checks (auto/disabled/release/enabled/paranoid) [[default=auto]]]),
   3.182 +              , enable_assertions=auto)
   3.183 +case "$enable_assertions" in
   3.184 +    auto) # Use optimization settings to determine assertion level
   3.185 +        ;;
   3.186 +    disabled)
   3.187 +        AC_DEFINE(SDL_DEFAULT_ASSERT_LEVEL, 0, [ ])
   3.188 +        ;;
   3.189 +    release)
   3.190 +        AC_DEFINE(SDL_DEFAULT_ASSERT_LEVEL, 1, [ ])
   3.191 +        ;;
   3.192 +    enabled)
   3.193 +        AC_DEFINE(SDL_DEFAULT_ASSERT_LEVEL, 2, [ ])
   3.194 +        ;;
   3.195 +    paranoid)
   3.196 +        AC_DEFINE(SDL_DEFAULT_ASSERT_LEVEL, 3, [ ])
   3.197 +        ;;
   3.198 +    *)
   3.199 +        AC_MSG_ERROR([*** unknown assertion level. stop.])
   3.200 +        ;;
   3.201 +esac
   3.202 +
   3.203 +dnl See whether we can use gcc style dependency tracking
   3.204 +AC_ARG_ENABLE(dependency-tracking,
   3.205 +AS_HELP_STRING([--enable-dependency-tracking],
   3.206 +               [Use gcc -MMD -MT dependency tracking [[default=yes]]]),
   3.207 +              , enable_dependency_tracking=yes)
   3.208 +if test x$enable_dependency_tracking = xyes; then
   3.209 +    have_gcc_mmd_mt=no
   3.210 +    AC_MSG_CHECKING(for GCC -MMD -MT option)
   3.211 +    AC_TRY_COMPILE([
   3.212 +    #if !defined(__GNUC__) || __GNUC__ < 3
   3.213 +    #error Dependency tracking requires GCC 3.0 or newer
   3.214 +    #endif
   3.215 +    ],[
   3.216 +    ],[
   3.217 +    have_gcc_mmd_mt=yes
   3.218 +    ])
   3.219 +    AC_MSG_RESULT($have_gcc_mmd_mt)
   3.220 +
   3.221 +    if test x$have_gcc_mmd_mt = xyes; then
   3.222 +        DEPENDENCY_TRACKING_OPTIONS="-MMD -MT \$@"
   3.223 +    fi
   3.224 +fi
   3.225 +
   3.226 +AC_MSG_CHECKING(for linker option --no-undefined)
   3.227 +have_no_undefined=no
   3.228 +case "$host" in
   3.229 +    dnl Skip this on platforms where it is just simply busted.
   3.230 +    *-*-openbsd*)
   3.231 +        ;;
   3.232 +
   3.233 +    *)
   3.234 +        save_LDFLAGS="$LDFLAGS"
   3.235 +        LDFLAGS="$LDFLAGS -Wl,--no-undefined"
   3.236 +        AC_TRY_LINK([
   3.237 +        ],[
   3.238 +        ],[
   3.239 +        have_no_undefined=yes
   3.240 +        EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,--no-undefined"
   3.241 +        ])
   3.242 +        LDFLAGS="$save_LDFLAGS"
   3.243 +        ;;
   3.244 +esac
   3.245 +AC_MSG_RESULT($have_no_undefined)
   3.246 +
   3.247 +AC_MSG_CHECKING(for linker option --dynamicbase)
   3.248 +have_dynamicbase=no
   3.249 +case "$host" in
   3.250 +    *)
   3.251 +        save_LDFLAGS="$LDFLAGS"
   3.252 +        LDFLAGS="$LDFLAGS -Wl,--dynamicbase"
   3.253 +        AC_TRY_LINK([
   3.254 +        ],[
   3.255 +        ],[
   3.256 +        have_dynamicbase=yes
   3.257 +        EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,--dynamicbase"
   3.258 +        ])
   3.259 +        LDFLAGS="$save_LDFLAGS"
   3.260 +        ;;
   3.261 +esac
   3.262 +AC_MSG_RESULT($have_dynamicbase)
   3.263 +
   3.264 +AC_MSG_CHECKING(for linker option --nxcompat)
   3.265 +have_nxcompat=no
   3.266 +case "$host" in
   3.267 +    *)
   3.268 +        save_LDFLAGS="$LDFLAGS"
   3.269 +        LDFLAGS="$LDFLAGS -Wl,--nxcompat"
   3.270 +        AC_TRY_LINK([
   3.271 +        ],[
   3.272 +        ],[
   3.273 +        have_nxcompat=yes
   3.274 +        EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,--nxcompat"
   3.275 +        ])
   3.276 +        LDFLAGS="$save_LDFLAGS"
   3.277 +        ;;
   3.278 +esac
   3.279 +AC_MSG_RESULT($have_nxcompat)
   3.280 +
   3.281 +AC_MSG_CHECKING(for linker option --high-entropy-va)
   3.282 +have_high_entropy_va=no
   3.283 +case "$host" in
   3.284 +    *)
   3.285 +        save_LDFLAGS="$LDFLAGS"
   3.286 +        LDFLAGS="$LDFLAGS -Wl,--high-entropy-va"
   3.287 +        AC_TRY_LINK([
   3.288 +        ],[
   3.289 +        ],[
   3.290 +        have_high_entropy_va=yes
   3.291 +        EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,--high-entropy-va"
   3.292 +        ])
   3.293 +        LDFLAGS="$save_LDFLAGS"
   3.294 +        ;;
   3.295 +esac
   3.296 +AC_MSG_RESULT($have_high_entropy_va)
   3.297 +
   3.298 +dnl See whether we are allowed to use the system C library
   3.299 +AC_ARG_ENABLE(libc,
   3.300 +AS_HELP_STRING([--enable-libc], [Use the system C library [[default=yes]]]),
   3.301 +              , enable_libc=yes)
   3.302 +if test x$enable_libc = xyes; then
   3.303 +    AC_DEFINE(HAVE_LIBC, 1, [ ])
   3.304 +
   3.305 +    dnl Check for C library headers
   3.306 +    AC_HEADER_STDC
   3.307 +    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)
   3.308 +
   3.309 +    dnl Check for typedefs, structures, etc.
   3.310 +    AC_TYPE_SIZE_T
   3.311 +
   3.312 +    dnl Check for defines
   3.313 +    AC_CHECK_DEFINE(M_PI, math.h)
   3.314 +
   3.315 +    dnl Checks for library functions.
   3.316 +    case "$host" in
   3.317 +    *-*-cygwin* | *-*-mingw32*)
   3.318 +        ;;
   3.319 +    *)
   3.320 +        AC_FUNC_ALLOCA
   3.321 +        ;;
   3.322 +    esac
   3.323 +
   3.324 +    AC_FUNC_MEMCMP
   3.325 +    if test x$ac_cv_func_memcmp_working = xyes; then
   3.326 +        AC_DEFINE(HAVE_MEMCMP, 1, [ ])
   3.327 +    fi
   3.328 +    AC_FUNC_STRTOD
   3.329 +    if test x$ac_cv_func_strtod = xyes; then
   3.330 +        AC_DEFINE(HAVE_STRTOD, 1, [ ])
   3.331 +    fi
   3.332 +    AC_CHECK_FUNC(mprotect,
   3.333 +        AC_TRY_COMPILE([
   3.334 +          #include <sys/types.h>
   3.335 +          #include <sys/mman.h>
   3.336 +        ],[
   3.337 +        ],[
   3.338 +        AC_DEFINE(HAVE_MPROTECT, 1, [ ])
   3.339 +        ]),
   3.340 +    )
   3.341 +    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)
   3.342 +
   3.343 +    AC_CHECK_LIB(m, pow, [LIBS="$LIBS -lm"; EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lm"])
   3.344 +    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)
   3.345 +
   3.346 +    AC_CHECK_LIB(iconv, iconv_open, [LIBS="$LIBS -liconv"; EXTRA_LDFLAGS="$EXTRA_LDFLAGS -liconv"])
   3.347 +    AC_CHECK_FUNCS(iconv)
   3.348 +
   3.349 +    AC_CHECK_MEMBER(struct sigaction.sa_sigaction,[AC_DEFINE([HAVE_SA_SIGACTION], 1, [ ])], ,[#include <signal.h>])
   3.350 +
   3.351 +    dnl Check for additional non-standard headers
   3.352 +    AC_CHECK_HEADERS(libunwind.h)
   3.353 +fi
   3.354 +
   3.355 +dnl AC_CHECK_SIZEOF(void*)
   3.356 +
   3.357 +dnl See whether we can use gcc atomic operations on this architecture
   3.358 +AC_ARG_ENABLE(gcc-atomics,
   3.359 +AS_HELP_STRING([--enable-gcc-atomics],
   3.360 +               [Use gcc builtin atomics [[default=yes]]]),
   3.361 +              , enable_gcc_atomics=yes)
   3.362 +if test x$enable_gcc_atomics = xyes; then
   3.363 +    have_gcc_atomics=no
   3.364 +    AC_MSG_CHECKING(for GCC builtin atomic operations)
   3.365 +    AC_TRY_LINK([
   3.366 +    ],[
   3.367 +    int a;
   3.368 +    void *x, *y, *z;
   3.369 +    __sync_lock_test_and_set(&a, 4);
   3.370 +    __sync_lock_test_and_set(&x, y);
   3.371 +    __sync_fetch_and_add(&a, 1);
   3.372 +    __sync_bool_compare_and_swap(&a, 5, 10);
   3.373 +    __sync_bool_compare_and_swap(&x, y, z);
   3.374 +    ],[
   3.375 +    have_gcc_atomics=yes
   3.376 +    ])
   3.377 +    AC_MSG_RESULT($have_gcc_atomics)
   3.378 +
   3.379 +    if test x$have_gcc_atomics = xyes; then
   3.380 +        AC_DEFINE(HAVE_GCC_ATOMICS, 1, [ ])
   3.381 +    else
   3.382 +        # See if we have the minimum operation needed for GCC atomics
   3.383 +        AC_TRY_LINK([
   3.384 +        ],[
   3.385 +        int a;
   3.386 +        __sync_lock_test_and_set(&a, 1);
   3.387 +        __sync_lock_release(&a);
   3.388 +        ],[
   3.389 +        have_gcc_sync_lock_test_and_set=yes
   3.390 +        ])
   3.391 +        if test x$have_gcc_sync_lock_test_and_set = xyes; then
   3.392 +            AC_DEFINE(HAVE_GCC_SYNC_LOCK_TEST_AND_SET, 1, [ ])
   3.393 +        fi
   3.394 +    fi
   3.395 +fi
   3.396 +
   3.397 +# Standard C sources
   3.398 +SOURCES="$SOURCES $srcdir/src/*.c"
   3.399 +SOURCES="$SOURCES $srcdir/src/atomic/*.c"
   3.400 +SOURCES="$SOURCES $srcdir/src/audio/*.c"
   3.401 +SOURCES="$SOURCES $srcdir/src/cpuinfo/*.c"
   3.402 +SOURCES="$SOURCES $srcdir/src/dynapi/*.c"
   3.403 +SOURCES="$SOURCES $srcdir/src/events/*.c"
   3.404 +SOURCES="$SOURCES $srcdir/src/file/*.c"
   3.405 +SOURCES="$SOURCES $srcdir/src/haptic/*.c"
   3.406 +SOURCES="$SOURCES $srcdir/src/joystick/*.c"
   3.407 +SOURCES="$SOURCES $srcdir/src/libm/*.c"
   3.408 +SOURCES="$SOURCES $srcdir/src/power/*.c"
   3.409 +#SOURCES="$SOURCES $srcdir/src/filesystem/*.c"
   3.410 +SOURCES="$SOURCES $srcdir/src/render/*.c"
   3.411 +SOURCES="$SOURCES $srcdir/src/render/*/*.c"
   3.412 +SOURCES="$SOURCES $srcdir/src/sensor/*.c"
   3.413 +SOURCES="$SOURCES $srcdir/src/stdlib/*.c"
   3.414 +SOURCES="$SOURCES $srcdir/src/thread/*.c"
   3.415 +SOURCES="$SOURCES $srcdir/src/timer/*.c"
   3.416 +SOURCES="$SOURCES $srcdir/src/video/*.c"
   3.417 +SOURCES="$SOURCES $srcdir/src/video/yuv2rgb/*.c"
   3.418 +
   3.419 +dnl Enable/disable various subsystems of the SDL library
   3.420 +
   3.421 +AC_ARG_ENABLE(atomic,
   3.422 +AS_HELP_STRING([--enable-atomic], [Enable the atomic operations subsystem [[default=yes]]]),
   3.423 +              , enable_atomic=yes)
   3.424 +if test x$enable_atomic != xyes; then
   3.425 +    AC_DEFINE(SDL_ATOMIC_DISABLED, 1, [ ])
   3.426 +else
   3.427 +    SUMMARY_modules="${SUMMARY_modules} atomic"
   3.428 +fi
   3.429 +AC_ARG_ENABLE(audio,
   3.430 +AS_HELP_STRING([--enable-audio], [Enable the audio subsystem [[default=yes]]]),
   3.431 +              , enable_audio=yes)
   3.432 +if test x$enable_audio != xyes; then
   3.433 +    AC_DEFINE(SDL_AUDIO_DISABLED, 1, [ ])
   3.434 +else
   3.435 +    SUMMARY_modules="${SUMMARY_modules} audio"
   3.436 +fi
   3.437 +AC_ARG_ENABLE(video,
   3.438 +AS_HELP_STRING([--enable-video], [Enable the video subsystem [[default=yes]]]),
   3.439 +              , enable_video=yes)
   3.440 +if test x$enable_video != xyes; then
   3.441 +    AC_DEFINE(SDL_VIDEO_DISABLED, 1, [ ])
   3.442 +else
   3.443 +    SUMMARY_modules="${SUMMARY_modules} video"
   3.444 +fi
   3.445 +AC_ARG_ENABLE(render,
   3.446 +AS_HELP_STRING([--enable-render], [Enable the render subsystem [[default=yes]]]),
   3.447 +              , enable_render=yes)
   3.448 +if test x$enable_render != xyes; then
   3.449 +    AC_DEFINE(SDL_RENDER_DISABLED, 1, [ ])
   3.450 +else
   3.451 +    SUMMARY_modules="${SUMMARY_modules} render"
   3.452 +fi
   3.453 +AC_ARG_ENABLE(events,
   3.454 +AS_HELP_STRING([--enable-events], [Enable the events subsystem [[default=yes]]]),
   3.455 +              , enable_events=yes)
   3.456 +if test x$enable_events != xyes; then
   3.457 +    AC_DEFINE(SDL_EVENTS_DISABLED, 1, [ ])
   3.458 +else
   3.459 +    SUMMARY_modules="${SUMMARY_modules} events"
   3.460 +fi
   3.461 +AC_ARG_ENABLE(joystick,
   3.462 +AS_HELP_STRING([--enable-joystick], [Enable the joystick subsystem [[default=yes]]]),
   3.463 +              , enable_joystick=yes)
   3.464 +if test x$enable_joystick != xyes; then
   3.465 +    AC_DEFINE(SDL_JOYSTICK_DISABLED, 1, [ ])
   3.466 +else
   3.467 +    SUMMARY_modules="${SUMMARY_modules} joystick"
   3.468 +fi
   3.469 +AC_ARG_ENABLE(haptic,
   3.470 +AS_HELP_STRING([--enable-haptic], [Enable the haptic (force feedback) subsystem [[default=yes]]]),
   3.471 +              , enable_haptic=yes)
   3.472 +if test x$enable_haptic != xyes; then
   3.473 +    AC_DEFINE(SDL_HAPTIC_DISABLED, 1, [ ])
   3.474 +else
   3.475 +    SUMMARY_modules="${SUMMARY_modules} haptic"
   3.476 +fi
   3.477 +AC_ARG_ENABLE(sensor,
   3.478 +AS_HELP_STRING([--enable-sensor], [Enable the sensor subsystem [[default=yes]]]),
   3.479 +              , enable_sensor=yes)
   3.480 +if test x$enable_sensor != xyes; then
   3.481 +    AC_DEFINE(SDL_SENSOR_DISABLED, 1, [ ])
   3.482 +else
   3.483 +    SUMMARY_modules="${SUMMARY_modules} sensor"
   3.484 +fi
   3.485 +AC_ARG_ENABLE(power,
   3.486 +AS_HELP_STRING([--enable-power], [Enable the power subsystem [[default=yes]]]),
   3.487 +              , enable_power=yes)
   3.488 +if test x$enable_power != xyes; then
   3.489 +    AC_DEFINE(SDL_POWER_DISABLED, 1, [ ])
   3.490 +else
   3.491 +    SUMMARY_modules="${SUMMARY_modules} power"
   3.492 +fi
   3.493 +AC_ARG_ENABLE(filesystem,
   3.494 +AS_HELP_STRING([--enable-filesystem], [Enable the filesystem subsystem [[default=yes]]]),
   3.495 +              , enable_filesystem=yes)
   3.496 +if test x$enable_filesystem != xyes; then
   3.497 +    AC_DEFINE(SDL_FILESYSTEM_DISABLED, 1, [ ])
   3.498 +else
   3.499 +    SUMMARY_modules="${SUMMARY_modules} filesystem"
   3.500 +fi
   3.501 +AC_ARG_ENABLE(threads,
   3.502 +AS_HELP_STRING([--enable-threads], [Enable the threading subsystem [[default=yes]]]),
   3.503 +              , enable_threads=yes)
   3.504 +if test x$enable_threads != xyes; then
   3.505 +    AC_DEFINE(SDL_THREADS_DISABLED, 1, [ ])
   3.506 +else
   3.507 +    SUMMARY_modules="${SUMMARY_modules} threads"
   3.508 +fi
   3.509 +AC_ARG_ENABLE(timers,
   3.510 +AS_HELP_STRING([--enable-timers], [Enable the timer subsystem [[default=yes]]]),
   3.511 +              , enable_timers=yes)
   3.512 +if test x$enable_timers != xyes; then
   3.513 +    AC_DEFINE(SDL_TIMERS_DISABLED, 1, [ ])
   3.514 +else
   3.515 +    SUMMARY_modules="${SUMMARY_modules} timers"
   3.516 +fi
   3.517 +AC_ARG_ENABLE(file,
   3.518 +AS_HELP_STRING([--enable-file], [Enable the file subsystem [[default=yes]]]),
   3.519 +              , enable_file=yes)
   3.520 +if test x$enable_file != xyes; then
   3.521 +    AC_DEFINE(SDL_FILE_DISABLED, 1, [ ])
   3.522 +else
   3.523 +    SUMMARY_modules="${SUMMARY_modules} file"
   3.524 +fi
   3.525 +AC_ARG_ENABLE(loadso,
   3.526 +AS_HELP_STRING([--enable-loadso], [Enable the shared object loading subsystem [[default=yes]]]),
   3.527 +              , enable_loadso=yes)
   3.528 +if test x$enable_loadso != xyes; then
   3.529 +    AC_DEFINE(SDL_LOADSO_DISABLED, 1, [ ])
   3.530 +else
   3.531 +    SUMMARY_modules="${SUMMARY_modules} loadso"
   3.532 +fi
   3.533 +AC_ARG_ENABLE(cpuinfo,
   3.534 +AS_HELP_STRING([--enable-cpuinfo], [Enable the cpuinfo subsystem [[default=yes]]]),
   3.535 +              , enable_cpuinfo=yes)
   3.536 +if test x$enable_cpuinfo != xyes; then
   3.537 +    AC_DEFINE(SDL_CPUINFO_DISABLED, 1, [ ])
   3.538 +else
   3.539 +    SUMMARY_modules="${SUMMARY_modules} cpuinfo"
   3.540 +fi
   3.541 +AC_ARG_ENABLE(assembly,
   3.542 +AS_HELP_STRING([--enable-assembly], [Enable assembly routines [[default=yes]]]),
   3.543 +              , enable_assembly=yes)
   3.544 +if test x$enable_assembly = xyes; then
   3.545 +    SUMMARY_modules="${SUMMARY_modules} assembly"
   3.546 +
   3.547 +    AC_DEFINE(SDL_ASSEMBLY_ROUTINES, 1, [ ])
   3.548 +
   3.549 +    # Make sure that we don't generate floating point code that would
   3.550 +    # cause illegal instruction exceptions on older processors
   3.551 +    case "$host" in
   3.552 +        *-*-darwin*)
   3.553 +            # Don't need to worry about Apple hardware, it's all SSE capable
   3.554 +            default_ssemath=yes
   3.555 +            ;;
   3.556 +        *64-*-*)
   3.557 +            # x86 64-bit architectures all have SSE instructions
   3.558 +            default_ssemath=yes
   3.559 +            ;;
   3.560 +        *)
   3.561 +            default_ssemath=no
   3.562 +            ;;
   3.563 +    esac
   3.564 +    AC_ARG_ENABLE(ssemath,
   3.565 +AS_HELP_STRING([--enable-ssemath], [Allow GCC to use SSE floating point math [[default=maybe]]]),
   3.566 +                  , enable_ssemath=$default_ssemath)
   3.567 +    if test x$enable_ssemath = xno; then
   3.568 +        if test x$have_gcc_sse = xyes -o x$have_gcc_sse2 = xyes -o x$have_gcc_sse3 = xyes; then
   3.569 +            EXTRA_CFLAGS="$EXTRA_CFLAGS -mfpmath=387"
   3.570 +        fi
   3.571 +    fi
   3.572 +
   3.573 +    dnl Check for various instruction support
   3.574 +    AC_ARG_ENABLE(mmx,
   3.575 +AS_HELP_STRING([--enable-mmx], [use MMX assembly routines [[default=yes]]]),
   3.576 +                  , enable_mmx=yes)
   3.577 +    if test x$enable_mmx = xyes; then
   3.578 +        save_CFLAGS="$CFLAGS"
   3.579 +        have_gcc_mmx=no
   3.580 +        AC_MSG_CHECKING(for GCC -mmmx option)
   3.581 +        mmx_CFLAGS="-mmmx"
   3.582 +        CFLAGS="$save_CFLAGS $mmx_CFLAGS"
   3.583 +
   3.584 +        AC_TRY_COMPILE([
   3.585 +        #ifdef __MINGW32__
   3.586 +        #include <_mingw.h>
   3.587 +        #ifdef __MINGW64_VERSION_MAJOR
   3.588 +        #include <intrin.h>
   3.589 +        #else
   3.590 +        #include <mmintrin.h>
   3.591 +        #endif
   3.592 +        #else
   3.593 +        #include <mmintrin.h>
   3.594 +        #endif
   3.595 +        #ifndef __MMX__
   3.596 +        #error Assembler CPP flag not enabled
   3.597 +        #endif
   3.598 +        ],[
   3.599 +        ],[
   3.600 +        have_gcc_mmx=yes
   3.601 +        ])
   3.602 +        AC_MSG_RESULT($have_gcc_mmx)
   3.603 +        CFLAGS="$save_CFLAGS"
   3.604 +
   3.605 +        if test x$have_gcc_mmx = xyes; then
   3.606 +            EXTRA_CFLAGS="$EXTRA_CFLAGS $mmx_CFLAGS"
   3.607 +            SUMMARY_math="${SUMMARY_math} mmx"
   3.608 +        fi
   3.609 +    fi
   3.610 +
   3.611 +    AC_ARG_ENABLE(3dnow,
   3.612 +AS_HELP_STRING([--enable-3dnow], [use 3DNow! assembly routines [[default=yes]]]),
   3.613 +                  , enable_3dnow=yes)
   3.614 +    if test x$enable_3dnow = xyes; then
   3.615 +        save_CFLAGS="$CFLAGS"
   3.616 +        have_gcc_3dnow=no
   3.617 +        AC_MSG_CHECKING(for GCC -m3dnow option)
   3.618 +        amd3dnow_CFLAGS="-m3dnow"
   3.619 +        CFLAGS="$save_CFLAGS $amd3dnow_CFLAGS"
   3.620 +
   3.621 +        AC_TRY_LINK([
   3.622 +        #include <mm3dnow.h>
   3.623 +        #ifndef __3dNOW__
   3.624 +        #error Assembler CPP flag not enabled
   3.625 +        #endif
   3.626 +        ],[
   3.627 +        void *p = 0;
   3.628 +        _m_prefetch(p);
   3.629 +        ],[
   3.630 +        have_gcc_3dnow=yes
   3.631 +        ])
   3.632 +        AC_MSG_RESULT($have_gcc_3dnow)
   3.633 +        CFLAGS="$save_CFLAGS"
   3.634 +
   3.635 +        if test x$have_gcc_3dnow = xyes; then
   3.636 +            EXTRA_CFLAGS="$EXTRA_CFLAGS $amd3dnow_CFLAGS"
   3.637 +            SUMMARY_math="${SUMMARY_math} 3dnow"
   3.638 +        fi
   3.639 +    fi
   3.640 +
   3.641 +    AC_ARG_ENABLE(sse,
   3.642 +AS_HELP_STRING([--enable-sse], [use SSE assembly routines [[default=yes]]]),
   3.643 +                  , enable_sse=yes)
   3.644 +    if test x$enable_sse = xyes; then
   3.645 +        save_CFLAGS="$CFLAGS"
   3.646 +        have_gcc_sse=no
   3.647 +        AC_MSG_CHECKING(for GCC -msse option)
   3.648 +        sse_CFLAGS="-msse"
   3.649 +        CFLAGS="$save_CFLAGS $sse_CFLAGS"
   3.650 +
   3.651 +        AC_TRY_COMPILE([
   3.652 +        #ifdef __MINGW32__
   3.653 +        #include <_mingw.h>
   3.654 +        #ifdef __MINGW64_VERSION_MAJOR
   3.655 +        #include <intrin.h>
   3.656 +        #else
   3.657 +        #include <xmmintrin.h>
   3.658 +        #endif
   3.659 +        #else
   3.660 +        #include <xmmintrin.h>
   3.661 +        #endif
   3.662 +        #ifndef __SSE__
   3.663 +        #error Assembler CPP flag not enabled
   3.664 +        #endif
   3.665 +        ],[
   3.666 +        ],[
   3.667 +        have_gcc_sse=yes
   3.668 +        ])
   3.669 +        AC_MSG_RESULT($have_gcc_sse)
   3.670 +        CFLAGS="$save_CFLAGS"
   3.671 +
   3.672 +        if test x$have_gcc_sse = xyes; then
   3.673 +            EXTRA_CFLAGS="$EXTRA_CFLAGS $sse_CFLAGS"
   3.674 +            SUMMARY_math="${SUMMARY_math} sse"
   3.675 +        fi
   3.676 +    fi
   3.677 +
   3.678 +    AC_ARG_ENABLE(sse2,
   3.679 +AS_HELP_STRING([--enable-sse2], [use SSE2 assembly routines [[default=maybe]]]),
   3.680 +                  , enable_sse2=$default_ssemath)
   3.681 +    if test x$enable_sse2 = xyes; then
   3.682 +        save_CFLAGS="$CFLAGS"
   3.683 +        have_gcc_sse2=no
   3.684 +        AC_MSG_CHECKING(for GCC -msse2 option)
   3.685 +        sse2_CFLAGS="-msse2"
   3.686 +        CFLAGS="$save_CFLAGS $sse2_CFLAGS"
   3.687 +
   3.688 +        AC_TRY_COMPILE([
   3.689 +        #ifdef __MINGW32__
   3.690 +        #include <_mingw.h>
   3.691 +        #ifdef __MINGW64_VERSION_MAJOR
   3.692 +        #include <intrin.h>
   3.693 +        #else
   3.694 +        #include <emmintrin.h>
   3.695 +        #endif
   3.696 +        #else
   3.697 +        #include <emmintrin.h>
   3.698 +        #endif
   3.699 +        #ifndef __SSE2__
   3.700 +        #error Assembler CPP flag not enabled
   3.701 +        #endif
   3.702 +        ],[
   3.703 +        ],[
   3.704 +        have_gcc_sse2=yes
   3.705 +        ])
   3.706 +        AC_MSG_RESULT($have_gcc_sse2)
   3.707 +        CFLAGS="$save_CFLAGS"
   3.708 +
   3.709 +        if test x$have_gcc_sse2 = xyes; then
   3.710 +            EXTRA_CFLAGS="$EXTRA_CFLAGS $sse2_CFLAGS"
   3.711 +            SUMMARY_math="${SUMMARY_math} sse2"
   3.712 +        fi
   3.713 +    fi
   3.714 +
   3.715 +    AC_ARG_ENABLE(sse3,
   3.716 +AS_HELP_STRING([--enable-sse3], [use SSE3 assembly routines [[default=maybe]]]),
   3.717 +                  , enable_sse3=$default_ssemath)
   3.718 +    if test x$enable_sse3 = xyes; then
   3.719 +        save_CFLAGS="$CFLAGS"
   3.720 +        have_gcc_sse3=no
   3.721 +        AC_MSG_CHECKING(for GCC -msse3 option)
   3.722 +        sse3_CFLAGS="-msse3"
   3.723 +        CFLAGS="$save_CFLAGS $sse3_CFLAGS"
   3.724 +
   3.725 +        AC_TRY_COMPILE([
   3.726 +        #ifdef __MINGW32__
   3.727 +        #include <_mingw.h>
   3.728 +        #ifdef __MINGW64_VERSION_MAJOR
   3.729 +        #include <intrin.h>
   3.730 +        #else
   3.731 +        #include <pmmintrin.h>
   3.732 +        #endif
   3.733 +        #else
   3.734 +        #include <pmmintrin.h>
   3.735 +        #endif
   3.736 +        #ifndef __SSE2__
   3.737 +        #error Assembler CPP flag not enabled
   3.738 +        #endif
   3.739 +        ],[
   3.740 +        ],[
   3.741 +        have_gcc_sse3=yes
   3.742 +        ])
   3.743 +        AC_MSG_RESULT($have_gcc_sse3)
   3.744 +        CFLAGS="$save_CFLAGS"
   3.745 +
   3.746 +        if test x$have_gcc_sse3 = xyes; then
   3.747 +            EXTRA_CFLAGS="$EXTRA_CFLAGS $sse3_CFLAGS"
   3.748 +            SUMMARY_math="${SUMMARY_math} sse3"
   3.749 +        fi
   3.750 +    fi
   3.751 +
   3.752 +    AC_CHECK_HEADER(immintrin.h,
   3.753 +                    have_immintrin_h_hdr=yes,
   3.754 +                    have_immintrin_h_hdr=no)
   3.755 +    if test x$have_immintrin_h_hdr = xyes; then
   3.756 +        AC_DEFINE(HAVE_IMMINTRIN_H, 1, [ ])
   3.757 +    fi
   3.758 +
   3.759 +    AC_ARG_ENABLE(altivec,
   3.760 +AS_HELP_STRING([--enable-altivec], [use Altivec assembly routines [[default=yes]]]),
   3.761 +                  , enable_altivec=yes)
   3.762 +    if test x$enable_altivec = xyes; then
   3.763 +        save_CFLAGS="$CFLAGS"
   3.764 +        have_gcc_altivec=no
   3.765 +        have_altivec_h_hdr=no
   3.766 +        altivec_CFLAGS="-maltivec"
   3.767 +        CFLAGS="$save_CFLAGS $altivec_CFLAGS"
   3.768 +
   3.769 +        AC_MSG_CHECKING(for Altivec with GCC altivec.h and -maltivec option)
   3.770 +        AC_TRY_COMPILE([
   3.771 +        #include <altivec.h>
   3.772 +        vector unsigned int vzero() {
   3.773 +            return vec_splat_u32(0);
   3.774 +        }
   3.775 +        ],[
   3.776 +        ],[
   3.777 +        have_gcc_altivec=yes
   3.778 +        have_altivec_h_hdr=yes
   3.779 +        ])
   3.780 +        AC_MSG_RESULT($have_gcc_altivec)
   3.781 +
   3.782 +        if test x$have_gcc_altivec = xno; then
   3.783 +            AC_MSG_CHECKING(for Altivec with GCC -maltivec option)
   3.784 +            AC_TRY_COMPILE([
   3.785 +            vector unsigned int vzero() {
   3.786 +                return vec_splat_u32(0);
   3.787 +            }
   3.788 +            ],[
   3.789 +            ],[
   3.790 +            have_gcc_altivec=yes
   3.791 +            ])
   3.792 +            AC_MSG_RESULT($have_gcc_altivec)
   3.793 +        fi
   3.794 +
   3.795 +        if test x$have_gcc_altivec = xno; then
   3.796 +            AC_MSG_CHECKING(for Altivec with GCC altivec.h and -faltivec option)
   3.797 +            altivec_CFLAGS="-faltivec"
   3.798 +            CFLAGS="$save_CFLAGS $altivec_CFLAGS"
   3.799 +            AC_TRY_COMPILE([
   3.800 +            #include <altivec.h>
   3.801 +            vector unsigned int vzero() {
   3.802 +                return vec_splat_u32(0);
   3.803 +            }
   3.804 +            ],[
   3.805 +            ],[
   3.806 +            have_gcc_altivec=yes
   3.807 +            have_altivec_h_hdr=yes
   3.808 +            ])
   3.809 +            AC_MSG_RESULT($have_gcc_altivec)
   3.810 +        fi
   3.811 +
   3.812 +        if test x$have_gcc_altivec = xno; then
   3.813 +            AC_MSG_CHECKING(for Altivec with GCC -faltivec option)
   3.814 +            AC_TRY_COMPILE([
   3.815 +            vector unsigned int vzero() {
   3.816 +                return vec_splat_u32(0);
   3.817 +            }
   3.818 +            ],[
   3.819 +            ],[
   3.820 +            have_gcc_altivec=yes
   3.821 +            ])
   3.822 +            AC_MSG_RESULT($have_gcc_altivec)
   3.823 +        fi
   3.824 +        CFLAGS="$save_CFLAGS"
   3.825 +
   3.826 +        if test x$have_gcc_altivec = xyes; then
   3.827 +            AC_DEFINE(SDL_ALTIVEC_BLITTERS, 1, [ ])
   3.828 +            if test x$have_altivec_h_hdr = xyes; then
   3.829 +              AC_DEFINE(HAVE_ALTIVEC_H, 1, [ ])
   3.830 +            fi
   3.831 +            EXTRA_CFLAGS="$EXTRA_CFLAGS $altivec_CFLAGS"
   3.832 +            SUMMARY_math="${SUMMARY_math} altivec"
   3.833 +        fi
   3.834 +    fi
   3.835 +fi
   3.836 +
   3.837 +dnl See if the OSS audio interface is supported
   3.838 +CheckOSS()
   3.839 +{
   3.840 +    AC_ARG_ENABLE(oss,
   3.841 +AS_HELP_STRING([--enable-oss], [support the OSS audio API [[default=maybe]]]),
   3.842 +                  , enable_oss=maybe)
   3.843 +
   3.844 +    # OpenBSD "has" OSS, but it's not really for app use. They want you to
   3.845 +    #  use sndio instead. So on there, we default to disabled. You can force
   3.846 +    #  it on if you really want, though.
   3.847 +    if test x$enable_oss = xmaybe; then
   3.848 +        enable_oss=yes
   3.849 +        case "$host" in
   3.850 +            *-*-openbsd*)
   3.851 +                enable_oss=no;;
   3.852 +        esac
   3.853 +    fi
   3.854 +
   3.855 +    if test x$enable_audio = xyes -a x$enable_oss = xyes; then
   3.856 +        AC_MSG_CHECKING(for OSS audio support)
   3.857 +        have_oss=no
   3.858 +        if test x$have_oss != xyes; then
   3.859 +            AC_TRY_COMPILE([
   3.860 +              #include <sys/soundcard.h>
   3.861 +            ],[
   3.862 +              int arg = SNDCTL_DSP_SETFRAGMENT;
   3.863 +            ],[
   3.864 +            have_oss=yes
   3.865 +            ])
   3.866 +        fi
   3.867 +        if test x$have_oss != xyes; then
   3.868 +            AC_TRY_COMPILE([
   3.869 +              #include <soundcard.h>
   3.870 +            ],[
   3.871 +              int arg = SNDCTL_DSP_SETFRAGMENT;
   3.872 +            ],[
   3.873 +            have_oss=yes
   3.874 +            AC_DEFINE(SDL_AUDIO_DRIVER_OSS_SOUNDCARD_H, 1, [ ])
   3.875 +            ])
   3.876 +        fi
   3.877 +        AC_MSG_RESULT($have_oss)
   3.878 +        if test x$have_oss = xyes; then
   3.879 +            SUMMARY_audio="${SUMMARY_audio} oss"
   3.880 +            AC_DEFINE(SDL_AUDIO_DRIVER_OSS, 1, [ ])
   3.881 +            SOURCES="$SOURCES $srcdir/src/audio/dsp/*.c"
   3.882 +            have_audio=yes
   3.883 +
   3.884 +            # We may need to link with ossaudio emulation library
   3.885 +            case "$host" in
   3.886 +                *-*-openbsd*|*-*-netbsd*)
   3.887 +                    EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lossaudio";;
   3.888 +            esac
   3.889 +        fi
   3.890 +    fi
   3.891 +}
   3.892 +
   3.893 +dnl See if the ALSA audio interface is supported
   3.894 +CheckALSA()
   3.895 +{
   3.896 +    AC_ARG_ENABLE(alsa,
   3.897 +AS_HELP_STRING([--enable-alsa], [support the ALSA audio API [[default=yes]]]),
   3.898 +                  , enable_alsa=yes)
   3.899 +    if test x$enable_audio = xyes -a x$enable_alsa = xyes; then
   3.900 +        AM_PATH_ALSA(1.0.11, have_alsa=yes, have_alsa=no)
   3.901 +        # Restore all flags from before the ALSA detection runs
   3.902 +        CFLAGS="$alsa_save_CFLAGS"
   3.903 +        LDFLAGS="$alsa_save_LDFLAGS"
   3.904 +        LIBS="$alsa_save_LIBS"
   3.905 +        if test x$have_alsa = xyes; then
   3.906 +            AC_ARG_ENABLE(alsa-shared,
   3.907 +AS_HELP_STRING([--enable-alsa-shared], [dynamically load ALSA audio support [[default=yes]]]),
   3.908 +                          , enable_alsa_shared=yes)
   3.909 +            alsa_lib=[`find_lib "libasound.so.*" "$ALSA_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`]
   3.910 +
   3.911 +            AC_DEFINE(SDL_AUDIO_DRIVER_ALSA, 1, [ ])
   3.912 +            SOURCES="$SOURCES $srcdir/src/audio/alsa/*.c"
   3.913 +            EXTRA_CFLAGS="$EXTRA_CFLAGS $ALSA_CFLAGS"
   3.914 +            if test x$have_loadso != xyes && \
   3.915 +               test x$enable_alsa_shared = xyes; then
   3.916 +                AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic ALSA loading])
   3.917 +            fi
   3.918 +            if test x$have_loadso = xyes && \
   3.919 +               test x$enable_alsa_shared = xyes && test x$alsa_lib != x; then
   3.920 +                echo "-- dynamic libasound -> $alsa_lib"
   3.921 +                AC_DEFINE_UNQUOTED(SDL_AUDIO_DRIVER_ALSA_DYNAMIC, "$alsa_lib", [ ])
   3.922 +                SUMMARY_audio="${SUMMARY_audio} alsa(dynamic)"
   3.923 +            else
   3.924 +                EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ALSA_LIBS"
   3.925 +                SUMMARY_audio="${SUMMARY_audio} alsa"
   3.926 +            fi
   3.927 +            have_audio=yes
   3.928 +        fi
   3.929 +    fi
   3.930 +}
   3.931 +
   3.932 +dnl Find JACK Audio
   3.933 +CheckJACK()
   3.934 +{
   3.935 +    AC_ARG_ENABLE(jack,
   3.936 +AS_HELP_STRING([--enable-jack], [use JACK audio [[default=yes]]]),
   3.937 +                  , enable_jack=yes)
   3.938 +    if test x$enable_audio = xyes -a x$enable_jack = xyes; then
   3.939 +        PKG_CHECK_MODULES([JACK], [jack >= 0.125], audio_jack=yes, audio_jack=no)
   3.940 +
   3.941 +        if test x$audio_jack = xyes; then
   3.942 +            AC_ARG_ENABLE(jack-shared,
   3.943 +AS_HELP_STRING([--enable-jack-shared], [dynamically load JACK audio support [[default=yes]]]),
   3.944 +                          , enable_jack_shared=yes)
   3.945 +            jack_lib=[`find_lib "libjack.so.*" "$JACK_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`]
   3.946 +
   3.947 +            AC_DEFINE(SDL_AUDIO_DRIVER_JACK, 1, [ ])
   3.948 +            SOURCES="$SOURCES $srcdir/src/audio/jack/*.c"
   3.949 +            EXTRA_CFLAGS="$EXTRA_CFLAGS $JACK_CFLAGS"
   3.950 +            if test x$have_loadso != xyes && \
   3.951 +               test x$enable_jack_shared = xyes; then
   3.952 +                AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic JACK audio loading])
   3.953 +            fi
   3.954 +            if test x$have_loadso = xyes && \
   3.955 +               test x$enable_jack_shared = xyes && test x$jack_lib != x; then
   3.956 +                echo "-- dynamic libjack -> $jack_lib"
   3.957 +                AC_DEFINE_UNQUOTED(SDL_AUDIO_DRIVER_JACK_DYNAMIC, "$jack_lib", [ ])
   3.958 +                SUMMARY_audio="${SUMMARY_audio} jack(dynamic)"
   3.959 +
   3.960 +                case "$host" in
   3.961 +                    # On Solaris, jack must be linked deferred explicitly
   3.962 +                    # to prevent undefined symbol failures.
   3.963 +                    *-*-solaris*)
   3.964 +                        JACK_LIBS=`echo $JACK_LIBS | sed 's/\-l/-Wl,-l/g'`
   3.965 +                        EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-zdeferred $JACK_LIBS -Wl,-znodeferred"
   3.966 +                esac
   3.967 +            else
   3.968 +                EXTRA_LDFLAGS="$EXTRA_LDFLAGS $JACK_LIBS"
   3.969 +                SUMMARY_audio="${SUMMARY_audio} jack"
   3.970 +            fi
   3.971 +            have_audio=yes
   3.972 +        fi
   3.973 +    fi
   3.974 +}
   3.975 +
   3.976 +dnl Find the ESD includes and libraries
   3.977 +CheckESD()
   3.978 +{
   3.979 +    AC_ARG_ENABLE(esd,
   3.980 +AS_HELP_STRING([--enable-esd], [support the Enlightened Sound Daemon [[default=yes]]]),
   3.981 +                  , enable_esd=yes)
   3.982 +    if test x$enable_audio = xyes -a x$enable_esd = xyes; then
   3.983 +        AM_PATH_ESD(0.2.8, have_esd=yes, have_esd=no)
   3.984 +        if test x$have_esd = xyes; then
   3.985 +            AC_ARG_ENABLE(esd-shared,
   3.986 +AS_HELP_STRING([--enable-esd-shared], [dynamically load ESD audio support [[default=yes]]]),
   3.987 +                          , enable_esd_shared=yes)
   3.988 +            esd_lib=[`find_lib "libesd.so.*" "$ESD_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`]
   3.989 +
   3.990 +            AC_DEFINE(SDL_AUDIO_DRIVER_ESD, 1, [ ])
   3.991 +            SOURCES="$SOURCES $srcdir/src/audio/esd/*.c"
   3.992 +            EXTRA_CFLAGS="$EXTRA_CFLAGS $ESD_CFLAGS"
   3.993 +            if test x$have_loadso != xyes && \
   3.994 +               test x$enable_esd_shared = xyes; then
   3.995 +                AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic ESD loading])
   3.996 +            fi
   3.997 +            if test x$have_loadso = xyes && \
   3.998 +               test x$enable_esd_shared = xyes && test x$esd_lib != x; then
   3.999 +                echo "-- dynamic libesd -> $esd_lib"
  3.1000 +                AC_DEFINE_UNQUOTED(SDL_AUDIO_DRIVER_ESD_DYNAMIC, "$esd_lib", [ ])
  3.1001 +                SUMMARY_audio="${SUMMARY_audio} esd(dynamic)"
  3.1002 +            else
  3.1003 +                EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ESD_LIBS"
  3.1004 +                SUMMARY_audio="${SUMMARY_audio} esd"
  3.1005 +            fi
  3.1006 +            have_audio=yes
  3.1007 +        fi
  3.1008 +    fi
  3.1009 +}
  3.1010 +
  3.1011 +dnl Find PulseAudio
  3.1012 +CheckPulseAudio()
  3.1013 +{
  3.1014 +    AC_ARG_ENABLE(pulseaudio,
  3.1015 +AS_HELP_STRING([--enable-pulseaudio], [use PulseAudio [[default=yes]]]),
  3.1016 +                  , enable_pulseaudio=yes)
  3.1017 +    if test x$enable_audio = xyes -a x$enable_pulseaudio = xyes; then
  3.1018 +        PKG_CHECK_MODULES([PULSEAUDIO], [libpulse-simple >= 0.9], audio_pulseaudio=yes, audio_pulseaudio=no)
  3.1019 +
  3.1020 +        if test x$audio_pulseaudio = xyes; then
  3.1021 +            AC_ARG_ENABLE(pulseaudio-shared,
  3.1022 +AS_HELP_STRING([--enable-pulseaudio-shared], [dynamically load PulseAudio support [[default=yes]]]),
  3.1023 +                          , enable_pulseaudio_shared=yes)
  3.1024 +            pulseaudio_lib=[`find_lib "libpulse-simple.so.*" "$PULSEAUDIO_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`]
  3.1025 +
  3.1026 +            AC_DEFINE(SDL_AUDIO_DRIVER_PULSEAUDIO, 1, [ ])
  3.1027 +            SOURCES="$SOURCES $srcdir/src/audio/pulseaudio/*.c"
  3.1028 +            EXTRA_CFLAGS="$EXTRA_CFLAGS $PULSEAUDIO_CFLAGS"
  3.1029 +            if test x$have_loadso != xyes && \
  3.1030 +               test x$enable_pulseaudio_shared = xyes; then
  3.1031 +                AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic PulseAudio loading])
  3.1032 +            fi
  3.1033 +            if test x$have_loadso = xyes && \
  3.1034 +               test x$enable_pulseaudio_shared = xyes && test x$pulseaudio_lib != x; then
  3.1035 +                echo "-- dynamic libpulse-simple -> $pulseaudio_lib"
  3.1036 +                AC_DEFINE_UNQUOTED(SDL_AUDIO_DRIVER_PULSEAUDIO_DYNAMIC, "$pulseaudio_lib", [ ])
  3.1037 +                SUMMARY_audio="${SUMMARY_audio} pulse(dynamic)"
  3.1038 +
  3.1039 +                case "$host" in
  3.1040 +                    # On Solaris, pulseaudio must be linked deferred explicitly
  3.1041 +                    # to prevent undefined symbol failures.
  3.1042 +                    *-*-solaris*)
  3.1043 +                        PULSEAUDIO_LIBS=`echo $PULSEAUDIO_LIBS | sed 's/\-l/-Wl,-l/g'`
  3.1044 +                        EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-zdeferred $PULSEAUDIO_LIBS -Wl,-znodeferred"
  3.1045 +                esac
  3.1046 +            else
  3.1047 +                EXTRA_LDFLAGS="$EXTRA_LDFLAGS $PULSEAUDIO_LIBS"
  3.1048 +                SUMMARY_audio="${SUMMARY_audio} pulse"
  3.1049 +            fi
  3.1050 +            have_audio=yes
  3.1051 +        fi
  3.1052 +    fi
  3.1053 +}
  3.1054 +
  3.1055 +CheckARTSC()
  3.1056 +{
  3.1057 +    AC_ARG_ENABLE(arts,
  3.1058 +AS_HELP_STRING([--enable-arts], [support the Analog Real Time Synthesizer [[default=yes]]]),
  3.1059 +                  , enable_arts=yes)
  3.1060 +    if test x$enable_audio = xyes -a x$enable_arts = xyes; then
  3.1061 +        AC_PATH_PROG(ARTSCONFIG, artsc-config)
  3.1062 +        if test x$ARTSCONFIG = x -o x$ARTSCONFIG = x'"$ARTSCONFIG"'; then
  3.1063 +            : # arts isn't installed
  3.1064 +        else
  3.1065 +            ARTS_CFLAGS=`$ARTSCONFIG --cflags`
  3.1066 +            ARTS_LIBS=`$ARTSCONFIG --libs`
  3.1067 +            AC_MSG_CHECKING(for aRts development environment)
  3.1068 +            audio_arts=no
  3.1069 +            save_CFLAGS="$CFLAGS"
  3.1070 +            CFLAGS="$CFLAGS $ARTS_CFLAGS"
  3.1071 +            AC_TRY_COMPILE([
  3.1072 +             #include <artsc.h>
  3.1073 +            ],[
  3.1074 +             arts_stream_t stream;
  3.1075 +            ],[
  3.1076 +            audio_arts=yes
  3.1077 +            ])
  3.1078 +            CFLAGS="$save_CFLAGS"
  3.1079 +            AC_MSG_RESULT($audio_arts)
  3.1080 +            if test x$audio_arts = xyes; then
  3.1081 +                AC_ARG_ENABLE(arts-shared,
  3.1082 +AS_HELP_STRING([--enable-arts-shared], [dynamically load aRts audio support [[default=yes]]]),
  3.1083 +                              , enable_arts_shared=yes)
  3.1084 +                arts_lib=[`find_lib "libartsc.so.*" "$ARTS_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`]
  3.1085 +
  3.1086 +                AC_DEFINE(SDL_AUDIO_DRIVER_ARTS, 1, [ ])
  3.1087 +                SOURCES="$SOURCES $srcdir/src/audio/arts/*.c"
  3.1088 +                EXTRA_CFLAGS="$EXTRA_CFLAGS $ARTS_CFLAGS"
  3.1089 +                if test x$have_loadso != xyes && \
  3.1090 +                   test x$enable_arts_shared = xyes; then
  3.1091 +                    AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic ARTS loading])
  3.1092 +                fi
  3.1093 +                if test x$have_loadso = xyes && \
  3.1094 +                   test x$enable_arts_shared = xyes && test x$arts_lib != x; then
  3.1095 +                    echo "-- dynamic libartsc -> $arts_lib"
  3.1096 +                    AC_DEFINE_UNQUOTED(SDL_AUDIO_DRIVER_ARTS_DYNAMIC, "$arts_lib", [ ])
  3.1097 +                    SUMMARY_audio="${SUMMARY_audio} arts(dynamic)"
  3.1098 +                else
  3.1099 +                    EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ARTS_LIBS"
  3.1100 +                    SUMMARY_audio="${SUMMARY_audio} arts"
  3.1101 +                fi
  3.1102 +                have_audio=yes
  3.1103 +            fi
  3.1104 +        fi
  3.1105 +    fi
  3.1106 +}
  3.1107 +
  3.1108 +dnl See if the NAS audio interface is supported
  3.1109 +CheckNAS()
  3.1110 +{
  3.1111 +    AC_ARG_ENABLE(nas,
  3.1112 +AS_HELP_STRING([--enable-nas], [support the NAS audio API [[default=yes]]]),
  3.1113 +                  , enable_nas=yes)
  3.1114 +    if test x$enable_audio = xyes -a x$enable_nas = xyes; then
  3.1115 +        AC_CHECK_HEADER(audio/audiolib.h, have_nas_hdr=yes)
  3.1116 +        AC_CHECK_LIB(audio, AuOpenServer, have_nas_lib=yes)
  3.1117 +
  3.1118 +        AC_MSG_CHECKING(for NAS audio support)
  3.1119 +        have_nas=no
  3.1120 +
  3.1121 +        if test x$have_nas_hdr = xyes -a x$have_nas_lib = xyes; then
  3.1122 +            have_nas=yes
  3.1123 +            NAS_LIBS="-laudio"
  3.1124 +
  3.1125 +        elif test -r /usr/X11R6/include/audio/audiolib.h; then
  3.1126 +            have_nas=yes
  3.1127 +            NAS_CFLAGS="-I/usr/X11R6/include/"
  3.1128 +            NAS_LIBS="-L/usr/X11R6/lib -laudio -lXt"
  3.1129 +
  3.1130 +        fi
  3.1131 +
  3.1132 +        AC_MSG_RESULT($have_nas)
  3.1133 +
  3.1134 +        if test x$have_nas = xyes; then
  3.1135 +            AC_ARG_ENABLE(nas-shared,
  3.1136 +AS_HELP_STRING([--enable-nas-shared], [dynamically load NAS audio support [[default=yes]]]),
  3.1137 +                          , enable_nas_shared=yes)
  3.1138 +            nas_lib=[`find_lib "libaudio.so.*" "$NAS_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`]
  3.1139 +
  3.1140 +            if test x$have_loadso != xyes && \
  3.1141 +               test x$enable_nas_shared = xyes; then
  3.1142 +                AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic NAS loading])
  3.1143 +            fi
  3.1144 +            if test x$have_loadso = xyes && \
  3.1145 +               test x$enable_nas_shared = xyes && test x$nas_lib != x; then
  3.1146 +                echo "-- dynamic libaudio -> $nas_lib"
  3.1147 +                AC_DEFINE_UNQUOTED(SDL_AUDIO_DRIVER_NAS_DYNAMIC, "$nas_lib", [ ])
  3.1148 +                SUMMARY_audio="${SUMMARY_audio} nas(dynamic)"
  3.1149 +            else
  3.1150 +                EXTRA_LDFLAGS="$EXTRA_LDFLAGS $NAS_LIBS"
  3.1151 +                SUMMARY_audio="${SUMMARY_audio} nas"
  3.1152 +            fi
  3.1153 +
  3.1154 +            AC_DEFINE(SDL_AUDIO_DRIVER_NAS, 1, [ ])
  3.1155 +            SOURCES="$SOURCES $srcdir/src/audio/nas/*.c"
  3.1156 +            EXTRA_CFLAGS="$EXTRA_CFLAGS $NAS_CFLAGS"
  3.1157 +            have_audio=yes
  3.1158 +        fi
  3.1159 +    fi
  3.1160 +}
  3.1161 +
  3.1162 +dnl See if the sndio audio interface is supported
  3.1163 +CheckSNDIO()
  3.1164 +{
  3.1165 +    AC_ARG_ENABLE(sndio,
  3.1166 +AS_HELP_STRING([--enable-sndio], [support the sndio audio API [[default=yes]]]),
  3.1167 +                  , enable_sndio=yes)
  3.1168 +    if test x$enable_audio = xyes -a x$enable_sndio = xyes; then
  3.1169 +        AC_CHECK_HEADER(sndio.h, have_sndio_hdr=yes)
  3.1170 +        AC_CHECK_LIB(sndio, sio_open, have_sndio_lib=yes)
  3.1171 +
  3.1172 +        AC_MSG_CHECKING(for sndio audio support)
  3.1173 +        have_sndio=no
  3.1174 +
  3.1175 +        if test x$have_sndio_hdr = xyes -a x$have_sndio_lib = xyes; then
  3.1176 +            have_sndio=yes
  3.1177 +            SNDIO_LIBS="-lsndio"
  3.1178 +        fi
  3.1179 +
  3.1180 +        AC_MSG_RESULT($have_sndio)
  3.1181 +
  3.1182 +        if test x$have_sndio = xyes; then
  3.1183 +            AC_ARG_ENABLE(sndio-shared,
  3.1184 +AS_HELP_STRING([--enable-sndio-shared], [dynamically load sndio audio support [[default=yes]]]),
  3.1185 +                          , enable_sndio_shared=yes)
  3.1186 +            sndio_lib=[`find_lib "libsndio.so.*" "$SNDIO_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`]
  3.1187 +
  3.1188 +            if test x$have_loadso != xyes && \
  3.1189 +               test x$enable_sndio_shared = xyes; then
  3.1190 +                AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic sndio loading])
  3.1191 +            fi
  3.1192 +            if test x$have_loadso = xyes && \
  3.1193 +               test x$enable_sndio_shared = xyes && test x$sndio_lib != x; then
  3.1194 +                echo "-- dynamic libsndio -> $sndio_lib"
  3.1195 +                AC_DEFINE_UNQUOTED(SDL_AUDIO_DRIVER_SNDIO_DYNAMIC, "$sndio_lib", [ ])
  3.1196 +                SUMMARY_audio="${SUMMARY_audio} sndio(dynamic)"
  3.1197 +            else
  3.1198 +                EXTRA_LDFLAGS="$EXTRA_LDFLAGS $SNDIO_LIBS"
  3.1199 +                SUMMARY_audio="${SUMMARY_audio} sndio"
  3.1200 +            fi
  3.1201 +
  3.1202 +            AC_DEFINE(SDL_AUDIO_DRIVER_SNDIO, 1, [ ])
  3.1203 +            SOURCES="$SOURCES $srcdir/src/audio/sndio/*.c"
  3.1204 +            EXTRA_CFLAGS="$EXTRA_CFLAGS $SNDIO_CFLAGS"
  3.1205 +            have_audio=yes
  3.1206 +        fi
  3.1207 +    fi
  3.1208 +}
  3.1209 +
  3.1210 +dnl Find FusionSound
  3.1211 +CheckFusionSound()
  3.1212 +{
  3.1213 +    AC_ARG_ENABLE(fusionsound,
  3.1214 +AS_HELP_STRING([--enable-fusionsound], [use FusionSound audio driver [[default=no]]]),
  3.1215 +                  , enable_fusionsound=no)
  3.1216 +    if test x$enable_audio = xyes -a x$enable_fusionsound = xyes; then
  3.1217 +        PKG_CHECK_MODULES([FUSIONSOUND], [fusionsound >= 1.1.1], fusionsound=yes, fusionsound=no)
  3.1218 +
  3.1219 +        if test x$fusionsound = xyes; then
  3.1220 +            AC_DEFINE(SDL_AUDIO_DRIVER_FUSIONSOUND, 1, [ ])
  3.1221 +            SOURCES="$SOURCES $srcdir/src/audio/fusionsound/*.c"
  3.1222 +            EXTRA_CFLAGS="$EXTRA_CFLAGS $FUSIONSOUND_CFLAGS"
  3.1223 +            
  3.1224 +            AC_ARG_ENABLE(fusionsound-shared,
  3.1225 +AS_HELP_STRING([--enable-fusionsound-shared], [dynamically load fusionsound audio support [[default=yes]]]),
  3.1226 +                          , enable_fusionsound_shared=yes)
  3.1227 +            fusionsound_shared=no
  3.1228 +            AC_MSG_CHECKING(for FusionSound dynamic loading support)
  3.1229 +            if test x$have_loadso != xyes && \
  3.1230 +               test x$enable_fusionsound_shared = xyes; then
  3.1231 +                AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic fusionsound loading])
  3.1232 +            fi
  3.1233 +            if test x$have_loadso = xyes && \
  3.1234 +               test x$enable_fusionsound_shared = xyes; then
  3.1235 +                AC_DEFINE_UNQUOTED(SDL_AUDIO_DRIVER_FUSIONSOUND_DYNAMIC, "libfusionsound.so", [ ])
  3.1236 +                fusionsound_shared=yes
  3.1237 +                SUMMARY_audio="${SUMMARY_audio} fusionsound(dynamic)"
  3.1238 +            else
  3.1239 +                EXTRA_LDFLAGS="$EXTRA_LDFLAGS $FUSIONSOUND_LIBS"
  3.1240 +                SUMMARY_audio="${SUMMARY_audio} fusionsound"
  3.1241 +            fi
  3.1242 +            AC_MSG_RESULT($fusionsound_shared)
  3.1243 +            
  3.1244 +            have_audio=yes
  3.1245 +        fi
  3.1246 +    fi
  3.1247 +}
  3.1248 +
  3.1249 +dnl rcg07142001 See if the user wants the disk writer audio driver...
  3.1250 +CheckDiskAudio()
  3.1251 +{
  3.1252 +    AC_ARG_ENABLE(diskaudio,
  3.1253 +AS_HELP_STRING([--enable-diskaudio], [support the disk writer audio driver [[default=yes]]]),
  3.1254 +                  , enable_diskaudio=yes)
  3.1255 +    if test x$enable_audio = xyes -a x$enable_diskaudio = xyes; then
  3.1256 +        AC_DEFINE(SDL_AUDIO_DRIVER_DISK, 1, [ ])
  3.1257 +        SOURCES="$SOURCES $srcdir/src/audio/disk/*.c"
  3.1258 +        SUMMARY_audio="${SUMMARY_audio} disk"
  3.1259 +    fi
  3.1260 +}
  3.1261 +
  3.1262 +dnl rcg03142006 See if the user wants the dummy audio driver...
  3.1263 +CheckDummyAudio()
  3.1264 +{
  3.1265 +    AC_ARG_ENABLE(dummyaudio,
  3.1266 +AS_HELP_STRING([--enable-dummyaudio], [support the dummy audio driver [[default=yes]]]),
  3.1267 +                  , enable_dummyaudio=yes)
  3.1268 +    if test x$enable_audio = xyes -a x$enable_dummyaudio = xyes; then
  3.1269 +        AC_DEFINE(SDL_AUDIO_DRIVER_DUMMY, 1, [ ])
  3.1270 +        SOURCES="$SOURCES $srcdir/src/audio/dummy/*.c"
  3.1271 +        SUMMARY_audio="${SUMMARY_audio} dummy"
  3.1272 +    fi
  3.1273 +}
  3.1274 +
  3.1275 +dnl See if libsamplerate is available
  3.1276 +CheckLibSampleRate()
  3.1277 +{
  3.1278 +    AC_ARG_ENABLE(libsamplerate,
  3.1279 +AS_HELP_STRING([--enable-libsamplerate], [use libsamplerate for audio rate conversion [[default=yes]]]),
  3.1280 +                  , enable_libsamplerate=yes)
  3.1281 +    if test x$enable_libsamplerate = xyes; then
  3.1282 +        AC_CHECK_HEADER(samplerate.h,
  3.1283 +                        have_samplerate_h_hdr=yes,
  3.1284 +                        have_samplerate_h_hdr=no)
  3.1285 +        if test x$have_samplerate_h_hdr = xyes; then
  3.1286 +            AC_DEFINE(HAVE_LIBSAMPLERATE_H, 1, [ ])
  3.1287 +
  3.1288 +            AC_ARG_ENABLE(libsamplerate-shared,
  3.1289 +AS_HELP_STRING([--enable-libsamplerate-shared], [dynamically load libsamplerate [[default=yes]]]),
  3.1290 +                          , enable_libsamplerate_shared=yes)
  3.1291 +
  3.1292 +            samplerate_lib=[`find_lib "libsamplerate.so.*" "" | sed 's/.*\/\(.*\)/\1/; q'`]
  3.1293 +
  3.1294 +            if test x$have_loadso != xyes && \
  3.1295 +               test x$enable_libsamplerate_shared = xyes; then
  3.1296 +                AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic libsamplerate loading])
  3.1297 +            fi
  3.1298 +            if test x$have_loadso = xyes && \
  3.1299 +               test x$enable_libsamplerate_shared = xyes && test x$samplerate_lib != x; then
  3.1300 +                echo "-- dynamic libsamplerate -> $samplerate_lib"
  3.1301 +                AC_DEFINE_UNQUOTED(SDL_LIBSAMPLERATE_DYNAMIC, "$samplerate_lib", [ ])
  3.1302 +            else
  3.1303 +                EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lsamplerate"
  3.1304 +            fi
  3.1305 +        fi
  3.1306 +    fi
  3.1307 +}
  3.1308 +
  3.1309 +dnl See if GCC's -fvisibility=hidden is supported (gcc4 and later, usually).
  3.1310 +dnl  Details of this flag are here: http://gcc.gnu.org/wiki/Visibility
  3.1311 +CheckVisibilityHidden()
  3.1312 +{
  3.1313 +    AC_MSG_CHECKING(for GCC -fvisibility=hidden option)
  3.1314 +    have_gcc_fvisibility=no
  3.1315 +
  3.1316 +    visibility_CFLAGS="-fvisibility=hidden"
  3.1317 +    save_CFLAGS="$CFLAGS"
  3.1318 +    CFLAGS="$save_CFLAGS $visibility_CFLAGS -Werror"
  3.1319 +    AC_TRY_COMPILE([
  3.1320 +    #if !defined(__GNUC__) || __GNUC__ < 4
  3.1321 +    #error SDL only uses visibility attributes in GCC 4 or newer
  3.1322 +    #endif
  3.1323 +    ],[
  3.1324 +    ],[
  3.1325 +    have_gcc_fvisibility=yes
  3.1326 +    ])
  3.1327 +    AC_MSG_RESULT($have_gcc_fvisibility)
  3.1328 +    CFLAGS="$save_CFLAGS"
  3.1329 +
  3.1330 +    if test x$have_gcc_fvisibility = xyes; then
  3.1331 +        EXTRA_CFLAGS="$EXTRA_CFLAGS $visibility_CFLAGS"
  3.1332 +    fi
  3.1333 +}
  3.1334 +
  3.1335 +dnl See if GCC's -mpreferred-stack-boundary is supported.
  3.1336 +dnl  Reference: http://bugzilla.libsdl.org/show_bug.cgi?id=1296
  3.1337 +CheckStackBoundary()
  3.1338 +{
  3.1339 +    AC_MSG_CHECKING(for GCC -mpreferred-stack-boundary option)
  3.1340 +    have_gcc_preferred_stack_boundary=no
  3.1341 +
  3.1342 +    save_CFLAGS="$CFLAGS"
  3.1343 +    CFLAGS="$save_CFLAGS -mpreferred-stack-boundary=2"
  3.1344 +    AC_TRY_COMPILE([
  3.1345 +    int x = 0;
  3.1346 +    ],[
  3.1347 +    ],[
  3.1348 +    have_gcc_preferred_stack_boundary=yes
  3.1349 +    ])
  3.1350 +    AC_MSG_RESULT($have_gcc_preferred_stack_boundary)
  3.1351 +    CFLAGS="$save_CFLAGS"
  3.1352 +
  3.1353 +    if test x$have_gcc_preferred_stack_boundary = xyes; then
  3.1354 +        EXTRA_CFLAGS="$EXTRA_CFLAGS -mpreferred-stack-boundary=2"
  3.1355 +    fi
  3.1356 +}
  3.1357 +
  3.1358 +dnl See if GCC's -Wdeclaration-after-statement is supported.
  3.1359 +dnl  This lets us catch things that would fail on a C89 compiler when using
  3.1360 +dnl  a modern GCC.
  3.1361 +CheckDeclarationAfterStatement()
  3.1362 +{
  3.1363 +    AC_MSG_CHECKING(for GCC -Wdeclaration-after-statement option)
  3.1364 +    have_gcc_declaration_after_statement=no
  3.1365 +
  3.1366 +    save_CFLAGS="$CFLAGS"
  3.1367 +    CFLAGS="$save_CFLAGS -Wdeclaration-after-statement -Werror=declaration-after-statement"
  3.1368 +    AC_TRY_COMPILE([
  3.1369 +    int x = 0;
  3.1370 +    ],[
  3.1371 +    ],[
  3.1372 +    have_gcc_declaration_after_statement=yes
  3.1373 +    ])
  3.1374 +    AC_MSG_RESULT($have_gcc_declaration_after_statement)
  3.1375 +    CFLAGS="$save_CFLAGS"
  3.1376 +
  3.1377 +    if test x$have_gcc_declaration_after_statement = xyes; then
  3.1378 +        EXTRA_CFLAGS="$EXTRA_CFLAGS -Wdeclaration-after-statement -Werror=declaration-after-statement"
  3.1379 +    fi
  3.1380 +}
  3.1381 +
  3.1382 +dnl See if GCC's -Wall is supported.
  3.1383 +CheckWarnAll()
  3.1384 +{
  3.1385 +    AC_MSG_CHECKING(for GCC -Wall option)
  3.1386 +    have_gcc_Wall=no
  3.1387 +
  3.1388 +    save_CFLAGS="$CFLAGS"
  3.1389 +    CFLAGS="$save_CFLAGS -Wall"
  3.1390 +    AC_TRY_COMPILE([
  3.1391 +    int x = 0;
  3.1392 +    ],[
  3.1393 +    ],[
  3.1394 +    have_gcc_Wall=yes
  3.1395 +    ])
  3.1396 +    AC_MSG_RESULT($have_gcc_Wall)
  3.1397 +    CFLAGS="$save_CFLAGS"
  3.1398 +
  3.1399 +    if test x$have_gcc_Wall = xyes; then
  3.1400 +        EXTRA_CFLAGS="$EXTRA_CFLAGS -Wall"
  3.1401 +
  3.1402 +        dnl Haiku headers use multicharacter constants all over the place. Ignore these warnings when using -Wall.
  3.1403 +        AC_MSG_CHECKING(for necessary GCC -Wno-multichar option)
  3.1404 +        need_gcc_Wno_multichar=no
  3.1405 +        case "$host" in
  3.1406 +            *-*-haiku*)
  3.1407 +                need_gcc_Wno_multichar=yes
  3.1408 +                ;;
  3.1409 +        esac
  3.1410 +        AC_MSG_RESULT($need_gcc_Wno_multichar)
  3.1411 +        if test x$need_gcc_Wno_multichar = xyes; then
  3.1412 +            EXTRA_CFLAGS="$EXTRA_CFLAGS -Wno-multichar"
  3.1413 +        fi
  3.1414 +    fi
  3.1415 +}
  3.1416 +
  3.1417 +dnl Check for Wayland
  3.1418 +CheckWayland()
  3.1419 +{
  3.1420 +    AC_ARG_ENABLE(video-wayland,
  3.1421 +AS_HELP_STRING([--enable-video-wayland], [use Wayland video driver [[default=yes]]]),
  3.1422 +                  ,enable_video_wayland=yes)
  3.1423 +
  3.1424 +    AC_ARG_ENABLE(video-wayland-qt-touch,
  3.1425 +AS_HELP_STRING([--enable-video-wayland-qt-touch], [QtWayland server support for Wayland video driver [[default=yes]]]),
  3.1426 +                  ,enable_video_wayland_qt_touch=yes)
  3.1427 +
  3.1428 +    if test x$enable_video = xyes -a x$enable_video_wayland = xyes; then
  3.1429 +        AC_MSG_CHECKING(for Wayland support)
  3.1430 +        video_wayland=no
  3.1431 +        if  test x$video_opengl_egl = xyes && \
  3.1432 +            test x$video_opengles_v2 = xyes; then
  3.1433 +            if $PKG_CONFIG --exists wayland-client wayland-scanner wayland-protocols wayland-egl wayland-cursor egl xkbcommon ; then
  3.1434 +                WAYLAND_CFLAGS=`$PKG_CONFIG --cflags wayland-client wayland-egl wayland-cursor xkbcommon`
  3.1435 +                WAYLAND_LIBS=`$PKG_CONFIG --libs wayland-client wayland-egl wayland-cursor xkbcommon`
  3.1436 +                WAYLAND_SCANNER=`$PKG_CONFIG --variable=wayland_scanner wayland-scanner`
  3.1437 +                video_wayland=yes
  3.1438 +            fi
  3.1439 +        fi
  3.1440 +        AC_MSG_RESULT($video_wayland)
  3.1441 +
  3.1442 +        if test x$video_wayland = xyes; then
  3.1443 +            AC_DEFINE(SDL_VIDEO_DRIVER_WAYLAND, 1, [ ])
  3.1444 +            if test x$enable_video_wayland_qt_touch = xyes; then
  3.1445 +                AC_DEFINE(SDL_VIDEO_DRIVER_WAYLAND_QT_TOUCH, 1, [ ])
  3.1446 +            fi
  3.1447 +
  3.1448 +            WAYLAND_SOURCES="$srcdir/src/video/wayland/*.c"
  3.1449 +            SOURCES="$SOURCES $WAYLAND_SOURCES"
  3.1450 +            EXTRA_CFLAGS="$EXTRA_CFLAGS $WAYLAND_CFLAGS -I\$(gen)"
  3.1451 +            AC_ARG_ENABLE(wayland-shared,
  3.1452 +AS_HELP_STRING([--enable-wayland-shared], [dynamically load Wayland support [[default=maybe]]]),
  3.1453 +                          , enable_wayland_shared=maybe)
  3.1454 +
  3.1455 +            dnl FIXME: Do BSD and OS X need special cases?
  3.1456 +            case "$host" in
  3.1457 +                *)
  3.1458 +                    wayland_client_lib=[`find_lib "libwayland-client.so.*" "$WAYLAND_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`]
  3.1459 +                    wayland_egl_lib=[`find_lib "libwayland-egl.so.*" "$WAYLAND_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`]
  3.1460 +                    if test x$wayland_egl_lib = x; then
  3.1461 +                        dnl This works in Ubuntu 13.10, maybe others
  3.1462 +                        wayland_egl_lib=[`find_lib "mesa-egl/libwayland-egl.so.*" "$WAYLAND_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`]
  3.1463 +                    fi
  3.1464 +                    wayland_cursor_lib=[`find_lib "libwayland-cursor.so.*" "$WAYLAND_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`]
  3.1465 +                    xkbcommon_lib=[`find_lib "libxkbcommon.so.*" "$WAYLAND_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`]
  3.1466 +                    ;;
  3.1467 +            esac
  3.1468 +
  3.1469 +            if test x$enable_wayland_shared = xmaybe; then
  3.1470 +                enable_wayland_shared=yes
  3.1471 +            fi
  3.1472 +            if test x$have_loadso != xyes && \
  3.1473 +               test x$enable_wayland_shared = xyes; then
  3.1474 +                AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic Wayland loading])
  3.1475 +                enable_wayland_shared=no
  3.1476 +            fi
  3.1477 +            if test x$have_loadso = xyes && \
  3.1478 +               test x$enable_wayland_shared = xyes && \
  3.1479 +               test x$wayland_client_lib != x && \
  3.1480 +               test x$wayland_egl_lib != x && \
  3.1481 +               test x$wayland_cursor_lib != x && \
  3.1482 +               test x$xkbcommon_lib != x; then
  3.1483 +                echo "-- dynamic libwayland-client -> $wayland_client_lib"
  3.1484 +                echo "-- dynamic libwayland-egl -> $wayland_egl_lib"
  3.1485 +                echo "-- dynamic libwayland-cursor -> $wayland_cursor_lib"
  3.1486 +                echo "-- dynamic libxkbcommon -> $xkbcommon_lib"
  3.1487 +                AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC, "$wayland_client_lib", [ ])
  3.1488 +                AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_EGL, "$wayland_egl_lib", [ ])
  3.1489 +                AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_CURSOR, "$wayland_cursor_lib", [ ])
  3.1490 +                AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_XKBCOMMON, "$xkbcommon_lib", [ ])
  3.1491 +                SUMMARY_video="${SUMMARY_video} wayland(dynamic)"
  3.1492 +            else
  3.1493 +                enable_wayland_shared=no
  3.1494 +                EXTRA_LDFLAGS="$EXTRA_LDFLAGS $WAYLAND_LIBS"
  3.1495 +                SUMMARY_video="${SUMMARY_video} wayland"
  3.1496 +            fi
  3.1497 +            have_video=yes
  3.1498 +        fi
  3.1499 +    fi
  3.1500 +}
  3.1501 +
  3.1502 +
  3.1503 +dnl Check for Native Client stuff
  3.1504 +CheckNativeClient()
  3.1505 +{
  3.1506 +        AC_TRY_COMPILE([
  3.1507 +          #if !defined(__native_client__)
  3.1508 +          #error "NO NACL"
  3.1509 +          #endif
  3.1510 +        ],[
  3.1511 +        ],[
  3.1512 +        AC_DEFINE(SDL_VIDEO_DRIVER_NACL, 1, [ ])
  3.1513 +        AC_DEFINE(SDL_AUDIO_DRIVER_NACL, 1, [ ])
  3.1514 +        AC_DEFINE(HAVE_POW, 1, [ ])
  3.1515 +        AC_DEFINE(HAVE_OPENGLES2, 1, [ ])
  3.1516 +        AC_DEFINE(SDL_VIDEO_OPENGL_ES2, 1, [ ])
  3.1517 +        AC_DEFINE(SDL_VIDEO_RENDER_OGL_ES2, 1, [ ])
  3.1518 +
  3.1519 +        SDL_LIBS="-lppapi_simple -lppapi_gles2 $SDL_LIBS"
  3.1520 +
  3.1521 +        SDLMAIN_SOURCES="$srcdir/src/main/nacl/*.c"
  3.1522 +        SOURCES="$SOURCES $srcdir/src/audio/nacl/*.c"
  3.1523 +        SUMMARY_audio="${SUMMARY_audio} nacl"
  3.1524 +        SOURCES="$SOURCES $srcdir/src/video/nacl/*.c"
  3.1525 +        SUMMARY_video="${SUMMARY_video} nacl opengles2"
  3.1526 +        ])
  3.1527 +}
  3.1528 +
  3.1529 +
  3.1530 +CheckRPI()
  3.1531 +{
  3.1532 +    AC_ARG_ENABLE(video-rpi,
  3.1533 +AS_HELP_STRING([--enable-video-rpi], [use Raspberry Pi video driver [[default=no]]]),
  3.1534 +                  , enable_video_rpi=no)
  3.1535 +    if test x$enable_video = xyes -a x$enable_video_rpi = xyes; then
  3.1536 +        PKG_CHECK_MODULES([RPI], [bcm_host brcmegl], video_rpi=yes, video_rpi=no)
  3.1537 +
  3.1538 +        if test x$video_rpi = xno; then
  3.1539 +            if test x$ARCH = xnetbsd; then
  3.1540 +                RPI_CFLAGS="-I/usr/pkg/include -I/usr/pkg/include/interface/vcos/pthreads -I/usr/pkg/include/interface/vmcs_host/linux"
  3.1541 +                RPI_LIBS="-Wl,-R/usr/pkg/lib -L/usr/pkg/lib -lbcm_host"
  3.1542 +            else
  3.1543 +                RPI_CFLAGS="-I/opt/vc/include -I/opt/vc/include/interface/vcos/pthreads -I/opt/vc/include/interface/vmcs_host/linux"
  3.1544 +                RPI_LIBS="-Wl,-rpath,/opt/vc/lib -L/opt/vc/lib -lbcm_host"
  3.1545 +            fi
  3.1546 +        fi
  3.1547 +
  3.1548 +        # Save the original compiler flags and libraries
  3.1549 +        ac_save_cflags="$CFLAGS"; ac_save_libs="$LIBS"
  3.1550 +
  3.1551 +        # Add the Raspberry Pi compiler flags and libraries
  3.1552 +        CFLAGS="$CFLAGS $RPI_CFLAGS"; LIBS="$LIBS $RPI_LIBS"
  3.1553 +
  3.1554 +        AC_MSG_CHECKING(for Raspberry Pi)
  3.1555 +        have_video_rpi=no
  3.1556 +        AC_TRY_LINK([
  3.1557 +          #include <bcm_host.h>
  3.1558 +        ],[
  3.1559 +          bcm_host_init();
  3.1560 +        ],[
  3.1561 +        have_video_rpi=yes
  3.1562 +        ],[
  3.1563 +        ])
  3.1564 +        AC_MSG_RESULT($have_video_rpi)
  3.1565 +
  3.1566 +        # Restore the compiler flags and libraries
  3.1567 +        CFLAGS="$ac_save_cflags"; LIBS="$ac_save_libs"
  3.1568 +        
  3.1569 +        if test x$have_video_rpi = xyes; then
  3.1570 +            CFLAGS="$CFLAGS $RPI_CFLAGS"
  3.1571 +            SDL_CFLAGS="$SDL_CFLAGS $RPI_CFLAGS"
  3.1572 +            EXTRA_CFLAGS="$EXTRA_CFLAGS $RPI_CFLAGS"
  3.1573 +            EXTRA_LDFLAGS="$EXTRA_LDFLAGS $RPI_LIBS"
  3.1574 +            SOURCES="$SOURCES $srcdir/src/video/raspberry/*.c"
  3.1575 +            AC_DEFINE(SDL_VIDEO_DRIVER_RPI, 1, [ ])
  3.1576 +            SUMMARY_video="${SUMMARY_video} rpi"
  3.1577 +        fi
  3.1578 +    fi
  3.1579 +}
  3.1580 +
  3.1581 +dnl Find the X11 include and library directories
  3.1582 +CheckX11()
  3.1583 +{
  3.1584 +    AC_ARG_ENABLE(video-x11,
  3.1585 +AS_HELP_STRING([--enable-video-x11], [use X11 video driver [[default=yes]]]),
  3.1586 +                  , enable_video_x11=yes)
  3.1587 +    if test x$enable_video = xyes -a x$enable_video_x11 = xyes; then
  3.1588 +        case "$host" in
  3.1589 +            *-*-darwin*)
  3.1590 +                # This isn't necessary for X11, but fixes GLX detection
  3.1591 +                if test "x$x_includes" = xNONE && \
  3.1592 +                   test "x$x_libraries" = xNONE && \
  3.1593 +                   test -d /usr/X11R6/include && \
  3.1594 +                   test -d /usr/X11R6/lib; then
  3.1595 +                    x_includes="/usr/X11R6/include"
  3.1596 +                    x_libraries="/usr/X11R6/lib"
  3.1597 +                fi
  3.1598 +                ;;
  3.1599 +        esac
  3.1600 +        AC_PATH_X
  3.1601 +        AC_PATH_XTRA
  3.1602 +        if test x$have_x = xyes; then
  3.1603 +            AC_ARG_ENABLE(x11-shared,
  3.1604 +AS_HELP_STRING([--enable-x11-shared], [dynamically load X11 support [[default=maybe]]]),
  3.1605 +                          , enable_x11_shared=maybe)
  3.1606 +
  3.1607 +            case "$host" in
  3.1608 +                *-*-darwin*)
  3.1609 +                    x11_lib='/usr/X11R6/lib/libX11.6.dylib'
  3.1610 +                    x11ext_lib='/usr/X11R6/lib/libXext.6.dylib'
  3.1611 +                    xcursor_lib='/usr/X11R6/lib/libXcursor.1.dylib'
  3.1612 +                    xinerama_lib='/usr/X11R6/lib/libXinerama.1.dylib'
  3.1613 +                    xinput_lib='/usr/X11R6/lib/libXi.6.dylib'
  3.1614 +                    xrandr_lib='/usr/X11R6/lib/libXrandr.2.dylib'
  3.1615 +                    xrender_lib='/usr/X11R6/lib/libXrender.1.dylib'
  3.1616 +                    xss_lib='/usr/X11R6/lib/libXss.1.dylib'
  3.1617 +                    xvidmode_lib='/usr/X11R6/lib/libXxf86vm.1.dylib'
  3.1618 +                    ;;
  3.1619 +                *-*-openbsd*)
  3.1620 +                    x11_lib='libX11.so'
  3.1621 +                    x11ext_lib='libXext.so'
  3.1622 +                    xcursor_lib='libXcursor.so'
  3.1623 +                    xinerama_lib='libXinerama.so'
  3.1624 +                    xinput_lib='libXi.so'
  3.1625 +                    xrandr_lib='libXrandr.so'
  3.1626 +                    xrender_lib='libXrender.so'
  3.1627 +                    xss_lib='libXss.so'
  3.1628 +                    xvidmode_lib='libXxf86vm.so'
  3.1629 +                    ;;
  3.1630 +                *)
  3.1631 +                    x11_lib=[`find_lib "libX11.so.*" "$X_LIBS -L/usr/X11/$base_libdir -L/usr/X11R6/$base_libdir" | sed 's/.*\/\(.*\)/\1/; q'`]
  3.1632 +                    x11ext_lib=[`find_lib "libXext.so.*" "$X_LIBS -L/usr/X11/$base_libdir -L/usr/X11R6/$base_libdir" | sed 's/.*\/\(.*\)/\1/; q'`]
  3.1633 +                    xcursor_lib=[`find_lib "libXcursor.so.*" "$X_LIBS -L/usr/X11/$base_libdir -L/usr/X11R6/$base_libdir" | sed 's/.*\/\(.*\)/\1/; q'`]
  3.1634 +                    xinerama_lib=[`find_lib "libXinerama.so.*" "$X_LIBS -L/usr/X11/$base_libdir -L/usr/X11R6/$base_libdir" | sed 's/.*\/\(.*\)/\1/; q'`]
  3.1635 +                    xinput_lib=[`find_lib "libXi.so.*" "$X_LIBS -L/usr/X11/$base_libdir -L/usr/X11R6/$base_libdir" | sed 's/.*\/\(.*\)/\1/; q'`]
  3.1636 +                    xrandr_lib=[`find_lib "libXrandr.so.*" "$X_LIBS -L/usr/X11/$base_libdir -L/usr/X11R6/$base_libdir" | sed 's/.*\/\(.*\)/\1/; q'`]
  3.1637 +                    xrender_lib=[`find_lib "libXrender.so.*" "$X_LIBS -L/usr/X11/$base_libdir -L/usr/X11R6/$base_libdir" | sed 's/.*\/\(.*\)/\1/; q'`]
  3.1638 +                    xss_lib=[`find_lib "libXss.so.*" "$X_LIBS -L/usr/X11/$base_libdir -L/usr/X11R6/$base_libdir" | sed 's/.*\/\(.*\)/\1/; q'`]
  3.1639 +                    xvidmode_lib=[`find_lib "libXxf86vm.so.*" "$X_LIBS -L/usr/X11/$base_libdir -L/usr/X11R6/$base_libdir" | sed 's/.*\/\(.*\)/\1/; q'`]
  3.1640 +                    ;;
  3.1641 +            esac
  3.1642 +
  3.1643 +            if test x$ac_cv_func_shmat != xyes; then
  3.1644 +                X_CFLAGS="$X_CFLAGS -DNO_SHARED_MEMORY"
  3.1645 +            fi
  3.1646 +            CFLAGS="$CFLAGS $X_CFLAGS"
  3.1647 +            LDFLAGS="$LDFLAGS $X_LIBS"
  3.1648 +
  3.1649 +            AC_CHECK_HEADER(X11/extensions/Xext.h,
  3.1650 +                            have_xext_h_hdr=yes,
  3.1651 +                            have_xext_h_hdr=no,
  3.1652 +                            [#include <X11/Xlib.h>
  3.1653 +                             #include <X11/Xproto.h>
  3.1654 +                            ])
  3.1655 +            if test x$have_xext_h_hdr != xyes; then
  3.1656 +               AC_MSG_ERROR([
  3.1657 +*** Missing Xext.h, maybe you need to install the libxext-dev package?
  3.1658 +               ])
  3.1659 +            fi
  3.1660 +
  3.1661 +            AC_DEFINE(SDL_VIDEO_DRIVER_X11, 1, [ ])
  3.1662 +            SOURCES="$SOURCES $srcdir/src/video/x11/*.c"
  3.1663 +            EXTRA_CFLAGS="$EXTRA_CFLAGS $X_CFLAGS"
  3.1664 +
  3.1665 +            # Needed so SDL applications can include SDL_syswm.h
  3.1666 +            SDL_CFLAGS="$SDL_CFLAGS $X_CFLAGS"
  3.1667 +
  3.1668 +            if test x$enable_x11_shared = xmaybe; then
  3.1669 +                enable_x11_shared=yes
  3.1670 +            fi
  3.1671 +            if test x$have_loadso != xyes && \
  3.1672 +               test x$enable_x11_shared = xyes; then
  3.1673 +                AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic X11 loading])
  3.1674 +                enable_x11_shared=no
  3.1675 +            fi
  3.1676 +            if test x$have_loadso = xyes && \
  3.1677 +               test x$enable_x11_shared = xyes && test x$x11_lib != x && test x$x11ext_lib != x; then
  3.1678 +                echo "-- dynamic libX11 -> $x11_lib"
  3.1679 +                echo "-- dynamic libX11ext -> $x11ext_lib"
  3.1680 +                AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_X11_DYNAMIC, "$x11_lib", [ ])
  3.1681 +                AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_X11_DYNAMIC_XEXT, "$x11ext_lib", [ ])
  3.1682 +                SUMMARY_video="${SUMMARY_video} x11(dynamic)"
  3.1683 +            else
  3.1684 +                enable_x11_shared=no
  3.1685 +                EXTRA_LDFLAGS="$EXTRA_LDFLAGS $X_LIBS -lX11 -lXext"
  3.1686 +                SUMMARY_video="${SUMMARY_video} x11"
  3.1687 +            fi
  3.1688 +            have_video=yes
  3.1689 +
  3.1690 +            AC_MSG_CHECKING(for const parameter to XextAddDisplay)
  3.1691 +            have_const_param_XextAddDisplay=no
  3.1692 +            AC_TRY_COMPILE([
  3.1693 +              #include <X11/Xlib.h>
  3.1694 +              #include <X11/Xproto.h>
  3.1695 +              #include <X11/extensions/Xext.h>
  3.1696 +              #include <X11/extensions/extutil.h>
  3.1697 +              extern XExtDisplayInfo* XextAddDisplay(XExtensionInfo* a,Display* b,_Xconst char* c,XExtensionHooks* d,int e,XPointer f);
  3.1698 +            ],[
  3.1699 +            ],[
  3.1700 +            have_const_param_XextAddDisplay=yes
  3.1701 +            AC_DEFINE([SDL_VIDEO_DRIVER_X11_CONST_PARAM_XEXTADDDISPLAY], 1, [ ])
  3.1702 +            ])
  3.1703 +            AC_MSG_RESULT($have_const_param_XextAddDisplay)
  3.1704 +
  3.1705 +            dnl AC_CHECK_LIB(X11, XGetEventData, AC_DEFINE(SDL_VIDEO_DRIVER_X11_SUPPORTS_GENERIC_EVENTS, 1, [Have XGenericEvent]))
  3.1706 +            AC_MSG_CHECKING([for XGenericEvent])
  3.1707 +            have_XGenericEvent=no
  3.1708 +            AC_TRY_COMPILE([
  3.1709 +                #include <X11/Xlib.h>
  3.1710 +            ],[
  3.1711 +Display *display;
  3.1712 +XEvent event;
  3.1713 +XGenericEventCookie *cookie = &event.xcookie;
  3.1714 +XNextEvent(display, &event);
  3.1715 +XGetEventData(display, cookie);
  3.1716 +XFreeEventData(display, cookie);
  3.1717 +            ],[
  3.1718 +                have_XGenericEvent=yes
  3.1719 +                AC_DEFINE([SDL_VIDEO_DRIVER_X11_SUPPORTS_GENERIC_EVENTS], 1, [ ])
  3.1720 +            ])
  3.1721 +            AC_MSG_RESULT($have_XGenericEvent)
  3.1722 +
  3.1723 +            AC_CHECK_LIB(X11, XkbKeycodeToKeysym, AC_DEFINE(SDL_VIDEO_DRIVER_X11_HAS_XKBKEYCODETOKEYSYM, 1, [Have XkbKeycodeToKeysym]))
  3.1724 +
  3.1725 +            AC_ARG_ENABLE(video-x11-xcursor,
  3.1726 +AS_HELP_STRING([--enable-video-x11-xcursor], [enable X11 Xcursor support [[default=yes]]]),
  3.1727 +                            , enable_video_x11_xcursor=yes)
  3.1728 +            if test x$enable_video_x11_xcursor = xyes; then
  3.1729 +                definitely_enable_video_x11_xcursor=no
  3.1730 +                AC_CHECK_HEADER(X11/Xcursor/Xcursor.h,
  3.1731 +                                have_xcursor_h_hdr=yes,
  3.1732 +                                have_xcursor_h_hdr=no,
  3.1733 +                                [#include <X11/Xlib.h>
  3.1734 +                                ])
  3.1735 +                if test x$have_xcursor_h_hdr = xyes; then
  3.1736 +                    if test x$enable_x11_shared = xyes && test x$xcursor_lib != x ; then
  3.1737 +                        echo "-- dynamic libXcursor -> $xcursor_lib"
  3.1738 +                        AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_X11_DYNAMIC_XCURSOR, "$xcursor_lib", [ ])
  3.1739 +                        definitely_enable_video_x11_xcursor=yes
  3.1740 +                    else
  3.1741 +                        AC_CHECK_LIB(Xcursor, XcursorImageCreate, have_xcursor_lib=yes)
  3.1742 +                        if test x$have_xcursor_lib = xyes ; then
  3.1743 +                            EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lXcursor"
  3.1744 +                            definitely_enable_video_x11_xcursor=yes
  3.1745 +                        fi
  3.1746 +                    fi
  3.1747 +                fi
  3.1748 +            fi
  3.1749 +            if test x$definitely_enable_video_x11_xcursor = xyes; then
  3.1750 +                AC_DEFINE(SDL_VIDEO_DRIVER_X11_XCURSOR, 1, [ ])
  3.1751 +                SUMMARY_video_x11="${SUMMARY_video_x11} xcursor"
  3.1752 +            fi
  3.1753 +            AC_ARG_ENABLE(video-x11-xdbe,
  3.1754 +AS_HELP_STRING([--enable-video-x11-xdbe], [enable X11 Xdbe support [[default=yes]]]),
  3.1755 +                            , enable_video_x11_xdbe=yes)
  3.1756 +            if test x$enable_video_x11_xdbe = xyes; then
  3.1757 +                AC_CHECK_HEADER(X11/extensions/Xdbe.h,
  3.1758 +                                have_dbe_h_hdr=yes,
  3.1759 +                                have_dbe_h_hdr=no,
  3.1760 +                                [#include <X11/Xlib.h>
  3.1761 +                                ])
  3.1762 +                if test x$have_dbe_h_hdr = xyes; then
  3.1763 +                    AC_DEFINE(SDL_VIDEO_DRIVER_X11_XDBE, 1, [ ])
  3.1764 +                    SUMMARY_video_x11="${SUMMARY_video_x11} xdbe"
  3.1765 +                fi
  3.1766 +            fi
  3.1767 +            AC_ARG_ENABLE(video-x11-xinerama,
  3.1768 +AS_HELP_STRING([--enable-video-x11-xinerama], [enable X11 Xinerama support [[default=yes]]]),
  3.1769 +                            , enable_video_x11_xinerama=yes)
  3.1770 +            if test x$enable_video_x11_xinerama = xyes; then
  3.1771 +                definitely_enable_video_x11_xinerama=no
  3.1772 +                AC_CHECK_HEADER(X11/extensions/Xinerama.h,
  3.1773 +                                have_xinerama_h_hdr=yes,
  3.1774 +                                have_xinerama_h_hdr=no,
  3.1775 +                                [#include <X11/Xlib.h>
  3.1776 +                                ])
  3.1777 +                if test x$have_xinerama_h_hdr = xyes; then
  3.1778 +                    if test x$enable_x11_shared = xyes && test x$xinerama_lib != x ; then
  3.1779 +                        echo "-- dynamic libXinerama -> $xinerama_lib"
  3.1780 +                        AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_X11_DYNAMIC_XINERAMA, "$xinerama_lib", [ ])
  3.1781 +                        definitely_enable_video_x11_xinerama=yes
  3.1782 +                    else
  3.1783 +                        AC_CHECK_LIB(Xinerama, XineramaQueryExtension, have_xinerama_lib=yes)
  3.1784 +                        if test x$have_xinerama_lib = xyes ; then
  3.1785 +                            EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lXinerama"
  3.1786 +                            definitely_enable_video_x11_xinerama=yes
  3.1787 +                        fi
  3.1788 +                    fi
  3.1789 +                fi
  3.1790 +            fi
  3.1791 +            if test x$definitely_enable_video_x11_xinerama = xyes; then
  3.1792 +                AC_DEFINE(SDL_VIDEO_DRIVER_X11_XINERAMA, 1, [ ])
  3.1793 +                SUMMARY_video_x11="${SUMMARY_video_x11} xinerama"
  3.1794 +            fi
  3.1795 +            AC_ARG_ENABLE(video-x11-xinput,
  3.1796 +AS_HELP_STRING([--enable-video-x11-xinput], [enable X11 XInput extension for manymouse, tablets, etc [[default=yes]]]),
  3.1797 +                            , enable_video_x11_xinput=yes)
  3.1798 +            if test x$enable_video_x11_xinput = xyes; then
  3.1799 +                definitely_enable_video_x11_xinput=no
  3.1800 +                AC_CHECK_HEADER(X11/extensions/XInput2.h,
  3.1801 +                                have_xinput_h_hdr=yes,
  3.1802 +                                have_xinput_h_hdr=no,
  3.1803 +                                [#include <X11/Xlib.h>
  3.1804 +                                ])
  3.1805 +                if test x$have_xinput_h_hdr = xyes; then
  3.1806 +                    if test x$enable_x11_shared = xyes && test x$xinput_lib != x ; then
  3.1807 +                        echo "-- dynamic libXi -> $xinput_lib"
  3.1808 +                        AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_X11_DYNAMIC_XINPUT2, "$xinput_lib", [ ])
  3.1809 +                        definitely_enable_video_x11_xinput=yes
  3.1810 +                    else
  3.1811 +                        AC_CHECK_LIB(Xi, XOpenDevice, have_xinput_lib=yes)
  3.1812 +                        if test x$have_xinput_lib = xyes ; then
  3.1813 +                            EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lXi"
  3.1814 +                            definitely_enable_video_x11_xinput=yes
  3.1815 +                        fi
  3.1816 +                    fi
  3.1817 +                fi
  3.1818 +            fi
  3.1819 +            if test x$definitely_enable_video_x11_xinput = xyes; then
  3.1820 +                SUMMARY_video_x11="${SUMMARY_video_x11} xinput2"
  3.1821 +                AC_DEFINE(SDL_VIDEO_DRIVER_X11_XINPUT2, 1, [ ])
  3.1822 +                AC_MSG_CHECKING(for xinput2 multitouch)
  3.1823 +                have_xinput2_multitouch=no
  3.1824 +                AC_TRY_COMPILE([
  3.1825 +                    #include <X11/Xlib.h>
  3.1826 +                    #include <X11/Xproto.h>
  3.1827 +                    #include <X11/extensions/XInput2.h>
  3.1828 +                    ],[
  3.1829 +int event_type = XI_TouchBegin;
  3.1830 +XITouchClassInfo *t;
  3.1831 +                    ],[
  3.1832 +                    have_xinput2_multitouch=yes
  3.1833 +                    AC_DEFINE([SDL_VIDEO_DRIVER_X11_XINPUT2_SUPPORTS_MULTITOUCH], 1, [])
  3.1834 +                    SUMMARY_video_x11="${SUMMARY_video_x11} xinput2_multitouch"
  3.1835 +                    ])
  3.1836 +                AC_MSG_RESULT($have_xinput2_multitouch)
  3.1837 +            fi
  3.1838 +            AC_ARG_ENABLE(video-x11-xrandr,
  3.1839 +AS_HELP_STRING([--enable-video-x11-xrandr], [enable X11 Xrandr extension for fullscreen [[default=yes]]]),
  3.1840 +                            , enable_video_x11_xrandr=yes)
  3.1841 +            if test x$enable_video_x11_xrandr = xyes; then
  3.1842 +                dnl XRRScreenResources is only present in Xrandr >= 1.2, we use that as a test.
  3.1843 +                definitely_enable_video_x11_xrandr=no
  3.1844 +                have_xrandr_h_hdr=no
  3.1845 +                AC_TRY_COMPILE([
  3.1846 +                #include <X11/Xlib.h>
  3.1847 +                #include <X11/extensions/Xrandr.h>
  3.1848 +                ],[
  3.1849 +                XRRScreenResources *res = NULL;
  3.1850 +                ],[
  3.1851 +                have_xrandr_h_hdr=yes
  3.1852 +                ])
  3.1853 +                if test x$have_xrandr_h_hdr = xyes; then
  3.1854 +                    if test x$enable_x11_shared = xyes && test x$xrandr_lib != x ; then
  3.1855 +                        echo "-- dynamic libXrandr -> $xrandr_lib"
  3.1856 +                        AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_X11_DYNAMIC_XRANDR, "$xrandr_lib", [ ])
  3.1857 +                        definitely_enable_video_x11_xrandr=yes
  3.1858 +                    else
  3.1859 +                        AC_CHECK_LIB(Xrandr, XRRQueryExtension, have_xrandr_lib=yes)
  3.1860 +                        if test x$have_xrandr_lib = xyes ; then
  3.1861 +                            EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lXrandr"
  3.1862 +                            definitely_enable_video_x11_xrandr=yes
  3.1863 +                        fi
  3.1864 +                    fi
  3.1865 +                fi
  3.1866 +            fi
  3.1867 +            if test x$definitely_enable_video_x11_xrandr = xyes; then
  3.1868 +                AC_DEFINE(SDL_VIDEO_DRIVER_X11_XRANDR, 1, [ ])
  3.1869 +                SUMMARY_video_x11="${SUMMARY_video_x11} xrandr"
  3.1870 +            fi
  3.1871 +            AC_ARG_ENABLE(video-x11-scrnsaver,
  3.1872 +AS_HELP_STRING([--enable-video-x11-scrnsaver], [enable X11 screensaver extension [[default=yes]]]),
  3.1873 +                            , enable_video_x11_scrnsaver=yes)
  3.1874 +            if test x$enable_video_x11_scrnsaver = xyes; then
  3.1875 +                AC_CHECK_HEADER(X11/extensions/scrnsaver.h,
  3.1876 +                                have_scrnsaver_h_hdr=yes,
  3.1877 +                                have_scrnsaver_h_hdr=no,
  3.1878 +                                [#include <X11/Xlib.h>
  3.1879 +                                ])
  3.1880 +                if test x$have_scrnsaver_h_hdr = xyes; then
  3.1881 +                    if test x$enable_x11_shared = xyes && test x$xss_lib != x ; then
  3.1882 +                        echo "-- dynamic libXss -> $xss_lib"
  3.1883 +                        AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_X11_DYNAMIC_XSS, "$xss_lib", [ ])
  3.1884 +                        definitely_enable_video_x11_scrnsaver=yes
  3.1885 +                    else
  3.1886 +                        AC_CHECK_LIB(Xss, XScreenSaverSuspend, have_xss_lib=yes)
  3.1887 +                        if test x$have_xss_lib = xyes ; then
  3.1888 +                            EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lXss"
  3.1889 +                            definitely_enable_video_x11_scrnsaver=yes
  3.1890 +                        fi
  3.1891 +                    fi
  3.1892 +                fi
  3.1893 +            fi
  3.1894 +            if test x$definitely_enable_video_x11_scrnsaver = xyes; then
  3.1895 +                AC_DEFINE(SDL_VIDEO_DRIVER_X11_XSCRNSAVER, 1, [ ])
  3.1896 +                SUMMARY_video_x11="${SUMMARY_video_x11} xscrnsaver"
  3.1897 +            fi
  3.1898 +            AC_ARG_ENABLE(video-x11-xshape,
  3.1899 +AS_HELP_STRING([--enable-video-x11-xshape], [enable X11 XShape support [[default=yes]]]),
  3.1900 +                            , enable_video_x11_xshape=yes)
  3.1901 +            if test x$enable_video_x11_xshape = xyes; then
  3.1902 +                AC_CHECK_HEADER(X11/extensions/shape.h,
  3.1903 +                                have_shape_h_hdr=yes,
  3.1904 +                                have_shape_h_hdr=no,
  3.1905 +                                [#include <X11/Xlib.h>
  3.1906 +                                ])
  3.1907 +                if test x$have_shape_h_hdr = xyes; then
  3.1908 +                    AC_DEFINE(SDL_VIDEO_DRIVER_X11_XSHAPE, 1, [ ])
  3.1909 +                    SUMMARY_video_x11="${SUMMARY_video_x11} xshape"
  3.1910 +                fi
  3.1911 +            fi
  3.1912 +            AC_ARG_ENABLE(video-x11-vm,
  3.1913 +AS_HELP_STRING([--enable-video-x11-vm], [use X11 VM extension for fullscreen [[default=yes]]]),
  3.1914 +                            , enable_video_x11_vm=yes)
  3.1915 +            if test x$enable_video_x11_vm = xyes; then
  3.1916 +                definitely_enable_video_x11_vm=no
  3.1917 +                AC_CHECK_HEADER(X11/extensions/xf86vmode.h,
  3.1918 +                                have_vm_h_hdr=yes,
  3.1919 +                                have_vm_h_hdr=no,
  3.1920 +                                [#include <X11/Xlib.h>
  3.1921 +                                ])
  3.1922 +                if test x$have_vm_h_hdr = xyes; then
  3.1923 +                    if test x$enable_x11_shared = xyes && test x$xvidmode_lib != x ; then
  3.1924 +                        echo "-- dynamic libXxf86vm -> $xvidmode_lib"
  3.1925 +                        AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_X11_DYNAMIC_XVIDMODE, "$xvidmode_lib", [ ])
  3.1926 +                        definitely_enable_video_x11_vm=yes
  3.1927 +                    else
  3.1928 +                        AC_CHECK_LIB(Xxf86vm, XF86VidModeQueryVersion, have_vm_lib=yes)
  3.1929 +                        if test x$have_vm_lib = xyes ; then
  3.1930 +                            EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lXxf86vm"
  3.1931 +                            definitely_enable_video_x11_vm=yes
  3.1932 +                        fi
  3.1933 +                    fi
  3.1934 +                fi
  3.1935 +            fi
  3.1936 +            if test x$definitely_enable_video_x11_vm = xyes; then
  3.1937 +                AC_DEFINE(SDL_VIDEO_DRIVER_X11_XVIDMODE, 1, [ ])
  3.1938 +                SUMMARY_video_x11="${SUMMARY_video_x11} xvidmode"
  3.1939 +            fi
  3.1940 +        fi
  3.1941 +    fi
  3.1942 +}
  3.1943 +
  3.1944 +dnl Set up the Vivante video driver if enabled
  3.1945 +CheckVivanteVideo()
  3.1946 +{
  3.1947 +    AC_ARG_ENABLE(video-vivante,
  3.1948 +AS_HELP_STRING([--enable-video-vivante], [use Vivante EGL video driver [[default=yes]]]),
  3.1949 +                  , enable_video_vivante=yes)
  3.1950 +    if test x$enable_video = xyes -a x$enable_video_vivante = xyes; then
  3.1951 +        AC_MSG_CHECKING(for Vivante VDK API)
  3.1952 +        have_vivante_vdk=no
  3.1953 +        AC_TRY_COMPILE([
  3.1954 +          #define LINUX
  3.1955 +          #define EGL_API_FB
  3.1956 +          #include <gc_vdk.h>
  3.1957 +        ],[
  3.1958 +        ],[
  3.1959 +        have_vivante_vdk=yes
  3.1960 +        ])
  3.1961 +        AC_MSG_RESULT($have_vivante_vdk)
  3.1962 +
  3.1963 +        AC_MSG_CHECKING(for Vivante FB API)
  3.1964 +        have_vivante_egl=no
  3.1965 +        AC_TRY_COMPILE([
  3.1966 +          #define LINUX
  3.1967 +          #define EGL_API_FB
  3.1968 +          #include <EGL/eglvivante.h>
  3.1969 +        ],[
  3.1970 +        ],[
  3.1971 +        have_vivante_egl=yes
  3.1972 +        ])
  3.1973 +        AC_MSG_RESULT($have_vivante_egl)
  3.1974 +
  3.1975 +        if test x$have_vivante_vdk = xyes -o x$have_vivante_egl = xyes; then
  3.1976 +            AC_DEFINE(SDL_VIDEO_DRIVER_VIVANTE, 1, [ ])
  3.1977 +            EXTRA_CFLAGS="$EXTRA_CFLAGS -DLINUX -DEGL_API_FB"
  3.1978 +            if test x$have_vivante_vdk = xyes; then
  3.1979 +                AC_DEFINE(SDL_VIDEO_DRIVER_VIVANTE_VDK, 1, [ ])
  3.1980 +                EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lVDK"
  3.1981 +            fi
  3.1982 +            SOURCES="$SOURCES $srcdir/src/video/vivante/*.c"
  3.1983 +            SUMMARY_video="${SUMMARY_video} vivante"
  3.1984 +            have_video=yes
  3.1985 +        fi
  3.1986 +    fi
  3.1987 +}
  3.1988 +
  3.1989 +dnl Set up the Haiku video driver if enabled
  3.1990 +CheckHaikuVideo()
  3.1991 +{
  3.1992 +    if test x$enable_video = xyes; then
  3.1993 +        AC_DEFINE(SDL_VIDEO_DRIVER_HAIKU, 1, [ ])
  3.1994 +        SOURCES="$SOURCES $srcdir/src/video/haiku/*.cc"
  3.1995 +        have_video=yes
  3.1996 +        SUMMARY_video="${SUMMARY_video} haiku"
  3.1997 +    fi
  3.1998 +}
  3.1999 +
  3.2000 +dnl Set up the Cocoa video driver for Mac OS X (but not Darwin)
  3.2001 +CheckCOCOA()
  3.2002 +{
  3.2003 +    AC_ARG_ENABLE(video-cocoa,
  3.2004 +AS_HELP_STRING([--enable-video-cocoa], [use Cocoa video driver [[default=yes]]]),
  3.2005 +                  , enable_video_cocoa=yes)
  3.2006 +    if test x$enable_video = xyes -a x$enable_video_cocoa = xyes; then
  3.2007 +        save_CFLAGS="$CFLAGS"
  3.2008 +        dnl Work around that we don't have Objective-C support in autoconf
  3.2009 +        CFLAGS="$CFLAGS -x objective-c"
  3.2010 +        AC_MSG_CHECKING(for Cocoa framework)
  3.2011 +        have_cocoa=no
  3.2012 +        AC_TRY_COMPILE([
  3.2013 +          #import <Cocoa/Cocoa.h>
  3.2014 +        ],[
  3.2015 +        ],[
  3.2016 +        have_cocoa=yes
  3.2017 +        ])
  3.2018 +        AC_MSG_RESULT($have_cocoa)
  3.2019 +        CFLAGS="$save_CFLAGS"
  3.2020 +        if test x$have_cocoa = xyes; then
  3.2021 +            AC_DEFINE(SDL_VIDEO_DRIVER_COCOA, 1, [ ])
  3.2022 +            SOURCES="$SOURCES $srcdir/src/video/cocoa/*.m"
  3.2023 +            SUMMARY_video="${SUMMARY_video} cocoa"
  3.2024 +            have_video=yes
  3.2025 +        fi
  3.2026 +    fi
  3.2027 +}
  3.2028 +
  3.2029 +CheckMETAL()
  3.2030 +{
  3.2031 +    AC_ARG_ENABLE(render-metal,
  3.2032 +AS_HELP_STRING([--enable-render-metal], [enable the Metal render driver [[default=yes]]]),
  3.2033 +                                , enable_render_metal=yes)
  3.2034 +    if test x$enable_render = xyes -a x$enable_render_metal = xyes; then
  3.2035 +        save_CFLAGS="$CFLAGS"
  3.2036 +        dnl Work around that we don't have Objective-C support in autoconf
  3.2037 +        CFLAGS="$CFLAGS -x objective-c"
  3.2038 +        AC_MSG_CHECKING(for Metal framework)
  3.2039 +        have_metal=no
  3.2040 +        AC_TRY_COMPILE([
  3.2041 +          #import <Cocoa/Cocoa.h>
  3.2042 +          #import <Metal/Metal.h>
  3.2043 +          #import <QuartzCore/CAMetalLayer.h>
  3.2044 +
  3.2045 +          #if !TARGET_CPU_X86_64
  3.2046 +          #error Metal doesn't work on this configuration
  3.2047 +          #endif
  3.2048 +        ],[
  3.2049 +        ],[
  3.2050 +        have_metal=yes
  3.2051 +        ])
  3.2052 +        CFLAGS="$save_CFLAGS"
  3.2053 +        AC_MSG_RESULT($have_metal)
  3.2054 +        if test x$have_metal = xyes; then
  3.2055 +            AC_DEFINE(SDL_VIDEO_RENDER_METAL, 1, [ ])
  3.2056 +            SOURCES="$SOURCES $srcdir/src/render/metal/*.m"
  3.2057 +            SUMMARY_video="${SUMMARY_video} metal"
  3.2058 +        else
  3.2059 +            enable_render_metal=no
  3.2060 +        fi
  3.2061 +    fi
  3.2062 +}
  3.2063 +
  3.2064 +
  3.2065 +dnl Find DirectFB
  3.2066 +CheckDirectFB()
  3.2067 +{
  3.2068 +    AC_ARG_ENABLE(video-directfb,
  3.2069 +AS_HELP_STRING([--enable-video-directfb], [use DirectFB video driver [[default=no]]]),
  3.2070 +                  , enable_video_directfb=no)
  3.2071 +    if test x$enable_video = xyes -a x$enable_video_directfb = xyes; then
  3.2072 +        PKG_CHECK_MODULES([DIRECTFB], [directfb >= 1.0.0], video_directfb=yes, video_directfb=no)
  3.2073 +
  3.2074 +        if test x$video_directfb = xyes; then
  3.2075 +            # SuSE 11.1 installs directfb-config without directfb-devel
  3.2076 +            save_CPPFLAGS="$CPPFLAGS"
  3.2077 +            CPPFLAGS="$CPPFLAGS $DIRECTFB_CFLAGS"
  3.2078 +            AC_CHECK_HEADER(directfb.h, have_directfb_hdr=yes, have_directfb_hdr=no)
  3.2079 +            CPPFLAGS="$save_CPPFLAGS"
  3.2080 +            video_directfb=$have_directfb_hdr
  3.2081 +        fi
  3.2082 +
  3.2083 +        if test x$video_directfb = xyes; then
  3.2084 +            AC_ARG_ENABLE(directfb-shared,
  3.2085 +AS_HELP_STRING([--enable-directfb-shared], [dynamically load directfb support [[default=yes]]]),
  3.2086 +                              , enable_directfb_shared=yes)
  3.2087 +
  3.2088 +            AC_DEFINE(SDL_VIDEO_DRIVER_DIRECTFB, 1, [ ])
  3.2089 +            AC_DEFINE(SDL_VIDEO_RENDER_DIRECTFB, 1, [ ])
  3.2090 +            SOURCES="$SOURCES $srcdir/src/video/directfb/*.c"
  3.2091 +            EXTRA_CFLAGS="$EXTRA_CFLAGS $DIRECTFB_CFLAGS"
  3.2092 +
  3.2093 +            AC_MSG_CHECKING(for directfb dynamic loading support)
  3.2094 +            directfb_shared=no
  3.2095 +            directfb_lib=[`find_lib "libdirectfb*.so.*" "$DIRECTFB_LIBS"`]
  3.2096 +            # | sed 's/.*\/\(.*\)/\1/; q'`]
  3.2097 +AC_MSG_WARN("directfb $directfb_lib")
  3.2098 +            if test x$have_loadso != xyes && \
  3.2099 +               test x$enable_directfb_shared = xyes; then
  3.2100 +                AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic directfb loading])
  3.2101 +            fi
  3.2102 +            if test x$have_loadso = xyes && \
  3.2103 +               test x$enable_directfb_shared = xyes && test x$directfb_lib != x; then
  3.2104 +                directfb_shared=yes
  3.2105 +                echo "-- $directfb_lib_spec -> $directfb_lib"
  3.2106 +                AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_DIRECTFB_DYNAMIC, "$directfb_lib", [ ])
  3.2107 +                SUMMARY_video="${SUMMARY_video} directfb(dynamic)"
  3.2108 +            else
  3.2109 +                EXTRA_LDFLAGS="$EXTRA_LDFLAGS $DIRECTFB_LIBS"
  3.2110 +                SUMMARY_video="${SUMMARY_video} directfb"
  3.2111 +            fi
  3.2112 +            AC_MSG_RESULT($directfb_shared)
  3.2113 +            SDL_CFLAGS="$SDL_CFLAGS $DIRECTFB_CFLAGS"
  3.2114 +            have_video=yes
  3.2115 +        fi
  3.2116 +    fi
  3.2117 +}
  3.2118 +
  3.2119 +dnl Find KMSDRM
  3.2120 +CheckKMSDRM()
  3.2121 +{
  3.2122 +    AC_ARG_ENABLE(video-kmsdrm,
  3.2123 +AS_HELP_STRING([--enable-video-kmsdrm], [use KMSDRM video driver [[default=no]]]),
  3.2124 +                  , enable_video_kmsdrm=no)
  3.2125 +
  3.2126 +    if test x$enable_video = xyes -a x$enable_video_kmsdrm = xyes; then
  3.2127 +        video_kmsdrm=no
  3.2128 +
  3.2129 +        PKG_CHECK_MODULES([LIBDRM], [libdrm >= 2.4.46], libdrm_avail=yes, libdrm_avail=no)
  3.2130 +        PKG_CHECK_MODULES([LIBGBM], [gbm >= 9.0.0], libgbm_avail=yes, libgbm_avail=no)
  3.2131 +
  3.2132 +        if test x$libdrm_avail = xyes -a x$libgbm_avail = xyes; then
  3.2133 +            video_kmsdrm=yes
  3.2134 +        fi
  3.2135 +
  3.2136 +        if test x$video_kmsdrm = xyes; then
  3.2137 +            AC_ARG_ENABLE(kmsdrm-shared,
  3.2138 +AS_HELP_STRING([--enable-kmsdrm-shared], [dynamically load kmsdrm support [[default=yes]]]),
  3.2139 +                , enable_kmsdrm_shared=yes)
  3.2140 +
  3.2141 +            AC_DEFINE(SDL_VIDEO_DRIVER_KMSDRM, 1, [ ])
  3.2142 +            SOURCES="$SOURCES $srcdir/src/video/kmsdrm/*.c"
  3.2143 +            EXTRA_CFLAGS="$EXTRA_CFLAGS $LIBDRM_CFLAGS $LIBGBM_CFLAGS"
  3.2144 +
  3.2145 +            AC_MSG_CHECKING(for kmsdrm dynamic loading support)
  3.2146 +            kmsdrm_shared=no
  3.2147 +            drm_lib=[`find_lib "libdrm.so.*" "$DRM_LIBS"`]
  3.2148 +            gbm_lib=[`find_lib "libgbm.so.*" "$DRM_LIBS"`]
  3.2149 +            if test x$have_loadso != xyes && \
  3.2150 +               test x$enable_kmsdrm_shared = xyes; then
  3.2151 +                AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic kmsdrm loading])
  3.2152 +            fi
  3.2153 +            if test x$have_loadso = xyes && \
  3.2154 +               test x$enable_kmsdrm_shared = xyes && test x$drm_lib != x && test x$gbm_lib != x; then
  3.2155 +                kmsdrm_shared=yes
  3.2156 +                AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_KMSDRM_DYNAMIC, "$drm_lib", [ ])
  3.2157 +                AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_KMSDRM_DYNAMIC_GBM, "$gbm_lib", [ ])
  3.2158 +                AC_DEFINE_UNQUOTED(HAVE_KMSDRM_SHARED, "TRUE", [ ])
  3.2159 +                SUMMARY_video="${SUMMARY_video} kmsdrm(dynamic)"
  3.2160 +            else
  3.2161 +                EXTRA_LDFLAGS="$EXTRA_LDFLAGS $LIBDRM_LIBS $LIBGBM_LIBS"
  3.2162 +                SUMMARY_video="${SUMMARY_video} kmsdrm"
  3.2163 +            fi
  3.2164 +            AC_MSG_RESULT($kmsdrm_shared)
  3.2165 +            have_video=yes
  3.2166 +        fi
  3.2167 +    fi
  3.2168 +}
  3.2169 +
  3.2170 +dnl rcg04172001 Set up the Null video driver.
  3.2171 +CheckDummyVideo()
  3.2172 +{
  3.2173 +    AC_ARG_ENABLE(video-dummy,
  3.2174 +AS_HELP_STRING([--enable-video-dummy], [use dummy video driver [[default=yes]]]),
  3.2175 +                  , enable_video_dummy=yes)
  3.2176 +    if test x$enable_video_dummy = xyes; then
  3.2177 +        AC_DEFINE(SDL_VIDEO_DRIVER_DUMMY, 1, [ ])
  3.2178 +        SOURCES="$SOURCES $srcdir/src/video/dummy/*.c"
  3.2179 +        have_video=yes
  3.2180 +        SUMMARY_video="${SUMMARY_video} dummy"
  3.2181 +    fi
  3.2182 +}
  3.2183 +
  3.2184 +dnl Set up the QNX video driver if enabled
  3.2185 +CheckQNXVideo()
  3.2186 +{
  3.2187 +    if test x$enable_video = xyes; then
  3.2188 +        AC_DEFINE(SDL_VIDEO_DRIVER_QNX, 1, [ ])
  3.2189 +        SOURCES="$SOURCES $srcdir/src/video/qnx/*.c"
  3.2190 +        have_video=yes
  3.2191 +        EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lscreen -lEGL -lGLESv2"
  3.2192 +        SUMMARY_video="${SUMMARY_video} qnx"
  3.2193 +    fi
  3.2194 +}
  3.2195 +
  3.2196 +dnl Set up the QNX audio driver if enabled
  3.2197 +CheckQNXAudio()
  3.2198 +{
  3.2199 +    if test x$enable_audio = xyes; then
  3.2200 +        AC_DEFINE(SDL_AUDIO_DRIVER_QSA, 1, [ ])
  3.2201 +        SOURCES="$SOURCES $srcdir/src/audio/qsa/*.c"
  3.2202 +        have_audio=yes
  3.2203 +        EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lasound"
  3.2204 +        SUMMARY_audio="${SUMMARY_audio} qsa"
  3.2205 +    fi
  3.2206 +}
  3.2207 +
  3.2208 +dnl Check to see if OpenGL support is desired
  3.2209 +AC_ARG_ENABLE(video-opengl,
  3.2210 +AS_HELP_STRING([--enable-video-opengl], [include OpenGL support [[default=yes]]]),
  3.2211 +              , enable_video_opengl=yes)
  3.2212 +
  3.2213 +dnl Find OpenGL
  3.2214 +CheckOpenGLX11()
  3.2215 +{
  3.2216 +    if test x$enable_video = xyes -a x$enable_video_opengl = xyes; then
  3.2217 +        AC_MSG_CHECKING(for OpenGL (GLX) support)
  3.2218 +        video_opengl=no
  3.2219 +        AC_TRY_COMPILE([
  3.2220 +         #include <GL/gl.h>
  3.2221 +         #include <GL/glx.h>
  3.2222 +        ],[
  3.2223 +        ],[
  3.2224 +        video_opengl=yes
  3.2225 +        ])
  3.2226 +        AC_MSG_RESULT($video_opengl)
  3.2227 +        if test x$video_opengl = xyes; then
  3.2228 +            AC_DEFINE(SDL_VIDEO_OPENGL, 1, [ ])
  3.2229 +            AC_DEFINE(SDL_VIDEO_OPENGL_GLX, 1, [ ])
  3.2230 +            AC_DEFINE(SDL_VIDEO_RENDER_OGL, 1, [ ])
  3.2231 +            SUMMARY_video="${SUMMARY_video} opengl"
  3.2232 +        fi
  3.2233 +    fi
  3.2234 +}
  3.2235 +
  3.2236 +dnl Check to see if OpenGL ES support is desired
  3.2237 +AC_ARG_ENABLE(video-opengles,
  3.2238 +AS_HELP_STRING([--enable-video-opengles], [include OpenGL ES support [[default=yes]]]),
  3.2239 +              , enable_video_opengles=yes)
  3.2240 +AC_ARG_ENABLE(video-opengles1,
  3.2241 +AS_HELP_STRING([--enable-video-opengles1], [include OpenGL ES 1.1 support [[default=yes]]]),
  3.2242 +              , enable_video_opengles1=yes)
  3.2243 +AC_ARG_ENABLE(video-opengles2,
  3.2244 +AS_HELP_STRING([--enable-video-opengles2], [include OpenGL ES 2.0 support [[default=yes]]]),
  3.2245 +              , enable_video_opengles2=yes)
  3.2246 +
  3.2247 +dnl Find OpenGL ES
  3.2248 +CheckOpenGLESX11()
  3.2249 +{
  3.2250 +    if test x$enable_video = xyes -a x$enable_video_opengles = xyes; then
  3.2251 +        AC_MSG_CHECKING(for EGL support)
  3.2252 +        video_opengl_egl=no
  3.2253 +        AC_TRY_COMPILE([
  3.2254 +          #define LINUX
  3.2255 +          #define EGL_API_FB
  3.2256 +          #define MESA_EGL_NO_X11_HEADERS
  3.2257 +          #include <EGL/egl.h>
  3.2258 +          #include <EGL/eglext.h>
  3.2259 +        ],[
  3.2260 +        ],[
  3.2261 +        video_opengl_egl=yes
  3.2262 +        ])
  3.2263 +        AC_MSG_RESULT($video_opengl_egl)
  3.2264 +        if test x$video_opengl_egl = xyes; then
  3.2265 +            AC_DEFINE(SDL_VIDEO_OPENGL_EGL, 1, [ ])
  3.2266 +        fi
  3.2267 +            
  3.2268 +        if test x$enable_video_opengles1 = xyes; then
  3.2269 +            AC_MSG_CHECKING(for OpenGL ES v1 headers)
  3.2270 +            video_opengles_v1=no
  3.2271 +            AC_TRY_COMPILE([
  3.2272 +             #include <GLES/gl.h>
  3.2273 +             #include <GLES/glext.h>
  3.2274 +            ],[
  3.2275 +            ],[
  3.2276 +            video_opengles_v1=yes
  3.2277 +            ])
  3.2278 +            AC_MSG_RESULT($video_opengles_v1)
  3.2279 +            if test x$video_opengles_v1 = xyes; then
  3.2280 +                AC_DEFINE(SDL_VIDEO_OPENGL_ES, 1, [ ])
  3.2281 +                AC_DEFINE(SDL_VIDEO_RENDER_OGL_ES, 1, [ ])
  3.2282 +                SUMMARY_video="${SUMMARY_video} opengl_es1"
  3.2283 +            fi
  3.2284 +        fi
  3.2285 +        
  3.2286 +        if test x$enable_video_opengles2 = xyes; then
  3.2287 +            AC_MSG_CHECKING(for OpenGL ES v2 headers)
  3.2288 +            video_opengles_v2=no
  3.2289 +            AC_TRY_COMPILE([
  3.2290 +             #include <GLES2/gl2.h>
  3.2291 +             #include <GLES2/gl2ext.h>
  3.2292 +            ],[
  3.2293 +            ],[
  3.2294 +            video_opengles_v2=yes
  3.2295 +            ])
  3.2296 +            AC_MSG_RESULT($video_opengles_v2)
  3.2297 +            if test x$video_opengles_v2 = xyes; then
  3.2298 +                AC_DEFINE(SDL_VIDEO_OPENGL_ES2, 1, [ ])
  3.2299 +                AC_DEFINE(SDL_VIDEO_RENDER_OGL_ES2, 1, [ ])
  3.2300 +                SUMMARY_video="${SUMMARY_video} opengl_es2"
  3.2301 +            fi
  3.2302 +        fi
  3.2303 +    fi
  3.2304 +}
  3.2305 +
  3.2306 +dnl Check for Windows OpenGL
  3.2307 +CheckWINDOWSGL()
  3.2308 +{
  3.2309 +    if test x$enable_video = xyes -a x$enable_video_opengl = xyes; then
  3.2310 +        AC_DEFINE(SDL_VIDEO_OPENGL, 1, [ ])
  3.2311 +        AC_DEFINE(SDL_VIDEO_OPENGL_WGL, 1, [ ])
  3.2312 +        AC_DEFINE(SDL_VIDEO_RENDER_OGL, 1, [ ])
  3.2313 +        SUMMARY_video="${SUMMARY_video} opengl"
  3.2314 +    fi
  3.2315 +}
  3.2316 +
  3.2317 +dnl Check for Windows OpenGL
  3.2318 +CheckWINDOWSGLES()
  3.2319 +{
  3.2320 +    if test x$enable_video = xyes -a x$enable_video_opengles = xyes; then
  3.2321 +
  3.2322 +        AC_MSG_CHECKING(for EGL support)
  3.2323 +        video_opengl_egl=no
  3.2324 +        AC_TRY_COMPILE([
  3.2325 +         #include <EGL/egl.h>
  3.2326 +        ],[
  3.2327 +        ],[
  3.2328 +        video_opengl_egl=yes
  3.2329 +        ])
  3.2330 +        AC_MSG_RESULT($video_opengl_egl)
  3.2331 +        if test x$video_opengl_egl = xyes; then
  3.2332 +            AC_DEFINE(SDL_VIDEO_OPENGL, 1, [ ])
  3.2333 +            AC_DEFINE(SDL_VIDEO_OPENGL_EGL, 1, [ ])
  3.2334 +            SUMMARY_video="${SUMMARY_video} opengl_es1"
  3.2335 +        fi
  3.2336 +       
  3.2337 +        AC_MSG_CHECKING(for OpenGL ES v2 headers)
  3.2338 +        video_opengles_v2=no
  3.2339 +        AC_TRY_COMPILE([
  3.2340 +         #include <GLES2/gl2.h>
  3.2341 +         #include <GLES2/gl2ext.h>
  3.2342 +        ],[
  3.2343 +        ],[
  3.2344 +        video_opengles_v2=yes
  3.2345 +        ])
  3.2346 +        AC_MSG_RESULT($video_opengles_v2)
  3.2347 +        if test x$video_opengles_v2 = xyes; then
  3.2348 +            AC_DEFINE(SDL_VIDEO_OPENGL, 1, [ ])
  3.2349 +            AC_DEFINE(SDL_VIDEO_OPENGL_ES2, 1, [ ])
  3.2350 +            AC_DEFINE(SDL_VIDEO_RENDER_OGL_ES2, 1, [ ])
  3.2351 +            SUMMARY_video="${SUMMARY_video} opengl_es2"
  3.2352 +        fi
  3.2353 +    fi
  3.2354 +}
  3.2355 +
  3.2356 +dnl Check for Haiku OpenGL
  3.2357 +CheckHaikuGL()
  3.2358 +{
  3.2359 +    if test x$enable_video = xyes -a x$enable_video_opengl = xyes; then
  3.2360 +        AC_DEFINE(SDL_VIDEO_OPENGL, 1, [ ])
  3.2361 +        AC_DEFINE(SDL_VIDEO_OPENGL_HAIKU, 1, [ ])
  3.2362 +        AC_DEFINE(SDL_VIDEO_RENDER_OGL, 1, [ ])
  3.2363 +        EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lGL"
  3.2364 +        SUMMARY_video="${SUMMARY_video} opengl"
  3.2365 +    fi
  3.2366 +}
  3.2367 +
  3.2368 +dnl Check for MacOS OpenGL
  3.2369 +CheckMacGL()
  3.2370 +{
  3.2371 +    if test x$enable_video = xyes -a x$enable_video_opengl = xyes; then
  3.2372 +        AC_DEFINE(SDL_VIDEO_OPENGL, 1, [ ])
  3.2373 +        AC_DEFINE(SDL_VIDEO_OPENGL_CGL, 1, [ ])
  3.2374 +        AC_DEFINE(SDL_VIDEO_RENDER_OGL, 1, [ ])
  3.2375 +        SUMMARY_video="${SUMMARY_video} opengl"
  3.2376 +    fi
  3.2377 +}
  3.2378 +
  3.2379 +dnl Check for MacOS OpenGLES
  3.2380 +CheckMacGLES()
  3.2381 +{
  3.2382 +    if test x$enable_video = xyes -a x$enable_video_opengles = xyes; then
  3.2383 +        video_opengl_egl=yes
  3.2384 +        AC_DEFINE(SDL_VIDEO_OPENGL_EGL, 1, [ ])
  3.2385 +        video_opengles_v2=yes
  3.2386 +        AC_DEFINE(SDL_VIDEO_OPENGL_ES2, 1, [ ])
  3.2387 +        AC_DEFINE(SDL_VIDEO_RENDER_OGL_ES2, 1, [ ])
  3.2388 +        SUMMARY_video="${SUMMARY_video} opengl_es2"
  3.2389 +    fi
  3.2390 +}
  3.2391 +
  3.2392 +CheckEmscriptenGLES()
  3.2393 +{
  3.2394 +    if test x$enable_video = xyes -a x$enable_video_opengles = xyes; then
  3.2395 +        AC_MSG_CHECKING(for EGL support)
  3.2396 +        video_opengl_egl=no
  3.2397 +        AC_TRY_COMPILE([
  3.2398 +         #include <EGL/egl.h>
  3.2399 +        ],[
  3.2400 +        ],[
  3.2401 +        video_opengl_egl=yes
  3.2402 +        ])
  3.2403 +        AC_MSG_RESULT($video_opengl_egl)
  3.2404 +        if test x$video_opengl_egl = xyes; then
  3.2405 +            AC_DEFINE(SDL_VIDEO_OPENGL_EGL, 1, [ ])
  3.2406 +        fi
  3.2407 +
  3.2408 +        AC_MSG_CHECKING(for OpenGL ES v2 headers)
  3.2409 +        video_opengles_v2=no
  3.2410 +        AC_TRY_COMPILE([
  3.2411 +         #include <GLES2/gl2.h>
  3.2412 +         #include <GLES2/gl2ext.h>
  3.2413 +        ],[
  3.2414 +        ],[
  3.2415 +        video_opengles_v2=yes
  3.2416 +        ])
  3.2417 +        AC_MSG_RESULT($video_opengles_v2)
  3.2418 +        if test x$video_opengles_v2 = xyes; then
  3.2419 +            AC_DEFINE(SDL_VIDEO_OPENGL_ES2, 1, [ ])
  3.2420 +            AC_DEFINE(SDL_VIDEO_RENDER_OGL_ES2, 1, [ ])
  3.2421 +            SUMMARY_video="${SUMMARY_video} opengl_es2"
  3.2422 +        fi
  3.2423 +    fi
  3.2424 +}
  3.2425 +
  3.2426 +dnl Check to see if Vulkan support is desired
  3.2427 +AC_ARG_ENABLE(video-vulkan,
  3.2428 +AS_HELP_STRING([--enable-video-vulkan], [include Vulkan support [[default=yes]]]),
  3.2429 +              , enable_video_vulkan=yes)
  3.2430 +
  3.2431 +dnl Find Vulkan Header
  3.2432 +CheckVulkan()
  3.2433 +{
  3.2434 +    if test x$enable_video = xyes -a x$enable_video_vulkan = xyes; then
  3.2435 +        case "$host" in
  3.2436 +            *-*-android*)
  3.2437 +                AC_TRY_COMPILE([
  3.2438 +                  #if defined(__ARM_ARCH) && __ARM_ARCH < 7
  3.2439 +                  #error Vulkan doesn't work on this configuration
  3.2440 +                  #endif
  3.2441 +                ],[
  3.2442 +                ],[
  3.2443 +                ],[
  3.2444 +                    enable_video_vulkan=no
  3.2445 +                ])
  3.2446 +                ;;
  3.2447 +            *-*-darwin*)
  3.2448 +                save_CFLAGS="$CFLAGS"
  3.2449 +                dnl Work around that we don't have Objective-C support in autoconf
  3.2450 +                CFLAGS="$CFLAGS -x objective-c"
  3.2451 +                AC_TRY_COMPILE([
  3.2452 +                  #include <Cocoa/Cocoa.h>
  3.2453 +                  #include <Metal/Metal.h>
  3.2454 +                  #include <QuartzCore/CAMetalLayer.h>
  3.2455 +
  3.2456 +                  #if !TARGET_CPU_X86_64
  3.2457 +                  #error Vulkan doesn't work on this configuration
  3.2458 +                  #endif
  3.2459 +                ],[
  3.2460 +                ],[
  3.2461 +                ],[
  3.2462 +                    enable_video_vulkan=no
  3.2463 +                ])
  3.2464 +                CFLAGS="$save_CFLAGS"
  3.2465 +                ;;
  3.2466 +            *)
  3.2467 +                ;;
  3.2468 +        esac
  3.2469 +        if test x$enable_video_vulkan = xno; then
  3.2470 +            # For reasons I am totally unable to see, I get an undefined macro error if
  3.2471 +            # I put this in the AC_TRY_COMPILE.
  3.2472 +            AC_MSG_WARN([Vulkan does not work on this configuration.])
  3.2473 +        fi
  3.2474 +    fi
  3.2475 +    if test x$enable_video_vulkan = xyes; then
  3.2476 +        AC_DEFINE(SDL_VIDEO_VULKAN, 1, [ ])
  3.2477 +        SUMMARY_video="${SUMMARY_video} vulkan"
  3.2478 +    fi
  3.2479 +}
  3.2480 +
  3.2481 +dnl See if we can use the new unified event interface in Linux 2.4
  3.2482 +CheckInputEvents()
  3.2483 +{
  3.2484 +    dnl Check for Linux 2.4 unified input event interface support
  3.2485 +        AC_MSG_CHECKING(for Linux 2.4 unified input interface)
  3.2486 +        use_input_events=no
  3.2487 +        AC_TRY_COMPILE([
  3.2488 +          #include <linux/input.h>
  3.2489 +        ],[
  3.2490 +          #ifndef EVIOCGNAME
  3.2491 +          #error EVIOCGNAME() ioctl not available
  3.2492 +          #endif
  3.2493 +        ],[
  3.2494 +        use_input_events=yes
  3.2495 +        ])
  3.2496 +        AC_MSG_RESULT($use_input_events)
  3.2497 +        if test x$use_input_events = xyes; then
  3.2498 +            AC_DEFINE(SDL_INPUT_LINUXEV, 1, [ ])
  3.2499 +            SUMMARY_input="${SUMMARY_input} linuxev"
  3.2500 +        fi
  3.2501 +}
  3.2502 +
  3.2503 +dnl See if we can use the kernel kd.h header
  3.2504 +CheckInputKD()
  3.2505 +{
  3.2506 +
  3.2507 +    AC_MSG_CHECKING(for Linux kd.h)
  3.2508 +    use_input_kd=no
  3.2509 +    AC_TRY_COMPILE([
  3.2510 +      #include <linux/kd.h>
  3.2511 +      #include <linux/keyboard.h>
  3.2512 +    ],[
  3.2513 +        struct kbentry kbe;
  3.2514 +        kbe.kb_table = KG_CTRL;
  3.2515 +        ioctl(0, KDGKBENT, &kbe);
  3.2516 +    ],[
  3.2517 +    use_input_kd=yes
  3.2518 +    ])
  3.2519 +    AC_MSG_RESULT($use_input_kd)
  3.2520 +    if test x$use_input_kd = xyes; then
  3.2521 +        AC_DEFINE(SDL_INPUT_LINUXKD, 1, [ ])
  3.2522 +        SUMMARY_input="${SUMMARY_input} linuxkd"
  3.2523 +    fi
  3.2524 +}
  3.2525 +
  3.2526 +dnl See if the platform offers libudev for device enumeration and hotplugging.
  3.2527 +CheckLibUDev()
  3.2528 +{
  3.2529 +    AC_ARG_ENABLE(libudev,
  3.2530 +AS_HELP_STRING([--enable-libudev], [enable libudev support [[default=yes]]]),
  3.2531 +                        , enable_libudev=yes)
  3.2532 +    if test x$enable_libudev = xyes; then
  3.2533 +        AC_CHECK_HEADER(libudev.h,
  3.2534 +                        have_libudev_h_hdr=yes,
  3.2535 +                        have_libudev_h_hdr=no)
  3.2536 +        if test x$have_libudev_h_hdr = xyes; then
  3.2537 +            AC_DEFINE(HAVE_LIBUDEV_H, 1, [ ])
  3.2538 +
  3.2539 +            udev_lib=[`find_lib "libudev.so.*" "" | sed 's/.*\/\(.*\)/\1/; q'`]
  3.2540 +            if test x$udev_lib != x; then
  3.2541 +                echo "-- dynamic udev -> $udev_lib"
  3.2542 +                AC_DEFINE_UNQUOTED(SDL_UDEV_DYNAMIC, "$udev_lib", [ ])
  3.2543 +            fi
  3.2544 +        fi
  3.2545 +    fi
  3.2546 +}
  3.2547 +
  3.2548 +dnl See if the platform offers libdbus for various IPC techniques.
  3.2549 +CheckDBus()
  3.2550 +{
  3.2551 +    AC_ARG_ENABLE(dbus,
  3.2552 +AS_HELP_STRING([--enable-dbus], [enable D-Bus support [[default=yes]]]),
  3.2553 +                        , enable_dbus=yes)
  3.2554 +    if test x$enable_dbus = xyes; then
  3.2555 +        PKG_CHECK_MODULES([DBUS], [dbus-1], have_dbus=yes, have_dbus=no)
  3.2556 +        save_CFLAGS="$CFLAGS"
  3.2557 +        CFLAGS="$save_CFLAGS $DBUS_CFLAGS"
  3.2558 +        AC_CHECK_HEADER(dbus/dbus.h,
  3.2559 +                        have_dbus_dbus_h_hdr=yes,
  3.2560 +                        have_dbus_dbus_h_hdr=no)
  3.2561 +        CFLAGS="$save_CFLAGS"
  3.2562 +        if test x$have_dbus_dbus_h_hdr = xyes; then
  3.2563 +            AC_DEFINE(HAVE_DBUS_DBUS_H, 1, [ ])
  3.2564 +            EXTRA_CFLAGS="$EXTRA_CFLAGS $DBUS_CFLAGS"
  3.2565 +            SOURCES="$SOURCES $srcdir/src/core/linux/SDL_dbus.c"
  3.2566 +        fi
  3.2567 +    fi
  3.2568 +}
  3.2569 +
  3.2570 +dnl See if the platform wanna IME support.
  3.2571 +CheckIME()
  3.2572 +{
  3.2573 +    AC_ARG_ENABLE(ime,
  3.2574 +AS_HELP_STRING([--enable-ime], [enable IME support [[default=yes]]]),
  3.2575 +                  , enable_ime=yes)
  3.2576 +    if test x$enable_ime = xyes; then
  3.2577 +        AC_DEFINE(SDL_USE_IME, 1, [ ])
  3.2578 +            SOURCES="$SOURCES $srcdir/src/core/linux/SDL_ime.c"
  3.2579 +    fi
  3.2580 +}
  3.2581 +
  3.2582 +dnl See if the platform has libibus IME support.
  3.2583 +CheckIBus()
  3.2584 +{
  3.2585 +    AC_ARG_ENABLE(ibus,
  3.2586 +AS_HELP_STRING([--enable-ibus], [enable IBus support [[default=yes]]]),
  3.2587 +                  , enable_ibus=yes)
  3.2588 +    if test x$enable_ibus = xyes; then
  3.2589 +        PKG_CHECK_MODULES([IBUS], [ibus-1.0], have_ibus=yes, have_ibus=no)
  3.2590 +        save_CFLAGS="$CFLAGS"
  3.2591 +        CFLAGS="$save_CFLAGS $IBUS_CFLAGS"
  3.2592 +        AC_CHECK_HEADER(ibus-1.0/ibus.h,
  3.2593 +                        have_ibus_ibus_h_hdr=yes,
  3.2594 +                        have_ibus_ibus_h_hdr=no)
  3.2595 +        AC_CHECK_HEADER(sys/inotify.h,
  3.2596 +                        have_inotify_inotify_h_hdr=yes,
  3.2597 +                        have_inotify_inotify_h_hdr=no)
  3.2598 +        CFLAGS="$save_CFLAGS"
  3.2599 +        if test x$have_ibus_ibus_h_hdr = xyes; then
  3.2600 +            if test x$enable_ime != xyes; then
  3.2601 +                AC_MSG_WARN([IME support is required for IBus.])
  3.2602 +                have_ibus_ibus_h_hdr=no
  3.2603 +            elif test x$enable_dbus != xyes; then
  3.2604 +                AC_MSG_WARN([DBus support is required for IBus.])
  3.2605 +                have_ibus_ibus_h_hdr=no
  3.2606 +            elif test x$have_inotify_inotify_h_hdr != xyes; then
  3.2607 +                AC_MSG_WARN([INotify support is required for IBus.])
  3.2608 +                have_ibus_ibus_h_hdr=no
  3.2609 +            else
  3.2610 +                AC_DEFINE(HAVE_IBUS_IBUS_H, 1, [ ])
  3.2611 +                EXTRA_CFLAGS="$EXTRA_CFLAGS $IBUS_CFLAGS"
  3.2612 +                SOURCES="$SOURCES $srcdir/src/core/linux/SDL_ibus.c"
  3.2613 +            fi
  3.2614 +        fi
  3.2615 +    fi
  3.2616 +}
  3.2617 +
  3.2618 +dnl See if the platform has fcitx IME support.
  3.2619 +CheckFcitx()
  3.2620 +{
  3.2621 +    AC_ARG_ENABLE(fcitx,
  3.2622 +AS_HELP_STRING([--enable-fcitx], [enable fcitx support [[default=yes]]]),
  3.2623 +                  , enable_fcitx=yes)
  3.2624 +    if test x$enable_fcitx = xyes; then
  3.2625 +        PKG_CHECK_MODULES([FCITX], [fcitx], have_fcitx=yes, have_fcitx=no)
  3.2626 +        CFLAGS="$CFLAGS $FCITX_CFLAGS"
  3.2627 +        AC_CHECK_HEADER(fcitx/frontend.h,
  3.2628 +                        have_fcitx_frontend_h_hdr=yes,
  3.2629 +                        have_fcitx_frontend_h_hdr=no)
  3.2630 +        CFLAGS="$save_CFLAGS"
  3.2631 +        if test x$have_fcitx_frontend_h_hdr = xyes; then
  3.2632 +            if test x$enable_ime != xyes; then
  3.2633 +                AC_MSG_WARN([IME support is required for fcitx.])
  3.2634 +                have_fcitx_frontend_h_hdr=no
  3.2635 +            elif test x$enable_dbus != xyes; then
  3.2636 +                AC_MSG_WARN([DBus support is required for fcitx.])
  3.2637 +                have_fcitx_frontend_h_hdr=no
  3.2638 +            else
  3.2639 +                AC_DEFINE(HAVE_FCITX_FRONTEND_H, 1, [ ])
  3.2640 +                EXTRA_CFLAGS="$EXTRA_CFLAGS $FCITX_CFLAGS"
  3.2641 +                SOURCES="$SOURCES $srcdir/src/core/linux/SDL_fcitx.c"
  3.2642 +            fi
  3.2643 +        fi
  3.2644 +    fi
  3.2645 +}
  3.2646 +
  3.2647 +dnl See if we can use the Touchscreen input library
  3.2648 +CheckTslib()
  3.2649 +{
  3.2650 +    AC_ARG_ENABLE(input-tslib,
  3.2651 +AS_HELP_STRING([--enable-input-tslib], [use the Touchscreen library for input [[default=yes]]]),
  3.2652 +                  , enable_input_tslib=yes)
  3.2653 +    if test x$enable_input_tslib = xyes; then
  3.2654 +        AC_MSG_CHECKING(for Touchscreen library support)
  3.2655 +        enable_input_tslib=no
  3.2656 +        AC_TRY_COMPILE([
  3.2657 +          #include "tslib.h"
  3.2658 +        ],[
  3.2659 +        ],[
  3.2660 +        enable_input_tslib=yes
  3.2661 +        ])
  3.2662 +        AC_MSG_RESULT($enable_input_tslib)
  3.2663 +        if test x$enable_input_tslib = xyes; then
  3.2664 +            AC_DEFINE(SDL_INPUT_TSLIB, 1, [ ])
  3.2665 +            EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lts"
  3.2666 +            SUMMARY_input="${SUMMARY_input} ts"
  3.2667 +        fi
  3.2668 +    fi
  3.2669 +}
  3.2670 +
  3.2671 +dnl See what type of thread model to use on Linux and Solaris
  3.2672 +CheckPTHREAD()
  3.2673 +{
  3.2674 +    dnl Check for pthread support
  3.2675 +    AC_ARG_ENABLE(pthreads,
  3.2676 +AS_HELP_STRING([--enable-pthreads], [use POSIX threads for multi-threading [[default=yes]]]),
  3.2677 +                  , enable_pthreads=yes)
  3.2678 +    dnl This is used on Linux for glibc binary compatibility (Doh!)
  3.2679 +    AC_ARG_ENABLE(pthread-sem,
  3.2680 +AS_HELP_STRING([--enable-pthread-sem], [use pthread semaphores [[default=yes]]]),
  3.2681 +                  , enable_pthread_sem=yes)
  3.2682 +    case "$host" in
  3.2683 +         *-*-android*)
  3.2684 +            pthread_cflags="-D_REENTRANT -D_THREAD_SAFE"
  3.2685 +            pthread_lib=""
  3.2686 +            ;;
  3.2687 +        *-*-linux*|*-*-uclinux*)
  3.2688 +            pthread_cflags="-D_REENTRANT"
  3.2689 +            pthread_lib="-lpthread"
  3.2690 +            ;;
  3.2691 +        *-*-bsdi*)
  3.2692 +            pthread_cflags="-D_REENTRANT -D_THREAD_SAFE"
  3.2693 +            pthread_lib=""
  3.2694 +            ;;
  3.2695 +        *-*-darwin*)
  3.2696 +            pthread_cflags="-D_THREAD_SAFE"
  3.2697 +# causes Carbon.p complaints?
  3.2698 +#            pthread_cflags="-D_REENTRANT -D_THREAD_SAFE"
  3.2699 +            ;;
  3.2700 +        *-*-freebsd*|*-*-dragonfly*)
  3.2701 +            pthread_cflags="-D_REENTRANT -D_THREAD_SAFE"
  3.2702 +            pthread_lib="-pthread"
  3.2703 +            ;;
  3.2704 +        *-*-netbsd*)
  3.2705 +            pthread_cflags="-D_REENTRANT -D_THREAD_SAFE"
  3.2706 +            pthread_lib="-lpthread"
  3.2707 +            ;;
  3.2708 +        *-*-openbsd*)
  3.2709 +            pthread_cflags="-D_REENTRANT"
  3.2710 +            pthread_lib="-pthread"
  3.2711 +            ;;
  3.2712 +        *-*-solaris2.9)
  3.2713 +            # From Solaris 9+, posix4's preferred name is rt.
  3.2714 +            pthread_cflags="-D_REENTRANT"
  3.2715 +            pthread_lib="-lpthread -lrt"
  3.2716 +            ;;
  3.2717 +        *-*-solaris2.10)
  3.2718 +            # Solaris 10+ merged pthread into libc.
  3.2719 +            pthread_cflags="-D_REENTRANT"
  3.2720 +            pthread_lib="-lrt"
  3.2721 +            ;;
  3.2722 +        *-*-solaris*)
  3.2723 +            # Solaris 11+ merged rt into libc.
  3.2724 +            pthread_cflags="-D_REENTRANT"
  3.2725 +            pthread_lib=""
  3.2726 +            ;;
  3.2727 +        *-*-sysv5*)
  3.2728 +            pthread_cflags="-D_REENTRANT -Kthread"
  3.2729 +            pthread_lib=""
  3.2730 +            ;;
  3.2731 +        *-*-aix*)
  3.2732 +            pthread_cflags="-D_REENTRANT -mthreads"
  3.2733 +            pthread_lib="-lpthread"
  3.2734 +            ;;
  3.2735 +        *-*-hpux11*)
  3.2736 +            pthread_cflags="-D_REENTRANT"
  3.2737 +            pthread_lib="-L/usr/lib -lpthread"
  3.2738 +            ;;
  3.2739 +        *-*-haiku*)
  3.2740 +            pthread_cflags="-D_REENTRANT"
  3.2741 +            pthread_lib=""
  3.2742 +            ;;
  3.2743 +        *-*-nto*)
  3.2744 +            pthread_cflags="-D_REENTRANT"
  3.2745 +            pthread_lib=""
  3.2746 +            ;;
  3.2747 +        *)
  3.2748 +            pthread_cflags="-D_REENTRANT"
  3.2749 +            pthread_lib="-lpthread"
  3.2750 +            ;;
  3.2751 +    esac
  3.2752 +    if test x$enable_threads = xyes -a x$enable_pthreads = xyes; then
  3.2753 +        # Save the original compiler flags and libraries
  3.2754 +        ac_save_cflags="$CFLAGS"; ac_save_libs="$LIBS"
  3.2755 +        # Add the pthread compiler flags and libraries
  3.2756 +        CFLAGS="$CFLAGS $pthread_cflags"; LIBS="$LIBS $pthread_lib"
  3.2757 +        # Check to see if we have pthread support on this system
  3.2758 +        AC_MSG_CHECKING(for pthreads)
  3.2759 +        use_pthreads=no
  3.2760 +        AC_TRY_LINK([
  3.2761 +         #include <pthread.h>
  3.2762 +        ],[
  3.2763 +         pthread_attr_t type;
  3.2764 +         pthread_attr_init(&type);
  3.2765 +        ],[
  3.2766 +        use_pthreads=yes
  3.2767 +        ])
  3.2768 +        AC_MSG_RESULT($use_pthreads)
  3.2769 +        # Restore the compiler flags and libraries
  3.2770 +        CFLAGS="$ac_save_cflags"; LIBS="$ac_save_libs"
  3.2771 +
  3.2772 +        # Do futher testing if we have pthread support...
  3.2773 +        if test x$use_pthreads = xyes; then
  3.2774 +            AC_DEFINE(SDL_THREAD_PTHREAD, 1, [ ])
  3.2775 +            EXTRA_CFLAGS="$EXTRA_CFLAGS $pthread_cflags"
  3.2776 +            EXTRA_LDFLAGS="$EXTRA_LDFLAGS $pthread_lib"
  3.2777 +            SDL_CFLAGS="$SDL_CFLAGS $pthread_cflags"
  3.2778 +
  3.2779 +            # Save the original compiler flags and libraries
  3.2780 +            ac_save_cflags="$CFLAGS"; ac_save_libs="$LIBS"
  3.2781 +            # Add the pthread compiler flags and libraries
  3.2782 +            CFLAGS="$CFLAGS $pthread_cflags"; LIBS="$LIBS $pthread_lib"
  3.2783 +
  3.2784 +            # Check to see if recursive mutexes are available
  3.2785 +            AC_MSG_CHECKING(for recursive mutexes)
  3.2786 +            has_recursive_mutexes=no
  3.2787 +            if test x$has_recursive_mutexes = xno; then
  3.2788 +                AC_TRY_LINK([
  3.2789 +                  #define _GNU_SOURCE 1
  3.2790 +                  #include <pthread.h>
  3.2791 +                ],[
  3.2792 +                  pthread_mutexattr_t attr;
  3.2793 +                  pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
  3.2794 +                ],[
  3.2795 +                has_recursive_mutexes=yes
  3.2796 +                AC_DEFINE(SDL_THREAD_PTHREAD_RECURSIVE_MUTEX, 1, [ ])
  3.2797 +                ])
  3.2798 +            fi
  3.2799 +            if test x$has_recursive_mutexes = xno; then
  3.2800 +                AC_TRY_LINK([
  3.2801 +                  #define _GNU_SOURCE 1
  3.2802 +                  #include <pthread.h>
  3.2803 +                ],[
  3.2804 +                  pthread_mutexattr_t attr;
  3.2805 +                  pthread_mutexattr_setkind_np(&attr, PTHREAD_MUTEX_RECURSIVE_NP);
  3.2806 +                ],[
  3.2807 +                has_recursive_mutexes=yes
  3.2808 +                AC_DEFINE(SDL_THREAD_PTHREAD_RECURSIVE_MUTEX_NP, 1, [ ])
  3.2809 +                ])
  3.2810 +            fi
  3.2811 +            AC_MSG_RESULT($has_recursive_mutexes)
  3.2812 +
  3.2813 +            # Check to see if pthread semaphore support is missing
  3.2814 +            if test x$enable_pthread_sem = xyes; then
  3.2815 +                AC_MSG_CHECKING(for pthread semaphores)
  3.2816 +                have_pthread_sem=no
  3.2817 +                AC_TRY_COMPILE([
  3.2818 +                  #include <pthread.h>
  3.2819 +                  #include <semaphore.h>
  3.2820 +                ],[
  3.2821 +                ],[
  3.2822 +                have_pthread_sem=yes
  3.2823 +                ])
  3.2824 +                AC_MSG_RESULT($have_pthread_sem)
  3.2825 +            fi
  3.2826 +            if test x$have_pthread_sem = xyes; then
  3.2827 +                AC_MSG_CHECKING(for sem_timedwait)
  3.2828 +                have_sem_timedwait=no
  3.2829 +                AC_TRY_LINK([
  3.2830 +                  #include <pthread.h>
  3.2831 +                  #include <semaphore.h>
  3.2832 +                ],[
  3.2833 +                  sem_timedwait(NULL, NULL);
  3.2834 +                ],[
  3.2835 +                have_sem_timedwait=yes
  3.2836 +                AC_DEFINE([HAVE_SEM_TIMEDWAIT], 1, [ ])
  3.2837 +                ])
  3.2838 +                AC_MSG_RESULT($have_sem_timedwait)
  3.2839 +            fi
  3.2840 +
  3.2841 +            AC_CHECK_HEADER(pthread_np.h, have_pthread_np_h=yes, have_pthread_np_h=no, [ #include <pthread.h> ])
  3.2842 +            if test x$have_pthread_np_h = xyes; then
  3.2843 +                AC_DEFINE(HAVE_PTHREAD_NP_H, 1, [ ])
  3.2844 +            fi
  3.2845 +
  3.2846 +            # Check to see if pthread naming is available
  3.2847 +            AC_MSG_CHECKING(for pthread_setname_np)
  3.2848 +            AC_TRY_LINK_FUNC(pthread_setname_np, [
  3.2849 +              has_pthread_setname_np=yes
  3.2850 +              AC_DEFINE(HAVE_PTHREAD_SETNAME_NP, 1, [ ])
  3.2851 +            ],[
  3.2852 +              has_pthread_setname_np=no
  3.2853 +            ])
  3.2854 +            AC_MSG_RESULT($has_pthread_setname_np)
  3.2855 +
  3.2856 +            AC_MSG_CHECKING(for pthread_set_name_np)
  3.2857 +            AC_TRY_LINK_FUNC(pthread_set_name_np, [
  3.2858 +              has_pthread_set_name_np=yes
  3.2859 +              AC_DEFINE(HAVE_PTHREAD_SET_NAME_NP, 1, [ ])
  3.2860 +            ],[
  3.2861 +              has_pthread_set_name_np=no
  3.2862 +            ])
  3.2863 +            AC_MSG_RESULT($has_pthread_set_name_np)
  3.2864 +
  3.2865 +            # Restore the compiler flags and libraries
  3.2866 +            CFLAGS="$ac_save_cflags"; LIBS="$ac_save_libs"
  3.2867 +
  3.2868 +            # Basic thread creation functions
  3.2869 +            SOURCES="$SOURCES $srcdir/src/thread/pthread/SDL_systhread.c"
  3.2870 +
  3.2871 +            # Semaphores
  3.2872 +            # We can fake these with mutexes and condition variables if necessary
  3.2873 +            if test x$have_pthread_sem = xyes; then
  3.2874 +                SOURCES="$SOURCES $srcdir/src/thread/pthread/SDL_syssem.c"
  3.2875 +            else
  3.2876 +                SOURCES="$SOURCES $srcdir/src/thread/generic/SDL_syssem.c"
  3.2877 +            fi
  3.2878 +
  3.2879 +            # Mutexes
  3.2880 +            # We can fake these with semaphores if necessary
  3.2881 +            SOURCES="$SOURCES $srcdir/src/thread/pthread/SDL_sysmutex.c"
  3.2882 +
  3.2883 +            # Condition variables
  3.2884 +            # We can fake these with semaphores and mutexes if necessary
  3.2885 +            SOURCES="$SOURCES $srcdir/src/thread/pthread/SDL_syscond.c"
  3.2886 +
  3.2887 +            # Thread local storage
  3.2888 +            SOURCES="$SOURCES $srcdir/src/thread/pthread/SDL_systls.c"
  3.2889 +
  3.2890 +            have_threads=yes
  3.2891 +        fi
  3.2892 +    fi
  3.2893 +}
  3.2894 +
  3.2895 +dnl Determine whether the compiler can produce Windows executables
  3.2896 +CheckWINDOWS()
  3.2897 +{
  3.2898 +    AC_MSG_CHECKING(Windows compiler)
  3.2899 +    have_win32_gcc=no
  3.2900 +    AC_TRY_COMPILE([
  3.2901 +     #include <windows.h>
  3.2902 +    ],[
  3.2903 +    ],[
  3.2904 +    have_win32_gcc=yes
  3.2905 +    ])
  3.2906 +    AC_MSG_RESULT($have_win32_gcc)
  3.2907 +    if test x$have_win32_gcc != xyes; then
  3.2908 +       AC_MSG_ERROR([
  3.2909 +*** Your compiler ($CC) does not produce Windows executables!
  3.2910 +       ])
  3.2911 +    fi
  3.2912 +
  3.2913 +    AC_MSG_CHECKING(Windows CE)
  3.2914 +    have_wince=no
  3.2915 +    AC_TRY_COMPILE([
  3.2916 +#if !defined(_WIN32_WCE) && !defined(__MINGW32CE__)
  3.2917 +#error This is not Windows CE
  3.2918 +#endif
  3.2919 +    ],[
  3.2920 +    ],[
  3.2921 +    have_wince=yes
  3.2922 +       AC_MSG_ERROR([
  3.2923 +*** Sorry, Windows CE is no longer supported.
  3.2924 +       ])
  3.2925 +    ])
  3.2926 +    AC_MSG_RESULT($have_wince)
  3.2927 +
  3.2928 +    # This fixes Windows stack alignment with newer GCC
  3.2929 +    CheckStackBoundary
  3.2930 +}
  3.2931 +
  3.2932 +dnl Find the DirectX includes and libraries
  3.2933 +CheckDIRECTX()
  3.2934 +{
  3.2935 +    AC_ARG_ENABLE(directx,
  3.2936 +AS_HELP_STRING([--enable-directx], [use DirectX for Windows audio/video [[default=yes]]]),
  3.2937 +                  , enable_directx=yes)
  3.2938 +    if test x$enable_directx = xyes; then
  3.2939 +        AC_CHECK_HEADER(d3d9.h, have_d3d=yes)
  3.2940 +        AC_CHECK_HEADER(d3d11_1.h, have_d3d11=yes)
  3.2941 +        AC_CHECK_HEADER(ddraw.h, have_ddraw=yes)
  3.2942 +        AC_CHECK_HEADER(dsound.h, have_dsound=yes)
  3.2943 +        AC_CHECK_HEADER(dinput.h, have_dinput=yes)
  3.2944 +        AC_CHECK_HEADER(dxgi.h, have_dxgi=yes)
  3.2945 +        AC_CHECK_HEADER(xinput.h, have_xinput=yes)
  3.2946 +        AC_TRY_COMPILE([
  3.2947 +#include <windows.h>
  3.2948 +#include <xinput.h>
  3.2949 +XINPUT_GAMEPAD_EX x1;
  3.2950 +        ],[],[have_xinput_gamepadex=yes])
  3.2951 +        AC_TRY_COMPILE([
  3.2952 +#include <windows.h>
  3.2953 +#include <xinput.h>
  3.2954 +XINPUT_STATE_EX s1;
  3.2955 +        ],[],[have_xinput_stateex=yes])
  3.2956 +
  3.2957 +        if test x$have_ddraw = xyes; then
  3.2958 +            AC_DEFINE(HAVE_DDRAW_H, 1, [ ])
  3.2959 +        fi
  3.2960 +        if test x$have_dinput = xyes; then
  3.2961 +            AC_DEFINE(HAVE_DINPUT_H, 1, [ ])
  3.2962 +        fi
  3.2963 +        if test x$have_dsound = xyes; then
  3.2964 +            AC_DEFINE(HAVE_DSOUND_H, 1, [ ])
  3.2965 +        fi
  3.2966 +        if test x$have_dxgi = xyes; then
  3.2967 +            AC_DEFINE(HAVE_DXGI_H, 1, [ ])
  3.2968 +        fi
  3.2969 +        if test x$have_xinput = xyes; then
  3.2970 +            AC_DEFINE(HAVE_XINPUT_H, 1, [ ])
  3.2971 +        fi
  3.2972 +        if test x$have_xinput_gamepadex = xyes; then
  3.2973 +            AC_DEFINE(HAVE_XINPUT_GAMEPAD_EX, 1, [ ])
  3.2974 +        fi
  3.2975 +        if test x$have_xinput_stateex = xyes; then
  3.2976 +            AC_DEFINE(HAVE_XINPUT_STATE_EX, 1, [ ])
  3.2977 +        fi
  3.2978 +
  3.2979 +        SUMMARY_video="${SUMMARY_video} directx"
  3.2980 +        SUMMARY_audio="${SUMMARY_audio} directx"
  3.2981 +
  3.2982 +        # FIXME: latest Cygwin finds dinput headers, but we die on other win32 headers.
  3.2983 +        # FIXME:  ...so force it off for now.
  3.2984 +        case "$host" in
  3.2985 +            *-*-cygwin*)
  3.2986 +            have_dinput=false
  3.2987 +            ;;
  3.2988 +        esac
  3.2989 +    fi
  3.2990 +
  3.2991 +    AC_CHECK_HEADER(mmdeviceapi.h, have_wasapi=yes)
  3.2992 +    if test x$have_wasapi = xyes; then
  3.2993 +        AC_DEFINE(HAVE_MMDEVICEAPI_H,1,[])
  3.2994 +    fi
  3.2995 +    AC_CHECK_HEADER(audioclient.h,,have_wasapi=no)
  3.2996 +    if test x$have_wasapi = xyes; then
  3.2997 +        AC_DEFINE(HAVE_AUDIOCLIENT_H,1,[])
  3.2998 +    fi
  3.2999 +
  3.3000 +    AC_CHECK_HEADER(endpointvolume.h,AC_DEFINE(HAVE_ENDPOINTVOLUME_H,1,[]))
  3.3001 +
  3.3002 +    AC_ARG_ENABLE(wasapi,
  3.3003 +AS_HELP_STRING([--enable-wasapi], [use the Windows WASAPI audio driver [[default=yes]]]),
  3.3004 +                                , enable_wasapi=yes)
  3.3005 +}
  3.3006 +
  3.3007 +dnl Check for the dlfcn.h interface for dynamically loading objects
  3.3008 +CheckDLOPEN()
  3.3009 +{
  3.3010 +    AC_ARG_ENABLE(sdl-dlopen,
  3.3011 +AS_HELP_STRING([--enable-sdl-dlopen], [use dlopen for shared object loading [[default=yes]]]),
  3.3012 +                  , enable_sdl_dlopen=yes)
  3.3013 +    if test x$enable_sdl_dlopen = xyes; then
  3.3014 +        AC_MSG_CHECKING(for dlopen)
  3.3015 +        have_dlopen=no
  3.3016 +        AC_TRY_COMPILE([
  3.3017 +         #include <dlfcn.h>
  3.3018 +        ],[
  3.3019 +         void *handle = dlopen("", RTLD_NOW);
  3.3020 +         const char *loaderror = (char *) dlerror();
  3.3021 +        ],[
  3.3022 +        have_dlopen=yes
  3.3023 +        ])
  3.3024 +        AC_MSG_RESULT($have_dlopen)
  3.3025 +
  3.3026 +        if test x$have_dlopen = xyes; then
  3.3027 +            AC_CHECK_LIB(c, dlopen, EXTRA_LDFLAGS="$EXTRA_LDFLAGS",
  3.3028 +               AC_CHECK_LIB(dl, dlopen, EXTRA_LDFLAGS="$EXTRA_LDFLAGS -ldl",
  3.3029 +                  AC_CHECK_LIB(ltdl, dlopen, EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lltdl")))
  3.3030 +            AC_DEFINE(SDL_LOADSO_DLOPEN, 1, [ ])
  3.3031 +            SOURCES="$SOURCES $srcdir/src/loadso/dlopen/*.c"
  3.3032 +            have_loadso=yes
  3.3033 +        fi
  3.3034 +    fi
  3.3035 +}
  3.3036 +
  3.3037 +dnl Check for the usbhid(3) library on *BSD
  3.3038 +CheckUSBHID()
  3.3039 +{
  3.3040 +    case "$host" in
  3.3041 +        *-*-*bsd*)
  3.3042 +            if test x$enable_joystick = xyes; then
  3.3043 +                AC_CHECK_LIB(usbhid, hid_init, have_libusbhid=yes)
  3.3044 +                if test x$have_libusbhid = xyes; then
  3.3045 +                    AC_CHECK_HEADER(usbhid.h, [USB_CFLAGS="-DHAVE_USBHID_H"])
  3.3046 +                    AC_CHECK_HEADER(libusbhid.h, [USB_CFLAGS="-DHAVE_LIBUSBHID_H"])
  3.3047 +                    USB_LIBS="$USB_LIBS -lusbhid"
  3.3048 +                else
  3.3049 +                    AC_CHECK_HEADER(usb.h, [USB_CFLAGS="-DHAVE_USB_H"])
  3.3050 +                    AC_CHECK_HEADER(libusb.h, [USB_CFLAGS="-DHAVE_LIBUSB_H"])
  3.3051 +                    AC_CHECK_LIB(usb, hid_init, [USB_LIBS="$USB_LIBS -lusb"])
  3.3052 +                fi
  3.3053 +                    
  3.3054 +                save_CFLAGS="$CFLAGS"
  3.3055 +                CFLAGS="$CFLAGS $USB_CFLAGS"
  3.3056 +
  3.3057 +                AC_MSG_CHECKING(for usbhid)
  3.3058 +                have_usbhid=no
  3.3059 +                AC_TRY_COMPILE([
  3.3060 +                  #include <sys/types.h>
  3.3061 +                  #if defined(HAVE_USB_H)
  3.3062 +                  #include <usb.h>
  3.3063 +                  #endif
  3.3064 +                  #ifdef __DragonFly__
  3.3065 +                  # include <bus/usb/usb.h>
  3.3066 +                  # include <bus/usb/usbhid.h>
  3.3067 +                  #else
  3.3068 +                  # include <dev/usb/usb.h>
  3.3069 +                  # include <dev/usb/usbhid.h>
  3.3070 +                  #endif
  3.3071 +                  #if defined(HAVE_USBHID_H)
  3.3072 +                  #include <usbhid.h>
  3.3073 +                  #elif defined(HAVE_LIBUSB_H)
  3.3074 +                  #include <libusb.h>
  3.3075 +                  #elif defined(HAVE_LIBUSBHID_H)
  3.3076 +                  #include <libusbhid.h>
  3.3077 +                  #endif
  3.3078 +                ],[
  3.3079 +                  struct report_desc *repdesc;
  3.3080 +                  struct usb_ctl_report *repbuf;
  3.3081 +                  hid_kind_t hidkind;
  3.3082 +                ],[
  3.3083 +                have_usbhid=yes
  3.3084 +                ])
  3.3085 +                AC_MSG_RESULT($have_usbhid)
  3.3086 +
  3.3087 +                if test x$have_usbhid = xyes; then
  3.3088 +                    AC_MSG_CHECKING(for ucr_data member of usb_ctl_report)
  3.3089 +                    have_usbhid_ucr_data=no
  3.3090 +                    AC_TRY_COMPILE([
  3.3091 +                      #include <sys/types.h>
  3.3092 +                      #if defined(HAVE_USB_H)
  3.3093 +                      #include <usb.h>
  3.3094 +                      #endif
  3.3095 +                      #ifdef __DragonFly__
  3.3096 +                      # include <bus/usb/usb.h>
  3.3097 +                      # include <bus/usb/usbhid.h>
  3.3098 +                      #else
  3.3099 +                      # include <dev/usb/usb.h>
  3.3100 +                      # include <dev/usb/usbhid.h>
  3.3101 +                      #endif
  3.3102 +                      #if defined(HAVE_USBHID_H)
  3.3103 +                      #include <usbhid.h>
  3.3104 +                      #elif defined(HAVE_LIBUSB_H)
  3.3105 +                      #include <libusb.h>
  3.3106 +                      #elif defined(HAVE_LIBUSBHID_H)
  3.3107 +                      #include <libusbhid.h>
  3.3108 +                      #endif
  3.3109 +                    ],[
  3.3110 +                      struct usb_ctl_report buf;
  3.3111 +                      if (buf.ucr_data) { }
  3.3112 +                    ],[
  3.3113 +                    have_usbhid_ucr_data=yes
  3.3114 +                    ])
  3.3115 +                    if test x$have_usbhid_ucr_data = xyes; then
  3.3116 +                        USB_CFLAGS="$USB_CFLAGS -DUSBHID_UCR_DATA"
  3.3117 +                    fi
  3.3118 +                    AC_MSG_RESULT($have_usbhid_ucr_data)
  3.3119 +                    
  3.3120 +                    AC_MSG_CHECKING(for new usbhid API)
  3.3121 +                    have_usbhid_new=no
  3.3122 +                    AC_TRY_COMPILE([
  3.3123 +                      #include <sys/types.h>
  3.3124 +                      #if defined(HAVE_USB_H)
  3.3125 +                      #include <usb.h>
  3.3126 +                      #endif
  3.3127 +                      #ifdef __DragonFly__
  3.3128 +                      #include <bus/usb/usb.h>
  3.3129 +                      #include <bus/usb/usbhid.h>
  3.3130 +                      #else
  3.3131 +                      #include <dev/usb/usb.h>
  3.3132 +                      #include <dev/usb/usbhid.h>
  3.3133 +                      #endif
  3.3134 +                      #if defined(HAVE_USBHID_H)
  3.3135 +                      #include <usbhid.h>
  3.3136 +                      #elif defined(HAVE_LIBUSB_H)
  3.3137 +                      #include <libusb.h>
  3.3138 +                      #elif defined(HAVE_LIBUSBHID_H)
  3.3139 +                      #include <libusbhid.h>
  3.3140 +                      #endif
  3.3141 +                    ],[
  3.3142 +                      report_desc_t d;
  3.3143 +                      hid_start_parse(d, 1, 1);
  3.3144 +                    ],[
  3.3145 +                    have_usbhid_new=yes
  3.3146 +                    ])
  3.3147 +                    if test x$have_usbhid_new = xyes; then
  3.3148 +                        USB_CFLAGS="$USB_CFLAGS -DUSBHID_NEW"
  3.3149 +                    fi
  3.3150 +                    AC_MSG_RESULT($have_usbhid_new)
  3.3151 +
  3.3152 +                    AC_MSG_CHECKING(for struct joystick in machine/joystick.h)
  3.3153 +                    have_machine_joystick=no
  3.3154 +                    AC_TRY_COMPILE([
  3.3155 +                      #include <machine/joystick.h>
  3.3156 +                    ],[
  3.3157 +                      struct joystick t;
  3.3158 +                    ],[
  3.3159 +                    have_machine_joystick=yes
  3.3160 +                    ])
  3.3161 +                    if test x$have_machine_joystick = xyes; then
  3.3162 +                        AC_DEFINE(SDL_JOYSTICK_USBHID_MACHINE_JOYSTICK_H, 1, [ ])
  3.3163 +                    fi
  3.3164 +                    AC_MSG_RESULT($have_machine_joystick)
  3.3165 +
  3.3166 +                    AC_DEFINE(SDL_JOYSTICK_USBHID, 1, [ ])
  3.3167 +                    SOURCES="$SOURCES $srcdir/src/joystick/bsd/*.c"
  3.3168 +                    EXTRA_CFLAGS="$EXTRA_CFLAGS $USB_CFLAGS"
  3.3169 +                    EXTRA_LDFLAGS="$EXTRA_LDFLAGS $USB_LIBS"
  3.3170 +                    have_joystick=yes
  3.3171 +                fi
  3.3172 +                CFLAGS="$save_CFLAGS"
  3.3173 +            fi
  3.3174 +        ;;
  3.3175 +    esac
  3.3176 +}
  3.3177 +
  3.3178 +dnl Check for HIDAPI joystick drivers
  3.3179 +CheckHIDAPI()
  3.3180 +{
  3.3181 +    # The hidraw support doesn't catch Xbox, PS4 and Nintendo controllers,
  3.3182 +    # so we'll just use libusb when it's available.
  3.3183 +    #
  3.3184 +    # Except that libusb requires root permissions to open devices, so that's not generally useful, and we'll disable this by default.
  3.3185 +    AC_ARG_ENABLE(hidapi,
  3.3186 +AS_HELP_STRING([--enable-hidapi], [use HIDAPI for low level joystick drivers [[default=no]]]),
  3.3187 +                  , enable_hidapi=no)
  3.3188 +    if test x$enable_joystick = xyes -a x$enable_hidapi = xyes; then
  3.3189 +        PKG_CHECK_MODULES([LIBUSB], [libusb-1.0], have_libusb=yes, have_libusb=no)
  3.3190 +        hidapi_support=no
  3.3191 +        save_CFLAGS="$CFLAGS"
  3.3192 +        CFLAGS="$save_CFLAGS $LIBUSB_CFLAGS"
  3.3193 +        AC_CHECK_HEADER(libusb.h, have_libusb_h=yes)
  3.3194 +        CFLAGS="$save_CFLAGS"
  3.3195 +
  3.3196 +        if test x$have_libusb_h = xyes; then
  3.3197 +            hidapi_support=yes
  3.3198 +            AC_DEFINE(SDL_JOYSTICK_HIDAPI, 1, [ ])
  3.3199 +            EXTRA_CFLAGS="$EXTRA_CFLAGS -I$srcdir/src/hidapi/hidapi"
  3.3200 +            SOURCES="$SOURCES $srcdir/src/joystick/hidapi/*.c"
  3.3201 +            SOURCES="$SOURCES $srcdir/src/hidapi/libusb/hid.c"
  3.3202 +            EXTRA_CFLAGS="$EXTRA_CFLAGS $LIBUSB_CFLAGS"
  3.3203 +            EXTRA_LDFLAGS="$EXTRA_LDFLAGS $LIBUSB_LIBS"
  3.3204 +        fi
  3.3205 +        AC_MSG_CHECKING(for hidapi support)
  3.3206 +        AC_MSG_RESULT($hidapi_support)
  3.3207 +    fi
  3.3208 +}
  3.3209 +
  3.3210 +dnl Check for clock_gettime()
  3.3211 +CheckClockGettime()
  3.3212 +{
  3.3213 +    AC_ARG_ENABLE(clock_gettime,
  3.3214 +AS_HELP_STRING([--enable-clock_gettime], [use clock_gettime() instead of gettimeofday() on UNIX [[default=yes]]]),
  3.3215 +                  , enable_clock_gettime=yes)
  3.3216 +    if test x$enable_clock_gettime = xyes; then
  3.3217 +        AC_CHECK_LIB(rt, clock_gettime, have_clock_gettime=yes)
  3.3218 +        if test x$have_clock_gettime = xyes; then
  3.3219 +            AC_DEFINE(HAVE_CLOCK_GETTIME, 1, [ ])
  3.3220 +            EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lrt"
  3.3221 +        else
  3.3222 +            AC_CHECK_LIB(c, clock_gettime, have_clock_gettime=yes)
  3.3223 +            if test x$have_clock_gettime = xyes; then
  3.3224 +               AC_DEFINE(HAVE_CLOCK_GETTIME, 1, [ ])
  3.3225 +               EXTRA_LDFLAGS="$EXTRA_LDFLAGS"
  3.3226 +            fi
  3.3227 +        fi
  3.3228 +    fi
  3.3229 +}
  3.3230 +
  3.3231 +dnl Check for a valid linux/version.h
  3.3232 +CheckLinuxVersion()
  3.3233 +{
  3.3234 +    AC_CHECK_HEADER(linux/version.h, have_linux_version_h=yes)
  3.3235 +    if test x$have_linux_version_h = xyes; then
  3.3236 +        EXTRA_CFLAGS="$EXTRA_CFLAGS -DHAVE_LINUX_VERSION_H"
  3.3237 +    fi
  3.3238 +}
  3.3239 +
  3.3240 +dnl Check if we want to use RPATH
  3.3241 +CheckRPATH()
  3.3242 +{
  3.3243 +    AC_ARG_ENABLE(rpath,
  3.3244 +AS_HELP_STRING([--enable-rpath], [use an rpath when linking SDL [[default=yes]]]),
  3.3245 +                  , enable_rpath=yes)
  3.3246 +}
  3.3247 +
  3.3248 +dnl Check if we want to use custom signals to fake iOS/Android's backgrounding
  3.3249 +dnl  events. These could be useful if you're building a custom embedded
  3.3250 +dnl  environment, etc, but most people don't need this.
  3.3251 +CheckEventSignals()
  3.3252 +{
  3.3253 +    AC_ARG_ENABLE(backgrounding-signal,
  3.3254 +AS_HELP_STRING([--enable-backgrounding-signal], [number to use for magic backgrounding signal or 'no' [[default=no]]]),
  3.3255 +                  , enable_backgrounding_signal=no)
  3.3256 +    if test x$enable_backgrounding_signal != xno; then
  3.3257 +        EXTRA_CFLAGS="$EXTRA_CFLAGS -DSDL_BACKGROUNDING_SIGNAL=$enable_backgrounding_signal"
  3.3258 +    fi
  3.3259 +
  3.3260 +    AC_ARG_ENABLE(foregrounding-signal,
  3.3261 +AS_HELP_STRING([--enable-foregrounding-signal], [number to use for magic foregrounding signal or 'no' [[default=no]]]),
  3.3262 +                  , enable_foregrounding_signal=no)
  3.3263 +    if test x$enable_foregrounding_signal != xno; then
  3.3264 +        EXTRA_CFLAGS="$EXTRA_CFLAGS -DSDL_FOREGROUNDING_SIGNAL=$enable_foregrounding_signal"
  3.3265 +    fi
  3.3266 +}
  3.3267 +
  3.3268 +
  3.3269 +
  3.3270 +dnl Do this on all platforms, before everything else (other things might want to override it).
  3.3271 +CheckWarnAll
  3.3272 +
  3.3273 +dnl Do this for every platform, but for some it doesn't mean anything, but better to catch it here anyhow.
  3.3274 +CheckEventSignals
  3.3275 +
  3.3276 +dnl Set up the configuration based on the host platform!
  3.3277 +case "$host" in
  3.3278 +    *-*-linux*|*-*-uclinux*|*-*-gnu*|*-*-k*bsd*-gnu|*-*-bsdi*|*-*-freebsd*|*-*-dragonfly*|*-*-netbsd*|*-*-openbsd*|*-*-sysv5*|*-*-solaris*|*-*-hpux*|*-*-aix*|*-*-minix*|*-*-nto*)
  3.3279 +        case "$host" in
  3.3280 +            *-*-android*)
  3.3281 +                # Android
  3.3282 +                ARCH=android
  3.3283 +                ANDROID_CFLAGS="-DGL_GLEXT_PROTOTYPES"
  3.3284 +                CFLAGS="$CFLAGS $ANDROID_CFLAGS"
  3.3285 +                SDL_CFLAGS="$SDL_CFLAGS $ANDROID_CFLAGS"
  3.3286 +                EXTRA_CFLAGS="$EXTRA_CFLAGS $ANDROID_CFLAGS"
  3.3287 +                EXTRA_LDFLAGS="$EXTRA_LDFLAGS -ldl -lGLESv1_CM -lGLESv2 -llog -landroid"
  3.3288 +                SDLMAIN_SOURCES="$srcdir/src/main/android/*.c"
  3.3289 +
  3.3290 +                if test x$enable_video = xyes; then
  3.3291 +                    SOURCES="$SOURCES $srcdir/src/core/android/*.c $srcdir/src/video/android/*.c"
  3.3292 +                    # FIXME: confdefs? Not AC_DEFINE?
  3.3293 +                    $as_echo "#define SDL_VIDEO_DRIVER_ANDROID 1" >>confdefs.h
  3.3294 +                    SUMMARY_video="${SUMMARY_video} android"
  3.3295 +                fi
  3.3296 +                ;;
  3.3297 +            *-*-linux*)         ARCH=linux ;;
  3.3298 +            *-*-uclinux*)       ARCH=linux ;;
  3.3299 +            *-*-kfreebsd*-gnu)  ARCH=kfreebsd-gnu ;;
  3.3300 +            *-*-knetbsd*-gnu)   ARCH=knetbsd-gnu ;;
  3.3301 +            *-*-kopenbsd*-gnu)  ARCH=kopenbsd-gnu ;;
  3.3302 +            *-*-gnu*)           ARCH=gnu ;; # must be last of the gnu variants
  3.3303 +            *-*-bsdi*)          ARCH=bsdi ;;
  3.3304 +            *-*-freebsd*)       ARCH=freebsd ;;
  3.3305 +            *-*-dragonfly*)     ARCH=freebsd ;;
  3.3306 +            *-*-netbsd*)        ARCH=netbsd ;;
  3.3307 +            *-*-openbsd*)       ARCH=openbsd ;;
  3.3308 +            *-*-sysv5*)         ARCH=sysv5 ;;
  3.3309 +            *-*-solaris*)       ARCH=solaris ;;
  3.3310 +            *-*-hpux*)          ARCH=hpux ;;
  3.3311 +            *-*-aix*)           ARCH=aix ;;
  3.3312 +            *-*-minix*)         ARCH=minix ;;
  3.3313 +            *-*-nto*)           ARCH=nto
  3.3314 +                CheckQNXVideo
  3.3315 +                ;;
  3.3316 +        esac
  3.3317 +        CheckVisibilityHidden
  3.3318 +        CheckDeclarationAfterStatement
  3.3319 +        CheckDummyVideo
  3.3320 +        CheckDiskAudio
  3.3321 +        CheckDummyAudio
  3.3322 +        CheckDLOPEN
  3.3323 +        CheckOSS
  3.3324 +        CheckALSA
  3.3325 +        CheckPulseAudio
  3.3326 +        CheckJACK
  3.3327 +        CheckARTSC
  3.3328 +        CheckESD
  3.3329 +        CheckNAS
  3.3330 +        CheckSNDIO
  3.3331 +        CheckFusionSound
  3.3332 +        CheckLibSampleRate
  3.3333 +        # Need to check for Raspberry PI first and add platform specific compiler flags, otherwise the test for GLES fails!
  3.3334 +        CheckRPI
  3.3335 +        CheckX11
  3.3336 +        CheckDirectFB
  3.3337 +        CheckKMSDRM
  3.3338 +        CheckOpenGLX11
  3.3339 +        CheckOpenGLESX11
  3.3340 +        CheckVulkan
  3.3341 +        CheckWayland
  3.3342 +        CheckLibUDev
  3.3343 +        CheckDBus
  3.3344 +        CheckIME
  3.3345 +        CheckIBus
  3.3346 +        CheckFcitx
  3.3347 +        case $ARCH in
  3.3348 +          linux)
  3.3349 +              CheckInputEvents
  3.3350 +              CheckInputKD
  3.3351 +          ;;
  3.3352 +        esac
  3.3353 +        CheckTslib
  3.3354 +        CheckUSBHID
  3.3355 +        CheckHIDAPI
  3.3356 +        CheckPTHREAD
  3.3357 +        CheckClockGettime
  3.3358 +        CheckLinuxVersion
  3.3359 +        CheckRPATH
  3.3360 +        CheckVivanteVideo
  3.3361 +
  3.3362 +        # Set up files for the audio library
  3.3363 +        if test x$enable_audio = xyes; then
  3.3364 +          case $ARCH in
  3.3365 +            sysv5|solaris|hpux)
  3.3366 +                AC_DEFINE(SDL_AUDIO_DRIVER_SUNAUDIO, 1, [ ])
  3.3367 +                SOURCES="$SOURCES $srcdir/src/audio/sun/*.c"
  3.3368 +                SUMMARY_audio="${SUMMARY_audio} sun"
  3.3369 +                have_audio=yes
  3.3370 +            ;;
  3.3371 +            netbsd)  # Don't use this on OpenBSD, it's busted.
  3.3372 +                AC_DEFINE(SDL_AUDIO_DRIVER_NETBSD, 1, [ ])
  3.3373 +                SOURCES="$SOURCES $srcdir/src/audio/netbsd/*.c"
  3.3374 +                SUMMARY_audio="${SUMMARY_audio} netbsd"
  3.3375 +                have_audio=yes
  3.3376 +            ;;
  3.3377 +            aix)
  3.3378 +                AC_DEFINE(SDL_AUDIO_DRIVER_PAUDIO, 1, [ ])
  3.3379 +                SOURCES="$SOURCES $srcdir/src/audio/paudio/*.c"
  3.3380 +                SUMMARY_audio="${SUMMARY_audio} paudio"
  3.3381 +                have_audio=yes
  3.3382 +            ;;
  3.3383 +            android)
  3.3384 +                AC_DEFINE(SDL_AUDIO_DRIVER_ANDROID, 1, [ ])
  3.3385 +                SOURCES="$SOURCES $srcdir/src/audio/android/*.c"
  3.3386 +                SUMMARY_audio="${SUMMARY_audio} android"
  3.3387 +                have_audio=yes
  3.3388 +            ;;
  3.3389 +            nto)
  3.3390 +                CheckQNXAudio
  3.3391 +            ;;
  3.3392 +          esac
  3.3393 +        fi
  3.3394 +        # Set up files for the joystick library
  3.3395 +        if test x$enable_joystick = xyes; then
  3.3396 +          case $ARCH in
  3.3397 +            linux)
  3.3398 +                AC_DEFINE(SDL_JOYSTICK_LINUX, 1, [ ])
  3.3399 +                SOURCES="$SOURCES $srcdir/src/joystick/linux/*.c"
  3.3400 +                SOURCES="$SOURCES $srcdir/src/joystick/steam/*.c"
  3.3401 +                have_joystick=yes
  3.3402 +            ;;
  3.3403 +            android)
  3.3404 +                AC_DEFINE(SDL_JOYSTICK_ANDROID, 1, [ ])
  3.3405 +                SOURCES="$SOURCES $srcdir/src/joystick/android/*.c"
  3.3406 +                SOURCES="$SOURCES $srcdir/src/joystick/steam/*.c"
  3.3407 +                have_joystick=yes
  3.3408 +            ;;
  3.3409 +          esac
  3.3410 +        fi
  3.3411 +        # Set up files for the haptic library
  3.3412 +        if test x$enable_haptic = xyes; then
  3.3413 +          case $ARCH in
  3.3414 +            linux)
  3.3415 +                if test x$use_input_events = xyes; then
  3.3416 +                    AC_DEFINE(SDL_HAPTIC_LINUX, 1, [ ])
  3.3417 +                    SOURCES="$SOURCES $srcdir/src/haptic/linux/*.c"
  3.3418 +                    have_haptic=yes
  3.3419 +                fi
  3.3420 +            ;;
  3.3421 +            android)
  3.3422 +                AC_DEFINE(SDL_HAPTIC_ANDROID, 1, [ ])
  3.3423 +                SOURCES="$SOURCES $srcdir/src/haptic/android/*.c"
  3.3424 +                have_haptic=yes
  3.3425 +            ;;
  3.3426 +          esac
  3.3427 +        fi
  3.3428 +        # Set up files for the sensor library
  3.3429 +        if test x$enable_sensor = xyes; then
  3.3430 +          case $ARCH in
  3.3431 +            android)
  3.3432 +                AC_DEFINE(SDL_SENSOR_ANDROID, 1, [ ])
  3.3433 +                SOURCES="$SOURCES $srcdir/src/sensor/android/*.c"
  3.3434 +                have_sensor=yes
  3.3435 +            ;;
  3.3436 +          esac
  3.3437 +        fi
  3.3438 +        # Set up files for the power library
  3.3439 +        if test x$enable_power = xyes; then
  3.3440 +             case $ARCH in
  3.3441 +               linux)
  3.3442 +                   AC_DEFINE(SDL_POWER_LINUX, 1, [ ])
  3.3443 +                   SOURCES="$SOURCES $srcdir/src/power/linux/*.c"
  3.3444 +                   have_power=yes
  3.3445 +               ;;
  3.3446 +               android)
  3.3447 +                   AC_DEFINE(SDL_POWER_ANDROID, 1, [ ])
  3.3448 +                   SOURCES="$SOURCES $srcdir/src/power/android/*.c"
  3.3449 +                   have_power=yes
  3.3450 +               ;;
  3.3451 +             esac
  3.3452 +        fi
  3.3453 +        # Set up files for the filesystem library
  3.3454 +        if test x$enable_filesystem = xyes; then
  3.3455 +             case $ARCH in
  3.3456 +               android)
  3.3457 +                   AC_DEFINE(SDL_FILESYSTEM_ANDROID, 1, [ ])
  3.3458 +                   SOURCES="$SOURCES $srcdir/src/filesystem/android/*.c"
  3.3459 +                   have_filesystem=yes
  3.3460 +               ;;
  3.3461 +               *)
  3.3462 +                   AC_DEFINE(SDL_FILESYSTEM_UNIX, 1, [ ])
  3.3463 +                   SOURCES="$SOURCES $srcdir/src/filesystem/unix/*.c"
  3.3464 +                   have_filesystem=yes
  3.3465 +               ;;
  3.3466 +             esac
  3.3467 +        fi
  3.3468 +        # Set up files for the timer library
  3.3469 +        if test x$enable_timers = xyes; then
  3.3470 +            AC_DEFINE(SDL_TIMER_UNIX, 1, [ ])
  3.3471 +            SOURCES="$SOURCES $srcdir/src/timer/unix/*.c"
  3.3472 +            have_timers=yes
  3.3473 +        fi
  3.3474 +        # Set up files for udev hotplugging support
  3.3475 +        if test x$enable_libudev = xyes && test x$have_libudev_h_hdr = xyes; then
  3.3476 +            SOURCES="$SOURCES $srcdir/src/core/linux/SDL_udev.c"               
  3.3477 +        fi
  3.3478 +        # Set up files for evdev input
  3.3479 +        if test x$use_input_events = xyes; then
  3.3480 +            SOURCES="$SOURCES $srcdir/src/core/linux/SDL_evdev*.c"
  3.3481 +        fi       
  3.3482 +        # Set up other core UNIX files
  3.3483 +        SOURCES="$SOURCES $srcdir/src/core/linux/SDL_threadprio.c"
  3.3484 +        SOURCES="$SOURCES $srcdir/src/core/unix/*.c"
  3.3485 +        ;;
  3.3486 +    *-*-cygwin* | *-*-mingw32*)
  3.3487 +        ARCH=win32
  3.3488 +        if test "$build" != "$host"; then # cross-compiling
  3.3489 +            # Default cross-compile location
  3.3490 +            ac_default_prefix=/usr/local/cross-tools/$host
  3.3491 +        else
  3.3492 +            # Look for the location of the tools and install there
  3.3493 +            if test "$BUILD_PREFIX" != ""; then
  3.3494 +                ac_default_prefix=$BUILD_PREFIX
  3.3495 +            fi
  3.3496 +        fi
  3.3497 +        CheckDeclarationAfterStatement
  3.3498 +        CheckDummyVideo
  3.3499 +        CheckDiskAudio
  3.3500 +        CheckDummyAudio
  3.3501 +        CheckWINDOWS
  3.3502 +        CheckWINDOWSGL
  3.3503 +        CheckWINDOWSGLES
  3.3504 +        CheckVulkan
  3.3505 +        CheckDIRECTX
  3.3506 +
  3.3507 +        # Set up the core platform files
  3.3508 +        SOURCES="$SOURCES $srcdir/src/core/windows/*.c"
  3.3509 +
  3.3510 +        # Set up files for the video library
  3.3511 +        if test x$enable_video = xyes; then
  3.3512 +            AC_DEFINE(SDL_VIDEO_DRIVER_WINDOWS, 1, [ ])
  3.3513 +            SOURCES="$SOURCES $srcdir/src/video/windows/*.c"
  3.3514 +            have_video=yes
  3.3515 +            AC_ARG_ENABLE(render-d3d,
  3.3516 +AS_HELP_STRING([--enable-render-d3d], [enable the Direct3D render driver [[default=yes]]]),
  3.3517 +                                , enable_render_d3d=yes)
  3.3518 +            if test x$enable_render_d3d = xyes -a x$have_d3d = xyes; then
  3.3519 +                AC_DEFINE(SDL_VIDEO_RENDER_D3D, 1, [ ])
  3.3520 +            fi
  3.3521 +            if test x$enable_render_d3d = xyes -a x$have_d3d11 = xyes; then
  3.3522 +                AC_DEFINE(SDL_VIDEO_RENDER_D3D11, 1, [ ])
  3.3523 +            fi
  3.3524 +        fi
  3.3525 +        # Set up files for the audio library
  3.3526 +        if test x$enable_audio = xyes; then
  3.3527 +            AC_DEFINE(SDL_AUDIO_DRIVER_WINMM, 1, [ ])
  3.3528 +            SOURCES="$SOURCES $srcdir/src/audio/winmm/*.c"
  3.3529 +            if test x$have_dsound = xyes; then
  3.3530 +                AC_DEFINE(SDL_AUDIO_DRIVER_DSOUND, 1, [ ])
  3.3531 +                SOURCES="$SOURCES $srcdir/src/audio/directsound/*.c"
  3.3532 +            fi
  3.3533 +            if test x$have_wasapi = xyes -a x$enable_wasapi = xyes; then
  3.3534 +                AC_DEFINE(SDL_AUDIO_DRIVER_WASAPI, 1, [ ])
  3.3535 +                SUMMARY_audio="${SUMMARY_audio} wasapi"
  3.3536 +                SOURCES="$SOURCES $srcdir/src/audio/wasapi/*.c"
  3.3537 +            fi
  3.3538 +            have_audio=yes
  3.3539 +        fi
  3.3540 +        # Set up files for the joystick library
  3.3541 +        if test x$enable_joystick = xyes; then
  3.3542 +            if test x$have_dinput = xyes -o x$have_xinput = xyes; then
  3.3543 +                if test x$have_xinput = xyes; then
  3.3544 +                    AC_DEFINE(SDL_JOYSTICK_XINPUT, 1, [ ])
  3.3545 +                fi
  3.3546 +                if test x$have_dinput = xyes; then
  3.3547 +                    AC_DEFINE(SDL_JOYSTICK_DINPUT, 1, [ ])
  3.3548 +                    EXTRA_LDFLAGS="$EXTRA_LDFLAGS -ldinput8 -ldxguid -ldxerr8"
  3.3549 +                fi
  3.3550 +            else
  3.3551 +                AC_DEFINE(SDL_JOYSTICK_WINMM, 1, [ ])
  3.3552 +            fi
  3.3553 +            AC_DEFINE(SDL_JOYSTICK_HIDAPI, 1, [ ])
  3.3554 +            SOURCES="$SOURCES $srcdir/src/joystick/windows/*.c"
  3.3555 +            SOURCES="$SOURCES $srcdir/src/joystick/hidapi/*.c"
  3.3556 +            SOURCES="$SOURCES $srcdir/src/hidapi/windows/hid.c"
  3.3557 +            EXTRA_CFLAGS="$EXTRA_CFLAGS -I$srcdir/src/hidapi/hidapi"
  3.3558 +            have_joystick=yes
  3.3559 +        fi
  3.3560 +        if test x$enable_haptic = xyes; then
  3.3561 +            if test x$have_dinput = xyes -o x$have_xinput = xyes; then
  3.3562 +                if test x$have_xinput = xyes; then
  3.3563 +                    AC_DEFINE(SDL_HAPTIC_XINPUT, 1, [ ])
  3.3564 +                fi
  3.3565 +                if test x$have_dinput = xyes; then
  3.3566 +                    AC_DEFINE(SDL_HAPTIC_DINPUT, 1, [ ])
  3.3567 +                fi
  3.3568 +                SOURCES="$SOURCES $srcdir/src/haptic/windows/*.c"
  3.3569 +                have_haptic=yes
  3.3570 +            fi
  3.3571 +        fi
  3.3572 +        if test x$enable_power = xyes; then
  3.3573 +            AC_DEFINE(SDL_POWER_WINDOWS, 1, [ ])
  3.3574 +            SOURCES="$SOURCES $srcdir/src/power/windows/SDL_syspower.c"
  3.3575 +            have_power=yes
  3.3576 +        fi
  3.3577 +        if test x$enable_filesystem = xyes; then
  3.3578 +            AC_DEFINE(SDL_FILESYSTEM_WINDOWS, 1, [ ])
  3.3579 +            SOURCES="$SOURCES $srcdir/src/filesystem/windows/SDL_sysfilesystem.c"
  3.3580 +            have_filesystem=yes
  3.3581 +        fi
  3.3582 +        # Set up files for the thread library
  3.3583 +        if test x$enable_threads = xyes; then
  3.3584 +            AC_DEFINE(SDL_THREAD_WINDOWS, 1, [ ])
  3.3585 +            SOURCES="$SOURCES $srcdir/src/thread/windows/*.c"
  3.3586 +            SOURCES="$SOURCES $srcdir/src/thread/generic/SDL_syscond.c"
  3.3587 +            have_threads=yes
  3.3588 +        fi
  3.3589 +        # Set up files for the timer library
  3.3590 +        if test x$enable_timers = xyes; then
  3.3591 +            AC_DEFINE(SDL_TIMER_WINDOWS, 1, [ ])
  3.3592 +            SOURCES="$SOURCES $srcdir/src/timer/windows/*.c"
  3.3593 +            have_timers=yes
  3.3594 +        fi
  3.3595 +        # Set up files for the shared object loading library
  3.3596 +        if test x$enable_loadso = xyes; then
  3.3597 +            AC_DEFINE(SDL_LOADSO_WINDOWS, 1, [ ])
  3.3598 +            SOURCES="$SOURCES $srcdir/src/loadso/windows/*.c"
  3.3599 +            have_loadso=yes
  3.3600 +        fi
  3.3601 +        # Set up the system libraries we need
  3.3602 +        if test -f /lib/w32api/libuuid.a; then
  3.3603 +            LIBUUID=/lib/w32api/libuuid.a
  3.3604 +        else
  3.3605 +            LIBUUID=-luuid
  3.3606 +        fi
  3.3607 +        EXTRA_LDFLAGS="$EXTRA_LDFLAGS -luser32 -lgdi32 -lwinmm -limm32 -lole32 -loleaut32 -lshell32 -lsetupapi -lversion $LIBUUID -static-libgcc"
  3.3608 +        # The Windows platform requires special setup
  3.3609 +        VERSION_SOURCES="$srcdir/src/main/windows/*.rc"
  3.3610 +        SDLMAIN_SOURCES="$srcdir/src/main/windows/*.c"
  3.3611 +        SDL_CFLAGS="$SDL_CFLAGS -Dmain=SDL_main"
  3.3612 +        SDL_LIBS="-lSDL2main $SDL_LIBS -mwindows"
  3.3613 +
  3.3614 +        # Check to see if this is a mingw or cygwin build
  3.3615 +        have_mingw32=
  3.3616 +        AC_CHECK_LIB(mingw32, main, [have_mingw32=yes])
  3.3617 +        if test x$have_mingw32 = xyes; then
  3.3618 +            SDL_LIBS="-lmingw32 $SDL_LIBS"
  3.3619 +        else
  3.3620 +            SDL_LIBS="-lcygwin $SDL_LIBS"
  3.3621 +        fi
  3.3622 +        ;;
  3.3623 +
  3.3624 +    dnl BeOS support removed after SDL 2.0.1. Haiku still works.  --ryan.
  3.3625 +    *-*-beos*)
  3.3626 +        AC_MSG_ERROR([
  3.3627 +*** BeOS support has been removed as of SDL 2.0.2.
  3.3628 +        ])
  3.3629 +        ;;
  3.3630 +
  3.3631 +    *-*-haiku*)
  3.3632 +        ARCH=haiku
  3.3633 +        ac_default_prefix=/boot/system
  3.3634 +        CheckDummyVideo
  3.3635 +        CheckDiskAudio
  3.3636 +        CheckDummyAudio
  3.3637 +        CheckDLOPEN
  3.3638 +        CheckHaikuVideo
  3.3639 +        CheckHaikuGL
  3.3640 +        CheckPTHREAD
  3.3641 +
  3.3642 +        # Set up files for the audio library
  3.3643 +        if test x$enable_audio = xyes; then
  3.3644 +            AC_DEFINE(SDL_AUDIO_DRIVER_HAIKU, 1, [ ])
  3.3645 +            SOURCES="$SOURCES $srcdir/src/audio/haiku/*.cc"
  3.3646 +            SUMMARY_audio="${SUMMARY_audio} haiku"
  3.3647 +            have_audio=yes
  3.3648 +        fi
  3.3649 +        # Set up files for the joystick library
  3.3650 +        if test x$enable_joystick = xyes; then
  3.3651 +            AC_DEFINE(SDL_JOYSTICK_HAIKU, 1, [ ])
  3.3652 +            SOURCES="$SOURCES $srcdir/src/joystick/haiku/*.cc"
  3.3653 +            have_joystick=yes
  3.3654 +        fi
  3.3655 +        # Set up files for the timer library
  3.3656 +        if test x$enable_timers = xyes; then
  3.3657 +            AC_DEFINE(SDL_TIMER_HAIKU, 1, [ ])
  3.3658 +            SOURCES="$SOURCES $srcdir/src/timer/haiku/*.c"
  3.3659 +            have_timers=yes
  3.3660 +        fi
  3.3661 +        # Set up files for the system power library
  3.3662 +        if test x$enable_power = xyes; then
  3.3663 +            AC_DEFINE(SDL_POWER_HAIKU, 1, [ ])
  3.3664 +            SOURCES="$SOURCES $srcdir/src/power/haiku/*.c"
  3.3665 +            have_power=yes
  3.3666 +        fi
  3.3667 +        # Set up files for the system filesystem library
  3.3668 +        if test x$enable_filesystem = xyes; then
  3.3669 +            AC_DEFINE(SDL_FILESYSTEM_HAIKU, 1, [ ])
  3.3670 +            SOURCES="$SOURCES $srcdir/src/filesystem/haiku/*.cc"
  3.3671 +            have_filesystem=yes
  3.3672 +        fi
  3.3673 +        # The Haiku platform requires special setup.
  3.3674 +        SOURCES="$srcdir/src/main/haiku/*.cc $SOURCES"
  3.3675 +        EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lroot -lbe -lmedia -lgame -ldevice -ltextencoding"
  3.3676 +        # Haiku's x86 spins use libstdc++.r4.so (for binary compat?), but
  3.3677 +        #  other spins, like x86-64, use a more standard "libstdc++.so.*"
  3.3678 +        AC_CHECK_FILE("/boot/system/lib/libstdc++.r4.so", EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lstdc++.r4", EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lstdc++")
  3.3679 +        ;;
  3.3680 +    arm*-apple-darwin*|*-ios-*)
  3.3681 +        ARCH=ios
  3.3682 +
  3.3683 +        CheckVisibilityHidden
  3.3684 +        CheckDeclarationAfterStatement
  3.3685 +        CheckDummyVideo
  3.3686 +        CheckDiskAudio
  3.3687 +        CheckDummyAudio
  3.3688 +        CheckDLOPEN
  3.3689 +        CheckMETAL
  3.3690 +        CheckVulkan
  3.3691 +        CheckPTHREAD
  3.3692 +
  3.3693 +        # Set up files for the audio library
  3.3694 +        if test x$enable_audio = xyes; then
  3.3695 +            AC_DEFINE(SDL_AUDIO_DRIVER_COREAUDIO, 1, [ ])
  3.3696 +            SOURCES="$SOURCES $srcdir/src/audio/coreaudio/*.m"
  3.3697 +            SUMMARY_audio="${SUMMARY_audio} coreaudio"
  3.3698 +            have_audio=yes
  3.3699 +        fi
  3.3700 +        # Set up files for the joystick library
  3.3701 +        if test x$enable_joystick = xyes; then
  3.3702 +            AC_DEFINE(SDL_JOYSTICK_MFI, 1, [ ])
  3.3703 +            SOURCES="$SOURCES $srcdir/src/joystick/iphoneos/*.m"
  3.3704 +            SOURCES="$SOURCES $srcdir/src/joystick/steam/*.c"
  3.3705 +            have_joystick=yes
  3.3706 +        fi
  3.3707 +        # Set up files for the haptic library
  3.3708 +        #if test x$enable_haptic = xyes; then
  3.3709 +        #    SOURCES="$SOURCES $srcdir/src/haptic/darwin/*.c"
  3.3710 +        #    have_haptic=yes
  3.3711 +        #    EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,ForceFeedback"
  3.3712 +        #fi
  3.3713 +        # Set up files for the power library
  3.3714 +        if test x$enable_power = xyes; then
  3.3715 +            AC_DEFINE(SDL_POWER_UIKIT, 1, [ ])
  3.3716 +            SOURCES="$SOURCES $srcdir/src/power/uikit/*.m"
  3.3717 +            have_power=yes
  3.3718 +        fi
  3.3719 +        # Set up files for the filesystem library
  3.3720 +        if test x$enable_filesystem = xyes; then
  3.3721 +            SOURCES="$SOURCES $srcdir/src/filesystem/cocoa/*.m"
  3.3722 +            have_filesystem=yes
  3.3723 +        fi
  3.3724 +        # Set up additional files for the file library
  3.3725 +        if test x$enable_file = xyes; then
  3.3726 +            AC_DEFINE(SDL_FILESYSTEM_COCOA, 1, [ ])
  3.3727 +            SOURCES="$SOURCES $srcdir/src/file/cocoa/*.m"
  3.3728 +        fi
  3.3729 +        # Set up files for the timer library
  3.3730 +        if test x$enable_timers = xyes; then
  3.3731 +            AC_DEFINE(SDL_TIMER_UNIX, 1, [ ])
  3.3732 +            SOURCES="$SOURCES $srcdir/src/timer/unix/*.c"
  3.3733 +            have_timers=yes
  3.3734 +        fi
  3.3735 +        # Set up other core UNIX files
  3.3736 +        SOURCES="$SOURCES $srcdir/src/core/unix/*.c"
  3.3737 +        # The iOS platform requires special setup.
  3.3738 +        AC_DEFINE(SDL_VIDEO_DRIVER_UIKIT, 1, [ ])
  3.3739 +        AC_DEFINE(SDL_VIDEO_OPENGL_ES2, 1, [ ])
  3.3740 +        AC_DEFINE(SDL_VIDEO_OPENGL_ES, 1, [ ])
  3.3741 +        AC_DEFINE(SDL_VIDEO_RENDER_OGL_ES, 1, [ ])
  3.3742 +        AC_DEFINE(SDL_VIDEO_RENDER_OGL_ES2, 1, [ ])
  3.3743 +        SOURCES="$SOURCES $srcdir/src/video/uikit/*.m"
  3.3744 +        EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lm -liconv -lobjc"
  3.3745 +        EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,AVFoundation"
  3.3746 +        EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,AudioToolbox"
  3.3747 +        EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,CoreAudio"
  3.3748 +        EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,CoreGraphics"
  3.3749 +        EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,CoreMotion"
  3.3750 +        EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,Foundation"
  3.3751 +        EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,GameController"
  3.3752 +        EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,OpenGLES"
  3.3753 +        EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,QuartzCore"
  3.3754 +        EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,UIKit"
  3.3755 +
  3.3756 +        if test x$enable_render = xyes -a x$enable_render_metal = xyes; then
  3.3757 +            EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,Metal"
  3.3758 +        fi
  3.3759 +        ;;
  3.3760 +    *-*-darwin* )
  3.3761 +        # This could be either full "Mac OS X", or plain "Darwin" which is
  3.3762 +        # just the OS X kernel sans upper layers like Carbon and Cocoa.
  3.3763 +        # Next line is broken, and a few files below require Mac OS X (full)
  3.3764 +        ARCH=macosx
  3.3765 +
  3.3766 +        # Mac OS X builds with both the Carbon and OSX APIs at the moment
  3.3767 +        EXTRA_CFLAGS="$EXTRA_CFLAGS -DTARGET_API_MAC_CARBON"
  3.3768 +        EXTRA_CFLAGS="$EXTRA_CFLAGS -DTARGET_API_MAC_OSX"
  3.3769 +
  3.3770 +        CheckVisibilityHidden
  3.3771 +        CheckDeclarationAfterStatement
  3.3772 +        CheckDummyVideo
  3.3773 +        CheckDiskAudio
  3.3774 +        CheckDummyAudio
  3.3775 +        CheckDLOPEN
  3.3776 +        CheckCOCOA
  3.3777 +        CheckMETAL
  3.3778 +        CheckX11
  3.3779 +        CheckMacGL
  3.3780 +        CheckMacGLES
  3.3781 +        CheckOpenGLX11
  3.3782 +        CheckVulkan
  3.3783 +        CheckPTHREAD
  3.3784 +
  3.3785 +        # Set up files for the audio library
  3.3786 +        if test x$enable_audio = xyes; then
  3.3787 +            AC_DEFINE(SDL_AUDIO_DRIVER_COREAUDIO, 1, [ ])
  3.3788 +            SOURCES="$SOURCES $srcdir/src/audio/coreaudio/*.m"
  3.3789 +            EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,CoreAudio -Wl,-framework,AudioToolbox"
  3.3790 +            SUMMARY_audio="${SUMMARY_audio} coreaudio"
  3.3791 +            have_audio=yes
  3.3792 +        fi
  3.3793 +        # Set up files for the joystick library
  3.3794 +        if test x$enable_joystick = xyes; then
  3.3795 +            AC_DEFINE(SDL_JOYSTICK_IOKIT, 1, [ ])
  3.3796 +            AC_DEFINE(SDL_JOYSTICK_HIDAPI, 1, [ ])
  3.3797 +            SOURCES="$SOURCES $srcdir/src/joystick/darwin/*.c"
  3.3798 +            SOURCES="$SOURCES $srcdir/src/joystick/hidapi/*.c"
  3.3799 +            SOURCES="$SOURCES $srcdir/src/hidapi/mac/hid.c"
  3.3800 +            EXTRA_CFLAGS="$EXTRA_CFLAGS -I$srcdir/src/hidapi/hidapi"
  3.3801 +            have_joystick=yes
  3.3802 +        fi
  3.3803 +        # Set up files for the haptic library
  3.3804 +        if test x$enable_haptic = xyes; then
  3.3805 +            AC_DEFINE(SDL_HAPTIC_IOKIT, 1, [ ])
  3.3806 +            SOURCES="$SOURCES $srcdir/src/haptic/darwin/*.c"
  3.3807 +            EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,ForceFeedback"
  3.3808 +            have_haptic=yes
  3.3809 +        fi
  3.3810 +        # Set up files for the power library
  3.3811 +        if test x$enable_power = xyes; then
  3.3812 +            AC_DEFINE(SDL_POWER_MACOSX, 1, [ ])
  3.3813 +            SOURCES="$SOURCES $srcdir/src/power/macosx/*.c"
  3.3814 +            have_power=yes
  3.3815 +        fi
  3.3816 +        # Set up files for the filesystem library
  3.3817 +        if test x$enable_filesystem = xyes; then
  3.3818 +            AC_DEFINE(SDL_FILESYSTEM_COCOA, 1, [ ])
  3.3819 +            SOURCES="$SOURCES $srcdir/src/filesystem/cocoa/*.m"
  3.3820 +            have_filesystem=yes
  3.3821 +        fi
  3.3822 +        # Set up files for the timer library
  3.3823 +        if test x$enable_timers = xyes; then
  3.3824 +            AC_DEFINE(SDL_TIMER_UNIX, 1, [ ])
  3.3825 +            SOURCES="$SOURCES $srcdir/src/timer/unix/*.c"
  3.3826 +            have_timers=yes
  3.3827 +        fi
  3.3828 +        # Set up additional files for the file library
  3.3829 +        if test x$enable_file = xyes; then
  3.3830 +            SOURCES="$SOURCES $srcdir/src/file/cocoa/*.m"
  3.3831 +        fi
  3.3832 +        # Set up other core UNIX files
  3.3833 +        SOURCES="$SOURCES $srcdir/src/core/unix/*.c"
  3.3834 +        # The Mac OS X platform requires special setup.
  3.3835 +        EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lobjc"
  3.3836 +        EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,CoreVideo"
  3.3837 +        EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,Cocoa"
  3.3838 +        EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,Carbon"
  3.3839 +        EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,IOKit"
  3.3840 +
  3.3841 +        if test x$enable_render = xyes -a x$enable_render_metal = xyes; then
  3.3842 +            EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-weak_framework,QuartzCore -Wl,-weak_framework,Metal"
  3.3843 +        fi
  3.3844 +        ;;
  3.3845 +    *-nacl|*-pnacl)
  3.3846 +        ARCH=nacl
  3.3847 +        CheckNativeClient
  3.3848 +        CheckDummyAudio
  3.3849 +        CheckDummyVideo
  3.3850 +        CheckInputEvents
  3.3851 +        CheckPTHREAD
  3.3852 +
  3.3853 +        # Set up files for the timer library
  3.3854 +        if test x$enable_timers = xyes; then
  3.3855 +            AC_DEFINE(SDL_TIMER_UNIX, 1, [ ])
  3.3856 +            SOURCES="$SOURCES $srcdir/src/timer/unix/*.c"
  3.3857 +            have_timers=yes
  3.3858 +        fi
  3.3859 +        
  3.3860 +        if test x$enable_filesystem = xyes; then
  3.3861 +            AC_DEFINE(SDL_FILESYSTEM_NACL, 1, [ ])
  3.3862 +            SOURCES="$SOURCES $srcdir/src/filesystem/nacl/*.c"
  3.3863 +            have_filesystem=yes
  3.3864 +        fi
  3.3865 +        ;;
  3.3866 +    *-*-emscripten* )
  3.3867 +        if test x$enable_video = xyes; then
  3.3868 +            AC_DEFINE(SDL_VIDEO_DRIVER_EMSCRIPTEN, 1, [ ])
  3.3869 +            SOURCES="$SOURCES $srcdir/src/video/emscripten/*.c"
  3.3870 +            have_video=yes
  3.3871 +            SUMMARY_video="${SUMMARY_video} emscripten"
  3.3872 +        fi
  3.3873 +
  3.3874 +        if test x$enable_audio = xyes; then
  3.3875 +            AC_DEFINE(SDL_AUDIO_DRIVER_EMSCRIPTEN, 1, [ ])
  3.3876 +            SOURCES="$SOURCES $srcdir/src/audio/emscripten/*.c"
  3.3877 +            have_audio=yes
  3.3878 +            SUMMARY_audio="${SUMMARY_audio} emscripten"
  3.3879 +        fi
  3.3880 +
  3.3881 +        CheckVisibilityHidden
  3.3882 +        CheckDeclarationAfterStatement
  3.3883 +        CheckDummyVideo
  3.3884 +        CheckDiskAudio
  3.3885 +        CheckDummyAudio
  3.3886 +        CheckDLOPEN
  3.3887 +        CheckClockGettime
  3.3888 +        CheckEmscriptenGLES
  3.3889 +
  3.3890 +         # Set up files for the power library
  3.3891 +        if test x$enable_power = xyes; then
  3.3892 +            AC_DEFINE(SDL_POWER_EMSCRIPTEN, 1, [ ])
  3.3893 +            SOURCES="$SOURCES $srcdir/src/power/emscripten/*.c"
  3.3894 +            have_power=yes
  3.3895 +        fi
  3.3896 +        
  3.3897 +        # Set up files for the power library
  3.3898 +        if test x$enable_joystick = xyes; then
  3.3899 +            AC_DEFINE(SDL_JOYSTICK_EMSCRIPTEN, 1, [ ])
  3.3900 +            SOURCES="$SOURCES $srcdir/src/joystick/emscripten/*.c"
  3.3901 +            have_joystick=yes
  3.3902 +        fi
  3.3903 +
  3.3904 +        # Set up files for the filesystem library
  3.3905 +        if test x$enable_filesystem = xyes; then
  3.3906 +            AC_DEFINE(SDL_FILESYSTEM_EMSCRIPTEN, 1, [ ])
  3.3907 +            SOURCES="$SOURCES $srcdir/src/filesystem/emscripten/*.c"
  3.3908 +            have_filesystem=yes
  3.3909 +        fi
  3.3910 +        # Set up files for the timer library
  3.3911 +        if test x$enable_timers = xyes; then
  3.3912 +            AC_DEFINE(SDL_TIMER_UNIX, 1, [ ])
  3.3913 +            SOURCES="$SOURCES $srcdir/src/timer/unix/*.c"
  3.3914 +            have_timers=yes
  3.3915 +        fi
  3.3916 +        ;;
  3.3917 +    *)
  3.3918 +        AC_MSG_ERROR([
  3.3919 +*** Unsupported host:  Please add to configure.ac
  3.3920 +        ])
  3.3921 +        ;;
  3.3922 +esac
  3.3923 +
  3.3924 +# Verify that we have all the platform specific files we need
  3.3925 +
  3.3926 +if test x$have_joystick != xyes; then
  3.3927 +    if test x$enable_joystick = xyes; then
  3.3928 +        AC_DEFINE(SDL_JOYSTICK_DUMMY, 1, [ ])
  3.3929 +    fi
  3.3930 +    SOURCES="$SOURCES $srcdir/src/joystick/dummy/*.c"
  3.3931 +fi
  3.3932 +if test x$have_haptic != xyes; then
  3.3933 +    if test x$enable_haptic = xyes; then
  3.3934 +        AC_DEFINE(SDL_HAPTIC_DUMMY, 1, [ ])
  3.3935 +    fi
  3.3936 +    SOURCES="$SOURCES $srcdir/src/haptic/dummy/*.c"
  3.3937 +fi
  3.3938 +if test x$have_sensor != xyes; then
  3.3939 +    if test x$enable_sensor = xyes; then
  3.3940 +        AC_DEFINE(SDL_SENSOR_DUMMY, 1, [ ])
  3.3941 +    fi
  3.3942 +    SOURCES="$SOURCES $srcdir/src/sensor/dummy/*.c"
  3.3943 +fi
  3.3944 +if test x$have_threads != xyes; then
  3.3945 +    if test x$enable_threads = xyes; then
  3.3946 +        AC_DEFINE(SDL_THREADS_DISABLED, 1, [ ])
  3.3947 +    fi
  3.3948 +    SOURCES="$SOURCES $srcdir/src/thread/generic/*.c"
  3.3949 +fi
  3.3950 +if test x$have_timers != xyes; then
  3.3951 +    if test x$enable_timers = xyes; then
  3.3952 +        AC_DEFINE(SDL_TIMERS_DISABLED, 1, [ ])
  3.3953 +    fi
  3.3954 +    SOURCES="$SOURCES $srcdir/src/timer/dummy/*.c"
  3.3955 +fi
  3.3956 +if test x$have_filesystem != xyes; then
  3.3957 +    if test x$enable_filesystem = xyes; then
  3.3958 +        AC_DEFINE(SDL_FILESYSTEM_DISABLED, 1, [ ])
  3.3959 +    fi
  3.3960 +    SOURCES="$SOURCES $srcdir/src/filesystem/dummy/*.c"
  3.3961 +fi
  3.3962 +if test x$have_loadso != xyes; then
  3.3963 +    if test x$enable_loadso = xyes; then
  3.3964 +        AC_DEFINE(SDL_LOADSO_DISABLED, 1, [ ])
  3.3965 +    fi
  3.3966 +    SOURCES="$SOURCES $srcdir/src/loadso/dummy/*.c"
  3.3967 +fi
  3.3968 +if test x$SDLMAIN_SOURCES = x; then
  3.3969 +    SDLMAIN_SOURCES="$srcdir/src/main/dummy/*.c"
  3.3970 +fi
  3.3971 +SDLTEST_SOURCES="$srcdir/src/test/*.c"
  3.3972 +
  3.3973 +if test x$video_wayland = xyes; then
  3.3974 +    WAYLAND_PROTOCOLS=`cd $srcdir/wayland-protocols ; for p in *.xml ; do echo -n "\$p" |sed 's,\\.xml\$, ,g' ; done`
  3.3975 +    WAYLAND_PROTOCOLS_SOURCES=`for p in $WAYLAND_PROTOCOLS ; do echo -n "\\$(gen)/\$p-protocol.c " ; done`
  3.3976 +    WAYLAND_PROTOCOLS_HEADERS=`for p in $WAYLAND_PROTOCOLS ; do echo -n "\\$(gen)/\$p-client-protocol.h " ; done`
  3.3977 +    GEN_SOURCES="$GEN_SOURCES $WAYLAND_PROTOCOLS_SOURCES"
  3.3978 +    GEN_HEADERS="$GEN_HEADERS $WAYLAND_PROTOCOLS_HEADERS"
  3.3979 +
  3.3980 +    WAYLAND_PROTOCOLS_DEPENDS=`for p in $WAYLAND_PROTOCOLS ; do\
  3.3981 +        echo ;\
  3.3982 +        echo "\\$(gen)/\$p-client-protocol.h: \\$(srcdir)/wayland-protocols/\$p.xml" ;\
  3.3983 +        echo "	@\\$(SHELL) \\$(auxdir)/mkinstalldirs \\$(gen)" ;\
  3.3984 +        echo "	\\$(RUN_CMD_GEN)\\$(WAYLAND_SCANNER) client-header \\$< \\$@" ;\
  3.3985 +        echo ;\
  3.3986 +        echo "\\$(gen)/\$p-protocol.c: \\$(srcdir)/wayland-protocols/\$p.xml" ;\
  3.3987 +        echo "	@\\$(SHELL) \\$(auxdir)/mkinstalldirs \\$(gen)" ;\
  3.3988 +        echo "	\\$(RUN_CMD_GEN)\\$(WAYLAND_SCANNER) code \\$< \\$@" ;\
  3.3989 +        echo ;\
  3.3990 +        echo "\\$(objects)/\$p-protocol.lo: \\$(gen)/\$p-protocol.c \\$(gen)/\$p-client-protocol.h" ;\
  3.3991 +        echo "	\\$(RUN_CMD_CC)\\$(LIBTOOL) --tag=CC --mode=compile \\$(CC) \\$(CFLAGS) \\$(EXTRA_CFLAGS) $DEPENDENCY_TRACKING_OPTIONS -c \\$< -o \\$@" ;\
  3.3992 +        done ;\
  3.3993 +        echo ;\
  3.3994 +        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`
  3.3995 +fi
  3.3996 +
  3.3997 +OBJECTS=`echo $SOURCES`
  3.3998 +DEPENDS=`echo $SOURCES | tr ' ' '\n'`
  3.3999 +for EXT in asm cc m c S; do
  3.4000 +    OBJECTS=`echo "$OBJECTS" | sed 's,[[^ ]]*/\([[^ ]]*\)\.'$EXT',$(objects)/\1.lo,g'`
  3.4001 +    DEPENDS=`echo "$DEPENDS" | sed "s,^\\([[^ ]]*\\)/\\([[^ ]]*\\)\\.$EXT\\$,\\\\
  3.4002 +\\$(objects)/\\2.lo: \\1/\\2.$EXT \\$(objects)/.created\\\\
  3.4003 +	\\$(RUN_CMD_CC)\\$(LIBTOOL) --tag=CC --mode=compile \\$(CC) \\$(CFLAGS) \\$(EXTRA_CFLAGS) $DEPENDENCY_TRACKING_OPTIONS -c \\$< -o \\$@,g"`
  3.4004 +done
  3.4005 +
  3.4006 +GEN_OBJECTS=`echo "$GEN_SOURCES" | sed 's,[[^ ]]*/\([[^ ]]*\)\.c,$(objects)/\1.lo,g'`
  3.4007 +
  3.4008 +VERSION_OBJECTS=`echo $VERSION_SOURCES`
  3.4009 +VERSION_DEPENDS=`echo $VERSION_SOURCES`
  3.4010 +VERSION_OBJECTS=`echo "$VERSION_OBJECTS" | sed 's,[[^ ]]*/\([[^ ]]*\)\.rc,$(objects)/\1.o,g'`
  3.4011 +VERSION_DEPENDS=`echo "$VERSION_DEPENDS" | sed "s,\\([[^ ]]*\\)/\\([[^ ]]*\\)\\.rc,\\\\
  3.4012 +\\$(objects)/\\2.o: \\1/\\2.rc\\\\
  3.4013 +	\\$(WINDRES) \\$< \\$@,g"`
  3.4014 +
  3.4015 +SDLMAIN_OBJECTS=`echo $SDLMAIN_SOURCES`
  3.4016 +SDLMAIN_DEPENDS=`echo $SDLMAIN_SOURCES`
  3.4017 +SDLMAIN_OBJECTS=`echo "$SDLMAIN_OBJECTS" | sed 's,[[^ ]]*/\([[^ ]]*\)\.c,$(objects)/\1.lo,g'`
  3.4018 +SDLMAIN_DEPENDS=`echo "$SDLMAIN_DEPENDS" | sed "s,\\([[^ ]]*\\)/\\([[^ ]]*\\)\\.c,\\\\
  3.4019 +\\$(objects)/\\2.lo: \\1/\\2.c \\$(objects)/.created\\\\
  3.4020 +	\\$(RUN_CMD_CC)\\$(LIBTOOL) --tag=CC --mode=compile \\$(CC) \\$(CFLAGS) \\$(EXTRA_CFLAGS) $DEPENDENCY_TRACKING_OPTIONS -c \\$< -o \\$@,g"`
  3.4021 +
  3.4022 +SDLTEST_OBJECTS=`echo $SDLTEST_SOURCES`
  3.4023 +SDLTEST_DEPENDS=`echo $SDLTEST_SOURCES`
  3.4024 +SDLTEST_OBJECTS=`echo "$SDLTEST_OBJECTS" | sed 's,[[^ ]]*/\([[^ ]]*\)\.c,$(objects)/\1.lo,g'`
  3.4025 +SDLTEST_DEPENDS=`echo "$SDLTEST_DEPENDS" | sed "s,\\([[^ ]]*\\)/\\([[^ ]]*\\)\\.c,\\\\
  3.4026 +\\$(objects)/\\2.lo: \\1/\\2.c \\$(objects)/.created\\\\
  3.4027 +	\\$(RUN_CMD_CC)\\$(LIBTOOL) --tag=CC --mode=compile \\$(CC) \\$(CFLAGS) \\$(EXTRA_CFLAGS) $DEPENDENCY_TRACKING_OPTIONS -c \\$< -o \\$@,g"`
  3.4028 +
  3.4029 +# Set runtime shared library paths as needed
  3.4030 +
  3.4031 +if test "x$enable_rpath" = "xyes"; then
  3.4032 +  if test $ARCH = bsdi -o $ARCH = freebsd -o $ARCH = linux -o $ARCH = netbsd; then
  3.4033 +    SDL_RLD_FLAGS="-Wl,-rpath,\${libdir}"
  3.4034 +
  3.4035 +    AC_MSG_CHECKING(for linker option --enable-new-dtags)
  3.4036 +    have_enable_new_dtags=no
  3.4037 +    save_LDFLAGS="$LDFLAGS"
  3.4038 +    LDFLAGS="$LDFLAGS -Wl,--enable-new-dtags"
  3.4039 +    AC_TRY_LINK([
  3.4040 +    ],[
  3.4041 +    ],[
  3.4042 +    have_enable_new_dtags=yes
  3.4043 +    SDL_RLD_FLAGS="$SDL_RLD_FLAGS -Wl,--enable-new-dtags"
  3.4044 +    ])
  3.4045 +    LDFLAGS="$save_LDFLAGS"
  3.4046 +    AC_MSG_RESULT($have_enable_new_dtags)
  3.4047 +  fi
  3.4048 +  if test $ARCH = solaris; then
  3.4049 +    SDL_RLD_FLAGS="-R\${libdir}"
  3.4050 +  fi
  3.4051 +else
  3.4052 +  SDL_RLD_FLAGS=""
  3.4053 +fi
  3.4054 +
  3.4055 +SDL_STATIC_LIBS="$SDL_LIBS $EXTRA_LDFLAGS"
  3.4056 +
  3.4057 +dnl Expand the cflags and libraries needed by apps using SDL
  3.4058 +AC_SUBST(SDL_CFLAGS)
  3.4059 +AC_SUBST(SDL_LIBS)
  3.4060 +AC_SUBST(SDL_STATIC_LIBS)
  3.4061 +AC_SUBST(SDL_RLD_FLAGS)
  3.4062 +if test x$enable_shared = xyes; then
  3.4063 +    ENABLE_SHARED_TRUE=
  3.4064 +    ENABLE_SHARED_FALSE="#"
  3.4065 +else
  3.4066 +    ENABLE_SHARED_TRUE="#"
  3.4067 +    ENABLE_SHARED_FALSE=
  3.4068 +fi
  3.4069 +if test x$enable_static = xyes; then
  3.4070 +    ENABLE_STATIC_TRUE=
  3.4071 +    ENABLE_STATIC_FALSE="#"
  3.4072 +else
  3.4073 +    ENABLE_STATIC_TRUE="#"
  3.4074 +    ENABLE_STATIC_FALSE=
  3.4075 +fi
  3.4076 +AC_SUBST(ENABLE_SHARED_TRUE)
  3.4077 +AC_SUBST(ENABLE_SHARED_FALSE)
  3.4078 +AC_SUBST(ENABLE_STATIC_TRUE)
  3.4079 +AC_SUBST(ENABLE_STATIC_FALSE)
  3.4080 +
  3.4081 +dnl Expand the sources and objects needed to build the library
  3.4082 +AC_SUBST(ac_aux_dir)
  3.4083 +AC_SUBST(INCLUDE)
  3.4084 +AC_SUBST(OBJECTS)
  3.4085 +AC_SUBST(GEN_HEADERS)
  3.4086 +AC_SUBST(GEN_OBJECTS)
  3.4087 +AC_SUBST(VERSION_OBJECTS)
  3.4088 +AC_SUBST(SDLMAIN_OBJECTS)
  3.4089 +AC_SUBST(SDLTEST_OBJECTS)
  3.4090 +AC_SUBST(BUILD_CFLAGS)
  3.4091 +AC_SUBST(EXTRA_CFLAGS)
  3.4092 +AC_SUBST(BUILD_LDFLAGS)
  3.4093 +AC_SUBST(EXTRA_LDFLAGS)
  3.4094 +AC_SUBST(WINDRES)
  3.4095 +AC_SUBST(WAYLAND_SCANNER)
  3.4096 +
  3.4097 +cat >Makefile.rules <<__EOF__
  3.4098 +
  3.4099 +# Build rules for objects
  3.4100 +-include \$(OBJECTS:.lo=.d)
  3.4101 +
  3.4102 +# Special dependency for SDL.c, since it depends on SDL_revision.h
  3.4103 +$srcdir/src/SDL.c: update-revision
  3.4104 +$DEPENDS
  3.4105 +$VERSION_DEPENDS
  3.4106 +$SDLMAIN_DEPENDS
  3.4107 +$SDLTEST_DEPENDS
  3.4108 +$WAYLAND_PROTOCOLS_DEPENDS
  3.4109 +__EOF__
  3.4110 +
  3.4111 +AC_CONFIG_FILES([
  3.4112 +    Makefile:Makefile.in:Makefile.rules sdl2-config sdl2-config.cmake SDL2.spec sdl2.pc
  3.4113 +])
  3.4114 +AC_CONFIG_COMMANDS([sdl2_config],[chmod a+x sdl2-config])
  3.4115 +
  3.4116 +SUMMARY="SDL2 Configure Summary:\n"
  3.4117 +if test x$enable_shared = xyes; then
  3.4118 +    SUMMARY="${SUMMARY}Building Shared Libraries\n"
  3.4119 +fi
  3.4120 +if test x$enable_static = xyes; then
  3.4121 +    SUMMARY="${SUMMARY}Building Static Libraries\n"
  3.4122 +fi
  3.4123 +SUMMARY="${SUMMARY}Enabled modules :${SUMMARY_modules}\n"
  3.4124 +SUMMARY="${SUMMARY}Assembly Math   :${SUMMARY_math}\n" 
  3.4125 +SUMMARY="${SUMMARY}Audio drivers   :${SUMMARY_audio}\n"
  3.4126 +SUMMARY="${SUMMARY}Video drivers   :${SUMMARY_video}\n"
  3.4127 +if test x$have_x = xyes; then
  3.4128 +    SUMMARY="${SUMMARY}X11 libraries   :${SUMMARY_video_x11}\n"
  3.4129 +fi
  3.4130 +SUMMARY="${SUMMARY}Input drivers   :${SUMMARY_input}\n"
  3.4131 +if test x$have_samplerate_h_hdr = xyes; then
  3.4132 +    SUMMARY="${SUMMARY}Using libsamplerate : YES\n"
  3.4133 +else
  3.4134 +    SUMMARY="${SUMMARY}Using libsamplerate : NO\n"
  3.4135 +fi
  3.4136 +if test x$have_libudev_h_hdr = xyes; then
  3.4137 +    SUMMARY="${SUMMARY}Using libudev       : YES\n"
  3.4138 +else
  3.4139 +    SUMMARY="${SUMMARY}Using libudev       : NO\n"
  3.4140 +fi
  3.4141 +if test x$have_dbus_dbus_h_hdr = xyes; then
  3.4142 +    SUMMARY="${SUMMARY}Using dbus          : YES\n"
  3.4143 +else
  3.4144 +    SUMMARY="${SUMMARY}Using dbus          : NO\n"
  3.4145 +fi
  3.4146 +if test x$enable_ime = xyes; then
  3.4147 +    SUMMARY="${SUMMARY}Using ime           : YES\n"
  3.4148 +else
  3.4149 +    SUMMARY="${SUMMARY}Using ime           : NO\n"
  3.4150 +fi
  3.4151 +if test x$have_ibus_ibus_h_hdr = xyes; then
  3.4152 +    SUMMARY="${SUMMARY}Using ibus          : YES\n"
  3.4153 +else
  3.4154 +    SUMMARY="${SUMMARY}Using ibus          : NO\n"
  3.4155 +fi
  3.4156 +if test x$have_fcitx_frontend_h_hdr = xyes; then
  3.4157 +    SUMMARY="${SUMMARY}Using fcitx         : YES\n"
  3.4158 +else
  3.4159 +    SUMMARY="${SUMMARY}Using fcitx         : NO\n"
  3.4160 +fi
  3.4161 +AC_CONFIG_COMMANDS([summary], [echo -en "$SUMMARY"], [SUMMARY="$SUMMARY"])
  3.4162 +
  3.4163 +AC_OUTPUT
     4.1 --- a/configure.in	Wed Mar 27 08:17:05 2019 -0700
     4.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.3 @@ -1,4160 +0,0 @@
     4.4 -dnl Process this file with autoconf to produce a configure script.
     4.5 -AC_INIT(README.txt)
     4.6 -AC_CONFIG_HEADER(include/SDL_config.h)
     4.7 -AC_CONFIG_AUX_DIR(build-scripts)
     4.8 -AC_CONFIG_MACRO_DIR([acinclude])
     4.9 -
    4.10 -dnl Save the CFLAGS to see whether they were passed in or generated
    4.11 -orig_CFLAGS="$CFLAGS"
    4.12 -
    4.13 -dnl Set various version strings - taken gratefully from the GTk sources
    4.14 -#
    4.15 -# Making releases:
    4.16 -# Edit include/SDL_version.h and change the version, then:
    4.17 -#   SDL_MICRO_VERSION += 1;
    4.18 -#   SDL_INTERFACE_AGE += 1;
    4.19 -#   SDL_BINARY_AGE += 1;
    4.20 -# if any functions have been added, set SDL_INTERFACE_AGE to 0.
    4.21 -# if backwards compatibility has been broken,
    4.22 -# set SDL_BINARY_AGE and SDL_INTERFACE_AGE to 0.
    4.23 -#
    4.24 -SDL_MAJOR_VERSION=2
    4.25 -SDL_MINOR_VERSION=0
    4.26 -SDL_MICRO_VERSION=9
    4.27 -SDL_INTERFACE_AGE=0
    4.28 -SDL_BINARY_AGE=9
    4.29 -SDL_VERSION=$SDL_MAJOR_VERSION.$SDL_MINOR_VERSION.$SDL_MICRO_VERSION
    4.30 -
    4.31 -AC_SUBST(SDL_MAJOR_VERSION)
    4.32 -AC_SUBST(SDL_MINOR_VERSION)
    4.33 -AC_SUBST(SDL_MICRO_VERSION)
    4.34 -AC_SUBST(SDL_INTERFACE_AGE)
    4.35 -AC_SUBST(SDL_BINARY_AGE)
    4.36 -AC_SUBST(SDL_VERSION)
    4.37 -
    4.38 -# libtool versioning
    4.39 -LT_INIT([win32-dll])
    4.40 -
    4.41 -LT_RELEASE=$SDL_MAJOR_VERSION.$SDL_MINOR_VERSION
    4.42 -LT_CURRENT=`expr $SDL_MICRO_VERSION - $SDL_INTERFACE_AGE`
    4.43 -LT_REVISION=$SDL_INTERFACE_AGE
    4.44 -LT_AGE=`expr $SDL_BINARY_AGE - $SDL_INTERFACE_AGE`
    4.45 -m4_pattern_allow([^LT_])
    4.46 -
    4.47 -AC_SUBST(LT_RELEASE)
    4.48 -AC_SUBST(LT_CURRENT)
    4.49 -AC_SUBST(LT_REVISION)
    4.50 -AC_SUBST(LT_AGE)
    4.51 -
    4.52 -dnl Detect the canonical build and host environments
    4.53 -dnl AC_CANONICAL_HOST
    4.54 -
    4.55 -dnl Check for tools
    4.56 -AC_PROG_LIBTOOL
    4.57 -AC_PROG_CC
    4.58 -AC_PROG_CXX
    4.59 -AC_PROG_INSTALL
    4.60 -AC_PROG_MAKE_SET
    4.61 -AC_CHECK_TOOL(WINDRES, [windres], [:])
    4.62 -PKG_PROG_PKG_CONFIG
    4.63 -
    4.64 -dnl Make sure that srcdir is a full pathname
    4.65 -case "$host" in
    4.66 -    *-*-mingw32*)
    4.67 -        # Except on msys, where make can't handle full pathnames (bug 1972)
    4.68 -        ;;
    4.69 -    *)
    4.70 -        srcdir=`cd $srcdir && pwd`
    4.71 -        ;;
    4.72 -esac
    4.73 -
    4.74 -dnl Set up the compiler and linker flags
    4.75 -INCLUDE="-I$srcdir/include -idirafter $srcdir/src/video/khronos"
    4.76 -if test x$srcdir != x.; then
    4.77 -    INCLUDE="-Iinclude $INCLUDE"
    4.78 -elif test -d .hg; then
    4.79 -    AC_MSG_ERROR([
    4.80 -*** When building from Mercurial you should configure and build in a
    4.81 -    separate directory so you don't clobber SDL_config.h, SDL_revision.h
    4.82 -])
    4.83 -fi
    4.84 -BASE_CFLAGS=""
    4.85 -BASE_LDFLAGS=""
    4.86 -case "$host" in
    4.87 -    *-*-cygwin*)
    4.88 -        # We build SDL on cygwin without the UNIX emulation layer
    4.89 -        save_CFLAGS="$CFLAGS"
    4.90 -        have_no_cygwin=no
    4.91 -        AC_MSG_CHECKING(for GCC -mno-cygwin option)
    4.92 -        CFLAGS="$save_CFLAGS -mno-cygwin"
    4.93 -
    4.94 -        AC_TRY_COMPILE([
    4.95 -        ],[
    4.96 -        ],[
    4.97 -        have_no_cygwin=yes
    4.98 -        ])
    4.99 -        AC_MSG_RESULT($have_no_cygwin)
   4.100 -        CFLAGS="$save_CFLAGS"
   4.101 -
   4.102 -        if test x$have_no_cygwin = xyes; then
   4.103 -            BASE_CFLAGS="-mno-cygwin"
   4.104 -            BASE_LDFLAGS="-mno-cygwin"
   4.105 -        fi
   4.106 -        BASE_CFLAGS="$BASE_CFLAGS -I/usr/include/mingw"
   4.107 -        ;;
   4.108 -esac
   4.109 -# Uncomment the following line if you want to force SDL and applications
   4.110 -# built with it to be compiled for a particular architecture.
   4.111 -#AX_GCC_ARCHFLAG([no], [BASE_CFLAGS="$BASE_CFLAGS $ax_cv_gcc_archflag]")
   4.112 -BUILD_CFLAGS="$CFLAGS $CPPFLAGS -DUSING_GENERATED_CONFIG_H"
   4.113 -# The default optimization for SDL is -O3 (Bug #31)
   4.114 -if test "x$orig_CFLAGS" = x; then
   4.115 -    BUILD_CFLAGS=`echo $BUILD_CFLAGS | sed 's/-O2/-O3/'`
   4.116 -fi
   4.117 -EXTRA_CFLAGS="$INCLUDE $BASE_CFLAGS"
   4.118 -BUILD_LDFLAGS="$LDFLAGS"
   4.119 -EXTRA_LDFLAGS="$BASE_LDFLAGS"
   4.120 -## These are common directories to find software packages
   4.121 -#for path in /usr/freeware /usr/pkg /usr/X11R6 /usr/local; do
   4.122 -#    if test -d $path/include; then
   4.123 -#        EXTRA_CFLAGS="$EXTRA_CFLAGS -I$path/include"
   4.124 -#    fi
   4.125 -#    if test -d $path/lib; then
   4.126 -#        EXTRA_LDFLAGS="$EXTRA_LDFLAGS -L$path/lib"
   4.127 -#    fi
   4.128 -#done
   4.129 -SDL_CFLAGS="$BASE_CFLAGS"
   4.130 -SDL_LIBS="-lSDL2"
   4.131 -if test "x$BASE_LDFLAGS" != x; then
   4.132 -    SDL_LIBS="$SDL_LIBS $BASE_LDFLAGS"
   4.133 -fi
   4.134 -if test "x$EXTRA_CFLAGS" != x; then
   4.135 -    CPPFLAGS="$CPPFLAGS $EXTRA_CFLAGS"
   4.136 -    CFLAGS="$CFLAGS $EXTRA_CFLAGS"
   4.137 -fi
   4.138 -if test "x$EXTRA_LDFLAGS" != x; then
   4.139 -    LDFLAGS="$LDFLAGS $EXTRA_LDFLAGS"
   4.140 -fi
   4.141 -
   4.142 -dnl set this to use on systems that use lib64 instead of lib
   4.143 -base_libdir=`echo \${libdir} | sed 's/.*\/\(.*\)/\1/; q'`
   4.144 -
   4.145 -dnl Function to find a library in the compiler search path
   4.146 -find_lib()
   4.147 -{
   4.148 -    gcc_bin_path=[`$CC -print-search-dirs 2>/dev/null | fgrep programs: | sed 's/[^=]*=\(.*\)/\1/' | sed 's/:/ /g'`]
   4.149 -    gcc_lib_path=[`$CC -print-search-dirs 2>/dev/null | fgrep libraries: | sed 's/[^=]*=\(.*\)/\1/' | sed 's/:/ /g'`]
   4.150 -    env_lib_path=[`echo $LIBS $LDFLAGS $* | sed 's/-L[ ]*//g'`]
   4.151 -    if test "$cross_compiling" = yes; then
   4.152 -        host_lib_path=""
   4.153 -    else
   4.154 -        host_lib_path="/usr/$base_libdir /usr/local/$base_libdir"
   4.155 -    fi
   4.156 -    for path in $env_lib_path $gcc_bin_path $gcc_lib_path $host_lib_path; do
   4.157 -        lib=[`ls -- $path/$1 2>/dev/null | sed -e '/\.so\..*\./d' -e 's,.*/,,' | sort | tail -1`]
   4.158 -        if test x$lib != x; then
   4.159 -            echo $lib
   4.160 -            return
   4.161 -        fi
   4.162 -    done
   4.163 -    # Try again, this time allowing more than one version digit after the .so
   4.164 -    for path in $env_lib_path $gcc_bin_path $gcc_lib_path $host_lib_path; do
   4.165 -        lib=[`ls -- $path/$1 2>/dev/null | sed -e 's,.*/,,' | sort | tail -1`]
   4.166 -        if test x$lib != x; then
   4.167 -            echo $lib
   4.168 -            return
   4.169 -        fi
   4.170 -    done
   4.171 -}
   4.172 -
   4.173 -dnl Check for compiler characteristics
   4.174 -AC_C_CONST
   4.175 -AC_C_INLINE
   4.176 -AC_C_VOLATILE
   4.177 -
   4.178 -dnl See whether we want assertions for debugging/sanity checking SDL itself.
   4.179 -AC_ARG_ENABLE(assertions,
   4.180 -AS_HELP_STRING([--enable-assertions],
   4.181 -               [Enable internal sanity checks (auto/disabled/release/enabled/paranoid) [[default=auto]]]),
   4.182 -              , enable_assertions=auto)
   4.183 -case "$enable_assertions" in
   4.184 -    auto) # Use optimization settings to determine assertion level
   4.185 -        ;;
   4.186 -    disabled)
   4.187 -        AC_DEFINE(SDL_DEFAULT_ASSERT_LEVEL, 0, [ ])
   4.188 -        ;;
   4.189 -    release)
   4.190 -        AC_DEFINE(SDL_DEFAULT_ASSERT_LEVEL, 1, [ ])
   4.191 -        ;;
   4.192 -    enabled)
   4.193 -        AC_DEFINE(SDL_DEFAULT_ASSERT_LEVEL, 2, [ ])
   4.194 -        ;;
   4.195 -    paranoid)
   4.196 -        AC_DEFINE(SDL_DEFAULT_ASSERT_LEVEL, 3, [ ])
   4.197 -        ;;
   4.198 -    *)
   4.199 -        AC_MSG_ERROR([*** unknown assertion level. stop.])
   4.200 -        ;;
   4.201 -esac
   4.202 -
   4.203 -dnl See whether we can use gcc style dependency tracking
   4.204 -AC_ARG_ENABLE(dependency-tracking,
   4.205 -AS_HELP_STRING([--enable-dependency-tracking],
   4.206 -               [Use gcc -MMD -MT dependency tracking [[default=yes]]]),
   4.207 -              , enable_dependency_tracking=yes)
   4.208 -if test x$enable_dependency_tracking = xyes; then
   4.209 -    have_gcc_mmd_mt=no
   4.210 -    AC_MSG_CHECKING(for GCC -MMD -MT option)
   4.211 -    AC_TRY_COMPILE([
   4.212 -    #if !defined(__GNUC__) || __GNUC__ < 3
   4.213 -    #error Dependency tracking requires GCC 3.0 or newer
   4.214 -    #endif
   4.215 -    ],[
   4.216 -    ],[
   4.217 -    have_gcc_mmd_mt=yes
   4.218 -    ])
   4.219 -    AC_MSG_RESULT($have_gcc_mmd_mt)
   4.220 -
   4.221 -    if test x$have_gcc_mmd_mt = xyes; then
   4.222 -        DEPENDENCY_TRACKING_OPTIONS="-MMD -MT \$@"
   4.223 -    fi
   4.224 -fi
   4.225 -
   4.226 -AC_MSG_CHECKING(for linker option --no-undefined)
   4.227 -have_no_undefined=no
   4.228 -case "$host" in
   4.229 -    dnl Skip this on platforms where it is just simply busted.
   4.230 -    *-*-openbsd*)
   4.231 -        ;;
   4.232 -
   4.233 -    *)
   4.234 -        save_LDFLAGS="$LDFLAGS"
   4.235 -        LDFLAGS="$LDFLAGS -Wl,--no-undefined"
   4.236 -        AC_TRY_LINK([
   4.237 -        ],[
   4.238 -        ],[
   4.239 -        have_no_undefined=yes
   4.240 -        EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,--no-undefined"
   4.241 -        ])
   4.242 -        LDFLAGS="$save_LDFLAGS"
   4.243 -        ;;
   4.244 -esac
   4.245 -AC_MSG_RESULT($have_no_undefined)
   4.246 -
   4.247 -AC_MSG_CHECKING(for linker option --dynamicbase)
   4.248 -have_dynamicbase=no
   4.249 -case "$host" in
   4.250 -    *)
   4.251 -        save_LDFLAGS="$LDFLAGS"
   4.252 -        LDFLAGS="$LDFLAGS -Wl,--dynamicbase"
   4.253 -        AC_TRY_LINK([
   4.254 -        ],[
   4.255 -        ],[
   4.256 -        have_dynamicbase=yes
   4.257 -        EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,--dynamicbase"
   4.258 -        ])
   4.259 -        LDFLAGS="$save_LDFLAGS"
   4.260 -        ;;
   4.261 -esac
   4.262 -AC_MSG_RESULT($have_dynamicbase)
   4.263 -
   4.264 -AC_MSG_CHECKING(for linker option --nxcompat)
   4.265 -have_nxcompat=no
   4.266 -case "$host" in
   4.267 -    *)
   4.268 -        save_LDFLAGS="$LDFLAGS"
   4.269 -        LDFLAGS="$LDFLAGS -Wl,--nxcompat"
   4.270 -        AC_TRY_LINK([
   4.271 -        ],[
   4.272 -        ],[
   4.273 -        have_nxcompat=yes
   4.274 -        EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,--nxcompat"
   4.275 -        ])
   4.276 -        LDFLAGS="$save_LDFLAGS"
   4.277 -        ;;
   4.278 -esac
   4.279 -AC_MSG_RESULT($have_nxcompat)
   4.280 -
   4.281 -AC_MSG_CHECKING(for linker option --high-entropy-va)
   4.282 -have_high_entropy_va=no
   4.283 -case "$host" in
   4.284 -    *)
   4.285 -        save_LDFLAGS="$LDFLAGS"
   4.286 -        LDFLAGS="$LDFLAGS -Wl,--high-entropy-va"
   4.287 -        AC_TRY_LINK([
   4.288 -        ],[
   4.289 -        ],[
   4.290 -        have_high_entropy_va=yes
   4.291 -        EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,--high-entropy-va"
   4.292 -        ])
   4.293 -        LDFLAGS="$save_LDFLAGS"
   4.294 -        ;;
   4.295 -esac
   4.296 -AC_MSG_RESULT($have_high_entropy_va)
   4.297 -
   4.298 -dnl See whether we are allowed to use the system C library
   4.299 -AC_ARG_ENABLE(libc,
   4.300 -AS_HELP_STRING([--enable-libc], [Use the system C library [[default=yes]]]),
   4.301 -              , enable_libc=yes)
   4.302 -if test x$enable_libc = xyes; then
   4.303 -    AC_DEFINE(HAVE_LIBC, 1, [ ])
   4.304 -
   4.305 -    dnl Check for C library headers
   4.306 -    AC_HEADER_STDC
   4.307 -    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)
   4.308 -
   4.309 -    dnl Check for typedefs, structures, etc.
   4.310 -    AC_TYPE_SIZE_T
   4.311 -
   4.312 -    dnl Check for defines
   4.313 -    AC_CHECK_DEFINE(M_PI, math.h)
   4.314 -
   4.315 -    dnl Checks for library functions.
   4.316 -    case "$host" in
   4.317 -    *-*-cygwin* | *-*-mingw32*)
   4.318 -        ;;
   4.319 -    *)
   4.320 -        AC_FUNC_ALLOCA
   4.321 -        ;;
   4.322 -    esac
   4.323 -
   4.324 -    AC_FUNC_MEMCMP
   4.325 -    if test x$ac_cv_func_memcmp_working = xyes; then
   4.326 -        AC_DEFINE(HAVE_MEMCMP, 1, [ ])
   4.327 -    fi
   4.328 -    AC_FUNC_STRTOD
   4.329 -    if test x$ac_cv_func_strtod = xyes; then
   4.330 -        AC_DEFINE(HAVE_STRTOD, 1, [ ])
   4.331 -    fi
   4.332 -    AC_CHECK_FUNC(mprotect,
   4.333 -        AC_TRY_COMPILE([
   4.334 -          #include <sys/types.h>
   4.335 -          #include <sys/mman.h>
   4.336 -        ],[
   4.337 -        ],[
   4.338 -        AC_DEFINE(HAVE_MPROTECT, 1, [ ])
   4.339 -        ]),
   4.340 -    )
   4.341 -    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)
   4.342 -
   4.343 -    AC_CHECK_LIB(m, pow, [LIBS="$LIBS -lm"; EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lm"])
   4.344 -    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)
   4.345 -
   4.346 -    AC_CHECK_LIB(iconv, iconv_open, [LIBS="$LIBS -liconv"; EXTRA_LDFLAGS="$EXTRA_LDFLAGS -liconv"])
   4.347 -    AC_CHECK_FUNCS(iconv)
   4.348 -
   4.349 -    AC_CHECK_MEMBER(struct sigaction.sa_sigaction,[AC_DEFINE([HAVE_SA_SIGACTION], 1, [ ])], ,[#include <signal.h>])
   4.350 -
   4.351 -    dnl Check for additional non-standard headers
   4.352 -    AC_CHECK_HEADERS(libunwind.h)
   4.353 -fi
   4.354 -
   4.355 -dnl AC_CHECK_SIZEOF(void*)
   4.356 -
   4.357 -dnl See whether we can use gcc atomic operations on this architecture
   4.358 -AC_ARG_ENABLE(gcc-atomics,
   4.359 -AS_HELP_STRING([--enable-gcc-atomics],
   4.360 -               [Use gcc builtin atomics [[default=yes]]]),
   4.361 -              , enable_gcc_atomics=yes)
   4.362 -if test x$enable_gcc_atomics = xyes; then
   4.363 -    have_gcc_atomics=no
   4.364 -    AC_MSG_CHECKING(for GCC builtin atomic operations)
   4.365 -    AC_TRY_LINK([
   4.366 -    ],[
   4.367 -    int a;
   4.368 -    void *x, *y, *z;
   4.369 -    __sync_lock_test_and_set(&a, 4);
   4.370 -    __sync_lock_test_and_set(&x, y);
   4.371 -    __sync_fetch_and_add(&a, 1);
   4.372 -    __sync_bool_compare_and_swap(&a, 5, 10);
   4.373 -    __sync_bool_compare_and_swap(&x, y, z);
   4.374 -    ],[
   4.375 -    have_gcc_atomics=yes
   4.376 -    ])
   4.377 -    AC_MSG_RESULT($have_gcc_atomics)
   4.378 -
   4.379 -    if test x$have_gcc_atomics = xyes; then
   4.380 -        AC_DEFINE(HAVE_GCC_ATOMICS, 1, [ ])
   4.381 -    else
   4.382 -        # See if we have the minimum operation needed for GCC atomics
   4.383 -        AC_TRY_LINK([
   4.384 -        ],[
   4.385 -        int a;
   4.386 -        __sync_lock_test_and_set(&a, 1);
   4.387 -        __sync_lock_release(&a);
   4.388 -        ],[
   4.389 -        have_gcc_sync_lock_test_and_set=yes
   4.390 -        ])
   4.391 -        if test x$have_gcc_sync_lock_test_and_set = xyes; then
   4.392 -            AC_DEFINE(HAVE_GCC_SYNC_LOCK_TEST_AND_SET, 1, [ ])
   4.393 -        fi
   4.394 -    fi
   4.395 -fi
   4.396 -
   4.397 -# Standard C sources
   4.398 -SOURCES="$SOURCES $srcdir/src/*.c"
   4.399 -SOURCES="$SOURCES $srcdir/src/atomic/*.c"
   4.400 -SOURCES="$SOURCES $srcdir/src/audio/*.c"
   4.401 -SOURCES="$SOURCES $srcdir/src/cpuinfo/*.c"
   4.402 -SOURCES="$SOURCES $srcdir/src/dynapi/*.c"
   4.403 -SOURCES="$SOURCES $srcdir/src/events/*.c"
   4.404 -SOURCES="$SOURCES $srcdir/src/file/*.c"
   4.405 -SOURCES="$SOURCES $srcdir/src/haptic/*.c"
   4.406 -SOURCES="$SOURCES $srcdir/src/joystick/*.c"
   4.407 -SOURCES="$SOURCES $srcdir/src/libm/*.c"
   4.408 -SOURCES="$SOURCES $srcdir/src/power/*.c"
   4.409 -#SOURCES="$SOURCES $srcdir/src/filesystem/*.c"
   4.410 -SOURCES="$SOURCES $srcdir/src/render/*.c"
   4.411 -SOURCES="$SOURCES $srcdir/src/render/*/*.c"
   4.412 -SOURCES="$SOURCES $srcdir/src/sensor/*.c"
   4.413 -SOURCES="$SOURCES $srcdir/src/stdlib/*.c"
   4.414 -SOURCES="$SOURCES $srcdir/src/thread/*.c"
   4.415 -SOURCES="$SOURCES $srcdir/src/timer/*.c"
   4.416 -SOURCES="$SOURCES $srcdir/src/video/*.c"
   4.417 -SOURCES="$SOURCES $srcdir/src/video/yuv2rgb/*.c"
   4.418 -
   4.419 -dnl Enable/disable various subsystems of the SDL library
   4.420 -
   4.421 -AC_ARG_ENABLE(atomic,
   4.422 -AS_HELP_STRING([--enable-atomic], [Enable the atomic operations subsystem [[default=yes]]]),
   4.423 -              , enable_atomic=yes)
   4.424 -if test x$enable_atomic != xyes; then
   4.425 -    AC_DEFINE(SDL_ATOMIC_DISABLED, 1, [ ])
   4.426 -else
   4.427 -    SUMMARY_modules="${SUMMARY_modules} atomic"
   4.428 -fi
   4.429 -AC_ARG_ENABLE(audio,
   4.430 -AS_HELP_STRING([--enable-audio], [Enable the audio subsystem [[default=yes]]]),
   4.431 -              , enable_audio=yes)
   4.432 -if test x$enable_audio != xyes; then
   4.433 -    AC_DEFINE(SDL_AUDIO_DISABLED, 1, [ ])
   4.434 -else
   4.435 -    SUMMARY_modules="${SUMMARY_modules} audio"
   4.436 -fi
   4.437 -AC_ARG_ENABLE(video,
   4.438 -AS_HELP_STRING([--enable-video], [Enable the video subsystem [[default=yes]]]),
   4.439 -              , enable_video=yes)
   4.440 -if test x$enable_video != xyes; then
   4.441 -    AC_DEFINE(SDL_VIDEO_DISABLED, 1, [ ])
   4.442 -else
   4.443 -    SUMMARY_modules="${SUMMARY_modules} video"
   4.444 -fi
   4.445 -AC_ARG_ENABLE(render,
   4.446 -AS_HELP_STRING([--enable-render], [Enable the render subsystem [[default=yes]]]),
   4.447 -              , enable_render=yes)
   4.448 -if test x$enable_render != xyes; then
   4.449 -    AC_DEFINE(SDL_RENDER_DISABLED, 1, [ ])
   4.450 -else
   4.451 -    SUMMARY_modules="${SUMMARY_modules} render"
   4.452 -fi
   4.453 -AC_ARG_ENABLE(events,
   4.454 -AS_HELP_STRING([--enable-events], [Enable the events subsystem [[default=yes]]]),
   4.455 -              , enable_events=yes)
   4.456 -if test x$enable_events != xyes; then
   4.457 -    AC_DEFINE(SDL_EVENTS_DISABLED, 1, [ ])
   4.458 -else
   4.459 -    SUMMARY_modules="${SUMMARY_modules} events"
   4.460 -fi
   4.461 -AC_ARG_ENABLE(joystick,
   4.462 -AS_HELP_STRING([--enable-joystick], [Enable the joystick subsystem [[default=yes]]]),
   4.463 -              , enable_joystick=yes)
   4.464 -if test x$enable_joystick != xyes; then
   4.465 -    AC_DEFINE(SDL_JOYSTICK_DISABLED, 1, [ ])
   4.466 -else
   4.467 -    SUMMARY_modules="${SUMMARY_modules} joystick"
   4.468 -fi
   4.469 -AC_ARG_ENABLE(haptic,
   4.470 -AS_HELP_STRING([--enable-haptic], [Enable the haptic (force feedback) subsystem [[default=yes]]]),
   4.471 -              , enable_haptic=yes)
   4.472 -if test x$enable_haptic != xyes; then
   4.473 -    AC_DEFINE(SDL_HAPTIC_DISABLED, 1, [ ])
   4.474 -else
   4.475 -    SUMMARY_modules="${SUMMARY_modules} haptic"
   4.476 -fi
   4.477 -AC_ARG_ENABLE(sensor,
   4.478 -AS_HELP_STRING([--enable-sensor], [Enable the sensor subsystem [[default=yes]]]),
   4.479 -              , enable_sensor=yes)
   4.480 -if test x$enable_sensor != xyes; then
   4.481 -    AC_DEFINE(SDL_SENSOR_DISABLED, 1, [ ])
   4.482 -else
   4.483 -    SUMMARY_modules="${SUMMARY_modules} sensor"
   4.484 -fi
   4.485 -AC_ARG_ENABLE(power,
   4.486 -AS_HELP_STRING([--enable-power], [Enable the power subsystem [[default=yes]]]),
   4.487 -              , enable_power=yes)
   4.488 -if test x$enable_power != xyes; then
   4.489 -    AC_DEFINE(SDL_POWER_DISABLED, 1, [ ])
   4.490 -else
   4.491 -    SUMMARY_modules="${SUMMARY_modules} power"
   4.492 -fi
   4.493 -AC_ARG_ENABLE(filesystem,
   4.494 -AS_HELP_STRING([--enable-filesystem], [Enable the filesystem subsystem [[default=yes]]]),
   4.495 -              , enable_filesystem=yes)
   4.496 -if test x$enable_filesystem != xyes; then
   4.497 -    AC_DEFINE(SDL_FILESYSTEM_DISABLED, 1, [ ])
   4.498 -else
   4.499 -    SUMMARY_modules="${SUMMARY_modules} filesystem"
   4.500 -fi
   4.501 -AC_ARG_ENABLE(threads,
   4.502 -AS_HELP_STRING([--enable-threads], [Enable the threading subsystem [[default=yes]]]),
   4.503 -              , enable_threads=yes)
   4.504 -if test x$enable_threads != xyes; then
   4.505 -    AC_DEFINE(SDL_THREADS_DISABLED, 1, [ ])
   4.506 -else
   4.507 -    SUMMARY_modules="${SUMMARY_modules} threads"
   4.508 -fi
   4.509 -AC_ARG_ENABLE(timers,
   4.510 -AS_HELP_STRING([--enable-timers], [Enable the timer subsystem [[default=yes]]]),
   4.511 -              , enable_timers=yes)
   4.512 -if test x$enable_timers != xyes; then
   4.513 -    AC_DEFINE(SDL_TIMERS_DISABLED, 1, [ ])
   4.514 -else
   4.515 -    SUMMARY_modules="${SUMMARY_modules} timers"
   4.516 -fi
   4.517 -AC_ARG_ENABLE(file,
   4.518 -AS_HELP_STRING([--enable-file], [Enable the file subsystem [[default=yes]]]),
   4.519 -              , enable_file=yes)
   4.520 -if test x$enable_file != xyes; then
   4.521 -    AC_DEFINE(SDL_FILE_DISABLED, 1, [ ])
   4.522 -else
   4.523 -    SUMMARY_modules="${SUMMARY_modules} file"
   4.524 -fi
   4.525 -AC_ARG_ENABLE(loadso,
   4.526 -AS_HELP_STRING([--enable-loadso], [Enable the shared object loading subsystem [[default=yes]]]),
   4.527 -              , enable_loadso=yes)
   4.528 -if test x$enable_loadso != xyes; then
   4.529 -    AC_DEFINE(SDL_LOADSO_DISABLED, 1, [ ])
   4.530 -else
   4.531 -    SUMMARY_modules="${SUMMARY_modules} loadso"
   4.532 -fi
   4.533 -AC_ARG_ENABLE(cpuinfo,
   4.534 -AS_HELP_STRING([--enable-cpuinfo], [Enable the cpuinfo subsystem [[default=yes]]]),
   4.535 -              , enable_cpuinfo=yes)
   4.536 -if test x$enable_cpuinfo != xyes; then
   4.537 -    AC_DEFINE(SDL_CPUINFO_DISABLED, 1, [ ])
   4.538 -else
   4.539 -    SUMMARY_modules="${SUMMARY_modules} cpuinfo"
   4.540 -fi
   4.541 -AC_ARG_ENABLE(assembly,
   4.542 -AS_HELP_STRING([--enable-assembly], [Enable assembly routines [[default=yes]]]),
   4.543 -              , enable_assembly=yes)
   4.544 -if test x$enable_assembly = xyes; then
   4.545 -    SUMMARY_modules="${SUMMARY_modules} assembly"
   4.546 -
   4.547 -    AC_DEFINE(SDL_ASSEMBLY_ROUTINES, 1, [ ])
   4.548 -
   4.549 -    # Make sure that we don't generate floating point code that would
   4.550 -    # cause illegal instruction exceptions on older processors
   4.551 -    case "$host" in
   4.552 -        *-*-darwin*)
   4.553 -            # Don't need to worry about Apple hardware, it's all SSE capable
   4.554 -            default_ssemath=yes
   4.555 -            ;;
   4.556 -        *64-*-*)
   4.557 -            # x86 64-bit architectures all have SSE instructions
   4.558 -            default_ssemath=yes
   4.559 -            ;;
   4.560 -        *)
   4.561 -            default_ssemath=no
   4.562 -            ;;
   4.563 -    esac
   4.564 -    AC_ARG_ENABLE(ssemath,
   4.565 -AS_HELP_STRING([--enable-ssemath], [Allow GCC to use SSE floating point math [[default=maybe]]]),
   4.566 -                  , enable_ssemath=$default_ssemath)
   4.567 -    if test x$enable_ssemath = xno; then
   4.568 -        if test x$have_gcc_sse = xyes -o x$have_gcc_sse2 = xyes -o x$have_gcc_sse3 = xyes; then
   4.569 -            EXTRA_CFLAGS="$EXTRA_CFLAGS -mfpmath=387"
   4.570 -        fi
   4.571 -    fi
   4.572 -
   4.573 -    dnl Check for various instruction support
   4.574 -    AC_ARG_ENABLE(mmx,
   4.575 -AS_HELP_STRING([--enable-mmx], [use MMX assembly routines [[default=yes]]]),
   4.576 -                  , enable_mmx=yes)
   4.577 -    if test x$enable_mmx = xyes; then
   4.578 -        save_CFLAGS="$CFLAGS"
   4.579 -        have_gcc_mmx=no
   4.580 -        AC_MSG_CHECKING(for GCC -mmmx option)
   4.581 -        mmx_CFLAGS="-mmmx"
   4.582 -        CFLAGS="$save_CFLAGS $mmx_CFLAGS"
   4.583 -
   4.584 -        AC_TRY_COMPILE([
   4.585 -        #ifdef __MINGW32__
   4.586 -        #include <_mingw.h>
   4.587 -        #ifdef __MINGW64_VERSION_MAJOR
   4.588 -        #include <intrin.h>
   4.589 -        #else
   4.590 -        #include <mmintrin.h>
   4.591 -        #endif
   4.592 -        #else
   4.593 -        #include <mmintrin.h>
   4.594 -        #endif
   4.595 -        #ifndef __MMX__
   4.596 -        #error Assembler CPP flag not enabled
   4.597 -        #endif
   4.598 -        ],[
   4.599 -        ],[
   4.600 -        have_gcc_mmx=yes
   4.601 -        ])
   4.602 -        AC_MSG_RESULT($have_gcc_mmx)
   4.603 -        CFLAGS="$save_CFLAGS"
   4.604 -
   4.605 -        if test x$have_gcc_mmx = xyes; then
   4.606 -            EXTRA_CFLAGS="$EXTRA_CFLAGS $mmx_CFLAGS"
   4.607 -            SUMMARY_math="${SUMMARY_math} mmx"
   4.608 -        fi
   4.609 -    fi
   4.610 -
   4.611 -    AC_ARG_ENABLE(3dnow,
   4.612 -AS_HELP_STRING([--enable-3dnow], [use 3DNow! assembly routines [[default=yes]]]),
   4.613 -                  , enable_3dnow=yes)
   4.614 -    if test x$enable_3dnow = xyes; then
   4.615 -        save_CFLAGS="$CFLAGS"
   4.616 -        have_gcc_3dnow=no
   4.617 -        AC_MSG_CHECKING(for GCC -m3dnow option)
   4.618 -        amd3dnow_CFLAGS="-m3dnow"
   4.619 -        CFLAGS="$save_CFLAGS $amd3dnow_CFLAGS"
   4.620 -
   4.621 -        AC_TRY_LINK([
   4.622 -        #include <mm3dnow.h>
   4.623 -        #ifndef __3dNOW__
   4.624 -        #error Assembler CPP flag not enabled
   4.625 -        #endif
   4.626 -        ],[
   4.627 -        void *p = 0;
   4.628 -        _m_prefetch(p);
   4.629 -        ],[
   4.630 -        have_gcc_3dnow=yes
   4.631 -        ])
   4.632 -        AC_MSG_RESULT($have_gcc_3dnow)
   4.633 -        CFLAGS="$save_CFLAGS"
   4.634 -
   4.635 -        if test x$have_gcc_3dnow = xyes; then
   4.636 -            EXTRA_CFLAGS="$EXTRA_CFLAGS $amd3dnow_CFLAGS"
   4.637 -            SUMMARY_math="${SUMMARY_math} 3dnow"
   4.638 -        fi
   4.639 -    fi
   4.640 -
   4.641 -    AC_ARG_ENABLE(sse,
   4.642 -AS_HELP_STRING([--enable-sse], [use SSE assembly routines [[default=yes]]]),
   4.643 -                  , enable_sse=yes)
   4.644 -    if test x$enable_sse = xyes; then
   4.645 -        save_CFLAGS="$CFLAGS"
   4.646 -        have_gcc_sse=no
   4.647 -        AC_MSG_CHECKING(for GCC -msse option)
   4.648 -        sse_CFLAGS="-msse"
   4.649 -        CFLAGS="$save_CFLAGS $sse_CFLAGS"
   4.650 -
   4.651 -        AC_TRY_COMPILE([
   4.652 -        #ifdef __MINGW32__
   4.653 -        #include <_mingw.h>
   4.654 -        #ifdef __MINGW64_VERSION_MAJOR
   4.655 -        #include <intrin.h>
   4.656 -        #else
   4.657 -        #include <xmmintrin.h>
   4.658 -        #endif
   4.659 -        #else
   4.660 -        #include <xmmintrin.h>
   4.661 -        #endif
   4.662 -        #ifndef __SSE__
   4.663 -        #error Assembler CPP flag not enabled
   4.664 -        #endif
   4.665 -        ],[
   4.666 -        ],[
   4.667 -        have_gcc_sse=yes
   4.668 -        ])
   4.669 -        AC_MSG_RESULT($have_gcc_sse)
   4.670 -        CFLAGS="$save_CFLAGS"
   4.671 -
   4.672 -        if test x$have_gcc_sse = xyes; then
   4.673 -            EXTRA_CFLAGS="$EXTRA_CFLAGS $sse_CFLAGS"
   4.674 -            SUMMARY_math="${SUMMARY_math} sse"
   4.675 -        fi
   4.676 -    fi
   4.677 -
   4.678 -    AC_ARG_ENABLE(sse2,
   4.679 -AS_HELP_STRING([--enable-sse2], [use SSE2 assembly routines [[default=maybe]]]),
   4.680 -                  , enable_sse2=$default_ssemath)
   4.681 -    if test x$enable_sse2 = xyes; then
   4.682 -        save_CFLAGS="$CFLAGS"
   4.683 -        have_gcc_sse2=no
   4.684 -        AC_MSG_CHECKING(for GCC -msse2 option)
   4.685 -        sse2_CFLAGS="-msse2"
   4.686 -        CFLAGS="$save_CFLAGS $sse2_CFLAGS"
   4.687 -
   4.688 -        AC_TRY_COMPILE([
   4.689 -        #ifdef __MINGW32__
   4.690 -        #include <_mingw.h>
   4.691 -        #ifdef __MINGW64_VERSION_MAJOR
   4.692 -        #include <intrin.h>
   4.693 -        #else
   4.694 -        #include <emmintrin.h>
   4.695 -        #endif
   4.696 -        #else
   4.697 -        #include <emmintrin.h>
   4.698 -        #endif
   4.699 -        #ifndef __SSE2__
   4.700 -        #error Assembler CPP flag not enabled
   4.701 -        #endif
   4.702 -        ],[
   4.703 -        ],[
   4.704 -        have_gcc_sse2=yes
   4.705 -        ])
   4.706 -        AC_MSG_RESULT($have_gcc_sse2)
   4.707 -        CFLAGS="$save_CFLAGS"
   4.708 -
   4.709 -        if test x$have_gcc_sse2 = xyes; then
   4.710 -            EXTRA_CFLAGS="$EXTRA_CFLAGS $sse2_CFLAGS"
   4.711 -            SUMMARY_math="${SUMMARY_math} sse2"
   4.712 -        fi
   4.713 -    fi
   4.714 -
   4.715 -    AC_ARG_ENABLE(sse3,
   4.716 -AS_HELP_STRING([--enable-sse3], [use SSE3 assembly routines [[default=maybe]]]),
   4.717 -                  , enable_sse3=$default_ssemath)
   4.718 -    if test x$enable_sse3 = xyes; then
   4.719 -        save_CFLAGS="$CFLAGS"
   4.720 -        have_gcc_sse3=no
   4.721 -        AC_MSG_CHECKING(for GCC -msse3 option)
   4.722 -        sse3_CFLAGS="-msse3"
   4.723 -        CFLAGS="$save_CFLAGS $sse3_CFLAGS"
   4.724 -
   4.725 -        AC_TRY_COMPILE([
   4.726 -        #ifdef __MINGW32__
   4.727 -        #include <_mingw.h>
   4.728 -        #ifdef __MINGW64_VERSION_MAJOR
   4.729 -        #include <intrin.h>
   4.730 -        #else
   4.731 -        #include <pmmintrin.h>
   4.732 -        #endif
   4.733 -        #else
   4.734 -        #include <pmmintrin.h>
   4.735 -        #endif
   4.736 -        #ifndef __SSE2__
   4.737 -        #error Assembler CPP flag not enabled
   4.738 -        #endif
   4.739 -        ],[
   4.740 -        ],[
   4.741 -        have_gcc_sse3=yes
   4.742 -        ])
   4.743 -        AC_MSG_RESULT($have_gcc_sse3)
   4.744 -        CFLAGS="$save_CFLAGS"
   4.745 -
   4.746 -        if test x$have_gcc_sse3 = xyes; then
   4.747 -            EXTRA_CFLAGS="$EXTRA_CFLAGS $sse3_CFLAGS"
   4.748 -            SUMMARY_math="${SUMMARY_math} sse3"
   4.749 -        fi
   4.750 -    fi
   4.751 -
   4.752 -    AC_CHECK_HEADER(immintrin.h,
   4.753 -                    have_immintrin_h_hdr=yes,
   4.754 -                    have_immintrin_h_hdr=no)
   4.755 -    if test x$have_immintrin_h_hdr = xyes; then
   4.756 -        AC_DEFINE(HAVE_IMMINTRIN_H, 1, [ ])
   4.757 -    fi
   4.758 -
   4.759 -    AC_ARG_ENABLE(altivec,
   4.760 -AS_HELP_STRING([--enable-altivec], [use Altivec assembly routines [[default=yes]]]),
   4.761 -                  , enable_altivec=yes)
   4.762 -    if test x$enable_altivec = xyes; then
   4.763 -        save_CFLAGS="$CFLAGS"
   4.764 -        have_gcc_altivec=no
   4.765 -        have_altivec_h_hdr=no
   4.766 -        altivec_CFLAGS="-maltivec"
   4.767 -        CFLAGS="$save_CFLAGS $altivec_CFLAGS"
   4.768 -
   4.769 -        AC_MSG_CHECKING(for Altivec with GCC altivec.h and -maltivec option)
   4.770 -        AC_TRY_COMPILE([
   4.771 -        #include <altivec.h>
   4.772 -        vector unsigned int vzero() {
   4.773 -            return vec_splat_u32(0);
   4.774 -        }
   4.775 -        ],[
   4.776 -        ],[
   4.777 -        have_gcc_altivec=yes
   4.778 -        have_altivec_h_hdr=yes
   4.779 -        ])
   4.780 -        AC_MSG_RESULT($have_gcc_altivec)
   4.781 -
   4.782 -        if test x$have_gcc_altivec = xno; then
   4.783 -            AC_MSG_CHECKING(for Altivec with GCC -maltivec option)
   4.784 -            AC_TRY_COMPILE([
   4.785 -            vector unsigned int vzero() {
   4.786 -                return vec_splat_u32(0);
   4.787 -            }
   4.788 -            ],[
   4.789 -            ],[
   4.790 -            have_gcc_altivec=yes
   4.791 -            ])
   4.792 -            AC_MSG_RESULT($have_gcc_altivec)
   4.793 -        fi
   4.794 -
   4.795 -        if test x$have_gcc_altivec = xno; then
   4.796 -            AC_MSG_CHECKING(for Altivec with GCC altivec.h and -faltivec option)
   4.797 -            altivec_CFLAGS="-faltivec"
   4.798 -            CFLAGS="$save_CFLAGS $altivec_CFLAGS"
   4.799 -            AC_TRY_COMPILE([
   4.800 -            #include <altivec.h>
   4.801 -            vector unsigned int vzero() {
   4.802 -                return vec_splat_u32(0);
   4.803 -            }
   4.804 -            ],[
   4.805 -            ],[
   4.806 -            have_gcc_altivec=yes
   4.807 -            have_altivec_h_hdr=yes
   4.808 -            ])
   4.809 -            AC_MSG_RESULT($have_gcc_altivec)
   4.810 -        fi
   4.811 -
   4.812 -        if test x$have_gcc_altivec = xno; then
   4.813 -            AC_MSG_CHECKING(for Altivec with GCC -faltivec option)
   4.814 -            AC_TRY_COMPILE([
   4.815 -            vector unsigned int vzero() {
   4.816 -                return vec_splat_u32(0);
   4.817 -            }
   4.818 -            ],[
   4.819 -            ],[
   4.820 -            have_gcc_altivec=yes
   4.821 -            ])
   4.822 -            AC_MSG_RESULT($have_gcc_altivec)
   4.823 -        fi
   4.824 -        CFLAGS="$save_CFLAGS"
   4.825 -
   4.826 -        if test x$have_gcc_altivec = xyes; then
   4.827 -            AC_DEFINE(SDL_ALTIVEC_BLITTERS, 1, [ ])
   4.828 -            if test x$have_altivec_h_hdr = xyes; then
   4.829 -              AC_DEFINE(HAVE_ALTIVEC_H, 1, [ ])
   4.830 -            fi
   4.831 -            EXTRA_CFLAGS="$EXTRA_CFLAGS $altivec_CFLAGS"
   4.832 -            SUMMARY_math="${SUMMARY_math} altivec"
   4.833 -        fi
   4.834 -    fi
   4.835 -fi
   4.836 -
   4.837 -dnl See if the OSS audio interface is supported
   4.838 -CheckOSS()
   4.839 -{
   4.840 -    AC_ARG_ENABLE(oss,
   4.841 -AS_HELP_STRING([--enable-oss], [support the OSS audio API [[default=maybe]]]),
   4.842 -                  , enable_oss=maybe)
   4.843 -
   4.844 -    # OpenBSD "has" OSS, but it's not really for app use. They want you to
   4.845 -    #  use sndio instead. So on there, we default to disabled. You can force
   4.846 -    #  it on if you really want, though.
   4.847 -    if test x$enable_oss = xmaybe; then
   4.848 -        enable_oss=yes
   4.849 -        case "$host" in
   4.850 -            *-*-openbsd*)
   4.851 -                enable_oss=no;;
   4.852 -        esac
   4.853 -    fi
   4.854 -
   4.855 -    if test x$enable_audio = xyes -a x$enable_oss = xyes; then
   4.856 -        AC_MSG_CHECKING(for OSS audio support)
   4.857 -        have_oss=no
   4.858 -        if test x$have_oss != xyes; then
   4.859 -            AC_TRY_COMPILE([
   4.860 -              #include <sys/soundcard.h>
   4.861 -            ],[
   4.862 -              int arg = SNDCTL_DSP_SETFRAGMENT;
   4.863 -            ],[
   4.864 -            have_oss=yes
   4.865 -            ])
   4.866 -        fi
   4.867 -        if test x$have_oss != xyes; then
   4.868 -            AC_TRY_COMPILE([
   4.869 -              #include <soundcard.h>
   4.870 -            ],[
   4.871 -              int arg = SNDCTL_DSP_SETFRAGMENT;
   4.872 -            ],[
   4.873 -            have_oss=yes
   4.874 -            AC_DEFINE(SDL_AUDIO_DRIVER_OSS_SOUNDCARD_H, 1, [ ])
   4.875 -            ])
   4.876 -        fi
   4.877 -        AC_MSG_RESULT($have_oss)
   4.878 -        if test x$have_oss = xyes; then
   4.879 -            SUMMARY_audio="${SUMMARY_audio} oss"
   4.880 -            AC_DEFINE(SDL_AUDIO_DRIVER_OSS, 1, [ ])
   4.881 -            SOURCES="$SOURCES $srcdir/src/audio/dsp/*.c"
   4.882 -            have_audio=yes
   4.883 -
   4.884 -            # We may need to link with ossaudio emulation library
   4.885 -            case "$host" in
   4.886 -                *-*-openbsd*|*-*-netbsd*)
   4.887 -                    EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lossaudio";;
   4.888 -            esac
   4.889 -        fi
   4.890 -    fi
   4.891 -}
   4.892 -
   4.893 -dnl See if the ALSA audio interface is supported
   4.894 -CheckALSA()
   4.895 -{
   4.896 -    AC_ARG_ENABLE(alsa,
   4.897 -AS_HELP_STRING([--enable-alsa], [support the ALSA audio API [[default=yes]]]),
   4.898 -                  , enable_alsa=yes)
   4.899 -    if test x$enable_audio = xyes -a x$enable_alsa = xyes; then
   4.900 -        AM_PATH_ALSA(1.0.11, have_alsa=yes, have_alsa=no)
   4.901 -        # Restore all flags from before the ALSA detection runs
   4.902 -        CFLAGS="$alsa_save_CFLAGS"
   4.903 -        LDFLAGS="$alsa_save_LDFLAGS"
   4.904 -        LIBS="$alsa_save_LIBS"
   4.905 -        if test x$have_alsa = xyes; then
   4.906 -            AC_ARG_ENABLE(alsa-shared,
   4.907 -AS_HELP_STRING([--enable-alsa-shared], [dynamically load ALSA audio support [[default=yes]]]),
   4.908 -                          , enable_alsa_shared=yes)
   4.909 -            alsa_lib=[`find_lib "libasound.so.*" "$ALSA_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`]
   4.910 -
   4.911 -            AC_DEFINE(SDL_AUDIO_DRIVER_ALSA, 1, [ ])
   4.912 -            SOURCES="$SOURCES $srcdir/src/audio/alsa/*.c"
   4.913 -            EXTRA_CFLAGS="$EXTRA_CFLAGS $ALSA_CFLAGS"
   4.914 -            if test x$have_loadso != xyes && \
   4.915 -               test x$enable_alsa_shared = xyes; then
   4.916 -                AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic ALSA loading])
   4.917 -            fi
   4.918 -            if test x$have_loadso = xyes && \
   4.919 -               test x$enable_alsa_shared = xyes && test x$alsa_lib != x; then
   4.920 -                echo "-- dynamic libasound -> $alsa_lib"
   4.921 -                AC_DEFINE_UNQUOTED(SDL_AUDIO_DRIVER_ALSA_DYNAMIC, "$alsa_lib", [ ])
   4.922 -                SUMMARY_audio="${SUMMARY_audio} alsa(dynamic)"
   4.923 -            else
   4.924 -                EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ALSA_LIBS"
   4.925 -                SUMMARY_audio="${SUMMARY_audio} alsa"
   4.926 -            fi
   4.927 -            have_audio=yes
   4.928 -        fi
   4.929 -    fi
   4.930 -}
   4.931 -
   4.932 -dnl Find JACK Audio
   4.933 -CheckJACK()
   4.934 -{
   4.935 -    AC_ARG_ENABLE(jack,
   4.936 -AS_HELP_STRING([--enable-jack], [use JACK audio [[default=yes]]]),
   4.937 -                  , enable_jack=yes)
   4.938 -    if test x$enable_audio = xyes -a x$enable_jack = xyes; then
   4.939 -        PKG_CHECK_MODULES([JACK], [jack >= 0.125], audio_jack=yes, audio_jack=no)
   4.940 -
   4.941 -        if test x$audio_jack = xyes; then
   4.942 -            AC_ARG_ENABLE(jack-shared,
   4.943 -AS_HELP_STRING([--enable-jack-shared], [dynamically load JACK audio support [[default=yes]]]),
   4.944 -                          , enable_jack_shared=yes)
   4.945 -            jack_lib=[`find_lib "libjack.so.*" "$JACK_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`]
   4.946 -
   4.947 -            AC_DEFINE(SDL_AUDIO_DRIVER_JACK, 1, [ ])
   4.948 -            SOURCES="$SOURCES $srcdir/src/audio/jack/*.c"
   4.949 -            EXTRA_CFLAGS="$EXTRA_CFLAGS $JACK_CFLAGS"
   4.950 -            if test x$have_loadso != xyes && \
   4.951 -               test x$enable_jack_shared = xyes; then
   4.952 -                AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic JACK audio loading])
   4.953 -            fi
   4.954 -            if test x$have_loadso = xyes && \
   4.955 -               test x$enable_jack_shared = xyes && test x$jack_lib != x; then
   4.956 -                echo "-- dynamic libjack -> $jack_lib"
   4.957 -                AC_DEFINE_UNQUOTED(SDL_AUDIO_DRIVER_JACK_DYNAMIC, "$jack_lib", [ ])
   4.958 -                SUMMARY_audio="${SUMMARY_audio} jack(dynamic)"
   4.959 -
   4.960 -                case "$host" in
   4.961 -                    # On Solaris, jack must be linked deferred explicitly
   4.962 -                    # to prevent undefined symbol failures.
   4.963 -                    *-*-solaris*)
   4.964 -                        JACK_LIBS=`echo $JACK_LIBS | sed 's/\-l/-Wl,-l/g'`
   4.965 -                        EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-zdeferred $JACK_LIBS -Wl,-znodeferred"
   4.966 -                esac
   4.967 -            else
   4.968 -                EXTRA_LDFLAGS="$EXTRA_LDFLAGS $JACK_LIBS"
   4.969 -                SUMMARY_audio="${SUMMARY_audio} jack"
   4.970 -            fi
   4.971 -            have_audio=yes
   4.972 -        fi
   4.973 -    fi
   4.974 -}
   4.975 -
   4.976 -dnl Find the ESD includes and libraries
   4.977 -CheckESD()
   4.978 -{
   4.979 -    AC_ARG_ENABLE(esd,
   4.980 -AS_HELP_STRING([--enable-esd], [support the Enlightened Sound Daemon [[default=yes]]]),
   4.981 -                  , enable_esd=yes)
   4.982 -    if test x$enable_audio = xyes -a x$enable_esd = xyes; then
   4.983 -        AM_PATH_ESD(0.2.8, have_esd=yes, have_esd=no)
   4.984 -        if test x$have_esd = xyes; then
   4.985 -            AC_ARG_ENABLE(esd-shared,
   4.986 -AS_HELP_STRING([--enable-esd-shared], [dynamically load ESD audio support [[default=yes]]]),
   4.987 -                          , enable_esd_shared=yes)
   4.988 -            esd_lib=[`find_lib "libesd.so.*" "$ESD_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`]
   4.989 -
   4.990 -            AC_DEFINE(SDL_AUDIO_DRIVER_ESD, 1, [ ])
   4.991 -            SOURCES="$SOURCES $srcdir/src/audio/esd/*.c"
   4.992 -            EXTRA_CFLAGS="$EXTRA_CFLAGS $ESD_CFLAGS"
   4.993 -            if test x$have_loadso != xyes && \
   4.994 -               test x$enable_esd_shared = xyes; then
   4.995 -                AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic ESD loading])
   4.996 -            fi
   4.997 -            if test x$have_loadso = xyes && \
   4.998 -               test x$enable_esd_shared = xyes && test x$esd_lib != x; then
   4.999 -                echo "-- dynamic libesd -> $esd_lib"
  4.1000 -                AC_DEFINE_UNQUOTED(SDL_AUDIO_DRIVER_ESD_DYNAMIC, "$esd_lib", [ ])
  4.1001 -                SUMMARY_audio="${SUMMARY_audio} esd(dynamic)"
  4.1002 -            else
  4.1003 -                EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ESD_LIBS"
  4.1004 -                SUMMARY_audio="${SUMMARY_audio} esd"
  4.1005 -            fi
  4.1006 -            have_audio=yes
  4.1007 -        fi
  4.1008 -    fi
  4.1009 -}
  4.1010 -
  4.1011 -dnl Find PulseAudio
  4.1012 -CheckPulseAudio()
  4.1013 -{
  4.1014 -    AC_ARG_ENABLE(pulseaudio,
  4.1015 -AS_HELP_STRING([--enable-pulseaudio], [use PulseAudio [[default=yes]]]),
  4.1016 -                  , enable_pulseaudio=yes)
  4.1017 -    if test x$enable_audio = xyes -a x$enable_pulseaudio = xyes; then
  4.1018 -        PKG_CHECK_MODULES([PULSEAUDIO], [libpulse-simple >= 0.9], audio_pulseaudio=yes, audio_pulseaudio=no)
  4.1019 -
  4.1020 -        if test x$audio_pulseaudio = xyes; then
  4.1021 -            AC_ARG_ENABLE(pulseaudio-shared,
  4.1022 -AS_HELP_STRING([--enable-pulseaudio-shared], [dynamically load PulseAudio support [[default=yes]]]),
  4.1023 -                          , enable_pulseaudio_shared=yes)
  4.1024 -            pulseaudio_lib=[`find_lib "libpulse-simple.so.*" "$PULSEAUDIO_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`]
  4.1025 -
  4.1026 -            AC_DEFINE(SDL_AUDIO_DRIVER_PULSEAUDIO, 1, [ ])
  4.1027 -            SOURCES="$SOURCES $srcdir/src/audio/pulseaudio/*.c"
  4.1028 -            EXTRA_CFLAGS="$EXTRA_CFLAGS $PULSEAUDIO_CFLAGS"
  4.1029 -            if test x$have_loadso != xyes && \
  4.1030 -               test x$enable_pulseaudio_shared = xyes; then
  4.1031 -                AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic PulseAudio loading])
  4.1032 -            fi
  4.1033 -            if test x$have_loadso = xyes && \
  4.1034 -               test x$enable_pulseaudio_shared = xyes && test x$pulseaudio_lib != x; then
  4.1035 -                echo "-- dynamic libpulse-simple -> $pulseaudio_lib"
  4.1036 -                AC_DEFINE_UNQUOTED(SDL_AUDIO_DRIVER_PULSEAUDIO_DYNAMIC, "$pulseaudio_lib", [ ])
  4.1037 -                SUMMARY_audio="${SUMMARY_audio} pulse(dynamic)"
  4.1038 -
  4.1039 -                case "$host" in
  4.1040 -                    # On Solaris, pulseaudio must be linked deferred explicitly
  4.1041 -                    # to prevent undefined symbol failures.
  4.1042 -                    *-*-solaris*)
  4.1043 -                        PULSEAUDIO_LIBS=`echo $PULSEAUDIO_LIBS | sed 's/\-l/-Wl,-l/g'`
  4.1044 -                        EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-zdeferred $PULSEAUDIO_LIBS -Wl,-znodeferred"
  4.1045 -                esac
  4.1046 -            else
  4.1047 -                EXTRA_LDFLAGS="$EXTRA_LDFLAGS $PULSEAUDIO_LIBS"
  4.1048 -                SUMMARY_audio="${SUMMARY_audio} pulse"
  4.1049 -            fi
  4.1050 -            have_audio=yes
  4.1051 -        fi
  4.1052 -    fi
  4.1053 -}
  4.1054 -
  4.1055 -CheckARTSC()
  4.1056 -{
  4.1057 -    AC_ARG_ENABLE(arts,
  4.1058 -AS_HELP_STRING([--enable-arts], [support the Analog Real Time Synthesizer [[default=yes]]]),
  4.1059 -                  , enable_arts=yes)
  4.1060 -    if test x$enable_audio = xyes -a x$enable_arts = xyes; then
  4.1061 -        AC_PATH_PROG(ARTSCONFIG, artsc-config)
  4.1062 -        if test x$ARTSCONFIG = x -o x$ARTSCONFIG = x'"$ARTSCONFIG"'; then
  4.1063 -            : # arts isn't installed
  4.1064 -        else
  4.1065 -            ARTS_CFLAGS=`$ARTSCONFIG --cflags`
  4.1066 -            ARTS_LIBS=`$ARTSCONFIG --libs`
  4.1067 -            AC_MSG_CHECKING(for aRts development environment)
  4.1068 -            audio_arts=no
  4.1069 -            save_CFLAGS="$CFLAGS"
  4.1070 -            CFLAGS="$CFLAGS $ARTS_CFLAGS"
  4.1071 -            AC_TRY_COMPILE([
  4.1072 -             #include <artsc.h>
  4.1073 -            ],[
  4.1074 -             arts_stream_t stream;
  4.1075 -            ],[
  4.1076 -            audio_arts=yes
  4.1077 -            ])
  4.1078 -            CFLAGS="$save_CFLAGS"
  4.1079 -            AC_MSG_RESULT($audio_arts)
  4.1080 -            if test x$audio_arts = xyes; then
  4.1081 -                AC_ARG_ENABLE(arts-shared,
  4.1082 -AS_HELP_STRING([--enable-arts-shared], [dynamically load aRts audio support [[default=yes]]]),
  4.1083 -                              , enable_arts_shared=yes)
  4.1084 -                arts_lib=[`find_lib "libartsc.so.*" "$ARTS_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`]
  4.1085 -
  4.1086 -                AC_DEFINE(SDL_AUDIO_DRIVER_ARTS, 1, [ ])
  4.1087 -                SOURCES="$SOURCES $srcdir/src/audio/arts/*.c"
  4.1088 -                EXTRA_CFLAGS="$EXTRA_CFLAGS $ARTS_CFLAGS"
  4.1089 -                if test x$have_loadso != xyes && \
  4.1090 -                   test x$enable_arts_shared = xyes; then
  4.1091 -                    AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic ARTS loading])
  4.1092 -                fi
  4.1093 -                if test x$have_loadso = xyes && \
  4.1094 -                   test x$enable_arts_shared = xyes && test x$arts_lib != x; then
  4.1095 -                    echo "-- dynamic libartsc -> $arts_lib"
  4.1096 -                    AC_DEFINE_UNQUOTED(SDL_AUDIO_DRIVER_ARTS_DYNAMIC, "$arts_lib", [ ])
  4.1097 -                    SUMMARY_audio="${SUMMARY_audio} arts(dynamic)"
  4.1098 -                else
  4.1099 -                    EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ARTS_LIBS"
  4.1100 -                    SUMMARY_audio="${SUMMARY_audio} arts"
  4.1101 -                fi
  4.1102 -                have_audio=yes
  4.1103 -            fi
  4.1104 -        fi
  4.1105 -    fi
  4.1106 -}
  4.1107 -
  4.1108 -dnl See if the NAS audio interface is supported
  4.1109 -CheckNAS()
  4.1110 -{
  4.1111 -    AC_ARG_ENABLE(nas,
  4.1112 -AS_HELP_STRING([--enable-nas], [support the NAS audio API [[default=yes]]]),
  4.1113 -                  , enable_nas=yes)
  4.1114 -    if test x$enable_audio = xyes -a x$enable_nas = xyes; then
  4.1115 -        AC_CHECK_HEADER(audio/audiolib.h, have_nas_hdr=yes)
  4.1116 -        AC_CHECK_LIB(audio, AuOpenServer, have_nas_lib=yes)
  4.1117 -
  4.1118 -        AC_MSG_CHECKING(for NAS audio support)
  4.1119 -        have_nas=no
  4.1120 -
  4.1121 -        if test x$have_nas_hdr = xyes -a x$have_nas_lib = xyes; then
  4.1122 -            have_nas=yes
  4.1123 -            NAS_LIBS="-laudio"
  4.1124 -
  4.1125 -        elif test -r /usr/X11R6/include/audio/audiolib.h; then
  4.1126 -            have_nas=yes
  4.1127 -            NAS_CFLAGS="-I/usr/X11R6/include/"
  4.1128 -            NAS_LIBS="-L/usr/X11R6/lib -laudio -lXt"
  4.1129 -
  4.1130 -        fi
  4.1131 -
  4.1132 -        AC_MSG_RESULT($have_nas)
  4.1133 -
  4.1134 -        if test x$have_nas = xyes; then
  4.1135 -            AC_ARG_ENABLE(nas-shared,
  4.1136 -AS_HELP_STRING([--enable-nas-shared], [dynamically load NAS audio support [[default=yes]]]),
  4.1137 -                          , enable_nas_shared=yes)
  4.1138 -            nas_lib=[`find_lib "libaudio.so.*" "$NAS_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`]
  4.1139 -
  4.1140 -            if test x$have_loadso != xyes && \
  4.1141 -               test x$enable_nas_shared = xyes; then
  4.1142 -                AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic NAS loading])
  4.1143 -            fi
  4.1144 -            if test x$have_loadso = xyes && \
  4.1145 -               test x$enable_nas_shared = xyes && test x$nas_lib != x; then
  4.1146 -                echo "-- dynamic libaudio -> $nas_lib"
  4.1147 -                AC_DEFINE_UNQUOTED(SDL_AUDIO_DRIVER_NAS_DYNAMIC, "$nas_lib", [ ])
  4.1148 -                SUMMARY_audio="${SUMMARY_audio} nas(dynamic)"
  4.1149 -            else
  4.1150 -                EXTRA_LDFLAGS="$EXTRA_LDFLAGS $NAS_LIBS"
  4.1151 -                SUMMARY_audio="${SUMMARY_audio} nas"
  4.1152 -            fi
  4.1153 -
  4.1154 -            AC_DEFINE(SDL_AUDIO_DRIVER_NAS, 1, [ ])
  4.1155 -            SOURCES="$SOURCES $srcdir/src/audio/nas/*.c"
  4.1156 -            EXTRA_CFLAGS="$EXTRA_CFLAGS $NAS_CFLAGS"
  4.1157 -            have_audio=yes
  4.1158 -        fi
  4.1159 -    fi
  4.1160 -}
  4.1161 -
  4.1162 -dnl See if the sndio audio interface is supported
  4.1163 -CheckSNDIO()
  4.1164 -{
  4.1165 -    AC_ARG_ENABLE(sndio,
  4.1166 -AS_HELP_STRING([--enable-sndio], [support the sndio audio API [[default=yes]]]),
  4.1167 -                  , enable_sndio=yes)
  4.1168 -    if test x$enable_audio = xyes -a x$enable_sndio = xyes; then
  4.1169 -        AC_CHECK_HEADER(sndio.h, have_sndio_hdr=yes)
  4.1170 -        AC_CHECK_LIB(sndio, sio_open, have_sndio_lib=yes)
  4.1171 -
  4.1172 -        AC_MSG_CHECKING(for sndio audio support)
  4.1173 -        have_sndio=no
  4.1174 -
  4.1175 -        if test x$have_sndio_hdr = xyes -a x$have_sndio_lib = xyes; then
  4.1176 -            have_sndio=yes
  4.1177 -            SNDIO_LIBS="-lsndio"
  4.1178 -        fi
  4.1179 -
  4.1180 -        AC_MSG_RESULT($have_sndio)
  4.1181 -
  4.1182 -        if test x$have_sndio = xyes; then
  4.1183 -            AC_ARG_ENABLE(sndio-shared,
  4.1184 -AS_HELP_STRING([--enable-sndio-shared], [dynamically load sndio audio support [[default=yes]]]),
  4.1185 -                          , enable_sndio_shared=yes)
  4.1186 -            sndio_lib=[`find_lib "libsndio.so.*" "$SNDIO_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`]
  4.1187 -
  4.1188 -            if test x$have_loadso != xyes && \
  4.1189 -               test x$enable_sndio_shared = xyes; then
  4.1190 -                AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic sndio loading])
  4.1191 -            fi
  4.1192 -            if test x$have_loadso = xyes && \
  4.1193 -               test x$enable_sndio_shared = xyes && test x$sndio_lib != x; then
  4.1194 -                echo "-- dynamic libsndio -> $sndio_lib"
  4.1195 -                AC_DEFINE_UNQUOTED(SDL_AUDIO_DRIVER_SNDIO_DYNAMIC, "$sndio_lib", [ ])
  4.1196 -                SUMMARY_audio="${SUMMARY_audio} sndio(dynamic)"
  4.1197 -            else
  4.1198 -                EXTRA_LDFLAGS="$EXTRA_LDFLAGS $SNDIO_LIBS"
  4.1199 -                SUMMARY_audio="${SUMMARY_audio} sndio"
  4.1200 -            fi
  4.1201 -
  4.1202 -            AC_DEFINE(SDL_AUDIO_DRIVER_SNDIO, 1, [ ])
  4.1203 -            SOURCES="$SOURCES $srcdir/src/audio/sndio/*.c"
  4.1204 -            EXTRA_CFLAGS="$EXTRA_CFLAGS $SNDIO_CFLAGS"
  4.1205 -            have_audio=yes
  4.1206 -        fi
  4.1207 -    fi
  4.1208 -}
  4.1209 -
  4.1210 -dnl Find FusionSound
  4.1211 -CheckFusionSound()
  4.1212 -{
  4.1213 -    AC_ARG_ENABLE(fusionsound,
  4.1214 -AS_HELP_STRING([--enable-fusionsound], [use FusionSound audio driver [[default=no]]]),
  4.1215 -                  , enable_fusionsound=no)
  4.1216 -    if test x$enable_audio = xyes -a x$enable_fusionsound = xyes; then
  4.1217 -        PKG_CHECK_MODULES([FUSIONSOUND], [fusionsound >= 1.1.1], fusionsound=yes, fusionsound=no)
  4.1218 -
  4.1219 -        if test x$fusionsound = xyes; then
  4.1220 -            AC_DEFINE(SDL_AUDIO_DRIVER_FUSIONSOUND, 1, [ ])
  4.1221 -            SOURCES="$SOURCES $srcdir/src/audio/fusionsound/*.c"
  4.1222 -            EXTRA_CFLAGS="$EXTRA_CFLAGS $FUSIONSOUND_CFLAGS"
  4.1223 -            
  4.1224 -            AC_ARG_ENABLE(fusionsound-shared,
  4.1225 -AS_HELP_STRING([--enable-fusionsound-shared], [dynamically load fusionsound audio support [[default=yes]]]),
  4.1226 -                          , enable_fusionsound_shared=yes)
  4.1227 -            fusionsound_shared=no
  4.1228 -            AC_MSG_CHECKING(for FusionSound dynamic loading support)
  4.1229 -            if test x$have_loadso != xyes && \
  4.1230 -               test x$enable_fusionsound_shared = xyes; then
  4.1231 -                AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic fusionsound loading])
  4.1232 -            fi
  4.1233 -            if test x$have_loadso = xyes && \
  4.1234 -               test x$enable_fusionsound_shared = xyes; then
  4.1235 -                AC_DEFINE_UNQUOTED(SDL_AUDIO_DRIVER_FUSIONSOUND_DYNAMIC, "libfusionsound.so", [ ])
  4.1236 -                fusionsound_shared=yes
  4.1237 -                SUMMARY_audio="${SUMMARY_audio} fusionsound(dynamic)"
  4.1238 -            else
  4.1239 -                EXTRA_LDFLAGS="$EXTRA_LDFLAGS $FUSIONSOUND_LIBS"
  4.1240 -                SUMMARY_audio="${SUMMARY_audio} fusionsound"
  4.1241 -            fi
  4.1242 -            AC_MSG_RESULT($fusionsound_shared)
  4.1243 -            
  4.1244 -            have_audio=yes
  4.1245 -        fi
  4.1246 -    fi
  4.1247 -}
  4.1248 -
  4.1249 -dnl rcg07142001 See if the user wants the disk writer audio driver...
  4.1250 -CheckDiskAudio()
  4.1251 -{
  4.1252 -    AC_ARG_ENABLE(diskaudio,
  4.1253 -AS_HELP_STRING([--enable-diskaudio], [support the disk writer audio driver [[default=yes]]]),
  4.1254 -                  , enable_diskaudio=yes)
  4.1255 -    if test x$enable_audio = xyes -a x$enable_diskaudio = xyes; then
  4.1256 -        AC_DEFINE(SDL_AUDIO_DRIVER_DISK, 1, [ ])
  4.1257 -        SOURCES="$SOURCES $srcdir/src/audio/disk/*.c"
  4.1258 -        SUMMARY_audio="${SUMMARY_audio} disk"
  4.1259 -    fi
  4.1260 -}
  4.1261 -
  4.1262 -dnl rcg03142006 See if the user wants the dummy audio driver...
  4.1263 -CheckDummyAudio()
  4.1264 -{
  4.1265 -    AC_ARG_ENABLE(dummyaudio,
  4.1266 -AS_HELP_STRING([--enable-dummyaudio], [support the dummy audio driver [[default=yes]]]),
  4.1267 -                  , enable_dummyaudio=yes)
  4.1268 -    if test x$enable_audio = xyes -a x$enable_dummyaudio = xyes; then
  4.1269 -        AC_DEFINE(SDL_AUDIO_DRIVER_DUMMY, 1, [ ])
  4.1270 -        SOURCES="$SOURCES $srcdir/src/audio/dummy/*.c"
  4.1271 -        SUMMARY_audio="${SUMMARY_audio} dummy"
  4.1272 -    fi
  4.1273 -}
  4.1274 -
  4.1275 -dnl See if libsamplerate is available
  4.1276 -CheckLibSampleRate()
  4.1277 -{
  4.1278 -    AC_ARG_ENABLE(libsamplerate,
  4.1279 -AS_HELP_STRING([--enable-libsamplerate], [use libsamplerate for audio rate conversion [[default=yes]]]),
  4.1280 -                  , enable_libsamplerate=yes)
  4.1281 -    if test x$enable_libsamplerate = xyes; then
  4.1282 -        AC_CHECK_HEADER(samplerate.h,
  4.1283 -                        have_samplerate_h_hdr=yes,
  4.1284 -                        have_samplerate_h_hdr=no)
  4.1285 -        if test x$have_samplerate_h_hdr = xyes; then
  4.1286 -            AC_DEFINE(HAVE_LIBSAMPLERATE_H, 1, [ ])
  4.1287 -
  4.1288 -            AC_ARG_ENABLE(libsamplerate-shared,
  4.1289 -AS_HELP_STRING([--enable-libsamplerate-shared], [dynamically load libsamplerate [[default=yes]]]),
  4.1290 -                          , enable_libsamplerate_shared=yes)
  4.1291 -
  4.1292 -            samplerate_lib=[`find_lib "libsamplerate.so.*" "" | sed 's/.*\/\(.*\)/\1/; q'`]
  4.1293 -
  4.1294 -            if test x$have_loadso != xyes && \
  4.1295 -               test x$enable_libsamplerate_shared = xyes; then
  4.1296 -                AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic libsamplerate loading])
  4.1297 -            fi
  4.1298 -            if test x$have_loadso = xyes && \
  4.1299 -               test x$enable_libsamplerate_shared = xyes && test x$samplerate_lib != x; then
  4.1300 -                echo "-- dynamic libsamplerate -> $samplerate_lib"
  4.1301 -                AC_DEFINE_UNQUOTED(SDL_LIBSAMPLERATE_DYNAMIC, "$samplerate_lib", [ ])
  4.1302 -            else
  4.1303 -                EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lsamplerate"
  4.1304 -            fi
  4.1305 -        fi
  4.1306 -    fi
  4.1307 -}
  4.1308 -
  4.1309 -dnl See if GCC's -fvisibility=hidden is supported (gcc4 and later, usually).
  4.1310 -dnl  Details of this flag are here: http://gcc.gnu.org/wiki/Visibility
  4.1311 -CheckVisibilityHidden()
  4.1312 -{
  4.1313 -    AC_MSG_CHECKING(for GCC -fvisibility=hidden option)
  4.1314 -    have_gcc_fvisibility=no
  4.1315 -
  4.1316 -    visibility_CFLAGS="-fvisibility=hidden"
  4.1317 -    save_CFLAGS="$CFLAGS"
  4.1318 -    CFLAGS="$save_CFLAGS $visibility_CFLAGS -Werror"
  4.1319 -    AC_TRY_COMPILE([
  4.1320 -    #if !defined(__GNUC__) || __GNUC__ < 4
  4.1321 -    #error SDL only uses visibility attributes in GCC 4 or newer
  4.1322 -    #endif
  4.1323 -    ],[
  4.1324 -    ],[
  4.1325 -    have_gcc_fvisibility=yes
  4.1326 -    ])
  4.1327 -    AC_MSG_RESULT($have_gcc_fvisibility)
  4.1328 -    CFLAGS="$save_CFLAGS"
  4.1329 -
  4.1330 -    if test x$have_gcc_fvisibility = xyes; then
  4.1331 -        EXTRA_CFLAGS="$EXTRA_CFLAGS $visibility_CFLAGS"
  4.1332 -    fi
  4.1333 -}
  4.1334 -
  4.1335 -dnl See if GCC's -mpreferred-stack-boundary is supported.
  4.1336 -dnl  Reference: http://bugzilla.libsdl.org/show_bug.cgi?id=1296
  4.1337 -CheckStackBoundary()
  4.1338 -{
  4.1339 -    AC_MSG_CHECKING(for GCC -mpreferred-stack-boundary option)
  4.1340 -    have_gcc_preferred_stack_boundary=no
  4.1341 -
  4.1342 -    save_CFLAGS="$CFLAGS"
  4.1343 -    CFLAGS="$save_CFLAGS -mpreferred-stack-boundary=2"
  4.1344 -    AC_TRY_COMPILE([
  4.1345 -    int x = 0;
  4.1346 -    ],[
  4.1347 -    ],[
  4.1348 -    have_gcc_preferred_stack_boundary=yes
  4.1349 -    ])
  4.1350 -    AC_MSG_RESULT($have_gcc_preferred_stack_boundary)
  4.1351 -    CFLAGS="$save_CFLAGS"
  4.1352 -
  4.1353 -    if test x$have_gcc_preferred_stack_boundary = xyes; then
  4.1354 -        EXTRA_CFLAGS="$EXTRA_CFLAGS -mpreferred-stack-boundary=2"
  4.1355 -    fi
  4.1356 -}
  4.1357 -
  4.1358 -dnl See if GCC's -Wdeclaration-after-statement is supported.
  4.1359 -dnl  This lets us catch things that would fail on a C89 compiler when using
  4.1360 -dnl  a modern GCC.
  4.1361 -CheckDeclarationAfterStatement()
  4.1362 -{
  4.1363 -    AC_MSG_CHECKING(for GCC -Wdeclaration-after-statement option)
  4.1364 -    have_gcc_declaration_after_statement=no
  4.1365 -
  4.1366 -    save_CFLAGS="$CFLAGS"
  4.1367 -    CFLAGS="$save_CFLAGS -Wdeclaration-after-statement -Werror=declaration-after-statement"
  4.1368 -    AC_TRY_COMPILE([
  4.1369 -    int x = 0;
  4.1370 -    ],[
  4.1371 -    ],[
  4.1372 -    have_gcc_declaration_after_statement=yes
  4.1373 -    ])
  4.1374 -    AC_MSG_RESULT($have_gcc_declaration_after_statement)
  4.1375 -    CFLAGS="$save_CFLAGS"
  4.1376 -
  4.1377 -    if test x$have_gcc_declaration_after_statement = xyes; then
  4.1378 -        EXTRA_CFLAGS="$EXTRA_CFLAGS -Wdeclaration-after-statement -Werror=declaration-after-statement"
  4.1379 -    fi
  4.1380 -}
  4.1381 -
  4.1382 -dnl See if GCC's -Wall is supported.
  4.1383 -CheckWarnAll()
  4.1384 -{
  4.1385 -    AC_MSG_CHECKING(for GCC -Wall option)
  4.1386 -    have_gcc_Wall=no
  4.1387 -
  4.1388 -    save_CFLAGS="$CFLAGS"
  4.1389 -    CFLAGS="$save_CFLAGS -Wall"
  4.1390 -    AC_TRY_COMPILE([
  4.1391 -    int x = 0;
  4.1392 -    ],[
  4.1393 -    ],[
  4.1394 -    have_gcc_Wall=yes
  4.1395 -    ])
  4.1396 -    AC_MSG_RESULT($have_gcc_Wall)
  4.1397 -    CFLAGS="$save_CFLAGS"
  4.1398 -
  4.1399 -    if test x$have_gcc_Wall = xyes; then
  4.1400 -        EXTRA_CFLAGS="$EXTRA_CFLAGS -Wall"
  4.1401 -
  4.1402 -        dnl Haiku headers use multicharacter constants all over the place. Ignore these warnings when using -Wall.
  4.1403 -        AC_MSG_CHECKING(for necessary GCC -Wno-multichar option)
  4.1404 -        need_gcc_Wno_multichar=no
  4.1405 -        case "$host" in
  4.1406 -            *-*-haiku*)
  4.1407 -                need_gcc_Wno_multichar=yes
  4.1408 -                ;;
  4.1409 -        esac
  4.1410 -        AC_MSG_RESULT($need_gcc_Wno_multichar)
  4.1411 -        if test x$need_gcc_Wno_multichar = xyes; then
  4.1412 -            EXTRA_CFLAGS="$EXTRA_CFLAGS -Wno-multichar"
  4.1413 -        fi
  4.1414 -    fi
  4.1415 -}
  4.1416 -
  4.1417 -dnl Check for Wayland
  4.1418 -CheckWayland()
  4.1419 -{
  4.1420 -    AC_ARG_ENABLE(video-wayland,
  4.1421 -AS_HELP_STRING([--enable-video-wayland], [use Wayland video driver [[default=yes]]]),
  4.1422 -                  ,enable_video_wayland=yes)
  4.1423 -
  4.1424 -    AC_ARG_ENABLE(video-wayland-qt-touch,
  4.1425 -AS_HELP_STRING([--enable-video-wayland-qt-touch], [QtWayland server support for Wayland video driver [[default=yes]]]),
  4.1426 -                  ,enable_video_wayland_qt_touch=yes)
  4.1427 -
  4.1428 -    if test x$enable_video = xyes -a x$enable_video_wayland = xyes; then
  4.1429 -        AC_MSG_CHECKING(for Wayland support)
  4.1430 -        video_wayland=no
  4.1431 -        if  test x$video_opengl_egl = xyes && \
  4.1432 -            test x$video_opengles_v2 = xyes; then
  4.1433 -            if $PKG_CONFIG --exists wayland-client wayland-scanner wayland-protocols wayland-egl wayland-cursor egl xkbcommon ; then
  4.1434 -                WAYLAND_CFLAGS=`$PKG_CONFIG --cflags wayland-client wayland-egl wayland-cursor xkbcommon`
  4.1435 -                WAYLAND_LIBS=`$PKG_CONFIG --libs wayland-client wayland-egl wayland-cursor xkbcommon`
  4.1436 -                WAYLAND_SCANNER=`$PKG_CONFIG --variable=wayland_scanner wayland-scanner`
  4.1437 -                video_wayland=yes
  4.1438 -            fi
  4.1439 -        fi
  4.1440 -        AC_MSG_RESULT($video_wayland)
  4.1441 -
  4.1442 -        if test x$video_wayland = xyes; then
  4.1443 -            AC_DEFINE(SDL_VIDEO_DRIVER_WAYLAND, 1, [ ])
  4.1444 -            if test x$enable_video_wayland_qt_touch = xyes; then
  4.1445 -                AC_DEFINE(SDL_VIDEO_DRIVER_WAYLAND_QT_TOUCH, 1, [ ])
  4.1446 -            fi
  4.1447 -
  4.1448 -            WAYLAND_SOURCES="$srcdir/src/video/wayland/*.c"
  4.1449 -            SOURCES="$SOURCES $WAYLAND_SOURCES"
  4.1450 -            EXTRA_CFLAGS="$EXTRA_CFLAGS $WAYLAND_CFLAGS -I\$(gen)"
  4.1451 -            AC_ARG_ENABLE(wayland-shared,
  4.1452 -AS_HELP_STRING([--enable-wayland-shared], [dynamically load Wayland support [[default=maybe]]]),
  4.1453 -                          , enable_wayland_shared=maybe)
  4.1454 -
  4.1455 -            dnl FIXME: Do BSD and OS X need special cases?
  4.1456 -            case "$host" in
  4.1457 -                *)
  4.1458 -                    wayland_client_lib=[`find_lib "libwayland-client.so.*" "$WAYLAND_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`]
  4.1459 -                    wayland_egl_lib=[`find_lib "libwayland-egl.so.*" "$WAYLAND_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`]
  4.1460 -                    if test x$wayland_egl_lib = x; then
  4.1461 -                        dnl This works in Ubuntu 13.10, maybe others
  4.1462 -                        wayland_egl_lib=[`find_lib "mesa-egl/libwayland-egl.so.*" "$WAYLAND_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`]
  4.1463 -                    fi
  4.1464 -                    wayland_cursor_lib=[`find_lib "libwayland-cursor.so.*" "$WAYLAND_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`]
  4.1465 -                    xkbcommon_lib=[`find_lib "libxkbcommon.so.*" "$WAYLAND_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`]
  4.1466 -                    ;;
  4.1467 -            esac
  4.1468 -
  4.1469 -            if test x$enable_wayland_shared = xmaybe; then
  4.1470 -                enable_wayland_shared=yes
  4.1471 -            fi
  4.1472 -            if test x$have_loadso != xyes && \
  4.1473 -               test x$enable_wayland_shared = xyes; then
  4.1474 -                AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic Wayland loading])
  4.1475 -                enable_wayland_shared=no
  4.1476 -            fi
  4.1477 -            if test x$have_loadso = xyes && \
  4.1478 -               test x$enable_wayland_shared = xyes && \
  4.1479 -               test x$wayland_client_lib != x && \
  4.1480 -               test x$wayland_egl_lib != x && \
  4.1481 -               test x$wayland_cursor_lib != x && \
  4.1482 -               test x$xkbcommon_lib != x; then
  4.1483 -                echo "-- dynamic libwayland-client -> $wayland_client_lib"
  4.1484 -                echo "-- dynamic libwayland-egl -> $wayland_egl_lib"
  4.1485 -                echo "-- dynamic libwayland-cursor -> $wayland_cursor_lib"
  4.1486 -                echo "-- dynamic libxkbcommon -> $xkbcommon_lib"
  4.1487 -                AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC, "$wayland_client_lib", [ ])
  4.1488 -                AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_EGL, "$wayland_egl_lib", [ ])
  4.1489 -                AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_CURSOR, "$wayland_cursor_lib", [ ])
  4.1490 -                AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_XKBCOMMON, "$xkbcommon_lib", [ ])
  4.1491 -                SUMMARY_video="${SUMMARY_video} wayland(dynamic)"
  4.1492 -            else
  4.1493 -                enable_wayland_shared=no
  4.1494 -                EXTRA_LDFLAGS="$EXTRA_LDFLAGS $WAYLAND_LIBS"
  4.1495 -                SUMMARY_video="${SUMMARY_video} wayland"
  4.1496 -            fi
  4.1497 -            have_video=yes
  4.1498 -        fi
  4.1499 -    fi
  4.1500 -}
  4.1501 -
  4.1502 -
  4.1503 -dnl Check for Native Client stuff
  4.1504 -CheckNativeClient()
  4.1505 -{
  4.1506 -        AC_TRY_COMPILE([
  4.1507 -          #if !defined(__native_client__)
  4.1508 -          #error "NO NACL"
  4.1509 -          #endif
  4.1510 -        ],[
  4.1511 -        ],[
  4.1512 -        AC_DEFINE(SDL_VIDEO_DRIVER_NACL, 1, [ ])
  4.1513 -        AC_DEFINE(SDL_AUDIO_DRIVER_NACL, 1, [ ])
  4.1514 -        AC_DEFINE(HAVE_POW, 1, [ ])
  4.1515 -        AC_DEFINE(HAVE_OPENGLES2, 1, [ ])
  4.1516 -        AC_DEFINE(SDL_VIDEO_OPENGL_ES2, 1, [ ])
  4.1517 -        AC_DEFINE(SDL_VIDEO_RENDER_OGL_ES2, 1, [ ])
  4.1518 -
  4.1519 -        SDL_LIBS="-lppapi_simple -lppapi_gles2 $SDL_LIBS"
  4.1520 -
  4.1521 -        SDLMAIN_SOURCES="$srcdir/src/main/nacl/*.c"
  4.1522 -        SOURCES="$SOURCES $srcdir/src/audio/nacl/*.c"
  4.1523 -        SUMMARY_audio="${SUMMARY_audio} nacl"
  4.1524 -        SOURCES="$SOURCES $srcdir/src/video/nacl/*.c"
  4.1525 -        SUMMARY_video="${SUMMARY_video} nacl opengles2"
  4.1526 -        ])
  4.1527 -}
  4.1528 -
  4.1529 -
  4.1530 -CheckRPI()
  4.1531 -{
  4.1532 -    AC_ARG_ENABLE(video-rpi,
  4.1533 -AS_HELP_STRING([--enable-video-rpi], [use Raspberry Pi video driver [[default=no]]]),
  4.1534 -                  , enable_video_rpi=no)
  4.1535 -    if test x$enable_video = xyes -a x$enable_video_rpi = xyes; then
  4.1536 -        PKG_CHECK_MODULES([RPI], [bcm_host brcmegl], video_rpi=yes, video_rpi=no)
  4.1537 -
  4.1538 -        if test x$video_rpi = xno; then
  4.1539 -            if test x$ARCH = xnetbsd; then
  4.1540 -                RPI_CFLAGS="-I/usr/pkg/include -I/usr/pkg/include/interface/vcos/pthreads -I/usr/pkg/include/interface/vmcs_host/linux"
  4.1541 -                RPI_LIBS="-Wl,-R/usr/pkg/lib -L/usr/pkg/lib -lbcm_host"
  4.1542 -            else
  4.1543 -                RPI_CFLAGS="-I/opt/vc/include -I/opt/vc/include/interface/vcos/pthreads -I/opt/vc/include/interface/vmcs_host/linux"
  4.1544 -                RPI_LIBS="-Wl,-rpath,/opt/vc/lib -L/opt/vc/lib -lbcm_host"
  4.1545 -            fi
  4.1546 -        fi
  4.1547 -
  4.1548 -        # Save the original compiler flags and libraries
  4.1549 -        ac_save_cflags="$CFLAGS"; ac_save_libs="$LIBS"
  4.1550 -
  4.1551 -        # Add the Raspberry Pi compiler flags and libraries
  4.1552 -        CFLAGS="$CFLAGS $RPI_CFLAGS"; LIBS="$LIBS $RPI_LIBS"
  4.1553 -
  4.1554 -        AC_MSG_CHECKING(for Raspberry Pi)
  4.1555 -        have_video_rpi=no
  4.1556 -        AC_TRY_LINK([
  4.1557 -          #include <bcm_host.h>
  4.1558 -        ],[
  4.1559 -          bcm_host_init();
  4.1560 -        ],[
  4.1561 -        have_video_rpi=yes
  4.1562 -        ],[
  4.1563 -        ])
  4.1564 -        AC_MSG_RESULT($have_video_rpi)
  4.1565 -
  4.1566 -        # Restore the compiler flags and libraries
  4.1567 -        CFLAGS="$ac_save_cflags"; LIBS="$ac_save_libs"
  4.1568 -        
  4.1569 -        if test x$have_video_rpi = xyes; then
  4.1570 -            CFLAGS="$CFLAGS $RPI_CFLAGS"
  4.1571 -            SDL_CFLAGS="$SDL_CFLAGS $RPI_CFLAGS"
  4.1572 -            EXTRA_CFLAGS="$EXTRA_CFLAGS $RPI_CFLAGS"
  4.1573 -            EXTRA_LDFLAGS="$EXTRA_LDFLAGS $RPI_LIBS"
  4.1574 -            SOURCES="$SOURCES $srcdir/src/video/raspberry/*.c"
  4.1575 -            AC_DEFINE(SDL_VIDEO_DRIVER_RPI, 1, [ ])
  4.1576 -            SUMMARY_video="${SUMMARY_video} rpi"
  4.1577 -        fi
  4.1578 -    fi
  4.1579 -}
  4.1580 -
  4.1581 -dnl Find the X11 include and library directories
  4.1582 -CheckX11()
  4.1583 -{
  4.1584 -    AC_ARG_ENABLE(video-x11,
  4.1585 -AS_HELP_STRING([--enable-video-x11], [use X11 video driver [[default=yes]]]),
  4.1586 -                  , enable_video_x11=yes)
  4.1587 -    if test x$enable_video = xyes -a x$enable_video_x11 = xyes; then
  4.1588 -        case "$host" in
  4.1589 -            *-*-darwin*)
  4.1590 -                # This isn't necessary for X11, but fixes GLX detection
  4.1591 -                if test "x$x_includes" = xNONE && \
  4.1592 -                   test "x$x_libraries" = xNONE && \
  4.1593 -                   test -d /usr/X11R6/include && \
  4.1594 -                   test -d /usr/X11R6/lib; then
  4.1595 -                    x_includes="/usr/X11R6/include"
  4.1596 -                    x_libraries="/usr/X11R6/lib"
  4.1597 -                fi
  4.1598 -                ;;
  4.1599 -        esac
  4.1600 -        AC_PATH_X
  4.1601 -        AC_PATH_XTRA
  4.1602 -        if test x$have_x = xyes; then
  4.1603 -            AC_ARG_ENABLE(x11-shared,
  4.1604 -AS_HELP_STRING([--enable-x11-shared], [dynamically load X11 support [[default=maybe]]]),
  4.1605 -                          , enable_x11_shared=maybe)
  4.1606 -
  4.1607 -            case "$host" in
  4.1608 -                *-*-darwin*)
  4.1609 -                    x11_lib='/usr/X11R6/lib/libX11.6.dylib'
  4.1610 -                    x11ext_lib='/usr/X11R6/lib/libXext.6.dylib'
  4.1611 -                    xcursor_lib='/usr/X11R6/lib/libXcursor.1.dylib'
  4.1612 -                    xinerama_lib='/usr/X11R6/lib/libXinerama.1.dylib'
  4.1613 -                    xinput_lib='/usr/X11R6/lib/libXi.6.dylib'
  4.1614 -                    xrandr_lib='/usr/X11R6/lib/libXrandr.2.dylib'
  4.1615 -                    xrender_lib='/usr/X11R6/lib/libXrender.1.dylib'
  4.1616 -                    xss_lib='/usr/X11R6/lib/libXss.1.dylib'
  4.1617 -                    xvidmode_lib='/usr/X11R6/lib/libXxf86vm.1.dylib'
  4.1618 -                    ;;
  4.1619 -                *-*-openbsd*)
  4.1620 -                    x11_lib='libX11.so'
  4.1621 -                    x11ext_lib='libXext.so'
  4.1622 -                    xcursor_lib='libXcursor.so'
  4.1623 -                    xinerama_lib='libXinerama.so'
  4.1624 -                    xinput_lib='libXi.so'
  4.1625 -                    xrandr_lib='libXrandr.so'
  4.1626 -                    xrender_lib='libXrender.so'
  4.1627 -                    xss_lib='libXss.so'
  4.1628 -                    xvidmode_lib='libXxf86vm.so'
  4.1629 -                    ;;
  4.1630 -                *)
  4.1631 -                    x11_lib=[`find_lib "libX11.so.*" "$X_LIBS -L/usr/X11/$base_libdir -L/usr/X11R6/$base_libdir" | sed 's/.*\/\(.*\)/\1/; q'`]
  4.1632 -                    x11ext_lib=[`find_lib "libXext.so.*" "$X_LIBS -L/usr/X11/$base_libdir -L/usr/X11R6/$base_libdir" | sed 's/.*\/\(.*\)/\1/; q'`]
  4.1633 -                    xcursor_lib=[`find_lib "libXcursor.so.*" "$X_LIBS -L/usr/X11/$base_libdir -L/usr/X11R6/$base_libdir" | sed 's/.*\/\(.*\)/\1/; q'`]
  4.1634 -                    xinerama_lib=[`find_lib "libXinerama.so.*" "$X_LIBS -L/usr/X11/$base_libdir -L/usr/X11R6/$base_libdir" | sed 's/.*\/\(.*\)/\1/; q'`]
  4.1635 -                    xinput_lib=[`find_lib "libXi.so.*" "$X_LIBS -L/usr/X11/$base_libdir -L/usr/X11R6/$base_libdir" | sed 's/.*\/\(.*\)/\1/; q'`]
  4.1636 -                    xrandr_lib=[`find_lib "libXrandr.so.*" "$X_LIBS -L/usr/X11/$base_libdir -L/usr/X11R6/$base_libdir" | sed 's/.*\/\(.*\)/\1/; q'`]
  4.1637 -                    xrender_lib=[`find_lib "libXrender.so.*" "$X_LIBS -L/usr/X11/$base_libdir -L/usr/X11R6/$base_libdir" | sed 's/.*\/\(.*\)/\1/; q'`]
  4.1638 -                    xss_lib=[`find_lib "libXss.so.*" "$X_LIBS -L/usr/X11/$base_libdir -L/usr/X11R6/$base_libdir" | sed 's/.*\/\(.*\)/\1/; q'`]
  4.1639 -                    xvidmode_lib=[`find_lib "libXxf86vm.so.*" "$X_LIBS -L/usr/X11/$base_libdir -L/usr/X11R6/$base_libdir" | sed 's/.*\/\(.*\)/\1/; q'`]
  4.1640 -                    ;;
  4.1641 -            esac
  4.1642 -
  4.1643 -            if test x$ac_cv_func_shmat != xyes; then
  4.1644 -                X_CFLAGS="$X_CFLAGS -DNO_SHARED_MEMORY"
  4.1645 -            fi
  4.1646 -            CFLAGS="$CFLAGS $X_CFLAGS"
  4.1647 -            LDFLAGS="$LDFLAGS $X_LIBS"
  4.1648 -
  4.1649 -            AC_CHECK_HEADER(X11/extensions/Xext.h,
  4.1650 -                            have_xext_h_hdr=yes,
  4.1651 -                            have_xext_h_hdr=no,
  4.1652 -                            [#include <X11/Xlib.h>
  4.1653 -                             #include <X11/Xproto.h>
  4.1654 -                            ])
  4.1655 -            if test x$have_xext_h_hdr != xyes; then
  4.1656 -               AC_MSG_ERROR([
  4.1657 -*** Missing Xext.h, maybe you need to install the libxext-dev package?
  4.1658 -               ])
  4.1659 -            fi
  4.1660 -
  4.1661 -            AC_DEFINE(SDL_VIDEO_DRIVER_X11, 1, [ ])
  4.1662 -            SOURCES="$SOURCES $srcdir/src/video/x11/*.c"
  4.1663 -            EXTRA_CFLAGS="$EXTRA_CFLAGS $X_CFLAGS"
  4.1664 -
  4.1665 -            # Needed so SDL applications can include SDL_syswm.h
  4.1666 -            SDL_CFLAGS="$SDL_CFLAGS $X_CFLAGS"
  4.1667 -
  4.1668 -            if test x$enable_x11_shared = xmaybe; then
  4.1669 -                enable_x11_shared=yes
  4.1670 -            fi
  4.1671 -            if test x$have_loadso != xyes && \
  4.1672 -               test x$enable_x11_shared = xyes; then
  4.1673 -                AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic X11 loading])
  4.1674 -                enable_x11_shared=no
  4.1675 -            fi
  4.1676 -            if test x$have_loadso = xyes && \
  4.1677 -               test x$enable_x11_shared = xyes && test x$x11_lib != x && test x$x11ext_lib != x; then
  4.1678 -                echo "-- dynamic libX11 -> $x11_lib"
  4.1679 -                echo "-- dynamic libX11ext -> $x11ext_lib"
  4.1680 -                AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_X11_DYNAMIC, "$x11_lib", [ ])
  4.1681 -                AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_X11_DYNAMIC_XEXT, "$x11ext_lib", [ ])
  4.1682 -                SUMMARY_video="${SUMMARY_video} x11(dynamic)"
  4.1683 -            else
  4.1684 -                enable_x11_shared=no
  4.1685 -                EXTRA_LDFLAGS="$EXTRA_LDFLAGS $X_LIBS -lX11 -lXext"
  4.1686 -                SUMMARY_video="${SUMMARY_video} x11"
  4.1687 -            fi
  4.1688 -            have_video=yes
  4.1689 -
  4.1690 -            AC_MSG_CHECKING(for const parameter to XextAddDisplay)
  4.1691 -            have_const_param_XextAddDisplay=no
  4.1692 -            AC_TRY_COMPILE([
  4.1693 -              #include <X11/Xlib.h>
  4.1694 -              #include <X11/Xproto.h>
  4.1695 -              #include <X11/extensions/Xext.h>
  4.1696 -              #include <X11/extensions/extutil.h>
  4.1697 -              extern XExtDisplayInfo* XextAddDisplay(XExtensionInfo* a,Display* b,_Xconst char* c,XExtensionHooks* d,int e,XPointer f);
  4.1698 -            ],[
  4.1699 -            ],[
  4.1700 -            have_const_param_XextAddDisplay=yes
  4.1701 -            AC_DEFINE([SDL_VIDEO_DRIVER_X11_CONST_PARAM_XEXTADDDISPLAY], 1, [ ])
  4.1702 -            ])
  4.1703 -            AC_MSG_RESULT($have_const_param_XextAddDisplay)
  4.1704 -
  4.1705 -            dnl AC_CHECK_LIB(X11, XGetEventData, AC_DEFINE(SDL_VIDEO_DRIVER_X11_SUPPORTS_GENERIC_EVENTS, 1, [Have XGenericEvent]))
  4.1706 -            AC_MSG_CHECKING([for XGenericEvent])
  4.1707 -            have_XGenericEvent=no
  4.1708 -            AC_TRY_COMPILE([
  4.1709 -                #include <X11/Xlib.h>
  4.1710 -            ],[
  4.1711 -Display *display;
  4.1712 -XEvent event;
  4.1713 -XGenericEventCookie *cookie = &event.xcookie;
  4.1714 -XNextEvent(display, &event);
  4.1715 -XGetEventData(display, cookie);
  4.1716 -XFreeEventData(display, cookie);
  4.1717 -            ],[
  4.1718 -                have_XGenericEvent=yes
  4.1719 -                AC_DEFINE([SDL_VIDEO_DRIVER_X11_SUPPORTS_GENERIC_EVENTS], 1, [ ])
  4.1720 -            ])
  4.1721 -            AC_MSG_RESULT($have_XGenericEvent)
  4.1722 -
  4.1723 -            AC_CHECK_LIB(X11, XkbKeycodeToKeysym, AC_DEFINE(SDL_VIDEO_DRIVER_X11_HAS_XKBKEYCODETOKEYSYM, 1, [Have XkbKeycodeToKeysym]))
  4.1724 -
  4.1725 -            AC_ARG_ENABLE(video-x11-xcursor,
  4.1726 -AS_HELP_STRING([--enable-video-x11-xcursor], [enable X11 Xcursor support [[default=yes]]]),
  4.1727 -                            , enable_video_x11_xcursor=yes)
  4.1728 -            if test x$enable_video_x11_xcursor = xyes; then
  4.1729 -                definitely_enable_video_x11_xcursor=no
  4.1730 -                AC_CHECK_HEADER(X11/Xcursor/Xcursor.h,
  4.1731 -                                have_xcursor_h_hdr=yes,
  4.1732 -                                have_xcursor_h_hdr=no,
  4.1733 -                                [#include <X11/Xlib.h>
  4.1734 -                                ])
  4.1735 -                if test x$have_xcursor_h_hdr = xyes; then
  4.1736 -                    if test x$enable_x11_shared = xyes && test x$xcursor_lib != x ; then
  4.1737 -                        echo "-- dynamic libXcursor -> $xcursor_lib"
  4.1738 -                        AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_X11_DYNAMIC_XCURSOR, "$xcursor_lib", [ ])
  4.1739 -                        definitely_enable_video_x11_xcursor=yes
  4.1740 -                    else
  4.1741 -                        AC_CHECK_LIB(Xcursor, XcursorImageCreate, have_xcursor_lib=yes)
  4.1742 -                        if test x$have_xcursor_lib = xyes ; then
  4.1743 -                            EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lXcursor"
  4.1744 -                            definitely_enable_video_x11_xcursor=yes
  4.1745 -                        fi
  4.1746 -                    fi
  4.1747 -                fi
  4.1748 -            fi
  4.1749 -            if test x$definitely_enable_video_x11_xcursor = xyes; then
  4.1750 -                AC_DEFINE(SDL_VIDEO_DRIVER_X11_XCURSOR, 1, [ ])
  4.1751 -                SUMMARY_video_x11="${SUMMARY_video_x11} xcursor"
  4.1752 -            fi
  4.1753 -            AC_ARG_ENABLE(video-x11-xdbe,
  4.1754 -AS_HELP_STRING([--enable-video-x11-xdbe], [enable X11 Xdbe support [[default=yes]]]),
  4.1755 -                            , enable_video_x11_xdbe=yes)
  4.1756 -            if test x$enable_video_x11_xdbe = xyes; then
  4.1757 -                AC_CHECK_HEADER(X11/extensions/Xdbe.h,
  4.1758 -                                have_dbe_h_hdr=yes,
  4.1759 -                                have_dbe_h_hdr=no,
  4.1760 -                                [#include <X11/Xlib.h>
  4.1761 -                                ])
  4.1762 -                if test x$have_dbe_h_hdr = xyes; then
  4.1763 -                    AC_DEFINE(SDL_VIDEO_DRIVER_X11_XDBE, 1, [ ])
  4.1764 -                    SUMMARY_video_x11="${SUMMARY_video_x11} xdbe"
  4.1765 -                fi
  4.1766 -            fi
  4.1767 -            AC_ARG_ENABLE(video-x11-xinerama,
  4.1768 -AS_HELP_STRING([--enable-video-x11-xinerama], [enable X11 Xinerama support [[default=yes]]]),
  4.1769 -                            , enable_video_x11_xinerama=yes)
  4.1770 -            if test x$enable_video_x11_xinerama = xyes; then
  4.1771 -                definitely_enable_video_x11_xinerama=no
  4.1772 -                AC_CHECK_HEADER(X11/extensions/Xinerama.h,
  4.1773 -                                have_xinerama_h_hdr=yes,
  4.1774 -                                have_xinerama_h_hdr=no,
  4.1775 -                                [#include <X11/Xlib.h>
  4.1776 -                                ])
  4.1777 -                if test x$have_xinerama_h_hdr = xyes; then
  4.1778 -                    if test x$enable_x11_shared = xyes && test x$xinerama_lib != x ; then
  4.1779 -                        echo "-- dynamic libXinerama -> $xinerama_lib"
  4.1780 -                        AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_X11_DYNAMIC_XINERAMA, "$xinerama_lib", [ ])
  4.1781 -                        definitely_enable_video_x11_xinerama=yes
  4.1782 -                    else
  4.1783 -                        AC_CHECK_LIB(Xinerama, XineramaQueryExtension, have_xinerama_lib=yes)
  4.1784 -                        if test x$have_xinerama_lib = xyes ; then
  4.1785 -                            EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lXinerama"
  4.1786 -                            definitely_enable_video_x11_xinerama=yes
  4.1787 -                        fi
  4.1788 -                    fi
  4.1789 -                fi
  4.1790 -            fi
  4.1791 -            if test x$definitely_enable_video_x11_xinerama = xyes; then
  4.1792 -                AC_DEFINE(SDL_VIDEO_DRIVER_X11_XINERAMA, 1, [ ])
  4.1793 -                SUMMARY_video_x11="${SUMMARY_video_x11} xinerama"
  4.1794 -            fi
  4.1795 -            AC_ARG_ENABLE(video-x11-xinput,
  4.1796 -AS_HELP_STRING([--enable-video-x11-xinput], [enable X11 XInput extension for manymouse, tablets, etc [[default=yes]]]),
  4.1797 -                            , enable_video_x11_xinput=yes)
  4.1798 -            if test x$enable_video_x11_xinput = xyes; then
  4.1799 -                definitely_enable_video_x11_xinput=no
  4.1800 -                AC_CHECK_HEADER(X11/extensions/XInput2.h,
  4.1801 -                                have_xinput_h_hdr=yes,
  4.1802 -                                have_xinput_h_hdr=no,
  4.1803 -                                [#include <X11/Xlib.h>
  4.1804 -                                ])
  4.1805 -                if test x$have_xinput_h_hdr = xyes; then
  4.1806 -                    if test x$enable_x11_shared = xyes && test x$xinput_lib != x ; then
  4.1807 -                        echo "-- dynamic libXi -> $xinput_lib"
  4.1808 -                        AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_X11_DYNAMIC_XINPUT2, "$xinput_lib", [ ])
  4.1809 -                        definitely_enable_video_x11_xinput=yes
  4.1810 -                    else
  4.1811 -                        AC_CHECK_LIB(Xi, XOpenDevice, have_xinput_lib=yes)
  4.1812 -                        if test x$have_xinput_lib = xyes ; then
  4.1813 -                            EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lXi"
  4.1814 -                            definitely_enable_video_x11_xinput=yes
  4.1815 -                        fi
  4.1816 -                    fi
  4.1817 -                fi
  4.1818 -            fi
  4.1819 -            if test x$definitely_enable_video_x11_xinput = xyes; then
  4.1820 -                SUMMARY_video_x11="${SUMMARY_video_x11} xinput2"
  4.1821 -                AC_DEFINE(SDL_VIDEO_DRIVER_X11_XINPUT2, 1, [ ])
  4.1822 -                AC_MSG_CHECKING(for xinput2 multitouch)
  4.1823 -                have_xinput2_multitouch=no
  4.1824 -                AC_TRY_COMPILE([
  4.1825 -                    #include <X11/Xlib.h>
  4.1826 -                    #include <X11/Xproto.h>
  4.1827 -                    #include <X11/extensions/XInput2.h>
  4.1828 -                    ],[
  4.1829 -int event_type = XI_TouchBegin;
  4.1830 -XITouchClassInfo *t;
  4.1831 -                    ],[
  4.1832 -                    have_xinput2_multitouch=yes
  4.1833 -                    AC_DEFINE([SDL_VIDEO_DRIVER_X11_XINPUT2_SUPPORTS_MULTITOUCH], 1, [])
  4.1834 -                    SUMMARY_video_x11="${SUMMARY_video_x11} xinput2_multitouch"
  4.1835 -                    ])
  4.1836 -                AC_MSG_RESULT($have_xinput2_multitouch)
  4.1837 -            fi
  4.1838 -            AC_ARG_ENABLE(video-x11-xrandr,
  4.1839 -AS_HELP_STRING([--enable-video-x11-xrandr], [enable X11 Xrandr extension for fullscreen [[default=yes]]]),
  4.1840 -                            , enable_video_x11_xrandr=yes)
  4.1841 -            if test x$enable_video_x11_xrandr = xyes; then
  4.1842 -                dnl XRRScreenResources is only present in Xrandr >= 1.2, we use that as a test.
  4.1843 -                definitely_enable_video_x11_xrandr=no
  4.1844 -                have_xrandr_h_hdr=no
  4.1845 -                AC_TRY_COMPILE([
  4.1846 -                #include <X11/Xlib.h>
  4.1847 -                #include <X11/extensions/Xrandr.h>
  4.1848 -                ],[
  4.1849 -                XRRScreenResources *res = NULL;
  4.1850 -                ],[
  4.1851 -                have_xrandr_h_hdr=yes
  4.1852 -                ])
  4.1853 -                if test x$have_xrandr_h_hdr = xyes; then
  4.1854 -                    if test x$enable_x11_shared = xyes && test x$xrandr_lib != x ; then
  4.1855 -                        echo "-- dynamic libXrandr -> $xrandr_lib"
  4.1856 -                        AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_X11_DYNAMIC_XRANDR, "$xrandr_lib", [ ])
  4.1857 -                        definitely_enable_video_x11_xrandr=yes
  4.1858 -                    else
  4.1859 -                        AC_CHECK_LIB(Xrandr, XRRQueryExtension, have_xrandr_lib=yes)
  4.1860 -                        if test x$have_xrandr_lib = xyes ; then
  4.1861 -                            EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lXrandr"
  4.1862 -                            definitely_enable_video_x11_xrandr=yes
  4.1863 -                        fi
  4.1864 -                    fi
  4.1865 -                fi
  4.1866 -            fi
  4.1867 -            if test x$definitely_enable_video_x11_xrandr = xyes; then
  4.1868 -                AC_DEFINE(SDL_VIDEO_DRIVER_X11_XRANDR, 1, [ ])
  4.1869 -                SUMMARY_video_x11="${SUMMARY_video_x11} xrandr"
  4.1870 -            fi
  4.1871 -            AC_ARG_ENABLE(video-x11-scrnsaver,
  4.1872 -AS_HELP_STRING([--enable-video-x11-scrnsaver], [enable X11 screensaver extension [[default=yes]]]),
  4.1873 -                            , enable_video_x11_scrnsaver=yes)
  4.1874 -            if test x$enable_video_x11_scrnsaver = xyes; then
  4.1875 -                AC_CHECK_HEADER(X11/extensions/scrnsaver.h,
  4.1876 -                                have_scrnsaver_h_hdr=yes,
  4.1877 -                                have_scrnsaver_h_hdr=no,
  4.1878 -                                [#include <X11/Xlib.h>
  4.1879 -                                ])
  4.1880 -                if test x$have_scrnsaver_h_hdr = xyes; then
  4.1881 -                    if test x$enable_x11_shared = xyes && test x$xss_lib != x ; then
  4.1882 -                        echo "-- dynamic libXss -> $xss_lib"
  4.1883 -                        AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_X11_DYNAMIC_XSS, "$xss_lib", [ ])
  4.1884 -                        definitely_enable_video_x11_scrnsaver=yes
  4.1885 -                    else
  4.1886 -                        AC_CHECK_LIB(Xss, XScreenSaverSuspend, have_xss_lib=yes)
  4.1887 -                        if test x$have_xss_lib = xyes ; then
  4.1888 -                            EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lXss"
  4.1889 -                            definitely_enable_video_x11_scrnsaver=yes
  4.1890 -                        fi
  4.1891 -                    fi
  4.1892 -                fi
  4.1893 -            fi
  4.1894 -            if test x$definitely_enable_video_x11_scrnsaver = xyes; then
  4.1895 -                AC_DEFINE(SDL_VIDEO_DRIVER_X11_XSCRNSAVER, 1, [ ])
  4.1896 -                SUMMARY_video_x11="${SUMMARY_video_x11} xscrnsaver"
  4.1897 -            fi
  4.1898 -            AC_ARG_ENABLE(video-x11-xshape,
  4.1899 -AS_HELP_STRING([--enable-video-x11-xshape], [enable X11 XShape support [[default=yes]]]),
  4.1900 -                            , enable_video_x11_xshape=yes)
  4.1901 -            if test x$enable_video_x11_xshape = xyes; then
  4.1902 -                AC_CHECK_HEADER(X11/extensions/shape.h,
  4.1903 -                                have_shape_h_hdr=yes,
  4.1904 -                                have_shape_h_hdr=no,
  4.1905 -                                [#include <X11/Xlib.h>
  4.1906 -                                ])
  4.1907 -                if test x$have_shape_h_hdr = xyes; then
  4.1908 -                    AC_DEFINE(SDL_VIDEO_DRIVER_X11_XSHAPE, 1, [ ])
  4.1909 -                    SUMMARY_video_x11="${SUMMARY_video_x11} xshape"
  4.1910 -                fi
  4.1911 -            fi
  4.1912 -            AC_ARG_ENABLE(video-x11-vm,
  4.1913 -AS_HELP_STRING([--enable-video-x11-vm], [use X11 VM extension for fullscreen [[default=yes]]]),
  4.1914 -                            , enable_video_x11_vm=yes)
  4.1915 -            if test x$enable_video_x11_vm = xyes; then
  4.1916 -                definitely_enable_video_x11_vm=no
  4.1917 -                AC_CHECK_HEADER(X11/extensions/xf86vmode.h,
  4.1918 -                                have_vm_h_hdr=yes,
  4.1919 -                                have_vm_h_hdr=no,
  4.1920 -                                [#include <X11/Xlib.h>
  4.1921 -                                ])
  4.1922 -                if test x$have_vm_h_hdr = xyes; then
  4.1923 -                    if test x$enable_x11_shared = xyes && test x$xvidmode_lib != x ; then
  4.1924 -                        echo "-- dynamic libXxf86vm -> $xvidmode_lib"
  4.1925 -                        AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_X11_DYNAMIC_XVIDMODE, "$xvidmode_lib", [ ])
  4.1926 -                        definitely_enable_video_x11_vm=yes
  4.1927 -                    else
  4.1928 -                        AC_CHECK_LIB(Xxf86vm, XF86VidModeQueryVersion, have_vm_lib=yes)
  4.1929 -                        if test x$have_vm_lib = xyes ; then
  4.1930 -                            EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lXxf86vm"
  4.1931 -                            definitely_enable_video_x11_vm=yes
  4.1932 -                        fi
  4.1933 -                    fi
  4.1934 -                fi
  4.1935 -            fi
  4.1936 -            if test x$definitely_enable_video_x11_vm = xyes; then
  4.1937 -                AC_DEFINE(SDL_VIDEO_DRIVER_X11_XVIDMODE, 1, [ ])
  4.1938 -                SUMMARY_video_x11="${SUMMARY_video_x11} xvidmode"
  4.1939 -            fi
  4.1940 -        fi
  4.1941 -    fi
  4.1942 -}
  4.1943 -
  4.1944 -dnl Set up the Vivante video driver if enabled
  4.1945 -CheckVivanteVideo()
  4.1946 -{
  4.1947 -    AC_ARG_ENABLE(video-vivante,
  4.1948 -AS_HELP_STRING([--enable-video-vivante], [use Vivante EGL video driver [[default=yes]]]),
  4.1949 -                  , enable_video_vivante=yes)
  4.1950 -    if test x$enable_video = xyes -a x$enable_video_vivante = xyes; then
  4.1951 -        AC_MSG_CHECKING(for Vivante VDK API)
  4.1952 -        have_vivante_vdk=no
  4.1953 -        AC_TRY_COMPILE([
  4.1954 -          #define LINUX
  4.1955 -          #define EGL_API_FB
  4.1956 -          #include <gc_vdk.h>
  4.1957 -        ],[
  4.1958 -        ],[
  4.1959 -        have_vivante_vdk=yes
  4.1960 -        ])
  4.1961 -        AC_MSG_RESULT($have_vivante_vdk)
  4.1962 -
  4.1963 -        AC_MSG_CHECKING(for Vivante FB API)
  4.1964 -        have_vivante_egl=no
  4.1965 -        AC_TRY_COMPILE([
  4.1966 -          #define LINUX
  4.1967 -          #define EGL_API_FB
  4.1968 -          #include <EGL/eglvivante.h>
  4.1969 -        ],[
  4.1970 -        ],[
  4.1971 -        have_vivante_egl=yes
  4.1972 -        ])
  4.1973 -        AC_MSG_RESULT($have_vivante_egl)
  4.1974 -
  4.1975 -        if test x$have_vivante_vdk = xyes -o x$have_vivante_egl = xyes; then
  4.1976 -            AC_DEFINE(SDL_VIDEO_DRIVER_VIVANTE, 1, [ ])
  4.1977 -            EXTRA_CFLAGS="$EXTRA_CFLAGS -DLINUX -DEGL_API_FB"
  4.1978 -            if test x$have_vivante_vdk = xyes; then
  4.1979 -                AC_DEFINE(SDL_VIDEO_DRIVER_VIVANTE_VDK, 1, [ ])
  4.1980 -                EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lVDK"
  4.1981 -            fi
  4.1982 -            SOURCES="$SOURCES $srcdir/src/video/vivante/*.c"
  4.1983 -            SUMMARY_video="${SUMMARY_video} vivante"
  4.1984 -            have_video=yes
  4.1985 -        fi
  4.1986 -    fi
  4.1987 -}
  4.1988 -
  4.1989 -dnl Set up the Haiku video driver if enabled
  4.1990 -CheckHaikuVideo()
  4.1991 -{
  4.1992 -    if test x$enable_video = xyes; then
  4.1993 -        AC_DEFINE(SDL_VIDEO_DRIVER_HAIKU, 1, [ ])
  4.1994 -        SOURCES="$SOURCES $srcdir/src/video/haiku/*.cc"
  4.1995 -        have_video=yes
  4.1996 -        SUMMARY_video="${SUMMARY_video} haiku"
  4.1997 -    fi
  4.1998 -}
  4.1999 -
  4.2000 -dnl Set up the Cocoa video driver for Mac OS X (but not Darwin)
  4.2001 -CheckCOCOA()
  4.2002 -{
  4.2003 -    AC_ARG_ENABLE(video-cocoa,
  4.2004 -AS_HELP_STRING([--enable-video-cocoa], [use Cocoa video driver [[default=yes]]]),
  4.2005 -                  , enable_video_cocoa=yes)
  4.2006 -    if test x$enable_video = xyes -a x$enable_video_cocoa = xyes; then
  4.2007 -        save_CFLAGS="$CFLAGS"
  4.2008 -        dnl Work around that we don't have Objective-C support in autoconf
  4.2009 -        CFLAGS="$CFLAGS -x objective-c"
  4.2010 -        AC_MSG_CHECKING(for Cocoa framework)
  4.2011 -        have_cocoa=no
  4.2012 -        AC_TRY_COMPILE([
  4.2013 -          #import <Cocoa/Cocoa.h>
  4.2014 -        ],[
  4.2015 -        ],[
  4.2016 -        have_cocoa=yes
  4.2017 -        ])
  4.2018 -        AC_MSG_RESULT($have_cocoa)
  4.2019 -        CFLAGS="$save_CFLAGS"
  4.2020 -        if test x$have_cocoa = xyes; then
  4.2021 -            AC_DEFINE(SDL_VIDEO_DRIVER_COCOA, 1, [ ])
  4.2022 -            SOURCES="$SOURCES $srcdir/src/video/cocoa/*.m"
  4.2023 -            SUMMARY_video="${SUMMARY_video} cocoa"
  4.2024 -            have_video=yes
  4.2025 -        fi
  4.2026 -    fi
  4.2027 -}
  4.2028 -
  4.2029 -CheckMETAL()
  4.2030 -{
  4.2031 -    AC_ARG_ENABLE(render-metal,
  4.2032 -AS_HELP_STRING([--enable-render-metal], [enable the Metal render driver [[default=yes]]]),
  4.2033 -                                , enable_render_metal=yes)
  4.2034 -    if test x$enable_render = xyes -a x$enable_render_metal = xyes; then
  4.2035 -        save_CFLAGS="$CFLAGS"
  4.2036 -        dnl Work around that we don't have Objective-C support in autoconf
  4.2037 -        CFLAGS="$CFLAGS -x objective-c"
  4.2038 -        AC_MSG_CHECKING(for Metal framework)
  4.2039 -        have_metal=no
  4.2040 -        AC_TRY_COMPILE([
  4.2041 -          #import <Cocoa/Cocoa.h>
  4.2042 -          #import <Metal/Metal.h>
  4.2043 -          #import <QuartzCore/CAMetalLayer.h>
  4.2044 -
  4.2045 -          #if !TARGET_CPU_X86_64
  4.2046 -          #error Metal doesn't work on this configuration
  4.2047 -          #endif
  4.2048 -        ],[
  4.2049 -        ],[
  4.2050 -        have_metal=yes
  4.2051 -        ])
  4.2052 -        CFLAGS="$save_CFLAGS"
  4.2053 -        AC_MSG_RESULT($have_metal)
  4.2054 -        if test x$have_metal = xyes; then
  4.2055 -            AC_DEFINE(SDL_VIDEO_RENDER_METAL, 1, [ ])
  4.2056 -            SOURCES="$SOURCES $srcdir/src/render/metal/*.m"
  4.2057 -            SUMMARY_video="${SUMMARY_video} metal"
  4.2058 -        else
  4.2059 -            enable_render_metal=no
  4.2060 -        fi
  4.2061 -    fi
  4.2062 -}
  4.2063 -
  4.2064 -
  4.2065 -dnl Find DirectFB
  4.2066 -CheckDirectFB()
  4.2067 -{
  4.2068 -    AC_ARG_ENABLE(video-directfb,
  4.2069 -AS_HELP_STRING([--enable-video-directfb], [use DirectFB video driver [[default=no]]]),
  4.2070 -                  , enable_video_directfb=no)
  4.2071 -    if test x$enable_video = xyes -a x$enable_video_directfb = xyes; then
  4.2072 -        PKG_CHECK_MODULES([DIRECTFB], [directfb >= 1.0.0], video_directfb=yes, video_directfb=no)
  4.2073 -
  4.2074 -        if test x$video_directfb = xyes; then
  4.2075 -            # SuSE 11.1 installs directfb-config without directfb-devel
  4.2076 -            save_CPPFLAGS="$CPPFLAGS"
  4.2077 -            CPPFLAGS="$CPPFLAGS $DIRECTFB_CFLAGS"
  4.2078 -            AC_CHECK_HEADER(directfb.h, have_directfb_hdr=yes, have_directfb_hdr=no)
  4.2079 -            CPPFLAGS="$save_CPPFLAGS"
  4.2080 -            video_directfb=$have_directfb_hdr
  4.2081 -        fi
  4.2082 -
  4.2083 -        if test x$video_directfb = xyes; then
  4.2084 -            AC_ARG_ENABLE(directfb-shared,
  4.2085 -AS_HELP_STRING([--enable-directfb-shared], [dynamically load directfb support [[default=yes]]]),
  4.2086 -                              , enable_directfb_shared=yes)
  4.2087 -
  4.2088 -            AC_DEFINE(SDL_VIDEO_DRIVER_DIRECTFB, 1, [ ])
  4.2089 -            AC_DEFINE(SDL_VIDEO_RENDER_DIRECTFB, 1, [ ])
  4.2090 -            SOURCES="$SOURCES $srcdir/src/video/directfb/*.c"
  4.2091 -            EXTRA_CFLAGS="$EXTRA_CFLAGS $DIRECTFB_CFLAGS"
  4.2092 -
  4.2093 -            AC_MSG_CHECKING(for directfb dynamic loading support)
  4.2094 -            directfb_shared=no
  4.2095 -            directfb_lib=[`find_lib "libdirectfb*.so.*" "$DIRECTFB_LIBS"`]
  4.2096 -            # | sed 's/.*\/\(.*\)/\1/; q'`]
  4.2097 -AC_MSG_WARN("directfb $directfb_lib")
  4.2098 -            if test x$have_loadso != xyes && \
  4.2099 -               test x$enable_directfb_shared = xyes; then
  4.2100 -                AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic directfb loading])
  4.2101 -            fi
  4.2102 -            if test x$have_loadso = xyes && \
  4.2103 -               test x$enable_directfb_shared = xyes && test x$directfb_lib != x; then
  4.2104 -                directfb_shared=yes
  4.2105 -                echo "-- $directfb_lib_spec -> $directfb_lib"
  4.2106 -                AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_DIRECTFB_DYNAMIC, "$directfb_lib", [ ])
  4.2107 -                SUMMARY_video="${SUMMARY_video} directfb(dynamic)"
  4.2108 -            else
  4.2109 -                EXTRA_LDFLAGS="$EXTRA_LDFLAGS $DIRECTFB_LIBS"
  4.2110 -                SUMMARY_video="${SUMMARY_video} directfb"
  4.2111 -            fi
  4.2112 -            AC_MSG_RESULT($directfb_shared)
  4.2113 -            SDL_CFLAGS="$SDL_CFLAGS $DIRECTFB_CFLAGS"
  4.2114 -            have_video=yes
  4.2115 -        fi
  4.2116 -    fi
  4.2117 -}
  4.2118 -
  4.2119 -dnl Find KMSDRM
  4.2120 -CheckKMSDRM()
  4.2121 -{
  4.2122 -    AC_ARG_ENABLE(video-kmsdrm,
  4.2123 -AS_HELP_STRING([--enable-video-kmsdrm], [use KMSDRM video driver [[default=no]]]),
  4.2124 -                  , enable_video_kmsdrm=no)
  4.2125 -
  4.2126 -    if test x$enable_video = xyes -a x$enable_video_kmsdrm = xyes; then
  4.2127 -        video_kmsdrm=no
  4.2128 -
  4.2129 -        PKG_CHECK_MODULES([LIBDRM], [libdrm >= 2.4.46], libdrm_avail=yes, libdrm_avail=no)
  4.2130 -        PKG_CHECK_MODULES([LIBGBM], [gbm >= 9.0.0], libgbm_avail=yes, libgbm_avail=no)
  4.2131 -
  4.2132 -        if test x$libdrm_avail = xyes -a x$libgbm_avail = xyes; then
  4.2133 -            video_kmsdrm=yes
  4.2134 -        fi
  4.2135 -
  4.2136 -        if test x$video_kmsdrm = xyes; then
  4.2137 -            AC_ARG_ENABLE(kmsdrm-shared,
  4.2138 -AS_HELP_STRING([--enable-kmsdrm-shared], [dynamically load kmsdrm support [[default=yes]]]),
  4.2139 -                , enable_kmsdrm_shared=yes)
  4.2140 -
  4.2141 -            AC_DEFINE(SDL_VIDEO_DRIVER_KMSDRM, 1, [ ])
  4.2142 -            SOURCES="$SOURCES $srcdir/src/video/kmsdrm/*.c"
  4.2143 -            EXTRA_CFLAGS="$EXTRA_CFLAGS $LIBDRM_CFLAGS $LIBGBM_CFLAGS"
  4.2144 -
  4.2145 -            AC_MSG_CHECKING(for kmsdrm dynamic loading support)
  4.2146 -            kmsdrm_shared=no
  4.2147 -            drm_lib=[`find_lib "libdrm.so.*" "$DRM_LIBS"`]
  4.2148 -            gbm_lib=[`find_lib "libgbm.so.*" "$DRM_LIBS"`]
  4.2149 -            if test x$have_loadso != xyes && \
  4.2150 -               test x$enable_kmsdrm_shared = xyes; then
  4.2151 -                AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic kmsdrm loading])
  4.2152 -            fi
  4.2153 -            if test x$have_loadso = xyes && \
  4.2154 -               test x$enable_kmsdrm_shared = xyes && test x$drm_lib != x && test x$gbm_lib != x; then
  4.2155 -                kmsdrm_shared=yes
  4.2156 -                AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_KMSDRM_DYNAMIC, "$drm_lib", [ ])
  4.2157 -                AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_KMSDRM_DYNAMIC_GBM, "$gbm_lib", [ ])
  4.2158 -                AC_DEFINE_UNQUOTED(HAVE_KMSDRM_SHARED, "TRUE", [ ])
  4.2159 -                SUMMARY_video="${SUMMARY_video} kmsdrm(dynamic)"
  4.2160 -            else
  4.2161 -                EXTRA_LDFLAGS="$EXTRA_LDFLAGS $LIBDRM_LIBS $LIBGBM_LIBS"
  4.2162 -                SUMMARY_video="${SUMMARY_video} kmsdrm"
  4.2163 -            fi
  4.2164 -            AC_MSG_RESULT($kmsdrm_shared)
  4.2165 -            have_video=yes
  4.2166 -        fi
  4.2167 -    fi
  4.2168 -}
  4.2169 -
  4.2170 -dnl rcg04172001 Set up the Null video driver.
  4.2171 -CheckDummyVideo()
  4.2172 -{
  4.2173 -    AC_ARG_ENABLE(video-dummy,
  4.2174 -AS_HELP_STRING([--enable-video-dummy], [use dummy video driver [[default=yes]]]),
  4.2175 -                  , enable_video_dummy=yes)
  4.2176 -    if test x$enable_video_dummy = xyes; then
  4.2177 -        AC_DEFINE(SDL_VIDEO_DRIVER_DUMMY, 1, [ ])
  4.2178 -        SOURCES="$SOURCES $srcdir/src/video/dummy/*.c"
  4.2179 -        have_video=yes
  4.2180 -        SUMMARY_video="${SUMMARY_video} dummy"
  4.2181 -    fi
  4.2182 -}
  4.2183 -
  4.2184 -dnl Set up the QNX video driver if enabled
  4.2185 -CheckQNXVideo()
  4.2186 -{
  4.2187 -    if test x$enable_video = xyes; then
  4.2188 -        AC_DEFINE(SDL_VIDEO_DRIVER_QNX, 1, [ ])
  4.2189 -        SOURCES="$SOURCES $srcdir/src/video/qnx/*.c"
  4.2190 -        have_video=yes
  4.2191 -        EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lscreen -lEGL -lGLESv2"
  4.2192 -        SUMMARY_video="${SUMMARY_video} qnx"
  4.2193 -    fi
  4.2194 -}
  4.2195 -
  4.2196 -dnl Set up the QNX audio driver if enabled
  4.2197 -CheckQNXAudio()
  4.2198 -{
  4.2199 -    if test x$enable_audio = xyes; then
  4.2200 -        AC_DEFINE(SDL_AUDIO_DRIVER_QSA, 1, [ ])
  4.2201 -        SOURCES="$SOURCES $srcdir/src/audio/qsa/*.c"
  4.2202 -        have_audio=yes
  4.2203 -        EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lasound"
  4.2204 -        SUMMARY_audio="${SUMMARY_audio} qsa"
  4.2205 -    fi
  4.2206 -}
  4.2207 -
  4.2208 -dnl Check to see if OpenGL support is desired
  4.2209 -AC_ARG_ENABLE(video-opengl,
  4.2210 -AS_HELP_STRING([--enable-video-opengl], [include OpenGL support [[default=yes]]]),
  4.2211 -              , enable_video_opengl=yes)
  4.2212 -
  4.2213 -dnl Find OpenGL
  4.2214 -CheckOpenGLX11()
  4.2215 -{
  4.2216 -    if test x$enable_video = xyes -a x$enable_video_opengl = xyes; then
  4.2217 -        AC_MSG_CHECKING(for OpenGL (GLX) support)
  4.2218 -        video_opengl=no
  4.2219 -        AC_TRY_COMPILE([
  4.2220 -         #include <GL/gl.h>
  4.2221 -         #include <GL/glx.h>
  4.2222 -        ],[
  4.2223 -        ],[
  4.2224 -        video_opengl=yes
  4.2225 -        ])
  4.2226 -        AC_MSG_RESULT($video_opengl)
  4.2227 -        if test x$video_opengl = xyes; then
  4.2228 -            AC_DEFINE(SDL_VIDEO_OPENGL, 1, [ ])
  4.2229 -            AC_DEFINE(SDL_VIDEO_OPENGL_GLX, 1, [ ])
  4.2230 -            AC_DEFINE(SDL_VIDEO_RENDER_OGL, 1, [ ])
  4.2231 -            SUMMARY_video="${SUMMARY_video} opengl"
  4.2232 -        fi
  4.2233 -    fi
  4.2234 -}
  4.2235 -
  4.2236 -dnl Check to see if OpenGL ES support is desired
  4.2237 -AC_ARG_ENABLE(video-opengles,
  4.2238 -AS_HELP_STRING([--enable-video-opengles], [include OpenGL ES support [[default=yes]]]),
  4.2239 -              , enable_video_opengles=yes)
  4.2240 -AC_ARG_ENABLE(video-opengles1,
  4.2241 -AS_HELP_STRING([--enable-video-opengles1], [include OpenGL ES 1.1 support [[default=yes]]]),
  4.2242 -              , enable_video_opengles1=yes)
  4.2243 -AC_ARG_ENABLE(video-opengles2,
  4.2244 -AS_HELP_STRING([--enable-video-opengles2], [include OpenGL ES 2.0 support [[default=yes]]]),
  4.2245 -              , enable_video_opengles2=yes)
  4.2246 -
  4.2247 -dnl Find OpenGL ES
  4.2248 -CheckOpenGLESX11()
  4.2249 -{
  4.2250 -    if test x$enable_video = xyes -a x$enable_video_opengles = xyes; then
  4.2251 -        AC_MSG_CHECKING(for EGL support)
  4.2252 -        video_opengl_egl=no
  4.2253 -        AC_TRY_COMPILE([
  4.2254 -          #define LINUX
  4.2255 -          #define EGL_API_FB
  4.2256 -          #define MESA_EGL_NO_X11_HEADERS
  4.2257 -          #include <EGL/egl.h>
  4.2258 -          #include <EGL/eglext.h>
  4.2259 -        ],[
  4.2260 -        ],[
  4.2261 -        video_opengl_egl=yes
  4.2262 -        ])
  4.2263 -        AC_MSG_RESULT($video_opengl_egl)
  4.2264 -        if test x$video_opengl_egl = xyes; then
  4.2265 -            AC_DEFINE(SDL_VIDEO_OPENGL_EGL, 1, [ ])
  4.2266 -        fi
  4.2267 -            
  4.2268 -        if test x$enable_video_opengles1 = xyes; then
  4.2269 -            AC_MSG_CHECKING(for OpenGL ES v1 headers)
  4.2270 -            video_opengles_v1=no
  4.2271 -            AC_TRY_COMPILE([
  4.2272 -             #include <GLES/gl.h>
  4.2273 -             #include <GLES/glext.h>
  4.2274 -            ],[
  4.2275 -            ],[
  4.2276 -            video_opengles_v1=yes
  4.2277 -            ])
  4.2278 -            AC_MSG_RESULT($video_opengles_v1)
  4.2279 -            if test x$video_opengles_v1 = xyes; then
  4.2280 -                AC_DEFINE(SDL_VIDEO_OPENGL_ES, 1, [ ])
  4.2281 -                AC_DEFINE(SDL_VIDEO_RENDER_OGL_ES, 1, [ ])
  4.2282 -                SUMMARY_video="${SUMMARY_video} opengl_es1"
  4.2283 -            fi
  4.2284 -        fi
  4.2285 -        
  4.2286 -        if test x$enable_video_opengles2 = xyes; then
  4.2287 -            AC_MSG_CHECKING(for OpenGL ES v2 headers)
  4.2288 -            video_opengles_v2=no
  4.2289 -            AC_TRY_COMPILE([
  4.2290 -             #include <GLES2/gl2.h>
  4.2291 -             #include <GLES2/gl2ext.h>
  4.2292 -            ],[
  4.2293 -            ],[
  4.2294 -            video_opengles_v2=yes
  4.2295 -            ])
  4.2296 -            AC_MSG_RESULT($video_opengles_v2)
  4.2297 -            if test x$video_opengles_v2 = xyes; then
  4.2298 -                AC_DEFINE(SDL_VIDEO_OPENGL_ES2, 1, [ ])
  4.2299 -                AC_DEFINE(SDL_VIDEO_RENDER_OGL_ES2, 1, [ ])
  4.2300 -                SUMMARY_video="${SUMMARY_video} opengl_es2"
  4.2301 -            fi
  4.2302 -        fi
  4.2303 -    fi
  4.2304 -}
  4.2305 -
  4.2306 -dnl Check for Windows OpenGL
  4.2307 -CheckWINDOWSGL()
  4.2308 -{
  4.2309 -    if test x$enable_video = xyes -a x$enable_video_opengl = xyes; then
  4.2310 -        AC_DEFINE(SDL_VIDEO_OPENGL, 1, [ ])
  4.2311 -        AC_DEFINE(SDL_VIDEO_OPENGL_WGL, 1, [ ])
  4.2312 -        AC_DEFINE(SDL_VIDEO_RENDER_OGL, 1, [ ])
  4.2313 -        SUMMARY_video="${SUMMARY_video} opengl"
  4.2314 -    fi
  4.2315 -}
  4.2316 -
  4.2317 -dnl Check for Windows OpenGL
  4.2318 -CheckWINDOWSGLES()
  4.2319 -{
  4.2320 -    if test x$enable_video = xyes -a x$enable_video_opengles = xyes; then
  4.2321 -
  4.2322 -        AC_MSG_CHECKING(for EGL support)
  4.2323 -        video_opengl_egl=no
  4.2324 -        AC_TRY_COMPILE([
  4.2325 -         #include <EGL/egl.h>
  4.2326 -        ],[
  4.2327 -        ],[
  4.2328 -        video_opengl_egl=yes
  4.2329 -        ])
  4.2330 -        AC_MSG_RESULT($video_opengl_egl)
  4.2331 -        if test x$video_opengl_egl = xyes; then
  4.2332 -            AC_DEFINE(SDL_VIDEO_OPENGL, 1, [ ])
  4.2333 -            AC_DEFINE(SDL_VIDEO_OPENGL_EGL, 1, [ ])
  4.2334 -            SUMMARY_video="${SUMMARY_video} opengl_es1"
  4.2335 -        fi
  4.2336 -       
  4.2337 -        AC_MSG_CHECKING(for OpenGL ES v2 headers)
  4.2338 -        video_opengles_v2=no
  4.2339 -        AC_TRY_COMPILE([
  4.2340 -         #include <GLES2/gl2.h>
  4.2341 -         #include <GLES2/gl2ext.h>
  4.2342 -        ],[
  4.2343 -        ],[
  4.2344 -        video_opengles_v2=yes
  4.2345 -        ])
  4.2346 -        AC_MSG_RESULT($video_opengles_v2)
  4.2347 -        if test x$video_opengles_v2 = xyes; then
  4.2348 -            AC_DEFINE(SDL_VIDEO_OPENGL, 1, [ ])
  4.2349 -            AC_DEFINE(SDL_VIDEO_OPENGL_ES2, 1, [ ])
  4.2350 -            AC_DEFINE(SDL_VIDEO_RENDER_OGL_ES2, 1, [ ])
  4.2351 -            SUMMARY_video="${SUMMARY_video} opengl_es2"
  4.2352 -        fi
  4.2353 -    fi
  4.2354 -}
  4.2355 -
  4.2356 -dnl Check for Haiku OpenGL
  4.2357 -CheckHaikuGL()
  4.2358 -{
  4.2359 -    if test x$enable_video = xyes -a x$enable_video_opengl = xyes; then
  4.2360 -        AC_DEFINE(SDL_VIDEO_OPENGL, 1, [ ])
  4.2361 -        AC_DEFINE(SDL_VIDEO_OPENGL_HAIKU, 1, [ ])
  4.2362 -        AC_DEFINE(SDL_VIDEO_RENDER_OGL, 1, [ ])
  4.2363 -        EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lGL"
  4.2364 -        SUMMARY_video="${SUMMARY_video} opengl"
  4.2365 -    fi
  4.2366 -}
  4.2367 -
  4.2368 -dnl Check for MacOS OpenGL
  4.2369 -CheckMacGL()
  4.2370 -{
  4.2371 -    if test x$enable_video = xyes -a x$enable_video_opengl = xyes; then
  4.2372 -        AC_DEFINE(SDL_VIDEO_OPENGL, 1, [ ])
  4.2373 -        AC_DEFINE(SDL_VIDEO_OPENGL_CGL, 1, [ ])
  4.2374 -        AC_DEFINE(SDL_VIDEO_RENDER_OGL, 1, [ ])
  4.2375 -        SUMMARY_video="${SUMMARY_video} opengl"
  4.2376 -    fi
  4.2377 -}
  4.2378 -
  4.2379 -dnl Check for MacOS OpenGLES
  4.2380 -CheckMacGLES()
  4.2381 -{
  4.2382 -    if test x$enable_video = xyes -a x$enable_video_opengles = xyes; then
  4.2383 -        video_opengl_egl=yes
  4.2384 -        AC_DEFINE(SDL_VIDEO_OPENGL_EGL, 1, [ ])
  4.2385 -        video_opengles_v2=yes
  4.2386 -        AC_DEFINE(SDL_VIDEO_OPENGL_ES2, 1, [ ])
  4.2387 -        AC_DEFINE(SDL_VIDEO_RENDER_OGL_ES2, 1, [ ])
  4.2388 -        SUMMARY_video="${SUMMARY_video} opengl_es2"
  4.2389 -    fi
  4.2390 -}
  4.2391 -
  4.2392 -CheckEmscriptenGLES()
  4.2393 -{
  4.2394 -    if test x$enable_video = xyes -a x$enable_video_opengles = xyes; then
  4.2395 -        AC_MSG_CHECKING(for EGL support)
  4.2396 -        video_opengl_egl=no
  4.2397 -        AC_TRY_COMPILE([
  4.2398 -         #include <EGL/egl.h>
  4.2399 -        ],[
  4.2400 -        ],[
  4.2401 -        video_opengl_egl=yes
  4.2402 -        ])
  4.2403 -        AC_MSG_RESULT($video_opengl_egl)
  4.2404 -        if test x$video_opengl_egl = xyes; then
  4.2405 -            AC_DEFINE(SDL_VIDEO_OPENGL_EGL, 1, [ ])
  4.2406 -        fi
  4.2407 -
  4.2408 -        AC_MSG_CHECKING(for OpenGL ES v2 headers)
  4.2409 -        video_opengles_v2=no
  4.2410 -        AC_TRY_COMPILE([
  4.2411 -         #include <GLES2/gl2.h>
  4.2412 -         #include <GLES2/gl2ext.h>
  4.2413 -        ],[
  4.2414 -        ],[
  4.2415 -        video_opengles_v2=yes
  4.2416 -        ])
  4.2417 -        AC_MSG_RESULT($video_opengles_v2)
  4.2418 -        if test x$video_opengles_v2 = xyes; then
  4.2419 -            AC_DEFINE(SDL_VIDEO_OPENGL_ES2, 1, [ ])
  4.2420 -            AC_DEFINE(SDL_VIDEO_RENDER_OGL_ES2, 1, [ ])
  4.2421 -            SUMMARY_video="${SUMMARY_video} opengl_es2"
  4.2422 -        fi
  4.2423 -    fi
  4.2424 -}
  4.2425 -
  4.2426 -dnl Check to see if Vulkan support is desired
  4.2427 -AC_ARG_ENABLE(video-vulkan,
  4.2428 -AS_HELP_STRING([--enable-video-vulkan], [include Vulkan support [[default=yes]]]),
  4.2429 -              , enable_video_vulkan=yes)
  4.2430 -
  4.2431 -dnl Find Vulkan Header
  4.2432 -CheckVulkan()
  4.2433 -{
  4.2434 -    if test x$enable_video = xyes -a x$enable_video_vulkan = xyes; then
  4.2435 -        case "$host" in
  4.2436 -            *-*-android*)
  4.2437 -                AC_TRY_COMPILE([
  4.2438 -                  #if defined(__ARM_ARCH) && __ARM_ARCH < 7
  4.2439 -                  #error Vulkan doesn't work on this configuration
  4.2440 -                  #endif
  4.2441 -                ],[
  4.2442 -                ],[
  4.2443 -                ],[
  4.2444 -                    enable_video_vulkan=no
  4.2445 -                ])
  4.2446 -                ;;
  4.2447 -            *-*-darwin*)
  4.2448 -                save_CFLAGS="$CFLAGS"
  4.2449 -                dnl Work around that we don't have Objective-C support in autoconf
  4.2450 -                CFLAGS="$CFLAGS -x objective-c"
  4.2451 -                AC_TRY_COMPILE([
  4.2452 -                  #include <Cocoa/Cocoa.h>
  4.2453 -                  #include <Metal/Metal.h>
  4.2454 -                  #include <QuartzCore/CAMetalLayer.h>
  4.2455 -
  4.2456 -                  #if !TARGET_CPU_X86_64
  4.2457 -                  #error Vulkan doesn't work on this configuration
  4.2458 -                  #endif
  4.2459 -                ],[
  4.2460 -                ],[
  4.2461 -                ],[
  4.2462 -                    enable_video_vulkan=no
  4.2463 -                ])
  4.2464 -                CFLAGS="$save_CFLAGS"
  4.2465 -                ;;
  4.2466 -            *)
  4.2467 -                ;;
  4.2468 -        esac
  4.2469 -        if test x$enable_video_vulkan = xno; then
  4.2470 -            # For reasons I am totally unable to see, I get an undefined macro error if
  4.2471 -            # I put this in the AC_TRY_COMPILE.
  4.2472 -            AC_MSG_WARN([Vulkan does not work on this configuration.])
  4.2473 -        fi
  4.2474 -    fi
  4.2475 -    if test x$enable_video_vulkan = xyes; then
  4.2476 -        AC_DEFINE(SDL_VIDEO_VULKAN, 1, [ ])
  4.2477 -        SUMMARY_video="${SUMMARY_video} vulkan"
  4.2478 -    fi
  4.2479 -}
  4.2480 -
  4.2481 -dnl See if we can use the new unified event interface in Linux 2.4
  4.2482 -CheckInputEvents()
  4.2483 -{
  4.2484 -    dnl Check for Linux 2.4 unified input event interface support
  4.2485 -        AC_MSG_CHECKING(for Linux 2.4 unified input interface)
  4.2486 -        use_input_events=no
  4.2487 -        AC_TRY_COMPILE([
  4.2488 -          #include <linux/input.h>
  4.2489 -        ],[
  4.2490 -          #ifndef EVIOCGNAME
  4.2491 -          #error EVIOCGNAME() ioctl not available
  4.2492 -          #endif
  4.2493 -        ],[
  4.2494 -        use_input_events=yes
  4.2495 -        ])
  4.2496 -        AC_MSG_RESULT($use_input_events)
  4.2497 -        if test x$use_input_events = xyes; then
  4.2498 -            AC_DEFINE(SDL_INPUT_LINUXEV, 1, [ ])
  4.2499 -            SUMMARY_input="${SUMMARY_input} linuxev"
  4.2500 -        fi
  4.2501 -}
  4.2502 -
  4.2503 -dnl See if we can use the kernel kd.h header
  4.2504 -CheckInputKD()
  4.2505 -{
  4.2506 -
  4.2507 -    AC_MSG_CHECKING(for Linux kd.h)
  4.2508 -    use_input_kd=no
  4.2509 -    AC_TRY_COMPILE([
  4.2510 -      #include <linux/kd.h>
  4.2511 -      #include <linux/keyboard.h>
  4.2512 -    ],[
  4.2513 -        struct kbentry kbe;
  4.2514 -        kbe.kb_table = KG_CTRL;
  4.2515 -        ioctl(0, KDGKBENT, &kbe);
  4.2516 -    ],[
  4.2517 -    use_input_kd=yes
  4.2518 -    ])
  4.2519 -    AC_MSG_RESULT($use_input_kd)
  4.2520 -    if test x$use_input_kd = xyes; then
  4.2521 -        AC_DEFINE(SDL_INPUT_LINUXKD, 1, [ ])
  4.2522 -        SUMMARY_input="${SUMMARY_input} linuxkd"
  4.2523 -    fi
  4.2524 -}
  4.2525 -
  4.2526 -dnl See if the platform offers libudev for device enumeration and hotplugging.
  4.2527 -CheckLibUDev()
  4.2528 -{
  4.2529 -    AC_ARG_ENABLE(libudev,
  4.2530 -AS_HELP_STRING([--enable-libudev], [enable libudev support [[default=yes]]]),
  4.2531 -                        , enable_libudev=yes)
  4.2532 -    if test x$enable_libudev = xyes; then
  4.2533 -        AC_CHECK_HEADER(libudev.h,
  4.2534 -                        have_libudev_h_hdr=yes,
  4.2535 -                        have_libudev_h_hdr=no)
  4.2536 -        if test x$have_libudev_h_hdr = xyes; then
  4.2537 -            AC_DEFINE(HAVE_LIBUDEV_H, 1, [ ])
  4.2538 -
  4.2539 -            udev_lib=[`find_lib "libudev.so.*" "" | sed 's/.*\/\(.*\)/\1/; q'`]
  4.2540 -            if test x$udev_lib != x; then
  4.2541 -                echo "-- dynamic udev -> $udev_lib"
  4.2542 -                AC_DEFINE_UNQUOTED(SDL_UDEV_DYNAMIC, "$udev_lib", [ ])
  4.2543 -            fi
  4.2544 -        fi
  4.2545 -    fi
  4.2546 -}
  4.2547 -
  4.2548 -dnl See if the platform offers libdbus for various IPC techniques.
  4.2549 -CheckDBus()
  4.2550 -{
  4.2551 -    AC_ARG_ENABLE(dbus,
  4.2552 -AS_HELP_STRING([--enable-dbus], [enable D-Bus support [[default=yes]]]),
  4.2553 -                        , enable_dbus=yes)
  4.2554 -    if test x$enable_dbus = xyes; then
  4.2555 -        PKG_CHECK_MODULES([DBUS], [dbus-1], have_dbus=yes, have_dbus=no)
  4.2556 -        save_CFLAGS="$CFLAGS"
  4.2557 -        CFLAGS="$save_CFLAGS $DBUS_CFLAGS"
  4.2558 -        AC_CHECK_HEADER(dbus/dbus.h,
  4.2559 -                        have_dbus_dbus_h_hdr=yes,
  4.2560 -                        have_dbus_dbus_h_hdr=no)
  4.2561 -        CFLAGS="$save_CFLAGS"
  4.2562 -        if test x$have_dbus_dbus_h_hdr = xyes; then
  4.2563 -            AC_DEFINE(HAVE_DBUS_DBUS_H, 1, [ ])
  4.2564 -            EXTRA_CFLAGS="$EXTRA_CFLAGS $DBUS_CFLAGS"
  4.2565 -            SOURCES="$SOURCES $srcdir/src/core/linux/SDL_dbus.c"
  4.2566 -        fi
  4.2567 -    fi
  4.2568 -}
  4.2569 -
  4.2570 -dnl See if the platform wanna IME support.
  4.2571 -CheckIME()
  4.2572 -{
  4.2573 -    AC_ARG_ENABLE(ime,
  4.2574 -AS_HELP_STRING([--enable-ime], [enable IME support [[default=yes]]]),
  4.2575 -                  , enable_ime=yes)
  4.2576 -    if test x$enable_ime = xyes; then
  4.2577 -        AC_DEFINE(SDL_USE_IME, 1, [ ])
  4.2578 -            SOURCES="$SOURCES $srcdir/src/core/linux/SDL_ime.c"
  4.2579 -    fi
  4.2580 -}
  4.2581 -
  4.2582 -dnl See if the platform has libibus IME support.
  4.2583 -CheckIBus()
  4.2584 -{
  4.2585 -    AC_ARG_ENABLE(ibus,
  4.2586 -AS_HELP_STRING([--enable-ibus], [enable IBus support [[default=yes]]]),
  4.2587 -                  , enable_ibus=yes)
  4.2588 -    if test x$enable_ibus = xyes; then
  4.2589 -        PKG_CHECK_MODULES([IBUS], [ibus-1.0], have_ibus=yes, have_ibus=no)
  4.2590 -        save_CFLAGS="$CFLAGS"
  4.2591 -        CFLAGS="$save_CFLAGS $IBUS_CFLAGS"
  4.2592 -        AC_CHECK_HEADER(ibus-1.0/ibus.h,
  4.2593 -                        have_ibus_ibus_h_hdr=yes,
  4.2594 -                        have_ibus_ibus_h_hdr=no)
  4.2595 -        AC_CHECK_HEADER(sys/inotify.h,
  4.2596 -                        have_inotify_inotify_h_hdr=yes,
  4.2597 -                        have_inotify_inotify_h_hdr=no)
  4.2598 -        CFLAGS="$save_CFLAGS"
  4.2599 -        if test x$have_ibus_ibus_h_hdr = xyes; then
  4.2600 -            if test x$enable_ime != xyes; then
  4.2601 -                AC_MSG_WARN([IME support is required for IBus.])
  4.2602 -                have_ibus_ibus_h_hdr=no
  4.2603 -            elif test x$enable_dbus != xyes; then
  4.2604 -                AC_MSG_WARN([DBus support is required for IBus.])
  4.2605 -                have_ibus_ibus_h_hdr=no
  4.2606 -            elif test x$have_inotify_inotify_h_hdr != xyes; then
  4.2607 -                AC_MSG_WARN([INotify support is required for IBus.])
  4.2608 -                have_ibus_ibus_h_hdr=no
  4.2609 -            else
  4.2610 -                AC_DEFINE(HAVE_IBUS_IBUS_H, 1, [ ])
  4.2611 -                EXTRA_CFLAGS="$EXTRA_CFLAGS $IBUS_CFLAGS"
  4.2612 -                SOURCES="$SOURCES $srcdir/src/core/linux/SDL_ibus.c"
  4.2613 -            fi
  4.2614 -        fi
  4.2615 -    fi
  4.2616 -}
  4.2617 -
  4.2618 -dnl See if the platform has fcitx IME support.
  4.2619 -CheckFcitx()
  4.2620 -{
  4.2621 -    AC_ARG_ENABLE(fcitx,
  4.2622 -AS_HELP_STRING([--enable-fcitx], [enable fcitx support [[default=yes]]]),
  4.2623 -                  , enable_fcitx=yes)
  4.2624 -    if test x$enable_fcitx = xyes; then
  4.2625 -        PKG_CHECK_MODULES([FCITX], [fcitx], have_fcitx=yes, have_fcitx=no)
  4.2626 -        CFLAGS="$CFLAGS $FCITX_CFLAGS"
  4.2627 -        AC_CHECK_HEADER(fcitx/frontend.h,
  4.2628 -                        have_fcitx_frontend_h_hdr=yes,
  4.2629 -                        have_fcitx_frontend_h_hdr=no)
  4.2630 -        CFLAGS="$save_CFLAGS"
  4.2631 -        if test x$have_fcitx_frontend_h_hdr = xyes; then
  4.2632 -            if test x$enable_ime != xyes; then
  4.2633 -                AC_MSG_WARN([IME support is required for fcitx.])
  4.2634 -                have_fcitx_frontend_h_hdr=no
  4.2635 -            elif test x$enable_dbus != xyes; then
  4.2636 -                AC_MSG_WARN([DBus support is required for fcitx.])
  4.2637 -                have_fcitx_frontend_h_hdr=no
  4.2638 -            else
  4.2639 -                AC_DEFINE(HAVE_FCITX_FRONTEND_H, 1, [ ])
  4.2640 -                EXTRA_CFLAGS="$EXTRA_CFLAGS $FCITX_CFLAGS"
  4.2641 -                SOURCES="$SOURCES $srcdir/src/core/linux/SDL_fcitx.c"
  4.2642 -            fi
  4.2643 -        fi
  4.2644 -    fi
  4.2645 -}
  4.2646 -
  4.2647 -dnl See if we can use the Touchscreen input library
  4.2648 -CheckTslib()
  4.2649 -{
  4.2650 -    AC_ARG_ENABLE(input-tslib,
  4.2651 -AS_HELP_STRING([--enable-input-tslib], [use the Touchscreen library for input [[default=yes]]]),
  4.2652 -                  , enable_input_tslib=yes)
  4.2653 -    if test x$enable_input_tslib = xyes; then
  4.2654 -        AC_MSG_CHECKING(for Touchscreen library support)
  4.2655 -        enable_input_tslib=no
  4.2656 -        AC_TRY_COMPILE([
  4.2657 -          #include "tslib.h"
  4.2658 -        ],[
  4.2659 -        ],[
  4.2660 -        enable_input_tslib=yes
  4.2661 -        ])
  4.2662 -        AC_MSG_RESULT($enable_input_tslib)
  4.2663 -        if test x$enable_input_tslib = xyes; then
  4.2664 -            AC_DEFINE(SDL_INPUT_TSLIB, 1, [ ])
  4.2665 -            EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lts"
  4.2666 -            SUMMARY_input="${SUMMARY_input} ts"
  4.2667 -        fi
  4.2668 -    fi
  4.2669 -}
  4.2670 -
  4.2671 -dnl See what type of thread model to use on Linux and Solaris
  4.2672 -CheckPTHREAD()
  4.2673 -{
  4.2674 -    dnl Check for pthread support
  4.2675 -    AC_ARG_ENABLE(pthreads,
  4.2676 -AS_HELP_STRING([--enable-pthreads], [use POSIX threads for multi-threading [[default=yes]]]),
  4.2677 -                  , enable_pthreads=yes)
  4.2678 -    dnl This is used on Linux for glibc binary compatibility (Doh!)
  4.2679 -    AC_ARG_ENABLE(pthread-sem,
  4.2680 -AS_HELP_STRING([--enable-pthread-sem], [use pthread semaphores [[default=yes]]]),
  4.2681 -                  , enable_pthread_sem=yes)
  4.2682 -    case "$host" in
  4.2683 -         *-*-android*)
  4.2684 -            pthread_cflags="-D_REENTRANT -D_THREAD_SAFE"
  4.2685 -            pthread_lib=""
  4.2686 -            ;;
  4.2687 -        *-*-linux*|*-*-uclinux*)
  4.2688 -            pthread_cflags="-D_REENTRANT"
  4.2689 -            pthread_lib="-lpthread"
  4.2690 -            ;;
  4.2691 -        *-*-bsdi*)
  4.2692 -            pthread_cflags="-D_REENTRANT -D_THREAD_SAFE"
  4.2693 -            pthread_lib=""
  4.2694 -            ;;
  4.2695 -        *-*-darwin*)
  4.2696 -            pthread_cflags="-D_THREAD_SAFE"
  4.2697 -# causes Carbon.p complaints?
  4.2698 -#            pthread_cflags="-D_REENTRANT -D_THREAD_SAFE"
  4.2699 -            ;;
  4.2700 -        *-*-freebsd*|*-*-dragonfly*)
  4.2701 -            pthread_cflags="-D_REENTRANT -D_THREAD_SAFE"
  4.2702 -            pthread_lib="-pthread"
  4.2703 -            ;;
  4.2704 -        *-*-netbsd*)
  4.2705 -            pthread_cflags="-D_REENTRANT -D_THREAD_SAFE"
  4.2706 -            pthread_lib="-lpthread"
  4.2707 -            ;;
  4.2708 -        *-*-openbsd*)
  4.2709 -            pthread_cflags="-D_REENTRANT"
  4.2710 -            pthread_lib="-pthread"
  4.2711 -            ;;
  4.2712 -        *-*-solaris2.9)
  4.2713 -            # From Solaris 9+, posix4's preferred name is rt.
  4.2714 -            pthread_cflags="-D_REENTRANT"
  4.2715 -            pthread_lib="-lpthread -lrt"
  4.2716 -            ;;
  4.2717 -        *-*-solaris2.10)
  4.2718 -            # Solaris 10+ merged pthread into libc.
  4.2719 -            pthread_cflags="-D_REENTRANT"
  4.2720 -            pthread_lib="-lrt"
  4.2721 -            ;;
  4.2722 -        *-*-solaris*)
  4.2723 -            # Solaris 11+ merged rt into libc.
  4.2724 -            pthread_cflags="-D_REENTRANT"
  4.2725 -            pthread_lib=""
  4.2726 -            ;;
  4.2727 -        *-*-sysv5*)
  4.2728 -            pthread_cflags="-D_REENTRANT -Kthread"
  4.2729 -            pthread_lib=""
  4.2730 -            ;;
  4.2731 -        *-*-aix*)
  4.2732 -            pthread_cflags="-D_REENTRANT -mthreads"
  4.2733 -            pthread_lib="-lpthread"
  4.2734 -            ;;
  4.2735 -        *-*-hpux11*)
  4.2736 -            pthread_cflags="-D_REENTRANT"
  4.2737 -            pthread_lib="-L/usr/lib -lpthread"
  4.2738 -            ;;
  4.2739 -        *-*-haiku*)
  4.2740 -            pthread_cflags="-D_REENTRANT"
  4.2741 -            pthread_lib=""
  4.2742 -            ;;
  4.2743 -        *-*-nto*)
  4.2744 -            pthread_cflags="-D_REENTRANT"
  4.2745 -            pthread_lib=""
  4.2746 -            ;;
  4.2747 -        *)
  4.2748 -            pthread_cflags="-D_REENTRANT"
  4.2749 -            pthread_lib="-lpthread"
  4.2750 -            ;;
  4.2751 -    esac
  4.2752 -    if test x$enable_threads = xyes -a x$enable_pthreads = xyes; then
  4.2753 -        # Save the original compiler flags and libraries
  4.2754 -        ac_save_cflags="$CFLAGS"; ac_save_libs="$LIBS"
  4.2755 -        # Add the pthread compiler flags and libraries
  4.2756 -        CFLAGS="$CFLAGS $pthread_cflags"; LIBS="$LIBS $pthread_lib"
  4.2757 -        # Check to see if we have pthread support on this system
  4.2758 -        AC_MSG_CHECKING(for pthreads)
  4.2759 -        use_pthreads=no
  4.2760 -        AC_TRY_LINK([
  4.2761 -         #include <pthread.h>
  4.2762 -        ],[
  4.2763 -         pthread_attr_t type;
  4.2764 -         pthread_attr_init(&type);
  4.2765 -        ],[
  4.2766 -        use_pthreads=yes
  4.2767 -        ])
  4.2768 -        AC_MSG_RESULT($use_pthreads)
  4.2769 -        # Restore the compiler flags and libraries
  4.2770 -        CFLAGS="$ac_save_cflags"; LIBS="$ac_save_libs"
  4.2771 -
  4.2772 -        # Do futher testing if we have pthread support...
  4.2773 -        if test x$use_pthreads = xyes; then
  4.2774 -            AC_DEFINE(SDL_THREAD_PTHREAD, 1, [ ])
  4.2775 -            EXTRA_CFLAGS="$EXTRA_CFLAGS $pthread_cflags"
  4.2776 -            EXTRA_LDFLAGS="$EXTRA_LDFLAGS $pthread_lib"
  4.2777 -            SDL_CFLAGS="$SDL_CFLAGS $pthread_cflags"
  4.2778 -
  4.2779 -            # Save the original compiler flags and libraries
  4.2780 -            ac_save_cflags="$CFLAGS"; ac_save_libs="$LIBS"
  4.2781 -            # Add the pthread compiler flags and libraries
  4.2782 -            CFLAGS="$CFLAGS $pthread_cflags"; LIBS="$LIBS $pthread_lib"
  4.2783 -
  4.2784 -            # Check to see if recursive mutexes are available
  4.2785 -            AC_MSG_CHECKING(for recursive mutexes)
  4.2786 -            has_recursive_mutexes=no
  4.2787 -            if test x$has_recursive_mutexes = xno; then
  4.2788 -                AC_TRY_LINK([
  4.2789 -                  #define _GNU_SOURCE 1
  4.2790 -                  #include <pthread.h>
  4.2791 -                ],[
  4.2792 -                  pthread_mutexattr_t attr;
  4.2793 -                  pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
  4.2794 -                ],[
  4.2795 -                has_recursive_mutexes=yes
  4.2796 -                AC_DEFINE(SDL_THREAD_PTHREAD_RECURSIVE_MUTEX, 1, [ ])
  4.2797 -                ])
  4.2798 -            fi
  4.2799 -            if test x$has_recursive_mutexes = xno; then
  4.2800 -                AC_TRY_LINK([
  4.2801 -                  #define _GNU_SOURCE 1
  4.2802 -                  #include <pthread.h>
  4.2803 -                ],[
  4.2804 -                  pthread_mutexattr_t attr;
  4.2805 -                  pthread_mutexattr_setkind_np(&attr, PTHREAD_MUTEX_RECURSIVE_NP);
  4.2806 -                ],[
  4.2807 -                has_recursive_mutexes=yes
  4.2808 -                AC_DEFINE(SDL_THREAD_PTHREAD_RECURSIVE_MUTEX_NP, 1, [ ])
  4.2809 -                ])
  4.2810 -            fi
  4.2811 -            AC_MSG_RESULT($has_recursive_mutexes)
  4.2812 -
  4.2813 -            # Check to see if pthread semaphore support is missing
  4.2814 -            if test x$enable_pthread_sem = xyes; then
  4.2815 -                AC_MSG_CHECKING(for pthread semaphores)
  4.2816 -                have_pthread_sem=no
  4.2817 -                AC_TRY_COMPILE([
  4.2818 -                  #include <pthread.h>
  4.2819 -                  #include <semaphore.h>
  4.2820 -                ],[
  4.2821 -                ],[
  4.2822 -                have_pthread_sem=yes
  4.2823 -                ])
  4.2824 -                AC_MSG_RESULT($have_pthread_sem)
  4.2825 -            fi
  4.2826 -            if test x$have_pthread_sem = xyes; then
  4.2827 -                AC_MSG_CHECKING(for sem_timedwait)
  4.2828 -                have_sem_timedwait=no
  4.2829 -                AC_TRY_LINK([
  4.2830 -                  #include <pthread.h>
  4.2831 -                  #include <semaphore.h>
  4.2832 -                ],[
  4.2833 -                  sem_timedwait(NULL, NULL);
  4.2834 -                ],[
  4.2835 -                have_sem_timedwait=yes
  4.2836 -                AC_DEFINE([HAVE_SEM_TIMEDWAIT], 1, [ ])
  4.2837 -                ])
  4.2838 -                AC_MSG_RESULT($have_sem_timedwait)
  4.2839 -            fi
  4.2840 -
  4.2841 -            AC_CHECK_HEADER(pthread_np.h, have_pthread_np_h=yes, have_pthread_np_h=no, [ #include <pthread.h> ])
  4.2842 -            if test x$have_pthread_np_h = xyes; then
  4.2843 -                AC_DEFINE(HAVE_PTHREAD_NP_H, 1, [ ])
  4.2844 -            fi
  4.2845 -
  4.2846 -            # Check to see if pthread naming is available
  4.2847 -            AC_MSG_CHECKING(for pthread_setname_np)
  4.2848 -            AC_TRY_LINK_FUNC(pthread_setname_np, [
  4.2849 -              has_pthread_setname_np=yes
  4.2850 -              AC_DEFINE(HAVE_PTHREAD_SETNAME_NP, 1, [ ])
  4.2851 -            ],[
  4.2852 -              has_pthread_setname_np=no
  4.2853 -            ])
  4.2854 -            AC_MSG_RESULT($has_pthread_setname_np)
  4.2855 -
  4.2856 -            AC_MSG_CHECKING(for pthread_set_name_np)
  4.2857 -            AC_TRY_LINK_FUNC(pthread_set_name_np, [
  4.2858 -              has_pthread_set_name_np=yes
  4.2859 -              AC_DEFINE(HAVE_PTHREAD_SET_NAME_NP, 1, [ ])
  4.2860 -            ],[
  4.2861 -              has_pthread_set_name_np=no
  4.2862 -            ])
  4.2863 -            AC_MSG_RESULT($has_pthread_set_name_np)
  4.2864 -
  4.2865 -            # Restore the compiler flags and libraries
  4.2866 -            CFLAGS="$ac_save_cflags"; LIBS="$ac_save_libs"
  4.2867 -
  4.2868 -            # Basic thread creation functions
  4.2869 -            SOURCES="$SOURCES $srcdir/src/thread/pthread/SDL_systhread.c"
  4.2870 -
  4.2871 -            # Semaphores
  4.2872 -            # We can fake these with mutexes and condition variables if necessary
  4.2873 -            if test x$have_pthread_sem = xyes; then
  4.2874 -                SOURCES="$SOURCES $srcdir/src/thread/pthread/SDL_syssem.c"
  4.2875 -            else
  4.2876 -                SOURCES="$SOURCES $srcdir/src/thread/generic/SDL_syssem.c"
  4.2877 -            fi
  4.2878 -
  4.2879 -            # Mutexes
  4.2880 -            # We can fake these with semaphores if necessary
  4.2881 -            SOURCES="$SOURCES $srcdir/src/thread/pthread/SDL_sysmutex.c"
  4.2882 -
  4.2883 -            # Condition variables
  4.2884 -            # We can fake these with semaphores and mutexes if necessary
  4.2885 -            SOURCES="$SOURCES $srcdir/src/thread/pthread/SDL_syscond.c"
  4.2886 -
  4.2887 -            # Thread local storage
  4.2888 -            SOURCES="$SOURCES $srcdir/src/thread/pthread/SDL_systls.c"
  4.2889 -
  4.2890 -            have_threads=yes
  4.2891 -        fi
  4.2892 -    fi
  4.2893 -}
  4.2894 -
  4.2895 -dnl Determine whether the compiler can produce Windows executables
  4.2896 -CheckWINDOWS()
  4.2897 -{
  4.2898 -    AC_MSG_CHECKING(Windows compiler)
  4.2899 -    have_win32_gcc=no
  4.2900 -    AC_TRY_COMPILE([
  4.2901 -     #include <windows.h>
  4.2902 -    ],[
  4.2903 -    ],[
  4.2904 -    have_win32_gcc=yes
  4.2905 -    ])
  4.2906 -    AC_MSG_RESULT($have_win32_gcc)
  4.2907 -    if test x$have_win32_gcc != xyes; then
  4.2908 -       AC_MSG_ERROR([
  4.2909 -*** Your compiler ($CC) does not produce Windows executables!
  4.2910 -       ])
  4.2911 -    fi
  4.2912 -
  4.2913 -    AC_MSG_CHECKING(Windows CE)
  4.2914 -    have_wince=no
  4.2915 -    AC_TRY_COMPILE([
  4.2916 -#if !defined(_WIN32_WCE) && !defined(__MINGW32CE__)
  4.2917 -#error This is not Windows CE
  4.2918 -#endif
  4.2919 -    ],[
  4.2920 -    ],[
  4.2921 -    have_wince=yes
  4.2922 -       AC_MSG_ERROR([
  4.2923 -*** Sorry, Windows CE is no longer supported.
  4.2924 -       ])
  4.2925 -    ])
  4.2926 -    AC_MSG_RESULT($have_wince)
  4.2927 -
  4.2928 -    # This fixes Windows stack alignment with newer GCC
  4.2929 -    CheckStackBoundary
  4.2930 -}
  4.2931 -
  4.2932 -dnl Find the DirectX includes and libraries
  4.2933 -CheckDIRECTX()
  4.2934 -{
  4.2935 -    AC_ARG_ENABLE(directx,
  4.2936 -AS_HELP_STRING([--enable-directx], [use DirectX for Windows audio/video [[default=yes]]]),
  4.2937 -                  , enable_directx=yes)
  4.2938 -    if test x$enable_directx = xyes; then
  4.2939 -        AC_CHECK_HEADER(d3d9.h, have_d3d=yes)
  4.2940 -        AC_CHECK_HEADER(d3d11_1.h, have_d3d11=yes)
  4.2941 -        AC_CHECK_HEADER(ddraw.h, have_ddraw=yes)
  4.2942 -        AC_CHECK_HEADER(dsound.h, have_dsound=yes)
  4.2943 -        AC_CHECK_HEADER(dinput.h, have_dinput=yes)
  4.2944 -        AC_CHECK_HEADER(dxgi.h, have_dxgi=yes)
  4.2945 -        AC_CHECK_HEADER(xinput.h, have_xinput=yes)
  4.2946 -        AC_TRY_COMPILE([
  4.2947 -#include <windows.h>
  4.2948 -#include <xinput.h>
  4.2949 -XINPUT_GAMEPAD_EX x1;
  4.2950 -        ],[],[have_xinput_gamepadex=yes])
  4.2951 -        AC_TRY_COMPILE([
  4.2952 -#include <windows.h>
  4.2953 -#include <xinput.h>
  4.2954 -XINPUT_STATE_EX s1;
  4.2955 -        ],[],[have_xinput_stateex=yes])
  4.2956 -
  4.2957 -        if test x$have_ddraw = xyes; then
  4.2958 -            AC_DEFINE(HAVE_DDRAW_H, 1, [ ])
  4.2959 -        fi
  4.2960 -        if test x$have_dinput = xyes; then
  4.2961 -            AC_DEFINE(HAVE_DINPUT_H, 1, [ ])
  4.2962 -        fi
  4.2963 -        if test x$have_dsound = xyes; then
  4.2964 -            AC_DEFINE(HAVE_DSOUND_H, 1, [ ])
  4.2965 -        fi
  4.2966 -        if test x$have_dxgi = xyes; then
  4.2967 -            AC_DEFINE(HAVE_DXGI_H, 1, [ ])
  4.2968 -        fi
  4.2969 -        if test x$have_xinput = xyes; then
  4.2970 -            AC_DEFINE(HAVE_XINPUT_H, 1, [ ])
  4.2971 -        fi
  4.2972 -        if test x$have_xinput_gamepadex = xyes; then
  4.2973 -            AC_DEFINE(HAVE_XINPUT_GAMEPAD_EX, 1, [ ])
  4.2974 -        fi
  4.2975 -        if test x$have_xinput_stateex = xyes; then
  4.2976 -            AC_DEFINE(HAVE_XINPUT_STATE_EX, 1, [ ])
  4.2977 -        fi
  4.2978 -
  4.2979 -        SUMMARY_video="${SUMMARY_video} directx"
  4.2980 -        SUMMARY_audio="${SUMMARY_audio} directx"
  4.2981 -
  4.2982 -        # FIXME: latest Cygwin finds dinput headers, but we die on other win32 headers.
  4.2983 -        # FIXME:  ...so force it off for now.
  4.2984 -        case "$host" in
  4.2985 -            *-*-cygwin*)
  4.2986 -            have_dinput=false
  4.2987 -            ;;
  4.2988 -        esac
  4.2989 -    fi
  4.2990 -
  4.2991 -    AC_CHECK_HEADER(mmdeviceapi.h, have_wasapi=yes)
  4.2992 -    if test x$have_wasapi = xyes; then
  4.2993 -        AC_DEFINE(HAVE_MMDEVICEAPI_H,1,[])
  4.2994 -    fi
  4.2995 -    AC_CHECK_HEADER(audioclient.h,,have_wasapi=no)
  4.2996 -    if test x$have_wasapi = xyes; then
  4.2997 -        AC_DEFINE(HAVE_AUDIOCLIENT_H,1,[])
  4.2998 -    fi
  4.2999 -
  4.3000 -    AC_CHECK_HEADER(endpointvolume.h,AC_DEFINE(HAVE_ENDPOINTVOLUME_H,1,[]))
  4.3001 -
  4.3002 -    AC_ARG_ENABLE(wasapi,
  4.3003 -AS_HELP_STRING([--enable-wasapi], [use the Windows WASAPI audio driver [[default=yes]]]),
  4.3004 -                                , enable_wasapi=yes)
  4.3005 -}
  4.3006 -
  4.3007 -dnl Check for the dlfcn.h interface for dynamically loading objects
  4.3008 -CheckDLOPEN()
  4.3009 -{
  4.3010 -    AC_ARG_ENABLE(sdl-dlopen,
  4.3011 -AS_HELP_STRING([--enable-sdl-dlopen], [use dlopen for shared object loading [[default=yes]]]),
  4.3012 -                  , enable_sdl_dlopen=yes)
  4.3013 -    if test x$enable_sdl_dlopen = xyes; then
  4.3014 -        AC_MSG_CHECKING(for dlopen)
  4.3015 -        have_dlopen=no
  4.3016 -        AC_TRY_COMPILE([
  4.3017 -         #include <dlfcn.h>
  4.3018 -        ],[
  4.3019 -         void *handle = dlopen("", RTLD_NOW);
  4.3020 -         const char *loaderror = (char *) dlerror();
  4.3021 -        ],[
  4.3022 -        have_dlopen=yes
  4.3023 -        ])
  4.3024 -        AC_MSG_RESULT($have_dlopen)
  4.3025 -
  4.3026 -        if test x$have_dlopen = xyes; then
  4.3027 -            AC_CHECK_LIB(c, dlopen, EXTRA_LDFLAGS="$EXTRA_LDFLAGS",
  4.3028 -               AC_CHECK_LIB(dl, dlopen, EXTRA_LDFLAGS="$EXTRA_LDFLAGS -ldl",
  4.3029 -                  AC_CHECK_LIB(ltdl, dlopen, EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lltdl")))
  4.3030 -            AC_DEFINE(SDL_LOADSO_DLOPEN, 1, [ ])
  4.3031 -            SOURCES="$SOURCES $srcdir/src/loadso/dlopen/*.c"
  4.3032 -            have_loadso=yes
  4.3033 -        fi
  4.3034 -    fi
  4.3035 -}
  4.3036 -
  4.3037 -dnl Check for the usbhid(3) library on *BSD
  4.3038 -CheckUSBHID()
  4.3039 -{
  4.3040 -    case "$host" in
  4.3041 -        *-*-*bsd*)
  4.3042 -            if test x$enable_joystick = xyes; then
  4.3043 -                AC_CHECK_LIB(usbhid, hid_init, have_libusbhid=yes)
  4.3044 -                if test x$have_libusbhid = xyes; then
  4.3045 -                    AC_CHECK_HEADER(usbhid.h, [USB_CFLAGS="-DHAVE_USBHID_H"])
  4.3046 -                    AC_CHECK_HEADER(libusbhid.h, [USB_CFLAGS="-DHAVE_LIBUSBHID_H"])
  4.3047 -                    USB_LIBS="$USB_LIBS -lusbhid"
  4.3048 -                else
  4.3049 -                    AC_CHECK_HEADER(usb.h, [USB_CFLAGS="-DHAVE_USB_H"])
  4.3050 -                    AC_CHECK_HEADER(libusb.h, [USB_CFLAGS="-DHAVE_LIBUSB_H"])
  4.3051 -                    AC_CHECK_LIB(usb, hid_init, [USB_LIBS="$USB_LIBS -lusb"])
  4.3052 -                fi
  4.3053 -                    
  4.3054 -                save_CFLAGS="$CFLAGS"
  4.3055 -                CFLAGS="$CFLAGS $USB_CFLAGS"
  4.3056 -
  4.3057 -                AC_MSG_CHECKING(for usbhid)
  4.3058 -                have_usbhid=no
  4.3059 -                AC_TRY_COMPILE([
  4.3060 -                  #include <sys/types.h>
  4.3061 -                  #if defined(HAVE_USB_H)
  4.3062 -                  #include <usb.h>
  4.3063 -                  #endif
  4.3064 -                  #ifdef __DragonFly__
  4.3065 -                  # include <bus/usb/usb.h>
  4.3066 -                  # include <bus/usb/usbhid.h>
  4.3067 -                  #else
  4.3068 -                  # include <dev/usb/usb.h>
  4.3069 -                  # include <dev/usb/usbhid.h>
  4.3070 -                  #endif
  4.3071 -                  #if defined(HAVE_USBHID_H)
  4.3072 -                  #include <usbhid.h>
  4.3073 -                  #elif defined(HAVE_LIBUSB_H)
  4.3074 -                  #include <libusb.h>
  4.3075 -                  #elif defined(HAVE_LIBUSBHID_H)
  4.3076 -                  #include <libusbhid.h>
  4.3077 -                  #endif
  4.3078 -                ],[
  4.3079 -                  struct report_desc *repdesc;
  4.3080 -                  struct usb_ctl_report *repbuf;
  4.3081 -                  hid_kind_t hidkind;
  4.3082 -                ],[
  4.3083 -                have_usbhid=yes
  4.3084 -                ])
  4.3085 -                AC_MSG_RESULT($have_usbhid)
  4.3086 -
  4.3087 -                if test x$have_usbhid = xyes; then
  4.3088 -                    AC_MSG_CHECKING(for ucr_data member of usb_ctl_report)
  4.3089 -                    have_usbhid_ucr_data=no
  4.3090 -                    AC_TRY_COMPILE([
  4.3091 -                      #include <sys/types.h>
  4.3092 -                      #if defined(HAVE_USB_H)
  4.3093 -                      #include <usb.h>
  4.3094 -                      #endif
  4.3095 -                      #ifdef __DragonFly__
  4.3096 -                      # include <bus/usb/usb.h>
  4.3097 -                      # include <bus/usb/usbhid.h>
  4.3098 -                      #else
  4.3099 -                      # include <dev/usb/usb.h>
  4.3100 -                      # include <dev/usb/usbhid.h>
  4.3101 -                      #endif
  4.3102 -                      #if defined(HAVE_USBHID_H)
  4.3103 -                      #include <usbhid.h>
  4.3104 -                      #elif defined(HAVE_LIBUSB_H)
  4.3105 -                      #include <libusb.h>
  4.3106 -                      #elif defined(HAVE_LIBUSBHID_H)
  4.3107 -                      #include <libusbhid.h>
  4.3108 -                      #endif
  4.3109 -                    ],[
  4.3110 -                      struct usb_ctl_report buf;
  4.3111 -                      if (buf.ucr_data) { }
  4.3112 -                    ],[
  4.3113 -                    have_usbhid_ucr_data=yes
  4.3114 -                    ])
  4.3115 -                    if test x$have_usbhid_ucr_data = xyes; then
  4.3116 -                        USB_CFLAGS="$USB_CFLAGS -DUSBHID_UCR_DATA"
  4.3117 -                    fi
  4.3118 -                    AC_MSG_RESULT($have_usbhid_ucr_data)
  4.3119 -                    
  4.3120 -                    AC_MSG_CHECKING(for new usbhid API)
  4.3121 -                    have_usbhid_new=no
  4.3122 -                    AC_TRY_COMPILE([
  4.3123 -                      #include <sys/types.h>
  4.3124 -                      #if defined(HAVE_USB_H)
  4.3125 -                      #include <usb.h>
  4.3126 -                      #endif
  4.3127 -                      #ifdef __DragonFly__
  4.3128 -                      #include <bus/usb/usb.h>
  4.3129 -                      #include <bus/usb/usbhid.h>
  4.3130 -                      #else
  4.3131 -                      #include <dev/usb/usb.h>
  4.3132 -                      #include <dev/usb/usbhid.h>
  4.3133 -                      #endif
  4.3134 -                      #if defined(HAVE_USBHID_H)
  4.3135 -                      #include <usbhid.h>
  4.3136 -                      #elif defined(HAVE_LIBUSB_H)
  4.3137 -                      #include <libusb.h>
  4.3138 -                      #elif defined(HAVE_LIBUSBHID_H)
  4.3139 -                      #include <libusbhid.h>
  4.3140 -                      #endif
  4.3141 -                    ],[
  4.3142 -                      report_desc_t d;
  4.3143 -                      hid_start_parse(d, 1, 1);
  4.3144 -                    ],[
  4.3145 -                    have_usbhid_new=yes
  4.3146 -                    ])
  4.3147 -                    if test x$have_usbhid_new = xyes; then
  4.3148 -                        USB_CFLAGS="$USB_CFLAGS -DUSBHID_NEW"
  4.3149 -                    fi
  4.3150 -                    AC_MSG_RESULT($have_usbhid_new)
  4.3151 -
  4.3152 -                    AC_MSG_CHECKING(for struct joystick in machine/joystick.h)
  4.3153 -                    have_machine_joystick=no
  4.3154 -                    AC_TRY_COMPILE([
  4.3155 -                      #include <machine/joystick.h>
  4.3156 -                    ],[
  4.3157 -                      struct joystick t;
  4.3158 -                    ],[
  4.3159 -                    have_machine_joystick=yes
  4.3160 -                    ])
  4.3161 -                    if test x$have_machine_joystick = xyes; then
  4.3162 -                        AC_DEFINE(SDL_JOYSTICK_USBHID_MACHINE_JOYSTICK_H, 1, [ ])
  4.3163 -                    fi
  4.3164 -                    AC_MSG_RESULT($have_machine_joystick)
  4.3165 -
  4.3166 -                    AC_DEFINE(SDL_JOYSTICK_USBHID, 1, [ ])
  4.3167 -                    SOURCES="$SOURCES $srcdir/src/joystick/bsd/*.c"
  4.3168 -                    EXTRA_CFLAGS="$EXTRA_CFLAGS $USB_CFLAGS"
  4.3169 -                    EXTRA_LDFLAGS="$EXTRA_LDFLAGS $USB_LIBS"
  4.3170 -                    have_joystick=yes
  4.3171 -                fi
  4.3172 -                CFLAGS="$save_CFLAGS"
  4.3173 -            fi
  4.3174 -        ;;
  4.3175 -    esac
  4.3176 -}
  4.3177 -
  4.3178 -dnl Check for HIDAPI joystick drivers
  4.3179 -CheckHIDAPI()
  4.3180 -{
  4.3181 -    # The hidraw support doesn't catch Xbox, PS4 and Nintendo controllers,
  4.3182 -    # so we'll just use libusb when it's available.
  4.3183 -    #
  4.3184 -    # Except that libusb requires root permissions to open devices, so that's not generally useful, and we'll disable this by default.
  4.3185 -    AC_ARG_ENABLE(hidapi,
  4.3186 -AS_HELP_STRING([--enable-hidapi], [use HIDAPI for low level joystick drivers [[default=no]]]),
  4.3187 -                  , enable_hidapi=no)
  4.3188 -    if test x$enable_joystick = xyes -a x$enable_hidapi = xyes; then
  4.3189 -        PKG_CHECK_MODULES([LIBUSB], [libusb-1.0], have_libusb=yes, have_libusb=no)
  4.3190 -        hidapi_support=no
  4.3191 -        save_CFLAGS="$CFLAGS"
  4.3192 -        CFLAGS="$save_CFLAGS $LIBUSB_CFLAGS"
  4.3193 -        AC_CHECK_HEADER(libusb.h, have_libusb_h=yes)
  4.3194 -        CFLAGS="$save_CFLAGS"
  4.3195 -
  4.3196 -        if test x$have_libusb_h = xyes; then
  4.3197 -            hidapi_support=yes
  4.3198 -            AC_DEFINE(SDL_JOYSTICK_HIDAPI, 1, [ ])
  4.3199 -            EXTRA_CFLAGS="$EXTRA_CFLAGS -I$srcdir/src/hidapi/hidapi"
  4.3200 -            SOURCES="$SOURCES $srcdir/src/joystick/hidapi/*.c"
  4.3201 -            SOURCES="$SOURCES $srcdir/src/hidapi/libusb/hid.c"
  4.3202 -            EXTRA_CFLAGS="$EXTRA_CFLAGS $LIBUSB_CFLAGS"
  4.3203 -            EXTRA_LDFLAGS="$EXTRA_LDFLAGS $LIBUSB_LIBS"
  4.3204 -        fi
  4.3205 -        AC_MSG_CHECKING(for hidapi support)
  4.3206 -        AC_MSG_RESULT($hidapi_support)
  4.3207 -    fi
  4.3208 -}
  4.3209 -
  4.3210 -dnl Check for clock_gettime()
  4.3211 -CheckClockGettime()
  4.3212 -{
  4.3213 -    AC_ARG_ENABLE(clock_gettime,
  4.3214 -AS_HELP_STRING([--enable-clock_gettime], [use clock_gettime() instead of gettimeofday() on UNIX [[default=yes]]]),
  4.3215 -                  , enable_clock_gettime=yes)
  4.3216 -    if test x$enable_clock_gettime = xyes; then
  4.3217 -        AC_CHECK_LIB(rt, clock_gettime, have_clock_gettime=yes)
  4.3218 -        if test x$have_clock_gettime = xyes; then
  4.3219 -            AC_DEFINE(HAVE_CLOCK_GETTIME, 1, [ ])
  4.3220 -            EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lrt"
  4.3221 -        else
  4.3222 -            AC_CHECK_LIB(c, clock_gettime, have_clock_gettime=yes)
  4.3223 -            if test x$have_clock_gettime = xyes; then
  4.3224 -               AC_DEFINE(HAVE_CLOCK_GETTIME, 1, [ ])
  4.3225 -               EXTRA_LDFLAGS="$EXTRA_LDFLAGS"
  4.3226 -            fi
  4.3227 -        fi
  4.3228 -    fi
  4.3229 -}
  4.3230 -
  4.3231 -dnl Check for a valid linux/version.h
  4.3232 -CheckLinuxVersion()
  4.3233 -{
  4.3234 -    AC_CHECK_HEADER(linux/version.h, have_linux_version_h=yes)
  4.3235 -    if test x$have_linux_version_h = xyes; then
  4.3236 -        EXTRA_CFLAGS="$EXTRA_CFLAGS -DHAVE_LINUX_VERSION_H"
  4.3237 -    fi
  4.3238 -}
  4.3239 -
  4.3240 -dnl Check if we want to use RPATH
  4.3241 -CheckRPATH()
  4.3242 -{
  4.3243 -    AC_ARG_ENABLE(rpath,
  4.3244 -AS_HELP_STRING([--enable-rpath], [use an rpath when linking SDL [[default=yes]]]),
  4.3245 -                  , enable_rpath=yes)
  4.3246 -}
  4.3247 -
  4.3248 -dnl Check if we want to use custom signals to fake iOS/Android's backgrounding
  4.3249 -dnl  events. These could be useful if you're building a custom embedded
  4.3250 -dnl  environment, etc, but most people don't need this.
  4.3251 -CheckEventSignals()
  4.3252 -{
  4.3253 -    AC_ARG_ENABLE(backgrounding-signal,
  4.3254 -AS_HELP_STRING([--enable-backgrounding-signal], [number to use for magic backgrounding signal or 'no' [[default=no]]]),
  4.3255 -                  , enable_backgrounding_signal=no)
  4.3256 -    if test x$enable_backgrounding_signal != xno; then
  4.3257 -        EXTRA_CFLAGS="$EXTRA_CFLAGS -DSDL_BACKGROUNDING_SIGNAL=$enable_backgrounding_signal"
  4.3258 -    fi
  4.3259 -
  4.3260 -    AC_ARG_ENABLE(foregrounding-signal,
  4.3261 -AS_HELP_STRING([--enable-foregrounding-signal], [number to use for magic foregrounding signal or 'no' [[default=no]]]),
  4.3262 -                  , enable_foregrounding_signal=no)
  4.3263 -    if test x$enable_foregrounding_signal != xno; then
  4.3264 -        EXTRA_CFLAGS="$EXTRA_CFLAGS -DSDL_FOREGROUNDING_SIGNAL=$enable_foregrounding_signal"
  4.3265 -    fi
  4.3266 -}
  4.3267 -
  4.3268 -
  4.3269 -
  4.3270 -dnl Do this on all platforms, before everything else (other things might want to override it).
  4.3271 -CheckWarnAll
  4.3272 -
  4.3273 -dnl Do this for every platform, but for some it doesn't mean anything, but better to catch it here anyhow.
  4.3274 -CheckEventSignals
  4.3275 -
  4.3276 -dnl Set up the configuration based on the host platform!
  4.3277 -case "$host" in
  4.3278 -    *-*-linux*|*-*-uclinux*|*-*-gnu*|*-*-k*bsd*-gnu|*-*-bsdi*|*-*-freebsd*|*-*-dragonfly*|*-*-netbsd*|*-*-openbsd*|*-*-sysv5*|*-*-solaris*|*-*-hpux*|*-*-aix*|*-*-minix*|*-*-nto*)
  4.3279 -        case "$host" in
  4.3280 -            *-*-android*)
  4.3281 -                # Android
  4.3282 -                ARCH=android
  4.3283 -                ANDROID_CFLAGS="-DGL_GLEXT_PROTOTYPES"
  4.3284 -                CFLAGS="$CFLAGS $ANDROID_CFLAGS"
  4.3285 -                SDL_CFLAGS="$SDL_CFLAGS $ANDROID_CFLAGS"
  4.3286 -                EXTRA_CFLAGS="$EXTRA_CFLAGS $ANDROID_CFLAGS"
  4.3287 -                EXTRA_LDFLAGS="$EXTRA_LDFLAGS -ldl -lGLESv1_CM -lGLESv2 -llog -landroid"
  4.3288 -                SDLMAIN_SOURCES="$srcdir/src/main/android/*.c"
  4.3289 -
  4.3290 -                if test x$enable_video = xyes; then
  4.3291 -                    SOURCES="$SOURCES $srcdir/src/core/android/*.c $srcdir/src/video/android/*.c"
  4.3292 -                    # FIXME: confdefs? Not AC_DEFINE?
  4.3293 -                    $as_echo "#define SDL_VIDEO_DRIVER_ANDROID 1" >>confdefs.h
  4.3294 -                    SUMMARY_video="${SUMMARY_video} android"
  4.3295 -                fi
  4.3296 -                ;;
  4.3297 -            *-*-linux*)         ARCH=linux ;;
  4.3298 -            *-*-uclinux*)       ARCH=linux ;;
  4.3299 -            *-*-kfreebsd*-gnu)  ARCH=kfreebsd-gnu ;;
  4.3300 -            *-*-knetbsd*-gnu)   ARCH=knetbsd-gnu ;;
  4.3301 -            *-*-kopenbsd*-gnu)  ARCH=kopenbsd-gnu ;;
  4.3302 -            *-*-gnu*)           ARCH=gnu ;; # must be last of the gnu variants
  4.3303 -            *-*-bsdi*)          ARCH=bsdi ;;
  4.3304 -            *-*-freebsd*)       ARCH=freebsd ;;
  4.3305 -            *-*-dragonfly*)     ARCH=freebsd ;;
  4.3306 -            *-*-netbsd*)        ARCH=netbsd ;;
  4.3307 -            *-*-openbsd*)       ARCH=openbsd ;;
  4.3308 -            *-*-sysv5*)         ARCH=sysv5 ;;
  4.3309 -            *-*-solaris*)       ARCH=solaris ;;
  4.3310 -            *-*-hpux*)          ARCH=hpux ;;
  4.3311 -            *-*-aix*)           ARCH=aix ;;
  4.3312 -            *-*-minix*)         ARCH=minix ;;
  4.3313 -            *-*-nto*)           ARCH=nto
  4.3314 -                CheckQNXVideo
  4.3315 -                ;;
  4.3316 -        esac
  4.3317 -        CheckVisibilityHidden
  4.3318 -        CheckDeclarationAfterStatement
  4.3319 -        CheckDummyVideo
  4.3320 -        CheckDiskAudio
  4.3321 -        CheckDummyAudio
  4.3322 -        CheckDLOPEN
  4.3323 -        CheckOSS
  4.3324 -        CheckALSA
  4.3325 -        CheckPulseAudio
  4.3326 -        CheckJACK
  4.3327 -        CheckARTSC
  4.3328 -        CheckESD
  4.3329 -        CheckNAS
  4.3330 -        CheckSNDIO
  4.3331 -        CheckFusionSound
  4.3332 -        CheckLibSampleRate
  4.3333 -        # Need to check for Raspberry PI first and add platform specific compiler flags, otherwise the test for GLES fails!
  4.3334 -        CheckRPI
  4.3335 -        CheckX11
  4.3336 -        CheckDirectFB
  4.3337 -        CheckKMSDRM
  4.3338 -        CheckOpenGLX11
  4.3339 -        CheckOpenGLESX11
  4.3340 -        CheckVulkan
  4.3341 -        CheckWayland
  4.3342 -        CheckLibUDev
  4.3343 -        CheckDBus
  4.3344 -        CheckIME
  4.3345 -        CheckIBus
  4.3346 -        CheckFcitx
  4.3347 -        case $ARCH in
  4.3348 -          linux)
  4.3349 -              CheckInputEvents
  4.3350 -              CheckInputKD
  4.3351 -          ;;
  4.3352 -        esac
  4.3353 -        CheckTslib
  4.3354 -        CheckUSBHID
  4.3355 -        CheckHIDAPI
  4.3356 -        CheckPTHREAD
  4.3357 -        CheckClockGettime
  4.3358 -        CheckLinuxVersion
  4.3359 -        CheckRPATH
  4.3360 -        CheckVivanteVideo
  4.3361 -
  4.3362 -        # Set up files for the audio library
  4.3363 -        if test x$enable_audio = xyes; then
  4.3364 -          case $ARCH in
  4.3365 -            sysv5|solaris|hpux)
  4.3366 -                AC_DEFINE(SDL_AUDIO_DRIVER_SUNAUDIO, 1, [ ])
  4.3367 -                SOURCES="$SOURCES $srcdir/src/audio/sun/*.c"
  4.3368 -                SUMMARY_audio="${SUMMARY_audio} sun"
  4.3369 -                have_audio=yes
  4.3370 -            ;;
  4.3371 -            netbsd)  # Don't use this on OpenBSD, it's busted.
  4.3372 -                AC_DEFINE(SDL_AUDIO_DRIVER_NETBSD, 1, [ ])
  4.3373 -                SOURCES="$SOURCES $srcdir/src/audio/netbsd/*.c"
  4.3374 -                SUMMARY_audio="${SUMMARY_audio} netbsd"
  4.3375 -                have_audio=yes
  4.3376 -            ;;
  4.3377 -            aix)
  4.3378 -                AC_DEFINE(SDL_AUDIO_DRIVER_PAUDIO, 1, [ ])
  4.3379 -                SOURCES="$SOURCES $srcdir/src/audio/paudio/*.c"
  4.3380 -                SUMMARY_audio="${SUMMARY_audio} paudio"
  4.3381 -                have_audio=yes
  4.3382 -            ;;
  4.3383 -            android)
  4.3384 -                AC_DEFINE(SDL_AUDIO_DRIVER_ANDROID, 1, [ ])
  4.3385 -                SOURCES="$SOURCES $srcdir/src/audio/android/*.c"
  4.3386 -                SUMMARY_audio="${SUMMARY_audio} android"
  4.3387 -                have_audio=yes
  4.3388 -            ;;
  4.3389 -            nto)
  4.3390 -                CheckQNXAudio
  4.3391 -            ;;
  4.3392 -          esac
  4.3393 -        fi
  4.3394 -        # Set up files for the joystick library
  4.3395 -        if test x$enable_joystick = xyes; then
  4.3396 -          case $ARCH in
  4.3397 -            linux)
  4.3398 -                AC_DEFINE(SDL_JOYSTICK_LINUX, 1, [ ])
  4.3399 -                SOURCES="$SOURCES $srcdir/src/joystick/linux/*.c"
  4.3400 -                SOURCES="$SOURCES $srcdir/src/joystick/steam/*.c"
  4.3401 -                have_joystick=yes
  4.3402 -            ;;
  4.3403 -            android)
  4.3404 -                AC_DEFINE(SDL_JOYSTICK_ANDROID, 1, [ ])
  4.3405 -                SOURCES="$SOURCES $srcdir/src/joystick/android/*.c"
  4.3406 -                SOURCES="$SOURCES $srcdir/src/joystick/steam/*.c"
  4.3407 -                have_joystick=yes
  4.3408 -            ;;
  4.3409 -          esac
  4.3410 -        fi
  4.3411 -        # Set up files for the haptic library
  4.3412 -        if test x$enable_haptic = xyes; then
  4.3413 -          case $ARCH in
  4.3414 -            linux)
  4.3415 -                if test x$use_input_events = xyes; then
  4.3416 -                    AC_DEFINE(SDL_HAPTIC_LINUX, 1, [ ])
  4.3417 -                    SOURCES="$SOURCES $srcdir/src/haptic/linux/*.c"
  4.3418 -                    have_haptic=yes
  4.3419 -                fi
  4.3420 -            ;;
  4.3421 -            android)
  4.3422 -                AC_DEFINE(SDL_HAPTIC_ANDROID, 1, [ ])
  4.3423 -                SOURCES="$SOURCES $srcdir/src/haptic/android/*.c"
  4.3424 -                have_haptic=yes
  4.3425 -            ;;
  4.3426 -          esac
  4.3427 -        fi
  4.3428 -        # Set up files for the sensor library
  4.3429 -        if test x$enable_sensor = xyes; then
  4.3430 -          case $ARCH in
  4.3431 -            android)
  4.3432 -                AC_DEFINE(SDL_SENSOR_ANDROID, 1, [ ])
  4.3433 -                SOURCES="$SOURCES $srcdir/src/sensor/android/*.c"
  4.3434 -                have_sensor=yes
  4.3435 -            ;;
  4.3436 -          esac
  4.3437 -        fi
  4.3438 -        # Set up files for the power library
  4.3439 -        if test x$enable_power = xyes; then
  4.3440 -             case $ARCH in
  4.3441 -               linux)
  4.3442 -                   AC_DEFINE(SDL_POWER_LINUX, 1, [ ])
  4.3443 -                   SOURCES="$SOURCES $srcdir/src/power/linux/*.c"
  4.3444 -                   have_power=yes
  4.3445 -               ;;
  4.3446 -               android)
  4.3447 -                   AC_DEFINE(SDL_POWER_ANDROID, 1, [ ])
  4.3448 -                   SOURCES="$SOURCES $srcdir/src/power/android/*.c"
  4.3449 -                   have_power=yes
  4.3450 -               ;;
  4.3451 -             esac
  4.3452 -        fi
  4.3453 -        # Set up files for the filesystem library
  4.3454 -        if test x$enable_filesystem = xyes; then
  4.3455 -             case $ARCH in
  4.3456 -               android)
  4.3457 -                   AC_DEFINE(SDL_FILESYSTEM_ANDROID, 1, [ ])
  4.3458 -                   SOURCES="$SOURCES $srcdir/src/filesystem/android/*.c"
  4.3459 -                   have_filesystem=yes
  4.3460 -               ;;
  4.3461 -               *)
  4.3462 -                   AC_DEFINE(SDL_FILESYSTEM_UNIX, 1, [ ])
  4.3463 -                   SOURCES="$SOURCES $srcdir/src/filesystem/unix/*.c"
  4.3464 -                   have_filesystem=yes
  4.3465 -               ;;
  4.3466 -             esac
  4.3467 -        fi
  4.3468 -        # Set up files for the timer library
  4.3469 -        if test x$enable_timers = xyes; then
  4.3470 -            AC_DEFINE(SDL_TIMER_UNIX, 1, [ ])
  4.3471 -            SOURCES="$SOURCES $srcdir/src/timer/unix/*.c"
  4.3472 -            have_timers=yes
  4.3473 -        fi
  4.3474 -        # Set up files for udev hotplugging support
  4.3475 -        if test x$enable_libudev = xyes && test x$have_libudev_h_hdr = xyes; then
  4.3476 -            SOURCES="$SOURCES $srcdir/src/core/linux/SDL_udev.c"               
  4.3477 -        fi
  4.3478 -        # Set up files for evdev input
  4.3479 -        if test x$use_input_events = xyes; then
  4.3480 -            SOURCES="$SOURCES $srcdir/src/core/linux/SDL_evdev*.c"
  4.3481 -        fi       
  4.3482 -        # Set up other core UNIX files
  4.3483 -        SOURCES="$SOURCES $srcdir/src/core/linux/SDL_threadprio.c"
  4.3484 -        SOURCES="$SOURCES $srcdir/src/core/unix/*.c"
  4.3485 -        ;;
  4.3486 -    *-*-cygwin* | *-*-mingw32*)
  4.3487 -        ARCH=win32
  4.3488 -        if test "$build" != "$host"; then # cross-compiling
  4.3489 -            # Default cross-compile location
  4.3490 -            ac_default_prefix=/usr/local/cross-tools/$host
  4.3491 -        else
  4.3492 -            # Look for the location of the tools and install there
  4.3493 -            if test "$BUILD_PREFIX" != ""; then
  4.3494 -                ac_default_prefix=$BUILD_PREFIX
  4.3495 -            fi
  4.3496 -        fi
  4.3497 -        CheckDeclarationAfterStatement
  4.3498 -        CheckDummyVideo
  4.3499 -        CheckDiskAudio
  4.3500 -        CheckDummyAudio
  4.3501 -        CheckWINDOWS