1 dnl Process this file with autoconf to produce a configure script.
3 AC_CONFIG_HEADER(include/SDL_config.h)
5 AC_CONFIG_AUX_DIRS($srcdir/build-scripts)
7 dnl Set various version strings - taken gratefully from the GTk sources
10 # Edit include/SDL/SDL_version.h and change the version, then:
11 # SDL_MICRO_VERSION += 1;
12 # SDL_INTERFACE_AGE += 1;
13 # SDL_BINARY_AGE += 1;
14 # if any functions have been added, set SDL_INTERFACE_AGE to 0.
15 # if backwards compatibility has been broken,
16 # set SDL_BINARY_AGE and SDL_INTERFACE_AGE to 0.
23 SDL_VERSION=$SDL_MAJOR_VERSION.$SDL_MINOR_VERSION.$SDL_MICRO_VERSION
25 AC_SUBST(SDL_MAJOR_VERSION)
26 AC_SUBST(SDL_MINOR_VERSION)
27 AC_SUBST(SDL_MICRO_VERSION)
28 AC_SUBST(SDL_INTERFACE_AGE)
29 AC_SUBST(SDL_BINARY_AGE)
35 LT_RELEASE=$SDL_MAJOR_VERSION.$SDL_MINOR_VERSION
36 LT_CURRENT=`expr $SDL_MICRO_VERSION - $SDL_INTERFACE_AGE`
37 LT_REVISION=$SDL_INTERFACE_AGE
38 LT_AGE=`expr $SDL_BINARY_AGE - $SDL_INTERFACE_AGE`
39 m4_pattern_allow([^LT_])
46 dnl Detect the canonical build and host environments
47 AC_CONFIG_AUX_DIR([build-scripts])
50 if test x$ac_cv_c_bigendian = xyes; then
51 AC_DEFINE(SDL_BYTEORDER, 4321)
53 AC_DEFINE(SDL_BYTEORDER, 1234)
62 if test -z "$host_alias"; then
65 hostaliaswindres="$host_alias-windres"
67 AC_CHECK_PROGS(WINDRES, [windres $hostaliaswindres $host_os-windres])
69 dnl Set up the compiler and linker flags
70 INCLUDE="-I$srcdir/include"
71 if test x$srcdir != x.; then
72 # Remove SDL_config.h from the source directory, since it's the
73 # default one, and we want to include the one that we generate.
74 if test -f $srcdir/include/SDL_config.h; then
75 rm $srcdir/include/SDL_config.h
77 INCLUDE="-Iinclude $INCLUDE"
81 # We build SDL on cygwin without the UNIX emulation layer
82 BASE_CFLAGS="-I/usr/include/mingw -mno-cygwin"
83 BASE_LDFLAGS="-mno-cygwin"
86 BASE_CFLAGS="-D_GNU_SOURCE=1"
90 BUILD_CFLAGS="$CFLAGS $CPPFLAGS"
91 EXTRA_CFLAGS="$INCLUDE $BASE_CFLAGS"
92 BUILD_LDFLAGS="$LDFLAGS"
93 EXTRA_LDFLAGS="$BASE_LDFLAGS"
94 ## These are common directories to find software packages
95 #for path in /usr/freeware /usr/pkg /usr/X11R6 /usr/local; do
96 # if test -d $path/include; then
97 # EXTRA_CFLAGS="$EXTRA_CFLAGS -I$path/include"
99 # if test -d $path/lib; then
100 # EXTRA_LDFLAGS="$EXTRA_LDFLAGS -L$path/lib"
103 SDL_CFLAGS="$BASE_CFLAGS"
104 SDL_LIBS="-lSDL $BASE_LDFLAGS"
105 CPPFLAGS="$CPPFLAGS $EXTRA_CFLAGS"
106 CFLAGS="$CFLAGS $EXTRA_CFLAGS"
107 LDFLAGS="$LDFLAGS $EXTRA_LDFLAGS"
109 dnl set this to use on systems that use lib64 instead of lib
110 base_libdir=`echo \${libdir} | sed 's/.*\/\(.*\)/\1/; q'`
112 dnl Function to find a library in the compiler search path
115 gcc_bin_path=[`$CC -print-search-dirs 2>/dev/null | fgrep programs: | sed 's/[^=]*=\(.*\)/\1/' | sed 's/:/ /g'`]
116 gcc_lib_path=[`$CC -print-search-dirs 2>/dev/null | fgrep libraries: | sed 's/[^=]*=\(.*\)/\1/' | sed 's/:/ /g'`]
117 env_lib_path=[`echo $LIBS $LDFLAGS $* | sed 's/-L[ ]*//g'`]
118 if test "$cross_compiling" = yes; then
121 host_lib_path="/usr/$base_libdir /usr/local/$base_libdir"
123 for path in $gcc_bin_path $gcc_lib_path $env_lib_path $host_lib_path; do
124 lib=[`ls -- $path/$1 2>/dev/null | sort | sed 's/.*\/\(.*\)/\1/; q'`]
125 if test x$lib != x; then
132 dnl Check for compiler characteristics
137 dnl See whether we are allowed to use the system C library
139 AC_HELP_STRING([--enable-libc], [Use the system C library [[default=yes]]]),
141 if test x$enable_libc = xyes; then
144 dnl Check for C library headers
146 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)
148 dnl Check for typedefs, structures, etc.
150 if test x$ac_cv_header_inttypes_h = xyes -o x$ac_cv_header_stdint_h = xyes; then
151 AC_CHECK_TYPE(int64_t)
152 if test x$ac_cv_type_int64_t = xyes; then
153 AC_DEFINE(SDL_HAS_64BIT_TYPE)
158 dnl Checks for library functions.
160 *-*-cygwin* | *-*-mingw32*)
168 if test x$ac_cv_func_memcmp_working = xyes; then
169 AC_DEFINE(HAVE_MEMCMP)
172 if test x$ac_cv_func_strtod = xyes; then
173 AC_DEFINE(HAVE_STRTOD)
175 AC_CHECK_FUNC(mprotect,
177 #include <sys/types.h>
178 #include <sys/mman.h>
181 AC_DEFINE(HAVE_MPROTECT)
184 AC_CHECK_FUNCS(malloc calloc realloc free getenv 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 sscanf snprintf vsnprintf iconv sigaction setjmp nanosleep)
186 AC_CHECK_LIB(iconv, libiconv_open, [EXTRA_LDFLAGS="$EXTRA_LDFLAGS -liconv"])
187 AC_CHECK_LIB(m, pow, [EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lm"])
190 if test x$have_inttypes != xyes; then
191 AC_CHECK_SIZEOF(char, 1)
192 AC_CHECK_SIZEOF(short, 2)
193 AC_CHECK_SIZEOF(int, 4)
194 AC_CHECK_SIZEOF(long, 4)
195 AC_CHECK_SIZEOF(long long, 8)
196 if test x$ac_cv_sizeof_char = x1; then
197 AC_DEFINE(int8_t, signed char)
198 AC_DEFINE(uint8_t, unsigned char)
200 if test x$ac_cv_sizeof_short = x2; then
201 AC_DEFINE(int16_t, signed short)
202 AC_DEFINE(uint16_t, unsigned short)
204 if test x$ac_cv_sizeof_int = x2; then
205 AC_DEFINE(int16_t, signed int)
206 AC_DEFINE(uint16_t, unsigned int)
209 if test x$ac_cv_sizeof_int = x4; then
210 AC_DEFINE(int32_t, signed int)
211 AC_DEFINE(uint32_t, unsigned int)
213 if test x$ac_cv_sizeof_long = x4; then
214 AC_DEFINE(int32_t, signed long)
215 AC_DEFINE(uint32_t, unsigned long)
218 if test x$ac_cv_sizeof_long = x8; then
219 AC_DEFINE(int64_t, signed long)
220 AC_DEFINE(uint64_t, unsigned long)
221 AC_DEFINE(SDL_HAS_64BIT_TYPE)
223 if test x$ac_cv_sizeof_long_long = x8; then
224 AC_DEFINE(int64_t, signed long long)
225 AC_DEFINE(uint64_t, unsigned long long)
226 AC_DEFINE(SDL_HAS_64BIT_TYPE)
229 AC_DEFINE(size_t, unsigned int)
230 AC_DEFINE(uintptr_t, unsigned long)
234 SOURCES="$SOURCES $srcdir/src/*.c"
235 SOURCES="$SOURCES $srcdir/src/audio/*.c"
236 SOURCES="$SOURCES $srcdir/src/cdrom/*.c"
237 SOURCES="$SOURCES $srcdir/src/cpuinfo/*.c"
238 SOURCES="$SOURCES $srcdir/src/events/*.c"
239 SOURCES="$SOURCES $srcdir/src/file/*.c"
240 SOURCES="$SOURCES $srcdir/src/stdlib/*.c"
241 SOURCES="$SOURCES $srcdir/src/thread/*.c"
242 SOURCES="$SOURCES $srcdir/src/timer/*.c"
243 SOURCES="$SOURCES $srcdir/src/video/*.c"
245 dnl Enable/disable various subsystems of the SDL library
248 AC_HELP_STRING([--enable-audio], [Enable the audio subsystem [[default=yes]]]),
250 if test x$enable_audio != xyes; then
251 AC_DEFINE(SDL_AUDIO_DISABLED)
254 AC_HELP_STRING([--enable-video], [Enable the video subsystem [[default=yes]]]),
256 if test x$enable_video != xyes; then
257 AC_DEFINE(SDL_VIDEO_DISABLED)
259 AC_ARG_ENABLE(events,
260 AC_HELP_STRING([--enable-events], [Enable the events subsystem [[default=yes]]]),
262 if test x$enable_events != xyes; then
263 AC_DEFINE(SDL_EVENTS_DISABLED)
265 AC_ARG_ENABLE(joystick,
266 AC_HELP_STRING([--enable-joystick], [Enable the joystick subsystem [[default=yes]]]),
267 , enable_joystick=yes)
268 if test x$enable_joystick != xyes; then
269 AC_DEFINE(SDL_JOYSTICK_DISABLED)
271 SOURCES="$SOURCES $srcdir/src/joystick/*.c"
274 AC_HELP_STRING([--enable-cdrom], [Enable the cdrom subsystem [[default=yes]]]),
276 if test x$enable_cdrom != xyes; then
277 AC_DEFINE(SDL_CDROM_DISABLED)
279 AC_ARG_ENABLE(threads,
280 AC_HELP_STRING([--enable-threads], [Enable the threading subsystem [[default=yes]]]),
281 , enable_threads=yes)
282 if test x$enable_threads != xyes; then
283 AC_DEFINE(SDL_THREADS_DISABLED)
285 AC_ARG_ENABLE(timers,
286 AC_HELP_STRING([--enable-timers], [Enable the timer subsystem [[default=yes]]]),
288 if test x$enable_timers != xyes; then
289 AC_DEFINE(SDL_TIMERS_DISABLED)
292 AC_HELP_STRING([--enable-file], [Enable the file subsystem [[default=yes]]]),
294 if test x$enable_file != xyes; then
295 AC_DEFINE(SDL_FILE_DISABLED)
297 AC_ARG_ENABLE(loadso,
298 AC_HELP_STRING([--enable-loadso], [Enable the shared object loading subsystem [[default=yes]]]),
300 if test x$enable_loadso != xyes; then
301 AC_DEFINE(SDL_LOADSO_DISABLED)
303 AC_ARG_ENABLE(cpuinfo,
304 AC_HELP_STRING([--enable-cpuinfo], [Enable the cpuinfo subsystem [[default=yes]]]),
305 , enable_cpuinfo=yes)
306 if test x$enable_cpuinfo != xyes; then
307 AC_DEFINE(SDL_CPUINFO_DISABLED)
309 AC_ARG_ENABLE(assembly,
310 AC_HELP_STRING([--enable-assembly], [Enable assembly routines [[default=yes]]]),
311 , enable_assembly=yes)
312 if test x$enable_assembly = xyes; then
313 AC_DEFINE(SDL_ASSEMBLY_ROUTINES)
316 dnl See if the OSS audio interface is supported
320 AC_HELP_STRING([--enable-oss], [support the OSS audio API [[default=yes]]]),
322 if test x$enable_audio = xyes -a x$enable_oss = xyes; then
323 AC_MSG_CHECKING(for OSS audio support)
325 if test x$have_oss != xyes; then
327 #include <sys/soundcard.h>
329 int arg = SNDCTL_DSP_SETFRAGMENT;
334 if test x$have_oss != xyes; then
336 #include <soundcard.h>
338 int arg = SNDCTL_DSP_SETFRAGMENT;
341 AC_DEFINE(SDL_AUDIO_DRIVER_OSS_SOUNDCARD_H)
344 AC_MSG_RESULT($have_oss)
345 if test x$have_oss = xyes; then
346 AC_DEFINE(SDL_AUDIO_DRIVER_OSS)
347 SOURCES="$SOURCES $srcdir/src/audio/dsp/*.c"
348 SOURCES="$SOURCES $srcdir/src/audio/dma/*.c"
351 # We may need to link with ossaudio emulation library
353 *-*-openbsd*|*-*-netbsd*)
354 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lossaudio";;
360 dnl See if the ALSA audio interface is supported
364 AC_HELP_STRING([--enable-alsa], [support the ALSA audio API [[default=yes]]]),
366 if test x$enable_audio = xyes -a x$enable_alsa = xyes; then
367 AM_PATH_ALSA(0.9.0, have_alsa=yes, have_alsa=no)
368 # Restore all flags from before the ALSA detection runs
369 CFLAGS="$alsa_save_CFLAGS"
370 LDFLAGS="$alsa_save_LDFLAGS"
371 LIBS="$alsa_save_LIBS"
372 if test x$have_alsa = xyes; then
373 AC_ARG_ENABLE(alsa-shared,
374 AC_HELP_STRING([--enable-alsa-shared], [dynamically load ALSA audio support [[default=yes]]]),
375 , enable_alsa_shared=yes)
376 alsa_lib=[`find_lib "libasound.so.*" "$ALSA_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`]
378 AC_DEFINE(SDL_AUDIO_DRIVER_ALSA)
379 SOURCES="$SOURCES $srcdir/src/audio/alsa/*.c"
380 EXTRA_CFLAGS="$EXTRA_CFLAGS $ALSA_CFLAGS"
381 if test x$have_loadso != xyes && \
382 test x$enable_alsa_shared = xyes; then
383 AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic ALSA loading])
385 if test x$have_loadso = xyes && \
386 test x$enable_alsa_shared = xyes && test x$alsa_lib != x; then
387 echo "-- dynamic libasound -> $alsa_lib"
388 AC_DEFINE_UNQUOTED(SDL_AUDIO_DRIVER_ALSA_DYNAMIC, "$alsa_lib")
390 EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ALSA_LIBS"
397 dnl Check whether we want to use IRIX 6.5+ native audio or not
400 if test x$enable_audio = xyes; then
401 AC_MSG_CHECKING(for dmedia audio support)
404 #include <dmedia/audio.h>
410 AC_MSG_RESULT($have_dmedia)
411 # Set up files for the audio library
412 if test x$have_dmedia = xyes; then
413 AC_DEFINE(SDL_AUDIO_DRIVER_DMEDIA)
414 SOURCES="$SOURCES $srcdir/src/audio/dmedia/*.c"
415 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -laudio"
421 dnl Check whether we want to use Tru64 UNIX native audio or not
424 dnl Make sure we are running on an Tru64 UNIX
432 if test x$enable_audio = xyes; then
433 AC_MSG_CHECKING(for MME audio support)
434 MME_CFLAGS="-I/usr/include/mme"
437 save_CFLAGS="$CFLAGS"
438 CFLAGS="$CFLAGS $MME_CFLAGS"
446 CFLAGS="$save_CFLAGS"
447 AC_MSG_RESULT($have_mme)
448 # Set up files for the audio library
449 if test x$have_mme = xyes; then
450 AC_DEFINE(SDL_AUDIO_DRIVER_MMEAUDIO)
451 SOURCES="$SOURCES $srcdir/src/audio/mme/*.c"
452 EXTRA_CFLAGS="$EXTRA_CFLAGS $MME_CFLAGS"
453 EXTRA_LDFLAGS="$EXTRA_LDFLAGS $MME_LIBS"
459 dnl Find the ESD includes and libraries
463 AC_HELP_STRING([--enable-esd], [support the Enlightened Sound Daemon [[default=yes]]]),
465 if test x$enable_audio = xyes -a x$enable_esd = xyes; then
466 AM_PATH_ESD(0.2.8, have_esd=yes, have_esd=no)
467 if test x$have_esd = xyes; then
468 AC_ARG_ENABLE(esd-shared,
469 AC_HELP_STRING([--enable-esd-shared], [dynamically load ESD audio support [[default=yes]]]),
470 , enable_esd_shared=yes)
471 esd_lib=[`find_lib "libesd.so.*" "$ESD_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`]
473 AC_DEFINE(SDL_AUDIO_DRIVER_ESD)
474 SOURCES="$SOURCES $srcdir/src/audio/esd/*.c"
475 EXTRA_CFLAGS="$EXTRA_CFLAGS $ESD_CFLAGS"
476 if test x$have_loadso != xyes && \
477 test x$enable_esd_shared = xyes; then
478 AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic ESD loading])
480 if test x$have_loadso = xyes && \
481 test x$enable_esd_shared = xyes && test x$esd_lib != x; then
482 echo "-- dynamic libesd -> $esd_lib"
483 AC_DEFINE_UNQUOTED(SDL_AUDIO_DRIVER_ESD_DYNAMIC, "$esd_lib")
485 EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ESD_LIBS"
495 AC_ARG_ENABLE(pulseaudio,
496 AC_HELP_STRING([--enable-pulseaudio], [use PulseAudio [[default=yes]]]),
497 , enable_pulseaudio=yes)
498 if test x$enable_audio = xyes -a x$enable_pulseaudio = xyes; then
501 PULSE_REQUIRED_VERSION=0.9
503 AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
504 AC_MSG_CHECKING(for PulseAudio $PULSE_REQUIRED_VERSION support)
505 if test x$PKG_CONFIG != xno; then
506 if $PKG_CONFIG --atleast-pkgconfig-version 0.7 && $PKG_CONFIG --atleast-version $PULSE_REQUIRED_VERSION libpulse-simple; then
507 PULSE_CFLAGS=`$PKG_CONFIG --cflags libpulse-simple`
508 PULSE_LIBS=`$PKG_CONFIG --libs libpulse-simple`
512 AC_MSG_RESULT($audio_pulse)
514 if test x$audio_pulse = xyes; then
515 AC_ARG_ENABLE(pulseaudio-shared,
516 AC_HELP_STRING([--enable-pulseaudio-shared], [dynamically load PulseAudio support [[default=yes]]]),
517 , enable_pulseaudio_shared=yes)
518 pulse_lib=[`find_lib "libpulse-simple.so.*" "$PULSE_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`]
520 AC_DEFINE(SDL_AUDIO_DRIVER_PULSE)
521 SOURCES="$SOURCES $srcdir/src/audio/pulse/*.c"
522 EXTRA_CFLAGS="$EXTRA_CFLAGS $PULSE_CFLAGS"
523 if test x$have_loadso != xyes && \
524 test x$enable_pulseaudio_shared = xyes; then
525 AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic PulseAudio loading])
527 if test x$have_loadso = xyes && \
528 test x$enable_pulseaudio_shared = xyes && test x$pulse_lib != x; then
529 echo "-- dynamic libpulse-simple -> $pulse_lib"
530 AC_DEFINE_UNQUOTED(SDL_AUDIO_DRIVER_PULSE_DYNAMIC, "$pulse_lib")
532 EXTRA_LDFLAGS="$EXTRA_LDFLAGS $PULSE_LIBS"
542 AC_HELP_STRING([--enable-arts], [support the Analog Real Time Synthesizer [[default=yes]]]),
544 if test x$enable_audio = xyes -a x$enable_arts = xyes; then
545 AC_PATH_PROG(ARTSCONFIG, artsc-config)
546 if test x$ARTSCONFIG = x -o x$ARTSCONFIG = x'"$ARTSCONFIG"'; then
547 : # arts isn't installed
549 ARTS_CFLAGS=`$ARTSCONFIG --cflags`
550 ARTS_LIBS=`$ARTSCONFIG --libs`
551 AC_MSG_CHECKING(for aRts development environment)
553 save_CFLAGS="$CFLAGS"
554 CFLAGS="$CFLAGS $ARTS_CFLAGS"
558 arts_stream_t stream;
562 CFLAGS="$save_CFLAGS"
563 AC_MSG_RESULT($audio_arts)
564 if test x$audio_arts = xyes; then
565 AC_ARG_ENABLE(arts-shared,
566 AC_HELP_STRING([--enable-arts-shared], [dynamically load aRts audio support [[default=yes]]]),
567 , enable_arts_shared=yes)
568 arts_lib=[`find_lib "libartsc.so.*" "$ARTS_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`]
570 AC_DEFINE(SDL_AUDIO_DRIVER_ARTS)
571 SOURCES="$SOURCES $srcdir/src/audio/arts/*.c"
572 EXTRA_CFLAGS="$EXTRA_CFLAGS $ARTS_CFLAGS"
573 if test x$have_loadso != xyes && \
574 test x$enable_arts_shared = xyes; then
575 AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic ARTS loading])
577 if test x$have_loadso = xyes && \
578 test x$enable_arts_shared = xyes && test x$arts_lib != x; then
579 echo "-- dynamic libartsc -> $arts_lib"
580 AC_DEFINE_UNQUOTED(SDL_AUDIO_DRIVER_ARTS_DYNAMIC, "$arts_lib")
582 EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ARTS_LIBS"
590 dnl See if the NAS audio interface is supported
594 AC_HELP_STRING([--enable-nas], [support the NAS audio API [[default=yes]]]),
596 if test x$enable_audio = xyes -a x$enable_nas = xyes; then
597 AC_CHECK_HEADER(audio/audiolib.h, have_nas_hdr=yes)
598 AC_CHECK_LIB(audio, AuOpenServer, have_nas_lib=yes)
600 AC_MSG_CHECKING(for NAS audio support)
603 if test x$have_nas_hdr = xyes -a x$have_nas_lib = xyes; then
607 elif test -r /usr/X11R6/include/audio/audiolib.h; then
609 NAS_CFLAGS="-I/usr/X11R6/include/"
610 NAS_LIBS="-L/usr/X11R6/lib -laudio -lXt"
612 dnl On IRIX, the NAS includes are in a different directory,
613 dnl and libnas must be explicitly linked in
615 elif test -r /usr/freeware/include/nas/audiolib.h; then
617 NAS_LIBS="-lnas -lXt"
620 AC_MSG_RESULT($have_nas)
622 if test x$have_nas = xyes; then
623 AC_ARG_ENABLE(nas-shared,
624 AC_HELP_STRING([--enable-nas-shared], [dynamically load NAS audio support [[default=yes]]]),
625 , enable_nas_shared=yes)
626 nas_lib=[`find_lib "libaudio.so.*" "$NAS_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`]
628 if test x$have_loadso != xyes && \
629 test x$enable_nas_shared = xyes; then
630 AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic NAS loading])
632 if test x$have_loadso = xyes && \
633 test x$enable_nas_shared = xyes && test x$nas_lib != x; then
634 echo "-- dynamic libaudio -> $nas_lib"
635 AC_DEFINE_UNQUOTED(SDL_AUDIO_DRIVER_NAS_DYNAMIC, "$nas_lib")
637 EXTRA_LDFLAGS="$EXTRA_LDFLAGS $NAS_LIBS"
640 AC_DEFINE(SDL_AUDIO_DRIVER_NAS)
641 SOURCES="$SOURCES $srcdir/src/audio/nas/*.c"
642 EXTRA_CFLAGS="$EXTRA_CFLAGS $NAS_CFLAGS"
648 dnl rcg07142001 See if the user wants the disk writer audio driver...
651 AC_ARG_ENABLE(diskaudio,
652 AC_HELP_STRING([--enable-diskaudio], [support the disk writer audio driver [[default=yes]]]),
653 , enable_diskaudio=yes)
654 if test x$enable_audio = xyes -a x$enable_diskaudio = xyes; then
655 AC_DEFINE(SDL_AUDIO_DRIVER_DISK)
656 SOURCES="$SOURCES $srcdir/src/audio/disk/*.c"
660 dnl rcg03142006 See if the user wants the dummy audio driver...
663 AC_ARG_ENABLE(dummyaudio,
664 AC_HELP_STRING([--enable-dummyaudio], [support the dummy audio driver [[default=yes]]]),
665 , enable_dummyaudio=yes)
666 if test x$enable_audio = xyes -a x$enable_dummyaudio = xyes; then
667 AC_DEFINE(SDL_AUDIO_DRIVER_DUMMY)
668 SOURCES="$SOURCES $srcdir/src/audio/dummy/*.c"
672 dnl Set up the Atari Audio driver
675 AC_ARG_ENABLE(mintaudio,
676 AC_HELP_STRING([--enable-mintaudio], [support Atari audio driver [[default=yes]]]),
677 , enable_mintaudio=yes)
678 if test x$enable_audio = xyes -a x$enable_mintaudio = xyes; then
680 AC_CHECK_HEADER(mint/falcon.h, have_mint_falcon_hdr=yes)
681 if test x$have_mint_falcon_hdr = xyes; then
683 AC_DEFINE(SDL_AUDIO_DRIVER_MINT)
684 SOURCES="$SOURCES $srcdir/src/audio/mint/*.c"
685 SOURCES="$SOURCES $srcdir/src/audio/mint/*.S"
691 dnl See if we can use x86 assembly blitters
692 # NASM is available from: http://nasm.sourceforge.net
695 dnl Make sure we are running on an x86 platform
705 dnl Mac OS X might report itself as "i386" but generate x86_64 code.
706 dnl So see what size we think a pointer is, and bail if not 32-bit.
707 AC_CHECK_SIZEOF([void *], 4)
708 if test x$ac_cv_sizeof_void_p != x4; then
712 dnl Check for NASM (for assembly blit routines)
714 AC_HELP_STRING([--enable-nasm], [use nasm assembly blitters on x86 [[default=yes]]]),
716 if test x$enable_video = xyes -a x$enable_assembly = xyes -a x$enable_nasm = xyes; then
719 # Usage: CompileNASM <filename>
720 AC_MSG_CHECKING(to see if $NASM supports $1)
721 if $NASM $NASMFLAGS $1 -o $1.o >&AS_MESSAGE_LOG_FD 2>&1; then
722 CompileNASM_ret="yes"
727 AC_MSG_RESULT($CompileNASM_ret)
728 test "$CompileNASM_ret" = "yes"
731 if test x"$NASMFLAGS" = x; then
748 AC_PATH_PROG(NASM, yasm)
749 echo "%ifidn __OUTPUT_FORMAT__,elf" > unquoted-sections
750 echo "section .note.GNU-stack noalloc noexec nowrite progbits" >> unquoted-sections
751 echo "%endif" >> unquoted-sections
752 CompileNASM unquoted-sections || NASM=""
754 if test "x$NASM" = x -o "x$NASM" = x'"$NASM"'; then
755 $as_unset ac_cv_path_NASM
756 AC_PATH_PROG(NASM, nasm)
758 if test "x$NASM" != x -a "x$NASM" != x'"$NASM"'; then
759 AC_DEFINE(SDL_HERMES_BLITTERS)
760 SOURCES="$SOURCES $srcdir/src/hermes/*.asm"
761 NASMFLAGS="$NASMFLAGS -I $srcdir/src/hermes/"
763 dnl See if hidden visibility is supported
764 echo "GLOBAL _bar:function hidden" > symbol-visibility
765 echo "_bar:" >> symbol-visibility
766 CompileNASM symbol-visibility && NASMFLAGS="$NASMFLAGS -DHIDDEN_VISIBILITY"
772 # this line is needed for QNX, because it's not defined the __ELF__
774 EXTRA_CFLAGS="$EXTRA_CFLAGS -D__ELF__";;
776 EXTRA_CFLAGS="$EXTRA_CFLAGS -D__ELF__";;
782 dnl Check for altivec instruction support using gas syntax
785 AC_ARG_ENABLE(altivec,
786 AC_HELP_STRING([--enable-altivec], [use altivec assembly blitters on PPC [[default=yes]]]),
787 , enable_altivec=yes)
788 if test x$enable_video = xyes -a x$enable_assembly = xyes -a x$enable_altivec = xyes; then
789 save_CFLAGS="$CFLAGS"
791 have_altivec_h_hdr=no
792 altivec_CFLAGS="-maltivec"
793 CFLAGS="$save_CFLAGS $altivec_CFLAGS"
795 AC_MSG_CHECKING(for Altivec with GCC altivec.h and -maltivec option)
798 vector unsigned int vzero() {
799 return vec_splat_u32(0);
804 have_altivec_h_hdr=yes
806 AC_MSG_RESULT($have_gcc_altivec)
808 if test x$have_gcc_altivec = xno; then
809 AC_MSG_CHECKING(for Altivec with GCC -maltivec option)
811 vector unsigned int vzero() {
812 return vec_splat_u32(0);
818 AC_MSG_RESULT($have_gcc_altivec)
821 if test x$have_gcc_altivec = xno; then
822 AC_MSG_CHECKING(for Altivec with GCC altivec.h and -faltivec option)
823 altivec_CFLAGS="-faltivec"
824 CFLAGS="$save_CFLAGS $altivec_CFLAGS"
827 vector unsigned int vzero() {
828 return vec_splat_u32(0);
833 have_altivec_h_hdr=yes
835 AC_MSG_RESULT($have_gcc_altivec)
838 if test x$have_gcc_altivec = xno; then
839 AC_MSG_CHECKING(for Altivec with GCC -faltivec option)
841 vector unsigned int vzero() {
842 return vec_splat_u32(0);
848 AC_MSG_RESULT($have_gcc_altivec)
850 CFLAGS="$save_CFLAGS"
852 if test x$have_gcc_altivec = xyes; then
853 AC_DEFINE(SDL_ALTIVEC_BLITTERS)
854 if test x$have_altivec_h_hdr = xyes; then
855 AC_DEFINE(HAVE_ALTIVEC_H)
857 EXTRA_CFLAGS="$EXTRA_CFLAGS $altivec_CFLAGS"
862 dnl See if GCC's -fvisibility=hidden is supported (gcc4 and later, usually).
863 dnl Details of this flag are here: http://gcc.gnu.org/wiki/Visibility
864 CheckVisibilityHidden()
866 AC_MSG_CHECKING(for GCC -fvisibility=hidden option)
867 have_gcc_fvisibility=no
869 visibility_CFLAGS="-fvisibility=hidden"
870 save_CFLAGS="$CFLAGS"
871 CFLAGS="$save_CFLAGS $visibility_CFLAGS -Werror"
873 #if !defined(__GNUC__) || __GNUC__ < 4
874 #error SDL only uses visibility attributes in GCC 4 or newer
878 have_gcc_fvisibility=yes
880 AC_MSG_RESULT($have_gcc_fvisibility)
881 CFLAGS="$save_CFLAGS"
883 if test x$have_gcc_fvisibility = xyes; then
884 EXTRA_CFLAGS="$EXTRA_CFLAGS $visibility_CFLAGS"
889 dnl Do the iPod thing
893 AC_HELP_STRING([--enable-ipod], [configure SDL to work with iPodLinux [[default=no]]]),
896 if test x$enable_ipod = xyes; then
897 EXTRA_CFLAGS="$EXTRA_CFLAGS -DIPOD"
898 AC_DEFINE(SDL_VIDEO_DRIVER_IPOD)
899 SOURCES="$SOURCES $srcdir/src/video/ipod/*.c"
903 dnl Find the nanox include and library directories
906 AC_ARG_ENABLE(video-nanox,
907 AC_HELP_STRING([--enable-video-nanox], [use nanox video driver [[default=no]]]),
908 , enable_video_nanox=no)
910 if test x$enable_video = xyes -a x$enable_video_nanox = xyes; then
911 AC_ARG_ENABLE(nanox-debug,
912 AC_HELP_STRING([--enable-nanox-debug], [print debug messages [[default=no]]]),
913 , enable_nanox_debug=no)
914 if test x$enable_nanox_debug = xyes; then
915 EXTRA_CFLAGS="$EXTRA_CFLAGS -DENABLE_NANOX_DEBUG"
918 AC_ARG_ENABLE(nanox-share-memory,
919 AC_HELP_STRING([--enable-nanox-share-memory], [use share memory [[default=no]]]),
920 , enable_nanox_share_memory=no)
921 if test x$enable_nanox_share_memory = xyes; then
922 EXTRA_CFLAGS="$EXTRA_CFLAGS -DNANOX_SHARE_MEMORY"
925 AC_ARG_ENABLE(nanox_direct_fb,
926 AC_HELP_STRING([--enable-nanox-direct-fb], [use direct framebuffer access [[default=no]]]),
927 , enable_nanox_direct_fb=no)
928 if test x$enable_nanox_direct_fb = xyes; then
929 EXTRA_CFLAGS="$EXTRA_CFLAGS -DENABLE_NANOX_DIRECT_FB"
932 AC_DEFINE(SDL_VIDEO_DRIVER_NANOX)
933 SOURCES="$SOURCES $srcdir/src/video/nanox/*.c"
934 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lnano-X"
939 dnl Find the X11 include and library directories
942 AC_ARG_ENABLE(video-x11,
943 AC_HELP_STRING([--enable-video-x11], [use X11 video driver [[default=yes]]]),
944 , enable_video_x11=yes)
945 if test x$enable_video = xyes -a x$enable_video_x11 = xyes; then
948 # This isn't necessary for X11, but fixes GLX detection
949 if test "x$x_includes" = xNONE && test "x$x_libraries" = xNONE; then
950 x_includes="/usr/X11R6/include"
951 x_libraries="/usr/X11R6/lib"
957 if test x$have_x = xyes; then
958 # Only allow dynamically loaded X11 if the X11 function pointers
959 # will not end up in the global namespace, which causes problems
960 # with other libraries calling X11 functions.
961 x11_symbols_private=$have_gcc_fvisibility
963 AC_ARG_ENABLE(x11-shared,
964 AC_HELP_STRING([--enable-x11-shared], [dynamically load X11 support [[default=maybe]]]),
965 , enable_x11_shared=maybe)
968 *-*-darwin*) # Latest Mac OS X actually ships with Xrandr/Xrender libs...
969 x11_symbols_private=yes
970 x11_lib='/usr/X11R6/lib/libX11.6.dylib'
971 x11ext_lib='/usr/X11R6/lib/libXext.6.dylib'
972 xrender_lib='/usr/X11R6/lib/libXrender.1.dylib'
973 xrandr_lib='/usr/X11R6/lib/libXrandr.2.dylib'
977 x11ext_lib='libXext.so'
979 *-*-irix*) # IRIX 6.5 requires that we use /usr/lib32
981 x11ext_lib='libXext.so'
984 x11_lib=[`find_lib "libX11.so.*" "$X_LIBS -L/usr/X11/$base_libdir -L/usr/X11R6/$base_libdir" | sed 's/.*\/\(.*\)/\1/; q'`]
985 x11ext_lib=[`find_lib "libXext.so.*" "$X_LIBS -L/usr/X11/$base_libdir -L/usr/X11R6/$base_libdir" | sed 's/.*\/\(.*\)/\1/; q'`]
986 xrender_lib=[`find_lib "libXrender.so.*" "$X_LIBS -L/usr/X11/$base_libdir -L/usr/X11R6/$base_libdir" | sed 's/.*\/\(.*\)/\1/; q'`]
987 xrandr_lib=[`find_lib "libXrandr.so.*" "$X_LIBS -L/usr/X11/$base_libdir -L/usr/X11R6/$base_libdir" | sed 's/.*\/\(.*\)/\1/; q'`]
991 X_CFLAGS="$X_CFLAGS -DXTHREADS"
992 if test x$ac_cv_func_shmat != xyes; then
993 X_CFLAGS="$X_CFLAGS -DNO_SHARED_MEMORY"
995 CFLAGS="$CFLAGS $X_CFLAGS"
996 LDFLAGS="$LDFLAGS $X_LIBS"
998 AC_DEFINE(SDL_VIDEO_DRIVER_X11)
999 SOURCES="$SOURCES $srcdir/src/video/x11/*.c"
1000 EXTRA_CFLAGS="$EXTRA_CFLAGS $X_CFLAGS"
1002 if test x$enable_x11_shared = xmaybe; then
1003 enable_x11_shared=$x11_symbols_private
1005 if test x$have_loadso != xyes && \
1006 test x$enable_x11_shared = xyes; then
1007 AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic X11 loading])
1008 enable_x11_shared=no
1010 if test x$x11_symbols_private != xyes && \
1011 test x$enable_x11_shared = xyes; then
1012 AC_MSG_WARN([You must have gcc4 (-fvisibility=hidden) for dynamic X11 loading])
1013 enable_x11_shared=no
1016 if test x$have_loadso = xyes && \
1017 test x$enable_x11_shared = xyes && test x$x11_lib != x && test x$x11ext_lib != x; then
1018 echo "-- dynamic libX11 -> $x11_lib"
1019 echo "-- dynamic libX11ext -> $x11ext_lib"
1020 AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_X11_DYNAMIC, "$x11_lib")
1021 AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_X11_DYNAMIC_XEXT, "$x11ext_lib")
1023 enable_x11_shared=no
1024 EXTRA_LDFLAGS="$EXTRA_LDFLAGS $X_LIBS -lX11 -lXext"
1029 AC_HELP_STRING([--enable-dga], [allow use of X11 DGA code [[default=yes]]]),
1031 if test x$enable_dga = xyes; then
1032 SOURCES="$SOURCES $srcdir/src/video/Xext/Xxf86dga/*.c"
1034 AC_ARG_ENABLE(video-dga,
1035 AC_HELP_STRING([--enable-video-dga], [use DGA 2.0 video driver [[default=yes]]]),
1036 , enable_video_dga=yes)
1037 if test x$enable_dga = xyes -a x$enable_video_dga = xyes; then
1038 AC_DEFINE(SDL_VIDEO_DRIVER_DGA)
1039 SOURCES="$SOURCES $srcdir/src/video/dga/*.c"
1041 AC_ARG_ENABLE(video-x11-dgamouse,
1042 AC_HELP_STRING([--enable-video-x11-dgamouse], [use X11 DGA for mouse events [[default=yes]]]),
1043 , enable_video_x11_dgamouse=yes)
1044 if test x$enable_dga = xyes -a x$enable_video_x11_dgamouse = xyes; then
1045 AC_DEFINE(SDL_VIDEO_DRIVER_X11_DGAMOUSE)
1047 AC_ARG_ENABLE(video-x11-vm,
1048 AC_HELP_STRING([--enable-video-x11-vm], [use X11 VM extension for fullscreen [[default=yes]]]),
1049 , enable_video_x11_vm=yes)
1050 if test x$enable_video_x11_vm = xyes; then
1051 AC_DEFINE(SDL_VIDEO_DRIVER_X11_VIDMODE)
1052 SOURCES="$SOURCES $srcdir/src/video/Xext/Xxf86vm/*.c"
1054 AC_ARG_ENABLE(video-x11-xv,
1055 AC_HELP_STRING([--enable-video-x11-xv], [use X11 XvImage extension for video [[default=yes]]]),
1056 , enable_video_x11_xv=yes)
1057 if test x$enable_video_x11_xv = xyes; then
1058 AC_DEFINE(SDL_VIDEO_DRIVER_X11_XV)
1059 SOURCES="$SOURCES $srcdir/src/video/Xext/Xv/*.c"
1061 AC_ARG_ENABLE(video-x11-xinerama,
1062 AC_HELP_STRING([--enable-video-x11-xinerama], [enable X11 Xinerama support [[default=yes]]]),
1063 , enable_video_x11_xinerama=yes)
1064 if test x$enable_video_x11_xinerama = xyes; then
1065 AC_DEFINE(SDL_VIDEO_DRIVER_X11_XINERAMA)
1066 SOURCES="$SOURCES $srcdir/src/video/Xext/Xinerama/*.c"
1068 AC_ARG_ENABLE(video-x11-xme,
1069 AC_HELP_STRING([--enable-video-x11-xme], [enable Xi Graphics XME for fullscreen [[default=yes]]]),
1070 , enable_video_x11_xme=yes)
1071 if test x$enable_video_x11_xme = xyes; then
1072 AC_DEFINE(SDL_VIDEO_DRIVER_X11_XME)
1073 SOURCES="$SOURCES $srcdir/src/video/Xext/XME/*.c"
1075 AC_ARG_ENABLE(video-x11-xrandr,
1076 AC_HELP_STRING([--enable-video-x11-xrandr], [enable X11 Xrandr extension for fullscreen [[default=yes]]]),
1077 , enable_video_x11_xrandr=yes)
1078 if test x$enable_video_x11_xrandr = xyes; then
1079 definitely_enable_video_x11_xrandr=no
1080 AC_CHECK_HEADER(X11/extensions/Xrandr.h,
1081 have_xrandr_h_hdr=yes,
1082 have_xrandr_h_hdr=no,
1083 [#include <X11/Xlib.h>
1085 if test x$have_xrandr_h_hdr = xyes; then
1086 if test x$enable_x11_shared = xyes && test x$xrandr_lib != x ; then
1087 echo "-- dynamic libXrender -> $xrender_lib"
1088 echo "-- dynamic libXrandr -> $xrandr_lib"
1089 AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_X11_DYNAMIC_XRENDER, "$xrender_lib")
1090 AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_X11_DYNAMIC_XRANDR, "$xrandr_lib")
1091 definitely_enable_video_x11_xrandr=yes
1093 AC_CHECK_LIB(Xrender, XRenderQueryExtension, have_xrender_lib=yes)
1094 AC_CHECK_LIB(Xrandr, XRRQueryExtension, have_xrandr_lib=yes)
1095 if test x$have_xrender_lib = xyes && test x$have_xrandr_lib = xyes ; then
1096 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lXrandr -lXrender"
1097 definitely_enable_video_x11_xrandr=yes
1102 if test x$definitely_enable_video_x11_xrandr = xyes; then
1103 AC_DEFINE(SDL_VIDEO_DRIVER_X11_XRANDR)
1109 dnl Check for QNX photon video driver
1112 AC_ARG_ENABLE(video-photon,
1113 AC_HELP_STRING([--enable-video-photon], [use QNX Photon video driver [[default=yes]]]),
1114 , enable_video_photon=yes)
1115 if test x$enable_video = xyes -a x$enable_video_photon = xyes; then
1116 AC_MSG_CHECKING(for QNX Photon support)
1121 #include <photon/Pg.h>
1122 #include <photon/PdDirect.h>
1124 PgDisplaySettings_t *visual;
1128 AC_MSG_RESULT($video_photon)
1129 if test x$video_photon = xyes; then
1130 AC_DEFINE(SDL_VIDEO_DRIVER_PHOTON)
1131 SOURCES="$SOURCES $srcdir/src/video/photon/*.c"
1132 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lph"
1140 dnl Set up the BWindow video driver if enabled
1143 if test x$enable_video = xyes; then
1144 AC_DEFINE(SDL_VIDEO_DRIVER_BWINDOW)
1145 SOURCES="$SOURCES $srcdir/src/video/bwindow/*.cc"
1150 dnl Set up the Carbon/QuickDraw video driver for Mac OS X (but not Darwin)
1153 AC_ARG_ENABLE(video-carbon,
1154 AC_HELP_STRING([--enable-video-carbon], [use Carbon/QuickDraw video driver [[default=no]]]),
1155 , enable_video_carbon=no)
1156 if test x$enable_video = xyes -a x$enable_video_carbon = xyes; then
1157 AC_MSG_CHECKING(for Carbon framework)
1160 #include <Carbon/Carbon.h>
1165 AC_MSG_RESULT($have_carbon)
1166 if test x$have_carbon = xyes; then
1167 AC_DEFINE(SDL_VIDEO_DRIVER_TOOLBOX)
1168 SOURCES="$SOURCES $srcdir/src/video/maccommon/*.c"
1169 SOURCES="$SOURCES $srcdir/src/video/macrom/*.c"
1175 dnl Set up the Cocoa/Quartz video driver for Mac OS X (but not Darwin)
1178 AC_ARG_ENABLE(video-cocoa,
1179 AC_HELP_STRING([--enable-video-cocoa], [use Cocoa/Quartz video driver [[default=yes]]]),
1180 , enable_video_cocoa=yes)
1181 if test x$enable_video = xyes -a x$enable_video_cocoa = xyes; then
1182 save_CFLAGS="$CFLAGS"
1183 dnl work around that we don't have Objective-C support in autoconf
1184 CFLAGS="$CFLAGS -x objective-c"
1185 AC_MSG_CHECKING(for Cocoa framework)
1188 #import <Cocoa/Cocoa.h>
1193 AC_MSG_RESULT($have_cocoa)
1194 CFLAGS="$save_CFLAGS"
1195 if test x$have_cocoa = xyes; then
1196 AC_DEFINE(SDL_VIDEO_DRIVER_QUARTZ)
1197 SOURCES="$SOURCES $srcdir/src/video/quartz/*.m"
1203 dnl Find the framebuffer console includes
1206 AC_ARG_ENABLE(video-fbcon,
1207 AC_HELP_STRING([--enable-video-fbcon], [use framebuffer console video driver [[default=yes]]]),
1208 , enable_video_fbcon=yes)
1209 if test x$enable_video = xyes -a x$enable_video_fbcon = xyes; then
1210 AC_MSG_CHECKING(for framebuffer console support)
1213 #include <linux/fb.h>
1214 #include <linux/kd.h>
1215 #include <linux/keyboard.h>
1220 AC_MSG_RESULT($video_fbcon)
1221 if test x$video_fbcon = xyes; then
1222 AC_CHECK_FUNCS(getpagesize)
1223 AC_DEFINE(SDL_VIDEO_DRIVER_FBCON)
1224 SOURCES="$SOURCES $srcdir/src/video/fbcon/*.c"
1233 AC_ARG_ENABLE(video-directfb,
1234 AC_HELP_STRING([--enable-video-directfb], [use DirectFB video driver [[default=yes]]]),
1235 , enable_video_directfb=yes)
1236 if test x$enable_video = xyes -a x$enable_video_directfb = xyes; then
1239 DIRECTFB_REQUIRED_VERSION=0.9.15
1241 AC_PATH_PROG(DIRECTFBCONFIG, directfb-config, no)
1242 if test x$DIRECTFBCONFIG = xno; then
1243 AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
1244 if test x$PKG_CONFIG != xno; then
1245 if $PKG_CONFIG --atleast-pkgconfig-version 0.7 && $PKG_CONFIG --atleast-version $DIRECTFB_REQUIRED_VERSION directfb; then
1246 DIRECTFB_CFLAGS=`$PKG_CONFIG --cflags directfb`
1247 DIRECTFB_LIBS=`$PKG_CONFIG --libs directfb`
1252 set -- `echo $DIRECTFB_REQUIRED_VERSION | sed 's/\./ /g'`
1253 NEED_VERSION=`expr $1 \* 10000 + $2 \* 100 + $3`
1254 set -- `directfb-config --version | sed 's/\./ /g'`
1255 HAVE_VERSION=`expr $1 \* 10000 + $2 \* 100 + $3`
1256 if test $HAVE_VERSION -ge $NEED_VERSION; then
1257 DIRECTFB_CFLAGS=`$DIRECTFBCONFIG --cflags`
1258 DIRECTFB_LIBS=`$DIRECTFBCONFIG --libs`
1262 if test x$video_directfb = xyes; then
1263 # SuSE 11.1 installs directfb-config without directfb-devel
1264 save_CFLAGS="$CFLAGS"
1265 CFLAGS="$CFLAGS $DIRECTFB_CFLAGS"
1266 AC_CHECK_HEADER(directfb.h, have_directfb_hdr=yes, have_directfb_hdr=no)
1267 CFLAGS="$save_CFLAGS"
1268 video_directfb=$have_directfb_hdr
1270 AC_MSG_CHECKING(for DirectFB $DIRECTFB_REQUIRED_VERSION support)
1271 AC_MSG_RESULT($video_directfb)
1273 if test x$video_directfb = xyes; then
1274 AC_DEFINE(SDL_VIDEO_DRIVER_DIRECTFB)
1275 SOURCES="$SOURCES $srcdir/src/video/directfb/*.c"
1276 EXTRA_CFLAGS="$EXTRA_CFLAGS $DIRECTFB_CFLAGS"
1277 EXTRA_LDFLAGS="$EXTRA_LDFLAGS $DIRECTFB_LIBS"
1283 dnl See if we're running on PlayStation 2 hardware
1286 AC_ARG_ENABLE(video-ps2gs,
1287 AC_HELP_STRING([--enable-video-ps2gs], [use PlayStation 2 GS video driver [[default=yes]]]),
1288 , enable_video_ps2gs=yes)
1289 if test x$enable_video = xyes -a x$enable_video_ps2gs = xyes; then
1290 AC_MSG_CHECKING(for PlayStation 2 GS support)
1293 #include <linux/ps2/dev.h>
1294 #include <linux/ps2/gs.h>
1299 AC_MSG_RESULT($video_ps2gs)
1300 if test x$video_ps2gs = xyes; then
1301 AC_DEFINE(SDL_VIDEO_DRIVER_PS2GS)
1302 SOURCES="$SOURCES $srcdir/src/video/ps2gs/*.c"
1308 dnl See if we're running on PlayStation 3 Cell hardware
1311 AC_ARG_ENABLE(video-ps3,
1312 AC_HELP_STRING([--enable-video-ps3], [use PlayStation 3 Cell driver [[default=yes]]]),
1313 , enable_video_ps3=yes)
1314 if test x$enable_video = xyes -a x$enable_video_ps3 = xyes; then
1315 AC_MSG_CHECKING(for PlayStation 3 Cell support)
1318 #include <linux/fb.h>
1319 #include <asm/ps3fb.h>
1324 AC_MSG_RESULT($video_ps3)
1325 if test x$video_ps3 = xyes; then
1326 AC_DEFINE(SDL_VIDEO_DRIVER_PS3)
1327 SOURCES="$SOURCES $srcdir/src/video/ps3/*.c"
1328 EXTRA_CFLAGS="$EXTRA_CFLAGS -I/opt/cell/sdk/usr/include"
1329 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lbilin_scaler_spu -lfb_writer_spu -lyuv2rgb_spu -L/opt/cell/sdk/usr/lib -lspe2"
1335 dnl Find the GGI includes
1338 AC_ARG_ENABLE(video-ggi,
1339 AC_HELP_STRING([--enable-video-ggi], [use GGI video driver [[default=no]]]),
1340 , enable_video_ggi=no)
1341 if test x$enable_video = xyes -a x$enable_video_ggi = xyes; then
1342 AC_MSG_CHECKING(for GGI support)
1345 #include <ggi/ggi.h>
1346 #include <ggi/gii.h>
1351 AC_MSG_RESULT($video_ggi)
1352 if test x$video_ggi = xyes; then
1353 AC_DEFINE(SDL_VIDEO_DRIVER_GGI)
1354 SOURCES="$SOURCES $srcdir/src/video/ggi/*.c"
1355 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lggi -lgii -lgg"
1361 dnl Find the SVGAlib includes and libraries
1364 AC_ARG_ENABLE(video-svga,
1365 AC_HELP_STRING([--enable-video-svga], [use SVGAlib video driver [[default=yes]]]),
1366 , enable_video_svga=yes)
1367 if test x$enable_video = xyes -a x$enable_video_svga = xyes; then
1368 AC_MSG_CHECKING(for SVGAlib (1.4.0+) support)
1372 #include <vgamouse.h>
1373 #include <vgakeyboard.h>
1375 if ( SCANCODE_RIGHTWIN && SCANCODE_LEFTWIN ) {
1381 AC_MSG_RESULT($video_svga)
1382 if test x$video_svga = xyes; then
1383 AC_DEFINE(SDL_VIDEO_DRIVER_SVGALIB)
1384 SOURCES="$SOURCES $srcdir/src/video/svga/*.c"
1385 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lvga"
1391 dnl Find the VGL includes and libraries
1394 AC_ARG_ENABLE(video-vgl,
1395 AC_HELP_STRING([--enable-video-vgl], [use VGL video driver [[default=yes]]]),
1396 , enable_video_vgl=yes)
1397 if test x$enable_video = xyes -a x$enable_video_vgl = xyes; then
1398 AC_MSG_CHECKING(for libVGL support)
1401 #include <sys/fbio.h>
1402 #include <sys/consio.h>
1403 #include <sys/kbio.h>
1407 bitmap.Type = VIDBUF32;
1408 bitmap.PixelBytes = 4;
1409 exit(bitmap.Bitmap);
1413 AC_MSG_RESULT($video_vgl)
1414 if test x$video_vgl = xyes; then
1415 AC_DEFINE(SDL_VIDEO_DRIVER_VGL)
1416 SOURCES="$SOURCES $srcdir/src/video/vgl/*.c"
1417 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lvgl"
1423 dnl Set up the wscons video driver if enabled
1426 AC_ARG_ENABLE(video-wscons,
1427 AC_HELP_STRING([--enable-video-wscons], [use wscons video driver [[default=yes]]]),
1428 , enable_video_wscons=yes)
1429 if test x$enable_video = xyes -a x$enable_video_wscons = xyes; then
1430 AC_MSG_CHECKING(for wscons support)
1433 #include <sys/time.h>
1434 #include <dev/wscons/wsconsio.h>
1435 #include <dev/wscons/wsdisplay_usl_io.h>
1437 int wsmode = WSDISPLAYIO_MODE_DUMBFB;
1441 AC_MSG_RESULT($video_wscons)
1442 if test x$video_wscons = xyes; then
1443 AC_DEFINE(SDL_VIDEO_DRIVER_WSCONS)
1444 SOURCES="$SOURCES $srcdir/src/video/wscons/*.c"
1451 dnl Find the AAlib includes
1454 AC_ARG_ENABLE(video-aalib,
1455 AC_HELP_STRING([--enable-video-aalib], [use AAlib video driver [[default=no]]]),
1456 , enable_video_aalib=no)
1457 if test x$enable_video = xyes -a x$enable_video_aalib = xyes; then
1458 AC_MSG_CHECKING(for AAlib support)
1466 AC_MSG_RESULT($video_aalib)
1467 if test x$video_aalib = xyes; then
1468 AC_DEFINE(SDL_VIDEO_DRIVER_AALIB)
1469 SOURCES="$SOURCES $srcdir/src/video/aalib/*.c"
1470 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -laa"
1476 dnl Find the libcaca includes
1479 AC_ARG_ENABLE(video-caca,
1480 AC_HELP_STRING([--enable-video-caca], [use libcaca video driver [[default=no]]]),
1481 , enable_video_caca=no)
1482 if test x$enable_video = xyes -a x$enable_video_caca = xyes; then
1484 AC_PATH_PROG(CACACONFIG, caca-config, no)
1485 if test x$CACACONFIG != xno; then
1486 AC_MSG_CHECKING(for libcaca support)
1487 CACA_CFLAGS=`$CACACONFIG --cflags`
1488 CACA_LDFLAGS=`$CACACONFIG --libs`
1489 save_CFLAGS="$CFLAGS"
1496 CFLAGS="$save_CFLAGS"
1497 AC_MSG_RESULT($video_caca)
1498 if test x$video_caca = xyes; then
1499 AC_DEFINE(SDL_VIDEO_DRIVER_CACA)
1500 EXTRA_CFLAGS="$EXTRA_CFLAGS $CACA_CFLAGS"
1501 EXTRA_LDFLAGS="$EXTRA_LDFLAGS $CACA_LDFLAGS"
1502 SOURCES="$SOURCES $srcdir/src/video/caca/*.c"
1508 dnl Check for ARM NEON
1511 AC_MSG_CHECKING(for ARM NEON support)
1515 #ifndef __ARM_NEON__
1516 #error NEON not available
1521 AC_MSG_RESULT($have_arm_neon)
1522 if test x$have_arm_neon = xyes; then
1523 SOURCES="$SOURCES $srcdir/src/video/SDL_blit_neon.S"
1527 dnl Set up the QTopia video driver if enabled
1530 AC_ARG_ENABLE(video-qtopia,
1531 AC_HELP_STRING([--enable-video-qtopia], [use Qtopia video driver [[default=no]]]),
1532 , enable_video_qtopia=no)
1533 if test x$enable_video = xyes -a x$enable_video_qtopia = xyes; then
1534 AC_MSG_CHECKING(for Qtopia support)
1536 QTOPIA_FLAGS="-DQT_QWS_EBX -DQT_QWS_CUSTOM -DQWS -I${QPEDIR}/include -I${QTDIR}/include/ -DNO_DEBUG -fno-rtti -fno-exceptions"
1539 CXXFLAGS="$QTOPIA_FLAGS"
1541 #include <qpe/qpeapplication.h>
1547 AC_MSG_RESULT($video_qtopia)
1548 if test x$video_qtopia = xyes; then
1549 AC_DEFINE(SDL_VIDEO_DRIVER_QTOPIA)
1550 SOURCES="$SOURCES $srcdir/src/video/qtopia/*.cc"
1551 SDLMAIN_SOURCES="$srcdir/src/main/qtopia/*.cc"
1552 EXTRA_CFLAGS="$EXTRA_CFLAGS $QTOPIA_FLAGS"
1553 SDL_CFLAGS="$SDL_CFLAGS -DQWS -Dmain=SDL_main"
1554 SDL_LIBS="-lSDLmain $SDL_LIBS -L${QPEDIR}/lib -L${QTDIR}/lib/ -lqpe -lqte"
1561 dnl Set up the PicoGUI video driver if enabled
1564 AC_ARG_ENABLE(video-picogui,
1565 AC_HELP_STRING([--enable-video-picogui], [use PicoGUI video driver [[default=no]]]),
1566 , enable_video_picogui=no)
1567 if test x$enable_video = xyes -a x$enable_video_picogui = xyes; then
1568 AC_MSG_CHECKING(for PicoGUI support)
1571 #include <picogui.h>
1576 AC_MSG_RESULT($video_picogui)
1577 if test x$video_picogui = xyes; then
1578 AC_DEFINE(SDL_VIDEO_DRIVER_PICOGUI)
1579 SOURCES="$SOURCES $srcdir/src/video/picogui/*.c"
1580 SDL_LIBS="$SDL_LIBS -lpgui"
1586 dnl Set up the Atari Bios keyboard driver
1587 CheckAtariBiosEvent()
1589 SOURCES="$SOURCES $srcdir/src/video/ataricommon/*.c"
1590 SOURCES="$SOURCES $srcdir/src/video/ataricommon/*.S"
1593 dnl Set up the Atari Xbios driver
1594 CheckAtariXbiosVideo()
1596 AC_ARG_ENABLE(xbios,
1597 AC_HELP_STRING([--enable-video-xbios], [use Atari Xbios video driver [[default=yes]]]),
1598 , enable_video_xbios=yes)
1600 if test x$enable_video = xyes -a x$enable_video_xbios = xyes; then
1602 AC_DEFINE(SDL_VIDEO_DRIVER_XBIOS)
1603 SOURCES="$SOURCES $srcdir/src/video/xbios/*.c"
1608 dnl Set up the Atari Gem driver
1609 CheckAtariGemVideo()
1612 AC_HELP_STRING([--enable-video-gem], [use Atari Gem video driver [[default=yes]]]),
1613 , enable_video_gem=yes)
1614 if test x$enable_video = xyes -a x$enable_video_gem = xyes; then
1616 AC_CHECK_HEADER(gem.h, have_gem_hdr=yes)
1617 AC_CHECK_LIB(gem, appl_init, have_gem_lib=yes)
1618 if test x$have_gem_hdr = xyes -a x$have_gem_lib = xyes; then
1620 AC_DEFINE(SDL_VIDEO_DRIVER_GEM)
1621 SOURCES="$SOURCES $srcdir/src/video/gem/*.c"
1622 SDL_LIBS="$SDL_LIBS -lgem"
1631 AC_ARG_ENABLE(video-omapdss,
1632 AC_HELP_STRING([--enable-video-omapdss], [use OMAP DSS2 video driver [[default=yes]]]),
1633 , enable_video_omapdss=yes)
1635 if test x$enable_video_omapdss = xyes; then
1636 AC_DEFINE(SDL_VIDEO_DRIVER_OMAPDSS)
1637 SOURCES="$SOURCES $srcdir/src/video/omapdss/sdlif.c"
1638 SOURCES="$SOURCES $srcdir/src/video/omapdss/osdl_input.c"
1639 SOURCES="$SOURCES $srcdir/src/video/omapdss/osdl_video.c"
1640 SOURCES="$SOURCES $srcdir/src/video/omapdss/config.c"
1641 SOURCES="$SOURCES $srcdir/src/video/omapdss/SDL_x11reuse.c"
1642 SOURCES="$SOURCES $srcdir/src/video/omapdss/linux/fbdev.c"
1643 SOURCES="$SOURCES $srcdir/src/video/omapdss/linux/xenv.c"
1648 dnl rcg04172001 Set up the Null video driver.
1651 AC_ARG_ENABLE(video-dummy,
1652 AC_HELP_STRING([--enable-video-dummy], [use dummy video driver [[default=yes]]]),
1653 , enable_video_dummy=yes)
1654 if test x$enable_video_dummy = xyes; then
1655 AC_DEFINE(SDL_VIDEO_DRIVER_DUMMY)
1656 SOURCES="$SOURCES $srcdir/src/video/dummy/*.c"
1661 dnl Check to see if OpenGL support is desired
1662 AC_ARG_ENABLE(video-opengl,
1663 AC_HELP_STRING([--enable-video-opengl], [include OpenGL context creation [[default=yes]]]),
1664 , enable_video_opengl=yes)
1669 if test x$enable_video = xyes -a x$enable_video_opengl = xyes; then
1670 AC_MSG_CHECKING(for OpenGL (GLX) support)
1680 AC_MSG_RESULT($video_opengl)
1681 if test x$video_opengl = xyes; then
1682 AC_DEFINE(SDL_VIDEO_OPENGL)
1683 AC_DEFINE(SDL_VIDEO_OPENGL_GLX)
1688 dnl Find QNX RtP OpenGL
1691 if test x$enable_video = xyes -a x$enable_video_opengl = xyes; then
1692 AC_MSG_CHECKING(for OpenGL (Photon) support)
1700 AC_MSG_RESULT($video_opengl)
1701 if test x$video_opengl = xyes; then
1702 AC_DEFINE(SDL_VIDEO_OPENGL)
1703 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lGL"
1708 dnl Check for Win32 OpenGL
1711 if test x$enable_video = xyes -a x$enable_video_opengl = xyes; then
1712 AC_DEFINE(SDL_VIDEO_OPENGL)
1713 AC_DEFINE(SDL_VIDEO_OPENGL_WGL)
1717 dnl Check for BeOS OpenGL
1720 if test x$enable_video = xyes -a x$enable_video_opengl = xyes; then
1721 AC_DEFINE(SDL_VIDEO_OPENGL)
1722 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lGL"
1726 dnl Check for MacOS OpenGL
1729 if test x$enable_video = xyes -a x$enable_video_opengl = xyes; then
1730 AC_DEFINE(SDL_VIDEO_OPENGL)
1733 if test x$enable_video_cocoa = xyes; then
1734 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,OpenGL"
1736 if test x$enable_video_carbon = xyes; then
1737 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,AGL"
1743 dnl Check for Mesa offscreen rendering
1746 if test "x$enable_video" = "xyes" -a "x$enable_video_opengl" = "xyes"; then
1747 AC_CHECK_HEADER(GL/osmesa.h, have_osmesa_hdr=yes)
1748 AC_CHECK_LIB(OSMesa, OSMesaCreateContext, have_osmesa_lib=yes, have_osmesa_lib=no, -lm)
1750 # Static linking to -lOSMesa
1751 AC_PATH_PROG(OSMESA_CONFIG, osmesa-config, no)
1752 if test "x$OSMESA_CONFIG" = "xno" -o "x$enable_atari_ldg" = "xno"; then
1753 # -lOSMesa is really the static library
1754 if test "x$have_osmesa_hdr" = "xyes" -a "x$have_osmesa_lib" = "xyes"; then
1755 OSMESA_LIBS="-lOSMesa"
1758 # -lOSMesa is a loader for OSMesa.ldg
1759 OSMESA_CFLAGS=`$OSMESA_CONFIG --cflags`
1760 OSMESA_LIBS=`$OSMESA_CONFIG --libs`
1762 AC_DEFINE(SDL_VIDEO_OPENGL)
1763 AC_DEFINE(SDL_VIDEO_OPENGL_OSMESA)
1764 SDL_CFLAGS="$SDL_CFLAGS $OSMESA_CFLAGS"
1765 SDL_LIBS="$SDL_LIBS $OSMESA_LIBS"
1767 AC_ARG_ENABLE(osmesa-shared,
1768 AC_HELP_STRING([--enable-osmesa-shared], [dynamically load OSMesa OpenGL support [[default=yes]]]),
1769 , enable_osmesa_shared=yes)
1770 if test "x$enable_osmesa_shared" = "xyes" -a "x$enable_atari_ldg" = "xyes"; then
1772 if test "x$have_osmesa_hdr" = "xyes"; then
1773 AC_DEFINE(SDL_VIDEO_OPENGL_OSMESA_DYNAMIC)
1779 AC_ARG_ENABLE(screensaver,
1780 AC_HELP_STRING([--enable-screensaver], [enable screensaver by default while any SDL application is running [[default=no]]]),
1781 , enable_screensaver=no)
1782 if test x$enable_screensaver = xno; then
1783 AC_DEFINE(SDL_VIDEO_DISABLE_SCREENSAVER)
1786 dnl See if we can use the new unified event interface in Linux 2.4
1789 dnl Check for Linux 2.4 unified input event interface support
1790 AC_ARG_ENABLE(input-events,
1791 AC_HELP_STRING([--enable-input-events], [use Linux 2.4 unified input interface [[default=yes]]]),
1792 , enable_input_events=yes)
1793 if test x$enable_input_events = xyes; then
1794 AC_MSG_CHECKING(for Linux 2.4 unified input interface)
1797 #include <linux/input.h>
1800 #error EVIOCGNAME() ioctl not available
1803 use_input_events=yes
1805 AC_MSG_RESULT($use_input_events)
1806 if test x$use_input_events = xyes; then
1807 AC_DEFINE(SDL_INPUT_LINUXEV)
1812 dnl See if we can use the Touchscreen input library
1815 AC_ARG_ENABLE(input-tslib,
1816 AC_HELP_STRING([--enable-input-tslib], [use the Touchscreen library for input [[default=yes]]]),
1817 , enable_input_tslib=yes)
1818 if test x$enable_input_tslib = xyes; then
1819 AC_MSG_CHECKING(for Touchscreen library support)
1820 enable_input_tslib=no
1825 enable_input_tslib=yes
1827 AC_MSG_RESULT($enable_input_tslib)
1828 if test x$enable_input_tslib = xyes; then
1829 AC_DEFINE(SDL_INPUT_TSLIB)
1830 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lts"
1835 dnl See if we can use GNU pth library for threads
1838 dnl Check for pth support
1840 AC_HELP_STRING([--enable-pth], [use GNU pth library for multi-threading [[default=yes]]]),
1842 if test x$enable_threads = xyes -a x$enable_pth = xyes; then
1843 AC_PATH_PROG(PTH_CONFIG, pth-config, no)
1844 if test "$PTH_CONFIG" = "no"; then
1849 AC_MSG_CHECKING(pth)
1850 AC_MSG_RESULT($use_pth)
1851 if test "x$use_pth" = xyes; then
1852 AC_DEFINE(SDL_THREAD_PTH)
1853 SOURCES="$SOURCES $srcdir/src/thread/pth/*.c"
1854 SOURCES="$SOURCES $srcdir/src/thread/generic/SDL_syssem.c"
1855 SDL_CFLAGS="$SDL_CFLAGS `$PTH_CONFIG --cflags`"
1856 SDL_LIBS="$SDL_LIBS `$PTH_CONFIG --libs --all`"
1862 dnl See what type of thread model to use on Linux and Solaris
1865 dnl Check for pthread support
1866 AC_ARG_ENABLE(pthreads,
1867 AC_HELP_STRING([--enable-pthreads], [use POSIX threads for multi-threading [[default=yes]]]),
1868 , enable_pthreads=yes)
1869 dnl This is used on Linux for glibc binary compatibility (Doh!)
1870 AC_ARG_ENABLE(pthread-sem,
1871 AC_HELP_STRING([--enable-pthread-sem], [use pthread semaphores [[default=yes]]]),
1872 , enable_pthread_sem=yes)
1874 *-*-linux*|*-*-uclinux*)
1875 pthread_cflags="-D_REENTRANT"
1876 pthread_lib="-lpthread"
1879 pthread_cflags="-D_REENTRANT -D_THREAD_SAFE"
1883 pthread_cflags="-D_THREAD_SAFE"
1884 # causes Carbon.p complaints?
1885 # pthread_cflags="-D_REENTRANT -D_THREAD_SAFE"
1887 *-*-freebsd*|*-*-dragonfly*)
1888 pthread_cflags="-D_REENTRANT -D_THREAD_SAFE"
1889 pthread_lib="-pthread"
1892 pthread_cflags="-D_REENTRANT -D_THREAD_SAFE"
1893 pthread_lib="-lpthread"
1896 pthread_cflags="-D_REENTRANT"
1897 pthread_lib="-pthread"
1900 pthread_cflags="-D_REENTRANT"
1901 pthread_lib="-lpthread -lposix4"
1904 pthread_cflags="-D_REENTRANT -Kthread"
1908 pthread_cflags="-D_SGI_MP_SOURCE"
1909 pthread_lib="-lpthread"
1912 pthread_cflags="-D_REENTRANT -mthreads"
1913 pthread_lib="-lpthread"
1916 pthread_cflags="-D_REENTRANT"
1917 pthread_lib="-L/usr/lib -lpthread"
1924 pthread_cflags="-D_REENTRANT"
1925 if test x$ac_cv_prog_gcc = xyes; then
1926 pthread_lib="-lpthread -lrt"
1928 pthread_lib="-lpthread -lexc -lrt"
1932 pthread_cflags="-D_REENTRANT"
1933 pthread_lib="-lpthread"
1936 if test x$enable_threads = xyes -a x$enable_pthreads = xyes -a x$enable_ipod != xyes; then
1937 # Save the original compiler flags and libraries
1938 ac_save_cflags="$CFLAGS"; ac_save_libs="$LIBS"
1939 # Add the pthread compiler flags and libraries
1940 CFLAGS="$CFLAGS $pthread_cflags"; LIBS="$LIBS $pthread_lib"
1941 # Check to see if we have pthread support on this system
1942 AC_MSG_CHECKING(for pthreads)
1945 #include <pthread.h>
1947 pthread_attr_t type;
1948 pthread_attr_init(&type);
1952 AC_MSG_RESULT($use_pthreads)
1953 # Restore the compiler flags and libraries
1954 CFLAGS="$ac_save_cflags"; LIBS="$ac_save_libs"
1956 # Do futher testing if we have pthread support...
1957 if test x$use_pthreads = xyes; then
1958 AC_DEFINE(SDL_THREAD_PTHREAD)
1959 EXTRA_CFLAGS="$EXTRA_CFLAGS $pthread_cflags"
1960 EXTRA_LDFLAGS="$EXTRA_LDFLAGS $pthread_lib"
1961 SDL_CFLAGS="$SDL_CFLAGS $pthread_cflags"
1962 SDL_LIBS="$SDL_LIBS $pthread_lib"
1964 # Save the original compiler flags and libraries
1965 ac_save_cflags="$CFLAGS"; ac_save_libs="$LIBS"
1966 # Add the pthread compiler flags and libraries
1967 CFLAGS="$CFLAGS $pthread_cflags"; LIBS="$LIBS $pthread_lib"
1969 # Check to see if recursive mutexes are available
1970 AC_MSG_CHECKING(for recursive mutexes)
1971 has_recursive_mutexes=no
1972 if test x$has_recursive_mutexes = xno; then
1974 #include <pthread.h>
1976 pthread_mutexattr_t attr;
1977 pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
1979 has_recursive_mutexes=yes
1980 AC_DEFINE(SDL_THREAD_PTHREAD_RECURSIVE_MUTEX)
1983 if test x$has_recursive_mutexes = xno; then
1985 #include <pthread.h>
1987 pthread_mutexattr_t attr;
1988 pthread_mutexattr_setkind_np(&attr, PTHREAD_MUTEX_RECURSIVE_NP);
1990 has_recursive_mutexes=yes
1991 AC_DEFINE(SDL_THREAD_PTHREAD_RECURSIVE_MUTEX_NP)
1994 AC_MSG_RESULT($has_recursive_mutexes)
1996 # Check to see if pthread semaphore support is missing
1997 if test x$enable_pthread_sem = xyes; then
1998 AC_MSG_CHECKING(for pthread semaphores)
2001 #include <pthread.h>
2002 #include <semaphore.h>
2005 have_pthread_sem=yes
2007 AC_MSG_RESULT($have_pthread_sem)
2010 # Restore the compiler flags and libraries
2011 CFLAGS="$ac_save_cflags"; LIBS="$ac_save_libs"
2013 # Basic thread creation functions
2014 SOURCES="$SOURCES $srcdir/src/thread/pthread/SDL_systhread.c"
2017 # We can fake these with mutexes and condition variables if necessary
2018 if test x$have_pthread_sem = xyes; then
2019 SOURCES="$SOURCES $srcdir/src/thread/pthread/SDL_syssem.c"
2021 SOURCES="$SOURCES $srcdir/src/thread/generic/SDL_syssem.c"
2025 # We can fake these with semaphores if necessary
2026 SOURCES="$SOURCES $srcdir/src/thread/pthread/SDL_sysmutex.c"
2028 # Condition variables
2029 # We can fake these with semaphores and mutexes if necessary
2030 SOURCES="$SOURCES $srcdir/src/thread/pthread/SDL_syscond.c"
2039 dnl Determine whether the compiler can produce Win32 executables
2042 AC_MSG_CHECKING(Win32 compiler)
2045 #include <windows.h>
2050 AC_MSG_RESULT($have_win32_gcc)
2051 if test x$have_win32_gcc != xyes; then
2053 *** Your compiler ($CC) does not produce Win32 executables!
2057 dnl See if the user wants to redirect standard output to files
2058 AC_ARG_ENABLE(stdio-redirect,
2059 AC_HELP_STRING([--enable-stdio-redirect], [Redirect STDIO to files on Win32 [[default=yes]]]),
2060 , enable_stdio_redirect=yes)
2061 if test x$enable_stdio_redirect != xyes; then
2062 EXTRA_CFLAGS="$EXTRA_CFLAGS -DNO_STDIO_REDIRECT"
2065 if test x$enable_video = xyes; then
2066 AC_DEFINE(SDL_VIDEO_DRIVER_WINDIB)
2067 SOURCES="$SOURCES $srcdir/src/video/wincommon/*.c"
2068 SOURCES="$SOURCES $srcdir/src/video/windib/*.c"
2073 dnl Find the DirectX includes and libraries
2076 AC_ARG_ENABLE(directx,
2077 AC_HELP_STRING([--enable-directx], [use DirectX for Win32 audio/video [[default=yes]]]),
2078 , enable_directx=yes)
2079 if test x$enable_directx = xyes; then
2081 AC_CHECK_HEADER(ddraw.h, have_ddraw=yes)
2082 AC_CHECK_HEADER(dsound.h, have_dsound=yes)
2083 AC_CHECK_HEADER(dinput.h, use_dinput=yes)
2084 if test x$have_ddraw = xyes -a x$have_dsound = xyes -a x$use_dinput = xyes; then
2087 if test x$enable_video = xyes -a x$have_directx = xyes; then
2088 AC_DEFINE(SDL_VIDEO_DRIVER_DDRAW)
2089 SOURCES="$SOURCES $srcdir/src/video/windx5/*.c"
2095 dnl Check for the dlfcn.h interface for dynamically loading objects
2098 AC_ARG_ENABLE(sdl-dlopen,
2099 AC_HELP_STRING([--enable-sdl-dlopen], [use dlopen for shared object loading [[default=yes]]]),
2100 , enable_sdl_dlopen=yes)
2101 if test x$enable_sdl_dlopen = xyes; then
2102 AC_MSG_CHECKING(for dlopen)
2107 #if defined(MAC_OS_X_VERSION_MIN_REQUIRED) && MAC_OS_X_VERSION_MIN_REQUIRED <= 1020
2108 #error Use dlcompat for Mac OS X 10.2 compatibility
2113 AC_MSG_RESULT($have_dlopen)
2115 if test x$have_dlopen = xyes; then
2116 AC_CHECK_LIB(c, dlopen, EXTRA_LDFLAGS="$EXTRA_LDFLAGS",
2117 AC_CHECK_LIB(dl, dlopen, EXTRA_LDFLAGS="$EXTRA_LDFLAGS -ldl",
2118 AC_CHECK_LIB(ltdl, dlopen, EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lltdl")))
2119 AC_DEFINE(SDL_LOADSO_DLOPEN)
2120 SOURCES="$SOURCES $srcdir/src/loadso/dlopen/*.c"
2126 dnl Set up the Atari LDG (shared object loader)
2129 AC_ARG_ENABLE(atari-ldg,
2130 AC_HELP_STRING([--enable-atari-ldg], [use Atari LDG for shared object loading [[default=yes]]]),
2131 , enable_atari_ldg=yes)
2132 if test x$video_gem = xyes -a x$enable_atari_ldg = xyes; then
2133 AC_CHECK_HEADER(ldg.h, have_ldg_hdr=yes)
2134 AC_CHECK_LIB(ldg, ldg_open, have_ldg_lib=yes, have_ldg_lib=no, -lgem)
2135 if test x$have_ldg_hdr = xyes -a x$have_ldg_lib = xyes; then
2136 AC_DEFINE(SDL_LOADSO_LDG)
2137 SOURCES="$SOURCES $srcdir/src/loadso/mint/*.c"
2138 SDL_LIBS="$SDL_LIBS -lldg -lgem"
2144 dnl Check for the usbhid(3) library on *BSD
2147 if test x$enable_joystick = xyes; then
2148 AC_CHECK_LIB(usbhid, hid_init, have_libusbhid=yes)
2149 if test x$have_libusbhid = xyes; then
2150 AC_CHECK_HEADER(usbhid.h, [USB_CFLAGS="-DHAVE_USBHID_H"])
2151 AC_CHECK_HEADER(libusbhid.h, [USB_CFLAGS="-DHAVE_LIBUSBHID_H"])
2152 USB_LIBS="$USB_LIBS -lusbhid"
2154 AC_CHECK_HEADER(usb.h, [USB_CFLAGS="-DHAVE_USB_H"])
2155 AC_CHECK_HEADER(libusb.h, [USB_CFLAGS="-DHAVE_LIBUSB_H"])
2156 AC_CHECK_LIB(usb, hid_init, [USB_LIBS="$USB_LIBS -lusb"])
2159 save_CFLAGS="$CFLAGS"
2160 CFLAGS="$CFLAGS $USB_CFLAGS"
2162 AC_MSG_CHECKING(for usbhid)
2165 #include <sys/types.h>
2166 #if defined(HAVE_USB_H)
2169 #ifdef __DragonFly__
2170 # include <bus/usb/usb.h>
2171 # include <bus/usb/usbhid.h>
2173 # include <dev/usb/usb.h>
2174 # include <dev/usb/usbhid.h>
2176 #if defined(HAVE_USBHID_H)
2178 #elif defined(HAVE_LIBUSB_H)
2180 #elif defined(HAVE_LIBUSBHID_H)
2181 #include <libusbhid.h>
2184 struct report_desc *repdesc;
2185 struct usb_ctl_report *repbuf;
2190 AC_MSG_RESULT($have_usbhid)
2192 if test x$have_usbhid = xyes; then
2193 AC_MSG_CHECKING(for ucr_data member of usb_ctl_report)
2194 have_usbhid_ucr_data=no
2196 #include <sys/types.h>
2197 #if defined(HAVE_USB_H)
2200 #ifdef __DragonFly__
2201 # include <bus/usb/usb.h>
2202 # include <bus/usb/usbhid.h>
2204 # include <dev/usb/usb.h>
2205 # include <dev/usb/usbhid.h>
2207 #if defined(HAVE_USBHID_H)
2209 #elif defined(HAVE_LIBUSB_H)
2211 #elif defined(HAVE_LIBUSBHID_H)
2212 #include <libusbhid.h>
2215 struct usb_ctl_report buf;
2216 if (buf.ucr_data) { }
2218 have_usbhid_ucr_data=yes
2220 if test x$have_usbhid_ucr_data = xyes; then
2221 USB_CFLAGS="$USB_CFLAGS -DUSBHID_UCR_DATA"
2223 AC_MSG_RESULT($have_usbhid_ucr_data)
2225 AC_MSG_CHECKING(for new usbhid API)
2228 #include <sys/types.h>
2229 #if defined(HAVE_USB_H)
2232 #ifdef __DragonFly__
2233 #include <bus/usb/usb.h>
2234 #include <bus/usb/usbhid.h>
2236 #include <dev/usb/usb.h>
2237 #include <dev/usb/usbhid.h>
2239 #if defined(HAVE_USBHID_H)
2241 #elif defined(HAVE_LIBUSB_H)
2243 #elif defined(HAVE_LIBUSBHID_H)
2244 #include <libusbhid.h>
2248 hid_start_parse(d, 1, 1);
2252 if test x$have_usbhid_new = xyes; then
2253 USB_CFLAGS="$USB_CFLAGS -DUSBHID_NEW"
2255 AC_MSG_RESULT($have_usbhid_new)
2257 AC_MSG_CHECKING(for struct joystick in machine/joystick.h)
2258 have_machine_joystick=no
2260 #include <machine/joystick.h>
2264 have_machine_joystick=yes
2266 if test x$have_machine_joystick = xyes; then
2267 AC_DEFINE(SDL_JOYSTICK_USBHID_MACHINE_JOYSTICK_H)
2269 AC_MSG_RESULT($have_machine_joystick)
2271 AC_DEFINE(SDL_JOYSTICK_USBHID)
2272 SOURCES="$SOURCES $srcdir/src/joystick/bsd/*.c"
2273 EXTRA_CFLAGS="$EXTRA_CFLAGS $USB_CFLAGS"
2274 EXTRA_LDFLAGS="$EXTRA_LDFLAGS $USB_LIBS"
2277 CFLAGS="$save_CFLAGS"
2281 dnl Check for clock_gettime()
2284 AC_ARG_ENABLE(clock_gettime,
2285 AC_HELP_STRING([--enable-clock_gettime], [use clock_gettime() instead of gettimeofday() on UNIX [[default=no]]]),
2286 , enable_clock_gettime=no)
2287 if test x$enable_clock_gettime = xyes; then
2288 AC_CHECK_LIB(rt, clock_gettime, have_clock_gettime=yes)
2289 if test x$have_clock_gettime = xyes; then
2290 AC_DEFINE(HAVE_CLOCK_GETTIME)
2291 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lrt"
2296 dnl Check for a valid linux/version.h
2299 AC_CHECK_HEADER(linux/version.h, have_linux_version_h=yes)
2300 if test x$have_linux_version_h = xyes; then
2301 EXTRA_CFLAGS="$EXTRA_CFLAGS -DHAVE_LINUX_VERSION_H"
2305 dnl Check if we want to use RPATH
2308 AC_ARG_ENABLE(rpath,
2309 AC_HELP_STRING([--enable-rpath], [use an rpath when linking SDL [[default=yes]]]),
2313 dnl Set up the configuration based on the host platform!
2315 arm-*-elf*) # FIXME: Can we get more specific for iPodLinux?
2319 # Set up files for the timer library
2320 if test x$enable_timers = xyes; then
2321 AC_DEFINE(SDL_TIMER_UNIX)
2322 SOURCES="$SOURCES $srcdir/src/timer/unix/*.c"
2326 *-*-linux*|*-*-uclinux*|*-*-gnu*|*-*-k*bsd*-gnu|*-*-bsdi*|*-*-freebsd*|*-*-dragonfly*|*-*-netbsd*|*-*-openbsd*|*-*-sysv5*|*-*-solaris*|*-*-hpux*|*-*-irix*|*-*-aix*|*-*-osf*)
2328 *-*-linux*) ARCH=linux ;;
2329 *-*-uclinux*) ARCH=linux ;;
2330 *-*-kfreebsd*-gnu) ARCH=kfreebsd-gnu ;;
2331 *-*-knetbsd*-gnu) ARCH=knetbsd-gnu ;;
2332 *-*-kopenbsd*-gnu) ARCH=kopenbsd-gnu ;;
2333 *-*-gnu*) ARCH=gnu ;; # must be last of the gnu variants
2334 *-*-bsdi*) ARCH=bsdi ;;
2335 *-*-freebsd*) ARCH=freebsd ;;
2336 *-*-dragonfly*) ARCH=freebsd ;;
2337 *-*-netbsd*) ARCH=netbsd ;;
2338 *-*-openbsd*) ARCH=openbsd ;;
2339 *-*-sysv5*) ARCH=sysv5 ;;
2340 *-*-solaris*) ARCH=solaris ;;
2341 *-*-hpux*) ARCH=hpux ;;
2342 *-*-irix*) ARCH=irix ;;
2343 *-*-aix*) ARCH=aix ;;
2344 *-*-osf*) ARCH=osf ;;
2346 CheckVisibilityHidden
2385 # Set up files for the audio library
2386 if test x$enable_audio = xyes; then
2389 AC_DEFINE(SDL_AUDIO_DRIVER_SUNAUDIO)
2390 SOURCES="$SOURCES $srcdir/src/audio/sun/*.c"
2394 AC_DEFINE(SDL_AUDIO_DRIVER_BSD)
2395 SOURCES="$SOURCES $srcdir/src/audio/bsd/*.c"
2399 AC_DEFINE(SDL_AUDIO_DRIVER_PAUD)
2400 SOURCES="$SOURCES $srcdir/src/audio/paudio/*.c"
2405 # Set up files for the joystick library
2406 if test x$enable_joystick = xyes; then
2409 AC_DEFINE(SDL_JOYSTICK_LINUX)
2410 SOURCES="$SOURCES $srcdir/src/joystick/linux/*.c"
2415 # Set up files for the cdrom library
2416 if test x$enable_cdrom = xyes; then
2419 AC_DEFINE(SDL_CDROM_LINUX)
2420 SOURCES="$SOURCES $srcdir/src/cdrom/linux/*.c"
2424 AC_DEFINE(SDL_CDROM_FREEBSD)
2425 SOURCES="$SOURCES $srcdir/src/cdrom/freebsd/*.c"
2429 AC_DEFINE(SDL_CDROM_OPENBSD)
2430 SOURCES="$SOURCES $srcdir/src/cdrom/openbsd/*.c"
2434 AC_DEFINE(SDL_CDROM_BSDI)
2435 SOURCES="$SOURCES $srcdir/src/cdrom/bsdi/*.c"
2439 AC_DEFINE(SDL_CDROM_AIX)
2440 SOURCES="$SOURCES $srcdir/src/cdrom/aix/*.c"
2444 AC_DEFINE(SDL_CDROM_OSF)
2445 SOURCES="$SOURCES $srcdir/src/cdrom/osf/*.c"
2450 # Set up files for the thread library
2451 if test x$enable_threads = xyes -a x$use_pthreads != xyes -a x$use_pth != xyes -a x$ARCH = xirix; then
2452 AC_DEFINE(SDL_THREAD_SPROC)
2453 SOURCES="$SOURCES $srcdir/src/thread/irix/*.c"
2454 SOURCES="$SOURCES $srcdir/src/thread/generic/SDL_sysmutex.c"
2455 SOURCES="$SOURCES $srcdir/src/thread/generic/SDL_syscond.c"
2458 # Set up files for the timer library
2459 if test x$enable_timers = xyes; then
2460 AC_DEFINE(SDL_TIMER_UNIX)
2461 SOURCES="$SOURCES $srcdir/src/timer/unix/*.c"
2477 # Set up files for the audio library
2478 if test x$enable_audio = xyes; then
2479 AC_DEFINE(SDL_AUDIO_DRIVER_QNXNTO)
2480 SOURCES="$SOURCES $srcdir/src/audio/nto/*.c"
2481 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lasound"
2484 # Set up files for the cdrom library
2485 if test x$enable_cdrom = xyes; then
2486 AC_DEFINE(SDL_CDROM_QNX)
2487 SOURCES="$SOURCES $srcdir/src/cdrom/qnx/*.c"
2490 # Set up files for the timer library
2491 if test x$enable_timers = xyes; then
2492 AC_DEFINE(SDL_TIMER_UNIX)
2493 SOURCES="$SOURCES $srcdir/src/timer/unix/*.c"
2497 *-*-cygwin* | *-*-mingw32*)
2499 if test "$build" != "$host"; then # cross-compiling
2500 # Default cross-compile location
2501 ac_default_prefix=/usr/local/cross-tools/i386-mingw32
2503 # Look for the location of the tools and install there
2504 if test "$BUILD_PREFIX" != ""; then
2505 ac_default_prefix=$BUILD_PREFIX
2515 # Set up files for the audio library
2516 if test x$enable_audio = xyes; then
2517 AC_DEFINE(SDL_AUDIO_DRIVER_WAVEOUT)
2518 SOURCES="$SOURCES $srcdir/src/audio/windib/*.c"
2519 if test x$have_directx = xyes; then
2520 AC_DEFINE(SDL_AUDIO_DRIVER_DSOUND)
2521 SOURCES="$SOURCES $srcdir/src/audio/windx5/*.c"
2525 # Set up files for the joystick library
2526 if test x$enable_joystick = xyes; then
2527 AC_DEFINE(SDL_JOYSTICK_WINMM)
2528 SOURCES="$SOURCES $srcdir/src/joystick/win32/*.c"
2531 # Set up files for the cdrom library
2532 if test x$enable_cdrom = xyes; then
2533 AC_DEFINE(SDL_CDROM_WIN32)
2534 SOURCES="$SOURCES $srcdir/src/cdrom/win32/*.c"
2537 # Set up files for the thread library
2538 if test x$enable_threads = xyes; then
2539 AC_DEFINE(SDL_THREAD_WIN32)
2540 SOURCES="$SOURCES $srcdir/src/thread/win32/SDL_sysmutex.c"
2541 SOURCES="$SOURCES $srcdir/src/thread/win32/SDL_syssem.c"
2542 SOURCES="$SOURCES $srcdir/src/thread/win32/SDL_systhread.c"
2543 SOURCES="$SOURCES $srcdir/src/thread/generic/SDL_syscond.c"
2546 # Set up files for the timer library
2547 if test x$enable_timers = xyes; then
2548 AC_DEFINE(SDL_TIMER_WIN32)
2549 SOURCES="$SOURCES $srcdir/src/timer/win32/*.c"
2552 # Set up files for the shared object loading library
2553 if test x$enable_loadso = xyes; then
2554 AC_DEFINE(SDL_LOADSO_WIN32)
2555 SOURCES="$SOURCES $srcdir/src/loadso/win32/*.c"
2558 # Set up the system libraries we need
2559 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -luser32 -lgdi32 -lwinmm"
2560 if test x$have_directx = xyes; then
2561 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -ldxguid"
2563 # The Win32 platform requires special setup
2564 SOURCES="$SOURCES $srcdir/src/main/win32/*.rc"
2565 SDLMAIN_SOURCES="$srcdir/src/main/win32/*.c"
2566 SDL_CFLAGS="$SDL_CFLAGS -Dmain=SDL_main"
2567 SDL_LIBS="-lmingw32 -lSDLmain $SDL_LIBS -mwindows"
2576 SOURCES="$SOURCES $srcdir/src/video/gapi/*.c"
2577 EXTRA_CFLAGS="$EXTRA_CFLAGS -D_WIN32_WCE=0x420"
2578 if test x$enable_audio = xyes; then
2579 AC_DEFINE(SDL_AUDIO_DRIVER_WAVEOUT)
2580 SOURCES="$SOURCES $srcdir/src/audio/windib/*.c"
2583 # Set up files for the thread library
2584 if test x$enable_threads = xyes; then
2585 AC_DEFINE(SDL_THREAD_WIN32)
2586 SOURCES="$SOURCES $srcdir/src/thread/win32/SDL_sysmutex.c"
2587 SOURCES="$SOURCES $srcdir/src/thread/win32/SDL_syssem.c"
2588 SOURCES="$SOURCES $srcdir/src/thread/win32/SDL_systhread.c"
2589 SOURCES="$SOURCES $srcdir/src/thread/generic/SDL_syscond.c"
2592 # Set up files for the timer library
2593 if test x$enable_timers = xyes; then
2594 AC_DEFINE(SDL_TIMER_WINCE)
2595 SOURCES="$SOURCES $srcdir/src/timer/wince/*.c"
2596 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lcoredll -lmmtimer"
2599 # Set up files for the shared object loading library
2600 if test x$enable_loadso = xyes; then
2601 AC_DEFINE(SDL_LOADSO_WIN32)
2602 SOURCES="$SOURCES $srcdir/src/loadso/win32/*.c"
2605 # Set up the system libraries we need
2606 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lcoredll -lcommctrl"
2607 # The Win32 platform requires special setup
2608 SDLMAIN_SOURCES="$srcdir/src/main/win32/*.c"
2609 SDL_CFLAGS="$SDL_CFLAGS -Dmain=SDL_main -D_WIN32_WCE=0x420"
2610 SDL_LIBS="-lSDLmain $SDL_LIBS"
2612 *-*-beos* | *-*-haiku*)
2614 ac_default_prefix=/boot/develop/tools/gnupro
2621 # Set up files for the audio library
2622 if test x$enable_audio = xyes; then
2623 AC_DEFINE(SDL_AUDIO_DRIVER_BAUDIO)
2624 SOURCES="$SOURCES $srcdir/src/audio/baudio/*.cc"
2627 # Set up files for the joystick library
2628 if test x$enable_joystick = xyes; then
2629 AC_DEFINE(SDL_JOYSTICK_BEOS)
2630 SOURCES="$SOURCES $srcdir/src/joystick/beos/*.cc"
2633 # Set up files for the cdrom library
2634 if test x$enable_cdrom = xyes; then
2635 AC_DEFINE(SDL_CDROM_BEOS)
2636 SOURCES="$SOURCES $srcdir/src/cdrom/beos/*.cc"
2639 # Set up files for the thread library
2640 if test x$enable_threads = xyes; then
2641 AC_DEFINE(SDL_THREAD_BEOS)
2642 SOURCES="$SOURCES $srcdir/src/thread/beos/*.c"
2643 SOURCES="$SOURCES $srcdir/src/thread/generic/SDL_sysmutex.c"
2644 SOURCES="$SOURCES $srcdir/src/thread/generic/SDL_syscond.c"
2647 # Set up files for the timer library
2648 if test x$enable_timers = xyes; then
2649 AC_DEFINE(SDL_TIMER_BEOS)
2650 SOURCES="$SOURCES $srcdir/src/timer/beos/*.c"
2653 # Set up files for the shared object loading library
2654 if test x$enable_loadso = xyes; then
2657 AC_DEFINE(SDL_LOADSO_BEOS)
2658 SOURCES="$SOURCES $srcdir/src/loadso/beos/*.c"
2661 AC_DEFINE(SDL_LOADSO_DLOPEN)
2662 SOURCES="$SOURCES $srcdir/src/loadso/dlopen/*.c"
2667 # The BeOS platform requires special setup.
2668 SOURCES="$srcdir/src/main/beos/*.cc $SOURCES"
2669 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lroot -lbe -lmedia -lgame -ldevice -ltextencoding"
2672 # This could be either full "Mac OS X", or plain "Darwin" which is
2673 # just the OS X kernel sans upper layers like Carbon and Cocoa.
2674 # Next line is broken, and a few files below require Mac OS X (full)
2677 # Mac OS X builds with both the Carbon and OSX APIs at the moment
2678 EXTRA_CFLAGS="$EXTRA_CFLAGS -DTARGET_API_MAC_CARBON"
2679 EXTRA_CFLAGS="$EXTRA_CFLAGS -DTARGET_API_MAC_OSX"
2681 # HACK: Reset EXTRA_LDFLAGS; the only thing it contains at this point
2682 # is -lm which is not needed under Mac OS X. But for some reasons it
2683 # also tends to contain spurious -L switches, which we don't want to
2684 # use here or in sdl-config. Hence we reset it.
2687 CheckVisibilityHidden
2694 # Set up files for the shared object loading library
2695 # (this needs to be done before the dynamic X11 check)
2696 if test x$enable_loadso = xyes -a x$have_dlopen != xyes; then
2697 AC_DEFINE(SDL_LOADSO_DLCOMPAT)
2698 SOURCES="$SOURCES $srcdir/src/loadso/macosx/*.c"
2710 # Need this or things might misbuild on a G3.
2711 EXTRA_CFLAGS="$EXTRA_CFLAGS -force_cpusubtype_ALL"
2713 # Set up files for the audio library
2714 if test x$enable_audio = xyes; then
2715 AC_DEFINE(SDL_AUDIO_DRIVER_COREAUDIO)
2716 SOURCES="$SOURCES $srcdir/src/audio/macosx/*.c"
2719 # Set up files for the joystick library
2720 if test x$enable_joystick = xyes; then
2721 AC_DEFINE(SDL_JOYSTICK_IOKIT)
2722 SOURCES="$SOURCES $srcdir/src/joystick/darwin/*.c"
2724 need_iokit_framework=yes
2726 # Set up files for the cdrom library
2727 if test x$enable_cdrom = xyes; then
2728 AC_DEFINE(SDL_CDROM_MACOSX)
2729 SOURCES="$SOURCES $srcdir/src/cdrom/macosx/*.c"
2732 # Set up files for the timer library
2733 if test x$enable_timers = xyes; then
2734 AC_DEFINE(SDL_TIMER_UNIX)
2735 SOURCES="$SOURCES $srcdir/src/timer/unix/*.c"
2738 # The Mac OS X platform requires special setup.
2739 SDLMAIN_SOURCES="$srcdir/src/main/macosx/*.m"
2740 EXTRA_CFLAGS="$EXTRA_CFLAGS -fpascal-strings"
2741 SDL_LIBS="-lSDLmain $SDL_LIBS"
2742 if test x$enable_video_cocoa = xyes; then
2743 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,Cocoa"
2744 need_iokit_framework=yes
2746 if test x$enable_video_carbon = xyes -o x$enable_video_cocoa = xyes; then
2747 # The Cocoa backend still needs Carbon
2748 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,ApplicationServices"
2749 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,Carbon"
2751 # If either the audio or CD driver is used, add the AudioUnit framework
2752 if test x$enable_audio = xyes -o x$enable_cdrom = xyes; then
2753 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,AudioToolbox -Wl,-framework,AudioUnit"
2755 # Some subsystems reference IOKit...
2756 if test x$need_iokit_framework = xyes; then
2757 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,IOKit"
2766 CheckAtariXbiosVideo
2772 # Set up files for the audio library
2773 if test x$enable_threads = xyes -a x$enable_pth = xyes; then
2774 if test x$enable_audio = xyes; then
2775 AC_DEFINE(SDL_AUDIO_DRIVER_SUNAUDIO)
2776 SOURCES="$SOURCES $srcdir/src/audio/sun/*.c"
2780 # Set up files for the joystick library
2781 if test x$enable_joystick = xyes; then
2782 AC_DEFINE(SDL_JOYSTICK_MINT)
2783 SOURCES="$SOURCES $srcdir/src/joystick/mint/*.c"
2786 # Set up files for the cdrom library
2787 if test x$enable_cdrom = xyes; then
2788 AC_DEFINE(SDL_CDROM_MINT)
2789 SOURCES="$SOURCES $srcdir/src/cdrom/mint/*.c"
2792 # Set up files for the timer library
2793 if test x$enable_timers = xyes; then
2794 if test x$enable_threads = xyes -a x$enable_pth = xyes; then
2795 AC_DEFINE(SDL_TIMER_UNIX)
2796 SOURCES="$SOURCES $srcdir/src/timer/unix/*.c"
2798 AC_DEFINE(SDL_TIMER_MINT)
2799 SOURCES="$SOURCES $srcdir/src/timer/mint/*.c"
2800 SOURCES="$SOURCES $srcdir/src/timer/mint/*.S"
2809 # Set up files for the video library
2810 if test x$enable_video = xyes; then
2811 AC_DEFINE(SDL_VIDEO_DRIVER_RISCOS)
2812 SOURCES="$SOURCES $srcdir/src/video/riscos/*.c"
2813 SOURCES="$SOURCES $srcdir/src/video/riscos/*.S"
2816 # Set up files for the joystick library
2817 if test x$enable_joystick = xyes; then
2818 AC_DEFINE(SDL_JOYSTICK_RISCOS)
2819 SOURCES="$SOURCES $srcdir/src/joystick/riscos/*.c"
2822 # Set up files for the timer library
2823 if test x$enable_timers = xyes; then
2824 AC_DEFINE(SDL_TIMER_RISCOS)
2825 SOURCES="$SOURCES $srcdir/src/timer/riscos/*.c"
2828 # The RISC OS platform requires special setup.
2829 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -ljpeg -ltiff -lpng -lz"
2833 *** Unsupported host: Please add to configure.in
2838 # Verify that we have all the platform specific files we need
2840 if test x$enable_joystick = xyes; then
2841 if test x$have_joystick != xyes; then
2842 # Wants joystick subsystem, but doesn't have a platform-specific backend...
2843 AC_DEFINE(SDL_JOYSTICK_DUMMY)
2844 SOURCES="$SOURCES $srcdir/src/joystick/dummy/*.c"
2847 if test x$have_cdrom != xyes; then
2848 if test x$enable_cdrom = xyes; then
2849 AC_DEFINE(SDL_CDROM_DISABLED)
2851 SOURCES="$SOURCES $srcdir/src/cdrom/dummy/*.c"
2853 if test x$have_threads != xyes; then
2854 if test x$enable_threads = xyes; then
2855 AC_DEFINE(SDL_THREADS_DISABLED)
2857 SOURCES="$SOURCES $srcdir/src/thread/generic/*.c"
2859 if test x$have_timers != xyes; then
2860 if test x$enable_timers = xyes; then
2861 AC_DEFINE(SDL_TIMERS_DISABLED)
2863 SOURCES="$SOURCES $srcdir/src/timer/dummy/*.c"
2865 if test x$have_loadso != xyes; then
2866 if test x$enable_loadso = xyes; then
2867 AC_DEFINE(SDL_LOADSO_DISABLED)
2869 SOURCES="$SOURCES $srcdir/src/loadso/dummy/*.c"
2871 if test x$SDLMAIN_SOURCES = x; then
2872 SDLMAIN_SOURCES="$srcdir/src/main/dummy/*.c"
2875 OBJECTS=`echo $SOURCES | sed 's,[[^ ]]*/\([[^ ]]*\)\.asm,$(objects)/\1.lo,g'`
2876 OBJECTS=`echo $OBJECTS | sed 's,[[^ ]]*/\([[^ ]]*\)\.cc,$(objects)/\1.lo,g'`
2877 OBJECTS=`echo $OBJECTS | sed 's,[[^ ]]*/\([[^ ]]*\)\.m,$(objects)/\1.lo,g'`
2878 OBJECTS=`echo $OBJECTS | sed 's,[[^ ]]*/\([[^ ]]*\)\.c,$(objects)/\1.lo,g'`
2879 OBJECTS=`echo $OBJECTS | sed 's,[[^ ]]*/\([[^ ]]*\)\.S,$(objects)/\1.lo,g'`
2880 OBJECTS=`echo $OBJECTS | sed 's,[[^ ]]*/\([[^ ]]*\)\.rc,$(objects)/\1.o,g'`
2882 SDLMAIN_OBJECTS=`echo $SDLMAIN_SOURCES | sed 's,[[^ ]]*/\([[^ ]]*\)\.cc,$(objects)/\1.o,g'`
2883 SDLMAIN_OBJECTS=`echo $SDLMAIN_OBJECTS | sed 's,[[^ ]]*/\([[^ ]]*\)\.m,$(objects)/\1.o,g'`
2884 SDLMAIN_OBJECTS=`echo $SDLMAIN_OBJECTS | sed 's,[[^ ]]*/\([[^ ]]*\)\.c,$(objects)/\1.o,g'`
2886 # Set runtime shared library paths as needed
2888 if test "x$enable_rpath" = "xyes"; then
2889 if test $ARCH = bsdi -o $ARCH = freebsd -o $ARCH = irix -o $ARCH = linux -o $ARCH = netbsd; then
2890 SDL_RLD_FLAGS="-Wl,-rpath,\${libdir}"
2892 if test $ARCH = solaris; then
2893 SDL_RLD_FLAGS="-R\${libdir}"
2901 if test x$enable_video = xyes -a x$enable_video_cocoa = xyes; then
2902 SDL_LIBS="$SDL_LIBS -Wl,-framework,Cocoa"
2904 if test x$enable_video = xyes -a x$enable_video_carbon = xyes; then
2905 SDL_LIBS="$SDL_LIBS -Wl,-framework,Carbon"
2907 # Evil hack to allow static linking on Mac OS X
2908 SDL_STATIC_LIBS="\${libdir}/libSDLmain.a \${libdir}/libSDL.a $EXTRA_LDFLAGS"
2911 SDL_STATIC_LIBS="$SDL_LIBS $EXTRA_LDFLAGS"
2915 dnl Expand the cflags and libraries needed by apps using SDL
2916 AC_SUBST(SDL_CFLAGS)
2918 AC_SUBST(SDL_STATIC_LIBS)
2919 AC_SUBST(SDL_RLD_FLAGS)
2920 if test x$enable_shared = xyes; then
2922 ENABLE_SHARED_FALSE="#"
2924 ENABLE_SHARED_TRUE="#"
2925 ENABLE_SHARED_FALSE=
2927 if test x$enable_static = xyes; then
2929 ENABLE_STATIC_FALSE="#"
2931 ENABLE_STATIC_TRUE="#"
2932 ENABLE_STATIC_FALSE=
2934 AC_SUBST(ENABLE_SHARED_TRUE)
2935 AC_SUBST(ENABLE_SHARED_FALSE)
2936 AC_SUBST(ENABLE_STATIC_TRUE)
2937 AC_SUBST(ENABLE_STATIC_FALSE)
2939 dnl Expand the sources and objects needed to build the library
2940 AC_SUBST(ac_aux_dir)
2944 AC_SUBST(SDLMAIN_SOURCES)
2945 AC_SUBST(SDLMAIN_OBJECTS)
2946 AC_SUBST(BUILD_CFLAGS)
2947 AC_SUBST(EXTRA_CFLAGS)
2948 AC_SUBST(BUILD_LDFLAGS)
2949 AC_SUBST(EXTRA_LDFLAGS)
2953 Makefile sdl-config SDL.spec SDL.qpg sdl.pc
2956 if test x"$MAKE" = x; then MAKE=make; fi; $MAKE depend