1 dnl Process this file with autoconf to produce a configure script.
4 dnl Set various version strings - taken gratefully from the GTk sources
7 # Edit include/SDL/SDL_version.h and change the version, then:
8 # SDL_MICRO_VERSION += 1;
9 # SDL_INTERFACE_AGE += 1;
10 # SDL_BINARY_AGE += 1;
11 # if any functions have been added, set SDL_INTERFACE_AGE to 0.
12 # if backwards compatibility has been broken,
13 # set SDL_BINARY_AGE and SDL_INTERFACE_AGE to 0.
20 SDL_VERSION=$SDL_MAJOR_VERSION.$SDL_MINOR_VERSION.$SDL_MICRO_VERSION
22 AC_SUBST(SDL_MAJOR_VERSION)
23 AC_SUBST(SDL_MINOR_VERSION)
24 AC_SUBST(SDL_MICRO_VERSION)
25 AC_SUBST(SDL_INTERFACE_AGE)
26 AC_SUBST(SDL_BINARY_AGE)
30 LT_RELEASE=$SDL_MAJOR_VERSION.$SDL_MINOR_VERSION
31 LT_CURRENT=`expr $SDL_MICRO_VERSION - $SDL_INTERFACE_AGE`
32 LT_REVISION=$SDL_INTERFACE_AGE
33 LT_AGE=`expr $SDL_BINARY_AGE - $SDL_INTERFACE_AGE`
40 dnl Detect the canonical host and target build environment
43 dnl Setup for automake
44 AM_INIT_AUTOMAKE(SDL, $SDL_VERSION)
63 AM_CONDITIONAL([am__fastdepOBJC], false)
65 dnl The alpha architecture needs special flags for binary portability
68 if test x$ac_cv_prog_gcc = xyes; then
69 CFLAGS="$CFLAGS -mcpu=ev4 -Wa,-mall"
74 dnl Add compiler-specific optimization flags
76 dnl See if the user wants aggressive optimizations of the code
78 [ --enable-debug Disable aggressive optimizations [default=yes]],
80 if test x$enable_debug != xyes; then
81 if test x$ac_cv_prog_gcc = xyes; then
82 CFLAGS="$CFLAGS -fexpensive-optimizations"
83 # Ack! This breaks the MMX YV12 conversion on gcc 2.95.2
84 # CFLAGS="$CFLAGS -fomit-frame-pointer"
88 if test x$ac_cv_prog_gcc = xyes; then
89 CFLAGS="$CFLAGS -march=i486"
93 if test x$ac_cv_prog_gcc = xyes; then
94 CFLAGS="$CFLAGS -march=pentium -mcpu=pentiumpro"
98 if test x$ac_cv_prog_gcc != xyes; then
99 CFLAGS="-g3 -fast -arch host"
105 dnl Add verbose warnings by default, and allow ANSI compliance checking
106 AC_ARG_ENABLE(strict-ansi,
107 [ --enable-strict-ansi Enable strict ANSI compliance build [default=no]],
108 , enable_strict_ansi=no)
109 if test x$ac_cv_prog_gcc = xyes; then
110 CFLAGS="$CFLAGS -Wall"
111 if test x$enable_strict_ansi = xyes; then
112 CFLAGS="$CFLAGS -ansi -pedantic -D_XOPEN_SOURCE"
116 dnl Initialize the compiler and linker flags for SDL applications
121 dnl Add the math library for the new gamma correction support
124 *-*-cygwin* | *-*-mingw32*)
137 SYSTEM_LIBS="$SYSTEM_LIBS $MATHLIB"
139 dnl Enable/disable various subsystems of the SDL library
142 [ --enable-audio Enable the audio subsystem [default=yes]],
144 if test x$enable_audio = xyes; then
145 SDL_EXTRADIRS="$SDL_EXTRADIRS audio"
146 SDL_EXTRALIBS="$SDL_EXTRALIBS audio/libaudio.la"
148 CFLAGS="$CFLAGS -DDISABLE_AUDIO"
151 [ --enable-video Enable the video subsystem [default=yes]],
153 if test x$enable_video = xyes; then
154 SDL_EXTRADIRS="$SDL_EXTRADIRS video"
155 SDL_EXTRALIBS="$SDL_EXTRALIBS video/libvideo.la"
157 CFLAGS="$CFLAGS -DDISABLE_VIDEO"
159 AC_ARG_ENABLE(events,
160 [ --enable-events Enable the events subsystem [default=yes]],
162 if test x$enable_video = xyes -a x$enable_events = xyes; then
163 SDL_EXTRADIRS="$SDL_EXTRADIRS events"
164 SDL_EXTRALIBS="$SDL_EXTRALIBS events/libevents.la"
166 CFLAGS="$CFLAGS -DDISABLE_EVENTS"
168 AC_ARG_ENABLE(joystick,
169 [ --enable-joystick Enable the joystick subsystem [default=yes]],
170 , enable_joystick=yes)
171 if test x$enable_joystick = xyes; then
172 SDL_EXTRADIRS="$SDL_EXTRADIRS joystick"
173 SDL_EXTRALIBS="$SDL_EXTRALIBS joystick/libjoystick.la"
175 CFLAGS="$CFLAGS -DDISABLE_JOYSTICK"
178 [ --enable-cdrom Enable the cdrom subsystem [default=yes]],
180 if test x$enable_cdrom = xyes; then
181 SDL_EXTRADIRS="$SDL_EXTRADIRS cdrom"
182 SDL_EXTRALIBS="$SDL_EXTRALIBS cdrom/libcdrom.la"
184 CFLAGS="$CFLAGS -DDISABLE_CDROM"
186 AC_ARG_ENABLE(threads,
187 [ --enable-threads Enable the threading subsystem [default=yes]],
188 , enable_threads=yes)
189 SDL_EXTRADIRS="$SDL_EXTRADIRS thread"
190 SDL_EXTRALIBS="$SDL_EXTRALIBS thread/libthread.la"
191 if test x$enable_threads != xyes; then
192 CFLAGS="$CFLAGS -DDISABLE_THREADS"
193 COPY_ARCH_SRC(src/thread, generic, SDL_systhread.c)
194 COPY_ARCH_SRC(src/thread, generic, SDL_systhread_c.h)
195 COPY_ARCH_SRC(src/thread, generic, SDL_sysmutex.c)
196 COPY_ARCH_SRC(src/thread, generic, SDL_sysmutex_c.h)
197 COPY_ARCH_SRC(src/thread, generic, SDL_syssem.c)
198 COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
199 COPY_ARCH_SRC(src/thread, generic, SDL_syscond.c)
200 COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
202 AC_ARG_ENABLE(timers,
203 [ --enable-timers Enable the timer subsystem [default=yes]],
205 if test x$enable_timers = xyes; then
206 SDL_EXTRADIRS="$SDL_EXTRADIRS timer"
207 SDL_EXTRALIBS="$SDL_EXTRALIBS timer/libtimer.la"
209 CFLAGS="$CFLAGS -DDISABLE_TIMERS"
211 AC_ARG_ENABLE(endian,
212 [ --enable-endian Enable the endian subsystem [default=yes]],
214 if test x$enable_endian = xyes; then
215 SDL_EXTRADIRS="$SDL_EXTRADIRS endian"
216 SDL_EXTRALIBS="$SDL_EXTRALIBS endian/libendian.la"
218 CFLAGS="$CFLAGS -DDISABLE_ENDIAN"
221 [ --enable-file Enable the file subsystem [default=yes]],
223 if test x$enable_file = xyes; then
224 SDL_EXTRADIRS="$SDL_EXTRADIRS file"
225 SDL_EXTRALIBS="$SDL_EXTRALIBS file/libfile.la"
227 CFLAGS="$CFLAGS -DDISABLE_FILE"
229 AC_ARG_ENABLE(cpuinfo,
230 [ --enable-cpuinfo Enable the cpuinfo subsystem [default=yes]],
231 , enable_cpuinfo=yes)
232 if test x$enable_cpuinfo = xyes; then
233 SDL_EXTRADIRS="$SDL_EXTRADIRS cpuinfo"
234 SDL_EXTRALIBS="$SDL_EXTRALIBS cpuinfo/libcpuinfo.la"
236 CFLAGS="$CFLAGS -DDISABLE_CPUINFO"
239 dnl See if the OSS audio interface is supported
243 [ --enable-oss support the OSS audio API [default=yes]],
245 if test x$enable_audio = xyes -a x$enable_oss = xyes; then
246 AC_MSG_CHECKING(for OSS audio support)
248 if test x$have_oss != xyes; then
250 #include <sys/soundcard.h>
252 int arg = SNDCTL_DSP_SETFRAGMENT;
257 if test x$have_oss != xyes; then
259 #include <soundcard.h>
261 int arg = SNDCTL_DSP_SETFRAGMENT;
264 CFLAGS="$CFLAGS -DOSS_USE_SOUNDCARD_H"
267 AC_MSG_RESULT($have_oss)
268 if test x$have_oss = xyes; then
269 CFLAGS="$CFLAGS -DOSS_SUPPORT"
270 AUDIO_SUBDIRS="$AUDIO_SUBDIRS dsp"
271 AUDIO_DRIVERS="$AUDIO_DRIVERS dsp/libaudio_dsp.la"
272 AUDIO_SUBDIRS="$AUDIO_SUBDIRS dma"
273 AUDIO_DRIVERS="$AUDIO_DRIVERS dma/libaudio_dma.la"
278 dnl See if the ALSA audio interface is supported
282 [ --enable-alsa support the ALSA audio API [default=yes]],
284 if test x$enable_audio = xyes -a x$enable_alsa = xyes; then
285 AM_PATH_ALSA(0.9.0, have_alsa=yes, have_alsa=no)
286 # Restore all flags from before the ALSA detection runs
287 CFLAGS="$alsa_save_CFLAGS"
288 LDFLAGS="$alsa_save_LDFLAGS"
289 LIBS="$alsa_save_LIBS"
290 if test x$have_alsa = xyes; then
291 AC_ARG_ENABLE(alsa-shared,
292 [ --enable-alsa-shared dynamically load ALSA audio support [default=yes]],
293 , enable_alsa_shared=yes)
294 if test "x`echo $ALSA_LIBS | grep -- -L`" = "x"; then
295 if test "x`ls /lib/libasound.so.* 2> /dev/null`" != "x"; then
296 ALSA_LIBS="-L/lib $ALSA_LIBS"
297 elif test "x`ls /usr/lib/libasound.so.* 2> /dev/null`" != "x"; then
298 ALSA_LIBS="-L/usr/lib $ALSA_LIBS"
299 elif test "x`ls /usr/local/lib/libasound.so.* 2> /dev/null`" != "x"; then
300 ALSA_LIBS="-L/usr/local/lib $ALSA_LIBS"
303 alsa_lib_spec=`echo $ALSA_LIBS | sed 's/.*-L\([[^ ]]*\).*/\1\/libasound.so.*/'`
304 alsa_lib=`ls $alsa_lib_spec | sed 's/.*\/\(.*\)/\1/; q'`
305 echo "-- $alsa_lib_spec -> $alsa_lib"
307 if test x$have_loadso != xyes && \
308 test x$enable_alsa_shared = xyes; then
309 AC_MSG_ERROR([You must have SDL_LoadObject() support])
311 if test x$have_loadso = xyes && \
312 test x$enable_alsa_shared = xyes && test x$alsa_lib != x; then
313 CFLAGS="$CFLAGS -DALSA_SUPPORT -DALSA_DYNAMIC=\$(alsa_lib) $ALSA_CFLAGS"
317 AC_CHECK_LIB(dl, dlvsym, [use_dlvsym=yes])
318 if test x$use_dlvsym = xyes; then
319 CFLAGS="$CFLAGS -DUSE_DLVSYM"
322 CFLAGS="$CFLAGS -DALSA_SUPPORT $ALSA_CFLAGS"
323 SYSTEM_LIBS="$SYSTEM_LIBS $ALSA_LIBS"
325 AUDIO_SUBDIRS="$AUDIO_SUBDIRS alsa"
326 AUDIO_DRIVERS="$AUDIO_DRIVERS alsa/libaudio_alsa.la"
331 dnl Check whether we want to use IRIX 6.5+ native audio or not
334 if test x$enable_audio = xyes; then
335 AC_MSG_CHECKING(for dmedia audio support)
338 #include <dmedia/audio.h>
344 AC_MSG_RESULT($have_dmedia)
345 # Set up files for the audio library
346 if test x$have_dmedia = xyes; then
347 CFLAGS="$CFLAGS -DDMEDIA_SUPPORT"
348 AUDIO_SUBDIRS="$AUDIO_SUBDIRS dmedia"
349 AUDIO_DRIVERS="$AUDIO_DRIVERS dmedia/libaudio_dmedia.la"
350 SYSTEM_LIBS="$SYSTEM_LIBS -laudio"
355 dnl Find the ESD includes and libraries
359 [ --enable-esd support the Enlightened Sound Daemon [default=yes]],
361 if test x$enable_audio = xyes -a x$enable_esd = xyes; then
362 AM_PATH_ESD(0.2.8, have_esd=yes, have_esd=no)
363 if test x$have_esd = xyes; then
364 AC_ARG_ENABLE(esd-shared,
365 [ --enable-esd-shared dynamically load ESD audio support [default=yes]],
366 , enable_esd_shared=yes)
367 esd_lib_spec=`echo $ESD_LIBS | sed 's/.*-L\([[^ ]]*\).*/\1\/libesd.so.*/'`
368 esd_lib=`ls $esd_lib_spec | sed 's/.*\/\(.*\)/\1/; q'`
369 echo "-- $esd_lib_spec -> $esd_lib"
370 if test x$have_loadso != xyes && \
371 test x$enable_esd_shared = xyes; then
372 AC_MSG_ERROR([You must have SDL_LoadObject() support])
374 if test x$have_loadso = xyes && \
375 test x$enable_esd_shared = xyes && test x$esd_lib != x; then
376 CFLAGS="$CFLAGS -DESD_SUPPORT -DESD_DYNAMIC=\$(esd_lib) $ESD_CFLAGS"
379 CFLAGS="$CFLAGS -DESD_SUPPORT $ESD_CFLAGS"
380 SYSTEM_LIBS="$SYSTEM_LIBS $ESD_LIBS"
382 AUDIO_SUBDIRS="$AUDIO_SUBDIRS esd"
383 AUDIO_DRIVERS="$AUDIO_DRIVERS esd/libaudio_esd.la"
391 [ --enable-arts support the Analog Real Time Synthesizer [default=yes]],
393 if test x$enable_audio = xyes -a x$enable_arts = xyes; then
394 AC_PATH_PROG(ARTSCCONFIG, artsc-config)
395 if test x$ARTSCCONFIG = x -o x$ARTSCCONFIG = x'"$ARTSCCONFIG"'; then
396 : # arts isn't installed
398 ARTSC_CFLAGS=`$ARTSCCONFIG --cflags`
399 ARTSC_LIBS=`$ARTSCCONFIG --libs`
400 ARTSC_PREFIX=`$ARTSCCONFIG --arts-prefix`
401 AC_MSG_CHECKING(for aRts development environment)
403 save_CFLAGS="$CFLAGS"
404 CFLAGS="$CFLAGS $ARTSC_CFLAGS"
408 arts_stream_t stream;
412 CFLAGS="$save_CFLAGS"
413 AC_MSG_RESULT($audio_arts)
414 if test x$audio_arts = xyes; then
415 AC_ARG_ENABLE(arts-shared,
416 [ --enable-arts-shared dynamically load aRts audio support [default=yes]],
417 , enable_arts_shared=yes)
418 arts_lib_spec="$ARTSC_PREFIX/lib/libartsc.so.*"
419 arts_lib=`ls $arts_lib_spec | sed 's/.*\/\(.*\)/\1/; q'`
420 echo "-- $arts_lib_spec -> $arts_lib"
421 if test x$have_loadso != xyes && \
422 test x$enable_arts_shared = xyes; then
423 AC_MSG_ERROR([You must have SDL_LoadObject() support])
425 if test x$have_loadso = xyes && \
426 test x$enable_arts_shared = xyes && test x$arts_lib != x; then
427 CFLAGS="$CFLAGS -DARTSC_SUPPORT -DARTSC_DYNAMIC=\$(arts_lib) $ARTSC_CFLAGS"
430 CFLAGS="$CFLAGS -DARTSC_SUPPORT $ARTSC_CFLAGS"
431 SYSTEM_LIBS="$SYSTEM_LIBS $ARTSC_LIBS"
433 AUDIO_SUBDIRS="$AUDIO_SUBDIRS arts"
434 AUDIO_DRIVERS="$AUDIO_DRIVERS arts/libaudio_arts.la"
440 dnl See if the NAS audio interface is supported
444 [ --enable-nas support the NAS audio API [default=yes]],
446 if test x$enable_audio = xyes -a x$enable_nas = xyes; then
447 AC_MSG_CHECKING(for NAS audio support)
449 if test -r /usr/X11R6/include/audio/audiolib.h; then
451 CFLAGS="$CFLAGS -DNAS_SUPPORT -I/usr/X11R6/include/"
452 SYSTEM_LIBS="$SYSTEM_LIBS -laudio -lXt"
453 AUDIO_SUBDIRS="$AUDIO_SUBDIRS nas"
454 AUDIO_DRIVERS="$AUDIO_DRIVERS nas/libaudio_nas.la"
456 dnl On IRIX, the NAS includes are in a different directory,
457 dnl and libnas must be explicitly linked in
459 elif test -r /usr/freeware/include/nas/audiolib.h; then
461 CFLAGS="$CFLAGS -DNAS_SUPPORT"
462 SYSTEM_LIBS="$SYSTEM_LIBS -lnas -lXt"
463 AUDIO_SUBDIRS="$AUDIO_SUBDIRS nas"
464 AUDIO_DRIVERS="$AUDIO_DRIVERS nas/libaudio_nas.la"
466 AC_MSG_RESULT($have_nas)
470 dnl rcg07142001 See if the user wants the disk writer audio driver...
473 AC_ARG_ENABLE(diskaudio,
474 [ --enable-diskaudio support the disk writer audio driver [default=yes]],
475 , enable_diskaudio=yes)
476 if test x$enable_audio = xyes -a x$enable_diskaudio = xyes; then
477 CFLAGS="$CFLAGS -DDISKAUD_SUPPORT"
478 AUDIO_SUBDIRS="$AUDIO_SUBDIRS disk"
479 AUDIO_DRIVERS="$AUDIO_DRIVERS disk/libaudio_disk.la"
483 dnl Set up the Atari Audio driver
486 AC_ARG_ENABLE(mintaudio,
487 [ --enable-mintaudio support Atari audio driver [default=yes]],
488 , enable_mintaudio=yes)
489 if test x$enable_audio = xyes -a x$enable_mintaudio = xyes; then
491 AC_CHECK_HEADER(mint/falcon.h, have_mint_falcon_hdr=yes)
492 if test x$have_mint_falcon_hdr = xyes; then
494 CFLAGS="$CFLAGS -DMINTAUDIO_SUPPORT"
495 AUDIO_SUBDIRS="$AUDIO_SUBDIRS mint"
496 AUDIO_DRIVERS="$AUDIO_DRIVERS mint/libaudio_mintaudio.la"
501 dnl See if we can use x86 assembly blitters
502 # NASM is available from: http://nasm.octium.net/
505 dnl Make sure we are running on an x86 platform
514 dnl Check for NASM (for assembly blit routines)
516 [ --enable-nasm use nasm assembly blitters on x86 [default=yes]],
518 if test x$enable_video = xyes -a x$enable_nasm = xyes; then
519 AC_PATH_PROG(NASM, nasm)
520 if test x$NASM = x -o x$NASM = x'"$NASM"'; then
521 : # nasm isn't installed
523 CFLAGS="$CFLAGS -DUSE_ASMBLIT -I$srcdir/hermes"
536 CFLAGS="$CFLAGS -I\$(top_srcdir)/src/hermes"
537 SDL_EXTRADIRS="$SDL_EXTRADIRS hermes"
538 SDL_EXTRALIBS="$SDL_EXTRALIBS hermes/libhermes.la"
542 # this line is needed for QNX, because it's not defined the __ELF__
543 *-*-qnx*) CFLAGS="$CFLAGS -D__ELF__"
552 dnl Do the iPod thing
556 [ --enable-ipod configure SDL to work with iPodLinux [default=yes on arm-elf]],
559 if test x$enable_ipod = xyes; then
560 CFLAGS="$CFLAGS -DENABLE_IPOD -DIPOD"
561 VIDEO_SUBDIRS="$VIDEO_SUBDIRS ipod"
562 VIDEO_DRIVERS="$VIDEO_DRIVERS ipod/libvideo_ipod.la"
566 dnl Find the nanox include and library directories
569 AC_ARG_ENABLE(video-nanox,
570 [ --enable-video-nanox use nanox video driver [default=no]],
571 , enable_video_nanox=no)
572 AC_ARG_ENABLE(nanox-debug,
573 [ --enable-nanox-debug print debug messages [default=no]],
574 , enable_nanox_debug=no)
575 AC_ARG_ENABLE(nanox-share-memory,
576 [ --enable-nanox-share-memory use share memory [default=no]],
577 , enable_nanox_share_memory=no)
578 AC_ARG_ENABLE(nanox_direct_fb,
579 [ --enable-nanox-direct-fb use direct framebuffer access [default=no]],
580 , enable_nanox_direct_fb=no)
582 if test x$enable_video = xyes -a x$enable_video_nanox = xyes; then
583 if test x$enable_nanox_debug = xyes; then
584 CFLAGS="$CFLAGS -DENABLE_NANOX_DEBUG"
587 if test x$enable_nanox_share_memory = xyes; then
588 CFLAGS="$CFLAGS -DNANOX_SHARE_MEMORY"
591 if test x$enable_nanox_direct_fb = xyes; then
592 CFLAGS="$CFLAGS -DENABLE_NANOX_DIRECT_FB"
595 CFLAGS="$CFLAGS $X_CFLAGS -DENABLE_NANOX"
596 SYSTEM_LIBS="$SYSTEM_LIBS -lnano-X"
597 VIDEO_SUBDIRS="$VIDEO_SUBDIRS nanox"
598 VIDEO_DRIVERS="$VIDEO_DRIVERS nanox/libvideo_nanox.la"
602 dnl Find the X11 include and library directories
605 AC_ARG_ENABLE(video-x11,
606 [ --enable-video-x11 use X11 video driver [default=yes]],
607 , enable_video_x11=yes)
608 if test x$enable_video = xyes -a x$enable_video_x11 = xyes; then
611 if test x$have_x = xyes; then
612 AC_ARG_ENABLE(x11-shared,
613 [ --enable-x11-shared dynamically load X11 support [default=yes]],
614 , enable_x11_shared=yes)
616 dnl !!! FIXME: if a platform needs more than this, fill it in!
619 x11_lib='/usr/X11R6/lib/libX11.6.dylib'
620 x11ext_lib='/usr/X11R6/lib/libXext.6.dylib'
623 x11_lib='libX11.so.6'
624 x11ext_lib='libXext.so.6'
628 if test x$have_loadso != xyes && \
629 test x$enable_x11_shared = xyes; then
630 AC_MSG_ERROR([You must have SDL_LoadObject() support])
633 if test x$have_loadso = xyes && \
634 test x$enable_x11_shared = xyes && test x$x11_lib != x && test x$x11ext_lib != x; then
635 CFLAGS="$CFLAGS $X_CFLAGS -DENABLE_X11 -DXTHREADS -DX11_DYNAMIC=\$(x11_lib) -DX11EXT_DYNAMIC=\$(x11ext_lib) -I$srcdir/include -I$srcdir/src/video"
636 SYSTEM_LIBS="$SYSTEM_LIBS $X_LIBS"
637 echo "-- dynamic libX11 -> $x11_lib"
638 echo "-- dynamic libX11ext -> $x11ext_lib"
642 CFLAGS="$CFLAGS $X_CFLAGS -DENABLE_X11 -DXTHREADS -I$srcdir/include -I$srcdir/src/video"
643 SYSTEM_LIBS="$SYSTEM_LIBS $X_LIBS -lX11 -lXext"
646 if test x$ac_cv_func_shmat != xyes; then
647 CFLAGS="$CFLAGS -DNO_SHARED_MEMORY"
650 VIDEO_SUBDIRS="$VIDEO_SUBDIRS x11"
651 VIDEO_DRIVERS="$VIDEO_DRIVERS x11/libvideo_x11.la"
653 AC_ARG_ENABLE(video-x11-vm,
654 [ --enable-video-x11-vm use X11 VM extension for fullscreen [default=yes]],
655 , enable_video_x11_vm=yes)
656 if test x$enable_video_x11_vm = xyes; then
657 AC_MSG_CHECKING(for XFree86 VidMode 1.0 support)
660 #include <X11/Xlib.h>
661 #include <XFree86/extensions/xf86vmode.h>
666 AC_MSG_RESULT($video_x11_vm)
667 if test x$video_x11_vm = xyes; then
668 CFLAGS="$CFLAGS -DXFREE86_VM"
669 VIDEO_SUBDIRS="$VIDEO_SUBDIRS XFree86/Xxf86vm"
670 VIDEO_DRIVERS="$VIDEO_DRIVERS XFree86/Xxf86vm/libXFree86_Xxf86vm.la"
671 AC_MSG_CHECKING(for XFree86 VidMode gamma support)
674 #include <X11/Xlib.h>
675 #include <XFree86/extensions/xf86vmode.h>
677 SDL_NAME(XF86VidModeGamma) gamma;
679 video_x11_vmgamma=yes
681 AC_MSG_RESULT($video_x11_vmgamma)
682 if test x$video_x11_vmgamma = xyes; then
683 CFLAGS="$CFLAGS -DXFREE86_VMGAMMA"
688 [ --enable-dga allow use of X11 DGA code [default=yes]],
690 AC_ARG_ENABLE(video-x11-dgamouse,
691 [ --enable-video-x11-dgamouse use X11 DGA for mouse events [default=yes]],
692 , enable_video_x11_dgamouse=yes)
693 if test x$enable_dga = xyes; then
694 AC_MSG_CHECKING(for XFree86 DGA 1.0 support)
697 #include <X11/Xlib.h>
698 #include <XFree86/extensions/xf86dga.h>
703 AC_MSG_RESULT($video_x11_dga)
704 if test x$video_x11_dga = xyes; then
705 CFLAGS="$CFLAGS -DXFREE86_DGAMOUSE"
706 if test x$enable_video_x11_dgamouse = xyes; then
707 CFLAGS="$CFLAGS -DDEFAULT_DGAMOUSE"
709 VIDEO_SUBDIRS="$VIDEO_SUBDIRS XFree86/Xxf86dga"
710 VIDEO_DRIVERS="$VIDEO_DRIVERS XFree86/Xxf86dga/libXFree86_Xxf86dga.la"
713 AC_ARG_ENABLE(video-x11-xv,
714 [ --enable-video-x11-xv use X11 XvImage extension for video [default=yes]],
715 , enable_video_x11_xv=yes)
716 if test x$enable_video_x11_xv = xyes; then
717 AC_MSG_CHECKING(for XFree86 XvImage support)
720 #include <X11/Xlib.h>
723 #include <X11/extensions/XShm.h>
724 #include <XFree86/extensions/Xvlib.h>
726 SDL_NAME(XvImage) *image;
730 AC_MSG_RESULT($video_x11_xv)
731 if test x$video_x11_xv = xyes; then
732 CFLAGS="$CFLAGS -DXFREE86_XV"
733 VIDEO_SUBDIRS="$VIDEO_SUBDIRS XFree86/Xv"
734 VIDEO_DRIVERS="$VIDEO_DRIVERS XFree86/Xv/libXFree86_Xv.la"
737 AC_ARG_ENABLE(video-x11-xinerama,
738 [ --enable-video-x11-xinerama enable X11 Xinerama support [default=yes]],
739 , enable_video_x11_xinerama=yes)
740 if test x$enable_video_x11_xinerama = xyes; then
741 AC_MSG_CHECKING(for X11 Xinerama support)
742 video_x11_xinerama=no
744 #include <X11/Xlib.h>
745 #include <XFree86/extensions/Xinerama.h>
747 SDL_NAME(XineramaScreenInfo) *xinerama;
749 video_x11_xinerama=yes
751 AC_MSG_RESULT($video_x11_xinerama)
752 if test x$video_x11_xinerama = xyes; then
753 CFLAGS="$CFLAGS -DHAVE_XINERAMA"
754 VIDEO_SUBDIRS="$VIDEO_SUBDIRS XFree86/Xinerama"
755 VIDEO_DRIVERS="$VIDEO_DRIVERS XFree86/Xinerama/libXFree86_Xinerama.la"
758 AC_ARG_ENABLE(video-x11-xme,
759 [ --enable-video-x11-xme enable Xi Graphics XME for fullscreen [default=yes]],
760 , enable_video_x11_xme=yes)
761 if test x$enable_video_x11_xme = xyes; then
762 AC_MSG_CHECKING(for Xi Graphics XiGMiscExtension support)
764 AC_MSG_RESULT($video_x11_xme)
765 if test x$video_x11_xme = xyes; then
766 CFLAGS="$CFLAGS -DHAVE_XIGXME"
767 VIDEO_SUBDIRS="$VIDEO_SUBDIRS XFree86/XME"
768 VIDEO_DRIVERS="$VIDEO_DRIVERS XFree86/XME/libXME.la"
775 dnl Find the X11 DGA 2.0 include and library directories
778 AC_ARG_ENABLE(video-dga,
779 [ --enable-video-dga use DGA 2.0 video driver [default=yes]],
780 , enable_video_dga=yes)
781 if test x$video_x11_dga = xyes -a x$enable_video_dga = xyes; then
782 save_CFLAGS="$CFLAGS"; CFLAGS="$CFLAGS -Isrc/video"
783 AC_MSG_CHECKING(for XFree86 DGA 2.0 support)
786 #include <X11/Xlib.h>
787 #include <XFree86/extensions/xf86dga.h>
789 SDL_NAME(XDGAEvent) xevent;
793 AC_MSG_RESULT($video_x11_dga2)
794 if test x$video_x11_dga2 = xyes; then
795 CFLAGS="$CFLAGS -DENABLE_DGA"
796 VIDEO_SUBDIRS="$VIDEO_SUBDIRS dga"
797 VIDEO_DRIVERS="$VIDEO_DRIVERS dga/libvideo_dga.la"
804 AC_ARG_ENABLE(video-photon,
805 [ --enable-video-photon use QNX Photon video driver [default=yes]],
806 , enable_video_photon=yes)
807 if test x$enable_video = xyes -a x$enable_video_photon = xyes; then
808 AC_MSG_CHECKING(for QNX Photon support)
813 #include <photon/Pg.h>
814 #include <photon/PdDirect.h>
816 PgDisplaySettings_t *visual;
820 AC_MSG_RESULT($video_photon)
821 if test x$video_photon = xyes; then
822 CFLAGS="$CFLAGS -DENABLE_PHOTON"
823 SYSTEM_LIBS="$SYSTEM_LIBS -lph"
824 VIDEO_SUBDIRS="$VIDEO_SUBDIRS photon"
825 VIDEO_DRIVERS="$VIDEO_DRIVERS photon/libvideo_photon.la"
831 dnl Find the framebuffer console includes
834 AC_ARG_ENABLE(video-fbcon,
835 [ --enable-video-fbcon use framebuffer console video driver [default=yes]],
836 , enable_video_fbcon=yes)
837 if test x$enable_video = xyes -a x$enable_video_fbcon = xyes; then
838 AC_MSG_CHECKING(for framebuffer console support)
841 #include <linux/fb.h>
842 #include <linux/kd.h>
843 #include <linux/keyboard.h>
848 AC_MSG_RESULT($video_fbcon)
849 if test x$video_fbcon = xyes; then
850 CFLAGS="$CFLAGS -DENABLE_FBCON"
851 VIDEO_SUBDIRS="$VIDEO_SUBDIRS fbcon"
852 VIDEO_DRIVERS="$VIDEO_DRIVERS fbcon/libvideo_fbcon.la"
860 AC_ARG_ENABLE(video-directfb,
861 [ --enable-video-directfb use DirectFB video driver [default=no]],
862 , enable_video_directfb=no)
863 if test x$enable_video = xyes -a x$enable_video_directfb = xyes; then
866 AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
867 if test x$PKG_CONFIG = xno ; then
868 AC_MSG_WARN([*** pkg-config is required to build the DirectFB video driver.])
870 AC_MSG_CHECKING(for DirectFB support)
872 if ! $PKG_CONFIG --atleast-pkgconfig-version 0.7 ; then
873 AC_MSG_ERROR([*** pkg-config too old; version 0.7 or better required.])
876 DIRECTFB_REQUIRED_VERSION=0.9.15
878 if $PKG_CONFIG --atleast-version $DIRECTFB_REQUIRED_VERSION directfb ; then
879 DIRECTFB_CFLAGS=`$PKG_CONFIG --cflags directfb`
880 DIRECTFB_LIBS=`$PKG_CONFIG --libs directfb`
885 AC_MSG_RESULT($video_directfb)
886 if test x$video_directfb = xyes; then
887 CFLAGS="$CFLAGS -DENABLE_DIRECTFB"
888 VIDEO_SUBDIRS="$VIDEO_SUBDIRS directfb"
889 VIDEO_DRIVERS="$VIDEO_DRIVERS directfb/libvideo_directfb.la"
891 AC_SUBST(DIRECTFB_CFLAGS)
892 AC_SUBST(DIRECTFB_LIBS)
897 dnl See if we're running on PlayStation 2 hardware
900 AC_ARG_ENABLE(video-ps2gs,
901 [ --enable-video-ps2gs use PlayStation 2 GS video driver [default=yes]],
902 , enable_video_ps2gs=yes)
903 if test x$enable_video = xyes -a x$enable_video_ps2gs = xyes; then
904 AC_MSG_CHECKING(for PlayStation 2 GS support)
907 #include <linux/ps2/dev.h>
908 #include <linux/ps2/gs.h>
913 AC_MSG_RESULT($video_ps2gs)
914 if test x$video_ps2gs = xyes; then
915 CFLAGS="$CFLAGS -DENABLE_PS2GS"
916 VIDEO_SUBDIRS="$VIDEO_SUBDIRS ps2gs"
917 VIDEO_DRIVERS="$VIDEO_DRIVERS ps2gs/libvideo_ps2gs.la"
922 dnl Find the GGI includes
925 AC_ARG_ENABLE(video-ggi,
926 [ --enable-video-ggi use GGI video driver [default=no]],
927 , enable_video_ggi=no)
928 if test x$enable_video = xyes -a x$enable_video_ggi = xyes; then
929 AC_MSG_CHECKING(for GGI support)
938 AC_MSG_RESULT($video_ggi)
939 if test x$video_ggi = xyes; then
940 CFLAGS="$CFLAGS $X_CFLAGS -DENABLE_GGI"
941 SYSTEM_LIBS="$SYSTEM_LIBS -lggi -lgii -lgg"
943 VIDEO_SUBDIRS="$VIDEO_SUBDIRS ggi"
944 VIDEO_DRIVERS="$VIDEO_DRIVERS ggi/libvideo_ggi.la"
949 dnl Find the SVGAlib includes and libraries
952 AC_ARG_ENABLE(video-svga,
953 [ --enable-video-svga use SVGAlib video driver [default=no]],
954 , enable_video_svga=no)
955 if test x$enable_video = xyes -a x$enable_video_svga = xyes; then
956 AC_MSG_CHECKING(for SVGAlib (1.4.0+) support)
960 #include <vgamouse.h>
961 #include <vgakeyboard.h>
963 if ( SCANCODE_RIGHTWIN && SCANCODE_LEFTWIN ) {
969 AC_MSG_RESULT($video_svga)
970 if test x$video_svga = xyes; then
971 CFLAGS="$CFLAGS -DENABLE_SVGALIB"
972 SYSTEM_LIBS="$SYSTEM_LIBS -lvga"
974 VIDEO_SUBDIRS="$VIDEO_SUBDIRS svga"
975 VIDEO_DRIVERS="$VIDEO_DRIVERS svga/libvideo_svga.la"
980 dnl Find the VGL includes and libraries
983 AC_ARG_ENABLE(video-vgl,
984 [ --enable-video-vgl use VGL video driver [default=no]],
985 , enable_video_vgl=no)
986 if test x$enable_video = xyes -a x$enable_video_vgl = xyes; then
987 AC_MSG_CHECKING(for libVGL support)
990 #include <sys/fbio.h>
991 #include <sys/consio.h>
992 #include <sys/kbio.h>
1000 AC_MSG_RESULT($video_vgl)
1001 if test x$video_vgl = xyes; then
1002 CFLAGS="$CFLAGS -DENABLE_VGL"
1003 SYSTEM_LIBS="$SYSTEM_LIBS -lvgl"
1005 VIDEO_SUBDIRS="$VIDEO_SUBDIRS vgl"
1006 VIDEO_DRIVERS="$VIDEO_DRIVERS vgl/libvideo_vgl.la"
1011 dnl Find the AAlib includes
1014 AC_ARG_ENABLE(video-aalib,
1015 [ --enable-video-aalib use AAlib video driver [default=no]],
1016 , enable_video_aalib=no)
1017 if test x$enable_video = xyes -a x$enable_video_aalib = xyes; then
1018 AC_MSG_CHECKING(for AAlib support)
1026 AC_MSG_RESULT($video_aalib)
1027 if test x$video_aalib = xyes; then
1028 CFLAGS="$CFLAGS -DENABLE_AALIB"
1029 SYSTEM_LIBS="$SYSTEM_LIBS -laa"
1031 VIDEO_SUBDIRS="$VIDEO_SUBDIRS aalib"
1032 VIDEO_DRIVERS="$VIDEO_DRIVERS aalib/libvideo_aa.la"
1037 dnl Set up the Atari Xbios driver
1038 CheckAtariXbiosVideo()
1040 AC_ARG_ENABLE(xbios,
1041 [ --enable-video-xbios use Atari Xbios video driver [default=yes]],
1042 , enable_video_xbios=yes)
1044 if test x$enable_video = xyes -a x$enable_video_xbios = xyes; then
1046 CFLAGS="$CFLAGS -DENABLE_XBIOS"
1047 VIDEO_SUBDIRS="$VIDEO_SUBDIRS xbios"
1048 VIDEO_DRIVERS="$VIDEO_DRIVERS xbios/libvideo_xbios.la"
1052 dnl Set up the Atari Gem driver
1053 CheckAtariGemVideo()
1056 [ --enable-video-gem use Atari Gem video driver [default=yes]],
1057 , enable_video_gem=yes)
1058 if test x$enable_video = xyes -a x$enable_video_gem = xyes; then
1060 AC_CHECK_HEADER(gem.h, have_gem_hdr=yes)
1061 AC_CHECK_LIB(gem, appl_init, have_gem_lib=yes)
1062 if test x$have_gem_hdr = xyes -a x$have_gem_lib = xyes; then
1064 CFLAGS="$CFLAGS -DENABLE_GEM"
1065 SYSTEM_LIBS="$SYSTEM_LIBS -lgem"
1066 VIDEO_SUBDIRS="$VIDEO_SUBDIRS gem"
1067 VIDEO_DRIVERS="$VIDEO_DRIVERS gem/libvideo_gem.la"
1072 dnl Set up the Atari Bios keyboard driver
1073 CheckAtariBiosEvent()
1075 CFLAGS="$CFLAGS -I\$(top_srcdir)/src/video/ataricommon"
1076 VIDEO_SUBDIRS="$VIDEO_SUBDIRS ataricommon"
1077 VIDEO_DRIVERS="$VIDEO_DRIVERS ataricommon/libvideo_ataricommon.la"
1080 dnl rcg04172001 Set up the Null video driver.
1083 AC_ARG_ENABLE(video-dummy,
1084 [ --enable-video-dummy use dummy video driver [default=yes]],
1085 , enable_video_dummy=yes)
1086 if test x$enable_video_dummy = xyes; then
1087 CFLAGS="$CFLAGS -DENABLE_DUMMYVIDEO"
1088 VIDEO_SUBDIRS="$VIDEO_SUBDIRS dummy"
1089 VIDEO_DRIVERS="$VIDEO_DRIVERS dummy/libvideo_null.la"
1093 dnl Check to see if OpenGL support is desired
1094 AC_ARG_ENABLE(video-opengl,
1095 [ --enable-video-opengl include OpenGL context creation [default=yes]],
1096 , enable_video_opengl=yes)
1101 if test x$enable_video = xyes -a x$enable_video_opengl = xyes; then
1102 AC_MSG_CHECKING(for OpenGL (GLX) support)
1107 #include <dlfcn.h> /* For loading extensions */
1112 AC_MSG_RESULT($video_opengl)
1113 if test x$video_opengl = xyes; then
1114 CFLAGS="$CFLAGS -DHAVE_OPENGL -DHAVE_OPENGL_X11"
1115 if test x$have_loadso != xyes; then
1116 AC_CHECK_LIB(dl, dlopen, SYSTEM_LIBS="$SYSTEM_LIBS -ldl")
1122 dnl Find QNX RtP OpenGL
1125 if test x$enable_video = xyes -a x$enable_video_opengl = xyes; then
1126 AC_MSG_CHECKING(for OpenGL (Photon) support)
1134 AC_MSG_RESULT($video_opengl)
1135 if test x$video_opengl = xyes; then
1136 CFLAGS="$CFLAGS -DHAVE_OPENGL"
1137 SYSTEM_LIBS="$SYSTEM_LIBS -lGL"
1138 if test x$have_loadso != xyes; then
1139 AC_CHECK_LIB(c, dlopen, SYSTEM_LIBS="$SYSTEM_LIBS", AC_CHECK_LIB(ltdl, dlopen, SYSTEM_LIBS="$SYSTEM_LIBS -lltdl"))
1145 dnl Check for BeOS OpenGL
1148 if test x$enable_video = xyes -a x$enable_video_opengl = xyes; then
1149 CFLAGS="$CFLAGS -DHAVE_OPENGL"
1150 SYSTEM_LIBS="$SYSTEM_LIBS -lGL"
1154 dnl Check for MacOS OpenGL
1157 if test x$enable_video = xyes -a x$enable_video_opengl = xyes; then
1158 CFLAGS="$CFLAGS -DHAVE_OPENGL"
1161 SYSTEM_LIBS="$SYSTEM_LIBS -framework OpenGL"
1162 # The following is probably not available in Darwin:
1163 SYSTEM_LIBS="$SYSTEM_LIBS -framework AGL"
1168 dnl Check for Mesa offscreen rendering
1171 if test "x$enable_video" = "xyes" -a "x$enable_video_opengl" = "xyes"; then
1172 AC_CHECK_HEADER(GL/osmesa.h, have_osmesa_hdr=yes)
1173 AC_CHECK_LIB(OSMesa, OSMesaCreateContext, have_osmesa_lib=yes, have_osmesa_lib=no, -lm)
1175 # Static linking to -lOSMesa
1176 AC_PATH_PROG(OSMESA_CONFIG, osmesa-config, no)
1177 if test "x$OSMESA_CONFIG" = "xno" -o "x$enable_atari_ldg" = "xno"; then
1178 # -lOSMesa is really the static library
1179 if test "x$have_osmesa_hdr" = "xyes" -a "x$have_osmesa_lib" = "xyes"; then
1180 CFLAGS="$CFLAGS -DHAVE_OPENGL"
1181 SYSTEM_LIBS="$SYSTEM_LIBS -lOSMesa"
1184 # -lOSMesa is a loader for OSMesa.ldg
1185 OSMESA_CFLAGS=`$OSMESA_CONFIG --cflags`
1186 OSMESA_LIBS=`$OSMESA_CONFIG --libs`
1187 CFLAGS="$CFLAGS -DHAVE_OPENGL $OSMESA_CFLAGS"
1188 SYSTEM_LIBS="$SYSTEM_LIBS $OSMESA_LIBS"
1191 AC_ARG_ENABLE(osmesa-shared,
1192 [ --enable-osmesa-shared dynamically load OSMesa OpenGL support [default=yes]],
1193 , enable_osmesa_shared=yes)
1194 if test "x$enable_osmesa_shared" = "xyes" -a "x$enable_atari_ldg" = "xyes"; then
1196 if test "x$have_osmesa_hdr" = "xyes"; then
1197 CFLAGS="$CFLAGS -DENABLE_OSMESA_SHARED"
1203 dnl See if we can use the new unified event interface in Linux 2.4
1206 dnl Check for Linux 2.4 unified input event interface support
1207 AC_ARG_ENABLE(input-events,
1208 [ --enable-input-events use Linux 2.4 unified input interface [default=yes]],
1209 , enable_input_events=yes)
1210 if test x$enable_input_events = xyes; then
1211 AC_MSG_CHECKING(for Linux 2.4 unified input interface)
1214 #include <linux/input.h>
1217 #error EVIOCGNAME() ioctl not available
1220 use_input_events=yes
1222 AC_MSG_RESULT($use_input_events)
1223 if test x$use_input_events = xyes; then
1224 CFLAGS="$CFLAGS -DUSE_INPUT_EVENTS"
1229 dnl See if we can use the Touchscreen input library
1232 AC_ARG_ENABLE(input-tslib,
1233 [ --enable-input-tslib use the Touchscreen library for input [default=yes]],
1234 , enable_input_tslib=yes)
1235 if test x$enable_input_tslib = xyes; then
1236 AC_MSG_CHECKING(for Touchscreen library support)
1237 enable_input_tslib=no
1242 enable_input_tslib=yes
1244 AC_MSG_RESULT($enable_input_tslib)
1245 if test x$enable_input_tslib = xyes; then
1246 CFLAGS="$CFLAGS -DHAVE_TSLIB"
1247 SYSTEM_LIBS="$SYSTEM_LIBS -lts"
1252 dnl See if we can use GNU pth library for threads
1255 dnl Check for pth support
1257 [ --enable-pth use GNU pth library for multi-threading [default=yes]],
1259 if test x$enable_threads = xyes -a x$enable_pth = xyes; then
1260 AC_PATH_PROG(PTH_CONFIG, pth-config, no)
1261 if test "$PTH_CONFIG" = "no"; then
1264 PTH_CFLAGS=`$PTH_CONFIG --cflags`
1265 PTH_LIBS=`$PTH_CONFIG --libs --all`
1266 SDL_CFLAGS="$SDL_CFLAGS $PTH_CFLAGS"
1267 SDL_LIBS="$SDL_LIBS $PTH_LIBS"
1268 CFLAGS="$CFLAGS -DENABLE_PTH"
1271 AC_MSG_CHECKING(pth)
1272 if test "x$use_pth" = xyes; then
1280 dnl See what type of thread model to use on Linux and Solaris
1283 dnl Check for pthread support
1284 AC_ARG_ENABLE(pthreads,
1285 [ --enable-pthreads use POSIX threads for multi-threading [default=yes]],
1286 , enable_pthreads=yes)
1287 dnl This is used on Linux for glibc binary compatibility (Doh!)
1288 AC_ARG_ENABLE(pthread-sem,
1289 [ --enable-pthread-sem use pthread semaphores [default=yes]],
1290 , enable_pthread_sem=yes)
1293 pthread_cflags="-D_REENTRANT -D_THREAD_SAFE"
1297 pthread_cflags="-D_THREAD_SAFE"
1298 # causes Carbon.p complaints?
1299 # pthread_cflags="-D_REENTRANT -D_THREAD_SAFE"
1302 pthread_cflags="-D_REENTRANT -D_THREAD_SAFE"
1303 pthread_lib="-pthread"
1306 pthread_cflags="-I/usr/include -D_REENTRANT -D_THREAD_SAFE"
1307 pthread_lib="-L/usr/lib -lpthread"
1310 pthread_cflags="-D_REENTRANT"
1311 pthread_lib="-pthread"
1314 pthread_cflags="-D_REENTRANT"
1315 pthread_lib="-lpthread -lposix4"
1318 pthread_cflags="-D_REENTRANT -Kthread"
1322 pthread_cflags="-D_SGI_MP_SOURCE"
1323 pthread_lib="-lpthread"
1326 pthread_cflags="-D_REENTRANT -mthreads"
1327 pthread_lib="-lpthread"
1330 pthread_cflags="-D_REENTRANT"
1331 pthread_lib="-L/usr/lib -lpthread"
1338 pthread_cflags="-D_REENTRANT"
1339 if test x$ac_cv_prog_gcc = xyes; then
1340 pthread_lib="-lpthread -lrt"
1342 pthread_lib="-lpthread -lexc -lrt"
1346 pthread_cflags="-D_REENTRANT"
1347 pthread_lib="-lpthread"
1350 if test x$enable_threads = xyes -a x$enable_pthreads = xyes -a x$enable_ipod != xyes; then
1351 # Save the original compiler flags and libraries
1352 ac_save_cflags="$CFLAGS"; ac_save_libs="$LIBS"
1353 # Add the pthread compiler flags and libraries
1354 CFLAGS="$CFLAGS $pthread_cflags"; LIBS="$LIBS $pthread_lib"
1355 # Check to see if we have pthread support on this system
1356 AC_MSG_CHECKING(for pthreads)
1359 #include <pthread.h>
1361 pthread_attr_t type;
1362 pthread_attr_init(&type);
1366 AC_MSG_RESULT($use_pthreads)
1367 # Restore the compiler flags and libraries
1368 CFLAGS="$ac_save_cflags"; LIBS="$ac_save_libs"
1369 # Do futher testing if we have pthread support...
1370 if test x$use_pthreads = xyes; then
1371 CFLAGS="$CFLAGS $pthread_cflags -DSDL_USE_PTHREADS"
1372 LIBS="$LIBS $pthread_lib"
1373 SDL_CFLAGS="$SDL_CFLAGS $pthread_cflags"
1374 SDL_LIBS="$SDL_LIBS $pthread_lib"
1376 # Check to see if recursive mutexes are available
1377 AC_MSG_CHECKING(for recursive mutexes)
1378 has_recursive_mutexes=no
1380 #include <pthread.h>
1382 pthread_mutexattr_t attr;
1383 #if defined(linux) && !(defined(__arm__) && defined(QWS))
1384 pthread_mutexattr_setkind_np(&attr, PTHREAD_MUTEX_RECURSIVE_NP);
1386 pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
1389 has_recursive_mutexes=yes
1391 # Some systems have broken recursive mutex implementations
1394 has_recursive_mutexes=no
1397 has_recursive_mutexes=no
1400 AC_MSG_RESULT($has_recursive_mutexes)
1401 if test x$has_recursive_mutexes != xyes; then
1402 CFLAGS="$CFLAGS -DPTHREAD_NO_RECURSIVE_MUTEX"
1405 # Check to see if pthread semaphore support is missing
1406 if test x$enable_pthread_sem = xyes; then
1407 AC_MSG_CHECKING(for pthread semaphores)
1410 #include <pthread.h>
1411 #include <semaphore.h>
1414 have_pthread_sem=yes
1416 AC_MSG_RESULT($have_pthread_sem)
1419 # Check to see if this is broken glibc 2.0 pthreads
1422 AC_MSG_CHECKING(for broken glibc 2.0 pthreads)
1425 #include <features.h>
1426 #if (__GLIBC__ == 2) && (__GLIBC_MINOR__ == 0)
1427 #warning Working around a bug in glibc 2.0 pthreads
1429 #error pthread implementation okay
1430 #endif /* glibc 2.0 */
1433 glibc20_pthreads=yes
1435 AC_MSG_RESULT($glibc20_pthreads)
1440 AC_MSG_CHECKING(whether semun is defined in /usr/include/sys/sem.h)
1443 #include <sys/types.h>
1444 #include <sys/sem.h>
1450 AC_MSG_RESULT($have_semun)
1451 if test x$have_semun = xyes; then
1452 CFLAGS="$CFLAGS -DHAVE_SEMUN"
1455 # See if we can use GNU Pth or clone() on Linux directly
1456 if test x$enable_threads = xyes -a x$use_pthreads != xyes; then
1458 if test x$use_pth != xyes; then
1468 # Note that we need to have either semaphores or to have mutexes and
1469 # condition variables to implement all thread synchronization primitives
1470 CopyUnixThreadSource()
1472 if test x$use_pthreads = xyes -o x$use_clone = xyes; then
1473 # Basic thread creation functions
1474 COPY_ARCH_SRC(src/thread, linux, SDL_systhread.c)
1475 COPY_ARCH_SRC(src/thread, linux, SDL_systhread_c.h)
1478 # We can fake these with mutexes and condition variables if necessary
1479 if test x$use_pthreads = xyes -a x$have_pthread_sem != xyes; then
1480 COPY_ARCH_SRC(src/thread, generic, SDL_syssem.c)
1482 COPY_ARCH_SRC(src/thread, linux, SDL_syssem.c)
1484 COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
1487 # We can fake these with semaphores if necessary
1490 COPY_ARCH_SRC(src/thread, bsdi, SDL_syssem.c)
1491 COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
1492 COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex.c)
1493 COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex_c.h)
1496 if test x$glibc20_pthreads = xyes; then
1497 COPY_ARCH_SRC(src/thread, generic, SDL_sysmutex.c)
1498 COPY_ARCH_SRC(src/thread, generic, SDL_sysmutex_c.h)
1500 COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex.c)
1501 COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex_c.h)
1506 # Condition variables
1507 # We can fake these with semaphores and mutexes if necessary
1508 if test x$glibc20_pthreads = xyes -o x$has_recursive_mutexes != xyes; then
1509 COPY_ARCH_SRC(src/thread, generic, SDL_syscond.c)
1511 COPY_ARCH_SRC(src/thread, linux, SDL_syscond.c)
1513 COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
1515 elif test x$use_pth = xyes; then
1516 COPY_ARCH_SRC(src/thread, pth, SDL_systhread.c)
1517 COPY_ARCH_SRC(src/thread, pth, SDL_systhread_c.h)
1518 COPY_ARCH_SRC(src/thread, pth, SDL_sysmutex.c)
1519 COPY_ARCH_SRC(src/thread, pth, SDL_sysmutex_c.h)
1520 COPY_ARCH_SRC(src/thread, pth, SDL_syscond.c)
1521 COPY_ARCH_SRC(src/thread, pth, SDL_syscond_c.h)
1522 COPY_ARCH_SRC(src/thread, generic, SDL_syssem.c)
1523 COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
1526 *** No thread support detected
1531 dnl See if we can use sigaction() instead of signal()
1534 dnl Check for sigaction support
1535 AC_ARG_ENABLE(sigaction,
1536 [ --enable-sigaction use sigaction instead of signal [default=yes]],
1537 , enable_sigaction=yes)
1538 if test x$enable_sigaction = xyes; then
1539 AC_MSG_CHECKING(sigaction)
1544 struct sigaction junk;
1545 sigaction(0, &junk, &junk);
1549 AC_MSG_RESULT($have_sigaction)
1550 if test x$have_sigaction = xyes; then
1551 CFLAGS="$CFLAGS -DHAVE_SIGACTION"
1556 dnl Determine whether the compiler can produce Win32 executables
1559 AC_MSG_CHECKING(Win32 compiler)
1562 #include <windows.h>
1567 AC_MSG_RESULT($have_win32_gcc)
1568 if test x$have_win32_gcc != xyes; then
1570 *** Your compiler ($CC) does not produce Win32 executables!
1574 dnl See if the user wants to redirect standard output to files
1575 AC_ARG_ENABLE(stdio-redirect,
1576 [ --enable-stdio-redirect Redirect STDIO to files on Win32 [default=yes]],
1577 , enable_stdio_redirect=yes)
1578 if test x$enable_stdio_redirect != xyes; then
1579 CFLAGS="$CFLAGS -DNO_STDIO_REDIRECT"
1583 dnl Find the DirectX includes and libraries
1586 AC_ARG_ENABLE(directx,
1587 [ --enable-directx use DirectX for Win32 audio/video [default=yes]],
1588 , enable_directx=yes)
1589 if test x$enable_directx = xyes; then
1590 AC_MSG_CHECKING(for DirectX headers and libraries)
1593 CFLAGS="$CFLAGS -I$srcdir"
1595 #include "src/video/windx5/directx.h"
1601 AC_MSG_RESULT($use_directx)
1604 CFLAGS="$CFLAGS -I\$(top_srcdir)/src/video/wincommon"
1605 SYSTEM_LIBS="$SYSTEM_LIBS -luser32 -lgdi32 -lwinmm"
1606 VIDEO_SUBDIRS="$VIDEO_SUBDIRS wincommon"
1607 VIDEO_DRIVERS="$VIDEO_DRIVERS wincommon/libvideo_wincommon.la"
1608 # Enable the DIB driver
1609 CFLAGS="$CFLAGS -DENABLE_WINDIB"
1610 VIDEO_SUBDIRS="$VIDEO_SUBDIRS windib"
1611 VIDEO_DRIVERS="$VIDEO_DRIVERS windib/libvideo_windib.la"
1612 # See if we should enable the DirectX driver
1613 if test x$use_directx = xyes; then
1614 CFLAGS="$CFLAGS -DENABLE_DIRECTX"
1615 SYSTEM_LIBS="$SYSTEM_LIBS -ldxguid"
1616 VIDEO_SUBDIRS="$VIDEO_SUBDIRS windx5"
1617 VIDEO_DRIVERS="$VIDEO_DRIVERS windx5/libvideo_windx5.la"
1621 dnl Set up the BWindow video driver on BeOS
1624 CFLAGS="$CFLAGS -DENABLE_BWINDOW"
1625 VIDEO_SUBDIRS="$VIDEO_SUBDIRS bwindow"
1626 VIDEO_DRIVERS="$VIDEO_DRIVERS bwindow/libvideo_bwindow.la"
1629 dnl Set up the QTopia video driver if enabled
1632 AC_ARG_ENABLE(video-qtopia,
1633 [ --enable-video-qtopia use Qtopia video driver [default=no]],
1634 , enable_video_qtopia=no)
1635 if test x$enable_video = xyes -a x$enable_video_qtopia = xyes; then
1636 AC_MSG_CHECKING(for Qtopia support)
1640 CXXFLAGS="-DQT_QWS_EBX -fno-rtti -fno-exceptions -DQT_QWS_CUSTOM -DQWS -I${QPEDIR}/include -I${QTDIR}/include/ -DNO_DEBUG"
1642 #include <qpe/qpeapplication.h>
1648 AC_MSG_RESULT($video_qtopia)
1649 if test x$video_qtopia = xyes; then
1650 CFLAGS="$CFLAGS -DENABLE_QTOPIA -DQT_QWS_EBX -DQT_QWS_CUSTOM -DQWS -I${QPEDIR}/include -I${QTDIR}/include/ -DNO_DEBUG -fno-rtti -fno-exceptions"
1651 SDL_LIBS="$SDL_LIBS -L${QPEDIR}/lib -L${QTDIR}/lib/ -lqpe -lqte"
1652 SDL_CFLAGS="$SDL_CFLAGS -DQWS"
1653 VIDEO_SUBDIRS="$VIDEO_SUBDIRS qtopia"
1654 VIDEO_DRIVERS="$VIDEO_DRIVERS qtopia/libvideo_qtopia.la"
1657 *** Failed to find Qtopia includes. Make sure that the QTDIR and QPEDIR
1658 *** environment variables are set correctly.])
1664 dnl Set up the wscons video driver if enabled
1667 AC_ARG_ENABLE(video-wscons,
1668 [ --enable-video-wscons use wscons video driver [default=no]],
1669 , enable_video_wscons=no)
1670 if test x$enable_video = xyes -a x$enable_video_wscons = xyes; then
1671 AC_MSG_CHECKING(for wscons support)
1675 #include <sys/time.h>
1676 #include <dev/wscons/wsconsio.h>
1681 AC_MSG_RESULT($video_wscons)
1682 if test x$video_wscons = xyes; then
1683 CFLAGS="$CFLAGS -DENABLE_WSCONS"
1684 VIDEO_SUBDIRS="$VIDEO_SUBDIRS wscons"
1685 VIDEO_DRIVERS="$VIDEO_DRIVERS wscons/libvideo_wscons.la"
1688 *** Failed to find wscons includes.])
1695 dnl Set up the PicoGUI video driver if enabled
1698 AC_ARG_ENABLE(video-picogui,
1699 [ --enable-video-picogui use PicoGUI video driver [default=no]],
1700 , enable_video_picogui=no)
1701 if test x$enable_video = xyes -a x$enable_video_picogui = xyes; then
1702 AC_MSG_CHECKING(for PicoGUI support)
1705 #include <picogui.h>
1710 AC_MSG_RESULT($video_picogui)
1711 if test x$video_picogui = xyes; then
1712 SDL_LIBS="$SDL_LIBS -lpgui"
1713 CFLAGS="$CFLAGS -DENABLE_PICOGUI"
1714 VIDEO_SUBDIRS="$VIDEO_SUBDIRS picogui"
1715 VIDEO_DRIVERS="$VIDEO_DRIVERS picogui/libvideo_picogui.la"
1721 dnl Set up the Mac toolbox video driver for Mac OS 7-9
1724 CFLAGS="$CFLAGS -DENABLE_TOOLBOX -DENABLE_DRAWSPROCKET"
1725 VIDEO_SUBDIRS="$VIDEO_SUBDIRS maccommon"
1726 VIDEO_DRIVERS="$VIDEO_DRIVERS maccommon/libvideo_maccommon.la"
1727 VIDEO_SUBDIRS="$VIDEO_SUBDIRS macrom"
1728 VIDEO_DRIVERS="$VIDEO_DRIVERS macrom/libvideo_macrom.la"
1729 VIDEO_SUBDIRS="$VIDEO_SUBDIRS macdsp"
1730 VIDEO_DRIVERS="$VIDEO_DRIVERS macdsp/libvideo_macdsp.la"
1733 dnl Set up the Carbon/QuickDraw video driver for Mac OS X (but not Darwin)
1736 AC_ARG_ENABLE(video-carbon,
1737 [ --enable-video-carbon use Carbon/QuickDraw video driver [default=no]],
1738 , enable_video_carbon=no)
1739 if test x$enable_video = xyes -a x$enable_video_carbon = xyes; then
1740 AC_MSG_CHECKING(for Carbon framework)
1742 if test x$have_carbon != xyes; then
1744 #include <Carbon/Carbon.h>
1750 AC_MSG_RESULT($have_carbon)
1751 if test x$have_carbon = xyes; then
1752 # "MACOSX" is not an official definition, but it's commonly
1753 # accepted as a way to differentiate between what runs on X
1754 # and what runs on older Macs - while in theory "Carbon" defns
1755 # are consistent between the two, in practice Carbon is still
1756 # changing. -sts Aug 2000
1757 mac_autoconf_target_workaround="MAC"
1758 CFLAGS="$CFLAGS -I/System/Library/Frameworks/Carbon.framework/Headers \
1759 -fpascal-strings -DENABLE_TOOLBOX -DMACOSX -DTARGET_API_${mac_autoconf_target_workaround}_CARBON=1 -I\$(top_srcdir)/src/video/maccommon -I\$(top_srcdir)/src/video/macrom -I\$(top_srcdir)/src/video/macdsp"
1760 VIDEO_SUBDIRS="$VIDEO_SUBDIRS maccommon"
1761 VIDEO_DRIVERS="$VIDEO_DRIVERS maccommon/libvideo_maccommon.la"
1762 VIDEO_SUBDIRS="$VIDEO_SUBDIRS macrom"
1763 VIDEO_DRIVERS="$VIDEO_DRIVERS macrom/libvideo_macrom.la"
1764 #VIDEO_SUBDIRS="$VIDEO_SUBDIRS macdsp"
1765 #VIDEO_DRIVERS="$VIDEO_DRIVERS macdsp/libvideo_macdsp.la"
1770 dnl Set up the Cocoa/Quartz video driver for Mac OS X (but not Darwin)
1773 AC_ARG_ENABLE(video-cocoa,
1774 [ --enable-video-cocoa use Cocoa/Quartz video driver [default=yes]],
1775 , enable_video_cocoa=yes)
1776 if test x$enable_video = xyes -a x$enable_video_cocoa = xyes; then
1777 old_CFLAGS="$CFLAGS"
1778 dnl work around that we don't have Objective-C support in autoconf
1779 CFLAGS="$CFLAGS -x objective-c"
1780 AC_MSG_CHECKING(for Cocoa framework)
1782 if test x$have_cocoa != xyes; then
1784 #import <Cocoa/Cocoa.h>
1790 AC_MSG_RESULT($have_cocoa)
1791 CFLAGS="$old_CFLAGS"
1792 if test x$have_cocoa = xyes; then
1793 # "MACOSX" is not an official definition, but it's commonly
1794 # accepted as a way to differentiate between what runs on X
1795 # and what runs on older Macs - while in theory "Carbon" defns
1796 # are consistent between the two, in practice Carbon is still
1797 # changing. -sts Aug 2000
1798 mac_autoconf_target_workaround="MAC"
1799 CFLAGS="$CFLAGS -I/System/Library/Frameworks/Carbon.framework/Headers \
1800 -I/System/Library/Frameworks/Cocoa.framework/Headers -fpascal-strings \
1801 -DENABLE_QUARTZ -DMACOSX -DTARGET_API_${mac_autoconf_target_workaround}_CARBON=1 -I\$(top_srcdir)/src/video/quartz"
1802 VIDEO_SUBDIRS="$VIDEO_SUBDIRS quartz"
1803 VIDEO_DRIVERS="$VIDEO_DRIVERS quartz/libvideo_quartz.la"
1808 dnl Check for the dlfcn.h interface for dynamically loading objects
1811 AC_ARG_ENABLE(sdl-dlopen,
1812 [ --enable-sdl-dlopen use dlopen for shared object loading [default=yes]],
1813 , enable_sdl_dlopen=yes)
1814 if test x$enable_sdl_dlopen = xyes; then
1815 AC_MSG_CHECKING(for dlopen)
1823 AC_MSG_RESULT($have_loadso)
1825 if test x$have_loadso = xyes; then
1826 CFLAGS="$CFLAGS -DUSE_DLOPEN"
1827 AC_CHECK_LIB(c, dlopen, SYSTEM_LIBS="$SYSTEM_LIBS",
1828 AC_CHECK_LIB(dl, dlopen, SYSTEM_LIBS="$SYSTEM_LIBS -ldl",
1829 AC_CHECK_LIB(ltdl, dlopen, SYSTEM_LIBS="$SYSTEM_LIBS -lltdl")))
1834 dnl Set up the Atari LDG (shared object loader)
1837 AC_ARG_ENABLE(atari-ldg,
1838 [ --enable-atari-ldg use Atari LDG for shared object loading [default=yes]],
1839 , enable_atari_ldg=yes)
1840 if test x$video_gem = xyes -a x$enable_atari_ldg = xyes; then
1841 AC_CHECK_HEADER(ldg.h, have_ldg_hdr=yes)
1842 AC_CHECK_LIB(ldg, ldg_open, have_ldg_lib=yes, have_ldg_lib=no, -lgem)
1843 if test x$have_ldg_hdr = xyes -a x$have_ldg_lib = xyes; then
1845 CFLAGS="$CFLAGS -DENABLE_LDG"
1846 SYSTEM_LIBS="$SYSTEM_LIBS -lldg -lgem"
1851 dnl Check for the usbhid(3) library on *BSD
1854 if test x$enable_joystick = xyes; then
1857 AC_CHECK_LIB(usbhid, hid_init, have_libusbhid=yes)
1858 AC_CHECK_LIB(usb, hid_init, have_libusb=yes)
1859 if test x$have_libusbhid = xyes; then
1860 SYSTEM_LIBS="$SYSTEM_LIBS -lusbhid"
1862 if test x$have_libusb = xyes; then
1863 SYSTEM_LIBS="$SYSTEM_LIBS -lusb"
1866 AC_CHECK_HEADER(usb.h, have_usb_h=yes)
1867 AC_CHECK_HEADER(usbhid.h, have_usbhid_h=yes)
1868 AC_CHECK_HEADER(libusb.h, have_libusb_h=yes)
1869 AC_CHECK_HEADER(libusbhid.h, have_libusbhid_h=yes)
1870 if test x$have_usb_h = xyes; then
1871 CFLAGS="$CFLAGS -DHAVE_USB_H"
1873 if test x$have_usbhid_h = xyes; then
1874 CFLAGS="$CFLAGS -DHAVE_USBHID_H"
1876 if test x$have_libusb_h = xyes; then
1877 CFLAGS="$CFLAGS -DHAVE_LIBUSB_H"
1879 if test x$have_libusbhid_h = xyes; then
1880 CFLAGS="$CFLAGS -DHAVE_LIBUSBHID_H"
1883 AC_MSG_CHECKING(for usbhid)
1886 #include <sys/types.h>
1887 #if defined(HAVE_USB_H)
1890 #include <dev/usb/usb.h>
1891 #include <dev/usb/usbhid.h>
1892 #if defined(HAVE_USBHID_H)
1894 #elif defined(HAVE_LIBUSB_H)
1896 #elif defined(HAVE_LIBUSBHID_H)
1897 #include <libusbhid.h>
1900 struct report_desc *repdesc;
1901 struct usb_ctl_report *repbuf;
1906 AC_MSG_RESULT($have_usbhid)
1908 if test x$have_usbhid = xyes; then
1909 AC_MSG_CHECKING(for ucr_data member of usb_ctl_report)
1910 have_usbhid_ucr_data=no
1912 #include <sys/types.h>
1913 #if defined(HAVE_USB_H)
1916 #include <dev/usb/usb.h>
1917 #include <dev/usb/usbhid.h>
1918 #if defined(HAVE_USBHID_H)
1920 #elif defined(HAVE_LIBUSB_H)
1922 #elif defined(HAVE_LIBUSBHID_H)
1923 #include <libusbhid.h>
1926 struct usb_ctl_report buf;
1927 if (buf.ucr_data) { }
1929 have_usbhid_ucr_data=yes
1931 if test x$have_usbhid_ucr_data = xyes; then
1932 CFLAGS="$CFLAGS -DUSBHID_UCR_DATA"
1934 AC_MSG_RESULT($have_usbhid_ucr_data)
1936 AC_MSG_CHECKING(for new usbhid API)
1939 #include <sys/types.h>
1940 #if defined(HAVE_USB_H)
1943 #include <dev/usb/usb.h>
1944 #include <dev/usb/usbhid.h>
1945 #if defined(HAVE_USBHID_H)
1947 #elif defined(HAVE_LIBUSB_H)
1949 #elif defined(HAVE_LIBUSBHID_H)
1950 #include <libusbhid.h>
1954 hid_start_parse(d, 1, 1);
1958 if test x$have_usbhid_new = xyes; then
1959 CFLAGS="$CFLAGS -DUSBHID_NEW"
1961 AC_MSG_RESULT($have_usbhid_new)
1963 JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS bsd"
1964 JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS bsd/libjoystick_bsd.la"
1969 dnl Check for altivec instruction support using gas syntax
1972 have_altivec_h_hdr=no
1973 AC_CHECK_HEADER(altivec.h, have_altivec_h_hdr=yes)
1975 save_CFLAGS="${CFLAGS}"
1977 AC_MSG_CHECKING(for Altivec with GCC -maltivec option)
1978 CFLAGS="${save_CFLAGS} -DGCC_ALTIVEC -DUSE_ALTIVEC_BLITTERS -maltivec"
1980 if test x$have_altivec_h_hdr = xyes; then
1982 #include <altivec.h>
1983 vector unsigned int vzero() {
1984 return vec_splat_u32(0);
1988 have_gcc_altivec=yes
1990 AC_MSG_RESULT($have_gcc_altivec)
1993 vector unsigned int vzero() {
1994 return vec_splat_u32(0);
1998 have_gcc_altivec=yes
2000 AC_MSG_RESULT($have_gcc_altivec)
2003 if test x$have_gcc_altivec = xno; then
2004 AC_MSG_CHECKING(for Altivec with GCC -faltivec option)
2005 CFLAGS="${save_CFLAGS} -DGCC_ALTIVEC -DUSE_ALTIVEC_BLITTERS -faltivec"
2006 if test x$have_altivec_h_hdr = xyes; then
2008 #include <altivec.h>
2009 vector unsigned int vzero() {
2010 return vec_splat_u32(0);
2014 have_gcc_altivec=yes
2016 AC_MSG_RESULT($have_gcc_altivec)
2019 vector unsigned int vzero() {
2020 return vec_splat_u32(0);
2024 have_gcc_altivec=yes
2026 AC_MSG_RESULT($have_gcc_altivec)
2030 if test x$have_gcc_altivec = xno; then
2031 CFLAGS="${save_CFLAGS}"
2033 if test x$have_altivec_h_hdr = xyes; then
2034 CFLAGS="${CFLAGS} -DHAVE_ALTIVEC_H"
2039 dnl Check for a valid linux/version.h
2042 AC_CHECK_HEADER(linux/version.h, have_linux_version_h=yes)
2043 if test x$have_linux_version_h = xyes; then
2044 CFLAGS="$CFLAGS -DHAVE_LINUX_VERSION_H"
2048 dnl Check if we want to use RPATH
2051 AC_ARG_ENABLE(rpath,
2052 [ --enable-rpath use an rpath when linking SDL [default=yes]],
2062 # Set up files for the timer library
2063 if test x$enable_timers = xyes; then
2064 COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
2067 *-*-linux*|*-*-gnu*|*-*-k*bsd*-gnu)
2069 *-*-linux*) ARCH=linux ;;
2070 *-*-kfreebsd*-gnu) ARCH=kfreebsd-gnu ;;
2071 *-*-knetbsd*-gnu) ARCH=knetbsd-gnu ;;
2072 *-*-kopenbsd*-gnu) ARCH=kopenbsd-gnu ;;
2073 *-*-gnu*) ARCH=gnu ;; # must be last
2104 # Set up files for the main() stub
2105 if test "x$video_qtopia" = "xyes"; then
2106 SDL_CFLAGS="$SDL_CFLAGS -Dmain=SDL_main"
2107 SDL_LIBS="-lSDLmain $SDL_LIBS"
2109 # Set up files for the audio library
2110 # We use the OSS and ALSA API's, not the Sun audio API
2111 #if test x$enable_audio = xyes; then
2112 # CFLAGS="$CFLAGS -DSUNAUDIO_SUPPORT"
2113 # AUDIO_SUBDIRS="$AUDIO_SUBDIRS sun"
2114 # AUDIO_DRIVERS="$AUDIO_DRIVERS sun/libaudio_sun.la"
2116 # Set up files for the joystick library
2117 if test x$enable_joystick = xyes; then
2120 JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS linux"
2121 JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS linux/libjoystick_linux.la"
2124 JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS dummy"
2125 JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS dummy/libjoystick_dummy.la"
2128 JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS bsd"
2129 JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS bsd/libjoystick_bsd.la"
2133 # Set up files for the cdrom library
2134 if test x$enable_cdrom = xyes; then
2137 CDROM_SUBDIRS="$CDROM_SUBDIRS linux"
2138 CDROM_DRIVERS="$CDROM_DRIVERS linux/libcdrom_linux.la"
2141 CDROM_SUBDIRS="$CDROM_SUBDIRS dummy"
2142 CDROM_DRIVERS="$CDROM_DRIVERS dummy/libcdrom_dummy.la"
2145 CDROM_SUBDIRS="$CDROM_SUBDIRS freebsd"
2146 CDROM_DRIVERS="$CDROM_DRIVERS freebsd/libcdrom_freebsd.la"
2148 knetbsd-gnu|kopenbsd-gnu)
2149 CDROM_SUBDIRS="$CDROM_SUBDIRS openbsd"
2150 CDROM_DRIVERS="$CDROM_DRIVERS openbsd/libcdrom_openbsd.la"
2154 # Set up files for the thread library
2155 if test x$enable_threads = xyes; then
2156 CopyUnixThreadSource
2158 # Set up files for the timer library
2159 if test x$enable_timers = xyes; then
2160 COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
2181 # Set up files for the audio library
2182 # We use the OSS and ALSA API's, not the Sun audio API
2183 #if test x$enable_audio = xyes; then
2184 # CFLAGS="$CFLAGS -DSUNAUDIO_SUPPORT"
2185 # AUDIO_SUBDIRS="$AUDIO_SUBDIRS sun"
2186 # AUDIO_DRIVERS="$AUDIO_DRIVERS sun/libaudio_sun.la"
2188 # Set up files for the joystick library
2189 # (No joystick support yet)
2190 if test x$enable_joystick = xyes; then
2191 JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS dummy"
2192 JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS dummy/libjoystick_dummy.la"
2194 # Set up files for the cdrom library
2195 if test x$enable_cdrom = xyes; then
2196 CDROM_SUBDIRS="$CDROM_SUBDIRS bsdi"
2197 CDROM_DRIVERS="$CDROM_DRIVERS bsdi/libcdrom_bsdi.la"
2199 # Set up files for the thread library
2200 if test x$enable_threads = xyes; then
2201 CopyUnixThreadSource
2203 # Set up files for the timer library
2204 if test x$enable_timers = xyes; then
2205 COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
2228 # Set up files for the audio library
2229 # We use the OSS and ALSA API's, not the Sun audio API
2230 #if test x$enable_audio = xyes; then
2231 # CFLAGS="$CFLAGS -DSUNAUDIO_SUPPORT"
2232 # AUDIO_SUBDIRS="$AUDIO_SUBDIRS sun"
2233 # AUDIO_DRIVERS="$AUDIO_DRIVERS sun/libaudio_sun.la"
2235 # Set up files for the cdrom library
2236 if test x$enable_cdrom = xyes; then
2237 CDROM_SUBDIRS="$CDROM_SUBDIRS freebsd"
2238 CDROM_DRIVERS="$CDROM_DRIVERS freebsd/libcdrom_freebsd.la"
2240 # Set up files for the thread library
2241 if test x$enable_threads = xyes; then
2242 CopyUnixThreadSource
2244 # Set up files for the timer library
2245 if test x$enable_timers = xyes; then
2246 COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
2267 # Set up files for the audio library
2268 if test x$enable_audio = xyes; then
2269 CFLAGS="$CFLAGS -DSUNAUDIO_SUPPORT"
2270 AUDIO_SUBDIRS="$AUDIO_SUBDIRS sun"
2271 AUDIO_DRIVERS="$AUDIO_DRIVERS sun/libaudio_sun.la"
2273 # Set up files for the cdrom library
2274 if test x$enable_cdrom = xyes; then
2275 CDROM_SUBDIRS="$CDROM_SUBDIRS openbsd"
2276 CDROM_DRIVERS="$CDROM_DRIVERS openbsd/libcdrom_openbsd.la"
2278 # Set up files for the thread library
2279 if test x$enable_threads = xyes; then
2280 if test x$use_pthreads = xyes; then
2281 CFLAGS="$CFLAGS -D_POSIX_THREAD_SYSCALL_SOFT=1"
2283 CopyUnixThreadSource
2285 # Set up files for the timer library
2286 if test x$enable_timers = xyes; then
2287 COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
2289 # NetBSD does not define "unix"
2290 CFLAGS="$CFLAGS -Dunix"
2309 # Set up files for the audio library
2310 if test x$enable_audio = xyes; then
2311 CFLAGS="$CFLAGS -DOPENBSD_AUDIO_SUPPORT"
2312 AUDIO_SUBDIRS="$AUDIO_SUBDIRS openbsd"
2313 AUDIO_DRIVERS="$AUDIO_DRIVERS openbsd/libaudio_openbsd.la"
2315 # OpenBSD needs linking with ossaudio emulation library
2316 if test x$have_oss = xyes; then
2317 SYSTEM_LIBS="$SYSTEM_LIBS -lossaudio"
2319 # Set up files for the cdrom library
2320 if test x$enable_cdrom = xyes; then
2321 CDROM_SUBDIRS="$CDROM_SUBDIRS openbsd"
2322 CDROM_DRIVERS="$CDROM_DRIVERS openbsd/libcdrom_openbsd.la"
2324 # Set up files for the thread library
2325 if test x$enable_threads = xyes; then
2326 CopyUnixThreadSource
2328 # Set up files for the timer library
2329 if test x$enable_timers = xyes; then
2330 COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
2332 # OpenBSD does not define "unix"
2333 CFLAGS="$CFLAGS -Dunix"
2351 # Set up files for the audio library
2352 if test x$enable_audio = xyes; then
2353 CFLAGS="$CFLAGS -DSUNAUDIO_SUPPORT"
2354 AUDIO_SUBDIRS="$AUDIO_SUBDIRS sun"
2355 AUDIO_DRIVERS="$AUDIO_DRIVERS sun/libaudio_sun.la"
2357 # Set up files for the joystick library
2358 # (No joystick support yet)
2359 if test x$enable_joystick = xyes; then
2360 JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS dummy"
2361 JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS dummy/libjoystick_dummy.la"
2363 # Set up files for the cdrom library
2364 if test x$enable_cdrom = xyes; then
2365 CDROM_SUBDIRS="$CDROM_SUBDIRS dummy"
2366 CDROM_DRIVERS="$CDROM_DRIVERS dummy/libcdrom_dummy.la"
2368 # Set up files for the thread library
2369 if test x$enable_threads = xyes; then
2370 CopyUnixThreadSource
2372 # Set up files for the timer library
2373 if test x$enable_timers = xyes; then
2374 COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
2379 CFLAGS="$CFLAGS -D__ELF__" # Fix for nasm on Solaris x86
2394 # Set up files for the audio library
2395 if test x$enable_audio = xyes; then
2396 CFLAGS="$CFLAGS -DSUNAUDIO_SUPPORT"
2397 AUDIO_SUBDIRS="$AUDIO_SUBDIRS sun"
2398 AUDIO_DRIVERS="$AUDIO_DRIVERS sun/libaudio_sun.la"
2400 # Set up files for the joystick library
2401 # (No joystick support yet)
2402 if test x$enable_joystick = xyes; then
2403 JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS dummy"
2404 JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS dummy/libjoystick_dummy.la"
2406 # Set up files for the cdrom library
2407 if test x$enable_cdrom = xyes; then
2408 CDROM_SUBDIRS="$CDROM_SUBDIRS linux"
2409 CDROM_DRIVERS="$CDROM_DRIVERS linux/libcdrom_linux.la"
2411 # Set up files for the thread library
2412 if test x$enable_threads = xyes; then
2413 CopyUnixThreadSource
2415 # Set up files for the timer library
2416 if test x$enable_timers = xyes; then
2417 COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
2433 # We use the dmedia audio API, not the Sun audio API
2434 #if test x$enable_audio = xyes; then
2435 # CFLAGS="$CFLAGS -DSUNAUDIO_SUPPORT"
2436 # AUDIO_SUBDIRS="$AUDIO_SUBDIRS sun"
2437 # AUDIO_DRIVERS="$AUDIO_DRIVERS sun/libaudio_sun.la"
2439 # Set up files for the joystick library
2440 # (No joystick support yet)
2441 if test x$enable_joystick = xyes; then
2442 JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS dummy"
2443 JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS dummy/libjoystick_dummy.la"
2445 # Set up files for the cdrom library
2446 # (No CD-ROM support yet)
2447 if test x$enable_cdrom = xyes; then
2448 CDROM_SUBDIRS="$CDROM_SUBDIRS dummy"
2449 CDROM_DRIVERS="$CDROM_DRIVERS dummy/libcdrom_dummy.la"
2451 # Set up files for the thread library
2452 if test x$enable_threads = xyes; then
2453 if test x$use_pthreads = xyes -o x$use_pth = xyes; then
2454 CopyUnixThreadSource
2456 COPY_ARCH_SRC(src/thread, irix, SDL_systhread.c)
2457 COPY_ARCH_SRC(src/thread, irix, SDL_systhread_c.h)
2458 COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex.c)
2459 COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex_c.h)
2460 COPY_ARCH_SRC(src/thread, linux, SDL_syssem.c)
2461 COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
2462 COPY_ARCH_SRC(src/thread, generic, SDL_syscond.c)
2463 COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
2466 # Set up files for the timer library
2467 if test x$enable_timers = xyes; then
2468 COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
2484 # Set up files for the audio library
2485 if test x$enable_audio = xyes; then
2486 CFLAGS="$CFLAGS -DSUNAUDIO_SUPPORT"
2487 AUDIO_SUBDIRS="$AUDIO_SUBDIRS sun"
2488 AUDIO_DRIVERS="$AUDIO_DRIVERS sun/libaudio_sun.la"
2490 # Set up files for the joystick library
2491 # (No joystick support yet)
2492 if test x$enable_joystick = xyes; then
2493 JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS dummy"
2494 JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS dummy/libjoystick_dummy.la"
2496 # Set up files for the cdrom library
2497 # (No CD-ROM support yet)
2498 if test x$enable_cdrom = xyes; then
2499 CDROM_SUBDIRS="$CDROM_SUBDIRS dummy"
2500 CDROM_DRIVERS="$CDROM_DRIVERS dummy/libcdrom_dummy.la"
2502 # Set up files for the thread library
2503 if test x$enable_threads = xyes; then
2504 CopyUnixThreadSource
2506 # Set up files for the timer library
2507 if test x$enable_timers = xyes; then
2508 COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
2524 # Set up files for the audio library
2525 if test x$enable_audio = xyes; then
2526 AUDIO_SUBDIRS="$AUDIO_SUBDIRS paudio"
2527 AUDIO_DRIVERS="$AUDIO_DRIVERS paudio/libaudio_paudio.la"
2529 # Set up files for the joystick library
2530 # (No joystick support yet)
2531 if test x$enable_joystick = xyes; then
2532 JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS dummy"
2533 JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS dummy/libjoystick_dummy.la"
2535 # Set up files for the cdrom library
2536 if test x$enable_cdrom = xyes; then
2537 CDROM_SUBDIRS="$CDROM_SUBDIRS aix"
2538 CDROM_DRIVERS="$CDROM_DRIVERS aix/libcdrom_aix.la"
2540 # Set up files for the thread library
2541 if test x$enable_threads = xyes; then
2542 CopyUnixThreadSource
2544 # Set up files for the timer library
2545 if test x$enable_timers = xyes; then
2546 COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
2561 # Set up files for the audio library
2562 if test x$enable_audio = xyes; then
2563 CFLAGS="$CFLAGS -I/usr/include/mme -DMMEAUDIO_SUPPORT"
2564 SYSTEM_LIBS="$SYSTEM_LIBS -lmme"
2565 AUDIO_SUBDIRS="$AUDIO_SUBDIRS mme"
2566 AUDIO_DRIVERS="$AUDIO_DRIVERS mme/libaudio_mme.la"
2568 # Set up files for the joystick library
2569 # (No joystick support yet)
2570 if test x$enable_joystick = xyes; then
2571 JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS dummy"
2572 JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS dummy/libjoystick_dummy.la"
2574 # Set up files for the cdrom library
2575 # (No cdrom support yet)
2576 if test x$enable_cdrom = xyes; then
2577 CDROM_SUBDIRS="$CDROM_SUBDIRS osf"
2578 CDROM_DRIVERS="$CDROM_DRIVERS osf/libcdrom_osf.la"
2580 # Set up files for the thread library
2581 if test x$enable_threads = xyes; then
2582 CopyUnixThreadSource
2584 # Set up files for the timer library
2585 if test x$enable_timers = xyes; then
2586 COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
2601 # Set up files for the audio library
2602 if test x$enable_audio = xyes; then
2603 CFLAGS="$CFLAGS -DQNXNTOAUDIO_SUPPORT"
2604 SYSTEM_LIBS="$SYSTEM_LIBS -lasound"
2605 AUDIO_SUBDIRS="$AUDIO_SUBDIRS nto"
2606 AUDIO_DRIVERS="$AUDIO_DRIVERS nto/libaudio_nto.la"
2608 # Set up files for the joystick library
2609 if test x$enable_joystick = xyes; then
2610 # (No joystick support yet)
2611 JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS dummy"
2612 JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS dummy/libjoystick_dummy.la"
2614 # Set up files for the cdrom library
2615 if test x$enable_cdrom = xyes; then
2616 CDROM_SUBDIRS="$CDROM_SUBDIRS qnx"
2617 CDROM_DRIVERS="$CDROM_DRIVERS qnx/libcdrom_qnx.la"
2619 # Set up files for the thread library
2620 if test x$enable_threads = xyes; then
2621 CopyUnixThreadSource
2623 # Set up files for the timer library
2624 if test x$enable_timers = xyes; then
2625 COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
2628 *-*-cygwin* | *-*-mingw32*)
2631 if test "$build" != "$target"; then # cross-compiling
2632 # Default cross-compile location
2633 ac_default_prefix=/usr/local/cross-tools/i386-mingw32msvc
2635 # Look for the location of the tools and install there
2636 if test "$BUILD_PREFIX" != ""; then
2637 ac_default_prefix=$BUILD_PREFIX
2645 # Set up files for the audio library
2646 if test x$enable_audio = xyes; then
2647 AUDIO_SUBDIRS="$AUDIO_SUBDIRS windib"
2648 AUDIO_DRIVERS="$AUDIO_DRIVERS windib/libaudio_windib.la"
2649 if test x$use_directx = xyes; then
2650 AUDIO_SUBDIRS="$AUDIO_SUBDIRS windx5"
2651 AUDIO_DRIVERS="$AUDIO_DRIVERS windx5/libaudio_windx5.la"
2654 # Set up files for the joystick library
2655 if test x$enable_joystick = xyes; then
2656 JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS win32"
2657 JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS win32/libjoystick_winmm.la"
2659 # Set up files for the cdrom library
2660 if test x$enable_cdrom = xyes; then
2661 CDROM_SUBDIRS="$CDROM_SUBDIRS win32"
2662 CDROM_DRIVERS="$CDROM_DRIVERS win32/libcdrom_win32.la"
2664 # Set up files for the thread library
2665 if test x$enable_threads = xyes; then
2666 COPY_ARCH_SRC(src/thread, win32, SDL_systhread.c)
2667 COPY_ARCH_SRC(src/thread, win32, SDL_systhread_c.h)
2668 COPY_ARCH_SRC(src/thread, win32, SDL_sysmutex.c)
2669 COPY_ARCH_SRC(src/thread, generic, SDL_sysmutex_c.h)
2670 COPY_ARCH_SRC(src/thread, win32, SDL_syssem.c)
2671 COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
2672 COPY_ARCH_SRC(src/thread, generic, SDL_syscond.c)
2673 COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
2675 # Set up files for the timer library
2676 if test x$enable_timers = xyes; then
2677 COPY_ARCH_SRC(src/timer, win32, SDL_systimer.c)
2679 # The Win32 platform requires special setup
2680 SDL_CFLAGS="$SDL_CFLAGS -Dmain=SDL_main"
2683 CFLAGS="$CFLAGS -I/usr/include/mingw -DWIN32 -Uunix -mno-cygwin"
2684 SDL_CFLAGS="$SDL_CFLAGS -I/usr/include/mingw -DWIN32 -Uunix -mno-cygwin"
2685 LIBS="$LIBS -mno-cygwin"
2686 SDL_LIBS="-lmingw32 -lSDLmain $SDL_LIBS -mwindows -mno-cygwin"
2689 SDL_LIBS="-lmingw32 -lSDLmain $SDL_LIBS -mwindows"
2695 ac_default_prefix=/boot/develop/tools/gnupro
2702 # Set up files for the audio library
2703 if test x$enable_audio = xyes; then
2704 AUDIO_SUBDIRS="$AUDIO_SUBDIRS baudio"
2705 AUDIO_DRIVERS="$AUDIO_DRIVERS baudio/libaudio_baudio.la"
2707 # Set up files for the joystick library
2708 if test x$enable_joystick = xyes; then
2709 JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS beos"
2710 JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS beos/libjoystick_beos.la"
2712 # Set up files for the cdrom library
2713 if test x$enable_cdrom = xyes; then
2714 CDROM_SUBDIRS="$CDROM_SUBDIRS beos"
2715 CDROM_DRIVERS="$CDROM_DRIVERS beos/libcdrom_beos.la"
2717 # Set up files for the thread library
2718 if test x$enable_threads = xyes; then
2719 COPY_ARCH_SRC(src/thread, beos, SDL_systhread.c)
2720 COPY_ARCH_SRC(src/thread, beos, SDL_systhread_c.h)
2721 COPY_ARCH_SRC(src/thread, generic, SDL_sysmutex.c)
2722 COPY_ARCH_SRC(src/thread, generic, SDL_sysmutex_c.h)
2723 COPY_ARCH_SRC(src/thread, beos, SDL_syssem.c)
2724 COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
2725 COPY_ARCH_SRC(src/thread, generic, SDL_syscond.c)
2726 COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
2728 # Set up files for the timer library
2729 if test x$enable_timers = xyes; then
2730 COPY_ARCH_SRC(src/timer, beos, SDL_systimer.c)
2732 # The BeOS platform requires special libraries
2733 SYSTEM_LIBS="$SYSTEM_LIBS -lroot -lbe -lmedia -lgame -ldevice -ltextencoding"
2736 # This would be used if cross-compiling to MacOS 9. No way to
2737 # use it at present, but Apple is working on a X-to-9 compiler
2738 # for which this case would be handy.
2745 # Set up files for the audio library
2746 if test x$enable_audio = xyes; then
2747 AUDIO_SUBDIRS="$AUDIO_SUBDIRS macrom"
2748 AUDIO_DRIVERS="$AUDIO_DRIVERS macrom/libaudio_macrom.la"
2750 # Set up files for the joystick library
2751 if test x$enable_joystick = xyes; then
2752 JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS macos"
2753 JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS macos/libjoystick_macos.la"
2755 # Set up files for the cdrom library
2756 if test x$enable_cdrom = xyes; then
2757 CDROM_SUBDIRS="$CDROM_SUBDIRS macos"
2758 CDROM_DRIVERS="$CDROM_DRIVERS macos/libcdrom_macos.la"
2760 # Set up files for the thread library
2761 if test x$enable_threads = xyes; then
2762 COPY_ARCH_SRC(src/thread, macos, SDL_systhread.c)
2763 COPY_ARCH_SRC(src/thread, macos, SDL_systhread_c.h)
2764 COPY_ARCH_SRC(src/thread, generic, SDL_sysmutex.c)
2765 COPY_ARCH_SRC(src/thread, generic, SDL_sysmutex_c.h)
2766 COPY_ARCH_SRC(src/thread, macos, SDL_syssem.c)
2767 COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
2768 COPY_ARCH_SRC(src/thread, generic, SDL_syscond.c)
2769 COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
2771 # Set up files for the timer library
2772 if test x$enable_timers = xyes; then
2773 COPY_ARCH_SRC(src/timer, macos, SDL_systimer.c)
2775 # The MacOS platform requires special setup
2776 SDL_CFLAGS="$SDL_CFLAGS -Dmain=SDL_main"
2777 SDL_LIBS="-lSDLmain $SDL_LIBS"
2780 # This could be either full "Mac OS X", or plain "Darwin" which is
2781 # just the OS X kernel sans upper layers like Carbon and Cocoa.
2782 # Next line is broken, and a few files below require Mac OS X (full)
2795 # If either the audio or CD driver is used, add the AudioUnit framework
2796 if test x$enable_audio = xyes -o x$enable_cdrom = xyes; then
2797 SYSTEM_LIBS="$SYSTEM_LIBS -framework AudioToolbox -framework AudioUnit"
2799 # Set up files for the audio library
2800 if test x$enable_audio = xyes; then
2801 AUDIO_SUBDIRS="$AUDIO_SUBDIRS macosx"
2802 AUDIO_DRIVERS="$AUDIO_DRIVERS macosx/libaudio_macosx.la"
2803 AUDIO_SUBDIRS="$AUDIO_SUBDIRS macrom"
2804 AUDIO_DRIVERS="$AUDIO_DRIVERS macrom/libaudio_macrom.la"
2806 # Set up files for the joystick library
2807 if test x$enable_joystick = xyes; then
2808 JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS darwin"
2809 JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS darwin/libjoystick_darwin.la"
2810 SYSTEM_LIBS="$SYSTEM_LIBS -framework IOKit"
2812 # Set up files for the cdrom library
2813 if test x$enable_cdrom = xyes; then
2814 CDROM_SUBDIRS="$CDROM_SUBDIRS macosx"
2815 CDROM_DRIVERS="$CDROM_DRIVERS macosx/libcdrom_macosx.la"
2817 # Set up files for the thread library
2818 if test x$enable_threads = xyes; then
2819 CopyUnixThreadSource
2821 # Set up files for the timer library
2822 if test x$enable_timers = xyes; then
2823 COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
2825 # The MacOS X platform requires special setup.
2826 SDL_LIBS="-lSDLmain $SDL_LIBS"
2827 if test x$enable_video_cocoa = xyes; then
2828 SYSTEM_LIBS="$SYSTEM_LIBS -framework Cocoa"
2830 if test x$enable_video_carbon = xyes -o x$enable_video_cocoa = xyes; then
2831 # The Cocoa backend still needs Carbon, and the YUV code QuickTime
2832 SYSTEM_LIBS="$SYSTEM_LIBS -framework Carbon -framework QuickTime"
2834 #if test x$enable_video_carbon = xyes; then
2835 # SYSTEM_LIBS="$SYSTEM_LIBS -framework DrawSprocket"
2843 CheckAtariXbiosVideo
2849 # Set up files for the audio library
2850 if test x$enable_threads = xyes -a x$enable_pth = xyes; then
2851 if test x$enable_audio = xyes; then
2852 CFLAGS="$CFLAGS -DSUNAUDIO_SUPPORT"
2853 AUDIO_SUBDIRS="$AUDIO_SUBDIRS sun"
2854 AUDIO_DRIVERS="$AUDIO_DRIVERS sun/libaudio_sun.la"
2857 # Set up files for the joystick library
2858 if test x$enable_joystick = xyes; then
2859 JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS mint"
2860 JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS mint/libjoystick_mint.la"
2862 # Set up files for the cdrom library
2863 if test x$enable_cdrom = xyes; then
2864 CDROM_SUBDIRS="$CDROM_SUBDIRS mint"
2865 CDROM_DRIVERS="$CDROM_DRIVERS mint/libcdrom_mint.la"
2867 # Set up files for the thread library
2868 if test x$enable_threads = xyes; then
2869 CopyUnixThreadSource
2871 # Set up files for the timer library
2872 if test x$enable_timers = xyes; then
2873 if test x$enable_threads = xyes -a x$enable_pth = xyes; then
2874 COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
2876 COPY_ARCH_SRC(src/timer, mint, SDL_systimer.c)
2879 # MiNT does not define "unix"
2880 CFLAGS="$CFLAGS -Dunix"
2884 # Set up files for the video library
2885 if test x$enable_video = xyes; then
2886 VIDEO_SUBDIRS="$VIDEO_SUBDIRS riscos"
2887 VIDEO_DRIVERS="$VIDEO_DRIVERS riscos/libvideo_riscos.la"
2889 # Set up files for the audio library
2890 if test x$enable_audio = xyes; then
2891 CFLAGS="$CFLAGS -DOSS_SUPPORT"
2892 AUDIO_SUBDIRS="$AUDIO_SUBDIRS dsp"
2893 AUDIO_DRIVERS="$AUDIO_DRIVERS dsp/libaudio_dsp.la"
2894 AUDIO_SUBDIRS="$AUDIO_SUBDIRS dma"
2895 AUDIO_DRIVERS="$AUDIO_DRIVERS dma/libaudio_dma.la"
2897 # Set up files for the joystick library
2898 if test x$enable_joystick = xyes; then
2899 JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS riscos"
2900 JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS riscos/libjoystick_riscos.la"
2902 # Set up files for the cdrom library
2903 if test x$enable_cdrom = xyes; then
2904 CDROM_SUBDIRS="$CDROM_SUBDIRS dummy"
2905 CDROM_DRIVERS="$CDROM_DRIVERS dummy/libcdrom_dummy.la"
2907 # Set up files for the thread library
2908 if test x$enable_threads = xyes; then
2909 COPY_ARCH_SRC(src/thread, riscos, SDL_systhread.c)
2910 COPY_ARCH_SRC(src/thread, riscos, SDL_systhread_c.h)
2911 COPY_ARCH_SRC(src/thread, riscos, SDL_sysmutex.c)
2912 COPY_ARCH_SRC(src/thread, riscos, SDL_sysmutex_c.h)
2913 COPY_ARCH_SRC(src/thread, riscos, SDL_syssem.c)
2914 COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
2915 COPY_ARCH_SRC(src/thread, riscos, SDL_syscond.c)
2916 COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
2918 CFLAGS="$CFLAGS -DDISABLE_THREADS"
2920 # Set up files for the timer library
2921 if test x$enable_timers = xyes; then
2922 COPY_ARCH_SRC(src/timer, riscos, SDL_systimer.c)
2925 CFLAGS="$CFLAGS -DENABLE_RISCOS"
2927 SYSTEM_LIBS="$SYSTEM_LIBS -ljpeg -ltiff -lpng -lz"
2930 AC_MSG_ERROR(Unsupported target: Please add to configure.in)
2935 # Set the conditional variables for this target
2936 AM_CONDITIONAL(TARGET_LINUX, test $ARCH = linux)
2937 AM_CONDITIONAL(TARGET_QTOPIA, test "x$video_qtopia" = "xyes")
2938 AM_CONDITIONAL(TARGET_SOLARIS, test $ARCH = solaris)
2939 AM_CONDITIONAL(TARGET_IRIX, test $ARCH = irix)
2940 AM_CONDITIONAL(TARGET_BSDI, test $ARCH = bsdi)
2941 AM_CONDITIONAL(TARGET_FREEBSD, test $ARCH = freebsd)
2942 AM_CONDITIONAL(TARGET_NETBSD, test $ARCH = netbsd)
2943 AM_CONDITIONAL(TARGET_OPENBSD, test $ARCH = openbsd)
2944 AM_CONDITIONAL(TARGET_AIX, test $ARCH = aix)
2945 AM_CONDITIONAL(TARGET_WIN32, test $ARCH = win32)
2946 AM_CONDITIONAL(TARGET_BEOS, test $ARCH = beos)
2947 AM_CONDITIONAL(TARGET_MACOS, test $ARCH = macos)
2948 AM_CONDITIONAL(TARGET_MACOSX, test $ARCH = macosx)
2949 AM_CONDITIONAL(TARGET_QNX, test $ARCH = qnx)
2950 AM_CONDITIONAL(TARGET_MINT, test $ARCH = mint)
2951 AM_CONDITIONAL(TARGET_IPOD, test x$enable_ipod = xyes)
2953 # More automake conditionals
2954 AM_CONDITIONAL(USE_DIRECTX, test x$use_directx = xyes)
2955 AM_CONDITIONAL(USE_CLONE, test x$use_clone = xyes)
2956 AM_CONDITIONAL(HAVE_NASM, test x$use_nasm = xyes)
2957 AM_CONDITIONAL(USE_COCOA, test x$enable_video_cocoa = xyes)
2958 AM_CONDITIONAL(USE_CARBON, test x$enable_video_carbon = xyes)
2960 # Set conditional variables for shared and static library selection.
2961 # These are not used in any Makefile.am but in sdl-config.in.
2962 AM_CONDITIONAL([ENABLE_SHARED], [test "$enable_shared" = yes])
2963 AM_CONDITIONAL([ENABLE_STATIC], [test "$enable_static" = yes])
2965 # Set runtime shared library paths as needed
2967 if test "x$enable_rpath" = "xyes"; then
2968 if test $ARCH = linux -o $ARCH = freebsd -o $ARCH = bsdi; then
2969 SDL_RLD_FLAGS="-Wl,-rpath,\${exec_prefix}/lib"
2971 if test $ARCH = solaris; then
2972 SDL_RLD_FLAGS="-R\${exec_prefix}/lib"
2979 openbsd | netbsd | bsdi)
2980 SHARED_SYSTEM_LIBS="$SYSTEM_LIBS"
2983 SHARED_SYSTEM_LIBS="$SYSTEM_LIBS"
2986 SHARED_SYSTEM_LIBS=""
2987 if test x$enable_video = xyes -a x$enable_video_cocoa = xyes; then
2988 SHARED_SYSTEM_LIBS="$SHARED_SYSTEM_LIBS -framework Cocoa"
2990 if test x$enable_video = xyes -a x$enable_video_carbon = xyes; then
2991 SHARED_SYSTEM_LIBS="$SHARED_SYSTEM_LIBS -framework Carbon"
2993 if test x$enable_video = xyes -a x$enable_video_opengl = xyes; then
2994 SHARED_SYSTEM_LIBS="$SHARED_SYSTEM_LIBS -framework OpenGL"
2998 SHARED_SYSTEM_LIBS=""
3004 # Evil hack to allow static linking on Mac OS X
3005 SDL_STATIC_LIBS="\${exec_prefix}/lib/libSDLmain.a \${exec_prefix}/lib/libSDL.a"
3008 SDL_STATIC_LIBS="$SDL_LIBS"
3013 STATIC_SYSTEM_LIBS="$SYSTEM_LIBS"
3015 dnl Output the video drivers we use
3016 if test x$enable_video = xtrue; then
3017 if test "$VIDEO_SUBDIRS" = ""; then
3018 AC_MSG_ERROR(*** No video drivers are enabled!)
3021 AC_SUBST(AUDIO_SUBDIRS)
3022 AC_SUBST(AUDIO_DRIVERS)
3023 AC_SUBST(VIDEO_SUBDIRS)
3024 AC_SUBST(VIDEO_DRIVERS)
3025 AC_SUBST(JOYSTICK_SUBDIRS)
3026 AC_SUBST(JOYSTICK_DRIVERS)
3027 AC_SUBST(CDROM_SUBDIRS)
3028 AC_SUBST(CDROM_DRIVERS)
3029 AC_SUBST(SDL_EXTRADIRS)
3030 AC_SUBST(SDL_EXTRALIBS)
3032 dnl Expand the cflags and libraries needed by apps using SDL
3033 AC_SUBST(SDL_CFLAGS)
3035 AC_SUBST(SDL_STATIC_LIBS)
3036 AC_SUBST(SDL_RLD_FLAGS)
3038 dnl Expand the libraries needed for static and dynamic linking
3039 AC_SUBST(STATIC_SYSTEM_LIBS)
3040 AC_SUBST(SHARED_SYSTEM_LIBS)
3041 AC_SUBST(SYSTEM_LIBS)
3043 dnl Expand the include directories for building SDL
3044 CFLAGS="$CFLAGS -I\$(top_srcdir)/include"
3045 CFLAGS="$CFLAGS -I\$(top_srcdir)/include/SDL"
3046 CFLAGS="$CFLAGS -I\$(top_srcdir)/src -I\$(top_srcdir)/src/main/$ARCH"
3047 CFLAGS="$CFLAGS -I\$(top_srcdir)/src/audio"
3048 CFLAGS="$CFLAGS -I\$(top_srcdir)/src/video"
3049 CFLAGS="$CFLAGS -I\$(top_srcdir)/src/video/XFree86/extensions"
3050 CFLAGS="$CFLAGS -I\$(top_srcdir)/src/events"
3051 CFLAGS="$CFLAGS -I\$(top_srcdir)/src/joystick"
3052 CFLAGS="$CFLAGS -I\$(top_srcdir)/src/cdrom"
3053 CFLAGS="$CFLAGS -I\$(top_srcdir)/src/thread"
3054 CFLAGS="$CFLAGS -I\$(top_srcdir)/src/timer"
3055 CFLAGS="$CFLAGS -I\$(top_srcdir)/src/endian"
3056 CFLAGS="$CFLAGS -I\$(top_srcdir)/src/file"
3057 CFLAGS="$CFLAGS -I\$(top_builddir)/src/thread"
3061 # Check for darwin at the very end and set up the Objective C compiler
3062 # We do this here so that we get the full CFLAGS into OBJCFLAGS
3065 dnl AC_PROG_OBJC doesn't seem to exist, this is the SDL workaround
3066 AC_MSG_CHECKING(for an Objective-C compiler)
3071 _AM_DEPENDENCIES(OBJC)
3075 # Finally create all the generated files
3076 dnl Important: Any directory that you want to be in the distcheck should
3077 dnl have a file listed here, so that configure generates the
3078 dnl subdirectories on the build target.
3087 src/main/macos/Makefile
3088 src/main/macosx/Makefile
3089 src/main/macosx/Info.plist
3091 src/audio/alsa/Makefile
3092 src/audio/arts/Makefile
3093 src/audio/baudio/Makefile
3094 src/audio/dc/Makefile
3095 src/audio/disk/Makefile
3096 src/audio/dma/Makefile
3097 src/audio/dmedia/Makefile
3098 src/audio/dsp/Makefile
3099 src/audio/esd/Makefile
3100 src/audio/macosx/Makefile
3101 src/audio/macrom/Makefile
3102 src/audio/mint/Makefile
3103 src/audio/mme/Makefile
3104 src/audio/nas/Makefile
3105 src/audio/nto/Makefile
3106 src/audio/openbsd/Makefile
3107 src/audio/paudio/Makefile
3108 src/audio/sun/Makefile
3109 src/audio/ums/Makefile
3110 src/audio/windib/Makefile
3111 src/audio/windx5/Makefile
3113 src/video/aalib/Makefile
3114 src/video/ataricommon/Makefile
3115 src/video/bwindow/Makefile
3116 src/video/cybergfx/Makefile
3117 src/video/dc/Makefile
3118 src/video/dga/Makefile
3119 src/video/directfb/Makefile
3120 src/video/dummy/Makefile
3121 src/video/epoc/Makefile
3122 src/video/fbcon/Makefile
3123 src/video/gem/Makefile
3124 src/video/ggi/Makefile
3125 src/video/ipod/Makefile
3126 src/video/maccommon/Makefile
3127 src/video/macdsp/Makefile
3128 src/video/macrom/Makefile
3129 src/video/nanox/Makefile
3130 src/video/photon/Makefile
3131 src/video/picogui/Makefile
3132 src/video/ps2gs/Makefile
3133 src/video/qtopia/Makefile
3134 src/video/wscons/Makefile
3135 src/video/quartz/Makefile
3136 src/video/riscos/Makefile
3137 src/video/svga/Makefile
3138 src/video/vgl/Makefile
3139 src/video/wincommon/Makefile
3140 src/video/windib/Makefile
3141 src/video/windx5/Makefile
3142 src/video/x11/Makefile
3143 src/video/xbios/Makefile
3144 src/video/XFree86/Makefile
3145 src/video/XFree86/extensions/Makefile
3146 src/video/XFree86/Xinerama/Makefile
3147 src/video/XFree86/Xv/Makefile
3148 src/video/XFree86/Xxf86dga/Makefile
3149 src/video/XFree86/Xxf86vm/Makefile
3150 src/video/XFree86/XME/Makefile
3152 src/joystick/Makefile
3153 src/joystick/amigaos/Makefile
3154 src/joystick/beos/Makefile
3155 src/joystick/bsd/Makefile
3156 src/joystick/darwin/Makefile
3157 src/joystick/dc/Makefile
3158 src/joystick/dummy/Makefile
3159 src/joystick/linux/Makefile
3160 src/joystick/macos/Makefile
3161 src/joystick/mint/Makefile
3162 src/joystick/riscos/Makefile
3163 src/joystick/win32/Makefile
3165 src/cdrom/aix/Makefile
3166 src/cdrom/beos/Makefile
3167 src/cdrom/dc/Makefile
3168 src/cdrom/dummy/Makefile
3169 src/cdrom/bsdi/Makefile
3170 src/cdrom/freebsd/Makefile
3171 src/cdrom/linux/Makefile
3172 src/cdrom/macos/Makefile
3173 src/cdrom/macosx/Makefile
3174 src/cdrom/mint/Makefile
3175 src/cdrom/openbsd/Makefile
3176 src/cdrom/osf/Makefile
3177 src/cdrom/qnx/Makefile
3178 src/cdrom/win32/Makefile
3183 src/cpuinfo/Makefile
3188 ], [chmod +x sdl-config])