2001-04-26 16:45:43 +00:00
dnl Process this file with autoconf to produce a configure script.
2013-05-26 11:06:17 -07:00
AC_INIT(README.txt)
2012-01-19 01:55:51 -05:00
AC_CONFIG_HEADER(include/SDL_config.h)
2011-11-17 00:43:44 -05:00
AC_CONFIG_AUX_DIR(build-scripts)
2011-06-04 15:26:02 -04:00
AC_CONFIG_MACRO_DIR([acinclude])
2001-04-26 16:45:43 +00:00
2009-10-11 10:38:38 +00:00
dnl Save the CFLAGS to see whether they were passed in or generated
orig_CFLAGS="$CFLAGS"
2001-04-26 16:45:43 +00:00
dnl Set various version strings - taken gratefully from the GTk sources
#
# Making releases:
2012-01-22 17:21:00 -05:00
# Edit include/SDL_version.h and change the version, then:
2001-04-26 16:45:43 +00:00
# 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.
#
2012-01-22 17:21:00 -05:00
SDL_MAJOR_VERSION=2
SDL_MINOR_VERSION=0
2018-09-26 10:08:14 -07:00
SDL_MICRO_VERSION=9
2016-11-10 17:19:34 -08:00
SDL_INTERFACE_AGE=0
2018-09-26 10:08:14 -07:00
SDL_BINARY_AGE=9
2001-04-26 16:45:43 +00:00
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
2009-03-04 08:57:30 +00:00
LT_INIT([win32-dll])
2001-04-26 16:45:43 +00:00
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`
2009-10-10 09:58:24 +00:00
m4_pattern_allow([^LT_])
2001-04-26 16:45:43 +00:00
AC_SUBST(LT_RELEASE)
AC_SUBST(LT_CURRENT)
AC_SUBST(LT_REVISION)
AC_SUBST(LT_AGE)
2006-03-19 05:27:22 +00:00
dnl Detect the canonical build and host environments
2009-10-10 09:58:24 +00:00
dnl AC_CANONICAL_HOST
2001-04-26 16:45:43 +00:00
2009-10-02 13:50:36 +00:00
dnl Check for tools
AC_PROG_LIBTOOL
AC_PROG_CC
AC_PROG_CXX
AC_PROG_INSTALL
AC_PROG_MAKE_SET
2011-09-11 03:35:46 -04:00
AC_CHECK_TOOL(WINDRES, [windres], [:])
2009-10-02 13:50:36 +00:00
2013-07-08 09:21:54 -07:00
dnl Make sure that srcdir is a full pathname
2013-08-04 09:37:27 -07:00
case "$host" in
*-*-mingw32*)
# Except on msys, where make can't handle full pathnames (bug 1972)
;;
*)
srcdir=`cd $srcdir && pwd`
;;
esac
2013-07-08 09:21:54 -07:00
2006-02-20 11:30:29 +00:00
dnl Set up the compiler and linker flags
2017-08-30 00:40:06 -07:00
INCLUDE="-I$srcdir/include -idirafter $srcdir/src/video/khronos"
2006-02-20 11:30:29 +00:00
if test x$srcdir != x.; then
2006-03-21 10:38:41 +00:00
INCLUDE="-Iinclude $INCLUDE"
2012-01-14 13:21:19 -05:00
elif test -d .hg; then
AC_MSG_ERROR([
*** When building from Mercurial you should configure and build in a
2012-01-19 01:55:51 -05:00
separate directory so you don't clobber SDL_config.h, SDL_revision.h
2012-01-14 13:21:19 -05:00
])
2006-02-20 11:30:29 +00:00
fi
2013-07-21 23:01:01 -07:00
BASE_CFLAGS=""
BASE_LDFLAGS=""
2006-03-19 05:27:22 +00:00
case "$host" in
2006-02-16 20:17:43 +00:00
*-*-cygwin*)
# We build SDL on cygwin without the UNIX emulation layer
2013-07-21 23:01:01 -07:00
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"
2006-02-16 20:17:43 +00:00
;;
esac
2011-01-19 00:07:43 -08:00
# 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]")
2012-01-19 01:55:51 -05:00
BUILD_CFLAGS="$CFLAGS $CPPFLAGS -DUSING_GENERATED_CONFIG_H"
2012-01-22 17:21:00 -05:00
# The default optimization for SDL is -O3 (Bug #31)
2012-07-20 12:57:25 -07:00
if test "x$orig_CFLAGS" = x; then
2009-10-11 10:38:38 +00:00
BUILD_CFLAGS=`echo $BUILD_CFLAGS | sed 's/-O2/-O3/'`
fi
2006-03-14 02:46:26 +00:00
EXTRA_CFLAGS="$INCLUDE $BASE_CFLAGS"
BUILD_LDFLAGS="$LDFLAGS"
EXTRA_LDFLAGS="$BASE_LDFLAGS"
2007-07-10 15:51:17 +00:00
## These are common directories to find software packages
#for path in /usr/freeware /usr/pkg /usr/X11R6 /usr/local; do
2006-05-12 04:18:32 +00:00
# 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
2006-03-14 02:46:26 +00:00
SDL_CFLAGS="$BASE_CFLAGS"
2018-04-23 21:55:59 -07:00
SDL_LIBS="-lSDL2"
2018-05-05 10:31:03 -07:00
if test "x$BASE_LDFLAGS" != x; then
2018-04-23 21:55:59 -07:00
SDL_LIBS="$SDL_LIBS $BASE_LDFLAGS"
fi
2018-05-05 10:31:03 -07:00
if test "x$EXTRA_CFLAGS" != x; then
2018-04-23 21:55:59 -07:00
CPPFLAGS="$CPPFLAGS $EXTRA_CFLAGS"
CFLAGS="$CFLAGS $EXTRA_CFLAGS"
fi
2018-05-05 10:31:03 -07:00
if test "x$EXTRA_LDFLAGS" != x; then
2018-04-23 21:55:59 -07:00
LDFLAGS="$LDFLAGS $EXTRA_LDFLAGS"
fi
2006-02-19 16:42:18 +00:00
2009-10-13 06:40:08 +00:00
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
Fixed bug 2795 - SDL library detection selects the wrong lib
Chris Beck
When creating a homebrew recipe for wesnoth, I discovered that the SDL image configuration routine does not detect libpng properly -- if you have multiple instances of libpng on your system, and you use environment variables to select an instance which is not in your system directory, the build can be broken, because it will run configuration tests against the system installed version, but deduce that it should use the filename of the system-installed version. In a vanilla build of wesnoth using homebrew, this results in segfaults at runtime, because you end up linking against two different versions of libpng, which is also needed independently of SDL.
The problem is essentially in the "find_lib" routine in the configure file:
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'`]
for path in $gcc_bin_path $gcc_lib_path $env_lib_path /usr/lib /usr/local/lib; do
lib=[`ls -- $path/$1 2>/dev/null | sort -r | sed 's/.*\/\(.*\)/\1/; q'`]
if test x$lib != x; then
echo $lib
return
fi
done
}
Because the for loop goes over the system directories before the environment directories, any system-installed lib will shadow the lib selected via environment variables. This is contrary to the behavior of the configuration tests earlier in the script, which prefers the environment variable libs over the system-installed libs. The 'for' loop should instead be:
for path in $env_lib_path $gcc_bin_path $gcc_lib_path /usr/lib /usr/local/lib; do
You can see the full discussion on the Homebrew / linuxbrew issue tracker here: https://github.com/Homebrew/linuxbrew/issues/172
I have checked that this bug also affects SDL 1.2.15, SDL_mixer and SDL_ttf 1.2, which all use this same "find_lib" routine. I have not determined if the bug affects SDL 2.0, which seems not to use this exact routine.
2014-11-29 14:41:18 -08:00
for path in $env_lib_path $gcc_bin_path $gcc_lib_path $host_lib_path; do
2013-06-07 21:47:23 -07:00
lib=[`ls -- $path/$1 2>/dev/null | sed -e '/\.so\..*\./d' -e 's,.*/,,' | sort | tail -1`]
2009-10-13 06:40:08 +00:00
if test x$lib != x; then
echo $lib
return
fi
done
2018-11-23 21:11:11 -08:00
# Try again, this time allowing more than one version digit after the .so
for path in $env_lib_path $gcc_bin_path $gcc_lib_path $host_lib_path; do
lib=[`ls -- $path/$1 2>/dev/null | sed -e 's,.*/,,' | sort | tail -1`]
if test x$lib != x; then
echo $lib
return
fi
done
2009-10-13 06:40:08 +00:00
}
2006-02-09 09:07:13 +00:00
dnl Check for compiler characteristics
2006-02-07 12:11:33 +00:00
AC_C_CONST
AC_C_INLINE
2006-02-09 09:07:13 +00:00
AC_C_VOLATILE
2010-01-13 06:47:17 +00:00
dnl See whether we want assertions for debugging/sanity checking SDL itself.
AC_ARG_ENABLE(assertions,
AC_HELP_STRING([--enable-assertions],
2010-01-13 08:06:32 +00:00
[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)
2011-06-04 15:26:02 -04:00
AC_DEFINE(SDL_DEFAULT_ASSERT_LEVEL, 0, [ ])
2010-01-13 08:06:32 +00:00
;;
release)
2011-06-04 15:26:02 -04:00
AC_DEFINE(SDL_DEFAULT_ASSERT_LEVEL, 1, [ ])
2010-01-13 08:06:32 +00:00
;;
enabled)
2011-06-04 15:26:02 -04:00
AC_DEFINE(SDL_DEFAULT_ASSERT_LEVEL, 2, [ ])
2010-01-13 08:06:32 +00:00
;;
paranoid)
2011-06-04 15:26:02 -04:00
AC_DEFINE(SDL_DEFAULT_ASSERT_LEVEL, 3, [ ])
2010-01-13 08:06:32 +00:00
;;
*)
AC_MSG_ERROR([*** unknown assertion level. stop.])
;;
esac
2010-01-13 06:47:17 +00:00
2009-10-08 09:07:58 +00:00
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
2011-01-16 15:16:39 -08:00
2013-11-14 20:24:15 -05:00
AC_MSG_CHECKING(for linker option --no-undefined)
have_no_undefined=no
2013-11-16 21:52:56 -05:00
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
2013-11-14 20:24:15 -05:00
AC_MSG_RESULT($have_no_undefined)
2012-10-11 15:05:00 -07:00
2018-11-02 18:07:11 -07:00
AC_MSG_CHECKING(for linker option --dynamicbase)
have_dynamicbase=no
case "$host" in
*)
save_LDFLAGS="$LDFLAGS"
LDFLAGS="$LDFLAGS -Wl,--dynamicbase"
AC_TRY_LINK([
],[
],[
have_dynamicbase=yes
EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,--dynamicbase"
])
LDFLAGS="$save_LDFLAGS"
;;
esac
AC_MSG_RESULT($have_dynamicbase)
AC_MSG_CHECKING(for linker option --nxcompat)
have_nxcompat=no
case "$host" in
*)
save_LDFLAGS="$LDFLAGS"
LDFLAGS="$LDFLAGS -Wl,--nxcompat"
AC_TRY_LINK([
],[
],[
have_nxcompat=yes
EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,--nxcompat"
])
LDFLAGS="$save_LDFLAGS"
;;
esac
AC_MSG_RESULT($have_nxcompat)
AC_MSG_CHECKING(for linker option --high-entropy-va)
have_high_entropy_va=no
case "$host" in
*)
save_LDFLAGS="$LDFLAGS"
LDFLAGS="$LDFLAGS -Wl,--high-entropy-va"
AC_TRY_LINK([
],[
],[
have_high_entropy_va=yes
EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,--high-entropy-va"
])
LDFLAGS="$save_LDFLAGS"
;;
esac
AC_MSG_RESULT($have_high_entropy_va)
2006-02-16 10:11:48 +00:00
dnl See whether we are allowed to use the system C library
AC_ARG_ENABLE(libc,
2006-04-14 06:03:09 +00:00
AC_HELP_STRING([--enable-libc], [Use the system C library [[default=yes]]]),
2006-02-16 10:11:48 +00:00
, enable_libc=yes)
if test x$enable_libc = xyes; then
2011-06-04 15:26:02 -04:00
AC_DEFINE(HAVE_LIBC, 1, [ ])
2006-02-16 10:11:48 +00:00
dnl Check for C library headers
AC_HEADER_STDC
2017-09-09 08:36:37 -07:00
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)
2006-02-16 10:11:48 +00:00
dnl Check for typedefs, structures, etc.
AC_TYPE_SIZE_T
2006-02-09 09:07:13 +00:00
2009-01-10 18:32:24 +00:00
dnl Check for defines
AC_CHECK_DEFINE(M_PI, math.h)
2006-02-16 10:11:48 +00:00
dnl Checks for library functions.
2006-12-01 20:25:03 +00:00
case "$host" in
*-*-cygwin* | *-*-mingw32*)
;;
*)
AC_FUNC_ALLOCA
;;
esac
2006-02-16 10:11:48 +00:00
AC_FUNC_MEMCMP
if test x$ac_cv_func_memcmp_working = xyes; then
2011-06-04 15:26:02 -04:00
AC_DEFINE(HAVE_MEMCMP, 1, [ ])
2006-02-09 09:07:13 +00:00
fi
2006-02-16 10:11:48 +00:00
AC_FUNC_STRTOD
if test x$ac_cv_func_strtod = xyes; then
2011-06-04 15:26:02 -04:00
AC_DEFINE(HAVE_STRTOD, 1, [ ])
2006-02-16 10:11:48 +00:00
fi
2009-10-18 17:49:40 +00:00
AC_CHECK_FUNC(mprotect,
AC_TRY_COMPILE([
#include <sys/types.h>
#include <sys/mman.h>
],[
],[
2011-06-04 15:26:02 -04:00
AC_DEFINE(HAVE_MPROTECT, 1, [ ])
2009-10-18 17:49:40 +00:00
]),
)
2017-10-12 13:44:28 -07:00
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)
2006-02-19 16:42:18 +00:00
2009-01-10 22:36:30 +00:00
AC_CHECK_LIB(m, pow, [LIBS="$LIBS -lm"; EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lm"])
2018-08-04 11:52:46 -04:00
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)
2009-01-10 22:36:30 +00:00
2011-01-19 15:02:11 -08:00
AC_CHECK_LIB(iconv, iconv_open, [LIBS="$LIBS -liconv"; EXTRA_LDFLAGS="$EXTRA_LDFLAGS -liconv"])
2009-01-10 22:36:30 +00:00
AC_CHECK_FUNCS(iconv)
2011-07-20 16:35:37 -07:00
2017-08-12 15:00:33 -07:00
AC_CHECK_MEMBER(struct sigaction.sa_sigaction,[AC_DEFINE([HAVE_SA_SIGACTION], 1, [ ])], ,[#include <signal.h>])
2017-10-12 13:44:28 -07:00
2018-08-09 16:00:17 -07:00
dnl Check for additional non-standard headers
2017-10-12 13:44:28 -07:00
AC_CHECK_HEADERS(libunwind.h)
2006-02-16 10:11:48 +00:00
fi
2013-07-31 12:13:26 -04:00
dnl AC_CHECK_SIZEOF(void*)
2006-02-07 12:11:33 +00:00
2011-01-16 15:16:39 -08:00
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);
2011-01-25 17:40:06 -08:00
__sync_lock_test_and_set(&x, y);
2011-01-16 15:16:39 -08:00
__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)
2011-01-21 21:35:43 -08:00
if test x$have_gcc_atomics = xyes; then
2011-06-04 15:26:02 -04:00
AC_DEFINE(HAVE_GCC_ATOMICS, 1, [ ])
2011-01-21 21:45:55 -08:00
else
# See if we have the minimum operation needed for GCC atomics
AC_TRY_LINK([
],[
int a;
__sync_lock_test_and_set(&a, 1);
2011-01-25 17:40:06 -08:00
__sync_lock_release(&a);
2011-01-21 21:45:55 -08:00
],[
have_gcc_sync_lock_test_and_set=yes
])
if test x$have_gcc_sync_lock_test_and_set = xyes; then
2011-06-04 15:26:02 -04:00
AC_DEFINE(HAVE_GCC_SYNC_LOCK_TEST_AND_SET, 1, [ ])
2011-01-21 21:45:55 -08:00
fi
2011-01-21 21:42:04 -08:00
fi
2011-01-16 15:16:39 -08:00
fi
2006-02-16 10:11:48 +00:00
# Standard C sources
SOURCES="$SOURCES $srcdir/src/*.c"
2011-01-15 12:41:59 -08:00
SOURCES="$SOURCES $srcdir/src/atomic/*.c"
2011-02-02 14:34:54 -08:00
SOURCES="$SOURCES $srcdir/src/audio/*.c"
2006-02-16 10:11:48 +00:00
SOURCES="$SOURCES $srcdir/src/cpuinfo/*.c"
2013-12-09 16:03:18 -05:00
SOURCES="$SOURCES $srcdir/src/dynapi/*.c"
2006-02-16 10:11:48 +00:00
SOURCES="$SOURCES $srcdir/src/events/*.c"
SOURCES="$SOURCES $srcdir/src/file/*.c"
2013-06-13 22:10:10 -07:00
SOURCES="$SOURCES $srcdir/src/haptic/*.c"
SOURCES="$SOURCES $srcdir/src/joystick/*.c"
2012-10-20 00:14:58 -07:00
SOURCES="$SOURCES $srcdir/src/libm/*.c"
2013-06-13 22:10:10 -07:00
SOURCES="$SOURCES $srcdir/src/power/*.c"
2013-08-20 19:57:11 -04:00
#SOURCES="$SOURCES $srcdir/src/filesystem/*.c"
2011-02-02 14:34:54 -08:00
SOURCES="$SOURCES $srcdir/src/render/*.c"
SOURCES="$SOURCES $srcdir/src/render/*/*.c"
2018-08-21 12:11:34 -07:00
SOURCES="$SOURCES $srcdir/src/sensor/*.c"
2006-02-16 10:11:48 +00:00
SOURCES="$SOURCES $srcdir/src/stdlib/*.c"
SOURCES="$SOURCES $srcdir/src/thread/*.c"
SOURCES="$SOURCES $srcdir/src/timer/*.c"
SOURCES="$SOURCES $srcdir/src/video/*.c"
2017-11-12 22:51:12 -08:00
SOURCES="$SOURCES $srcdir/src/video/yuv2rgb/*.c"
2006-02-16 10:11:48 +00:00
2001-04-26 16:45:43 +00:00
dnl Enable/disable various subsystems of the SDL library
2009-06-24 20:04:08 +00:00
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
2011-06-04 15:26:02 -04:00
AC_DEFINE(SDL_ATOMIC_DISABLED, 1, [ ])
2014-01-25 15:05:44 -05:00
else
SUMMARY_modules="${SUMMARY_modules} atomic"
2009-06-24 20:04:08 +00:00
fi
2001-04-26 16:45:43 +00:00
AC_ARG_ENABLE(audio,
2006-04-14 06:03:09 +00:00
AC_HELP_STRING([--enable-audio], [Enable the audio subsystem [[default=yes]]]),
2001-04-26 16:45:43 +00:00
, enable_audio=yes)
2006-02-16 10:11:48 +00:00
if test x$enable_audio != xyes; then
2011-06-04 15:26:02 -04:00
AC_DEFINE(SDL_AUDIO_DISABLED, 1, [ ])
2014-01-25 15:05:44 -05:00
else
SUMMARY_modules="${SUMMARY_modules} audio"
2001-04-26 16:45:43 +00:00
fi
AC_ARG_ENABLE(video,
2006-04-14 06:03:09 +00:00
AC_HELP_STRING([--enable-video], [Enable the video subsystem [[default=yes]]]),
2001-04-26 16:45:43 +00:00
, enable_video=yes)
2006-02-16 10:11:48 +00:00
if test x$enable_video != xyes; then
2011-06-04 15:26:02 -04:00
AC_DEFINE(SDL_VIDEO_DISABLED, 1, [ ])
2014-01-25 15:05:44 -05:00
else
SUMMARY_modules="${SUMMARY_modules} video"
2001-04-26 16:45:43 +00:00
fi
2011-02-08 10:04:09 -08:00
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
2011-06-04 15:26:02 -04:00
AC_DEFINE(SDL_RENDER_DISABLED, 1, [ ])
2014-01-25 15:05:44 -05:00
else
SUMMARY_modules="${SUMMARY_modules} render"
2011-02-08 10:04:09 -08:00
fi
2001-04-26 16:45:43 +00:00
AC_ARG_ENABLE(events,
2006-04-14 06:03:09 +00:00
AC_HELP_STRING([--enable-events], [Enable the events subsystem [[default=yes]]]),
2001-04-26 16:45:43 +00:00
, enable_events=yes)
2006-02-16 10:11:48 +00:00
if test x$enable_events != xyes; then
2011-06-04 15:26:02 -04:00
AC_DEFINE(SDL_EVENTS_DISABLED, 1, [ ])
2014-01-25 15:05:44 -05:00
else
SUMMARY_modules="${SUMMARY_modules} events"
2001-04-26 16:45:43 +00:00
fi
AC_ARG_ENABLE(joystick,
2006-04-14 06:03:09 +00:00
AC_HELP_STRING([--enable-joystick], [Enable the joystick subsystem [[default=yes]]]),
2001-04-26 16:45:43 +00:00
, enable_joystick=yes)
2006-02-16 10:11:48 +00:00
if test x$enable_joystick != xyes; then
2011-06-04 15:26:02 -04:00
AC_DEFINE(SDL_JOYSTICK_DISABLED, 1, [ ])
2014-01-25 15:05:44 -05:00
else
SUMMARY_modules="${SUMMARY_modules} joystick"
2001-04-26 16:45:43 +00:00
fi
2008-08-25 09:55:03 +00:00
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
2011-06-04 15:26:02 -04:00
AC_DEFINE(SDL_HAPTIC_DISABLED, 1, [ ])
2014-01-25 15:05:44 -05:00
else
SUMMARY_modules="${SUMMARY_modules} haptic"
2008-08-25 09:55:03 +00:00
fi
2018-08-21 12:11:34 -07:00
AC_ARG_ENABLE(sensor,
AC_HELP_STRING([--enable-sensor], [Enable the sensor subsystem [[default=yes]]]),
, enable_sensor=yes)
if test x$enable_sensor != xyes; then
AC_DEFINE(SDL_SENSOR_DISABLED, 1, [ ])
else
SUMMARY_modules="${SUMMARY_modules} sensor"
fi
2009-06-07 06:06:35 +00:00
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
2011-06-04 15:26:02 -04:00
AC_DEFINE(SDL_POWER_DISABLED, 1, [ ])
2014-01-25 15:05:44 -05:00
else
SUMMARY_modules="${SUMMARY_modules} power"
2009-06-07 06:06:35 +00:00
fi
2013-08-20 19:57:11 -04:00
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, [ ])
2014-01-25 15:05:44 -05:00
else
SUMMARY_modules="${SUMMARY_modules} filesystem"
2013-08-20 19:57:11 -04:00
fi
2001-04-26 16:45:43 +00:00
AC_ARG_ENABLE(threads,
2006-04-14 06:03:09 +00:00
AC_HELP_STRING([--enable-threads], [Enable the threading subsystem [[default=yes]]]),
2001-04-26 16:45:43 +00:00
, enable_threads=yes)
if test x$enable_threads != xyes; then
2011-06-04 15:26:02 -04:00
AC_DEFINE(SDL_THREADS_DISABLED, 1, [ ])
2014-01-25 15:05:44 -05:00
else
SUMMARY_modules="${SUMMARY_modules} threads"
2001-04-26 16:45:43 +00:00
fi
AC_ARG_ENABLE(timers,
2006-04-14 06:03:09 +00:00
AC_HELP_STRING([--enable-timers], [Enable the timer subsystem [[default=yes]]]),
2001-04-26 16:45:43 +00:00
, enable_timers=yes)
2006-02-16 10:11:48 +00:00
if test x$enable_timers != xyes; then
2011-06-04 15:26:02 -04:00
AC_DEFINE(SDL_TIMERS_DISABLED, 1, [ ])
2014-01-25 15:05:44 -05:00
else
SUMMARY_modules="${SUMMARY_modules} timers"
2001-04-26 16:45:43 +00:00
fi
AC_ARG_ENABLE(file,
2006-04-14 06:03:09 +00:00
AC_HELP_STRING([--enable-file], [Enable the file subsystem [[default=yes]]]),
2001-04-26 16:45:43 +00:00
, enable_file=yes)
2006-02-16 10:11:48 +00:00
if test x$enable_file != xyes; then
2011-06-04 15:26:02 -04:00
AC_DEFINE(SDL_FILE_DISABLED, 1, [ ])
2014-01-25 15:05:44 -05:00
else
SUMMARY_modules="${SUMMARY_modules} file"
2006-02-16 10:11:48 +00:00
fi
AC_ARG_ENABLE(loadso,
2006-04-14 06:03:09 +00:00
AC_HELP_STRING([--enable-loadso], [Enable the shared object loading subsystem [[default=yes]]]),
2006-02-16 10:11:48 +00:00
, enable_loadso=yes)
if test x$enable_loadso != xyes; then
2011-06-04 15:26:02 -04:00
AC_DEFINE(SDL_LOADSO_DISABLED, 1, [ ])
2014-01-25 15:05:44 -05:00
else
SUMMARY_modules="${SUMMARY_modules} loadso"
2001-04-26 16:45:43 +00:00
fi
2003-11-18 02:16:57 +00:00
AC_ARG_ENABLE(cpuinfo,
2006-04-14 06:03:09 +00:00
AC_HELP_STRING([--enable-cpuinfo], [Enable the cpuinfo subsystem [[default=yes]]]),
2003-11-18 02:16:57 +00:00
, enable_cpuinfo=yes)
2006-02-16 10:11:48 +00:00
if test x$enable_cpuinfo != xyes; then
2011-06-04 15:26:02 -04:00
AC_DEFINE(SDL_CPUINFO_DISABLED, 1, [ ])
2014-01-25 15:05:44 -05:00
else
SUMMARY_modules="${SUMMARY_modules} cpuinfo"
2011-02-07 22:57:33 -08:00
fi
2006-02-21 08:46:50 +00:00
AC_ARG_ENABLE(assembly,
2006-04-14 06:03:09 +00:00
AC_HELP_STRING([--enable-assembly], [Enable assembly routines [[default=yes]]]),
2006-02-21 08:46:50 +00:00
, enable_assembly=yes)
if test x$enable_assembly = xyes; then
2014-01-25 15:05:44 -05:00
SUMMARY_modules="${SUMMARY_modules} assembly"
2011-06-04 15:26:02 -04:00
AC_DEFINE(SDL_ASSEMBLY_ROUTINES, 1, [ ])
2007-08-15 08:21:10 +00:00
2008-12-07 23:25:39 +00:00
# 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
;;
2009-10-13 06:49:29 +00:00
*)
2008-12-07 23:25:39 +00:00
default_ssemath=no
;;
esac
AC_ARG_ENABLE(ssemath,
2017-01-24 12:20:12 -05:00
AC_HELP_STRING([--enable-ssemath], [Allow GCC to use SSE floating point math [[default=maybe]]]),
2008-12-07 23:25:39 +00:00
, enable_ssemath=$default_ssemath)
if test x$enable_ssemath = xno; then
2017-01-24 12:20:12 -05:00
if test x$have_gcc_sse = xyes -o x$have_gcc_sse2 = xyes -o x$have_gcc_sse3 = xyes; then
2008-12-07 23:25:39 +00:00
EXTRA_CFLAGS="$EXTRA_CFLAGS -mfpmath=387"
fi
fi
2007-08-15 08:21:10 +00:00
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([
2010-03-10 15:02:58 +00:00
#ifdef __MINGW32__
#include <_mingw.h>
#ifdef __MINGW64_VERSION_MAJOR
#include <intrin.h>
#else
2007-08-15 08:21:10 +00:00
#include <mmintrin.h>
2010-03-10 15:02:58 +00:00
#endif
#else
#include <mmintrin.h>
#endif
2007-08-17 03:22:03 +00:00
#ifndef __MMX__
#error Assembler CPP flag not enabled
#endif
2007-08-15 08:21:10 +00:00
],[
],[
have_gcc_mmx=yes
])
AC_MSG_RESULT($have_gcc_mmx)
2007-12-29 22:13:47 +00:00
CFLAGS="$save_CFLAGS"
2007-08-15 08:21:10 +00:00
if test x$have_gcc_mmx = xyes; then
EXTRA_CFLAGS="$EXTRA_CFLAGS $mmx_CFLAGS"
2014-01-25 15:05:44 -05:00
SUMMARY_math="${SUMMARY_math} mmx"
2007-08-15 08:21:10 +00:00
fi
fi
2011-02-22 21:44:36 -08:00
AC_ARG_ENABLE(3dnow,
2012-09-20 21:17:49 -07:00
AC_HELP_STRING([--enable-3dnow], [use 3DNow! assembly routines [[default=yes]]]),
2011-02-22 21:44:36 -08:00
, 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"
2012-09-20 21:16:02 -07:00
AC_TRY_LINK([
2011-02-22 21:44:36 -08:00
#include <mm3dnow.h>
#ifndef __3dNOW__
#error Assembler CPP flag not enabled
#endif
],[
2012-09-20 21:16:02 -07:00
void *p = 0;
_m_prefetch(p);
2011-02-22 21:44:36 -08:00
],[
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"
2014-01-25 15:05:44 -05:00
SUMMARY_math="${SUMMARY_math} 3dnow"
2011-02-22 21:44:36 -08:00
fi
fi
2007-08-15 08:21:10 +00:00
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([
2010-03-10 15:02:58 +00:00
#ifdef __MINGW32__
#include <_mingw.h>
#ifdef __MINGW64_VERSION_MAJOR
#include <intrin.h>
#else
#include <xmmintrin.h>
#endif
#else
2007-08-15 08:21:10 +00:00
#include <xmmintrin.h>
2010-03-10 15:02:58 +00:00
#endif
2007-08-17 03:22:03 +00:00
#ifndef __SSE__
#error Assembler CPP flag not enabled
#endif
2007-08-15 08:21:10 +00:00
],[
],[
have_gcc_sse=yes
])
AC_MSG_RESULT($have_gcc_sse)
2007-12-29 22:13:47 +00:00
CFLAGS="$save_CFLAGS"
2007-08-15 08:21:10 +00:00
if test x$have_gcc_sse = xyes; then
EXTRA_CFLAGS="$EXTRA_CFLAGS $sse_CFLAGS"
2014-01-25 15:05:44 -05:00
SUMMARY_math="${SUMMARY_math} sse"
2007-08-15 08:21:10 +00:00
fi
fi
2007-08-17 06:41:20 +00:00
AC_ARG_ENABLE(sse2,
2017-01-23 01:05:44 -05:00
AC_HELP_STRING([--enable-sse2], [use SSE2 assembly routines [[default=maybe]]]),
2008-12-07 23:25:39 +00:00
, enable_sse2=$default_ssemath)
2007-08-17 06:41:20 +00:00
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([
2010-03-10 15:02:58 +00:00
#ifdef __MINGW32__
#include <_mingw.h>
#ifdef __MINGW64_VERSION_MAJOR
#include <intrin.h>
#else
#include <emmintrin.h>
#endif
#else
2007-08-17 06:41:20 +00:00
#include <emmintrin.h>
2010-03-10 15:02:58 +00:00
#endif
2007-08-17 06:41:20 +00:00
#ifndef __SSE2__
#error Assembler CPP flag not enabled
#endif
],[
],[
have_gcc_sse2=yes
])
AC_MSG_RESULT($have_gcc_sse2)
2007-12-29 22:13:47 +00:00
CFLAGS="$save_CFLAGS"
2007-08-17 06:41:20 +00:00
if test x$have_gcc_sse2 = xyes; then
EXTRA_CFLAGS="$EXTRA_CFLAGS $sse2_CFLAGS"
2014-01-25 15:05:44 -05:00
SUMMARY_math="${SUMMARY_math} sse2"
2007-08-17 06:41:20 +00:00
fi
fi
2011-02-22 21:44:36 -08:00
2017-01-23 01:05:44 -05:00
AC_ARG_ENABLE(sse3,
AC_HELP_STRING([--enable-sse3], [use SSE3 assembly routines [[default=maybe]]]),
, enable_sse3=$default_ssemath)
if test x$enable_sse3 = xyes; then
save_CFLAGS="$CFLAGS"
have_gcc_sse3=no
AC_MSG_CHECKING(for GCC -msse3 option)
sse3_CFLAGS="-msse3"
CFLAGS="$save_CFLAGS $sse3_CFLAGS"
AC_TRY_COMPILE([
#ifdef __MINGW32__
#include <_mingw.h>
#ifdef __MINGW64_VERSION_MAJOR
#include <intrin.h>
#else
#include <pmmintrin.h>
#endif
#else
#include <pmmintrin.h>
#endif
#ifndef __SSE2__
#error Assembler CPP flag not enabled
#endif
],[
],[
have_gcc_sse3=yes
])
AC_MSG_RESULT($have_gcc_sse3)
CFLAGS="$save_CFLAGS"
if test x$have_gcc_sse3 = xyes; then
EXTRA_CFLAGS="$EXTRA_CFLAGS $sse3_CFLAGS"
SUMMARY_math="${SUMMARY_math} sse3"
fi
fi
2017-12-11 12:00:12 -08:00
AC_CHECK_HEADER(immintrin.h,
have_immintrin_h_hdr=yes,
have_immintrin_h_hdr=no)
if test x$have_immintrin_h_hdr = xyes; then
AC_DEFINE(HAVE_IMMINTRIN_H, 1, [ ])
fi
2011-02-22 21:44:36 -08:00
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
2011-06-04 15:26:02 -04:00
AC_DEFINE(SDL_ALTIVEC_BLITTERS, 1, [ ])
2011-02-22 21:44:36 -08:00
if test x$have_altivec_h_hdr = xyes; then
2011-06-04 15:26:02 -04:00
AC_DEFINE(HAVE_ALTIVEC_H, 1, [ ])
2011-02-22 21:44:36 -08:00
fi
EXTRA_CFLAGS="$EXTRA_CFLAGS $altivec_CFLAGS"
2014-01-25 15:05:44 -05:00
SUMMARY_math="${SUMMARY_math} altivec"
2011-02-22 21:44:36 -08:00
fi
fi
2003-11-18 02:16:57 +00:00
fi
2001-04-26 16:45:43 +00:00
dnl See if the OSS audio interface is supported
CheckOSS()
{
AC_ARG_ENABLE(oss,
2013-07-08 13:26:59 -04:00
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;;
2013-07-10 02:32:04 -07:00
esac
2013-07-08 13:26:59 -04:00
fi
2001-04-26 16:45:43 +00:00
if test x$enable_audio = xyes -a x$enable_oss = xyes; then
AC_MSG_CHECKING(for OSS audio support)
have_oss=no
2001-07-08 09:00:06 +00:00
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
2011-06-04 15:26:02 -04:00
AC_DEFINE(SDL_AUDIO_DRIVER_OSS_SOUNDCARD_H, 1, [ ])
2001-07-08 09:00:06 +00:00
])
fi
2001-04-26 16:45:43 +00:00
AC_MSG_RESULT($have_oss)
if test x$have_oss = xyes; then
2014-01-25 15:05:44 -05:00
SUMMARY_audio="${SUMMARY_audio} oss"
2011-06-04 15:26:02 -04:00
AC_DEFINE(SDL_AUDIO_DRIVER_OSS, 1, [ ])
2006-02-16 10:11:48 +00:00
SOURCES="$SOURCES $srcdir/src/audio/dsp/*.c"
have_audio=yes
2006-03-21 08:54:50 +00:00
# We may need to link with ossaudio emulation library
2006-03-19 05:27:22 +00:00
case "$host" in
2006-02-20 03:57:03 +00:00
*-*-openbsd*|*-*-netbsd*)
2006-03-14 02:46:26 +00:00
EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lossaudio";;
2006-02-16 10:11:48 +00:00
esac
2001-04-26 16:45:43 +00:00
fi
fi
}
dnl See if the ALSA audio interface is supported
CheckALSA()
{
AC_ARG_ENABLE(alsa,
2006-04-14 06:03:09 +00:00
AC_HELP_STRING([--enable-alsa], [support the ALSA audio API [[default=yes]]]),
2001-04-26 16:45:43 +00:00
, enable_alsa=yes)
if test x$enable_audio = xyes -a x$enable_alsa = xyes; then
2016-10-07 18:03:08 -07:00
AM_PATH_ALSA(1.0.11, have_alsa=yes, have_alsa=no)
2004-12-13 07:32:53 +00:00
# Restore all flags from before the ALSA detection runs
CFLAGS="$alsa_save_CFLAGS"
LDFLAGS="$alsa_save_LDFLAGS"
LIBS="$alsa_save_LIBS"
2002-04-15 07:38:54 +00:00
if test x$have_alsa = xyes; then
2004-03-02 12:49:16 +00:00
AC_ARG_ENABLE(alsa-shared,
2006-04-14 06:03:09 +00:00
AC_HELP_STRING([--enable-alsa-shared], [dynamically load ALSA audio support [[default=yes]]]),
2006-02-16 10:11:48 +00:00
, enable_alsa_shared=yes)
2009-10-13 06:40:08 +00:00
alsa_lib=[`find_lib "libasound.so.*" "$ALSA_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`]
2006-02-16 10:11:48 +00:00
2011-06-04 15:26:02 -04:00
AC_DEFINE(SDL_AUDIO_DRIVER_ALSA, 1, [ ])
2006-02-16 10:11:48 +00:00
SOURCES="$SOURCES $srcdir/src/audio/alsa/*.c"
2006-03-14 02:46:26 +00:00
EXTRA_CFLAGS="$EXTRA_CFLAGS $ALSA_CFLAGS"
2006-02-16 10:11:48 +00:00
if test x$have_loadso != xyes && \
test x$enable_alsa_shared = xyes; then
2006-03-06 00:50:03 +00:00
AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic ALSA loading])
2006-02-16 10:11:48 +00:00
fi
if test x$have_loadso = xyes && \
test x$enable_alsa_shared = xyes && test x$alsa_lib != x; then
2009-10-13 06:49:29 +00:00
echo "-- dynamic libasound -> $alsa_lib"
2011-06-04 15:26:02 -04:00
AC_DEFINE_UNQUOTED(SDL_AUDIO_DRIVER_ALSA_DYNAMIC, "$alsa_lib", [ ])
2014-01-25 15:05:44 -05:00
SUMMARY_audio="${SUMMARY_audio} alsa(dynamic)"
2006-02-16 10:11:48 +00:00
else
2006-03-14 02:46:26 +00:00
EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ALSA_LIBS"
2014-01-25 15:05:44 -05:00
SUMMARY_audio="${SUMMARY_audio} alsa"
2006-02-16 10:11:48 +00:00
fi
have_audio=yes
fi
fi
2001-04-26 16:45:43 +00:00
}
2017-06-08 13:27:58 -04:00
dnl Find JACK Audio
CheckJACK()
{
AC_ARG_ENABLE(jack,
AC_HELP_STRING([--enable-jack], [use JACK audio [[default=yes]]]),
, enable_jack=yes)
if test x$enable_audio = xyes -a x$enable_jack = xyes; then
audio_jack=no
JACK_REQUIRED_VERSION=0.125
AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
AC_MSG_CHECKING(for JACK $JACK_REQUIRED_VERSION support)
if test x$PKG_CONFIG != xno; then
if $PKG_CONFIG --atleast-pkgconfig-version 0.7 && $PKG_CONFIG --atleast-version $JACK_REQUIRED_VERSION jack; then
JACK_CFLAGS=`$PKG_CONFIG --cflags jack`
JACK_LIBS=`$PKG_CONFIG --libs jack`
audio_jack=yes
fi
fi
AC_MSG_RESULT($audio_jack)
if test x$audio_jack = xyes; then
AC_ARG_ENABLE(jack-shared,
AC_HELP_STRING([--enable-jack-shared], [dynamically load JACK audio support [[default=yes]]]),
, enable_jack_shared=yes)
jack_lib=[`find_lib "libjack.so.*" "$JACK_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`]
AC_DEFINE(SDL_AUDIO_DRIVER_JACK, 1, [ ])
SOURCES="$SOURCES $srcdir/src/audio/jack/*.c"
EXTRA_CFLAGS="$EXTRA_CFLAGS $JACK_CFLAGS"
if test x$have_loadso != xyes && \
test x$enable_jack_shared = xyes; then
AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic JACK audio loading])
fi
if test x$have_loadso = xyes && \
test x$enable_jack_shared = xyes && test x$jack_lib != x; then
echo "-- dynamic libjack -> $jack_lib"
AC_DEFINE_UNQUOTED(SDL_AUDIO_DRIVER_JACK_DYNAMIC, "$jack_lib", [ ])
SUMMARY_audio="${SUMMARY_audio} jack(dynamic)"
case "$host" in
# On Solaris, jack must be linked deferred explicitly
# to prevent undefined symbol failures.
*-*-solaris*)
JACK_LIBS=`echo $JACK_LIBS | sed 's/\-l/-Wl,-l/g'`
EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-zdeferred $JACK_LIBS -Wl,-znodeferred"
esac
else
EXTRA_LDFLAGS="$EXTRA_LDFLAGS $JACK_LIBS"
SUMMARY_audio="${SUMMARY_audio} jack"
fi
have_audio=yes
fi
fi
}
2001-04-26 16:45:43 +00:00
dnl Find the ESD includes and libraries
CheckESD()
{
AC_ARG_ENABLE(esd,
2006-04-14 06:03:09 +00:00
AC_HELP_STRING([--enable-esd], [support the Enlightened Sound Daemon [[default=yes]]]),
2001-04-26 16:45:43 +00:00
, enable_esd=yes)
if test x$enable_audio = xyes -a x$enable_esd = xyes; then
2004-08-24 06:32:50 +00:00
AM_PATH_ESD(0.2.8, have_esd=yes, have_esd=no)
if test x$have_esd = xyes; then
2002-03-06 05:20:11 +00:00
AC_ARG_ENABLE(esd-shared,
2006-04-14 06:03:09 +00:00
AC_HELP_STRING([--enable-esd-shared], [dynamically load ESD audio support [[default=yes]]]),
2003-08-09 20:36:29 +00:00
, enable_esd_shared=yes)
2009-10-13 06:40:08 +00:00
esd_lib=[`find_lib "libesd.so.*" "$ESD_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`]
2006-03-06 00:50:03 +00:00
2011-06-04 15:26:02 -04:00
AC_DEFINE(SDL_AUDIO_DRIVER_ESD, 1, [ ])
2006-03-06 00:50:03 +00:00
SOURCES="$SOURCES $srcdir/src/audio/esd/*.c"
2006-03-14 02:46:26 +00:00
EXTRA_CFLAGS="$EXTRA_CFLAGS $ESD_CFLAGS"
2005-11-17 03:15:05 +00:00
if test x$have_loadso != xyes && \
2002-03-06 11:05:47 +00:00
test x$enable_esd_shared = xyes; then
2006-03-06 00:50:03 +00:00
AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic ESD loading])
2002-03-06 11:05:47 +00:00
fi
2005-11-17 03:15:05 +00:00
if test x$have_loadso = xyes && \
2002-03-06 05:20:11 +00:00
test x$enable_esd_shared = xyes && test x$esd_lib != x; then
2009-10-13 06:49:29 +00:00
echo "-- dynamic libesd -> $esd_lib"
2011-06-04 15:26:02 -04:00
AC_DEFINE_UNQUOTED(SDL_AUDIO_DRIVER_ESD_DYNAMIC, "$esd_lib", [ ])
2014-01-25 15:05:44 -05:00
SUMMARY_audio="${SUMMARY_audio} esd(dynamic)"
2006-03-06 00:50:03 +00:00
else
2006-03-14 02:46:26 +00:00
EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ESD_LIBS"
2014-01-25 15:05:44 -05:00
SUMMARY_audio="${SUMMARY_audio} esd"
2002-03-06 05:20:11 +00:00
fi
2006-02-16 10:11:48 +00:00
have_audio=yes
2002-03-06 05:20:11 +00:00
fi
2001-04-26 16:45:43 +00:00
fi
}
2007-08-20 01:02:37 +00:00
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
2018-08-09 16:00:17 -07:00
if $PKG_CONFIG --atleast-pkgconfig-version 0.7 && $PKG_CONFIG --atleast-version $PULSEAUDIO_REQUIRED_VERSION libpulse-simple; then
2007-08-20 01:02:37 +00:00
PULSEAUDIO_CFLAGS=`$PKG_CONFIG --cflags libpulse-simple`
PULSEAUDIO_LIBS=`$PKG_CONFIG --libs libpulse-simple`
audio_pulseaudio=yes
2009-10-13 06:40:08 +00:00
fi
2007-08-20 01:02:37 +00:00
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)
2009-10-13 06:40:08 +00:00
pulseaudio_lib=[`find_lib "libpulse-simple.so.*" "$PULSEAUDIO_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`]
2007-08-20 01:02:37 +00:00
2011-06-04 15:26:02 -04:00
AC_DEFINE(SDL_AUDIO_DRIVER_PULSEAUDIO, 1, [ ])
2007-08-20 01:02:37 +00:00
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
2009-10-13 06:49:29 +00:00
echo "-- dynamic libpulse-simple -> $pulseaudio_lib"
2011-06-04 15:26:02 -04:00
AC_DEFINE_UNQUOTED(SDL_AUDIO_DRIVER_PULSEAUDIO_DYNAMIC, "$pulseaudio_lib", [ ])
2014-01-25 15:05:44 -05:00
SUMMARY_audio="${SUMMARY_audio} pulse(dynamic)"
2013-02-25 22:46:21 +00:00
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
2007-08-20 01:02:37 +00:00
else
EXTRA_LDFLAGS="$EXTRA_LDFLAGS $PULSEAUDIO_LIBS"
2014-01-25 15:05:44 -05:00
SUMMARY_audio="${SUMMARY_audio} pulse"
2007-08-20 01:02:37 +00:00
fi
have_audio=yes
fi
fi
}
2001-04-26 16:45:43 +00:00
CheckARTSC()
{
AC_ARG_ENABLE(arts,
2006-04-14 06:03:09 +00:00
AC_HELP_STRING([--enable-arts], [support the Analog Real Time Synthesizer [[default=yes]]]),
2001-04-26 16:45:43 +00:00
, enable_arts=yes)
if test x$enable_audio = xyes -a x$enable_arts = xyes; then
2006-02-16 10:11:48 +00:00
AC_PATH_PROG(ARTSCONFIG, artsc-config)
if test x$ARTSCONFIG = x -o x$ARTSCONFIG = x'"$ARTSCONFIG"'; then
2001-04-26 16:45:43 +00:00
: # arts isn't installed
else
2006-02-16 10:11:48 +00:00
ARTS_CFLAGS=`$ARTSCONFIG --cflags`
ARTS_LIBS=`$ARTSCONFIG --libs`
2001-04-26 16:45:43 +00:00
AC_MSG_CHECKING(for aRts development environment)
audio_arts=no
save_CFLAGS="$CFLAGS"
2006-02-16 10:11:48 +00:00
CFLAGS="$CFLAGS $ARTS_CFLAGS"
2001-04-26 16:45:43 +00:00
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
2002-03-06 05:20:11 +00:00
AC_ARG_ENABLE(arts-shared,
2006-04-14 06:03:09 +00:00
AC_HELP_STRING([--enable-arts-shared], [dynamically load aRts audio support [[default=yes]]]),
2003-08-09 20:36:29 +00:00
, enable_arts_shared=yes)
2009-10-13 06:40:08 +00:00
arts_lib=[`find_lib "libartsc.so.*" "$ARTS_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`]
2006-03-06 00:50:03 +00:00
2011-06-04 15:26:02 -04:00
AC_DEFINE(SDL_AUDIO_DRIVER_ARTS, 1, [ ])
2006-03-06 00:50:03 +00:00
SOURCES="$SOURCES $srcdir/src/audio/arts/*.c"
2006-03-14 02:46:26 +00:00
EXTRA_CFLAGS="$EXTRA_CFLAGS $ARTS_CFLAGS"
2005-11-17 03:15:05 +00:00
if test x$have_loadso != xyes && \
2002-03-06 11:05:47 +00:00
test x$enable_arts_shared = xyes; then
2006-03-06 00:50:03 +00:00
AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic ARTS loading])
2002-03-06 11:05:47 +00:00
fi
2005-11-17 03:15:05 +00:00
if test x$have_loadso = xyes && \
2002-03-06 05:20:11 +00:00
test x$enable_arts_shared = xyes && test x$arts_lib != x; then
2009-10-13 06:49:29 +00:00
echo "-- dynamic libartsc -> $arts_lib"
2011-06-04 15:26:02 -04:00
AC_DEFINE_UNQUOTED(SDL_AUDIO_DRIVER_ARTS_DYNAMIC, "$arts_lib", [ ])
2014-01-25 15:05:44 -05:00
SUMMARY_audio="${SUMMARY_audio} arts(dynamic)"
2006-03-06 00:50:03 +00:00
else
2006-03-14 02:46:26 +00:00
EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ARTS_LIBS"
2014-01-25 15:05:44 -05:00
SUMMARY_audio="${SUMMARY_audio} arts"
2002-03-06 05:20:11 +00:00
fi
2006-02-16 10:11:48 +00:00
have_audio=yes
2001-04-26 16:45:43 +00:00
fi
fi
fi
}
dnl See if the NAS audio interface is supported
CheckNAS()
{
AC_ARG_ENABLE(nas,
2006-04-14 06:03:09 +00:00
AC_HELP_STRING([--enable-nas], [support the NAS audio API [[default=yes]]]),
2001-05-27 00:24:43 +00:00
, enable_nas=yes)
2001-04-26 16:45:43 +00:00
if test x$enable_audio = xyes -a x$enable_nas = xyes; then
2006-10-17 09:15:21 +00:00
AC_CHECK_HEADER(audio/audiolib.h, have_nas_hdr=yes)
AC_CHECK_LIB(audio, AuOpenServer, have_nas_lib=yes)
2001-05-27 00:24:43 +00:00
AC_MSG_CHECKING(for NAS audio support)
have_nas=no
2006-10-17 09:15:21 +00:00
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
2001-05-27 00:24:43 +00:00
have_nas=yes
2006-02-16 10:11:48 +00:00
NAS_CFLAGS="-I/usr/X11R6/include/"
2006-03-13 18:01:34 +00:00
NAS_LIBS="-L/usr/X11R6/lib -laudio -lXt"
2003-03-06 06:12:41 +00:00
2001-05-27 00:24:43 +00:00
fi
2006-10-17 09:15:21 +00:00
2003-03-06 06:12:41 +00:00
AC_MSG_RESULT($have_nas)
2006-10-17 09:15:21 +00:00
2006-02-16 10:11:48 +00:00
if test x$have_nas = xyes; then
2006-10-17 09:15:21 +00:00
AC_ARG_ENABLE(nas-shared,
AC_HELP_STRING([--enable-nas-shared], [dynamically load NAS audio support [[default=yes]]]),
, enable_nas_shared=yes)
2009-10-13 06:40:08 +00:00
nas_lib=[`find_lib "libaudio.so.*" "$NAS_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`]
2006-10-17 09:15:21 +00:00
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 && \
2007-07-10 15:51:17 +00:00
test x$enable_nas_shared = xyes && test x$nas_lib != x; then
2009-10-13 06:49:29 +00:00
echo "-- dynamic libaudio -> $nas_lib"
2011-06-04 15:26:02 -04:00
AC_DEFINE_UNQUOTED(SDL_AUDIO_DRIVER_NAS_DYNAMIC, "$nas_lib", [ ])
2014-01-25 15:05:44 -05:00
SUMMARY_audio="${SUMMARY_audio} nas(dynamic)"
2006-10-17 09:15:21 +00:00
else
EXTRA_LDFLAGS="$EXTRA_LDFLAGS $NAS_LIBS"
2014-01-25 15:05:44 -05:00
SUMMARY_audio="${SUMMARY_audio} nas"
2006-10-17 09:15:21 +00:00
fi
2011-06-04 15:26:02 -04:00
AC_DEFINE(SDL_AUDIO_DRIVER_NAS, 1, [ ])
2006-02-16 10:11:48 +00:00
SOURCES="$SOURCES $srcdir/src/audio/nas/*.c"
2006-03-14 02:46:26 +00:00
EXTRA_CFLAGS="$EXTRA_CFLAGS $NAS_CFLAGS"
2006-02-16 10:11:48 +00:00
have_audio=yes
fi
2001-04-26 16:45:43 +00:00
fi
}
2013-07-07 02:03:07 -04:00
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", [ ])
2014-01-25 15:05:44 -05:00
SUMMARY_audio="${SUMMARY_audio} sndio(dynamic)"
2013-07-07 02:03:07 -04:00
else
EXTRA_LDFLAGS="$EXTRA_LDFLAGS $SNDIO_LIBS"
2014-01-25 15:05:44 -05:00
SUMMARY_audio="${SUMMARY_audio} sndio"
2013-07-07 02:03:07 -04:00
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
}
2017-01-06 20:43:53 -08:00
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
}
2001-06-16 01:51:42 +00:00
dnl rcg07142001 See if the user wants the disk writer audio driver...
CheckDiskAudio()
{
AC_ARG_ENABLE(diskaudio,
2006-04-14 06:03:09 +00:00
AC_HELP_STRING([--enable-diskaudio], [support the disk writer audio driver [[default=yes]]]),
2001-07-02 00:20:29 +00:00
, enable_diskaudio=yes)
2001-06-16 01:51:42 +00:00
if test x$enable_audio = xyes -a x$enable_diskaudio = xyes; then
2011-06-04 15:26:02 -04:00
AC_DEFINE(SDL_AUDIO_DRIVER_DISK, 1, [ ])
2006-02-16 10:11:48 +00:00
SOURCES="$SOURCES $srcdir/src/audio/disk/*.c"
2014-01-25 15:05:44 -05:00
SUMMARY_audio="${SUMMARY_audio} disk"
2001-06-16 01:51:42 +00:00
fi
}
2006-03-14 08:53:33 +00:00
dnl rcg03142006 See if the user wants the dummy audio driver...
CheckDummyAudio()
{
AC_ARG_ENABLE(dummyaudio,
2006-04-14 06:03:09 +00:00
AC_HELP_STRING([--enable-dummyaudio], [support the dummy audio driver [[default=yes]]]),
2006-03-14 08:53:33 +00:00
, enable_dummyaudio=yes)
if test x$enable_audio = xyes -a x$enable_dummyaudio = xyes; then
2011-06-04 15:26:02 -04:00
AC_DEFINE(SDL_AUDIO_DRIVER_DUMMY, 1, [ ])
2006-03-14 08:53:33 +00:00
SOURCES="$SOURCES $srcdir/src/audio/dummy/*.c"
2014-01-25 15:05:44 -05:00
SUMMARY_audio="${SUMMARY_audio} dummy"
2006-03-14 08:53:33 +00:00
fi
}
2017-01-06 20:43:53 -08:00
dnl See if libsamplerate is available
CheckLibSampleRate()
{
AC_ARG_ENABLE(libsamplerate,
AC_HELP_STRING([--enable-libsamplerate], [use libsamplerate for audio rate conversion [[default=yes]]]),
, enable_libsamplerate=yes)
if test x$enable_libsamplerate = xyes; then
AC_CHECK_HEADER(samplerate.h,
have_samplerate_h_hdr=yes,
have_samplerate_h_hdr=no)
if test x$have_samplerate_h_hdr = xyes; then
AC_DEFINE(HAVE_LIBSAMPLERATE_H, 1, [ ])
AC_ARG_ENABLE(libsamplerate-shared,
AC_HELP_STRING([--enable-libsamplerate-shared], [dynamically load libsamplerate [[default=yes]]]),
, enable_libsamplerate_shared=yes)
2017-01-08 10:52:02 -08:00
samplerate_lib=[`find_lib "libsamplerate.so.*" "" | sed 's/.*\/\(.*\)/\1/; q'`]
if test x$have_loadso != xyes && \
test x$enable_libsamplerate_shared = xyes; then
AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic libsamplerate loading])
fi
if test x$have_loadso = xyes && \
test x$enable_libsamplerate_shared = xyes && test x$samplerate_lib != x; then
echo "-- dynamic libsamplerate -> $samplerate_lib"
AC_DEFINE_UNQUOTED(SDL_LIBSAMPLERATE_DYNAMIC, "$samplerate_lib", [ ])
else
EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lsamplerate"
2017-01-06 20:43:53 -08:00
fi
fi
fi
}
2006-03-22 01:28:36 +00:00
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"
2007-12-30 05:01:35 +00:00
CFLAGS="$save_CFLAGS $visibility_CFLAGS -Werror"
2006-03-22 01:28:36 +00:00
AC_TRY_COMPILE([
2006-04-29 04:08:40 +00:00
#if !defined(__GNUC__) || __GNUC__ < 4
#error SDL only uses visibility attributes in GCC 4 or newer
#endif
2006-03-22 01:28:36 +00:00
],[
],[
have_gcc_fvisibility=yes
])
AC_MSG_RESULT($have_gcc_fvisibility)
CFLAGS="$save_CFLAGS"
if test x$have_gcc_fvisibility = xyes; then
2006-03-22 04:51:44 +00:00
EXTRA_CFLAGS="$EXTRA_CFLAGS $visibility_CFLAGS"
2006-03-22 01:28:36 +00:00
fi
}
2011-12-29 05:36:39 -05:00
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
}
2016-01-04 22:58:38 -05:00
dnl See if GCC's -Wdeclaration-after-statement is supported.
dnl This lets us catch things that would fail on a C89 compiler when using
dnl a modern GCC.
CheckDeclarationAfterStatement()
{
AC_MSG_CHECKING(for GCC -Wdeclaration-after-statement option)
have_gcc_declaration_after_statement=no
save_CFLAGS="$CFLAGS"
CFLAGS="$save_CFLAGS -Wdeclaration-after-statement -Werror=declaration-after-statement"
AC_TRY_COMPILE([
int x = 0;
],[
],[
have_gcc_declaration_after_statement=yes
])
AC_MSG_RESULT($have_gcc_declaration_after_statement)
CFLAGS="$save_CFLAGS"
if test x$have_gcc_declaration_after_statement = xyes; then
EXTRA_CFLAGS="$EXTRA_CFLAGS -Wdeclaration-after-statement -Werror=declaration-after-statement"
fi
}
2011-10-11 22:04:51 -04:00
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"
2011-10-13 16:35:25 -04:00
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
2013-11-14 11:51:24 -05:00
*-*-haiku*)
2011-10-13 16:35:25 -04:00
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
2011-10-11 22:04:51 -04:00
fi
}
2013-12-14 20:18:43 -03:00
dnl Check for Wayland
CheckWayland()
{
AC_ARG_ENABLE(video-wayland,
AC_HELP_STRING([--enable-video-wayland], [use Wayland video driver [[default=yes]]]),
2014-03-25 14:33:34 -07:00
,enable_video_wayland=yes)
2013-12-14 20:18:43 -03:00
2013-12-27 09:29:39 -03:00
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)
2013-12-14 20:18:43 -03:00
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
2014-05-13 19:42:40 -03:00
if test x$PKG_CONFIG != xno && \
test x$video_opengl_egl = xyes && \
test x$video_opengles_v2 = xyes; then
2016-09-01 01:26:56 -07:00
if $PKG_CONFIG --exists wayland-client wayland-scanner wayland-protocols wayland-egl wayland-cursor egl xkbcommon ; then
2014-01-09 13:56:21 -03:00
WAYLAND_CFLAGS=`$PKG_CONFIG --cflags wayland-client wayland-egl wayland-cursor xkbcommon`
WAYLAND_LIBS=`$PKG_CONFIG --libs wayland-client wayland-egl wayland-cursor xkbcommon`
2016-06-23 18:39:05 +08:00
WAYLAND_SCANNER=`$PKG_CONFIG --variable=wayland_scanner wayland-scanner`
2013-12-14 20:18:43 -03:00
video_wayland=yes
fi
fi
AC_MSG_RESULT($video_wayland)
if test x$video_wayland = xyes; then
AC_DEFINE(SDL_VIDEO_DRIVER_WAYLAND, 1, [ ])
2013-12-27 09:29:39 -03:00
if test x$enable_video_wayland_qt_touch = xyes; then
AC_DEFINE(SDL_VIDEO_DRIVER_WAYLAND_QT_TOUCH, 1, [ ])
fi
2016-09-01 01:26:56 -07:00
2018-08-07 17:28:07 -04:00
WAYLAND_SOURCES="$srcdir/src/video/wayland/*.c"
SOURCES="$SOURCES $WAYLAND_SOURCES"
2016-06-23 18:39:05 +08:00
EXTRA_CFLAGS="$EXTRA_CFLAGS $WAYLAND_CFLAGS -I\$(gen)"
2014-01-09 13:56:21 -03:00
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
2014-02-03 11:52:54 -05:00
AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic Wayland loading])
2014-01-09 13:56:21 -03:00
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"
2014-02-03 11:52:54 -05:00
echo "-- dynamic libxkbcommon -> $xkbcommon_lib"
2014-01-09 13:56:21 -03:00
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", [ ])
2014-01-25 15:05:44 -05:00
SUMMARY_video="${SUMMARY_video} wayland(dynamic)"
2014-01-09 13:56:21 -03:00
else
enable_wayland_shared=no
EXTRA_LDFLAGS="$EXTRA_LDFLAGS $WAYLAND_LIBS"
2014-01-25 15:05:44 -05:00
SUMMARY_video="${SUMMARY_video} wayland"
2014-01-09 13:56:21 -03:00
fi
2013-12-14 20:18:43 -03:00
have_video=yes
fi
fi
}
2006-03-22 01:28:36 +00:00
2014-02-03 11:52:54 -05:00
2014-06-06 15:45:59 -03:00
dnl Check for Native Client stuff
CheckNativeClient()
{
AC_TRY_COMPILE([
#if !defined(__native_client__)
#error "NO NACL"
#endif
],[
],[
2017-05-02 11:16:58 -04:00
AC_DEFINE(SDL_VIDEO_DRIVER_NACL, 1, [ ])
AC_DEFINE(SDL_AUDIO_DRIVER_NACL, 1, [ ])
2014-06-06 15:45:59 -03:00
AC_DEFINE(HAVE_POW, 1, [ ])
AC_DEFINE(HAVE_OPENGLES2, 1, [ ])
AC_DEFINE(SDL_VIDEO_OPENGL_ES2, 1, [ ])
AC_DEFINE(SDL_VIDEO_RENDER_OGL_ES2, 1, [ ])
SDL_LIBS="-lppapi_simple -lppapi_gles2 $SDL_LIBS"
SDLMAIN_SOURCES="$srcdir/src/main/nacl/*.c"
SOURCES="$SOURCES $srcdir/src/audio/nacl/*.c"
SUMMARY_audio="${SUMMARY_audio} nacl"
SOURCES="$SOURCES $srcdir/src/video/nacl/*.c"
SUMMARY_video="${SUMMARY_video} nacl opengles2"
])
}
2014-02-03 11:52:54 -05:00
2017-09-08 22:21:01 -07:00
CheckRPI()
2001-04-26 16:45:43 +00:00
{
2017-09-08 22:21:01 -07:00
AC_ARG_ENABLE(video-rpi,
AC_HELP_STRING([--enable-video-rpi], [use Raspberry Pi video driver [[default=yes]]]),
, enable_video_rpi=yes)
if test x$enable_video = xyes -a x$enable_video_rpi = xyes; then
2018-01-17 13:17:10 -08:00
AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
if test x$PKG_CONFIG != xno && $PKG_CONFIG --exists bcm_host; then
RPI_CFLAGS=`$PKG_CONFIG --cflags bcm_host brcmegl`
RPI_LDFLAGS=`$PKG_CONFIG --libs bcm_host brcmegl`
elif test x$ARCH = xnetbsd; then
2017-09-08 22:21:01 -07:00
RPI_CFLAGS="-I/usr/pkg/include -I/usr/pkg/include/interface/vcos/pthreads -I/usr/pkg/include/interface/vmcs_host/linux"
RPI_LDFLAGS="-Wl,-R/usr/pkg/lib -L/usr/pkg/lib -lbcm_host"
else
RPI_CFLAGS="-I/opt/vc/include -I/opt/vc/include/interface/vcos/pthreads -I/opt/vc/include/interface/vmcs_host/linux"
2018-02-07 14:12:26 -08:00
RPI_LDFLAGS="-Wl,-rpath,/opt/vc/lib -L/opt/vc/lib -lbcm_host"
2017-09-08 22:21:01 -07:00
fi
# Save the original compiler flags and libraries
ac_save_cflags="$CFLAGS"; ac_save_libs="$LIBS"
# Add the Raspberry Pi compiler flags and libraries
CFLAGS="$CFLAGS $RPI_CFLAGS"; LIBS="$LIBS $RPI_LDFLAGS"
2010-08-02 00:14:53 -04:00
2017-09-08 22:21:01 -07:00
AC_MSG_CHECKING(for Raspberry Pi)
have_video_rpi=no
AC_TRY_LINK([
#include <bcm_host.h>
],[
bcm_host_init();
],[
have_video_rpi=yes
],[
])
AC_MSG_RESULT($have_video_rpi)
# Restore the compiler flags and libraries
CFLAGS="$ac_save_cflags"; LIBS="$ac_save_libs"
if test x$have_video_rpi = xyes; then
CFLAGS="$CFLAGS $RPI_CFLAGS"
SDL_CFLAGS="$SDL_CFLAGS $RPI_CFLAGS"
EXTRA_CFLAGS="$EXTRA_CFLAGS $RPI_CFLAGS"
EXTRA_LDFLAGS="$EXTRA_LDFLAGS $RPI_LDFLAGS"
SOURCES="$SOURCES $srcdir/src/video/raspberry/*.c"
AC_DEFINE(SDL_VIDEO_DRIVER_RPI, 1, [ ])
SUMMARY_video="${SUMMARY_video} rpi"
fi
fi
}
2010-08-02 00:14:53 -04:00
2017-09-08 22:21:01 -07:00
dnl Find the X11 include and library directories
CheckX11()
{
2001-04-26 16:45:43 +00:00
AC_ARG_ENABLE(video-x11,
2006-04-14 06:03:09 +00:00
AC_HELP_STRING([--enable-video-x11], [use X11 video driver [[default=yes]]]),
2001-04-26 16:45:43 +00:00
, enable_video_x11=yes)
if test x$enable_video = xyes -a x$enable_video_x11 = xyes; then
2006-05-10 14:59:08 +00:00
case "$host" in
2006-05-10 15:00:30 +00:00
*-*-darwin*)
# This isn't necessary for X11, but fixes GLX detection
2012-09-20 22:01:51 -07:00
if test "x$x_includes" = xNONE && \
test "x$x_libraries" = xNONE && \
test -d /usr/X11R6/include && \
test -d /usr/X11R6/lib; then
2006-05-10 14:59:08 +00:00
x_includes="/usr/X11R6/include"
x_libraries="/usr/X11R6/lib"
fi
;;
esac
2001-04-26 16:45:43 +00:00
AC_PATH_X
AC_PATH_XTRA
if test x$have_x = xyes; then
2005-11-05 19:53:37 +00:00
AC_ARG_ENABLE(x11-shared,
2006-06-23 08:39:05 +00:00
AC_HELP_STRING([--enable-x11-shared], [dynamically load X11 support [[default=maybe]]]),
, enable_x11_shared=maybe)
2005-11-05 19:53:37 +00:00
2006-03-19 05:27:22 +00:00
case "$host" in
2011-03-11 13:56:53 -08:00
*-*-darwin*)
2005-11-17 03:16:01 +00:00
x11_lib='/usr/X11R6/lib/libX11.6.dylib'
x11ext_lib='/usr/X11R6/lib/libXext.6.dylib'
2011-03-11 13:56:53 -08:00
xcursor_lib='/usr/X11R6/lib/libXcursor.1.dylib'
2011-02-28 09:01:53 -08:00
xinerama_lib='/usr/X11R6/lib/libXinerama.1.dylib'
2008-09-17 08:20:57 +00:00
xinput_lib='/usr/X11R6/lib/libXi.6.dylib'
2011-02-28 09:01:53 -08:00
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'
2005-11-17 03:16:01 +00:00
;;
2012-07-18 13:57:39 -07:00
*-*-openbsd*)
x11_lib='libX11.so'
x11ext_lib='libXext.so'
2012-08-01 21:41:54 -04:00
xcursor_lib='libXcursor.so'
xinerama_lib='libXinerama.so'
xinput_lib='libXi.so'
2012-07-18 13:57:39 -07:00
xrandr_lib='libXrandr.so'
2012-08-01 21:41:54 -04:00
xrender_lib='libXrender.so'
xss_lib='libXss.so'
xvidmode_lib='libXxf86vm.so'
2012-07-18 13:57:39 -07:00
;;
2005-11-17 03:16:01 +00:00
*)
2009-10-13 06:40:08 +00:00
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'`]
2011-03-11 13:56:53 -08:00
xcursor_lib=[`find_lib "libXcursor.so.*" "$X_LIBS -L/usr/X11/$base_libdir -L/usr/X11R6/$base_libdir" | sed 's/.*\/\(.*\)/\1/; q'`]
2011-02-28 09:01:53 -08:00
xinerama_lib=[`find_lib "libXinerama.so.*" "$X_LIBS -L/usr/X11/$base_libdir -L/usr/X11R6/$base_libdir" | sed 's/.*\/\(.*\)/\1/; q'`]
2009-10-13 06:40:08 +00:00
xinput_lib=[`find_lib "libXi.so.*" "$X_LIBS -L/usr/X11/$base_libdir -L/usr/X11R6/$base_libdir" | sed 's/.*\/\(.*\)/\1/; q'`]
2011-02-28 09:01:53 -08:00
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'`]
2009-10-13 06:40:08 +00:00
xss_lib=[`find_lib "libXss.so.*" "$X_LIBS -L/usr/X11/$base_libdir -L/usr/X11R6/$base_libdir" | sed 's/.*\/\(.*\)/\1/; q'`]
2011-02-28 09:01:53 -08:00
xvidmode_lib=[`find_lib "libXxf86vm.so.*" "$X_LIBS -L/usr/X11/$base_libdir -L/usr/X11R6/$base_libdir" | sed 's/.*\/\(.*\)/\1/; q'`]
2005-11-17 03:16:01 +00:00
;;
esac
2005-11-05 19:53:37 +00:00
2006-02-16 10:11:48 +00:00
if test x$ac_cv_func_shmat != xyes; then
X_CFLAGS="$X_CFLAGS -DNO_SHARED_MEMORY"
fi
2006-05-10 05:17:58 +00:00
CFLAGS="$CFLAGS $X_CFLAGS"
LDFLAGS="$LDFLAGS $X_LIBS"
2006-03-06 01:05:11 +00:00
2013-07-13 10:41:57 -07:00
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
2011-06-04 15:26:02 -04:00
AC_DEFINE(SDL_VIDEO_DRIVER_X11, 1, [ ])
2006-03-06 01:05:11 +00:00
SOURCES="$SOURCES $srcdir/src/video/x11/*.c"
2006-03-14 02:46:26 +00:00
EXTRA_CFLAGS="$EXTRA_CFLAGS $X_CFLAGS"
2006-06-23 08:39:05 +00:00
2013-07-21 12:37:43 -07:00
# Needed so SDL applications can include SDL_syswm.h
SDL_CFLAGS="$SDL_CFLAGS $X_CFLAGS"
2006-06-23 08:39:05 +00:00
if test x$enable_x11_shared = xmaybe; then
2013-11-19 15:00:39 -05:00
enable_x11_shared=yes
2006-06-23 08:39:05 +00:00
fi
2005-11-17 03:15:05 +00:00
if test x$have_loadso != xyes && \
2005-11-05 19:53:37 +00:00
test x$enable_x11_shared = xyes; then
2006-03-06 00:50:03 +00:00
AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic X11 loading])
2006-06-23 02:19:52 +00:00
enable_x11_shared=no
2005-11-05 19:53:37 +00:00
fi
2005-11-17 03:15:05 +00:00
if test x$have_loadso = xyes && \
2005-11-08 01:34:28 +00:00
test x$enable_x11_shared = xyes && test x$x11_lib != x && test x$x11ext_lib != x; then
2005-11-17 03:16:01 +00:00
echo "-- dynamic libX11 -> $x11_lib"
echo "-- dynamic libX11ext -> $x11ext_lib"
2011-06-04 15:26:02 -04:00
AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_X11_DYNAMIC, "$x11_lib", [ ])
AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_X11_DYNAMIC_XEXT, "$x11ext_lib", [ ])
2014-01-25 15:05:44 -05:00
SUMMARY_video="${SUMMARY_video} x11(dynamic)"
2005-11-05 19:53:37 +00:00
else
2006-03-22 11:13:58 +00:00
enable_x11_shared=no
2008-09-17 08:20:57 +00:00
EXTRA_LDFLAGS="$EXTRA_LDFLAGS $X_LIBS -lX11 -lXext"
2014-01-25 15:05:44 -05:00
SUMMARY_video="${SUMMARY_video} x11"
2005-11-05 19:53:37 +00:00
fi
2006-02-16 10:11:48 +00:00
have_video=yes
2001-04-26 16:45:43 +00:00
2012-05-30 11:44:57 -04:00
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>
2012-06-03 17:34:18 -03:00
extern XExtDisplayInfo* XextAddDisplay(XExtensionInfo* a,Display* b,_Xconst char* c,XExtensionHooks* d,int e,XPointer f);
2012-05-30 11:44:57 -04:00
],[
],[
have_const_param_XextAddDisplay=yes
2017-05-02 11:16:58 -04:00
AC_DEFINE([SDL_VIDEO_DRIVER_X11_CONST_PARAM_XEXTADDDISPLAY], 1, [ ])
2012-05-30 11:44:57 -04:00
])
AC_MSG_RESULT($have_const_param_XextAddDisplay)
2012-07-18 10:47:41 -07:00
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([
2018-08-09 16:00:17 -07:00
#include <X11/Xlib.h>
2012-07-18 10:47:41 -07:00
],[
Display *display;
XEvent event;
XGenericEventCookie *cookie = &event.xcookie;
XNextEvent(display, &event);
XGetEventData(display, cookie);
XFreeEventData(display, cookie);
],[
have_XGenericEvent=yes
2017-05-02 11:16:58 -04:00
AC_DEFINE([SDL_VIDEO_DRIVER_X11_SUPPORTS_GENERIC_EVENTS], 1, [ ])
2012-07-18 10:47:41 -07:00
])
AC_MSG_RESULT($have_XGenericEvent)
2012-05-31 19:23:30 +03:00
AC_CHECK_LIB(X11, XkbKeycodeToKeysym, AC_DEFINE(SDL_VIDEO_DRIVER_X11_HAS_XKBKEYCODETOKEYSYM, 1, [Have XkbKeycodeToKeysym]))
2012-05-30 11:25:35 -04:00
2011-03-11 13:56:53 -08:00
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"
2011-06-04 15:26:02 -04:00
AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_X11_DYNAMIC_XCURSOR, "$xcursor_lib", [ ])
2011-03-11 13:56:53 -08:00
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
2011-06-04 15:26:02 -04:00
AC_DEFINE(SDL_VIDEO_DRIVER_X11_XCURSOR, 1, [ ])
2014-01-25 15:05:44 -05:00
SUMMARY_video_x11="${SUMMARY_video_x11} xcursor"
2011-03-11 13:56:53 -08:00
fi
2015-05-28 00:30:21 -04:00
AC_ARG_ENABLE(video-x11-xdbe,
AC_HELP_STRING([--enable-video-x11-xdbe], [enable X11 Xdbe support [[default=yes]]]),
, enable_video_x11_xdbe=yes)
if test x$enable_video_x11_xdbe = xyes; then
AC_CHECK_HEADER(X11/extensions/Xdbe.h,
have_dbe_h_hdr=yes,
have_dbe_h_hdr=no,
[#include <X11/Xlib.h>
])
if test x$have_dbe_h_hdr = xyes; then
AC_DEFINE(SDL_VIDEO_DRIVER_X11_XDBE, 1, [ ])
SUMMARY_video_x11="${SUMMARY_video_x11} xdbe"
fi
fi
2001-11-03 17:03:16 +00:00
AC_ARG_ENABLE(video-x11-xinerama,
2006-04-14 06:03:09 +00:00
AC_HELP_STRING([--enable-video-x11-xinerama], [enable X11 Xinerama support [[default=yes]]]),
2001-11-03 17:03:16 +00:00
, enable_video_x11_xinerama=yes)
if test x$enable_video_x11_xinerama = xyes; then
2011-02-28 09:01:53 -08:00
definitely_enable_video_x11_xinerama=no
AC_CHECK_HEADER(X11/extensions/Xinerama.h,
have_xinerama_h_hdr=yes,
have_xinerama_h_hdr=no,
2006-03-22 11:13:58 +00:00
[#include <X11/Xlib.h>
])
2011-02-28 09:01:53 -08:00
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"
2011-06-04 15:26:02 -04:00
AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_X11_DYNAMIC_XINERAMA, "$xinerama_lib", [ ])
2011-02-28 09:01:53 -08:00
definitely_enable_video_x11_xinerama=yes
2006-03-22 11:13:58 +00:00
else
2011-02-28 09:01:53 -08:00
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
2006-03-22 11:13:58 +00:00
fi
fi
fi
fi
2011-02-28 09:01:53 -08:00
if test x$definitely_enable_video_x11_xinerama = xyes; then
2011-06-04 15:26:02 -04:00
AC_DEFINE(SDL_VIDEO_DRIVER_X11_XINERAMA, 1, [ ])
2014-01-25 15:05:44 -05:00
SUMMARY_video_x11="${SUMMARY_video_x11} xinerama"
2006-03-22 11:13:58 +00:00
fi
2008-09-17 08:20:57 +00:00
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
2012-05-30 11:25:35 -04:00
AC_CHECK_HEADER(X11/extensions/XInput2.h,
2008-09-17 08:20:57 +00:00
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"
2012-05-30 11:25:35 -04:00
AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_X11_DYNAMIC_XINPUT2, "$xinput_lib", [ ])
2008-09-17 08:20:57 +00:00
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
2014-01-25 15:05:44 -05:00
SUMMARY_video_x11="${SUMMARY_video_x11} xinput2"
2012-05-30 11:25:35 -04:00
AC_DEFINE(SDL_VIDEO_DRIVER_X11_XINPUT2, 1, [ ])
2012-05-31 13:37:02 +03:00
AC_MSG_CHECKING(for xinput2 multitouch)
2018-08-09 16:00:17 -07:00
have_xinput2_multitouch=no
AC_TRY_COMPILE([
#include <X11/Xlib.h>
#include <X11/Xproto.h>
#include <X11/extensions/XInput2.h>
],[
2012-06-21 14:01:47 -03:00
int event_type = XI_TouchBegin;
XITouchClassInfo *t;
2018-08-09 16:00:17 -07:00
],[
have_xinput2_multitouch=yes
AC_DEFINE([SDL_VIDEO_DRIVER_X11_XINPUT2_SUPPORTS_MULTITOUCH], 1, [])
SUMMARY_video_x11="${SUMMARY_video_x11} xinput2_multitouch"
])
AC_MSG_RESULT($have_xinput2_multitouch)
2008-09-17 08:20:57 +00:00
fi
2011-02-28 09:01:53 -08:00
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
2014-01-30 20:27:13 -03:00
dnl XRRScreenResources is only present in Xrandr >= 1.2, we use that as a test.
2011-02-28 09:01:53 -08:00
definitely_enable_video_x11_xrandr=no
2014-01-30 20:27:13 -03:00
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
])
2011-02-28 09:01:53 -08:00
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"
2011-06-04 15:26:02 -04:00
AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_X11_DYNAMIC_XRANDR, "$xrandr_lib", [ ])
2011-02-28 09:01:53 -08:00
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
2011-06-04 15:26:02 -04:00
AC_DEFINE(SDL_VIDEO_DRIVER_X11_XRANDR, 1, [ ])
2014-01-25 15:05:44 -05:00
SUMMARY_video_x11="${SUMMARY_video_x11} xrandr"
2011-02-28 09:01:53 -08:00
fi
2009-01-12 06:19:05 +00:00
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,
2006-05-08 06:38:13 +00:00
[#include <X11/Xlib.h>
])
2009-01-12 06:19:05 +00:00
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"
2011-06-04 15:26:02 -04:00
AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_X11_DYNAMIC_XSS, "$xss_lib", [ ])
2009-01-12 06:19:05 +00:00
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
2006-05-08 06:38:13 +00:00
fi
fi
2009-01-12 06:19:05 +00:00
if test x$definitely_enable_video_x11_scrnsaver = xyes; then
2011-06-04 15:26:02 -04:00
AC_DEFINE(SDL_VIDEO_DRIVER_X11_XSCRNSAVER, 1, [ ])
2014-01-25 15:05:44 -05:00
SUMMARY_video_x11="${SUMMARY_video_x11} xscrnsaver"
2011-02-28 09:01:53 -08:00
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
2011-06-04 15:26:02 -04:00
AC_DEFINE(SDL_VIDEO_DRIVER_X11_XSHAPE, 1, [ ])
2014-01-25 15:05:44 -05:00
SUMMARY_video_x11="${SUMMARY_video_x11} xshape"
2011-02-28 09:01:53 -08:00
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"
2011-06-04 15:26:02 -04:00
AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_X11_DYNAMIC_XVIDMODE, "$xvidmode_lib", [ ])
2011-02-28 09:01:53 -08:00
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
2011-06-04 15:26:02 -04:00
AC_DEFINE(SDL_VIDEO_DRIVER_X11_XVIDMODE, 1, [ ])
2014-01-25 15:05:44 -05:00
SUMMARY_video_x11="${SUMMARY_video_x11} xvidmode"
2009-01-12 06:19:05 +00:00
fi
2001-04-26 16:45:43 +00:00
fi
fi
}
2002-02-14 02:15:15 +00:00
2014-10-15 09:18:17 -07:00
dnl Set up the Vivante video driver if enabled
CheckVivanteVideo()
2014-09-10 08:54:01 -07:00
{
2014-10-15 09:18:17 -07:00
AC_ARG_ENABLE(video-vivante,
AC_HELP_STRING([--enable-video-vivante], [use Vivante EGL video driver [[default=yes]]]),
, enable_video_vivante=yes)
if test x$enable_video = xyes -a x$enable_video_vivante = xyes; then
AC_MSG_CHECKING(for Vivante VDK API)
have_vivante_vdk=no
2014-09-10 08:54:01 -07:00
AC_TRY_COMPILE([
2014-10-15 09:18:17 -07:00
#define LINUX
#define EGL_API_FB
#include <gc_vdk.h>
],[
],[
have_vivante_vdk=yes
])
AC_MSG_RESULT($have_vivante_vdk)
AC_MSG_CHECKING(for Vivante FB API)
have_vivante_egl=no
AC_TRY_COMPILE([
#define LINUX
2014-09-10 08:54:01 -07:00
#define EGL_API_FB
#include <EGL/eglvivante.h>
],[
],[
2014-10-15 09:18:17 -07:00
have_vivante_egl=yes
2014-09-10 08:54:01 -07:00
])
2014-10-15 09:18:17 -07:00
AC_MSG_RESULT($have_vivante_egl)
if test x$have_vivante_vdk = xyes -o x$have_vivante_egl = xyes; then
AC_DEFINE(SDL_VIDEO_DRIVER_VIVANTE, 1, [ ])
EXTRA_CFLAGS="$EXTRA_CFLAGS -DLINUX -DEGL_API_FB"
if test x$have_vivante_vdk = xyes; then
AC_DEFINE(SDL_VIDEO_DRIVER_VIVANTE_VDK, 1, [ ])
EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lVDK"
fi
SOURCES="$SOURCES $srcdir/src/video/vivante/*.c"
SUMMARY_video="${SUMMARY_video} vivante"
2014-09-10 08:54:01 -07:00
have_video=yes
fi
fi
}
2013-11-14 11:51:24 -05:00
dnl Set up the Haiku video driver if enabled
CheckHaikuVideo()
2006-02-16 10:11:48 +00:00
{
if test x$enable_video = xyes; then
2013-11-14 11:51:24 -05:00
AC_DEFINE(SDL_VIDEO_DRIVER_HAIKU, 1, [ ])
SOURCES="$SOURCES $srcdir/src/video/haiku/*.cc"
2006-02-16 10:11:48 +00:00
have_video=yes
2014-01-25 15:05:44 -05:00
SUMMARY_video="${SUMMARY_video} haiku"
2006-02-16 10:11:48 +00:00
fi
}
2006-07-23 09:11:10 +00:00
dnl Set up the Cocoa video driver for Mac OS X (but not Darwin)
2006-02-16 10:11:48 +00:00
CheckCOCOA()
{
AC_ARG_ENABLE(video-cocoa,
2006-07-23 09:11:10 +00:00
AC_HELP_STRING([--enable-video-cocoa], [use Cocoa video driver [[default=yes]]]),
2006-02-16 10:11:48 +00:00
, enable_video_cocoa=yes)
if test x$enable_video = xyes -a x$enable_video_cocoa = xyes; then
save_CFLAGS="$CFLAGS"
2017-08-28 22:36:45 -07:00
dnl Work around that we don't have Objective-C support in autoconf
2006-02-16 10:11:48 +00:00
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
2011-06-04 15:26:02 -04:00
AC_DEFINE(SDL_VIDEO_DRIVER_COCOA, 1, [ ])
2006-07-23 09:11:10 +00:00
SOURCES="$SOURCES $srcdir/src/video/cocoa/*.m"
2014-01-25 15:05:44 -05:00
SUMMARY_video="${SUMMARY_video} cocoa"
2006-02-16 10:11:48 +00:00
have_video=yes
fi
fi
}
2016-04-21 03:16:44 -04:00
CheckMETAL()
{
AC_ARG_ENABLE(render-metal,
2017-12-07 16:08:09 -08:00
AC_HELP_STRING([--enable-render-metal], [enable the Metal render driver [[default=yes]]]),
, enable_render_metal=yes)
2016-04-21 03:16:44 -04:00
if test x$enable_render = xyes -a x$enable_render_metal = xyes; then
2018-01-02 19:06:14 -04:00
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 Metal framework)
have_metal=no
AC_TRY_COMPILE([
#import <Cocoa/Cocoa.h>
#import <Metal/Metal.h>
#import <QuartzCore/CAMetalLayer.h>
#if !TARGET_CPU_X86_64
#error Metal doesn't work on this configuration
#endif
],[
],[
have_metal=yes
])
CFLAGS="$save_CFLAGS"
AC_MSG_RESULT($have_metal)
if test x$have_metal = xyes; then
AC_DEFINE(SDL_VIDEO_RENDER_METAL, 1, [ ])
SOURCES="$SOURCES $srcdir/src/render/metal/*.m"
SUMMARY_video="${SUMMARY_video} metal"
2018-02-11 17:25:51 -08:00
else
enable_render_metal=no
2018-01-02 19:06:14 -04:00
fi
2016-04-21 03:16:44 -04:00
fi
}
2001-09-04 22:53:46 +00:00
dnl Find DirectFB
CheckDirectFB()
{
AC_ARG_ENABLE(video-directfb,
2008-02-10 16:21:05 +00:00
AC_HELP_STRING([--enable-video-directfb], [use DirectFB video driver [[default=no]]]),
, enable_video_directfb=no)
2001-09-04 22:53:46 +00:00
if test x$enable_video = xyes -a x$enable_video_directfb = xyes; then
video_directfb=no
2009-01-04 23:43:33 +00:00
DIRECTFB_REQUIRED_VERSION=1.0.0
2011-02-05 16:07:10 -08:00
AC_PATH_PROGS(DIRECTFBCONFIG, directfb-config, no, [$prefix/bin:$PATH])
2006-03-23 17:31:12 +00:00
if test x$DIRECTFBCONFIG = xno; then
2006-03-22 09:18:10 +00:00
AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
2006-03-23 17:31:12 +00:00
if test x$PKG_CONFIG != xno; then
if $PKG_CONFIG --atleast-pkgconfig-version 0.7 && $PKG_CONFIG --atleast-version $DIRECTFB_REQUIRED_VERSION directfb; then
2006-03-22 09:18:10 +00:00
DIRECTFB_CFLAGS=`$PKG_CONFIG --cflags directfb`
DIRECTFB_LIBS=`$PKG_CONFIG --libs directfb`
2009-01-04 23:43:33 +00:00
DIRECTFB_PREFIX=`$PKG_CONFIG --variable=prefix directfb`
2006-03-22 09:18:10 +00:00
video_directfb=yes
fi
fi
else
set -- `echo $DIRECTFB_REQUIRED_VERSION | sed 's/\./ /g'`
NEED_VERSION=`expr $1 \* 10000 + $2 \* 100 + $3`
2013-03-09 10:35:12 -08:00
set -- `$DIRECTFBCONFIG --version | sed 's/\./ /g'`
2006-03-22 09:18:10 +00:00
HAVE_VERSION=`expr $1 \* 10000 + $2 \* 100 + $3`
if test $HAVE_VERSION -ge $NEED_VERSION; then
DIRECTFB_CFLAGS=`$DIRECTFBCONFIG --cflags`
DIRECTFB_LIBS=`$DIRECTFBCONFIG --libs`
2009-01-04 23:43:33 +00:00
DIRECTFB_PREFIX=`$DIRECTFBCONFIG --prefix`
2001-09-04 22:53:46 +00:00
video_directfb=yes
fi
fi
2009-10-07 06:11:53 +00:00
if test x$video_directfb = xyes; then
# SuSE 11.1 installs directfb-config without directfb-devel
2010-01-11 21:46:59 +00:00
save_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS $DIRECTFB_CFLAGS"
2009-10-07 06:11:53 +00:00
AC_CHECK_HEADER(directfb.h, have_directfb_hdr=yes, have_directfb_hdr=no)
2010-01-11 21:46:59 +00:00
CPPFLAGS="$save_CPPFLAGS"
2009-10-07 06:11:53 +00:00
video_directfb=$have_directfb_hdr
fi
AC_MSG_CHECKING(for DirectFB $DIRECTFB_REQUIRED_VERSION support)
AC_MSG_RESULT($video_directfb)
2001-09-04 22:53:46 +00:00
if test x$video_directfb = xyes; then
2009-01-04 23:43:33 +00:00
AC_ARG_ENABLE(directfb-shared,
AC_HELP_STRING([--enable-directfb-shared], [dynamically load directfb support [[default=yes]]]),
, enable_directfb_shared=yes)
2011-06-04 15:26:02 -04:00
AC_DEFINE(SDL_VIDEO_DRIVER_DIRECTFB, 1, [ ])
2018-08-27 11:51:05 -07:00
AC_DEFINE(SDL_VIDEO_RENDER_DIRECTFB, 1, [ ])
2006-02-16 10:11:48 +00:00
SOURCES="$SOURCES $srcdir/src/video/directfb/*.c"
2006-03-14 02:46:26 +00:00
EXTRA_CFLAGS="$EXTRA_CFLAGS $DIRECTFB_CFLAGS"
2009-01-04 23:43:33 +00:00
2009-10-13 06:49:29 +00:00
AC_MSG_CHECKING(for directfb dynamic loading support)
directfb_shared=no
2017-06-11 22:30:06 +02:00
directfb_lib=[`find_lib "libdirectfb*.so.*" "$DIRECTFB_LIBS"`]
2011-02-05 16:07:10 -08:00
# | sed 's/.*\/\(.*\)/\1/; q'`]
AC_MSG_WARN("directfb $directfb_lib")
2009-01-04 23:43:33 +00:00
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
2009-10-13 06:49:29 +00:00
directfb_shared=yes
echo "-- $directfb_lib_spec -> $directfb_lib"
2011-06-04 15:26:02 -04:00
AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_DIRECTFB_DYNAMIC, "$directfb_lib", [ ])
2014-01-25 15:05:44 -05:00
SUMMARY_video="${SUMMARY_video} directfb(dynamic)"
2009-01-04 23:43:33 +00:00
else
2009-10-13 06:49:29 +00:00
EXTRA_LDFLAGS="$EXTRA_LDFLAGS $DIRECTFB_LIBS"
2014-01-25 15:05:44 -05:00
SUMMARY_video="${SUMMARY_video} directfb"
2009-01-04 23:43:33 +00:00
fi
2009-10-13 06:49:29 +00:00
AC_MSG_RESULT($directfb_shared)
2014-04-17 14:02:21 -07:00
SDL_CFLAGS="$SDL_CFLAGS $DIRECTFB_CFLAGS"
2006-02-16 10:11:48 +00:00
have_video=yes
2001-09-04 22:53:46 +00:00
fi
fi
}
2017-08-02 10:22:48 -07:00
dnl Find KMSDRM
CheckKMSDRM()
{
AC_ARG_ENABLE(video-kmsdrm,
AC_HELP_STRING([--enable-video-kmsdrm], [use KMSDRM video driver [[default=no]]]),
, enable_video_kmsdrm=no)
if test x$enable_video = xyes -a x$enable_video_kmsdrm = xyes; then
video_kmsdrm=no
libdrm_avail=no
libgbm_avail=no
LIBDRM_REQUIRED_VERSION=2.4.46
LIBGBM_REQUIRED_VERSION=9.0.0
AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
if test x$PKG_CONFIG != xno; then
if $PKG_CONFIG --atleast-pkgconfig-version 0.7; then
if $PKG_CONFIG --atleast-version $LIBDRM_REQUIRED_VERSION libdrm; then
LIBDRM_CFLAGS=`$PKG_CONFIG --cflags libdrm`
LIBDRM_LIBS=`$PKG_CONFIG --libs libdrm`
LIBDRM_PREFIX=`$PKG_CONFIG --variable=prefix libdrm`
libdrm_avail=yes
fi
if $PKG_CONFIG --atleast-version $LIBGBM_REQUIRED_VERSION gbm; then
LIBGBM_CFLAGS=`$PKG_CONFIG --cflags gbm`
LIBGBM_LIBS=`$PKG_CONFIG --libs gbm`
LIBGBM_PREFIX=`$PKG_CONFIG --variable=prefix gbm`
libgbm_avail=yes
fi
if test x$libdrm_avail = xyes -a x$libgbm_avail = xyes; then
video_kmsdrm=yes
fi
AC_MSG_CHECKING(for libdrm $LIBDRM_REQUIRED_VERSION library for kmsdrm support)
AC_MSG_RESULT($libdrm_avail)
AC_MSG_CHECKING(for libgbm $LIBGBM_REQUIRED_VERSION library for kmsdrm support)
AC_MSG_RESULT($libgbm_avail)
if test x$video_kmsdrm = xyes; then
AC_ARG_ENABLE(kmsdrm-shared,
AC_HELP_STRING([--enable-kmsdrm-shared], [dynamically load kmsdrm support [[default=yes]]]),
, enable_kmsdrm_shared=yes)
AC_DEFINE(SDL_VIDEO_DRIVER_KMSDRM, 1, [ ])
SOURCES="$SOURCES $srcdir/src/video/kmsdrm/*.c"
EXTRA_CFLAGS="$EXTRA_CFLAGS $LIBDRM_CFLAGS $LIBGBM_CFLAGS"
AC_MSG_CHECKING(for kmsdrm dynamic loading support)
kmsdrm_shared=no
drm_lib=[`find_lib "libdrm.so.*" "$DRM_LIBS"`]
gbm_lib=[`find_lib "libgbm.so.*" "$DRM_LIBS"`]
if test x$have_loadso != xyes && \
test x$enable_kmsdrm_shared = xyes; then
AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic kmsdrm loading])
fi
if test x$have_loadso = xyes && \
test x$enable_kmsdrm_shared = xyes && test x$drm_lib != x && test x$gbm_lib != x; then
kmsdrm_shared=yes
AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_KMSDRM_DYNAMIC, "$drm_lib", [ ])
AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_KMSDRM_DYNAMIC_GBM, "$gbm_lib", [ ])
AC_DEFINE_UNQUOTED(HAVE_KMSDRM_SHARED, "TRUE", [ ])
SUMMARY_video="${SUMMARY_video} kmsdrm(dynamic)"
else
EXTRA_LDFLAGS="$EXTRA_LDFLAGS $LIBDRM_LIBS $LIBGBM_LIBS"
SUMMARY_video="${SUMMARY_video} kmsdrm"
fi
AC_MSG_RESULT($kmsdrm_shared)
have_video=yes
fi
fi
fi
fi
}
2001-04-26 16:50:19 +00:00
dnl rcg04172001 Set up the Null video driver.
CheckDummyVideo()
{
AC_ARG_ENABLE(video-dummy,
2006-04-14 06:03:09 +00:00
AC_HELP_STRING([--enable-video-dummy], [use dummy video driver [[default=yes]]]),
2001-07-02 00:20:29 +00:00
, enable_video_dummy=yes)
2001-04-26 16:50:19 +00:00
if test x$enable_video_dummy = xyes; then
2011-06-04 15:26:02 -04:00
AC_DEFINE(SDL_VIDEO_DRIVER_DUMMY, 1, [ ])
2006-02-16 10:11:48 +00:00
SOURCES="$SOURCES $srcdir/src/video/dummy/*.c"
have_video=yes
2014-01-25 15:05:44 -05:00
SUMMARY_video="${SUMMARY_video} dummy"
2001-04-26 16:50:19 +00:00
fi
}
2017-07-01 17:50:47 -04:00
dnl Set up the QNX video driver if enabled
CheckQNXVideo()
{
if test x$enable_video = xyes; then
AC_DEFINE(SDL_VIDEO_DRIVER_QNX, 1, [ ])
SOURCES="$SOURCES $srcdir/src/video/qnx/*.c"
have_video=yes
EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lscreen -lEGL -lGLESv2"
SUMMARY_video="${SUMMARY_video} qnx"
fi
}
dnl Set up the QNX audio driver if enabled
CheckQNXAudio()
{
if test x$enable_audio = xyes; then
AC_DEFINE(SDL_AUDIO_DRIVER_QSA, 1, [ ])
SOURCES="$SOURCES $srcdir/src/audio/qsa/*.c"
2017-07-02 22:45:31 +02:00
have_audio=yes
2017-07-01 17:50:47 -04:00
EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lasound"
SUMMARY_audio="${SUMMARY_audio} qsa"
fi
}
2001-04-26 16:45:43 +00:00
dnl Check to see if OpenGL support is desired
AC_ARG_ENABLE(video-opengl,
2006-07-28 08:43:17 +00:00
AC_HELP_STRING([--enable-video-opengl], [include OpenGL support [[default=yes]]]),
2001-04-26 16:45:43 +00:00
, enable_video_opengl=yes)
dnl Find OpenGL
2005-11-23 11:46:36 +00:00
CheckOpenGLX11()
2001-04-26 16:45:43 +00:00
{
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
2011-06-04 15:26:02 -04:00
AC_DEFINE(SDL_VIDEO_OPENGL, 1, [ ])
AC_DEFINE(SDL_VIDEO_OPENGL_GLX, 1, [ ])
AC_DEFINE(SDL_VIDEO_RENDER_OGL, 1, [ ])
2014-01-25 15:05:44 -05:00
SUMMARY_video="${SUMMARY_video} opengl"
2001-04-26 16:45:43 +00:00
fi
fi
}
Fixed bug 1242 - PATCH: Improve support for OpenGL ES under X11
Scott Percival 2011-07-03 06:41:51 PDT
This submission is aimed at making life easier for OpenGL ES capable devices
running a X11 stack (e.g. Maemo, Meego, TrimSlice, other ARM SoC boards not
running Android). SDL's Pandora support already has the neccesary GLES-to-X11
glue code, however it's all ghetto'd off in Makefile.pandora and not very
flexible.
The patch:
- adds an awesome --enable-video-opengles option to configure
- re-modifies the opengles and opengles2 SDL_renderers to use function pointers
- no idea why this was removed?
- for SDL_Renderers, links in libGLESv1_CM, libGLES_CM (for PowerVR fans) or
libGLESv2 at runtime
- links in libEGL.so at runtime - the old code made an assumption that
eglFunctions could be pulled from the active GLES library, PowerVR for one
doesn't let you do that with their libGLESv2
- allows you to pick which of GLES v1 or v2 to load via
SDL_GL_CONTEXT_MAJOR_VERSION
So far I've tested this on a Nokia N900 (OMAP 3430/SGX 530 running Maemo 5) and
a Toshiba AC100 (Tegra 2 running Ubuntu 10.10). I haven't tested it on... well,
everything that isn't those two, such as a Pandora, iOS or Android device. The
Pandora specific code should be kept intact (fingers crossed), and nothing
painfully drastic has been added to the SDL_renderers. The library loading
sequence in SDL_x11opengles has been updated to accomodate both NVIDIA's
propensity to let developers get away with murder and PowerVR's alternative of
punishing every missed step.
The test apps work okay with GLES or GLES2 as the renderer. For some reason
alpha blending doesn't seem to work on the Tegra 2; last week NVIDIA pushed out
a new set of X11 GLES drivers, so I'll try and investigate once I upgrade
those. Also, this patch adds things to configure.in, include/SDL_config.h.in
and test/configure.in. I didn't know what the policy was re. committing
generated spaghetti from autotools, so ./autogen.sh has to be run again. Sorry.
I think that's about everything, let me know if there's anything I've
overlooked.
2012-01-08 02:23:37 -05:00
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)
2014-10-13 10:43:10 -07:00
AC_ARG_ENABLE(video-opengles1,
AC_HELP_STRING([--enable-video-opengles1], [include OpenGL ES 1.1 support [[default=yes]]]),
, enable_video_opengles1=yes)
AC_ARG_ENABLE(video-opengles2,
AC_HELP_STRING([--enable-video-opengles2], [include OpenGL ES 2.0 support [[default=yes]]]),
, enable_video_opengles2=yes)
Fixed bug 1242 - PATCH: Improve support for OpenGL ES under X11
Scott Percival 2011-07-03 06:41:51 PDT
This submission is aimed at making life easier for OpenGL ES capable devices
running a X11 stack (e.g. Maemo, Meego, TrimSlice, other ARM SoC boards not
running Android). SDL's Pandora support already has the neccesary GLES-to-X11
glue code, however it's all ghetto'd off in Makefile.pandora and not very
flexible.
The patch:
- adds an awesome --enable-video-opengles option to configure
- re-modifies the opengles and opengles2 SDL_renderers to use function pointers
- no idea why this was removed?
- for SDL_Renderers, links in libGLESv1_CM, libGLES_CM (for PowerVR fans) or
libGLESv2 at runtime
- links in libEGL.so at runtime - the old code made an assumption that
eglFunctions could be pulled from the active GLES library, PowerVR for one
doesn't let you do that with their libGLESv2
- allows you to pick which of GLES v1 or v2 to load via
SDL_GL_CONTEXT_MAJOR_VERSION
So far I've tested this on a Nokia N900 (OMAP 3430/SGX 530 running Maemo 5) and
a Toshiba AC100 (Tegra 2 running Ubuntu 10.10). I haven't tested it on... well,
everything that isn't those two, such as a Pandora, iOS or Android device. The
Pandora specific code should be kept intact (fingers crossed), and nothing
painfully drastic has been added to the SDL_renderers. The library loading
sequence in SDL_x11opengles has been updated to accomodate both NVIDIA's
propensity to let developers get away with murder and PowerVR's alternative of
punishing every missed step.
The test apps work okay with GLES or GLES2 as the renderer. For some reason
alpha blending doesn't seem to work on the Tegra 2; last week NVIDIA pushed out
a new set of X11 GLES drivers, so I'll try and investigate once I upgrade
those. Also, this patch adds things to configure.in, include/SDL_config.h.in
and test/configure.in. I didn't know what the policy was re. committing
generated spaghetti from autotools, so ./autogen.sh has to be run again. Sorry.
I think that's about everything, let me know if there's anything I've
overlooked.
2012-01-08 02:23:37 -05:00
dnl Find OpenGL ES
CheckOpenGLESX11()
{
if test x$enable_video = xyes -a x$enable_video_opengles = xyes; then
2013-08-19 16:29:46 -03:00
AC_MSG_CHECKING(for EGL support)
video_opengl_egl=no
Fixed bug 1242 - PATCH: Improve support for OpenGL ES under X11
Scott Percival 2011-07-03 06:41:51 PDT
This submission is aimed at making life easier for OpenGL ES capable devices
running a X11 stack (e.g. Maemo, Meego, TrimSlice, other ARM SoC boards not
running Android). SDL's Pandora support already has the neccesary GLES-to-X11
glue code, however it's all ghetto'd off in Makefile.pandora and not very
flexible.
The patch:
- adds an awesome --enable-video-opengles option to configure
- re-modifies the opengles and opengles2 SDL_renderers to use function pointers
- no idea why this was removed?
- for SDL_Renderers, links in libGLESv1_CM, libGLES_CM (for PowerVR fans) or
libGLESv2 at runtime
- links in libEGL.so at runtime - the old code made an assumption that
eglFunctions could be pulled from the active GLES library, PowerVR for one
doesn't let you do that with their libGLESv2
- allows you to pick which of GLES v1 or v2 to load via
SDL_GL_CONTEXT_MAJOR_VERSION
So far I've tested this on a Nokia N900 (OMAP 3430/SGX 530 running Maemo 5) and
a Toshiba AC100 (Tegra 2 running Ubuntu 10.10). I haven't tested it on... well,
everything that isn't those two, such as a Pandora, iOS or Android device. The
Pandora specific code should be kept intact (fingers crossed), and nothing
painfully drastic has been added to the SDL_renderers. The library loading
sequence in SDL_x11opengles has been updated to accomodate both NVIDIA's
propensity to let developers get away with murder and PowerVR's alternative of
punishing every missed step.
The test apps work okay with GLES or GLES2 as the renderer. For some reason
alpha blending doesn't seem to work on the Tegra 2; last week NVIDIA pushed out
a new set of X11 GLES drivers, so I'll try and investigate once I upgrade
those. Also, this patch adds things to configure.in, include/SDL_config.h.in
and test/configure.in. I didn't know what the policy was re. committing
generated spaghetti from autotools, so ./autogen.sh has to be run again. Sorry.
I think that's about everything, let me know if there's anything I've
overlooked.
2012-01-08 02:23:37 -05:00
AC_TRY_COMPILE([
2014-10-15 09:18:17 -07:00
#define LINUX
#define EGL_API_FB
2018-12-05 16:53:15 -05:00
#define MESA_EGL_NO_X11_HEADERS
2014-10-15 09:18:17 -07:00
#include <EGL/egl.h>
#include <EGL/eglext.h>
Fixed bug 1242 - PATCH: Improve support for OpenGL ES under X11
Scott Percival 2011-07-03 06:41:51 PDT
This submission is aimed at making life easier for OpenGL ES capable devices
running a X11 stack (e.g. Maemo, Meego, TrimSlice, other ARM SoC boards not
running Android). SDL's Pandora support already has the neccesary GLES-to-X11
glue code, however it's all ghetto'd off in Makefile.pandora and not very
flexible.
The patch:
- adds an awesome --enable-video-opengles option to configure
- re-modifies the opengles and opengles2 SDL_renderers to use function pointers
- no idea why this was removed?
- for SDL_Renderers, links in libGLESv1_CM, libGLES_CM (for PowerVR fans) or
libGLESv2 at runtime
- links in libEGL.so at runtime - the old code made an assumption that
eglFunctions could be pulled from the active GLES library, PowerVR for one
doesn't let you do that with their libGLESv2
- allows you to pick which of GLES v1 or v2 to load via
SDL_GL_CONTEXT_MAJOR_VERSION
So far I've tested this on a Nokia N900 (OMAP 3430/SGX 530 running Maemo 5) and
a Toshiba AC100 (Tegra 2 running Ubuntu 10.10). I haven't tested it on... well,
everything that isn't those two, such as a Pandora, iOS or Android device. The
Pandora specific code should be kept intact (fingers crossed), and nothing
painfully drastic has been added to the SDL_renderers. The library loading
sequence in SDL_x11opengles has been updated to accomodate both NVIDIA's
propensity to let developers get away with murder and PowerVR's alternative of
punishing every missed step.
The test apps work okay with GLES or GLES2 as the renderer. For some reason
alpha blending doesn't seem to work on the Tegra 2; last week NVIDIA pushed out
a new set of X11 GLES drivers, so I'll try and investigate once I upgrade
those. Also, this patch adds things to configure.in, include/SDL_config.h.in
and test/configure.in. I didn't know what the policy was re. committing
generated spaghetti from autotools, so ./autogen.sh has to be run again. Sorry.
I think that's about everything, let me know if there's anything I've
overlooked.
2012-01-08 02:23:37 -05:00
],[
],[
2013-08-19 16:29:46 -03:00
video_opengl_egl=yes
Fixed bug 1242 - PATCH: Improve support for OpenGL ES under X11
Scott Percival 2011-07-03 06:41:51 PDT
This submission is aimed at making life easier for OpenGL ES capable devices
running a X11 stack (e.g. Maemo, Meego, TrimSlice, other ARM SoC boards not
running Android). SDL's Pandora support already has the neccesary GLES-to-X11
glue code, however it's all ghetto'd off in Makefile.pandora and not very
flexible.
The patch:
- adds an awesome --enable-video-opengles option to configure
- re-modifies the opengles and opengles2 SDL_renderers to use function pointers
- no idea why this was removed?
- for SDL_Renderers, links in libGLESv1_CM, libGLES_CM (for PowerVR fans) or
libGLESv2 at runtime
- links in libEGL.so at runtime - the old code made an assumption that
eglFunctions could be pulled from the active GLES library, PowerVR for one
doesn't let you do that with their libGLESv2
- allows you to pick which of GLES v1 or v2 to load via
SDL_GL_CONTEXT_MAJOR_VERSION
So far I've tested this on a Nokia N900 (OMAP 3430/SGX 530 running Maemo 5) and
a Toshiba AC100 (Tegra 2 running Ubuntu 10.10). I haven't tested it on... well,
everything that isn't those two, such as a Pandora, iOS or Android device. The
Pandora specific code should be kept intact (fingers crossed), and nothing
painfully drastic has been added to the SDL_renderers. The library loading
sequence in SDL_x11opengles has been updated to accomodate both NVIDIA's
propensity to let developers get away with murder and PowerVR's alternative of
punishing every missed step.
The test apps work okay with GLES or GLES2 as the renderer. For some reason
alpha blending doesn't seem to work on the Tegra 2; last week NVIDIA pushed out
a new set of X11 GLES drivers, so I'll try and investigate once I upgrade
those. Also, this patch adds things to configure.in, include/SDL_config.h.in
and test/configure.in. I didn't know what the policy was re. committing
generated spaghetti from autotools, so ./autogen.sh has to be run again. Sorry.
I think that's about everything, let me know if there's anything I've
overlooked.
2012-01-08 02:23:37 -05:00
])
2013-08-19 16:29:46 -03:00
AC_MSG_RESULT($video_opengl_egl)
if test x$video_opengl_egl = xyes; then
AC_DEFINE(SDL_VIDEO_OPENGL_EGL, 1, [ ])
fi
2014-10-13 10:43:10 -07:00
if test x$enable_video_opengles1 = xyes; then
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
2013-08-19 16:29:46 -03:00
fi
2014-10-13 10:43:10 -07:00
if test x$enable_video_opengles2 = xyes; then
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
Fixed bug 1242 - PATCH: Improve support for OpenGL ES under X11
Scott Percival 2011-07-03 06:41:51 PDT
This submission is aimed at making life easier for OpenGL ES capable devices
running a X11 stack (e.g. Maemo, Meego, TrimSlice, other ARM SoC boards not
running Android). SDL's Pandora support already has the neccesary GLES-to-X11
glue code, however it's all ghetto'd off in Makefile.pandora and not very
flexible.
The patch:
- adds an awesome --enable-video-opengles option to configure
- re-modifies the opengles and opengles2 SDL_renderers to use function pointers
- no idea why this was removed?
- for SDL_Renderers, links in libGLESv1_CM, libGLES_CM (for PowerVR fans) or
libGLESv2 at runtime
- links in libEGL.so at runtime - the old code made an assumption that
eglFunctions could be pulled from the active GLES library, PowerVR for one
doesn't let you do that with their libGLESv2
- allows you to pick which of GLES v1 or v2 to load via
SDL_GL_CONTEXT_MAJOR_VERSION
So far I've tested this on a Nokia N900 (OMAP 3430/SGX 530 running Maemo 5) and
a Toshiba AC100 (Tegra 2 running Ubuntu 10.10). I haven't tested it on... well,
everything that isn't those two, such as a Pandora, iOS or Android device. The
Pandora specific code should be kept intact (fingers crossed), and nothing
painfully drastic has been added to the SDL_renderers. The library loading
sequence in SDL_x11opengles has been updated to accomodate both NVIDIA's
propensity to let developers get away with murder and PowerVR's alternative of
punishing every missed step.
The test apps work okay with GLES or GLES2 as the renderer. For some reason
alpha blending doesn't seem to work on the Tegra 2; last week NVIDIA pushed out
a new set of X11 GLES drivers, so I'll try and investigate once I upgrade
those. Also, this patch adds things to configure.in, include/SDL_config.h.in
and test/configure.in. I didn't know what the policy was re. committing
generated spaghetti from autotools, so ./autogen.sh has to be run again. Sorry.
I think that's about everything, let me know if there's anything I've
overlooked.
2012-01-08 02:23:37 -05:00
fi
fi
}
2011-01-20 18:04:05 -08:00
dnl Check for Windows OpenGL
CheckWINDOWSGL()
2006-02-16 10:11:48 +00:00
{
if test x$enable_video = xyes -a x$enable_video_opengl = xyes; then
2011-06-04 15:26:02 -04:00
AC_DEFINE(SDL_VIDEO_OPENGL, 1, [ ])
AC_DEFINE(SDL_VIDEO_OPENGL_WGL, 1, [ ])
AC_DEFINE(SDL_VIDEO_RENDER_OGL, 1, [ ])
2014-01-25 15:05:44 -05:00
SUMMARY_video="${SUMMARY_video} opengl"
2006-02-16 10:11:48 +00:00
fi
}
2013-11-22 14:19:52 -03:00
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, [ ])
2014-01-25 15:05:44 -05:00
SUMMARY_video="${SUMMARY_video} opengl_es1"
2013-11-22 14:19:52 -03:00
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, [ ])
2014-01-25 15:05:44 -05:00
SUMMARY_video="${SUMMARY_video} opengl_es2"
2013-11-22 14:19:52 -03:00
fi
fi
}
2013-11-14 11:51:24 -05:00
dnl Check for Haiku OpenGL
CheckHaikuGL()
2001-04-26 16:45:43 +00:00
{
if test x$enable_video = xyes -a x$enable_video_opengl = xyes; then
2011-06-04 15:26:02 -04:00
AC_DEFINE(SDL_VIDEO_OPENGL, 1, [ ])
2013-11-14 11:51:24 -05:00
AC_DEFINE(SDL_VIDEO_OPENGL_HAIKU, 1, [ ])
2011-06-04 15:26:02 -04:00
AC_DEFINE(SDL_VIDEO_RENDER_OGL, 1, [ ])
2006-03-14 02:46:26 +00:00
EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lGL"
2014-01-25 15:05:44 -05:00
SUMMARY_video="${SUMMARY_video} opengl"
2001-04-26 16:45:43 +00:00
fi
}
dnl Check for MacOS OpenGL
CheckMacGL()
{
if test x$enable_video = xyes -a x$enable_video_opengl = xyes; then
2011-06-04 15:26:02 -04:00
AC_DEFINE(SDL_VIDEO_OPENGL, 1, [ ])
AC_DEFINE(SDL_VIDEO_OPENGL_CGL, 1, [ ])
AC_DEFINE(SDL_VIDEO_RENDER_OGL, 1, [ ])
2014-01-25 15:05:44 -05:00
SUMMARY_video="${SUMMARY_video} opengl"
2001-04-26 16:45:43 +00:00
fi
}
2018-03-12 18:41:06 -07:00
dnl Check for MacOS OpenGLES
CheckMacGLES()
{
if test x$enable_video = xyes -a x$enable_video_opengles = xyes; then
video_opengl_egl=yes
AC_DEFINE(SDL_VIDEO_OPENGL_EGL, 1, [ ])
video_opengles_v2=yes
AC_DEFINE(SDL_VIDEO_OPENGL_ES2, 1, [ ])
AC_DEFINE(SDL_VIDEO_RENDER_OGL_ES2, 1, [ ])
SUMMARY_video="${SUMMARY_video} opengl_es2"
fi
}
Initial merge of Emscripten port!
With this commit, you can compile SDL2 with Emscripten
( http://emscripten.org/ ), and make your SDL-based C/C++ program
into a web app.
This port was due to the efforts of several people, including: Charlie Birks,
Sathyanarayanan Gunasekaran, Jukka Jylänki, Alon Zakai, Edward Rudd,
Bruce Mitchener, and Martin Gerhardy. (Thanks, everyone!)
--HG--
extra : rebase_source : 97af74c8a5121e926ebe89f123536b5dd6681695
2014-12-18 00:19:52 -05:00
CheckEmscriptenGLES()
{
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 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
}
2017-08-28 22:36:45 -07:00
dnl Check to see if Vulkan support is desired
2017-08-27 22:15:57 -04:00
AC_ARG_ENABLE(video-vulkan,
2017-08-28 00:11:38 -07:00
AC_HELP_STRING([--enable-video-vulkan], [include Vulkan support [[default=yes]]]),
2017-08-27 22:15:57 -04:00
, enable_video_vulkan=yes)
dnl Find Vulkan Header
CheckVulkan()
{
if test x$enable_video = xyes -a x$enable_video_vulkan = xyes; then
case "$host" in
2017-11-04 09:00:40 -07:00
*-*-android*)
2017-08-27 22:15:57 -04:00
AC_TRY_COMPILE([
2017-08-28 22:36:45 -07:00
#if defined(__ARM_ARCH) && __ARM_ARCH < 7
2017-08-27 22:15:57 -04:00
#error Vulkan doesn't work on this configuration
#endif
2017-08-28 22:36:45 -07:00
],[
],[
2017-08-27 22:15:57 -04:00
],[
enable_video_vulkan=no
2017-08-28 22:36:45 -07:00
])
;;
*-*-darwin*)
save_CFLAGS="$CFLAGS"
dnl Work around that we don't have Objective-C support in autoconf
CFLAGS="$CFLAGS -x objective-c"
AC_TRY_COMPILE([
#include <Cocoa/Cocoa.h>
#include <Metal/Metal.h>
#include <QuartzCore/CAMetalLayer.h>
#if !TARGET_CPU_X86_64
#error Vulkan doesn't work on this configuration
#endif
],[
2017-08-27 22:15:57 -04:00
],[
2017-08-28 22:36:45 -07:00
],[
enable_video_vulkan=no
2017-08-27 22:15:57 -04:00
])
2017-08-28 22:36:45 -07:00
CFLAGS="$save_CFLAGS"
2017-08-27 22:15:57 -04:00
;;
*)
;;
esac
if test x$enable_video_vulkan = xno; then
# For reasons I am totally unable to see, I get an undefined macro error if
# I put this in the AC_TRY_COMPILE.
2017-08-28 22:36:45 -07:00
AC_MSG_WARN([Vulkan does not work on this configuration.])
2017-08-27 22:15:57 -04:00
fi
fi
2017-08-27 23:25:12 -04:00
if test x$enable_video_vulkan = xyes; then
2017-08-28 00:11:38 -07:00
AC_DEFINE(SDL_VIDEO_VULKAN, 1, [ ])
2017-08-27 22:15:57 -04:00
SUMMARY_video="${SUMMARY_video} vulkan"
fi
}
2001-04-26 16:45:43 +00:00
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
2011-06-04 15:26:02 -04:00
AC_DEFINE(SDL_INPUT_LINUXEV, 1, [ ])
2014-01-25 15:05:44 -05:00
SUMMARY_input="${SUMMARY_input} linuxev"
2001-04-26 16:45:43 +00:00
fi
}
2013-10-03 10:28:10 -03:00
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, [ ])
2014-01-25 15:05:44 -05:00
SUMMARY_input="${SUMMARY_input} linuxkd"
2013-10-03 10:28:10 -03:00
fi
}
2012-12-11 12:07:06 -05:00
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, [ ])
2016-11-29 05:34:20 -08:00
udev_lib=[`find_lib "libudev.so.*" "" | sed 's/.*\/\(.*\)/\1/; q'`]
if test x$udev_lib != x; then
echo "-- dynamic udev -> $udev_lib"
AC_DEFINE_UNQUOTED(SDL_UDEV_DYNAMIC, "$udev_lib", [ ])
fi
2012-12-11 12:07:06 -05:00
fi
fi
}
2012-12-28 03:46:55 -05:00
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"
2014-06-18 20:11:39 +01:00
SOURCES="$SOURCES $srcdir/src/core/linux/SDL_dbus.c"
fi
fi
fi
}
2016-10-07 18:57:40 -07:00
dnl See if the platform wanna IME support.
CheckIME()
{
AC_ARG_ENABLE(ime,
AC_HELP_STRING([--enable-ime], [enable IME support [[default=yes]]]),
, enable_ime=yes)
if test x$enable_ime = xyes; then
AC_DEFINE(SDL_USE_IME, 1, [ ])
SOURCES="$SOURCES $srcdir/src/core/linux/SDL_ime.c"
fi
}
2014-06-18 20:11:39 +01:00
dnl See if the platform has libibus IME support.
CheckIBus()
{
AC_ARG_ENABLE(ibus,
AC_HELP_STRING([--enable-ibus], [enable IBus support [[default=yes]]]),
, enable_ibus=yes)
if test x$enable_ibus = xyes; then
AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
if test x$PKG_CONFIG != xno; then
IBUS_CFLAGS=`$PKG_CONFIG --cflags ibus-1.0`
save_CFLAGS="$CFLAGS"
CFLAGS="$save_CFLAGS $IBUS_CFLAGS"
AC_CHECK_HEADER(ibus-1.0/ibus.h,
have_ibus_ibus_h_hdr=yes,
have_ibus_ibus_h_hdr=no)
AC_CHECK_HEADER(sys/inotify.h,
have_inotify_inotify_h_hdr=yes,
have_inotify_inotify_h_hdr=no)
CFLAGS="$save_CFLAGS"
if test x$have_ibus_ibus_h_hdr = xyes; then
2016-10-07 18:57:40 -07:00
if test x$enable_ime != xyes; then
AC_MSG_WARN([IME support is required for IBus.])
have_ibus_ibus_h_hdr=no
elif test x$enable_dbus != xyes; then
2014-06-18 20:11:39 +01:00
AC_MSG_WARN([DBus support is required for IBus.])
have_ibus_ibus_h_hdr=no
elif test x$have_inotify_inotify_h_hdr != xyes; then
AC_MSG_WARN([INotify support is required for IBus.])
have_ibus_ibus_h_hdr=no
else
AC_DEFINE(HAVE_IBUS_IBUS_H, 1, [ ])
EXTRA_CFLAGS="$EXTRA_CFLAGS $IBUS_CFLAGS"
SOURCES="$SOURCES $srcdir/src/core/linux/SDL_ibus.c"
fi
2012-12-28 03:46:55 -05:00
fi
fi
fi
}
2016-10-07 18:57:40 -07:00
dnl See if the platform has fcitx IME support.
CheckFcitx()
{
AC_ARG_ENABLE(fcitx,
AC_HELP_STRING([--enable-fcitx], [enable fcitx support [[default=yes]]]),
, enable_fcitx=yes)
if test x$enable_fcitx = xyes; then
AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
if test x$PKG_CONFIG != xno; then
FCITX_CFLAGS=`$PKG_CONFIG --cflags fcitx`
CFLAGS="$CFLAGS $FCITX_CFLAGS"
AC_CHECK_HEADER(fcitx/frontend.h,
have_fcitx_frontend_h_hdr=yes,
have_fcitx_frontend_h_hdr=no)
CFLAGS="$save_CFLAGS"
if test x$have_fcitx_frontend_h_hdr = xyes; then
if test x$enable_ime != xyes; then
AC_MSG_WARN([IME support is required for fcitx.])
have_fcitx_frontend_h_hdr=no
elif test x$enable_dbus != xyes; then
AC_MSG_WARN([DBus support is required for fcitx.])
have_fcitx_frontend_h_hdr=no
else
AC_DEFINE(HAVE_FCITX_FRONTEND_H, 1, [ ])
EXTRA_CFLAGS="$EXTRA_CFLAGS $FCITX_CFLAGS"
SOURCES="$SOURCES $srcdir/src/core/linux/SDL_fcitx.c"
fi
fi
fi
fi
}
2005-12-12 09:26:32 +00:00
dnl See if we can use the Touchscreen input library
CheckTslib()
{
AC_ARG_ENABLE(input-tslib,
2006-04-14 06:03:09 +00:00
AC_HELP_STRING([--enable-input-tslib], [use the Touchscreen library for input [[default=yes]]]),
2005-12-12 09:26:32 +00:00
, 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
2011-06-04 15:26:02 -04:00
AC_DEFINE(SDL_INPUT_TSLIB, 1, [ ])
2006-03-14 02:46:26 +00:00
EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lts"
2014-01-25 15:05:44 -05:00
SUMMARY_input="${SUMMARY_input} ts"
2005-12-12 09:26:32 +00:00
fi
fi
}
2001-04-26 16:45:43 +00:00
dnl See what type of thread model to use on Linux and Solaris
CheckPTHREAD()
{
dnl Check for pthread support
AC_ARG_ENABLE(pthreads,
2006-04-14 06:03:09 +00:00
AC_HELP_STRING([--enable-pthreads], [use POSIX threads for multi-threading [[default=yes]]]),
2001-04-26 16:45:43 +00:00
, enable_pthreads=yes)
dnl This is used on Linux for glibc binary compatibility (Doh!)
AC_ARG_ENABLE(pthread-sem,
2006-04-14 06:03:09 +00:00
AC_HELP_STRING([--enable-pthread-sem], [use pthread semaphores [[default=yes]]]),
2001-04-26 16:45:43 +00:00
, enable_pthread_sem=yes)
2006-03-19 05:27:22 +00:00
case "$host" in
2017-11-04 09:00:40 -07:00
*-*-android*)
2014-04-06 00:30:48 +03:00
pthread_cflags="-D_REENTRANT -D_THREAD_SAFE"
pthread_lib=""
2014-10-15 09:18:17 -07:00
;;
2006-05-11 23:26:45 +00:00
*-*-linux*|*-*-uclinux*)
2006-02-16 10:11:48 +00:00
pthread_cflags="-D_REENTRANT"
2006-02-03 06:33:54 +00:00
pthread_lib="-lpthread"
;;
2001-04-26 16:45:43 +00:00
*-*-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"
;;
2006-03-21 08:54:50 +00:00
*-*-freebsd*|*-*-dragonfly*)
2001-04-26 16:45:43 +00:00
pthread_cflags="-D_REENTRANT -D_THREAD_SAFE"
pthread_lib="-pthread"
;;
2001-05-27 01:03:39 +00:00
*-*-netbsd*)
2006-02-20 03:57:03 +00:00
pthread_cflags="-D_REENTRANT -D_THREAD_SAFE"
2007-07-10 04:45:50 +00:00
pthread_lib="-lpthread"
2001-05-27 01:03:39 +00:00
;;
2001-04-26 16:45:43 +00:00
*-*-openbsd*)
pthread_cflags="-D_REENTRANT"
pthread_lib="-pthread"
;;
2013-02-24 12:55:51 -08:00
*-*-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"
;;
2001-04-26 16:45:43 +00:00
*-*-solaris*)
2013-02-24 12:55:51 -08:00
# Solaris 11+ merged rt into libc.
2001-04-26 16:45:43 +00:00
pthread_cflags="-D_REENTRANT"
2013-02-24 12:55:51 -08:00
pthread_lib=""
2001-04-26 16:45:43 +00:00
;;
*-*-sysv5*)
pthread_cflags="-D_REENTRANT -Kthread"
pthread_lib=""
;;
*-*-aix*)
pthread_cflags="-D_REENTRANT -mthreads"
pthread_lib="-lpthread"
;;
2002-07-22 09:49:52 +00:00
*-*-hpux11*)
pthread_cflags="-D_REENTRANT"
pthread_lib="-L/usr/lib -lpthread"
;;
2013-11-13 22:35:26 -05:00
*-*-haiku*)
pthread_cflags="-D_REENTRANT"
pthread_lib=""
;;
2017-07-01 17:50:47 -04:00
*-*-nto*)
pthread_cflags="-D_REENTRANT"
pthread_lib=""
;;
2001-04-26 16:45:43 +00:00
*)
pthread_cflags="-D_REENTRANT"
pthread_lib="-lpthread"
;;
esac
2009-09-19 06:24:07 +00:00
if test x$enable_threads = xyes -a x$enable_pthreads = xyes; then
2002-06-13 21:36:25 +00:00
# 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
2001-04-26 16:45:43 +00:00
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)
2002-06-13 21:36:25 +00:00
# Restore the compiler flags and libraries
CFLAGS="$ac_save_cflags"; LIBS="$ac_save_libs"
2006-02-16 10:11:48 +00:00
2002-06-13 21:36:25 +00:00
# Do futher testing if we have pthread support...
2001-04-26 16:45:43 +00:00
if test x$use_pthreads = xyes; then
2011-06-04 15:26:02 -04:00
AC_DEFINE(SDL_THREAD_PTHREAD, 1, [ ])
2006-03-14 02:46:26 +00:00
EXTRA_CFLAGS="$EXTRA_CFLAGS $pthread_cflags"
EXTRA_LDFLAGS="$EXTRA_LDFLAGS $pthread_lib"
2001-04-26 16:45:43 +00:00
SDL_CFLAGS="$SDL_CFLAGS $pthread_cflags"
Date: Sun, 26 Feb 2006 11:25:09 +0900
From: Hayashi Naoyuki
Subject: Re: [SDL] CVS stable again, please update SDL ports
Some problems are caused on Tru64 UNIX.
If applying SDL12-osf1.path, these problems are fixed.
1. configure-script say "recursive mutexes... no" and "pthread
semaphores... no".
checking for pthreads... yes
checking for recursive mutexes... no
checking for pthread semaphores... no
This is because it compiled without pthread_cflags and pthread_lib when
checking recursive mutexes and pthread semaphores.
2. Compiling src/audio/mme/SDL_mmeaudio.c fails.
cc: Severe: ./src/audio/mme/SDL_mmeaudio.c, line 25: Cannot find file
<mme_api.h> specified in #include directive. (noinclfilef)
#include <mme_api.h>
-^
This is because BUILD_CFLAGS is wrong.
3. Compiling src/cdrom/osf/SDL_syscdrom.c fails.
cc: Warning: ./src/cdrom/osf/SDL_syscdrom.c, line 176: Too few actual
parameters in the invocation of the macro "SDL_stack_alloc". (toofewactuals)
cdpath = SDL_stack_alloc(len);
------------------------------------^
cc: Error: ./src/cdrom/osf/SDL_syscdrom.c, line 176: Invalid expression.
(badexpr)
cdpath = SDL_stack_alloc(len);
-----------------^
SDL_stack_alloc is defined in include/SDL_stdinc.h.
#define SDL_stack_alloc(type, count) (type*)alloca(sizeof(type)*count)
4. Linking fails if running configure with --enable-x11-shared=yes.
/usr/ccs/bin/ld:
Warning: Unresolved:
p_XData32
5. Compiling src/video/x11/SDL_x11dyn.c fails if running configure with
--enable-x11-shared=no.
cc: Error: ./src/video/x11/SDL_x11sym.h, line 149: In this statement,
"_SmtBufferOverflow" is not declared. (undeclared)
SDL_X11_SYM(1,void,_SmtBufferOverflow,(Display *dpy,register smtDisplayPtr))
^
cc: Error: ./src/video/x11/SDL_x11sym.h, line 150: In this statement,
"_SmtBufferOverflow" is not declared. (undeclared)
SDL_X11_SYM(1,void,_SmtBufferOverflow,(Display *dpy,register smtDisplayPtr))
^
cc: Error: ./src/video/x11/SDL_x11sym.h, line 150: In this statement,
"_SmtIpError" is not declared. (undeclared)
SDL_X11_SYM(1,void,_SmtIpError,(Display *dpy,register smtDisplayPtr, int))
^
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401442
2006-02-26 04:54:01 +00:00
# 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"
2001-04-26 16:45:43 +00:00
# Check to see if recursive mutexes are available
AC_MSG_CHECKING(for recursive mutexes)
has_recursive_mutexes=no
2006-02-03 06:33:54 +00:00
if test x$has_recursive_mutexes = xno; then
2015-03-23 20:07:24 -04:00
AC_TRY_LINK([
#define _GNU_SOURCE 1
2006-02-03 06:33:54 +00:00
#include <pthread.h>
],[
pthread_mutexattr_t attr;
pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
],[
has_recursive_mutexes=yes
2011-06-04 15:26:02 -04:00
AC_DEFINE(SDL_THREAD_PTHREAD_RECURSIVE_MUTEX, 1, [ ])
2006-02-03 06:33:54 +00:00
])
fi
if test x$has_recursive_mutexes = xno; then
2015-03-23 20:07:24 -04:00
AC_TRY_LINK([
#define _GNU_SOURCE 1
2006-02-03 06:33:54 +00:00
#include <pthread.h>
],[
pthread_mutexattr_t attr;
pthread_mutexattr_setkind_np(&attr, PTHREAD_MUTEX_RECURSIVE_NP);
],[
has_recursive_mutexes=yes
2011-06-04 15:26:02 -04:00
AC_DEFINE(SDL_THREAD_PTHREAD_RECURSIVE_MUTEX_NP, 1, [ ])
2006-02-03 06:33:54 +00:00
])
fi
2001-04-26 16:45:43 +00:00
AC_MSG_RESULT($has_recursive_mutexes)
2001-07-08 09:00:06 +00:00
# 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
2012-01-15 03:34:14 -05:00
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
2017-05-02 11:16:58 -04:00
AC_DEFINE([HAVE_SEM_TIMEDWAIT], 1, [ ])
2012-01-15 03:34:14 -05:00
])
AC_MSG_RESULT($have_sem_timedwait)
fi
2001-07-08 09:00:06 +00:00
2012-07-20 13:32:34 -04:00
AC_CHECK_HEADER(pthread_np.h, have_pthread_np_h=yes, have_pthread_np_h=no, [ #include <pthread.h> ])
2011-10-02 00:29:16 -04:00
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_FUNC(pthread_set_name_np, [
has_pthread_set_name_np=yes
AC_DEFINE(HAVE_PTHREAD_SET_NAME_NP, 1, [ ])
],[
has_pthread_set_name_np=no
])
AC_MSG_RESULT($has_pthread_set_name_np)
Date: Sun, 26 Feb 2006 11:25:09 +0900
From: Hayashi Naoyuki
Subject: Re: [SDL] CVS stable again, please update SDL ports
Some problems are caused on Tru64 UNIX.
If applying SDL12-osf1.path, these problems are fixed.
1. configure-script say "recursive mutexes... no" and "pthread
semaphores... no".
checking for pthreads... yes
checking for recursive mutexes... no
checking for pthread semaphores... no
This is because it compiled without pthread_cflags and pthread_lib when
checking recursive mutexes and pthread semaphores.
2. Compiling src/audio/mme/SDL_mmeaudio.c fails.
cc: Severe: ./src/audio/mme/SDL_mmeaudio.c, line 25: Cannot find file
<mme_api.h> specified in #include directive. (noinclfilef)
#include <mme_api.h>
-^
This is because BUILD_CFLAGS is wrong.
3. Compiling src/cdrom/osf/SDL_syscdrom.c fails.
cc: Warning: ./src/cdrom/osf/SDL_syscdrom.c, line 176: Too few actual
parameters in the invocation of the macro "SDL_stack_alloc". (toofewactuals)
cdpath = SDL_stack_alloc(len);
------------------------------------^
cc: Error: ./src/cdrom/osf/SDL_syscdrom.c, line 176: Invalid expression.
(badexpr)
cdpath = SDL_stack_alloc(len);
-----------------^
SDL_stack_alloc is defined in include/SDL_stdinc.h.
#define SDL_stack_alloc(type, count) (type*)alloca(sizeof(type)*count)
4. Linking fails if running configure with --enable-x11-shared=yes.
/usr/ccs/bin/ld:
Warning: Unresolved:
p_XData32
5. Compiling src/video/x11/SDL_x11dyn.c fails if running configure with
--enable-x11-shared=no.
cc: Error: ./src/video/x11/SDL_x11sym.h, line 149: In this statement,
"_SmtBufferOverflow" is not declared. (undeclared)
SDL_X11_SYM(1,void,_SmtBufferOverflow,(Display *dpy,register smtDisplayPtr))
^
cc: Error: ./src/video/x11/SDL_x11sym.h, line 150: In this statement,
"_SmtBufferOverflow" is not declared. (undeclared)
SDL_X11_SYM(1,void,_SmtBufferOverflow,(Display *dpy,register smtDisplayPtr))
^
cc: Error: ./src/video/x11/SDL_x11sym.h, line 150: In this statement,
"_SmtIpError" is not declared. (undeclared)
SDL_X11_SYM(1,void,_SmtIpError,(Display *dpy,register smtDisplayPtr, int))
^
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401442
2006-02-26 04:54:01 +00:00
# Restore the compiler flags and libraries
CFLAGS="$ac_save_cflags"; LIBS="$ac_save_libs"
2006-02-16 10:11:48 +00:00
# Basic thread creation functions
SOURCES="$SOURCES $srcdir/src/thread/pthread/SDL_systhread.c"
2001-04-26 16:45:43 +00:00
2006-02-16 10:11:48 +00:00
# Semaphores
# We can fake these with mutexes and condition variables if necessary
if test x$have_pthread_sem = xyes; then
SOURCES="$SOURCES $srcdir/src/thread/pthread/SDL_syssem.c"
else
SOURCES="$SOURCES $srcdir/src/thread/generic/SDL_syssem.c"
fi
2001-04-26 16:45:43 +00:00
2006-02-16 10:11:48 +00:00
# Mutexes
# We can fake these with semaphores if necessary
SOURCES="$SOURCES $srcdir/src/thread/pthread/SDL_sysmutex.c"
2002-06-10 21:39:49 +00:00
2006-02-16 10:11:48 +00:00
# Condition variables
# We can fake these with semaphores and mutexes if necessary
SOURCES="$SOURCES $srcdir/src/thread/pthread/SDL_syscond.c"
2002-06-10 21:39:49 +00:00
2013-07-10 02:32:04 -07:00
# Thread local storage
SOURCES="$SOURCES $srcdir/src/thread/pthread/SDL_systls.c"
2006-02-16 10:11:48 +00:00
have_threads=yes
2004-02-12 16:29:24 +00:00
fi
fi
}
2011-01-20 18:04:05 -08:00
dnl Determine whether the compiler can produce Windows executables
CheckWINDOWS()
2001-04-26 16:45:43 +00:00
{
2011-01-20 18:04:05 -08:00
AC_MSG_CHECKING(Windows compiler)
2001-04-26 16:45:43 +00:00
have_win32_gcc=no
AC_TRY_COMPILE([
#include <windows.h>
],[
],[
have_win32_gcc=yes
])
AC_MSG_RESULT($have_win32_gcc)
if test x$have_win32_gcc != xyes; then
AC_MSG_ERROR([
2011-01-20 18:04:05 -08:00
*** Your compiler ($CC) does not produce Windows executables!
2001-04-26 16:45:43 +00:00
])
fi
2009-06-07 02:44:46 +00:00
AC_MSG_CHECKING(Windows CE)
have_wince=no
AC_TRY_COMPILE([
Andrey A.
I made a video driver GAPI/RAW for WinCE (SDL-1.3).
RAW mode has a priority, and also, GAPI mode works with environment
"SDL_VIDEO_RENDERER=gapi" and for RAW mode "SDL_VIDEO_RENDERER=raw".
I checked the work on the screens of VGA, WVGA, QVGA, WQVGA, HVGA,
+ tested all modes with WindowsMobile Emulator.
Also, correctly draws the pointer position and the scale of the pointer
for VGA/WVGA modes,
correctly draws top left position for DM orientation screen, and
portrait/landscape/square geometry the screen also correct.
Also, I added a small fix for GDI fullscreen mode.
Patch for latest revision SDL-1.3 in an attachment.
Also added small path for mingw32ce build.
2010-07-27 21:31:28 -07:00
#if !defined(_WIN32_WCE) && !defined(__MINGW32CE__)
2009-06-07 02:44:46 +00:00
#error This is not Windows CE
#endif
],[
],[
have_wince=yes
2012-09-15 10:59:39 -04:00
AC_MSG_ERROR([
*** Sorry, Windows CE is no longer supported.
2012-09-15 11:03:14 -04:00
])
2009-06-07 02:44:46 +00:00
])
AC_MSG_RESULT($have_wince)
2011-12-29 05:36:39 -05:00
# This fixes Windows stack alignment with newer GCC
CheckStackBoundary
2001-04-26 16:45:43 +00:00
}
dnl Find the DirectX includes and libraries
CheckDIRECTX()
{
AC_ARG_ENABLE(directx,
2011-01-20 18:04:05 -08:00
AC_HELP_STRING([--enable-directx], [use DirectX for Windows audio/video [[default=yes]]]),
2001-04-26 16:45:43 +00:00
, enable_directx=yes)
if test x$enable_directx = xyes; then
2006-07-10 21:04:37 +00:00
AC_CHECK_HEADER(d3d9.h, have_d3d=yes)
2014-03-10 01:51:03 -07:00
AC_CHECK_HEADER(d3d11_1.h, have_d3d11=yes)
2009-06-07 02:44:46 +00:00
AC_CHECK_HEADER(ddraw.h, have_ddraw=yes)
2006-02-16 10:11:48 +00:00
AC_CHECK_HEADER(dsound.h, have_dsound=yes)
2008-08-25 10:04:06 +00:00
AC_CHECK_HEADER(dinput.h, have_dinput=yes)
2014-05-06 00:13:07 -04:00
AC_CHECK_HEADER(dxgi.h, have_dxgi=yes)
2014-07-03 15:39:55 -07:00
AC_CHECK_HEADER(xinput.h, have_xinput=yes)
2017-07-10 18:31:28 -07:00
AC_TRY_COMPILE([
#include <windows.h>
#include <xinput.h>
XINPUT_GAMEPAD_EX x1;
],[],[have_xinput_gamepadex=yes])
AC_TRY_COMPILE([
#include <windows.h>
#include <xinput.h>
XINPUT_STATE_EX s1;
],[],[have_xinput_stateex=yes])
2014-07-03 15:39:55 -07:00
if test x$have_ddraw = xyes; then
AC_DEFINE(HAVE_DDRAW_H, 1, [ ])
fi
if test x$have_dinput = xyes; then
AC_DEFINE(HAVE_DINPUT_H, 1, [ ])
fi
if test x$have_dsound = xyes; then
AC_DEFINE(HAVE_DSOUND_H, 1, [ ])
fi
if test x$have_dxgi = xyes; then
AC_DEFINE(HAVE_DXGI_H, 1, [ ])
fi
if test x$have_xinput = xyes; then
AC_DEFINE(HAVE_XINPUT_H, 1, [ ])
fi
2017-07-10 18:31:28 -07:00
if test x$have_xinput_gamepadex = xyes; then
AC_DEFINE(HAVE_XINPUT_GAMEPAD_EX, 1, [ ])
fi
if test x$have_xinput_stateex = xyes; then
AC_DEFINE(HAVE_XINPUT_STATE_EX, 1, [ ])
fi
2013-06-05 00:42:39 -04:00
2014-01-25 15:05:44 -05:00
SUMMARY_video="${SUMMARY_video} directx"
SUMMARY_audio="${SUMMARY_audio} directx"
2013-06-05 00:42:39 -04:00
# FIXME: latest Cygwin finds dinput headers, but we die on other win32 headers.
# FIXME: ...so force it off for now.
case "$host" in
*-*-cygwin*)
have_dinput=false
;;
esac
2005-11-22 15:19:50 +00:00
fi
2018-09-28 11:30:50 +03:00
AC_CHECK_HEADER(mmdeviceapi.h, have_wasapi=yes)
2018-09-28 13:41:04 +03:00
if test x$have_wasapi = xyes; then
AC_DEFINE(HAVE_MMDEVICEAPI_H,1,[])
fi
2018-09-28 11:30:50 +03:00
AC_CHECK_HEADER(audioclient.h,,have_wasapi=no)
2018-09-28 13:41:04 +03:00
if test x$have_wasapi = xyes; then
AC_DEFINE(HAVE_AUDIOCLIENT_H,1,[])
fi
AC_CHECK_HEADER(endpointvolume.h,AC_DEFINE(HAVE_ENDPOINTVOLUME_H,1,[]))
2018-09-28 11:30:50 +03:00
AC_ARG_ENABLE(wasapi,
AC_HELP_STRING([--enable-wasapi], [use the Windows WASAPI audio driver [[default=yes]]]),
, enable_wasapi=yes)
2005-11-22 15:19:50 +00:00
}
2002-03-06 05:20:11 +00:00
dnl Check for the dlfcn.h interface for dynamically loading objects
CheckDLOPEN()
{
2003-10-06 09:03:02 +00:00
AC_ARG_ENABLE(sdl-dlopen,
2006-04-14 06:03:09 +00:00
AC_HELP_STRING([--enable-sdl-dlopen], [use dlopen for shared object loading [[default=yes]]]),
2003-10-06 09:03:02 +00:00
, enable_sdl_dlopen=yes)
if test x$enable_sdl_dlopen = xyes; then
2002-03-06 05:20:11 +00:00
AC_MSG_CHECKING(for dlopen)
2006-02-16 10:11:48 +00:00
have_dlopen=no
2002-03-06 05:20:11 +00:00
AC_TRY_COMPILE([
#include <dlfcn.h>
],[
2013-07-23 17:38:59 -07:00
void *handle = dlopen("", RTLD_NOW);
const char *loaderror = (char *) dlerror();
2002-03-06 05:20:11 +00:00
],[
2006-02-16 10:11:48 +00:00
have_dlopen=yes
2002-03-06 05:20:11 +00:00
])
2006-02-16 10:11:48 +00:00
AC_MSG_RESULT($have_dlopen)
if test x$have_dlopen = xyes; then
2006-03-14 02:46:26 +00:00
AC_CHECK_LIB(c, dlopen, EXTRA_LDFLAGS="$EXTRA_LDFLAGS",
AC_CHECK_LIB(dl, dlopen, EXTRA_LDFLAGS="$EXTRA_LDFLAGS -ldl",
AC_CHECK_LIB(ltdl, dlopen, EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lltdl")))
2011-06-04 15:26:02 -04:00
AC_DEFINE(SDL_LOADSO_DLOPEN, 1, [ ])
2006-02-16 10:11:48 +00:00
SOURCES="$SOURCES $srcdir/src/loadso/dlopen/*.c"
have_loadso=yes
2002-03-06 05:20:11 +00:00
fi
fi
}
2002-05-28 20:01:29 +00:00
dnl Check for the usbhid(3) library on *BSD
CheckUSBHID()
{
2013-10-13 19:49:45 -07:00
case "$host" in
*-*-*bsd*)
if test x$enable_joystick = xyes; then
AC_CHECK_LIB(usbhid, hid_init, have_libusbhid=yes)
if test x$have_libusbhid = xyes; then
AC_CHECK_HEADER(usbhid.h, [USB_CFLAGS="-DHAVE_USBHID_H"])
AC_CHECK_HEADER(libusbhid.h, [USB_CFLAGS="-DHAVE_LIBUSBHID_H"])
USB_LIBS="$USB_LIBS -lusbhid"
else
AC_CHECK_HEADER(usb.h, [USB_CFLAGS="-DHAVE_USB_H"])
AC_CHECK_HEADER(libusb.h, [USB_CFLAGS="-DHAVE_LIBUSB_H"])
AC_CHECK_LIB(usb, hid_init, [USB_LIBS="$USB_LIBS -lusb"])
fi
save_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS $USB_CFLAGS"
2002-05-28 20:01:29 +00:00
2013-10-13 19:49:45 -07:00
AC_MSG_CHECKING(for usbhid)
have_usbhid=no
AC_TRY_COMPILE([
#include <sys/types.h>
#if defined(HAVE_USB_H)
#include <usb.h>
#endif
#ifdef __DragonFly__
# include <bus/usb/usb.h>
# include <bus/usb/usbhid.h>
#else
# include <dev/usb/usb.h>
# include <dev/usb/usbhid.h>
#endif
#if defined(HAVE_USBHID_H)
#include <usbhid.h>
#elif defined(HAVE_LIBUSB_H)
#include <libusb.h>
#elif defined(HAVE_LIBUSBHID_H)
#include <libusbhid.h>
#endif
],[
struct report_desc *repdesc;
struct usb_ctl_report *repbuf;
hid_kind_t hidkind;
],[
have_usbhid=yes
])
AC_MSG_RESULT($have_usbhid)
if test x$have_usbhid = xyes; then
AC_MSG_CHECKING(for ucr_data member of usb_ctl_report)
have_usbhid_ucr_data=no
AC_TRY_COMPILE([
#include <sys/types.h>
#if defined(HAVE_USB_H)
#include <usb.h>
#endif
#ifdef __DragonFly__
# include <bus/usb/usb.h>
# include <bus/usb/usbhid.h>
#else
# include <dev/usb/usb.h>
# include <dev/usb/usbhid.h>
#endif
#if defined(HAVE_USBHID_H)
#include <usbhid.h>
#elif defined(HAVE_LIBUSB_H)
#include <libusb.h>
#elif defined(HAVE_LIBUSBHID_H)
#include <libusbhid.h>
#endif
],[
struct usb_ctl_report buf;
if (buf.ucr_data) { }
],[
have_usbhid_ucr_data=yes
])
if test x$have_usbhid_ucr_data = xyes; then
USB_CFLAGS="$USB_CFLAGS -DUSBHID_UCR_DATA"
fi
AC_MSG_RESULT($have_usbhid_ucr_data)
AC_MSG_CHECKING(for new usbhid API)
have_usbhid_new=no
AC_TRY_COMPILE([
#include <sys/types.h>
#if defined(HAVE_USB_H)
#include <usb.h>
#endif
#ifdef __DragonFly__
#include <bus/usb/usb.h>
#include <bus/usb/usbhid.h>
#else
#include <dev/usb/usb.h>
#include <dev/usb/usbhid.h>
#endif
#if defined(HAVE_USBHID_H)
#include <usbhid.h>
#elif defined(HAVE_LIBUSB_H)
#include <libusb.h>
#elif defined(HAVE_LIBUSBHID_H)
#include <libusbhid.h>
#endif
],[
report_desc_t d;
hid_start_parse(d, 1, 1);
],[
have_usbhid_new=yes
])
if test x$have_usbhid_new = xyes; then
USB_CFLAGS="$USB_CFLAGS -DUSBHID_NEW"
fi
AC_MSG_RESULT($have_usbhid_new)
AC_MSG_CHECKING(for struct joystick in machine/joystick.h)
have_machine_joystick=no
AC_TRY_COMPILE([
#include <machine/joystick.h>
],[
struct joystick t;
],[
have_machine_joystick=yes
])
if test x$have_machine_joystick = xyes; then
AC_DEFINE(SDL_JOYSTICK_USBHID_MACHINE_JOYSTICK_H, 1, [ ])
fi
AC_MSG_RESULT($have_machine_joystick)
2006-02-16 10:11:48 +00:00
2013-10-13 19:49:45 -07:00
AC_DEFINE(SDL_JOYSTICK_USBHID, 1, [ ])
SOURCES="$SOURCES $srcdir/src/joystick/bsd/*.c"
EXTRA_CFLAGS="$EXTRA_CFLAGS $USB_CFLAGS"
EXTRA_LDFLAGS="$EXTRA_LDFLAGS $USB_LIBS"
have_joystick=yes
fi
CFLAGS="$save_CFLAGS"
2006-03-21 08:54:50 +00:00
fi
2013-10-13 19:49:45 -07:00
;;
esac
2006-02-16 10:11:48 +00:00
}
2018-08-09 16:00:17 -07:00
dnl Check for HIDAPI joystick drivers
CheckHIDAPI()
{
# The hidraw support doesn't catch Xbox, PS4 and Nintendo controllers,
# so we'll just use libusb when it's available.
#
# Except that libusb requires root permissions to open devices, so that's not generally useful, and we'll disable this by default.
AC_ARG_ENABLE(hidapi,
AC_HELP_STRING([--enable-hidapi], [use HIDAPI for low level joystick drivers [[default=no]]]),
, enable_hidapi=no)
if test x$enable_joystick = xyes -a x$enable_hidapi = xyes; then
hidapi_support=no
AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
if test x$PKG_CONFIG != xno; then
LIBUSB_CFLAGS=`$PKG_CONFIG --cflags libusb-1.0`
LIBUSB_LDFLAGS=`$PKG_CONFIG --libs libusb-1.0`
save_CFLAGS="$CFLAGS"
CFLAGS="$save_CFLAGS $LIBUSB_CFLAGS"
AC_CHECK_HEADER(libusb.h, have_libusb_h=yes)
CFLAGS="$save_CFLAGS"
fi
if test x$have_libusb_h = xyes; then
hidapi_support=yes
AC_DEFINE(SDL_JOYSTICK_HIDAPI, 1, [ ])
EXTRA_CFLAGS="$EXTRA_CFLAGS -I$srcdir/src/hidapi/hidapi"
SOURCES="$SOURCES $srcdir/src/joystick/hidapi/*.c"
SOURCES="$SOURCES $srcdir/src/hidapi/libusb/hid.c"
EXTRA_CFLAGS="$EXTRA_CFLAGS $LIBUSB_CFLAGS"
EXTRA_LDFLAGS="$EXTRA_LDFLAGS $LIBUSB_LDFLAGS"
fi
AC_MSG_CHECKING(for hidapi support)
AC_MSG_RESULT($hidapi_support)
fi
}
2006-02-16 10:11:48 +00:00
dnl Check for clock_gettime()
CheckClockGettime()
{
AC_ARG_ENABLE(clock_gettime,
2013-05-02 21:23:38 -04:00
AC_HELP_STRING([--enable-clock_gettime], [use clock_gettime() instead of gettimeofday() on UNIX [[default=yes]]]),
, enable_clock_gettime=yes)
2006-02-16 10:11:48 +00:00
if test x$enable_clock_gettime = xyes; then
AC_CHECK_LIB(rt, clock_gettime, have_clock_gettime=yes)
if test x$have_clock_gettime = xyes; then
2011-06-04 15:26:02 -04:00
AC_DEFINE(HAVE_CLOCK_GETTIME, 1, [ ])
2006-03-14 02:46:26 +00:00
EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lrt"
2009-03-04 15:10:47 +00:00
else
AC_CHECK_LIB(c, clock_gettime, have_clock_gettime=yes)
if test x$have_clock_gettime = xyes; then
2011-06-04 15:26:02 -04:00
AC_DEFINE(HAVE_CLOCK_GETTIME, 1, [ ])
2009-03-04 15:10:47 +00:00
EXTRA_LDFLAGS="$EXTRA_LDFLAGS"
fi
2001-04-26 16:45:43 +00:00
fi
2006-02-16 10:11:48 +00:00
fi
}
dnl Check for a valid linux/version.h
CheckLinuxVersion()
{
AC_CHECK_HEADER(linux/version.h, have_linux_version_h=yes)
if test x$have_linux_version_h = xyes; then
2006-03-14 02:46:26 +00:00
EXTRA_CFLAGS="$EXTRA_CFLAGS -DHAVE_LINUX_VERSION_H"
2006-02-16 10:11:48 +00:00
fi
}
dnl Check if we want to use RPATH
CheckRPATH()
{
AC_ARG_ENABLE(rpath,
2006-04-14 06:03:09 +00:00
AC_HELP_STRING([--enable-rpath], [use an rpath when linking SDL [[default=yes]]]),
2006-02-16 10:11:48 +00:00
, enable_rpath=yes)
}
2016-01-04 22:58:38 -05:00
dnl Do this on all platforms, before everything else (other things might want to override it).
CheckWarnAll
2006-03-19 05:27:22 +00:00
dnl Set up the configuration based on the host platform!
case "$host" in
2017-07-01 17:50:47 -04:00
*-*-linux*|*-*-uclinux*|*-*-gnu*|*-*-k*bsd*-gnu|*-*-bsdi*|*-*-freebsd*|*-*-dragonfly*|*-*-netbsd*|*-*-openbsd*|*-*-sysv5*|*-*-solaris*|*-*-hpux*|*-*-aix*|*-*-minix*|*-*-nto*)
2006-03-19 05:27:22 +00:00
case "$host" in
2017-11-04 09:00:40 -07:00
*-*-android*)
2014-04-06 00:30:48 +03:00
# Android
ARCH=android
ANDROID_CFLAGS="-DGL_GLEXT_PROTOTYPES"
CFLAGS="$CFLAGS $ANDROID_CFLAGS"
SDL_CFLAGS="$SDL_CFLAGS $ANDROID_CFLAGS"
EXTRA_CFLAGS="$EXTRA_CFLAGS $ANDROID_CFLAGS"
EXTRA_LDFLAGS="$EXTRA_LDFLAGS -ldl -lGLESv1_CM -lGLESv2 -llog -landroid"
2017-08-13 18:12:06 -07:00
SDLMAIN_SOURCES="$srcdir/src/main/android/*.c"
2014-04-06 00:30:48 +03:00
if test x$enable_video = xyes; then
SOURCES="$SOURCES $srcdir/src/core/android/*.c $srcdir/src/video/android/*.c"
2015-04-11 05:58:37 +00:00
# FIXME: confdefs? Not AC_DEFINE?
2014-04-06 00:30:48 +03:00
$as_echo "#define SDL_VIDEO_DRIVER_ANDROID 1" >>confdefs.h
2014-05-05 22:36:47 +03:00
SUMMARY_video="${SUMMARY_video} android"
2014-04-06 00:30:48 +03:00
fi
;;
2006-02-16 10:11:48 +00:00
*-*-linux*) ARCH=linux ;;
2006-05-11 23:26:45 +00:00
*-*-uclinux*) ARCH=linux ;;
2006-02-16 10:11:48 +00:00
*-*-kfreebsd*-gnu) ARCH=kfreebsd-gnu ;;
*-*-knetbsd*-gnu) ARCH=knetbsd-gnu ;;
*-*-kopenbsd*-gnu) ARCH=kopenbsd-gnu ;;
*-*-gnu*) ARCH=gnu ;; # must be last of the gnu variants
*-*-bsdi*) ARCH=bsdi ;;
*-*-freebsd*) ARCH=freebsd ;;
2006-03-21 08:54:50 +00:00
*-*-dragonfly*) ARCH=freebsd ;;
2006-02-16 10:11:48 +00:00
*-*-netbsd*) ARCH=netbsd ;;
*-*-openbsd*) ARCH=openbsd ;;
*-*-sysv5*) ARCH=sysv5 ;;
*-*-solaris*) ARCH=solaris ;;
*-*-hpux*) ARCH=hpux ;;
*-*-aix*) ARCH=aix ;;
2008-10-29 05:56:23 +00:00
*-*-minix*) ARCH=minix ;;
2017-07-01 17:50:47 -04:00
*-*-nto*) ARCH=nto
CheckQNXVideo
;;
2006-02-16 10:11:48 +00:00
esac
2006-03-22 01:28:36 +00:00
CheckVisibilityHidden
2016-01-04 22:58:38 -05:00
CheckDeclarationAfterStatement
2001-04-26 16:50:19 +00:00
CheckDummyVideo
2001-06-16 01:51:42 +00:00
CheckDiskAudio
2006-03-14 08:53:33 +00:00
CheckDummyAudio
2002-05-19 20:06:01 +00:00
CheckDLOPEN
2001-05-23 00:36:17 +00:00
CheckOSS
2006-02-16 10:11:48 +00:00
CheckALSA
2007-08-20 01:02:37 +00:00
CheckPulseAudio
2017-06-08 13:27:58 -04:00
CheckJACK
2006-02-16 10:11:48 +00:00
CheckARTSC
2001-08-09 13:09:47 +00:00
CheckESD
2001-04-26 16:45:43 +00:00
CheckNAS
2013-07-07 02:03:07 -04:00
CheckSNDIO
2017-01-06 20:43:53 -08:00
CheckFusionSound
CheckLibSampleRate
2017-09-08 22:21:01 -07:00
# Need to check for Raspberry PI first and add platform specific compiler flags, otherwise the test for GLES fails!
CheckRPI
2001-04-26 16:45:43 +00:00
CheckX11
2006-02-16 10:11:48 +00:00
CheckDirectFB
2017-08-02 10:22:48 -07:00
CheckKMSDRM
2005-11-23 11:46:36 +00:00
CheckOpenGLX11
Fixed bug 1242 - PATCH: Improve support for OpenGL ES under X11
Scott Percival 2011-07-03 06:41:51 PDT
This submission is aimed at making life easier for OpenGL ES capable devices
running a X11 stack (e.g. Maemo, Meego, TrimSlice, other ARM SoC boards not
running Android). SDL's Pandora support already has the neccesary GLES-to-X11
glue code, however it's all ghetto'd off in Makefile.pandora and not very
flexible.
The patch:
- adds an awesome --enable-video-opengles option to configure
- re-modifies the opengles and opengles2 SDL_renderers to use function pointers
- no idea why this was removed?
- for SDL_Renderers, links in libGLESv1_CM, libGLES_CM (for PowerVR fans) or
libGLESv2 at runtime
- links in libEGL.so at runtime - the old code made an assumption that
eglFunctions could be pulled from the active GLES library, PowerVR for one
doesn't let you do that with their libGLESv2
- allows you to pick which of GLES v1 or v2 to load via
SDL_GL_CONTEXT_MAJOR_VERSION
So far I've tested this on a Nokia N900 (OMAP 3430/SGX 530 running Maemo 5) and
a Toshiba AC100 (Tegra 2 running Ubuntu 10.10). I haven't tested it on... well,
everything that isn't those two, such as a Pandora, iOS or Android device. The
Pandora specific code should be kept intact (fingers crossed), and nothing
painfully drastic has been added to the SDL_renderers. The library loading
sequence in SDL_x11opengles has been updated to accomodate both NVIDIA's
propensity to let developers get away with murder and PowerVR's alternative of
punishing every missed step.
The test apps work okay with GLES or GLES2 as the renderer. For some reason
alpha blending doesn't seem to work on the Tegra 2; last week NVIDIA pushed out
a new set of X11 GLES drivers, so I'll try and investigate once I upgrade
those. Also, this patch adds things to configure.in, include/SDL_config.h.in
and test/configure.in. I didn't know what the policy was re. committing
generated spaghetti from autotools, so ./autogen.sh has to be run again. Sorry.
I think that's about everything, let me know if there's anything I've
overlooked.
2012-01-08 02:23:37 -05:00
CheckOpenGLESX11
2017-08-27 22:15:57 -04:00
CheckVulkan
2014-05-13 19:42:40 -03:00
CheckWayland
2012-12-11 12:07:06 -05:00
CheckLibUDev
2012-12-28 03:46:55 -05:00
CheckDBus
2016-10-07 18:57:40 -07:00
CheckIME
2014-06-18 20:11:39 +01:00
CheckIBus
2016-10-07 18:57:40 -07:00
CheckFcitx
2015-04-25 20:49:26 -04:00
case $ARCH in
linux)
CheckInputEvents
CheckInputKD
;;
esac
2006-02-16 10:11:48 +00:00
CheckTslib
CheckUSBHID
2018-08-09 16:00:17 -07:00
CheckHIDAPI
2001-04-26 16:45:43 +00:00
CheckPTHREAD
2006-02-16 10:11:48 +00:00
CheckClockGettime
CheckLinuxVersion
CheckRPATH
2014-10-15 09:18:17 -07:00
CheckVivanteVideo
2017-07-01 17:50:47 -04:00
2001-04-26 16:45:43 +00:00
# Set up files for the audio library
if test x$enable_audio = xyes; then
2006-02-16 10:11:48 +00:00
case $ARCH in
2006-03-21 08:54:50 +00:00
sysv5|solaris|hpux)
2011-06-04 15:26:02 -04:00
AC_DEFINE(SDL_AUDIO_DRIVER_SUNAUDIO, 1, [ ])
2006-02-16 10:11:48 +00:00
SOURCES="$SOURCES $srcdir/src/audio/sun/*.c"
2017-07-07 23:00:47 +02:00
SUMMARY_audio="${SUMMARY_audio} sun"
2006-02-16 10:11:48 +00:00
have_audio=yes
;;
2013-07-08 13:26:59 -04:00
netbsd) # Don't use this on OpenBSD, it's busted.
2017-05-24 19:56:59 -04:00
AC_DEFINE(SDL_AUDIO_DRIVER_NETBSD, 1, [ ])
SOURCES="$SOURCES $srcdir/src/audio/netbsd/*.c"
2017-07-07 23:00:47 +02:00
SUMMARY_audio="${SUMMARY_audio} netbsd"
2006-02-16 10:11:48 +00:00
have_audio=yes
;;
aix)
2011-06-04 15:26:02 -04:00
AC_DEFINE(SDL_AUDIO_DRIVER_PAUDIO, 1, [ ])
2006-02-16 10:11:48 +00:00
SOURCES="$SOURCES $srcdir/src/audio/paudio/*.c"
2017-07-07 23:00:47 +02:00
SUMMARY_audio="${SUMMARY_audio} paudio"
2006-02-16 10:11:48 +00:00
have_audio=yes
;;
2014-04-06 00:30:48 +03:00
android)
AC_DEFINE(SDL_AUDIO_DRIVER_ANDROID, 1, [ ])
SOURCES="$SOURCES $srcdir/src/audio/android/*.c"
2014-05-05 22:36:47 +03:00
SUMMARY_audio="${SUMMARY_audio} android"
2014-04-06 00:30:48 +03:00
have_audio=yes
;;
2017-07-01 17:50:47 -04:00
nto)
CheckQNXAudio
;;
2006-02-16 10:11:48 +00:00
esac
2001-04-26 16:45:43 +00:00
fi
# Set up files for the joystick library
if test x$enable_joystick = xyes; then
2006-02-16 10:11:48 +00:00
case $ARCH in
linux)
2011-06-04 15:26:02 -04:00
AC_DEFINE(SDL_JOYSTICK_LINUX, 1, [ ])
2006-02-16 10:11:48 +00:00
SOURCES="$SOURCES $srcdir/src/joystick/linux/*.c"
2017-09-22 08:30:52 -07:00
SOURCES="$SOURCES $srcdir/src/joystick/steam/*.c"
2006-02-16 10:11:48 +00:00
have_joystick=yes
;;
2014-04-06 00:30:48 +03:00
android)
AC_DEFINE(SDL_JOYSTICK_ANDROID, 1, [ ])
SOURCES="$SOURCES $srcdir/src/joystick/android/*.c"
2017-09-22 16:33:34 -07:00
SOURCES="$SOURCES $srcdir/src/joystick/steam/*.c"
2014-04-06 00:30:48 +03:00
have_joystick=yes
;;
2006-02-16 10:11:48 +00:00
esac
2001-04-26 16:45:43 +00:00
fi
2008-08-25 09:55:03 +00:00
# Set up files for the haptic library
if test x$enable_haptic = xyes; then
2017-11-04 09:00:40 -07:00
case $ARCH in
linux)
if test x$use_input_events = xyes; then
AC_DEFINE(SDL_HAPTIC_LINUX, 1, [ ])
SOURCES="$SOURCES $srcdir/src/haptic/linux/*.c"
have_haptic=yes
fi
;;
android)
AC_DEFINE(SDL_HAPTIC_ANDROID, 1, [ ])
SOURCES="$SOURCES $srcdir/src/haptic/android/*.c"
have_haptic=yes
;;
esac
2008-08-25 09:55:03 +00:00
fi
2018-08-21 13:29:21 -07:00
# Set up files for the sensor library
if test x$enable_sensor = xyes; then
case $ARCH in
android)
AC_DEFINE(SDL_SENSOR_ANDROID, 1, [ ])
SOURCES="$SOURCES $srcdir/src/sensor/android/*.c"
have_sensor=yes
;;
esac
fi
2009-06-07 06:06:35 +00:00
# Set up files for the power library
if test x$enable_power = xyes; then
case $ARCH in
linux)
2011-06-04 15:26:02 -04:00
AC_DEFINE(SDL_POWER_LINUX, 1, [ ])
2009-06-07 06:06:35 +00:00
SOURCES="$SOURCES $srcdir/src/power/linux/*.c"
have_power=yes
;;
2014-04-06 00:30:48 +03:00
android)
AC_DEFINE(SDL_POWER_ANDROID, 1, [ ])
SOURCES="$SOURCES $srcdir/src/power/android/*.c"
have_power=yes
;;
2009-06-07 06:06:35 +00:00
esac
fi
2013-08-20 19:57:11 -04:00
# Set up files for the filesystem library
if test x$enable_filesystem = xyes; then
2015-01-26 22:00:29 +01:00
case $ARCH in
android)
AC_DEFINE(SDL_FILESYSTEM_ANDROID, 1, [ ])
SOURCES="$SOURCES $srcdir/src/filesystem/android/*.c"
have_filesystem=yes
;;
2015-01-26 22:27:27 +01:00
*)
AC_DEFINE(SDL_FILESYSTEM_UNIX, 1, [ ])
SOURCES="$SOURCES $srcdir/src/filesystem/unix/*.c"
have_filesystem=yes
;;
2015-01-26 22:00:29 +01:00
esac
2013-08-20 19:57:11 -04:00
fi
2001-04-26 16:45:43 +00:00
# Set up files for the timer library
if test x$enable_timers = xyes; then
2011-06-04 15:26:02 -04:00
AC_DEFINE(SDL_TIMER_UNIX, 1, [ ])
2006-02-16 10:11:48 +00:00
SOURCES="$SOURCES $srcdir/src/timer/unix/*.c"
have_timers=yes
fi
2013-09-28 13:28:19 -03:00
# Set up files for udev hotplugging support
if test x$enable_libudev = xyes && test x$have_libudev_h_hdr = xyes; then
SOURCES="$SOURCES $srcdir/src/core/linux/SDL_udev.c"
fi
2013-11-17 10:41:16 -03:00
# Set up files for evdev input
if test x$use_input_events = xyes; then
2017-01-09 02:54:42 -08:00
SOURCES="$SOURCES $srcdir/src/core/linux/SDL_evdev*.c"
2013-11-17 10:41:16 -03:00
fi
2017-08-14 20:22:19 -07:00
# Set up other core UNIX files
2018-12-05 16:51:22 -05:00
SOURCES="$SOURCES $srcdir/src/core/linux/SDL_threadprio.c"
2017-08-14 20:22:19 -07:00
SOURCES="$SOURCES $srcdir/src/core/unix/*.c"
2001-04-26 16:45:43 +00:00
;;
*-*-cygwin* | *-*-mingw32*)
ARCH=win32
2006-03-19 05:27:22 +00:00
if test "$build" != "$host"; then # cross-compiling
2001-04-26 16:45:43 +00:00
# Default cross-compile location
2010-07-05 12:41:28 -07:00
ac_default_prefix=/usr/local/cross-tools/$host
2001-04-26 16:45:43 +00:00
else
# Look for the location of the tools and install there
2003-11-24 21:57:13 +00:00
if test "$BUILD_PREFIX" != ""; then
2001-04-26 16:50:19 +00:00
ac_default_prefix=$BUILD_PREFIX
fi
2001-04-26 16:45:43 +00:00
fi
2017-02-26 00:54:45 -05:00
CheckDeclarationAfterStatement
2001-04-26 16:50:19 +00:00
CheckDummyVideo
2001-06-16 01:51:42 +00:00
CheckDiskAudio
2006-03-14 08:53:33 +00:00
CheckDummyAudio
2011-01-20 18:04:05 -08:00
CheckWINDOWS
CheckWINDOWSGL
2013-11-22 14:19:52 -03:00
CheckWINDOWSGLES
2017-08-27 22:15:57 -04:00
CheckVulkan
2001-04-26 16:45:43 +00:00
CheckDIRECTX
2011-01-24 21:41:36 -08:00
# Set up the core platform files
SOURCES="$SOURCES $srcdir/src/core/windows/*.c"
2006-07-10 21:04:37 +00:00
# Set up files for the video library
if test x$enable_video = xyes; then
2011-06-04 15:26:02 -04:00
AC_DEFINE(SDL_VIDEO_DRIVER_WINDOWS, 1, [ ])
2011-01-20 18:04:05 -08:00
SOURCES="$SOURCES $srcdir/src/video/windows/*.c"
2006-07-10 21:04:37 +00:00
have_video=yes
AC_ARG_ENABLE(render-d3d,
AC_HELP_STRING([--enable-render-d3d], [enable the Direct3D render driver [[default=yes]]]),
, enable_render_d3d=yes)
if test x$enable_render_d3d = xyes -a x$have_d3d = xyes; then
2011-06-04 15:26:02 -04:00
AC_DEFINE(SDL_VIDEO_RENDER_D3D, 1, [ ])
2006-07-10 21:04:37 +00:00
fi
2014-03-10 01:51:03 -07:00
if test x$enable_render_d3d = xyes -a x$have_d3d11 = xyes; then
AC_DEFINE(SDL_VIDEO_RENDER_D3D11, 1, [ ])
fi
2006-07-10 21:04:37 +00:00
fi
2001-04-26 16:45:43 +00:00
# Set up files for the audio library
if test x$enable_audio = xyes; then
2011-08-04 01:24:22 -04:00
AC_DEFINE(SDL_AUDIO_DRIVER_WINMM, 1, [ ])
SOURCES="$SOURCES $srcdir/src/audio/winmm/*.c"
2006-07-10 21:04:37 +00:00
if test x$have_dsound = xyes; then
2011-06-04 15:26:02 -04:00
AC_DEFINE(SDL_AUDIO_DRIVER_DSOUND, 1, [ ])
2011-08-04 01:26:12 -04:00
SOURCES="$SOURCES $srcdir/src/audio/directsound/*.c"
2001-04-26 16:45:43 +00:00
fi
2018-07-01 19:50:00 +03:00
if test x$have_wasapi = xyes -a x$enable_wasapi = xyes; then
2017-08-21 11:17:38 -07:00
AC_DEFINE(SDL_AUDIO_DRIVER_WASAPI, 1, [ ])
2018-07-01 17:01:04 +03:00
SUMMARY_audio="${SUMMARY_audio} wasapi"
2017-08-21 11:17:38 -07:00
SOURCES="$SOURCES $srcdir/src/audio/wasapi/*.c"
fi
2006-02-16 10:11:48 +00:00
have_audio=yes
2001-04-26 16:45:43 +00:00
fi
# Set up files for the joystick library
if test x$enable_joystick = xyes; then
2014-07-03 15:39:55 -07:00
if test x$have_dinput = xyes -o x$have_xinput = xyes; then
if test x$have_xinput = xyes; then
AC_DEFINE(SDL_JOYSTICK_XINPUT, 1, [ ])
fi
if test x$have_dinput = xyes; then
AC_DEFINE(SDL_JOYSTICK_DINPUT, 1, [ ])
EXTRA_LDFLAGS="$EXTRA_LDFLAGS -ldinput8 -ldxguid -ldxerr8"
fi
2006-07-10 21:04:37 +00:00
else
2011-06-04 15:26:02 -04:00
AC_DEFINE(SDL_JOYSTICK_WINMM, 1, [ ])
2006-07-10 21:04:37 +00:00
fi
2018-09-28 00:40:35 -07:00
AC_DEFINE(SDL_JOYSTICK_HIDAPI, 1, [ ])
2018-09-28 01:00:47 -07:00
SOURCES="$SOURCES $srcdir/src/joystick/windows/*.c"
2018-09-28 00:40:35 -07:00
SOURCES="$SOURCES $srcdir/src/joystick/hidapi/*.c"
2018-09-28 01:00:47 -07:00
SOURCES="$SOURCES $srcdir/src/hidapi/windows/hid.c"
EXTRA_CFLAGS="$EXTRA_CFLAGS -I$srcdir/src/hidapi/hidapi"
have_joystick=yes
2018-09-28 00:40:35 -07:00
fi
2008-08-25 09:55:03 +00:00
if test x$enable_haptic = xyes; then
2014-07-03 15:39:55 -07:00
if test x$have_dinput = xyes -o x$have_xinput = xyes; then
if test x$have_xinput = xyes; then
AC_DEFINE(SDL_HAPTIC_XINPUT, 1, [ ])
fi
if test x$have_dinput = xyes; then
AC_DEFINE(SDL_HAPTIC_DINPUT, 1, [ ])
fi
2014-07-07 10:26:28 -07:00
SOURCES="$SOURCES $srcdir/src/haptic/windows/*.c"
2008-08-25 09:55:03 +00:00
have_haptic=yes
fi
fi
2009-06-07 06:06:35 +00:00
if test x$enable_power = xyes; then
2011-06-04 15:26:02 -04:00
AC_DEFINE(SDL_POWER_WINDOWS, 1, [ ])
2009-06-07 06:06:35 +00:00
SOURCES="$SOURCES $srcdir/src/power/windows/SDL_syspower.c"
have_power=yes
fi
2013-08-20 19:57:11 -04:00
if test x$enable_filesystem = xyes; then
AC_DEFINE(SDL_FILESYSTEM_WINDOWS, 1, [ ])
SOURCES="$SOURCES $srcdir/src/filesystem/windows/SDL_sysfilesystem.c"
have_filesystem=yes
fi
2001-04-26 16:45:43 +00:00
# Set up files for the thread library
if test x$enable_threads = xyes; then
2011-06-04 15:26:02 -04:00
AC_DEFINE(SDL_THREAD_WINDOWS, 1, [ ])
2013-07-10 02:32:04 -07:00
SOURCES="$SOURCES $srcdir/src/thread/windows/*.c"
2006-02-16 10:11:48 +00:00
SOURCES="$SOURCES $srcdir/src/thread/generic/SDL_syscond.c"
have_threads=yes
2001-04-26 16:45:43 +00:00
fi
# Set up files for the timer library
if test x$enable_timers = xyes; then
2011-06-04 15:26:02 -04:00
AC_DEFINE(SDL_TIMER_WINDOWS, 1, [ ])
2011-01-20 18:04:05 -08:00
SOURCES="$SOURCES $srcdir/src/timer/windows/*.c"
2006-02-16 10:11:48 +00:00
have_timers=yes
fi
# Set up files for the shared object loading library
if test x$enable_loadso = xyes; then
2011-06-04 15:26:02 -04:00
AC_DEFINE(SDL_LOADSO_WINDOWS, 1, [ ])
2011-01-20 18:04:05 -08:00
SOURCES="$SOURCES $srcdir/src/loadso/windows/*.c"
2006-02-16 10:11:48 +00:00
have_loadso=yes
fi
# Set up the system libraries we need
2014-03-01 11:39:39 -08:00
if test -f /lib/w32api/libuuid.a; then
2014-02-22 15:34:31 -08:00
LIBUUID=/lib/w32api/libuuid.a
else
LIBUUID=-luuid
fi
2018-09-28 01:00:47 -07:00
EXTRA_LDFLAGS="$EXTRA_LDFLAGS -luser32 -lgdi32 -lwinmm -limm32 -lole32 -loleaut32 -lshell32 -lsetupapi -lversion $LIBUUID -static-libgcc"
2011-01-20 18:04:05 -08:00
# The Windows platform requires special setup
VERSION_SOURCES="$srcdir/src/main/windows/*.rc"
SDLMAIN_SOURCES="$srcdir/src/main/windows/*.c"
2001-04-26 16:45:43 +00:00
SDL_CFLAGS="$SDL_CFLAGS -Dmain=SDL_main"
2013-07-21 23:01:01 -07:00
SDL_LIBS="-lSDL2main $SDL_LIBS -mwindows"
# Check to see if this is a mingw or cygwin build
have_mingw32=
AC_CHECK_LIB(mingw32, main, [have_mingw32=yes])
if test x$have_mingw32 = xyes; then
SDL_LIBS="-lmingw32 $SDL_LIBS"
else
SDL_LIBS="-lcygwin $SDL_LIBS"
fi
2001-04-26 16:45:43 +00:00
;;
2013-11-13 22:35:26 -05:00
dnl BeOS support removed after SDL 2.0.1. Haiku still works. --ryan.
2013-11-14 11:51:24 -05:00
*-*-beos*)
AC_MSG_ERROR([
*** BeOS support has been removed as of SDL 2.0.2.
])
;;
2013-11-13 22:35:26 -05:00
*-*-haiku*)
2013-11-14 11:51:24 -05:00
ARCH=haiku
2013-11-14 14:45:00 -05:00
ac_default_prefix=/boot/system
2001-04-26 16:50:19 +00:00
CheckDummyVideo
2001-06-16 01:51:42 +00:00
CheckDiskAudio
2006-03-14 08:53:33 +00:00
CheckDummyAudio
2016-11-01 10:30:46 -07:00
CheckDLOPEN
2013-11-14 11:51:24 -05:00
CheckHaikuVideo
CheckHaikuGL
2013-11-13 22:35:26 -05:00
CheckPTHREAD
2013-11-14 11:51:24 -05:00
2001-04-26 16:45:43 +00:00
# Set up files for the audio library
if test x$enable_audio = xyes; then
2013-11-14 11:51:24 -05:00
AC_DEFINE(SDL_AUDIO_DRIVER_HAIKU, 1, [ ])
SOURCES="$SOURCES $srcdir/src/audio/haiku/*.cc"
2017-07-07 23:00:47 +02:00
SUMMARY_audio="${SUMMARY_audio} haiku"
2006-02-16 10:11:48 +00:00
have_audio=yes
2001-04-26 16:45:43 +00:00
fi
# Set up files for the joystick library
if test x$enable_joystick = xyes; then
2013-11-14 11:51:24 -05:00
AC_DEFINE(SDL_JOYSTICK_HAIKU, 1, [ ])
SOURCES="$SOURCES $srcdir/src/joystick/haiku/*.cc"
2006-02-16 10:11:48 +00:00
have_joystick=yes
2001-04-26 16:45:43 +00:00
fi
# Set up files for the timer library
if test x$enable_timers = xyes; then
2013-11-14 11:51:24 -05:00
AC_DEFINE(SDL_TIMER_HAIKU, 1, [ ])
SOURCES="$SOURCES $srcdir/src/timer/haiku/*.c"
2006-02-16 10:11:48 +00:00
have_timers=yes
fi
2009-06-07 22:44:59 +00:00
# Set up files for the system power library
if test x$enable_power = xyes; then
2013-11-14 11:51:24 -05:00
AC_DEFINE(SDL_POWER_HAIKU, 1, [ ])
SOURCES="$SOURCES $srcdir/src/power/haiku/*.c"
2009-06-07 22:44:59 +00:00
have_power=yes
fi
2013-08-20 19:57:11 -04:00
# Set up files for the system filesystem library
if test x$enable_filesystem = xyes; then
2013-11-14 11:51:24 -05:00
AC_DEFINE(SDL_FILESYSTEM_HAIKU, 1, [ ])
SOURCES="$SOURCES $srcdir/src/filesystem/haiku/*.cc"
2013-08-20 19:57:11 -04:00
have_filesystem=yes
fi
2013-11-14 11:51:24 -05:00
# The Haiku platform requires special setup.
SOURCES="$srcdir/src/main/haiku/*.cc $SOURCES"
2017-08-09 18:41:59 -04:00
EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lroot -lbe -lmedia -lgame -ldevice -ltextencoding"
# Haiku's x86 spins use libstdc++.r4.so (for binary compat?), but
# other spins, like x86-64, use a more standard "libstdc++.so.*"
AC_CHECK_FILE("/boot/system/lib/libstdc++.r4.so", EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lstdc++.r4", EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lstdc++")
2001-04-26 16:45:43 +00:00
;;
2017-02-20 10:55:49 -08:00
arm*-apple-darwin*|*-ios-*)
2012-06-19 12:29:53 -04:00
ARCH=ios
CheckVisibilityHidden
2016-01-04 22:58:38 -05:00
CheckDeclarationAfterStatement
2012-06-19 12:29:53 -04:00
CheckDummyVideo
CheckDiskAudio
CheckDummyAudio
CheckDLOPEN
2016-04-21 03:16:44 -04:00
CheckMETAL
2017-08-27 22:15:57 -04:00
CheckVulkan
2016-04-21 03:16:44 -04:00
CheckPTHREAD
2012-06-19 12:29:53 -04:00
# Set up files for the audio library
if test x$enable_audio = xyes; then
2017-02-20 10:55:49 -08:00
AC_DEFINE(SDL_AUDIO_DRIVER_COREAUDIO, 1, [ ])
2016-09-15 08:29:20 -07:00
SOURCES="$SOURCES $srcdir/src/audio/coreaudio/*.m"
2014-06-15 01:19:01 -04:00
SUMMARY_audio="${SUMMARY_audio} coreaudio"
2012-06-19 12:29:53 -04:00
have_audio=yes
fi
# Set up files for the joystick library
if test x$enable_joystick = xyes; then
2017-02-20 10:55:49 -08:00
AC_DEFINE(SDL_JOYSTICK_MFI, 1, [ ])
2012-06-19 12:29:53 -04:00
SOURCES="$SOURCES $srcdir/src/joystick/iphoneos/*.m"
2017-09-22 16:33:34 -07:00
SOURCES="$SOURCES $srcdir/src/joystick/steam/*.c"
2012-06-19 12:29:53 -04:00
have_joystick=yes
fi
# Set up files for the haptic library
#if test x$enable_haptic = xyes; then
# SOURCES="$SOURCES $srcdir/src/haptic/darwin/*.c"
# have_haptic=yes
# EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,ForceFeedback"
#fi
# Set up files for the power library
if test x$enable_power = xyes; then
2017-02-20 10:55:49 -08:00
AC_DEFINE(SDL_POWER_UIKIT, 1, [ ])
2012-06-19 12:29:53 -04:00
SOURCES="$SOURCES $srcdir/src/power/uikit/*.m"
have_power=yes
fi
2013-08-20 19:57:11 -04:00
# Set up files for the filesystem library
if test x$enable_filesystem = xyes; then
SOURCES="$SOURCES $srcdir/src/filesystem/cocoa/*.m"
have_filesystem=yes
fi
2017-02-20 10:55:49 -08:00
# Set up additional files for the file library
if test x$enable_file = xyes; then
AC_DEFINE(SDL_FILESYSTEM_COCOA, 1, [ ])
SOURCES="$SOURCES $srcdir/src/file/cocoa/*.m"
fi
2012-06-19 12:29:53 -04:00
# Set up files for the timer library
if test x$enable_timers = xyes; then
2017-02-20 10:55:49 -08:00
AC_DEFINE(SDL_TIMER_UNIX, 1, [ ])
2012-06-19 12:29:53 -04:00
SOURCES="$SOURCES $srcdir/src/timer/unix/*.c"
have_timers=yes
fi
2017-08-18 19:52:58 -04:00
# Set up other core UNIX files
SOURCES="$SOURCES $srcdir/src/core/unix/*.c"
2012-06-19 12:29:53 -04:00
# The iOS platform requires special setup.
2017-02-20 10:55:49 -08:00
AC_DEFINE(SDL_VIDEO_DRIVER_UIKIT, 1, [ ])
AC_DEFINE(SDL_VIDEO_OPENGL_ES2, 1, [ ])
AC_DEFINE(SDL_VIDEO_OPENGL_ES, 1, [ ])
AC_DEFINE(SDL_VIDEO_RENDER_OGL_ES, 1, [ ])
AC_DEFINE(SDL_VIDEO_RENDER_OGL_ES2, 1, [ ])
2012-06-19 12:29:53 -04:00
SOURCES="$SOURCES $srcdir/src/video/uikit/*.m"
2013-03-04 10:33:48 -03:00
EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lm -liconv -lobjc"
2017-02-20 10:55:49 -08:00
EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,AVFoundation"
2013-03-04 10:33:48 -03:00
EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,AudioToolbox"
2017-02-20 10:55:49 -08:00
EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,CoreAudio"
2013-03-04 10:33:48 -03:00
EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,CoreGraphics"
2014-07-07 10:42:19 -07:00
EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,CoreMotion"
2017-02-20 10:55:49 -08:00
EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,Foundation"
2015-09-21 21:16:54 +02:00
EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,GameController"
2017-02-20 10:55:49 -08:00
EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,OpenGLES"
EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,QuartzCore"
EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,UIKit"
2016-04-21 03:16:44 -04:00
if test x$enable_render = xyes -a x$enable_render_metal = xyes; then
EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,Metal"
fi
2012-06-19 12:29:53 -04:00
;;
2001-04-26 16:45:43 +00:00
*-*-darwin* )
The MacOSX Carbon/Cocoa/X11 all in one library patch. Relevant emails:
To: SDL Developers <sdl@libsdl.org>
From: =?ISO-8859-1?Q?Anders_F_Bj=F6rklund?= <afb@algonet.se>
Date: Mon, 30 May 2005 23:29:04 +0200
Subject: [SDL] Mac OS X Video Drivers [patch]
I've updated/added the Carbon and X11 video drivers
to the Mac OS X port of SDL 1.2 (the CVS version),
and made the Cocoa driver and runtime *optional*.
The default is still Cocoa, and the "Quartz" driver.
But you can now also use "toolbox" for Carbon, and
"x11" for running with Apple's (or other) X11 server:
export SDL_VIDEODRIVER=x11
export SDL_VIDEO_GL_DRIVER=/usr/X11R6/lib/libGL.dylib
It also checks if the frameworks are available, by a:
#include <Carbon/Carbon.h> or #import <Cocoa/Cocoa.h>
(this should make it configure on plain Darwin as well?)
Here are the new configure targets:
--enable-video-cocoa use Cocoa/Quartz video driver default=yes
--enable-video-carbon use Carbon/QuickDraw video driver default=yes
--enable-video-x11 use X11 video driver default=no
./configure --enable-video-cocoa --enable-video-carbon
--enable-video-x11 \
--x-includes=/usr/X11R6/include --x-libraries=/usr/X11R6/lib
The Carbon version is just an updated version of the old
SDL driver for Mac OS 9, and could probably be improved...
(but it does work, including the Carbon version of SDLmain)
If you disable cocoa, you can run with -framework Carbon only,
and the C version of SDL_main.c. And if you disable carbon too,
you can still use the X11 version which doesn't require SDLmain.
I updated the DrawSprocket version, but did not include it.
(no blitters or VRAM GWorlds etc. available on OS X anyway)
Besides for Mac OS 9, I don't think there's any use for it ?
And note that any performance on Mac OS X equals OpenGL anyway...
You can get "fair" software SDL results on captured CG displays,
but for decent frame rates you need to be using GL for rendering.
Finally, here is the patch itself:
http://www.algonet.se/~afb/SDL-12CVS-macvideo.patch
--anders
PS. It says "video", but as usual it applies to mouse/keyboard too.
------
To: A list for developers using the SDL library <sdl@libsdl.org>
From: =?ISO-8859-1?Q?Anders_F_Bj=F6rklund?= <afb@algonet.se>
Date: Sun, 4 Sep 2005 10:02:15 +0200
Subject: [SDL] Updated Mac patch
Updated the previous Mac patch to disable Carbon by default.
Also "fixed" the SDL.spec again, so that it builds on Darwin.
http://www.algonet.se/~afb/SDL-1.2.9-mac.patch
Also applied fine to SDL12 CVS, when I tried it.
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401136
2005-09-08 06:16:14 +00:00
# This could be either full "Mac OS X", or plain "Darwin" which is
2001-08-21 07:19:59 +00:00
# just the OS X kernel sans upper layers like Carbon and Cocoa.
The MacOSX Carbon/Cocoa/X11 all in one library patch. Relevant emails:
To: SDL Developers <sdl@libsdl.org>
From: =?ISO-8859-1?Q?Anders_F_Bj=F6rklund?= <afb@algonet.se>
Date: Mon, 30 May 2005 23:29:04 +0200
Subject: [SDL] Mac OS X Video Drivers [patch]
I've updated/added the Carbon and X11 video drivers
to the Mac OS X port of SDL 1.2 (the CVS version),
and made the Cocoa driver and runtime *optional*.
The default is still Cocoa, and the "Quartz" driver.
But you can now also use "toolbox" for Carbon, and
"x11" for running with Apple's (or other) X11 server:
export SDL_VIDEODRIVER=x11
export SDL_VIDEO_GL_DRIVER=/usr/X11R6/lib/libGL.dylib
It also checks if the frameworks are available, by a:
#include <Carbon/Carbon.h> or #import <Cocoa/Cocoa.h>
(this should make it configure on plain Darwin as well?)
Here are the new configure targets:
--enable-video-cocoa use Cocoa/Quartz video driver default=yes
--enable-video-carbon use Carbon/QuickDraw video driver default=yes
--enable-video-x11 use X11 video driver default=no
./configure --enable-video-cocoa --enable-video-carbon
--enable-video-x11 \
--x-includes=/usr/X11R6/include --x-libraries=/usr/X11R6/lib
The Carbon version is just an updated version of the old
SDL driver for Mac OS 9, and could probably be improved...
(but it does work, including the Carbon version of SDLmain)
If you disable cocoa, you can run with -framework Carbon only,
and the C version of SDL_main.c. And if you disable carbon too,
you can still use the X11 version which doesn't require SDLmain.
I updated the DrawSprocket version, but did not include it.
(no blitters or VRAM GWorlds etc. available on OS X anyway)
Besides for Mac OS 9, I don't think there's any use for it ?
And note that any performance on Mac OS X equals OpenGL anyway...
You can get "fair" software SDL results on captured CG displays,
but for decent frame rates you need to be using GL for rendering.
Finally, here is the patch itself:
http://www.algonet.se/~afb/SDL-12CVS-macvideo.patch
--anders
PS. It says "video", but as usual it applies to mouse/keyboard too.
------
To: A list for developers using the SDL library <sdl@libsdl.org>
From: =?ISO-8859-1?Q?Anders_F_Bj=F6rklund?= <afb@algonet.se>
Date: Sun, 4 Sep 2005 10:02:15 +0200
Subject: [SDL] Updated Mac patch
Updated the previous Mac patch to disable Carbon by default.
Also "fixed" the SDL.spec again, so that it builds on Darwin.
http://www.algonet.se/~afb/SDL-1.2.9-mac.patch
Also applied fine to SDL12 CVS, when I tried it.
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401136
2005-09-08 06:16:14 +00:00
# Next line is broken, and a few files below require Mac OS X (full)
2001-08-21 07:19:59 +00:00
ARCH=macosx
2006-04-13 13:29:00 +00:00
2006-04-13 14:14:06 +00:00
# Mac OS X builds with both the Carbon and OSX APIs at the moment
2006-04-17 03:34:28 +00:00
EXTRA_CFLAGS="$EXTRA_CFLAGS -DTARGET_API_MAC_CARBON"
EXTRA_CFLAGS="$EXTRA_CFLAGS -DTARGET_API_MAC_OSX"
2006-04-13 14:14:06 +00:00
2006-04-28 05:38:06 +00:00
CheckVisibilityHidden
2016-01-04 22:58:38 -05:00
CheckDeclarationAfterStatement
2001-04-26 16:50:19 +00:00
CheckDummyVideo
2001-06-16 01:51:42 +00:00
CheckDiskAudio
2006-03-14 08:53:33 +00:00
CheckDummyAudio
2006-04-17 03:34:28 +00:00
CheckDLOPEN
The MacOSX Carbon/Cocoa/X11 all in one library patch. Relevant emails:
To: SDL Developers <sdl@libsdl.org>
From: =?ISO-8859-1?Q?Anders_F_Bj=F6rklund?= <afb@algonet.se>
Date: Mon, 30 May 2005 23:29:04 +0200
Subject: [SDL] Mac OS X Video Drivers [patch]
I've updated/added the Carbon and X11 video drivers
to the Mac OS X port of SDL 1.2 (the CVS version),
and made the Cocoa driver and runtime *optional*.
The default is still Cocoa, and the "Quartz" driver.
But you can now also use "toolbox" for Carbon, and
"x11" for running with Apple's (or other) X11 server:
export SDL_VIDEODRIVER=x11
export SDL_VIDEO_GL_DRIVER=/usr/X11R6/lib/libGL.dylib
It also checks if the frameworks are available, by a:
#include <Carbon/Carbon.h> or #import <Cocoa/Cocoa.h>
(this should make it configure on plain Darwin as well?)
Here are the new configure targets:
--enable-video-cocoa use Cocoa/Quartz video driver default=yes
--enable-video-carbon use Carbon/QuickDraw video driver default=yes
--enable-video-x11 use X11 video driver default=no
./configure --enable-video-cocoa --enable-video-carbon
--enable-video-x11 \
--x-includes=/usr/X11R6/include --x-libraries=/usr/X11R6/lib
The Carbon version is just an updated version of the old
SDL driver for Mac OS 9, and could probably be improved...
(but it does work, including the Carbon version of SDLmain)
If you disable cocoa, you can run with -framework Carbon only,
and the C version of SDL_main.c. And if you disable carbon too,
you can still use the X11 version which doesn't require SDLmain.
I updated the DrawSprocket version, but did not include it.
(no blitters or VRAM GWorlds etc. available on OS X anyway)
Besides for Mac OS 9, I don't think there's any use for it ?
And note that any performance on Mac OS X equals OpenGL anyway...
You can get "fair" software SDL results on captured CG displays,
but for decent frame rates you need to be using GL for rendering.
Finally, here is the patch itself:
http://www.algonet.se/~afb/SDL-12CVS-macvideo.patch
--anders
PS. It says "video", but as usual it applies to mouse/keyboard too.
------
To: A list for developers using the SDL library <sdl@libsdl.org>
From: =?ISO-8859-1?Q?Anders_F_Bj=F6rklund?= <afb@algonet.se>
Date: Sun, 4 Sep 2005 10:02:15 +0200
Subject: [SDL] Updated Mac patch
Updated the previous Mac patch to disable Carbon by default.
Also "fixed" the SDL.spec again, so that it builds on Darwin.
http://www.algonet.se/~afb/SDL-1.2.9-mac.patch
Also applied fine to SDL12 CVS, when I tried it.
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401136
2005-09-08 06:16:14 +00:00
CheckCOCOA
2016-04-21 03:16:44 -04:00
CheckMETAL
2005-11-17 03:16:01 +00:00
CheckX11
2001-04-26 16:45:43 +00:00
CheckMacGL
2018-03-12 18:41:06 -07:00
CheckMacGLES
2005-11-23 11:46:36 +00:00
CheckOpenGLX11
2017-08-27 22:15:57 -04:00
CheckVulkan
2001-04-26 16:45:43 +00:00
CheckPTHREAD
2006-02-27 01:32:12 +00:00
2001-04-26 16:45:43 +00:00
# Set up files for the audio library
if test x$enable_audio = xyes; then
2011-06-04 15:26:02 -04:00
AC_DEFINE(SDL_AUDIO_DRIVER_COREAUDIO, 1, [ ])
2016-09-15 08:29:20 -07:00
SOURCES="$SOURCES $srcdir/src/audio/coreaudio/*.m"
2016-09-15 08:57:56 -07:00
EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,CoreAudio -Wl,-framework,AudioToolbox"
2014-06-15 01:19:01 -04:00
SUMMARY_audio="${SUMMARY_audio} coreaudio"
2006-02-16 10:11:48 +00:00
have_audio=yes
2001-04-26 16:45:43 +00:00
fi
# Set up files for the joystick library
if test x$enable_joystick = xyes; then
2011-06-04 15:26:02 -04:00
AC_DEFINE(SDL_JOYSTICK_IOKIT, 1, [ ])
2018-08-09 16:00:17 -07:00
AC_DEFINE(SDL_JOYSTICK_HIDAPI, 1, [ ])
2006-02-16 10:11:48 +00:00
SOURCES="$SOURCES $srcdir/src/joystick/darwin/*.c"
2018-08-09 16:00:17 -07:00
SOURCES="$SOURCES $srcdir/src/joystick/hidapi/*.c"
SOURCES="$SOURCES $srcdir/src/hidapi/mac/hid.c"
EXTRA_CFLAGS="$EXTRA_CFLAGS -I$srcdir/src/hidapi/hidapi"
2006-02-16 10:11:48 +00:00
have_joystick=yes
2001-04-26 16:45:43 +00:00
fi
2008-08-25 09:55:03 +00:00
# Set up files for the haptic library
if test x$enable_haptic = xyes; then
2011-06-04 15:26:02 -04:00
AC_DEFINE(SDL_HAPTIC_IOKIT, 1, [ ])
2008-08-25 09:55:03 +00:00
SOURCES="$SOURCES $srcdir/src/haptic/darwin/*.c"
2010-01-10 05:06:03 +00:00
EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,ForceFeedback"
2016-09-15 08:46:14 -07:00
have_haptic=yes
2008-08-25 09:55:03 +00:00
fi
2009-06-07 06:06:35 +00:00
# Set up files for the power library
if test x$enable_power = xyes; then
2011-06-04 15:26:02 -04:00
AC_DEFINE(SDL_POWER_MACOSX, 1, [ ])
2009-06-07 06:06:35 +00:00
SOURCES="$SOURCES $srcdir/src/power/macosx/*.c"
have_power=yes
fi
2013-08-20 19:57:11 -04:00
# Set up files for the filesystem library
if test x$enable_filesystem = xyes; then
AC_DEFINE(SDL_FILESYSTEM_COCOA, 1, [ ])
SOURCES="$SOURCES $srcdir/src/filesystem/cocoa/*.m"
have_filesystem=yes
fi
2001-04-26 16:45:43 +00:00
# Set up files for the timer library
if test x$enable_timers = xyes; then
2011-06-04 15:26:02 -04:00
AC_DEFINE(SDL_TIMER_UNIX, 1, [ ])
2006-02-16 10:11:48 +00:00
SOURCES="$SOURCES $srcdir/src/timer/unix/*.c"
have_timers=yes
fi
2010-05-09 10:00:33 -07:00
# Set up additional files for the file library
if test x$enable_file = xyes; then
SOURCES="$SOURCES $srcdir/src/file/cocoa/*.m"
fi
2017-08-18 19:52:58 -04:00
# Set up other core UNIX files
SOURCES="$SOURCES $srcdir/src/core/unix/*.c"
2006-04-13 13:08:26 +00:00
# The Mac OS X platform requires special setup.
2009-01-19 15:58:57 +00:00
EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lobjc"
2014-08-23 10:47:50 -07:00
EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,CoreVideo"
2010-01-10 05:06:03 +00:00
EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,Cocoa"
EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,Carbon"
EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,IOKit"
2017-12-07 16:08:09 -08:00
if test x$enable_render = xyes -a x$enable_render_metal = xyes; then
EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-weak_framework,QuartzCore -Wl,-weak_framework,Metal"
fi
2001-04-26 16:45:43 +00:00
;;
2014-06-06 15:45:59 -03:00
*-nacl|*-pnacl)
ARCH=nacl
CheckNativeClient
CheckDummyAudio
CheckDummyVideo
CheckInputEvents
2014-06-08 18:18:13 -03:00
CheckPTHREAD
2014-06-06 15:45:59 -03:00
# Set up files for the timer library
if test x$enable_timers = xyes; then
2017-05-02 11:16:58 -04:00
AC_DEFINE(SDL_TIMER_UNIX, 1, [ ])
2014-06-06 15:45:59 -03:00
SOURCES="$SOURCES $srcdir/src/timer/unix/*.c"
have_timers=yes
fi
2014-06-08 18:18:13 -03:00
if test x$enable_filesystem = xyes; then
AC_DEFINE(SDL_FILESYSTEM_NACL, 1, [ ])
SOURCES="$SOURCES $srcdir/src/filesystem/nacl/*.c"
have_filesystem=yes
fi
Initial merge of Emscripten port!
With this commit, you can compile SDL2 with Emscripten
( http://emscripten.org/ ), and make your SDL-based C/C++ program
into a web app.
This port was due to the efforts of several people, including: Charlie Birks,
Sathyanarayanan Gunasekaran, Jukka Jylänki, Alon Zakai, Edward Rudd,
Bruce Mitchener, and Martin Gerhardy. (Thanks, everyone!)
--HG--
extra : rebase_source : 97af74c8a5121e926ebe89f123536b5dd6681695
2014-12-18 00:19:52 -05:00
;;
*-*-emscripten* )
if test x$enable_video = xyes; then
AC_DEFINE(SDL_VIDEO_DRIVER_EMSCRIPTEN, 1, [ ])
SOURCES="$SOURCES $srcdir/src/video/emscripten/*.c"
have_video=yes
SUMMARY_video="${SUMMARY_video} emscripten"
fi
if test x$enable_audio = xyes; then
AC_DEFINE(SDL_AUDIO_DRIVER_EMSCRIPTEN, 1, [ ])
SOURCES="$SOURCES $srcdir/src/audio/emscripten/*.c"
have_audio=yes
SUMMARY_audio="${SUMMARY_audio} emscripten"
fi
CheckVisibilityHidden
2016-01-04 22:58:38 -05:00
CheckDeclarationAfterStatement
Initial merge of Emscripten port!
With this commit, you can compile SDL2 with Emscripten
( http://emscripten.org/ ), and make your SDL-based C/C++ program
into a web app.
This port was due to the efforts of several people, including: Charlie Birks,
Sathyanarayanan Gunasekaran, Jukka Jylänki, Alon Zakai, Edward Rudd,
Bruce Mitchener, and Martin Gerhardy. (Thanks, everyone!)
--HG--
extra : rebase_source : 97af74c8a5121e926ebe89f123536b5dd6681695
2014-12-18 00:19:52 -05:00
CheckDummyVideo
CheckDiskAudio
CheckDummyAudio
CheckDLOPEN
CheckClockGettime
CheckEmscriptenGLES
# Set up files for the power library
if test x$enable_power = xyes; then
AC_DEFINE(SDL_POWER_EMSCRIPTEN, 1, [ ])
SOURCES="$SOURCES $srcdir/src/power/emscripten/*.c"
have_power=yes
fi
2014-06-08 18:18:13 -03:00
Initial merge of Emscripten port!
With this commit, you can compile SDL2 with Emscripten
( http://emscripten.org/ ), and make your SDL-based C/C++ program
into a web app.
This port was due to the efforts of several people, including: Charlie Birks,
Sathyanarayanan Gunasekaran, Jukka Jylänki, Alon Zakai, Edward Rudd,
Bruce Mitchener, and Martin Gerhardy. (Thanks, everyone!)
--HG--
extra : rebase_source : 97af74c8a5121e926ebe89f123536b5dd6681695
2014-12-18 00:19:52 -05:00
# Set up files for the power library
if test x$enable_joystick = xyes; then
AC_DEFINE(SDL_JOYSTICK_EMSCRIPTEN, 1, [ ])
SOURCES="$SOURCES $srcdir/src/joystick/emscripten/*.c"
have_joystick=yes
fi
# Set up files for the filesystem library
if test x$enable_filesystem = xyes; then
AC_DEFINE(SDL_FILESYSTEM_EMSCRIPTEN, 1, [ ])
SOURCES="$SOURCES $srcdir/src/filesystem/emscripten/*.c"
have_filesystem=yes
fi
# Set up files for the timer library
if test x$enable_timers = xyes; then
AC_DEFINE(SDL_TIMER_UNIX, 1, [ ])
SOURCES="$SOURCES $srcdir/src/timer/unix/*.c"
have_timers=yes
fi
2014-06-06 15:45:59 -03:00
;;
2001-04-26 16:45:43 +00:00
*)
2006-02-16 10:11:48 +00:00
AC_MSG_ERROR([
2006-03-19 05:27:22 +00:00
*** Unsupported host: Please add to configure.in
2006-02-16 10:11:48 +00:00
])
2001-04-26 16:45:43 +00:00
;;
esac
2006-02-16 10:11:48 +00:00
# Verify that we have all the platform specific files we need
2006-11-03 21:48:35 +00:00
2009-04-03 13:35:05 +00:00
if test x$have_joystick != xyes; then
if test x$enable_joystick = xyes; then
2018-09-28 21:19:27 -07:00
AC_DEFINE(SDL_JOYSTICK_DUMMY, 1, [ ])
2009-03-23 05:35:21 +00:00
fi
2006-02-16 10:11:48 +00:00
SOURCES="$SOURCES $srcdir/src/joystick/dummy/*.c"
fi
2008-08-25 09:55:03 +00:00
if test x$have_haptic != xyes; then
if test x$enable_haptic = xyes; then
2018-09-28 21:19:27 -07:00
AC_DEFINE(SDL_HAPTIC_DUMMY, 1, [ ])
2008-08-25 09:55:03 +00:00
fi
SOURCES="$SOURCES $srcdir/src/haptic/dummy/*.c"
fi
2018-08-21 13:29:21 -07:00
if test x$have_sensor != xyes; then
if test x$enable_sensor = xyes; then
2018-09-28 21:19:27 -07:00
AC_DEFINE(SDL_SENSOR_DUMMY, 1, [ ])
2018-08-21 13:29:21 -07:00
fi
SOURCES="$SOURCES $srcdir/src/sensor/dummy/*.c"
fi
2006-02-16 10:11:48 +00:00
if test x$have_threads != xyes; then
if test x$enable_threads = xyes; then
2011-06-04 15:26:02 -04:00
AC_DEFINE(SDL_THREADS_DISABLED, 1, [ ])
2006-02-16 10:11:48 +00:00
fi
SOURCES="$SOURCES $srcdir/src/thread/generic/*.c"
fi
if test x$have_timers != xyes; then
if test x$enable_timers = xyes; then
2011-06-04 15:26:02 -04:00
AC_DEFINE(SDL_TIMERS_DISABLED, 1, [ ])
2006-02-16 10:11:48 +00:00
fi
SOURCES="$SOURCES $srcdir/src/timer/dummy/*.c"
fi
2013-08-20 19:57:11 -04:00
if test x$have_filesystem != xyes; then
if test x$enable_filesystem = xyes; then
AC_DEFINE(SDL_FILESYSTEM_DISABLED, 1, [ ])
fi
SOURCES="$SOURCES $srcdir/src/filesystem/dummy/*.c"
fi
2006-02-16 10:11:48 +00:00
if test x$have_loadso != xyes; then
if test x$enable_loadso = xyes; then
2011-06-04 15:26:02 -04:00
AC_DEFINE(SDL_LOADSO_DISABLED, 1, [ ])
2006-02-16 10:11:48 +00:00
fi
SOURCES="$SOURCES $srcdir/src/loadso/dummy/*.c"
fi
2006-02-20 22:15:38 +00:00
if test x$SDLMAIN_SOURCES = x; then
SDLMAIN_SOURCES="$srcdir/src/main/dummy/*.c"
fi
2012-11-26 07:53:56 -08:00
SDLTEST_SOURCES="$srcdir/src/test/*.c"
2006-02-16 10:11:48 +00:00
2016-06-23 18:39:05 +08:00
if test x$video_wayland = xyes; then
2018-06-25 09:37:25 -07:00
WAYLAND_PROTOCOLS=`cd $srcdir/wayland-protocols ; for p in *.xml ; do echo -n "\$p" |sed 's,\\.xml\$, ,g' ; done`
WAYLAND_PROTOCOLS_SOURCES=`for p in $WAYLAND_PROTOCOLS ; do echo -n "\\$(gen)/\$p-protocol.c " ; done`
WAYLAND_PROTOCOLS_HEADERS=`for p in $WAYLAND_PROTOCOLS ; do echo -n "\\$(gen)/\$p-client-protocol.h " ; done`
GEN_SOURCES="$GEN_SOURCES $WAYLAND_PROTOCOLS_SOURCES"
GEN_HEADERS="$GEN_HEADERS $WAYLAND_PROTOCOLS_HEADERS"
WAYLAND_PROTOCOLS_DEPENDS=`for p in $WAYLAND_PROTOCOLS ; do\
echo ;\
echo "\\$(gen)/\$p-client-protocol.h: \\$(srcdir)/wayland-protocols/\$p.xml" ;\
echo " @\\$(SHELL) \\$(auxdir)/mkinstalldirs \\$(gen)" ;\
echo " \\$(RUN_CMD_GEN)\\$(WAYLAND_SCANNER) client-header \\$< \\$@" ;\
echo ;\
echo "\\$(gen)/\$p-protocol.c: \\$(srcdir)/wayland-protocols/\$p.xml" ;\
echo " @\\$(SHELL) \\$(auxdir)/mkinstalldirs \\$(gen)" ;\
echo " \\$(RUN_CMD_GEN)\\$(WAYLAND_SCANNER) code \\$< \\$@" ;\
echo ;\
echo "\\$(objects)/\$p-protocol.lo: \\$(gen)/\$p-protocol.c \\$(gen)/\$p-client-protocol.h" ;\
echo " \\$(RUN_CMD_CC)\\$(LIBTOOL) --tag=CC --mode=compile \\$(CC) \\$(CFLAGS) \\$(EXTRA_CFLAGS) $DEPENDENCY_TRACKING_OPTIONS -c \\$< -o \\$@" ;\
2018-08-07 17:28:07 -04:00
done ;\
echo ;\
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`
2016-06-23 18:39:05 +08:00
fi
2009-10-04 03:38:01 +00:00
OBJECTS=`echo $SOURCES`
2011-01-27 14:54:20 -08:00
DEPENDS=`echo $SOURCES | tr ' ' '\n'`
2009-10-04 03:38:01 +00:00
for EXT in asm cc m c S; do
OBJECTS=`echo "$OBJECTS" | sed 's,[[^ ]]*/\([[^ ]]*\)\.'$EXT',$(objects)/\1.lo,g'`
2011-01-27 14:54:20 -08:00
DEPENDS=`echo "$DEPENDS" | sed "s,^\\([[^ ]]*\\)/\\([[^ ]]*\\)\\.$EXT\\$,\\\\
2009-10-28 04:27:50 +00:00
\\$(objects)/\\2.lo: \\1/\\2.$EXT\\\\
2014-06-19 00:40:09 -04:00
\\$(RUN_CMD_CC)\\$(LIBTOOL) --tag=CC --mode=compile \\$(CC) \\$(CFLAGS) \\$(EXTRA_CFLAGS) $DEPENDENCY_TRACKING_OPTIONS -c \\$< -o \\$@,g"`
2009-10-04 03:38:01 +00:00
done
2016-06-23 18:39:05 +08:00
GEN_OBJECTS=`echo "$GEN_SOURCES" | sed 's,[[^ ]]*/\([[^ ]]*\)\.c,$(objects)/\1.lo,g'`
2009-10-04 03:38:01 +00:00
VERSION_OBJECTS=`echo $VERSION_SOURCES`
VERSION_DEPENDS=`echo $VERSION_SOURCES`
VERSION_OBJECTS=`echo "$VERSION_OBJECTS" | sed 's,[[^ ]]*/\([[^ ]]*\)\.rc,$(objects)/\1.o,g'`
2009-10-28 04:27:50 +00:00
VERSION_DEPENDS=`echo "$VERSION_DEPENDS" | sed "s,\\([[^ ]]*\\)/\\([[^ ]]*\\)\\.rc,\\\\
\\$(objects)/\\2.o: \\1/\\2.rc\\\\
\\$(WINDRES) \\$< \\$@,g"`
2009-10-04 03:38:01 +00:00
SDLMAIN_OBJECTS=`echo $SDLMAIN_SOURCES`
SDLMAIN_DEPENDS=`echo $SDLMAIN_SOURCES`
2017-08-12 15:00:33 -07:00
SDLMAIN_OBJECTS=`echo "$SDLMAIN_OBJECTS" | sed 's,[[^ ]]*/\([[^ ]]*\)\.c,$(objects)/\1.lo,g'`
2009-10-28 04:27:50 +00:00
SDLMAIN_DEPENDS=`echo "$SDLMAIN_DEPENDS" | sed "s,\\([[^ ]]*\\)/\\([[^ ]]*\\)\\.c,\\\\
2017-08-12 15:00:33 -07:00
\\$(objects)/\\2.lo: \\1/\\2.c\\\\
2014-06-19 00:40:09 -04:00
\\$(RUN_CMD_CC)\\$(LIBTOOL) --tag=CC --mode=compile \\$(CC) \\$(CFLAGS) \\$(EXTRA_CFLAGS) $DEPENDENCY_TRACKING_OPTIONS -c \\$< -o \\$@,g"`
2006-02-20 22:15:38 +00:00
2012-11-26 07:53:56 -08:00
SDLTEST_OBJECTS=`echo $SDLTEST_SOURCES`
SDLTEST_DEPENDS=`echo $SDLTEST_SOURCES`
2017-08-12 15:00:33 -07:00
SDLTEST_OBJECTS=`echo "$SDLTEST_OBJECTS" | sed 's,[[^ ]]*/\([[^ ]]*\)\.c,$(objects)/\1.lo,g'`
2012-11-26 07:53:56 -08:00
SDLTEST_DEPENDS=`echo "$SDLTEST_DEPENDS" | sed "s,\\([[^ ]]*\\)/\\([[^ ]]*\\)\\.c,\\\\
2017-08-12 15:00:33 -07:00
\\$(objects)/\\2.lo: \\1/\\2.c\\\\
2014-06-19 00:40:09 -04:00
\\$(RUN_CMD_CC)\\$(LIBTOOL) --tag=CC --mode=compile \\$(CC) \\$(CFLAGS) \\$(EXTRA_CFLAGS) $DEPENDENCY_TRACKING_OPTIONS -c \\$< -o \\$@,g"`
2012-11-26 07:53:56 -08:00
2001-04-26 16:45:43 +00:00
# Set runtime shared library paths as needed
2005-08-23 06:36:23 +00:00
if test "x$enable_rpath" = "xyes"; then
2011-02-28 09:06:29 -08:00
if test $ARCH = bsdi -o $ARCH = freebsd -o $ARCH = linux -o $ARCH = netbsd; then
2006-09-24 00:44:45 +00:00
SDL_RLD_FLAGS="-Wl,-rpath,\${libdir}"
2016-01-07 16:42:30 -08:00
AC_MSG_CHECKING(for linker option --enable-new-dtags)
have_enable_new_dtags=no
save_LDFLAGS="$LDFLAGS"
LDFLAGS="$LDFLAGS -Wl,--enable-new-dtags"
AC_TRY_LINK([
],[
],[
have_enable_new_dtags=yes
SDL_RLD_FLAGS="$SDL_RLD_FLAGS -Wl,--enable-new-dtags"
])
LDFLAGS="$save_LDFLAGS"
AC_MSG_RESULT($have_enable_new_dtags)
2005-08-23 06:36:23 +00:00
fi
if test $ARCH = solaris; then
2006-09-24 00:44:45 +00:00
SDL_RLD_FLAGS="-R\${libdir}"
2005-08-23 06:36:23 +00:00
fi
else
SDL_RLD_FLAGS=""
2001-04-26 16:45:43 +00:00
fi
2002-06-01 18:48:13 +00:00
2012-02-28 21:58:36 -05:00
SDL_STATIC_LIBS="$SDL_LIBS $EXTRA_LDFLAGS"
2004-02-11 07:09:11 +00:00
2001-04-26 16:45:43 +00:00
dnl Expand the cflags and libraries needed by apps using SDL
AC_SUBST(SDL_CFLAGS)
AC_SUBST(SDL_LIBS)
2004-02-11 07:09:11 +00:00
AC_SUBST(SDL_STATIC_LIBS)
2001-04-26 16:45:43 +00:00
AC_SUBST(SDL_RLD_FLAGS)
2006-02-16 10:11:48 +00:00
if test x$enable_shared = xyes; then
ENABLE_SHARED_TRUE=
ENABLE_SHARED_FALSE="#"
else
ENABLE_SHARED_TRUE="#"
ENABLE_SHARED_FALSE=
fi
if test x$enable_static = xyes; then
ENABLE_STATIC_TRUE=
ENABLE_STATIC_FALSE="#"
else
ENABLE_STATIC_TRUE="#"
ENABLE_STATIC_FALSE=
fi
AC_SUBST(ENABLE_SHARED_TRUE)
AC_SUBST(ENABLE_SHARED_FALSE)
AC_SUBST(ENABLE_STATIC_TRUE)
AC_SUBST(ENABLE_STATIC_FALSE)
2001-04-26 16:45:43 +00:00
2006-02-16 10:11:48 +00:00
dnl Expand the sources and objects needed to build the library
AC_SUBST(ac_aux_dir)
AC_SUBST(INCLUDE)
AC_SUBST(OBJECTS)
2016-06-23 18:39:05 +08:00
AC_SUBST(GEN_HEADERS)
AC_SUBST(GEN_OBJECTS)
2009-10-04 03:38:01 +00:00
AC_SUBST(VERSION_OBJECTS)
2006-02-20 22:15:38 +00:00
AC_SUBST(SDLMAIN_OBJECTS)
2012-11-26 07:53:56 -08:00
AC_SUBST(SDLTEST_OBJECTS)
2006-02-16 10:11:48 +00:00
AC_SUBST(BUILD_CFLAGS)
2006-03-14 02:46:26 +00:00
AC_SUBST(EXTRA_CFLAGS)
2006-02-20 20:08:29 +00:00
AC_SUBST(BUILD_LDFLAGS)
2006-03-14 02:46:26 +00:00
AC_SUBST(EXTRA_LDFLAGS)
2007-07-16 03:28:48 +00:00
AC_SUBST(WINDRES)
2016-06-23 18:39:05 +08:00
AC_SUBST(WAYLAND_SCANNER)
2001-08-21 07:19:59 +00:00
2011-02-18 11:19:34 -08:00
cat >Makefile.rules <<__EOF__
2011-01-21 12:43:25 -08:00
# Build rules for objects
-include \$(OBJECTS:.lo=.d)
2011-02-18 11:19:34 -08:00
# Special dependency for SDL.c, since it depends on SDL_revision.h
$srcdir/src/SDL.c: update-revision
2011-01-21 12:43:25 -08:00
$DEPENDS
$VERSION_DEPENDS
$SDLMAIN_DEPENDS
2012-11-26 07:53:56 -08:00
$SDLTEST_DEPENDS
2016-06-23 18:39:05 +08:00
$WAYLAND_PROTOCOLS_DEPENDS
2011-02-18 11:19:34 -08:00
__EOF__
AC_CONFIG_FILES([
2015-06-29 22:24:00 -07:00
Makefile:Makefile.in:Makefile.rules sdl2-config sdl2-config.cmake SDL2.spec sdl2.pc
2011-01-21 12:43:25 -08:00
])
2014-01-25 15:05:44 -05:00
AC_CONFIG_COMMANDS([sdl2_config],[chmod a+x sdl2-config])
SUMMARY="SDL2 Configure Summary:\n"
if test x$enable_shared = xyes; then
SUMMARY="${SUMMARY}Building Shared Libraries\n"
fi
if test x$enable_static = xyes; then
SUMMARY="${SUMMARY}Building Static Libraries\n"
fi
SUMMARY="${SUMMARY}Enabled modules :${SUMMARY_modules}\n"
SUMMARY="${SUMMARY}Assembly Math :${SUMMARY_math}\n"
SUMMARY="${SUMMARY}Audio drivers :${SUMMARY_audio}\n"
SUMMARY="${SUMMARY}Video drivers :${SUMMARY_video}\n"
if test x$have_x = xyes; then
SUMMARY="${SUMMARY}X11 libraries :${SUMMARY_video_x11}\n"
fi
SUMMARY="${SUMMARY}Input drivers :${SUMMARY_input}\n"
2017-01-24 16:18:25 -05:00
if test x$have_samplerate_h_hdr = xyes; then
SUMMARY="${SUMMARY}Using libsamplerate : YES\n"
else
SUMMARY="${SUMMARY}Using libsamplerate : NO\n"
fi
2016-11-01 10:42:35 -07:00
if test x$have_libudev_h_hdr = xyes; then
2017-01-24 16:18:25 -05:00
SUMMARY="${SUMMARY}Using libudev : YES\n"
2014-01-25 15:05:44 -05:00
else
2017-01-24 16:18:25 -05:00
SUMMARY="${SUMMARY}Using libudev : NO\n"
2014-01-25 15:05:44 -05:00
fi
if test x$have_dbus_dbus_h_hdr = xyes; then
2017-01-24 16:18:25 -05:00
SUMMARY="${SUMMARY}Using dbus : YES\n"
2014-01-25 15:05:44 -05:00
else
2017-01-24 16:18:25 -05:00
SUMMARY="${SUMMARY}Using dbus : NO\n"
2014-01-25 15:05:44 -05:00
fi
2016-10-07 18:57:40 -07:00
if test x$enable_ime = xyes; then
2017-01-24 16:18:25 -05:00
SUMMARY="${SUMMARY}Using ime : YES\n"
2016-10-07 18:57:40 -07:00
else
2017-01-24 16:18:25 -05:00
SUMMARY="${SUMMARY}Using ime : NO\n"
2016-10-07 18:57:40 -07:00
fi
2014-06-18 20:11:39 +01:00
if test x$have_ibus_ibus_h_hdr = xyes; then
2017-01-24 16:18:25 -05:00
SUMMARY="${SUMMARY}Using ibus : YES\n"
2014-06-18 20:11:39 +01:00
else
2017-01-24 16:18:25 -05:00
SUMMARY="${SUMMARY}Using ibus : NO\n"
2014-06-18 20:11:39 +01:00
fi
2016-10-07 18:57:40 -07:00
if test x$have_fcitx_frontend_h_hdr = xyes; then
2017-01-24 16:18:25 -05:00
SUMMARY="${SUMMARY}Using fcitx : YES\n"
2016-10-07 18:57:40 -07:00
else
2017-01-24 16:18:25 -05:00
SUMMARY="${SUMMARY}Using fcitx : NO\n"
2016-10-07 18:57:40 -07:00
fi
2014-01-25 15:05:44 -05:00
AC_CONFIG_COMMANDS([summary], [echo -en "$SUMMARY"], [SUMMARY="$SUMMARY"])
2011-01-21 12:43:25 -08:00
AC_OUTPUT