You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@corinthia.apache.org by ja...@apache.org on 2015/03/23 17:19:16 UTC
[28/83] [abbrv] [partial] incubator-corinthia git commit: removed SDL2
http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/d1484ae0/DocFormats/platform/3rdparty/SDL2-2.0.3/configure.in
----------------------------------------------------------------------
diff --git a/DocFormats/platform/3rdparty/SDL2-2.0.3/configure.in b/DocFormats/platform/3rdparty/SDL2-2.0.3/configure.in
deleted file mode 100644
index 3d8a2de..0000000
--- a/DocFormats/platform/3rdparty/SDL2-2.0.3/configure.in
+++ /dev/null
@@ -1,3255 +0,0 @@
-dnl Process this file with autoconf to produce a configure script.
-AC_INIT(README.txt)
-AC_CONFIG_HEADER(include/SDL_config.h)
-AC_CONFIG_AUX_DIR(build-scripts)
-AC_CONFIG_MACRO_DIR([acinclude])
-
-dnl Save the CFLAGS to see whether they were passed in or generated
-orig_CFLAGS="$CFLAGS"
-
-dnl Set various version strings - taken gratefully from the GTk sources
-#
-# Making releases:
-# Edit include/SDL_version.h and change the version, then:
-# SDL_MICRO_VERSION += 1;
-# SDL_INTERFACE_AGE += 1;
-# SDL_BINARY_AGE += 1;
-# if any functions have been added, set SDL_INTERFACE_AGE to 0.
-# if backwards compatibility has been broken,
-# set SDL_BINARY_AGE and SDL_INTERFACE_AGE to 0.
-#
-SDL_MAJOR_VERSION=2
-SDL_MINOR_VERSION=0
-SDL_MICRO_VERSION=3
-SDL_INTERFACE_AGE=1
-SDL_BINARY_AGE=3
-SDL_VERSION=$SDL_MAJOR_VERSION.$SDL_MINOR_VERSION.$SDL_MICRO_VERSION
-
-AC_SUBST(SDL_MAJOR_VERSION)
-AC_SUBST(SDL_MINOR_VERSION)
-AC_SUBST(SDL_MICRO_VERSION)
-AC_SUBST(SDL_INTERFACE_AGE)
-AC_SUBST(SDL_BINARY_AGE)
-AC_SUBST(SDL_VERSION)
-
-# libtool versioning
-LT_INIT([win32-dll])
-
-LT_RELEASE=$SDL_MAJOR_VERSION.$SDL_MINOR_VERSION
-LT_CURRENT=`expr $SDL_MICRO_VERSION - $SDL_INTERFACE_AGE`
-LT_REVISION=$SDL_INTERFACE_AGE
-LT_AGE=`expr $SDL_BINARY_AGE - $SDL_INTERFACE_AGE`
-m4_pattern_allow([^LT_])
-
-AC_SUBST(LT_RELEASE)
-AC_SUBST(LT_CURRENT)
-AC_SUBST(LT_REVISION)
-AC_SUBST(LT_AGE)
-
-dnl Detect the canonical build and host environments
-dnl AC_CANONICAL_HOST
-
-dnl Check for tools
-AC_PROG_LIBTOOL
-AC_PROG_CC
-AC_PROG_CXX
-AC_PROG_INSTALL
-AC_PROG_MAKE_SET
-AC_CHECK_TOOL(WINDRES, [windres], [:])
-
-dnl Make sure that srcdir is a full pathname
-case "$host" in
- *-*-mingw32*)
- # Except on msys, where make can't handle full pathnames (bug 1972)
- ;;
- *)
- srcdir=`cd $srcdir && pwd`
- ;;
-esac
-
-dnl Set up the compiler and linker flags
-INCLUDE="-I$srcdir/include"
-if test x$srcdir != x.; then
- INCLUDE="-Iinclude $INCLUDE"
-elif test -d .hg; then
- AC_MSG_ERROR([
-*** When building from Mercurial you should configure and build in a
- separate directory so you don't clobber SDL_config.h, SDL_revision.h
-])
-fi
-BASE_CFLAGS=""
-BASE_LDFLAGS=""
-case "$host" in
- *-*-cygwin*)
- # We build SDL on cygwin without the UNIX emulation layer
- save_CFLAGS="$CFLAGS"
- have_no_cygwin=no
- AC_MSG_CHECKING(for GCC -mno-cygwin option)
- CFLAGS="$save_CFLAGS -mno-cygwin"
-
- AC_TRY_COMPILE([
- ],[
- ],[
- have_no_cygwin=yes
- ])
- AC_MSG_RESULT($have_no_cygwin)
- CFLAGS="$save_CFLAGS"
-
- if test x$have_no_cygwin = xyes; then
- BASE_CFLAGS="-mno-cygwin"
- BASE_LDFLAGS="-mno-cygwin"
- fi
- BASE_CFLAGS="$BASE_CFLAGS -I/usr/include/mingw"
- ;;
-esac
-# Uncomment the following line if you want to force SDL and applications
-# built with it to be compiled for a particular architecture.
-#AX_GCC_ARCHFLAG([no], [BASE_CFLAGS="$BASE_CFLAGS $ax_cv_gcc_archflag]")
-BUILD_CFLAGS="$CFLAGS $CPPFLAGS -DUSING_GENERATED_CONFIG_H"
-# The default optimization for SDL is -O3 (Bug #31)
-if test "x$orig_CFLAGS" = x; then
- BUILD_CFLAGS=`echo $BUILD_CFLAGS | sed 's/-O2/-O3/'`
-fi
-EXTRA_CFLAGS="$INCLUDE $BASE_CFLAGS"
-BUILD_LDFLAGS="$LDFLAGS"
-EXTRA_LDFLAGS="$BASE_LDFLAGS"
-## These are common directories to find software packages
-#for path in /usr/freeware /usr/pkg /usr/X11R6 /usr/local; do
-# if test -d $path/include; then
-# EXTRA_CFLAGS="$EXTRA_CFLAGS -I$path/include"
-# fi
-# if test -d $path/lib; then
-# EXTRA_LDFLAGS="$EXTRA_LDFLAGS -L$path/lib"
-# fi
-#done
-SDL_CFLAGS="$BASE_CFLAGS"
-SDL_LIBS="-lSDL2 $BASE_LDFLAGS"
-CPPFLAGS="$CPPFLAGS $EXTRA_CFLAGS"
-CFLAGS="$CFLAGS $EXTRA_CFLAGS"
-LDFLAGS="$LDFLAGS $EXTRA_LDFLAGS"
-
-dnl set this to use on systems that use lib64 instead of lib
-base_libdir=`echo \${libdir} | sed 's/.*\/\(.*\)/\1/; q'`
-
-dnl Function to find a library in the compiler search path
-find_lib()
-{
- gcc_bin_path=[`$CC -print-search-dirs 2>/dev/null | fgrep programs: | sed 's/[^=]*=\(.*\)/\1/' | sed 's/:/ /g'`]
- gcc_lib_path=[`$CC -print-search-dirs 2>/dev/null | fgrep libraries: | sed 's/[^=]*=\(.*\)/\1/' | sed 's/:/ /g'`]
- env_lib_path=[`echo $LIBS $LDFLAGS $* | sed 's/-L[ ]*//g'`]
- if test "$cross_compiling" = yes; then
- host_lib_path=""
- else
- host_lib_path="/usr/$base_libdir /usr/local/$base_libdir"
- fi
- for path in $gcc_bin_path $gcc_lib_path $env_lib_path $host_lib_path; do
- lib=[`ls -- $path/$1 2>/dev/null | sed -e '/\.so\..*\./d' -e 's,.*/,,' | sort | tail -1`]
- if test x$lib != x; then
- echo $lib
- return
- fi
- done
-}
-
-dnl Check for compiler characteristics
-AC_C_CONST
-AC_C_INLINE
-AC_C_VOLATILE
-
-dnl See whether we want assertions for debugging/sanity checking SDL itself.
-AC_ARG_ENABLE(assertions,
-AC_HELP_STRING([--enable-assertions],
- [Enable internal sanity checks (auto/disabled/release/enabled/paranoid) [[default=auto]]]),
- , enable_assertions=auto)
-case "$enable_assertions" in
- auto) # Use optimization settings to determine assertion level
- ;;
- disabled)
- AC_DEFINE(SDL_DEFAULT_ASSERT_LEVEL, 0, [ ])
- ;;
- release)
- AC_DEFINE(SDL_DEFAULT_ASSERT_LEVEL, 1, [ ])
- ;;
- enabled)
- AC_DEFINE(SDL_DEFAULT_ASSERT_LEVEL, 2, [ ])
- ;;
- paranoid)
- AC_DEFINE(SDL_DEFAULT_ASSERT_LEVEL, 3, [ ])
- ;;
- *)
- AC_MSG_ERROR([*** unknown assertion level. stop.])
- ;;
-esac
-
-dnl See whether we can use gcc style dependency tracking
-AC_ARG_ENABLE(dependency-tracking,
-AC_HELP_STRING([--enable-dependency-tracking],
- [Use gcc -MMD -MT dependency tracking [[default=yes]]]),
- , enable_dependency_tracking=yes)
-if test x$enable_dependency_tracking = xyes; then
- have_gcc_mmd_mt=no
- AC_MSG_CHECKING(for GCC -MMD -MT option)
- AC_TRY_COMPILE([
- #if !defined(__GNUC__) || __GNUC__ < 3
- #error Dependency tracking requires GCC 3.0 or newer
- #endif
- ],[
- ],[
- have_gcc_mmd_mt=yes
- ])
- AC_MSG_RESULT($have_gcc_mmd_mt)
-
- if test x$have_gcc_mmd_mt = xyes; then
- DEPENDENCY_TRACKING_OPTIONS="-MMD -MT \$@"
- fi
-fi
-
-AC_MSG_CHECKING(for linker option --no-undefined)
-have_no_undefined=no
-case "$host" in
- dnl Skip this on platforms where it is just simply busted.
- *-*-openbsd*)
- ;;
-
- *)
- save_LDFLAGS="$LDFLAGS"
- LDFLAGS="$LDFLAGS -Wl,--no-undefined"
- AC_TRY_LINK([
- ],[
- ],[
- have_no_undefined=yes
- EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,--no-undefined"
- ])
- LDFLAGS="$save_LDFLAGS"
- ;;
-esac
-AC_MSG_RESULT($have_no_undefined)
-
-dnl See whether we are allowed to use the system C library
-AC_ARG_ENABLE(libc,
-AC_HELP_STRING([--enable-libc], [Use the system C library [[default=yes]]]),
- , enable_libc=yes)
-if test x$enable_libc = xyes; then
- AC_DEFINE(HAVE_LIBC, 1, [ ])
-
- dnl Check for C library headers
- AC_HEADER_STDC
- AC_CHECK_HEADERS(sys/types.h stdio.h stdlib.h stddef.h stdarg.h malloc.h memory.h string.h strings.h inttypes.h stdint.h ctype.h math.h iconv.h signal.h)
-
- dnl Check for typedefs, structures, etc.
- AC_TYPE_SIZE_T
-
- dnl Check for defines
- AC_CHECK_DEFINE(M_PI, math.h)
-
- dnl Checks for library functions.
- case "$host" in
- *-*-cygwin* | *-*-mingw32*)
- ;;
- *)
- AC_FUNC_ALLOCA
- ;;
- esac
-
- AC_FUNC_MEMCMP
- if test x$ac_cv_func_memcmp_working = xyes; then
- AC_DEFINE(HAVE_MEMCMP, 1, [ ])
- fi
- AC_FUNC_STRTOD
- if test x$ac_cv_func_strtod = xyes; then
- AC_DEFINE(HAVE_STRTOD, 1, [ ])
- fi
- AC_CHECK_FUNC(mprotect,
- AC_TRY_COMPILE([
- #include <sys/types.h>
- #include <sys/mman.h>
- ],[
- ],[
- AC_DEFINE(HAVE_MPROTECT, 1, [ ])
- ]),
- )
- AC_CHECK_FUNCS(malloc calloc realloc free getenv setenv putenv unsetenv qsort abs bcopy memset memcpy memmove strlen strlcpy strlcat strdup _strrev _strupr _strlwr strchr strrchr strstr itoa _ltoa _uitoa _ultoa strtol strtoul _i64toa _ui64toa strtoll strtoull atoi atof strcmp strncmp _stricmp strcasecmp _strnicmp strncasecmp vsscanf vsnprintf fseeko fseeko64 sigaction setjmp nanosleep sysconf sysctlbyname)
-
- AC_CHECK_LIB(m, pow, [LIBS="$LIBS -lm"; EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lm"])
- AC_CHECK_FUNCS(atan atan2 acos asin ceil copysign cos cosf fabs floor log pow scalbn sin sinf sqrt)
-
- AC_CHECK_LIB(iconv, iconv_open, [LIBS="$LIBS -liconv"; EXTRA_LDFLAGS="$EXTRA_LDFLAGS -liconv"])
- AC_CHECK_FUNCS(iconv)
-
- AC_CHECK_MEMBER(struct sigaction.sa_sigaction,[AC_DEFINE(HAVE_SA_SIGACTION)], ,[#include <signal.h>])
-fi
-
-dnl AC_CHECK_SIZEOF(void*)
-
-dnl See whether we can use gcc atomic operations on this architecture
-AC_ARG_ENABLE(gcc-atomics,
-AC_HELP_STRING([--enable-gcc-atomics],
- [Use gcc builtin atomics [[default=yes]]]),
- , enable_gcc_atomics=yes)
-if test x$enable_gcc_atomics = xyes; then
- have_gcc_atomics=no
- AC_MSG_CHECKING(for GCC builtin atomic operations)
- AC_TRY_LINK([
- ],[
- int a;
- void *x, *y, *z;
- __sync_lock_test_and_set(&a, 4);
- __sync_lock_test_and_set(&x, y);
- __sync_fetch_and_add(&a, 1);
- __sync_bool_compare_and_swap(&a, 5, 10);
- __sync_bool_compare_and_swap(&x, y, z);
- ],[
- have_gcc_atomics=yes
- ])
- AC_MSG_RESULT($have_gcc_atomics)
-
- if test x$have_gcc_atomics = xyes; then
- AC_DEFINE(HAVE_GCC_ATOMICS, 1, [ ])
- else
- # See if we have the minimum operation needed for GCC atomics
- AC_TRY_LINK([
- ],[
- int a;
- __sync_lock_test_and_set(&a, 1);
- __sync_lock_release(&a);
- ],[
- have_gcc_sync_lock_test_and_set=yes
- ])
- if test x$have_gcc_sync_lock_test_and_set = xyes; then
- AC_DEFINE(HAVE_GCC_SYNC_LOCK_TEST_AND_SET, 1, [ ])
- fi
- fi
-fi
-
-# Standard C sources
-SOURCES="$SOURCES $srcdir/src/*.c"
-SOURCES="$SOURCES $srcdir/src/atomic/*.c"
-SOURCES="$SOURCES $srcdir/src/audio/*.c"
-SOURCES="$SOURCES $srcdir/src/cpuinfo/*.c"
-SOURCES="$SOURCES $srcdir/src/dynapi/*.c"
-SOURCES="$SOURCES $srcdir/src/events/*.c"
-SOURCES="$SOURCES $srcdir/src/file/*.c"
-SOURCES="$SOURCES $srcdir/src/haptic/*.c"
-SOURCES="$SOURCES $srcdir/src/joystick/*.c"
-SOURCES="$SOURCES $srcdir/src/libm/*.c"
-SOURCES="$SOURCES $srcdir/src/power/*.c"
-#SOURCES="$SOURCES $srcdir/src/filesystem/*.c"
-SOURCES="$SOURCES $srcdir/src/render/*.c"
-SOURCES="$SOURCES $srcdir/src/render/*/*.c"
-SOURCES="$SOURCES $srcdir/src/stdlib/*.c"
-SOURCES="$SOURCES $srcdir/src/thread/*.c"
-SOURCES="$SOURCES $srcdir/src/timer/*.c"
-SOURCES="$SOURCES $srcdir/src/video/*.c"
-
-dnl Enable/disable various subsystems of the SDL library
-
-AC_ARG_ENABLE(atomic,
-AC_HELP_STRING([--enable-atomic], [Enable the atomic operations subsystem [[default=yes]]]),
- , enable_atomic=yes)
-if test x$enable_atomic != xyes; then
- AC_DEFINE(SDL_ATOMIC_DISABLED, 1, [ ])
-else
- SUMMARY_modules="${SUMMARY_modules} atomic"
-fi
-AC_ARG_ENABLE(audio,
-AC_HELP_STRING([--enable-audio], [Enable the audio subsystem [[default=yes]]]),
- , enable_audio=yes)
-if test x$enable_audio != xyes; then
- AC_DEFINE(SDL_AUDIO_DISABLED, 1, [ ])
-else
- SUMMARY_modules="${SUMMARY_modules} audio"
-fi
-AC_ARG_ENABLE(video,
-AC_HELP_STRING([--enable-video], [Enable the video subsystem [[default=yes]]]),
- , enable_video=yes)
-if test x$enable_video != xyes; then
- AC_DEFINE(SDL_VIDEO_DISABLED, 1, [ ])
-else
- SUMMARY_modules="${SUMMARY_modules} video"
-fi
-AC_ARG_ENABLE(render,
-AC_HELP_STRING([--enable-render], [Enable the render subsystem [[default=yes]]]),
- , enable_render=yes)
-if test x$enable_render != xyes; then
- AC_DEFINE(SDL_RENDER_DISABLED, 1, [ ])
-else
- SUMMARY_modules="${SUMMARY_modules} render"
-fi
-AC_ARG_ENABLE(events,
-AC_HELP_STRING([--enable-events], [Enable the events subsystem [[default=yes]]]),
- , enable_events=yes)
-if test x$enable_events != xyes; then
- AC_DEFINE(SDL_EVENTS_DISABLED, 1, [ ])
-else
- SUMMARY_modules="${SUMMARY_modules} events"
-fi
-AC_ARG_ENABLE(joystick,
-AC_HELP_STRING([--enable-joystick], [Enable the joystick subsystem [[default=yes]]]),
- , enable_joystick=yes)
-if test x$enable_joystick != xyes; then
- AC_DEFINE(SDL_JOYSTICK_DISABLED, 1, [ ])
-else
- SUMMARY_modules="${SUMMARY_modules} joystick"
-fi
-AC_ARG_ENABLE(haptic,
-AC_HELP_STRING([--enable-haptic], [Enable the haptic (force feedback) subsystem [[default=yes]]]),
- , enable_haptic=yes)
-if test x$enable_haptic != xyes; then
- AC_DEFINE(SDL_HAPTIC_DISABLED, 1, [ ])
-else
- SUMMARY_modules="${SUMMARY_modules} haptic"
-fi
-AC_ARG_ENABLE(power,
-AC_HELP_STRING([--enable-power], [Enable the power subsystem [[default=yes]]]),
- , enable_power=yes)
-if test x$enable_power != xyes; then
- AC_DEFINE(SDL_POWER_DISABLED, 1, [ ])
-else
- SUMMARY_modules="${SUMMARY_modules} power"
-fi
-AC_ARG_ENABLE(filesystem,
-AC_HELP_STRING([--enable-filesystem], [Enable the filesystem subsystem [[default=yes]]]),
- , enable_filesystem=yes)
-if test x$enable_filesystem != xyes; then
- AC_DEFINE(SDL_FILESYSTEM_DISABLED, 1, [ ])
-else
- SUMMARY_modules="${SUMMARY_modules} filesystem"
-fi
-AC_ARG_ENABLE(threads,
-AC_HELP_STRING([--enable-threads], [Enable the threading subsystem [[default=yes]]]),
- , enable_threads=yes)
-if test x$enable_threads != xyes; then
- AC_DEFINE(SDL_THREADS_DISABLED, 1, [ ])
-else
- SUMMARY_modules="${SUMMARY_modules} threads"
-fi
-AC_ARG_ENABLE(timers,
-AC_HELP_STRING([--enable-timers], [Enable the timer subsystem [[default=yes]]]),
- , enable_timers=yes)
-if test x$enable_timers != xyes; then
- AC_DEFINE(SDL_TIMERS_DISABLED, 1, [ ])
-else
- SUMMARY_modules="${SUMMARY_modules} timers"
-fi
-AC_ARG_ENABLE(file,
-AC_HELP_STRING([--enable-file], [Enable the file subsystem [[default=yes]]]),
- , enable_file=yes)
-if test x$enable_file != xyes; then
- AC_DEFINE(SDL_FILE_DISABLED, 1, [ ])
-else
- SUMMARY_modules="${SUMMARY_modules} file"
-fi
-AC_ARG_ENABLE(loadso,
-AC_HELP_STRING([--enable-loadso], [Enable the shared object loading subsystem [[default=yes]]]),
- , enable_loadso=yes)
-if test x$enable_loadso != xyes; then
- AC_DEFINE(SDL_LOADSO_DISABLED, 1, [ ])
-else
- SUMMARY_modules="${SUMMARY_modules} loadso"
-fi
-AC_ARG_ENABLE(cpuinfo,
-AC_HELP_STRING([--enable-cpuinfo], [Enable the cpuinfo subsystem [[default=yes]]]),
- , enable_cpuinfo=yes)
-if test x$enable_cpuinfo != xyes; then
- AC_DEFINE(SDL_CPUINFO_DISABLED, 1, [ ])
-else
- SUMMARY_modules="${SUMMARY_modules} cpuinfo"
-fi
-AC_ARG_ENABLE(assembly,
-AC_HELP_STRING([--enable-assembly], [Enable assembly routines [[default=yes]]]),
- , enable_assembly=yes)
-if test x$enable_assembly = xyes; then
- SUMMARY_modules="${SUMMARY_modules} assembly"
-
- AC_DEFINE(SDL_ASSEMBLY_ROUTINES, 1, [ ])
-
- # Make sure that we don't generate floating point code that would
- # cause illegal instruction exceptions on older processors
- case "$host" in
- *-*-darwin*)
- # Don't need to worry about Apple hardware, it's all SSE capable
- default_ssemath=yes
- ;;
- *64-*-*)
- # x86 64-bit architectures all have SSE instructions
- default_ssemath=yes
- ;;
- *)
- default_ssemath=no
- ;;
- esac
- AC_ARG_ENABLE(ssemath,
-AC_HELP_STRING([--enable-ssemath], [Allow GCC to use SSE floating point math [[default=no]]]),
- , enable_ssemath=$default_ssemath)
- if test x$enable_ssemath = xno; then
- if test x$have_gcc_sse = xyes -o x$have_gcc_sse2 = xyes; then
- EXTRA_CFLAGS="$EXTRA_CFLAGS -mfpmath=387"
- fi
- fi
-
- dnl Check for various instruction support
- AC_ARG_ENABLE(mmx,
-AC_HELP_STRING([--enable-mmx], [use MMX assembly routines [[default=yes]]]),
- , enable_mmx=yes)
- if test x$enable_mmx = xyes; then
- save_CFLAGS="$CFLAGS"
- have_gcc_mmx=no
- AC_MSG_CHECKING(for GCC -mmmx option)
- mmx_CFLAGS="-mmmx"
- CFLAGS="$save_CFLAGS $mmx_CFLAGS"
-
- AC_TRY_COMPILE([
- #ifdef __MINGW32__
- #include <_mingw.h>
- #ifdef __MINGW64_VERSION_MAJOR
- #include <intrin.h>
- #else
- #include <mmintrin.h>
- #endif
- #else
- #include <mmintrin.h>
- #endif
- #ifndef __MMX__
- #error Assembler CPP flag not enabled
- #endif
- ],[
- ],[
- have_gcc_mmx=yes
- ])
- AC_MSG_RESULT($have_gcc_mmx)
- CFLAGS="$save_CFLAGS"
-
- if test x$have_gcc_mmx = xyes; then
- EXTRA_CFLAGS="$EXTRA_CFLAGS $mmx_CFLAGS"
- SUMMARY_math="${SUMMARY_math} mmx"
- fi
- fi
-
- AC_ARG_ENABLE(3dnow,
-AC_HELP_STRING([--enable-3dnow], [use 3DNow! assembly routines [[default=yes]]]),
- , enable_3dnow=yes)
- if test x$enable_3dnow = xyes; then
- save_CFLAGS="$CFLAGS"
- have_gcc_3dnow=no
- AC_MSG_CHECKING(for GCC -m3dnow option)
- amd3dnow_CFLAGS="-m3dnow"
- CFLAGS="$save_CFLAGS $amd3dnow_CFLAGS"
-
- AC_TRY_LINK([
- #include <mm3dnow.h>
- #ifndef __3dNOW__
- #error Assembler CPP flag not enabled
- #endif
- ],[
- void *p = 0;
- _m_prefetch(p);
- ],[
- have_gcc_3dnow=yes
- ])
- AC_MSG_RESULT($have_gcc_3dnow)
- CFLAGS="$save_CFLAGS"
-
- if test x$have_gcc_3dnow = xyes; then
- EXTRA_CFLAGS="$EXTRA_CFLAGS $amd3dnow_CFLAGS"
- SUMMARY_math="${SUMMARY_math} 3dnow"
- fi
- fi
-
- AC_ARG_ENABLE(sse,
-AC_HELP_STRING([--enable-sse], [use SSE assembly routines [[default=yes]]]),
- , enable_sse=yes)
- if test x$enable_sse = xyes; then
- save_CFLAGS="$CFLAGS"
- have_gcc_sse=no
- AC_MSG_CHECKING(for GCC -msse option)
- sse_CFLAGS="-msse"
- CFLAGS="$save_CFLAGS $sse_CFLAGS"
-
- AC_TRY_COMPILE([
- #ifdef __MINGW32__
- #include <_mingw.h>
- #ifdef __MINGW64_VERSION_MAJOR
- #include <intrin.h>
- #else
- #include <xmmintrin.h>
- #endif
- #else
- #include <xmmintrin.h>
- #endif
- #ifndef __SSE__
- #error Assembler CPP flag not enabled
- #endif
- ],[
- ],[
- have_gcc_sse=yes
- ])
- AC_MSG_RESULT($have_gcc_sse)
- CFLAGS="$save_CFLAGS"
-
- if test x$have_gcc_sse = xyes; then
- EXTRA_CFLAGS="$EXTRA_CFLAGS $sse_CFLAGS"
- SUMMARY_math="${SUMMARY_math} sse"
- fi
- fi
-
- AC_ARG_ENABLE(sse2,
-AC_HELP_STRING([--enable-sse2], [use SSE2 assembly routines [[default=no]]]),
- , enable_sse2=$default_ssemath)
- if test x$enable_sse2 = xyes; then
- save_CFLAGS="$CFLAGS"
- have_gcc_sse2=no
- AC_MSG_CHECKING(for GCC -msse2 option)
- sse2_CFLAGS="-msse2"
- CFLAGS="$save_CFLAGS $sse2_CFLAGS"
-
- AC_TRY_COMPILE([
- #ifdef __MINGW32__
- #include <_mingw.h>
- #ifdef __MINGW64_VERSION_MAJOR
- #include <intrin.h>
- #else
- #include <emmintrin.h>
- #endif
- #else
- #include <emmintrin.h>
- #endif
- #ifndef __SSE2__
- #error Assembler CPP flag not enabled
- #endif
- ],[
- ],[
- have_gcc_sse2=yes
- ])
- AC_MSG_RESULT($have_gcc_sse2)
- CFLAGS="$save_CFLAGS"
-
- if test x$have_gcc_sse2 = xyes; then
- EXTRA_CFLAGS="$EXTRA_CFLAGS $sse2_CFLAGS"
- SUMMARY_math="${SUMMARY_math} sse2"
- fi
- fi
-
- AC_ARG_ENABLE(altivec,
-AC_HELP_STRING([--enable-altivec], [use Altivec assembly routines [[default=yes]]]),
- , enable_altivec=yes)
- if test x$enable_altivec = xyes; then
- save_CFLAGS="$CFLAGS"
- have_gcc_altivec=no
- have_altivec_h_hdr=no
- altivec_CFLAGS="-maltivec"
- CFLAGS="$save_CFLAGS $altivec_CFLAGS"
-
- AC_MSG_CHECKING(for Altivec with GCC altivec.h and -maltivec option)
- AC_TRY_COMPILE([
- #include <altivec.h>
- vector unsigned int vzero() {
- return vec_splat_u32(0);
- }
- ],[
- ],[
- have_gcc_altivec=yes
- have_altivec_h_hdr=yes
- ])
- AC_MSG_RESULT($have_gcc_altivec)
-
- if test x$have_gcc_altivec = xno; then
- AC_MSG_CHECKING(for Altivec with GCC -maltivec option)
- AC_TRY_COMPILE([
- vector unsigned int vzero() {
- return vec_splat_u32(0);
- }
- ],[
- ],[
- have_gcc_altivec=yes
- ])
- AC_MSG_RESULT($have_gcc_altivec)
- fi
-
- if test x$have_gcc_altivec = xno; then
- AC_MSG_CHECKING(for Altivec with GCC altivec.h and -faltivec option)
- altivec_CFLAGS="-faltivec"
- CFLAGS="$save_CFLAGS $altivec_CFLAGS"
- AC_TRY_COMPILE([
- #include <altivec.h>
- vector unsigned int vzero() {
- return vec_splat_u32(0);
- }
- ],[
- ],[
- have_gcc_altivec=yes
- have_altivec_h_hdr=yes
- ])
- AC_MSG_RESULT($have_gcc_altivec)
- fi
-
- if test x$have_gcc_altivec = xno; then
- AC_MSG_CHECKING(for Altivec with GCC -faltivec option)
- AC_TRY_COMPILE([
- vector unsigned int vzero() {
- return vec_splat_u32(0);
- }
- ],[
- ],[
- have_gcc_altivec=yes
- ])
- AC_MSG_RESULT($have_gcc_altivec)
- fi
- CFLAGS="$save_CFLAGS"
-
- if test x$have_gcc_altivec = xyes; then
- AC_DEFINE(SDL_ALTIVEC_BLITTERS, 1, [ ])
- if test x$have_altivec_h_hdr = xyes; then
- AC_DEFINE(HAVE_ALTIVEC_H, 1, [ ])
- fi
- EXTRA_CFLAGS="$EXTRA_CFLAGS $altivec_CFLAGS"
- SUMMARY_math="${SUMMARY_math} altivec"
- fi
- fi
-fi
-
-dnl See if the OSS audio interface is supported
-CheckOSS()
-{
- AC_ARG_ENABLE(oss,
-AC_HELP_STRING([--enable-oss], [support the OSS audio API [[default=maybe]]]),
- , enable_oss=maybe)
-
- # OpenBSD "has" OSS, but it's not really for app use. They want you to
- # use sndio instead. So on there, we default to disabled. You can force
- # it on if you really want, though.
- if test x$enable_oss = xmaybe; then
- enable_oss=yes
- case "$host" in
- *-*-openbsd*)
- enable_oss=no;;
- esac
- fi
-
- if test x$enable_audio = xyes -a x$enable_oss = xyes; then
- AC_MSG_CHECKING(for OSS audio support)
- have_oss=no
- if test x$have_oss != xyes; then
- AC_TRY_COMPILE([
- #include <sys/soundcard.h>
- ],[
- int arg = SNDCTL_DSP_SETFRAGMENT;
- ],[
- have_oss=yes
- ])
- fi
- if test x$have_oss != xyes; then
- AC_TRY_COMPILE([
- #include <soundcard.h>
- ],[
- int arg = SNDCTL_DSP_SETFRAGMENT;
- ],[
- have_oss=yes
- AC_DEFINE(SDL_AUDIO_DRIVER_OSS_SOUNDCARD_H, 1, [ ])
- ])
- fi
- AC_MSG_RESULT($have_oss)
- if test x$have_oss = xyes; then
- SUMMARY_audio="${SUMMARY_audio} oss"
- AC_DEFINE(SDL_AUDIO_DRIVER_OSS, 1, [ ])
- SOURCES="$SOURCES $srcdir/src/audio/dsp/*.c"
- have_audio=yes
-
- # We may need to link with ossaudio emulation library
- case "$host" in
- *-*-openbsd*|*-*-netbsd*)
- EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lossaudio";;
- esac
- fi
- fi
-}
-
-dnl See if the ALSA audio interface is supported
-CheckALSA()
-{
- AC_ARG_ENABLE(alsa,
-AC_HELP_STRING([--enable-alsa], [support the ALSA audio API [[default=yes]]]),
- , enable_alsa=yes)
- if test x$enable_audio = xyes -a x$enable_alsa = xyes; then
- AM_PATH_ALSA(0.9.0, have_alsa=yes, have_alsa=no)
- # Restore all flags from before the ALSA detection runs
- CFLAGS="$alsa_save_CFLAGS"
- LDFLAGS="$alsa_save_LDFLAGS"
- LIBS="$alsa_save_LIBS"
- if test x$have_alsa = xyes; then
- AC_ARG_ENABLE(alsa-shared,
-AC_HELP_STRING([--enable-alsa-shared], [dynamically load ALSA audio support [[default=yes]]]),
- , enable_alsa_shared=yes)
- alsa_lib=[`find_lib "libasound.so.*" "$ALSA_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`]
-
- AC_DEFINE(SDL_AUDIO_DRIVER_ALSA, 1, [ ])
- SOURCES="$SOURCES $srcdir/src/audio/alsa/*.c"
- EXTRA_CFLAGS="$EXTRA_CFLAGS $ALSA_CFLAGS"
- if test x$have_loadso != xyes && \
- test x$enable_alsa_shared = xyes; then
- AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic ALSA loading])
- fi
- if test x$have_loadso = xyes && \
- test x$enable_alsa_shared = xyes && test x$alsa_lib != x; then
- echo "-- dynamic libasound -> $alsa_lib"
- AC_DEFINE_UNQUOTED(SDL_AUDIO_DRIVER_ALSA_DYNAMIC, "$alsa_lib", [ ])
- SUMMARY_audio="${SUMMARY_audio} alsa(dynamic)"
- else
- EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ALSA_LIBS"
- SUMMARY_audio="${SUMMARY_audio} alsa"
- fi
- have_audio=yes
- fi
- fi
-}
-
-dnl Find the ESD includes and libraries
-CheckESD()
-{
- AC_ARG_ENABLE(esd,
-AC_HELP_STRING([--enable-esd], [support the Enlightened Sound Daemon [[default=yes]]]),
- , enable_esd=yes)
- if test x$enable_audio = xyes -a x$enable_esd = xyes; then
- AM_PATH_ESD(0.2.8, have_esd=yes, have_esd=no)
- if test x$have_esd = xyes; then
- AC_ARG_ENABLE(esd-shared,
-AC_HELP_STRING([--enable-esd-shared], [dynamically load ESD audio support [[default=yes]]]),
- , enable_esd_shared=yes)
- esd_lib=[`find_lib "libesd.so.*" "$ESD_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`]
-
- AC_DEFINE(SDL_AUDIO_DRIVER_ESD, 1, [ ])
- SOURCES="$SOURCES $srcdir/src/audio/esd/*.c"
- EXTRA_CFLAGS="$EXTRA_CFLAGS $ESD_CFLAGS"
- if test x$have_loadso != xyes && \
- test x$enable_esd_shared = xyes; then
- AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic ESD loading])
- fi
- if test x$have_loadso = xyes && \
- test x$enable_esd_shared = xyes && test x$esd_lib != x; then
- echo "-- dynamic libesd -> $esd_lib"
- AC_DEFINE_UNQUOTED(SDL_AUDIO_DRIVER_ESD_DYNAMIC, "$esd_lib", [ ])
- SUMMARY_audio="${SUMMARY_audio} esd(dynamic)"
- else
- EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ESD_LIBS"
- SUMMARY_audio="${SUMMARY_audio} esd"
- fi
- have_audio=yes
- fi
- fi
-}
-
-dnl Find PulseAudio
-CheckPulseAudio()
-{
- AC_ARG_ENABLE(pulseaudio,
-AC_HELP_STRING([--enable-pulseaudio], [use PulseAudio [[default=yes]]]),
- , enable_pulseaudio=yes)
- if test x$enable_audio = xyes -a x$enable_pulseaudio = xyes; then
- audio_pulseaudio=no
-
- PULSEAUDIO_REQUIRED_VERSION=0.9
-
- AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
- AC_MSG_CHECKING(for PulseAudio $PULSEAUDIO_REQUIRED_VERSION support)
- if test x$PKG_CONFIG != xno; then
- if $PKG_CONFIG --atleast-pkgconfig-version 0.7 && $PKG_CONFIG --atleast-version $PULSEAUDIO_REQUIRED_VERSION libpulse-simple; then
- PULSEAUDIO_CFLAGS=`$PKG_CONFIG --cflags libpulse-simple`
- PULSEAUDIO_LIBS=`$PKG_CONFIG --libs libpulse-simple`
- audio_pulseaudio=yes
- fi
- fi
- AC_MSG_RESULT($audio_pulseaudio)
-
- if test x$audio_pulseaudio = xyes; then
- AC_ARG_ENABLE(pulseaudio-shared,
-AC_HELP_STRING([--enable-pulseaudio-shared], [dynamically load PulseAudio support [[default=yes]]]),
- , enable_pulseaudio_shared=yes)
- pulseaudio_lib=[`find_lib "libpulse-simple.so.*" "$PULSEAUDIO_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`]
-
- AC_DEFINE(SDL_AUDIO_DRIVER_PULSEAUDIO, 1, [ ])
- SOURCES="$SOURCES $srcdir/src/audio/pulseaudio/*.c"
- EXTRA_CFLAGS="$EXTRA_CFLAGS $PULSEAUDIO_CFLAGS"
- if test x$have_loadso != xyes && \
- test x$enable_pulseaudio_shared = xyes; then
- AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic PulseAudio loading])
- fi
- if test x$have_loadso = xyes && \
- test x$enable_pulseaudio_shared = xyes && test x$pulseaudio_lib != x; then
- echo "-- dynamic libpulse-simple -> $pulseaudio_lib"
- AC_DEFINE_UNQUOTED(SDL_AUDIO_DRIVER_PULSEAUDIO_DYNAMIC, "$pulseaudio_lib", [ ])
- SUMMARY_audio="${SUMMARY_audio} pulse(dynamic)"
-
- case "$host" in
- # On Solaris, pulseaudio must be linked deferred explicitly
- # to prevent undefined symbol failures.
- *-*-solaris*)
- PULSEAUDIO_LIBS=`echo $PULSEAUDIO_LIBS | sed 's/\-l/-Wl,-l/g'`
- EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-zdeferred $PULSEAUDIO_LIBS -Wl,-znodeferred"
- esac
- else
- EXTRA_LDFLAGS="$EXTRA_LDFLAGS $PULSEAUDIO_LIBS"
- SUMMARY_audio="${SUMMARY_audio} pulse"
- fi
- have_audio=yes
- fi
- fi
-}
-
-CheckARTSC()
-{
- AC_ARG_ENABLE(arts,
-AC_HELP_STRING([--enable-arts], [support the Analog Real Time Synthesizer [[default=yes]]]),
- , enable_arts=yes)
- if test x$enable_audio = xyes -a x$enable_arts = xyes; then
- AC_PATH_PROG(ARTSCONFIG, artsc-config)
- if test x$ARTSCONFIG = x -o x$ARTSCONFIG = x'"$ARTSCONFIG"'; then
- : # arts isn't installed
- else
- ARTS_CFLAGS=`$ARTSCONFIG --cflags`
- ARTS_LIBS=`$ARTSCONFIG --libs`
- AC_MSG_CHECKING(for aRts development environment)
- audio_arts=no
- save_CFLAGS="$CFLAGS"
- CFLAGS="$CFLAGS $ARTS_CFLAGS"
- AC_TRY_COMPILE([
- #include <artsc.h>
- ],[
- arts_stream_t stream;
- ],[
- audio_arts=yes
- ])
- CFLAGS="$save_CFLAGS"
- AC_MSG_RESULT($audio_arts)
- if test x$audio_arts = xyes; then
- AC_ARG_ENABLE(arts-shared,
-AC_HELP_STRING([--enable-arts-shared], [dynamically load aRts audio support [[default=yes]]]),
- , enable_arts_shared=yes)
- arts_lib=[`find_lib "libartsc.so.*" "$ARTS_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`]
-
- AC_DEFINE(SDL_AUDIO_DRIVER_ARTS, 1, [ ])
- SOURCES="$SOURCES $srcdir/src/audio/arts/*.c"
- EXTRA_CFLAGS="$EXTRA_CFLAGS $ARTS_CFLAGS"
- if test x$have_loadso != xyes && \
- test x$enable_arts_shared = xyes; then
- AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic ARTS loading])
- fi
- if test x$have_loadso = xyes && \
- test x$enable_arts_shared = xyes && test x$arts_lib != x; then
- echo "-- dynamic libartsc -> $arts_lib"
- AC_DEFINE_UNQUOTED(SDL_AUDIO_DRIVER_ARTS_DYNAMIC, "$arts_lib", [ ])
- SUMMARY_audio="${SUMMARY_audio} arts(dynamic)"
- else
- EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ARTS_LIBS"
- SUMMARY_audio="${SUMMARY_audio} arts"
- fi
- have_audio=yes
- fi
- fi
- fi
-}
-
-dnl See if the NAS audio interface is supported
-CheckNAS()
-{
- AC_ARG_ENABLE(nas,
-AC_HELP_STRING([--enable-nas], [support the NAS audio API [[default=yes]]]),
- , enable_nas=yes)
- if test x$enable_audio = xyes -a x$enable_nas = xyes; then
- AC_CHECK_HEADER(audio/audiolib.h, have_nas_hdr=yes)
- AC_CHECK_LIB(audio, AuOpenServer, have_nas_lib=yes)
-
- AC_MSG_CHECKING(for NAS audio support)
- have_nas=no
-
- if test x$have_nas_hdr = xyes -a x$have_nas_lib = xyes; then
- have_nas=yes
- NAS_LIBS="-laudio"
-
- elif test -r /usr/X11R6/include/audio/audiolib.h; then
- have_nas=yes
- NAS_CFLAGS="-I/usr/X11R6/include/"
- NAS_LIBS="-L/usr/X11R6/lib -laudio -lXt"
-
- fi
-
- AC_MSG_RESULT($have_nas)
-
- if test x$have_nas = xyes; then
- AC_ARG_ENABLE(nas-shared,
-AC_HELP_STRING([--enable-nas-shared], [dynamically load NAS audio support [[default=yes]]]),
- , enable_nas_shared=yes)
- nas_lib=[`find_lib "libaudio.so.*" "$NAS_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`]
-
- if test x$have_loadso != xyes && \
- test x$enable_nas_shared = xyes; then
- AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic NAS loading])
- fi
- if test x$have_loadso = xyes && \
- test x$enable_nas_shared = xyes && test x$nas_lib != x; then
- echo "-- dynamic libaudio -> $nas_lib"
- AC_DEFINE_UNQUOTED(SDL_AUDIO_DRIVER_NAS_DYNAMIC, "$nas_lib", [ ])
- SUMMARY_audio="${SUMMARY_audio} nas(dynamic)"
- else
- EXTRA_LDFLAGS="$EXTRA_LDFLAGS $NAS_LIBS"
- SUMMARY_audio="${SUMMARY_audio} nas"
- fi
-
- AC_DEFINE(SDL_AUDIO_DRIVER_NAS, 1, [ ])
- SOURCES="$SOURCES $srcdir/src/audio/nas/*.c"
- EXTRA_CFLAGS="$EXTRA_CFLAGS $NAS_CFLAGS"
- have_audio=yes
- fi
- fi
-}
-
-dnl See if the sndio audio interface is supported
-CheckSNDIO()
-{
- AC_ARG_ENABLE(sndio,
-AC_HELP_STRING([--enable-sndio], [support the sndio audio API [[default=yes]]]),
- , enable_sndio=yes)
- if test x$enable_audio = xyes -a x$enable_sndio = xyes; then
- AC_CHECK_HEADER(sndio.h, have_sndio_hdr=yes)
- AC_CHECK_LIB(sndio, sio_open, have_sndio_lib=yes)
-
- AC_MSG_CHECKING(for sndio audio support)
- have_sndio=no
-
- if test x$have_sndio_hdr = xyes -a x$have_sndio_lib = xyes; then
- have_sndio=yes
- SNDIO_LIBS="-lsndio"
- fi
-
- AC_MSG_RESULT($have_sndio)
-
- if test x$have_sndio = xyes; then
- AC_ARG_ENABLE(sndio-shared,
-AC_HELP_STRING([--enable-sndio-shared], [dynamically load sndio audio support [[default=yes]]]),
- , enable_sndio_shared=yes)
- sndio_lib=[`find_lib "libsndio.so.*" "$SNDIO_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`]
-
- if test x$have_loadso != xyes && \
- test x$enable_sndio_shared = xyes; then
- AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic sndio loading])
- fi
- if test x$have_loadso = xyes && \
- test x$enable_sndio_shared = xyes && test x$sndio_lib != x; then
- echo "-- dynamic libsndio -> $sndio_lib"
- AC_DEFINE_UNQUOTED(SDL_AUDIO_DRIVER_SNDIO_DYNAMIC, "$sndio_lib", [ ])
- SUMMARY_audio="${SUMMARY_audio} sndio(dynamic)"
- else
- EXTRA_LDFLAGS="$EXTRA_LDFLAGS $SNDIO_LIBS"
- SUMMARY_audio="${SUMMARY_audio} sndio"
- fi
-
- AC_DEFINE(SDL_AUDIO_DRIVER_SNDIO, 1, [ ])
- SOURCES="$SOURCES $srcdir/src/audio/sndio/*.c"
- EXTRA_CFLAGS="$EXTRA_CFLAGS $SNDIO_CFLAGS"
- have_audio=yes
- fi
- fi
-}
-
-dnl rcg07142001 See if the user wants the disk writer audio driver...
-CheckDiskAudio()
-{
- AC_ARG_ENABLE(diskaudio,
-AC_HELP_STRING([--enable-diskaudio], [support the disk writer audio driver [[default=yes]]]),
- , enable_diskaudio=yes)
- if test x$enable_audio = xyes -a x$enable_diskaudio = xyes; then
- AC_DEFINE(SDL_AUDIO_DRIVER_DISK, 1, [ ])
- SOURCES="$SOURCES $srcdir/src/audio/disk/*.c"
- SUMMARY_audio="${SUMMARY_audio} disk"
- fi
-}
-
-dnl rcg03142006 See if the user wants the dummy audio driver...
-CheckDummyAudio()
-{
- AC_ARG_ENABLE(dummyaudio,
-AC_HELP_STRING([--enable-dummyaudio], [support the dummy audio driver [[default=yes]]]),
- , enable_dummyaudio=yes)
- if test x$enable_audio = xyes -a x$enable_dummyaudio = xyes; then
- AC_DEFINE(SDL_AUDIO_DRIVER_DUMMY, 1, [ ])
- SOURCES="$SOURCES $srcdir/src/audio/dummy/*.c"
- SUMMARY_audio="${SUMMARY_audio} dummy"
- fi
-}
-
-dnl See if GCC's -fvisibility=hidden is supported (gcc4 and later, usually).
-dnl Details of this flag are here: http://gcc.gnu.org/wiki/Visibility
-CheckVisibilityHidden()
-{
- AC_MSG_CHECKING(for GCC -fvisibility=hidden option)
- have_gcc_fvisibility=no
-
- visibility_CFLAGS="-fvisibility=hidden"
- save_CFLAGS="$CFLAGS"
- CFLAGS="$save_CFLAGS $visibility_CFLAGS -Werror"
- AC_TRY_COMPILE([
- #if !defined(__GNUC__) || __GNUC__ < 4
- #error SDL only uses visibility attributes in GCC 4 or newer
- #endif
- ],[
- ],[
- have_gcc_fvisibility=yes
- ])
- AC_MSG_RESULT($have_gcc_fvisibility)
- CFLAGS="$save_CFLAGS"
-
- if test x$have_gcc_fvisibility = xyes; then
- EXTRA_CFLAGS="$EXTRA_CFLAGS $visibility_CFLAGS"
- fi
-}
-
-dnl See if GCC's -mpreferred-stack-boundary is supported.
-dnl Reference: http://bugzilla.libsdl.org/show_bug.cgi?id=1296
-CheckStackBoundary()
-{
- AC_MSG_CHECKING(for GCC -mpreferred-stack-boundary option)
- have_gcc_preferred_stack_boundary=no
-
- save_CFLAGS="$CFLAGS"
- CFLAGS="$save_CFLAGS -mpreferred-stack-boundary=2"
- AC_TRY_COMPILE([
- int x = 0;
- ],[
- ],[
- have_gcc_preferred_stack_boundary=yes
- ])
- AC_MSG_RESULT($have_gcc_preferred_stack_boundary)
- CFLAGS="$save_CFLAGS"
-
- if test x$have_gcc_preferred_stack_boundary = xyes; then
- EXTRA_CFLAGS="$EXTRA_CFLAGS -mpreferred-stack-boundary=2"
- fi
-}
-
-dnl See if GCC's -Wall is supported.
-CheckWarnAll()
-{
- AC_MSG_CHECKING(for GCC -Wall option)
- have_gcc_Wall=no
-
- save_CFLAGS="$CFLAGS"
- CFLAGS="$save_CFLAGS -Wall"
- AC_TRY_COMPILE([
- int x = 0;
- ],[
- ],[
- have_gcc_Wall=yes
- ])
- AC_MSG_RESULT($have_gcc_Wall)
- CFLAGS="$save_CFLAGS"
-
- if test x$have_gcc_Wall = xyes; then
- EXTRA_CFLAGS="$EXTRA_CFLAGS -Wall"
-
- dnl Haiku headers use multicharacter constants all over the place. Ignore these warnings when using -Wall.
- AC_MSG_CHECKING(for necessary GCC -Wno-multichar option)
- need_gcc_Wno_multichar=no
- case "$host" in
- *-*-haiku*)
- need_gcc_Wno_multichar=yes
- ;;
- esac
- AC_MSG_RESULT($need_gcc_Wno_multichar)
- if test x$need_gcc_Wno_multichar = xyes; then
- EXTRA_CFLAGS="$EXTRA_CFLAGS -Wno-multichar"
- fi
- fi
-}
-
-dnl Check for Wayland
-CheckWayland()
-{
- AC_ARG_ENABLE(video-wayland,
-AC_HELP_STRING([--enable-video-wayland], [use Wayland video driver [[default=yes]]]),
- ,enable_video_wayland=no) #yes)
-
- AC_ARG_ENABLE(video-wayland-qt-touch,
-AC_HELP_STRING([--enable-video-wayland-qt-touch], [QtWayland server support for Wayland video driver [[default=yes]]]),
- ,enable_video_wayland_qt_touch=yes)
-
- if test x$enable_video = xyes -a x$enable_video_wayland = xyes; then
- AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
- AC_MSG_CHECKING(for Wayland support)
- video_wayland=no
- if test x$PKG_CONFIG != xno; then
- if $PKG_CONFIG --exists wayland-client wayland-egl wayland-cursor egl xkbcommon ; then
- WAYLAND_CFLAGS=`$PKG_CONFIG --cflags wayland-client wayland-egl wayland-cursor xkbcommon`
- WAYLAND_LIBS=`$PKG_CONFIG --libs wayland-client wayland-egl wayland-cursor xkbcommon`
- video_wayland=yes
- fi
- fi
- AC_MSG_RESULT($video_wayland)
-
- if test x$video_wayland = xyes; then
- AC_DEFINE(SDL_VIDEO_DRIVER_WAYLAND, 1, [ ])
- if test x$enable_video_wayland_qt_touch = xyes; then
- AC_DEFINE(SDL_VIDEO_DRIVER_WAYLAND_QT_TOUCH, 1, [ ])
- fi
- SOURCES="$SOURCES $srcdir/src/video/wayland/*.c"
- EXTRA_CFLAGS="$EXTRA_CFLAGS $WAYLAND_CFLAGS"
- AC_ARG_ENABLE(wayland-shared,
-AC_HELP_STRING([--enable-wayland-shared], [dynamically load Wayland support [[default=maybe]]]),
- , enable_wayland_shared=maybe)
-
- dnl FIXME: Do BSD and OS X need special cases?
- case "$host" in
- *)
- wayland_client_lib=[`find_lib "libwayland-client.so.*" "$WAYLAND_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`]
- wayland_egl_lib=[`find_lib "libwayland-egl.so.*" "$WAYLAND_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`]
- if test x$wayland_egl_lib = x; then
- dnl This works in Ubuntu 13.10, maybe others
- wayland_egl_lib=[`find_lib "mesa-egl/libwayland-egl.so.*" "$WAYLAND_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`]
- fi
- wayland_cursor_lib=[`find_lib "libwayland-cursor.so.*" "$WAYLAND_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`]
- xkbcommon_lib=[`find_lib "libxkbcommon.so.*" "$WAYLAND_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`]
- ;;
- esac
-
- if test x$enable_wayland_shared = xmaybe; then
- enable_wayland_shared=yes
- fi
- if test x$have_loadso != xyes && \
- test x$enable_wayland_shared = xyes; then
- AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic Wayland loading])
- enable_wayland_shared=no
- fi
- if test x$have_loadso = xyes && \
- test x$enable_wayland_shared = xyes && \
- test x$wayland_client_lib != x && \
- test x$wayland_egl_lib != x && \
- test x$wayland_cursor_lib != x && \
- test x$xkbcommon_lib != x; then
- echo "-- dynamic libwayland-client -> $wayland_client_lib"
- echo "-- dynamic libwayland-egl -> $wayland_egl_lib"
- echo "-- dynamic libwayland-cursor -> $wayland_cursor_lib"
- echo "-- dynamic libxkbcommon -> $xkbcommon_lib"
- AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC, "$wayland_client_lib", [ ])
- AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_EGL, "$wayland_egl_lib", [ ])
- AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_CURSOR, "$wayland_cursor_lib", [ ])
- AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_XKBCOMMON, "$xkbcommon_lib", [ ])
- SUMMARY_video="${SUMMARY_video} wayland(dynamic)"
- else
- enable_wayland_shared=no
- EXTRA_LDFLAGS="$EXTRA_LDFLAGS $WAYLAND_LIBS"
- SUMMARY_video="${SUMMARY_video} wayland"
- fi
- have_video=yes
- fi
- fi
-}
-
-dnl Check for Mir
-CheckMir()
-{
- AC_ARG_ENABLE(video-mir,
-AC_HELP_STRING([--enable-video-mir], [use Mir video driver [[default=yes]]]),
- ,enable_video_mir=no) #yes)
-
- if test x$enable_video = xyes -a x$enable_video_mir = xyes; then
- AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
- AC_MSG_CHECKING(for Mir support)
- video_mir=no
- if test x$PKG_CONFIG != xno; then
- if $PKG_CONFIG --exists mirclient egl xkbcommon ; then
- MIR_CFLAGS=`$PKG_CONFIG --cflags mirclient egl xkbcommon`
- MIR_LIBS=`$PKG_CONFIG --libs mirclient egl xkbcommon`
- video_mir=yes
- fi
- fi
- AC_MSG_RESULT($video_mir)
-
- if test x$video_mir = xyes; then
- AC_DEFINE(SDL_VIDEO_DRIVER_MIR, 1, [ ])
- SOURCES="$SOURCES $srcdir/src/video/mir/*.c"
- EXTRA_CFLAGS="$EXTRA_CFLAGS $MIR_CFLAGS"
- AC_ARG_ENABLE(mir-shared,
-AC_HELP_STRING([--enable-mir-shared], [dynamically load Mir support [[default=maybe]]]),
- , enable_mir_shared=maybe)
-
- dnl FIXME: Do BSD and OS X need special cases?
- case "$host" in
- *)
- mirclient_lib=[`find_lib "libmirclient.so.*" "$MIR_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`]
- xkbcommon_lib=[`find_lib "libxkbcommon.so.*" "$MIR_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`]
- ;;
- esac
-
- if test x$enable_mir_shared = xmaybe; then
- enable_mir_shared=yes
- fi
- if test x$have_loadso != xyes && \
- test x$enable_mir_shared = xyes; then
- AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic Mir loading])
- enable_mir_shared=no
- fi
- if test x$have_loadso = xyes && \
- test x$enable_mir_shared = xyes && \
- test x$mirclient_lib != x && \
- test x$xkbcommon_lib != x; then
- echo "-- dynamic libmirclient -> $mirclient_lib"
- echo "-- dynamic libxkbcommon -> $xkbcommon_lib"
- AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_MIR_DYNAMIC, "$mirclient_lib", [ ])
- AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_MIR_DYNAMIC_XKBCOMMON, "$xkbcommon_lib", [ ])
- SUMMARY_video="${SUMMARY_video} mir(dynamic)"
- else
- enable_mir_shared=no
- EXTRA_LDFLAGS="$EXTRA_LDFLAGS $MIR_LIBS"
- SUMMARY_video="${SUMMARY_video} mir"
- fi
- have_video=yes
- fi
- fi
-}
-
-
-dnl Find the X11 include and library directories
-CheckX11()
-{
-
-
- AC_ARG_ENABLE(video-x11,
-AC_HELP_STRING([--enable-video-x11], [use X11 video driver [[default=yes]]]),
- , enable_video_x11=yes)
- if test x$enable_video = xyes -a x$enable_video_x11 = xyes; then
- case "$host" in
- *-*-darwin*)
- # This isn't necessary for X11, but fixes GLX detection
- if test "x$x_includes" = xNONE && \
- test "x$x_libraries" = xNONE && \
- test -d /usr/X11R6/include && \
- test -d /usr/X11R6/lib; then
- x_includes="/usr/X11R6/include"
- x_libraries="/usr/X11R6/lib"
- fi
- ;;
- esac
- AC_PATH_X
- AC_PATH_XTRA
- if test x$have_x = xyes; then
- AC_ARG_ENABLE(x11-shared,
-AC_HELP_STRING([--enable-x11-shared], [dynamically load X11 support [[default=maybe]]]),
- , enable_x11_shared=maybe)
-
- case "$host" in
- *-*-darwin*)
- x11_lib='/usr/X11R6/lib/libX11.6.dylib'
- x11ext_lib='/usr/X11R6/lib/libXext.6.dylib'
- xcursor_lib='/usr/X11R6/lib/libXcursor.1.dylib'
- xinerama_lib='/usr/X11R6/lib/libXinerama.1.dylib'
- xinput_lib='/usr/X11R6/lib/libXi.6.dylib'
- xrandr_lib='/usr/X11R6/lib/libXrandr.2.dylib'
- xrender_lib='/usr/X11R6/lib/libXrender.1.dylib'
- xss_lib='/usr/X11R6/lib/libXss.1.dylib'
- xvidmode_lib='/usr/X11R6/lib/libXxf86vm.1.dylib'
- ;;
- *-*-openbsd*)
- x11_lib='libX11.so'
- x11ext_lib='libXext.so'
- xcursor_lib='libXcursor.so'
- xinerama_lib='libXinerama.so'
- xinput_lib='libXi.so'
- xrandr_lib='libXrandr.so'
- xrender_lib='libXrender.so'
- xss_lib='libXss.so'
- xvidmode_lib='libXxf86vm.so'
- ;;
- *)
- x11_lib=[`find_lib "libX11.so.*" "$X_LIBS -L/usr/X11/$base_libdir -L/usr/X11R6/$base_libdir" | sed 's/.*\/\(.*\)/\1/; q'`]
- x11ext_lib=[`find_lib "libXext.so.*" "$X_LIBS -L/usr/X11/$base_libdir -L/usr/X11R6/$base_libdir" | sed 's/.*\/\(.*\)/\1/; q'`]
- xcursor_lib=[`find_lib "libXcursor.so.*" "$X_LIBS -L/usr/X11/$base_libdir -L/usr/X11R6/$base_libdir" | sed 's/.*\/\(.*\)/\1/; q'`]
- xinerama_lib=[`find_lib "libXinerama.so.*" "$X_LIBS -L/usr/X11/$base_libdir -L/usr/X11R6/$base_libdir" | sed 's/.*\/\(.*\)/\1/; q'`]
- xinput_lib=[`find_lib "libXi.so.*" "$X_LIBS -L/usr/X11/$base_libdir -L/usr/X11R6/$base_libdir" | sed 's/.*\/\(.*\)/\1/; q'`]
- xrandr_lib=[`find_lib "libXrandr.so.*" "$X_LIBS -L/usr/X11/$base_libdir -L/usr/X11R6/$base_libdir" | sed 's/.*\/\(.*\)/\1/; q'`]
- xrender_lib=[`find_lib "libXrender.so.*" "$X_LIBS -L/usr/X11/$base_libdir -L/usr/X11R6/$base_libdir" | sed 's/.*\/\(.*\)/\1/; q'`]
- xss_lib=[`find_lib "libXss.so.*" "$X_LIBS -L/usr/X11/$base_libdir -L/usr/X11R6/$base_libdir" | sed 's/.*\/\(.*\)/\1/; q'`]
- xvidmode_lib=[`find_lib "libXxf86vm.so.*" "$X_LIBS -L/usr/X11/$base_libdir -L/usr/X11R6/$base_libdir" | sed 's/.*\/\(.*\)/\1/; q'`]
- ;;
- esac
-
- if test x$ac_cv_func_shmat != xyes; then
- X_CFLAGS="$X_CFLAGS -DNO_SHARED_MEMORY"
- fi
- CFLAGS="$CFLAGS $X_CFLAGS"
- LDFLAGS="$LDFLAGS $X_LIBS"
-
- AC_CHECK_HEADER(X11/extensions/Xext.h,
- have_xext_h_hdr=yes,
- have_xext_h_hdr=no,
- [#include <X11/Xlib.h>
- #include <X11/Xproto.h>
- ])
- if test x$have_xext_h_hdr != xyes; then
- AC_MSG_ERROR([
-*** Missing Xext.h, maybe you need to install the libxext-dev package?
- ])
- fi
-
- AC_DEFINE(SDL_VIDEO_DRIVER_X11, 1, [ ])
- SOURCES="$SOURCES $srcdir/src/video/x11/*.c"
- EXTRA_CFLAGS="$EXTRA_CFLAGS $X_CFLAGS"
-
- # Needed so SDL applications can include SDL_syswm.h
- SDL_CFLAGS="$SDL_CFLAGS $X_CFLAGS"
-
- if test x$enable_x11_shared = xmaybe; then
- enable_x11_shared=yes
- fi
- if test x$have_loadso != xyes && \
- test x$enable_x11_shared = xyes; then
- AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic X11 loading])
- enable_x11_shared=no
- fi
- if test x$have_loadso = xyes && \
- test x$enable_x11_shared = xyes && test x$x11_lib != x && test x$x11ext_lib != x; then
- echo "-- dynamic libX11 -> $x11_lib"
- echo "-- dynamic libX11ext -> $x11ext_lib"
- AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_X11_DYNAMIC, "$x11_lib", [ ])
- AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_X11_DYNAMIC_XEXT, "$x11ext_lib", [ ])
- SUMMARY_video="${SUMMARY_video} x11(dynamic)"
- else
- enable_x11_shared=no
- EXTRA_LDFLAGS="$EXTRA_LDFLAGS $X_LIBS -lX11 -lXext"
- SUMMARY_video="${SUMMARY_video} x11"
- fi
- have_video=yes
-
- AC_MSG_CHECKING(for const parameter to XextAddDisplay)
- have_const_param_XextAddDisplay=no
- AC_TRY_COMPILE([
- #include <X11/Xlib.h>
- #include <X11/Xproto.h>
- #include <X11/extensions/Xext.h>
- #include <X11/extensions/extutil.h>
- extern XExtDisplayInfo* XextAddDisplay(XExtensionInfo* a,Display* b,_Xconst char* c,XExtensionHooks* d,int e,XPointer f);
- ],[
- ],[
- have_const_param_XextAddDisplay=yes
- AC_DEFINE(SDL_VIDEO_DRIVER_X11_CONST_PARAM_XEXTADDDISPLAY)
- ])
- AC_MSG_RESULT($have_const_param_XextAddDisplay)
-
- AC_MSG_CHECKING(for const parameter to _XData32)
- have_const_param_xdata32=no
- AC_TRY_COMPILE([
- #include <X11/Xlibint.h>
- extern int _XData32(Display *dpy,register _Xconst long *data,unsigned len);
- ],[
- ],[
- have_const_param_xdata32=yes
- AC_DEFINE(SDL_VIDEO_DRIVER_X11_CONST_PARAM_XDATA32)
- ])
- AC_MSG_RESULT($have_const_param_xdata32)
-
- dnl AC_CHECK_LIB(X11, XGetEventData, AC_DEFINE(SDL_VIDEO_DRIVER_X11_SUPPORTS_GENERIC_EVENTS, 1, [Have XGenericEvent]))
- AC_MSG_CHECKING([for XGenericEvent])
- have_XGenericEvent=no
- AC_TRY_COMPILE([
- #include <X11/Xlib.h>
- ],[
-Display *display;
-XEvent event;
-XGenericEventCookie *cookie = &event.xcookie;
-XNextEvent(display, &event);
-XGetEventData(display, cookie);
-XFreeEventData(display, cookie);
- ],[
- have_XGenericEvent=yes
- AC_DEFINE(SDL_VIDEO_DRIVER_X11_SUPPORTS_GENERIC_EVENTS)
- ])
- AC_MSG_RESULT($have_XGenericEvent)
-
- AC_CHECK_LIB(X11, XkbKeycodeToKeysym, AC_DEFINE(SDL_VIDEO_DRIVER_X11_HAS_XKBKEYCODETOKEYSYM, 1, [Have XkbKeycodeToKeysym]))
-
- AC_ARG_ENABLE(video-x11-xcursor,
-AC_HELP_STRING([--enable-video-x11-xcursor], [enable X11 Xcursor support [[default=yes]]]),
- , enable_video_x11_xcursor=yes)
- if test x$enable_video_x11_xcursor = xyes; then
- definitely_enable_video_x11_xcursor=no
- AC_CHECK_HEADER(X11/Xcursor/Xcursor.h,
- have_xcursor_h_hdr=yes,
- have_xcursor_h_hdr=no,
- [#include <X11/Xlib.h>
- ])
- if test x$have_xcursor_h_hdr = xyes; then
- if test x$enable_x11_shared = xyes && test x$xcursor_lib != x ; then
- echo "-- dynamic libXcursor -> $xcursor_lib"
- AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_X11_DYNAMIC_XCURSOR, "$xcursor_lib", [ ])
- definitely_enable_video_x11_xcursor=yes
- else
- AC_CHECK_LIB(Xcursor, XcursorImageCreate, have_xcursor_lib=yes)
- if test x$have_xcursor_lib = xyes ; then
- EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lXcursor"
- definitely_enable_video_x11_xcursor=yes
- fi
- fi
- fi
- fi
- if test x$definitely_enable_video_x11_xcursor = xyes; then
- AC_DEFINE(SDL_VIDEO_DRIVER_X11_XCURSOR, 1, [ ])
- SUMMARY_video_x11="${SUMMARY_video_x11} xcursor"
- fi
- AC_ARG_ENABLE(video-x11-xinerama,
-AC_HELP_STRING([--enable-video-x11-xinerama], [enable X11 Xinerama support [[default=yes]]]),
- , enable_video_x11_xinerama=yes)
- if test x$enable_video_x11_xinerama = xyes; then
- definitely_enable_video_x11_xinerama=no
- AC_CHECK_HEADER(X11/extensions/Xinerama.h,
- have_xinerama_h_hdr=yes,
- have_xinerama_h_hdr=no,
- [#include <X11/Xlib.h>
- ])
- if test x$have_xinerama_h_hdr = xyes; then
- if test x$enable_x11_shared = xyes && test x$xinerama_lib != x ; then
- echo "-- dynamic libXinerama -> $xinerama_lib"
- AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_X11_DYNAMIC_XINERAMA, "$xinerama_lib", [ ])
- definitely_enable_video_x11_xinerama=yes
- else
- AC_CHECK_LIB(Xinerama, XineramaQueryExtension, have_xinerama_lib=yes)
- if test x$have_xinerama_lib = xyes ; then
- EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lXinerama"
- definitely_enable_video_x11_xinerama=yes
- fi
- fi
- fi
- fi
- if test x$definitely_enable_video_x11_xinerama = xyes; then
- AC_DEFINE(SDL_VIDEO_DRIVER_X11_XINERAMA, 1, [ ])
- SUMMARY_video_x11="${SUMMARY_video_x11} xinerama"
- fi
- AC_ARG_ENABLE(video-x11-xinput,
-AC_HELP_STRING([--enable-video-x11-xinput], [enable X11 XInput extension for manymouse, tablets, etc [[default=yes]]]),
- , enable_video_x11_xinput=yes)
- if test x$enable_video_x11_xinput = xyes; then
- definitely_enable_video_x11_xinput=no
- AC_CHECK_HEADER(X11/extensions/XInput2.h,
- have_xinput_h_hdr=yes,
- have_xinput_h_hdr=no,
- [#include <X11/Xlib.h>
- ])
- if test x$have_xinput_h_hdr = xyes; then
- if test x$enable_x11_shared = xyes && test x$xinput_lib != x ; then
- echo "-- dynamic libXi -> $xinput_lib"
- AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_X11_DYNAMIC_XINPUT2, "$xinput_lib", [ ])
- definitely_enable_video_x11_xinput=yes
- else
- AC_CHECK_LIB(Xi, XOpenDevice, have_xinput_lib=yes)
- if test x$have_xinput_lib = xyes ; then
- EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lXi"
- definitely_enable_video_x11_xinput=yes
- fi
- fi
- fi
- fi
- if test x$definitely_enable_video_x11_xinput = xyes; then
- SUMMARY_video_x11="${SUMMARY_video_x11} xinput2"
- AC_DEFINE(SDL_VIDEO_DRIVER_X11_XINPUT2, 1, [ ])
- AC_MSG_CHECKING(for xinput2 multitouch)
- have_xinput2_multitouch=no
- AC_TRY_COMPILE([
- #include <X11/Xlib.h>
- #include <X11/Xproto.h>
- #include <X11/extensions/XInput2.h>
- ],[
-int event_type = XI_TouchBegin;
-XITouchClassInfo *t;
- ],[
- have_xinput2_multitouch=yes
- AC_DEFINE(SDL_VIDEO_DRIVER_X11_XINPUT2_SUPPORTS_MULTITOUCH)
- SUMMARY_video_x11="${SUMMARY_video_x11} xinput2_multitouch"
- ])
- AC_MSG_RESULT($have_xinput2_multitouch)
- fi
- AC_ARG_ENABLE(video-x11-xrandr,
-AC_HELP_STRING([--enable-video-x11-xrandr], [enable X11 Xrandr extension for fullscreen [[default=yes]]]),
- , enable_video_x11_xrandr=yes)
- if test x$enable_video_x11_xrandr = xyes; then
- dnl XRRScreenResources is only present in Xrandr >= 1.2, we use that as a test.
- definitely_enable_video_x11_xrandr=no
- have_xrandr_h_hdr=no
- AC_TRY_COMPILE([
- #include <X11/Xlib.h>
- #include <X11/extensions/Xrandr.h>
- ],[
- XRRScreenResources *res = NULL;
- ],[
- have_xrandr_h_hdr=yes
- ])
- if test x$have_xrandr_h_hdr = xyes; then
- if test x$enable_x11_shared = xyes && test x$xrandr_lib != x ; then
- echo "-- dynamic libXrandr -> $xrandr_lib"
- AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_X11_DYNAMIC_XRANDR, "$xrandr_lib", [ ])
- definitely_enable_video_x11_xrandr=yes
- else
- AC_CHECK_LIB(Xrandr, XRRQueryExtension, have_xrandr_lib=yes)
- if test x$have_xrandr_lib = xyes ; then
- EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lXrandr"
- definitely_enable_video_x11_xrandr=yes
- fi
- fi
- fi
- fi
- if test x$definitely_enable_video_x11_xrandr = xyes; then
- AC_DEFINE(SDL_VIDEO_DRIVER_X11_XRANDR, 1, [ ])
- SUMMARY_video_x11="${SUMMARY_video_x11} xrandr"
- fi
- AC_ARG_ENABLE(video-x11-scrnsaver,
-AC_HELP_STRING([--enable-video-x11-scrnsaver], [enable X11 screensaver extension [[default=yes]]]),
- , enable_video_x11_scrnsaver=yes)
- if test x$enable_video_x11_scrnsaver = xyes; then
- AC_CHECK_HEADER(X11/extensions/scrnsaver.h,
- have_scrnsaver_h_hdr=yes,
- have_scrnsaver_h_hdr=no,
- [#include <X11/Xlib.h>
- ])
- if test x$have_scrnsaver_h_hdr = xyes; then
- if test x$enable_x11_shared = xyes && test x$xss_lib != x ; then
- echo "-- dynamic libXss -> $xss_lib"
- AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_X11_DYNAMIC_XSS, "$xss_lib", [ ])
- definitely_enable_video_x11_scrnsaver=yes
- else
- AC_CHECK_LIB(Xss, XScreenSaverSuspend, have_xss_lib=yes)
- if test x$have_xss_lib = xyes ; then
- EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lXss"
- definitely_enable_video_x11_scrnsaver=yes
- fi
- fi
- fi
- fi
- if test x$definitely_enable_video_x11_scrnsaver = xyes; then
- AC_DEFINE(SDL_VIDEO_DRIVER_X11_XSCRNSAVER, 1, [ ])
- SUMMARY_video_x11="${SUMMARY_video_x11} xscrnsaver"
- fi
- AC_ARG_ENABLE(video-x11-xshape,
-AC_HELP_STRING([--enable-video-x11-xshape], [enable X11 XShape support [[default=yes]]]),
- , enable_video_x11_xshape=yes)
- if test x$enable_video_x11_xshape = xyes; then
- AC_CHECK_HEADER(X11/extensions/shape.h,
- have_shape_h_hdr=yes,
- have_shape_h_hdr=no,
- [#include <X11/Xlib.h>
- ])
- if test x$have_shape_h_hdr = xyes; then
- AC_DEFINE(SDL_VIDEO_DRIVER_X11_XSHAPE, 1, [ ])
- SUMMARY_video_x11="${SUMMARY_video_x11} xshape"
- fi
- fi
- AC_ARG_ENABLE(video-x11-vm,
-AC_HELP_STRING([--enable-video-x11-vm], [use X11 VM extension for fullscreen [[default=yes]]]),
- , enable_video_x11_vm=yes)
- if test x$enable_video_x11_vm = xyes; then
- definitely_enable_video_x11_vm=no
- AC_CHECK_HEADER(X11/extensions/xf86vmode.h,
- have_vm_h_hdr=yes,
- have_vm_h_hdr=no,
- [#include <X11/Xlib.h>
- ])
- if test x$have_vm_h_hdr = xyes; then
- if test x$enable_x11_shared = xyes && test x$xvidmode_lib != x ; then
- echo "-- dynamic libXxf86vm -> $xvidmode_lib"
- AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_X11_DYNAMIC_XVIDMODE, "$xvidmode_lib", [ ])
- definitely_enable_video_x11_vm=yes
- else
- AC_CHECK_LIB(Xxf86vm, XF86VidModeQueryVersion, have_vm_lib=yes)
- if test x$have_vm_lib = xyes ; then
- EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lXxf86vm"
- definitely_enable_video_x11_vm=yes
- fi
- fi
- fi
- fi
- if test x$definitely_enable_video_x11_vm = xyes; then
- AC_DEFINE(SDL_VIDEO_DRIVER_X11_XVIDMODE, 1, [ ])
- SUMMARY_video_x11="${SUMMARY_video_x11} xvidmode"
- fi
- fi
- fi
-}
-
-dnl Set up the Haiku video driver if enabled
-CheckHaikuVideo()
-{
- if test x$enable_video = xyes; then
- AC_DEFINE(SDL_VIDEO_DRIVER_HAIKU, 1, [ ])
- SOURCES="$SOURCES $srcdir/src/video/haiku/*.cc"
- have_video=yes
- SUMMARY_video="${SUMMARY_video} haiku"
- fi
-}
-
-dnl Set up the Cocoa video driver for Mac OS X (but not Darwin)
-CheckCOCOA()
-{
- AC_ARG_ENABLE(video-cocoa,
-AC_HELP_STRING([--enable-video-cocoa], [use Cocoa video driver [[default=yes]]]),
- , enable_video_cocoa=yes)
- if test x$enable_video = xyes -a x$enable_video_cocoa = xyes; then
- save_CFLAGS="$CFLAGS"
- dnl work around that we don't have Objective-C support in autoconf
- CFLAGS="$CFLAGS -x objective-c"
- AC_MSG_CHECKING(for Cocoa framework)
- have_cocoa=no
- AC_TRY_COMPILE([
- #import <Cocoa/Cocoa.h>
- ],[
- ],[
- have_cocoa=yes
- ])
- AC_MSG_RESULT($have_cocoa)
- CFLAGS="$save_CFLAGS"
- if test x$have_cocoa = xyes; then
- AC_DEFINE(SDL_VIDEO_DRIVER_COCOA, 1, [ ])
- SOURCES="$SOURCES $srcdir/src/video/cocoa/*.m"
- SUMMARY_video="${SUMMARY_video} cocoa"
- have_video=yes
- fi
- fi
-}
-
-dnl Find DirectFB
-CheckDirectFB()
-{
- AC_ARG_ENABLE(video-directfb,
-AC_HELP_STRING([--enable-video-directfb], [use DirectFB video driver [[default=no]]]),
- , enable_video_directfb=no)
- if test x$enable_video = xyes -a x$enable_video_directfb = xyes; then
- video_directfb=no
-
- DIRECTFB_REQUIRED_VERSION=1.0.0
- AC_PATH_PROGS(DIRECTFBCONFIG, directfb-config, no, [$prefix/bin:$PATH])
- if test x$DIRECTFBCONFIG = xno; then
- AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
- if test x$PKG_CONFIG != xno; then
- if $PKG_CONFIG --atleast-pkgconfig-version 0.7 && $PKG_CONFIG --atleast-version $DIRECTFB_REQUIRED_VERSION directfb; then
- DIRECTFB_CFLAGS=`$PKG_CONFIG --cflags directfb`
- DIRECTFB_LIBS=`$PKG_CONFIG --libs directfb`
- DIRECTFB_PREFIX=`$PKG_CONFIG --variable=prefix directfb`
- video_directfb=yes
- fi
- fi
- else
- set -- `echo $DIRECTFB_REQUIRED_VERSION | sed 's/\./ /g'`
- NEED_VERSION=`expr $1 \* 10000 + $2 \* 100 + $3`
- set -- `$DIRECTFBCONFIG --version | sed 's/\./ /g'`
- HAVE_VERSION=`expr $1 \* 10000 + $2 \* 100 + $3`
- if test $HAVE_VERSION -ge $NEED_VERSION; then
- DIRECTFB_CFLAGS=`$DIRECTFBCONFIG --cflags`
- DIRECTFB_LIBS=`$DIRECTFBCONFIG --libs`
- DIRECTFB_PREFIX=`$DIRECTFBCONFIG --prefix`
- video_directfb=yes
- fi
- fi
- if test x$video_directfb = xyes; then
- # SuSE 11.1 installs directfb-config without directfb-devel
- save_CPPFLAGS="$CPPFLAGS"
- CPPFLAGS="$CPPFLAGS $DIRECTFB_CFLAGS"
- AC_CHECK_HEADER(directfb.h, have_directfb_hdr=yes, have_directfb_hdr=no)
- CPPFLAGS="$save_CPPFLAGS"
- video_directfb=$have_directfb_hdr
- fi
- AC_MSG_CHECKING(for DirectFB $DIRECTFB_REQUIRED_VERSION support)
- AC_MSG_RESULT($video_directfb)
-
- if test x$video_directfb = xyes; then
- AC_ARG_ENABLE(directfb-shared,
-AC_HELP_STRING([--enable-directfb-shared], [dynamically load directfb support [[default=yes]]]),
- , enable_directfb_shared=yes)
-
- AC_DEFINE(SDL_VIDEO_DRIVER_DIRECTFB, 1, [ ])
- AC_DEFINE(SDL_VIDEO_RENDER_DIRECTFB, 1, [ ])
- SOURCES="$SOURCES $srcdir/src/video/directfb/*.c"
- EXTRA_CFLAGS="$EXTRA_CFLAGS $DIRECTFB_CFLAGS"
-
- AC_MSG_CHECKING(for directfb dynamic loading support)
- directfb_shared=no
- directfb_lib=[`find_lib "libdirectfb.so.*" "$DIRECTFB_LIBS"`]
- # | sed 's/.*\/\(.*\)/\1/; q'`]
-AC_MSG_WARN("directfb $directfb_lib")
- if test x$have_loadso != xyes && \
- test x$enable_directfb_shared = xyes; then
- AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic directfb loading])
- fi
- if test x$have_loadso = xyes && \
- test x$enable_directfb_shared = xyes && test x$directfb_lib != x; then
- directfb_shared=yes
- echo "-- $directfb_lib_spec -> $directfb_lib"
- AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_DIRECTFB_DYNAMIC, "$directfb_lib", [ ])
- SUMMARY_video="${SUMMARY_video} directfb(dynamic)"
- else
- EXTRA_LDFLAGS="$EXTRA_LDFLAGS $DIRECTFB_LIBS"
- SUMMARY_video="${SUMMARY_video} directfb"
- fi
- AC_MSG_RESULT($directfb_shared)
- have_video=yes
- fi
- fi
-}
-
-dnl Find FusionSound
-CheckFusionSound()
-{
- AC_ARG_ENABLE(fusionsound,
-AC_HELP_STRING([--enable-fusionsound], [use FusionSound audio driver [[default=no]]]),
- , enable_fusionsound=no)
- if test x$enable_audio = xyes -a x$enable_fusionsound = xyes; then
- fusionsound=no
-
- FUSIONSOUND_REQUIRED_VERSION=1.1.1
-
- AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
- AC_MSG_CHECKING(for FusionSound $FUSIONSOUND_REQUIRED_VERSION support)
- if test x$PKG_CONFIG != xno; then
- if $PKG_CONFIG --atleast-pkgconfig-version 0.7 && $PKG_CONFIG --atleast-version $FUSIONSOUND_REQUIRED_VERSION fusionsound; then
- FUSIONSOUND_CFLAGS=`$PKG_CONFIG --cflags fusionsound`
- FUSIONSOUND_LIBS=`$PKG_CONFIG --libs fusionsound`
- fusionsound=yes
- fi
- fi
- AC_MSG_RESULT($fusionsound)
-
- if test x$fusionsound = xyes; then
- AC_DEFINE(SDL_AUDIO_DRIVER_FUSIONSOUND, 1, [ ])
- SOURCES="$SOURCES $srcdir/src/audio/fusionsound/*.c"
- EXTRA_CFLAGS="$EXTRA_CFLAGS $FUSIONSOUND_CFLAGS"
-
- AC_ARG_ENABLE(fusionsound-shared,
-AC_HELP_STRING([--enable-fusionsound-shared], [dynamically load fusionsound audio support [[default=yes]]]),
- , enable_fusionsound_shared=yes)
- fusionsound_shared=no
- AC_MSG_CHECKING(for FusionSound dynamic loading support)
- if test x$have_loadso != xyes && \
- test x$enable_fusionsound_shared = xyes; then
- AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic fusionsound loading])
- fi
- if test x$have_loadso = xyes && \
- test x$enable_fusionsound_shared = xyes; then
- AC_DEFINE_UNQUOTED(SDL_AUDIO_DRIVER_FUSIONSOUND_DYNAMIC, "libfusionsound.so", [ ])
- fusionsound_shared=yes
- SUMMARY_audio="${SUMMARY_audio} fusionsound(dynamic)"
- else
- EXTRA_LDFLAGS="$EXTRA_LDFLAGS $FUSIONSOUND_LIBS"
- SUMMARY_audio="${SUMMARY_audio} fusionsound"
- fi
- AC_MSG_RESULT($fusionsound_shared)
-
- have_audio=yes
- fi
- fi
-}
-
-dnl rcg04172001 Set up the Null video driver.
-CheckDummyVideo()
-{
- AC_ARG_ENABLE(video-dummy,
-AC_HELP_STRING([--enable-video-dummy], [use dummy video driver [[default=yes]]]),
- , enable_video_dummy=yes)
- if test x$enable_video_dummy = xyes; then
- AC_DEFINE(SDL_VIDEO_DRIVER_DUMMY, 1, [ ])
- SOURCES="$SOURCES $srcdir/src/video/dummy/*.c"
- have_video=yes
- SUMMARY_video="${SUMMARY_video} dummy"
- fi
-}
-
-dnl Check to see if OpenGL support is desired
-AC_ARG_ENABLE(video-opengl,
-AC_HELP_STRING([--enable-video-opengl], [include OpenGL support [[default=yes]]]),
- , enable_video_opengl=yes)
-
-dnl Find OpenGL
-CheckOpenGLX11()
-{
- if test x$enable_video = xyes -a x$enable_video_opengl = xyes; then
- AC_MSG_CHECKING(for OpenGL (GLX) support)
- video_opengl=no
- AC_TRY_COMPILE([
- #include <GL/gl.h>
- #include <GL/glx.h>
- ],[
- ],[
- video_opengl=yes
- ])
- AC_MSG_RESULT($video_opengl)
- if test x$video_opengl = xyes; then
- AC_DEFINE(SDL_VIDEO_OPENGL, 1, [ ])
- AC_DEFINE(SDL_VIDEO_OPENGL_GLX, 1, [ ])
- AC_DEFINE(SDL_VIDEO_RENDER_OGL, 1, [ ])
- SUMMARY_video="${SUMMARY_video} opengl"
- fi
- fi
-}
-
-dnl Check to see if OpenGL ES support is desired
-AC_ARG_ENABLE(video-opengles,
-AC_HELP_STRING([--enable-video-opengles], [include OpenGL ES support [[default=yes]]]),
- , enable_video_opengles=yes)
-
-dnl Find OpenGL ES
-CheckOpenGLESX11()
-{
- if test x$enable_video = xyes -a x$enable_video_opengles = xyes; then
- AC_MSG_CHECKING(for EGL support)
- video_opengl_egl=no
- AC_TRY_COMPILE([
- #include <EGL/egl.h>
- ],[
- ],[
- video_opengl_egl=yes
- ])
- AC_MSG_RESULT($video_opengl_egl)
- if test x$video_opengl_egl = xyes; then
- AC_DEFINE(SDL_VIDEO_OPENGL_EGL, 1, [ ])
- fi
-
- AC_MSG_CHECKING(for OpenGL ES v1 headers)
- video_opengles_v1=no
- AC_TRY_COMPILE([
- #include <GLES/gl.h>
- #include <GLES/glext.h>
- ],[
- ],[
- video_opengles_v1=yes
- ])
- AC_MSG_RESULT($video_opengles_v1)
- if test x$video_opengles_v1 = xyes; then
- AC_DEFINE(SDL_VIDEO_OPENGL_ES, 1, [ ])
- AC_DEFINE(SDL_VIDEO_RENDER_OGL_ES, 1, [ ])
- SUMMARY_video="${SUMMARY_video} opengl_es1"
- fi
-
- AC_MSG_CHECKING(for OpenGL ES v2 headers)
- video_opengles_v2=no
- AC_TRY_COMPILE([
- #include <GLES2/gl2.h>
- #include <GLES2/gl2ext.h>
- ],[
- ],[
- video_opengles_v2=yes
- ])
- AC_MSG_RESULT($video_opengles_v2)
- if test x$video_opengles_v2 = xyes; then
- AC_DEFINE(SDL_VIDEO_OPENGL_ES2, 1, [ ])
- AC_DEFINE(SDL_VIDEO_RENDER_OGL_ES2, 1, [ ])
- SUMMARY_video="${SUMMARY_video} opengl_es2"
- fi
- fi
-}
-
-dnl Check for Windows OpenGL
-CheckWINDOWSGL()
-{
- if test x$enable_video = xyes -a x$enable_video_opengl = xyes; then
- AC_DEFINE(SDL_VIDEO_OPENGL, 1, [ ])
- AC_DEFINE(SDL_VIDEO_OPENGL_WGL, 1, [ ])
- AC_DEFINE(SDL_VIDEO_RENDER_OGL, 1, [ ])
- SUMMARY_video="${SUMMARY_video} opengl"
- fi
-}
-
-dnl Check for Windows OpenGL
-CheckWINDOWSGLES()
-{
- if test x$enable_video = xyes -a x$enable_video_opengles = xyes; then
-
- AC_MSG_CHECKING(for EGL support)
- video_opengl_egl=no
- AC_TRY_COMPILE([
- #include <EGL/egl.h>
- ],[
- ],[
- video_opengl_egl=yes
- ])
- AC_MSG_RESULT($video_opengl_egl)
- if test x$video_opengl_egl = xyes; then
- AC_DEFINE(SDL_VIDEO_OPENGL, 1, [ ])
- AC_DEFINE(SDL_VIDEO_OPENGL_EGL, 1, [ ])
- SUMMARY_video="${SUMMARY_video} opengl_es1"
- fi
-
- AC_MSG_CHECKING(for OpenGL ES v2 headers)
- video_opengles_v2=no
- AC_TRY_COMPILE([
- #include <GLES2/gl2.h>
- #include <GLES2/gl2ext.h>
- ],[
- ],[
- video_opengles_v2=yes
- ])
- AC_MSG_RESULT($video_opengles_v2)
- if test x$video_opengles_v2 = xyes; then
- AC_DEFINE(SDL_VIDEO_OPENGL, 1, [ ])
- AC_DEFINE(SDL_VIDEO_OPENGL_ES2, 1, [ ])
- AC_DEFINE(SDL_VIDEO_RENDER_OGL_ES2, 1, [ ])
- SUMMARY_video="${SUMMARY_video} opengl_es2"
- fi
- fi
-}
-
-dnl Check for Haiku OpenGL
-CheckHaikuGL()
-{
- if test x$enable_video = xyes -a x$enable_video_opengl = xyes; then
- AC_DEFINE(SDL_VIDEO_OPENGL, 1, [ ])
- AC_DEFINE(SDL_VIDEO_OPENGL_HAIKU, 1, [ ])
- AC_DEFINE(SDL_VIDEO_RENDER_OGL, 1, [ ])
- EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lGL"
- SUMMARY_video="${SUMMARY_video} opengl"
- fi
-}
-
-dnl Check for MacOS OpenGL
-CheckMacGL()
-{
- if test x$enable_video = xyes -a x$enable_video_opengl = xyes; then
- AC_DEFINE(SDL_VIDEO_OPENGL, 1, [ ])
- AC_DEFINE(SDL_VIDEO_OPENGL_CGL, 1, [ ])
- AC_DEFINE(SDL_VIDEO_RENDER_OGL, 1, [ ])
- SUMMARY_video="${SUMMARY_video} opengl"
- case "$host" in
- *-*-darwin*)
- if test x$enable_video_cocoa = xyes; then
- EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,OpenGL"
- fi
- esac
- fi
-}
-
-dnl See if we can use the new unified event interface in Linux 2.4
-CheckInputEvents()
-{
- dnl Check for Linux 2.4 unified input event interface support
- AC_MSG_CHECKING(for Linux 2.4 unified input interface)
- use_input_events=no
- AC_TRY_COMPILE([
- #include <linux/input.h>
- ],[
- #ifndef EVIOCGNAME
- #error EVIOCGNAME() ioctl not available
- #endif
- ],[
- use_input_events=yes
- ])
- AC_MSG_RESULT($use_input_events)
- if test x$use_input_events = xyes; then
- AC_DEFINE(SDL_INPUT_LINUXEV, 1, [ ])
- SUMMARY_input="${SUMMARY_input} linuxev"
- fi
-}
-
-dnl See if we can use the kernel kd.h header
-CheckInputKD()
-{
-
- AC_MSG_CHECKING(for Linux kd.h)
- use_input_kd=no
- AC_TRY_COMPILE([
- #include <linux/kd.h>
- #include <linux/keyboard.h>
- ],[
- struct kbentry kbe;
- kbe.kb_table = KG_CTRL;
- ioctl(0, KDGKBENT, &kbe);
- ],[
- use_input_kd=yes
- ])
- AC_MSG_RESULT($use_input_kd)
- if test x$use_input_kd = xyes; then
- AC_DEFINE(SDL_INPUT_LINUXKD, 1, [ ])
- SUMMARY_input="${SUMMARY_input} linuxkd"
- fi
-}
-
-dnl See if the platform offers libudev for device enumeration and hotplugging.
-CheckLibUDev()
-{
- AC_ARG_ENABLE(libudev,
-AC_HELP_STRING([--enable-libudev], [enable libudev support [[default=yes]]]),
- , enable_libudev=yes)
- if test x$enable_libudev = xyes; then
- AC_CHECK_HEADER(libudev.h,
- have_libudev_h_hdr=yes,
- have_libudev_h_hdr=no)
- if test x$have_libudev_h_hdr = xyes; then
- AC_DEFINE(HAVE_LIBUDEV_H, 1, [ ])
- fi
- fi
-}
-
-dnl See if the platform offers libdbus for various IPC techniques.
-CheckDBus()
-{
- AC_ARG_ENABLE(dbus,
-AC_HELP_STRING([--enable-dbus], [enable D-Bus support [[default=yes]]]),
- , enable_dbus=yes)
- if test x$enable_dbus = xyes; then
- AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
- if test x$PKG_CONFIG != xno; then
- DBUS_CFLAGS=`$PKG_CONFIG --cflags dbus-1`
- save_CFLAGS="$CFLAGS"
- CFLAGS="$save_CFLAGS $DBUS_CFLAGS"
- AC_CHECK_HEADER(dbus/dbus.h,
- have_dbus_dbus_h_hdr=yes,
- have_dbus_dbus_h_hdr=no)
- CFLAGS="$save_CFLAGS"
- if test x$have_dbus_dbus_h_hdr = xyes; then
- AC_DEFINE(HAVE_DBUS_DBUS_H, 1, [ ])
- EXTRA_CFLAGS="$EXTRA_CFLAGS $DBUS_CFLAGS"
- fi
- fi
- fi
-}
-
-dnl See if we can use the Touchscreen input library
-CheckTslib()
-{
- AC_ARG_ENABLE(input-tslib,
-AC_HELP_STRING([--enable-input-tslib], [use the Touchscreen library for input [[default=yes]]]),
- , enable_input_tslib=yes)
- if test x$enable_input_tslib = xyes; then
- AC_MSG_CHECKING(for Touchscreen library support)
- enable_input_tslib=no
- AC_TRY_COMPILE([
- #include "tslib.h"
- ],[
- ],[
- enable_input_tslib=yes
- ])
- AC_MSG_RESULT($enable_input_tslib)
- if test x$enable_input_tslib = xyes; then
- AC_DEFINE(SDL_INPUT_TSLIB, 1, [ ])
- EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lts"
- SUMMARY_input="${SUMMARY_input} ts"
- fi
- fi
-}
-
-dnl See what type of thread model to use on Linux and Solaris
-CheckPTHREAD()
-{
- dnl Check for pthread support
- AC_ARG_ENABLE(pthreads,
-AC_HELP_STRING([--enable-pthreads], [use POSIX threads for multi-threading [[default=yes]]]),
- , enable_pthreads=yes)
- dnl This is used on Linux for glibc binary compatibility (Doh!)
- AC_ARG_ENABLE(pthread-sem,
-AC_HELP_STRING([--enable-pthread-sem], [use pthread semaphores [[default=yes]]]),
- , enable_pthread_sem=yes)
- case "$host" in
- *-*-linux*|*-*-uclinux*)
- pthread_cflags="-D_REENTRANT"
- pthread_lib="-lpthread"
- ;;
- *-*-bsdi*)
- pthread_cflags="-D_REENTRANT -D_THREAD_SAFE"
- pthread_lib=""
- ;;
- *-*-darwin*)
- pthread_cflags="-D_THREAD_SAFE"
-# causes Carbon.p complaints?
-# pthread_cflags="-D_REENTRANT -D_THREAD_SAFE"
- ;;
- *-*-freebsd*|*-*-dragonfly*)
- pthread_cflags="-D_REENTRANT -D_THREAD_SAFE"
- pthread_lib="-pthread"
- ;;
- *-*-netbsd*)
- pthread_cflags="-D_REENTRANT -D_THREAD_SAFE"
- pthread_lib="-lpthread"
- ;;
- *-*-openbsd*)
- pthread_cflags="-D_REENTRANT"
- pthread_lib="-pthread"
- ;;
- *-*-solaris2.9)
- # From Solaris 9+, posix4's preferred name is rt.
- pthread_cflags="-D_REENTRANT"
- pthread_lib="-lpthread -lrt"
- ;;
- *-*-solaris2.10)
- # Solaris 10+ merged pthread into libc.
- pthread_cflags="-D_REENTRANT"
- pthread_lib="-lrt"
- ;;
- *-*-solaris*)
- # Solaris 11+ merged rt into libc.
- pthread_cflags="-D_REENTRANT"
- pthread_lib=""
- ;;
- *-*-sysv5*)
- pthread_cflags="-D_REENTRANT -Kthread"
- pthread_lib=""
- ;;
- *-*-aix*)
- pthread_cflags="-D_REENTRANT -mthreads"
- pthread_lib="-lpthread"
- ;;
- *-*-hpux11*)
- pthread_cflags="-D_REENTRANT"
- pthread_lib="-L/usr/lib -lpthread"
- ;;
- *-*-haiku*)
- pthread_cflags="-D_REENTRANT"
- pthread_lib=""
- ;;
- *)
- pthread_cflags="-D_REENTRANT"
- pthread_lib="-lpthread"
- ;;
- esac
- if test x$enable_threads = xyes -a x$enable_pthreads = xyes; then
- # Save the original compiler flags and libraries
- ac_save_cflags="$CFLAGS"; ac_save_libs="$LIBS"
- # Add the pthread compiler flags and libraries
- CFLAGS="$CFLAGS $pthread_cflags"; LIBS="$LIBS $pthread_lib"
- # Check to see if we have pthread support on this system
- AC_MSG_CHECKING(for pthreads)
- use_pthreads=no
- AC_TRY_LINK([
- #include <pthread.h>
- ],[
- pthread_attr_t type;
- pthread_attr_init(&type);
- ],[
- use_pthreads=yes
- ])
- AC_MSG_RESULT($use_pthreads)
- # Restore the compiler flags and libraries
- CFLAGS="$ac_save_cflags"; LIBS="$ac_save_libs"
-
- # Do futher testing if we have pthread support...
- if test x$use_pthreads = xyes; then
- AC_DEFINE(SDL_THREAD_PTHREAD, 1, [ ])
- EXTRA_CFLAGS="$EXTRA_CFLAGS $pthread_cflags"
- EXTRA_LDFLAGS="$EXTRA_LDFLAGS $pthread_lib"
- SDL_CFLAGS="$SDL_CFLAGS $pthread_cflags"
- SDL_LIBS="$SDL_LIBS $pthread_lib"
-
- # Save the original compiler flags and libraries
- ac_save_cflags="$CFLAGS"; ac_save_libs="$LIBS"
- # Add the pthread compiler flags and libraries
- CFLAGS="$CFLAGS $pthread_cflags"; LIBS="$LIBS $pthread_lib"
-
- # Check to see if recursive mutexes are available
- AC_MSG_CHECKING(for recursive mutexes)
- has_recursive_mutexes=no
- if test x$has_recursive_mutexes = xno; then
- AC_TRY_COMPILE([
- #include <pthread.h>
- ],[
- pthread_mutexattr_t attr;
- pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
- ],[
- has_recursive_mutexes=yes
- AC_DEFINE(SDL_THREAD_PTHREAD_RECURSIVE_MUTEX, 1, [ ])
- ])
- fi
- if test x$has_recursive_mutexes = xno; then
- AC_TRY_COMPILE([
- #include <pthread.h>
- ],[
- pthread_mutexattr_t attr;
- pthread_mutexattr_setkind_np(&attr, PTHREAD_MUTEX_RECURSIVE_NP);
- ],[
- has_recursive_mutexes=yes
- AC_DEFINE(SDL_THREAD_PTHREAD_RECURSIVE_MUTEX_NP, 1, [ ])
- ])
- fi
- AC_MSG_RESULT($has_recursive_mutexes)
-
- # Check to see if pthread semaphore support is missing
- if test x$enable_pthread_sem = xyes; then
- AC_MSG_CHECKING(for pthread semaphores)
- have_pthread_sem=no
- AC_TRY_COMPILE([
- #include <pthread.h>
- #include <semaphore.h>
- ],[
- ],[
- have_pthread_sem=yes
- ])
- AC_MSG_RESULT($have_pthread_sem)
- fi
- if test x$have_pthread_sem = xyes; then
- AC_MSG_CHECKING(for sem_timedwait)
- have_sem_timedwait=no
- AC_TRY_LINK([
- #include <pthread.h>
- #include <semaphore.h>
- ],[
- sem_timedwait(NULL, NULL);
- ],[
- have_sem_timedwait=yes
- AC_DEFINE(HAVE_SEM_TIMEDWAIT)
- ])
- AC_MSG_RESULT($have_sem_timedwait)
- fi
-
- AC_MSG_CHECKING(for pthread_spin_trylock)
- AC_TRY_LINK_FUNC(pthread_spin_trylock, [
- has_pthread_spin_trylock=yes
- AC_DEFINE(HAVE_PTHREAD_SPINLOCK, 1, [ ])
- ],[
- has_pthread_spin_trylock=no
- ])
- AC_MSG_RESULT($has_pthread_spin_trylock)
-
- AC_CHECK_HEADER(pthread_np.h, have_pthread_np_h=yes, have_pthread_np_h=no, [ #include <pthread.h> ])
- if test x$have_pthread_np_h = xyes; then
- AC_DEFINE(HAVE_PTHREAD_NP_H, 1, [ ])
- fi
-
- # Check to see if pthread naming is available
- AC_MSG_CHECKING(for pthread_setname_np)
- AC_TRY_LINK_FUNC(pthread_setname_np, [
- has_pthread_setname_np=yes
- AC_DEFINE(HAVE_PTHREAD_SETNAME_NP, 1, [ ])
- ],[
- has_pthread_setname_np=no
- ])
- AC_MSG_RESULT($has_pthread_setname_np)
-
- AC_MSG_CHECKING(for pthread_set_name_np)
- AC_TRY_LINK_
<TRUNCATED>