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 _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(acos acosf asin asinf atan atanf atan2 atan2f ceil ceilf copysign copysignf cos cosf fabs fabsf floor floorf fmod fmodf log logf log10 log10f pow powf scalbn scalbnf 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>])
281 dnl Check for additional non-standard headers
282 AC_CHECK_HEADERS(libunwind.h)
285 dnl AC_CHECK_SIZEOF(void*)
287 dnl See whether we can use gcc atomic operations on this architecture
288 AC_ARG_ENABLE(gcc-atomics,
289 AC_HELP_STRING([--enable-gcc-atomics],
290 [Use gcc builtin atomics [[default=yes]]]),
291 , enable_gcc_atomics=yes)
292 if test x$enable_gcc_atomics = xyes; then
294 AC_MSG_CHECKING(for GCC builtin atomic operations)
299 __sync_lock_test_and_set(&a, 4);
300 __sync_lock_test_and_set(&x, y);
301 __sync_fetch_and_add(&a, 1);
302 __sync_bool_compare_and_swap(&a, 5, 10);
303 __sync_bool_compare_and_swap(&x, y, z);
307 AC_MSG_RESULT($have_gcc_atomics)
309 if test x$have_gcc_atomics = xyes; then
310 AC_DEFINE(HAVE_GCC_ATOMICS, 1, [ ])
312 # See if we have the minimum operation needed for GCC atomics
316 __sync_lock_test_and_set(&a, 1);
317 __sync_lock_release(&a);
319 have_gcc_sync_lock_test_and_set=yes
321 if test x$have_gcc_sync_lock_test_and_set = xyes; then
322 AC_DEFINE(HAVE_GCC_SYNC_LOCK_TEST_AND_SET, 1, [ ])
328 SOURCES="$SOURCES $srcdir/src/*.c"
329 SOURCES="$SOURCES $srcdir/src/atomic/*.c"
330 SOURCES="$SOURCES $srcdir/src/audio/*.c"
331 SOURCES="$SOURCES $srcdir/src/cpuinfo/*.c"
332 SOURCES="$SOURCES $srcdir/src/dynapi/*.c"
333 SOURCES="$SOURCES $srcdir/src/events/*.c"
334 SOURCES="$SOURCES $srcdir/src/file/*.c"
335 SOURCES="$SOURCES $srcdir/src/haptic/*.c"
336 SOURCES="$SOURCES $srcdir/src/joystick/*.c"
337 SOURCES="$SOURCES $srcdir/src/libm/*.c"
338 SOURCES="$SOURCES $srcdir/src/power/*.c"
339 #SOURCES="$SOURCES $srcdir/src/filesystem/*.c"
340 SOURCES="$SOURCES $srcdir/src/render/*.c"
341 SOURCES="$SOURCES $srcdir/src/render/*/*.c"
342 SOURCES="$SOURCES $srcdir/src/stdlib/*.c"
343 SOURCES="$SOURCES $srcdir/src/thread/*.c"
344 SOURCES="$SOURCES $srcdir/src/timer/*.c"
345 SOURCES="$SOURCES $srcdir/src/video/*.c"
346 SOURCES="$SOURCES $srcdir/src/video/yuv2rgb/*.c"
348 dnl Enable/disable various subsystems of the SDL library
350 AC_ARG_ENABLE(atomic,
351 AC_HELP_STRING([--enable-atomic], [Enable the atomic operations subsystem [[default=yes]]]),
353 if test x$enable_atomic != xyes; then
354 AC_DEFINE(SDL_ATOMIC_DISABLED, 1, [ ])
356 SUMMARY_modules="${SUMMARY_modules} atomic"
359 AC_HELP_STRING([--enable-audio], [Enable the audio subsystem [[default=yes]]]),
361 if test x$enable_audio != xyes; then
362 AC_DEFINE(SDL_AUDIO_DISABLED, 1, [ ])
364 SUMMARY_modules="${SUMMARY_modules} audio"
367 AC_HELP_STRING([--enable-video], [Enable the video subsystem [[default=yes]]]),
369 if test x$enable_video != xyes; then
370 AC_DEFINE(SDL_VIDEO_DISABLED, 1, [ ])
372 SUMMARY_modules="${SUMMARY_modules} video"
374 AC_ARG_ENABLE(render,
375 AC_HELP_STRING([--enable-render], [Enable the render subsystem [[default=yes]]]),
377 if test x$enable_render != xyes; then
378 AC_DEFINE(SDL_RENDER_DISABLED, 1, [ ])
380 SUMMARY_modules="${SUMMARY_modules} render"
382 AC_ARG_ENABLE(events,
383 AC_HELP_STRING([--enable-events], [Enable the events subsystem [[default=yes]]]),
385 if test x$enable_events != xyes; then
386 AC_DEFINE(SDL_EVENTS_DISABLED, 1, [ ])
388 SUMMARY_modules="${SUMMARY_modules} events"
390 AC_ARG_ENABLE(joystick,
391 AC_HELP_STRING([--enable-joystick], [Enable the joystick subsystem [[default=yes]]]),
392 , enable_joystick=yes)
393 if test x$enable_joystick != xyes; then
394 AC_DEFINE(SDL_JOYSTICK_DISABLED, 1, [ ])
396 SUMMARY_modules="${SUMMARY_modules} joystick"
398 AC_ARG_ENABLE(haptic,
399 AC_HELP_STRING([--enable-haptic], [Enable the haptic (force feedback) subsystem [[default=yes]]]),
401 if test x$enable_haptic != xyes; then
402 AC_DEFINE(SDL_HAPTIC_DISABLED, 1, [ ])
404 SUMMARY_modules="${SUMMARY_modules} haptic"
407 AC_HELP_STRING([--enable-power], [Enable the power subsystem [[default=yes]]]),
409 if test x$enable_power != xyes; then
410 AC_DEFINE(SDL_POWER_DISABLED, 1, [ ])
412 SUMMARY_modules="${SUMMARY_modules} power"
414 AC_ARG_ENABLE(filesystem,
415 AC_HELP_STRING([--enable-filesystem], [Enable the filesystem subsystem [[default=yes]]]),
416 , enable_filesystem=yes)
417 if test x$enable_filesystem != xyes; then
418 AC_DEFINE(SDL_FILESYSTEM_DISABLED, 1, [ ])
420 SUMMARY_modules="${SUMMARY_modules} filesystem"
422 AC_ARG_ENABLE(threads,
423 AC_HELP_STRING([--enable-threads], [Enable the threading subsystem [[default=yes]]]),
424 , enable_threads=yes)
425 if test x$enable_threads != xyes; then
426 AC_DEFINE(SDL_THREADS_DISABLED, 1, [ ])
428 SUMMARY_modules="${SUMMARY_modules} threads"
430 AC_ARG_ENABLE(timers,
431 AC_HELP_STRING([--enable-timers], [Enable the timer subsystem [[default=yes]]]),
433 if test x$enable_timers != xyes; then
434 AC_DEFINE(SDL_TIMERS_DISABLED, 1, [ ])
436 SUMMARY_modules="${SUMMARY_modules} timers"
439 AC_HELP_STRING([--enable-file], [Enable the file subsystem [[default=yes]]]),
441 if test x$enable_file != xyes; then
442 AC_DEFINE(SDL_FILE_DISABLED, 1, [ ])
444 SUMMARY_modules="${SUMMARY_modules} file"
446 AC_ARG_ENABLE(loadso,
447 AC_HELP_STRING([--enable-loadso], [Enable the shared object loading subsystem [[default=yes]]]),
449 if test x$enable_loadso != xyes; then
450 AC_DEFINE(SDL_LOADSO_DISABLED, 1, [ ])
452 SUMMARY_modules="${SUMMARY_modules} loadso"
454 AC_ARG_ENABLE(cpuinfo,
455 AC_HELP_STRING([--enable-cpuinfo], [Enable the cpuinfo subsystem [[default=yes]]]),
456 , enable_cpuinfo=yes)
457 if test x$enable_cpuinfo != xyes; then
458 AC_DEFINE(SDL_CPUINFO_DISABLED, 1, [ ])
460 SUMMARY_modules="${SUMMARY_modules} cpuinfo"
462 AC_ARG_ENABLE(assembly,
463 AC_HELP_STRING([--enable-assembly], [Enable assembly routines [[default=yes]]]),
464 , enable_assembly=yes)
465 if test x$enable_assembly = xyes; then
466 SUMMARY_modules="${SUMMARY_modules} assembly"
468 AC_DEFINE(SDL_ASSEMBLY_ROUTINES, 1, [ ])
470 # Make sure that we don't generate floating point code that would
471 # cause illegal instruction exceptions on older processors
474 # Don't need to worry about Apple hardware, it's all SSE capable
478 # x86 64-bit architectures all have SSE instructions
485 AC_ARG_ENABLE(ssemath,
486 AC_HELP_STRING([--enable-ssemath], [Allow GCC to use SSE floating point math [[default=maybe]]]),
487 , enable_ssemath=$default_ssemath)
488 if test x$enable_ssemath = xno; then
489 if test x$have_gcc_sse = xyes -o x$have_gcc_sse2 = xyes -o x$have_gcc_sse3 = xyes; then
490 EXTRA_CFLAGS="$EXTRA_CFLAGS -mfpmath=387"
494 dnl Check for various instruction support
496 AC_HELP_STRING([--enable-mmx], [use MMX assembly routines [[default=yes]]]),
498 if test x$enable_mmx = xyes; then
499 save_CFLAGS="$CFLAGS"
501 AC_MSG_CHECKING(for GCC -mmmx option)
503 CFLAGS="$save_CFLAGS $mmx_CFLAGS"
508 #ifdef __MINGW64_VERSION_MAJOR
511 #include <mmintrin.h>
514 #include <mmintrin.h>
517 #error Assembler CPP flag not enabled
523 AC_MSG_RESULT($have_gcc_mmx)
524 CFLAGS="$save_CFLAGS"
526 if test x$have_gcc_mmx = xyes; then
527 EXTRA_CFLAGS="$EXTRA_CFLAGS $mmx_CFLAGS"
528 SUMMARY_math="${SUMMARY_math} mmx"
533 AC_HELP_STRING([--enable-3dnow], [use 3DNow! assembly routines [[default=yes]]]),
535 if test x$enable_3dnow = xyes; then
536 save_CFLAGS="$CFLAGS"
538 AC_MSG_CHECKING(for GCC -m3dnow option)
539 amd3dnow_CFLAGS="-m3dnow"
540 CFLAGS="$save_CFLAGS $amd3dnow_CFLAGS"
545 #error Assembler CPP flag not enabled
553 AC_MSG_RESULT($have_gcc_3dnow)
554 CFLAGS="$save_CFLAGS"
556 if test x$have_gcc_3dnow = xyes; then
557 EXTRA_CFLAGS="$EXTRA_CFLAGS $amd3dnow_CFLAGS"
558 SUMMARY_math="${SUMMARY_math} 3dnow"
563 AC_HELP_STRING([--enable-sse], [use SSE assembly routines [[default=yes]]]),
565 if test x$enable_sse = xyes; then
566 save_CFLAGS="$CFLAGS"
568 AC_MSG_CHECKING(for GCC -msse option)
570 CFLAGS="$save_CFLAGS $sse_CFLAGS"
575 #ifdef __MINGW64_VERSION_MAJOR
578 #include <xmmintrin.h>
581 #include <xmmintrin.h>
584 #error Assembler CPP flag not enabled
590 AC_MSG_RESULT($have_gcc_sse)
591 CFLAGS="$save_CFLAGS"
593 if test x$have_gcc_sse = xyes; then
594 EXTRA_CFLAGS="$EXTRA_CFLAGS $sse_CFLAGS"
595 SUMMARY_math="${SUMMARY_math} sse"
600 AC_HELP_STRING([--enable-sse2], [use SSE2 assembly routines [[default=maybe]]]),
601 , enable_sse2=$default_ssemath)
602 if test x$enable_sse2 = xyes; then
603 save_CFLAGS="$CFLAGS"
605 AC_MSG_CHECKING(for GCC -msse2 option)
607 CFLAGS="$save_CFLAGS $sse2_CFLAGS"
612 #ifdef __MINGW64_VERSION_MAJOR
615 #include <emmintrin.h>
618 #include <emmintrin.h>
621 #error Assembler CPP flag not enabled
627 AC_MSG_RESULT($have_gcc_sse2)
628 CFLAGS="$save_CFLAGS"
630 if test x$have_gcc_sse2 = xyes; then
631 EXTRA_CFLAGS="$EXTRA_CFLAGS $sse2_CFLAGS"
632 SUMMARY_math="${SUMMARY_math} sse2"
637 AC_HELP_STRING([--enable-sse3], [use SSE3 assembly routines [[default=maybe]]]),
638 , enable_sse3=$default_ssemath)
639 if test x$enable_sse3 = xyes; then
640 save_CFLAGS="$CFLAGS"
642 AC_MSG_CHECKING(for GCC -msse3 option)
644 CFLAGS="$save_CFLAGS $sse3_CFLAGS"
649 #ifdef __MINGW64_VERSION_MAJOR
652 #include <pmmintrin.h>
655 #include <pmmintrin.h>
658 #error Assembler CPP flag not enabled
664 AC_MSG_RESULT($have_gcc_sse3)
665 CFLAGS="$save_CFLAGS"
667 if test x$have_gcc_sse3 = xyes; then
668 EXTRA_CFLAGS="$EXTRA_CFLAGS $sse3_CFLAGS"
669 SUMMARY_math="${SUMMARY_math} sse3"
673 AC_CHECK_HEADER(immintrin.h,
674 have_immintrin_h_hdr=yes,
675 have_immintrin_h_hdr=no)
676 if test x$have_immintrin_h_hdr = xyes; then
677 AC_DEFINE(HAVE_IMMINTRIN_H, 1, [ ])
680 AC_ARG_ENABLE(altivec,
681 AC_HELP_STRING([--enable-altivec], [use Altivec assembly routines [[default=yes]]]),
682 , enable_altivec=yes)
683 if test x$enable_altivec = xyes; then
684 save_CFLAGS="$CFLAGS"
686 have_altivec_h_hdr=no
687 altivec_CFLAGS="-maltivec"
688 CFLAGS="$save_CFLAGS $altivec_CFLAGS"
690 AC_MSG_CHECKING(for Altivec with GCC altivec.h and -maltivec option)
693 vector unsigned int vzero() {
694 return vec_splat_u32(0);
699 have_altivec_h_hdr=yes
701 AC_MSG_RESULT($have_gcc_altivec)
703 if test x$have_gcc_altivec = xno; then
704 AC_MSG_CHECKING(for Altivec with GCC -maltivec option)
706 vector unsigned int vzero() {
707 return vec_splat_u32(0);
713 AC_MSG_RESULT($have_gcc_altivec)
716 if test x$have_gcc_altivec = xno; then
717 AC_MSG_CHECKING(for Altivec with GCC altivec.h and -faltivec option)
718 altivec_CFLAGS="-faltivec"
719 CFLAGS="$save_CFLAGS $altivec_CFLAGS"
722 vector unsigned int vzero() {
723 return vec_splat_u32(0);
728 have_altivec_h_hdr=yes
730 AC_MSG_RESULT($have_gcc_altivec)
733 if test x$have_gcc_altivec = xno; then
734 AC_MSG_CHECKING(for Altivec with GCC -faltivec option)
736 vector unsigned int vzero() {
737 return vec_splat_u32(0);
743 AC_MSG_RESULT($have_gcc_altivec)
745 CFLAGS="$save_CFLAGS"
747 if test x$have_gcc_altivec = xyes; then
748 AC_DEFINE(SDL_ALTIVEC_BLITTERS, 1, [ ])
749 if test x$have_altivec_h_hdr = xyes; then
750 AC_DEFINE(HAVE_ALTIVEC_H, 1, [ ])
752 EXTRA_CFLAGS="$EXTRA_CFLAGS $altivec_CFLAGS"
753 SUMMARY_math="${SUMMARY_math} altivec"
758 dnl See if the OSS audio interface is supported
762 AC_HELP_STRING([--enable-oss], [support the OSS audio API [[default=maybe]]]),
765 # OpenBSD "has" OSS, but it's not really for app use. They want you to
766 # use sndio instead. So on there, we default to disabled. You can force
767 # it on if you really want, though.
768 if test x$enable_oss = xmaybe; then
776 if test x$enable_audio = xyes -a x$enable_oss = xyes; then
777 AC_MSG_CHECKING(for OSS audio support)
779 if test x$have_oss != xyes; then
781 #include <sys/soundcard.h>
783 int arg = SNDCTL_DSP_SETFRAGMENT;
788 if test x$have_oss != xyes; then
790 #include <soundcard.h>
792 int arg = SNDCTL_DSP_SETFRAGMENT;
795 AC_DEFINE(SDL_AUDIO_DRIVER_OSS_SOUNDCARD_H, 1, [ ])
798 AC_MSG_RESULT($have_oss)
799 if test x$have_oss = xyes; then
800 SUMMARY_audio="${SUMMARY_audio} oss"
801 AC_DEFINE(SDL_AUDIO_DRIVER_OSS, 1, [ ])
802 SOURCES="$SOURCES $srcdir/src/audio/dsp/*.c"
805 # We may need to link with ossaudio emulation library
807 *-*-openbsd*|*-*-netbsd*)
808 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lossaudio";;
814 dnl See if the ALSA audio interface is supported
818 AC_HELP_STRING([--enable-alsa], [support the ALSA audio API [[default=yes]]]),
820 if test x$enable_audio = xyes -a x$enable_alsa = xyes; then
821 AM_PATH_ALSA(1.0.11, have_alsa=yes, have_alsa=no)
822 # Restore all flags from before the ALSA detection runs
823 CFLAGS="$alsa_save_CFLAGS"
824 LDFLAGS="$alsa_save_LDFLAGS"
825 LIBS="$alsa_save_LIBS"
826 if test x$have_alsa = xyes; then
827 AC_ARG_ENABLE(alsa-shared,
828 AC_HELP_STRING([--enable-alsa-shared], [dynamically load ALSA audio support [[default=yes]]]),
829 , enable_alsa_shared=yes)
830 alsa_lib=[`find_lib "libasound.so.*" "$ALSA_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`]
832 AC_DEFINE(SDL_AUDIO_DRIVER_ALSA, 1, [ ])
833 SOURCES="$SOURCES $srcdir/src/audio/alsa/*.c"
834 EXTRA_CFLAGS="$EXTRA_CFLAGS $ALSA_CFLAGS"
835 if test x$have_loadso != xyes && \
836 test x$enable_alsa_shared = xyes; then
837 AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic ALSA loading])
839 if test x$have_loadso = xyes && \
840 test x$enable_alsa_shared = xyes && test x$alsa_lib != x; then
841 echo "-- dynamic libasound -> $alsa_lib"
842 AC_DEFINE_UNQUOTED(SDL_AUDIO_DRIVER_ALSA_DYNAMIC, "$alsa_lib", [ ])
843 SUMMARY_audio="${SUMMARY_audio} alsa(dynamic)"
845 EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ALSA_LIBS"
846 SUMMARY_audio="${SUMMARY_audio} alsa"
857 AC_HELP_STRING([--enable-jack], [use JACK audio [[default=yes]]]),
859 if test x$enable_audio = xyes -a x$enable_jack = xyes; then
862 JACK_REQUIRED_VERSION=0.125
864 AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
865 AC_MSG_CHECKING(for JACK $JACK_REQUIRED_VERSION support)
866 if test x$PKG_CONFIG != xno; then
867 if $PKG_CONFIG --atleast-pkgconfig-version 0.7 && $PKG_CONFIG --atleast-version $JACK_REQUIRED_VERSION jack; then
868 JACK_CFLAGS=`$PKG_CONFIG --cflags jack`
869 JACK_LIBS=`$PKG_CONFIG --libs jack`
873 AC_MSG_RESULT($audio_jack)
875 if test x$audio_jack = xyes; then
876 AC_ARG_ENABLE(jack-shared,
877 AC_HELP_STRING([--enable-jack-shared], [dynamically load JACK audio support [[default=yes]]]),
878 , enable_jack_shared=yes)
879 jack_lib=[`find_lib "libjack.so.*" "$JACK_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`]
881 AC_DEFINE(SDL_AUDIO_DRIVER_JACK, 1, [ ])
882 SOURCES="$SOURCES $srcdir/src/audio/jack/*.c"
883 EXTRA_CFLAGS="$EXTRA_CFLAGS $JACK_CFLAGS"
884 if test x$have_loadso != xyes && \
885 test x$enable_jack_shared = xyes; then
886 AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic JACK audio loading])
888 if test x$have_loadso = xyes && \
889 test x$enable_jack_shared = xyes && test x$jack_lib != x; then
890 echo "-- dynamic libjack -> $jack_lib"
891 AC_DEFINE_UNQUOTED(SDL_AUDIO_DRIVER_JACK_DYNAMIC, "$jack_lib", [ ])
892 SUMMARY_audio="${SUMMARY_audio} jack(dynamic)"
895 # On Solaris, jack must be linked deferred explicitly
896 # to prevent undefined symbol failures.
898 JACK_LIBS=`echo $JACK_LIBS | sed 's/\-l/-Wl,-l/g'`
899 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-zdeferred $JACK_LIBS -Wl,-znodeferred"
902 EXTRA_LDFLAGS="$EXTRA_LDFLAGS $JACK_LIBS"
903 SUMMARY_audio="${SUMMARY_audio} jack"
910 dnl Find the ESD includes and libraries
914 AC_HELP_STRING([--enable-esd], [support the Enlightened Sound Daemon [[default=yes]]]),
916 if test x$enable_audio = xyes -a x$enable_esd = xyes; then
917 AM_PATH_ESD(0.2.8, have_esd=yes, have_esd=no)
918 if test x$have_esd = xyes; then
919 AC_ARG_ENABLE(esd-shared,
920 AC_HELP_STRING([--enable-esd-shared], [dynamically load ESD audio support [[default=yes]]]),
921 , enable_esd_shared=yes)
922 esd_lib=[`find_lib "libesd.so.*" "$ESD_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`]
924 AC_DEFINE(SDL_AUDIO_DRIVER_ESD, 1, [ ])
925 SOURCES="$SOURCES $srcdir/src/audio/esd/*.c"
926 EXTRA_CFLAGS="$EXTRA_CFLAGS $ESD_CFLAGS"
927 if test x$have_loadso != xyes && \
928 test x$enable_esd_shared = xyes; then
929 AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic ESD loading])
931 if test x$have_loadso = xyes && \
932 test x$enable_esd_shared = xyes && test x$esd_lib != x; then
933 echo "-- dynamic libesd -> $esd_lib"
934 AC_DEFINE_UNQUOTED(SDL_AUDIO_DRIVER_ESD_DYNAMIC, "$esd_lib", [ ])
935 SUMMARY_audio="${SUMMARY_audio} esd(dynamic)"
937 EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ESD_LIBS"
938 SUMMARY_audio="${SUMMARY_audio} esd"
948 AC_ARG_ENABLE(pulseaudio,
949 AC_HELP_STRING([--enable-pulseaudio], [use PulseAudio [[default=yes]]]),
950 , enable_pulseaudio=yes)
951 if test x$enable_audio = xyes -a x$enable_pulseaudio = xyes; then
954 PULSEAUDIO_REQUIRED_VERSION=0.9
956 AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
957 AC_MSG_CHECKING(for PulseAudio $PULSEAUDIO_REQUIRED_VERSION support)
958 if test x$PKG_CONFIG != xno; then
959 if $PKG_CONFIG --atleast-pkgconfig-version 0.7 && $PKG_CONFIG --atleast-version $PULSEAUDIO_REQUIRED_VERSION libpulse-simple; then
960 PULSEAUDIO_CFLAGS=`$PKG_CONFIG --cflags libpulse-simple`
961 PULSEAUDIO_LIBS=`$PKG_CONFIG --libs libpulse-simple`
965 AC_MSG_RESULT($audio_pulseaudio)
967 if test x$audio_pulseaudio = xyes; then
968 AC_ARG_ENABLE(pulseaudio-shared,
969 AC_HELP_STRING([--enable-pulseaudio-shared], [dynamically load PulseAudio support [[default=yes]]]),
970 , enable_pulseaudio_shared=yes)
971 pulseaudio_lib=[`find_lib "libpulse-simple.so.*" "$PULSEAUDIO_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`]
973 AC_DEFINE(SDL_AUDIO_DRIVER_PULSEAUDIO, 1, [ ])
974 SOURCES="$SOURCES $srcdir/src/audio/pulseaudio/*.c"
975 EXTRA_CFLAGS="$EXTRA_CFLAGS $PULSEAUDIO_CFLAGS"
976 if test x$have_loadso != xyes && \
977 test x$enable_pulseaudio_shared = xyes; then
978 AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic PulseAudio loading])
980 if test x$have_loadso = xyes && \
981 test x$enable_pulseaudio_shared = xyes && test x$pulseaudio_lib != x; then
982 echo "-- dynamic libpulse-simple -> $pulseaudio_lib"
983 AC_DEFINE_UNQUOTED(SDL_AUDIO_DRIVER_PULSEAUDIO_DYNAMIC, "$pulseaudio_lib", [ ])
984 SUMMARY_audio="${SUMMARY_audio} pulse(dynamic)"
987 # On Solaris, pulseaudio must be linked deferred explicitly
988 # to prevent undefined symbol failures.
990 PULSEAUDIO_LIBS=`echo $PULSEAUDIO_LIBS | sed 's/\-l/-Wl,-l/g'`
991 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-zdeferred $PULSEAUDIO_LIBS -Wl,-znodeferred"
994 EXTRA_LDFLAGS="$EXTRA_LDFLAGS $PULSEAUDIO_LIBS"
995 SUMMARY_audio="${SUMMARY_audio} pulse"
1005 AC_HELP_STRING([--enable-arts], [support the Analog Real Time Synthesizer [[default=yes]]]),
1007 if test x$enable_audio = xyes -a x$enable_arts = xyes; then
1008 AC_PATH_PROG(ARTSCONFIG, artsc-config)
1009 if test x$ARTSCONFIG = x -o x$ARTSCONFIG = x'"$ARTSCONFIG"'; then
1010 : # arts isn't installed
1012 ARTS_CFLAGS=`$ARTSCONFIG --cflags`
1013 ARTS_LIBS=`$ARTSCONFIG --libs`
1014 AC_MSG_CHECKING(for aRts development environment)
1016 save_CFLAGS="$CFLAGS"
1017 CFLAGS="$CFLAGS $ARTS_CFLAGS"
1021 arts_stream_t stream;
1025 CFLAGS="$save_CFLAGS"
1026 AC_MSG_RESULT($audio_arts)
1027 if test x$audio_arts = xyes; then
1028 AC_ARG_ENABLE(arts-shared,
1029 AC_HELP_STRING([--enable-arts-shared], [dynamically load aRts audio support [[default=yes]]]),
1030 , enable_arts_shared=yes)
1031 arts_lib=[`find_lib "libartsc.so.*" "$ARTS_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`]
1033 AC_DEFINE(SDL_AUDIO_DRIVER_ARTS, 1, [ ])
1034 SOURCES="$SOURCES $srcdir/src/audio/arts/*.c"
1035 EXTRA_CFLAGS="$EXTRA_CFLAGS $ARTS_CFLAGS"
1036 if test x$have_loadso != xyes && \
1037 test x$enable_arts_shared = xyes; then
1038 AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic ARTS loading])
1040 if test x$have_loadso = xyes && \
1041 test x$enable_arts_shared = xyes && test x$arts_lib != x; then
1042 echo "-- dynamic libartsc -> $arts_lib"
1043 AC_DEFINE_UNQUOTED(SDL_AUDIO_DRIVER_ARTS_DYNAMIC, "$arts_lib", [ ])
1044 SUMMARY_audio="${SUMMARY_audio} arts(dynamic)"
1046 EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ARTS_LIBS"
1047 SUMMARY_audio="${SUMMARY_audio} arts"
1055 dnl See if the NAS audio interface is supported
1059 AC_HELP_STRING([--enable-nas], [support the NAS audio API [[default=yes]]]),
1061 if test x$enable_audio = xyes -a x$enable_nas = xyes; then
1062 AC_CHECK_HEADER(audio/audiolib.h, have_nas_hdr=yes)
1063 AC_CHECK_LIB(audio, AuOpenServer, have_nas_lib=yes)
1065 AC_MSG_CHECKING(for NAS audio support)
1068 if test x$have_nas_hdr = xyes -a x$have_nas_lib = xyes; then
1072 elif test -r /usr/X11R6/include/audio/audiolib.h; then
1074 NAS_CFLAGS="-I/usr/X11R6/include/"
1075 NAS_LIBS="-L/usr/X11R6/lib -laudio -lXt"
1079 AC_MSG_RESULT($have_nas)
1081 if test x$have_nas = xyes; then
1082 AC_ARG_ENABLE(nas-shared,
1083 AC_HELP_STRING([--enable-nas-shared], [dynamically load NAS audio support [[default=yes]]]),
1084 , enable_nas_shared=yes)
1085 nas_lib=[`find_lib "libaudio.so.*" "$NAS_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`]
1087 if test x$have_loadso != xyes && \
1088 test x$enable_nas_shared = xyes; then
1089 AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic NAS loading])
1091 if test x$have_loadso = xyes && \
1092 test x$enable_nas_shared = xyes && test x$nas_lib != x; then
1093 echo "-- dynamic libaudio -> $nas_lib"
1094 AC_DEFINE_UNQUOTED(SDL_AUDIO_DRIVER_NAS_DYNAMIC, "$nas_lib", [ ])
1095 SUMMARY_audio="${SUMMARY_audio} nas(dynamic)"
1097 EXTRA_LDFLAGS="$EXTRA_LDFLAGS $NAS_LIBS"
1098 SUMMARY_audio="${SUMMARY_audio} nas"
1101 AC_DEFINE(SDL_AUDIO_DRIVER_NAS, 1, [ ])
1102 SOURCES="$SOURCES $srcdir/src/audio/nas/*.c"
1103 EXTRA_CFLAGS="$EXTRA_CFLAGS $NAS_CFLAGS"
1109 dnl See if the sndio audio interface is supported
1112 AC_ARG_ENABLE(sndio,
1113 AC_HELP_STRING([--enable-sndio], [support the sndio audio API [[default=yes]]]),
1115 if test x$enable_audio = xyes -a x$enable_sndio = xyes; then
1116 AC_CHECK_HEADER(sndio.h, have_sndio_hdr=yes)
1117 AC_CHECK_LIB(sndio, sio_open, have_sndio_lib=yes)
1119 AC_MSG_CHECKING(for sndio audio support)
1122 if test x$have_sndio_hdr = xyes -a x$have_sndio_lib = xyes; then
1124 SNDIO_LIBS="-lsndio"
1127 AC_MSG_RESULT($have_sndio)
1129 if test x$have_sndio = xyes; then
1130 AC_ARG_ENABLE(sndio-shared,
1131 AC_HELP_STRING([--enable-sndio-shared], [dynamically load sndio audio support [[default=yes]]]),
1132 , enable_sndio_shared=yes)
1133 sndio_lib=[`find_lib "libsndio.so.*" "$SNDIO_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`]
1135 if test x$have_loadso != xyes && \
1136 test x$enable_sndio_shared = xyes; then
1137 AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic sndio loading])
1139 if test x$have_loadso = xyes && \
1140 test x$enable_sndio_shared = xyes && test x$sndio_lib != x; then
1141 echo "-- dynamic libsndio -> $sndio_lib"
1142 AC_DEFINE_UNQUOTED(SDL_AUDIO_DRIVER_SNDIO_DYNAMIC, "$sndio_lib", [ ])
1143 SUMMARY_audio="${SUMMARY_audio} sndio(dynamic)"
1145 EXTRA_LDFLAGS="$EXTRA_LDFLAGS $SNDIO_LIBS"
1146 SUMMARY_audio="${SUMMARY_audio} sndio"
1149 AC_DEFINE(SDL_AUDIO_DRIVER_SNDIO, 1, [ ])
1150 SOURCES="$SOURCES $srcdir/src/audio/sndio/*.c"
1151 EXTRA_CFLAGS="$EXTRA_CFLAGS $SNDIO_CFLAGS"
1157 dnl Find FusionSound
1160 AC_ARG_ENABLE(fusionsound,
1161 AC_HELP_STRING([--enable-fusionsound], [use FusionSound audio driver [[default=no]]]),
1162 , enable_fusionsound=no)
1163 if test x$enable_audio = xyes -a x$enable_fusionsound = xyes; then
1166 FUSIONSOUND_REQUIRED_VERSION=1.1.1
1168 AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
1169 AC_MSG_CHECKING(for FusionSound $FUSIONSOUND_REQUIRED_VERSION support)
1170 if test x$PKG_CONFIG != xno; then
1171 if $PKG_CONFIG --atleast-pkgconfig-version 0.7 && $PKG_CONFIG --atleast-version $FUSIONSOUND_REQUIRED_VERSION fusionsound; then
1172 FUSIONSOUND_CFLAGS=`$PKG_CONFIG --cflags fusionsound`
1173 FUSIONSOUND_LIBS=`$PKG_CONFIG --libs fusionsound`
1177 AC_MSG_RESULT($fusionsound)
1179 if test x$fusionsound = xyes; then
1180 AC_DEFINE(SDL_AUDIO_DRIVER_FUSIONSOUND, 1, [ ])
1181 SOURCES="$SOURCES $srcdir/src/audio/fusionsound/*.c"
1182 EXTRA_CFLAGS="$EXTRA_CFLAGS $FUSIONSOUND_CFLAGS"
1184 AC_ARG_ENABLE(fusionsound-shared,
1185 AC_HELP_STRING([--enable-fusionsound-shared], [dynamically load fusionsound audio support [[default=yes]]]),
1186 , enable_fusionsound_shared=yes)
1187 fusionsound_shared=no
1188 AC_MSG_CHECKING(for FusionSound dynamic loading support)
1189 if test x$have_loadso != xyes && \
1190 test x$enable_fusionsound_shared = xyes; then
1191 AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic fusionsound loading])
1193 if test x$have_loadso = xyes && \
1194 test x$enable_fusionsound_shared = xyes; then
1195 AC_DEFINE_UNQUOTED(SDL_AUDIO_DRIVER_FUSIONSOUND_DYNAMIC, "libfusionsound.so", [ ])
1196 fusionsound_shared=yes
1197 SUMMARY_audio="${SUMMARY_audio} fusionsound(dynamic)"
1199 EXTRA_LDFLAGS="$EXTRA_LDFLAGS $FUSIONSOUND_LIBS"
1200 SUMMARY_audio="${SUMMARY_audio} fusionsound"
1202 AC_MSG_RESULT($fusionsound_shared)
1209 dnl rcg07142001 See if the user wants the disk writer audio driver...
1212 AC_ARG_ENABLE(diskaudio,
1213 AC_HELP_STRING([--enable-diskaudio], [support the disk writer audio driver [[default=yes]]]),
1214 , enable_diskaudio=yes)
1215 if test x$enable_audio = xyes -a x$enable_diskaudio = xyes; then
1216 AC_DEFINE(SDL_AUDIO_DRIVER_DISK, 1, [ ])
1217 SOURCES="$SOURCES $srcdir/src/audio/disk/*.c"
1218 SUMMARY_audio="${SUMMARY_audio} disk"
1222 dnl rcg03142006 See if the user wants the dummy audio driver...
1225 AC_ARG_ENABLE(dummyaudio,
1226 AC_HELP_STRING([--enable-dummyaudio], [support the dummy audio driver [[default=yes]]]),
1227 , enable_dummyaudio=yes)
1228 if test x$enable_audio = xyes -a x$enable_dummyaudio = xyes; then
1229 AC_DEFINE(SDL_AUDIO_DRIVER_DUMMY, 1, [ ])
1230 SOURCES="$SOURCES $srcdir/src/audio/dummy/*.c"
1231 SUMMARY_audio="${SUMMARY_audio} dummy"
1235 dnl See if libsamplerate is available
1236 CheckLibSampleRate()
1238 AC_ARG_ENABLE(libsamplerate,
1239 AC_HELP_STRING([--enable-libsamplerate], [use libsamplerate for audio rate conversion [[default=yes]]]),
1240 , enable_libsamplerate=yes)
1241 if test x$enable_libsamplerate = xyes; then
1242 AC_CHECK_HEADER(samplerate.h,
1243 have_samplerate_h_hdr=yes,
1244 have_samplerate_h_hdr=no)
1245 if test x$have_samplerate_h_hdr = xyes; then
1246 AC_DEFINE(HAVE_LIBSAMPLERATE_H, 1, [ ])
1248 AC_ARG_ENABLE(libsamplerate-shared,
1249 AC_HELP_STRING([--enable-libsamplerate-shared], [dynamically load libsamplerate [[default=yes]]]),
1250 , enable_libsamplerate_shared=yes)
1252 samplerate_lib=[`find_lib "libsamplerate.so.*" "" | sed 's/.*\/\(.*\)/\1/; q'`]
1254 if test x$have_loadso != xyes && \
1255 test x$enable_libsamplerate_shared = xyes; then
1256 AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic libsamplerate loading])
1258 if test x$have_loadso = xyes && \
1259 test x$enable_libsamplerate_shared = xyes && test x$samplerate_lib != x; then
1260 echo "-- dynamic libsamplerate -> $samplerate_lib"
1261 AC_DEFINE_UNQUOTED(SDL_LIBSAMPLERATE_DYNAMIC, "$samplerate_lib", [ ])
1263 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lsamplerate"
1269 dnl See if GCC's -fvisibility=hidden is supported (gcc4 and later, usually).
1270 dnl Details of this flag are here: http://gcc.gnu.org/wiki/Visibility
1271 CheckVisibilityHidden()
1273 AC_MSG_CHECKING(for GCC -fvisibility=hidden option)
1274 have_gcc_fvisibility=no
1276 visibility_CFLAGS="-fvisibility=hidden"
1277 save_CFLAGS="$CFLAGS"
1278 CFLAGS="$save_CFLAGS $visibility_CFLAGS -Werror"
1280 #if !defined(__GNUC__) || __GNUC__ < 4
1281 #error SDL only uses visibility attributes in GCC 4 or newer
1285 have_gcc_fvisibility=yes
1287 AC_MSG_RESULT($have_gcc_fvisibility)
1288 CFLAGS="$save_CFLAGS"
1290 if test x$have_gcc_fvisibility = xyes; then
1291 EXTRA_CFLAGS="$EXTRA_CFLAGS $visibility_CFLAGS"
1295 dnl See if GCC's -mpreferred-stack-boundary is supported.
1296 dnl Reference: http://bugzilla.libsdl.org/show_bug.cgi?id=1296
1297 CheckStackBoundary()
1299 AC_MSG_CHECKING(for GCC -mpreferred-stack-boundary option)
1300 have_gcc_preferred_stack_boundary=no
1302 save_CFLAGS="$CFLAGS"
1303 CFLAGS="$save_CFLAGS -mpreferred-stack-boundary=2"
1308 have_gcc_preferred_stack_boundary=yes
1310 AC_MSG_RESULT($have_gcc_preferred_stack_boundary)
1311 CFLAGS="$save_CFLAGS"
1313 if test x$have_gcc_preferred_stack_boundary = xyes; then
1314 EXTRA_CFLAGS="$EXTRA_CFLAGS -mpreferred-stack-boundary=2"
1318 dnl See if GCC's -Wdeclaration-after-statement is supported.
1319 dnl This lets us catch things that would fail on a C89 compiler when using
1321 CheckDeclarationAfterStatement()
1323 AC_MSG_CHECKING(for GCC -Wdeclaration-after-statement option)
1324 have_gcc_declaration_after_statement=no
1326 save_CFLAGS="$CFLAGS"
1327 CFLAGS="$save_CFLAGS -Wdeclaration-after-statement -Werror=declaration-after-statement"
1332 have_gcc_declaration_after_statement=yes
1334 AC_MSG_RESULT($have_gcc_declaration_after_statement)
1335 CFLAGS="$save_CFLAGS"
1337 if test x$have_gcc_declaration_after_statement = xyes; then
1338 EXTRA_CFLAGS="$EXTRA_CFLAGS -Wdeclaration-after-statement -Werror=declaration-after-statement"
1342 dnl See if GCC's -Wall is supported.
1345 AC_MSG_CHECKING(for GCC -Wall option)
1348 save_CFLAGS="$CFLAGS"
1349 CFLAGS="$save_CFLAGS -Wall"
1356 AC_MSG_RESULT($have_gcc_Wall)
1357 CFLAGS="$save_CFLAGS"
1359 if test x$have_gcc_Wall = xyes; then
1360 EXTRA_CFLAGS="$EXTRA_CFLAGS -Wall"
1362 dnl Haiku headers use multicharacter constants all over the place. Ignore these warnings when using -Wall.
1363 AC_MSG_CHECKING(for necessary GCC -Wno-multichar option)
1364 need_gcc_Wno_multichar=no
1367 need_gcc_Wno_multichar=yes
1370 AC_MSG_RESULT($need_gcc_Wno_multichar)
1371 if test x$need_gcc_Wno_multichar = xyes; then
1372 EXTRA_CFLAGS="$EXTRA_CFLAGS -Wno-multichar"
1377 dnl Check for Wayland
1380 AC_ARG_ENABLE(video-wayland,
1381 AC_HELP_STRING([--enable-video-wayland], [use Wayland video driver [[default=yes]]]),
1382 ,enable_video_wayland=yes)
1384 AC_ARG_ENABLE(video-wayland-qt-touch,
1385 AC_HELP_STRING([--enable-video-wayland-qt-touch], [QtWayland server support for Wayland video driver [[default=yes]]]),
1386 ,enable_video_wayland_qt_touch=yes)
1388 if test x$enable_video = xyes -a x$enable_video_wayland = xyes; then
1389 AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
1390 AC_MSG_CHECKING(for Wayland support)
1392 if test x$PKG_CONFIG != xno && \
1393 test x$video_opengl_egl = xyes && \
1394 test x$video_opengles_v2 = xyes; then
1395 if $PKG_CONFIG --exists wayland-client wayland-scanner wayland-protocols wayland-egl wayland-cursor egl xkbcommon xdg-shell-client text-client tizen-extension-client; then
1396 WAYLAND_CFLAGS=`$PKG_CONFIG --cflags wayland-client wayland-egl wayland-cursor xkbcommon xdg-shell-client text-client tizen-extension-client`
1397 WAYLAND_LIBS=`$PKG_CONFIG --libs wayland-client wayland-egl wayland-cursor xkbcommon xdg-shell-client text-client tizen-extension-client`
1398 WAYLAND_SCANNER=`$PKG_CONFIG --variable=wayland_scanner wayland-scanner`
1399 WAYLAND_CORE_PROTOCOL_DIR=`$PKG_CONFIG --variable=pkgdatadir wayland-client`
1400 WAYLAND_PROTOCOLS_DIR=`$PKG_CONFIG --variable=pkgdatadir wayland-protocols`
1404 AC_MSG_RESULT($video_wayland)
1406 if test x$video_wayland = xyes; then
1407 AC_DEFINE(SDL_VIDEO_DRIVER_WAYLAND, 1, [ ])
1408 if test x$enable_video_wayland_qt_touch = xyes; then
1409 AC_DEFINE(SDL_VIDEO_DRIVER_WAYLAND_QT_TOUCH, 1, [ ])
1412 WAYLAND_PROTOCOLS_UNSTABLE="relative-pointer-unstable-v1 pointer-constraints-unstable-v1 xdg-shell-unstable-v6"
1414 SOURCES="$SOURCES $srcdir/src/video/wayland/*.c"
1415 EXTRA_CFLAGS="$EXTRA_CFLAGS $WAYLAND_CFLAGS -I\$(gen)"
1416 AC_ARG_ENABLE(wayland-shared,
1417 AC_HELP_STRING([--enable-wayland-shared], [dynamically load Wayland support [[default=maybe]]]),
1418 , enable_wayland_shared=maybe)
1420 dnl FIXME: Do BSD and OS X need special cases?
1423 wayland_client_lib=[`find_lib "libwayland-client.so.*" "$WAYLAND_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`]
1424 wayland_egl_lib=[`find_lib "libwayland-egl.so.*" "$WAYLAND_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`]
1425 if test x$wayland_egl_lib = x; then
1426 dnl This works in Ubuntu 13.10, maybe others
1427 wayland_egl_lib=[`find_lib "mesa-egl/libwayland-egl.so.*" "$WAYLAND_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`]
1429 wayland_cursor_lib=[`find_lib "libwayland-cursor.so.*" "$WAYLAND_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`]
1430 xkbcommon_lib=[`find_lib "libxkbcommon.so.*" "$WAYLAND_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`]
1431 xdg_shell_client_lib=[`find_lib "libxdg-shell-client.so.*" "$WAYLAND_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`]
1432 text_client_lib=[`find_lib "libtext-client.so.*" "$WAYLAND_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`]
1433 tizen_extension_client_lib=[`find_lib "libtizen-extension-client.so.*" "$WAYLAND_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`]
1437 if test x$enable_wayland_shared = xmaybe; then
1438 enable_wayland_shared=yes
1440 if test x$have_loadso != xyes && \
1441 test x$enable_wayland_shared = xyes; then
1442 AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic Wayland loading])
1443 enable_wayland_shared=no
1445 if test x$have_loadso = xyes && \
1446 test x$enable_wayland_shared = xyes && \
1447 test x$wayland_client_lib != x && \
1448 test x$wayland_egl_lib != x && \
1449 test x$wayland_cursor_lib != x && \
1450 test x$xdg_shell_client_lib != x && \
1451 test x$text_client_lib != x && \
1452 test x$tizen_extension_client_lib != x && \
1453 test x$xkbcommon_lib != x; then
1454 echo "-- dynamic libwayland-client -> $wayland_client_lib"
1455 echo "-- dynamic libwayland-egl -> $wayland_egl_lib"
1456 echo "-- dynamic libwayland-cursor -> $wayland_cursor_lib"
1457 echo "-- dynamic libxkbcommon -> $xkbcommon_lib"
1458 echo "-- dynamic libxdg_shell_client -> $xdg_shell_client_lib"
1459 echo "-- dynamic libtext_client -> $xtext_client_lib"
1460 echo "-- dynamic libtizen_extension_client -> $xtizen_extension_client_lib"
1461 AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC, "$wayland_client_lib", [ ])
1462 AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_EGL, "$wayland_egl_lib", [ ])
1463 AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_CURSOR, "$wayland_cursor_lib", [ ])
1464 AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_XKBCOMMON, "$xkbcommon_lib", [ ])
1465 AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_XDGSHELLCLIENT, "$xdg_shell_client_lib", [ ])
1466 AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_TEXTCLIENT, "$text_client_lib", [ ])
1467 AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_TIZENEXTENSIONCLIENT, "$tizen_extension_client_lib", [ ])
1468 SUMMARY_video="${SUMMARY_video} wayland(dynamic)"
1470 enable_wayland_shared=no
1471 EXTRA_LDFLAGS="$EXTRA_LDFLAGS $WAYLAND_LIBS"
1472 SUMMARY_video="${SUMMARY_video} wayland"
1482 AC_ARG_ENABLE(video-tizen,
1483 AC_HELP_STRING([--enable-video-tizen], [use tizen video driver [[default=yes]]]),
1484 ,enable_video_tizen=yes)
1486 if test x$enable_video = xyes -a x$enable_video_tizen = xyes; then
1487 AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
1488 AC_MSG_CHECKING(for Tizen support)
1490 if test x$PKG_CONFIG != xno && \
1491 test x$video_opengl_egl = xyes && \
1492 test x$video_opengles_v2 = xyes; then
1493 if $PKG_CONFIG --exists wayland-client wayland-egl wayland-egl-tizen ecore ecore-wl2 xdg-shell-client text-client tizen-extension-client eina elementary capi-appfw-application capi-system-system-settings ecore-input dlog ecore-imf libdrm ecore-ipc; then
1494 TIZEN_CFLAGS=`$PKG_CONFIG --cflags wayland-client wayland-egl wayland-egl-tizen ecore ecore-wl2 xdg-shell-client text-client tizen-extension-client eina elementary capi-appfw-application capi-system-system-settings ecore-input dlog ecore-imf libdrm aul ecore-ipc`
1495 TIZEN_LIBS=`$PKG_CONFIG --libs wayland-client wayland-egl wayland-egl-tizen ecore ecore-wl2 xdg-shell-client text-client tizen-extension-client eina elementary capi-appfw-application capi-system-system-settings ecore-input dlog ecore-imf libdrm aul ecore-ipc`
1499 AC_MSG_RESULT($video_tizen)
1501 if test x$video_tizen = xyes; then
1502 AC_DEFINE(SDL_VIDEO_DRIVER_TIZEN, 1, [ ])
1503 SOURCES="$SOURCES $srcdir/src/video/tizen/*.c"
1504 SOURCES="$SOURCES $srcdir/src/core/tizen/*.c"
1505 SDLMAIN_SOURCES="$srcdir/src/main/tizen/*.c"
1507 SDL_CFLAGS="$SDL_CFLAGS -Dmain=SDL_main"
1508 SDL_LIBS="-lSDL2main $SDL_LIBS"
1510 EXTRA_CFLAGS="$EXTRA_CFLAGS $TIZEN_CFLAGS -DTIZEN"
1511 EXTRA_LDFLAGS="$EXTRA_LDFLAGS $TIZEN_LIBS"
1512 SUMMARY_video="${SUMMARY_video} tizen"
1517 if test x$enable_joystick = xyes; then
1518 SUMMARY="${SUMMARY}SDL2 tizen joystick in:\n"
1519 AC_DEFINE(SDL_JOYSTICK_TIZEN, 1, [ ])
1520 SOURCES="$SOURCES $srcdir/src/joystick/tizen/*.c"
1528 AC_ARG_ENABLE(video-mir,
1529 AC_HELP_STRING([--enable-video-mir], [use Mir video driver [[default=no]]]),
1530 ,enable_video_mir=no)
1532 if test x$enable_video = xyes -a x$enable_video_mir = xyes; then
1533 AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
1534 AC_MSG_CHECKING(for Mir support)
1536 if test x$PKG_CONFIG != xno; then
1537 if $PKG_CONFIG --exists mirclient egl xkbcommon ; then
1538 MIR_CFLAGS=`$PKG_CONFIG --cflags mirclient egl xkbcommon`
1539 MIR_LIBS=`$PKG_CONFIG --libs mirclient egl xkbcommon`
1540 save_CFLAGS="$CFLAGS"
1541 CFLAGS="$save_CFLAGS $MIR_CFLAGS"
1543 dnl This will disable Mir if >= v0.26 is not available
1545 #include <mir_toolkit/mir_client_library.h>
1547 MirWindowAttrib attrib = mir_window_attrib_state
1551 CFLAGS="$save_CFLAGS"
1554 AC_MSG_RESULT($video_mir)
1556 if test x$video_mir = xyes; then
1557 AC_DEFINE(SDL_VIDEO_DRIVER_MIR, 1, [ ])
1558 SOURCES="$SOURCES $srcdir/src/video/mir/*.c"
1559 EXTRA_CFLAGS="$EXTRA_CFLAGS $MIR_CFLAGS"
1560 AC_ARG_ENABLE(mir-shared,
1561 AC_HELP_STRING([--enable-mir-shared], [dynamically load Mir support [[default=maybe]]]),
1562 , enable_mir_shared=maybe)
1564 dnl FIXME: Do BSD and OS X need special cases?
1567 mirclient_lib=[`find_lib "libmirclient.so.*" "$MIR_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`]
1568 xkbcommon_lib=[`find_lib "libxkbcommon.so.*" "$MIR_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`]
1572 if test x$enable_mir_shared = xmaybe; then
1573 enable_mir_shared=yes
1575 if test x$have_loadso != xyes && \
1576 test x$enable_mir_shared = xyes; then
1577 AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic Mir loading])
1578 enable_mir_shared=no
1580 if test x$have_loadso = xyes && \
1581 test x$enable_mir_shared = xyes && \
1582 test x$mirclient_lib != x && \
1583 test x$xkbcommon_lib != x; then
1584 echo "-- dynamic libmirclient -> $mirclient_lib"
1585 echo "-- dynamic libxkbcommon -> $xkbcommon_lib"
1586 AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_MIR_DYNAMIC, "$mirclient_lib", [ ])
1587 AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_MIR_DYNAMIC_XKBCOMMON, "$xkbcommon_lib", [ ])
1588 SUMMARY_video="${SUMMARY_video} mir(dynamic)"
1590 enable_mir_shared=no
1591 EXTRA_LDFLAGS="$EXTRA_LDFLAGS $MIR_LIBS"
1592 SUMMARY_video="${SUMMARY_video} mir"
1599 dnl Check for Native Client stuff
1603 #if !defined(__native_client__)
1608 AC_DEFINE(SDL_VIDEO_DRIVER_NACL, 1, [ ])
1609 AC_DEFINE(SDL_AUDIO_DRIVER_NACL, 1, [ ])
1610 AC_DEFINE(HAVE_POW, 1, [ ])
1611 AC_DEFINE(HAVE_OPENGLES2, 1, [ ])
1612 AC_DEFINE(SDL_VIDEO_OPENGL_ES2, 1, [ ])
1613 AC_DEFINE(SDL_VIDEO_RENDER_OGL_ES2, 1, [ ])
1615 SDL_LIBS="-lppapi_simple -lppapi_gles2 $SDL_LIBS"
1617 SDLMAIN_SOURCES="$srcdir/src/main/nacl/*.c"
1618 SOURCES="$SOURCES $srcdir/src/audio/nacl/*.c"
1619 SUMMARY_audio="${SUMMARY_audio} nacl"
1620 SOURCES="$SOURCES $srcdir/src/video/nacl/*.c"
1621 SUMMARY_video="${SUMMARY_video} nacl opengles2"
1628 AC_ARG_ENABLE(video-rpi,
1629 AC_HELP_STRING([--enable-video-rpi], [use Raspberry Pi video driver [[default=yes]]]),
1630 , enable_video_rpi=yes)
1631 if test x$enable_video = xyes -a x$enable_video_rpi = xyes; then
1632 AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
1633 if test x$PKG_CONFIG != xno && $PKG_CONFIG --exists bcm_host; then
1634 RPI_CFLAGS=`$PKG_CONFIG --cflags bcm_host brcmegl`
1635 RPI_LDFLAGS=`$PKG_CONFIG --libs bcm_host brcmegl`
1636 elif test x$ARCH = xnetbsd; then
1637 RPI_CFLAGS="-I/usr/pkg/include -I/usr/pkg/include/interface/vcos/pthreads -I/usr/pkg/include/interface/vmcs_host/linux"
1638 RPI_LDFLAGS="-Wl,-R/usr/pkg/lib -L/usr/pkg/lib -lbcm_host"
1640 RPI_CFLAGS="-I/opt/vc/include -I/opt/vc/include/interface/vcos/pthreads -I/opt/vc/include/interface/vmcs_host/linux"
1641 RPI_LDFLAGS="-Wl,-rpath,/opt/vc/lib -L/opt/vc/lib -lbcm_host"
1644 # Save the original compiler flags and libraries
1645 ac_save_cflags="$CFLAGS"; ac_save_libs="$LIBS"
1647 # Add the Raspberry Pi compiler flags and libraries
1648 CFLAGS="$CFLAGS $RPI_CFLAGS"; LIBS="$LIBS $RPI_LDFLAGS"
1650 AC_MSG_CHECKING(for Raspberry Pi)
1653 #include <bcm_host.h>
1660 AC_MSG_RESULT($have_video_rpi)
1662 # Restore the compiler flags and libraries
1663 CFLAGS="$ac_save_cflags"; LIBS="$ac_save_libs"
1665 if test x$have_video_rpi = xyes; then
1666 CFLAGS="$CFLAGS $RPI_CFLAGS"
1667 SDL_CFLAGS="$SDL_CFLAGS $RPI_CFLAGS"
1668 EXTRA_CFLAGS="$EXTRA_CFLAGS $RPI_CFLAGS"
1669 EXTRA_LDFLAGS="$EXTRA_LDFLAGS $RPI_LDFLAGS"
1670 SOURCES="$SOURCES $srcdir/src/video/raspberry/*.c"
1671 AC_DEFINE(SDL_VIDEO_DRIVER_RPI, 1, [ ])
1672 SUMMARY_video="${SUMMARY_video} rpi"
1677 dnl Find the X11 include and library directories
1680 AC_ARG_ENABLE(video-x11,
1681 AC_HELP_STRING([--enable-video-x11], [use X11 video driver [[default=yes]]]),
1682 , enable_video_x11=yes)
1683 if test x$enable_video = xyes -a x$enable_video_x11 = xyes; then
1686 # This isn't necessary for X11, but fixes GLX detection
1687 if test "x$x_includes" = xNONE && \
1688 test "x$x_libraries" = xNONE && \
1689 test -d /usr/X11R6/include && \
1690 test -d /usr/X11R6/lib; then
1691 x_includes="/usr/X11R6/include"
1692 x_libraries="/usr/X11R6/lib"
1698 if test x$have_x = xyes; then
1699 AC_ARG_ENABLE(x11-shared,
1700 AC_HELP_STRING([--enable-x11-shared], [dynamically load X11 support [[default=maybe]]]),
1701 , enable_x11_shared=maybe)
1705 x11_lib='/usr/X11R6/lib/libX11.6.dylib'
1706 x11ext_lib='/usr/X11R6/lib/libXext.6.dylib'
1707 xcursor_lib='/usr/X11R6/lib/libXcursor.1.dylib'
1708 xinerama_lib='/usr/X11R6/lib/libXinerama.1.dylib'
1709 xinput_lib='/usr/X11R6/lib/libXi.6.dylib'
1710 xrandr_lib='/usr/X11R6/lib/libXrandr.2.dylib'
1711 xrender_lib='/usr/X11R6/lib/libXrender.1.dylib'
1712 xss_lib='/usr/X11R6/lib/libXss.1.dylib'
1713 xvidmode_lib='/usr/X11R6/lib/libXxf86vm.1.dylib'
1717 x11ext_lib='libXext.so'
1718 xcursor_lib='libXcursor.so'
1719 xinerama_lib='libXinerama.so'
1720 xinput_lib='libXi.so'
1721 xrandr_lib='libXrandr.so'
1722 xrender_lib='libXrender.so'
1724 xvidmode_lib='libXxf86vm.so'
1727 x11_lib=[`find_lib "libX11.so.*" "$X_LIBS -L/usr/X11/$base_libdir -L/usr/X11R6/$base_libdir" | sed 's/.*\/\(.*\)/\1/; q'`]
1728 x11ext_lib=[`find_lib "libXext.so.*" "$X_LIBS -L/usr/X11/$base_libdir -L/usr/X11R6/$base_libdir" | sed 's/.*\/\(.*\)/\1/; q'`]
1729 xcursor_lib=[`find_lib "libXcursor.so.*" "$X_LIBS -L/usr/X11/$base_libdir -L/usr/X11R6/$base_libdir" | sed 's/.*\/\(.*\)/\1/; q'`]
1730 xinerama_lib=[`find_lib "libXinerama.so.*" "$X_LIBS -L/usr/X11/$base_libdir -L/usr/X11R6/$base_libdir" | sed 's/.*\/\(.*\)/\1/; q'`]
1731 xinput_lib=[`find_lib "libXi.so.*" "$X_LIBS -L/usr/X11/$base_libdir -L/usr/X11R6/$base_libdir" | sed 's/.*\/\(.*\)/\1/; q'`]
1732 xrandr_lib=[`find_lib "libXrandr.so.*" "$X_LIBS -L/usr/X11/$base_libdir -L/usr/X11R6/$base_libdir" | sed 's/.*\/\(.*\)/\1/; q'`]
1733 xrender_lib=[`find_lib "libXrender.so.*" "$X_LIBS -L/usr/X11/$base_libdir -L/usr/X11R6/$base_libdir" | sed 's/.*\/\(.*\)/\1/; q'`]
1734 xss_lib=[`find_lib "libXss.so.*" "$X_LIBS -L/usr/X11/$base_libdir -L/usr/X11R6/$base_libdir" | sed 's/.*\/\(.*\)/\1/; q'`]
1735 xvidmode_lib=[`find_lib "libXxf86vm.so.*" "$X_LIBS -L/usr/X11/$base_libdir -L/usr/X11R6/$base_libdir" | sed 's/.*\/\(.*\)/\1/; q'`]
1739 if test x$ac_cv_func_shmat != xyes; then
1740 X_CFLAGS="$X_CFLAGS -DNO_SHARED_MEMORY"
1742 CFLAGS="$CFLAGS $X_CFLAGS"
1743 LDFLAGS="$LDFLAGS $X_LIBS"
1745 AC_CHECK_HEADER(X11/extensions/Xext.h,
1746 have_xext_h_hdr=yes,
1748 [#include <X11/Xlib.h>
1749 #include <X11/Xproto.h>
1751 if test x$have_xext_h_hdr != xyes; then
1753 *** Missing Xext.h, maybe you need to install the libxext-dev package?
1757 AC_DEFINE(SDL_VIDEO_DRIVER_X11, 1, [ ])
1758 SOURCES="$SOURCES $srcdir/src/video/x11/*.c"
1759 EXTRA_CFLAGS="$EXTRA_CFLAGS $X_CFLAGS"
1761 # Needed so SDL applications can include SDL_syswm.h
1762 SDL_CFLAGS="$SDL_CFLAGS $X_CFLAGS"
1764 if test x$enable_x11_shared = xmaybe; then
1765 enable_x11_shared=yes
1767 if test x$have_loadso != xyes && \
1768 test x$enable_x11_shared = xyes; then
1769 AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic X11 loading])
1770 enable_x11_shared=no
1772 if test x$have_loadso = xyes && \
1773 test x$enable_x11_shared = xyes && test x$x11_lib != x && test x$x11ext_lib != x; then
1774 echo "-- dynamic libX11 -> $x11_lib"
1775 echo "-- dynamic libX11ext -> $x11ext_lib"
1776 AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_X11_DYNAMIC, "$x11_lib", [ ])
1777 AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_X11_DYNAMIC_XEXT, "$x11ext_lib", [ ])
1778 SUMMARY_video="${SUMMARY_video} x11(dynamic)"
1780 enable_x11_shared=no
1781 EXTRA_LDFLAGS="$EXTRA_LDFLAGS $X_LIBS -lX11 -lXext"
1782 SUMMARY_video="${SUMMARY_video} x11"
1786 AC_MSG_CHECKING(for const parameter to XextAddDisplay)
1787 have_const_param_XextAddDisplay=no
1789 #include <X11/Xlib.h>
1790 #include <X11/Xproto.h>
1791 #include <X11/extensions/Xext.h>
1792 #include <X11/extensions/extutil.h>
1793 extern XExtDisplayInfo* XextAddDisplay(XExtensionInfo* a,Display* b,_Xconst char* c,XExtensionHooks* d,int e,XPointer f);
1796 have_const_param_XextAddDisplay=yes
1797 AC_DEFINE([SDL_VIDEO_DRIVER_X11_CONST_PARAM_XEXTADDDISPLAY], 1, [ ])
1799 AC_MSG_RESULT($have_const_param_XextAddDisplay)
1801 dnl AC_CHECK_LIB(X11, XGetEventData, AC_DEFINE(SDL_VIDEO_DRIVER_X11_SUPPORTS_GENERIC_EVENTS, 1, [Have XGenericEvent]))
1802 AC_MSG_CHECKING([for XGenericEvent])
1803 have_XGenericEvent=no
1805 #include <X11/Xlib.h>
1809 XGenericEventCookie *cookie = &event.xcookie;
1810 XNextEvent(display, &event);
1811 XGetEventData(display, cookie);
1812 XFreeEventData(display, cookie);
1814 have_XGenericEvent=yes
1815 AC_DEFINE([SDL_VIDEO_DRIVER_X11_SUPPORTS_GENERIC_EVENTS], 1, [ ])
1817 AC_MSG_RESULT($have_XGenericEvent)
1819 AC_CHECK_LIB(X11, XkbKeycodeToKeysym, AC_DEFINE(SDL_VIDEO_DRIVER_X11_HAS_XKBKEYCODETOKEYSYM, 1, [Have XkbKeycodeToKeysym]))
1821 AC_ARG_ENABLE(video-x11-xcursor,
1822 AC_HELP_STRING([--enable-video-x11-xcursor], [enable X11 Xcursor support [[default=yes]]]),
1823 , enable_video_x11_xcursor=yes)
1824 if test x$enable_video_x11_xcursor = xyes; then
1825 definitely_enable_video_x11_xcursor=no
1826 AC_CHECK_HEADER(X11/Xcursor/Xcursor.h,
1827 have_xcursor_h_hdr=yes,
1828 have_xcursor_h_hdr=no,
1829 [#include <X11/Xlib.h>
1831 if test x$have_xcursor_h_hdr = xyes; then
1832 if test x$enable_x11_shared = xyes && test x$xcursor_lib != x ; then
1833 echo "-- dynamic libXcursor -> $xcursor_lib"
1834 AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_X11_DYNAMIC_XCURSOR, "$xcursor_lib", [ ])
1835 definitely_enable_video_x11_xcursor=yes
1837 AC_CHECK_LIB(Xcursor, XcursorImageCreate, have_xcursor_lib=yes)
1838 if test x$have_xcursor_lib = xyes ; then
1839 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lXcursor"
1840 definitely_enable_video_x11_xcursor=yes
1845 if test x$definitely_enable_video_x11_xcursor = xyes; then
1846 AC_DEFINE(SDL_VIDEO_DRIVER_X11_XCURSOR, 1, [ ])
1847 SUMMARY_video_x11="${SUMMARY_video_x11} xcursor"
1849 AC_ARG_ENABLE(video-x11-xdbe,
1850 AC_HELP_STRING([--enable-video-x11-xdbe], [enable X11 Xdbe support [[default=yes]]]),
1851 , enable_video_x11_xdbe=yes)
1852 if test x$enable_video_x11_xdbe = xyes; then
1853 AC_CHECK_HEADER(X11/extensions/Xdbe.h,
1856 [#include <X11/Xlib.h>
1858 if test x$have_dbe_h_hdr = xyes; then
1859 AC_DEFINE(SDL_VIDEO_DRIVER_X11_XDBE, 1, [ ])
1860 SUMMARY_video_x11="${SUMMARY_video_x11} xdbe"
1863 AC_ARG_ENABLE(video-x11-xinerama,
1864 AC_HELP_STRING([--enable-video-x11-xinerama], [enable X11 Xinerama support [[default=yes]]]),
1865 , enable_video_x11_xinerama=yes)
1866 if test x$enable_video_x11_xinerama = xyes; then
1867 definitely_enable_video_x11_xinerama=no
1868 AC_CHECK_HEADER(X11/extensions/Xinerama.h,
1869 have_xinerama_h_hdr=yes,
1870 have_xinerama_h_hdr=no,
1871 [#include <X11/Xlib.h>
1873 if test x$have_xinerama_h_hdr = xyes; then
1874 if test x$enable_x11_shared = xyes && test x$xinerama_lib != x ; then
1875 echo "-- dynamic libXinerama -> $xinerama_lib"
1876 AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_X11_DYNAMIC_XINERAMA, "$xinerama_lib", [ ])
1877 definitely_enable_video_x11_xinerama=yes
1879 AC_CHECK_LIB(Xinerama, XineramaQueryExtension, have_xinerama_lib=yes)
1880 if test x$have_xinerama_lib = xyes ; then
1881 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lXinerama"
1882 definitely_enable_video_x11_xinerama=yes
1887 if test x$definitely_enable_video_x11_xinerama = xyes; then
1888 AC_DEFINE(SDL_VIDEO_DRIVER_X11_XINERAMA, 1, [ ])
1889 SUMMARY_video_x11="${SUMMARY_video_x11} xinerama"
1891 AC_ARG_ENABLE(video-x11-xinput,
1892 AC_HELP_STRING([--enable-video-x11-xinput], [enable X11 XInput extension for manymouse, tablets, etc [[default=yes]]]),
1893 , enable_video_x11_xinput=yes)
1894 if test x$enable_video_x11_xinput = xyes; then
1895 definitely_enable_video_x11_xinput=no
1896 AC_CHECK_HEADER(X11/extensions/XInput2.h,
1897 have_xinput_h_hdr=yes,
1898 have_xinput_h_hdr=no,
1899 [#include <X11/Xlib.h>
1901 if test x$have_xinput_h_hdr = xyes; then
1902 if test x$enable_x11_shared = xyes && test x$xinput_lib != x ; then
1903 echo "-- dynamic libXi -> $xinput_lib"
1904 AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_X11_DYNAMIC_XINPUT2, "$xinput_lib", [ ])
1905 definitely_enable_video_x11_xinput=yes
1907 AC_CHECK_LIB(Xi, XOpenDevice, have_xinput_lib=yes)
1908 if test x$have_xinput_lib = xyes ; then
1909 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lXi"
1910 definitely_enable_video_x11_xinput=yes
1915 if test x$definitely_enable_video_x11_xinput = xyes; then
1916 SUMMARY_video_x11="${SUMMARY_video_x11} xinput2"
1917 AC_DEFINE(SDL_VIDEO_DRIVER_X11_XINPUT2, 1, [ ])
1918 AC_MSG_CHECKING(for xinput2 multitouch)
1919 have_xinput2_multitouch=no
1921 #include <X11/Xlib.h>
1922 #include <X11/Xproto.h>
1923 #include <X11/extensions/XInput2.h>
1925 int event_type = XI_TouchBegin;
1926 XITouchClassInfo *t;
1928 have_xinput2_multitouch=yes
1929 AC_DEFINE([SDL_VIDEO_DRIVER_X11_XINPUT2_SUPPORTS_MULTITOUCH], 1, [])
1930 SUMMARY_video_x11="${SUMMARY_video_x11} xinput2_multitouch"
1932 AC_MSG_RESULT($have_xinput2_multitouch)
1934 AC_ARG_ENABLE(video-x11-xrandr,
1935 AC_HELP_STRING([--enable-video-x11-xrandr], [enable X11 Xrandr extension for fullscreen [[default=yes]]]),
1936 , enable_video_x11_xrandr=yes)
1937 if test x$enable_video_x11_xrandr = xyes; then
1938 dnl XRRScreenResources is only present in Xrandr >= 1.2, we use that as a test.
1939 definitely_enable_video_x11_xrandr=no
1940 have_xrandr_h_hdr=no
1942 #include <X11/Xlib.h>
1943 #include <X11/extensions/Xrandr.h>
1945 XRRScreenResources *res = NULL;
1947 have_xrandr_h_hdr=yes
1949 if test x$have_xrandr_h_hdr = xyes; then
1950 if test x$enable_x11_shared = xyes && test x$xrandr_lib != x ; then
1951 echo "-- dynamic libXrandr -> $xrandr_lib"
1952 AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_X11_DYNAMIC_XRANDR, "$xrandr_lib", [ ])
1953 definitely_enable_video_x11_xrandr=yes
1955 AC_CHECK_LIB(Xrandr, XRRQueryExtension, have_xrandr_lib=yes)
1956 if test x$have_xrandr_lib = xyes ; then
1957 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lXrandr"
1958 definitely_enable_video_x11_xrandr=yes
1963 if test x$definitely_enable_video_x11_xrandr = xyes; then
1964 AC_DEFINE(SDL_VIDEO_DRIVER_X11_XRANDR, 1, [ ])
1965 SUMMARY_video_x11="${SUMMARY_video_x11} xrandr"
1967 AC_ARG_ENABLE(video-x11-scrnsaver,
1968 AC_HELP_STRING([--enable-video-x11-scrnsaver], [enable X11 screensaver extension [[default=yes]]]),
1969 , enable_video_x11_scrnsaver=yes)
1970 if test x$enable_video_x11_scrnsaver = xyes; then
1971 AC_CHECK_HEADER(X11/extensions/scrnsaver.h,
1972 have_scrnsaver_h_hdr=yes,
1973 have_scrnsaver_h_hdr=no,
1974 [#include <X11/Xlib.h>
1976 if test x$have_scrnsaver_h_hdr = xyes; then
1977 if test x$enable_x11_shared = xyes && test x$xss_lib != x ; then
1978 echo "-- dynamic libXss -> $xss_lib"
1979 AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_X11_DYNAMIC_XSS, "$xss_lib", [ ])
1980 definitely_enable_video_x11_scrnsaver=yes
1982 AC_CHECK_LIB(Xss, XScreenSaverSuspend, have_xss_lib=yes)
1983 if test x$have_xss_lib = xyes ; then
1984 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lXss"
1985 definitely_enable_video_x11_scrnsaver=yes
1990 if test x$definitely_enable_video_x11_scrnsaver = xyes; then
1991 AC_DEFINE(SDL_VIDEO_DRIVER_X11_XSCRNSAVER, 1, [ ])
1992 SUMMARY_video_x11="${SUMMARY_video_x11} xscrnsaver"
1994 AC_ARG_ENABLE(video-x11-xshape,
1995 AC_HELP_STRING([--enable-video-x11-xshape], [enable X11 XShape support [[default=yes]]]),
1996 , enable_video_x11_xshape=yes)
1997 if test x$enable_video_x11_xshape = xyes; then
1998 AC_CHECK_HEADER(X11/extensions/shape.h,
1999 have_shape_h_hdr=yes,
2000 have_shape_h_hdr=no,
2001 [#include <X11/Xlib.h>
2003 if test x$have_shape_h_hdr = xyes; then
2004 AC_DEFINE(SDL_VIDEO_DRIVER_X11_XSHAPE, 1, [ ])
2005 SUMMARY_video_x11="${SUMMARY_video_x11} xshape"
2008 AC_ARG_ENABLE(video-x11-vm,
2009 AC_HELP_STRING([--enable-video-x11-vm], [use X11 VM extension for fullscreen [[default=yes]]]),
2010 , enable_video_x11_vm=yes)
2011 if test x$enable_video_x11_vm = xyes; then
2012 definitely_enable_video_x11_vm=no
2013 AC_CHECK_HEADER(X11/extensions/xf86vmode.h,
2016 [#include <X11/Xlib.h>
2018 if test x$have_vm_h_hdr = xyes; then
2019 if test x$enable_x11_shared = xyes && test x$xvidmode_lib != x ; then
2020 echo "-- dynamic libXxf86vm -> $xvidmode_lib"
2021 AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_X11_DYNAMIC_XVIDMODE, "$xvidmode_lib", [ ])
2022 definitely_enable_video_x11_vm=yes
2024 AC_CHECK_LIB(Xxf86vm, XF86VidModeQueryVersion, have_vm_lib=yes)
2025 if test x$have_vm_lib = xyes ; then
2026 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lXxf86vm"
2027 definitely_enable_video_x11_vm=yes
2032 if test x$definitely_enable_video_x11_vm = xyes; then
2033 AC_DEFINE(SDL_VIDEO_DRIVER_X11_XVIDMODE, 1, [ ])
2034 SUMMARY_video_x11="${SUMMARY_video_x11} xvidmode"
2040 dnl Set up the Vivante video driver if enabled
2043 AC_ARG_ENABLE(video-vivante,
2044 AC_HELP_STRING([--enable-video-vivante], [use Vivante EGL video driver [[default=yes]]]),
2045 , enable_video_vivante=yes)
2046 if test x$enable_video = xyes -a x$enable_video_vivante = xyes; then
2047 AC_MSG_CHECKING(for Vivante VDK API)
2055 have_vivante_vdk=yes
2057 AC_MSG_RESULT($have_vivante_vdk)
2059 AC_MSG_CHECKING(for Vivante FB API)
2064 #include <EGL/eglvivante.h>
2067 have_vivante_egl=yes
2069 AC_MSG_RESULT($have_vivante_egl)
2071 if test x$have_vivante_vdk = xyes -o x$have_vivante_egl = xyes; then
2072 AC_DEFINE(SDL_VIDEO_DRIVER_VIVANTE, 1, [ ])
2073 EXTRA_CFLAGS="$EXTRA_CFLAGS -DLINUX -DEGL_API_FB"
2074 if test x$have_vivante_vdk = xyes; then
2075 AC_DEFINE(SDL_VIDEO_DRIVER_VIVANTE_VDK, 1, [ ])
2076 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lVDK"
2078 SOURCES="$SOURCES $srcdir/src/video/vivante/*.c"
2079 SUMMARY_video="${SUMMARY_video} vivante"
2085 dnl Set up the Haiku video driver if enabled
2088 if test x$enable_video = xyes; then
2089 AC_DEFINE(SDL_VIDEO_DRIVER_HAIKU, 1, [ ])
2090 SOURCES="$SOURCES $srcdir/src/video/haiku/*.cc"
2092 SUMMARY_video="${SUMMARY_video} haiku"
2096 dnl Set up the Cocoa video driver for Mac OS X (but not Darwin)
2099 AC_ARG_ENABLE(video-cocoa,
2100 AC_HELP_STRING([--enable-video-cocoa], [use Cocoa video driver [[default=yes]]]),
2101 , enable_video_cocoa=yes)
2102 if test x$enable_video = xyes -a x$enable_video_cocoa = xyes; then
2103 save_CFLAGS="$CFLAGS"
2104 dnl Work around that we don't have Objective-C support in autoconf
2105 CFLAGS="$CFLAGS -x objective-c"
2106 AC_MSG_CHECKING(for Cocoa framework)
2109 #import <Cocoa/Cocoa.h>
2114 AC_MSG_RESULT($have_cocoa)
2115 CFLAGS="$save_CFLAGS"
2116 if test x$have_cocoa = xyes; then
2117 AC_DEFINE(SDL_VIDEO_DRIVER_COCOA, 1, [ ])
2118 SOURCES="$SOURCES $srcdir/src/video/cocoa/*.m"
2119 SUMMARY_video="${SUMMARY_video} cocoa"
2127 AC_ARG_ENABLE(render-metal,
2128 AC_HELP_STRING([--enable-render-metal], [enable the Metal render driver [[default=yes]]]),
2129 , enable_render_metal=yes)
2130 if test x$enable_render = xyes -a x$enable_render_metal = xyes; then
2131 save_CFLAGS="$CFLAGS"
2132 dnl Work around that we don't have Objective-C support in autoconf
2133 CFLAGS="$CFLAGS -x objective-c"
2134 AC_MSG_CHECKING(for Metal framework)
2137 #import <Cocoa/Cocoa.h>
2138 #import <Metal/Metal.h>
2139 #import <QuartzCore/CAMetalLayer.h>
2141 #if !TARGET_CPU_X86_64
2142 #error Metal doesn't work on this configuration
2148 CFLAGS="$save_CFLAGS"
2149 AC_MSG_RESULT($have_metal)
2150 if test x$have_metal = xyes; then
2151 AC_DEFINE(SDL_VIDEO_RENDER_METAL, 1, [ ])
2152 SOURCES="$SOURCES $srcdir/src/render/metal/*.m"
2153 SUMMARY_video="${SUMMARY_video} metal"
2155 enable_render_metal=no
2164 AC_ARG_ENABLE(video-directfb,
2165 AC_HELP_STRING([--enable-video-directfb], [use DirectFB video driver [[default=no]]]),
2166 , enable_video_directfb=no)
2167 if test x$enable_video = xyes -a x$enable_video_directfb = xyes; then
2170 DIRECTFB_REQUIRED_VERSION=1.0.0
2171 AC_PATH_PROGS(DIRECTFBCONFIG, directfb-config, no, [$prefix/bin:$PATH])
2172 if test x$DIRECTFBCONFIG = xno; then
2173 AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
2174 if test x$PKG_CONFIG != xno; then
2175 if $PKG_CONFIG --atleast-pkgconfig-version 0.7 && $PKG_CONFIG --atleast-version $DIRECTFB_REQUIRED_VERSION directfb; then
2176 DIRECTFB_CFLAGS=`$PKG_CONFIG --cflags directfb`
2177 DIRECTFB_LIBS=`$PKG_CONFIG --libs directfb`
2178 DIRECTFB_PREFIX=`$PKG_CONFIG --variable=prefix directfb`
2183 set -- `echo $DIRECTFB_REQUIRED_VERSION | sed 's/\./ /g'`
2184 NEED_VERSION=`expr $1 \* 10000 + $2 \* 100 + $3`
2185 set -- `$DIRECTFBCONFIG --version | sed 's/\./ /g'`
2186 HAVE_VERSION=`expr $1 \* 10000 + $2 \* 100 + $3`
2187 if test $HAVE_VERSION -ge $NEED_VERSION; then
2188 DIRECTFB_CFLAGS=`$DIRECTFBCONFIG --cflags`
2189 DIRECTFB_LIBS=`$DIRECTFBCONFIG --libs`
2190 DIRECTFB_PREFIX=`$DIRECTFBCONFIG --prefix`
2194 if test x$video_directfb = xyes; then
2195 # SuSE 11.1 installs directfb-config without directfb-devel
2196 save_CPPFLAGS="$CPPFLAGS"
2197 CPPFLAGS="$CPPFLAGS $DIRECTFB_CFLAGS"
2198 AC_CHECK_HEADER(directfb.h, have_directfb_hdr=yes, have_directfb_hdr=no)
2199 CPPFLAGS="$save_CPPFLAGS"
2200 video_directfb=$have_directfb_hdr
2202 AC_MSG_CHECKING(for DirectFB $DIRECTFB_REQUIRED_VERSION support)
2203 AC_MSG_RESULT($video_directfb)
2205 if test x$video_directfb = xyes; then
2206 AC_ARG_ENABLE(directfb-shared,
2207 AC_HELP_STRING([--enable-directfb-shared], [dynamically load directfb support [[default=yes]]]),
2208 , enable_directfb_shared=yes)
2210 AC_DEFINE(SDL_VIDEO_DRIVER_DIRECTFB, 1, [ ])
2211 SOURCES="$SOURCES $srcdir/src/video/directfb/*.c"
2212 EXTRA_CFLAGS="$EXTRA_CFLAGS $DIRECTFB_CFLAGS"
2214 AC_MSG_CHECKING(for directfb dynamic loading support)
2216 directfb_lib=[`find_lib "libdirectfb*.so.*" "$DIRECTFB_LIBS"`]
2217 # | sed 's/.*\/\(.*\)/\1/; q'`]
2218 AC_MSG_WARN("directfb $directfb_lib")
2219 if test x$have_loadso != xyes && \
2220 test x$enable_directfb_shared = xyes; then
2221 AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic directfb loading])
2223 if test x$have_loadso = xyes && \
2224 test x$enable_directfb_shared = xyes && test x$directfb_lib != x; then
2226 echo "-- $directfb_lib_spec -> $directfb_lib"
2227 AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_DIRECTFB_DYNAMIC, "$directfb_lib", [ ])
2228 SUMMARY_video="${SUMMARY_video} directfb(dynamic)"
2230 EXTRA_LDFLAGS="$EXTRA_LDFLAGS $DIRECTFB_LIBS"
2231 SUMMARY_video="${SUMMARY_video} directfb"
2233 AC_MSG_RESULT($directfb_shared)
2234 SDL_CFLAGS="$SDL_CFLAGS $DIRECTFB_CFLAGS"
2243 AC_ARG_ENABLE(video-kmsdrm,
2244 AC_HELP_STRING([--enable-video-kmsdrm], [use KMSDRM video driver [[default=no]]]),
2245 , enable_video_kmsdrm=no)
2247 if test x$enable_video = xyes -a x$enable_video_kmsdrm = xyes; then
2252 LIBDRM_REQUIRED_VERSION=2.4.46
2253 LIBGBM_REQUIRED_VERSION=9.0.0
2255 AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
2256 if test x$PKG_CONFIG != xno; then
2257 if $PKG_CONFIG --atleast-pkgconfig-version 0.7; then
2258 if $PKG_CONFIG --atleast-version $LIBDRM_REQUIRED_VERSION libdrm; then
2259 LIBDRM_CFLAGS=`$PKG_CONFIG --cflags libdrm`
2260 LIBDRM_LIBS=`$PKG_CONFIG --libs libdrm`
2261 LIBDRM_PREFIX=`$PKG_CONFIG --variable=prefix libdrm`
2264 if $PKG_CONFIG --atleast-version $LIBGBM_REQUIRED_VERSION gbm; then
2265 LIBGBM_CFLAGS=`$PKG_CONFIG --cflags gbm`
2266 LIBGBM_LIBS=`$PKG_CONFIG --libs gbm`
2267 LIBGBM_PREFIX=`$PKG_CONFIG --variable=prefix gbm`
2270 if test x$libdrm_avail = xyes -a x$libgbm_avail = xyes; then
2274 AC_MSG_CHECKING(for libdrm $LIBDRM_REQUIRED_VERSION library for kmsdrm support)
2275 AC_MSG_RESULT($libdrm_avail)
2276 AC_MSG_CHECKING(for libgbm $LIBGBM_REQUIRED_VERSION library for kmsdrm support)
2277 AC_MSG_RESULT($libgbm_avail)
2279 if test x$video_kmsdrm = xyes; then
2280 AC_ARG_ENABLE(kmsdrm-shared,
2281 AC_HELP_STRING([--enable-kmsdrm-shared], [dynamically load kmsdrm support [[default=yes]]]),
2282 , enable_kmsdrm_shared=yes)
2284 AC_DEFINE(SDL_VIDEO_DRIVER_KMSDRM, 1, [ ])
2285 SOURCES="$SOURCES $srcdir/src/video/kmsdrm/*.c"
2286 EXTRA_CFLAGS="$EXTRA_CFLAGS $LIBDRM_CFLAGS $LIBGBM_CFLAGS"
2288 AC_MSG_CHECKING(for kmsdrm dynamic loading support)
2290 drm_lib=[`find_lib "libdrm.so.*" "$DRM_LIBS"`]
2291 gbm_lib=[`find_lib "libgbm.so.*" "$DRM_LIBS"`]
2292 if test x$have_loadso != xyes && \
2293 test x$enable_kmsdrm_shared = xyes; then
2294 AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic kmsdrm loading])
2296 if test x$have_loadso = xyes && \
2297 test x$enable_kmsdrm_shared = xyes && test x$drm_lib != x && test x$gbm_lib != x; then
2299 AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_KMSDRM_DYNAMIC, "$drm_lib", [ ])
2300 AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_KMSDRM_DYNAMIC_GBM, "$gbm_lib", [ ])
2301 AC_DEFINE_UNQUOTED(HAVE_KMSDRM_SHARED, "TRUE", [ ])
2302 SUMMARY_video="${SUMMARY_video} kmsdrm(dynamic)"
2304 EXTRA_LDFLAGS="$EXTRA_LDFLAGS $LIBDRM_LIBS $LIBGBM_LIBS"
2305 SUMMARY_video="${SUMMARY_video} kmsdrm"
2307 AC_MSG_RESULT($kmsdrm_shared)
2315 dnl rcg04172001 Set up the Null video driver.
2318 AC_ARG_ENABLE(video-dummy,
2319 AC_HELP_STRING([--enable-video-dummy], [use dummy video driver [[default=yes]]]),
2320 , enable_video_dummy=yes)
2321 if test x$enable_video_dummy = xyes; then
2322 AC_DEFINE(SDL_VIDEO_DRIVER_DUMMY, 1, [ ])
2323 SOURCES="$SOURCES $srcdir/src/video/dummy/*.c"
2325 SUMMARY_video="${SUMMARY_video} dummy"
2329 dnl Set up the QNX video driver if enabled
2332 if test x$enable_video = xyes; then
2333 AC_DEFINE(SDL_VIDEO_DRIVER_QNX, 1, [ ])
2334 SOURCES="$SOURCES $srcdir/src/video/qnx/*.c"
2336 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lscreen -lEGL -lGLESv2"
2337 SUMMARY_video="${SUMMARY_video} qnx"
2341 dnl Set up the QNX audio driver if enabled
2344 if test x$enable_audio = xyes; then
2345 AC_DEFINE(SDL_AUDIO_DRIVER_QSA, 1, [ ])
2346 SOURCES="$SOURCES $srcdir/src/audio/qsa/*.c"
2348 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lasound"
2349 SUMMARY_audio="${SUMMARY_audio} qsa"
2353 dnl Check to see if OpenGL support is desired
2354 AC_ARG_ENABLE(video-opengl,
2355 AC_HELP_STRING([--enable-video-opengl], [include OpenGL support [[default=yes]]]),
2356 , enable_video_opengl=yes)
2361 if test x$enable_video = xyes -a x$enable_video_opengl = xyes; then
2362 AC_MSG_CHECKING(for OpenGL (GLX) support)
2371 AC_MSG_RESULT($video_opengl)
2372 if test x$video_opengl = xyes; then
2373 AC_DEFINE(SDL_VIDEO_OPENGL, 1, [ ])
2374 AC_DEFINE(SDL_VIDEO_OPENGL_GLX, 1, [ ])
2375 AC_DEFINE(SDL_VIDEO_RENDER_OGL, 1, [ ])
2376 SUMMARY_video="${SUMMARY_video} opengl"
2381 dnl Check to see if OpenGL ES support is desired
2382 AC_ARG_ENABLE(video-opengles,
2383 AC_HELP_STRING([--enable-video-opengles], [include OpenGL ES support [[default=yes]]]),
2384 , enable_video_opengles=yes)
2385 AC_ARG_ENABLE(video-opengles1,
2386 AC_HELP_STRING([--enable-video-opengles1], [include OpenGL ES 1.1 support [[default=yes]]]),
2387 , enable_video_opengles1=yes)
2388 AC_ARG_ENABLE(video-opengles2,
2389 AC_HELP_STRING([--enable-video-opengles2], [include OpenGL ES 2.0 support [[default=yes]]]),
2390 , enable_video_opengles2=yes)
2396 if test x$enable_video = xyes -a x$enable_video_opengles = xyes; then
2397 AC_MSG_CHECKING(for EGL support)
2402 #include <EGL/egl.h>
2403 #include <EGL/eglext.h>
2406 video_opengl_egl=yes
2408 AC_MSG_RESULT($video_opengl_egl)
2409 if test x$video_opengl_egl = xyes; then
2410 AC_DEFINE(SDL_VIDEO_OPENGL_EGL, 1, [ ])
2413 if test x$enable_video_opengles1 = xyes; then
2414 AC_MSG_CHECKING(for OpenGL ES v1 headers)
2415 video_opengles_v1=no
2417 #include <GLES/gl.h>
2418 #include <GLES/glext.h>
2421 video_opengles_v1=yes
2423 AC_MSG_RESULT($video_opengles_v1)
2424 if test x$video_opengles_v1 = xyes; then
2425 AC_DEFINE(SDL_VIDEO_OPENGL_ES, 1, [ ])
2426 AC_DEFINE(SDL_VIDEO_RENDER_OGL_ES, 1, [ ])
2427 SUMMARY_video="${SUMMARY_video} opengl_es1"
2431 if test x$enable_video_opengles2 = xyes; then
2432 AC_MSG_CHECKING(for OpenGL ES v2 headers)
2433 video_opengles_v2=no
2435 #include <GLES2/gl2.h>
2436 #include <GLES2/gl2ext.h>
2439 video_opengles_v2=yes
2441 AC_MSG_RESULT($video_opengles_v2)
2442 if test x$video_opengles_v2 = xyes; then
2443 AC_DEFINE(SDL_VIDEO_OPENGL_ES2, 1, [ ])
2444 AC_DEFINE(SDL_VIDEO_RENDER_OGL_ES2, 1, [ ])
2445 SUMMARY_video="${SUMMARY_video} opengl_es2"
2451 dnl Check for Windows OpenGL
2454 if test x$enable_video = xyes -a x$enable_video_opengl = xyes; then
2455 AC_DEFINE(SDL_VIDEO_OPENGL, 1, [ ])
2456 AC_DEFINE(SDL_VIDEO_OPENGL_WGL, 1, [ ])
2457 AC_DEFINE(SDL_VIDEO_RENDER_OGL, 1, [ ])
2458 SUMMARY_video="${SUMMARY_video} opengl"
2462 dnl Check for Windows OpenGL
2465 if test x$enable_video = xyes -a x$enable_video_opengles = xyes; then
2467 AC_MSG_CHECKING(for EGL support)
2470 #include <EGL/egl.h>
2473 video_opengl_egl=yes
2475 AC_MSG_RESULT($video_opengl_egl)
2476 if test x$video_opengl_egl = xyes; then
2477 AC_DEFINE(SDL_VIDEO_OPENGL, 1, [ ])
2478 AC_DEFINE(SDL_VIDEO_OPENGL_EGL, 1, [ ])
2479 SUMMARY_video="${SUMMARY_video} opengl_es1"
2482 AC_MSG_CHECKING(for OpenGL ES v2 headers)
2483 video_opengles_v2=no
2485 #include <GLES2/gl2.h>
2486 #include <GLES2/gl2ext.h>
2489 video_opengles_v2=yes
2491 AC_MSG_RESULT($video_opengles_v2)
2492 if test x$video_opengles_v2 = xyes; then
2493 AC_DEFINE(SDL_VIDEO_OPENGL, 1, [ ])
2494 AC_DEFINE(SDL_VIDEO_OPENGL_ES2, 1, [ ])
2495 AC_DEFINE(SDL_VIDEO_RENDER_OGL_ES2, 1, [ ])
2496 SUMMARY_video="${SUMMARY_video} opengl_es2"
2501 dnl Check for Haiku OpenGL
2504 if test x$enable_video = xyes -a x$enable_video_opengl = xyes; then
2505 AC_DEFINE(SDL_VIDEO_OPENGL, 1, [ ])
2506 AC_DEFINE(SDL_VIDEO_OPENGL_HAIKU, 1, [ ])
2507 AC_DEFINE(SDL_VIDEO_RENDER_OGL, 1, [ ])
2508 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lGL"
2509 SUMMARY_video="${SUMMARY_video} opengl"
2513 dnl Check for MacOS OpenGL
2516 if test x$enable_video = xyes -a x$enable_video_opengl = xyes; then
2517 AC_DEFINE(SDL_VIDEO_OPENGL, 1, [ ])
2518 AC_DEFINE(SDL_VIDEO_OPENGL_CGL, 1, [ ])
2519 AC_DEFINE(SDL_VIDEO_RENDER_OGL, 1, [ ])
2520 SUMMARY_video="${SUMMARY_video} opengl"
2524 CheckEmscriptenGLES()
2526 if test x$enable_video = xyes -a x$enable_video_opengles = xyes; then
2527 AC_MSG_CHECKING(for EGL support)
2530 #include <EGL/egl.h>
2533 video_opengl_egl=yes
2535 AC_MSG_RESULT($video_opengl_egl)
2536 if test x$video_opengl_egl = xyes; then
2537 AC_DEFINE(SDL_VIDEO_OPENGL_EGL, 1, [ ])
2540 AC_MSG_CHECKING(for OpenGL ES v2 headers)
2541 video_opengles_v2=no
2543 #include <GLES2/gl2.h>
2544 #include <GLES2/gl2ext.h>
2547 video_opengles_v2=yes
2549 AC_MSG_RESULT($video_opengles_v2)
2550 if test x$video_opengles_v2 = xyes; then
2551 AC_DEFINE(SDL_VIDEO_OPENGL_ES2, 1, [ ])
2552 AC_DEFINE(SDL_VIDEO_RENDER_OGL_ES2, 1, [ ])
2553 SUMMARY_video="${SUMMARY_video} opengl_es2"
2558 dnl Check to see if Vulkan support is desired
2559 AC_ARG_ENABLE(video-vulkan,
2560 AC_HELP_STRING([--enable-video-vulkan], [include Vulkan support [[default=yes]]]),
2561 , enable_video_vulkan=yes)
2563 dnl Find Vulkan Header
2566 if test x$enable_video = xyes -a x$enable_video_vulkan = xyes; then
2570 #if defined(__ARM_ARCH) && __ARM_ARCH < 7
2571 #error Vulkan doesn't work on this configuration
2576 enable_video_vulkan=no
2580 save_CFLAGS="$CFLAGS"
2581 dnl Work around that we don't have Objective-C support in autoconf
2582 CFLAGS="$CFLAGS -x objective-c"
2584 #include <Cocoa/Cocoa.h>
2585 #include <Metal/Metal.h>
2586 #include <QuartzCore/CAMetalLayer.h>
2588 #if !TARGET_CPU_X86_64
2589 #error Vulkan doesn't work on this configuration
2594 enable_video_vulkan=no
2596 CFLAGS="$save_CFLAGS"
2601 if test x$enable_video_vulkan = xno; then
2602 # For reasons I am totally unable to see, I get an undefined macro error if
2603 # I put this in the AC_TRY_COMPILE.
2604 AC_MSG_WARN([Vulkan does not work on this configuration.])
2607 if test x$enable_video_vulkan = xyes; then
2608 AC_DEFINE(SDL_VIDEO_VULKAN, 1, [ ])
2609 SUMMARY_video="${SUMMARY_video} vulkan"
2613 dnl See if we can use the new unified event interface in Linux 2.4
2616 dnl Check for Linux 2.4 unified input event interface support
2617 AC_MSG_CHECKING(for Linux 2.4 unified input interface)
2620 #include <linux/input.h>
2623 #error EVIOCGNAME() ioctl not available
2626 use_input_events=yes
2628 AC_MSG_RESULT($use_input_events)
2629 if test x$use_input_events = xyes; then
2630 AC_DEFINE(SDL_INPUT_LINUXEV, 1, [ ])
2631 SUMMARY_input="${SUMMARY_input} linuxev"
2635 dnl See if we can use the kernel kd.h header
2639 AC_MSG_CHECKING(for Linux kd.h)
2642 #include <linux/kd.h>
2643 #include <linux/keyboard.h>
2646 kbe.kb_table = KG_CTRL;
2647 ioctl(0, KDGKBENT, &kbe);
2651 AC_MSG_RESULT($use_input_kd)
2652 if test x$use_input_kd = xyes; then
2653 AC_DEFINE(SDL_INPUT_LINUXKD, 1, [ ])
2654 SUMMARY_input="${SUMMARY_input} linuxkd"
2658 dnl See if the platform offers libudev for device enumeration and hotplugging.
2661 AC_ARG_ENABLE(libudev,
2662 AC_HELP_STRING([--enable-libudev], [enable libudev support [[default=yes]]]),
2663 , enable_libudev=yes)
2664 if test x$enable_libudev = xyes; then
2665 AC_CHECK_HEADER(libudev.h,
2666 have_libudev_h_hdr=yes,
2667 have_libudev_h_hdr=no)
2668 if test x$have_libudev_h_hdr = xyes; then
2669 AC_DEFINE(HAVE_LIBUDEV_H, 1, [ ])
2671 udev_lib=[`find_lib "libudev.so.*" "" | sed 's/.*\/\(.*\)/\1/; q'`]
2672 if test x$udev_lib != x; then
2673 echo "-- dynamic udev -> $udev_lib"
2674 AC_DEFINE_UNQUOTED(SDL_UDEV_DYNAMIC, "$udev_lib", [ ])
2680 dnl See if the platform offers libdbus for various IPC techniques.
2684 AC_HELP_STRING([--enable-dbus], [enable D-Bus support [[default=yes]]]),
2686 if test x$enable_dbus = xyes; then
2687 AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
2688 if test x$PKG_CONFIG != xno; then
2689 DBUS_CFLAGS=`$PKG_CONFIG --cflags dbus-1`
2690 save_CFLAGS="$CFLAGS"
2691 CFLAGS="$save_CFLAGS $DBUS_CFLAGS"
2692 AC_CHECK_HEADER(dbus/dbus.h,
2693 have_dbus_dbus_h_hdr=yes,
2694 have_dbus_dbus_h_hdr=no)
2695 CFLAGS="$save_CFLAGS"
2696 if test x$have_dbus_dbus_h_hdr = xyes; then
2697 AC_DEFINE(HAVE_DBUS_DBUS_H, 1, [ ])
2698 EXTRA_CFLAGS="$EXTRA_CFLAGS $DBUS_CFLAGS"
2699 SOURCES="$SOURCES $srcdir/src/core/linux/SDL_dbus.c"
2705 dnl See if the platform wanna IME support.
2709 AC_HELP_STRING([--enable-ime], [enable IME support [[default=yes]]]),
2711 if test x$enable_ime = xyes; then
2712 AC_DEFINE(SDL_USE_IME, 1, [ ])
2713 SOURCES="$SOURCES $srcdir/src/core/linux/SDL_ime.c"
2717 dnl See if the platform has libibus IME support.
2721 AC_HELP_STRING([--enable-ibus], [enable IBus support [[default=yes]]]),
2723 if test x$enable_ibus = xyes; then
2724 AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
2725 if test x$PKG_CONFIG != xno; then
2726 IBUS_CFLAGS=`$PKG_CONFIG --cflags ibus-1.0`
2727 save_CFLAGS="$CFLAGS"
2728 CFLAGS="$save_CFLAGS $IBUS_CFLAGS"
2729 AC_CHECK_HEADER(ibus-1.0/ibus.h,
2730 have_ibus_ibus_h_hdr=yes,
2731 have_ibus_ibus_h_hdr=no)
2732 AC_CHECK_HEADER(sys/inotify.h,
2733 have_inotify_inotify_h_hdr=yes,
2734 have_inotify_inotify_h_hdr=no)
2735 CFLAGS="$save_CFLAGS"
2736 if test x$have_ibus_ibus_h_hdr = xyes; then
2737 if test x$enable_ime != xyes; then
2738 AC_MSG_WARN([IME support is required for IBus.])
2739 have_ibus_ibus_h_hdr=no
2740 elif test x$enable_dbus != xyes; then
2741 AC_MSG_WARN([DBus support is required for IBus.])
2742 have_ibus_ibus_h_hdr=no
2743 elif test x$have_inotify_inotify_h_hdr != xyes; then
2744 AC_MSG_WARN([INotify support is required for IBus.])
2745 have_ibus_ibus_h_hdr=no
2747 AC_DEFINE(HAVE_IBUS_IBUS_H, 1, [ ])
2748 EXTRA_CFLAGS="$EXTRA_CFLAGS $IBUS_CFLAGS"
2749 SOURCES="$SOURCES $srcdir/src/core/linux/SDL_ibus.c"
2756 dnl See if the platform has fcitx IME support.
2759 AC_ARG_ENABLE(fcitx,
2760 AC_HELP_STRING([--enable-fcitx], [enable fcitx support [[default=yes]]]),
2762 if test x$enable_fcitx = xyes; then
2763 AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
2764 if test x$PKG_CONFIG != xno; then
2765 FCITX_CFLAGS=`$PKG_CONFIG --cflags fcitx`
2766 CFLAGS="$CFLAGS $FCITX_CFLAGS"
2767 AC_CHECK_HEADER(fcitx/frontend.h,
2768 have_fcitx_frontend_h_hdr=yes,
2769 have_fcitx_frontend_h_hdr=no)
2770 CFLAGS="$save_CFLAGS"
2771 if test x$have_fcitx_frontend_h_hdr = xyes; then
2772 if test x$enable_ime != xyes; then
2773 AC_MSG_WARN([IME support is required for fcitx.])
2774 have_fcitx_frontend_h_hdr=no
2775 elif test x$enable_dbus != xyes; then
2776 AC_MSG_WARN([DBus support is required for fcitx.])
2777 have_fcitx_frontend_h_hdr=no
2779 AC_DEFINE(HAVE_FCITX_FRONTEND_H, 1, [ ])
2780 EXTRA_CFLAGS="$EXTRA_CFLAGS $FCITX_CFLAGS"
2781 SOURCES="$SOURCES $srcdir/src/core/linux/SDL_fcitx.c"
2788 dnl See if we can use the Touchscreen input library
2791 AC_ARG_ENABLE(input-tslib,
2792 AC_HELP_STRING([--enable-input-tslib], [use the Touchscreen library for input [[default=yes]]]),
2793 , enable_input_tslib=yes)
2794 if test x$enable_input_tslib = xyes; then
2795 AC_MSG_CHECKING(for Touchscreen library support)
2796 enable_input_tslib=no
2801 enable_input_tslib=yes
2803 AC_MSG_RESULT($enable_input_tslib)
2804 if test x$enable_input_tslib = xyes; then
2805 AC_DEFINE(SDL_INPUT_TSLIB, 1, [ ])
2806 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lts"
2807 SUMMARY_input="${SUMMARY_input} ts"
2812 dnl See what type of thread model to use on Linux and Solaris
2815 dnl Check for pthread support
2816 AC_ARG_ENABLE(pthreads,
2817 AC_HELP_STRING([--enable-pthreads], [use POSIX threads for multi-threading [[default=yes]]]),
2818 , enable_pthreads=yes)
2819 dnl This is used on Linux for glibc binary compatibility (Doh!)
2820 AC_ARG_ENABLE(pthread-sem,
2821 AC_HELP_STRING([--enable-pthread-sem], [use pthread semaphores [[default=yes]]]),
2822 , enable_pthread_sem=yes)
2825 pthread_cflags="-D_REENTRANT -D_THREAD_SAFE"
2828 *-*-linux*|*-*-uclinux*)
2829 pthread_cflags="-D_REENTRANT"
2830 pthread_lib="-lpthread"
2833 pthread_cflags="-D_REENTRANT -D_THREAD_SAFE"
2837 pthread_cflags="-D_THREAD_SAFE"
2838 # causes Carbon.p complaints?
2839 # pthread_cflags="-D_REENTRANT -D_THREAD_SAFE"
2841 *-*-freebsd*|*-*-dragonfly*)
2842 pthread_cflags="-D_REENTRANT -D_THREAD_SAFE"
2843 pthread_lib="-pthread"
2846 pthread_cflags="-D_REENTRANT -D_THREAD_SAFE"
2847 pthread_lib="-lpthread"
2850 pthread_cflags="-D_REENTRANT"
2851 pthread_lib="-pthread"
2854 # From Solaris 9+, posix4's preferred name is rt.
2855 pthread_cflags="-D_REENTRANT"
2856 pthread_lib="-lpthread -lrt"
2859 # Solaris 10+ merged pthread into libc.
2860 pthread_cflags="-D_REENTRANT"
2864 # Solaris 11+ merged rt into libc.
2865 pthread_cflags="-D_REENTRANT"
2869 pthread_cflags="-D_REENTRANT -Kthread"
2873 pthread_cflags="-D_REENTRANT -mthreads"
2874 pthread_lib="-lpthread"
2877 pthread_cflags="-D_REENTRANT"
2878 pthread_lib="-L/usr/lib -lpthread"
2881 pthread_cflags="-D_REENTRANT"
2885 pthread_cflags="-D_REENTRANT"
2889 pthread_cflags="-D_REENTRANT"
2890 pthread_lib="-lpthread"
2893 if test x$enable_threads = xyes -a x$enable_pthreads = xyes; then
2894 # Save the original compiler flags and libraries
2895 ac_save_cflags="$CFLAGS"; ac_save_libs="$LIBS"
2896 # Add the pthread compiler flags and libraries
2897 CFLAGS="$CFLAGS $pthread_cflags"; LIBS="$LIBS $pthread_lib"
2898 # Check to see if we have pthread support on this system
2899 AC_MSG_CHECKING(for pthreads)
2902 #include <pthread.h>
2904 pthread_attr_t type;
2905 pthread_attr_init(&type);
2909 AC_MSG_RESULT($use_pthreads)
2910 # Restore the compiler flags and libraries
2911 CFLAGS="$ac_save_cflags"; LIBS="$ac_save_libs"
2913 # Do futher testing if we have pthread support...
2914 if test x$use_pthreads = xyes; then
2915 AC_DEFINE(SDL_THREAD_PTHREAD, 1, [ ])
2916 EXTRA_CFLAGS="$EXTRA_CFLAGS $pthread_cflags"
2917 EXTRA_LDFLAGS="$EXTRA_LDFLAGS $pthread_lib"
2918 SDL_CFLAGS="$SDL_CFLAGS $pthread_cflags"
2920 # Save the original compiler flags and libraries
2921 ac_save_cflags="$CFLAGS"; ac_save_libs="$LIBS"
2922 # Add the pthread compiler flags and libraries
2923 CFLAGS="$CFLAGS $pthread_cflags"; LIBS="$LIBS $pthread_lib"
2925 # Check to see if recursive mutexes are available
2926 AC_MSG_CHECKING(for recursive mutexes)
2927 has_recursive_mutexes=no
2928 if test x$has_recursive_mutexes = xno; then
2930 #define _GNU_SOURCE 1
2931 #include <pthread.h>
2933 pthread_mutexattr_t attr;
2934 pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
2936 has_recursive_mutexes=yes
2937 AC_DEFINE(SDL_THREAD_PTHREAD_RECURSIVE_MUTEX, 1, [ ])
2940 if test x$has_recursive_mutexes = xno; then
2942 #define _GNU_SOURCE 1
2943 #include <pthread.h>
2945 pthread_mutexattr_t attr;
2946 pthread_mutexattr_setkind_np(&attr, PTHREAD_MUTEX_RECURSIVE_NP);
2948 has_recursive_mutexes=yes
2949 AC_DEFINE(SDL_THREAD_PTHREAD_RECURSIVE_MUTEX_NP, 1, [ ])
2952 AC_MSG_RESULT($has_recursive_mutexes)
2954 # Check to see if pthread semaphore support is missing
2955 if test x$enable_pthread_sem = xyes; then
2956 AC_MSG_CHECKING(for pthread semaphores)
2959 #include <pthread.h>
2960 #include <semaphore.h>
2963 have_pthread_sem=yes
2965 AC_MSG_RESULT($have_pthread_sem)
2967 if test x$have_pthread_sem = xyes; then
2968 AC_MSG_CHECKING(for sem_timedwait)
2969 have_sem_timedwait=no
2971 #include <pthread.h>
2972 #include <semaphore.h>
2974 sem_timedwait(NULL, NULL);
2976 have_sem_timedwait=yes
2977 AC_DEFINE([HAVE_SEM_TIMEDWAIT], 1, [ ])
2979 AC_MSG_RESULT($have_sem_timedwait)
2982 AC_CHECK_HEADER(pthread_np.h, have_pthread_np_h=yes, have_pthread_np_h=no, [ #include <pthread.h> ])
2983 if test x$have_pthread_np_h = xyes; then
2984 AC_DEFINE(HAVE_PTHREAD_NP_H, 1, [ ])
2987 # Check to see if pthread naming is available
2988 AC_MSG_CHECKING(for pthread_setname_np)
2989 AC_TRY_LINK_FUNC(pthread_setname_np, [
2990 has_pthread_setname_np=yes
2991 AC_DEFINE(HAVE_PTHREAD_SETNAME_NP, 1, [ ])
2993 has_pthread_setname_np=no
2995 AC_MSG_RESULT($has_pthread_setname_np)
2997 AC_MSG_CHECKING(for pthread_set_name_np)
2998 AC_TRY_LINK_FUNC(pthread_set_name_np, [
2999 has_pthread_set_name_np=yes
3000 AC_DEFINE(HAVE_PTHREAD_SET_NAME_NP, 1, [ ])
3002 has_pthread_set_name_np=no
3004 AC_MSG_RESULT($has_pthread_set_name_np)
3006 # Restore the compiler flags and libraries
3007 CFLAGS="$ac_save_cflags"; LIBS="$ac_save_libs"
3009 # Basic thread creation functions
3010 SOURCES="$SOURCES $srcdir/src/thread/pthread/SDL_systhread.c"
3013 # We can fake these with mutexes and condition variables if necessary
3014 if test x$have_pthread_sem = xyes; then
3015 SOURCES="$SOURCES $srcdir/src/thread/pthread/SDL_syssem.c"
3017 SOURCES="$SOURCES $srcdir/src/thread/generic/SDL_syssem.c"
3021 # We can fake these with semaphores if necessary
3022 SOURCES="$SOURCES $srcdir/src/thread/pthread/SDL_sysmutex.c"
3024 # Condition variables
3025 # We can fake these with semaphores and mutexes if necessary
3026 SOURCES="$SOURCES $srcdir/src/thread/pthread/SDL_syscond.c"
3028 # Thread local storage
3029 SOURCES="$SOURCES $srcdir/src/thread/pthread/SDL_systls.c"
3036 dnl Determine whether the compiler can produce Windows executables
3039 AC_MSG_CHECKING(Windows compiler)
3042 #include <windows.h>
3047 AC_MSG_RESULT($have_win32_gcc)
3048 if test x$have_win32_gcc != xyes; then
3050 *** Your compiler ($CC) does not produce Windows executables!
3054 AC_MSG_CHECKING(Windows CE)
3057 #if !defined(_WIN32_WCE) && !defined(__MINGW32CE__)
3058 #error This is not Windows CE
3064 *** Sorry, Windows CE is no longer supported.
3067 AC_MSG_RESULT($have_wince)
3069 # This fixes Windows stack alignment with newer GCC
3073 dnl Find the DirectX includes and libraries
3076 AC_ARG_ENABLE(directx,
3077 AC_HELP_STRING([--enable-directx], [use DirectX for Windows audio/video [[default=yes]]]),
3078 , enable_directx=yes)
3079 if test x$enable_directx = xyes; then
3080 AC_CHECK_HEADER(d3d9.h, have_d3d=yes)
3081 AC_CHECK_HEADER(d3d11_1.h, have_d3d11=yes)
3082 AC_CHECK_HEADER(ddraw.h, have_ddraw=yes)
3083 AC_CHECK_HEADER(dsound.h, have_dsound=yes)
3084 AC_CHECK_HEADER(dinput.h, have_dinput=yes)
3085 AC_CHECK_HEADER(dxgi.h, have_dxgi=yes)
3086 AC_CHECK_HEADER(xinput.h, have_xinput=yes)
3087 AC_CHECK_HEADER(mmdeviceapi.h, have_wasapi=yes)
3088 AC_CHECK_HEADER(audioclient.h,,have_wasapi=no)
3090 #include <windows.h>
3092 XINPUT_GAMEPAD_EX x1;
3093 ],[],[have_xinput_gamepadex=yes])
3095 #include <windows.h>
3098 ],[],[have_xinput_stateex=yes])
3100 if test x$have_ddraw = xyes; then
3101 AC_DEFINE(HAVE_DDRAW_H, 1, [ ])
3103 if test x$have_dinput = xyes; then
3104 AC_DEFINE(HAVE_DINPUT_H, 1, [ ])
3106 if test x$have_dsound = xyes; then
3107 AC_DEFINE(HAVE_DSOUND_H, 1, [ ])
3109 if test x$have_dxgi = xyes; then
3110 AC_DEFINE(HAVE_DXGI_H, 1, [ ])
3112 if test x$have_xinput = xyes; then
3113 AC_DEFINE(HAVE_XINPUT_H, 1, [ ])
3115 if test x$have_xinput_gamepadex = xyes; then
3116 AC_DEFINE(HAVE_XINPUT_GAMEPAD_EX, 1, [ ])
3118 if test x$have_xinput_stateex = xyes; then
3119 AC_DEFINE(HAVE_XINPUT_STATE_EX, 1, [ ])
3122 SUMMARY_video="${SUMMARY_video} directx"
3123 SUMMARY_audio="${SUMMARY_audio} directx"
3125 # FIXME: latest Cygwin finds dinput headers, but we die on other win32 headers.
3126 # FIXME: ...so force it off for now.
3135 dnl Check for the dlfcn.h interface for dynamically loading objects
3138 AC_ARG_ENABLE(sdl-dlopen,
3139 AC_HELP_STRING([--enable-sdl-dlopen], [use dlopen for shared object loading [[default=yes]]]),
3140 , enable_sdl_dlopen=yes)
3141 if test x$enable_sdl_dlopen = xyes; then
3142 AC_MSG_CHECKING(for dlopen)
3147 void *handle = dlopen("", RTLD_NOW);
3148 const char *loaderror = (char *) dlerror();
3152 AC_MSG_RESULT($have_dlopen)
3154 if test x$have_dlopen = xyes; then
3155 AC_CHECK_LIB(c, dlopen, EXTRA_LDFLAGS="$EXTRA_LDFLAGS",
3156 AC_CHECK_LIB(dl, dlopen, EXTRA_LDFLAGS="$EXTRA_LDFLAGS -ldl",
3157 AC_CHECK_LIB(ltdl, dlopen, EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lltdl")))
3158 AC_DEFINE(SDL_LOADSO_DLOPEN, 1, [ ])
3159 SOURCES="$SOURCES $srcdir/src/loadso/dlopen/*.c"
3165 dnl Check for the usbhid(3) library on *BSD
3170 if test x$enable_joystick = xyes; then
3171 AC_CHECK_LIB(usbhid, hid_init, have_libusbhid=yes)
3172 if test x$have_libusbhid = xyes; then
3173 AC_CHECK_HEADER(usbhid.h, [USB_CFLAGS="-DHAVE_USBHID_H"])
3174 AC_CHECK_HEADER(libusbhid.h, [USB_CFLAGS="-DHAVE_LIBUSBHID_H"])
3175 USB_LIBS="$USB_LIBS -lusbhid"
3177 AC_CHECK_HEADER(usb.h, [USB_CFLAGS="-DHAVE_USB_H"])
3178 AC_CHECK_HEADER(libusb.h, [USB_CFLAGS="-DHAVE_LIBUSB_H"])
3179 AC_CHECK_LIB(usb, hid_init, [USB_LIBS="$USB_LIBS -lusb"])
3182 save_CFLAGS="$CFLAGS"
3183 CFLAGS="$CFLAGS $USB_CFLAGS"
3185 AC_MSG_CHECKING(for usbhid)
3188 #include <sys/types.h>
3189 #if defined(HAVE_USB_H)
3192 #ifdef __DragonFly__
3193 # include <bus/usb/usb.h>
3194 # include <bus/usb/usbhid.h>
3196 # include <dev/usb/usb.h>
3197 # include <dev/usb/usbhid.h>
3199 #if defined(HAVE_USBHID_H)
3201 #elif defined(HAVE_LIBUSB_H)
3203 #elif defined(HAVE_LIBUSBHID_H)
3204 #include <libusbhid.h>
3207 struct report_desc *repdesc;
3208 struct usb_ctl_report *repbuf;
3213 AC_MSG_RESULT($have_usbhid)
3215 if test x$have_usbhid = xyes; then
3216 AC_MSG_CHECKING(for ucr_data member of usb_ctl_report)
3217 have_usbhid_ucr_data=no
3219 #include <sys/types.h>
3220 #if defined(HAVE_USB_H)
3223 #ifdef __DragonFly__
3224 # include <bus/usb/usb.h>
3225 # include <bus/usb/usbhid.h>
3227 # include <dev/usb/usb.h>
3228 # include <dev/usb/usbhid.h>
3230 #if defined(HAVE_USBHID_H)
3232 #elif defined(HAVE_LIBUSB_H)
3234 #elif defined(HAVE_LIBUSBHID_H)
3235 #include <libusbhid.h>
3238 struct usb_ctl_report buf;
3239 if (buf.ucr_data) { }
3241 have_usbhid_ucr_data=yes
3243 if test x$have_usbhid_ucr_data = xyes; then
3244 USB_CFLAGS="$USB_CFLAGS -DUSBHID_UCR_DATA"
3246 AC_MSG_RESULT($have_usbhid_ucr_data)
3248 AC_MSG_CHECKING(for new usbhid API)
3251 #include <sys/types.h>
3252 #if defined(HAVE_USB_H)
3255 #ifdef __DragonFly__
3256 #include <bus/usb/usb.h>
3257 #include <bus/usb/usbhid.h>
3259 #include <dev/usb/usb.h>
3260 #include <dev/usb/usbhid.h>
3262 #if defined(HAVE_USBHID_H)
3264 #elif defined(HAVE_LIBUSB_H)
3266 #elif defined(HAVE_LIBUSBHID_H)
3267 #include <libusbhid.h>
3271 hid_start_parse(d, 1, 1);
3275 if test x$have_usbhid_new = xyes; then
3276 USB_CFLAGS="$USB_CFLAGS -DUSBHID_NEW"
3278 AC_MSG_RESULT($have_usbhid_new)
3280 AC_MSG_CHECKING(for struct joystick in machine/joystick.h)
3281 have_machine_joystick=no
3283 #include <machine/joystick.h>
3287 have_machine_joystick=yes
3289 if test x$have_machine_joystick = xyes; then
3290 AC_DEFINE(SDL_JOYSTICK_USBHID_MACHINE_JOYSTICK_H, 1, [ ])
3292 AC_MSG_RESULT($have_machine_joystick)
3294 AC_DEFINE(SDL_JOYSTICK_USBHID, 1, [ ])
3295 SOURCES="$SOURCES $srcdir/src/joystick/bsd/*.c"
3296 EXTRA_CFLAGS="$EXTRA_CFLAGS $USB_CFLAGS"
3297 EXTRA_LDFLAGS="$EXTRA_LDFLAGS $USB_LIBS"
3300 CFLAGS="$save_CFLAGS"
3306 dnl Check for clock_gettime()
3309 AC_ARG_ENABLE(clock_gettime,
3310 AC_HELP_STRING([--enable-clock_gettime], [use clock_gettime() instead of gettimeofday() on UNIX [[default=yes]]]),
3311 , enable_clock_gettime=yes)
3312 if test x$enable_clock_gettime = xyes; then
3313 AC_CHECK_LIB(rt, clock_gettime, have_clock_gettime=yes)
3314 if test x$have_clock_gettime = xyes; then
3315 AC_DEFINE(HAVE_CLOCK_GETTIME, 1, [ ])
3316 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lrt"
3318 AC_CHECK_LIB(c, clock_gettime, have_clock_gettime=yes)
3319 if test x$have_clock_gettime = xyes; then
3320 AC_DEFINE(HAVE_CLOCK_GETTIME, 1, [ ])
3321 EXTRA_LDFLAGS="$EXTRA_LDFLAGS"
3327 dnl Check for a valid linux/version.h
3330 AC_CHECK_HEADER(linux/version.h, have_linux_version_h=yes)
3331 if test x$have_linux_version_h = xyes; then
3332 EXTRA_CFLAGS="$EXTRA_CFLAGS -DHAVE_LINUX_VERSION_H"
3336 dnl Check if we want to use RPATH
3339 AC_ARG_ENABLE(rpath,
3340 AC_HELP_STRING([--enable-rpath], [use an rpath when linking SDL [[default=yes]]]),
3344 dnl Do this on all platforms, before everything else (other things might want to override it).
3347 dnl Set up the configuration based on the host platform!
3349 *-*-linux*|*-*-uclinux*|*-*-gnu*|*-*-k*bsd*-gnu|*-*-bsdi*|*-*-freebsd*|*-*-dragonfly*|*-*-netbsd*|*-*-openbsd*|*-*-sysv5*|*-*-solaris*|*-*-hpux*|*-*-aix*|*-*-minix*|*-*-nto*)
3354 ANDROID_CFLAGS="-DGL_GLEXT_PROTOTYPES"
3355 CFLAGS="$CFLAGS $ANDROID_CFLAGS"
3356 SDL_CFLAGS="$SDL_CFLAGS $ANDROID_CFLAGS"
3357 EXTRA_CFLAGS="$EXTRA_CFLAGS $ANDROID_CFLAGS"
3358 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -ldl -lGLESv1_CM -lGLESv2 -llog -landroid"
3359 SDLMAIN_SOURCES="$srcdir/src/main/android/*.c"
3361 if test x$enable_video = xyes; then
3362 SOURCES="$SOURCES $srcdir/src/core/android/*.c $srcdir/src/video/android/*.c"
3363 # FIXME: confdefs? Not AC_DEFINE?
3364 $as_echo "#define SDL_VIDEO_DRIVER_ANDROID 1" >>confdefs.h
3365 SUMMARY_video="${SUMMARY_video} android"
3368 *-*-linux*) ARCH=linux ;;
3369 *-*-uclinux*) ARCH=linux ;;
3370 *-*-kfreebsd*-gnu) ARCH=kfreebsd-gnu ;;
3371 *-*-knetbsd*-gnu) ARCH=knetbsd-gnu ;;
3372 *-*-kopenbsd*-gnu) ARCH=kopenbsd-gnu ;;
3373 *-*-gnu*) ARCH=gnu ;; # must be last of the gnu variants
3374 *-*-bsdi*) ARCH=bsdi ;;
3375 *-*-freebsd*) ARCH=freebsd ;;
3376 *-*-dragonfly*) ARCH=freebsd ;;
3377 *-*-netbsd*) ARCH=netbsd ;;
3378 *-*-openbsd*) ARCH=openbsd ;;
3379 *-*-sysv5*) ARCH=sysv5 ;;
3380 *-*-solaris*) ARCH=solaris ;;
3381 *-*-hpux*) ARCH=hpux ;;
3382 *-*-aix*) ARCH=aix ;;
3383 *-*-minix*) ARCH=minix ;;
3388 CheckVisibilityHidden
3389 CheckDeclarationAfterStatement
3404 # Need to check for Raspberry PI first and add platform specific compiler flags, otherwise the test for GLES fails!
3434 # Set up files for the audio library
3435 if test x$enable_audio = xyes; then
3438 AC_DEFINE(SDL_AUDIO_DRIVER_SUNAUDIO, 1, [ ])
3439 SOURCES="$SOURCES $srcdir/src/audio/sun/*.c"
3440 SUMMARY_audio="${SUMMARY_audio} sun"
3443 netbsd) # Don't use this on OpenBSD, it's busted.
3444 AC_DEFINE(SDL_AUDIO_DRIVER_NETBSD, 1, [ ])
3445 SOURCES="$SOURCES $srcdir/src/audio/netbsd/*.c"
3446 SUMMARY_audio="${SUMMARY_audio} netbsd"
3450 AC_DEFINE(SDL_AUDIO_DRIVER_PAUDIO, 1, [ ])
3451 SOURCES="$SOURCES $srcdir/src/audio/paudio/*.c"
3452 SUMMARY_audio="${SUMMARY_audio} paudio"
3456 AC_DEFINE(SDL_AUDIO_DRIVER_ANDROID, 1, [ ])
3457 SOURCES="$SOURCES $srcdir/src/audio/android/*.c"
3458 SUMMARY_audio="${SUMMARY_audio} android"
3466 # Set up files for the joystick library
3467 if test x$enable_joystick = xyes; then
3470 AC_DEFINE(SDL_JOYSTICK_LINUX, 1, [ ])
3471 SOURCES="$SOURCES $srcdir/src/joystick/linux/*.c"
3472 SOURCES="$SOURCES $srcdir/src/joystick/steam/*.c"
3476 AC_DEFINE(SDL_JOYSTICK_ANDROID, 1, [ ])
3477 SOURCES="$SOURCES $srcdir/src/joystick/android/*.c"
3478 SOURCES="$SOURCES $srcdir/src/joystick/steam/*.c"
3483 # Set up files for the haptic library
3484 if test x$enable_haptic = xyes; then
3487 if test x$use_input_events = xyes; then
3488 AC_DEFINE(SDL_HAPTIC_LINUX, 1, [ ])
3489 SOURCES="$SOURCES $srcdir/src/haptic/linux/*.c"
3494 AC_DEFINE(SDL_HAPTIC_ANDROID, 1, [ ])
3495 SOURCES="$SOURCES $srcdir/src/haptic/android/*.c"
3500 # Set up files for the power library
3501 if test x$enable_power = xyes; then
3504 AC_DEFINE(SDL_POWER_LINUX, 1, [ ])
3505 SOURCES="$SOURCES $srcdir/src/power/linux/*.c"
3509 AC_DEFINE(SDL_POWER_ANDROID, 1, [ ])
3510 SOURCES="$SOURCES $srcdir/src/power/android/*.c"
3515 # Set up files for the filesystem library
3516 if test x$enable_filesystem = xyes; then
3519 AC_DEFINE(SDL_FILESYSTEM_ANDROID, 1, [ ])
3520 SOURCES="$SOURCES $srcdir/src/filesystem/android/*.c"
3524 AC_DEFINE(SDL_FILESYSTEM_UNIX, 1, [ ])
3525 SOURCES="$SOURCES $srcdir/src/filesystem/unix/*.c"
3530 # Set up files for the timer library
3531 if test x$enable_timers = xyes; then
3532 AC_DEFINE(SDL_TIMER_UNIX, 1, [ ])
3533 SOURCES="$SOURCES $srcdir/src/timer/unix/*.c"
3536 # Set up files for udev hotplugging support
3537 if test x$enable_libudev = xyes && test x$have_libudev_h_hdr = xyes; then
3538 SOURCES="$SOURCES $srcdir/src/core/linux/SDL_udev.c"
3540 # Set up files for evdev input
3541 if test x$use_input_events = xyes; then
3542 SOURCES="$SOURCES $srcdir/src/core/linux/SDL_evdev*.c"
3544 # Set up other core UNIX files
3545 SOURCES="$SOURCES $srcdir/src/core/unix/*.c"
3547 *-*-cygwin* | *-*-mingw32*)
3549 if test "$build" != "$host"; then # cross-compiling
3550 # Default cross-compile location
3551 ac_default_prefix=/usr/local/cross-tools/$host
3553 # Look for the location of the tools and install there
3554 if test "$BUILD_PREFIX" != ""; then
3555 ac_default_prefix=$BUILD_PREFIX
3558 CheckDeclarationAfterStatement
3568 # Set up the core platform files
3569 SOURCES="$SOURCES $srcdir/src/core/windows/*.c"
3571 # Set up files for the video library
3572 if test x$enable_video = xyes; then
3573 AC_DEFINE(SDL_VIDEO_DRIVER_WINDOWS, 1, [ ])
3574 SOURCES="$SOURCES $srcdir/src/video/windows/*.c"
3576 AC_ARG_ENABLE(render-d3d,
3577 AC_HELP_STRING([--enable-render-d3d], [enable the Direct3D render driver [[default=yes]]]),
3578 , enable_render_d3d=yes)
3579 if test x$enable_render_d3d = xyes -a x$have_d3d = xyes; then
3580 AC_DEFINE(SDL_VIDEO_RENDER_D3D, 1, [ ])
3582 if test x$enable_render_d3d = xyes -a x$have_d3d11 = xyes; then
3583 AC_DEFINE(SDL_VIDEO_RENDER_D3D11, 1, [ ])
3586 # Set up files for the audio library
3587 if test x$enable_audio = xyes; then
3588 AC_DEFINE(SDL_AUDIO_DRIVER_WINMM, 1, [ ])
3589 SOURCES="$SOURCES $srcdir/src/audio/winmm/*.c"
3590 if test x$have_dsound = xyes; then
3591 AC_DEFINE(SDL_AUDIO_DRIVER_DSOUND, 1, [ ])
3592 SOURCES="$SOURCES $srcdir/src/audio/directsound/*.c"
3594 if test x$have_wasapi = xyes; then
3595 AC_DEFINE(SDL_AUDIO_DRIVER_WASAPI, 1, [ ])
3596 SOURCES="$SOURCES $srcdir/src/audio/wasapi/*.c"
3600 # Set up files for the joystick library
3601 if test x$enable_joystick = xyes; then
3602 if test x$have_dinput = xyes -o x$have_xinput = xyes; then
3603 if test x$have_xinput = xyes; then
3604 AC_DEFINE(SDL_JOYSTICK_XINPUT, 1, [ ])
3606 if test x$have_dinput = xyes; then
3607 AC_DEFINE(SDL_JOYSTICK_DINPUT, 1, [ ])
3608 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -ldinput8 -ldxguid -ldxerr8"
3611 AC_DEFINE(SDL_JOYSTICK_WINMM, 1, [ ])
3613 SOURCES="$SOURCES $srcdir/src/joystick/windows/*.c"
3616 if test x$enable_haptic = xyes; then
3617 if test x$have_dinput = xyes -o x$have_xinput = xyes; then
3618 if test x$have_xinput = xyes; then
3619 AC_DEFINE(SDL_HAPTIC_XINPUT, 1, [ ])
3621 if test x$have_dinput = xyes; then
3622 AC_DEFINE(SDL_HAPTIC_DINPUT, 1, [ ])
3624 SOURCES="$SOURCES $srcdir/src/haptic/windows/*.c"
3628 if test x$enable_power = xyes; then
3629 AC_DEFINE(SDL_POWER_WINDOWS, 1, [ ])
3630 SOURCES="$SOURCES $srcdir/src/power/windows/SDL_syspower.c"
3633 if test x$enable_filesystem = xyes; then
3634 AC_DEFINE(SDL_FILESYSTEM_WINDOWS, 1, [ ])
3635 SOURCES="$SOURCES $srcdir/src/filesystem/windows/SDL_sysfilesystem.c"
3638 # Set up files for the thread library
3639 if test x$enable_threads = xyes; then
3640 AC_DEFINE(SDL_THREAD_WINDOWS, 1, [ ])
3641 SOURCES="$SOURCES $srcdir/src/thread/windows/*.c"
3642 SOURCES="$SOURCES $srcdir/src/thread/generic/SDL_syscond.c"
3645 # Set up files for the timer library
3646 if test x$enable_timers = xyes; then
3647 AC_DEFINE(SDL_TIMER_WINDOWS, 1, [ ])
3648 SOURCES="$SOURCES $srcdir/src/timer/windows/*.c"
3651 # Set up files for the shared object loading library
3652 if test x$enable_loadso = xyes; then
3653 AC_DEFINE(SDL_LOADSO_WINDOWS, 1, [ ])
3654 SOURCES="$SOURCES $srcdir/src/loadso/windows/*.c"
3657 # Set up the system libraries we need
3658 if test -f /lib/w32api/libuuid.a; then
3659 LIBUUID=/lib/w32api/libuuid.a
3663 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -luser32 -lgdi32 -lwinmm -limm32 -lole32 -loleaut32 -lshell32 -lversion $LIBUUID -static-libgcc"
3664 # The Windows platform requires special setup
3665 VERSION_SOURCES="$srcdir/src/main/windows/*.rc"
3666 SDLMAIN_SOURCES="$srcdir/src/main/windows/*.c"
3667 SDL_CFLAGS="$SDL_CFLAGS -Dmain=SDL_main"
3668 SDL_LIBS="-lSDL2main $SDL_LIBS -mwindows"
3670 # Check to see if this is a mingw or cygwin build
3672 AC_CHECK_LIB(mingw32, main, [have_mingw32=yes])
3673 if test x$have_mingw32 = xyes; then
3674 SDL_LIBS="-lmingw32 $SDL_LIBS"
3676 SDL_LIBS="-lcygwin $SDL_LIBS"
3680 dnl BeOS support removed after SDL 2.0.1. Haiku still works. --ryan.
3683 *** BeOS support has been removed as of SDL 2.0.2.
3689 ac_default_prefix=/boot/system
3698 # Set up files for the audio library
3699 if test x$enable_audio = xyes; then
3700 AC_DEFINE(SDL_AUDIO_DRIVER_HAIKU, 1, [ ])
3701 SOURCES="$SOURCES $srcdir/src/audio/haiku/*.cc"
3702 SUMMARY_audio="${SUMMARY_audio} haiku"
3705 # Set up files for the joystick library
3706 if test x$enable_joystick = xyes; then
3707 AC_DEFINE(SDL_JOYSTICK_HAIKU, 1, [ ])
3708 SOURCES="$SOURCES $srcdir/src/joystick/haiku/*.cc"
3711 # Set up files for the timer library
3712 if test x$enable_timers = xyes; then
3713 AC_DEFINE(SDL_TIMER_HAIKU, 1, [ ])
3714 SOURCES="$SOURCES $srcdir/src/timer/haiku/*.c"
3717 # Set up files for the system power library
3718 if test x$enable_power = xyes; then
3719 AC_DEFINE(SDL_POWER_HAIKU, 1, [ ])
3720 SOURCES="$SOURCES $srcdir/src/power/haiku/*.c"
3723 # Set up files for the system filesystem library
3724 if test x$enable_filesystem = xyes; then
3725 AC_DEFINE(SDL_FILESYSTEM_HAIKU, 1, [ ])
3726 SOURCES="$SOURCES $srcdir/src/filesystem/haiku/*.cc"
3729 # The Haiku platform requires special setup.
3730 SOURCES="$srcdir/src/main/haiku/*.cc $SOURCES"
3731 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lroot -lbe -lmedia -lgame -ldevice -ltextencoding"
3732 # Haiku's x86 spins use libstdc++.r4.so (for binary compat?), but
3733 # other spins, like x86-64, use a more standard "libstdc++.so.*"
3734 AC_CHECK_FILE("/boot/system/lib/libstdc++.r4.so", EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lstdc++.r4", EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lstdc++")
3736 arm*-apple-darwin*|*-ios-*)
3739 CheckVisibilityHidden
3740 CheckDeclarationAfterStatement
3749 # Set up files for the audio library
3750 if test x$enable_audio = xyes; then
3751 AC_DEFINE(SDL_AUDIO_DRIVER_COREAUDIO, 1, [ ])
3752 SOURCES="$SOURCES $srcdir/src/audio/coreaudio/*.m"
3753 SUMMARY_audio="${SUMMARY_audio} coreaudio"
3756 # Set up files for the joystick library
3757 if test x$enable_joystick = xyes; then
3758 AC_DEFINE(SDL_JOYSTICK_MFI, 1, [ ])
3759 SOURCES="$SOURCES $srcdir/src/joystick/iphoneos/*.m"
3760 SOURCES="$SOURCES $srcdir/src/joystick/steam/*.c"
3763 # Set up files for the haptic library
3764 #if test x$enable_haptic = xyes; then
3765 # SOURCES="$SOURCES $srcdir/src/haptic/darwin/*.c"
3767 # EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,ForceFeedback"
3769 # Set up files for the power library
3770 if test x$enable_power = xyes; then
3771 AC_DEFINE(SDL_POWER_UIKIT, 1, [ ])
3772 SOURCES="$SOURCES $srcdir/src/power/uikit/*.m"
3775 # Set up files for the filesystem library
3776 if test x$enable_filesystem = xyes; then
3777 SOURCES="$SOURCES $srcdir/src/filesystem/cocoa/*.m"
3780 # Set up additional files for the file library
3781 if test x$enable_file = xyes; then
3782 AC_DEFINE(SDL_FILESYSTEM_COCOA, 1, [ ])
3783 SOURCES="$SOURCES $srcdir/src/file/cocoa/*.m"
3785 # Set up files for the timer library
3786 if test x$enable_timers = xyes; then
3787 AC_DEFINE(SDL_TIMER_UNIX, 1, [ ])
3788 SOURCES="$SOURCES $srcdir/src/timer/unix/*.c"
3791 # Set up other core UNIX files
3792 SOURCES="$SOURCES $srcdir/src/core/unix/*.c"
3793 # The iOS platform requires special setup.
3794 AC_DEFINE(SDL_VIDEO_DRIVER_UIKIT, 1, [ ])
3795 AC_DEFINE(SDL_VIDEO_OPENGL_ES2, 1, [ ])
3796 AC_DEFINE(SDL_VIDEO_OPENGL_ES, 1, [ ])
3797 AC_DEFINE(SDL_VIDEO_RENDER_OGL_ES, 1, [ ])
3798 AC_DEFINE(SDL_VIDEO_RENDER_OGL_ES2, 1, [ ])
3799 SOURCES="$SOURCES $srcdir/src/video/uikit/*.m"
3800 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lm -liconv -lobjc"
3801 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,AVFoundation"
3802 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,AudioToolbox"
3803 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,CoreAudio"
3804 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,CoreGraphics"
3805 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,CoreMotion"
3806 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,Foundation"
3807 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,GameController"
3808 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,OpenGLES"
3809 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,QuartzCore"
3810 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,UIKit"
3812 if test x$enable_render = xyes -a x$enable_render_metal = xyes; then
3813 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,Metal"
3817 # This could be either full "Mac OS X", or plain "Darwin" which is
3818 # just the OS X kernel sans upper layers like Carbon and Cocoa.
3819 # Next line is broken, and a few files below require Mac OS X (full)
3822 # Mac OS X builds with both the Carbon and OSX APIs at the moment
3823 EXTRA_CFLAGS="$EXTRA_CFLAGS -DTARGET_API_MAC_CARBON"
3824 EXTRA_CFLAGS="$EXTRA_CFLAGS -DTARGET_API_MAC_OSX"
3826 CheckVisibilityHidden
3827 CheckDeclarationAfterStatement
3840 # Set up files for the audio library
3841 if test x$enable_audio = xyes; then
3842 AC_DEFINE(SDL_AUDIO_DRIVER_COREAUDIO, 1, [ ])
3843 SOURCES="$SOURCES $srcdir/src/audio/coreaudio/*.m"
3844 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,CoreAudio -Wl,-framework,AudioToolbox"
3845 SUMMARY_audio="${SUMMARY_audio} coreaudio"
3848 # Set up files for the joystick library
3849 if test x$enable_joystick = xyes; then
3850 AC_DEFINE(SDL_JOYSTICK_IOKIT, 1, [ ])
3851 SOURCES="$SOURCES $srcdir/src/joystick/darwin/*.c"
3854 # Set up files for the haptic library
3855 if test x$enable_haptic = xyes; then
3856 AC_DEFINE(SDL_HAPTIC_IOKIT, 1, [ ])
3857 SOURCES="$SOURCES $srcdir/src/haptic/darwin/*.c"
3858 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,ForceFeedback"
3861 # Set up files for the power library
3862 if test x$enable_power = xyes; then
3863 AC_DEFINE(SDL_POWER_MACOSX, 1, [ ])
3864 SOURCES="$SOURCES $srcdir/src/power/macosx/*.c"
3867 # Set up files for the filesystem library
3868 if test x$enable_filesystem = xyes; then
3869 AC_DEFINE(SDL_FILESYSTEM_COCOA, 1, [ ])
3870 SOURCES="$SOURCES $srcdir/src/filesystem/cocoa/*.m"
3873 # Set up files for the timer library
3874 if test x$enable_timers = xyes; then
3875 AC_DEFINE(SDL_TIMER_UNIX, 1, [ ])
3876 SOURCES="$SOURCES $srcdir/src/timer/unix/*.c"
3879 # Set up additional files for the file library
3880 if test x$enable_file = xyes; then
3881 SOURCES="$SOURCES $srcdir/src/file/cocoa/*.m"
3883 # Set up other core UNIX files
3884 SOURCES="$SOURCES $srcdir/src/core/unix/*.c"
3885 # The Mac OS X platform requires special setup.
3886 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lobjc"
3887 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,CoreVideo"
3888 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,Cocoa"
3889 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,Carbon"
3890 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,IOKit"
3892 if test x$enable_render = xyes -a x$enable_render_metal = xyes; then
3893 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-weak_framework,QuartzCore -Wl,-weak_framework,Metal"
3904 # Set up files for the timer library
3905 if test x$enable_timers = xyes; then
3906 AC_DEFINE(SDL_TIMER_UNIX, 1, [ ])
3907 SOURCES="$SOURCES $srcdir/src/timer/unix/*.c"
3911 if test x$enable_filesystem = xyes; then
3912 AC_DEFINE(SDL_FILESYSTEM_NACL, 1, [ ])
3913 SOURCES="$SOURCES $srcdir/src/filesystem/nacl/*.c"
3918 if test x$enable_video = xyes; then
3919 AC_DEFINE(SDL_VIDEO_DRIVER_EMSCRIPTEN, 1, [ ])
3920 SOURCES="$SOURCES $srcdir/src/video/emscripten/*.c"
3922 SUMMARY_video="${SUMMARY_video} emscripten"
3925 if test x$enable_audio = xyes; then
3926 AC_DEFINE(SDL_AUDIO_DRIVER_EMSCRIPTEN, 1, [ ])
3927 SOURCES="$SOURCES $srcdir/src/audio/emscripten/*.c"
3929 SUMMARY_audio="${SUMMARY_audio} emscripten"
3932 CheckVisibilityHidden
3933 CheckDeclarationAfterStatement
3941 # Set up files for the power library
3942 if test x$enable_power = xyes; then
3943 AC_DEFINE(SDL_POWER_EMSCRIPTEN, 1, [ ])
3944 SOURCES="$SOURCES $srcdir/src/power/emscripten/*.c"
3948 # Set up files for the power library
3949 if test x$enable_joystick = xyes; then
3950 AC_DEFINE(SDL_JOYSTICK_EMSCRIPTEN, 1, [ ])
3951 SOURCES="$SOURCES $srcdir/src/joystick/emscripten/*.c"
3955 # Set up files for the filesystem library
3956 if test x$enable_filesystem = xyes; then
3957 AC_DEFINE(SDL_FILESYSTEM_EMSCRIPTEN, 1, [ ])
3958 SOURCES="$SOURCES $srcdir/src/filesystem/emscripten/*.c"
3961 # Set up files for the timer library
3962 if test x$enable_timers = xyes; then
3963 AC_DEFINE(SDL_TIMER_UNIX, 1, [ ])
3964 SOURCES="$SOURCES $srcdir/src/timer/unix/*.c"
3970 *** Unsupported host: Please add to configure.in
3975 # Verify that we have all the platform specific files we need
3977 if test x$have_joystick != xyes; then
3978 if test x$enable_joystick = xyes; then
3979 AC_DEFINE(SDL_JOYSTICK_DISABLED, 1, [ ])
3981 SOURCES="$SOURCES $srcdir/src/joystick/dummy/*.c"
3983 if test x$have_haptic != xyes; then
3984 if test x$enable_haptic = xyes; then
3985 AC_DEFINE(SDL_HAPTIC_DISABLED, 1, [ ])
3987 SOURCES="$SOURCES $srcdir/src/haptic/dummy/*.c"
3989 if test x$have_threads != xyes; then
3990 if test x$enable_threads = xyes; then
3991 AC_DEFINE(SDL_THREADS_DISABLED, 1, [ ])
3993 SOURCES="$SOURCES $srcdir/src/thread/generic/*.c"
3995 if test x$have_timers != xyes; then
3996 if test x$enable_timers = xyes; then
3997 AC_DEFINE(SDL_TIMERS_DISABLED, 1, [ ])
3999 SOURCES="$SOURCES $srcdir/src/timer/dummy/*.c"
4001 if test x$have_filesystem != xyes; then
4002 if test x$enable_filesystem = xyes; then
4003 AC_DEFINE(SDL_FILESYSTEM_DISABLED, 1, [ ])
4005 SOURCES="$SOURCES $srcdir/src/filesystem/dummy/*.c"
4007 if test x$have_loadso != xyes; then
4008 if test x$enable_loadso = xyes; then
4009 AC_DEFINE(SDL_LOADSO_DISABLED, 1, [ ])
4011 SOURCES="$SOURCES $srcdir/src/loadso/dummy/*.c"
4013 if test x$SDLMAIN_SOURCES = x; then
4014 SDLMAIN_SOURCES="$srcdir/src/main/dummy/*.c"
4016 SDLTEST_SOURCES="$srcdir/src/test/*.c"
4018 if test x$video_wayland = xyes; then
4019 WAYLAND_CORE_PROTOCOL_SOURCE='$(gen)/wayland-protocol.c'
4020 WAYLAND_CORE_PROTOCOL_HEADER='$(gen)/wayland-client-protocol.h'
4021 WAYLAND_PROTOCOLS_UNSTABLE_SOURCES=`echo $WAYLAND_PROTOCOLS_UNSTABLE |\
4022 sed 's,[[^ ]]\+,\\$(gen)/&-protocol.c,g'`
4023 WAYLAND_PROTOCOLS_UNSTABLE_HEADERS=`echo $WAYLAND_PROTOCOLS_UNSTABLE |\
4024 sed 's,[[^ ]]\+,\\$(gen)/&-client-protocol.h,g'`
4025 GEN_SOURCES="$GEN_SOURCES $WAYLAND_CORE_PROTOCOL_SOURCE $WAYLAND_PROTOCOLS_UNSTABLE_SOURCES"
4026 GEN_HEADERS="$GEN_HEADERS $WAYLAND_CORE_PROTOCOL_HEADER $WAYLAND_PROTOCOLS_UNSTABLE_HEADERS"
4028 WAYLAND_CORE_PROTOCOL_SOURCE_DEPENDS="
4029 $WAYLAND_CORE_PROTOCOL_SOURCE: $WAYLAND_CORE_PROTOCOL_DIR/wayland.xml
4030 \$(SHELL) \$(auxdir)/mkinstalldirs \$(gen)
4031 \$(RUN_CMD_GEN)\$(WAYLAND_SCANNER) code \$< \$@"
4033 WAYLAND_CORE_PROTOCOL_HEADER_DEPENDS="
4034 $WAYLAND_CORE_PROTOCOL_HEADER: $WAYLAND_CORE_PROTOCOL_DIR/wayland.xml
4035 \$(SHELL) \$(auxdir)/mkinstalldirs \$(gen)
4036 \$(RUN_CMD_GEN)\$(WAYLAND_SCANNER) client-header \$< \$@"
4038 WAYLAND_CORE_PROTOCOL_OBJECT="
4039 \$(objects)/`echo $WAYLAND_CORE_PROTOCOL_SOURCE | sed 's/\$(gen)\/\(.*\).c$/\1.lo/'`: $WAYLAND_CORE_PROTOCOL_SOURCE
4040 \$(RUN_CMD_CC)\$(LIBTOOL) --tag=CC --mode=compile \$(CC) \$(CFLAGS) \$(EXTRA_CFLAGS) $DEPENDENCY_TRACKING_OPTIONS -c \$< -o \$@"
4042 WAYLAND_PROTOCOLS_CLIENT_HEADER_UNSTABLE_DEPENDS=`for p in $WAYLAND_PROTOCOLS_UNSTABLE;\
4043 do echo ; echo \$p | sed\
4044 "s,^\\([[a-z\\-]]\\+\\)-unstable-\\(v[[0-9]]\+\\)\$,\\$(gen)/&-client-protocol.h: $WAYLAND_PROTOCOLS_DIR/unstable/\1/&.xml\\\\
4045 \\$(SHELL) \\$(auxdir)/mkinstalldirs \\$(gen)\\\\
4046 \\$(RUN_CMD_GEN)\\$(WAYLAND_SCANNER) client-header \\$< \\$@," ; done`
4048 WAYLAND_PROTOCOLS_CODE_UNSTABLE_DEPENDS=`for p in $WAYLAND_PROTOCOLS_UNSTABLE;\
4049 do echo ; echo \$p | sed\
4050 "s,^\\([[a-z\\-]]\\+\\)-unstable-\\(v[[0-9]]\+\\)\$,\\$(gen)/&-protocol.c: $WAYLAND_PROTOCOLS_DIR/unstable/\1/&.xml\\\\
4051 \\$(SHELL) \\$(auxdir)/mkinstalldirs \\$(gen)\\\\
4052 \\$(RUN_CMD_GEN)\\$(WAYLAND_SCANNER) code \\$< \\$@," ; done`
4054 WAYLAND_PROTOCOLS_OBJECTS_UNSTABLE=`for p in $WAYLAND_PROTOCOLS_UNSTABLE;\
4055 do echo ; echo \$p | sed\
4056 "s,^\\([[a-z\\-]]\\+\\)-unstable-\\(v[[0-9]]\+\\)\$,\\\$(objects)/&-protocol.lo: \\$(gen)/&-protocol.c \\$(gen)/&-client-protocol.h\\\\
4057 \\$(RUN_CMD_CC)\\$(LIBTOOL) --tag=CC --mode=compile \\$(CC) \\$(CFLAGS) \\$(EXTRA_CFLAGS) $DEPENDENCY_TRACKING_OPTIONS -c \\$< -o \\$@," ; done`
4059 WAYLAND_PROTOCOLS_DEPENDS="
4060 $WAYLAND_CORE_PROTOCOL_SOURCE_DEPENDS
4061 $WAYLAND_CORE_PROTOCOL_HEADER_DEPENDS
4062 $WAYLAND_CORE_PROTOCOL_OBJECT
4063 $WAYLAND_PROTOCOLS_CLIENT_HEADER_UNSTABLE_DEPENDS
4064 $WAYLAND_PROTOCOLS_CODE_UNSTABLE_DEPENDS
4065 $WAYLAND_PROTOCOLS_OBJECTS_UNSTABLE
4069 OBJECTS=`echo $SOURCES`
4070 DEPENDS=`echo $SOURCES | tr ' ' '\n'`
4071 for EXT in asm cc m c S; do
4072 OBJECTS=`echo "$OBJECTS" | sed 's,[[^ ]]*/\([[^ ]]*\)\.'$EXT',$(objects)/\1.lo,g'`
4073 DEPENDS=`echo "$DEPENDS" | sed "s,^\\([[^ ]]*\\)/\\([[^ ]]*\\)\\.$EXT\\$,\\\\
4074 \\$(objects)/\\2.lo: \\1/\\2.$EXT\\\\
4075 \\$(RUN_CMD_CC)\\$(LIBTOOL) --tag=CC --mode=compile \\$(CC) \\$(CFLAGS) \\$(EXTRA_CFLAGS) $DEPENDENCY_TRACKING_OPTIONS -c \\$< -o \\$@,g"`
4078 GEN_OBJECTS=`echo "$GEN_SOURCES" | sed 's,[[^ ]]*/\([[^ ]]*\)\.c,$(objects)/\1.lo,g'`
4080 VERSION_OBJECTS=`echo $VERSION_SOURCES`
4081 VERSION_DEPENDS=`echo $VERSION_SOURCES`
4082 VERSION_OBJECTS=`echo "$VERSION_OBJECTS" | sed 's,[[^ ]]*/\([[^ ]]*\)\.rc,$(objects)/\1.o,g'`
4083 VERSION_DEPENDS=`echo "$VERSION_DEPENDS" | sed "s,\\([[^ ]]*\\)/\\([[^ ]]*\\)\\.rc,\\\\
4084 \\$(objects)/\\2.o: \\1/\\2.rc\\\\
4085 \\$(WINDRES) \\$< \\$@,g"`
4087 SDLMAIN_OBJECTS=`echo $SDLMAIN_SOURCES`
4088 SDLMAIN_DEPENDS=`echo $SDLMAIN_SOURCES`
4089 SDLMAIN_OBJECTS=`echo "$SDLMAIN_OBJECTS" | sed 's,[[^ ]]*/\([[^ ]]*\)\.c,$(objects)/\1.lo,g'`
4090 SDLMAIN_DEPENDS=`echo "$SDLMAIN_DEPENDS" | sed "s,\\([[^ ]]*\\)/\\([[^ ]]*\\)\\.c,\\\\
4091 \\$(objects)/\\2.lo: \\1/\\2.c\\\\
4092 \\$(RUN_CMD_CC)\\$(LIBTOOL) --tag=CC --mode=compile \\$(CC) \\$(CFLAGS) \\$(EXTRA_CFLAGS) $DEPENDENCY_TRACKING_OPTIONS -c \\$< -o \\$@,g"`
4094 SDLTEST_OBJECTS=`echo $SDLTEST_SOURCES`
4095 SDLTEST_DEPENDS=`echo $SDLTEST_SOURCES`
4096 SDLTEST_OBJECTS=`echo "$SDLTEST_OBJECTS" | sed 's,[[^ ]]*/\([[^ ]]*\)\.c,$(objects)/\1.lo,g'`
4097 SDLTEST_DEPENDS=`echo "$SDLTEST_DEPENDS" | sed "s,\\([[^ ]]*\\)/\\([[^ ]]*\\)\\.c,\\\\
4098 \\$(objects)/\\2.lo: \\1/\\2.c\\\\
4099 \\$(RUN_CMD_CC)\\$(LIBTOOL) --tag=CC --mode=compile \\$(CC) \\$(CFLAGS) \\$(EXTRA_CFLAGS) $DEPENDENCY_TRACKING_OPTIONS -c \\$< -o \\$@,g"`
4101 # Set runtime shared library paths as needed
4103 if test "x$enable_rpath" = "xyes"; then
4104 if test $ARCH = bsdi -o $ARCH = freebsd -o $ARCH = linux -o $ARCH = netbsd; then
4105 SDL_RLD_FLAGS="-Wl,-rpath,\${libdir}"
4107 AC_MSG_CHECKING(for linker option --enable-new-dtags)
4108 have_enable_new_dtags=no
4109 save_LDFLAGS="$LDFLAGS"
4110 LDFLAGS="$LDFLAGS -Wl,--enable-new-dtags"
4114 have_enable_new_dtags=yes
4115 SDL_RLD_FLAGS="$SDL_RLD_FLAGS -Wl,--enable-new-dtags"
4117 LDFLAGS="$save_LDFLAGS"
4118 AC_MSG_RESULT($have_enable_new_dtags)
4120 if test $ARCH = solaris; then
4121 SDL_RLD_FLAGS="-R\${libdir}"
4127 SDL_STATIC_LIBS="$SDL_LIBS $EXTRA_LDFLAGS"
4129 dnl Expand the cflags and libraries needed by apps using SDL
4130 AC_SUBST(SDL_CFLAGS)
4132 AC_SUBST(SDL_STATIC_LIBS)
4133 AC_SUBST(SDL_RLD_FLAGS)
4134 if test x$enable_shared = xyes; then
4136 ENABLE_SHARED_FALSE="#"
4138 ENABLE_SHARED_TRUE="#"
4139 ENABLE_SHARED_FALSE=
4141 if test x$enable_static = xyes; then
4143 ENABLE_STATIC_FALSE="#"
4145 ENABLE_STATIC_TRUE="#"
4146 ENABLE_STATIC_FALSE=
4148 AC_SUBST(ENABLE_SHARED_TRUE)
4149 AC_SUBST(ENABLE_SHARED_FALSE)
4150 AC_SUBST(ENABLE_STATIC_TRUE)
4151 AC_SUBST(ENABLE_STATIC_FALSE)
4153 dnl Expand the sources and objects needed to build the library
4154 AC_SUBST(ac_aux_dir)
4157 AC_SUBST(GEN_HEADERS)
4158 AC_SUBST(GEN_OBJECTS)
4159 AC_SUBST(VERSION_OBJECTS)
4160 AC_SUBST(SDLMAIN_OBJECTS)
4161 AC_SUBST(SDLTEST_OBJECTS)
4162 AC_SUBST(BUILD_CFLAGS)
4163 AC_SUBST(EXTRA_CFLAGS)
4164 AC_SUBST(BUILD_LDFLAGS)
4165 AC_SUBST(EXTRA_LDFLAGS)
4167 AC_SUBST(WAYLAND_SCANNER)
4169 cat >Makefile.rules <<__EOF__
4171 # Build rules for objects
4172 -include \$(OBJECTS:.lo=.d)
4174 # Special dependency for SDL.c, since it depends on SDL_revision.h
4175 $srcdir/src/SDL.c: update-revision
4180 $WAYLAND_PROTOCOLS_DEPENDS
4184 Makefile:Makefile.in:Makefile.rules sdl2-config sdl2-config.cmake SDL2.spec sdl2.pc
4186 AC_CONFIG_COMMANDS([sdl2_config],[chmod a+x sdl2-config])
4188 SUMMARY="${SUMMARY}SDL2 Configure Summary:\n"
4189 if test x$enable_shared = xyes; then
4190 SUMMARY="${SUMMARY}Building Shared Libraries\n"
4192 if test x$enable_static = xyes; then
4193 SUMMARY="${SUMMARY}Building Static Libraries\n"
4195 SUMMARY="${SUMMARY}Enabled modules :${SUMMARY_modules}\n"
4196 SUMMARY="${SUMMARY}Assembly Math :${SUMMARY_math}\n"
4197 SUMMARY="${SUMMARY}Audio drivers :${SUMMARY_audio}\n"
4198 SUMMARY="${SUMMARY}Video drivers :${SUMMARY_video}\n"
4199 if test x$have_x = xyes; then
4200 SUMMARY="${SUMMARY}X11 libraries :${SUMMARY_video_x11}\n"
4202 SUMMARY="${SUMMARY}Input drivers :${SUMMARY_input}\n"
4203 if test x$have_samplerate_h_hdr = xyes; then
4204 SUMMARY="${SUMMARY}Using libsamplerate : YES\n"
4206 SUMMARY="${SUMMARY}Using libsamplerate : NO\n"
4208 if test x$have_libudev_h_hdr = xyes; then
4209 SUMMARY="${SUMMARY}Using libudev : YES\n"
4211 SUMMARY="${SUMMARY}Using libudev : NO\n"
4213 if test x$have_dbus_dbus_h_hdr = xyes; then
4214 SUMMARY="${SUMMARY}Using dbus : YES\n"
4216 SUMMARY="${SUMMARY}Using dbus : NO\n"
4218 if test x$enable_ime = xyes; then
4219 SUMMARY="${SUMMARY}Using ime : YES\n"
4221 SUMMARY="${SUMMARY}Using ime : NO\n"
4223 if test x$have_ibus_ibus_h_hdr = xyes; then
4224 SUMMARY="${SUMMARY}Using ibus : YES\n"
4226 SUMMARY="${SUMMARY}Using ibus : NO\n"
4228 if test x$have_fcitx_frontend_h_hdr = xyes; then
4229 SUMMARY="${SUMMARY}Using fcitx : YES\n"
4231 SUMMARY="${SUMMARY}Using fcitx : NO\n"
4233 AC_CONFIG_COMMANDS([summary], [echo -en "$SUMMARY"], [SUMMARY="$SUMMARY"])