Atlas - configure.in

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