1 dnl Process this file with autoconf to produce a configure script.
3 AC_CONFIG_HEADER(include/SDL_config.h)
6 dnl Set various version strings - taken gratefully from the GTk sources
9 # Edit include/SDL/SDL_version.h and change the version, then:
10 # SDL_MICRO_VERSION += 1;
11 # SDL_INTERFACE_AGE += 1;
12 # SDL_BINARY_AGE += 1;
13 # if any functions have been added, set SDL_INTERFACE_AGE to 0.
14 # if backwards compatibility has been broken,
15 # set SDL_BINARY_AGE and SDL_INTERFACE_AGE to 0.
22 SDL_VERSION=$SDL_MAJOR_VERSION.$SDL_MINOR_VERSION.$SDL_MICRO_VERSION
24 AC_SUBST(SDL_MAJOR_VERSION)
25 AC_SUBST(SDL_MINOR_VERSION)
26 AC_SUBST(SDL_MICRO_VERSION)
27 AC_SUBST(SDL_INTERFACE_AGE)
28 AC_SUBST(SDL_BINARY_AGE)
32 LT_RELEASE=$SDL_MAJOR_VERSION.$SDL_MINOR_VERSION
33 LT_CURRENT=`expr $SDL_MICRO_VERSION - $SDL_INTERFACE_AGE`
34 LT_REVISION=$SDL_INTERFACE_AGE
35 LT_AGE=`expr $SDL_BINARY_AGE - $SDL_INTERFACE_AGE`
42 dnl Detect the canonical build and host environments
43 AC_CONFIG_AUX_DIRS($srcdir/build-scripts)
46 if test x$ac_cv_c_bigendian = xyes; then
47 AC_DEFINE(SDL_BYTEORDER, 4321)
49 AC_DEFINE(SDL_BYTEORDER, 1234)
52 dnl Set up the compiler and linker flags
53 INCLUDE="-I$srcdir/include"
54 if test x$srcdir != x.; then
55 # Remove SDL_config.h from the source directory, since it's the
56 # default one, and we want to include the one that we generate.
57 if test -f $srcdir/include/SDL_config.h; then
58 rm $srcdir/include/SDL_config.h
60 INCLUDE="-Iinclude $INCLUDE"
64 # We build SDL on cygwin without the UNIX emulation layer
65 BASE_CFLAGS="-I/usr/include/mingw -mno-cygwin"
66 BASE_LDFLAGS="-mno-cygwin"
69 BASE_CFLAGS="-D_GNU_SOURCE=1"
73 BUILD_CFLAGS="$CFLAGS $CPPFLAGS"
74 EXTRA_CFLAGS="$INCLUDE $BASE_CFLAGS"
75 BUILD_LDFLAGS="$LDFLAGS"
76 EXTRA_LDFLAGS="$BASE_LDFLAGS"
77 ## These are common directories to find software packages
78 #for path in /usr/freeware /usr/pkg /usr/X11R6 /usr/local; do
79 # if test -d $path/include; then
80 # EXTRA_CFLAGS="$EXTRA_CFLAGS -I$path/include"
82 # if test -d $path/lib; then
83 # EXTRA_LDFLAGS="$EXTRA_LDFLAGS -L$path/lib"
86 SDL_CFLAGS="$BASE_CFLAGS"
87 SDL_LIBS="-lSDL $BASE_LDFLAGS"
88 CPPFLAGS="$CPPFLAGS $EXTRA_CFLAGS"
89 CFLAGS="$CFLAGS $EXTRA_CFLAGS"
90 LDFLAGS="$LDFLAGS $EXTRA_LDFLAGS"
99 if test -z "$host_alias"; then
102 hostaliaswindres="$host_alias-windres"
104 AC_CHECK_PROGS(WINDRES, [windres $hostaliaswindres $host_os-windres])
106 dnl Check for compiler characteristics
111 dnl See whether we are allowed to use the system C library
113 AC_HELP_STRING([--enable-libc], [Use the system C library [[default=yes]]]),
115 if test x$enable_libc = xyes; then
118 dnl Check for C library headers
120 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)
122 dnl Check for typedefs, structures, etc.
124 if test x$ac_cv_header_inttypes_h = xyes -o x$ac_cv_header_stdint_h = xyes; then
125 AC_CHECK_TYPE(int64_t)
126 if test x$ac_cv_type_int64_t = xyes; then
127 AC_DEFINE(SDL_HAS_64BIT_TYPE)
132 dnl Checks for library functions.
134 *-*-cygwin* | *-*-mingw32*)
142 if test x$ac_cv_func_memcmp_working = xyes; then
143 AC_DEFINE(HAVE_MEMCMP)
146 if test x$ac_cv_func_strtod = xyes; then
147 AC_DEFINE(HAVE_STRTOD)
149 AC_CHECK_FUNC(mprotect,
151 #include <sys/types.h>
152 #include <sys/mman.h>
155 AC_DEFINE(HAVE_MPROTECT)
158 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)
160 AC_CHECK_LIB(iconv, libiconv_open, [EXTRA_LDFLAGS="$EXTRA_LDFLAGS -liconv"])
161 AC_CHECK_LIB(m, pow, [EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lm"])
164 if test x$have_inttypes != xyes; then
165 AC_CHECK_SIZEOF(char, 1)
166 AC_CHECK_SIZEOF(short, 2)
167 AC_CHECK_SIZEOF(int, 4)
168 AC_CHECK_SIZEOF(long, 4)
169 AC_CHECK_SIZEOF(long long, 8)
170 if test x$ac_cv_sizeof_char = x1; then
171 AC_DEFINE(int8_t, signed char)
172 AC_DEFINE(uint8_t, unsigned char)
174 if test x$ac_cv_sizeof_short = x2; then
175 AC_DEFINE(int16_t, signed short)
176 AC_DEFINE(uint16_t, unsigned short)
178 if test x$ac_cv_sizeof_int = x2; then
179 AC_DEFINE(int16_t, signed int)
180 AC_DEFINE(uint16_t, unsigned int)
183 if test x$ac_cv_sizeof_int = x4; then
184 AC_DEFINE(int32_t, signed int)
185 AC_DEFINE(uint32_t, unsigned int)
187 if test x$ac_cv_sizeof_long = x4; then
188 AC_DEFINE(int32_t, signed long)
189 AC_DEFINE(uint32_t, unsigned long)
192 if test x$ac_cv_sizeof_long = x8; then
193 AC_DEFINE(int64_t, signed long)
194 AC_DEFINE(uint64_t, unsigned long)
195 AC_DEFINE(SDL_HAS_64BIT_TYPE)
197 if test x$ac_cv_sizeof_long_long = x8; then
198 AC_DEFINE(int64_t, signed long long)
199 AC_DEFINE(uint64_t, unsigned long long)
200 AC_DEFINE(SDL_HAS_64BIT_TYPE)
203 AC_DEFINE(size_t, unsigned int)
204 AC_DEFINE(uintptr_t, unsigned long)
208 SOURCES="$SOURCES $srcdir/src/*.c"
209 SOURCES="$SOURCES $srcdir/src/audio/*.c"
210 SOURCES="$SOURCES $srcdir/src/cdrom/*.c"
211 SOURCES="$SOURCES $srcdir/src/cpuinfo/*.c"
212 SOURCES="$SOURCES $srcdir/src/events/*.c"
213 SOURCES="$SOURCES $srcdir/src/file/*.c"
214 SOURCES="$SOURCES $srcdir/src/stdlib/*.c"
215 SOURCES="$SOURCES $srcdir/src/thread/*.c"
216 SOURCES="$SOURCES $srcdir/src/timer/*.c"
217 SOURCES="$SOURCES $srcdir/src/video/*.c"
219 dnl Enable/disable various subsystems of the SDL library
222 AC_HELP_STRING([--enable-audio], [Enable the audio subsystem [[default=yes]]]),
224 if test x$enable_audio != xyes; then
225 AC_DEFINE(SDL_AUDIO_DISABLED)
228 AC_HELP_STRING([--enable-video], [Enable the video subsystem [[default=yes]]]),
230 if test x$enable_video != xyes; then
231 AC_DEFINE(SDL_VIDEO_DISABLED)
233 AC_ARG_ENABLE(events,
234 AC_HELP_STRING([--enable-events], [Enable the events subsystem [[default=yes]]]),
236 if test x$enable_events != xyes; then
237 AC_DEFINE(SDL_EVENTS_DISABLED)
239 AC_ARG_ENABLE(joystick,
240 AC_HELP_STRING([--enable-joystick], [Enable the joystick subsystem [[default=yes]]]),
241 , enable_joystick=yes)
242 if test x$enable_joystick != xyes; then
243 AC_DEFINE(SDL_JOYSTICK_DISABLED)
245 SOURCES="$SOURCES $srcdir/src/joystick/*.c"
248 AC_HELP_STRING([--enable-cdrom], [Enable the cdrom subsystem [[default=yes]]]),
250 if test x$enable_cdrom != xyes; then
251 AC_DEFINE(SDL_CDROM_DISABLED)
253 AC_ARG_ENABLE(threads,
254 AC_HELP_STRING([--enable-threads], [Enable the threading subsystem [[default=yes]]]),
255 , enable_threads=yes)
256 if test x$enable_threads != xyes; then
257 AC_DEFINE(SDL_THREADS_DISABLED)
259 AC_ARG_ENABLE(timers,
260 AC_HELP_STRING([--enable-timers], [Enable the timer subsystem [[default=yes]]]),
262 if test x$enable_timers != xyes; then
263 AC_DEFINE(SDL_TIMERS_DISABLED)
266 AC_HELP_STRING([--enable-file], [Enable the file subsystem [[default=yes]]]),
268 if test x$enable_file != xyes; then
269 AC_DEFINE(SDL_FILE_DISABLED)
271 AC_ARG_ENABLE(loadso,
272 AC_HELP_STRING([--enable-loadso], [Enable the shared object loading subsystem [[default=yes]]]),
274 if test x$enable_loadso != xyes; then
275 AC_DEFINE(SDL_LOADSO_DISABLED)
277 AC_ARG_ENABLE(cpuinfo,
278 AC_HELP_STRING([--enable-cpuinfo], [Enable the cpuinfo subsystem [[default=yes]]]),
279 , enable_cpuinfo=yes)
280 if test x$enable_cpuinfo != xyes; then
281 AC_DEFINE(SDL_CPUINFO_DISABLED)
283 AC_ARG_ENABLE(assembly,
284 AC_HELP_STRING([--enable-assembly], [Enable assembly routines [[default=yes]]]),
285 , enable_assembly=yes)
286 if test x$enable_assembly = xyes; then
287 AC_DEFINE(SDL_ASSEMBLY_ROUTINES)
290 dnl See if the OSS audio interface is supported
294 AC_HELP_STRING([--enable-oss], [support the OSS audio API [[default=yes]]]),
296 if test x$enable_audio = xyes -a x$enable_oss = xyes; then
297 AC_MSG_CHECKING(for OSS audio support)
299 if test x$have_oss != xyes; then
301 #include <sys/soundcard.h>
303 int arg = SNDCTL_DSP_SETFRAGMENT;
308 if test x$have_oss != xyes; then
310 #include <soundcard.h>
312 int arg = SNDCTL_DSP_SETFRAGMENT;
315 AC_DEFINE(SDL_AUDIO_DRIVER_OSS_SOUNDCARD_H)
318 AC_MSG_RESULT($have_oss)
319 if test x$have_oss = xyes; then
320 AC_DEFINE(SDL_AUDIO_DRIVER_OSS)
321 SOURCES="$SOURCES $srcdir/src/audio/dsp/*.c"
322 SOURCES="$SOURCES $srcdir/src/audio/dma/*.c"
325 # We may need to link with ossaudio emulation library
327 *-*-openbsd*|*-*-netbsd*)
328 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lossaudio";;
334 dnl See if the ALSA audio interface is supported
338 AC_HELP_STRING([--enable-alsa], [support the ALSA audio API [[default=yes]]]),
340 if test x$enable_audio = xyes -a x$enable_alsa = xyes; then
341 AM_PATH_ALSA(0.9.0, have_alsa=yes, have_alsa=no)
342 # Restore all flags from before the ALSA detection runs
343 CFLAGS="$alsa_save_CFLAGS"
344 LDFLAGS="$alsa_save_LDFLAGS"
345 LIBS="$alsa_save_LIBS"
346 if test x$have_alsa = xyes; then
347 AC_ARG_ENABLE(alsa-shared,
348 AC_HELP_STRING([--enable-alsa-shared], [dynamically load ALSA audio support [[default=yes]]]),
349 , enable_alsa_shared=yes)
350 if test "x`echo $ALSA_LIBS | grep -- -L`" = "x"; then
351 if test "x`ls /lib/libasound.so.* 2> /dev/null`" != "x"; then
352 ALSA_LIBS="-L/lib $ALSA_LIBS"
353 elif test "x`ls /usr/lib/libasound.so.* 2> /dev/null`" != "x"; then
354 ALSA_LIBS="-L/usr/lib $ALSA_LIBS"
355 elif test "x`ls /usr/local/lib/libasound.so.* 2> /dev/null`" != "x"; then
356 ALSA_LIBS="-L/usr/local/lib $ALSA_LIBS"
359 alsa_lib_spec=`echo $ALSA_LIBS | sed 's/.*-L\([[^ ]]*\).*/\1\/libasound.so.*/'`
360 alsa_lib=`ls -- $alsa_lib_spec | sed 's/.*\/\(.*\)/\1/; q'`
361 echo "-- $alsa_lib_spec -> $alsa_lib"
363 AC_DEFINE(SDL_AUDIO_DRIVER_ALSA)
364 SOURCES="$SOURCES $srcdir/src/audio/alsa/*.c"
365 EXTRA_CFLAGS="$EXTRA_CFLAGS $ALSA_CFLAGS"
366 if test x$have_loadso != xyes && \
367 test x$enable_alsa_shared = xyes; then
368 AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic ALSA loading])
370 if test x$have_loadso = xyes && \
371 test x$enable_alsa_shared = xyes && test x$alsa_lib != x; then
372 AC_DEFINE_UNQUOTED(SDL_AUDIO_DRIVER_ALSA_DYNAMIC, "$alsa_lib")
374 EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ALSA_LIBS"
381 dnl Check whether we want to use IRIX 6.5+ native audio or not
384 if test x$enable_audio = xyes; then
385 AC_MSG_CHECKING(for dmedia audio support)
388 #include <dmedia/audio.h>
394 AC_MSG_RESULT($have_dmedia)
395 # Set up files for the audio library
396 if test x$have_dmedia = xyes; then
397 AC_DEFINE(SDL_AUDIO_DRIVER_DMEDIA)
398 SOURCES="$SOURCES $srcdir/src/audio/dmedia/*.c"
399 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -laudio"
405 dnl Check whether we want to use Tru64 UNIX native audio or not
408 dnl Make sure we are running on an Tru64 UNIX
416 if test x$enable_audio = xyes; then
417 AC_MSG_CHECKING(for MME audio support)
418 MME_CFLAGS="-I/usr/include/mme"
421 save_CFLAGS="$CFLAGS"
422 CFLAGS="$CFLAGS $MME_CFLAGS"
430 CFLAGS="$save_CFLAGS"
431 AC_MSG_RESULT($have_mme)
432 # Set up files for the audio library
433 if test x$have_mme = xyes; then
434 AC_DEFINE(SDL_AUDIO_DRIVER_MMEAUDIO)
435 SOURCES="$SOURCES $srcdir/src/audio/mme/*.c"
436 EXTRA_CFLAGS="$EXTRA_CFLAGS $MME_CFLAGS"
437 EXTRA_LDFLAGS="$EXTRA_LDFLAGS $MME_LIBS"
443 dnl Find the ESD includes and libraries
447 AC_HELP_STRING([--enable-esd], [support the Enlightened Sound Daemon [[default=yes]]]),
449 if test x$enable_audio = xyes -a x$enable_esd = xyes; then
450 AM_PATH_ESD(0.2.8, have_esd=yes, have_esd=no)
451 if test x$have_esd = xyes; then
452 AC_ARG_ENABLE(esd-shared,
453 AC_HELP_STRING([--enable-esd-shared], [dynamically load ESD audio support [[default=yes]]]),
454 , enable_esd_shared=yes)
455 esd_lib_spec=`echo $ESD_LIBS | sed 's/.*-L\([[^ ]]*\).*/\1\/libesd.so.*/'`
456 esd_lib=`ls -- $esd_lib_spec | sed 's/.*\/\(.*\)/\1/; q'`
457 echo "-- $esd_lib_spec -> $esd_lib"
459 AC_DEFINE(SDL_AUDIO_DRIVER_ESD)
460 SOURCES="$SOURCES $srcdir/src/audio/esd/*.c"
461 EXTRA_CFLAGS="$EXTRA_CFLAGS $ESD_CFLAGS"
462 if test x$have_loadso != xyes && \
463 test x$enable_esd_shared = xyes; then
464 AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic ESD loading])
466 if test x$have_loadso = xyes && \
467 test x$enable_esd_shared = xyes && test x$esd_lib != x; then
468 AC_DEFINE_UNQUOTED(SDL_AUDIO_DRIVER_ESD_DYNAMIC, "$esd_lib")
470 EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ESD_LIBS"
480 AC_ARG_ENABLE(pulseaudio,
481 AC_HELP_STRING([--enable-pulseaudio], [use PulseAudio [[default=yes]]]),
483 if test x$enable_audio = xyes -a x$enable_pulse = xyes; then
486 PULSE_REQUIRED_VERSION=0.9
488 AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
489 AC_MSG_CHECKING(for PulseAudio $PULSE_REQUIRED_VERSION support)
490 if test x$PKG_CONFIG != xno; then
491 if $PKG_CONFIG --atleast-pkgconfig-version 0.7 && $PKG_CONFIG --atleast-version $PULSE_REQUIRED_VERSION libpulse-simple; then
492 PULSE_CFLAGS=`$PKG_CONFIG --cflags libpulse-simple`
493 PULSE_LIBS=`$PKG_CONFIG --libs libpulse-simple`
497 AC_MSG_RESULT($audio_pulse)
499 if test x$audio_pulse = xyes; then
500 AC_ARG_ENABLE(pulseaudio-shared,
501 AC_HELP_STRING([--enable-pulseaudio-shared], [dynamically load PulseAudio support [[default=yes]]]),
502 , enable_pulse_shared=yes)
503 if test "x`echo $PULSE_LIBS | grep -- -L`" = "x"; then
504 if test "x`ls /lib/libpulse-simple.so.* 2> /dev/null`" != "x"; then
505 PULSE_LIBS="-L/lib $PULSE_LIBS"
506 elif test "x`ls /usr/lib/libpulse-simple.so.* 2> /dev/null`" != "x"; then
507 PULSE_LIBS="-L/usr/lib $PULSE_LIBS"
508 elif test "x`ls /usr/local/lib/libpulse-simple.so.* 2> /dev/null`" != "x"; then
509 PULSE_LIBS="-L/usr/local/lib $PULSE_LIBS"
512 pulse_lib_spec=`echo $PULSE_LIBS | sed 's/.*-L\([[^ ]]*\).*/\1\/libpulse-simple.so.*/'`
513 pulse_lib=`ls -- $pulse_lib_spec | sed 's/.*\/\(.*\)/\1/; q'`
514 echo "-- $pulse_lib_spec -> $pulse_lib"
516 AC_DEFINE(SDL_AUDIO_DRIVER_PULSE)
517 SOURCES="$SOURCES $srcdir/src/audio/pulse/*.c"
518 EXTRA_CFLAGS="$EXTRA_CFLAGS $PULSE_CFLAGS"
519 if test x$have_loadso != xyes && \
520 test x$enable_pulse_shared = xyes; then
521 AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic PulseAudio loading])
523 if test x$have_loadso = xyes && \
524 test x$enable_pulse_shared = xyes && test x$pulse_lib != x; then
525 AC_DEFINE_UNQUOTED(SDL_AUDIO_DRIVER_PULSE_DYNAMIC, "$pulse_lib")
527 EXTRA_LDFLAGS="$EXTRA_LDFLAGS $PULSE_LIBS"
537 AC_HELP_STRING([--enable-arts], [support the Analog Real Time Synthesizer [[default=yes]]]),
539 if test x$enable_audio = xyes -a x$enable_arts = xyes; then
540 AC_PATH_PROG(ARTSCONFIG, artsc-config)
541 if test x$ARTSCONFIG = x -o x$ARTSCONFIG = x'"$ARTSCONFIG"'; then
542 : # arts isn't installed
544 ARTS_CFLAGS=`$ARTSCONFIG --cflags`
545 ARTS_LIBS=`$ARTSCONFIG --libs`
546 ARTS_PREFIX=`$ARTSCONFIG --arts-prefix`
547 AC_MSG_CHECKING(for aRts development environment)
549 save_CFLAGS="$CFLAGS"
550 CFLAGS="$CFLAGS $ARTS_CFLAGS"
554 arts_stream_t stream;
558 CFLAGS="$save_CFLAGS"
559 AC_MSG_RESULT($audio_arts)
560 if test x$audio_arts = xyes; then
561 AC_ARG_ENABLE(arts-shared,
562 AC_HELP_STRING([--enable-arts-shared], [dynamically load aRts audio support [[default=yes]]]),
563 , enable_arts_shared=yes)
564 arts_lib_spec="$ARTS_PREFIX/lib/libartsc.so.*"
565 arts_lib=`ls -- $arts_lib_spec | sed 's/.*\/\(.*\)/\1/; q'`
566 echo "-- $arts_lib_spec -> $arts_lib"
568 AC_DEFINE(SDL_AUDIO_DRIVER_ARTS)
569 SOURCES="$SOURCES $srcdir/src/audio/arts/*.c"
570 EXTRA_CFLAGS="$EXTRA_CFLAGS $ARTS_CFLAGS"
571 if test x$have_loadso != xyes && \
572 test x$enable_arts_shared = xyes; then
573 AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic ARTS loading])
575 if test x$have_loadso = xyes && \
576 test x$enable_arts_shared = xyes && test x$arts_lib != x; then
577 AC_DEFINE_UNQUOTED(SDL_AUDIO_DRIVER_ARTS_DYNAMIC, "$arts_lib")
579 EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ARTS_LIBS"
587 dnl See if the NAS audio interface is supported
591 AC_HELP_STRING([--enable-nas], [support the NAS audio API [[default=yes]]]),
593 if test x$enable_audio = xyes -a x$enable_nas = xyes; then
594 save_LDFLAGS="$LDFLAGS"
595 LDFLAGS="$LDFLAGS -lXt -lm"
596 AC_CHECK_HEADER(audio/audiolib.h, have_audio_hdr=yes)
597 AC_CHECK_LIB(audio, AuOpenServer, have_audio_lib=yes)
598 AC_CHECK_HEADER(nas/audiolib.h, have_nas_hdr=yes)
599 AC_CHECK_LIB(nas, AuOpenServer, have_nas_lib=yes)
600 LDFLAGS="$save_LDFLAGS"
602 AC_MSG_CHECKING(for NAS audio support)
604 if test x$have_audio_hdr = xyes -a x$have_audio_lib = xyes; then
606 NAS_LIBS="-laudio -lXt"
607 elif test x$have_nas_hdr = xyes -a x$have_nas_lib = xyes; then
609 NAS_LIBS="-lnas -lXt"
611 AC_MSG_RESULT($have_nas)
613 if test x$have_nas = xyes; then
614 AC_DEFINE(SDL_AUDIO_DRIVER_NAS)
615 SOURCES="$SOURCES $srcdir/src/audio/nas/*.c"
616 EXTRA_CFLAGS="$EXTRA_CFLAGS $NAS_CFLAGS"
617 EXTRA_LDFLAGS="$EXTRA_LDFLAGS $NAS_LIBS"
623 dnl rcg07142001 See if the user wants the disk writer audio driver...
626 AC_ARG_ENABLE(diskaudio,
627 AC_HELP_STRING([--enable-diskaudio], [support the disk writer audio driver [[default=yes]]]),
628 , enable_diskaudio=yes)
629 if test x$enable_audio = xyes -a x$enable_diskaudio = xyes; then
630 AC_DEFINE(SDL_AUDIO_DRIVER_DISK)
631 SOURCES="$SOURCES $srcdir/src/audio/disk/*.c"
635 dnl rcg03142006 See if the user wants the dummy audio driver...
638 AC_ARG_ENABLE(dummyaudio,
639 AC_HELP_STRING([--enable-dummyaudio], [support the dummy audio driver [[default=yes]]]),
640 , enable_dummyaudio=yes)
641 if test x$enable_audio = xyes -a x$enable_dummyaudio = xyes; then
642 AC_DEFINE(SDL_AUDIO_DRIVER_DUMMY)
643 SOURCES="$SOURCES $srcdir/src/audio/dummy/*.c"
647 dnl Set up the Atari Audio driver
650 AC_ARG_ENABLE(mintaudio,
651 AC_HELP_STRING([--enable-mintaudio], [support Atari audio driver [[default=yes]]]),
652 , enable_mintaudio=yes)
653 if test x$enable_audio = xyes -a x$enable_mintaudio = xyes; then
655 AC_CHECK_HEADER(mint/falcon.h, have_mint_falcon_hdr=yes)
656 if test x$have_mint_falcon_hdr = xyes; then
658 AC_DEFINE(SDL_AUDIO_DRIVER_MINT)
659 SOURCES="$SOURCES $srcdir/src/audio/mint/*.c"
660 SOURCES="$SOURCES $srcdir/src/audio/mint/*.S"
666 dnl See if we can use x86 assembly blitters
667 # NASM is available from: http://nasm.sourceforge.net
670 dnl Make sure we are running on an x86 platform
679 dnl Check for NASM (for assembly blit routines)
681 AC_HELP_STRING([--enable-nasm], [use nasm assembly blitters on x86 [[default=yes]]]),
683 if test x$enable_video = xyes -a x$enable_assembly = xyes -a x$enable_nasm = xyes; then
686 # Usage: CompileNASM <filename>
687 AC_MSG_CHECKING(to see if $NASM supports $1)
688 if $NASM $NASMFLAGS $1 -o $1.o >&AS_MESSAGE_LOG_FD 2>&1; then
689 CompileNASM_ret="yes"
694 AC_MSG_RESULT($CompileNASM_ret)
695 test "$CompileNASM_ret" = "yes"
698 if test x"$NASMFLAGS" = x; then
715 AC_PATH_PROG(NASM, yasm)
716 echo "%ifidn __OUTPUT_FORMAT__,elf" > unquoted-sections
717 echo "section .note.GNU-stack noalloc noexec nowrite progbits" >> unquoted-sections
718 echo "%endif" >> unquoted-sections
719 CompileNASM unquoted-sections || NASM=""
721 if test "x$NASM" = x -o "x$NASM" = x'"$NASM"'; then
722 $as_unset ac_cv_path_NASM
723 AC_PATH_PROG(NASM, nasm)
725 if test "x$NASM" != x -a "x$NASM" != x'"$NASM"'; then
726 AC_DEFINE(SDL_HERMES_BLITTERS)
727 SOURCES="$SOURCES $srcdir/src/hermes/*.asm"
728 NASMFLAGS="$NASMFLAGS -I $srcdir/src/hermes/"
730 dnl See if hidden visibility is supported
731 echo "GLOBAL _bar:function hidden" > symbol-visibility
732 echo "_bar:" >> symbol-visibility
733 CompileNASM symbol-visibility && NASMFLAGS="$NASMFLAGS -DHIDDEN_VISIBILITY"
739 # this line is needed for QNX, because it's not defined the __ELF__
741 EXTRA_CFLAGS="$EXTRA_CFLAGS -D__ELF__";;
743 EXTRA_CFLAGS="$EXTRA_CFLAGS -D__ELF__";;
749 dnl Check for altivec instruction support using gas syntax
752 AC_ARG_ENABLE(altivec,
753 AC_HELP_STRING([--enable-altivec], [use altivec assembly blitters on PPC [[default=yes]]]),
754 , enable_altivec=yes)
755 if test x$enable_video = xyes -a x$enable_assembly = xyes -a x$enable_altivec = xyes; then
756 have_altivec_h_hdr=no
757 AC_CHECK_HEADER(altivec.h, have_altivec_h_hdr=yes)
759 save_CFLAGS="$CFLAGS"
761 AC_MSG_CHECKING(for Altivec with GCC -maltivec option)
762 altivec_CFLAGS="-maltivec"
763 CFLAGS="$save_CFLAGS $altivec_CFLAGS"
765 if test x$have_altivec_h_hdr = xyes; then
768 vector unsigned int vzero() {
769 return vec_splat_u32(0);
775 AC_MSG_RESULT($have_gcc_altivec)
778 vector unsigned int vzero() {
779 return vec_splat_u32(0);
785 AC_MSG_RESULT($have_gcc_altivec)
788 if test x$have_gcc_altivec = xno; then
789 AC_MSG_CHECKING(for Altivec with GCC -faltivec option)
790 altivec_CFLAGS="-faltivec"
791 CFLAGS="$save_CFLAGS $altivec_CFLAGS"
792 if test x$have_altivec_h_hdr = xyes; then
795 vector unsigned int vzero() {
796 return vec_splat_u32(0);
802 AC_MSG_RESULT($have_gcc_altivec)
805 vector unsigned int vzero() {
806 return vec_splat_u32(0);
812 AC_MSG_RESULT($have_gcc_altivec)
815 CFLAGS="$save_CFLAGS"
817 if test x$have_gcc_altivec = xyes; then
818 AC_DEFINE(SDL_ALTIVEC_BLITTERS)
819 if test x$have_altivec_h_hdr = xyes; then
820 AC_DEFINE(HAVE_ALTIVEC_H)
822 EXTRA_CFLAGS="$EXTRA_CFLAGS $altivec_CFLAGS"
827 dnl See if GCC's -fvisibility=hidden is supported (gcc4 and later, usually).
828 dnl Details of this flag are here: http://gcc.gnu.org/wiki/Visibility
829 CheckVisibilityHidden()
831 AC_MSG_CHECKING(for GCC -fvisibility=hidden option)
832 have_gcc_fvisibility=no
834 visibility_CFLAGS="-fvisibility=hidden"
835 save_CFLAGS="$CFLAGS"
836 CFLAGS="$save_CFLAGS $visibility_CFLAGS -Werror"
838 #if !defined(__GNUC__) || __GNUC__ < 4
839 #error SDL only uses visibility attributes in GCC 4 or newer
843 have_gcc_fvisibility=yes
845 AC_MSG_RESULT($have_gcc_fvisibility)
846 CFLAGS="$save_CFLAGS"
848 if test x$have_gcc_fvisibility = xyes; then
849 EXTRA_CFLAGS="$EXTRA_CFLAGS $visibility_CFLAGS"
854 dnl Do the iPod thing
858 AC_HELP_STRING([--enable-ipod], [configure SDL to work with iPodLinux [default=yes on arm-elf]]),
861 if test x$enable_ipod = xyes; then
862 EXTRA_CFLAGS="$EXTRA_CFLAGS -DIPOD"
863 AC_DEFINE(SDL_VIDEO_DRIVER_IPOD)
864 SOURCES="$SOURCES $srcdir/src/video/ipod/*.c"
868 dnl Find the nanox include and library directories
871 AC_ARG_ENABLE(video-nanox,
872 AC_HELP_STRING([--enable-video-nanox], [use nanox video driver [[default=no]]]),
873 , enable_video_nanox=no)
875 if test x$enable_video = xyes -a x$enable_video_nanox = xyes; then
876 AC_ARG_ENABLE(nanox-debug,
877 AC_HELP_STRING([--enable-nanox-debug], [print debug messages [[default=no]]]),
878 , enable_nanox_debug=no)
879 if test x$enable_nanox_debug = xyes; then
880 EXTRA_CFLAGS="$EXTRA_CFLAGS -DENABLE_NANOX_DEBUG"
883 AC_ARG_ENABLE(nanox-share-memory,
884 AC_HELP_STRING([--enable-nanox-share-memory], [use share memory [[default=no]]]),
885 , enable_nanox_share_memory=no)
886 if test x$enable_nanox_share_memory = xyes; then
887 EXTRA_CFLAGS="$EXTRA_CFLAGS -DNANOX_SHARE_MEMORY"
890 AC_ARG_ENABLE(nanox_direct_fb,
891 AC_HELP_STRING([--enable-nanox-direct-fb], [use direct framebuffer access [[default=no]]]),
892 , enable_nanox_direct_fb=no)
893 if test x$enable_nanox_direct_fb = xyes; then
894 EXTRA_CFLAGS="$EXTRA_CFLAGS -DENABLE_NANOX_DIRECT_FB"
897 AC_DEFINE(SDL_VIDEO_DRIVER_NANOX)
898 SOURCES="$SOURCES $srcdir/src/video/nanox/*.c"
899 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lnano-X"
904 dnl Find the X11 include and library directories
907 AC_ARG_ENABLE(video-x11,
908 AC_HELP_STRING([--enable-video-x11], [use X11 video driver [[default=yes]]]),
909 , enable_video_x11=yes)
910 if test x$enable_video = xyes -a x$enable_video_x11 = xyes; then
913 # This isn't necessary for X11, but fixes GLX detection
914 if test "x$x_includes" = xNONE && test "x$x_libraries" = xNONE; then
915 x_includes="/usr/X11R6/include"
916 x_libraries="/usr/X11R6/lib"
922 if test x$have_x = xyes; then
923 # Only allow dynamically loaded X11 if the X11 function pointers
924 # will not end up in the global namespace, which causes problems
925 # with other libraries calling X11 functions.
926 x11_symbols_private=$have_gcc_fvisibility
928 AC_ARG_ENABLE(x11-shared,
929 AC_HELP_STRING([--enable-x11-shared], [dynamically load X11 support [[default=maybe]]]),
930 , enable_x11_shared=maybe)
933 *-*-darwin*) # Latest Mac OS X actually ships with Xrandr/Xrender libs...
934 x11_symbols_private=yes
935 x11_lib='/usr/X11R6/lib/libX11.6.dylib'
936 x11ext_lib='/usr/X11R6/lib/libXext.6.dylib'
937 xrender_lib='/usr/X11R6/lib/libXrender.1.dylib'
938 xrandr_lib='/usr/X11R6/lib/libXrandr.2.dylib'
942 x11ext_lib='libXext.so'
944 *-*-irix*) # IRIX 6.5 requires that we use /usr/lib32
946 x11ext_lib='libXext.so'
949 x11_lib_path=[`echo $X_LIBS | sed 's/.*-L\([^ ]*\).*/\1/'`]
950 for path in $x11_lib_path /usr/lib /usr/X11/lib /usr/X11R6/lib; do
951 if test "x$x11_lib" = "x"; then
952 x11_lib=[`ls -- $path/libX11.so.[0-9] 2>/dev/null | sort -r | sed 's/.*\/\(.*\)/\1/; q'`]
953 if test "x$x11_lib" = "x"; then
954 x11_lib=[`ls -- $path/libX11.so.[0-9]* 2>/dev/null | sort -r | sed 's/.*\/\(.*\)/\1/; q'`]
957 if test "x$x11ext_lib" = "x"; then
958 x11ext_lib=[`ls -- $path/libXext.so.[0-9] 2>/dev/null | sort -r | sed 's/.*\/\(.*\)/\1/; q'`]
959 if test "x$x11ext_lib" = "x"; then
960 x11ext_lib=[`ls -- $path/libXext.so.[0-9]* 2>/dev/null | sort -r | sed 's/.*\/\(.*\)/\1/; q'`]
963 if test "x$xrender_lib" = "x"; then
964 xrender_lib=[`ls -- $path/libXrender.so.[0-9] 2>/dev/null | sort -r | sed 's/.*\/\(.*\)/\1/; q'`]
965 if test "x$xrender_lib" = "x"; then
966 xrender_lib=[`ls -- $path/libXrender.so.[0-9]* 2>/dev/null | sort -r | sed 's/.*\/\(.*\)/\1/; q'`]
969 if test "x$xrandr_lib" = "x"; then
970 xrandr_lib=[`ls -- $path/libXrandr.so.[0-9] 2>/dev/null | sort -r | sed 's/.*\/\(.*\)/\1/; q'`]
971 if test "x$xrandr_lib" = "x"; then
972 xrandr_lib=[`ls -- $path/libXrandr.so.[0-9]* 2>/dev/null | sort -r | sed 's/.*\/\(.*\)/\1/; q'`]
979 X_CFLAGS="$X_CFLAGS -DXTHREADS"
980 if test x$ac_cv_func_shmat != xyes; then
981 X_CFLAGS="$X_CFLAGS -DNO_SHARED_MEMORY"
983 CFLAGS="$CFLAGS $X_CFLAGS"
984 LDFLAGS="$LDFLAGS $X_LIBS"
986 AC_DEFINE(SDL_VIDEO_DRIVER_X11)
987 SOURCES="$SOURCES $srcdir/src/video/x11/*.c"
988 EXTRA_CFLAGS="$EXTRA_CFLAGS $X_CFLAGS"
990 if test x$enable_x11_shared = xmaybe; then
991 enable_x11_shared=$x11_symbols_private
993 if test x$have_loadso != xyes && \
994 test x$enable_x11_shared = xyes; then
995 AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic X11 loading])
998 if test x$x11_symbols_private != xyes && \
999 test x$enable_x11_shared = xyes; then
1000 AC_MSG_WARN([You must have gcc4 (-fvisibility=hidden) for dynamic X11 loading])
1001 enable_x11_shared=no
1004 if test x$have_loadso = xyes && \
1005 test x$enable_x11_shared = xyes && test x$x11_lib != x && test x$x11ext_lib != x; then
1006 echo "-- dynamic libX11 -> $x11_lib"
1007 echo "-- dynamic libX11ext -> $x11ext_lib"
1008 AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_X11_DYNAMIC, "$x11_lib")
1009 AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_X11_DYNAMIC_XEXT, "$x11ext_lib")
1011 enable_x11_shared=no
1012 EXTRA_LDFLAGS="$EXTRA_LDFLAGS $X_LIBS -lX11 -lXext"
1017 AC_HELP_STRING([--enable-dga], [allow use of X11 DGA code [[default=yes]]]),
1019 if test x$enable_dga = xyes; then
1020 SOURCES="$SOURCES $srcdir/src/video/Xext/Xxf86dga/*.c"
1022 AC_ARG_ENABLE(video-dga,
1023 AC_HELP_STRING([--enable-video-dga], [use DGA 2.0 video driver [[default=yes]]]),
1024 , enable_video_dga=yes)
1025 if test x$enable_dga = xyes -a x$enable_video_dga = xyes; then
1026 AC_DEFINE(SDL_VIDEO_DRIVER_DGA)
1027 SOURCES="$SOURCES $srcdir/src/video/dga/*.c"
1029 AC_ARG_ENABLE(video-x11-dgamouse,
1030 AC_HELP_STRING([--enable-video-x11-dgamouse], [use X11 DGA for mouse events [[default=yes]]]),
1031 , enable_video_x11_dgamouse=yes)
1032 if test x$enable_dga = xyes -a x$enable_video_x11_dgamouse = xyes; then
1033 AC_DEFINE(SDL_VIDEO_DRIVER_X11_DGAMOUSE)
1035 AC_ARG_ENABLE(video-x11-vm,
1036 AC_HELP_STRING([--enable-video-x11-vm], [use X11 VM extension for fullscreen [[default=yes]]]),
1037 , enable_video_x11_vm=yes)
1038 if test x$enable_video_x11_vm = xyes; then
1039 AC_DEFINE(SDL_VIDEO_DRIVER_X11_VIDMODE)
1040 SOURCES="$SOURCES $srcdir/src/video/Xext/Xxf86vm/*.c"
1042 AC_ARG_ENABLE(video-x11-xv,
1043 AC_HELP_STRING([--enable-video-x11-xv], [use X11 XvImage extension for video [[default=yes]]]),
1044 , enable_video_x11_xv=yes)
1045 if test x$enable_video_x11_xv = xyes; then
1046 AC_DEFINE(SDL_VIDEO_DRIVER_X11_XV)
1047 SOURCES="$SOURCES $srcdir/src/video/Xext/Xv/*.c"
1049 AC_ARG_ENABLE(video-x11-xinerama,
1050 AC_HELP_STRING([--enable-video-x11-xinerama], [enable X11 Xinerama support [[default=yes]]]),
1051 , enable_video_x11_xinerama=yes)
1052 if test x$enable_video_x11_xinerama = xyes; then
1053 AC_DEFINE(SDL_VIDEO_DRIVER_X11_XINERAMA)
1054 SOURCES="$SOURCES $srcdir/src/video/Xext/Xinerama/*.c"
1056 AC_ARG_ENABLE(video-x11-xme,
1057 AC_HELP_STRING([--enable-video-x11-xme], [enable Xi Graphics XME for fullscreen [[default=yes]]]),
1058 , enable_video_x11_xme=yes)
1059 if test x$enable_video_x11_xme = xyes; then
1060 AC_DEFINE(SDL_VIDEO_DRIVER_X11_XME)
1061 SOURCES="$SOURCES $srcdir/src/video/Xext/XME/*.c"
1063 AC_ARG_ENABLE(video-x11-xrandr,
1064 AC_HELP_STRING([--enable-video-x11-xrandr], [enable X11 Xrandr extension for fullscreen [[default=yes]]]),
1065 , enable_video_x11_xrandr=yes)
1066 if test x$enable_video_x11_xrandr = xyes; then
1067 definitely_enable_video_x11_xrandr=no
1068 AC_CHECK_HEADER(X11/extensions/Xrandr.h,
1069 have_xrandr_h_hdr=yes,
1070 have_xrandr_h_hdr=no,
1071 [#include <X11/Xlib.h>
1073 if test x$have_xrandr_h_hdr = xyes; then
1074 if test x$enable_x11_shared = xyes && test x$xrandr_lib != x ; then
1075 echo "-- dynamic libXrender -> $xrender_lib"
1076 echo "-- dynamic libXrandr -> $xrandr_lib"
1077 AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_X11_DYNAMIC_XRENDER, "$xrender_lib")
1078 AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_X11_DYNAMIC_XRANDR, "$xrandr_lib")
1079 definitely_enable_video_x11_xrandr=yes
1081 AC_CHECK_LIB(Xrender, XRenderQueryExtension, have_xrender_lib=yes)
1082 AC_CHECK_LIB(Xrandr, XRRQueryExtension, have_xrandr_lib=yes)
1083 if test x$have_xrender_lib = xyes && test x$have_xrandr_lib = xyes ; then
1084 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lXrandr -lXrender"
1085 definitely_enable_video_x11_xrandr=yes
1090 if test x$definitely_enable_video_x11_xrandr = xyes; then
1091 AC_DEFINE(SDL_VIDEO_DRIVER_X11_XRANDR)
1097 dnl Check for QNX photon video driver
1100 AC_ARG_ENABLE(video-photon,
1101 AC_HELP_STRING([--enable-video-photon], [use QNX Photon video driver [[default=yes]]]),
1102 , enable_video_photon=yes)
1103 if test x$enable_video = xyes -a x$enable_video_photon = xyes; then
1104 AC_MSG_CHECKING(for QNX Photon support)
1109 #include <photon/Pg.h>
1110 #include <photon/PdDirect.h>
1112 PgDisplaySettings_t *visual;
1116 AC_MSG_RESULT($video_photon)
1117 if test x$video_photon = xyes; then
1118 AC_DEFINE(SDL_VIDEO_DRIVER_PHOTON)
1119 SOURCES="$SOURCES $srcdir/src/video/photon/*.c"
1120 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lph"
1128 dnl Set up the BWindow video driver if enabled
1131 if test x$enable_video = xyes; then
1132 AC_DEFINE(SDL_VIDEO_DRIVER_BWINDOW)
1133 SOURCES="$SOURCES $srcdir/src/video/bwindow/*.cc"
1138 dnl Set up the Carbon/QuickDraw video driver for Mac OS X (but not Darwin)
1141 AC_ARG_ENABLE(video-carbon,
1142 AC_HELP_STRING([--enable-video-carbon], [use Carbon/QuickDraw video driver [[default=no]]]),
1143 , enable_video_carbon=no)
1144 if test x$enable_video = xyes -a x$enable_video_carbon = xyes; then
1145 AC_MSG_CHECKING(for Carbon framework)
1148 #include <Carbon/Carbon.h>
1153 AC_MSG_RESULT($have_carbon)
1154 if test x$have_carbon = xyes; then
1155 AC_DEFINE(SDL_VIDEO_DRIVER_TOOLBOX)
1156 SOURCES="$SOURCES $srcdir/src/video/maccommon/*.c"
1157 SOURCES="$SOURCES $srcdir/src/video/macrom/*.c"
1163 dnl Set up the Cocoa/Quartz video driver for Mac OS X (but not Darwin)
1166 AC_ARG_ENABLE(video-cocoa,
1167 AC_HELP_STRING([--enable-video-cocoa], [use Cocoa/Quartz video driver [[default=yes]]]),
1168 , enable_video_cocoa=yes)
1169 if test x$enable_video = xyes -a x$enable_video_cocoa = xyes; then
1170 save_CFLAGS="$CFLAGS"
1171 dnl work around that we don't have Objective-C support in autoconf
1172 CFLAGS="$CFLAGS -x objective-c"
1173 AC_MSG_CHECKING(for Cocoa framework)
1176 #import <Cocoa/Cocoa.h>
1181 AC_MSG_RESULT($have_cocoa)
1182 CFLAGS="$save_CFLAGS"
1183 if test x$have_cocoa = xyes; then
1184 AC_DEFINE(SDL_VIDEO_DRIVER_QUARTZ)
1185 SOURCES="$SOURCES $srcdir/src/video/quartz/*.m"
1191 dnl Find the framebuffer console includes
1194 AC_ARG_ENABLE(video-fbcon,
1195 AC_HELP_STRING([--enable-video-fbcon], [use framebuffer console video driver [[default=yes]]]),
1196 , enable_video_fbcon=yes)
1197 if test x$enable_video = xyes -a x$enable_video_fbcon = xyes; then
1198 AC_MSG_CHECKING(for framebuffer console support)
1201 #include <linux/fb.h>
1202 #include <linux/kd.h>
1203 #include <linux/keyboard.h>
1208 AC_MSG_RESULT($video_fbcon)
1209 if test x$video_fbcon = xyes; then
1210 AC_CHECK_FUNCS(getpagesize)
1211 AC_DEFINE(SDL_VIDEO_DRIVER_FBCON)
1212 SOURCES="$SOURCES $srcdir/src/video/fbcon/*.c"
1221 AC_ARG_ENABLE(video-directfb,
1222 AC_HELP_STRING([--enable-video-directfb], [use DirectFB video driver [[default=yes]]]),
1223 , enable_video_directfb=yes)
1224 if test x$enable_video = xyes -a x$enable_video_directfb = xyes; then
1227 DIRECTFB_REQUIRED_VERSION=0.9.15
1229 AC_PATH_PROG(DIRECTFBCONFIG, directfb-config, no)
1230 if test x$DIRECTFBCONFIG = xno; then
1231 AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
1232 AC_MSG_CHECKING(for DirectFB $DIRECTFB_REQUIRED_VERSION support)
1233 if test x$PKG_CONFIG != xno; then
1234 if $PKG_CONFIG --atleast-pkgconfig-version 0.7 && $PKG_CONFIG --atleast-version $DIRECTFB_REQUIRED_VERSION directfb; then
1235 DIRECTFB_CFLAGS=`$PKG_CONFIG --cflags directfb`
1236 DIRECTFB_LIBS=`$PKG_CONFIG --libs directfb`
1240 AC_MSG_RESULT($video_directfb)
1242 AC_MSG_CHECKING(for DirectFB $DIRECTFB_REQUIRED_VERSION support)
1243 set -- `echo $DIRECTFB_REQUIRED_VERSION | sed 's/\./ /g'`
1244 NEED_VERSION=`expr $1 \* 10000 + $2 \* 100 + $3`
1245 set -- `directfb-config --version | sed 's/\./ /g'`
1246 HAVE_VERSION=`expr $1 \* 10000 + $2 \* 100 + $3`
1247 if test $HAVE_VERSION -ge $NEED_VERSION; then
1248 DIRECTFB_CFLAGS=`$DIRECTFBCONFIG --cflags`
1249 DIRECTFB_LIBS=`$DIRECTFBCONFIG --libs`
1252 AC_MSG_RESULT($video_directfb)
1255 if test x$video_directfb = xyes; then
1256 AC_DEFINE(SDL_VIDEO_DRIVER_DIRECTFB)
1257 SOURCES="$SOURCES $srcdir/src/video/directfb/*.c"
1258 EXTRA_CFLAGS="$EXTRA_CFLAGS $DIRECTFB_CFLAGS"
1259 EXTRA_LDFLAGS="$EXTRA_LDFLAGS $DIRECTFB_LIBS"
1265 dnl See if we're running on PlayStation 2 hardware
1268 AC_ARG_ENABLE(video-ps2gs,
1269 AC_HELP_STRING([--enable-video-ps2gs], [use PlayStation 2 GS video driver [[default=yes]]]),
1270 , enable_video_ps2gs=yes)
1271 if test x$enable_video = xyes -a x$enable_video_ps2gs = xyes; then
1272 AC_MSG_CHECKING(for PlayStation 2 GS support)
1275 #include <linux/ps2/dev.h>
1276 #include <linux/ps2/gs.h>
1281 AC_MSG_RESULT($video_ps2gs)
1282 if test x$video_ps2gs = xyes; then
1283 AC_DEFINE(SDL_VIDEO_DRIVER_PS2GS)
1284 SOURCES="$SOURCES $srcdir/src/video/ps2gs/*.c"
1290 dnl Find the GGI includes
1293 AC_ARG_ENABLE(video-ggi,
1294 AC_HELP_STRING([--enable-video-ggi], [use GGI video driver [[default=no]]]),
1295 , enable_video_ggi=no)
1296 if test x$enable_video = xyes -a x$enable_video_ggi = xyes; then
1297 AC_MSG_CHECKING(for GGI support)
1300 #include <ggi/ggi.h>
1301 #include <ggi/gii.h>
1306 AC_MSG_RESULT($video_ggi)
1307 if test x$video_ggi = xyes; then
1308 AC_DEFINE(SDL_VIDEO_DRIVER_GGI)
1309 SOURCES="$SOURCES $srcdir/src/video/ggi/*.c"
1310 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lggi -lgii -lgg"
1316 dnl Find the SVGAlib includes and libraries
1319 AC_ARG_ENABLE(video-svga,
1320 AC_HELP_STRING([--enable-video-svga], [use SVGAlib video driver [[default=yes]]]),
1321 , enable_video_svga=yes)
1322 if test x$enable_video = xyes -a x$enable_video_svga = xyes; then
1323 AC_MSG_CHECKING(for SVGAlib (1.4.0+) support)
1327 #include <vgamouse.h>
1328 #include <vgakeyboard.h>
1330 if ( SCANCODE_RIGHTWIN && SCANCODE_LEFTWIN ) {
1336 AC_MSG_RESULT($video_svga)
1337 if test x$video_svga = xyes; then
1338 AC_DEFINE(SDL_VIDEO_DRIVER_SVGALIB)
1339 SOURCES="$SOURCES $srcdir/src/video/svga/*.c"
1340 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lvga"
1346 dnl Find the VGL includes and libraries
1349 AC_ARG_ENABLE(video-vgl,
1350 AC_HELP_STRING([--enable-video-vgl], [use VGL video driver [[default=yes]]]),
1351 , enable_video_vgl=yes)
1352 if test x$enable_video = xyes -a x$enable_video_vgl = xyes; then
1353 AC_MSG_CHECKING(for libVGL support)
1356 #include <sys/fbio.h>
1357 #include <sys/consio.h>
1358 #include <sys/kbio.h>
1362 bitmap.Type = VIDBUF32;
1363 bitmap.PixelBytes = 4;
1364 exit(bitmap.Bitmap);
1368 AC_MSG_RESULT($video_vgl)
1369 if test x$video_vgl = xyes; then
1370 AC_DEFINE(SDL_VIDEO_DRIVER_VGL)
1371 SOURCES="$SOURCES $srcdir/src/video/vgl/*.c"
1372 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lvgl"
1378 dnl Set up the wscons video driver if enabled
1381 AC_ARG_ENABLE(video-wscons,
1382 AC_HELP_STRING([--enable-video-wscons], [use wscons video driver [[default=yes]]]),
1383 , enable_video_wscons=yes)
1384 if test x$enable_video = xyes -a x$enable_video_wscons = xyes; then
1385 AC_MSG_CHECKING(for wscons support)
1388 #include <sys/time.h>
1389 #include <dev/wscons/wsconsio.h>
1390 #include <dev/wscons/wsdisplay_usl_io.h>
1392 int wsmode = WSDISPLAYIO_MODE_DUMBFB;
1396 AC_MSG_RESULT($video_wscons)
1397 if test x$video_wscons = xyes; then
1398 AC_DEFINE(SDL_VIDEO_DRIVER_WSCONS)
1399 SOURCES="$SOURCES $srcdir/src/video/wscons/*.c"
1406 dnl Find the AAlib includes
1409 AC_ARG_ENABLE(video-aalib,
1410 AC_HELP_STRING([--enable-video-aalib], [use AAlib video driver [[default=no]]]),
1411 , enable_video_aalib=no)
1412 if test x$enable_video = xyes -a x$enable_video_aalib = xyes; then
1413 AC_MSG_CHECKING(for AAlib support)
1421 AC_MSG_RESULT($video_aalib)
1422 if test x$video_aalib = xyes; then
1423 AC_DEFINE(SDL_VIDEO_DRIVER_AALIB)
1424 SOURCES="$SOURCES $srcdir/src/video/aalib/*.c"
1425 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -laa"
1431 dnl Set up the QTopia video driver if enabled
1434 AC_ARG_ENABLE(video-qtopia,
1435 AC_HELP_STRING([--enable-video-qtopia], [use Qtopia video driver [[default=no]]]),
1436 , enable_video_qtopia=no)
1437 if test x$enable_video = xyes -a x$enable_video_qtopia = xyes; then
1438 AC_MSG_CHECKING(for Qtopia support)
1440 QTOPIA_FLAGS="-DQT_QWS_EBX -DQT_QWS_CUSTOM -DQWS -I${QPEDIR}/include -I${QTDIR}/include/ -DNO_DEBUG -fno-rtti -fno-exceptions"
1443 CXXFLAGS="$QTOPIA_FLAGS"
1445 #include <qpe/qpeapplication.h>
1451 AC_MSG_RESULT($video_qtopia)
1452 if test x$video_qtopia = xyes; then
1453 AC_DEFINE(SDL_VIDEO_DRIVER_QTOPIA)
1454 SOURCES="$SOURCES $srcdir/src/video/qtopia/*.cc"
1455 SDLMAIN_SOURCES="$srcdir/src/main/qtopia/*.cc"
1456 EXTRA_CFLAGS="$EXTRA_CFLAGS $QTOPIA_FLAGS"
1457 SDL_CFLAGS="$SDL_CFLAGS -DQWS -Dmain=SDL_main"
1458 SDL_LIBS="-lSDLmain $SDL_LIBS -L${QPEDIR}/lib -L${QTDIR}/lib/ -lqpe -lqte"
1465 dnl Set up the PicoGUI video driver if enabled
1468 AC_ARG_ENABLE(video-picogui,
1469 AC_HELP_STRING([--enable-video-picogui], [use PicoGUI video driver [[default=no]]]),
1470 , enable_video_picogui=no)
1471 if test x$enable_video = xyes -a x$enable_video_picogui = xyes; then
1472 AC_MSG_CHECKING(for PicoGUI support)
1475 #include <picogui.h>
1480 AC_MSG_RESULT($video_picogui)
1481 if test x$video_picogui = xyes; then
1482 AC_DEFINE(SDL_VIDEO_DRIVER_PICOGUI)
1483 SOURCES="$SOURCES $srcdir/src/video/picogui/*.c"
1484 SDL_LIBS="$SDL_LIBS -lpgui"
1490 dnl Set up the Atari Bios keyboard driver
1491 CheckAtariBiosEvent()
1493 SOURCES="$SOURCES $srcdir/src/video/ataricommon/*.c"
1494 SOURCES="$SOURCES $srcdir/src/video/ataricommon/*.S"
1497 dnl Set up the Atari Xbios driver
1498 CheckAtariXbiosVideo()
1500 AC_ARG_ENABLE(xbios,
1501 AC_HELP_STRING([--enable-video-xbios], [use Atari Xbios video driver [[default=yes]]]),
1502 , enable_video_xbios=yes)
1504 if test x$enable_video = xyes -a x$enable_video_xbios = xyes; then
1506 AC_DEFINE(SDL_VIDEO_DRIVER_XBIOS)
1507 SOURCES="$SOURCES $srcdir/src/video/xbios/*.c"
1512 dnl Set up the Atari Gem driver
1513 CheckAtariGemVideo()
1516 AC_HELP_STRING([--enable-video-gem], [use Atari Gem video driver [[default=yes]]]),
1517 , enable_video_gem=yes)
1518 if test x$enable_video = xyes -a x$enable_video_gem = xyes; then
1520 AC_CHECK_HEADER(gem.h, have_gem_hdr=yes)
1521 AC_CHECK_LIB(gem, appl_init, have_gem_lib=yes)
1522 if test x$have_gem_hdr = xyes -a x$have_gem_lib = xyes; then
1524 AC_DEFINE(SDL_VIDEO_DRIVER_GEM)
1525 SOURCES="$SOURCES $srcdir/src/video/gem/*.c"
1526 SDL_LIBS="$SDL_LIBS -lgem"
1532 dnl rcg04172001 Set up the Null video driver.
1535 AC_ARG_ENABLE(video-dummy,
1536 AC_HELP_STRING([--enable-video-dummy], [use dummy video driver [[default=yes]]]),
1537 , enable_video_dummy=yes)
1538 if test x$enable_video_dummy = xyes; then
1539 AC_DEFINE(SDL_VIDEO_DRIVER_DUMMY)
1540 SOURCES="$SOURCES $srcdir/src/video/dummy/*.c"
1545 dnl Check to see if OpenGL support is desired
1546 AC_ARG_ENABLE(video-opengl,
1547 AC_HELP_STRING([--enable-video-opengl], [include OpenGL context creation [[default=yes]]]),
1548 , enable_video_opengl=yes)
1553 if test x$enable_video = xyes -a x$enable_video_opengl = xyes; then
1554 AC_MSG_CHECKING(for OpenGL (GLX) support)
1564 AC_MSG_RESULT($video_opengl)
1565 if test x$video_opengl = xyes; then
1566 AC_DEFINE(SDL_VIDEO_OPENGL)
1567 AC_DEFINE(SDL_VIDEO_OPENGL_GLX)
1572 dnl Find QNX RtP OpenGL
1575 if test x$enable_video = xyes -a x$enable_video_opengl = xyes; then
1576 AC_MSG_CHECKING(for OpenGL (Photon) support)
1584 AC_MSG_RESULT($video_opengl)
1585 if test x$video_opengl = xyes; then
1586 AC_DEFINE(SDL_VIDEO_OPENGL)
1587 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lGL"
1592 dnl Check for Win32 OpenGL
1595 if test x$enable_video = xyes -a x$enable_video_opengl = xyes; then
1596 AC_DEFINE(SDL_VIDEO_OPENGL)
1597 AC_DEFINE(SDL_VIDEO_OPENGL_WGL)
1601 dnl Check for BeOS OpenGL
1604 if test x$enable_video = xyes -a x$enable_video_opengl = xyes; then
1605 AC_DEFINE(SDL_VIDEO_OPENGL)
1606 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lGL"
1610 dnl Check for MacOS OpenGL
1613 if test x$enable_video = xyes -a x$enable_video_opengl = xyes; then
1614 AC_DEFINE(SDL_VIDEO_OPENGL)
1617 if test x$enable_video_cocoa = xyes; then
1618 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,OpenGL"
1620 if test x$enable_video_carbon = xyes; then
1621 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,AGL"
1627 dnl Check for Mesa offscreen rendering
1630 if test "x$enable_video" = "xyes" -a "x$enable_video_opengl" = "xyes"; then
1631 AC_CHECK_HEADER(GL/osmesa.h, have_osmesa_hdr=yes)
1632 AC_CHECK_LIB(OSMesa, OSMesaCreateContext, have_osmesa_lib=yes, have_osmesa_lib=no, -lm)
1634 # Static linking to -lOSMesa
1635 AC_PATH_PROG(OSMESA_CONFIG, osmesa-config, no)
1636 if test "x$OSMESA_CONFIG" = "xno" -o "x$enable_atari_ldg" = "xno"; then
1637 # -lOSMesa is really the static library
1638 if test "x$have_osmesa_hdr" = "xyes" -a "x$have_osmesa_lib" = "xyes"; then
1639 OSMESA_LIBS="-lOSMesa"
1642 # -lOSMesa is a loader for OSMesa.ldg
1643 OSMESA_CFLAGS=`$OSMESA_CONFIG --cflags`
1644 OSMESA_LIBS=`$OSMESA_CONFIG --libs`
1646 AC_DEFINE(SDL_VIDEO_OPENGL)
1647 AC_DEFINE(SDL_VIDEO_OPENGL_OSMESA)
1648 SDL_CFLAGS="$SDL_CFLAGS $OSMESA_CFLAGS"
1649 SDL_LIBS="$SDL_LIBS $OSMESA_LIBS"
1651 AC_ARG_ENABLE(osmesa-shared,
1652 AC_HELP_STRING([--enable-osmesa-shared], [dynamically load OSMesa OpenGL support [[default=yes]]]),
1653 , enable_osmesa_shared=yes)
1654 if test "x$enable_osmesa_shared" = "xyes" -a "x$enable_atari_ldg" = "xyes"; then
1656 if test "x$have_osmesa_hdr" = "xyes"; then
1657 AC_DEFINE(SDL_VIDEO_OPENGL_OSMESA_DYNAMIC)
1663 AC_ARG_ENABLE(screensaver,
1664 AC_HELP_STRING([--enable-screensaver], [enable screensaver by default while any SDL application is running [[default=no]]]),
1665 , enable_screensaver=no)
1666 if test x$enable_screensaver = xno; then
1667 AC_DEFINE(SDL_VIDEO_DISABLE_SCREENSAVER)
1670 dnl See if we can use the new unified event interface in Linux 2.4
1673 dnl Check for Linux 2.4 unified input event interface support
1674 AC_ARG_ENABLE(input-events,
1675 AC_HELP_STRING([--enable-input-events], [use Linux 2.4 unified input interface [[default=yes]]]),
1676 , enable_input_events=yes)
1677 if test x$enable_input_events = xyes; then
1678 AC_MSG_CHECKING(for Linux 2.4 unified input interface)
1681 #include <linux/input.h>
1684 #error EVIOCGNAME() ioctl not available
1687 use_input_events=yes
1689 AC_MSG_RESULT($use_input_events)
1690 if test x$use_input_events = xyes; then
1691 AC_DEFINE(SDL_INPUT_LINUXEV)
1696 dnl See if we can use the Touchscreen input library
1699 AC_ARG_ENABLE(input-tslib,
1700 AC_HELP_STRING([--enable-input-tslib], [use the Touchscreen library for input [[default=yes]]]),
1701 , enable_input_tslib=yes)
1702 if test x$enable_input_tslib = xyes; then
1703 AC_MSG_CHECKING(for Touchscreen library support)
1704 enable_input_tslib=no
1709 enable_input_tslib=yes
1711 AC_MSG_RESULT($enable_input_tslib)
1712 if test x$enable_input_tslib = xyes; then
1713 AC_DEFINE(SDL_INPUT_TSLIB)
1714 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lts"
1719 dnl See if we can use GNU pth library for threads
1722 dnl Check for pth support
1724 AC_HELP_STRING([--enable-pth], [use GNU pth library for multi-threading [[default=yes]]]),
1726 if test x$enable_threads = xyes -a x$enable_pth = xyes; then
1727 AC_PATH_PROG(PTH_CONFIG, pth-config, no)
1728 if test "$PTH_CONFIG" = "no"; then
1733 AC_MSG_CHECKING(pth)
1734 AC_MSG_RESULT($use_pth)
1735 if test "x$use_pth" = xyes; then
1736 AC_DEFINE(SDL_THREAD_PTH)
1737 SOURCES="$SOURCES $srcdir/src/thread/pth/*.c"
1738 SOURCES="$SOURCES $srcdir/src/thread/generic/SDL_syssem.c"
1739 SDL_CFLAGS="$SDL_CFLAGS `$PTH_CONFIG --cflags`"
1740 SDL_LIBS="$SDL_LIBS `$PTH_CONFIG --libs --all`"
1746 dnl See what type of thread model to use on Linux and Solaris
1749 dnl Check for pthread support
1750 AC_ARG_ENABLE(pthreads,
1751 AC_HELP_STRING([--enable-pthreads], [use POSIX threads for multi-threading [[default=yes]]]),
1752 , enable_pthreads=yes)
1753 dnl This is used on Linux for glibc binary compatibility (Doh!)
1754 AC_ARG_ENABLE(pthread-sem,
1755 AC_HELP_STRING([--enable-pthread-sem], [use pthread semaphores [[default=yes]]]),
1756 , enable_pthread_sem=yes)
1758 *-*-linux*|*-*-uclinux*)
1759 pthread_cflags="-D_REENTRANT"
1760 pthread_lib="-lpthread"
1763 pthread_cflags="-D_REENTRANT -D_THREAD_SAFE"
1767 pthread_cflags="-D_THREAD_SAFE"
1768 # causes Carbon.p complaints?
1769 # pthread_cflags="-D_REENTRANT -D_THREAD_SAFE"
1771 *-*-freebsd*|*-*-dragonfly*)
1772 pthread_cflags="-D_REENTRANT -D_THREAD_SAFE"
1773 pthread_lib="-pthread"
1776 pthread_cflags="-D_REENTRANT -D_THREAD_SAFE"
1777 pthread_lib="-lpthread"
1780 pthread_cflags="-D_REENTRANT"
1781 pthread_lib="-pthread"
1784 pthread_cflags="-D_REENTRANT"
1785 pthread_lib="-lpthread -lposix4"
1788 pthread_cflags="-D_REENTRANT -Kthread"
1792 pthread_cflags="-D_SGI_MP_SOURCE"
1793 pthread_lib="-lpthread"
1796 pthread_cflags="-D_REENTRANT -mthreads"
1797 pthread_lib="-lpthread"
1800 pthread_cflags="-D_REENTRANT"
1801 pthread_lib="-L/usr/lib -lpthread"
1808 pthread_cflags="-D_REENTRANT"
1809 if test x$ac_cv_prog_gcc = xyes; then
1810 pthread_lib="-lpthread -lrt"
1812 pthread_lib="-lpthread -lexc -lrt"
1816 pthread_cflags="-D_REENTRANT"
1817 pthread_lib="-lpthread"
1820 if test x$enable_threads = xyes -a x$enable_pthreads = xyes -a x$enable_ipod != xyes; then
1821 # Save the original compiler flags and libraries
1822 ac_save_cflags="$CFLAGS"; ac_save_libs="$LIBS"
1823 # Add the pthread compiler flags and libraries
1824 CFLAGS="$CFLAGS $pthread_cflags"; LIBS="$LIBS $pthread_lib"
1825 # Check to see if we have pthread support on this system
1826 AC_MSG_CHECKING(for pthreads)
1829 #include <pthread.h>
1831 pthread_attr_t type;
1832 pthread_attr_init(&type);
1836 AC_MSG_RESULT($use_pthreads)
1837 # Restore the compiler flags and libraries
1838 CFLAGS="$ac_save_cflags"; LIBS="$ac_save_libs"
1840 # Do futher testing if we have pthread support...
1841 if test x$use_pthreads = xyes; then
1842 AC_DEFINE(SDL_THREAD_PTHREAD)
1843 EXTRA_CFLAGS="$EXTRA_CFLAGS $pthread_cflags"
1844 EXTRA_LDFLAGS="$EXTRA_LDFLAGS $pthread_lib"
1845 SDL_CFLAGS="$SDL_CFLAGS $pthread_cflags"
1846 SDL_LIBS="$SDL_LIBS $pthread_lib"
1848 # Save the original compiler flags and libraries
1849 ac_save_cflags="$CFLAGS"; ac_save_libs="$LIBS"
1850 # Add the pthread compiler flags and libraries
1851 CFLAGS="$CFLAGS $pthread_cflags"; LIBS="$LIBS $pthread_lib"
1853 # Check to see if recursive mutexes are available
1854 AC_MSG_CHECKING(for recursive mutexes)
1855 has_recursive_mutexes=no
1856 if test x$has_recursive_mutexes = xno; then
1858 #include <pthread.h>
1860 pthread_mutexattr_t attr;
1861 pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
1863 has_recursive_mutexes=yes
1864 AC_DEFINE(SDL_THREAD_PTHREAD_RECURSIVE_MUTEX)
1867 if test x$has_recursive_mutexes = xno; then
1869 #include <pthread.h>
1871 pthread_mutexattr_t attr;
1872 pthread_mutexattr_setkind_np(&attr, PTHREAD_MUTEX_RECURSIVE_NP);
1874 has_recursive_mutexes=yes
1875 AC_DEFINE(SDL_THREAD_PTHREAD_RECURSIVE_MUTEX_NP)
1878 AC_MSG_RESULT($has_recursive_mutexes)
1880 # Check to see if pthread semaphore support is missing
1881 if test x$enable_pthread_sem = xyes; then
1882 AC_MSG_CHECKING(for pthread semaphores)
1885 #include <pthread.h>
1886 #include <semaphore.h>
1889 have_pthread_sem=yes
1891 AC_MSG_RESULT($have_pthread_sem)
1894 # Restore the compiler flags and libraries
1895 CFLAGS="$ac_save_cflags"; LIBS="$ac_save_libs"
1897 # Basic thread creation functions
1898 SOURCES="$SOURCES $srcdir/src/thread/pthread/SDL_systhread.c"
1901 # We can fake these with mutexes and condition variables if necessary
1902 if test x$have_pthread_sem = xyes; then
1903 SOURCES="$SOURCES $srcdir/src/thread/pthread/SDL_syssem.c"
1905 SOURCES="$SOURCES $srcdir/src/thread/generic/SDL_syssem.c"
1909 # We can fake these with semaphores if necessary
1910 SOURCES="$SOURCES $srcdir/src/thread/pthread/SDL_sysmutex.c"
1912 # Condition variables
1913 # We can fake these with semaphores and mutexes if necessary
1914 SOURCES="$SOURCES $srcdir/src/thread/pthread/SDL_syscond.c"
1923 dnl Determine whether the compiler can produce Win32 executables
1926 AC_MSG_CHECKING(Win32 compiler)
1929 #include <windows.h>
1934 AC_MSG_RESULT($have_win32_gcc)
1935 if test x$have_win32_gcc != xyes; then
1937 *** Your compiler ($CC) does not produce Win32 executables!
1941 dnl See if the user wants to redirect standard output to files
1942 AC_ARG_ENABLE(stdio-redirect,
1943 AC_HELP_STRING([--enable-stdio-redirect], [Redirect STDIO to files on Win32 [[default=yes]]]),
1944 , enable_stdio_redirect=yes)
1945 if test x$enable_stdio_redirect != xyes; then
1946 EXTRA_CFLAGS="$EXTRA_CFLAGS -DNO_STDIO_REDIRECT"
1949 if test x$enable_video = xyes; then
1950 AC_DEFINE(SDL_VIDEO_DRIVER_WINDIB)
1951 SOURCES="$SOURCES $srcdir/src/video/wincommon/*.c"
1952 SOURCES="$SOURCES $srcdir/src/video/windib/*.c"
1957 dnl Find the DirectX includes and libraries
1960 AC_ARG_ENABLE(directx,
1961 AC_HELP_STRING([--enable-directx], [use DirectX for Win32 audio/video [[default=yes]]]),
1962 , enable_directx=yes)
1963 if test x$enable_directx = xyes; then
1965 AC_CHECK_HEADER(ddraw.h, have_ddraw=yes)
1966 AC_CHECK_HEADER(dsound.h, have_dsound=yes)
1967 AC_CHECK_HEADER(dinput.h, use_dinput=yes)
1968 if test x$have_ddraw = xyes -a x$have_dsound = xyes -a x$use_dinput = xyes; then
1971 if test x$enable_video = xyes -a x$have_directx = xyes; then
1972 AC_DEFINE(SDL_VIDEO_DRIVER_DDRAW)
1973 SOURCES="$SOURCES $srcdir/src/video/windx5/*.c"
1979 dnl Check for the dlfcn.h interface for dynamically loading objects
1982 AC_ARG_ENABLE(sdl-dlopen,
1983 AC_HELP_STRING([--enable-sdl-dlopen], [use dlopen for shared object loading [[default=yes]]]),
1984 , enable_sdl_dlopen=yes)
1985 if test x$enable_sdl_dlopen = xyes; then
1986 AC_MSG_CHECKING(for dlopen)
1991 #if defined(MAC_OS_X_VERSION_MIN_REQUIRED) && MAC_OS_X_VERSION_MIN_REQUIRED <= 1020
1992 #error Use dlcompat for Mac OS X 10.2 compatibility
1997 AC_MSG_RESULT($have_dlopen)
1999 if test x$have_dlopen = xyes; then
2000 AC_CHECK_LIB(c, dlopen, EXTRA_LDFLAGS="$EXTRA_LDFLAGS",
2001 AC_CHECK_LIB(dl, dlopen, EXTRA_LDFLAGS="$EXTRA_LDFLAGS -ldl",
2002 AC_CHECK_LIB(ltdl, dlopen, EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lltdl")))
2003 AC_CHECK_LIB(dl, dlvsym, have_dlvsym=yes)
2004 if test x$have_dlvsym = xyes; then
2005 AC_DEFINE(HAVE_DLVSYM)
2007 AC_DEFINE(SDL_LOADSO_DLOPEN)
2008 SOURCES="$SOURCES $srcdir/src/loadso/dlopen/*.c"
2014 dnl Set up the Atari LDG (shared object loader)
2017 AC_ARG_ENABLE(atari-ldg,
2018 AC_HELP_STRING([--enable-atari-ldg], [use Atari LDG for shared object loading [[default=yes]]]),
2019 , enable_atari_ldg=yes)
2020 if test x$video_gem = xyes -a x$enable_atari_ldg = xyes; then
2021 AC_CHECK_HEADER(ldg.h, have_ldg_hdr=yes)
2022 AC_CHECK_LIB(ldg, ldg_open, have_ldg_lib=yes, have_ldg_lib=no, -lgem)
2023 if test x$have_ldg_hdr = xyes -a x$have_ldg_lib = xyes; then
2024 AC_DEFINE(SDL_LOADSO_LDG)
2025 SOURCES="$SOURCES $srcdir/src/loadso/mint/*.c"
2026 SDL_LIBS="$SDL_LIBS -lldg -lgem"
2032 dnl Check for the usbhid(3) library on *BSD
2035 if test x$enable_joystick = xyes; then
2036 AC_CHECK_LIB(usbhid, hid_init, have_libusbhid=yes)
2037 if test x$have_libusbhid = xyes; then
2038 AC_CHECK_HEADER(usbhid.h, [USB_CFLAGS="-DHAVE_USBHID_H"])
2039 AC_CHECK_HEADER(libusbhid.h, [USB_CFLAGS="-DHAVE_LIBUSBHID_H"])
2040 USB_LIBS="$USB_LIBS -lusbhid"
2042 AC_CHECK_HEADER(usb.h, [USB_CFLAGS="-DHAVE_USB_H"])
2043 AC_CHECK_HEADER(libusb.h, [USB_CFLAGS="-DHAVE_LIBUSB_H"])
2044 AC_CHECK_LIB(usb, hid_init, [USB_LIBS="$USB_LIBS -lusb"])
2047 save_CFLAGS="$CFLAGS"
2048 CFLAGS="$CFLAGS $USB_CFLAGS"
2050 AC_MSG_CHECKING(for usbhid)
2053 #include <sys/types.h>
2054 #if defined(HAVE_USB_H)
2057 #ifdef __DragonFly__
2058 # include <bus/usb/usb.h>
2059 # include <bus/usb/usbhid.h>
2061 # include <dev/usb/usb.h>
2062 # include <dev/usb/usbhid.h>
2064 #if defined(HAVE_USBHID_H)
2066 #elif defined(HAVE_LIBUSB_H)
2068 #elif defined(HAVE_LIBUSBHID_H)
2069 #include <libusbhid.h>
2072 struct report_desc *repdesc;
2073 struct usb_ctl_report *repbuf;
2078 AC_MSG_RESULT($have_usbhid)
2080 if test x$have_usbhid = xyes; then
2081 AC_MSG_CHECKING(for ucr_data member of usb_ctl_report)
2082 have_usbhid_ucr_data=no
2084 #include <sys/types.h>
2085 #if defined(HAVE_USB_H)
2088 #ifdef __DragonFly__
2089 # include <bus/usb/usb.h>
2090 # include <bus/usb/usbhid.h>
2092 # include <dev/usb/usb.h>
2093 # include <dev/usb/usbhid.h>
2095 #if defined(HAVE_USBHID_H)
2097 #elif defined(HAVE_LIBUSB_H)
2099 #elif defined(HAVE_LIBUSBHID_H)
2100 #include <libusbhid.h>
2103 struct usb_ctl_report buf;
2104 if (buf.ucr_data) { }
2106 have_usbhid_ucr_data=yes
2108 if test x$have_usbhid_ucr_data = xyes; then
2109 USB_CFLAGS="$USB_CFLAGS -DUSBHID_UCR_DATA"
2111 AC_MSG_RESULT($have_usbhid_ucr_data)
2113 AC_MSG_CHECKING(for new usbhid API)
2116 #include <sys/types.h>
2117 #if defined(HAVE_USB_H)
2120 #ifdef __DragonFly__
2121 #include <bus/usb/usb.h>
2122 #include <bus/usb/usbhid.h>
2124 #include <dev/usb/usb.h>
2125 #include <dev/usb/usbhid.h>
2127 #if defined(HAVE_USBHID_H)
2129 #elif defined(HAVE_LIBUSB_H)
2131 #elif defined(HAVE_LIBUSBHID_H)
2132 #include <libusbhid.h>
2136 hid_start_parse(d, 1, 1);
2140 if test x$have_usbhid_new = xyes; then
2141 USB_CFLAGS="$USB_CFLAGS -DUSBHID_NEW"
2143 AC_MSG_RESULT($have_usbhid_new)
2145 AC_MSG_CHECKING(for struct joystick in machine/joystick.h)
2146 have_machine_joystick=no
2148 #include <machine/joystick.h>
2152 have_machine_joystick=yes
2154 if test x$have_machine_joystick = xyes; then
2155 AC_DEFINE(SDL_JOYSTICK_USBHID_MACHINE_JOYSTICK_H)
2157 AC_MSG_RESULT($have_machine_joystick)
2159 AC_DEFINE(SDL_JOYSTICK_USBHID)
2160 SOURCES="$SOURCES $srcdir/src/joystick/bsd/*.c"
2161 EXTRA_CFLAGS="$EXTRA_CFLAGS $USB_CFLAGS"
2162 EXTRA_LDFLAGS="$EXTRA_LDFLAGS $USB_LIBS"
2165 CFLAGS="$save_CFLAGS"
2169 dnl Check for clock_gettime()
2172 AC_ARG_ENABLE(clock_gettime,
2173 AC_HELP_STRING([--enable-clock_gettime], [use clock_gettime() instead of gettimeofday() on UNIX [[default=no]]]),
2174 , enable_clock_gettime=no)
2175 if test x$enable_clock_gettime = xyes; then
2176 AC_CHECK_LIB(rt, clock_gettime, have_clock_gettime=yes)
2177 if test x$have_clock_gettime = xyes; then
2178 AC_DEFINE(HAVE_CLOCK_GETTIME)
2179 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lrt"
2184 dnl Check for a valid linux/version.h
2187 AC_CHECK_HEADER(linux/version.h, have_linux_version_h=yes)
2188 if test x$have_linux_version_h = xyes; then
2189 EXTRA_CFLAGS="$EXTRA_CFLAGS -DHAVE_LINUX_VERSION_H"
2193 dnl Check if we want to use RPATH
2196 AC_ARG_ENABLE(rpath,
2197 AC_HELP_STRING([--enable-rpath], [use an rpath when linking SDL [[default=yes]]]),
2201 dnl Set up the configuration based on the host platform!
2203 arm-*-elf*) # FIXME: Can we get more specific for iPodLinux?
2207 # Set up files for the timer library
2208 if test x$enable_timers = xyes; then
2209 AC_DEFINE(SDL_TIMER_UNIX)
2210 SOURCES="$SOURCES $srcdir/src/timer/unix/*.c"
2214 *-*-linux*|*-*-uclinux*|*-*-gnu*|*-*-k*bsd*-gnu|*-*-bsdi*|*-*-freebsd*|*-*-dragonfly*|*-*-netbsd*|*-*-openbsd*|*-*-sysv5*|*-*-solaris*|*-*-hpux*|*-*-irix*|*-*-aix*|*-*-osf*)
2216 *-*-linux*) ARCH=linux ;;
2217 *-*-uclinux*) ARCH=linux ;;
2218 *-*-kfreebsd*-gnu) ARCH=kfreebsd-gnu ;;
2219 *-*-knetbsd*-gnu) ARCH=knetbsd-gnu ;;
2220 *-*-kopenbsd*-gnu) ARCH=kopenbsd-gnu ;;
2221 *-*-gnu*) ARCH=gnu ;; # must be last of the gnu variants
2222 *-*-bsdi*) ARCH=bsdi ;;
2223 *-*-freebsd*) ARCH=freebsd ;;
2224 *-*-dragonfly*) ARCH=freebsd ;;
2225 *-*-netbsd*) ARCH=netbsd ;;
2226 *-*-openbsd*) ARCH=openbsd ;;
2227 *-*-sysv5*) ARCH=sysv5 ;;
2228 *-*-solaris*) ARCH=solaris ;;
2229 *-*-hpux*) ARCH=hpux ;;
2230 *-*-irix*) ARCH=irix ;;
2231 *-*-aix*) ARCH=aix ;;
2232 *-*-osf*) ARCH=osf ;;
2234 CheckVisibilityHidden
2269 # Set up files for the audio library
2270 if test x$enable_audio = xyes; then
2273 AC_DEFINE(SDL_AUDIO_DRIVER_SUNAUDIO)
2274 SOURCES="$SOURCES $srcdir/src/audio/sun/*.c"
2278 AC_DEFINE(SDL_AUDIO_DRIVER_BSD)
2279 SOURCES="$SOURCES $srcdir/src/audio/bsd/*.c"
2283 AC_DEFINE(SDL_AUDIO_DRIVER_PAUD)
2284 SOURCES="$SOURCES $srcdir/src/audio/paudio/*.c"
2289 # Set up files for the joystick library
2290 if test x$enable_joystick = xyes; then
2293 AC_DEFINE(SDL_JOYSTICK_LINUX)
2294 SOURCES="$SOURCES $srcdir/src/joystick/linux/*.c"
2299 # Set up files for the cdrom library
2300 if test x$enable_cdrom = xyes; then
2303 AC_DEFINE(SDL_CDROM_LINUX)
2304 SOURCES="$SOURCES $srcdir/src/cdrom/linux/*.c"
2308 AC_DEFINE(SDL_CDROM_FREEBSD)
2309 SOURCES="$SOURCES $srcdir/src/cdrom/freebsd/*.c"
2313 AC_DEFINE(SDL_CDROM_OPENBSD)
2314 SOURCES="$SOURCES $srcdir/src/cdrom/openbsd/*.c"
2318 AC_DEFINE(SDL_CDROM_BSDI)
2319 SOURCES="$SOURCES $srcdir/src/cdrom/bsdi/*.c"
2323 AC_DEFINE(SDL_CDROM_AIX)
2324 SOURCES="$SOURCES $srcdir/src/cdrom/aix/*.c"
2328 AC_DEFINE(SDL_CDROM_OSF)
2329 SOURCES="$SOURCES $srcdir/src/cdrom/osf/*.c"
2334 # Set up files for the thread library
2335 if test x$enable_threads = xyes -a x$use_pthreads != xyes -a x$use_pth != xyes -a x$ARCH = xirix; then
2336 AC_DEFINE(SDL_THREAD_SPROC)
2337 SOURCES="$SOURCES $srcdir/src/thread/irix/*.c"
2338 SOURCES="$SOURCES $srcdir/src/thread/generic/SDL_sysmutex.c"
2339 SOURCES="$SOURCES $srcdir/src/thread/generic/SDL_syscond.c"
2342 # Set up files for the timer library
2343 if test x$enable_timers = xyes; then
2344 AC_DEFINE(SDL_TIMER_UNIX)
2345 SOURCES="$SOURCES $srcdir/src/timer/unix/*.c"
2361 # Set up files for the audio library
2362 if test x$enable_audio = xyes; then
2363 AC_DEFINE(SDL_AUDIO_DRIVER_QNXNTO)
2364 SOURCES="$SOURCES $srcdir/src/audio/nto/*.c"
2365 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lasound"
2368 # Set up files for the cdrom library
2369 if test x$enable_cdrom = xyes; then
2370 AC_DEFINE(SDL_CDROM_QNX)
2371 SOURCES="$SOURCES $srcdir/src/cdrom/qnx/*.c"
2374 # Set up files for the timer library
2375 if test x$enable_timers = xyes; then
2376 AC_DEFINE(SDL_TIMER_UNIX)
2377 SOURCES="$SOURCES $srcdir/src/timer/unix/*.c"
2381 *-*-cygwin* | *-*-mingw32*)
2383 if test "$build" != "$host"; then # cross-compiling
2384 # Default cross-compile location
2385 ac_default_prefix=/usr/local/cross-tools/i386-mingw32
2387 # Look for the location of the tools and install there
2388 if test "$BUILD_PREFIX" != ""; then
2389 ac_default_prefix=$BUILD_PREFIX
2399 # Set up files for the audio library
2400 if test x$enable_audio = xyes; then
2401 AC_DEFINE(SDL_AUDIO_DRIVER_WAVEOUT)
2402 SOURCES="$SOURCES $srcdir/src/audio/windib/*.c"
2403 if test x$have_directx = xyes; then
2404 AC_DEFINE(SDL_AUDIO_DRIVER_DSOUND)
2405 SOURCES="$SOURCES $srcdir/src/audio/windx5/*.c"
2409 # Set up files for the joystick library
2410 if test x$enable_joystick = xyes; then
2411 AC_DEFINE(SDL_JOYSTICK_WINMM)
2412 SOURCES="$SOURCES $srcdir/src/joystick/win32/*.c"
2415 # Set up files for the cdrom library
2416 if test x$enable_cdrom = xyes; then
2417 AC_DEFINE(SDL_CDROM_WIN32)
2418 SOURCES="$SOURCES $srcdir/src/cdrom/win32/*.c"
2421 # Set up files for the thread library
2422 if test x$enable_threads = xyes; then
2423 AC_DEFINE(SDL_THREAD_WIN32)
2424 SOURCES="$SOURCES $srcdir/src/thread/win32/SDL_sysmutex.c"
2425 SOURCES="$SOURCES $srcdir/src/thread/win32/SDL_syssem.c"
2426 SOURCES="$SOURCES $srcdir/src/thread/win32/SDL_systhread.c"
2427 SOURCES="$SOURCES $srcdir/src/thread/generic/SDL_syscond.c"
2430 # Set up files for the timer library
2431 if test x$enable_timers = xyes; then
2432 AC_DEFINE(SDL_TIMER_WIN32)
2433 SOURCES="$SOURCES $srcdir/src/timer/win32/*.c"
2436 # Set up files for the shared object loading library
2437 if test x$enable_loadso = xyes; then
2438 AC_DEFINE(SDL_LOADSO_WIN32)
2439 SOURCES="$SOURCES $srcdir/src/loadso/win32/*.c"
2442 # Set up the system libraries we need
2443 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -luser32 -lgdi32 -lwinmm"
2444 if test x$have_directx = xyes; then
2445 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -ldxguid"
2447 # The Win32 platform requires special setup
2448 SOURCES="$SOURCES $srcdir/src/main/win32/*.rc"
2449 SDLMAIN_SOURCES="$srcdir/src/main/win32/*.c"
2450 SDL_CFLAGS="$SDL_CFLAGS -Dmain=SDL_main"
2451 SDL_LIBS="-lmingw32 -lSDLmain $SDL_LIBS -mwindows"
2460 SOURCES="$SOURCES $srcdir/src/video/gapi/*.c"
2461 EXTRA_CFLAGS="$EXTRA_CFLAGS -D_WIN32_WCE=0x420"
2462 if test x$enable_audio = xyes; then
2463 AC_DEFINE(SDL_AUDIO_DRIVER_WAVEOUT)
2464 SOURCES="$SOURCES $srcdir/src/audio/windib/*.c"
2467 # Set up files for the thread library
2468 if test x$enable_threads = xyes; then
2469 AC_DEFINE(SDL_THREAD_WIN32)
2470 SOURCES="$SOURCES $srcdir/src/thread/win32/SDL_sysmutex.c"
2471 SOURCES="$SOURCES $srcdir/src/thread/win32/SDL_syssem.c"
2472 SOURCES="$SOURCES $srcdir/src/thread/win32/SDL_systhread.c"
2473 SOURCES="$SOURCES $srcdir/src/thread/generic/SDL_syscond.c"
2476 # Set up files for the timer library
2477 if test x$enable_timers = xyes; then
2478 AC_DEFINE(SDL_TIMER_WINCE)
2479 SOURCES="$SOURCES $srcdir/src/timer/wince/*.c"
2480 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lcoredll -lmmtimer"
2483 # Set up files for the shared object loading library
2484 if test x$enable_loadso = xyes; then
2485 AC_DEFINE(SDL_LOADSO_WIN32)
2486 SOURCES="$SOURCES $srcdir/src/loadso/win32/*.c"
2489 # Set up the system libraries we need
2490 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lcoredll -lcommctrl"
2491 # The Win32 platform requires special setup
2492 SDLMAIN_SOURCES="$srcdir/src/main/win32/*.c"
2493 SDL_CFLAGS="$SDL_CFLAGS -Dmain=SDL_main -D_WIN32_WCE=0x420"
2494 SDL_LIBS="-lSDLmain $SDL_LIBS"
2498 ac_default_prefix=/boot/develop/tools/gnupro
2505 # Set up files for the audio library
2506 if test x$enable_audio = xyes; then
2507 AC_DEFINE(SDL_AUDIO_DRIVER_BAUDIO)
2508 SOURCES="$SOURCES $srcdir/src/audio/baudio/*.cc"
2511 # Set up files for the joystick library
2512 if test x$enable_joystick = xyes; then
2513 AC_DEFINE(SDL_JOYSTICK_BEOS)
2514 SOURCES="$SOURCES $srcdir/src/joystick/beos/*.cc"
2517 # Set up files for the cdrom library
2518 if test x$enable_cdrom = xyes; then
2519 AC_DEFINE(SDL_CDROM_BEOS)
2520 SOURCES="$SOURCES $srcdir/src/cdrom/beos/*.cc"
2523 # Set up files for the thread library
2524 if test x$enable_threads = xyes; then
2525 AC_DEFINE(SDL_THREAD_BEOS)
2526 SOURCES="$SOURCES $srcdir/src/thread/beos/*.c"
2527 SOURCES="$SOURCES $srcdir/src/thread/generic/SDL_sysmutex.c"
2528 SOURCES="$SOURCES $srcdir/src/thread/generic/SDL_syscond.c"
2531 # Set up files for the timer library
2532 if test x$enable_timers = xyes; then
2533 AC_DEFINE(SDL_TIMER_BEOS)
2534 SOURCES="$SOURCES $srcdir/src/timer/beos/*.c"
2537 # Set up files for the shared object loading library
2538 if test x$enable_loadso = xyes; then
2539 AC_DEFINE(SDL_LOADSO_BEOS)
2540 SOURCES="$SOURCES $srcdir/src/loadso/beos/*.c"
2543 # The BeOS platform requires special setup.
2544 SOURCES="$srcdir/src/main/beos/*.cc $SOURCES"
2545 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lroot -lbe -lmedia -lgame -ldevice -ltextencoding"
2548 # This could be either full "Mac OS X", or plain "Darwin" which is
2549 # just the OS X kernel sans upper layers like Carbon and Cocoa.
2550 # Next line is broken, and a few files below require Mac OS X (full)
2553 # Mac OS X builds with both the Carbon and OSX APIs at the moment
2554 EXTRA_CFLAGS="$EXTRA_CFLAGS -DTARGET_API_MAC_CARBON"
2555 EXTRA_CFLAGS="$EXTRA_CFLAGS -DTARGET_API_MAC_OSX"
2557 # HACK: Reset EXTRA_LDFLAGS; the only thing it contains at this point
2558 # is -lm which is not needed under Mac OS X. But for some reasons it
2559 # also tends to contain spurious -L switches, which we don't want to
2560 # use here or in sdl-config. Hence we reset it.
2563 CheckVisibilityHidden
2570 # Set up files for the shared object loading library
2571 # (this needs to be done before the dynamic X11 check)
2572 if test x$enable_loadso = xyes -a x$have_dlopen != xyes; then
2573 AC_DEFINE(SDL_LOADSO_DLCOMPAT)
2574 SOURCES="$SOURCES $srcdir/src/loadso/macosx/*.c"
2586 # Need this or things might misbuild on a G3.
2587 EXTRA_CFLAGS="$EXTRA_CFLAGS -force_cpusubtype_ALL"
2589 # Set up files for the audio library
2590 if test x$enable_audio = xyes; then
2591 AC_DEFINE(SDL_AUDIO_DRIVER_COREAUDIO)
2592 SOURCES="$SOURCES $srcdir/src/audio/macosx/*.c"
2593 AC_DEFINE(SDL_AUDIO_DRIVER_SNDMGR)
2594 SOURCES="$SOURCES $srcdir/src/audio/macrom/*.c"
2597 # Set up files for the joystick library
2598 if test x$enable_joystick = xyes; then
2599 AC_DEFINE(SDL_JOYSTICK_IOKIT)
2600 SOURCES="$SOURCES $srcdir/src/joystick/darwin/*.c"
2602 need_iokit_framework=yes
2604 # Set up files for the cdrom library
2605 if test x$enable_cdrom = xyes; then
2606 AC_DEFINE(SDL_CDROM_MACOSX)
2607 SOURCES="$SOURCES $srcdir/src/cdrom/macosx/*.c"
2610 # Set up files for the timer library
2611 if test x$enable_timers = xyes; then
2612 AC_DEFINE(SDL_TIMER_UNIX)
2613 SOURCES="$SOURCES $srcdir/src/timer/unix/*.c"
2616 # The Mac OS X platform requires special setup.
2617 SDLMAIN_SOURCES="$srcdir/src/main/macosx/*.m"
2618 EXTRA_CFLAGS="$EXTRA_CFLAGS -fpascal-strings"
2619 SDL_LIBS="-lSDLmain $SDL_LIBS"
2620 if test x$enable_video_cocoa = xyes; then
2621 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,Cocoa"
2622 need_iokit_framework=yes
2624 if test x$enable_video_carbon = xyes -o x$enable_video_cocoa = xyes; then
2625 # The Cocoa backend still needs Carbon, and the YUV code QuickTime
2626 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,QuickTime -Wl,-framework,ApplicationServices"
2627 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,Carbon"
2629 # If either the audio or CD driver is used, add the AudioUnit framework
2630 if test x$enable_audio = xyes -o x$enable_cdrom = xyes; then
2631 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,AudioToolbox -Wl,-framework,AudioUnit"
2633 # Some subsystems reference IOKit...
2634 if test x$need_iokit_framework = xyes; then
2635 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,IOKit"
2644 CheckAtariXbiosVideo
2650 # Set up files for the audio library
2651 if test x$enable_threads = xyes -a x$enable_pth = xyes; then
2652 if test x$enable_audio = xyes; then
2653 AC_DEFINE(SDL_AUDIO_DRIVER_SUNAUDIO)
2654 SOURCES="$SOURCES $srcdir/src/audio/sun/*.c"
2658 # Set up files for the joystick library
2659 if test x$enable_joystick = xyes; then
2660 AC_DEFINE(SDL_JOYSTICK_MINT)
2661 SOURCES="$SOURCES $srcdir/src/joystick/mint/*.c"
2664 # Set up files for the cdrom library
2665 if test x$enable_cdrom = xyes; then
2666 AC_DEFINE(SDL_CDROM_MINT)
2667 SOURCES="$SOURCES $srcdir/src/cdrom/mint/*.c"
2670 # Set up files for the timer library
2671 if test x$enable_timers = xyes; then
2672 if test x$enable_threads = xyes -a x$enable_pth = xyes; then
2673 AC_DEFINE(SDL_TIMER_UNIX)
2674 SOURCES="$SOURCES $srcdir/src/timer/unix/*.c"
2676 AC_DEFINE(SDL_TIMER_MINT)
2677 SOURCES="$SOURCES $srcdir/src/timer/mint/*.c"
2678 SOURCES="$SOURCES $srcdir/src/timer/mint/*.S"
2687 # Set up files for the video library
2688 if test x$enable_video = xyes; then
2689 AC_DEFINE(SDL_VIDEO_DRIVER_RISCOS)
2690 SOURCES="$SOURCES $srcdir/src/video/riscos/*.c"
2691 SOURCES="$SOURCES $srcdir/src/video/riscos/*.S"
2694 # Set up files for the joystick library
2695 if test x$enable_joystick = xyes; then
2696 AC_DEFINE(SDL_JOYSTICK_RISCOS)
2697 SOURCES="$SOURCES $srcdir/src/joystick/riscos/*.c"
2700 # Set up files for the timer library
2701 if test x$enable_timers = xyes; then
2702 AC_DEFINE(SDL_TIMER_RISCOS)
2703 SOURCES="$SOURCES $srcdir/src/timer/riscos/*.c"
2706 # The RISC OS platform requires special setup.
2707 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -ljpeg -ltiff -lpng -lz"
2711 *** Unsupported host: Please add to configure.in
2716 # Verify that we have all the platform specific files we need
2718 if test x$enable_joystick = xyes; then
2719 if test x$have_joystick != xyes; then
2720 # Wants joystick subsystem, but doesn't have a platform-specific backend...
2721 AC_DEFINE(SDL_JOYSTICK_DUMMY)
2722 SOURCES="$SOURCES $srcdir/src/joystick/dummy/*.c"
2725 if test x$have_cdrom != xyes; then
2726 if test x$enable_cdrom = xyes; then
2727 AC_DEFINE(SDL_CDROM_DISABLED)
2729 SOURCES="$SOURCES $srcdir/src/cdrom/dummy/*.c"
2731 if test x$have_threads != xyes; then
2732 if test x$enable_threads = xyes; then
2733 AC_DEFINE(SDL_THREADS_DISABLED)
2735 SOURCES="$SOURCES $srcdir/src/thread/generic/*.c"
2737 if test x$have_timers != xyes; then
2738 if test x$enable_timers = xyes; then
2739 AC_DEFINE(SDL_TIMERS_DISABLED)
2741 SOURCES="$SOURCES $srcdir/src/timer/dummy/*.c"
2743 if test x$have_loadso != xyes; then
2744 if test x$enable_loadso = xyes; then
2745 AC_DEFINE(SDL_LOADSO_DISABLED)
2747 SOURCES="$SOURCES $srcdir/src/loadso/dummy/*.c"
2749 if test x$SDLMAIN_SOURCES = x; then
2750 SDLMAIN_SOURCES="$srcdir/src/main/dummy/*.c"
2753 OBJECTS=`echo $SOURCES | sed 's,[[^ ]]*/\([[^ ]]*\)\.asm,$(objects)/\1.lo,g'`
2754 OBJECTS=`echo $OBJECTS | sed 's,[[^ ]]*/\([[^ ]]*\)\.cc,$(objects)/\1.lo,g'`
2755 OBJECTS=`echo $OBJECTS | sed 's,[[^ ]]*/\([[^ ]]*\)\.m,$(objects)/\1.lo,g'`
2756 OBJECTS=`echo $OBJECTS | sed 's,[[^ ]]*/\([[^ ]]*\)\.c,$(objects)/\1.lo,g'`
2757 OBJECTS=`echo $OBJECTS | sed 's,[[^ ]]*/\([[^ ]]*\)\.S,$(objects)/\1.lo,g'`
2758 OBJECTS=`echo $OBJECTS | sed 's,[[^ ]]*/\([[^ ]]*\)\.rc,$(objects)/\1.o,g'`
2760 SDLMAIN_OBJECTS=`echo $SDLMAIN_SOURCES | sed 's,[[^ ]]*/\([[^ ]]*\)\.cc,$(objects)/\1.o,g'`
2761 SDLMAIN_OBJECTS=`echo $SDLMAIN_OBJECTS | sed 's,[[^ ]]*/\([[^ ]]*\)\.m,$(objects)/\1.o,g'`
2762 SDLMAIN_OBJECTS=`echo $SDLMAIN_OBJECTS | sed 's,[[^ ]]*/\([[^ ]]*\)\.c,$(objects)/\1.o,g'`
2764 # Set runtime shared library paths as needed
2766 if test "x$enable_rpath" = "xyes"; then
2767 if test $ARCH = bsdi -o $ARCH = freebsd -o $ARCH = irix -o $ARCH = linux -o $ARCH = netbsd; then
2768 SDL_RLD_FLAGS="-Wl,-rpath,\${libdir}"
2770 if test $ARCH = solaris; then
2771 SDL_RLD_FLAGS="-R\${libdir}"
2779 if test x$enable_video = xyes -a x$enable_video_cocoa = xyes; then
2780 SDL_LIBS="$SDL_LIBS -Wl,-framework,Cocoa"
2782 if test x$enable_video = xyes -a x$enable_video_carbon = xyes; then
2783 SDL_LIBS="$SDL_LIBS -Wl,-framework,Carbon"
2785 # Evil hack to allow static linking on Mac OS X
2786 SDL_STATIC_LIBS="\${libdir}/libSDLmain.a \${libdir}/libSDL.a $EXTRA_LDFLAGS"
2789 SDL_STATIC_LIBS="$SDL_LIBS $EXTRA_LDFLAGS"
2793 dnl Expand the cflags and libraries needed by apps using SDL
2794 AC_SUBST(SDL_CFLAGS)
2796 AC_SUBST(SDL_STATIC_LIBS)
2797 AC_SUBST(SDL_RLD_FLAGS)
2798 if test x$enable_shared = xyes; then
2800 ENABLE_SHARED_FALSE="#"
2802 ENABLE_SHARED_TRUE="#"
2803 ENABLE_SHARED_FALSE=
2805 if test x$enable_static = xyes; then
2807 ENABLE_STATIC_FALSE="#"
2809 ENABLE_STATIC_TRUE="#"
2810 ENABLE_STATIC_FALSE=
2812 AC_SUBST(ENABLE_SHARED_TRUE)
2813 AC_SUBST(ENABLE_SHARED_FALSE)
2814 AC_SUBST(ENABLE_STATIC_TRUE)
2815 AC_SUBST(ENABLE_STATIC_FALSE)
2817 dnl Expand the sources and objects needed to build the library
2818 AC_SUBST(ac_aux_dir)
2822 AC_SUBST(SDLMAIN_SOURCES)
2823 AC_SUBST(SDLMAIN_OBJECTS)
2824 AC_SUBST(BUILD_CFLAGS)
2825 AC_SUBST(EXTRA_CFLAGS)
2826 AC_SUBST(BUILD_LDFLAGS)
2827 AC_SUBST(EXTRA_LDFLAGS)
2831 Makefile sdl-config SDL.spec SDL.qpg sdl.pc
2834 if test x"$MAKE" = x; then MAKE=make; fi; $MAKE depend