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"
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 inttypes.h stdint.h ctype.h math.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 strlen strlcpy strlcat strdup _strrev _strupr _strlwr strchr strrchr strstr itoa _ltoa _uitoa _ultoa strtol strtoul _i64toa _ui64toa strtoll strtoull atoi atof strcmp strncmp _stricmp strcasecmp _strnicmp strncasecmp vsscanf vsnprintf fseeko fseeko64 sigaction setjmp nanosleep sysconf sysctlbyname)
273 AC_CHECK_LIB(m, pow, [LIBS="$LIBS -lm"; EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lm"])
274 AC_CHECK_FUNCS(atan atan2 acos asin ceil copysign cos cosf fabs floor log pow scalbn sin sinf sqrt sqrtf tan tanf)
276 AC_CHECK_LIB(iconv, iconv_open, [LIBS="$LIBS -liconv"; EXTRA_LDFLAGS="$EXTRA_LDFLAGS -liconv"])
277 AC_CHECK_FUNCS(iconv)
279 AC_CHECK_MEMBER(struct sigaction.sa_sigaction,[AC_DEFINE(HAVE_SA_SIGACTION)], ,[#include <signal.h>])
282 dnl AC_CHECK_SIZEOF(void*)
284 dnl See whether we can use gcc atomic operations on this architecture
285 AC_ARG_ENABLE(gcc-atomics,
286 AC_HELP_STRING([--enable-gcc-atomics],
287 [Use gcc builtin atomics [[default=yes]]]),
288 , enable_gcc_atomics=yes)
289 if test x$enable_gcc_atomics = xyes; then
291 AC_MSG_CHECKING(for GCC builtin atomic operations)
296 __sync_lock_test_and_set(&a, 4);
297 __sync_lock_test_and_set(&x, y);
298 __sync_fetch_and_add(&a, 1);
299 __sync_bool_compare_and_swap(&a, 5, 10);
300 __sync_bool_compare_and_swap(&x, y, z);
304 AC_MSG_RESULT($have_gcc_atomics)
306 if test x$have_gcc_atomics = xyes; then
307 AC_DEFINE(HAVE_GCC_ATOMICS, 1, [ ])
309 # See if we have the minimum operation needed for GCC atomics
313 __sync_lock_test_and_set(&a, 1);
314 __sync_lock_release(&a);
316 have_gcc_sync_lock_test_and_set=yes
318 if test x$have_gcc_sync_lock_test_and_set = xyes; then
319 AC_DEFINE(HAVE_GCC_SYNC_LOCK_TEST_AND_SET, 1, [ ])
325 SOURCES="$SOURCES $srcdir/src/*.c"
326 SOURCES="$SOURCES $srcdir/src/atomic/*.c"
327 SOURCES="$SOURCES $srcdir/src/audio/*.c"
328 SOURCES="$SOURCES $srcdir/src/cpuinfo/*.c"
329 SOURCES="$SOURCES $srcdir/src/dynapi/*.c"
330 SOURCES="$SOURCES $srcdir/src/events/*.c"
331 SOURCES="$SOURCES $srcdir/src/file/*.c"
332 SOURCES="$SOURCES $srcdir/src/haptic/*.c"
333 SOURCES="$SOURCES $srcdir/src/joystick/*.c"
334 SOURCES="$SOURCES $srcdir/src/libm/*.c"
335 SOURCES="$SOURCES $srcdir/src/power/*.c"
336 #SOURCES="$SOURCES $srcdir/src/filesystem/*.c"
337 SOURCES="$SOURCES $srcdir/src/render/*.c"
338 SOURCES="$SOURCES $srcdir/src/render/*/*.c"
339 SOURCES="$SOURCES $srcdir/src/stdlib/*.c"
340 SOURCES="$SOURCES $srcdir/src/thread/*.c"
341 SOURCES="$SOURCES $srcdir/src/timer/*.c"
342 SOURCES="$SOURCES $srcdir/src/video/*.c"
344 dnl Enable/disable various subsystems of the SDL library
346 AC_ARG_ENABLE(atomic,
347 AC_HELP_STRING([--enable-atomic], [Enable the atomic operations subsystem [[default=yes]]]),
349 if test x$enable_atomic != xyes; then
350 AC_DEFINE(SDL_ATOMIC_DISABLED, 1, [ ])
352 SUMMARY_modules="${SUMMARY_modules} atomic"
355 AC_HELP_STRING([--enable-audio], [Enable the audio subsystem [[default=yes]]]),
357 if test x$enable_audio != xyes; then
358 AC_DEFINE(SDL_AUDIO_DISABLED, 1, [ ])
360 SUMMARY_modules="${SUMMARY_modules} audio"
363 AC_HELP_STRING([--enable-video], [Enable the video subsystem [[default=yes]]]),
365 if test x$enable_video != xyes; then
366 AC_DEFINE(SDL_VIDEO_DISABLED, 1, [ ])
368 SUMMARY_modules="${SUMMARY_modules} video"
370 AC_ARG_ENABLE(render,
371 AC_HELP_STRING([--enable-render], [Enable the render subsystem [[default=yes]]]),
373 if test x$enable_render != xyes; then
374 AC_DEFINE(SDL_RENDER_DISABLED, 1, [ ])
376 SUMMARY_modules="${SUMMARY_modules} render"
378 AC_ARG_ENABLE(events,
379 AC_HELP_STRING([--enable-events], [Enable the events subsystem [[default=yes]]]),
381 if test x$enable_events != xyes; then
382 AC_DEFINE(SDL_EVENTS_DISABLED, 1, [ ])
384 SUMMARY_modules="${SUMMARY_modules} events"
386 AC_ARG_ENABLE(joystick,
387 AC_HELP_STRING([--enable-joystick], [Enable the joystick subsystem [[default=yes]]]),
388 , enable_joystick=yes)
389 if test x$enable_joystick != xyes; then
390 AC_DEFINE(SDL_JOYSTICK_DISABLED, 1, [ ])
392 SUMMARY_modules="${SUMMARY_modules} joystick"
394 AC_ARG_ENABLE(haptic,
395 AC_HELP_STRING([--enable-haptic], [Enable the haptic (force feedback) subsystem [[default=yes]]]),
397 if test x$enable_haptic != xyes; then
398 AC_DEFINE(SDL_HAPTIC_DISABLED, 1, [ ])
400 SUMMARY_modules="${SUMMARY_modules} haptic"
403 AC_HELP_STRING([--enable-power], [Enable the power subsystem [[default=yes]]]),
405 if test x$enable_power != xyes; then
406 AC_DEFINE(SDL_POWER_DISABLED, 1, [ ])
408 SUMMARY_modules="${SUMMARY_modules} power"
410 AC_ARG_ENABLE(filesystem,
411 AC_HELP_STRING([--enable-filesystem], [Enable the filesystem subsystem [[default=yes]]]),
412 , enable_filesystem=yes)
413 if test x$enable_filesystem != xyes; then
414 AC_DEFINE(SDL_FILESYSTEM_DISABLED, 1, [ ])
416 SUMMARY_modules="${SUMMARY_modules} filesystem"
418 AC_ARG_ENABLE(threads,
419 AC_HELP_STRING([--enable-threads], [Enable the threading subsystem [[default=yes]]]),
420 , enable_threads=yes)
421 if test x$enable_threads != xyes; then
422 AC_DEFINE(SDL_THREADS_DISABLED, 1, [ ])
424 SUMMARY_modules="${SUMMARY_modules} threads"
426 AC_ARG_ENABLE(timers,
427 AC_HELP_STRING([--enable-timers], [Enable the timer subsystem [[default=yes]]]),
429 if test x$enable_timers != xyes; then
430 AC_DEFINE(SDL_TIMERS_DISABLED, 1, [ ])
432 SUMMARY_modules="${SUMMARY_modules} timers"
435 AC_HELP_STRING([--enable-file], [Enable the file subsystem [[default=yes]]]),
437 if test x$enable_file != xyes; then
438 AC_DEFINE(SDL_FILE_DISABLED, 1, [ ])
440 SUMMARY_modules="${SUMMARY_modules} file"
442 AC_ARG_ENABLE(loadso,
443 AC_HELP_STRING([--enable-loadso], [Enable the shared object loading subsystem [[default=yes]]]),
445 if test x$enable_loadso != xyes; then
446 AC_DEFINE(SDL_LOADSO_DISABLED, 1, [ ])
448 SUMMARY_modules="${SUMMARY_modules} loadso"
450 AC_ARG_ENABLE(cpuinfo,
451 AC_HELP_STRING([--enable-cpuinfo], [Enable the cpuinfo subsystem [[default=yes]]]),
452 , enable_cpuinfo=yes)
453 if test x$enable_cpuinfo != xyes; then
454 AC_DEFINE(SDL_CPUINFO_DISABLED, 1, [ ])
456 SUMMARY_modules="${SUMMARY_modules} cpuinfo"
458 AC_ARG_ENABLE(assembly,
459 AC_HELP_STRING([--enable-assembly], [Enable assembly routines [[default=yes]]]),
460 , enable_assembly=yes)
461 if test x$enable_assembly = xyes; then
462 SUMMARY_modules="${SUMMARY_modules} assembly"
464 AC_DEFINE(SDL_ASSEMBLY_ROUTINES, 1, [ ])
466 # Make sure that we don't generate floating point code that would
467 # cause illegal instruction exceptions on older processors
470 # Don't need to worry about Apple hardware, it's all SSE capable
474 # x86 64-bit architectures all have SSE instructions
481 AC_ARG_ENABLE(ssemath,
482 AC_HELP_STRING([--enable-ssemath], [Allow GCC to use SSE floating point math [[default=no]]]),
483 , enable_ssemath=$default_ssemath)
484 if test x$enable_ssemath = xno; then
485 if test x$have_gcc_sse = xyes -o x$have_gcc_sse2 = xyes; then
486 EXTRA_CFLAGS="$EXTRA_CFLAGS -mfpmath=387"
490 dnl Check for various instruction support
492 AC_HELP_STRING([--enable-mmx], [use MMX assembly routines [[default=yes]]]),
494 if test x$enable_mmx = xyes; then
495 save_CFLAGS="$CFLAGS"
497 AC_MSG_CHECKING(for GCC -mmmx option)
499 CFLAGS="$save_CFLAGS $mmx_CFLAGS"
504 #ifdef __MINGW64_VERSION_MAJOR
507 #include <mmintrin.h>
510 #include <mmintrin.h>
513 #error Assembler CPP flag not enabled
519 AC_MSG_RESULT($have_gcc_mmx)
520 CFLAGS="$save_CFLAGS"
522 if test x$have_gcc_mmx = xyes; then
523 EXTRA_CFLAGS="$EXTRA_CFLAGS $mmx_CFLAGS"
524 SUMMARY_math="${SUMMARY_math} mmx"
529 AC_HELP_STRING([--enable-3dnow], [use 3DNow! assembly routines [[default=yes]]]),
531 if test x$enable_3dnow = xyes; then
532 save_CFLAGS="$CFLAGS"
534 AC_MSG_CHECKING(for GCC -m3dnow option)
535 amd3dnow_CFLAGS="-m3dnow"
536 CFLAGS="$save_CFLAGS $amd3dnow_CFLAGS"
541 #error Assembler CPP flag not enabled
549 AC_MSG_RESULT($have_gcc_3dnow)
550 CFLAGS="$save_CFLAGS"
552 if test x$have_gcc_3dnow = xyes; then
553 EXTRA_CFLAGS="$EXTRA_CFLAGS $amd3dnow_CFLAGS"
554 SUMMARY_math="${SUMMARY_math} 3dnow"
559 AC_HELP_STRING([--enable-sse], [use SSE assembly routines [[default=yes]]]),
561 if test x$enable_sse = xyes; then
562 save_CFLAGS="$CFLAGS"
564 AC_MSG_CHECKING(for GCC -msse option)
566 CFLAGS="$save_CFLAGS $sse_CFLAGS"
571 #ifdef __MINGW64_VERSION_MAJOR
574 #include <xmmintrin.h>
577 #include <xmmintrin.h>
580 #error Assembler CPP flag not enabled
586 AC_MSG_RESULT($have_gcc_sse)
587 CFLAGS="$save_CFLAGS"
589 if test x$have_gcc_sse = xyes; then
590 EXTRA_CFLAGS="$EXTRA_CFLAGS $sse_CFLAGS"
591 SUMMARY_math="${SUMMARY_math} sse"
596 AC_HELP_STRING([--enable-sse2], [use SSE2 assembly routines [[default=no]]]),
597 , enable_sse2=$default_ssemath)
598 if test x$enable_sse2 = xyes; then
599 save_CFLAGS="$CFLAGS"
601 AC_MSG_CHECKING(for GCC -msse2 option)
603 CFLAGS="$save_CFLAGS $sse2_CFLAGS"
608 #ifdef __MINGW64_VERSION_MAJOR
611 #include <emmintrin.h>
614 #include <emmintrin.h>
617 #error Assembler CPP flag not enabled
623 AC_MSG_RESULT($have_gcc_sse2)
624 CFLAGS="$save_CFLAGS"
626 if test x$have_gcc_sse2 = xyes; then
627 EXTRA_CFLAGS="$EXTRA_CFLAGS $sse2_CFLAGS"
628 SUMMARY_math="${SUMMARY_math} sse2"
632 AC_ARG_ENABLE(altivec,
633 AC_HELP_STRING([--enable-altivec], [use Altivec assembly routines [[default=yes]]]),
634 , enable_altivec=yes)
635 if test x$enable_altivec = xyes; then
636 save_CFLAGS="$CFLAGS"
638 have_altivec_h_hdr=no
639 altivec_CFLAGS="-maltivec"
640 CFLAGS="$save_CFLAGS $altivec_CFLAGS"
642 AC_MSG_CHECKING(for Altivec with GCC altivec.h and -maltivec option)
645 vector unsigned int vzero() {
646 return vec_splat_u32(0);
651 have_altivec_h_hdr=yes
653 AC_MSG_RESULT($have_gcc_altivec)
655 if test x$have_gcc_altivec = xno; then
656 AC_MSG_CHECKING(for Altivec with GCC -maltivec option)
658 vector unsigned int vzero() {
659 return vec_splat_u32(0);
665 AC_MSG_RESULT($have_gcc_altivec)
668 if test x$have_gcc_altivec = xno; then
669 AC_MSG_CHECKING(for Altivec with GCC altivec.h and -faltivec option)
670 altivec_CFLAGS="-faltivec"
671 CFLAGS="$save_CFLAGS $altivec_CFLAGS"
674 vector unsigned int vzero() {
675 return vec_splat_u32(0);
680 have_altivec_h_hdr=yes
682 AC_MSG_RESULT($have_gcc_altivec)
685 if test x$have_gcc_altivec = xno; then
686 AC_MSG_CHECKING(for Altivec with GCC -faltivec option)
688 vector unsigned int vzero() {
689 return vec_splat_u32(0);
695 AC_MSG_RESULT($have_gcc_altivec)
697 CFLAGS="$save_CFLAGS"
699 if test x$have_gcc_altivec = xyes; then
700 AC_DEFINE(SDL_ALTIVEC_BLITTERS, 1, [ ])
701 if test x$have_altivec_h_hdr = xyes; then
702 AC_DEFINE(HAVE_ALTIVEC_H, 1, [ ])
704 EXTRA_CFLAGS="$EXTRA_CFLAGS $altivec_CFLAGS"
705 SUMMARY_math="${SUMMARY_math} altivec"
710 dnl See if the OSS audio interface is supported
714 AC_HELP_STRING([--enable-oss], [support the OSS audio API [[default=maybe]]]),
717 # OpenBSD "has" OSS, but it's not really for app use. They want you to
718 # use sndio instead. So on there, we default to disabled. You can force
719 # it on if you really want, though.
720 if test x$enable_oss = xmaybe; then
728 if test x$enable_audio = xyes -a x$enable_oss = xyes; then
729 AC_MSG_CHECKING(for OSS audio support)
731 if test x$have_oss != xyes; then
733 #include <sys/soundcard.h>
735 int arg = SNDCTL_DSP_SETFRAGMENT;
740 if test x$have_oss != xyes; then
742 #include <soundcard.h>
744 int arg = SNDCTL_DSP_SETFRAGMENT;
747 AC_DEFINE(SDL_AUDIO_DRIVER_OSS_SOUNDCARD_H, 1, [ ])
750 AC_MSG_RESULT($have_oss)
751 if test x$have_oss = xyes; then
752 SUMMARY_audio="${SUMMARY_audio} oss"
753 AC_DEFINE(SDL_AUDIO_DRIVER_OSS, 1, [ ])
754 SOURCES="$SOURCES $srcdir/src/audio/dsp/*.c"
757 # We may need to link with ossaudio emulation library
759 *-*-openbsd*|*-*-netbsd*)
760 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lossaudio";;
766 dnl See if the ALSA audio interface is supported
770 AC_HELP_STRING([--enable-alsa], [support the ALSA audio API [[default=yes]]]),
772 if test x$enable_audio = xyes -a x$enable_alsa = xyes; then
773 AM_PATH_ALSA(0.9.0, have_alsa=yes, have_alsa=no)
774 # Restore all flags from before the ALSA detection runs
775 CFLAGS="$alsa_save_CFLAGS"
776 LDFLAGS="$alsa_save_LDFLAGS"
777 LIBS="$alsa_save_LIBS"
778 if test x$have_alsa = xyes; then
779 AC_ARG_ENABLE(alsa-shared,
780 AC_HELP_STRING([--enable-alsa-shared], [dynamically load ALSA audio support [[default=yes]]]),
781 , enable_alsa_shared=yes)
782 alsa_lib=[`find_lib "libasound.so.*" "$ALSA_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`]
784 AC_DEFINE(SDL_AUDIO_DRIVER_ALSA, 1, [ ])
785 SOURCES="$SOURCES $srcdir/src/audio/alsa/*.c"
786 EXTRA_CFLAGS="$EXTRA_CFLAGS $ALSA_CFLAGS"
787 if test x$have_loadso != xyes && \
788 test x$enable_alsa_shared = xyes; then
789 AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic ALSA loading])
791 if test x$have_loadso = xyes && \
792 test x$enable_alsa_shared = xyes && test x$alsa_lib != x; then
793 echo "-- dynamic libasound -> $alsa_lib"
794 AC_DEFINE_UNQUOTED(SDL_AUDIO_DRIVER_ALSA_DYNAMIC, "$alsa_lib", [ ])
795 SUMMARY_audio="${SUMMARY_audio} alsa(dynamic)"
797 EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ALSA_LIBS"
798 SUMMARY_audio="${SUMMARY_audio} alsa"
805 dnl Find the ESD includes and libraries
809 AC_HELP_STRING([--enable-esd], [support the Enlightened Sound Daemon [[default=yes]]]),
811 if test x$enable_audio = xyes -a x$enable_esd = xyes; then
812 AM_PATH_ESD(0.2.8, have_esd=yes, have_esd=no)
813 if test x$have_esd = xyes; then
814 AC_ARG_ENABLE(esd-shared,
815 AC_HELP_STRING([--enable-esd-shared], [dynamically load ESD audio support [[default=yes]]]),
816 , enable_esd_shared=yes)
817 esd_lib=[`find_lib "libesd.so.*" "$ESD_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`]
819 AC_DEFINE(SDL_AUDIO_DRIVER_ESD, 1, [ ])
820 SOURCES="$SOURCES $srcdir/src/audio/esd/*.c"
821 EXTRA_CFLAGS="$EXTRA_CFLAGS $ESD_CFLAGS"
822 if test x$have_loadso != xyes && \
823 test x$enable_esd_shared = xyes; then
824 AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic ESD loading])
826 if test x$have_loadso = xyes && \
827 test x$enable_esd_shared = xyes && test x$esd_lib != x; then
828 echo "-- dynamic libesd -> $esd_lib"
829 AC_DEFINE_UNQUOTED(SDL_AUDIO_DRIVER_ESD_DYNAMIC, "$esd_lib", [ ])
830 SUMMARY_audio="${SUMMARY_audio} esd(dynamic)"
832 EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ESD_LIBS"
833 SUMMARY_audio="${SUMMARY_audio} esd"
843 AC_ARG_ENABLE(pulseaudio,
844 AC_HELP_STRING([--enable-pulseaudio], [use PulseAudio [[default=yes]]]),
845 , enable_pulseaudio=yes)
846 if test x$enable_audio = xyes -a x$enable_pulseaudio = xyes; then
849 PULSEAUDIO_REQUIRED_VERSION=0.9
851 AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
852 AC_MSG_CHECKING(for PulseAudio $PULSEAUDIO_REQUIRED_VERSION support)
853 if test x$PKG_CONFIG != xno; then
854 if $PKG_CONFIG --atleast-pkgconfig-version 0.7 && $PKG_CONFIG --atleast-version $PULSEAUDIO_REQUIRED_VERSION libpulse-simple; then
855 PULSEAUDIO_CFLAGS=`$PKG_CONFIG --cflags libpulse-simple`
856 PULSEAUDIO_LIBS=`$PKG_CONFIG --libs libpulse-simple`
860 AC_MSG_RESULT($audio_pulseaudio)
862 if test x$audio_pulseaudio = xyes; then
863 AC_ARG_ENABLE(pulseaudio-shared,
864 AC_HELP_STRING([--enable-pulseaudio-shared], [dynamically load PulseAudio support [[default=yes]]]),
865 , enable_pulseaudio_shared=yes)
866 pulseaudio_lib=[`find_lib "libpulse-simple.so.*" "$PULSEAUDIO_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`]
868 AC_DEFINE(SDL_AUDIO_DRIVER_PULSEAUDIO, 1, [ ])
869 SOURCES="$SOURCES $srcdir/src/audio/pulseaudio/*.c"
870 EXTRA_CFLAGS="$EXTRA_CFLAGS $PULSEAUDIO_CFLAGS"
871 if test x$have_loadso != xyes && \
872 test x$enable_pulseaudio_shared = xyes; then
873 AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic PulseAudio loading])
875 if test x$have_loadso = xyes && \
876 test x$enable_pulseaudio_shared = xyes && test x$pulseaudio_lib != x; then
877 echo "-- dynamic libpulse-simple -> $pulseaudio_lib"
878 AC_DEFINE_UNQUOTED(SDL_AUDIO_DRIVER_PULSEAUDIO_DYNAMIC, "$pulseaudio_lib", [ ])
879 SUMMARY_audio="${SUMMARY_audio} pulse(dynamic)"
882 # On Solaris, pulseaudio must be linked deferred explicitly
883 # to prevent undefined symbol failures.
885 PULSEAUDIO_LIBS=`echo $PULSEAUDIO_LIBS | sed 's/\-l/-Wl,-l/g'`
886 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-zdeferred $PULSEAUDIO_LIBS -Wl,-znodeferred"
889 EXTRA_LDFLAGS="$EXTRA_LDFLAGS $PULSEAUDIO_LIBS"
890 SUMMARY_audio="${SUMMARY_audio} pulse"
900 AC_HELP_STRING([--enable-arts], [support the Analog Real Time Synthesizer [[default=yes]]]),
902 if test x$enable_audio = xyes -a x$enable_arts = xyes; then
903 AC_PATH_PROG(ARTSCONFIG, artsc-config)
904 if test x$ARTSCONFIG = x -o x$ARTSCONFIG = x'"$ARTSCONFIG"'; then
905 : # arts isn't installed
907 ARTS_CFLAGS=`$ARTSCONFIG --cflags`
908 ARTS_LIBS=`$ARTSCONFIG --libs`
909 AC_MSG_CHECKING(for aRts development environment)
911 save_CFLAGS="$CFLAGS"
912 CFLAGS="$CFLAGS $ARTS_CFLAGS"
916 arts_stream_t stream;
920 CFLAGS="$save_CFLAGS"
921 AC_MSG_RESULT($audio_arts)
922 if test x$audio_arts = xyes; then
923 AC_ARG_ENABLE(arts-shared,
924 AC_HELP_STRING([--enable-arts-shared], [dynamically load aRts audio support [[default=yes]]]),
925 , enable_arts_shared=yes)
926 arts_lib=[`find_lib "libartsc.so.*" "$ARTS_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`]
928 AC_DEFINE(SDL_AUDIO_DRIVER_ARTS, 1, [ ])
929 SOURCES="$SOURCES $srcdir/src/audio/arts/*.c"
930 EXTRA_CFLAGS="$EXTRA_CFLAGS $ARTS_CFLAGS"
931 if test x$have_loadso != xyes && \
932 test x$enable_arts_shared = xyes; then
933 AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic ARTS loading])
935 if test x$have_loadso = xyes && \
936 test x$enable_arts_shared = xyes && test x$arts_lib != x; then
937 echo "-- dynamic libartsc -> $arts_lib"
938 AC_DEFINE_UNQUOTED(SDL_AUDIO_DRIVER_ARTS_DYNAMIC, "$arts_lib", [ ])
939 SUMMARY_audio="${SUMMARY_audio} arts(dynamic)"
941 EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ARTS_LIBS"
942 SUMMARY_audio="${SUMMARY_audio} arts"
950 dnl See if the NAS audio interface is supported
954 AC_HELP_STRING([--enable-nas], [support the NAS audio API [[default=yes]]]),
956 if test x$enable_audio = xyes -a x$enable_nas = xyes; then
957 AC_CHECK_HEADER(audio/audiolib.h, have_nas_hdr=yes)
958 AC_CHECK_LIB(audio, AuOpenServer, have_nas_lib=yes)
960 AC_MSG_CHECKING(for NAS audio support)
963 if test x$have_nas_hdr = xyes -a x$have_nas_lib = xyes; then
967 elif test -r /usr/X11R6/include/audio/audiolib.h; then
969 NAS_CFLAGS="-I/usr/X11R6/include/"
970 NAS_LIBS="-L/usr/X11R6/lib -laudio -lXt"
974 AC_MSG_RESULT($have_nas)
976 if test x$have_nas = xyes; then
977 AC_ARG_ENABLE(nas-shared,
978 AC_HELP_STRING([--enable-nas-shared], [dynamically load NAS audio support [[default=yes]]]),
979 , enable_nas_shared=yes)
980 nas_lib=[`find_lib "libaudio.so.*" "$NAS_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`]
982 if test x$have_loadso != xyes && \
983 test x$enable_nas_shared = xyes; then
984 AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic NAS loading])
986 if test x$have_loadso = xyes && \
987 test x$enable_nas_shared = xyes && test x$nas_lib != x; then
988 echo "-- dynamic libaudio -> $nas_lib"
989 AC_DEFINE_UNQUOTED(SDL_AUDIO_DRIVER_NAS_DYNAMIC, "$nas_lib", [ ])
990 SUMMARY_audio="${SUMMARY_audio} nas(dynamic)"
992 EXTRA_LDFLAGS="$EXTRA_LDFLAGS $NAS_LIBS"
993 SUMMARY_audio="${SUMMARY_audio} nas"
996 AC_DEFINE(SDL_AUDIO_DRIVER_NAS, 1, [ ])
997 SOURCES="$SOURCES $srcdir/src/audio/nas/*.c"
998 EXTRA_CFLAGS="$EXTRA_CFLAGS $NAS_CFLAGS"
1004 dnl See if the sndio audio interface is supported
1007 AC_ARG_ENABLE(sndio,
1008 AC_HELP_STRING([--enable-sndio], [support the sndio audio API [[default=yes]]]),
1010 if test x$enable_audio = xyes -a x$enable_sndio = xyes; then
1011 AC_CHECK_HEADER(sndio.h, have_sndio_hdr=yes)
1012 AC_CHECK_LIB(sndio, sio_open, have_sndio_lib=yes)
1014 AC_MSG_CHECKING(for sndio audio support)
1017 if test x$have_sndio_hdr = xyes -a x$have_sndio_lib = xyes; then
1019 SNDIO_LIBS="-lsndio"
1022 AC_MSG_RESULT($have_sndio)
1024 if test x$have_sndio = xyes; then
1025 AC_ARG_ENABLE(sndio-shared,
1026 AC_HELP_STRING([--enable-sndio-shared], [dynamically load sndio audio support [[default=yes]]]),
1027 , enable_sndio_shared=yes)
1028 sndio_lib=[`find_lib "libsndio.so.*" "$SNDIO_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`]
1030 if test x$have_loadso != xyes && \
1031 test x$enable_sndio_shared = xyes; then
1032 AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic sndio loading])
1034 if test x$have_loadso = xyes && \
1035 test x$enable_sndio_shared = xyes && test x$sndio_lib != x; then
1036 echo "-- dynamic libsndio -> $sndio_lib"
1037 AC_DEFINE_UNQUOTED(SDL_AUDIO_DRIVER_SNDIO_DYNAMIC, "$sndio_lib", [ ])
1038 SUMMARY_audio="${SUMMARY_audio} sndio(dynamic)"
1040 EXTRA_LDFLAGS="$EXTRA_LDFLAGS $SNDIO_LIBS"
1041 SUMMARY_audio="${SUMMARY_audio} sndio"
1044 AC_DEFINE(SDL_AUDIO_DRIVER_SNDIO, 1, [ ])
1045 SOURCES="$SOURCES $srcdir/src/audio/sndio/*.c"
1046 EXTRA_CFLAGS="$EXTRA_CFLAGS $SNDIO_CFLAGS"
1052 dnl rcg07142001 See if the user wants the disk writer audio driver...
1055 AC_ARG_ENABLE(diskaudio,
1056 AC_HELP_STRING([--enable-diskaudio], [support the disk writer audio driver [[default=yes]]]),
1057 , enable_diskaudio=yes)
1058 if test x$enable_audio = xyes -a x$enable_diskaudio = xyes; then
1059 AC_DEFINE(SDL_AUDIO_DRIVER_DISK, 1, [ ])
1060 SOURCES="$SOURCES $srcdir/src/audio/disk/*.c"
1061 SUMMARY_audio="${SUMMARY_audio} disk"
1065 dnl rcg03142006 See if the user wants the dummy audio driver...
1068 AC_ARG_ENABLE(dummyaudio,
1069 AC_HELP_STRING([--enable-dummyaudio], [support the dummy audio driver [[default=yes]]]),
1070 , enable_dummyaudio=yes)
1071 if test x$enable_audio = xyes -a x$enable_dummyaudio = xyes; then
1072 AC_DEFINE(SDL_AUDIO_DRIVER_DUMMY, 1, [ ])
1073 SOURCES="$SOURCES $srcdir/src/audio/dummy/*.c"
1074 SUMMARY_audio="${SUMMARY_audio} dummy"
1078 dnl See if GCC's -fvisibility=hidden is supported (gcc4 and later, usually).
1079 dnl Details of this flag are here: http://gcc.gnu.org/wiki/Visibility
1080 CheckVisibilityHidden()
1082 AC_MSG_CHECKING(for GCC -fvisibility=hidden option)
1083 have_gcc_fvisibility=no
1085 visibility_CFLAGS="-fvisibility=hidden"
1086 save_CFLAGS="$CFLAGS"
1087 CFLAGS="$save_CFLAGS $visibility_CFLAGS -Werror"
1089 #if !defined(__GNUC__) || __GNUC__ < 4
1090 #error SDL only uses visibility attributes in GCC 4 or newer
1094 have_gcc_fvisibility=yes
1096 AC_MSG_RESULT($have_gcc_fvisibility)
1097 CFLAGS="$save_CFLAGS"
1099 if test x$have_gcc_fvisibility = xyes; then
1100 EXTRA_CFLAGS="$EXTRA_CFLAGS $visibility_CFLAGS"
1104 dnl See if GCC's -mpreferred-stack-boundary is supported.
1105 dnl Reference: http://bugzilla.libsdl.org/show_bug.cgi?id=1296
1106 CheckStackBoundary()
1108 AC_MSG_CHECKING(for GCC -mpreferred-stack-boundary option)
1109 have_gcc_preferred_stack_boundary=no
1111 save_CFLAGS="$CFLAGS"
1112 CFLAGS="$save_CFLAGS -mpreferred-stack-boundary=2"
1117 have_gcc_preferred_stack_boundary=yes
1119 AC_MSG_RESULT($have_gcc_preferred_stack_boundary)
1120 CFLAGS="$save_CFLAGS"
1122 if test x$have_gcc_preferred_stack_boundary = xyes; then
1123 EXTRA_CFLAGS="$EXTRA_CFLAGS -mpreferred-stack-boundary=2"
1127 dnl See if GCC's -Wall is supported.
1130 AC_MSG_CHECKING(for GCC -Wall option)
1133 save_CFLAGS="$CFLAGS"
1134 CFLAGS="$save_CFLAGS -Wall"
1141 AC_MSG_RESULT($have_gcc_Wall)
1142 CFLAGS="$save_CFLAGS"
1144 if test x$have_gcc_Wall = xyes; then
1145 EXTRA_CFLAGS="$EXTRA_CFLAGS -Wall"
1147 dnl Haiku headers use multicharacter constants all over the place. Ignore these warnings when using -Wall.
1148 AC_MSG_CHECKING(for necessary GCC -Wno-multichar option)
1149 need_gcc_Wno_multichar=no
1152 need_gcc_Wno_multichar=yes
1155 AC_MSG_RESULT($need_gcc_Wno_multichar)
1156 if test x$need_gcc_Wno_multichar = xyes; then
1157 EXTRA_CFLAGS="$EXTRA_CFLAGS -Wno-multichar"
1162 dnl Check for Wayland
1165 AC_ARG_ENABLE(video-wayland,
1166 AC_HELP_STRING([--enable-video-wayland], [use Wayland video driver [[default=yes]]]),
1167 ,enable_video_wayland=yes)
1169 AC_ARG_ENABLE(video-wayland-qt-touch,
1170 AC_HELP_STRING([--enable-video-wayland-qt-touch], [QtWayland server support for Wayland video driver [[default=yes]]]),
1171 ,enable_video_wayland_qt_touch=yes)
1173 if test x$enable_video = xyes -a x$enable_video_wayland = xyes; then
1174 AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
1175 AC_MSG_CHECKING(for Wayland support)
1177 if test x$PKG_CONFIG != xno && \
1178 test x$video_opengl_egl = xyes && \
1179 test x$video_opengles_v2 = xyes; then
1180 if $PKG_CONFIG --exists wayland-client wayland-egl wayland-cursor egl xkbcommon xdg-shell-client text-client tizen-extension-client ; then
1181 WAYLAND_CFLAGS=`$PKG_CONFIG --cflags wayland-client wayland-egl wayland-cursor xkbcommon xdg-shell-client text-client tizen-extension-client`
1182 WAYLAND_LIBS=`$PKG_CONFIG --libs wayland-client wayland-egl wayland-cursor xkbcommon xdg-shell-client text-client tizen-extension-client`
1186 AC_MSG_RESULT($video_wayland)
1188 if test x$video_wayland = xyes; then
1189 AC_DEFINE(SDL_VIDEO_DRIVER_WAYLAND, 1, [ ])
1190 if test x$enable_video_wayland_qt_touch = xyes; then
1191 AC_DEFINE(SDL_VIDEO_DRIVER_WAYLAND_QT_TOUCH, 1, [ ])
1193 SOURCES="$SOURCES $srcdir/src/video/wayland/*.c"
1194 EXTRA_CFLAGS="$EXTRA_CFLAGS $WAYLAND_CFLAGS"
1195 AC_ARG_ENABLE(wayland-shared,
1196 AC_HELP_STRING([--enable-wayland-shared], [dynamically load Wayland support [[default=maybe]]]),
1197 , enable_wayland_shared=maybe)
1199 dnl FIXME: Do BSD and OS X need special cases?
1202 wayland_client_lib=[`find_lib "libwayland-client.so.*" "$WAYLAND_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`]
1203 wayland_egl_lib=[`find_lib "libwayland-egl.so.*" "$WAYLAND_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`]
1204 if test x$wayland_egl_lib = x; then
1205 dnl This works in Ubuntu 13.10, maybe others
1206 wayland_egl_lib=[`find_lib "mesa-egl/libwayland-egl.so.*" "$WAYLAND_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`]
1208 wayland_cursor_lib=[`find_lib "libwayland-cursor.so.*" "$WAYLAND_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`]
1209 xkbcommon_lib=[`find_lib "libxkbcommon.so.*" "$WAYLAND_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`]
1210 xdg_shell_client_lib=[`find_lib "libxdg-shell-client.so.*" "$WAYLAND_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`]
1211 text_client_lib=[`find_lib "libtext-client.so.*" "$WAYLAND_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`]
1212 tizen_extension_client_lib=[`find_lib "libtizen-extension-client.so.*" "$WAYLAND_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`]
1216 if test x$enable_wayland_shared = xmaybe; then
1217 enable_wayland_shared=yes
1219 if test x$have_loadso != xyes && \
1220 test x$enable_wayland_shared = xyes; then
1221 AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic Wayland loading])
1222 enable_wayland_shared=no
1224 if test x$have_loadso = xyes && \
1225 test x$enable_wayland_shared = xyes && \
1226 test x$wayland_client_lib != x && \
1227 test x$wayland_egl_lib != x && \
1228 test x$wayland_cursor_lib != x && \
1229 test x$xdg_shell_client_lib != x && \
1230 test x$text_client_lib != x && \
1231 test x$tizen_extension_client_lib != x && \
1232 test x$xkbcommon_lib != x; then
1233 echo "-- dynamic libwayland-client -> $wayland_client_lib"
1234 echo "-- dynamic libwayland-egl -> $wayland_egl_lib"
1235 echo "-- dynamic libwayland-cursor -> $wayland_cursor_lib"
1236 echo "-- dynamic libxkbcommon -> $xkbcommon_lib"
1237 echo "-- dynamic libxdg_shell_client -> $xdg_shell_client_lib"
1238 echo "-- dynamic libtext_client -> $xtext_client_lib"
1239 echo "-- dynamic libtizen_extension_client -> $xtizen_extension_client_lib"
1240 AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC, "$wayland_client_lib", [ ])
1241 AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_EGL, "$wayland_egl_lib", [ ])
1242 AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_CURSOR, "$wayland_cursor_lib", [ ])
1243 AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_XKBCOMMON, "$xkbcommon_lib", [ ])
1244 AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_XDGSHELLCLIENT, "$xdg_shell_client_lib", [ ])
1245 AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_TEXTCLIENT, "$text_client_lib", [ ])
1246 AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_TIZENEXTENSIONCLIENT, "$tizen_extension_client_lib", [ ])
1247 SUMMARY_video="${SUMMARY_video} wayland(dynamic)"
1249 enable_wayland_shared=no
1250 EXTRA_LDFLAGS="$EXTRA_LDFLAGS $WAYLAND_LIBS"
1251 SUMMARY_video="${SUMMARY_video} wayland"
1261 AC_ARG_ENABLE(video-tizen,
1262 AC_HELP_STRING([--enable-video-tizen], [use tizen video driver [[default=yes]]]),
1263 ,enable_video_tizen=yes)
1265 if test x$enable_video = xyes -a x$enable_video_tizen = xyes; then
1266 AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
1267 AC_MSG_CHECKING(for Tizen support)
1269 if test x$PKG_CONFIG != xno && \
1270 test x$video_opengl_egl = xyes && \
1271 test x$video_opengles_v2 = xyes; then
1272 if $PKG_CONFIG --exists wayland-client wayland-egl ecore ecore-wayland eina capi-appfw-application capi-system-system-settings ecore-input dlog ecore-imf; then
1273 TIZEN_CFLAGS=`$PKG_CONFIG --cflags wayland-client wayland-egl ecore ecore-wayland eina capi-appfw-application capi-system-system-settings ecore-input dlog ecore-imf`
1274 TIZEN_LIBS=`$PKG_CONFIG --libs wayland-client wayland-egl ecore ecore-wayland eina capi-appfw-application capi-system-system-settings ecore-input dlog ecore-imf`
1279 AC_MSG_RESULT($video_tizen)
1281 if test x$video_tizen = xyes; then
1282 AC_DEFINE(SDL_VIDEO_DRIVER_TIZEN, 1, [ ])
1283 SOURCES="$SOURCES $srcdir/src/video/tizen/*.c"
1284 SOURCES="$SOURCES $srcdir/src/core/tizen/*.c"
1285 SDLMAIN_SOURCES="$srcdir/src/main/tizen/*.c"
1287 SDL_CFLAGS="$SDL_CFLAGS -Dmain=SDL_main"
1288 SDL_LIBS="-lSDL2main $SDL_LIBS"
1290 EXTRA_CFLAGS="$EXTRA_CFLAGS $TIZEN_CFLAGS -DTIZEN"
1291 EXTRA_LDFLAGS="$EXTRA_LDFLAGS $TIZEN_LIBS"
1292 SUMMARY_video="${SUMMARY_video} tizen"
1301 AC_ARG_ENABLE(video-mir,
1302 AC_HELP_STRING([--enable-video-mir], [use Mir video driver [[default=yes]]]),
1303 ,enable_video_mir=yes)
1305 if test x$enable_video = xyes -a x$enable_video_mir = xyes; then
1306 AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
1307 AC_MSG_CHECKING(for Mir support)
1309 if test x$PKG_CONFIG != xno; then
1310 if $PKG_CONFIG --exists mirclient egl xkbcommon ; then
1311 MIR_CFLAGS=`$PKG_CONFIG --cflags mirclient egl xkbcommon`
1312 MIR_LIBS=`$PKG_CONFIG --libs mirclient egl xkbcommon`
1313 save_CFLAGS="$CFLAGS"
1314 CFLAGS="$save_CFLAGS $MIR_CFLAGS"
1316 dnl This will disable Mir on Ubuntu < 14.04
1318 #include <mir_toolkit/mir_client_library.h>
1320 MirMotionToolType tool = mir_motion_tool_type_mouse;
1324 CFLAGS="$save_CFLAGS"
1327 AC_MSG_RESULT($video_mir)
1329 if test x$video_mir = xyes; then
1330 AC_DEFINE(SDL_VIDEO_DRIVER_MIR, 1, [ ])
1331 SOURCES="$SOURCES $srcdir/src/video/mir/*.c"
1332 EXTRA_CFLAGS="$EXTRA_CFLAGS $MIR_CFLAGS"
1333 AC_ARG_ENABLE(mir-shared,
1334 AC_HELP_STRING([--enable-mir-shared], [dynamically load Mir support [[default=maybe]]]),
1335 , enable_mir_shared=maybe)
1337 dnl FIXME: Do BSD and OS X need special cases?
1340 mirclient_lib=[`find_lib "libmirclient.so.*" "$MIR_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`]
1341 xkbcommon_lib=[`find_lib "libxkbcommon.so.*" "$MIR_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`]
1345 if test x$enable_mir_shared = xmaybe; then
1346 enable_mir_shared=yes
1348 if test x$have_loadso != xyes && \
1349 test x$enable_mir_shared = xyes; then
1350 AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic Mir loading])
1351 enable_mir_shared=no
1353 if test x$have_loadso = xyes && \
1354 test x$enable_mir_shared = xyes && \
1355 test x$mirclient_lib != x && \
1356 test x$xkbcommon_lib != x; then
1357 echo "-- dynamic libmirclient -> $mirclient_lib"
1358 echo "-- dynamic libxkbcommon -> $xkbcommon_lib"
1359 AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_MIR_DYNAMIC, "$mirclient_lib", [ ])
1360 AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_MIR_DYNAMIC_XKBCOMMON, "$xkbcommon_lib", [ ])
1361 SUMMARY_video="${SUMMARY_video} mir(dynamic)"
1363 enable_mir_shared=no
1364 EXTRA_LDFLAGS="$EXTRA_LDFLAGS $MIR_LIBS"
1365 SUMMARY_video="${SUMMARY_video} mir"
1372 dnl Check for Native Client stuff
1376 #if !defined(__native_client__)
1381 AC_DEFINE(SDL_VIDEO_DRIVER_NACL)
1382 AC_DEFINE(SDL_AUDIO_DRIVER_NACL)
1383 AC_DEFINE(HAVE_POW, 1, [ ])
1384 AC_DEFINE(HAVE_OPENGLES2, 1, [ ])
1385 AC_DEFINE(SDL_VIDEO_OPENGL_ES2, 1, [ ])
1386 AC_DEFINE(SDL_VIDEO_RENDER_OGL_ES2, 1, [ ])
1388 SDL_LIBS="-lppapi_simple -lppapi_gles2 $SDL_LIBS"
1390 SDLMAIN_SOURCES="$srcdir/src/main/nacl/*.c"
1391 SOURCES="$SOURCES $srcdir/src/audio/nacl/*.c"
1392 SUMMARY_audio="${SUMMARY_audio} nacl"
1393 SOURCES="$SOURCES $srcdir/src/video/nacl/*.c"
1394 SUMMARY_video="${SUMMARY_video} nacl opengles2"
1399 dnl Find the X11 include and library directories
1404 AC_ARG_ENABLE(video-x11,
1405 AC_HELP_STRING([--enable-video-x11], [use X11 video driver [[default=yes]]]),
1406 , enable_video_x11=yes)
1407 if test x$enable_video = xyes -a x$enable_video_x11 = xyes; then
1410 # This isn't necessary for X11, but fixes GLX detection
1411 if test "x$x_includes" = xNONE && \
1412 test "x$x_libraries" = xNONE && \
1413 test -d /usr/X11R6/include && \
1414 test -d /usr/X11R6/lib; then
1415 x_includes="/usr/X11R6/include"
1416 x_libraries="/usr/X11R6/lib"
1422 if test x$have_x = xyes; then
1423 AC_ARG_ENABLE(x11-shared,
1424 AC_HELP_STRING([--enable-x11-shared], [dynamically load X11 support [[default=maybe]]]),
1425 , enable_x11_shared=maybe)
1429 x11_lib='/usr/X11R6/lib/libX11.6.dylib'
1430 x11ext_lib='/usr/X11R6/lib/libXext.6.dylib'
1431 xcursor_lib='/usr/X11R6/lib/libXcursor.1.dylib'
1432 xinerama_lib='/usr/X11R6/lib/libXinerama.1.dylib'
1433 xinput_lib='/usr/X11R6/lib/libXi.6.dylib'
1434 xrandr_lib='/usr/X11R6/lib/libXrandr.2.dylib'
1435 xrender_lib='/usr/X11R6/lib/libXrender.1.dylib'
1436 xss_lib='/usr/X11R6/lib/libXss.1.dylib'
1437 xvidmode_lib='/usr/X11R6/lib/libXxf86vm.1.dylib'
1441 x11ext_lib='libXext.so'
1442 xcursor_lib='libXcursor.so'
1443 xinerama_lib='libXinerama.so'
1444 xinput_lib='libXi.so'
1445 xrandr_lib='libXrandr.so'
1446 xrender_lib='libXrender.so'
1448 xvidmode_lib='libXxf86vm.so'
1451 x11_lib=[`find_lib "libX11.so.*" "$X_LIBS -L/usr/X11/$base_libdir -L/usr/X11R6/$base_libdir" | sed 's/.*\/\(.*\)/\1/; q'`]
1452 x11ext_lib=[`find_lib "libXext.so.*" "$X_LIBS -L/usr/X11/$base_libdir -L/usr/X11R6/$base_libdir" | sed 's/.*\/\(.*\)/\1/; q'`]
1453 xcursor_lib=[`find_lib "libXcursor.so.*" "$X_LIBS -L/usr/X11/$base_libdir -L/usr/X11R6/$base_libdir" | sed 's/.*\/\(.*\)/\1/; q'`]
1454 xinerama_lib=[`find_lib "libXinerama.so.*" "$X_LIBS -L/usr/X11/$base_libdir -L/usr/X11R6/$base_libdir" | sed 's/.*\/\(.*\)/\1/; q'`]
1455 xinput_lib=[`find_lib "libXi.so.*" "$X_LIBS -L/usr/X11/$base_libdir -L/usr/X11R6/$base_libdir" | sed 's/.*\/\(.*\)/\1/; q'`]
1456 xrandr_lib=[`find_lib "libXrandr.so.*" "$X_LIBS -L/usr/X11/$base_libdir -L/usr/X11R6/$base_libdir" | sed 's/.*\/\(.*\)/\1/; q'`]
1457 xrender_lib=[`find_lib "libXrender.so.*" "$X_LIBS -L/usr/X11/$base_libdir -L/usr/X11R6/$base_libdir" | sed 's/.*\/\(.*\)/\1/; q'`]
1458 xss_lib=[`find_lib "libXss.so.*" "$X_LIBS -L/usr/X11/$base_libdir -L/usr/X11R6/$base_libdir" | sed 's/.*\/\(.*\)/\1/; q'`]
1459 xvidmode_lib=[`find_lib "libXxf86vm.so.*" "$X_LIBS -L/usr/X11/$base_libdir -L/usr/X11R6/$base_libdir" | sed 's/.*\/\(.*\)/\1/; q'`]
1463 if test x$ac_cv_func_shmat != xyes; then
1464 X_CFLAGS="$X_CFLAGS -DNO_SHARED_MEMORY"
1466 CFLAGS="$CFLAGS $X_CFLAGS"
1467 LDFLAGS="$LDFLAGS $X_LIBS"
1469 AC_CHECK_HEADER(X11/extensions/Xext.h,
1470 have_xext_h_hdr=yes,
1472 [#include <X11/Xlib.h>
1473 #include <X11/Xproto.h>
1475 if test x$have_xext_h_hdr != xyes; then
1477 *** Missing Xext.h, maybe you need to install the libxext-dev package?
1481 AC_DEFINE(SDL_VIDEO_DRIVER_X11, 1, [ ])
1482 SOURCES="$SOURCES $srcdir/src/video/x11/*.c"
1483 EXTRA_CFLAGS="$EXTRA_CFLAGS $X_CFLAGS"
1485 # Needed so SDL applications can include SDL_syswm.h
1486 SDL_CFLAGS="$SDL_CFLAGS $X_CFLAGS"
1488 if test x$enable_x11_shared = xmaybe; then
1489 enable_x11_shared=yes
1491 if test x$have_loadso != xyes && \
1492 test x$enable_x11_shared = xyes; then
1493 AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic X11 loading])
1494 enable_x11_shared=no
1496 if test x$have_loadso = xyes && \
1497 test x$enable_x11_shared = xyes && test x$x11_lib != x && test x$x11ext_lib != x; then
1498 echo "-- dynamic libX11 -> $x11_lib"
1499 echo "-- dynamic libX11ext -> $x11ext_lib"
1500 AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_X11_DYNAMIC, "$x11_lib", [ ])
1501 AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_X11_DYNAMIC_XEXT, "$x11ext_lib", [ ])
1502 SUMMARY_video="${SUMMARY_video} x11(dynamic)"
1504 enable_x11_shared=no
1505 EXTRA_LDFLAGS="$EXTRA_LDFLAGS $X_LIBS -lX11 -lXext"
1506 SUMMARY_video="${SUMMARY_video} x11"
1510 AC_MSG_CHECKING(for const parameter to XextAddDisplay)
1511 have_const_param_XextAddDisplay=no
1513 #include <X11/Xlib.h>
1514 #include <X11/Xproto.h>
1515 #include <X11/extensions/Xext.h>
1516 #include <X11/extensions/extutil.h>
1517 extern XExtDisplayInfo* XextAddDisplay(XExtensionInfo* a,Display* b,_Xconst char* c,XExtensionHooks* d,int e,XPointer f);
1520 have_const_param_XextAddDisplay=yes
1521 AC_DEFINE(SDL_VIDEO_DRIVER_X11_CONST_PARAM_XEXTADDDISPLAY)
1523 AC_MSG_RESULT($have_const_param_XextAddDisplay)
1525 dnl AC_CHECK_LIB(X11, XGetEventData, AC_DEFINE(SDL_VIDEO_DRIVER_X11_SUPPORTS_GENERIC_EVENTS, 1, [Have XGenericEvent]))
1526 AC_MSG_CHECKING([for XGenericEvent])
1527 have_XGenericEvent=no
1529 #include <X11/Xlib.h>
1533 XGenericEventCookie *cookie = &event.xcookie;
1534 XNextEvent(display, &event);
1535 XGetEventData(display, cookie);
1536 XFreeEventData(display, cookie);
1538 have_XGenericEvent=yes
1539 AC_DEFINE(SDL_VIDEO_DRIVER_X11_SUPPORTS_GENERIC_EVENTS)
1541 AC_MSG_RESULT($have_XGenericEvent)
1543 AC_CHECK_LIB(X11, XkbKeycodeToKeysym, AC_DEFINE(SDL_VIDEO_DRIVER_X11_HAS_XKBKEYCODETOKEYSYM, 1, [Have XkbKeycodeToKeysym]))
1545 AC_ARG_ENABLE(video-x11-xcursor,
1546 AC_HELP_STRING([--enable-video-x11-xcursor], [enable X11 Xcursor support [[default=yes]]]),
1547 , enable_video_x11_xcursor=yes)
1548 if test x$enable_video_x11_xcursor = xyes; then
1549 definitely_enable_video_x11_xcursor=no
1550 AC_CHECK_HEADER(X11/Xcursor/Xcursor.h,
1551 have_xcursor_h_hdr=yes,
1552 have_xcursor_h_hdr=no,
1553 [#include <X11/Xlib.h>
1555 if test x$have_xcursor_h_hdr = xyes; then
1556 if test x$enable_x11_shared = xyes && test x$xcursor_lib != x ; then
1557 echo "-- dynamic libXcursor -> $xcursor_lib"
1558 AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_X11_DYNAMIC_XCURSOR, "$xcursor_lib", [ ])
1559 definitely_enable_video_x11_xcursor=yes
1561 AC_CHECK_LIB(Xcursor, XcursorImageCreate, have_xcursor_lib=yes)
1562 if test x$have_xcursor_lib = xyes ; then
1563 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lXcursor"
1564 definitely_enable_video_x11_xcursor=yes
1569 if test x$definitely_enable_video_x11_xcursor = xyes; then
1570 AC_DEFINE(SDL_VIDEO_DRIVER_X11_XCURSOR, 1, [ ])
1571 SUMMARY_video_x11="${SUMMARY_video_x11} xcursor"
1573 AC_ARG_ENABLE(video-x11-xdbe,
1574 AC_HELP_STRING([--enable-video-x11-xdbe], [enable X11 Xdbe support [[default=yes]]]),
1575 , enable_video_x11_xdbe=yes)
1576 if test x$enable_video_x11_xdbe = xyes; then
1577 AC_CHECK_HEADER(X11/extensions/Xdbe.h,
1580 [#include <X11/Xlib.h>
1582 if test x$have_dbe_h_hdr = xyes; then
1583 AC_DEFINE(SDL_VIDEO_DRIVER_X11_XDBE, 1, [ ])
1584 SUMMARY_video_x11="${SUMMARY_video_x11} xdbe"
1587 AC_ARG_ENABLE(video-x11-xinerama,
1588 AC_HELP_STRING([--enable-video-x11-xinerama], [enable X11 Xinerama support [[default=yes]]]),
1589 , enable_video_x11_xinerama=yes)
1590 if test x$enable_video_x11_xinerama = xyes; then
1591 definitely_enable_video_x11_xinerama=no
1592 AC_CHECK_HEADER(X11/extensions/Xinerama.h,
1593 have_xinerama_h_hdr=yes,
1594 have_xinerama_h_hdr=no,
1595 [#include <X11/Xlib.h>
1597 if test x$have_xinerama_h_hdr = xyes; then
1598 if test x$enable_x11_shared = xyes && test x$xinerama_lib != x ; then
1599 echo "-- dynamic libXinerama -> $xinerama_lib"
1600 AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_X11_DYNAMIC_XINERAMA, "$xinerama_lib", [ ])
1601 definitely_enable_video_x11_xinerama=yes
1603 AC_CHECK_LIB(Xinerama, XineramaQueryExtension, have_xinerama_lib=yes)
1604 if test x$have_xinerama_lib = xyes ; then
1605 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lXinerama"
1606 definitely_enable_video_x11_xinerama=yes
1611 if test x$definitely_enable_video_x11_xinerama = xyes; then
1612 AC_DEFINE(SDL_VIDEO_DRIVER_X11_XINERAMA, 1, [ ])
1613 SUMMARY_video_x11="${SUMMARY_video_x11} xinerama"
1615 AC_ARG_ENABLE(video-x11-xinput,
1616 AC_HELP_STRING([--enable-video-x11-xinput], [enable X11 XInput extension for manymouse, tablets, etc [[default=yes]]]),
1617 , enable_video_x11_xinput=yes)
1618 if test x$enable_video_x11_xinput = xyes; then
1619 definitely_enable_video_x11_xinput=no
1620 AC_CHECK_HEADER(X11/extensions/XInput2.h,
1621 have_xinput_h_hdr=yes,
1622 have_xinput_h_hdr=no,
1623 [#include <X11/Xlib.h>
1625 if test x$have_xinput_h_hdr = xyes; then
1626 if test x$enable_x11_shared = xyes && test x$xinput_lib != x ; then
1627 echo "-- dynamic libXi -> $xinput_lib"
1628 AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_X11_DYNAMIC_XINPUT2, "$xinput_lib", [ ])
1629 definitely_enable_video_x11_xinput=yes
1631 AC_CHECK_LIB(Xi, XOpenDevice, have_xinput_lib=yes)
1632 if test x$have_xinput_lib = xyes ; then
1633 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lXi"
1634 definitely_enable_video_x11_xinput=yes
1639 if test x$definitely_enable_video_x11_xinput = xyes; then
1640 SUMMARY_video_x11="${SUMMARY_video_x11} xinput2"
1641 AC_DEFINE(SDL_VIDEO_DRIVER_X11_XINPUT2, 1, [ ])
1642 AC_MSG_CHECKING(for xinput2 multitouch)
1643 have_xinput2_multitouch=no
1645 #include <X11/Xlib.h>
1646 #include <X11/Xproto.h>
1647 #include <X11/extensions/XInput2.h>
1649 int event_type = XI_TouchBegin;
1650 XITouchClassInfo *t;
1652 have_xinput2_multitouch=yes
1653 AC_DEFINE(SDL_VIDEO_DRIVER_X11_XINPUT2_SUPPORTS_MULTITOUCH)
1654 SUMMARY_video_x11="${SUMMARY_video_x11} xinput2_multitouch"
1656 AC_MSG_RESULT($have_xinput2_multitouch)
1658 AC_ARG_ENABLE(video-x11-xrandr,
1659 AC_HELP_STRING([--enable-video-x11-xrandr], [enable X11 Xrandr extension for fullscreen [[default=yes]]]),
1660 , enable_video_x11_xrandr=yes)
1661 if test x$enable_video_x11_xrandr = xyes; then
1662 dnl XRRScreenResources is only present in Xrandr >= 1.2, we use that as a test.
1663 definitely_enable_video_x11_xrandr=no
1664 have_xrandr_h_hdr=no
1666 #include <X11/Xlib.h>
1667 #include <X11/extensions/Xrandr.h>
1669 XRRScreenResources *res = NULL;
1671 have_xrandr_h_hdr=yes
1673 if test x$have_xrandr_h_hdr = xyes; then
1674 if test x$enable_x11_shared = xyes && test x$xrandr_lib != x ; then
1675 echo "-- dynamic libXrandr -> $xrandr_lib"
1676 AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_X11_DYNAMIC_XRANDR, "$xrandr_lib", [ ])
1677 definitely_enable_video_x11_xrandr=yes
1679 AC_CHECK_LIB(Xrandr, XRRQueryExtension, have_xrandr_lib=yes)
1680 if test x$have_xrandr_lib = xyes ; then
1681 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lXrandr"
1682 definitely_enable_video_x11_xrandr=yes
1687 if test x$definitely_enable_video_x11_xrandr = xyes; then
1688 AC_DEFINE(SDL_VIDEO_DRIVER_X11_XRANDR, 1, [ ])
1689 SUMMARY_video_x11="${SUMMARY_video_x11} xrandr"
1691 AC_ARG_ENABLE(video-x11-scrnsaver,
1692 AC_HELP_STRING([--enable-video-x11-scrnsaver], [enable X11 screensaver extension [[default=yes]]]),
1693 , enable_video_x11_scrnsaver=yes)
1694 if test x$enable_video_x11_scrnsaver = xyes; then
1695 AC_CHECK_HEADER(X11/extensions/scrnsaver.h,
1696 have_scrnsaver_h_hdr=yes,
1697 have_scrnsaver_h_hdr=no,
1698 [#include <X11/Xlib.h>
1700 if test x$have_scrnsaver_h_hdr = xyes; then
1701 if test x$enable_x11_shared = xyes && test x$xss_lib != x ; then
1702 echo "-- dynamic libXss -> $xss_lib"
1703 AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_X11_DYNAMIC_XSS, "$xss_lib", [ ])
1704 definitely_enable_video_x11_scrnsaver=yes
1706 AC_CHECK_LIB(Xss, XScreenSaverSuspend, have_xss_lib=yes)
1707 if test x$have_xss_lib = xyes ; then
1708 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lXss"
1709 definitely_enable_video_x11_scrnsaver=yes
1714 if test x$definitely_enable_video_x11_scrnsaver = xyes; then
1715 AC_DEFINE(SDL_VIDEO_DRIVER_X11_XSCRNSAVER, 1, [ ])
1716 SUMMARY_video_x11="${SUMMARY_video_x11} xscrnsaver"
1718 AC_ARG_ENABLE(video-x11-xshape,
1719 AC_HELP_STRING([--enable-video-x11-xshape], [enable X11 XShape support [[default=yes]]]),
1720 , enable_video_x11_xshape=yes)
1721 if test x$enable_video_x11_xshape = xyes; then
1722 AC_CHECK_HEADER(X11/extensions/shape.h,
1723 have_shape_h_hdr=yes,
1724 have_shape_h_hdr=no,
1725 [#include <X11/Xlib.h>
1727 if test x$have_shape_h_hdr = xyes; then
1728 AC_DEFINE(SDL_VIDEO_DRIVER_X11_XSHAPE, 1, [ ])
1729 SUMMARY_video_x11="${SUMMARY_video_x11} xshape"
1732 AC_ARG_ENABLE(video-x11-vm,
1733 AC_HELP_STRING([--enable-video-x11-vm], [use X11 VM extension for fullscreen [[default=yes]]]),
1734 , enable_video_x11_vm=yes)
1735 if test x$enable_video_x11_vm = xyes; then
1736 definitely_enable_video_x11_vm=no
1737 AC_CHECK_HEADER(X11/extensions/xf86vmode.h,
1740 [#include <X11/Xlib.h>
1742 if test x$have_vm_h_hdr = xyes; then
1743 if test x$enable_x11_shared = xyes && test x$xvidmode_lib != x ; then
1744 echo "-- dynamic libXxf86vm -> $xvidmode_lib"
1745 AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_X11_DYNAMIC_XVIDMODE, "$xvidmode_lib", [ ])
1746 definitely_enable_video_x11_vm=yes
1748 AC_CHECK_LIB(Xxf86vm, XF86VidModeQueryVersion, have_vm_lib=yes)
1749 if test x$have_vm_lib = xyes ; then
1750 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lXxf86vm"
1751 definitely_enable_video_x11_vm=yes
1756 if test x$definitely_enable_video_x11_vm = xyes; then
1757 AC_DEFINE(SDL_VIDEO_DRIVER_X11_XVIDMODE, 1, [ ])
1758 SUMMARY_video_x11="${SUMMARY_video_x11} xvidmode"
1764 dnl Set up the Vivante video driver if enabled
1767 AC_ARG_ENABLE(video-vivante,
1768 AC_HELP_STRING([--enable-video-vivante], [use Vivante EGL video driver [[default=yes]]]),
1769 , enable_video_vivante=yes)
1770 if test x$enable_video = xyes -a x$enable_video_vivante = xyes; then
1771 AC_MSG_CHECKING(for Vivante VDK API)
1779 have_vivante_vdk=yes
1781 AC_MSG_RESULT($have_vivante_vdk)
1783 AC_MSG_CHECKING(for Vivante FB API)
1788 #include <EGL/eglvivante.h>
1791 have_vivante_egl=yes
1793 AC_MSG_RESULT($have_vivante_egl)
1795 if test x$have_vivante_vdk = xyes -o x$have_vivante_egl = xyes; then
1796 AC_DEFINE(SDL_VIDEO_DRIVER_VIVANTE, 1, [ ])
1797 EXTRA_CFLAGS="$EXTRA_CFLAGS -DLINUX -DEGL_API_FB"
1798 if test x$have_vivante_vdk = xyes; then
1799 AC_DEFINE(SDL_VIDEO_DRIVER_VIVANTE_VDK, 1, [ ])
1800 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lVDK"
1802 SOURCES="$SOURCES $srcdir/src/video/vivante/*.c"
1803 SUMMARY_video="${SUMMARY_video} vivante"
1809 dnl Set up the Haiku video driver if enabled
1812 if test x$enable_video = xyes; then
1813 AC_DEFINE(SDL_VIDEO_DRIVER_HAIKU, 1, [ ])
1814 SOURCES="$SOURCES $srcdir/src/video/haiku/*.cc"
1816 SUMMARY_video="${SUMMARY_video} haiku"
1820 dnl Set up the Cocoa video driver for Mac OS X (but not Darwin)
1823 AC_ARG_ENABLE(video-cocoa,
1824 AC_HELP_STRING([--enable-video-cocoa], [use Cocoa video driver [[default=yes]]]),
1825 , enable_video_cocoa=yes)
1826 if test x$enable_video = xyes -a x$enable_video_cocoa = xyes; then
1827 save_CFLAGS="$CFLAGS"
1828 dnl work around that we don't have Objective-C support in autoconf
1829 CFLAGS="$CFLAGS -x objective-c"
1830 AC_MSG_CHECKING(for Cocoa framework)
1833 #import <Cocoa/Cocoa.h>
1838 AC_MSG_RESULT($have_cocoa)
1839 CFLAGS="$save_CFLAGS"
1840 if test x$have_cocoa = xyes; then
1841 AC_DEFINE(SDL_VIDEO_DRIVER_COCOA, 1, [ ])
1842 SOURCES="$SOURCES $srcdir/src/video/cocoa/*.m"
1843 SUMMARY_video="${SUMMARY_video} cocoa"
1852 AC_ARG_ENABLE(video-directfb,
1853 AC_HELP_STRING([--enable-video-directfb], [use DirectFB video driver [[default=no]]]),
1854 , enable_video_directfb=no)
1855 if test x$enable_video = xyes -a x$enable_video_directfb = xyes; then
1858 DIRECTFB_REQUIRED_VERSION=1.0.0
1859 AC_PATH_PROGS(DIRECTFBCONFIG, directfb-config, no, [$prefix/bin:$PATH])
1860 if test x$DIRECTFBCONFIG = xno; then
1861 AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
1862 if test x$PKG_CONFIG != xno; then
1863 if $PKG_CONFIG --atleast-pkgconfig-version 0.7 && $PKG_CONFIG --atleast-version $DIRECTFB_REQUIRED_VERSION directfb; then
1864 DIRECTFB_CFLAGS=`$PKG_CONFIG --cflags directfb`
1865 DIRECTFB_LIBS=`$PKG_CONFIG --libs directfb`
1866 DIRECTFB_PREFIX=`$PKG_CONFIG --variable=prefix directfb`
1871 set -- `echo $DIRECTFB_REQUIRED_VERSION | sed 's/\./ /g'`
1872 NEED_VERSION=`expr $1 \* 10000 + $2 \* 100 + $3`
1873 set -- `$DIRECTFBCONFIG --version | sed 's/\./ /g'`
1874 HAVE_VERSION=`expr $1 \* 10000 + $2 \* 100 + $3`
1875 if test $HAVE_VERSION -ge $NEED_VERSION; then
1876 DIRECTFB_CFLAGS=`$DIRECTFBCONFIG --cflags`
1877 DIRECTFB_LIBS=`$DIRECTFBCONFIG --libs`
1878 DIRECTFB_PREFIX=`$DIRECTFBCONFIG --prefix`
1882 if test x$video_directfb = xyes; then
1883 # SuSE 11.1 installs directfb-config without directfb-devel
1884 save_CPPFLAGS="$CPPFLAGS"
1885 CPPFLAGS="$CPPFLAGS $DIRECTFB_CFLAGS"
1886 AC_CHECK_HEADER(directfb.h, have_directfb_hdr=yes, have_directfb_hdr=no)
1887 CPPFLAGS="$save_CPPFLAGS"
1888 video_directfb=$have_directfb_hdr
1890 AC_MSG_CHECKING(for DirectFB $DIRECTFB_REQUIRED_VERSION support)
1891 AC_MSG_RESULT($video_directfb)
1893 if test x$video_directfb = xyes; then
1894 AC_ARG_ENABLE(directfb-shared,
1895 AC_HELP_STRING([--enable-directfb-shared], [dynamically load directfb support [[default=yes]]]),
1896 , enable_directfb_shared=yes)
1898 AC_DEFINE(SDL_VIDEO_DRIVER_DIRECTFB, 1, [ ])
1899 AC_DEFINE(SDL_VIDEO_RENDER_DIRECTFB, 1, [ ])
1900 SOURCES="$SOURCES $srcdir/src/video/directfb/*.c"
1901 EXTRA_CFLAGS="$EXTRA_CFLAGS $DIRECTFB_CFLAGS"
1903 AC_MSG_CHECKING(for directfb dynamic loading support)
1905 directfb_lib=[`find_lib "libdirectfb.so.*" "$DIRECTFB_LIBS"`]
1906 # | sed 's/.*\/\(.*\)/\1/; q'`]
1907 AC_MSG_WARN("directfb $directfb_lib")
1908 if test x$have_loadso != xyes && \
1909 test x$enable_directfb_shared = xyes; then
1910 AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic directfb loading])
1912 if test x$have_loadso = xyes && \
1913 test x$enable_directfb_shared = xyes && test x$directfb_lib != x; then
1915 echo "-- $directfb_lib_spec -> $directfb_lib"
1916 AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_DIRECTFB_DYNAMIC, "$directfb_lib", [ ])
1917 SUMMARY_video="${SUMMARY_video} directfb(dynamic)"
1919 EXTRA_LDFLAGS="$EXTRA_LDFLAGS $DIRECTFB_LIBS"
1920 SUMMARY_video="${SUMMARY_video} directfb"
1922 AC_MSG_RESULT($directfb_shared)
1923 SDL_CFLAGS="$SDL_CFLAGS $DIRECTFB_CFLAGS"
1929 dnl Find FusionSound
1932 AC_ARG_ENABLE(fusionsound,
1933 AC_HELP_STRING([--enable-fusionsound], [use FusionSound audio driver [[default=no]]]),
1934 , enable_fusionsound=no)
1935 if test x$enable_audio = xyes -a x$enable_fusionsound = xyes; then
1938 FUSIONSOUND_REQUIRED_VERSION=1.1.1
1940 AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
1941 AC_MSG_CHECKING(for FusionSound $FUSIONSOUND_REQUIRED_VERSION support)
1942 if test x$PKG_CONFIG != xno; then
1943 if $PKG_CONFIG --atleast-pkgconfig-version 0.7 && $PKG_CONFIG --atleast-version $FUSIONSOUND_REQUIRED_VERSION fusionsound; then
1944 FUSIONSOUND_CFLAGS=`$PKG_CONFIG --cflags fusionsound`
1945 FUSIONSOUND_LIBS=`$PKG_CONFIG --libs fusionsound`
1949 AC_MSG_RESULT($fusionsound)
1951 if test x$fusionsound = xyes; then
1952 AC_DEFINE(SDL_AUDIO_DRIVER_FUSIONSOUND, 1, [ ])
1953 SOURCES="$SOURCES $srcdir/src/audio/fusionsound/*.c"
1954 EXTRA_CFLAGS="$EXTRA_CFLAGS $FUSIONSOUND_CFLAGS"
1956 AC_ARG_ENABLE(fusionsound-shared,
1957 AC_HELP_STRING([--enable-fusionsound-shared], [dynamically load fusionsound audio support [[default=yes]]]),
1958 , enable_fusionsound_shared=yes)
1959 fusionsound_shared=no
1960 AC_MSG_CHECKING(for FusionSound dynamic loading support)
1961 if test x$have_loadso != xyes && \
1962 test x$enable_fusionsound_shared = xyes; then
1963 AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic fusionsound loading])
1965 if test x$have_loadso = xyes && \
1966 test x$enable_fusionsound_shared = xyes; then
1967 AC_DEFINE_UNQUOTED(SDL_AUDIO_DRIVER_FUSIONSOUND_DYNAMIC, "libfusionsound.so", [ ])
1968 fusionsound_shared=yes
1969 SUMMARY_audio="${SUMMARY_audio} fusionsound(dynamic)"
1971 EXTRA_LDFLAGS="$EXTRA_LDFLAGS $FUSIONSOUND_LIBS"
1972 SUMMARY_audio="${SUMMARY_audio} fusionsound"
1974 AC_MSG_RESULT($fusionsound_shared)
1981 dnl rcg04172001 Set up the Null video driver.
1984 AC_ARG_ENABLE(video-dummy,
1985 AC_HELP_STRING([--enable-video-dummy], [use dummy video driver [[default=yes]]]),
1986 , enable_video_dummy=yes)
1987 if test x$enable_video_dummy = xyes; then
1988 AC_DEFINE(SDL_VIDEO_DRIVER_DUMMY, 1, [ ])
1989 SOURCES="$SOURCES $srcdir/src/video/dummy/*.c"
1991 SUMMARY_video="${SUMMARY_video} dummy"
1995 dnl Check to see if OpenGL support is desired
1996 AC_ARG_ENABLE(video-opengl,
1997 AC_HELP_STRING([--enable-video-opengl], [include OpenGL support [[default=yes]]]),
1998 , enable_video_opengl=yes)
2003 if test x$enable_video = xyes -a x$enable_video_opengl = xyes; then
2004 AC_MSG_CHECKING(for OpenGL (GLX) support)
2013 AC_MSG_RESULT($video_opengl)
2014 if test x$video_opengl = xyes; then
2015 AC_DEFINE(SDL_VIDEO_OPENGL, 1, [ ])
2016 AC_DEFINE(SDL_VIDEO_OPENGL_GLX, 1, [ ])
2017 AC_DEFINE(SDL_VIDEO_RENDER_OGL, 1, [ ])
2018 SUMMARY_video="${SUMMARY_video} opengl"
2023 dnl Check to see if OpenGL ES support is desired
2024 AC_ARG_ENABLE(video-opengles,
2025 AC_HELP_STRING([--enable-video-opengles], [include OpenGL ES support [[default=yes]]]),
2026 , enable_video_opengles=yes)
2027 AC_ARG_ENABLE(video-opengles1,
2028 AC_HELP_STRING([--enable-video-opengles1], [include OpenGL ES 1.1 support [[default=yes]]]),
2029 , enable_video_opengles1=yes)
2030 AC_ARG_ENABLE(video-opengles2,
2031 AC_HELP_STRING([--enable-video-opengles2], [include OpenGL ES 2.0 support [[default=yes]]]),
2032 , enable_video_opengles2=yes)
2033 AC_ARG_ENABLE(video-vulkan,
2034 AC_HELP_STRING([--enable-video-vulkan], [include Vulkan support [[default=yes]]]),
2035 , enable_video_vulkan=yes)
2041 if test x$enable_video = xyes -a x$enable_video_opengles = xyes; then
2042 AC_MSG_CHECKING(for EGL support)
2047 #include <EGL/egl.h>
2048 #include <EGL/eglext.h>
2051 video_opengl_egl=yes
2053 AC_MSG_RESULT($video_opengl_egl)
2054 if test x$video_opengl_egl = xyes; then
2055 AC_DEFINE(SDL_VIDEO_OPENGL_EGL, 1, [ ])
2058 if test x$enable_video_opengles1 = xyes; then
2059 AC_MSG_CHECKING(for OpenGL ES v1 headers)
2060 video_opengles_v1=no
2062 #include <GLES/gl.h>
2063 #include <GLES/glext.h>
2066 video_opengles_v1=yes
2068 AC_MSG_RESULT($video_opengles_v1)
2069 if test x$video_opengles_v1 = xyes; then
2070 AC_DEFINE(SDL_VIDEO_OPENGL_ES, 1, [ ])
2071 AC_DEFINE(SDL_VIDEO_RENDER_OGL_ES, 1, [ ])
2072 SUMMARY_video="${SUMMARY_video} opengl_es1"
2076 if test x$enable_video_opengles2 = xyes; then
2077 AC_MSG_CHECKING(for OpenGL ES v2 headers)
2078 video_opengles_v2=no
2080 #include <GLES2/gl2.h>
2081 #include <GLES2/gl2ext.h>
2084 video_opengles_v2=yes
2086 AC_MSG_RESULT($video_opengles_v2)
2087 if test x$video_opengles_v2 = xyes; then
2088 AC_DEFINE(SDL_VIDEO_OPENGL_ES2, 1, [ ])
2089 AC_DEFINE(SDL_VIDEO_RENDER_OGL_ES2, 1, [ ])
2090 SUMMARY_video="${SUMMARY_video} opengl_es2"
2096 dnl Check for Windows OpenGL
2099 if test x$enable_video = xyes -a x$enable_video_opengl = xyes; then
2100 AC_DEFINE(SDL_VIDEO_OPENGL, 1, [ ])
2101 AC_DEFINE(SDL_VIDEO_OPENGL_WGL, 1, [ ])
2102 AC_DEFINE(SDL_VIDEO_RENDER_OGL, 1, [ ])
2103 SUMMARY_video="${SUMMARY_video} opengl"
2107 dnl Check for Windows OpenGL
2110 if test x$enable_video = xyes -a x$enable_video_opengles = xyes; then
2112 AC_MSG_CHECKING(for EGL support)
2115 #include <EGL/egl.h>
2118 video_opengl_egl=yes
2120 AC_MSG_RESULT($video_opengl_egl)
2121 if test x$video_opengl_egl = xyes; then
2122 AC_DEFINE(SDL_VIDEO_OPENGL, 1, [ ])
2123 AC_DEFINE(SDL_VIDEO_OPENGL_EGL, 1, [ ])
2124 SUMMARY_video="${SUMMARY_video} opengl_es1"
2127 AC_MSG_CHECKING(for OpenGL ES v2 headers)
2128 video_opengles_v2=no
2130 #include <GLES2/gl2.h>
2131 #include <GLES2/gl2ext.h>
2134 video_opengles_v2=yes
2136 AC_MSG_RESULT($video_opengles_v2)
2137 if test x$video_opengles_v2 = xyes; then
2138 AC_DEFINE(SDL_VIDEO_OPENGL, 1, [ ])
2139 AC_DEFINE(SDL_VIDEO_OPENGL_ES2, 1, [ ])
2140 AC_DEFINE(SDL_VIDEO_RENDER_OGL_ES2, 1, [ ])
2141 SUMMARY_video="${SUMMARY_video} opengl_es2"
2146 dnl Check for Haiku OpenGL
2149 if test x$enable_video = xyes -a x$enable_video_opengl = xyes; then
2150 AC_DEFINE(SDL_VIDEO_OPENGL, 1, [ ])
2151 AC_DEFINE(SDL_VIDEO_OPENGL_HAIKU, 1, [ ])
2152 AC_DEFINE(SDL_VIDEO_RENDER_OGL, 1, [ ])
2153 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lGL"
2154 SUMMARY_video="${SUMMARY_video} opengl"
2158 dnl Check for MacOS OpenGL
2161 if test x$enable_video = xyes -a x$enable_video_opengl = xyes; then
2162 AC_DEFINE(SDL_VIDEO_OPENGL, 1, [ ])
2163 AC_DEFINE(SDL_VIDEO_OPENGL_CGL, 1, [ ])
2164 AC_DEFINE(SDL_VIDEO_RENDER_OGL, 1, [ ])
2165 SUMMARY_video="${SUMMARY_video} opengl"
2169 CheckEmscriptenGLES()
2171 if test x$enable_video = xyes -a x$enable_video_opengles = xyes; then
2172 AC_MSG_CHECKING(for EGL support)
2175 #include <EGL/egl.h>
2178 video_opengl_egl=yes
2180 AC_MSG_RESULT($video_opengl_egl)
2181 if test x$video_opengl_egl = xyes; then
2182 AC_DEFINE(SDL_VIDEO_OPENGL_EGL, 1, [ ])
2185 AC_MSG_CHECKING(for OpenGL ES v2 headers)
2186 video_opengles_v2=no
2188 #include <GLES2/gl2.h>
2189 #include <GLES2/gl2ext.h>
2192 video_opengles_v2=yes
2194 AC_MSG_RESULT($video_opengles_v2)
2195 if test x$video_opengles_v2 = xyes; then
2196 AC_DEFINE(SDL_VIDEO_OPENGL_ES2, 1, [ ])
2197 AC_DEFINE(SDL_VIDEO_RENDER_OGL_ES2, 1, [ ])
2198 SUMMARY_video="${SUMMARY_video} opengl_es2"
2203 dnl Check for Tizen Vulkan
2206 if test x$enable_video = xyes -a x$enable_video_vulkan = xyes; then
2207 AC_MSG_CHECKING(for Vulkan support)
2210 #include <vulkan/vulkan.h>
2215 AC_MSG_RESULT($video_vulkan)
2216 if test x$video_vulkan = xyes; then
2217 AC_DEFINE(SDL_VIDEO_VULKAN, 1, [ ])
2218 SUMMARY_video="${SUMMARY_video} vulkan"
2219 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lvulkan"
2224 dnl See if we can use the new unified event interface in Linux 2.4
2227 dnl Check for Linux 2.4 unified input event interface support
2228 AC_MSG_CHECKING(for Linux 2.4 unified input interface)
2231 #include <linux/input.h>
2234 #error EVIOCGNAME() ioctl not available
2237 use_input_events=yes
2239 AC_MSG_RESULT($use_input_events)
2240 if test x$use_input_events = xyes; then
2241 AC_DEFINE(SDL_INPUT_LINUXEV, 1, [ ])
2242 SUMMARY_input="${SUMMARY_input} linuxev"
2246 dnl See if we can use the kernel kd.h header
2250 AC_MSG_CHECKING(for Linux kd.h)
2253 #include <linux/kd.h>
2254 #include <linux/keyboard.h>
2257 kbe.kb_table = KG_CTRL;
2258 ioctl(0, KDGKBENT, &kbe);
2262 AC_MSG_RESULT($use_input_kd)
2263 if test x$use_input_kd = xyes; then
2264 AC_DEFINE(SDL_INPUT_LINUXKD, 1, [ ])
2265 SUMMARY_input="${SUMMARY_input} linuxkd"
2269 dnl See if the platform offers libudev for device enumeration and hotplugging.
2272 AC_ARG_ENABLE(libudev,
2273 AC_HELP_STRING([--enable-libudev], [enable libudev support [[default=yes]]]),
2274 , enable_libudev=yes)
2275 if test x$enable_libudev = xyes; then
2276 AC_CHECK_HEADER(libudev.h,
2277 have_libudev_h_hdr=yes,
2278 have_libudev_h_hdr=no)
2279 if test x$have_libudev_h_hdr = xyes; then
2280 AC_DEFINE(HAVE_LIBUDEV_H, 1, [ ])
2285 dnl See if the platform offers libdbus for various IPC techniques.
2289 AC_HELP_STRING([--enable-dbus], [enable D-Bus support [[default=yes]]]),
2291 if test x$enable_dbus = xyes; then
2292 AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
2293 if test x$PKG_CONFIG != xno; then
2294 DBUS_CFLAGS=`$PKG_CONFIG --cflags dbus-1`
2295 save_CFLAGS="$CFLAGS"
2296 CFLAGS="$save_CFLAGS $DBUS_CFLAGS"
2297 AC_CHECK_HEADER(dbus/dbus.h,
2298 have_dbus_dbus_h_hdr=yes,
2299 have_dbus_dbus_h_hdr=no)
2300 CFLAGS="$save_CFLAGS"
2301 if test x$have_dbus_dbus_h_hdr = xyes; then
2302 AC_DEFINE(HAVE_DBUS_DBUS_H, 1, [ ])
2303 EXTRA_CFLAGS="$EXTRA_CFLAGS $DBUS_CFLAGS"
2304 SOURCES="$SOURCES $srcdir/src/core/linux/SDL_dbus.c"
2310 dnl See if the platform has libibus IME support.
2314 AC_HELP_STRING([--enable-ibus], [enable IBus support [[default=yes]]]),
2316 if test x$enable_ibus = xyes; then
2317 AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
2318 if test x$PKG_CONFIG != xno; then
2319 IBUS_CFLAGS=`$PKG_CONFIG --cflags ibus-1.0`
2320 save_CFLAGS="$CFLAGS"
2321 CFLAGS="$save_CFLAGS $IBUS_CFLAGS"
2322 AC_CHECK_HEADER(ibus-1.0/ibus.h,
2323 have_ibus_ibus_h_hdr=yes,
2324 have_ibus_ibus_h_hdr=no)
2325 AC_CHECK_HEADER(sys/inotify.h,
2326 have_inotify_inotify_h_hdr=yes,
2327 have_inotify_inotify_h_hdr=no)
2328 CFLAGS="$save_CFLAGS"
2329 if test x$have_ibus_ibus_h_hdr = xyes; then
2330 if test x$enable_dbus != xyes; then
2331 AC_MSG_WARN([DBus support is required for IBus.])
2332 have_ibus_ibus_h_hdr=no
2333 elif test x$have_inotify_inotify_h_hdr != xyes; then
2334 AC_MSG_WARN([INotify support is required for IBus.])
2335 have_ibus_ibus_h_hdr=no
2337 AC_DEFINE(HAVE_IBUS_IBUS_H, 1, [ ])
2338 EXTRA_CFLAGS="$EXTRA_CFLAGS $IBUS_CFLAGS"
2339 SOURCES="$SOURCES $srcdir/src/core/linux/SDL_ibus.c"
2346 dnl See if we can use the Touchscreen input library
2349 AC_ARG_ENABLE(input-tslib,
2350 AC_HELP_STRING([--enable-input-tslib], [use the Touchscreen library for input [[default=yes]]]),
2351 , enable_input_tslib=yes)
2352 if test x$enable_input_tslib = xyes; then
2353 AC_MSG_CHECKING(for Touchscreen library support)
2354 enable_input_tslib=no
2359 enable_input_tslib=yes
2361 AC_MSG_RESULT($enable_input_tslib)
2362 if test x$enable_input_tslib = xyes; then
2363 AC_DEFINE(SDL_INPUT_TSLIB, 1, [ ])
2364 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lts"
2365 SUMMARY_input="${SUMMARY_input} ts"
2370 dnl See what type of thread model to use on Linux and Solaris
2373 dnl Check for pthread support
2374 AC_ARG_ENABLE(pthreads,
2375 AC_HELP_STRING([--enable-pthreads], [use POSIX threads for multi-threading [[default=yes]]]),
2376 , enable_pthreads=yes)
2377 dnl This is used on Linux for glibc binary compatibility (Doh!)
2378 AC_ARG_ENABLE(pthread-sem,
2379 AC_HELP_STRING([--enable-pthread-sem], [use pthread semaphores [[default=yes]]]),
2380 , enable_pthread_sem=yes)
2383 pthread_cflags="-D_REENTRANT -D_THREAD_SAFE"
2386 *-*-linux*|*-*-uclinux*)
2387 pthread_cflags="-D_REENTRANT"
2388 pthread_lib="-lpthread"
2391 pthread_cflags="-D_REENTRANT -D_THREAD_SAFE"
2395 pthread_cflags="-D_THREAD_SAFE"
2396 # causes Carbon.p complaints?
2397 # pthread_cflags="-D_REENTRANT -D_THREAD_SAFE"
2399 *-*-freebsd*|*-*-dragonfly*)
2400 pthread_cflags="-D_REENTRANT -D_THREAD_SAFE"
2401 pthread_lib="-pthread"
2404 pthread_cflags="-D_REENTRANT -D_THREAD_SAFE"
2405 pthread_lib="-lpthread"
2408 pthread_cflags="-D_REENTRANT"
2409 pthread_lib="-pthread"
2412 # From Solaris 9+, posix4's preferred name is rt.
2413 pthread_cflags="-D_REENTRANT"
2414 pthread_lib="-lpthread -lrt"
2417 # Solaris 10+ merged pthread into libc.
2418 pthread_cflags="-D_REENTRANT"
2422 # Solaris 11+ merged rt into libc.
2423 pthread_cflags="-D_REENTRANT"
2427 pthread_cflags="-D_REENTRANT -Kthread"
2431 pthread_cflags="-D_REENTRANT -mthreads"
2432 pthread_lib="-lpthread"
2435 pthread_cflags="-D_REENTRANT"
2436 pthread_lib="-L/usr/lib -lpthread"
2439 pthread_cflags="-D_REENTRANT"
2443 pthread_cflags="-D_REENTRANT"
2444 pthread_lib="-lpthread"
2447 if test x$enable_threads = xyes -a x$enable_pthreads = xyes; then
2448 # Save the original compiler flags and libraries
2449 ac_save_cflags="$CFLAGS"; ac_save_libs="$LIBS"
2450 # Add the pthread compiler flags and libraries
2451 CFLAGS="$CFLAGS $pthread_cflags"; LIBS="$LIBS $pthread_lib"
2452 # Check to see if we have pthread support on this system
2453 AC_MSG_CHECKING(for pthreads)
2456 #include <pthread.h>
2458 pthread_attr_t type;
2459 pthread_attr_init(&type);
2463 AC_MSG_RESULT($use_pthreads)
2464 # Restore the compiler flags and libraries
2465 CFLAGS="$ac_save_cflags"; LIBS="$ac_save_libs"
2467 # Do futher testing if we have pthread support...
2468 if test x$use_pthreads = xyes; then
2469 AC_DEFINE(SDL_THREAD_PTHREAD, 1, [ ])
2470 EXTRA_CFLAGS="$EXTRA_CFLAGS $pthread_cflags"
2471 EXTRA_LDFLAGS="$EXTRA_LDFLAGS $pthread_lib"
2472 SDL_CFLAGS="$SDL_CFLAGS $pthread_cflags"
2474 # Save the original compiler flags and libraries
2475 ac_save_cflags="$CFLAGS"; ac_save_libs="$LIBS"
2476 # Add the pthread compiler flags and libraries
2477 CFLAGS="$CFLAGS $pthread_cflags"; LIBS="$LIBS $pthread_lib"
2479 # Check to see if recursive mutexes are available
2480 AC_MSG_CHECKING(for recursive mutexes)
2481 has_recursive_mutexes=no
2482 if test x$has_recursive_mutexes = xno; then
2484 #define _GNU_SOURCE 1
2485 #include <pthread.h>
2487 pthread_mutexattr_t attr;
2488 pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
2490 has_recursive_mutexes=yes
2491 AC_DEFINE(SDL_THREAD_PTHREAD_RECURSIVE_MUTEX, 1, [ ])
2494 if test x$has_recursive_mutexes = xno; then
2496 #define _GNU_SOURCE 1
2497 #include <pthread.h>
2499 pthread_mutexattr_t attr;
2500 pthread_mutexattr_setkind_np(&attr, PTHREAD_MUTEX_RECURSIVE_NP);
2502 has_recursive_mutexes=yes
2503 AC_DEFINE(SDL_THREAD_PTHREAD_RECURSIVE_MUTEX_NP, 1, [ ])
2506 AC_MSG_RESULT($has_recursive_mutexes)
2508 # Check to see if pthread semaphore support is missing
2509 if test x$enable_pthread_sem = xyes; then
2510 AC_MSG_CHECKING(for pthread semaphores)
2513 #include <pthread.h>
2514 #include <semaphore.h>
2517 have_pthread_sem=yes
2519 AC_MSG_RESULT($have_pthread_sem)
2521 if test x$have_pthread_sem = xyes; then
2522 AC_MSG_CHECKING(for sem_timedwait)
2523 have_sem_timedwait=no
2525 #include <pthread.h>
2526 #include <semaphore.h>
2528 sem_timedwait(NULL, NULL);
2530 have_sem_timedwait=yes
2531 AC_DEFINE(HAVE_SEM_TIMEDWAIT)
2533 AC_MSG_RESULT($have_sem_timedwait)
2536 AC_CHECK_HEADER(pthread_np.h, have_pthread_np_h=yes, have_pthread_np_h=no, [ #include <pthread.h> ])
2537 if test x$have_pthread_np_h = xyes; then
2538 AC_DEFINE(HAVE_PTHREAD_NP_H, 1, [ ])
2541 # Check to see if pthread naming is available
2542 AC_MSG_CHECKING(for pthread_setname_np)
2543 AC_TRY_LINK_FUNC(pthread_setname_np, [
2544 has_pthread_setname_np=yes
2545 AC_DEFINE(HAVE_PTHREAD_SETNAME_NP, 1, [ ])
2547 has_pthread_setname_np=no
2549 AC_MSG_RESULT($has_pthread_setname_np)
2551 AC_MSG_CHECKING(for pthread_set_name_np)
2552 AC_TRY_LINK_FUNC(pthread_set_name_np, [
2553 has_pthread_set_name_np=yes
2554 AC_DEFINE(HAVE_PTHREAD_SET_NAME_NP, 1, [ ])
2556 has_pthread_set_name_np=no
2558 AC_MSG_RESULT($has_pthread_set_name_np)
2560 # Restore the compiler flags and libraries
2561 CFLAGS="$ac_save_cflags"; LIBS="$ac_save_libs"
2563 # Basic thread creation functions
2564 SOURCES="$SOURCES $srcdir/src/thread/pthread/SDL_systhread.c"
2567 # We can fake these with mutexes and condition variables if necessary
2568 if test x$have_pthread_sem = xyes; then
2569 SOURCES="$SOURCES $srcdir/src/thread/pthread/SDL_syssem.c"
2571 SOURCES="$SOURCES $srcdir/src/thread/generic/SDL_syssem.c"
2575 # We can fake these with semaphores if necessary
2576 SOURCES="$SOURCES $srcdir/src/thread/pthread/SDL_sysmutex.c"
2578 # Condition variables
2579 # We can fake these with semaphores and mutexes if necessary
2580 SOURCES="$SOURCES $srcdir/src/thread/pthread/SDL_syscond.c"
2582 # Thread local storage
2583 SOURCES="$SOURCES $srcdir/src/thread/pthread/SDL_systls.c"
2590 dnl Determine whether the compiler can produce Windows executables
2593 AC_MSG_CHECKING(Windows compiler)
2596 #include <windows.h>
2601 AC_MSG_RESULT($have_win32_gcc)
2602 if test x$have_win32_gcc != xyes; then
2604 *** Your compiler ($CC) does not produce Windows executables!
2608 AC_MSG_CHECKING(Windows CE)
2611 #if !defined(_WIN32_WCE) && !defined(__MINGW32CE__)
2612 #error This is not Windows CE
2618 *** Sorry, Windows CE is no longer supported.
2621 AC_MSG_RESULT($have_wince)
2623 # This fixes Windows stack alignment with newer GCC
2627 dnl Find the DirectX includes and libraries
2630 AC_ARG_ENABLE(directx,
2631 AC_HELP_STRING([--enable-directx], [use DirectX for Windows audio/video [[default=yes]]]),
2632 , enable_directx=yes)
2633 if test x$enable_directx = xyes; then
2634 AC_CHECK_HEADER(d3d9.h, have_d3d=yes)
2635 AC_CHECK_HEADER(d3d11_1.h, have_d3d11=yes)
2636 AC_CHECK_HEADER(ddraw.h, have_ddraw=yes)
2637 AC_CHECK_HEADER(dsound.h, have_dsound=yes)
2638 AC_CHECK_HEADER(dinput.h, have_dinput=yes)
2639 AC_CHECK_HEADER(dxgi.h, have_dxgi=yes)
2640 AC_CHECK_HEADER(xaudio2.h, have_xaudio2=yes)
2641 AC_CHECK_HEADER(xinput.h, have_xinput=yes)
2643 if test x$have_ddraw = xyes; then
2644 AC_DEFINE(HAVE_DDRAW_H, 1, [ ])
2646 if test x$have_dinput = xyes; then
2647 AC_DEFINE(HAVE_DINPUT_H, 1, [ ])
2649 if test x$have_dsound = xyes; then
2650 AC_DEFINE(HAVE_DSOUND_H, 1, [ ])
2652 if test x$have_dxgi = xyes; then
2653 AC_DEFINE(HAVE_DXGI_H, 1, [ ])
2655 if test x$have_xinput = xyes; then
2656 AC_DEFINE(HAVE_XINPUT_H, 1, [ ])
2659 SUMMARY_video="${SUMMARY_video} directx"
2660 SUMMARY_audio="${SUMMARY_audio} directx"
2662 # FIXME: latest Cygwin finds dinput headers, but we die on other win32 headers.
2663 # FIXME: ...so force it off for now.
2672 dnl Check for the dlfcn.h interface for dynamically loading objects
2675 AC_ARG_ENABLE(sdl-dlopen,
2676 AC_HELP_STRING([--enable-sdl-dlopen], [use dlopen for shared object loading [[default=yes]]]),
2677 , enable_sdl_dlopen=yes)
2678 if test x$enable_sdl_dlopen = xyes; then
2679 AC_MSG_CHECKING(for dlopen)
2684 void *handle = dlopen("", RTLD_NOW);
2685 const char *loaderror = (char *) dlerror();
2689 AC_MSG_RESULT($have_dlopen)
2691 if test x$have_dlopen = xyes; then
2692 AC_CHECK_LIB(c, dlopen, EXTRA_LDFLAGS="$EXTRA_LDFLAGS",
2693 AC_CHECK_LIB(dl, dlopen, EXTRA_LDFLAGS="$EXTRA_LDFLAGS -ldl",
2694 AC_CHECK_LIB(ltdl, dlopen, EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lltdl")))
2695 AC_DEFINE(SDL_LOADSO_DLOPEN, 1, [ ])
2696 SOURCES="$SOURCES $srcdir/src/loadso/dlopen/*.c"
2702 dnl Check for the usbhid(3) library on *BSD
2707 if test x$enable_joystick = xyes; then
2708 AC_CHECK_LIB(usbhid, hid_init, have_libusbhid=yes)
2709 if test x$have_libusbhid = xyes; then
2710 AC_CHECK_HEADER(usbhid.h, [USB_CFLAGS="-DHAVE_USBHID_H"])
2711 AC_CHECK_HEADER(libusbhid.h, [USB_CFLAGS="-DHAVE_LIBUSBHID_H"])
2712 USB_LIBS="$USB_LIBS -lusbhid"
2714 AC_CHECK_HEADER(usb.h, [USB_CFLAGS="-DHAVE_USB_H"])
2715 AC_CHECK_HEADER(libusb.h, [USB_CFLAGS="-DHAVE_LIBUSB_H"])
2716 AC_CHECK_LIB(usb, hid_init, [USB_LIBS="$USB_LIBS -lusb"])
2719 save_CFLAGS="$CFLAGS"
2720 CFLAGS="$CFLAGS $USB_CFLAGS"
2722 AC_MSG_CHECKING(for usbhid)
2725 #include <sys/types.h>
2726 #if defined(HAVE_USB_H)
2729 #ifdef __DragonFly__
2730 # include <bus/usb/usb.h>
2731 # include <bus/usb/usbhid.h>
2733 # include <dev/usb/usb.h>
2734 # include <dev/usb/usbhid.h>
2736 #if defined(HAVE_USBHID_H)
2738 #elif defined(HAVE_LIBUSB_H)
2740 #elif defined(HAVE_LIBUSBHID_H)
2741 #include <libusbhid.h>
2744 struct report_desc *repdesc;
2745 struct usb_ctl_report *repbuf;
2750 AC_MSG_RESULT($have_usbhid)
2752 if test x$have_usbhid = xyes; then
2753 AC_MSG_CHECKING(for ucr_data member of usb_ctl_report)
2754 have_usbhid_ucr_data=no
2756 #include <sys/types.h>
2757 #if defined(HAVE_USB_H)
2760 #ifdef __DragonFly__
2761 # include <bus/usb/usb.h>
2762 # include <bus/usb/usbhid.h>
2764 # include <dev/usb/usb.h>
2765 # include <dev/usb/usbhid.h>
2767 #if defined(HAVE_USBHID_H)
2769 #elif defined(HAVE_LIBUSB_H)
2771 #elif defined(HAVE_LIBUSBHID_H)
2772 #include <libusbhid.h>
2775 struct usb_ctl_report buf;
2776 if (buf.ucr_data) { }
2778 have_usbhid_ucr_data=yes
2780 if test x$have_usbhid_ucr_data = xyes; then
2781 USB_CFLAGS="$USB_CFLAGS -DUSBHID_UCR_DATA"
2783 AC_MSG_RESULT($have_usbhid_ucr_data)
2785 AC_MSG_CHECKING(for new usbhid API)
2788 #include <sys/types.h>
2789 #if defined(HAVE_USB_H)
2792 #ifdef __DragonFly__
2793 #include <bus/usb/usb.h>
2794 #include <bus/usb/usbhid.h>
2796 #include <dev/usb/usb.h>
2797 #include <dev/usb/usbhid.h>
2799 #if defined(HAVE_USBHID_H)
2801 #elif defined(HAVE_LIBUSB_H)
2803 #elif defined(HAVE_LIBUSBHID_H)
2804 #include <libusbhid.h>
2808 hid_start_parse(d, 1, 1);
2812 if test x$have_usbhid_new = xyes; then
2813 USB_CFLAGS="$USB_CFLAGS -DUSBHID_NEW"
2815 AC_MSG_RESULT($have_usbhid_new)
2817 AC_MSG_CHECKING(for struct joystick in machine/joystick.h)
2818 have_machine_joystick=no
2820 #include <machine/joystick.h>
2824 have_machine_joystick=yes
2826 if test x$have_machine_joystick = xyes; then
2827 AC_DEFINE(SDL_JOYSTICK_USBHID_MACHINE_JOYSTICK_H, 1, [ ])
2829 AC_MSG_RESULT($have_machine_joystick)
2831 AC_DEFINE(SDL_JOYSTICK_USBHID, 1, [ ])
2832 SOURCES="$SOURCES $srcdir/src/joystick/bsd/*.c"
2833 EXTRA_CFLAGS="$EXTRA_CFLAGS $USB_CFLAGS"
2834 EXTRA_LDFLAGS="$EXTRA_LDFLAGS $USB_LIBS"
2837 CFLAGS="$save_CFLAGS"
2843 dnl Check for clock_gettime()
2846 AC_ARG_ENABLE(clock_gettime,
2847 AC_HELP_STRING([--enable-clock_gettime], [use clock_gettime() instead of gettimeofday() on UNIX [[default=yes]]]),
2848 , enable_clock_gettime=yes)
2849 if test x$enable_clock_gettime = xyes; then
2850 AC_CHECK_LIB(rt, clock_gettime, have_clock_gettime=yes)
2851 if test x$have_clock_gettime = xyes; then
2852 AC_DEFINE(HAVE_CLOCK_GETTIME, 1, [ ])
2853 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lrt"
2855 AC_CHECK_LIB(c, clock_gettime, have_clock_gettime=yes)
2856 if test x$have_clock_gettime = xyes; then
2857 AC_DEFINE(HAVE_CLOCK_GETTIME, 1, [ ])
2858 EXTRA_LDFLAGS="$EXTRA_LDFLAGS"
2864 dnl Check for a valid linux/version.h
2867 AC_CHECK_HEADER(linux/version.h, have_linux_version_h=yes)
2868 if test x$have_linux_version_h = xyes; then
2869 EXTRA_CFLAGS="$EXTRA_CFLAGS -DHAVE_LINUX_VERSION_H"
2873 dnl Check if we want to use RPATH
2876 AC_ARG_ENABLE(rpath,
2877 AC_HELP_STRING([--enable-rpath], [use an rpath when linking SDL [[default=yes]]]),
2881 dnl Set up the configuration based on the host platform!
2883 *-*-linux*|*-*-uclinux*|*-*-gnu*|*-*-k*bsd*-gnu|*-*-bsdi*|*-*-freebsd*|*-*-dragonfly*|*-*-netbsd*|*-*-openbsd*|*-*-sysv5*|*-*-solaris*|*-*-hpux*|*-*-aix*|*-*-minix*)
2888 RPI_CFLAGS="-I/opt/vc/include -I/opt/vc/include/interface/vcos/pthreads -I/opt/vc/include/interface/vmcs_host/linux"
2889 CFLAGS="$CFLAGS $RPI_CFLAGS"
2890 SDL_CFLAGS="$SDL_CFLAGS $RPI_CFLAGS"
2891 EXTRA_CFLAGS="$EXTRA_CFLAGS $RPI_CFLAGS"
2892 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -L/opt/vc/lib -lbcm_host -ldl"
2894 if test x$enable_video = xyes; then
2895 SOURCES="$SOURCES $srcdir/src/video/raspberry/*.c"
2896 # FIXME: confdefs? Not AC_DEFINE?
2897 $as_echo "#define SDL_VIDEO_DRIVER_RPI 1" >>confdefs.h
2898 SUMMARY_video="${SUMMARY_video} rpi"
2904 ANDROID_CFLAGS="-DGL_GLEXT_PROTOTYPES"
2905 CFLAGS="$CFLAGS $ANDROID_CFLAGS"
2906 SDL_CFLAGS="$SDL_CFLAGS $ANDROID_CFLAGS"
2907 EXTRA_CFLAGS="$EXTRA_CFLAGS $ANDROID_CFLAGS"
2908 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -ldl -lGLESv1_CM -lGLESv2 -llog -landroid"
2910 if test x$enable_video = xyes; then
2911 SOURCES="$SOURCES $srcdir/src/core/android/*.c $srcdir/src/video/android/*.c"
2912 # FIXME: confdefs? Not AC_DEFINE?
2913 $as_echo "#define SDL_VIDEO_DRIVER_ANDROID 1" >>confdefs.h
2914 SUMMARY_video="${SUMMARY_video} android"
2917 *-*-linux*) ARCH=linux ;;
2918 *-*-uclinux*) ARCH=linux ;;
2919 *-*-kfreebsd*-gnu) ARCH=kfreebsd-gnu ;;
2920 *-*-knetbsd*-gnu) ARCH=knetbsd-gnu ;;
2921 *-*-kopenbsd*-gnu) ARCH=kopenbsd-gnu ;;
2922 *-*-gnu*) ARCH=gnu ;; # must be last of the gnu variants
2923 *-*-bsdi*) ARCH=bsdi ;;
2924 *-*-freebsd*) ARCH=freebsd ;;
2925 *-*-dragonfly*) ARCH=freebsd ;;
2926 *-raspberry-netbsd*)
2929 RPI_CFLAGS="-I/usr/pkg/include -I/usr/pkg/include/interface/vcos/pthreads -I/usr/pkg/include/interface/vmcs_host/linux"
2930 CFLAGS="$CFLAGS $RPI_CFLAGS"
2931 SDL_CFLAGS="$SDL_CFLAGS $RPI_CFLAGS"
2932 EXTRA_CFLAGS="$EXTRA_CFLAGS $RPI_CFLAGS"
2933 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-R/usr/pkg/lib -L/usr/pkg/lib -lbcm_host -ldl"
2935 if test x$enable_video = xyes; then
2936 SOURCES="$SOURCES $srcdir/src/video/raspberry/*.c"
2937 $as_echo "#define SDL_VIDEO_DRIVER_RPI 1" >>confdefs.h
2938 SUMMARY_video="${SUMMARY_video} raspberry"
2941 *-*-netbsd*) ARCH=netbsd ;;
2942 *-*-openbsd*) ARCH=openbsd ;;
2943 *-*-sysv5*) ARCH=sysv5 ;;
2944 *-*-solaris*) ARCH=solaris ;;
2945 *-*-hpux*) ARCH=hpux ;;
2946 *-*-aix*) ARCH=aix ;;
2947 *-*-minix*) ARCH=minix ;;
2949 CheckVisibilityHidden
2986 # Set up files for the audio library
2987 if test x$enable_audio = xyes; then
2990 AC_DEFINE(SDL_AUDIO_DRIVER_SUNAUDIO, 1, [ ])
2991 SOURCES="$SOURCES $srcdir/src/audio/sun/*.c"
2994 netbsd) # Don't use this on OpenBSD, it's busted.
2995 AC_DEFINE(SDL_AUDIO_DRIVER_BSD, 1, [ ])
2996 SOURCES="$SOURCES $srcdir/src/audio/bsd/*.c"
3000 AC_DEFINE(SDL_AUDIO_DRIVER_PAUDIO, 1, [ ])
3001 SOURCES="$SOURCES $srcdir/src/audio/paudio/*.c"
3005 AC_DEFINE(SDL_AUDIO_DRIVER_ANDROID, 1, [ ])
3006 SOURCES="$SOURCES $srcdir/src/audio/android/*.c"
3007 SUMMARY_audio="${SUMMARY_audio} android"
3012 # Set up files for the joystick library
3013 if test x$enable_joystick = xyes; then
3016 AC_DEFINE(SDL_JOYSTICK_LINUX, 1, [ ])
3017 SOURCES="$SOURCES $srcdir/src/joystick/linux/*.c"
3021 AC_DEFINE(SDL_JOYSTICK_ANDROID, 1, [ ])
3022 SOURCES="$SOURCES $srcdir/src/joystick/android/*.c"
3027 # Set up files for the haptic library
3028 if test x$enable_haptic = xyes; then
3029 if test x$use_input_events = xyes; then
3032 AC_DEFINE(SDL_HAPTIC_LINUX, 1, [ ])
3033 SOURCES="$SOURCES $srcdir/src/haptic/linux/*.c"
3039 # Set up files for the power library
3040 if test x$enable_power = xyes; then
3043 AC_DEFINE(SDL_POWER_LINUX, 1, [ ])
3044 SOURCES="$SOURCES $srcdir/src/power/linux/*.c"
3048 AC_DEFINE(SDL_POWER_ANDROID, 1, [ ])
3049 SOURCES="$SOURCES $srcdir/src/power/android/*.c"
3054 # Set up files for the filesystem library
3055 if test x$enable_filesystem = xyes; then
3058 AC_DEFINE(SDL_FILESYSTEM_ANDROID, 1, [ ])
3059 SOURCES="$SOURCES $srcdir/src/filesystem/android/*.c"
3063 AC_DEFINE(SDL_FILESYSTEM_UNIX, 1, [ ])
3064 SOURCES="$SOURCES $srcdir/src/filesystem/unix/*.c"
3069 # Set up files for the timer library
3070 if test x$enable_timers = xyes; then
3071 AC_DEFINE(SDL_TIMER_UNIX, 1, [ ])
3072 SOURCES="$SOURCES $srcdir/src/timer/unix/*.c"
3075 # Set up files for udev hotplugging support
3076 if test x$enable_libudev = xyes && test x$have_libudev_h_hdr = xyes; then
3077 SOURCES="$SOURCES $srcdir/src/core/linux/SDL_udev.c"
3079 # Set up files for evdev input
3080 if test x$use_input_events = xyes; then
3081 SOURCES="$SOURCES $srcdir/src/core/linux/SDL_evdev.c"
3084 *-*-cygwin* | *-*-mingw32*)
3086 if test "$build" != "$host"; then # cross-compiling
3087 # Default cross-compile location
3088 ac_default_prefix=/usr/local/cross-tools/$host
3090 # Look for the location of the tools and install there
3091 if test "$BUILD_PREFIX" != ""; then
3092 ac_default_prefix=$BUILD_PREFIX
3103 # Set up the core platform files
3104 SOURCES="$SOURCES $srcdir/src/core/windows/*.c"
3106 # Set up files for the video library
3107 if test x$enable_video = xyes; then
3108 AC_DEFINE(SDL_VIDEO_DRIVER_WINDOWS, 1, [ ])
3109 SOURCES="$SOURCES $srcdir/src/video/windows/*.c"
3111 AC_ARG_ENABLE(render-d3d,
3112 AC_HELP_STRING([--enable-render-d3d], [enable the Direct3D render driver [[default=yes]]]),
3113 , enable_render_d3d=yes)
3114 if test x$enable_render_d3d = xyes -a x$have_d3d = xyes; then
3115 AC_DEFINE(SDL_VIDEO_RENDER_D3D, 1, [ ])
3117 if test x$enable_render_d3d = xyes -a x$have_d3d11 = xyes; then
3118 AC_DEFINE(SDL_VIDEO_RENDER_D3D11, 1, [ ])
3121 # Set up files for the audio library
3122 if test x$enable_audio = xyes; then
3123 AC_DEFINE(SDL_AUDIO_DRIVER_WINMM, 1, [ ])
3124 SOURCES="$SOURCES $srcdir/src/audio/winmm/*.c"
3125 if test x$have_dsound = xyes; then
3126 AC_DEFINE(SDL_AUDIO_DRIVER_DSOUND, 1, [ ])
3127 SOURCES="$SOURCES $srcdir/src/audio/directsound/*.c"
3129 if test x$have_xaudio2 = xyes; then
3130 AC_DEFINE(SDL_AUDIO_DRIVER_XAUDIO2, 1, [ ])
3131 SOURCES="$SOURCES $srcdir/src/audio/xaudio2/*.c"
3135 # Set up files for the joystick library
3136 if test x$enable_joystick = xyes; then
3137 if test x$have_dinput = xyes -o x$have_xinput = xyes; then
3138 if test x$have_xinput = xyes; then
3139 AC_DEFINE(SDL_JOYSTICK_XINPUT, 1, [ ])
3141 if test x$have_dinput = xyes; then
3142 AC_DEFINE(SDL_JOYSTICK_DINPUT, 1, [ ])
3143 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -ldinput8 -ldxguid -ldxerr8"
3146 AC_DEFINE(SDL_JOYSTICK_WINMM, 1, [ ])
3148 SOURCES="$SOURCES $srcdir/src/joystick/windows/*.c"
3151 if test x$enable_haptic = xyes; then
3152 if test x$have_dinput = xyes -o x$have_xinput = xyes; then
3153 if test x$have_xinput = xyes; then
3154 AC_DEFINE(SDL_HAPTIC_XINPUT, 1, [ ])
3156 if test x$have_dinput = xyes; then
3157 AC_DEFINE(SDL_HAPTIC_DINPUT, 1, [ ])
3159 SOURCES="$SOURCES $srcdir/src/haptic/windows/*.c"
3163 if test x$enable_power = xyes; then
3164 AC_DEFINE(SDL_POWER_WINDOWS, 1, [ ])
3165 SOURCES="$SOURCES $srcdir/src/power/windows/SDL_syspower.c"
3168 if test x$enable_filesystem = xyes; then
3169 AC_DEFINE(SDL_FILESYSTEM_WINDOWS, 1, [ ])
3170 SOURCES="$SOURCES $srcdir/src/filesystem/windows/SDL_sysfilesystem.c"
3173 # Set up files for the thread library
3174 if test x$enable_threads = xyes; then
3175 AC_DEFINE(SDL_THREAD_WINDOWS, 1, [ ])
3176 SOURCES="$SOURCES $srcdir/src/thread/windows/*.c"
3177 SOURCES="$SOURCES $srcdir/src/thread/generic/SDL_syscond.c"
3180 # Set up files for the timer library
3181 if test x$enable_timers = xyes; then
3182 AC_DEFINE(SDL_TIMER_WINDOWS, 1, [ ])
3183 SOURCES="$SOURCES $srcdir/src/timer/windows/*.c"
3186 # Set up files for the shared object loading library
3187 if test x$enable_loadso = xyes; then
3188 AC_DEFINE(SDL_LOADSO_WINDOWS, 1, [ ])
3189 SOURCES="$SOURCES $srcdir/src/loadso/windows/*.c"
3192 # Set up the system libraries we need
3193 if test -f /lib/w32api/libuuid.a; then
3194 LIBUUID=/lib/w32api/libuuid.a
3198 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -luser32 -lgdi32 -lwinmm -limm32 -lole32 -loleaut32 -lshell32 -lversion $LIBUUID -static-libgcc"
3199 # The Windows platform requires special setup
3200 VERSION_SOURCES="$srcdir/src/main/windows/*.rc"
3201 SDLMAIN_SOURCES="$srcdir/src/main/windows/*.c"
3202 SDL_CFLAGS="$SDL_CFLAGS -Dmain=SDL_main"
3203 SDL_LIBS="-lSDL2main $SDL_LIBS -mwindows"
3205 # Check to see if this is a mingw or cygwin build
3207 AC_CHECK_LIB(mingw32, main, [have_mingw32=yes])
3208 if test x$have_mingw32 = xyes; then
3209 SDL_LIBS="-lmingw32 $SDL_LIBS"
3211 SDL_LIBS="-lcygwin $SDL_LIBS"
3215 dnl BeOS support removed after SDL 2.0.1. Haiku still works. --ryan.
3218 *** BeOS support has been removed as of SDL 2.0.2.
3224 ac_default_prefix=/boot/system
3232 # Set up files for the audio library
3233 if test x$enable_audio = xyes; then
3234 AC_DEFINE(SDL_AUDIO_DRIVER_HAIKU, 1, [ ])
3235 SOURCES="$SOURCES $srcdir/src/audio/haiku/*.cc"
3238 # Set up files for the joystick library
3239 if test x$enable_joystick = xyes; then
3240 AC_DEFINE(SDL_JOYSTICK_HAIKU, 1, [ ])
3241 SOURCES="$SOURCES $srcdir/src/joystick/haiku/*.cc"
3244 # Set up files for the timer library
3245 if test x$enable_timers = xyes; then
3246 AC_DEFINE(SDL_TIMER_HAIKU, 1, [ ])
3247 SOURCES="$SOURCES $srcdir/src/timer/haiku/*.c"
3250 # Set up files for the shared object loading library
3251 if test x$enable_loadso = xyes; then
3252 AC_DEFINE(SDL_LOADSO_HAIKU, 1, [ ])
3253 SOURCES="$SOURCES $srcdir/src/loadso/haiku/*.c"
3256 # Set up files for the system power library
3257 if test x$enable_power = xyes; then
3258 AC_DEFINE(SDL_POWER_HAIKU, 1, [ ])
3259 SOURCES="$SOURCES $srcdir/src/power/haiku/*.c"
3262 # Set up files for the system filesystem library
3263 if test x$enable_filesystem = xyes; then
3264 AC_DEFINE(SDL_FILESYSTEM_HAIKU, 1, [ ])
3265 SOURCES="$SOURCES $srcdir/src/filesystem/haiku/*.cc"
3268 # The Haiku platform requires special setup.
3269 SOURCES="$srcdir/src/main/haiku/*.cc $SOURCES"
3270 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lroot -lbe -lmedia -lgame -ldevice -ltextencoding"
3273 # iOS - We are not writing anything to confdefs.h because you have to replace
3274 # SDL_config.h for SDL_config_iphoneos.h anyway
3277 CheckVisibilityHidden
3286 # Set up files for the audio library
3287 if test x$enable_audio = xyes; then
3288 SOURCES="$SOURCES $srcdir/src/audio/coreaudio/*.c"
3289 SUMMARY_audio="${SUMMARY_audio} coreaudio"
3292 # Set up files for the joystick library
3293 if test x$enable_joystick = xyes; then
3294 SOURCES="$SOURCES $srcdir/src/joystick/iphoneos/*.m"
3297 # Set up files for the haptic library
3298 #if test x$enable_haptic = xyes; then
3299 # SOURCES="$SOURCES $srcdir/src/haptic/darwin/*.c"
3301 # EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,ForceFeedback"
3303 # Set up files for the power library
3304 if test x$enable_power = xyes; then
3305 SOURCES="$SOURCES $srcdir/src/power/uikit/*.m"
3308 # Set up files for the filesystem library
3309 if test x$enable_filesystem = xyes; then
3310 SOURCES="$SOURCES $srcdir/src/filesystem/cocoa/*.m"
3313 # Set up files for the timer library
3314 if test x$enable_timers = xyes; then
3315 SOURCES="$SOURCES $srcdir/src/timer/unix/*.c"
3318 # Set up additional files for the file library
3319 if test x$enable_file = xyes; then
3320 SOURCES="$SOURCES $srcdir/src/file/cocoa/*.m"
3322 # The iOS platform requires special setup.
3323 SOURCES="$SOURCES $srcdir/src/video/uikit/*.m"
3324 EXTRA_CFLAGS="$EXTRA_CFLAGS -fpascal-strings"
3325 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lm -liconv -lobjc"
3326 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,Foundation"
3327 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,UIKit"
3328 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,OpenGLES"
3329 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,QuartzCore"
3330 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,CoreAudio"
3331 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,AudioToolbox"
3332 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,CoreGraphics"
3333 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,CoreMotion"
3334 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,GameController"
3337 # This could be either full "Mac OS X", or plain "Darwin" which is
3338 # just the OS X kernel sans upper layers like Carbon and Cocoa.
3339 # Next line is broken, and a few files below require Mac OS X (full)
3342 # Mac OS X builds with both the Carbon and OSX APIs at the moment
3343 EXTRA_CFLAGS="$EXTRA_CFLAGS -DTARGET_API_MAC_CARBON"
3344 EXTRA_CFLAGS="$EXTRA_CFLAGS -DTARGET_API_MAC_OSX"
3346 CheckVisibilityHidden
3357 # Set up files for the audio library
3358 if test x$enable_audio = xyes; then
3359 AC_DEFINE(SDL_AUDIO_DRIVER_COREAUDIO, 1, [ ])
3360 SOURCES="$SOURCES $srcdir/src/audio/coreaudio/*.c"
3361 SUMMARY_audio="${SUMMARY_audio} coreaudio"
3364 # Set up files for the joystick library
3365 if test x$enable_joystick = xyes; then
3366 AC_DEFINE(SDL_JOYSTICK_IOKIT, 1, [ ])
3367 SOURCES="$SOURCES $srcdir/src/joystick/darwin/*.c"
3370 # Set up files for the haptic library
3371 if test x$enable_haptic = xyes; then
3372 AC_DEFINE(SDL_HAPTIC_IOKIT, 1, [ ])
3373 SOURCES="$SOURCES $srcdir/src/haptic/darwin/*.c"
3375 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,ForceFeedback"
3377 # Set up files for the power library
3378 if test x$enable_power = xyes; then
3379 AC_DEFINE(SDL_POWER_MACOSX, 1, [ ])
3380 SOURCES="$SOURCES $srcdir/src/power/macosx/*.c"
3383 # Set up files for the filesystem library
3384 if test x$enable_filesystem = xyes; then
3385 AC_DEFINE(SDL_FILESYSTEM_COCOA, 1, [ ])
3386 SOURCES="$SOURCES $srcdir/src/filesystem/cocoa/*.m"
3389 # Set up files for the timer library
3390 if test x$enable_timers = xyes; then
3391 AC_DEFINE(SDL_TIMER_UNIX, 1, [ ])
3392 SOURCES="$SOURCES $srcdir/src/timer/unix/*.c"
3395 # Set up additional files for the file library
3396 if test x$enable_file = xyes; then
3397 SOURCES="$SOURCES $srcdir/src/file/cocoa/*.m"
3399 # The Mac OS X platform requires special setup.
3400 EXTRA_CFLAGS="$EXTRA_CFLAGS -fpascal-strings"
3401 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lobjc"
3402 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,CoreVideo"
3403 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,Cocoa"
3404 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,Carbon"
3405 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,IOKit"
3406 # If audio is used, add the AudioUnit framework
3407 if test x$enable_audio = xyes; then
3408 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,CoreAudio -Wl,-framework,AudioToolbox -Wl,-framework,AudioUnit"
3419 # Set up files for the timer library
3420 if test x$enable_timers = xyes; then
3421 AC_DEFINE(SDL_TIMER_UNIX)
3422 SOURCES="$SOURCES $srcdir/src/timer/unix/*.c"
3426 if test x$enable_filesystem = xyes; then
3427 AC_DEFINE(SDL_FILESYSTEM_NACL, 1, [ ])
3428 SOURCES="$SOURCES $srcdir/src/filesystem/nacl/*.c"
3433 if test x$enable_video = xyes; then
3434 AC_DEFINE(SDL_VIDEO_DRIVER_EMSCRIPTEN, 1, [ ])
3435 SOURCES="$SOURCES $srcdir/src/video/emscripten/*.c"
3437 SUMMARY_video="${SUMMARY_video} emscripten"
3440 if test x$enable_audio = xyes; then
3441 AC_DEFINE(SDL_AUDIO_DRIVER_EMSCRIPTEN, 1, [ ])
3442 SOURCES="$SOURCES $srcdir/src/audio/emscripten/*.c"
3444 SUMMARY_audio="${SUMMARY_audio} emscripten"
3447 CheckVisibilityHidden
3455 # Set up files for the power library
3456 if test x$enable_power = xyes; then
3457 AC_DEFINE(SDL_POWER_EMSCRIPTEN, 1, [ ])
3458 SOURCES="$SOURCES $srcdir/src/power/emscripten/*.c"
3462 # Set up files for the power library
3463 if test x$enable_joystick = xyes; then
3464 AC_DEFINE(SDL_JOYSTICK_EMSCRIPTEN, 1, [ ])
3465 SOURCES="$SOURCES $srcdir/src/joystick/emscripten/*.c"
3469 # Set up files for the filesystem library
3470 if test x$enable_filesystem = xyes; then
3471 AC_DEFINE(SDL_FILESYSTEM_EMSCRIPTEN, 1, [ ])
3472 SOURCES="$SOURCES $srcdir/src/filesystem/emscripten/*.c"
3475 # Set up files for the timer library
3476 if test x$enable_timers = xyes; then
3477 AC_DEFINE(SDL_TIMER_UNIX, 1, [ ])
3478 SOURCES="$SOURCES $srcdir/src/timer/unix/*.c"
3484 *** Unsupported host: Please add to configure.in
3489 dnl Do this on all platforms, after everything else.
3492 # Verify that we have all the platform specific files we need
3494 if test x$have_joystick != xyes; then
3495 if test x$enable_joystick = xyes; then
3496 AC_DEFINE(SDL_JOYSTICK_DISABLED, 1, [ ])
3498 SOURCES="$SOURCES $srcdir/src/joystick/dummy/*.c"
3500 if test x$have_haptic != xyes; then
3501 if test x$enable_haptic = xyes; then
3502 AC_DEFINE(SDL_HAPTIC_DISABLED, 1, [ ])
3504 SOURCES="$SOURCES $srcdir/src/haptic/dummy/*.c"
3506 if test x$have_threads != xyes; then
3507 if test x$enable_threads = xyes; then
3508 AC_DEFINE(SDL_THREADS_DISABLED, 1, [ ])
3510 SOURCES="$SOURCES $srcdir/src/thread/generic/*.c"
3512 if test x$have_timers != xyes; then
3513 if test x$enable_timers = xyes; then
3514 AC_DEFINE(SDL_TIMERS_DISABLED, 1, [ ])
3516 SOURCES="$SOURCES $srcdir/src/timer/dummy/*.c"
3518 if test x$have_filesystem != xyes; then
3519 if test x$enable_filesystem = xyes; then
3520 AC_DEFINE(SDL_FILESYSTEM_DISABLED, 1, [ ])
3522 SOURCES="$SOURCES $srcdir/src/filesystem/dummy/*.c"
3524 if test x$have_loadso != xyes; then
3525 if test x$enable_loadso = xyes; then
3526 AC_DEFINE(SDL_LOADSO_DISABLED, 1, [ ])
3528 SOURCES="$SOURCES $srcdir/src/loadso/dummy/*.c"
3530 if test x$SDLMAIN_SOURCES = x; then
3531 SDLMAIN_SOURCES="$srcdir/src/main/dummy/*.c"
3533 SDLTEST_SOURCES="$srcdir/src/test/*.c"
3535 OBJECTS=`echo $SOURCES`
3536 DEPENDS=`echo $SOURCES | tr ' ' '\n'`
3537 for EXT in asm cc m c S; do
3538 OBJECTS=`echo "$OBJECTS" | sed 's,[[^ ]]*/\([[^ ]]*\)\.'$EXT',$(objects)/\1.lo,g'`
3539 DEPENDS=`echo "$DEPENDS" | sed "s,^\\([[^ ]]*\\)/\\([[^ ]]*\\)\\.$EXT\\$,\\\\
3540 \\$(objects)/\\2.lo: \\1/\\2.$EXT\\\\
3541 \\$(RUN_CMD_CC)\\$(LIBTOOL) --tag=CC --mode=compile \\$(CC) \\$(CFLAGS) \\$(EXTRA_CFLAGS) $DEPENDENCY_TRACKING_OPTIONS -c \\$< -o \\$@,g"`
3544 VERSION_OBJECTS=`echo $VERSION_SOURCES`
3545 VERSION_DEPENDS=`echo $VERSION_SOURCES`
3546 VERSION_OBJECTS=`echo "$VERSION_OBJECTS" | sed 's,[[^ ]]*/\([[^ ]]*\)\.rc,$(objects)/\1.o,g'`
3547 VERSION_DEPENDS=`echo "$VERSION_DEPENDS" | sed "s,\\([[^ ]]*\\)/\\([[^ ]]*\\)\\.rc,\\\\
3548 \\$(objects)/\\2.o: \\1/\\2.rc\\\\
3549 \\$(WINDRES) \\$< \\$@,g"`
3551 SDLMAIN_OBJECTS=`echo $SDLMAIN_SOURCES`
3552 SDLMAIN_DEPENDS=`echo $SDLMAIN_SOURCES`
3553 SDLMAIN_OBJECTS=`echo "$SDLMAIN_OBJECTS" | sed 's,[[^ ]]*/\([[^ ]]*\)\.c,$(objects)/\1.o,g'`
3554 SDLMAIN_DEPENDS=`echo "$SDLMAIN_DEPENDS" | sed "s,\\([[^ ]]*\\)/\\([[^ ]]*\\)\\.c,\\\\
3555 \\$(objects)/\\2.o: \\1/\\2.c\\\\
3556 \\$(RUN_CMD_CC)\\$(LIBTOOL) --tag=CC --mode=compile \\$(CC) \\$(CFLAGS) \\$(EXTRA_CFLAGS) $DEPENDENCY_TRACKING_OPTIONS -c \\$< -o \\$@,g"`
3558 SDLTEST_OBJECTS=`echo $SDLTEST_SOURCES`
3559 SDLTEST_DEPENDS=`echo $SDLTEST_SOURCES`
3560 SDLTEST_OBJECTS=`echo "$SDLTEST_OBJECTS" | sed 's,[[^ ]]*/\([[^ ]]*\)\.c,$(objects)/\1.o,g'`
3561 SDLTEST_DEPENDS=`echo "$SDLTEST_DEPENDS" | sed "s,\\([[^ ]]*\\)/\\([[^ ]]*\\)\\.c,\\\\
3562 \\$(objects)/\\2.o: \\1/\\2.c\\\\
3563 \\$(RUN_CMD_CC)\\$(LIBTOOL) --tag=CC --mode=compile \\$(CC) \\$(CFLAGS) \\$(EXTRA_CFLAGS) $DEPENDENCY_TRACKING_OPTIONS -c \\$< -o \\$@,g"`
3565 # Set runtime shared library paths as needed
3567 if test "x$enable_rpath" = "xyes"; then
3568 if test $ARCH = bsdi -o $ARCH = freebsd -o $ARCH = linux -o $ARCH = netbsd; then
3569 SDL_RLD_FLAGS="-Wl,-rpath,\${libdir}"
3571 if test $ARCH = solaris; then
3572 SDL_RLD_FLAGS="-R\${libdir}"
3578 SDL_STATIC_LIBS="$SDL_LIBS $EXTRA_LDFLAGS"
3580 dnl Expand the cflags and libraries needed by apps using SDL
3581 AC_SUBST(SDL_CFLAGS)
3583 AC_SUBST(SDL_STATIC_LIBS)
3584 AC_SUBST(SDL_RLD_FLAGS)
3585 if test x$enable_shared = xyes; then
3587 ENABLE_SHARED_FALSE="#"
3589 ENABLE_SHARED_TRUE="#"
3590 ENABLE_SHARED_FALSE=
3592 if test x$enable_static = xyes; then
3594 ENABLE_STATIC_FALSE="#"
3596 ENABLE_STATIC_TRUE="#"
3597 ENABLE_STATIC_FALSE=
3599 AC_SUBST(ENABLE_SHARED_TRUE)
3600 AC_SUBST(ENABLE_SHARED_FALSE)
3601 AC_SUBST(ENABLE_STATIC_TRUE)
3602 AC_SUBST(ENABLE_STATIC_FALSE)
3604 dnl Expand the sources and objects needed to build the library
3605 AC_SUBST(ac_aux_dir)
3608 AC_SUBST(VERSION_OBJECTS)
3609 AC_SUBST(SDLMAIN_OBJECTS)
3610 AC_SUBST(SDLTEST_OBJECTS)
3611 AC_SUBST(BUILD_CFLAGS)
3612 AC_SUBST(EXTRA_CFLAGS)
3613 AC_SUBST(BUILD_LDFLAGS)
3614 AC_SUBST(EXTRA_LDFLAGS)
3617 cat >Makefile.rules <<__EOF__
3619 # Build rules for objects
3620 -include \$(OBJECTS:.lo=.d)
3622 # Special dependency for SDL.c, since it depends on SDL_revision.h
3623 $srcdir/src/SDL.c: update-revision
3631 Makefile:Makefile.in:Makefile.rules sdl2-config sdl2-config.cmake SDL2.spec sdl2.pc
3633 AC_CONFIG_COMMANDS([sdl2_config],[chmod a+x sdl2-config])
3635 SUMMARY="SDL2 Configure Summary:\n"
3636 if test x$enable_shared = xyes; then
3637 SUMMARY="${SUMMARY}Building Shared Libraries\n"
3639 if test x$enable_static = xyes; then
3640 SUMMARY="${SUMMARY}Building Static Libraries\n"
3642 SUMMARY="${SUMMARY}Enabled modules :${SUMMARY_modules}\n"
3643 SUMMARY="${SUMMARY}Assembly Math :${SUMMARY_math}\n"
3644 SUMMARY="${SUMMARY}Audio drivers :${SUMMARY_audio}\n"
3645 SUMMARY="${SUMMARY}Video drivers :${SUMMARY_video}\n"
3646 if test x$have_x = xyes; then
3647 SUMMARY="${SUMMARY}X11 libraries :${SUMMARY_video_x11}\n"
3649 SUMMARY="${SUMMARY}Input drivers :${SUMMARY_input}\n"
3650 if test x$enable_libudev = xyes; then
3651 SUMMARY="${SUMMARY}Using libudev : YES\n"
3653 SUMMARY="${SUMMARY}Using libudev : NO\n"
3655 if test x$have_dbus_dbus_h_hdr = xyes; then
3656 SUMMARY="${SUMMARY}Using dbus : YES\n"
3658 SUMMARY="${SUMMARY}Using dbus : NO\n"
3660 if test x$have_ibus_ibus_h_hdr = xyes; then
3661 SUMMARY="${SUMMARY}Using ibus : YES\n"
3663 SUMMARY="${SUMMARY}Using ibus : NO\n"
3665 AC_CONFIG_COMMANDS([summary], [echo -en "$SUMMARY"], [SUMMARY="$SUMMARY"])