1 dnl Process this file with autoconf to produce a configure script.
3 AC_CONFIG_HEADER(include/SDL_config.h)
4 AC_CONFIG_AUX_DIR(build-scripts)
5 AC_CONFIG_MACRO_DIR([acinclude])
7 dnl Save the CFLAGS to see whether they were passed in or generated
10 dnl Set various version strings - taken gratefully from the GTk sources
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.
26 SDL_VERSION=$SDL_MAJOR_VERSION.$SDL_MINOR_VERSION.$SDL_MICRO_VERSION
28 AC_SUBST(SDL_MAJOR_VERSION)
29 AC_SUBST(SDL_MINOR_VERSION)
30 AC_SUBST(SDL_MICRO_VERSION)
31 AC_SUBST(SDL_INTERFACE_AGE)
32 AC_SUBST(SDL_BINARY_AGE)
38 LT_RELEASE=$SDL_MAJOR_VERSION.$SDL_MINOR_VERSION
39 LT_CURRENT=`expr $SDL_MICRO_VERSION - $SDL_INTERFACE_AGE`
40 LT_REVISION=$SDL_INTERFACE_AGE
41 LT_AGE=`expr $SDL_BINARY_AGE - $SDL_INTERFACE_AGE`
42 m4_pattern_allow([^LT_])
49 dnl Detect the canonical build and host environments
58 AC_CHECK_TOOL(WINDRES, [windres], [:])
60 dnl Make sure that srcdir is a full pathname
63 # Except on msys, where make can't handle full pathnames (bug 1972)
66 srcdir=`cd $srcdir && pwd`
70 dnl Set up the compiler and linker flags
71 INCLUDE="-I$srcdir/include -idirafter $srcdir/src/video/khronos"
72 if test x$srcdir != x.; then
73 INCLUDE="-Iinclude $INCLUDE"
74 elif test -d .hg; then
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
84 # We build SDL on cygwin without the UNIX emulation layer
87 AC_MSG_CHECKING(for GCC -mno-cygwin option)
88 CFLAGS="$save_CFLAGS -mno-cygwin"
95 AC_MSG_RESULT($have_no_cygwin)
98 if test x$have_no_cygwin = xyes; then
99 BASE_CFLAGS="-mno-cygwin"
100 BASE_LDFLAGS="-mno-cygwin"
102 BASE_CFLAGS="$BASE_CFLAGS -I/usr/include/mingw"
105 # Uncomment the following line if you want to force SDL and applications
106 # built with it to be compiled for a particular architecture.
107 #AX_GCC_ARCHFLAG([no], [BASE_CFLAGS="$BASE_CFLAGS $ax_cv_gcc_archflag]")
108 BUILD_CFLAGS="$CFLAGS $CPPFLAGS -DUSING_GENERATED_CONFIG_H"
109 # The default optimization for SDL is -O3 (Bug #31)
110 if test "x$orig_CFLAGS" = x; then
111 BUILD_CFLAGS=`echo $BUILD_CFLAGS | sed 's/-O2/-O3/'`
113 EXTRA_CFLAGS="$INCLUDE $BASE_CFLAGS"
114 BUILD_LDFLAGS="$LDFLAGS"
115 EXTRA_LDFLAGS="$BASE_LDFLAGS"
116 ## These are common directories to find software packages
117 #for path in /usr/freeware /usr/pkg /usr/X11R6 /usr/local; do
118 # if test -d $path/include; then
119 # EXTRA_CFLAGS="$EXTRA_CFLAGS -I$path/include"
121 # if test -d $path/lib; then
122 # EXTRA_LDFLAGS="$EXTRA_LDFLAGS -L$path/lib"
125 SDL_CFLAGS="$BASE_CFLAGS"
126 SDL_LIBS="-lSDL2 $BASE_LDFLAGS"
127 CPPFLAGS="$CPPFLAGS $EXTRA_CFLAGS"
128 CFLAGS="$CFLAGS $EXTRA_CFLAGS"
129 LDFLAGS="$LDFLAGS $EXTRA_LDFLAGS"
131 dnl set this to use on systems that use lib64 instead of lib
132 base_libdir=`echo \${libdir} | sed 's/.*\/\(.*\)/\1/; q'`
134 dnl Function to find a library in the compiler search path
137 gcc_bin_path=[`$CC -print-search-dirs 2>/dev/null | fgrep programs: | sed 's/[^=]*=\(.*\)/\1/' | sed 's/:/ /g'`]
138 gcc_lib_path=[`$CC -print-search-dirs 2>/dev/null | fgrep libraries: | sed 's/[^=]*=\(.*\)/\1/' | sed 's/:/ /g'`]
139 env_lib_path=[`echo $LIBS $LDFLAGS $* | sed 's/-L[ ]*//g'`]
140 if test "$cross_compiling" = yes; then
143 host_lib_path="/usr/$base_libdir /usr/local/$base_libdir"
145 for path in $env_lib_path $gcc_bin_path $gcc_lib_path $host_lib_path; do
146 lib=[`ls -- $path/$1 2>/dev/null | sed -e '/\.so\..*\./d' -e 's,.*/,,' | sort | tail -1`]
147 if test x$lib != x; then
154 dnl Check for compiler characteristics
159 dnl See whether we want assertions for debugging/sanity checking SDL itself.
160 AC_ARG_ENABLE(assertions,
161 AC_HELP_STRING([--enable-assertions],
162 [Enable internal sanity checks (auto/disabled/release/enabled/paranoid) [[default=auto]]]),
163 , enable_assertions=auto)
164 case "$enable_assertions" in
165 auto) # Use optimization settings to determine assertion level
168 AC_DEFINE(SDL_DEFAULT_ASSERT_LEVEL, 0, [ ])
171 AC_DEFINE(SDL_DEFAULT_ASSERT_LEVEL, 1, [ ])
174 AC_DEFINE(SDL_DEFAULT_ASSERT_LEVEL, 2, [ ])
177 AC_DEFINE(SDL_DEFAULT_ASSERT_LEVEL, 3, [ ])
180 AC_MSG_ERROR([*** unknown assertion level. stop.])
184 dnl See whether we can use gcc style dependency tracking
185 AC_ARG_ENABLE(dependency-tracking,
186 AC_HELP_STRING([--enable-dependency-tracking],
187 [Use gcc -MMD -MT dependency tracking [[default=yes]]]),
188 , enable_dependency_tracking=yes)
189 if test x$enable_dependency_tracking = xyes; then
191 AC_MSG_CHECKING(for GCC -MMD -MT option)
193 #if !defined(__GNUC__) || __GNUC__ < 3
194 #error Dependency tracking requires GCC 3.0 or newer
200 AC_MSG_RESULT($have_gcc_mmd_mt)
202 if test x$have_gcc_mmd_mt = xyes; then
203 DEPENDENCY_TRACKING_OPTIONS="-MMD -MT \$@"
207 AC_MSG_CHECKING(for linker option --no-undefined)
210 dnl Skip this on platforms where it is just simply busted.
215 save_LDFLAGS="$LDFLAGS"
216 LDFLAGS="$LDFLAGS -Wl,--no-undefined"
220 have_no_undefined=yes
221 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,--no-undefined"
223 LDFLAGS="$save_LDFLAGS"
226 AC_MSG_RESULT($have_no_undefined)
228 dnl See whether we are allowed to use the system C library
230 AC_HELP_STRING([--enable-libc], [Use the system C library [[default=yes]]]),
232 if test x$enable_libc = xyes; then
233 AC_DEFINE(HAVE_LIBC, 1, [ ])
235 dnl Check for C library headers
237 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)
239 dnl Check for typedefs, structures, etc.
242 dnl Check for defines
243 AC_CHECK_DEFINE(M_PI, math.h)
245 dnl Checks for library functions.
247 *-*-cygwin* | *-*-mingw32*)
255 if test x$ac_cv_func_memcmp_working = xyes; then
256 AC_DEFINE(HAVE_MEMCMP, 1, [ ])
259 if test x$ac_cv_func_strtod = xyes; then
260 AC_DEFINE(HAVE_STRTOD, 1, [ ])
262 AC_CHECK_FUNC(mprotect,
264 #include <sys/types.h>
265 #include <sys/mman.h>
268 AC_DEFINE(HAVE_MPROTECT, 1, [ ])
271 AC_CHECK_FUNCS(malloc calloc realloc free getenv setenv putenv unsetenv qsort abs bcopy memset memcpy memmove wcslen wcscmp strlen strlcpy strlcat strdup _strrev _strupr _strlwr strchr strrchr strstr itoa _ltoa _uitoa _ultoa strtol strtoul _i64toa _ui64toa strtoll strtoull atoi atof strcmp strncmp _stricmp strcasecmp _strnicmp strncasecmp vsscanf vsnprintf fopen64 fseeko fseeko64 sigaction setjmp nanosleep sysconf sysctlbyname getauxval poll)
273 AC_CHECK_LIB(m, pow, [LIBS="$LIBS -lm"; EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lm"])
274 AC_CHECK_FUNCS(atan atan2 acos asin ceil copysign cos cosf fabs floor log pow scalbn sin sinf sqrt sqrtf tan tanf)
276 AC_CHECK_LIB(iconv, iconv_open, [LIBS="$LIBS -liconv"; EXTRA_LDFLAGS="$EXTRA_LDFLAGS -liconv"])
277 AC_CHECK_FUNCS(iconv)
279 AC_CHECK_MEMBER(struct sigaction.sa_sigaction,[AC_DEFINE([HAVE_SA_SIGACTION], 1, [ ])], ,[#include <signal.h>])
282 dnl AC_CHECK_SIZEOF(void*)
284 dnl See whether we can use gcc atomic operations on this architecture
285 AC_ARG_ENABLE(gcc-atomics,
286 AC_HELP_STRING([--enable-gcc-atomics],
287 [Use gcc builtin atomics [[default=yes]]]),
288 , enable_gcc_atomics=yes)
289 if test x$enable_gcc_atomics = xyes; then
291 AC_MSG_CHECKING(for GCC builtin atomic operations)
296 __sync_lock_test_and_set(&a, 4);
297 __sync_lock_test_and_set(&x, y);
298 __sync_fetch_and_add(&a, 1);
299 __sync_bool_compare_and_swap(&a, 5, 10);
300 __sync_bool_compare_and_swap(&x, y, z);
304 AC_MSG_RESULT($have_gcc_atomics)
306 if test x$have_gcc_atomics = xyes; then
307 AC_DEFINE(HAVE_GCC_ATOMICS, 1, [ ])
309 # See if we have the minimum operation needed for GCC atomics
313 __sync_lock_test_and_set(&a, 1);
314 __sync_lock_release(&a);
316 have_gcc_sync_lock_test_and_set=yes
318 if test x$have_gcc_sync_lock_test_and_set = xyes; then
319 AC_DEFINE(HAVE_GCC_SYNC_LOCK_TEST_AND_SET, 1, [ ])
325 SOURCES="$SOURCES $srcdir/src/*.c"
326 SOURCES="$SOURCES $srcdir/src/atomic/*.c"
327 SOURCES="$SOURCES $srcdir/src/audio/*.c"
328 SOURCES="$SOURCES $srcdir/src/cpuinfo/*.c"
329 SOURCES="$SOURCES $srcdir/src/dynapi/*.c"
330 SOURCES="$SOURCES $srcdir/src/events/*.c"
331 SOURCES="$SOURCES $srcdir/src/file/*.c"
332 SOURCES="$SOURCES $srcdir/src/haptic/*.c"
333 SOURCES="$SOURCES $srcdir/src/joystick/*.c"
334 SOURCES="$SOURCES $srcdir/src/libm/*.c"
335 SOURCES="$SOURCES $srcdir/src/power/*.c"
336 #SOURCES="$SOURCES $srcdir/src/filesystem/*.c"
337 SOURCES="$SOURCES $srcdir/src/render/*.c"
338 SOURCES="$SOURCES $srcdir/src/render/*/*.c"
339 SOURCES="$SOURCES $srcdir/src/stdlib/*.c"
340 SOURCES="$SOURCES $srcdir/src/thread/*.c"
341 SOURCES="$SOURCES $srcdir/src/timer/*.c"
342 SOURCES="$SOURCES $srcdir/src/video/*.c"
344 dnl Enable/disable various subsystems of the SDL library
346 AC_ARG_ENABLE(atomic,
347 AC_HELP_STRING([--enable-atomic], [Enable the atomic operations subsystem [[default=yes]]]),
349 if test x$enable_atomic != xyes; then
350 AC_DEFINE(SDL_ATOMIC_DISABLED, 1, [ ])
352 SUMMARY_modules="${SUMMARY_modules} atomic"
355 AC_HELP_STRING([--enable-audio], [Enable the audio subsystem [[default=yes]]]),
357 if test x$enable_audio != xyes; then
358 AC_DEFINE(SDL_AUDIO_DISABLED, 1, [ ])
360 SUMMARY_modules="${SUMMARY_modules} audio"
363 AC_HELP_STRING([--enable-video], [Enable the video subsystem [[default=yes]]]),
365 if test x$enable_video != xyes; then
366 AC_DEFINE(SDL_VIDEO_DISABLED, 1, [ ])
368 SUMMARY_modules="${SUMMARY_modules} video"
370 AC_ARG_ENABLE(render,
371 AC_HELP_STRING([--enable-render], [Enable the render subsystem [[default=yes]]]),
373 if test x$enable_render != xyes; then
374 AC_DEFINE(SDL_RENDER_DISABLED, 1, [ ])
376 SUMMARY_modules="${SUMMARY_modules} render"
378 AC_ARG_ENABLE(events,
379 AC_HELP_STRING([--enable-events], [Enable the events subsystem [[default=yes]]]),
381 if test x$enable_events != xyes; then
382 AC_DEFINE(SDL_EVENTS_DISABLED, 1, [ ])
384 SUMMARY_modules="${SUMMARY_modules} events"
386 AC_ARG_ENABLE(joystick,
387 AC_HELP_STRING([--enable-joystick], [Enable the joystick subsystem [[default=yes]]]),
388 , enable_joystick=yes)
389 if test x$enable_joystick != xyes; then
390 AC_DEFINE(SDL_JOYSTICK_DISABLED, 1, [ ])
392 SUMMARY_modules="${SUMMARY_modules} joystick"
394 AC_ARG_ENABLE(haptic,
395 AC_HELP_STRING([--enable-haptic], [Enable the haptic (force feedback) subsystem [[default=yes]]]),
397 if test x$enable_haptic != xyes; then
398 AC_DEFINE(SDL_HAPTIC_DISABLED, 1, [ ])
400 SUMMARY_modules="${SUMMARY_modules} haptic"
403 AC_HELP_STRING([--enable-power], [Enable the power subsystem [[default=yes]]]),
405 if test x$enable_power != xyes; then
406 AC_DEFINE(SDL_POWER_DISABLED, 1, [ ])
408 SUMMARY_modules="${SUMMARY_modules} power"
410 AC_ARG_ENABLE(filesystem,
411 AC_HELP_STRING([--enable-filesystem], [Enable the filesystem subsystem [[default=yes]]]),
412 , enable_filesystem=yes)
413 if test x$enable_filesystem != xyes; then
414 AC_DEFINE(SDL_FILESYSTEM_DISABLED, 1, [ ])
416 SUMMARY_modules="${SUMMARY_modules} filesystem"
418 AC_ARG_ENABLE(threads,
419 AC_HELP_STRING([--enable-threads], [Enable the threading subsystem [[default=yes]]]),
420 , enable_threads=yes)
421 if test x$enable_threads != xyes; then
422 AC_DEFINE(SDL_THREADS_DISABLED, 1, [ ])
424 SUMMARY_modules="${SUMMARY_modules} threads"
426 AC_ARG_ENABLE(timers,
427 AC_HELP_STRING([--enable-timers], [Enable the timer subsystem [[default=yes]]]),
429 if test x$enable_timers != xyes; then
430 AC_DEFINE(SDL_TIMERS_DISABLED, 1, [ ])
432 SUMMARY_modules="${SUMMARY_modules} timers"
435 AC_HELP_STRING([--enable-file], [Enable the file subsystem [[default=yes]]]),
437 if test x$enable_file != xyes; then
438 AC_DEFINE(SDL_FILE_DISABLED, 1, [ ])
440 SUMMARY_modules="${SUMMARY_modules} file"
442 AC_ARG_ENABLE(loadso,
443 AC_HELP_STRING([--enable-loadso], [Enable the shared object loading subsystem [[default=yes]]]),
445 if test x$enable_loadso != xyes; then
446 AC_DEFINE(SDL_LOADSO_DISABLED, 1, [ ])
448 SUMMARY_modules="${SUMMARY_modules} loadso"
450 AC_ARG_ENABLE(cpuinfo,
451 AC_HELP_STRING([--enable-cpuinfo], [Enable the cpuinfo subsystem [[default=yes]]]),
452 , enable_cpuinfo=yes)
453 if test x$enable_cpuinfo != xyes; then
454 AC_DEFINE(SDL_CPUINFO_DISABLED, 1, [ ])
456 SUMMARY_modules="${SUMMARY_modules} cpuinfo"
458 AC_ARG_ENABLE(assembly,
459 AC_HELP_STRING([--enable-assembly], [Enable assembly routines [[default=yes]]]),
460 , enable_assembly=yes)
461 if test x$enable_assembly = xyes; then
462 SUMMARY_modules="${SUMMARY_modules} assembly"
464 AC_DEFINE(SDL_ASSEMBLY_ROUTINES, 1, [ ])
466 # Make sure that we don't generate floating point code that would
467 # cause illegal instruction exceptions on older processors
470 # Don't need to worry about Apple hardware, it's all SSE capable
474 # x86 64-bit architectures all have SSE instructions
481 AC_ARG_ENABLE(ssemath,
482 AC_HELP_STRING([--enable-ssemath], [Allow GCC to use SSE floating point math [[default=maybe]]]),
483 , enable_ssemath=$default_ssemath)
484 if test x$enable_ssemath = xno; then
485 if test x$have_gcc_sse = xyes -o x$have_gcc_sse2 = xyes -o x$have_gcc_sse3 = xyes; then
486 EXTRA_CFLAGS="$EXTRA_CFLAGS -mfpmath=387"
490 dnl Check for various instruction support
492 AC_HELP_STRING([--enable-mmx], [use MMX assembly routines [[default=yes]]]),
494 if test x$enable_mmx = xyes; then
495 save_CFLAGS="$CFLAGS"
497 AC_MSG_CHECKING(for GCC -mmmx option)
499 CFLAGS="$save_CFLAGS $mmx_CFLAGS"
504 #ifdef __MINGW64_VERSION_MAJOR
507 #include <mmintrin.h>
510 #include <mmintrin.h>
513 #error Assembler CPP flag not enabled
519 AC_MSG_RESULT($have_gcc_mmx)
520 CFLAGS="$save_CFLAGS"
522 if test x$have_gcc_mmx = xyes; then
523 EXTRA_CFLAGS="$EXTRA_CFLAGS $mmx_CFLAGS"
524 SUMMARY_math="${SUMMARY_math} mmx"
529 AC_HELP_STRING([--enable-3dnow], [use 3DNow! assembly routines [[default=yes]]]),
531 if test x$enable_3dnow = xyes; then
532 save_CFLAGS="$CFLAGS"
534 AC_MSG_CHECKING(for GCC -m3dnow option)
535 amd3dnow_CFLAGS="-m3dnow"
536 CFLAGS="$save_CFLAGS $amd3dnow_CFLAGS"
541 #error Assembler CPP flag not enabled
549 AC_MSG_RESULT($have_gcc_3dnow)
550 CFLAGS="$save_CFLAGS"
552 if test x$have_gcc_3dnow = xyes; then
553 EXTRA_CFLAGS="$EXTRA_CFLAGS $amd3dnow_CFLAGS"
554 SUMMARY_math="${SUMMARY_math} 3dnow"
559 AC_HELP_STRING([--enable-sse], [use SSE assembly routines [[default=yes]]]),
561 if test x$enable_sse = xyes; then
562 save_CFLAGS="$CFLAGS"
564 AC_MSG_CHECKING(for GCC -msse option)
566 CFLAGS="$save_CFLAGS $sse_CFLAGS"
571 #ifdef __MINGW64_VERSION_MAJOR
574 #include <xmmintrin.h>
577 #include <xmmintrin.h>
580 #error Assembler CPP flag not enabled
586 AC_MSG_RESULT($have_gcc_sse)
587 CFLAGS="$save_CFLAGS"
589 if test x$have_gcc_sse = xyes; then
590 EXTRA_CFLAGS="$EXTRA_CFLAGS $sse_CFLAGS"
591 SUMMARY_math="${SUMMARY_math} sse"
596 AC_HELP_STRING([--enable-sse2], [use SSE2 assembly routines [[default=maybe]]]),
597 , enable_sse2=$default_ssemath)
598 if test x$enable_sse2 = xyes; then
599 save_CFLAGS="$CFLAGS"
601 AC_MSG_CHECKING(for GCC -msse2 option)
603 CFLAGS="$save_CFLAGS $sse2_CFLAGS"
608 #ifdef __MINGW64_VERSION_MAJOR
611 #include <emmintrin.h>
614 #include <emmintrin.h>
617 #error Assembler CPP flag not enabled
623 AC_MSG_RESULT($have_gcc_sse2)
624 CFLAGS="$save_CFLAGS"
626 if test x$have_gcc_sse2 = xyes; then
627 EXTRA_CFLAGS="$EXTRA_CFLAGS $sse2_CFLAGS"
628 SUMMARY_math="${SUMMARY_math} sse2"
633 AC_HELP_STRING([--enable-sse3], [use SSE3 assembly routines [[default=maybe]]]),
634 , enable_sse3=$default_ssemath)
635 if test x$enable_sse3 = xyes; then
636 save_CFLAGS="$CFLAGS"
638 AC_MSG_CHECKING(for GCC -msse3 option)
640 CFLAGS="$save_CFLAGS $sse3_CFLAGS"
645 #ifdef __MINGW64_VERSION_MAJOR
648 #include <pmmintrin.h>
651 #include <pmmintrin.h>
654 #error Assembler CPP flag not enabled
660 AC_MSG_RESULT($have_gcc_sse3)
661 CFLAGS="$save_CFLAGS"
663 if test x$have_gcc_sse3 = xyes; then
664 EXTRA_CFLAGS="$EXTRA_CFLAGS $sse3_CFLAGS"
665 SUMMARY_math="${SUMMARY_math} sse3"
669 AC_ARG_ENABLE(altivec,
670 AC_HELP_STRING([--enable-altivec], [use Altivec assembly routines [[default=yes]]]),
671 , enable_altivec=yes)
672 if test x$enable_altivec = xyes; then
673 save_CFLAGS="$CFLAGS"
675 have_altivec_h_hdr=no
676 altivec_CFLAGS="-maltivec"
677 CFLAGS="$save_CFLAGS $altivec_CFLAGS"
679 AC_MSG_CHECKING(for Altivec with GCC altivec.h and -maltivec option)
682 vector unsigned int vzero() {
683 return vec_splat_u32(0);
688 have_altivec_h_hdr=yes
690 AC_MSG_RESULT($have_gcc_altivec)
692 if test x$have_gcc_altivec = xno; then
693 AC_MSG_CHECKING(for Altivec with GCC -maltivec option)
695 vector unsigned int vzero() {
696 return vec_splat_u32(0);
702 AC_MSG_RESULT($have_gcc_altivec)
705 if test x$have_gcc_altivec = xno; then
706 AC_MSG_CHECKING(for Altivec with GCC altivec.h and -faltivec option)
707 altivec_CFLAGS="-faltivec"
708 CFLAGS="$save_CFLAGS $altivec_CFLAGS"
711 vector unsigned int vzero() {
712 return vec_splat_u32(0);
717 have_altivec_h_hdr=yes
719 AC_MSG_RESULT($have_gcc_altivec)
722 if test x$have_gcc_altivec = xno; then
723 AC_MSG_CHECKING(for Altivec with GCC -faltivec option)
725 vector unsigned int vzero() {
726 return vec_splat_u32(0);
732 AC_MSG_RESULT($have_gcc_altivec)
734 CFLAGS="$save_CFLAGS"
736 if test x$have_gcc_altivec = xyes; then
737 AC_DEFINE(SDL_ALTIVEC_BLITTERS, 1, [ ])
738 if test x$have_altivec_h_hdr = xyes; then
739 AC_DEFINE(HAVE_ALTIVEC_H, 1, [ ])
741 EXTRA_CFLAGS="$EXTRA_CFLAGS $altivec_CFLAGS"
742 SUMMARY_math="${SUMMARY_math} altivec"
747 dnl See if the OSS audio interface is supported
751 AC_HELP_STRING([--enable-oss], [support the OSS audio API [[default=maybe]]]),
754 # OpenBSD "has" OSS, but it's not really for app use. They want you to
755 # use sndio instead. So on there, we default to disabled. You can force
756 # it on if you really want, though.
757 if test x$enable_oss = xmaybe; then
765 if test x$enable_audio = xyes -a x$enable_oss = xyes; then
766 AC_MSG_CHECKING(for OSS audio support)
768 if test x$have_oss != xyes; then
770 #include <sys/soundcard.h>
772 int arg = SNDCTL_DSP_SETFRAGMENT;
777 if test x$have_oss != xyes; then
779 #include <soundcard.h>
781 int arg = SNDCTL_DSP_SETFRAGMENT;
784 AC_DEFINE(SDL_AUDIO_DRIVER_OSS_SOUNDCARD_H, 1, [ ])
787 AC_MSG_RESULT($have_oss)
788 if test x$have_oss = xyes; then
789 SUMMARY_audio="${SUMMARY_audio} oss"
790 AC_DEFINE(SDL_AUDIO_DRIVER_OSS, 1, [ ])
791 SOURCES="$SOURCES $srcdir/src/audio/dsp/*.c"
794 # We may need to link with ossaudio emulation library
796 *-*-openbsd*|*-*-netbsd*)
797 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lossaudio";;
803 dnl See if the ALSA audio interface is supported
807 AC_HELP_STRING([--enable-alsa], [support the ALSA audio API [[default=yes]]]),
809 if test x$enable_audio = xyes -a x$enable_alsa = xyes; then
810 AM_PATH_ALSA(1.0.11, have_alsa=yes, have_alsa=no)
811 # Restore all flags from before the ALSA detection runs
812 CFLAGS="$alsa_save_CFLAGS"
813 LDFLAGS="$alsa_save_LDFLAGS"
814 LIBS="$alsa_save_LIBS"
815 if test x$have_alsa = xyes; then
816 AC_ARG_ENABLE(alsa-shared,
817 AC_HELP_STRING([--enable-alsa-shared], [dynamically load ALSA audio support [[default=yes]]]),
818 , enable_alsa_shared=yes)
819 alsa_lib=[`find_lib "libasound.so.*" "$ALSA_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`]
821 AC_DEFINE(SDL_AUDIO_DRIVER_ALSA, 1, [ ])
822 SOURCES="$SOURCES $srcdir/src/audio/alsa/*.c"
823 EXTRA_CFLAGS="$EXTRA_CFLAGS $ALSA_CFLAGS"
824 if test x$have_loadso != xyes && \
825 test x$enable_alsa_shared = xyes; then
826 AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic ALSA loading])
828 if test x$have_loadso = xyes && \
829 test x$enable_alsa_shared = xyes && test x$alsa_lib != x; then
830 echo "-- dynamic libasound -> $alsa_lib"
831 AC_DEFINE_UNQUOTED(SDL_AUDIO_DRIVER_ALSA_DYNAMIC, "$alsa_lib", [ ])
832 SUMMARY_audio="${SUMMARY_audio} alsa(dynamic)"
834 EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ALSA_LIBS"
835 SUMMARY_audio="${SUMMARY_audio} alsa"
846 AC_HELP_STRING([--enable-jack], [use JACK audio [[default=yes]]]),
848 if test x$enable_audio = xyes -a x$enable_jack = xyes; then
851 JACK_REQUIRED_VERSION=0.125
853 AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
854 AC_MSG_CHECKING(for JACK $JACK_REQUIRED_VERSION support)
855 if test x$PKG_CONFIG != xno; then
856 if $PKG_CONFIG --atleast-pkgconfig-version 0.7 && $PKG_CONFIG --atleast-version $JACK_REQUIRED_VERSION jack; then
857 JACK_CFLAGS=`$PKG_CONFIG --cflags jack`
858 JACK_LIBS=`$PKG_CONFIG --libs jack`
862 AC_MSG_RESULT($audio_jack)
864 if test x$audio_jack = xyes; then
865 AC_ARG_ENABLE(jack-shared,
866 AC_HELP_STRING([--enable-jack-shared], [dynamically load JACK audio support [[default=yes]]]),
867 , enable_jack_shared=yes)
868 jack_lib=[`find_lib "libjack.so.*" "$JACK_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`]
870 AC_DEFINE(SDL_AUDIO_DRIVER_JACK, 1, [ ])
871 SOURCES="$SOURCES $srcdir/src/audio/jack/*.c"
872 EXTRA_CFLAGS="$EXTRA_CFLAGS $JACK_CFLAGS"
873 if test x$have_loadso != xyes && \
874 test x$enable_jack_shared = xyes; then
875 AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic JACK audio loading])
877 if test x$have_loadso = xyes && \
878 test x$enable_jack_shared = xyes && test x$jack_lib != x; then
879 echo "-- dynamic libjack -> $jack_lib"
880 AC_DEFINE_UNQUOTED(SDL_AUDIO_DRIVER_JACK_DYNAMIC, "$jack_lib", [ ])
881 SUMMARY_audio="${SUMMARY_audio} jack(dynamic)"
884 # On Solaris, jack must be linked deferred explicitly
885 # to prevent undefined symbol failures.
887 JACK_LIBS=`echo $JACK_LIBS | sed 's/\-l/-Wl,-l/g'`
888 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-zdeferred $JACK_LIBS -Wl,-znodeferred"
891 EXTRA_LDFLAGS="$EXTRA_LDFLAGS $JACK_LIBS"
892 SUMMARY_audio="${SUMMARY_audio} jack"
899 dnl Find the ESD includes and libraries
903 AC_HELP_STRING([--enable-esd], [support the Enlightened Sound Daemon [[default=yes]]]),
905 if test x$enable_audio = xyes -a x$enable_esd = xyes; then
906 AM_PATH_ESD(0.2.8, have_esd=yes, have_esd=no)
907 if test x$have_esd = xyes; then
908 AC_ARG_ENABLE(esd-shared,
909 AC_HELP_STRING([--enable-esd-shared], [dynamically load ESD audio support [[default=yes]]]),
910 , enable_esd_shared=yes)
911 esd_lib=[`find_lib "libesd.so.*" "$ESD_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`]
913 AC_DEFINE(SDL_AUDIO_DRIVER_ESD, 1, [ ])
914 SOURCES="$SOURCES $srcdir/src/audio/esd/*.c"
915 EXTRA_CFLAGS="$EXTRA_CFLAGS $ESD_CFLAGS"
916 if test x$have_loadso != xyes && \
917 test x$enable_esd_shared = xyes; then
918 AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic ESD loading])
920 if test x$have_loadso = xyes && \
921 test x$enable_esd_shared = xyes && test x$esd_lib != x; then
922 echo "-- dynamic libesd -> $esd_lib"
923 AC_DEFINE_UNQUOTED(SDL_AUDIO_DRIVER_ESD_DYNAMIC, "$esd_lib", [ ])
924 SUMMARY_audio="${SUMMARY_audio} esd(dynamic)"
926 EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ESD_LIBS"
927 SUMMARY_audio="${SUMMARY_audio} esd"
937 AC_ARG_ENABLE(pulseaudio,
938 AC_HELP_STRING([--enable-pulseaudio], [use PulseAudio [[default=yes]]]),
939 , enable_pulseaudio=yes)
940 if test x$enable_audio = xyes -a x$enable_pulseaudio = xyes; then
943 PULSEAUDIO_REQUIRED_VERSION=0.9
945 AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
946 AC_MSG_CHECKING(for PulseAudio $PULSEAUDIO_REQUIRED_VERSION support)
947 if test x$PKG_CONFIG != xno; then
948 if $PKG_CONFIG --atleast-pkgconfig-version 0.7 && $PKG_CONFIG --atleast-version $PULSEAUDIO_REQUIRED_VERSION libpulse-simple; then
949 PULSEAUDIO_CFLAGS=`$PKG_CONFIG --cflags libpulse-simple`
950 PULSEAUDIO_LIBS=`$PKG_CONFIG --libs libpulse-simple`
954 AC_MSG_RESULT($audio_pulseaudio)
956 if test x$audio_pulseaudio = xyes; then
957 AC_ARG_ENABLE(pulseaudio-shared,
958 AC_HELP_STRING([--enable-pulseaudio-shared], [dynamically load PulseAudio support [[default=yes]]]),
959 , enable_pulseaudio_shared=yes)
960 pulseaudio_lib=[`find_lib "libpulse-simple.so.*" "$PULSEAUDIO_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`]
962 AC_DEFINE(SDL_AUDIO_DRIVER_PULSEAUDIO, 1, [ ])
963 SOURCES="$SOURCES $srcdir/src/audio/pulseaudio/*.c"
964 EXTRA_CFLAGS="$EXTRA_CFLAGS $PULSEAUDIO_CFLAGS"
965 if test x$have_loadso != xyes && \
966 test x$enable_pulseaudio_shared = xyes; then
967 AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic PulseAudio loading])
969 if test x$have_loadso = xyes && \
970 test x$enable_pulseaudio_shared = xyes && test x$pulseaudio_lib != x; then
971 echo "-- dynamic libpulse-simple -> $pulseaudio_lib"
972 AC_DEFINE_UNQUOTED(SDL_AUDIO_DRIVER_PULSEAUDIO_DYNAMIC, "$pulseaudio_lib", [ ])
973 SUMMARY_audio="${SUMMARY_audio} pulse(dynamic)"
976 # On Solaris, pulseaudio must be linked deferred explicitly
977 # to prevent undefined symbol failures.
979 PULSEAUDIO_LIBS=`echo $PULSEAUDIO_LIBS | sed 's/\-l/-Wl,-l/g'`
980 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-zdeferred $PULSEAUDIO_LIBS -Wl,-znodeferred"
983 EXTRA_LDFLAGS="$EXTRA_LDFLAGS $PULSEAUDIO_LIBS"
984 SUMMARY_audio="${SUMMARY_audio} pulse"
994 AC_HELP_STRING([--enable-arts], [support the Analog Real Time Synthesizer [[default=yes]]]),
996 if test x$enable_audio = xyes -a x$enable_arts = xyes; then
997 AC_PATH_PROG(ARTSCONFIG, artsc-config)
998 if test x$ARTSCONFIG = x -o x$ARTSCONFIG = x'"$ARTSCONFIG"'; then
999 : # arts isn't installed
1001 ARTS_CFLAGS=`$ARTSCONFIG --cflags`
1002 ARTS_LIBS=`$ARTSCONFIG --libs`
1003 AC_MSG_CHECKING(for aRts development environment)
1005 save_CFLAGS="$CFLAGS"
1006 CFLAGS="$CFLAGS $ARTS_CFLAGS"
1010 arts_stream_t stream;
1014 CFLAGS="$save_CFLAGS"
1015 AC_MSG_RESULT($audio_arts)
1016 if test x$audio_arts = xyes; then
1017 AC_ARG_ENABLE(arts-shared,
1018 AC_HELP_STRING([--enable-arts-shared], [dynamically load aRts audio support [[default=yes]]]),
1019 , enable_arts_shared=yes)
1020 arts_lib=[`find_lib "libartsc.so.*" "$ARTS_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`]
1022 AC_DEFINE(SDL_AUDIO_DRIVER_ARTS, 1, [ ])
1023 SOURCES="$SOURCES $srcdir/src/audio/arts/*.c"
1024 EXTRA_CFLAGS="$EXTRA_CFLAGS $ARTS_CFLAGS"
1025 if test x$have_loadso != xyes && \
1026 test x$enable_arts_shared = xyes; then
1027 AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic ARTS loading])
1029 if test x$have_loadso = xyes && \
1030 test x$enable_arts_shared = xyes && test x$arts_lib != x; then
1031 echo "-- dynamic libartsc -> $arts_lib"
1032 AC_DEFINE_UNQUOTED(SDL_AUDIO_DRIVER_ARTS_DYNAMIC, "$arts_lib", [ ])
1033 SUMMARY_audio="${SUMMARY_audio} arts(dynamic)"
1035 EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ARTS_LIBS"
1036 SUMMARY_audio="${SUMMARY_audio} arts"
1044 dnl See if the NAS audio interface is supported
1048 AC_HELP_STRING([--enable-nas], [support the NAS audio API [[default=yes]]]),
1050 if test x$enable_audio = xyes -a x$enable_nas = xyes; then
1051 AC_CHECK_HEADER(audio/audiolib.h, have_nas_hdr=yes)
1052 AC_CHECK_LIB(audio, AuOpenServer, have_nas_lib=yes)
1054 AC_MSG_CHECKING(for NAS audio support)
1057 if test x$have_nas_hdr = xyes -a x$have_nas_lib = xyes; then
1061 elif test -r /usr/X11R6/include/audio/audiolib.h; then
1063 NAS_CFLAGS="-I/usr/X11R6/include/"
1064 NAS_LIBS="-L/usr/X11R6/lib -laudio -lXt"
1068 AC_MSG_RESULT($have_nas)
1070 if test x$have_nas = xyes; then
1071 AC_ARG_ENABLE(nas-shared,
1072 AC_HELP_STRING([--enable-nas-shared], [dynamically load NAS audio support [[default=yes]]]),
1073 , enable_nas_shared=yes)
1074 nas_lib=[`find_lib "libaudio.so.*" "$NAS_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`]
1076 if test x$have_loadso != xyes && \
1077 test x$enable_nas_shared = xyes; then
1078 AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic NAS loading])
1080 if test x$have_loadso = xyes && \
1081 test x$enable_nas_shared = xyes && test x$nas_lib != x; then
1082 echo "-- dynamic libaudio -> $nas_lib"
1083 AC_DEFINE_UNQUOTED(SDL_AUDIO_DRIVER_NAS_DYNAMIC, "$nas_lib", [ ])
1084 SUMMARY_audio="${SUMMARY_audio} nas(dynamic)"
1086 EXTRA_LDFLAGS="$EXTRA_LDFLAGS $NAS_LIBS"
1087 SUMMARY_audio="${SUMMARY_audio} nas"
1090 AC_DEFINE(SDL_AUDIO_DRIVER_NAS, 1, [ ])
1091 SOURCES="$SOURCES $srcdir/src/audio/nas/*.c"
1092 EXTRA_CFLAGS="$EXTRA_CFLAGS $NAS_CFLAGS"
1098 dnl See if the sndio audio interface is supported
1101 AC_ARG_ENABLE(sndio,
1102 AC_HELP_STRING([--enable-sndio], [support the sndio audio API [[default=yes]]]),
1104 if test x$enable_audio = xyes -a x$enable_sndio = xyes; then
1105 AC_CHECK_HEADER(sndio.h, have_sndio_hdr=yes)
1106 AC_CHECK_LIB(sndio, sio_open, have_sndio_lib=yes)
1108 AC_MSG_CHECKING(for sndio audio support)
1111 if test x$have_sndio_hdr = xyes -a x$have_sndio_lib = xyes; then
1113 SNDIO_LIBS="-lsndio"
1116 AC_MSG_RESULT($have_sndio)
1118 if test x$have_sndio = xyes; then
1119 AC_ARG_ENABLE(sndio-shared,
1120 AC_HELP_STRING([--enable-sndio-shared], [dynamically load sndio audio support [[default=yes]]]),
1121 , enable_sndio_shared=yes)
1122 sndio_lib=[`find_lib "libsndio.so.*" "$SNDIO_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`]
1124 if test x$have_loadso != xyes && \
1125 test x$enable_sndio_shared = xyes; then
1126 AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic sndio loading])
1128 if test x$have_loadso = xyes && \
1129 test x$enable_sndio_shared = xyes && test x$sndio_lib != x; then
1130 echo "-- dynamic libsndio -> $sndio_lib"
1131 AC_DEFINE_UNQUOTED(SDL_AUDIO_DRIVER_SNDIO_DYNAMIC, "$sndio_lib", [ ])
1132 SUMMARY_audio="${SUMMARY_audio} sndio(dynamic)"
1134 EXTRA_LDFLAGS="$EXTRA_LDFLAGS $SNDIO_LIBS"
1135 SUMMARY_audio="${SUMMARY_audio} sndio"
1138 AC_DEFINE(SDL_AUDIO_DRIVER_SNDIO, 1, [ ])
1139 SOURCES="$SOURCES $srcdir/src/audio/sndio/*.c"
1140 EXTRA_CFLAGS="$EXTRA_CFLAGS $SNDIO_CFLAGS"
1146 dnl Find FusionSound
1149 AC_ARG_ENABLE(fusionsound,
1150 AC_HELP_STRING([--enable-fusionsound], [use FusionSound audio driver [[default=no]]]),
1151 , enable_fusionsound=no)
1152 if test x$enable_audio = xyes -a x$enable_fusionsound = xyes; then
1155 FUSIONSOUND_REQUIRED_VERSION=1.1.1
1157 AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
1158 AC_MSG_CHECKING(for FusionSound $FUSIONSOUND_REQUIRED_VERSION support)
1159 if test x$PKG_CONFIG != xno; then
1160 if $PKG_CONFIG --atleast-pkgconfig-version 0.7 && $PKG_CONFIG --atleast-version $FUSIONSOUND_REQUIRED_VERSION fusionsound; then
1161 FUSIONSOUND_CFLAGS=`$PKG_CONFIG --cflags fusionsound`
1162 FUSIONSOUND_LIBS=`$PKG_CONFIG --libs fusionsound`
1166 AC_MSG_RESULT($fusionsound)
1168 if test x$fusionsound = xyes; then
1169 AC_DEFINE(SDL_AUDIO_DRIVER_FUSIONSOUND, 1, [ ])
1170 SOURCES="$SOURCES $srcdir/src/audio/fusionsound/*.c"
1171 EXTRA_CFLAGS="$EXTRA_CFLAGS $FUSIONSOUND_CFLAGS"
1173 AC_ARG_ENABLE(fusionsound-shared,
1174 AC_HELP_STRING([--enable-fusionsound-shared], [dynamically load fusionsound audio support [[default=yes]]]),
1175 , enable_fusionsound_shared=yes)
1176 fusionsound_shared=no
1177 AC_MSG_CHECKING(for FusionSound dynamic loading support)
1178 if test x$have_loadso != xyes && \
1179 test x$enable_fusionsound_shared = xyes; then
1180 AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic fusionsound loading])
1182 if test x$have_loadso = xyes && \
1183 test x$enable_fusionsound_shared = xyes; then
1184 AC_DEFINE_UNQUOTED(SDL_AUDIO_DRIVER_FUSIONSOUND_DYNAMIC, "libfusionsound.so", [ ])
1185 fusionsound_shared=yes
1186 SUMMARY_audio="${SUMMARY_audio} fusionsound(dynamic)"
1188 EXTRA_LDFLAGS="$EXTRA_LDFLAGS $FUSIONSOUND_LIBS"
1189 SUMMARY_audio="${SUMMARY_audio} fusionsound"
1191 AC_MSG_RESULT($fusionsound_shared)
1198 dnl rcg07142001 See if the user wants the disk writer audio driver...
1201 AC_ARG_ENABLE(diskaudio,
1202 AC_HELP_STRING([--enable-diskaudio], [support the disk writer audio driver [[default=yes]]]),
1203 , enable_diskaudio=yes)
1204 if test x$enable_audio = xyes -a x$enable_diskaudio = xyes; then
1205 AC_DEFINE(SDL_AUDIO_DRIVER_DISK, 1, [ ])
1206 SOURCES="$SOURCES $srcdir/src/audio/disk/*.c"
1207 SUMMARY_audio="${SUMMARY_audio} disk"
1211 dnl rcg03142006 See if the user wants the dummy audio driver...
1214 AC_ARG_ENABLE(dummyaudio,
1215 AC_HELP_STRING([--enable-dummyaudio], [support the dummy audio driver [[default=yes]]]),
1216 , enable_dummyaudio=yes)
1217 if test x$enable_audio = xyes -a x$enable_dummyaudio = xyes; then
1218 AC_DEFINE(SDL_AUDIO_DRIVER_DUMMY, 1, [ ])
1219 SOURCES="$SOURCES $srcdir/src/audio/dummy/*.c"
1220 SUMMARY_audio="${SUMMARY_audio} dummy"
1224 dnl See if libsamplerate is available
1225 CheckLibSampleRate()
1227 AC_ARG_ENABLE(libsamplerate,
1228 AC_HELP_STRING([--enable-libsamplerate], [use libsamplerate for audio rate conversion [[default=yes]]]),
1229 , enable_libsamplerate=yes)
1230 if test x$enable_libsamplerate = xyes; then
1231 AC_CHECK_HEADER(samplerate.h,
1232 have_samplerate_h_hdr=yes,
1233 have_samplerate_h_hdr=no)
1234 if test x$have_samplerate_h_hdr = xyes; then
1235 AC_DEFINE(HAVE_LIBSAMPLERATE_H, 1, [ ])
1237 AC_ARG_ENABLE(libsamplerate-shared,
1238 AC_HELP_STRING([--enable-libsamplerate-shared], [dynamically load libsamplerate [[default=yes]]]),
1239 , enable_libsamplerate_shared=yes)
1241 samplerate_lib=[`find_lib "libsamplerate.so.*" "" | sed 's/.*\/\(.*\)/\1/; q'`]
1243 if test x$have_loadso != xyes && \
1244 test x$enable_libsamplerate_shared = xyes; then
1245 AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic libsamplerate loading])
1247 if test x$have_loadso = xyes && \
1248 test x$enable_libsamplerate_shared = xyes && test x$samplerate_lib != x; then
1249 echo "-- dynamic libsamplerate -> $samplerate_lib"
1250 AC_DEFINE_UNQUOTED(SDL_LIBSAMPLERATE_DYNAMIC, "$samplerate_lib", [ ])
1252 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lsamplerate"
1258 dnl See if GCC's -fvisibility=hidden is supported (gcc4 and later, usually).
1259 dnl Details of this flag are here: http://gcc.gnu.org/wiki/Visibility
1260 CheckVisibilityHidden()
1262 AC_MSG_CHECKING(for GCC -fvisibility=hidden option)
1263 have_gcc_fvisibility=no
1265 visibility_CFLAGS="-fvisibility=hidden"
1266 save_CFLAGS="$CFLAGS"
1267 CFLAGS="$save_CFLAGS $visibility_CFLAGS -Werror"
1269 #if !defined(__GNUC__) || __GNUC__ < 4
1270 #error SDL only uses visibility attributes in GCC 4 or newer
1274 have_gcc_fvisibility=yes
1276 AC_MSG_RESULT($have_gcc_fvisibility)
1277 CFLAGS="$save_CFLAGS"
1279 if test x$have_gcc_fvisibility = xyes; then
1280 EXTRA_CFLAGS="$EXTRA_CFLAGS $visibility_CFLAGS"
1284 dnl See if GCC's -mpreferred-stack-boundary is supported.
1285 dnl Reference: http://bugzilla.libsdl.org/show_bug.cgi?id=1296
1286 CheckStackBoundary()
1288 AC_MSG_CHECKING(for GCC -mpreferred-stack-boundary option)
1289 have_gcc_preferred_stack_boundary=no
1291 save_CFLAGS="$CFLAGS"
1292 CFLAGS="$save_CFLAGS -mpreferred-stack-boundary=2"
1297 have_gcc_preferred_stack_boundary=yes
1299 AC_MSG_RESULT($have_gcc_preferred_stack_boundary)
1300 CFLAGS="$save_CFLAGS"
1302 if test x$have_gcc_preferred_stack_boundary = xyes; then
1303 EXTRA_CFLAGS="$EXTRA_CFLAGS -mpreferred-stack-boundary=2"
1307 dnl See if GCC's -Wdeclaration-after-statement is supported.
1308 dnl This lets us catch things that would fail on a C89 compiler when using
1310 CheckDeclarationAfterStatement()
1312 AC_MSG_CHECKING(for GCC -Wdeclaration-after-statement option)
1313 have_gcc_declaration_after_statement=no
1315 save_CFLAGS="$CFLAGS"
1316 CFLAGS="$save_CFLAGS -Wdeclaration-after-statement -Werror=declaration-after-statement"
1321 have_gcc_declaration_after_statement=yes
1323 AC_MSG_RESULT($have_gcc_declaration_after_statement)
1324 CFLAGS="$save_CFLAGS"
1326 if test x$have_gcc_declaration_after_statement = xyes; then
1327 EXTRA_CFLAGS="$EXTRA_CFLAGS -Wdeclaration-after-statement -Werror=declaration-after-statement"
1331 dnl See if GCC's -Wall is supported.
1334 AC_MSG_CHECKING(for GCC -Wall option)
1337 save_CFLAGS="$CFLAGS"
1338 CFLAGS="$save_CFLAGS -Wall"
1345 AC_MSG_RESULT($have_gcc_Wall)
1346 CFLAGS="$save_CFLAGS"
1348 if test x$have_gcc_Wall = xyes; then
1349 EXTRA_CFLAGS="$EXTRA_CFLAGS -Wall"
1351 dnl Haiku headers use multicharacter constants all over the place. Ignore these warnings when using -Wall.
1352 AC_MSG_CHECKING(for necessary GCC -Wno-multichar option)
1353 need_gcc_Wno_multichar=no
1356 need_gcc_Wno_multichar=yes
1359 AC_MSG_RESULT($need_gcc_Wno_multichar)
1360 if test x$need_gcc_Wno_multichar = xyes; then
1361 EXTRA_CFLAGS="$EXTRA_CFLAGS -Wno-multichar"
1366 dnl Check for Wayland
1369 AC_ARG_ENABLE(video-wayland,
1370 AC_HELP_STRING([--enable-video-wayland], [use Wayland video driver [[default=yes]]]),
1371 ,enable_video_wayland=yes)
1373 AC_ARG_ENABLE(video-wayland-qt-touch,
1374 AC_HELP_STRING([--enable-video-wayland-qt-touch], [QtWayland server support for Wayland video driver [[default=yes]]]),
1375 ,enable_video_wayland_qt_touch=yes)
1377 if test x$enable_video = xyes -a x$enable_video_wayland = xyes; then
1378 AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
1379 AC_MSG_CHECKING(for Wayland support)
1381 if test x$PKG_CONFIG != xno && \
1382 test x$video_opengl_egl = xyes && \
1383 test x$video_opengles_v2 = xyes; then
1384 if $PKG_CONFIG --exists wayland-client wayland-scanner wayland-protocols wayland-egl wayland-cursor egl xkbcommon ; then
1385 WAYLAND_CFLAGS=`$PKG_CONFIG --cflags wayland-client wayland-egl wayland-cursor xkbcommon`
1386 WAYLAND_LIBS=`$PKG_CONFIG --libs wayland-client wayland-egl wayland-cursor xkbcommon`
1387 WAYLAND_SCANNER=`$PKG_CONFIG --variable=wayland_scanner wayland-scanner`
1388 WAYLAND_CORE_PROTOCOL_DIR=`$PKG_CONFIG --variable=pkgdatadir wayland-client`
1389 WAYLAND_PROTOCOLS_DIR=`$PKG_CONFIG --variable=pkgdatadir wayland-protocols`
1393 AC_MSG_RESULT($video_wayland)
1395 if test x$video_wayland = xyes; then
1396 AC_DEFINE(SDL_VIDEO_DRIVER_WAYLAND, 1, [ ])
1397 if test x$enable_video_wayland_qt_touch = xyes; then
1398 AC_DEFINE(SDL_VIDEO_DRIVER_WAYLAND_QT_TOUCH, 1, [ ])
1401 WAYLAND_PROTOCOLS_UNSTABLE="relative-pointer-unstable-v1 pointer-constraints-unstable-v1"
1403 SOURCES="$SOURCES $srcdir/src/video/wayland/*.c"
1404 EXTRA_CFLAGS="$EXTRA_CFLAGS $WAYLAND_CFLAGS -I\$(gen)"
1405 AC_ARG_ENABLE(wayland-shared,
1406 AC_HELP_STRING([--enable-wayland-shared], [dynamically load Wayland support [[default=maybe]]]),
1407 , enable_wayland_shared=maybe)
1409 dnl FIXME: Do BSD and OS X need special cases?
1412 wayland_client_lib=[`find_lib "libwayland-client.so.*" "$WAYLAND_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`]
1413 wayland_egl_lib=[`find_lib "libwayland-egl.so.*" "$WAYLAND_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`]
1414 if test x$wayland_egl_lib = x; then
1415 dnl This works in Ubuntu 13.10, maybe others
1416 wayland_egl_lib=[`find_lib "mesa-egl/libwayland-egl.so.*" "$WAYLAND_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`]
1418 wayland_cursor_lib=[`find_lib "libwayland-cursor.so.*" "$WAYLAND_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`]
1419 xkbcommon_lib=[`find_lib "libxkbcommon.so.*" "$WAYLAND_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`]
1423 if test x$enable_wayland_shared = xmaybe; then
1424 enable_wayland_shared=yes
1426 if test x$have_loadso != xyes && \
1427 test x$enable_wayland_shared = xyes; then
1428 AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic Wayland loading])
1429 enable_wayland_shared=no
1431 if test x$have_loadso = xyes && \
1432 test x$enable_wayland_shared = xyes && \
1433 test x$wayland_client_lib != x && \
1434 test x$wayland_egl_lib != x && \
1435 test x$wayland_cursor_lib != x && \
1436 test x$xkbcommon_lib != x; then
1437 echo "-- dynamic libwayland-client -> $wayland_client_lib"
1438 echo "-- dynamic libwayland-egl -> $wayland_egl_lib"
1439 echo "-- dynamic libwayland-cursor -> $wayland_cursor_lib"
1440 echo "-- dynamic libxkbcommon -> $xkbcommon_lib"
1441 AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC, "$wayland_client_lib", [ ])
1442 AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_EGL, "$wayland_egl_lib", [ ])
1443 AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_CURSOR, "$wayland_cursor_lib", [ ])
1444 AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_XKBCOMMON, "$xkbcommon_lib", [ ])
1445 SUMMARY_video="${SUMMARY_video} wayland(dynamic)"
1447 enable_wayland_shared=no
1448 EXTRA_LDFLAGS="$EXTRA_LDFLAGS $WAYLAND_LIBS"
1449 SUMMARY_video="${SUMMARY_video} wayland"
1459 AC_ARG_ENABLE(video-mir,
1460 AC_HELP_STRING([--enable-video-mir], [use Mir video driver [[default=yes]]]),
1461 ,enable_video_mir=yes)
1463 if test x$enable_video = xyes -a x$enable_video_mir = xyes; then
1464 AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
1465 AC_MSG_CHECKING(for Mir support)
1467 if test x$PKG_CONFIG != xno; then
1468 if $PKG_CONFIG --exists mirclient egl xkbcommon ; then
1469 MIR_CFLAGS=`$PKG_CONFIG --cflags mirclient egl xkbcommon`
1470 MIR_LIBS=`$PKG_CONFIG --libs mirclient egl xkbcommon`
1471 save_CFLAGS="$CFLAGS"
1472 CFLAGS="$save_CFLAGS $MIR_CFLAGS"
1474 dnl This will disable Mir if >= v0.26 is not available
1476 #include <mir_toolkit/mir_client_library.h>
1478 MirWindowAttrib attrib = mir_window_attrib_state
1482 CFLAGS="$save_CFLAGS"
1485 AC_MSG_RESULT($video_mir)
1487 if test x$video_mir = xyes; then
1488 AC_DEFINE(SDL_VIDEO_DRIVER_MIR, 1, [ ])
1489 SOURCES="$SOURCES $srcdir/src/video/mir/*.c"
1490 EXTRA_CFLAGS="$EXTRA_CFLAGS $MIR_CFLAGS"
1491 AC_ARG_ENABLE(mir-shared,
1492 AC_HELP_STRING([--enable-mir-shared], [dynamically load Mir support [[default=maybe]]]),
1493 , enable_mir_shared=maybe)
1495 dnl FIXME: Do BSD and OS X need special cases?
1498 mirclient_lib=[`find_lib "libmirclient.so.*" "$MIR_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`]
1499 xkbcommon_lib=[`find_lib "libxkbcommon.so.*" "$MIR_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`]
1503 if test x$enable_mir_shared = xmaybe; then
1504 enable_mir_shared=yes
1506 if test x$have_loadso != xyes && \
1507 test x$enable_mir_shared = xyes; then
1508 AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic Mir loading])
1509 enable_mir_shared=no
1511 if test x$have_loadso = xyes && \
1512 test x$enable_mir_shared = xyes && \
1513 test x$mirclient_lib != x && \
1514 test x$xkbcommon_lib != x; then
1515 echo "-- dynamic libmirclient -> $mirclient_lib"
1516 echo "-- dynamic libxkbcommon -> $xkbcommon_lib"
1517 AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_MIR_DYNAMIC, "$mirclient_lib", [ ])
1518 AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_MIR_DYNAMIC_XKBCOMMON, "$xkbcommon_lib", [ ])
1519 SUMMARY_video="${SUMMARY_video} mir(dynamic)"
1521 enable_mir_shared=no
1522 EXTRA_LDFLAGS="$EXTRA_LDFLAGS $MIR_LIBS"
1523 SUMMARY_video="${SUMMARY_video} mir"
1530 dnl Check for Native Client stuff
1534 #if !defined(__native_client__)
1539 AC_DEFINE(SDL_VIDEO_DRIVER_NACL, 1, [ ])
1540 AC_DEFINE(SDL_AUDIO_DRIVER_NACL, 1, [ ])
1541 AC_DEFINE(HAVE_POW, 1, [ ])
1542 AC_DEFINE(HAVE_OPENGLES2, 1, [ ])
1543 AC_DEFINE(SDL_VIDEO_OPENGL_ES2, 1, [ ])
1544 AC_DEFINE(SDL_VIDEO_RENDER_OGL_ES2, 1, [ ])
1546 SDL_LIBS="-lppapi_simple -lppapi_gles2 $SDL_LIBS"
1548 SDLMAIN_SOURCES="$srcdir/src/main/nacl/*.c"
1549 SOURCES="$SOURCES $srcdir/src/audio/nacl/*.c"
1550 SUMMARY_audio="${SUMMARY_audio} nacl"
1551 SOURCES="$SOURCES $srcdir/src/video/nacl/*.c"
1552 SUMMARY_video="${SUMMARY_video} nacl opengles2"
1559 AC_ARG_ENABLE(video-rpi,
1560 AC_HELP_STRING([--enable-video-rpi], [use Raspberry Pi video driver [[default=yes]]]),
1561 , enable_video_rpi=yes)
1562 if test x$enable_video = xyes -a x$enable_video_rpi = xyes; then
1563 if test x$ARCH = xnetbsd; then
1564 RPI_CFLAGS="-I/usr/pkg/include -I/usr/pkg/include/interface/vcos/pthreads -I/usr/pkg/include/interface/vmcs_host/linux"
1565 RPI_LDFLAGS="-Wl,-R/usr/pkg/lib -L/usr/pkg/lib -lbcm_host"
1567 RPI_CFLAGS="-I/opt/vc/include -I/opt/vc/include/interface/vcos/pthreads -I/opt/vc/include/interface/vmcs_host/linux"
1568 RPI_LDFLAGS="-L/opt/vc/lib -lbcm_host"
1571 # Save the original compiler flags and libraries
1572 ac_save_cflags="$CFLAGS"; ac_save_libs="$LIBS"
1574 # Add the Raspberry Pi compiler flags and libraries
1575 CFLAGS="$CFLAGS $RPI_CFLAGS"; LIBS="$LIBS $RPI_LDFLAGS"
1577 AC_MSG_CHECKING(for Raspberry Pi)
1580 #include <bcm_host.h>
1587 AC_MSG_RESULT($have_video_rpi)
1589 # Restore the compiler flags and libraries
1590 CFLAGS="$ac_save_cflags"; LIBS="$ac_save_libs"
1592 if test x$have_video_rpi = xyes; then
1593 CFLAGS="$CFLAGS $RPI_CFLAGS"
1594 SDL_CFLAGS="$SDL_CFLAGS $RPI_CFLAGS"
1595 EXTRA_CFLAGS="$EXTRA_CFLAGS $RPI_CFLAGS"
1596 EXTRA_LDFLAGS="$EXTRA_LDFLAGS $RPI_LDFLAGS"
1597 SOURCES="$SOURCES $srcdir/src/video/raspberry/*.c"
1598 AC_DEFINE(SDL_VIDEO_DRIVER_RPI, 1, [ ])
1599 SUMMARY_video="${SUMMARY_video} rpi"
1604 dnl Find the X11 include and library directories
1607 AC_ARG_ENABLE(video-x11,
1608 AC_HELP_STRING([--enable-video-x11], [use X11 video driver [[default=yes]]]),
1609 , enable_video_x11=yes)
1610 if test x$enable_video = xyes -a x$enable_video_x11 = xyes; then
1613 # This isn't necessary for X11, but fixes GLX detection
1614 if test "x$x_includes" = xNONE && \
1615 test "x$x_libraries" = xNONE && \
1616 test -d /usr/X11R6/include && \
1617 test -d /usr/X11R6/lib; then
1618 x_includes="/usr/X11R6/include"
1619 x_libraries="/usr/X11R6/lib"
1625 if test x$have_x = xyes; then
1626 AC_ARG_ENABLE(x11-shared,
1627 AC_HELP_STRING([--enable-x11-shared], [dynamically load X11 support [[default=maybe]]]),
1628 , enable_x11_shared=maybe)
1632 x11_lib='/usr/X11R6/lib/libX11.6.dylib'
1633 x11ext_lib='/usr/X11R6/lib/libXext.6.dylib'
1634 xcursor_lib='/usr/X11R6/lib/libXcursor.1.dylib'
1635 xinerama_lib='/usr/X11R6/lib/libXinerama.1.dylib'
1636 xinput_lib='/usr/X11R6/lib/libXi.6.dylib'
1637 xrandr_lib='/usr/X11R6/lib/libXrandr.2.dylib'
1638 xrender_lib='/usr/X11R6/lib/libXrender.1.dylib'
1639 xss_lib='/usr/X11R6/lib/libXss.1.dylib'
1640 xvidmode_lib='/usr/X11R6/lib/libXxf86vm.1.dylib'
1644 x11ext_lib='libXext.so'
1645 xcursor_lib='libXcursor.so'
1646 xinerama_lib='libXinerama.so'
1647 xinput_lib='libXi.so'
1648 xrandr_lib='libXrandr.so'
1649 xrender_lib='libXrender.so'
1651 xvidmode_lib='libXxf86vm.so'
1654 x11_lib=[`find_lib "libX11.so.*" "$X_LIBS -L/usr/X11/$base_libdir -L/usr/X11R6/$base_libdir" | sed 's/.*\/\(.*\)/\1/; q'`]
1655 x11ext_lib=[`find_lib "libXext.so.*" "$X_LIBS -L/usr/X11/$base_libdir -L/usr/X11R6/$base_libdir" | sed 's/.*\/\(.*\)/\1/; q'`]
1656 xcursor_lib=[`find_lib "libXcursor.so.*" "$X_LIBS -L/usr/X11/$base_libdir -L/usr/X11R6/$base_libdir" | sed 's/.*\/\(.*\)/\1/; q'`]
1657 xinerama_lib=[`find_lib "libXinerama.so.*" "$X_LIBS -L/usr/X11/$base_libdir -L/usr/X11R6/$base_libdir" | sed 's/.*\/\(.*\)/\1/; q'`]
1658 xinput_lib=[`find_lib "libXi.so.*" "$X_LIBS -L/usr/X11/$base_libdir -L/usr/X11R6/$base_libdir" | sed 's/.*\/\(.*\)/\1/; q'`]
1659 xrandr_lib=[`find_lib "libXrandr.so.*" "$X_LIBS -L/usr/X11/$base_libdir -L/usr/X11R6/$base_libdir" | sed 's/.*\/\(.*\)/\1/; q'`]
1660 xrender_lib=[`find_lib "libXrender.so.*" "$X_LIBS -L/usr/X11/$base_libdir -L/usr/X11R6/$base_libdir" | sed 's/.*\/\(.*\)/\1/; q'`]
1661 xss_lib=[`find_lib "libXss.so.*" "$X_LIBS -L/usr/X11/$base_libdir -L/usr/X11R6/$base_libdir" | sed 's/.*\/\(.*\)/\1/; q'`]
1662 xvidmode_lib=[`find_lib "libXxf86vm.so.*" "$X_LIBS -L/usr/X11/$base_libdir -L/usr/X11R6/$base_libdir" | sed 's/.*\/\(.*\)/\1/; q'`]
1666 if test x$ac_cv_func_shmat != xyes; then
1667 X_CFLAGS="$X_CFLAGS -DNO_SHARED_MEMORY"
1669 CFLAGS="$CFLAGS $X_CFLAGS"
1670 LDFLAGS="$LDFLAGS $X_LIBS"
1672 AC_CHECK_HEADER(X11/extensions/Xext.h,
1673 have_xext_h_hdr=yes,
1675 [#include <X11/Xlib.h>
1676 #include <X11/Xproto.h>
1678 if test x$have_xext_h_hdr != xyes; then
1680 *** Missing Xext.h, maybe you need to install the libxext-dev package?
1684 AC_DEFINE(SDL_VIDEO_DRIVER_X11, 1, [ ])
1685 SOURCES="$SOURCES $srcdir/src/video/x11/*.c"
1686 EXTRA_CFLAGS="$EXTRA_CFLAGS $X_CFLAGS"
1688 # Needed so SDL applications can include SDL_syswm.h
1689 SDL_CFLAGS="$SDL_CFLAGS $X_CFLAGS"
1691 if test x$enable_x11_shared = xmaybe; then
1692 enable_x11_shared=yes
1694 if test x$have_loadso != xyes && \
1695 test x$enable_x11_shared = xyes; then
1696 AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic X11 loading])
1697 enable_x11_shared=no
1699 if test x$have_loadso = xyes && \
1700 test x$enable_x11_shared = xyes && test x$x11_lib != x && test x$x11ext_lib != x; then
1701 echo "-- dynamic libX11 -> $x11_lib"
1702 echo "-- dynamic libX11ext -> $x11ext_lib"
1703 AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_X11_DYNAMIC, "$x11_lib", [ ])
1704 AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_X11_DYNAMIC_XEXT, "$x11ext_lib", [ ])
1705 SUMMARY_video="${SUMMARY_video} x11(dynamic)"
1707 enable_x11_shared=no
1708 EXTRA_LDFLAGS="$EXTRA_LDFLAGS $X_LIBS -lX11 -lXext"
1709 SUMMARY_video="${SUMMARY_video} x11"
1713 AC_MSG_CHECKING(for const parameter to XextAddDisplay)
1714 have_const_param_XextAddDisplay=no
1716 #include <X11/Xlib.h>
1717 #include <X11/Xproto.h>
1718 #include <X11/extensions/Xext.h>
1719 #include <X11/extensions/extutil.h>
1720 extern XExtDisplayInfo* XextAddDisplay(XExtensionInfo* a,Display* b,_Xconst char* c,XExtensionHooks* d,int e,XPointer f);
1723 have_const_param_XextAddDisplay=yes
1724 AC_DEFINE([SDL_VIDEO_DRIVER_X11_CONST_PARAM_XEXTADDDISPLAY], 1, [ ])
1726 AC_MSG_RESULT($have_const_param_XextAddDisplay)
1728 dnl AC_CHECK_LIB(X11, XGetEventData, AC_DEFINE(SDL_VIDEO_DRIVER_X11_SUPPORTS_GENERIC_EVENTS, 1, [Have XGenericEvent]))
1729 AC_MSG_CHECKING([for XGenericEvent])
1730 have_XGenericEvent=no
1732 #include <X11/Xlib.h>
1736 XGenericEventCookie *cookie = &event.xcookie;
1737 XNextEvent(display, &event);
1738 XGetEventData(display, cookie);
1739 XFreeEventData(display, cookie);
1741 have_XGenericEvent=yes
1742 AC_DEFINE([SDL_VIDEO_DRIVER_X11_SUPPORTS_GENERIC_EVENTS], 1, [ ])
1744 AC_MSG_RESULT($have_XGenericEvent)
1746 AC_CHECK_LIB(X11, XkbKeycodeToKeysym, AC_DEFINE(SDL_VIDEO_DRIVER_X11_HAS_XKBKEYCODETOKEYSYM, 1, [Have XkbKeycodeToKeysym]))
1748 AC_ARG_ENABLE(video-x11-xcursor,
1749 AC_HELP_STRING([--enable-video-x11-xcursor], [enable X11 Xcursor support [[default=yes]]]),
1750 , enable_video_x11_xcursor=yes)
1751 if test x$enable_video_x11_xcursor = xyes; then
1752 definitely_enable_video_x11_xcursor=no
1753 AC_CHECK_HEADER(X11/Xcursor/Xcursor.h,
1754 have_xcursor_h_hdr=yes,
1755 have_xcursor_h_hdr=no,
1756 [#include <X11/Xlib.h>
1758 if test x$have_xcursor_h_hdr = xyes; then
1759 if test x$enable_x11_shared = xyes && test x$xcursor_lib != x ; then
1760 echo "-- dynamic libXcursor -> $xcursor_lib"
1761 AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_X11_DYNAMIC_XCURSOR, "$xcursor_lib", [ ])
1762 definitely_enable_video_x11_xcursor=yes
1764 AC_CHECK_LIB(Xcursor, XcursorImageCreate, have_xcursor_lib=yes)
1765 if test x$have_xcursor_lib = xyes ; then
1766 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lXcursor"
1767 definitely_enable_video_x11_xcursor=yes
1772 if test x$definitely_enable_video_x11_xcursor = xyes; then
1773 AC_DEFINE(SDL_VIDEO_DRIVER_X11_XCURSOR, 1, [ ])
1774 SUMMARY_video_x11="${SUMMARY_video_x11} xcursor"
1776 AC_ARG_ENABLE(video-x11-xdbe,
1777 AC_HELP_STRING([--enable-video-x11-xdbe], [enable X11 Xdbe support [[default=yes]]]),
1778 , enable_video_x11_xdbe=yes)
1779 if test x$enable_video_x11_xdbe = xyes; then
1780 AC_CHECK_HEADER(X11/extensions/Xdbe.h,
1783 [#include <X11/Xlib.h>
1785 if test x$have_dbe_h_hdr = xyes; then
1786 AC_DEFINE(SDL_VIDEO_DRIVER_X11_XDBE, 1, [ ])
1787 SUMMARY_video_x11="${SUMMARY_video_x11} xdbe"
1790 AC_ARG_ENABLE(video-x11-xinerama,
1791 AC_HELP_STRING([--enable-video-x11-xinerama], [enable X11 Xinerama support [[default=yes]]]),
1792 , enable_video_x11_xinerama=yes)
1793 if test x$enable_video_x11_xinerama = xyes; then
1794 definitely_enable_video_x11_xinerama=no
1795 AC_CHECK_HEADER(X11/extensions/Xinerama.h,
1796 have_xinerama_h_hdr=yes,
1797 have_xinerama_h_hdr=no,
1798 [#include <X11/Xlib.h>
1800 if test x$have_xinerama_h_hdr = xyes; then
1801 if test x$enable_x11_shared = xyes && test x$xinerama_lib != x ; then
1802 echo "-- dynamic libXinerama -> $xinerama_lib"
1803 AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_X11_DYNAMIC_XINERAMA, "$xinerama_lib", [ ])
1804 definitely_enable_video_x11_xinerama=yes
1806 AC_CHECK_LIB(Xinerama, XineramaQueryExtension, have_xinerama_lib=yes)
1807 if test x$have_xinerama_lib = xyes ; then
1808 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lXinerama"
1809 definitely_enable_video_x11_xinerama=yes
1814 if test x$definitely_enable_video_x11_xinerama = xyes; then
1815 AC_DEFINE(SDL_VIDEO_DRIVER_X11_XINERAMA, 1, [ ])
1816 SUMMARY_video_x11="${SUMMARY_video_x11} xinerama"
1818 AC_ARG_ENABLE(video-x11-xinput,
1819 AC_HELP_STRING([--enable-video-x11-xinput], [enable X11 XInput extension for manymouse, tablets, etc [[default=yes]]]),
1820 , enable_video_x11_xinput=yes)
1821 if test x$enable_video_x11_xinput = xyes; then
1822 definitely_enable_video_x11_xinput=no
1823 AC_CHECK_HEADER(X11/extensions/XInput2.h,
1824 have_xinput_h_hdr=yes,
1825 have_xinput_h_hdr=no,
1826 [#include <X11/Xlib.h>
1828 if test x$have_xinput_h_hdr = xyes; then
1829 if test x$enable_x11_shared = xyes && test x$xinput_lib != x ; then
1830 echo "-- dynamic libXi -> $xinput_lib"
1831 AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_X11_DYNAMIC_XINPUT2, "$xinput_lib", [ ])
1832 definitely_enable_video_x11_xinput=yes
1834 AC_CHECK_LIB(Xi, XOpenDevice, have_xinput_lib=yes)
1835 if test x$have_xinput_lib = xyes ; then
1836 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lXi"
1837 definitely_enable_video_x11_xinput=yes
1842 if test x$definitely_enable_video_x11_xinput = xyes; then
1843 SUMMARY_video_x11="${SUMMARY_video_x11} xinput2"
1844 AC_DEFINE(SDL_VIDEO_DRIVER_X11_XINPUT2, 1, [ ])
1845 AC_MSG_CHECKING(for xinput2 multitouch)
1846 have_xinput2_multitouch=no
1848 #include <X11/Xlib.h>
1849 #include <X11/Xproto.h>
1850 #include <X11/extensions/XInput2.h>
1852 int event_type = XI_TouchBegin;
1853 XITouchClassInfo *t;
1855 have_xinput2_multitouch=yes
1856 AC_DEFINE([SDL_VIDEO_DRIVER_X11_XINPUT2_SUPPORTS_MULTITOUCH], 1, [])
1857 SUMMARY_video_x11="${SUMMARY_video_x11} xinput2_multitouch"
1859 AC_MSG_RESULT($have_xinput2_multitouch)
1861 AC_ARG_ENABLE(video-x11-xrandr,
1862 AC_HELP_STRING([--enable-video-x11-xrandr], [enable X11 Xrandr extension for fullscreen [[default=yes]]]),
1863 , enable_video_x11_xrandr=yes)
1864 if test x$enable_video_x11_xrandr = xyes; then
1865 dnl XRRScreenResources is only present in Xrandr >= 1.2, we use that as a test.
1866 definitely_enable_video_x11_xrandr=no
1867 have_xrandr_h_hdr=no
1869 #include <X11/Xlib.h>
1870 #include <X11/extensions/Xrandr.h>
1872 XRRScreenResources *res = NULL;
1874 have_xrandr_h_hdr=yes
1876 if test x$have_xrandr_h_hdr = xyes; then
1877 if test x$enable_x11_shared = xyes && test x$xrandr_lib != x ; then
1878 echo "-- dynamic libXrandr -> $xrandr_lib"
1879 AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_X11_DYNAMIC_XRANDR, "$xrandr_lib", [ ])
1880 definitely_enable_video_x11_xrandr=yes
1882 AC_CHECK_LIB(Xrandr, XRRQueryExtension, have_xrandr_lib=yes)
1883 if test x$have_xrandr_lib = xyes ; then
1884 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lXrandr"
1885 definitely_enable_video_x11_xrandr=yes
1890 if test x$definitely_enable_video_x11_xrandr = xyes; then
1891 AC_DEFINE(SDL_VIDEO_DRIVER_X11_XRANDR, 1, [ ])
1892 SUMMARY_video_x11="${SUMMARY_video_x11} xrandr"
1894 AC_ARG_ENABLE(video-x11-scrnsaver,
1895 AC_HELP_STRING([--enable-video-x11-scrnsaver], [enable X11 screensaver extension [[default=yes]]]),
1896 , enable_video_x11_scrnsaver=yes)
1897 if test x$enable_video_x11_scrnsaver = xyes; then
1898 AC_CHECK_HEADER(X11/extensions/scrnsaver.h,
1899 have_scrnsaver_h_hdr=yes,
1900 have_scrnsaver_h_hdr=no,
1901 [#include <X11/Xlib.h>
1903 if test x$have_scrnsaver_h_hdr = xyes; then
1904 if test x$enable_x11_shared = xyes && test x$xss_lib != x ; then
1905 echo "-- dynamic libXss -> $xss_lib"
1906 AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_X11_DYNAMIC_XSS, "$xss_lib", [ ])
1907 definitely_enable_video_x11_scrnsaver=yes
1909 AC_CHECK_LIB(Xss, XScreenSaverSuspend, have_xss_lib=yes)
1910 if test x$have_xss_lib = xyes ; then
1911 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lXss"
1912 definitely_enable_video_x11_scrnsaver=yes
1917 if test x$definitely_enable_video_x11_scrnsaver = xyes; then
1918 AC_DEFINE(SDL_VIDEO_DRIVER_X11_XSCRNSAVER, 1, [ ])
1919 SUMMARY_video_x11="${SUMMARY_video_x11} xscrnsaver"
1921 AC_ARG_ENABLE(video-x11-xshape,
1922 AC_HELP_STRING([--enable-video-x11-xshape], [enable X11 XShape support [[default=yes]]]),
1923 , enable_video_x11_xshape=yes)
1924 if test x$enable_video_x11_xshape = xyes; then
1925 AC_CHECK_HEADER(X11/extensions/shape.h,
1926 have_shape_h_hdr=yes,
1927 have_shape_h_hdr=no,
1928 [#include <X11/Xlib.h>
1930 if test x$have_shape_h_hdr = xyes; then
1931 AC_DEFINE(SDL_VIDEO_DRIVER_X11_XSHAPE, 1, [ ])
1932 SUMMARY_video_x11="${SUMMARY_video_x11} xshape"
1935 AC_ARG_ENABLE(video-x11-vm,
1936 AC_HELP_STRING([--enable-video-x11-vm], [use X11 VM extension for fullscreen [[default=yes]]]),
1937 , enable_video_x11_vm=yes)
1938 if test x$enable_video_x11_vm = xyes; then
1939 definitely_enable_video_x11_vm=no
1940 AC_CHECK_HEADER(X11/extensions/xf86vmode.h,
1943 [#include <X11/Xlib.h>
1945 if test x$have_vm_h_hdr = xyes; then
1946 if test x$enable_x11_shared = xyes && test x$xvidmode_lib != x ; then
1947 echo "-- dynamic libXxf86vm -> $xvidmode_lib"
1948 AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_X11_DYNAMIC_XVIDMODE, "$xvidmode_lib", [ ])
1949 definitely_enable_video_x11_vm=yes
1951 AC_CHECK_LIB(Xxf86vm, XF86VidModeQueryVersion, have_vm_lib=yes)
1952 if test x$have_vm_lib = xyes ; then
1953 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lXxf86vm"
1954 definitely_enable_video_x11_vm=yes
1959 if test x$definitely_enable_video_x11_vm = xyes; then
1960 AC_DEFINE(SDL_VIDEO_DRIVER_X11_XVIDMODE, 1, [ ])
1961 SUMMARY_video_x11="${SUMMARY_video_x11} xvidmode"
1967 dnl Set up the Vivante video driver if enabled
1970 AC_ARG_ENABLE(video-vivante,
1971 AC_HELP_STRING([--enable-video-vivante], [use Vivante EGL video driver [[default=yes]]]),
1972 , enable_video_vivante=yes)
1973 if test x$enable_video = xyes -a x$enable_video_vivante = xyes; then
1974 AC_MSG_CHECKING(for Vivante VDK API)
1982 have_vivante_vdk=yes
1984 AC_MSG_RESULT($have_vivante_vdk)
1986 AC_MSG_CHECKING(for Vivante FB API)
1991 #include <EGL/eglvivante.h>
1994 have_vivante_egl=yes
1996 AC_MSG_RESULT($have_vivante_egl)
1998 if test x$have_vivante_vdk = xyes -o x$have_vivante_egl = xyes; then
1999 AC_DEFINE(SDL_VIDEO_DRIVER_VIVANTE, 1, [ ])
2000 EXTRA_CFLAGS="$EXTRA_CFLAGS -DLINUX -DEGL_API_FB"
2001 if test x$have_vivante_vdk = xyes; then
2002 AC_DEFINE(SDL_VIDEO_DRIVER_VIVANTE_VDK, 1, [ ])
2003 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lVDK"
2005 SOURCES="$SOURCES $srcdir/src/video/vivante/*.c"
2006 SUMMARY_video="${SUMMARY_video} vivante"
2012 dnl Set up the Haiku video driver if enabled
2015 if test x$enable_video = xyes; then
2016 AC_DEFINE(SDL_VIDEO_DRIVER_HAIKU, 1, [ ])
2017 SOURCES="$SOURCES $srcdir/src/video/haiku/*.cc"
2019 SUMMARY_video="${SUMMARY_video} haiku"
2023 dnl Set up the Cocoa video driver for Mac OS X (but not Darwin)
2026 AC_ARG_ENABLE(video-cocoa,
2027 AC_HELP_STRING([--enable-video-cocoa], [use Cocoa video driver [[default=yes]]]),
2028 , enable_video_cocoa=yes)
2029 if test x$enable_video = xyes -a x$enable_video_cocoa = xyes; then
2030 save_CFLAGS="$CFLAGS"
2031 dnl Work around that we don't have Objective-C support in autoconf
2032 CFLAGS="$CFLAGS -x objective-c"
2033 AC_MSG_CHECKING(for Cocoa framework)
2036 #import <Cocoa/Cocoa.h>
2041 AC_MSG_RESULT($have_cocoa)
2042 CFLAGS="$save_CFLAGS"
2043 if test x$have_cocoa = xyes; then
2044 AC_DEFINE(SDL_VIDEO_DRIVER_COCOA, 1, [ ])
2045 SOURCES="$SOURCES $srcdir/src/video/cocoa/*.m"
2046 SUMMARY_video="${SUMMARY_video} cocoa"
2055 AC_ARG_ENABLE(video-directfb,
2056 AC_HELP_STRING([--enable-video-directfb], [use DirectFB video driver [[default=no]]]),
2057 , enable_video_directfb=no)
2058 if test x$enable_video = xyes -a x$enable_video_directfb = xyes; then
2061 DIRECTFB_REQUIRED_VERSION=1.0.0
2062 AC_PATH_PROGS(DIRECTFBCONFIG, directfb-config, no, [$prefix/bin:$PATH])
2063 if test x$DIRECTFBCONFIG = xno; then
2064 AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
2065 if test x$PKG_CONFIG != xno; then
2066 if $PKG_CONFIG --atleast-pkgconfig-version 0.7 && $PKG_CONFIG --atleast-version $DIRECTFB_REQUIRED_VERSION directfb; then
2067 DIRECTFB_CFLAGS=`$PKG_CONFIG --cflags directfb`
2068 DIRECTFB_LIBS=`$PKG_CONFIG --libs directfb`
2069 DIRECTFB_PREFIX=`$PKG_CONFIG --variable=prefix directfb`
2074 set -- `echo $DIRECTFB_REQUIRED_VERSION | sed 's/\./ /g'`
2075 NEED_VERSION=`expr $1 \* 10000 + $2 \* 100 + $3`
2076 set -- `$DIRECTFBCONFIG --version | sed 's/\./ /g'`
2077 HAVE_VERSION=`expr $1 \* 10000 + $2 \* 100 + $3`
2078 if test $HAVE_VERSION -ge $NEED_VERSION; then
2079 DIRECTFB_CFLAGS=`$DIRECTFBCONFIG --cflags`
2080 DIRECTFB_LIBS=`$DIRECTFBCONFIG --libs`
2081 DIRECTFB_PREFIX=`$DIRECTFBCONFIG --prefix`
2085 if test x$video_directfb = xyes; then
2086 # SuSE 11.1 installs directfb-config without directfb-devel
2087 save_CPPFLAGS="$CPPFLAGS"
2088 CPPFLAGS="$CPPFLAGS $DIRECTFB_CFLAGS"
2089 AC_CHECK_HEADER(directfb.h, have_directfb_hdr=yes, have_directfb_hdr=no)
2090 CPPFLAGS="$save_CPPFLAGS"
2091 video_directfb=$have_directfb_hdr
2093 AC_MSG_CHECKING(for DirectFB $DIRECTFB_REQUIRED_VERSION support)
2094 AC_MSG_RESULT($video_directfb)
2096 if test x$video_directfb = xyes; then
2097 AC_ARG_ENABLE(directfb-shared,
2098 AC_HELP_STRING([--enable-directfb-shared], [dynamically load directfb support [[default=yes]]]),
2099 , enable_directfb_shared=yes)
2101 AC_DEFINE(SDL_VIDEO_DRIVER_DIRECTFB, 1, [ ])
2102 AC_DEFINE(SDL_VIDEO_RENDER_DIRECTFB, 1, [ ])
2103 SOURCES="$SOURCES $srcdir/src/video/directfb/*.c"
2104 EXTRA_CFLAGS="$EXTRA_CFLAGS $DIRECTFB_CFLAGS"
2106 AC_MSG_CHECKING(for directfb dynamic loading support)
2108 directfb_lib=[`find_lib "libdirectfb*.so.*" "$DIRECTFB_LIBS"`]
2109 # | sed 's/.*\/\(.*\)/\1/; q'`]
2110 AC_MSG_WARN("directfb $directfb_lib")
2111 if test x$have_loadso != xyes && \
2112 test x$enable_directfb_shared = xyes; then
2113 AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic directfb loading])
2115 if test x$have_loadso = xyes && \
2116 test x$enable_directfb_shared = xyes && test x$directfb_lib != x; then
2118 echo "-- $directfb_lib_spec -> $directfb_lib"
2119 AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_DIRECTFB_DYNAMIC, "$directfb_lib", [ ])
2120 SUMMARY_video="${SUMMARY_video} directfb(dynamic)"
2122 EXTRA_LDFLAGS="$EXTRA_LDFLAGS $DIRECTFB_LIBS"
2123 SUMMARY_video="${SUMMARY_video} directfb"
2125 AC_MSG_RESULT($directfb_shared)
2126 SDL_CFLAGS="$SDL_CFLAGS $DIRECTFB_CFLAGS"
2135 AC_ARG_ENABLE(video-kmsdrm,
2136 AC_HELP_STRING([--enable-video-kmsdrm], [use KMSDRM video driver [[default=no]]]),
2137 , enable_video_kmsdrm=no)
2139 if test x$enable_video = xyes -a x$enable_video_kmsdrm = xyes; then
2144 LIBDRM_REQUIRED_VERSION=2.4.46
2145 LIBGBM_REQUIRED_VERSION=9.0.0
2147 AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
2148 if test x$PKG_CONFIG != xno; then
2149 if $PKG_CONFIG --atleast-pkgconfig-version 0.7; then
2150 if $PKG_CONFIG --atleast-version $LIBDRM_REQUIRED_VERSION libdrm; then
2151 LIBDRM_CFLAGS=`$PKG_CONFIG --cflags libdrm`
2152 LIBDRM_LIBS=`$PKG_CONFIG --libs libdrm`
2153 LIBDRM_PREFIX=`$PKG_CONFIG --variable=prefix libdrm`
2156 if $PKG_CONFIG --atleast-version $LIBGBM_REQUIRED_VERSION gbm; then
2157 LIBGBM_CFLAGS=`$PKG_CONFIG --cflags gbm`
2158 LIBGBM_LIBS=`$PKG_CONFIG --libs gbm`
2159 LIBGBM_PREFIX=`$PKG_CONFIG --variable=prefix gbm`
2162 if test x$libdrm_avail = xyes -a x$libgbm_avail = xyes; then
2166 AC_MSG_CHECKING(for libdrm $LIBDRM_REQUIRED_VERSION library for kmsdrm support)
2167 AC_MSG_RESULT($libdrm_avail)
2168 AC_MSG_CHECKING(for libgbm $LIBGBM_REQUIRED_VERSION library for kmsdrm support)
2169 AC_MSG_RESULT($libgbm_avail)
2171 if test x$video_kmsdrm = xyes; then
2172 AC_ARG_ENABLE(kmsdrm-shared,
2173 AC_HELP_STRING([--enable-kmsdrm-shared], [dynamically load kmsdrm support [[default=yes]]]),
2174 , enable_kmsdrm_shared=yes)
2176 AC_DEFINE(SDL_VIDEO_DRIVER_KMSDRM, 1, [ ])
2177 SOURCES="$SOURCES $srcdir/src/video/kmsdrm/*.c"
2178 EXTRA_CFLAGS="$EXTRA_CFLAGS $LIBDRM_CFLAGS $LIBGBM_CFLAGS"
2180 AC_MSG_CHECKING(for kmsdrm dynamic loading support)
2182 drm_lib=[`find_lib "libdrm.so.*" "$DRM_LIBS"`]
2183 gbm_lib=[`find_lib "libgbm.so.*" "$DRM_LIBS"`]
2184 if test x$have_loadso != xyes && \
2185 test x$enable_kmsdrm_shared = xyes; then
2186 AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic kmsdrm loading])
2188 if test x$have_loadso = xyes && \
2189 test x$enable_kmsdrm_shared = xyes && test x$drm_lib != x && test x$gbm_lib != x; then
2191 AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_KMSDRM_DYNAMIC, "$drm_lib", [ ])
2192 AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_KMSDRM_DYNAMIC_GBM, "$gbm_lib", [ ])
2193 AC_DEFINE_UNQUOTED(HAVE_KMSDRM_SHARED, "TRUE", [ ])
2194 SUMMARY_video="${SUMMARY_video} kmsdrm(dynamic)"
2196 EXTRA_LDFLAGS="$EXTRA_LDFLAGS $LIBDRM_LIBS $LIBGBM_LIBS"
2197 SUMMARY_video="${SUMMARY_video} kmsdrm"
2199 AC_MSG_RESULT($kmsdrm_shared)
2207 dnl rcg04172001 Set up the Null video driver.
2210 AC_ARG_ENABLE(video-dummy,
2211 AC_HELP_STRING([--enable-video-dummy], [use dummy video driver [[default=yes]]]),
2212 , enable_video_dummy=yes)
2213 if test x$enable_video_dummy = xyes; then
2214 AC_DEFINE(SDL_VIDEO_DRIVER_DUMMY, 1, [ ])
2215 SOURCES="$SOURCES $srcdir/src/video/dummy/*.c"
2217 SUMMARY_video="${SUMMARY_video} dummy"
2221 dnl Set up the QNX video driver if enabled
2224 if test x$enable_video = xyes; then
2225 AC_DEFINE(SDL_VIDEO_DRIVER_QNX, 1, [ ])
2226 SOURCES="$SOURCES $srcdir/src/video/qnx/*.c"
2228 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lscreen -lEGL -lGLESv2"
2229 SUMMARY_video="${SUMMARY_video} qnx"
2233 dnl Set up the QNX audio driver if enabled
2236 if test x$enable_audio = xyes; then
2237 AC_DEFINE(SDL_AUDIO_DRIVER_QSA, 1, [ ])
2238 SOURCES="$SOURCES $srcdir/src/audio/qsa/*.c"
2240 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lasound"
2241 SUMMARY_audio="${SUMMARY_audio} qsa"
2245 dnl Check to see if OpenGL support is desired
2246 AC_ARG_ENABLE(video-opengl,
2247 AC_HELP_STRING([--enable-video-opengl], [include OpenGL support [[default=yes]]]),
2248 , enable_video_opengl=yes)
2253 if test x$enable_video = xyes -a x$enable_video_opengl = xyes; then
2254 AC_MSG_CHECKING(for OpenGL (GLX) support)
2263 AC_MSG_RESULT($video_opengl)
2264 if test x$video_opengl = xyes; then
2265 AC_DEFINE(SDL_VIDEO_OPENGL, 1, [ ])
2266 AC_DEFINE(SDL_VIDEO_OPENGL_GLX, 1, [ ])
2267 AC_DEFINE(SDL_VIDEO_RENDER_OGL, 1, [ ])
2268 SUMMARY_video="${SUMMARY_video} opengl"
2273 dnl Check to see if OpenGL ES support is desired
2274 AC_ARG_ENABLE(video-opengles,
2275 AC_HELP_STRING([--enable-video-opengles], [include OpenGL ES support [[default=yes]]]),
2276 , enable_video_opengles=yes)
2277 AC_ARG_ENABLE(video-opengles1,
2278 AC_HELP_STRING([--enable-video-opengles1], [include OpenGL ES 1.1 support [[default=yes]]]),
2279 , enable_video_opengles1=yes)
2280 AC_ARG_ENABLE(video-opengles2,
2281 AC_HELP_STRING([--enable-video-opengles2], [include OpenGL ES 2.0 support [[default=yes]]]),
2282 , enable_video_opengles2=yes)
2287 if test x$enable_video = xyes -a x$enable_video_opengles = xyes; then
2288 AC_MSG_CHECKING(for EGL support)
2293 #include <EGL/egl.h>
2294 #include <EGL/eglext.h>
2297 video_opengl_egl=yes
2299 AC_MSG_RESULT($video_opengl_egl)
2300 if test x$video_opengl_egl = xyes; then
2301 AC_DEFINE(SDL_VIDEO_OPENGL_EGL, 1, [ ])
2304 if test x$enable_video_opengles1 = xyes; then
2305 AC_MSG_CHECKING(for OpenGL ES v1 headers)
2306 video_opengles_v1=no
2308 #include <GLES/gl.h>
2309 #include <GLES/glext.h>
2312 video_opengles_v1=yes
2314 AC_MSG_RESULT($video_opengles_v1)
2315 if test x$video_opengles_v1 = xyes; then
2316 AC_DEFINE(SDL_VIDEO_OPENGL_ES, 1, [ ])
2317 AC_DEFINE(SDL_VIDEO_RENDER_OGL_ES, 1, [ ])
2318 SUMMARY_video="${SUMMARY_video} opengl_es1"
2322 if test x$enable_video_opengles2 = xyes; then
2323 AC_MSG_CHECKING(for OpenGL ES v2 headers)
2324 video_opengles_v2=no
2326 #include <GLES2/gl2.h>
2327 #include <GLES2/gl2ext.h>
2330 video_opengles_v2=yes
2332 AC_MSG_RESULT($video_opengles_v2)
2333 if test x$video_opengles_v2 = xyes; then
2334 AC_DEFINE(SDL_VIDEO_OPENGL_ES2, 1, [ ])
2335 AC_DEFINE(SDL_VIDEO_RENDER_OGL_ES2, 1, [ ])
2336 SUMMARY_video="${SUMMARY_video} opengl_es2"
2342 dnl Check for Windows OpenGL
2345 if test x$enable_video = xyes -a x$enable_video_opengl = xyes; then
2346 AC_DEFINE(SDL_VIDEO_OPENGL, 1, [ ])
2347 AC_DEFINE(SDL_VIDEO_OPENGL_WGL, 1, [ ])
2348 AC_DEFINE(SDL_VIDEO_RENDER_OGL, 1, [ ])
2349 SUMMARY_video="${SUMMARY_video} opengl"
2353 dnl Check for Windows OpenGL
2356 if test x$enable_video = xyes -a x$enable_video_opengles = xyes; then
2358 AC_MSG_CHECKING(for EGL support)
2361 #include <EGL/egl.h>
2364 video_opengl_egl=yes
2366 AC_MSG_RESULT($video_opengl_egl)
2367 if test x$video_opengl_egl = xyes; then
2368 AC_DEFINE(SDL_VIDEO_OPENGL, 1, [ ])
2369 AC_DEFINE(SDL_VIDEO_OPENGL_EGL, 1, [ ])
2370 SUMMARY_video="${SUMMARY_video} opengl_es1"
2373 AC_MSG_CHECKING(for OpenGL ES v2 headers)
2374 video_opengles_v2=no
2376 #include <GLES2/gl2.h>
2377 #include <GLES2/gl2ext.h>
2380 video_opengles_v2=yes
2382 AC_MSG_RESULT($video_opengles_v2)
2383 if test x$video_opengles_v2 = xyes; then
2384 AC_DEFINE(SDL_VIDEO_OPENGL, 1, [ ])
2385 AC_DEFINE(SDL_VIDEO_OPENGL_ES2, 1, [ ])
2386 AC_DEFINE(SDL_VIDEO_RENDER_OGL_ES2, 1, [ ])
2387 SUMMARY_video="${SUMMARY_video} opengl_es2"
2392 dnl Check for Haiku OpenGL
2395 if test x$enable_video = xyes -a x$enable_video_opengl = xyes; then
2396 AC_DEFINE(SDL_VIDEO_OPENGL, 1, [ ])
2397 AC_DEFINE(SDL_VIDEO_OPENGL_HAIKU, 1, [ ])
2398 AC_DEFINE(SDL_VIDEO_RENDER_OGL, 1, [ ])
2399 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lGL"
2400 SUMMARY_video="${SUMMARY_video} opengl"
2404 dnl Check for MacOS OpenGL
2407 if test x$enable_video = xyes -a x$enable_video_opengl = xyes; then
2408 AC_DEFINE(SDL_VIDEO_OPENGL, 1, [ ])
2409 AC_DEFINE(SDL_VIDEO_OPENGL_CGL, 1, [ ])
2410 AC_DEFINE(SDL_VIDEO_RENDER_OGL, 1, [ ])
2411 SUMMARY_video="${SUMMARY_video} opengl"
2415 CheckEmscriptenGLES()
2417 if test x$enable_video = xyes -a x$enable_video_opengles = xyes; then
2418 AC_MSG_CHECKING(for EGL support)
2421 #include <EGL/egl.h>
2424 video_opengl_egl=yes
2426 AC_MSG_RESULT($video_opengl_egl)
2427 if test x$video_opengl_egl = xyes; then
2428 AC_DEFINE(SDL_VIDEO_OPENGL_EGL, 1, [ ])
2431 AC_MSG_CHECKING(for OpenGL ES v2 headers)
2432 video_opengles_v2=no
2434 #include <GLES2/gl2.h>
2435 #include <GLES2/gl2ext.h>
2438 video_opengles_v2=yes
2440 AC_MSG_RESULT($video_opengles_v2)
2441 if test x$video_opengles_v2 = xyes; then
2442 AC_DEFINE(SDL_VIDEO_OPENGL_ES2, 1, [ ])
2443 AC_DEFINE(SDL_VIDEO_RENDER_OGL_ES2, 1, [ ])
2444 SUMMARY_video="${SUMMARY_video} opengl_es2"
2449 dnl Check to see if Vulkan support is desired
2450 AC_ARG_ENABLE(video-vulkan,
2451 AC_HELP_STRING([--enable-video-vulkan], [include Vulkan support [[default=yes]]]),
2452 , enable_video_vulkan=yes)
2454 dnl Find Vulkan Header
2457 if test x$enable_video = xyes -a x$enable_video_vulkan = xyes; then
2461 #if defined(__ARM_ARCH) && __ARM_ARCH < 7
2462 #error Vulkan doesn't work on this configuration
2467 enable_video_vulkan=no
2471 save_CFLAGS="$CFLAGS"
2472 dnl Work around that we don't have Objective-C support in autoconf
2473 CFLAGS="$CFLAGS -x objective-c"
2475 #include <Cocoa/Cocoa.h>
2476 #include <Metal/Metal.h>
2477 #include <QuartzCore/CAMetalLayer.h>
2479 #if !TARGET_CPU_X86_64
2480 #error Vulkan doesn't work on this configuration
2485 enable_video_vulkan=no
2487 CFLAGS="$save_CFLAGS"
2492 if test x$enable_video_vulkan = xno; then
2493 # For reasons I am totally unable to see, I get an undefined macro error if
2494 # I put this in the AC_TRY_COMPILE.
2495 AC_MSG_WARN([Vulkan does not work on this configuration.])
2498 if test x$enable_video_vulkan = xyes; then
2499 AC_DEFINE(SDL_VIDEO_VULKAN, 1, [ ])
2500 SUMMARY_video="${SUMMARY_video} vulkan"
2504 dnl See if we can use the new unified event interface in Linux 2.4
2507 dnl Check for Linux 2.4 unified input event interface support
2508 AC_MSG_CHECKING(for Linux 2.4 unified input interface)
2511 #include <linux/input.h>
2514 #error EVIOCGNAME() ioctl not available
2517 use_input_events=yes
2519 AC_MSG_RESULT($use_input_events)
2520 if test x$use_input_events = xyes; then
2521 AC_DEFINE(SDL_INPUT_LINUXEV, 1, [ ])
2522 SUMMARY_input="${SUMMARY_input} linuxev"
2526 dnl See if we can use the kernel kd.h header
2530 AC_MSG_CHECKING(for Linux kd.h)
2533 #include <linux/kd.h>
2534 #include <linux/keyboard.h>
2537 kbe.kb_table = KG_CTRL;
2538 ioctl(0, KDGKBENT, &kbe);
2542 AC_MSG_RESULT($use_input_kd)
2543 if test x$use_input_kd = xyes; then
2544 AC_DEFINE(SDL_INPUT_LINUXKD, 1, [ ])
2545 SUMMARY_input="${SUMMARY_input} linuxkd"
2549 dnl See if the platform offers libudev for device enumeration and hotplugging.
2552 AC_ARG_ENABLE(libudev,
2553 AC_HELP_STRING([--enable-libudev], [enable libudev support [[default=yes]]]),
2554 , enable_libudev=yes)
2555 if test x$enable_libudev = xyes; then
2556 AC_CHECK_HEADER(libudev.h,
2557 have_libudev_h_hdr=yes,
2558 have_libudev_h_hdr=no)
2559 if test x$have_libudev_h_hdr = xyes; then
2560 AC_DEFINE(HAVE_LIBUDEV_H, 1, [ ])
2562 udev_lib=[`find_lib "libudev.so.*" "" | sed 's/.*\/\(.*\)/\1/; q'`]
2563 if test x$udev_lib != x; then
2564 echo "-- dynamic udev -> $udev_lib"
2565 AC_DEFINE_UNQUOTED(SDL_UDEV_DYNAMIC, "$udev_lib", [ ])
2571 dnl See if the platform offers libdbus for various IPC techniques.
2575 AC_HELP_STRING([--enable-dbus], [enable D-Bus support [[default=yes]]]),
2577 if test x$enable_dbus = xyes; then
2578 AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
2579 if test x$PKG_CONFIG != xno; then
2580 DBUS_CFLAGS=`$PKG_CONFIG --cflags dbus-1`
2581 save_CFLAGS="$CFLAGS"
2582 CFLAGS="$save_CFLAGS $DBUS_CFLAGS"
2583 AC_CHECK_HEADER(dbus/dbus.h,
2584 have_dbus_dbus_h_hdr=yes,
2585 have_dbus_dbus_h_hdr=no)
2586 CFLAGS="$save_CFLAGS"
2587 if test x$have_dbus_dbus_h_hdr = xyes; then
2588 AC_DEFINE(HAVE_DBUS_DBUS_H, 1, [ ])
2589 EXTRA_CFLAGS="$EXTRA_CFLAGS $DBUS_CFLAGS"
2590 SOURCES="$SOURCES $srcdir/src/core/linux/SDL_dbus.c"
2596 dnl See if the platform wanna IME support.
2600 AC_HELP_STRING([--enable-ime], [enable IME support [[default=yes]]]),
2602 if test x$enable_ime = xyes; then
2603 AC_DEFINE(SDL_USE_IME, 1, [ ])
2604 SOURCES="$SOURCES $srcdir/src/core/linux/SDL_ime.c"
2608 dnl See if the platform has libibus IME support.
2612 AC_HELP_STRING([--enable-ibus], [enable IBus support [[default=yes]]]),
2614 if test x$enable_ibus = xyes; then
2615 AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
2616 if test x$PKG_CONFIG != xno; then
2617 IBUS_CFLAGS=`$PKG_CONFIG --cflags ibus-1.0`
2618 save_CFLAGS="$CFLAGS"
2619 CFLAGS="$save_CFLAGS $IBUS_CFLAGS"
2620 AC_CHECK_HEADER(ibus-1.0/ibus.h,
2621 have_ibus_ibus_h_hdr=yes,
2622 have_ibus_ibus_h_hdr=no)
2623 AC_CHECK_HEADER(sys/inotify.h,
2624 have_inotify_inotify_h_hdr=yes,
2625 have_inotify_inotify_h_hdr=no)
2626 CFLAGS="$save_CFLAGS"
2627 if test x$have_ibus_ibus_h_hdr = xyes; then
2628 if test x$enable_ime != xyes; then
2629 AC_MSG_WARN([IME support is required for IBus.])
2630 have_ibus_ibus_h_hdr=no
2631 elif test x$enable_dbus != xyes; then
2632 AC_MSG_WARN([DBus support is required for IBus.])
2633 have_ibus_ibus_h_hdr=no
2634 elif test x$have_inotify_inotify_h_hdr != xyes; then
2635 AC_MSG_WARN([INotify support is required for IBus.])
2636 have_ibus_ibus_h_hdr=no
2638 AC_DEFINE(HAVE_IBUS_IBUS_H, 1, [ ])
2639 EXTRA_CFLAGS="$EXTRA_CFLAGS $IBUS_CFLAGS"
2640 SOURCES="$SOURCES $srcdir/src/core/linux/SDL_ibus.c"
2647 dnl See if the platform has fcitx IME support.
2650 AC_ARG_ENABLE(fcitx,
2651 AC_HELP_STRING([--enable-fcitx], [enable fcitx support [[default=yes]]]),
2653 if test x$enable_fcitx = xyes; then
2654 AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
2655 if test x$PKG_CONFIG != xno; then
2656 FCITX_CFLAGS=`$PKG_CONFIG --cflags fcitx`
2657 CFLAGS="$CFLAGS $FCITX_CFLAGS"
2658 AC_CHECK_HEADER(fcitx/frontend.h,
2659 have_fcitx_frontend_h_hdr=yes,
2660 have_fcitx_frontend_h_hdr=no)
2661 CFLAGS="$save_CFLAGS"
2662 if test x$have_fcitx_frontend_h_hdr = xyes; then
2663 if test x$enable_ime != xyes; then
2664 AC_MSG_WARN([IME support is required for fcitx.])
2665 have_fcitx_frontend_h_hdr=no
2666 elif test x$enable_dbus != xyes; then
2667 AC_MSG_WARN([DBus support is required for fcitx.])
2668 have_fcitx_frontend_h_hdr=no
2670 AC_DEFINE(HAVE_FCITX_FRONTEND_H, 1, [ ])
2671 EXTRA_CFLAGS="$EXTRA_CFLAGS $FCITX_CFLAGS"
2672 SOURCES="$SOURCES $srcdir/src/core/linux/SDL_fcitx.c"
2679 dnl See if we can use the Touchscreen input library
2682 AC_ARG_ENABLE(input-tslib,
2683 AC_HELP_STRING([--enable-input-tslib], [use the Touchscreen library for input [[default=yes]]]),
2684 , enable_input_tslib=yes)
2685 if test x$enable_input_tslib = xyes; then
2686 AC_MSG_CHECKING(for Touchscreen library support)
2687 enable_input_tslib=no
2692 enable_input_tslib=yes
2694 AC_MSG_RESULT($enable_input_tslib)
2695 if test x$enable_input_tslib = xyes; then
2696 AC_DEFINE(SDL_INPUT_TSLIB, 1, [ ])
2697 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lts"
2698 SUMMARY_input="${SUMMARY_input} ts"
2703 dnl See what type of thread model to use on Linux and Solaris
2706 dnl Check for pthread support
2707 AC_ARG_ENABLE(pthreads,
2708 AC_HELP_STRING([--enable-pthreads], [use POSIX threads for multi-threading [[default=yes]]]),
2709 , enable_pthreads=yes)
2710 dnl This is used on Linux for glibc binary compatibility (Doh!)
2711 AC_ARG_ENABLE(pthread-sem,
2712 AC_HELP_STRING([--enable-pthread-sem], [use pthread semaphores [[default=yes]]]),
2713 , enable_pthread_sem=yes)
2716 pthread_cflags="-D_REENTRANT -D_THREAD_SAFE"
2719 *-*-linux*|*-*-uclinux*)
2720 pthread_cflags="-D_REENTRANT"
2721 pthread_lib="-lpthread"
2724 pthread_cflags="-D_REENTRANT -D_THREAD_SAFE"
2728 pthread_cflags="-D_THREAD_SAFE"
2729 # causes Carbon.p complaints?
2730 # pthread_cflags="-D_REENTRANT -D_THREAD_SAFE"
2732 *-*-freebsd*|*-*-dragonfly*)
2733 pthread_cflags="-D_REENTRANT -D_THREAD_SAFE"
2734 pthread_lib="-pthread"
2737 pthread_cflags="-D_REENTRANT -D_THREAD_SAFE"
2738 pthread_lib="-lpthread"
2741 pthread_cflags="-D_REENTRANT"
2742 pthread_lib="-pthread"
2745 # From Solaris 9+, posix4's preferred name is rt.
2746 pthread_cflags="-D_REENTRANT"
2747 pthread_lib="-lpthread -lrt"
2750 # Solaris 10+ merged pthread into libc.
2751 pthread_cflags="-D_REENTRANT"
2755 # Solaris 11+ merged rt into libc.
2756 pthread_cflags="-D_REENTRANT"
2760 pthread_cflags="-D_REENTRANT -Kthread"
2764 pthread_cflags="-D_REENTRANT -mthreads"
2765 pthread_lib="-lpthread"
2768 pthread_cflags="-D_REENTRANT"
2769 pthread_lib="-L/usr/lib -lpthread"
2772 pthread_cflags="-D_REENTRANT"
2776 pthread_cflags="-D_REENTRANT"
2780 pthread_cflags="-D_REENTRANT"
2781 pthread_lib="-lpthread"
2784 if test x$enable_threads = xyes -a x$enable_pthreads = xyes; then
2785 # Save the original compiler flags and libraries
2786 ac_save_cflags="$CFLAGS"; ac_save_libs="$LIBS"
2787 # Add the pthread compiler flags and libraries
2788 CFLAGS="$CFLAGS $pthread_cflags"; LIBS="$LIBS $pthread_lib"
2789 # Check to see if we have pthread support on this system
2790 AC_MSG_CHECKING(for pthreads)
2793 #include <pthread.h>
2795 pthread_attr_t type;
2796 pthread_attr_init(&type);
2800 AC_MSG_RESULT($use_pthreads)
2801 # Restore the compiler flags and libraries
2802 CFLAGS="$ac_save_cflags"; LIBS="$ac_save_libs"
2804 # Do futher testing if we have pthread support...
2805 if test x$use_pthreads = xyes; then
2806 AC_DEFINE(SDL_THREAD_PTHREAD, 1, [ ])
2807 EXTRA_CFLAGS="$EXTRA_CFLAGS $pthread_cflags"
2808 EXTRA_LDFLAGS="$EXTRA_LDFLAGS $pthread_lib"
2809 SDL_CFLAGS="$SDL_CFLAGS $pthread_cflags"
2811 # Save the original compiler flags and libraries
2812 ac_save_cflags="$CFLAGS"; ac_save_libs="$LIBS"
2813 # Add the pthread compiler flags and libraries
2814 CFLAGS="$CFLAGS $pthread_cflags"; LIBS="$LIBS $pthread_lib"
2816 # Check to see if recursive mutexes are available
2817 AC_MSG_CHECKING(for recursive mutexes)
2818 has_recursive_mutexes=no
2819 if test x$has_recursive_mutexes = xno; then
2821 #define _GNU_SOURCE 1
2822 #include <pthread.h>
2824 pthread_mutexattr_t attr;
2825 pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
2827 has_recursive_mutexes=yes
2828 AC_DEFINE(SDL_THREAD_PTHREAD_RECURSIVE_MUTEX, 1, [ ])
2831 if test x$has_recursive_mutexes = xno; then
2833 #define _GNU_SOURCE 1
2834 #include <pthread.h>
2836 pthread_mutexattr_t attr;
2837 pthread_mutexattr_setkind_np(&attr, PTHREAD_MUTEX_RECURSIVE_NP);
2839 has_recursive_mutexes=yes
2840 AC_DEFINE(SDL_THREAD_PTHREAD_RECURSIVE_MUTEX_NP, 1, [ ])
2843 AC_MSG_RESULT($has_recursive_mutexes)
2845 # Check to see if pthread semaphore support is missing
2846 if test x$enable_pthread_sem = xyes; then
2847 AC_MSG_CHECKING(for pthread semaphores)
2850 #include <pthread.h>
2851 #include <semaphore.h>
2854 have_pthread_sem=yes
2856 AC_MSG_RESULT($have_pthread_sem)
2858 if test x$have_pthread_sem = xyes; then
2859 AC_MSG_CHECKING(for sem_timedwait)
2860 have_sem_timedwait=no
2862 #include <pthread.h>
2863 #include <semaphore.h>
2865 sem_timedwait(NULL, NULL);
2867 have_sem_timedwait=yes
2868 AC_DEFINE([HAVE_SEM_TIMEDWAIT], 1, [ ])
2870 AC_MSG_RESULT($have_sem_timedwait)
2873 AC_CHECK_HEADER(pthread_np.h, have_pthread_np_h=yes, have_pthread_np_h=no, [ #include <pthread.h> ])
2874 if test x$have_pthread_np_h = xyes; then
2875 AC_DEFINE(HAVE_PTHREAD_NP_H, 1, [ ])
2878 # Check to see if pthread naming is available
2879 AC_MSG_CHECKING(for pthread_setname_np)
2880 AC_TRY_LINK_FUNC(pthread_setname_np, [
2881 has_pthread_setname_np=yes
2882 AC_DEFINE(HAVE_PTHREAD_SETNAME_NP, 1, [ ])
2884 has_pthread_setname_np=no
2886 AC_MSG_RESULT($has_pthread_setname_np)
2888 AC_MSG_CHECKING(for pthread_set_name_np)
2889 AC_TRY_LINK_FUNC(pthread_set_name_np, [
2890 has_pthread_set_name_np=yes
2891 AC_DEFINE(HAVE_PTHREAD_SET_NAME_NP, 1, [ ])
2893 has_pthread_set_name_np=no
2895 AC_MSG_RESULT($has_pthread_set_name_np)
2897 # Restore the compiler flags and libraries
2898 CFLAGS="$ac_save_cflags"; LIBS="$ac_save_libs"
2900 # Basic thread creation functions
2901 SOURCES="$SOURCES $srcdir/src/thread/pthread/SDL_systhread.c"
2904 # We can fake these with mutexes and condition variables if necessary
2905 if test x$have_pthread_sem = xyes; then
2906 SOURCES="$SOURCES $srcdir/src/thread/pthread/SDL_syssem.c"
2908 SOURCES="$SOURCES $srcdir/src/thread/generic/SDL_syssem.c"
2912 # We can fake these with semaphores if necessary
2913 SOURCES="$SOURCES $srcdir/src/thread/pthread/SDL_sysmutex.c"
2915 # Condition variables
2916 # We can fake these with semaphores and mutexes if necessary
2917 SOURCES="$SOURCES $srcdir/src/thread/pthread/SDL_syscond.c"
2919 # Thread local storage
2920 SOURCES="$SOURCES $srcdir/src/thread/pthread/SDL_systls.c"
2927 dnl Determine whether the compiler can produce Windows executables
2930 AC_MSG_CHECKING(Windows compiler)
2933 #include <windows.h>
2938 AC_MSG_RESULT($have_win32_gcc)
2939 if test x$have_win32_gcc != xyes; then
2941 *** Your compiler ($CC) does not produce Windows executables!
2945 AC_MSG_CHECKING(Windows CE)
2948 #if !defined(_WIN32_WCE) && !defined(__MINGW32CE__)
2949 #error This is not Windows CE
2955 *** Sorry, Windows CE is no longer supported.
2958 AC_MSG_RESULT($have_wince)
2960 # This fixes Windows stack alignment with newer GCC
2964 dnl Find the DirectX includes and libraries
2967 AC_ARG_ENABLE(directx,
2968 AC_HELP_STRING([--enable-directx], [use DirectX for Windows audio/video [[default=yes]]]),
2969 , enable_directx=yes)
2970 if test x$enable_directx = xyes; then
2971 AC_CHECK_HEADER(d3d9.h, have_d3d=yes)
2972 AC_CHECK_HEADER(d3d11_1.h, have_d3d11=yes)
2973 AC_CHECK_HEADER(ddraw.h, have_ddraw=yes)
2974 AC_CHECK_HEADER(dsound.h, have_dsound=yes)
2975 AC_CHECK_HEADER(dinput.h, have_dinput=yes)
2976 AC_CHECK_HEADER(dxgi.h, have_dxgi=yes)
2977 AC_CHECK_HEADER(xaudio2.h, have_xaudio2=yes)
2978 AC_CHECK_HEADER(xinput.h, have_xinput=yes)
2979 AC_CHECK_HEADER(mmdeviceapi.h, have_wasapi=yes)
2980 AC_CHECK_HEADER(audioclient.h,,have_wasapi=no)
2982 #include <windows.h>
2984 XINPUT_GAMEPAD_EX x1;
2985 ],[],[have_xinput_gamepadex=yes])
2987 #include <windows.h>
2990 ],[],[have_xinput_stateex=yes])
2992 if test x$have_ddraw = xyes; then
2993 AC_DEFINE(HAVE_DDRAW_H, 1, [ ])
2995 if test x$have_dinput = xyes; then
2996 AC_DEFINE(HAVE_DINPUT_H, 1, [ ])
2998 if test x$have_dsound = xyes; then
2999 AC_DEFINE(HAVE_DSOUND_H, 1, [ ])
3001 if test x$have_dxgi = xyes; then
3002 AC_DEFINE(HAVE_DXGI_H, 1, [ ])
3004 if test x$have_xinput = xyes; then
3005 AC_DEFINE(HAVE_XINPUT_H, 1, [ ])
3007 if test x$have_xinput_gamepadex = xyes; then
3008 AC_DEFINE(HAVE_XINPUT_GAMEPAD_EX, 1, [ ])
3010 if test x$have_xinput_stateex = xyes; then
3011 AC_DEFINE(HAVE_XINPUT_STATE_EX, 1, [ ])
3014 SUMMARY_video="${SUMMARY_video} directx"
3015 SUMMARY_audio="${SUMMARY_audio} directx"
3017 # FIXME: latest Cygwin finds dinput headers, but we die on other win32 headers.
3018 # FIXME: ...so force it off for now.
3027 dnl Check for the dlfcn.h interface for dynamically loading objects
3030 AC_ARG_ENABLE(sdl-dlopen,
3031 AC_HELP_STRING([--enable-sdl-dlopen], [use dlopen for shared object loading [[default=yes]]]),
3032 , enable_sdl_dlopen=yes)
3033 if test x$enable_sdl_dlopen = xyes; then
3034 AC_MSG_CHECKING(for dlopen)
3039 void *handle = dlopen("", RTLD_NOW);
3040 const char *loaderror = (char *) dlerror();
3044 AC_MSG_RESULT($have_dlopen)
3046 if test x$have_dlopen = xyes; then
3047 AC_CHECK_LIB(c, dlopen, EXTRA_LDFLAGS="$EXTRA_LDFLAGS",
3048 AC_CHECK_LIB(dl, dlopen, EXTRA_LDFLAGS="$EXTRA_LDFLAGS -ldl",
3049 AC_CHECK_LIB(ltdl, dlopen, EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lltdl")))
3050 AC_DEFINE(SDL_LOADSO_DLOPEN, 1, [ ])
3051 SOURCES="$SOURCES $srcdir/src/loadso/dlopen/*.c"
3057 dnl Check for the usbhid(3) library on *BSD
3062 if test x$enable_joystick = xyes; then
3063 AC_CHECK_LIB(usbhid, hid_init, have_libusbhid=yes)
3064 if test x$have_libusbhid = xyes; then
3065 AC_CHECK_HEADER(usbhid.h, [USB_CFLAGS="-DHAVE_USBHID_H"])
3066 AC_CHECK_HEADER(libusbhid.h, [USB_CFLAGS="-DHAVE_LIBUSBHID_H"])
3067 USB_LIBS="$USB_LIBS -lusbhid"
3069 AC_CHECK_HEADER(usb.h, [USB_CFLAGS="-DHAVE_USB_H"])
3070 AC_CHECK_HEADER(libusb.h, [USB_CFLAGS="-DHAVE_LIBUSB_H"])
3071 AC_CHECK_LIB(usb, hid_init, [USB_LIBS="$USB_LIBS -lusb"])
3074 save_CFLAGS="$CFLAGS"
3075 CFLAGS="$CFLAGS $USB_CFLAGS"
3077 AC_MSG_CHECKING(for usbhid)
3080 #include <sys/types.h>
3081 #if defined(HAVE_USB_H)
3084 #ifdef __DragonFly__
3085 # include <bus/usb/usb.h>
3086 # include <bus/usb/usbhid.h>
3088 # include <dev/usb/usb.h>
3089 # include <dev/usb/usbhid.h>
3091 #if defined(HAVE_USBHID_H)
3093 #elif defined(HAVE_LIBUSB_H)
3095 #elif defined(HAVE_LIBUSBHID_H)
3096 #include <libusbhid.h>
3099 struct report_desc *repdesc;
3100 struct usb_ctl_report *repbuf;
3105 AC_MSG_RESULT($have_usbhid)
3107 if test x$have_usbhid = xyes; then
3108 AC_MSG_CHECKING(for ucr_data member of usb_ctl_report)
3109 have_usbhid_ucr_data=no
3111 #include <sys/types.h>
3112 #if defined(HAVE_USB_H)
3115 #ifdef __DragonFly__
3116 # include <bus/usb/usb.h>
3117 # include <bus/usb/usbhid.h>
3119 # include <dev/usb/usb.h>
3120 # include <dev/usb/usbhid.h>
3122 #if defined(HAVE_USBHID_H)
3124 #elif defined(HAVE_LIBUSB_H)
3126 #elif defined(HAVE_LIBUSBHID_H)
3127 #include <libusbhid.h>
3130 struct usb_ctl_report buf;
3131 if (buf.ucr_data) { }
3133 have_usbhid_ucr_data=yes
3135 if test x$have_usbhid_ucr_data = xyes; then
3136 USB_CFLAGS="$USB_CFLAGS -DUSBHID_UCR_DATA"
3138 AC_MSG_RESULT($have_usbhid_ucr_data)
3140 AC_MSG_CHECKING(for new usbhid API)
3143 #include <sys/types.h>
3144 #if defined(HAVE_USB_H)
3147 #ifdef __DragonFly__
3148 #include <bus/usb/usb.h>
3149 #include <bus/usb/usbhid.h>
3151 #include <dev/usb/usb.h>
3152 #include <dev/usb/usbhid.h>
3154 #if defined(HAVE_USBHID_H)
3156 #elif defined(HAVE_LIBUSB_H)
3158 #elif defined(HAVE_LIBUSBHID_H)
3159 #include <libusbhid.h>
3163 hid_start_parse(d, 1, 1);
3167 if test x$have_usbhid_new = xyes; then
3168 USB_CFLAGS="$USB_CFLAGS -DUSBHID_NEW"
3170 AC_MSG_RESULT($have_usbhid_new)
3172 AC_MSG_CHECKING(for struct joystick in machine/joystick.h)
3173 have_machine_joystick=no
3175 #include <machine/joystick.h>
3179 have_machine_joystick=yes
3181 if test x$have_machine_joystick = xyes; then
3182 AC_DEFINE(SDL_JOYSTICK_USBHID_MACHINE_JOYSTICK_H, 1, [ ])
3184 AC_MSG_RESULT($have_machine_joystick)
3186 AC_DEFINE(SDL_JOYSTICK_USBHID, 1, [ ])
3187 SOURCES="$SOURCES $srcdir/src/joystick/bsd/*.c"
3188 EXTRA_CFLAGS="$EXTRA_CFLAGS $USB_CFLAGS"
3189 EXTRA_LDFLAGS="$EXTRA_LDFLAGS $USB_LIBS"
3192 CFLAGS="$save_CFLAGS"
3198 dnl Check for clock_gettime()
3201 AC_ARG_ENABLE(clock_gettime,
3202 AC_HELP_STRING([--enable-clock_gettime], [use clock_gettime() instead of gettimeofday() on UNIX [[default=yes]]]),
3203 , enable_clock_gettime=yes)
3204 if test x$enable_clock_gettime = xyes; then
3205 AC_CHECK_LIB(rt, clock_gettime, have_clock_gettime=yes)
3206 if test x$have_clock_gettime = xyes; then
3207 AC_DEFINE(HAVE_CLOCK_GETTIME, 1, [ ])
3208 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lrt"
3210 AC_CHECK_LIB(c, clock_gettime, have_clock_gettime=yes)
3211 if test x$have_clock_gettime = xyes; then
3212 AC_DEFINE(HAVE_CLOCK_GETTIME, 1, [ ])
3213 EXTRA_LDFLAGS="$EXTRA_LDFLAGS"
3219 dnl Check for a valid linux/version.h
3222 AC_CHECK_HEADER(linux/version.h, have_linux_version_h=yes)
3223 if test x$have_linux_version_h = xyes; then
3224 EXTRA_CFLAGS="$EXTRA_CFLAGS -DHAVE_LINUX_VERSION_H"
3228 dnl Check if we want to use RPATH
3231 AC_ARG_ENABLE(rpath,
3232 AC_HELP_STRING([--enable-rpath], [use an rpath when linking SDL [[default=yes]]]),
3236 dnl Do this on all platforms, before everything else (other things might want to override it).
3239 dnl Set up the configuration based on the host platform!
3241 *-*-linux*|*-*-uclinux*|*-*-gnu*|*-*-k*bsd*-gnu|*-*-bsdi*|*-*-freebsd*|*-*-dragonfly*|*-*-netbsd*|*-*-openbsd*|*-*-sysv5*|*-*-solaris*|*-*-hpux*|*-*-aix*|*-*-minix*|*-*-nto*)
3246 ANDROID_CFLAGS="-DGL_GLEXT_PROTOTYPES"
3247 CFLAGS="$CFLAGS $ANDROID_CFLAGS"
3248 SDL_CFLAGS="$SDL_CFLAGS $ANDROID_CFLAGS"
3249 EXTRA_CFLAGS="$EXTRA_CFLAGS $ANDROID_CFLAGS"
3250 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -ldl -lGLESv1_CM -lGLESv2 -llog -landroid"
3251 SDLMAIN_SOURCES="$srcdir/src/main/android/*.c"
3253 if test x$enable_video = xyes; then
3254 SOURCES="$SOURCES $srcdir/src/core/android/*.c $srcdir/src/video/android/*.c"
3255 # FIXME: confdefs? Not AC_DEFINE?
3256 $as_echo "#define SDL_VIDEO_DRIVER_ANDROID 1" >>confdefs.h
3257 SUMMARY_video="${SUMMARY_video} android"
3260 *-*-linux*) ARCH=linux ;;
3261 *-*-uclinux*) ARCH=linux ;;
3262 *-*-kfreebsd*-gnu) ARCH=kfreebsd-gnu ;;
3263 *-*-knetbsd*-gnu) ARCH=knetbsd-gnu ;;
3264 *-*-kopenbsd*-gnu) ARCH=kopenbsd-gnu ;;
3265 *-*-gnu*) ARCH=gnu ;; # must be last of the gnu variants
3266 *-*-bsdi*) ARCH=bsdi ;;
3267 *-*-freebsd*) ARCH=freebsd ;;
3268 *-*-dragonfly*) ARCH=freebsd ;;
3269 *-*-netbsd*) ARCH=netbsd ;;
3270 *-*-openbsd*) ARCH=openbsd ;;
3271 *-*-sysv5*) ARCH=sysv5 ;;
3272 *-*-solaris*) ARCH=solaris ;;
3273 *-*-hpux*) ARCH=hpux ;;
3274 *-*-aix*) ARCH=aix ;;
3275 *-*-minix*) ARCH=minix ;;
3280 CheckVisibilityHidden
3281 CheckDeclarationAfterStatement
3296 # Need to check for Raspberry PI first and add platform specific compiler flags, otherwise the test for GLES fails!
3325 # Set up files for the audio library
3326 if test x$enable_audio = xyes; then
3329 AC_DEFINE(SDL_AUDIO_DRIVER_SUNAUDIO, 1, [ ])
3330 SOURCES="$SOURCES $srcdir/src/audio/sun/*.c"
3331 SUMMARY_audio="${SUMMARY_audio} sun"
3334 netbsd) # Don't use this on OpenBSD, it's busted.
3335 AC_DEFINE(SDL_AUDIO_DRIVER_NETBSD, 1, [ ])
3336 SOURCES="$SOURCES $srcdir/src/audio/netbsd/*.c"
3337 SUMMARY_audio="${SUMMARY_audio} netbsd"
3341 AC_DEFINE(SDL_AUDIO_DRIVER_PAUDIO, 1, [ ])
3342 SOURCES="$SOURCES $srcdir/src/audio/paudio/*.c"
3343 SUMMARY_audio="${SUMMARY_audio} paudio"
3347 AC_DEFINE(SDL_AUDIO_DRIVER_ANDROID, 1, [ ])
3348 SOURCES="$SOURCES $srcdir/src/audio/android/*.c"
3349 SUMMARY_audio="${SUMMARY_audio} android"
3357 # Set up files for the joystick library
3358 if test x$enable_joystick = xyes; then
3361 AC_DEFINE(SDL_JOYSTICK_LINUX, 1, [ ])
3362 SOURCES="$SOURCES $srcdir/src/joystick/linux/*.c"
3366 AC_DEFINE(SDL_JOYSTICK_ANDROID, 1, [ ])
3367 SOURCES="$SOURCES $srcdir/src/joystick/android/*.c"
3372 # Set up files for the haptic library
3373 if test x$enable_haptic = xyes; then
3374 if test x$use_input_events = xyes; then
3377 AC_DEFINE(SDL_HAPTIC_LINUX, 1, [ ])
3378 SOURCES="$SOURCES $srcdir/src/haptic/linux/*.c"
3384 # Set up files for the power library
3385 if test x$enable_power = xyes; then
3388 AC_DEFINE(SDL_POWER_LINUX, 1, [ ])
3389 SOURCES="$SOURCES $srcdir/src/power/linux/*.c"
3393 AC_DEFINE(SDL_POWER_ANDROID, 1, [ ])
3394 SOURCES="$SOURCES $srcdir/src/power/android/*.c"
3399 # Set up files for the filesystem library
3400 if test x$enable_filesystem = xyes; then
3403 AC_DEFINE(SDL_FILESYSTEM_ANDROID, 1, [ ])
3404 SOURCES="$SOURCES $srcdir/src/filesystem/android/*.c"
3408 AC_DEFINE(SDL_FILESYSTEM_UNIX, 1, [ ])
3409 SOURCES="$SOURCES $srcdir/src/filesystem/unix/*.c"
3414 # Set up files for the timer library
3415 if test x$enable_timers = xyes; then
3416 AC_DEFINE(SDL_TIMER_UNIX, 1, [ ])
3417 SOURCES="$SOURCES $srcdir/src/timer/unix/*.c"
3420 # Set up files for udev hotplugging support
3421 if test x$enable_libudev = xyes && test x$have_libudev_h_hdr = xyes; then
3422 SOURCES="$SOURCES $srcdir/src/core/linux/SDL_udev.c"
3424 # Set up files for evdev input
3425 if test x$use_input_events = xyes; then
3426 SOURCES="$SOURCES $srcdir/src/core/linux/SDL_evdev*.c"
3428 # Set up other core UNIX files
3429 SOURCES="$SOURCES $srcdir/src/core/unix/*.c"
3431 *-*-cygwin* | *-*-mingw32*)
3433 if test "$build" != "$host"; then # cross-compiling
3434 # Default cross-compile location
3435 ac_default_prefix=/usr/local/cross-tools/$host
3437 # Look for the location of the tools and install there
3438 if test "$BUILD_PREFIX" != ""; then
3439 ac_default_prefix=$BUILD_PREFIX
3442 CheckDeclarationAfterStatement
3452 # Set up the core platform files
3453 SOURCES="$SOURCES $srcdir/src/core/windows/*.c"
3455 # Set up files for the video library
3456 if test x$enable_video = xyes; then
3457 AC_DEFINE(SDL_VIDEO_DRIVER_WINDOWS, 1, [ ])
3458 SOURCES="$SOURCES $srcdir/src/video/windows/*.c"
3460 AC_ARG_ENABLE(render-d3d,
3461 AC_HELP_STRING([--enable-render-d3d], [enable the Direct3D render driver [[default=yes]]]),
3462 , enable_render_d3d=yes)
3463 if test x$enable_render_d3d = xyes -a x$have_d3d = xyes; then
3464 AC_DEFINE(SDL_VIDEO_RENDER_D3D, 1, [ ])
3466 if test x$enable_render_d3d = xyes -a x$have_d3d11 = xyes; then
3467 AC_DEFINE(SDL_VIDEO_RENDER_D3D11, 1, [ ])
3470 # Set up files for the audio library
3471 if test x$enable_audio = xyes; then
3472 AC_DEFINE(SDL_AUDIO_DRIVER_WINMM, 1, [ ])
3473 SOURCES="$SOURCES $srcdir/src/audio/winmm/*.c"
3474 if test x$have_dsound = xyes; then
3475 AC_DEFINE(SDL_AUDIO_DRIVER_DSOUND, 1, [ ])
3476 SOURCES="$SOURCES $srcdir/src/audio/directsound/*.c"
3478 if test x$have_xaudio2 = xyes; then
3479 AC_DEFINE(SDL_AUDIO_DRIVER_XAUDIO2, 1, [ ])
3480 SOURCES="$SOURCES $srcdir/src/audio/xaudio2/*.c"
3482 if test x$have_wasapi = xyes; then
3483 AC_DEFINE(SDL_AUDIO_DRIVER_WASAPI, 1, [ ])
3484 SOURCES="$SOURCES $srcdir/src/audio/wasapi/*.c"
3488 # Set up files for the joystick library
3489 if test x$enable_joystick = xyes; then
3490 if test x$have_dinput = xyes -o x$have_xinput = xyes; then
3491 if test x$have_xinput = xyes; then
3492 AC_DEFINE(SDL_JOYSTICK_XINPUT, 1, [ ])
3494 if test x$have_dinput = xyes; then
3495 AC_DEFINE(SDL_JOYSTICK_DINPUT, 1, [ ])
3496 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -ldinput8 -ldxguid -ldxerr8"
3499 AC_DEFINE(SDL_JOYSTICK_WINMM, 1, [ ])
3501 SOURCES="$SOURCES $srcdir/src/joystick/windows/*.c"
3504 if test x$enable_haptic = xyes; then
3505 if test x$have_dinput = xyes -o x$have_xinput = xyes; then
3506 if test x$have_xinput = xyes; then
3507 AC_DEFINE(SDL_HAPTIC_XINPUT, 1, [ ])
3509 if test x$have_dinput = xyes; then
3510 AC_DEFINE(SDL_HAPTIC_DINPUT, 1, [ ])
3512 SOURCES="$SOURCES $srcdir/src/haptic/windows/*.c"
3516 if test x$enable_power = xyes; then
3517 AC_DEFINE(SDL_POWER_WINDOWS, 1, [ ])
3518 SOURCES="$SOURCES $srcdir/src/power/windows/SDL_syspower.c"
3521 if test x$enable_filesystem = xyes; then
3522 AC_DEFINE(SDL_FILESYSTEM_WINDOWS, 1, [ ])
3523 SOURCES="$SOURCES $srcdir/src/filesystem/windows/SDL_sysfilesystem.c"
3526 # Set up files for the thread library
3527 if test x$enable_threads = xyes; then
3528 AC_DEFINE(SDL_THREAD_WINDOWS, 1, [ ])
3529 SOURCES="$SOURCES $srcdir/src/thread/windows/*.c"
3530 SOURCES="$SOURCES $srcdir/src/thread/generic/SDL_syscond.c"
3533 # Set up files for the timer library
3534 if test x$enable_timers = xyes; then
3535 AC_DEFINE(SDL_TIMER_WINDOWS, 1, [ ])
3536 SOURCES="$SOURCES $srcdir/src/timer/windows/*.c"
3539 # Set up files for the shared object loading library
3540 if test x$enable_loadso = xyes; then
3541 AC_DEFINE(SDL_LOADSO_WINDOWS, 1, [ ])
3542 SOURCES="$SOURCES $srcdir/src/loadso/windows/*.c"
3545 # Set up the system libraries we need
3546 if test -f /lib/w32api/libuuid.a; then
3547 LIBUUID=/lib/w32api/libuuid.a
3551 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -luser32 -lgdi32 -lwinmm -limm32 -lole32 -loleaut32 -lshell32 -lversion $LIBUUID -static-libgcc"
3552 # The Windows platform requires special setup
3553 VERSION_SOURCES="$srcdir/src/main/windows/*.rc"
3554 SDLMAIN_SOURCES="$srcdir/src/main/windows/*.c"
3555 SDL_CFLAGS="$SDL_CFLAGS -Dmain=SDL_main"
3556 SDL_LIBS="-lSDL2main $SDL_LIBS -mwindows"
3558 # Check to see if this is a mingw or cygwin build
3560 AC_CHECK_LIB(mingw32, main, [have_mingw32=yes])
3561 if test x$have_mingw32 = xyes; then
3562 SDL_LIBS="-lmingw32 $SDL_LIBS"
3564 SDL_LIBS="-lcygwin $SDL_LIBS"
3568 dnl BeOS support removed after SDL 2.0.1. Haiku still works. --ryan.
3571 *** BeOS support has been removed as of SDL 2.0.2.
3577 ac_default_prefix=/boot/system
3586 # Set up files for the audio library
3587 if test x$enable_audio = xyes; then
3588 AC_DEFINE(SDL_AUDIO_DRIVER_HAIKU, 1, [ ])
3589 SOURCES="$SOURCES $srcdir/src/audio/haiku/*.cc"
3590 SUMMARY_audio="${SUMMARY_audio} haiku"
3593 # Set up files for the joystick library
3594 if test x$enable_joystick = xyes; then
3595 AC_DEFINE(SDL_JOYSTICK_HAIKU, 1, [ ])
3596 SOURCES="$SOURCES $srcdir/src/joystick/haiku/*.cc"
3599 # Set up files for the timer library
3600 if test x$enable_timers = xyes; then
3601 AC_DEFINE(SDL_TIMER_HAIKU, 1, [ ])
3602 SOURCES="$SOURCES $srcdir/src/timer/haiku/*.c"
3605 # Set up files for the system power library
3606 if test x$enable_power = xyes; then
3607 AC_DEFINE(SDL_POWER_HAIKU, 1, [ ])
3608 SOURCES="$SOURCES $srcdir/src/power/haiku/*.c"
3611 # Set up files for the system filesystem library
3612 if test x$enable_filesystem = xyes; then
3613 AC_DEFINE(SDL_FILESYSTEM_HAIKU, 1, [ ])
3614 SOURCES="$SOURCES $srcdir/src/filesystem/haiku/*.cc"
3617 # The Haiku platform requires special setup.
3618 SOURCES="$srcdir/src/main/haiku/*.cc $SOURCES"
3619 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lroot -lbe -lmedia -lgame -ldevice -ltextencoding"
3620 # Haiku's x86 spins use libstdc++.r4.so (for binary compat?), but
3621 # other spins, like x86-64, use a more standard "libstdc++.so.*"
3622 AC_CHECK_FILE("/boot/system/lib/libstdc++.r4.so", EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lstdc++.r4", EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lstdc++")
3624 arm*-apple-darwin*|*-ios-*)
3627 CheckVisibilityHidden
3628 CheckDeclarationAfterStatement
3636 # Set up files for the audio library
3637 if test x$enable_audio = xyes; then
3638 AC_DEFINE(SDL_AUDIO_DRIVER_COREAUDIO, 1, [ ])
3639 SOURCES="$SOURCES $srcdir/src/audio/coreaudio/*.m"
3640 SUMMARY_audio="${SUMMARY_audio} coreaudio"
3643 # Set up files for the joystick library
3644 if test x$enable_joystick = xyes; then
3645 AC_DEFINE(SDL_JOYSTICK_MFI, 1, [ ])
3646 SOURCES="$SOURCES $srcdir/src/joystick/iphoneos/*.m"
3649 # Set up files for the haptic library
3650 #if test x$enable_haptic = xyes; then
3651 # SOURCES="$SOURCES $srcdir/src/haptic/darwin/*.c"
3653 # EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,ForceFeedback"
3655 # Set up files for the power library
3656 if test x$enable_power = xyes; then
3657 AC_DEFINE(SDL_POWER_UIKIT, 1, [ ])
3658 SOURCES="$SOURCES $srcdir/src/power/uikit/*.m"
3661 # Set up files for the filesystem library
3662 if test x$enable_filesystem = xyes; then
3663 SOURCES="$SOURCES $srcdir/src/filesystem/cocoa/*.m"
3666 # Set up additional files for the file library
3667 if test x$enable_file = xyes; then
3668 AC_DEFINE(SDL_FILESYSTEM_COCOA, 1, [ ])
3669 SOURCES="$SOURCES $srcdir/src/file/cocoa/*.m"
3671 # Set up files for the timer library
3672 if test x$enable_timers = xyes; then
3673 AC_DEFINE(SDL_TIMER_UNIX, 1, [ ])
3674 SOURCES="$SOURCES $srcdir/src/timer/unix/*.c"
3677 # Set up other core UNIX files
3678 SOURCES="$SOURCES $srcdir/src/core/unix/*.c"
3679 # The iOS platform requires special setup.
3680 AC_DEFINE(SDL_VIDEO_DRIVER_UIKIT, 1, [ ])
3681 AC_DEFINE(SDL_VIDEO_OPENGL_ES2, 1, [ ])
3682 AC_DEFINE(SDL_VIDEO_OPENGL_ES, 1, [ ])
3683 AC_DEFINE(SDL_VIDEO_RENDER_OGL_ES, 1, [ ])
3684 AC_DEFINE(SDL_VIDEO_RENDER_OGL_ES2, 1, [ ])
3685 SOURCES="$SOURCES $srcdir/src/video/uikit/*.m"
3686 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lm -liconv -lobjc"
3687 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,AVFoundation"
3688 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,AudioToolbox"
3689 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,CoreAudio"
3690 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,CoreGraphics"
3691 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,CoreMotion"
3692 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,Foundation"
3693 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,GameController"
3694 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,OpenGLES"
3695 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,QuartzCore"
3696 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,UIKit"
3699 # This could be either full "Mac OS X", or plain "Darwin" which is
3700 # just the OS X kernel sans upper layers like Carbon and Cocoa.
3701 # Next line is broken, and a few files below require Mac OS X (full)
3704 # Mac OS X builds with both the Carbon and OSX APIs at the moment
3705 EXTRA_CFLAGS="$EXTRA_CFLAGS -DTARGET_API_MAC_CARBON"
3706 EXTRA_CFLAGS="$EXTRA_CFLAGS -DTARGET_API_MAC_OSX"
3708 CheckVisibilityHidden
3709 CheckDeclarationAfterStatement
3721 # Set up files for the audio library
3722 if test x$enable_audio = xyes; then
3723 AC_DEFINE(SDL_AUDIO_DRIVER_COREAUDIO, 1, [ ])
3724 SOURCES="$SOURCES $srcdir/src/audio/coreaudio/*.m"
3725 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,CoreAudio -Wl,-framework,AudioToolbox"
3726 SUMMARY_audio="${SUMMARY_audio} coreaudio"
3729 # Set up files for the joystick library
3730 if test x$enable_joystick = xyes; then
3731 AC_DEFINE(SDL_JOYSTICK_IOKIT, 1, [ ])
3732 SOURCES="$SOURCES $srcdir/src/joystick/darwin/*.c"
3735 # Set up files for the haptic library
3736 if test x$enable_haptic = xyes; then
3737 AC_DEFINE(SDL_HAPTIC_IOKIT, 1, [ ])
3738 SOURCES="$SOURCES $srcdir/src/haptic/darwin/*.c"
3739 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,ForceFeedback"
3742 # Set up files for the power library
3743 if test x$enable_power = xyes; then
3744 AC_DEFINE(SDL_POWER_MACOSX, 1, [ ])
3745 SOURCES="$SOURCES $srcdir/src/power/macosx/*.c"
3748 # Set up files for the filesystem library
3749 if test x$enable_filesystem = xyes; then
3750 AC_DEFINE(SDL_FILESYSTEM_COCOA, 1, [ ])
3751 SOURCES="$SOURCES $srcdir/src/filesystem/cocoa/*.m"
3754 # Set up files for the timer library
3755 if test x$enable_timers = xyes; then
3756 AC_DEFINE(SDL_TIMER_UNIX, 1, [ ])
3757 SOURCES="$SOURCES $srcdir/src/timer/unix/*.c"
3760 # Set up additional files for the file library
3761 if test x$enable_file = xyes; then
3762 SOURCES="$SOURCES $srcdir/src/file/cocoa/*.m"
3764 # Set up other core UNIX files
3765 SOURCES="$SOURCES $srcdir/src/core/unix/*.c"
3766 # The Mac OS X platform requires special setup.
3767 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lobjc"
3768 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,CoreVideo"
3769 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,Cocoa"
3770 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,Carbon"
3771 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,IOKit"
3781 # Set up files for the timer library
3782 if test x$enable_timers = xyes; then
3783 AC_DEFINE(SDL_TIMER_UNIX, 1, [ ])
3784 SOURCES="$SOURCES $srcdir/src/timer/unix/*.c"
3788 if test x$enable_filesystem = xyes; then
3789 AC_DEFINE(SDL_FILESYSTEM_NACL, 1, [ ])
3790 SOURCES="$SOURCES $srcdir/src/filesystem/nacl/*.c"
3795 if test x$enable_video = xyes; then
3796 AC_DEFINE(SDL_VIDEO_DRIVER_EMSCRIPTEN, 1, [ ])
3797 SOURCES="$SOURCES $srcdir/src/video/emscripten/*.c"
3799 SUMMARY_video="${SUMMARY_video} emscripten"
3802 if test x$enable_audio = xyes; then
3803 AC_DEFINE(SDL_AUDIO_DRIVER_EMSCRIPTEN, 1, [ ])
3804 SOURCES="$SOURCES $srcdir/src/audio/emscripten/*.c"
3806 SUMMARY_audio="${SUMMARY_audio} emscripten"
3809 CheckVisibilityHidden
3810 CheckDeclarationAfterStatement
3818 # Set up files for the power library
3819 if test x$enable_power = xyes; then
3820 AC_DEFINE(SDL_POWER_EMSCRIPTEN, 1, [ ])
3821 SOURCES="$SOURCES $srcdir/src/power/emscripten/*.c"
3825 # Set up files for the power library
3826 if test x$enable_joystick = xyes; then
3827 AC_DEFINE(SDL_JOYSTICK_EMSCRIPTEN, 1, [ ])
3828 SOURCES="$SOURCES $srcdir/src/joystick/emscripten/*.c"
3832 # Set up files for the filesystem library
3833 if test x$enable_filesystem = xyes; then
3834 AC_DEFINE(SDL_FILESYSTEM_EMSCRIPTEN, 1, [ ])
3835 SOURCES="$SOURCES $srcdir/src/filesystem/emscripten/*.c"
3838 # Set up files for the timer library
3839 if test x$enable_timers = xyes; then
3840 AC_DEFINE(SDL_TIMER_UNIX, 1, [ ])
3841 SOURCES="$SOURCES $srcdir/src/timer/unix/*.c"
3847 *** Unsupported host: Please add to configure.in
3852 # Verify that we have all the platform specific files we need
3854 if test x$have_joystick != xyes; then
3855 if test x$enable_joystick = xyes; then
3856 AC_DEFINE(SDL_JOYSTICK_DISABLED, 1, [ ])
3858 SOURCES="$SOURCES $srcdir/src/joystick/dummy/*.c"
3860 if test x$have_haptic != xyes; then
3861 if test x$enable_haptic = xyes; then
3862 AC_DEFINE(SDL_HAPTIC_DISABLED, 1, [ ])
3864 SOURCES="$SOURCES $srcdir/src/haptic/dummy/*.c"
3866 if test x$have_threads != xyes; then
3867 if test x$enable_threads = xyes; then
3868 AC_DEFINE(SDL_THREADS_DISABLED, 1, [ ])
3870 SOURCES="$SOURCES $srcdir/src/thread/generic/*.c"
3872 if test x$have_timers != xyes; then
3873 if test x$enable_timers = xyes; then
3874 AC_DEFINE(SDL_TIMERS_DISABLED, 1, [ ])
3876 SOURCES="$SOURCES $srcdir/src/timer/dummy/*.c"
3878 if test x$have_filesystem != xyes; then
3879 if test x$enable_filesystem = xyes; then
3880 AC_DEFINE(SDL_FILESYSTEM_DISABLED, 1, [ ])
3882 SOURCES="$SOURCES $srcdir/src/filesystem/dummy/*.c"
3884 if test x$have_loadso != xyes; then
3885 if test x$enable_loadso = xyes; then
3886 AC_DEFINE(SDL_LOADSO_DISABLED, 1, [ ])
3888 SOURCES="$SOURCES $srcdir/src/loadso/dummy/*.c"
3890 if test x$SDLMAIN_SOURCES = x; then
3891 SDLMAIN_SOURCES="$srcdir/src/main/dummy/*.c"
3893 SDLTEST_SOURCES="$srcdir/src/test/*.c"
3895 if test x$video_wayland = xyes; then
3896 WAYLAND_CORE_PROTOCOL_SOURCE='$(gen)/wayland-protocol.c'
3897 WAYLAND_CORE_PROTOCOL_HEADER='$(gen)/wayland-client-protocol.h'
3898 WAYLAND_PROTOCOLS_UNSTABLE_SOURCES=`echo $WAYLAND_PROTOCOLS_UNSTABLE |\
3899 sed 's,[[^ ]]\+,\\$(gen)/&-protocol.c,g'`
3900 WAYLAND_PROTOCOLS_UNSTABLE_HEADERS=`echo $WAYLAND_PROTOCOLS_UNSTABLE |\
3901 sed 's,[[^ ]]\+,\\$(gen)/&-client-protocol.h,g'`
3902 GEN_SOURCES="$GEN_SOURCES $WAYLAND_CORE_PROTOCOL_SOURCE $WAYLAND_PROTOCOLS_UNSTABLE_SOURCES"
3903 GEN_HEADERS="$GEN_HEADERS $WAYLAND_CORE_PROTOCOL_HEADER $WAYLAND_PROTOCOLS_UNSTABLE_HEADERS"
3905 WAYLAND_CORE_PROTOCOL_SOURCE_DEPENDS="
3906 $WAYLAND_CORE_PROTOCOL_SOURCE: $WAYLAND_CORE_PROTOCOL_DIR/wayland.xml
3907 \$(SHELL) \$(auxdir)/mkinstalldirs \$(gen)
3908 \$(RUN_CMD_GEN)\$(WAYLAND_SCANNER) code \$< \$@"
3910 WAYLAND_CORE_PROTOCOL_HEADER_DEPENDS="
3911 $WAYLAND_CORE_PROTOCOL_HEADER: $WAYLAND_CORE_PROTOCOL_DIR/wayland.xml
3912 \$(SHELL) \$(auxdir)/mkinstalldirs \$(gen)
3913 \$(RUN_CMD_GEN)\$(WAYLAND_SCANNER) client-header \$< \$@"
3915 WAYLAND_CORE_PROTOCOL_OBJECT="
3916 \$(objects)/`echo $WAYLAND_CORE_PROTOCOL_SOURCE | sed 's/\$(gen)\/\(.*\).c$/\1.lo/'`: $WAYLAND_CORE_PROTOCOL_SOURCE
3917 \$(RUN_CMD_CC)\$(LIBTOOL) --tag=CC --mode=compile \$(CC) \$(CFLAGS) \$(EXTRA_CFLAGS) $DEPENDENCY_TRACKING_OPTIONS -c \$< -o \$@"
3919 WAYLAND_PROTOCOLS_CLIENT_HEADER_UNSTABLE_DEPENDS=`for p in $WAYLAND_PROTOCOLS_UNSTABLE;\
3920 do echo ; echo \$p | sed\
3921 "s,^\\([[a-z\\-]]\\+\\)-unstable-\\(v[[0-9]]\+\\)\$,\\$(gen)/&-client-protocol.h: $WAYLAND_PROTOCOLS_DIR/unstable/\1/&.xml\\\\
3922 \\$(SHELL) \\$(auxdir)/mkinstalldirs \\$(gen)\\\\
3923 \\$(RUN_CMD_GEN)\\$(WAYLAND_SCANNER) client-header \\$< \\$@," ; done`
3925 WAYLAND_PROTOCOLS_CODE_UNSTABLE_DEPENDS=`for p in $WAYLAND_PROTOCOLS_UNSTABLE;\
3926 do echo ; echo \$p | sed\
3927 "s,^\\([[a-z\\-]]\\+\\)-unstable-\\(v[[0-9]]\+\\)\$,\\$(gen)/&-protocol.c: $WAYLAND_PROTOCOLS_DIR/unstable/\1/&.xml\\\\
3928 \\$(SHELL) \\$(auxdir)/mkinstalldirs \\$(gen)\\\\
3929 \\$(RUN_CMD_GEN)\\$(WAYLAND_SCANNER) code \\$< \\$@," ; done`
3931 WAYLAND_PROTOCOLS_OBJECTS_UNSTABLE=`for p in $WAYLAND_PROTOCOLS_UNSTABLE;\
3932 do echo ; echo \$p | sed\
3933 "s,^\\([[a-z\\-]]\\+\\)-unstable-\\(v[[0-9]]\+\\)\$,\\\$(objects)/&-protocol.lo: \\$(gen)/&-protocol.c \\$(gen)/&-client-protocol.h\\\\
3934 \\$(RUN_CMD_CC)\\$(LIBTOOL) --tag=CC --mode=compile \\$(CC) \\$(CFLAGS) \\$(EXTRA_CFLAGS) $DEPENDENCY_TRACKING_OPTIONS -c \\$< -o \\$@," ; done`
3936 WAYLAND_PROTOCOLS_DEPENDS="
3937 $WAYLAND_CORE_PROTOCOL_SOURCE_DEPENDS
3938 $WAYLAND_CORE_PROTOCOL_HEADER_DEPENDS
3939 $WAYLAND_CORE_PROTOCOL_OBJECT
3940 $WAYLAND_PROTOCOLS_CLIENT_HEADER_UNSTABLE_DEPENDS
3941 $WAYLAND_PROTOCOLS_CODE_UNSTABLE_DEPENDS
3942 $WAYLAND_PROTOCOLS_OBJECTS_UNSTABLE
3946 OBJECTS=`echo $SOURCES`
3947 DEPENDS=`echo $SOURCES | tr ' ' '\n'`
3948 for EXT in asm cc m c S; do
3949 OBJECTS=`echo "$OBJECTS" | sed 's,[[^ ]]*/\([[^ ]]*\)\.'$EXT',$(objects)/\1.lo,g'`
3950 DEPENDS=`echo "$DEPENDS" | sed "s,^\\([[^ ]]*\\)/\\([[^ ]]*\\)\\.$EXT\\$,\\\\
3951 \\$(objects)/\\2.lo: \\1/\\2.$EXT\\\\
3952 \\$(RUN_CMD_CC)\\$(LIBTOOL) --tag=CC --mode=compile \\$(CC) \\$(CFLAGS) \\$(EXTRA_CFLAGS) $DEPENDENCY_TRACKING_OPTIONS -c \\$< -o \\$@,g"`
3955 GEN_OBJECTS=`echo "$GEN_SOURCES" | sed 's,[[^ ]]*/\([[^ ]]*\)\.c,$(objects)/\1.lo,g'`
3957 VERSION_OBJECTS=`echo $VERSION_SOURCES`
3958 VERSION_DEPENDS=`echo $VERSION_SOURCES`
3959 VERSION_OBJECTS=`echo "$VERSION_OBJECTS" | sed 's,[[^ ]]*/\([[^ ]]*\)\.rc,$(objects)/\1.o,g'`
3960 VERSION_DEPENDS=`echo "$VERSION_DEPENDS" | sed "s,\\([[^ ]]*\\)/\\([[^ ]]*\\)\\.rc,\\\\
3961 \\$(objects)/\\2.o: \\1/\\2.rc\\\\
3962 \\$(WINDRES) \\$< \\$@,g"`
3964 SDLMAIN_OBJECTS=`echo $SDLMAIN_SOURCES`
3965 SDLMAIN_DEPENDS=`echo $SDLMAIN_SOURCES`
3966 SDLMAIN_OBJECTS=`echo "$SDLMAIN_OBJECTS" | sed 's,[[^ ]]*/\([[^ ]]*\)\.c,$(objects)/\1.lo,g'`
3967 SDLMAIN_DEPENDS=`echo "$SDLMAIN_DEPENDS" | sed "s,\\([[^ ]]*\\)/\\([[^ ]]*\\)\\.c,\\\\
3968 \\$(objects)/\\2.lo: \\1/\\2.c\\\\
3969 \\$(RUN_CMD_CC)\\$(LIBTOOL) --tag=CC --mode=compile \\$(CC) \\$(CFLAGS) \\$(EXTRA_CFLAGS) $DEPENDENCY_TRACKING_OPTIONS -c \\$< -o \\$@,g"`
3971 SDLTEST_OBJECTS=`echo $SDLTEST_SOURCES`
3972 SDLTEST_DEPENDS=`echo $SDLTEST_SOURCES`
3973 SDLTEST_OBJECTS=`echo "$SDLTEST_OBJECTS" | sed 's,[[^ ]]*/\([[^ ]]*\)\.c,$(objects)/\1.lo,g'`
3974 SDLTEST_DEPENDS=`echo "$SDLTEST_DEPENDS" | sed "s,\\([[^ ]]*\\)/\\([[^ ]]*\\)\\.c,\\\\
3975 \\$(objects)/\\2.lo: \\1/\\2.c\\\\
3976 \\$(RUN_CMD_CC)\\$(LIBTOOL) --tag=CC --mode=compile \\$(CC) \\$(CFLAGS) \\$(EXTRA_CFLAGS) $DEPENDENCY_TRACKING_OPTIONS -c \\$< -o \\$@,g"`
3978 # Set runtime shared library paths as needed
3980 if test "x$enable_rpath" = "xyes"; then
3981 if test $ARCH = bsdi -o $ARCH = freebsd -o $ARCH = linux -o $ARCH = netbsd; then
3982 SDL_RLD_FLAGS="-Wl,-rpath,\${libdir}"
3984 AC_MSG_CHECKING(for linker option --enable-new-dtags)
3985 have_enable_new_dtags=no
3986 save_LDFLAGS="$LDFLAGS"
3987 LDFLAGS="$LDFLAGS -Wl,--enable-new-dtags"
3991 have_enable_new_dtags=yes
3992 SDL_RLD_FLAGS="$SDL_RLD_FLAGS -Wl,--enable-new-dtags"
3994 LDFLAGS="$save_LDFLAGS"
3995 AC_MSG_RESULT($have_enable_new_dtags)
3997 if test $ARCH = solaris; then
3998 SDL_RLD_FLAGS="-R\${libdir}"
4004 SDL_STATIC_LIBS="$SDL_LIBS $EXTRA_LDFLAGS"
4006 dnl Expand the cflags and libraries needed by apps using SDL
4007 AC_SUBST(SDL_CFLAGS)
4009 AC_SUBST(SDL_STATIC_LIBS)
4010 AC_SUBST(SDL_RLD_FLAGS)
4011 if test x$enable_shared = xyes; then
4013 ENABLE_SHARED_FALSE="#"
4015 ENABLE_SHARED_TRUE="#"
4016 ENABLE_SHARED_FALSE=
4018 if test x$enable_static = xyes; then
4020 ENABLE_STATIC_FALSE="#"
4022 ENABLE_STATIC_TRUE="#"
4023 ENABLE_STATIC_FALSE=
4025 AC_SUBST(ENABLE_SHARED_TRUE)
4026 AC_SUBST(ENABLE_SHARED_FALSE)
4027 AC_SUBST(ENABLE_STATIC_TRUE)
4028 AC_SUBST(ENABLE_STATIC_FALSE)
4030 dnl Expand the sources and objects needed to build the library
4031 AC_SUBST(ac_aux_dir)
4034 AC_SUBST(GEN_HEADERS)
4035 AC_SUBST(GEN_OBJECTS)
4036 AC_SUBST(VERSION_OBJECTS)
4037 AC_SUBST(SDLMAIN_OBJECTS)
4038 AC_SUBST(SDLTEST_OBJECTS)
4039 AC_SUBST(BUILD_CFLAGS)
4040 AC_SUBST(EXTRA_CFLAGS)
4041 AC_SUBST(BUILD_LDFLAGS)
4042 AC_SUBST(EXTRA_LDFLAGS)
4044 AC_SUBST(WAYLAND_SCANNER)
4046 cat >Makefile.rules <<__EOF__
4048 # Build rules for objects
4049 -include \$(OBJECTS:.lo=.d)
4051 # Special dependency for SDL.c, since it depends on SDL_revision.h
4052 $srcdir/src/SDL.c: update-revision
4057 $WAYLAND_PROTOCOLS_DEPENDS
4061 Makefile:Makefile.in:Makefile.rules sdl2-config sdl2-config.cmake SDL2.spec sdl2.pc
4063 AC_CONFIG_COMMANDS([sdl2_config],[chmod a+x sdl2-config])
4065 SUMMARY="SDL2 Configure Summary:\n"
4066 if test x$enable_shared = xyes; then
4067 SUMMARY="${SUMMARY}Building Shared Libraries\n"
4069 if test x$enable_static = xyes; then
4070 SUMMARY="${SUMMARY}Building Static Libraries\n"
4072 SUMMARY="${SUMMARY}Enabled modules :${SUMMARY_modules}\n"
4073 SUMMARY="${SUMMARY}Assembly Math :${SUMMARY_math}\n"
4074 SUMMARY="${SUMMARY}Audio drivers :${SUMMARY_audio}\n"
4075 SUMMARY="${SUMMARY}Video drivers :${SUMMARY_video}\n"
4076 if test x$have_x = xyes; then
4077 SUMMARY="${SUMMARY}X11 libraries :${SUMMARY_video_x11}\n"
4079 SUMMARY="${SUMMARY}Input drivers :${SUMMARY_input}\n"
4080 if test x$have_samplerate_h_hdr = xyes; then
4081 SUMMARY="${SUMMARY}Using libsamplerate : YES\n"
4083 SUMMARY="${SUMMARY}Using libsamplerate : NO\n"
4085 if test x$have_libudev_h_hdr = xyes; then
4086 SUMMARY="${SUMMARY}Using libudev : YES\n"
4088 SUMMARY="${SUMMARY}Using libudev : NO\n"
4090 if test x$have_dbus_dbus_h_hdr = xyes; then
4091 SUMMARY="${SUMMARY}Using dbus : YES\n"
4093 SUMMARY="${SUMMARY}Using dbus : NO\n"
4095 if test x$enable_ime = xyes; then
4096 SUMMARY="${SUMMARY}Using ime : YES\n"
4098 SUMMARY="${SUMMARY}Using ime : NO\n"
4100 if test x$have_ibus_ibus_h_hdr = xyes; then
4101 SUMMARY="${SUMMARY}Using ibus : YES\n"
4103 SUMMARY="${SUMMARY}Using ibus : NO\n"
4105 if test x$have_fcitx_frontend_h_hdr = xyes; then
4106 SUMMARY="${SUMMARY}Using fcitx : YES\n"
4108 SUMMARY="${SUMMARY}Using fcitx : NO\n"
4110 AC_CONFIG_COMMANDS([summary], [echo -en "$SUMMARY"], [SUMMARY="$SUMMARY"])