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$use_dlopen != xyes && \
308 test x$enable_alsa_shared = xyes; then
309 AC_MSG_ERROR([You must have dlopen() support and use the --enable-dlopen option])
311 if test x$use_dlopen = 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"
316 AC_MSG_CHECKING(for dlvsym)
327 AC_MSG_RESULT($use_dlvsym);
328 if test x$use_dlvsym = xyes; then
329 CFLAGS="$CFLAGS -DUSE_DLVSYM"
332 CFLAGS="$CFLAGS -DALSA_SUPPORT $ALSA_CFLAGS"
333 SYSTEM_LIBS="$SYSTEM_LIBS $ALSA_LIBS"
335 AUDIO_SUBDIRS="$AUDIO_SUBDIRS alsa"
336 AUDIO_DRIVERS="$AUDIO_DRIVERS alsa/libaudio_alsa.la"
341 dnl Check whether we want to use IRIX 6.5+ native audio or not
344 if test x$enable_audio = xyes; then
345 AC_MSG_CHECKING(for dmedia audio support)
348 #include <dmedia/audio.h>
354 AC_MSG_RESULT($have_dmedia)
355 # Set up files for the audio library
356 if test x$have_dmedia = xyes; then
357 CFLAGS="$CFLAGS -DDMEDIA_SUPPORT"
358 AUDIO_SUBDIRS="$AUDIO_SUBDIRS dmedia"
359 AUDIO_DRIVERS="$AUDIO_DRIVERS dmedia/libaudio_dmedia.la"
360 SYSTEM_LIBS="$SYSTEM_LIBS -laudio"
365 dnl Find the ESD includes and libraries
369 [ --enable-esd support the Enlightened Sound Daemon [default=yes]],
371 if test x$enable_audio = xyes -a x$enable_esd = xyes; then
372 AM_PATH_ESD(0.2.8, have_esd=yes, have_esd=no)
373 if test x$have_esd = xyes; then
374 AC_ARG_ENABLE(esd-shared,
375 [ --enable-esd-shared dynamically load ESD audio support [default=yes]],
376 , enable_esd_shared=yes)
377 esd_lib_spec=`echo $ESD_LIBS | sed 's/.*-L\([[^ ]]*\).*/\1\/libesd.so.*/'`
378 esd_lib=`ls $esd_lib_spec | sed 's/.*\/\(.*\)/\1/; q'`
379 echo "-- $esd_lib_spec -> $esd_lib"
380 if test x$use_dlopen != xyes && \
381 test x$enable_esd_shared = xyes; then
382 AC_MSG_ERROR([You must have dlopen() support and use the --enable-dlopen option])
384 if test x$use_dlopen = xyes && \
385 test x$enable_esd_shared = xyes && test x$esd_lib != x; then
386 CFLAGS="$CFLAGS -DESD_SUPPORT -DESD_DYNAMIC=\$(esd_lib) $ESD_CFLAGS"
389 CFLAGS="$CFLAGS -DESD_SUPPORT $ESD_CFLAGS"
390 SYSTEM_LIBS="$SYSTEM_LIBS $ESD_LIBS"
392 AUDIO_SUBDIRS="$AUDIO_SUBDIRS esd"
393 AUDIO_DRIVERS="$AUDIO_DRIVERS esd/libaudio_esd.la"
401 [ --enable-arts support the Analog Real Time Synthesizer [default=yes]],
403 if test x$enable_audio = xyes -a x$enable_arts = xyes; then
404 AC_PATH_PROG(ARTSCCONFIG, artsc-config)
405 if test x$ARTSCCONFIG = x -o x$ARTSCCONFIG = x'"$ARTSCCONFIG"'; then
406 : # arts isn't installed
408 ARTSC_CFLAGS=`$ARTSCCONFIG --cflags`
409 ARTSC_LIBS=`$ARTSCCONFIG --libs`
410 ARTSC_PREFIX=`$ARTSCCONFIG --arts-prefix`
411 AC_MSG_CHECKING(for aRts development environment)
413 save_CFLAGS="$CFLAGS"
414 CFLAGS="$CFLAGS $ARTSC_CFLAGS"
418 arts_stream_t stream;
422 CFLAGS="$save_CFLAGS"
423 AC_MSG_RESULT($audio_arts)
424 if test x$audio_arts = xyes; then
425 AC_ARG_ENABLE(arts-shared,
426 [ --enable-arts-shared dynamically load aRts audio support [default=yes]],
427 , enable_arts_shared=yes)
428 arts_lib_spec="$ARTSC_PREFIX/lib/libartsc.so.*"
429 arts_lib=`ls $arts_lib_spec | sed 's/.*\/\(.*\)/\1/; q'`
430 echo "-- $arts_lib_spec -> $arts_lib"
431 if test x$use_dlopen != xyes && \
432 test x$enable_arts_shared = xyes; then
433 AC_MSG_ERROR([You must have dlopen() support and use the --enable-dlopen option])
435 if test x$use_dlopen = xyes && \
436 test x$enable_arts_shared = xyes && test x$arts_lib != x; then
437 CFLAGS="$CFLAGS -DARTSC_SUPPORT -DARTSC_DYNAMIC=\$(arts_lib) $ARTSC_CFLAGS"
440 CFLAGS="$CFLAGS -DARTSC_SUPPORT $ARTSC_CFLAGS"
441 SYSTEM_LIBS="$SYSTEM_LIBS $ARTSC_LIBS"
443 AUDIO_SUBDIRS="$AUDIO_SUBDIRS arts"
444 AUDIO_DRIVERS="$AUDIO_DRIVERS arts/libaudio_arts.la"
450 dnl See if the NAS audio interface is supported
454 [ --enable-nas support the NAS audio API [default=yes]],
456 if test x$enable_audio = xyes -a x$enable_nas = xyes; then
457 AC_MSG_CHECKING(for NAS audio support)
459 if test -r /usr/X11R6/include/audio/audiolib.h; then
461 CFLAGS="$CFLAGS -DNAS_SUPPORT -I/usr/X11R6/include/"
462 SYSTEM_LIBS="$SYSTEM_LIBS -laudio -lXt"
463 AUDIO_SUBDIRS="$AUDIO_SUBDIRS nas"
464 AUDIO_DRIVERS="$AUDIO_DRIVERS nas/libaudio_nas.la"
466 dnl On IRIX, the NAS includes are in a different directory,
467 dnl and libnas must be explicitly linked in
469 elif test -r /usr/freeware/include/nas/audiolib.h; then
471 CFLAGS="$CFLAGS -DNAS_SUPPORT"
472 SYSTEM_LIBS="$SYSTEM_LIBS -lnas -lXt"
473 AUDIO_SUBDIRS="$AUDIO_SUBDIRS nas"
474 AUDIO_DRIVERS="$AUDIO_DRIVERS nas/libaudio_nas.la"
476 AC_MSG_RESULT($have_nas)
480 dnl rcg07142001 See if the user wants the disk writer audio driver...
483 AC_ARG_ENABLE(diskaudio,
484 [ --enable-diskaudio support the disk writer audio driver [default=yes]],
485 , enable_diskaudio=yes)
486 if test x$enable_audio = xyes -a x$enable_diskaudio = xyes; then
487 CFLAGS="$CFLAGS -DDISKAUD_SUPPORT"
488 AUDIO_SUBDIRS="$AUDIO_SUBDIRS disk"
489 AUDIO_DRIVERS="$AUDIO_DRIVERS disk/libaudio_disk.la"
493 dnl Set up the Atari Audio driver
496 AC_ARG_ENABLE(mintaudio,
497 [ --enable-mintaudio support Atari audio driver [default=yes]],
498 , enable_mintaudio=yes)
499 if test x$enable_audio = xyes -a x$enable_mintaudio = xyes; then
501 AC_CHECK_HEADER(mint/falcon.h, have_mint_falcon_hdr=yes)
502 if test x$have_mint_falcon_hdr = xyes; then
504 CFLAGS="$CFLAGS -DMINTAUDIO_SUPPORT"
505 AUDIO_SUBDIRS="$AUDIO_SUBDIRS mint"
506 AUDIO_DRIVERS="$AUDIO_DRIVERS mint/libaudio_mintaudio.la"
511 dnl See if we can use x86 assembly blitters
512 # NASM is available from: http://nasm.octium.net/
515 dnl Make sure we are running on an x86 platform
524 dnl Check for NASM (for assembly blit routines)
526 [ --enable-nasm use nasm assembly blitters on x86 [default=yes]],
528 if test x$enable_video = xyes -a x$enable_nasm = xyes; then
529 AC_PATH_PROG(NASM, nasm)
530 if test x$NASM = x -o x$NASM = x'"$NASM"'; then
531 : # nasm isn't installed
533 CFLAGS="$CFLAGS -DUSE_ASMBLIT -I$srcdir/hermes"
546 CFLAGS="$CFLAGS -I\$(top_srcdir)/src/hermes"
547 SDL_EXTRADIRS="$SDL_EXTRADIRS hermes"
548 SDL_EXTRALIBS="$SDL_EXTRALIBS hermes/libhermes.la"
552 # this line is needed for QNX, because it's not defined the __ELF__
553 *-*-qnx*) CFLAGS="$CFLAGS -D__ELF__"
562 dnl Find the nanox include and library directories
565 AC_ARG_ENABLE(video-nanox,
566 [ --enable-video-nanox use nanox video driver [default=no]],
567 , enable_video_nanox=no)
568 AC_ARG_ENABLE(nanox-debug,
569 [ --enable-nanox-debug print debug messages [default=no]],
570 , enable_nanox_debug=no)
571 AC_ARG_ENABLE(nanox-share-memory,
572 [ --enable-nanox-share-memory use share memory [default=no]],
573 , enable_nanox_share_memory=no)
574 AC_ARG_ENABLE(nanox_direct_fb,
575 [ --enable-nanox-direct-fb use direct framebuffer access [default=no]],
576 , enable_nanox_direct_fb=no)
578 if test x$enable_video = xyes -a x$enable_video_nanox = xyes; then
579 if test x$enable_nanox_debug = xyes; then
580 CFLAGS="$CFLAGS -DENABLE_NANOX_DEBUG"
583 if test x$enable_nanox_share_memory = xyes; then
584 CFLAGS="$CFLAGS -DNANOX_SHARE_MEMORY"
587 if test x$enable_nanox_direct_fb = xyes; then
588 CFLAGS="$CFLAGS -DENABLE_NANOX_DIRECT_FB"
591 CFLAGS="$CFLAGS $X_CFLAGS -DENABLE_NANOX"
592 SYSTEM_LIBS="$SYSTEM_LIBS -lnano-X"
593 VIDEO_SUBDIRS="$VIDEO_SUBDIRS nanox"
594 VIDEO_DRIVERS="$VIDEO_DRIVERS nanox/libvideo_nanox.la"
598 dnl Find the X11 include and library directories
601 AC_ARG_ENABLE(video-x11,
602 [ --enable-video-x11 use X11 video driver [default=yes]],
603 , enable_video_x11=yes)
604 if test x$enable_video = xyes -a x$enable_video_x11 = xyes; then
607 if test x$have_x = xyes; then
608 CFLAGS="$CFLAGS $X_CFLAGS -DENABLE_X11 -DXTHREADS -I$srcdir/include -I$srcdir/src/video"
609 if test x$ac_cv_func_shmat != xyes; then
610 CFLAGS="$CFLAGS -DNO_SHARED_MEMORY"
612 SYSTEM_LIBS="$SYSTEM_LIBS $X_LIBS -lX11 -lXext"
613 VIDEO_SUBDIRS="$VIDEO_SUBDIRS x11"
614 VIDEO_DRIVERS="$VIDEO_DRIVERS x11/libvideo_x11.la"
616 AC_ARG_ENABLE(video-x11-vm,
617 [ --enable-video-x11-vm use X11 VM extension for fullscreen [default=yes]],
618 , enable_video_x11_vm=yes)
619 if test x$enable_video_x11_vm = xyes; then
620 AC_MSG_CHECKING(for XFree86 VidMode 1.0 support)
623 #include <X11/Xlib.h>
624 #include <XFree86/extensions/xf86vmode.h>
629 AC_MSG_RESULT($video_x11_vm)
630 if test x$video_x11_vm = xyes; then
631 CFLAGS="$CFLAGS -DXFREE86_VM"
632 VIDEO_SUBDIRS="$VIDEO_SUBDIRS XFree86/Xxf86vm"
633 VIDEO_DRIVERS="$VIDEO_DRIVERS XFree86/Xxf86vm/libXFree86_Xxf86vm.la"
634 AC_MSG_CHECKING(for XFree86 VidMode gamma support)
637 #include <X11/Xlib.h>
638 #include <XFree86/extensions/xf86vmode.h>
640 SDL_NAME(XF86VidModeGamma) gamma;
642 video_x11_vmgamma=yes
644 AC_MSG_RESULT($video_x11_vmgamma)
645 if test x$video_x11_vmgamma = xyes; then
646 CFLAGS="$CFLAGS -DXFREE86_VMGAMMA"
651 [ --enable-dga allow use of X11 DGA code [default=yes]],
653 AC_ARG_ENABLE(video-x11-dgamouse,
654 [ --enable-video-x11-dgamouse use X11 DGA for mouse events [default=yes]],
655 , enable_video_x11_dgamouse=yes)
656 if test x$enable_dga = xyes; then
657 AC_MSG_CHECKING(for XFree86 DGA 1.0 support)
660 #include <X11/Xlib.h>
661 #include <XFree86/extensions/xf86dga.h>
666 AC_MSG_RESULT($video_x11_dga)
667 if test x$video_x11_dga = xyes; then
668 CFLAGS="$CFLAGS -DXFREE86_DGAMOUSE"
669 if test x$enable_video_x11_dgamouse = xyes; then
670 CFLAGS="$CFLAGS -DDEFAULT_DGAMOUSE"
672 VIDEO_SUBDIRS="$VIDEO_SUBDIRS XFree86/Xxf86dga"
673 VIDEO_DRIVERS="$VIDEO_DRIVERS XFree86/Xxf86dga/libXFree86_Xxf86dga.la"
676 AC_ARG_ENABLE(video-x11-xv,
677 [ --enable-video-x11-xv use X11 XvImage extension for video [default=yes]],
678 , enable_video_x11_xv=yes)
679 if test x$enable_video_x11_xv = xyes; then
680 AC_MSG_CHECKING(for XFree86 XvImage support)
683 #include <X11/Xlib.h>
686 #include <X11/extensions/XShm.h>
687 #include <XFree86/extensions/Xvlib.h>
689 SDL_NAME(XvImage) *image;
693 AC_MSG_RESULT($video_x11_xv)
694 if test x$video_x11_xv = xyes; then
695 CFLAGS="$CFLAGS -DXFREE86_XV"
696 VIDEO_SUBDIRS="$VIDEO_SUBDIRS XFree86/Xv"
697 VIDEO_DRIVERS="$VIDEO_DRIVERS XFree86/Xv/libXFree86_Xv.la"
700 AC_ARG_ENABLE(video-x11-xinerama,
701 [ --enable-video-x11-xinerama enable X11 Xinerama support [default=yes]],
702 , enable_video_x11_xinerama=yes)
703 if test x$enable_video_x11_xinerama = xyes; then
704 AC_MSG_CHECKING(for X11 Xinerama support)
705 video_x11_xinerama=no
707 #include <X11/Xlib.h>
708 #include <XFree86/extensions/Xinerama.h>
710 SDL_NAME(XineramaScreenInfo) *xinerama;
712 video_x11_xinerama=yes
714 AC_MSG_RESULT($video_x11_xinerama)
715 if test x$video_x11_xinerama = xyes; then
716 CFLAGS="$CFLAGS -DHAVE_XINERAMA"
717 VIDEO_SUBDIRS="$VIDEO_SUBDIRS XFree86/Xinerama"
718 VIDEO_DRIVERS="$VIDEO_DRIVERS XFree86/Xinerama/libXFree86_Xinerama.la"
721 AC_ARG_ENABLE(video-x11-xme,
722 [ --enable-video-x11-xme enable Xi Graphics XME for fullscreen [default=yes]],
723 , enable_video_x11_xme=yes)
724 if test x$enable_video_x11_xme = xyes; then
725 AC_MSG_CHECKING(for Xi Graphics XiGMiscExtension support)
728 #include <X11/Xlib.h>
729 #include <X11/extensions/xme.h>
731 XiGMiscResolutionInfo *resolutions;
735 AC_MSG_RESULT($video_x11_xme)
736 if test x$video_x11_xme = xyes; then
737 CFLAGS="$CFLAGS -DHAVE_XIGXME"
738 SYSTEM_LIBS="$SYSTEM_LIBS -lxme"
745 dnl Find the X11 DGA 2.0 include and library directories
748 AC_ARG_ENABLE(video-dga,
749 [ --enable-video-dga use DGA 2.0 video driver [default=yes]],
750 , enable_video_dga=yes)
751 if test x$video_x11_dga = xyes -a x$enable_video_dga = xyes; then
752 save_CFLAGS="$CFLAGS"; CFLAGS="$CFLAGS -Isrc/video"
753 AC_MSG_CHECKING(for XFree86 DGA 2.0 support)
756 #include <X11/Xlib.h>
757 #include <XFree86/extensions/xf86dga.h>
759 SDL_NAME(XDGAEvent) xevent;
763 AC_MSG_RESULT($video_x11_dga2)
764 if test x$video_x11_dga2 = xyes; then
765 CFLAGS="$CFLAGS -DENABLE_DGA"
766 VIDEO_SUBDIRS="$VIDEO_SUBDIRS dga"
767 VIDEO_DRIVERS="$VIDEO_DRIVERS dga/libvideo_dga.la"
774 AC_ARG_ENABLE(video-photon,
775 [ --enable-video-photon use QNX Photon video driver [default=yes]],
776 , enable_video_photon=yes)
777 if test x$enable_video = xyes -a x$enable_video_photon = xyes; then
778 AC_MSG_CHECKING(for QNX Photon support)
783 #include <photon/Pg.h>
784 #include <photon/PdDirect.h>
786 PgDisplaySettings_t *visual;
790 AC_MSG_RESULT($video_photon)
791 if test x$video_photon = xyes; then
792 CFLAGS="$CFLAGS -DENABLE_PHOTON"
793 SYSTEM_LIBS="$SYSTEM_LIBS -lph"
794 VIDEO_SUBDIRS="$VIDEO_SUBDIRS photon"
795 VIDEO_DRIVERS="$VIDEO_DRIVERS photon/libvideo_photon.la"
801 dnl Find the framebuffer console includes
804 AC_ARG_ENABLE(video-fbcon,
805 [ --enable-video-fbcon use framebuffer console video driver [default=yes]],
806 , enable_video_fbcon=yes)
807 if test x$enable_video = xyes -a x$enable_video_fbcon = xyes; then
808 AC_MSG_CHECKING(for framebuffer console support)
811 #include <linux/fb.h>
812 #include <linux/kd.h>
813 #include <linux/keyboard.h>
818 AC_MSG_RESULT($video_fbcon)
819 if test x$video_fbcon = xyes; then
820 CFLAGS="$CFLAGS -DENABLE_FBCON"
821 VIDEO_SUBDIRS="$VIDEO_SUBDIRS fbcon"
822 VIDEO_DRIVERS="$VIDEO_DRIVERS fbcon/libvideo_fbcon.la"
830 AC_ARG_ENABLE(video-directfb,
831 [ --enable-video-directfb use DirectFB video driver [default=no]],
832 , enable_video_directfb=no)
833 if test x$enable_video = xyes -a x$enable_video_directfb = xyes; then
836 AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
837 if test x$PKG_CONFIG = xno ; then
838 AC_MSG_WARN([*** pkg-config is required to build the DirectFB video driver.])
840 AC_MSG_CHECKING(for DirectFB support)
842 if ! $PKG_CONFIG --atleast-pkgconfig-version 0.7 ; then
843 AC_MSG_ERROR([*** pkg-config too old; version 0.7 or better required.])
846 DIRECTFB_REQUIRED_VERSION=0.9.15
848 if $PKG_CONFIG --atleast-version $DIRECTFB_REQUIRED_VERSION directfb ; then
849 DIRECTFB_CFLAGS=`$PKG_CONFIG --cflags directfb`
850 DIRECTFB_LIBS=`$PKG_CONFIG --libs directfb`
855 AC_MSG_RESULT($video_directfb)
856 if test x$video_directfb = xyes; then
857 CFLAGS="$CFLAGS -DENABLE_DIRECTFB"
858 VIDEO_SUBDIRS="$VIDEO_SUBDIRS directfb"
859 VIDEO_DRIVERS="$VIDEO_DRIVERS directfb/libvideo_directfb.la"
861 AC_SUBST(DIRECTFB_CFLAGS)
862 AC_SUBST(DIRECTFB_LIBS)
867 dnl See if we're running on PlayStation 2 hardware
870 AC_ARG_ENABLE(video-ps2gs,
871 [ --enable-video-ps2gs use PlayStation 2 GS video driver [default=yes]],
872 , enable_video_ps2gs=yes)
873 if test x$enable_video = xyes -a x$enable_video_ps2gs = xyes; then
874 AC_MSG_CHECKING(for PlayStation 2 GS support)
877 #include <linux/ps2/dev.h>
878 #include <linux/ps2/gs.h>
883 AC_MSG_RESULT($video_ps2gs)
884 if test x$video_ps2gs = xyes; then
885 CFLAGS="$CFLAGS -DENABLE_PS2GS"
886 VIDEO_SUBDIRS="$VIDEO_SUBDIRS ps2gs"
887 VIDEO_DRIVERS="$VIDEO_DRIVERS ps2gs/libvideo_ps2gs.la"
892 dnl Find the GGI includes
895 AC_ARG_ENABLE(video-ggi,
896 [ --enable-video-ggi use GGI video driver [default=no]],
897 , enable_video_ggi=no)
898 if test x$enable_video = xyes -a x$enable_video_ggi = xyes; then
899 AC_MSG_CHECKING(for GGI support)
908 AC_MSG_RESULT($video_ggi)
909 if test x$video_ggi = xyes; then
910 CFLAGS="$CFLAGS $X_CFLAGS -DENABLE_GGI"
911 SYSTEM_LIBS="$SYSTEM_LIBS -lggi -lgii -lgg"
913 VIDEO_SUBDIRS="$VIDEO_SUBDIRS ggi"
914 VIDEO_DRIVERS="$VIDEO_DRIVERS ggi/libvideo_ggi.la"
919 dnl Find the SVGAlib includes and libraries
922 AC_ARG_ENABLE(video-svga,
923 [ --enable-video-svga use SVGAlib video driver [default=no]],
924 , enable_video_svga=no)
925 if test x$enable_video = xyes -a x$enable_video_svga = xyes; then
926 AC_MSG_CHECKING(for SVGAlib (1.4.0+) support)
930 #include <vgamouse.h>
931 #include <vgakeyboard.h>
933 if ( SCANCODE_RIGHTWIN && SCANCODE_LEFTWIN ) {
939 AC_MSG_RESULT($video_svga)
940 if test x$video_svga = xyes; then
941 CFLAGS="$CFLAGS -DENABLE_SVGALIB"
942 SYSTEM_LIBS="$SYSTEM_LIBS -lvga"
944 VIDEO_SUBDIRS="$VIDEO_SUBDIRS svga"
945 VIDEO_DRIVERS="$VIDEO_DRIVERS svga/libvideo_svga.la"
950 dnl Find the VGL includes and libraries
953 AC_ARG_ENABLE(video-vgl,
954 [ --enable-video-vgl use VGL video driver [default=no]],
955 , enable_video_vgl=no)
956 if test x$enable_video = xyes -a x$enable_video_vgl = xyes; then
957 AC_MSG_CHECKING(for libVGL support)
960 #include <sys/fbio.h>
961 #include <sys/consio.h>
962 #include <sys/kbio.h>
970 AC_MSG_RESULT($video_vgl)
971 if test x$video_vgl = xyes; then
972 CFLAGS="$CFLAGS -DENABLE_VGL"
973 SYSTEM_LIBS="$SYSTEM_LIBS -lvgl"
975 VIDEO_SUBDIRS="$VIDEO_SUBDIRS vgl"
976 VIDEO_DRIVERS="$VIDEO_DRIVERS vgl/libvideo_vgl.la"
981 dnl Find the AAlib includes
984 AC_ARG_ENABLE(video-aalib,
985 [ --enable-video-aalib use AAlib video driver [default=no]],
986 , enable_video_aalib=no)
987 if test x$enable_video = xyes -a x$enable_video_aalib = xyes; then
988 AC_MSG_CHECKING(for AAlib support)
996 AC_MSG_RESULT($video_aalib)
997 if test x$video_aalib = xyes; then
998 CFLAGS="$CFLAGS -DENABLE_AALIB"
999 SYSTEM_LIBS="$SYSTEM_LIBS -laa"
1001 VIDEO_SUBDIRS="$VIDEO_SUBDIRS aalib"
1002 VIDEO_DRIVERS="$VIDEO_DRIVERS aalib/libvideo_aa.la"
1007 dnl Set up the Atari Xbios driver
1008 CheckAtariXbiosVideo()
1010 AC_ARG_ENABLE(xbios,
1011 [ --enable-video-xbios use Atari Xbios video driver [default=yes]],
1012 , enable_video_xbios=yes)
1014 if test x$enable_video = xyes -a x$enable_video_xbios = xyes; then
1016 CFLAGS="$CFLAGS -DENABLE_XBIOS"
1017 VIDEO_SUBDIRS="$VIDEO_SUBDIRS xbios"
1018 VIDEO_DRIVERS="$VIDEO_DRIVERS xbios/libvideo_xbios.la"
1022 dnl Set up the Atari Gem driver
1023 CheckAtariGemVideo()
1026 [ --enable-video-gem use Atari Gem video driver [default=yes]],
1027 , enable_video_gem=yes)
1028 if test x$enable_video = xyes -a x$enable_video_gem = xyes; then
1030 AC_CHECK_HEADER(gem.h, have_gem_hdr=yes)
1031 AC_CHECK_LIB(gem, appl_init, have_gem_lib=yes)
1032 if test x$have_gem_hdr = xyes -a x$have_gem_lib = xyes; then
1034 CFLAGS="$CFLAGS -DENABLE_GEM"
1035 SYSTEM_LIBS="$SYSTEM_LIBS -lgem"
1036 VIDEO_SUBDIRS="$VIDEO_SUBDIRS gem"
1037 VIDEO_DRIVERS="$VIDEO_DRIVERS gem/libvideo_gem.la"
1042 dnl Set up the Atari Bios keyboard driver
1043 CheckAtariBiosEvent()
1045 CFLAGS="$CFLAGS -I\$(top_srcdir)/src/video/ataricommon"
1046 VIDEO_SUBDIRS="$VIDEO_SUBDIRS ataricommon"
1047 VIDEO_DRIVERS="$VIDEO_DRIVERS ataricommon/libvideo_ataricommon.la"
1050 dnl rcg04172001 Set up the Null video driver.
1053 AC_ARG_ENABLE(video-dummy,
1054 [ --enable-video-dummy use dummy video driver [default=yes]],
1055 , enable_video_dummy=yes)
1056 if test x$enable_video_dummy = xyes; then
1057 CFLAGS="$CFLAGS -DENABLE_DUMMYVIDEO"
1058 VIDEO_SUBDIRS="$VIDEO_SUBDIRS dummy"
1059 VIDEO_DRIVERS="$VIDEO_DRIVERS dummy/libvideo_null.la"
1063 dnl Check to see if OpenGL support is desired
1064 AC_ARG_ENABLE(video-opengl,
1065 [ --enable-video-opengl include OpenGL context creation [default=yes]],
1066 , enable_video_opengl=yes)
1071 if test x$enable_video = xyes -a x$enable_video_opengl = xyes; then
1072 AC_MSG_CHECKING(for OpenGL (GLX) support)
1077 #include <dlfcn.h> /* For loading extensions */
1082 AC_MSG_RESULT($video_opengl)
1083 if test x$video_opengl = xyes; then
1084 CFLAGS="$CFLAGS -DHAVE_OPENGL"
1085 if test x$use_dlopen != xyes; then
1086 AC_CHECK_LIB(dl, dlopen, SYSTEM_LIBS="$SYSTEM_LIBS -ldl")
1092 dnl Find QNX RtP OpenGL
1095 if test x$enable_video = xyes -a x$enable_video_opengl = xyes; then
1096 AC_MSG_CHECKING(for OpenGL (Photon) support)
1104 AC_MSG_RESULT($video_opengl)
1105 if test x$video_opengl = xyes; then
1106 CFLAGS="$CFLAGS -DHAVE_OPENGL"
1107 SYSTEM_LIBS="$SYSTEM_LIBS -lGL"
1108 if test x$use_dlopen != xyes; then
1109 AC_CHECK_LIB(c, dlopen, SYSTEM_LIBS="$SYSTEM_LIBS", AC_CHECK_LIB(ltdl, dlopen, SYSTEM_LIBS="$SYSTEM_LIBS -lltdl"))
1115 dnl Check for BeOS OpenGL
1118 if test x$enable_video = xyes -a x$enable_video_opengl = xyes; then
1119 CFLAGS="$CFLAGS -DHAVE_OPENGL"
1120 SYSTEM_LIBS="$SYSTEM_LIBS -lGL"
1124 dnl Check for MacOS OpenGL
1127 if test x$enable_video = xyes -a x$enable_video_opengl = xyes; then
1128 CFLAGS="$CFLAGS -DHAVE_OPENGL"
1131 SYSTEM_LIBS="$SYSTEM_LIBS -framework OpenGL -framework AGL"
1136 dnl Check for Mesa offscreen rendering
1139 if test "x$enable_video" = "xyes" -a "x$enable_video_opengl" = "xyes"; then
1140 AC_CHECK_HEADER(GL/osmesa.h, have_osmesa_hdr=yes)
1141 AC_CHECK_LIB(OSMesa, OSMesaCreateContext, have_osmesa_lib=yes, have_osmesa_lib=no, -lm)
1143 # Static linking to -lOSMesa
1144 AC_PATH_PROG(OSMESA_CONFIG, osmesa-config, no)
1145 if test "x$OSMESA_CONFIG" = "xno" -o "x$enable_atari_ldg" = "xno"; then
1146 # -lOSMesa is really the static library
1147 if test "x$have_osmesa_hdr" = "xyes" -a "x$have_osmesa_lib" = "xyes"; then
1148 CFLAGS="$CFLAGS -DHAVE_OPENGL"
1149 SYSTEM_LIBS="$SYSTEM_LIBS -lOSMesa"
1152 # -lOSMesa is a loader for OSMesa.ldg
1153 OSMESA_CFLAGS=`$OSMESA_CONFIG --cflags`
1154 OSMESA_LIBS=`$OSMESA_CONFIG --libs`
1155 CFLAGS="$CFLAGS -DHAVE_OPENGL $OSMESA_CFLAGS"
1156 SYSTEM_LIBS="$SYSTEM_LIBS $OSMESA_LIBS"
1159 AC_ARG_ENABLE(osmesa-shared,
1160 [ --enable-osmesa-shared dynamically load OSMesa OpenGL support [default=yes]],
1161 , enable_osmesa_shared=yes)
1162 if test "x$enable_osmesa_shared" = "xyes" -a "x$enable_atari_ldg" = "xyes"; then
1164 if test "x$have_osmesa_hdr" = "xyes"; then
1165 CFLAGS="$CFLAGS -DENABLE_OSMESA_SHARED"
1171 dnl See if we can use the new unified event interface in Linux 2.4
1174 dnl Check for Linux 2.4 unified input event interface support
1175 AC_ARG_ENABLE(input-events,
1176 [ --enable-input-events use Linux 2.4 unified input interface [default=yes]],
1177 , enable_input_events=yes)
1178 if test x$enable_input_events = xyes; then
1179 AC_MSG_CHECKING(for Linux 2.4 unified input interface)
1182 #include <linux/input.h>
1185 #error EVIOCGNAME() ioctl not available
1188 use_input_events=yes
1190 AC_MSG_RESULT($use_input_events)
1191 if test x$use_input_events = xyes; then
1192 CFLAGS="$CFLAGS -DUSE_INPUT_EVENTS"
1197 dnl See if we can use GNU pth library for threads
1200 dnl Check for pth support
1202 [ --enable-pth use GNU pth library for multi-threading [default=yes]],
1204 if test x$enable_threads = xyes -a x$enable_pth = xyes; then
1205 AC_PATH_PROG(PTH_CONFIG, pth-config, no)
1206 if test "$PTH_CONFIG" = "no"; then
1209 PTH_CFLAGS=`$PTH_CONFIG --cflags`
1210 PTH_LIBS=`$PTH_CONFIG --libs --all`
1211 SDL_CFLAGS="$SDL_CFLAGS $PTH_CFLAGS"
1212 SDL_LIBS="$SDL_LIBS $PTH_LIBS"
1213 CFLAGS="$CFLAGS -DENABLE_PTH"
1216 AC_MSG_CHECKING(pth)
1217 if test "x$use_pth" = xyes; then
1225 dnl See what type of thread model to use on Linux and Solaris
1228 dnl Check for pthread support
1229 AC_ARG_ENABLE(pthreads,
1230 [ --enable-pthreads use POSIX threads for multi-threading [default=yes]],
1231 , enable_pthreads=yes)
1232 dnl This is used on Linux for glibc binary compatibility (Doh!)
1233 AC_ARG_ENABLE(pthread-sem,
1234 [ --enable-pthread-sem use pthread semaphores [default=yes]],
1235 , enable_pthread_sem=yes)
1238 pthread_cflags="-D_REENTRANT -D_THREAD_SAFE"
1242 pthread_cflags="-D_THREAD_SAFE"
1243 # causes Carbon.p complaints?
1244 # pthread_cflags="-D_REENTRANT -D_THREAD_SAFE"
1247 pthread_cflags="-D_REENTRANT -D_THREAD_SAFE"
1248 pthread_lib="-pthread"
1251 pthread_cflags="-I/usr/pkg/include -D_REENTRANT"
1252 pthread_lib="-L/usr/pkg/lib -lpthread -lsem"
1255 pthread_cflags="-D_REENTRANT"
1256 pthread_lib="-pthread"
1259 pthread_cflags="-D_REENTRANT"
1260 pthread_lib="-lpthread -lposix4"
1263 pthread_cflags="-D_REENTRANT -Kthread"
1267 pthread_cflags="-D_SGI_MP_SOURCE"
1268 pthread_lib="-lpthread"
1271 pthread_cflags="-D_REENTRANT -mthreads"
1272 pthread_lib="-lpthread"
1275 pthread_cflags="-D_REENTRANT"
1276 pthread_lib="-L/usr/lib -lpthread"
1283 pthread_cflags="-D_REENTRANT"
1284 if test x$ac_cv_prog_gcc = xyes; then
1285 pthread_lib="-lpthread -lrt"
1287 pthread_lib="-lpthread -lexc -lrt"
1291 pthread_cflags="-D_REENTRANT"
1292 pthread_lib="-lpthread"
1295 if test x$enable_threads = xyes -a x$enable_pthreads = xyes; then
1296 # Save the original compiler flags and libraries
1297 ac_save_cflags="$CFLAGS"; ac_save_libs="$LIBS"
1298 # Add the pthread compiler flags and libraries
1299 CFLAGS="$CFLAGS $pthread_cflags"; LIBS="$LIBS $pthread_lib"
1300 # Check to see if we have pthread support on this system
1301 AC_MSG_CHECKING(for pthreads)
1304 #include <pthread.h>
1306 pthread_attr_t type;
1307 pthread_attr_init(&type);
1311 AC_MSG_RESULT($use_pthreads)
1312 # Restore the compiler flags and libraries
1313 CFLAGS="$ac_save_cflags"; LIBS="$ac_save_libs"
1314 # Do futher testing if we have pthread support...
1315 if test x$use_pthreads = xyes; then
1316 CFLAGS="$CFLAGS $pthread_cflags -DSDL_USE_PTHREADS"
1317 LIBS="$LIBS $pthread_lib"
1318 SDL_CFLAGS="$SDL_CFLAGS $pthread_cflags"
1319 SDL_LIBS="$SDL_LIBS $pthread_lib"
1321 # Check to see if recursive mutexes are available
1322 AC_MSG_CHECKING(for recursive mutexes)
1323 has_recursive_mutexes=no
1325 #include <pthread.h>
1327 pthread_mutexattr_t attr;
1328 #if defined(linux) && !(defined(__arm__) && defined(QWS))
1329 pthread_mutexattr_setkind_np(&attr, PTHREAD_MUTEX_RECURSIVE_NP);
1331 pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
1334 has_recursive_mutexes=yes
1336 # Some systems have broken recursive mutex implementations
1339 has_recursive_mutexes=no
1342 has_recursive_mutexes=no
1345 AC_MSG_RESULT($has_recursive_mutexes)
1346 if test x$has_recursive_mutexes != xyes; then
1347 CFLAGS="$CFLAGS -DPTHREAD_NO_RECURSIVE_MUTEX"
1350 # Check to see if pthread semaphore support is missing
1351 if test x$enable_pthread_sem = xyes; then
1352 AC_MSG_CHECKING(for pthread semaphores)
1355 #include <pthread.h>
1356 #include <semaphore.h>
1359 have_pthread_sem=yes
1361 AC_MSG_RESULT($have_pthread_sem)
1364 # Check to see if this is broken glibc 2.0 pthreads
1367 AC_MSG_CHECKING(for broken glibc 2.0 pthreads)
1370 #include <features.h>
1371 #if (__GLIBC__ == 2) && (__GLIBC_MINOR__ == 0)
1372 #warning Working around a bug in glibc 2.0 pthreads
1374 #error pthread implementation okay
1375 #endif /* glibc 2.0 */
1378 glibc20_pthreads=yes
1380 AC_MSG_RESULT($glibc20_pthreads)
1385 AC_MSG_CHECKING(whether semun is defined in /usr/include/sys/sem.h)
1388 #include <sys/types.h>
1389 #include <sys/sem.h>
1395 AC_MSG_RESULT($have_semun)
1396 if test x$have_semun = xyes; then
1397 CFLAGS="$CFLAGS -DHAVE_SEMUN"
1400 # See if we can use GNU Pth or clone() on Linux directly
1401 if test x$enable_threads = xyes -a x$use_pthreads != xyes; then
1403 if test x$use_pth != xyes; then
1413 # Note that we need to have either semaphores or to have mutexes and
1414 # condition variables to implement all thread synchronization primitives
1415 CopyUnixThreadSource()
1417 if test x$use_pthreads = xyes -o x$use_clone = xyes; then
1418 # Basic thread creation functions
1419 COPY_ARCH_SRC(src/thread, linux, SDL_systhread.c)
1420 COPY_ARCH_SRC(src/thread, linux, SDL_systhread_c.h)
1423 # We can fake these with mutexes and condition variables if necessary
1424 if test x$use_pthreads = xyes -a x$have_pthread_sem != xyes; then
1425 COPY_ARCH_SRC(src/thread, generic, SDL_syssem.c)
1427 COPY_ARCH_SRC(src/thread, linux, SDL_syssem.c)
1429 COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
1432 # We can fake these with semaphores if necessary
1435 COPY_ARCH_SRC(src/thread, bsdi, SDL_syssem.c)
1436 COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
1437 COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex.c)
1438 COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex_c.h)
1441 if test x$glibc20_pthreads = xyes; then
1442 COPY_ARCH_SRC(src/thread, generic, SDL_sysmutex.c)
1443 COPY_ARCH_SRC(src/thread, generic, SDL_sysmutex_c.h)
1445 COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex.c)
1446 COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex_c.h)
1451 # Condition variables
1452 # We can fake these with semaphores and mutexes if necessary
1453 if test x$glibc20_pthreads = xyes -o x$has_recursive_mutexes != xyes; then
1454 COPY_ARCH_SRC(src/thread, generic, SDL_syscond.c)
1456 COPY_ARCH_SRC(src/thread, linux, SDL_syscond.c)
1458 COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
1460 elif test x$use_pth = xyes; then
1461 COPY_ARCH_SRC(src/thread, pth, SDL_systhread.c)
1462 COPY_ARCH_SRC(src/thread, pth, SDL_systhread_c.h)
1463 COPY_ARCH_SRC(src/thread, pth, SDL_sysmutex.c)
1464 COPY_ARCH_SRC(src/thread, pth, SDL_sysmutex_c.h)
1465 COPY_ARCH_SRC(src/thread, pth, SDL_syscond.c)
1466 COPY_ARCH_SRC(src/thread, pth, SDL_syscond_c.h)
1467 COPY_ARCH_SRC(src/thread, generic, SDL_syssem.c)
1468 COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
1471 *** No thread support detected
1476 dnl See if we can use sigaction() instead of signal()
1479 dnl Check for sigaction support
1480 AC_ARG_ENABLE(sigaction,
1481 [ --enable-sigaction use sigaction instead of signal [default=yes]],
1482 , enable_sigaction=yes)
1483 if test x$enable_sigaction = xyes; then
1484 AC_MSG_CHECKING(sigaction)
1489 struct sigaction junk;
1490 sigaction(0, &junk, &junk);
1494 AC_MSG_RESULT($have_sigaction)
1495 if test x$have_sigaction = xyes; then
1496 CFLAGS="$CFLAGS -DHAVE_SIGACTION"
1501 dnl Determine whether the compiler can produce Win32 executables
1504 AC_MSG_CHECKING(Win32 compiler)
1507 #include <windows.h>
1512 AC_MSG_RESULT($have_win32_gcc)
1513 if test x$have_win32_gcc != xyes; then
1515 *** Your compiler ($CC) does not produce Win32 executables!
1519 dnl See if the user wants to redirect standard output to files
1520 AC_ARG_ENABLE(stdio-redirect,
1521 [ --enable-stdio-redirect Redirect STDIO to files on Win32 [default=yes]],
1522 , enable_stdio_redirect=yes)
1523 if test x$enable_stdio_redirect != xyes; then
1524 CFLAGS="$CFLAGS -DNO_STDIO_REDIRECT"
1528 dnl Find the DirectX includes and libraries
1531 AC_ARG_ENABLE(directx,
1532 [ --enable-directx use DirectX for Win32 audio/video [default=yes]],
1533 , enable_directx=yes)
1534 if test x$enable_directx = xyes; then
1535 AC_MSG_CHECKING(for DirectX headers and libraries)
1538 CFLAGS="$CFLAGS -I$srcdir"
1540 #include "src/video/windx5/directx.h"
1546 AC_MSG_RESULT($use_directx)
1549 CFLAGS="$CFLAGS -I\$(top_srcdir)/src/video/wincommon"
1550 SYSTEM_LIBS="$SYSTEM_LIBS -luser32 -lgdi32 -lwinmm"
1551 VIDEO_SUBDIRS="$VIDEO_SUBDIRS wincommon"
1552 VIDEO_DRIVERS="$VIDEO_DRIVERS wincommon/libvideo_wincommon.la"
1553 # Enable the DIB driver
1554 CFLAGS="$CFLAGS -DENABLE_WINDIB"
1555 VIDEO_SUBDIRS="$VIDEO_SUBDIRS windib"
1556 VIDEO_DRIVERS="$VIDEO_DRIVERS windib/libvideo_windib.la"
1557 # See if we should enable the DirectX driver
1558 if test x$use_directx = xyes; then
1559 CFLAGS="$CFLAGS -DENABLE_DIRECTX"
1560 SYSTEM_LIBS="$SYSTEM_LIBS -ldxguid"
1561 VIDEO_SUBDIRS="$VIDEO_SUBDIRS windx5"
1562 VIDEO_DRIVERS="$VIDEO_DRIVERS windx5/libvideo_windx5.la"
1566 dnl Set up the BWindow video driver on BeOS
1569 CFLAGS="$CFLAGS -DENABLE_BWINDOW"
1570 VIDEO_SUBDIRS="$VIDEO_SUBDIRS bwindow"
1571 VIDEO_DRIVERS="$VIDEO_DRIVERS bwindow/libvideo_bwindow.la"
1574 dnl Set up the QTopia video driver if enabled
1577 AC_ARG_ENABLE(video-qtopia,
1578 [ --enable-video-qtopia use Qtopia video driver [default=no]],
1579 , enable_video_qtopia=no)
1580 if test x$enable_video = xyes -a x$enable_video_qtopia = xyes; then
1581 AC_MSG_CHECKING(for Qtopia support)
1585 CXXFLAGS="-DQT_QWS_EBX -fno-rtti -fno-exceptions -DQT_QWS_CUSTOM -DQWS -I${QPEDIR}/include -I${QTDIR}/include/ -DNO_DEBUG"
1587 #include <qpe/qpeapplication.h>
1593 AC_MSG_RESULT($video_qtopia)
1594 if test x$video_qtopia = xyes; then
1595 CFLAGS="$CFLAGS -DENABLE_QTOPIA -DQT_QWS_EBX -DQT_QWS_CUSTOM -DQWS -I${QPEDIR}/include -I${QTDIR}/include/ -DNO_DEBUG -fno-rtti -fno-exceptions"
1596 SDL_LIBS="$SDL_LIBS -L${QPEDIR}/lib -L${QTDIR}/lib/ -lqpe -lqte"
1597 SDL_CFLAGS="$SDL_CFLAGS -DQWS"
1598 VIDEO_SUBDIRS="$VIDEO_SUBDIRS qtopia"
1599 VIDEO_DRIVERS="$VIDEO_DRIVERS qtopia/libvideo_qtopia.la"
1602 *** Failed to find Qtopia includes. Make sure that the QTDIR and QPEDIR
1603 *** environment variables are set correctly.])
1609 dnl Set up the PicoGUI video driver if enabled
1612 AC_ARG_ENABLE(video-picogui,
1613 [ --enable-video-picogui use PicoGUI video driver [default=no]],
1614 , enable_video_picogui=no)
1615 if test x$enable_video = xyes -a x$enable_video_picogui = xyes; then
1616 AC_MSG_CHECKING(for PicoGUI support)
1619 #include <picogui.h>
1624 AC_MSG_RESULT($video_picogui)
1625 if test x$video_picogui = xyes; then
1626 SDL_LIBS="$SDL_LIBS -lpgui"
1627 CFLAGS="$CFLAGS -DENABLE_PICOGUI"
1628 VIDEO_SUBDIRS="$VIDEO_SUBDIRS picogui"
1629 VIDEO_DRIVERS="$VIDEO_DRIVERS picogui/libvideo_picogui.la"
1635 dnl Set up the Mac toolbox video driver for Mac OS 7-9
1638 VIDEO_SUBDIRS="$VIDEO_SUBDIRS maccommon"
1639 VIDEO_DRIVERS="$VIDEO_DRIVERS maccommon/libvideo_maccommon.la"
1640 VIDEO_SUBDIRS="$VIDEO_SUBDIRS macrom"
1641 VIDEO_DRIVERS="$VIDEO_DRIVERS macrom/libvideo_macrom.la"
1644 dnl Set up the Mac toolbox video driver for Mac OS X
1647 # "MACOSX" is not an official definition, but it's commonly
1648 # accepted as a way to differentiate between what runs on X
1649 # and what runs on older Macs - while in theory "Carbon" defns
1650 # are consistent between the two, in practice Carbon is still
1651 # changing. -sts Aug 2000
1652 mac_autoconf_target_workaround="MAC"
1653 CFLAGS="$CFLAGS -I/System/Library/Frameworks/Carbon.framework/Headers \
1654 -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"
1655 VIDEO_SUBDIRS="$VIDEO_SUBDIRS maccommon"
1656 VIDEO_DRIVERS="$VIDEO_DRIVERS maccommon/libvideo_maccommon.la"
1657 VIDEO_SUBDIRS="$VIDEO_SUBDIRS macrom"
1658 VIDEO_DRIVERS="$VIDEO_DRIVERS macrom/libvideo_macrom.la"
1661 dnl Set up the Mac toolbox video driver for Mac OS X
1664 # "MACOSX" is not an official definition, but it's commonly
1665 # accepted as a way to differentiate between what runs on X
1666 # and what runs on older Macs - while in theory "Carbon" defns
1667 # are consistent between the two, in practice Carbon is still
1668 # changing. -sts Aug 2000
1669 mac_autoconf_target_workaround="MAC"
1670 CFLAGS="$CFLAGS -I/System/Library/Frameworks/Carbon.framework/Headers \
1671 -I/System/Library/Frameworks/Cocoa.framework/Headers -fpascal-strings \
1672 -DENABLE_QUARTZ -DMACOSX -DTARGET_API_${mac_autoconf_target_workaround}_CARBON=1 -I\$(top_srcdir)/src/video/quartz"
1673 VIDEO_SUBDIRS="$VIDEO_SUBDIRS quartz"
1674 VIDEO_DRIVERS="$VIDEO_DRIVERS quartz/libvideo_quartz.la"
1677 dnl Check for the dlfcn.h interface for dynamically loading objects
1680 AC_ARG_ENABLE(sdl-dlopen,
1681 [ --enable-sdl-dlopen use dlopen for shared object loading [default=yes]],
1682 , enable_sdl_dlopen=yes)
1683 if test x$enable_sdl_dlopen = xyes; then
1684 AC_MSG_CHECKING(for dlopen)
1692 AC_MSG_RESULT($use_dlopen)
1694 if test x$use_dlopen = xyes; then
1695 CFLAGS="$CFLAGS -DUSE_DLOPEN"
1696 AC_CHECK_LIB(c, dlopen, SYSTEM_LIBS="$SYSTEM_LIBS",
1697 AC_CHECK_LIB(dl, dlopen, SYSTEM_LIBS="$SYSTEM_LIBS -ldl",
1698 AC_CHECK_LIB(ltdl, dlopen, SYSTEM_LIBS="$SYSTEM_LIBS -lltdl")))
1703 dnl Set up the Atari LDG (shared object loader)
1706 AC_ARG_ENABLE(atari-ldg,
1707 [ --enable-atari-ldg use Atari LDG for shared object loading [default=yes]],
1708 , enable_atari_ldg=yes)
1709 if test x$video_gem = xyes -a x$enable_atari_ldg = xyes; then
1710 AC_CHECK_HEADER(ldg.h, have_ldg_hdr=yes)
1711 AC_CHECK_LIB(ldg, ldg_open, have_ldg_lib=yes, have_ldg_lib=no, -lgem)
1712 if test x$have_ldg_hdr = xyes -a x$have_ldg_lib = xyes; then
1713 CFLAGS="$CFLAGS -DENABLE_LDG"
1714 SYSTEM_LIBS="$SYSTEM_LIBS -lldg -lgem"
1719 dnl Check for the usbhid(3) library on *BSD
1722 if test x$enable_joystick = xyes; then
1725 AC_CHECK_LIB(usbhid, hid_init, have_libusbhid=yes)
1726 AC_CHECK_LIB(usb, hid_init, have_libusb=yes)
1727 if test x$have_libusbhid = xyes; then
1728 SYSTEM_LIBS="$SYSTEM_LIBS -lusbhid"
1730 if test x$have_libusb = xyes; then
1731 SYSTEM_LIBS="$SYSTEM_LIBS -lusb"
1734 AC_CHECK_HEADER(usb.h, have_usb_h=yes)
1735 AC_CHECK_HEADER(usbhid.h, have_usbhid_h=yes)
1736 AC_CHECK_HEADER(libusb.h, have_libusb_h=yes)
1737 AC_CHECK_HEADER(libusbhid.h, have_libusbhid_h=yes)
1738 if test x$have_usb_h = xyes; then
1739 CFLAGS="$CFLAGS -DHAVE_USB_H"
1741 if test x$have_usbhid_h = xyes; then
1742 CFLAGS="$CFLAGS -DHAVE_USBHID_H"
1744 if test x$have_libusb_h = xyes; then
1745 CFLAGS="$CFLAGS -DHAVE_LIBUSB_H"
1747 if test x$have_libusbhid_h = xyes; then
1748 CFLAGS="$CFLAGS -DHAVE_LIBUSBHID_H"
1751 AC_MSG_CHECKING(for usbhid)
1754 #include <sys/types.h>
1755 #if defined(HAVE_USB_H)
1758 #include <dev/usb/usb.h>
1759 #include <dev/usb/usbhid.h>
1760 #if defined(HAVE_USBHID_H)
1762 #elif defined(HAVE_LIBUSB_H)
1764 #elif defined(HAVE_LIBUSBHID_H)
1765 #include <libusbhid.h>
1768 struct report_desc *repdesc;
1769 struct usb_ctl_report *repbuf;
1774 AC_MSG_RESULT($have_usbhid)
1776 if test x$have_usbhid = xyes; then
1777 AC_MSG_CHECKING(for ucr_data member of usb_ctl_report)
1778 have_usbhid_ucr_data=no
1780 #include <sys/types.h>
1781 #if defined(HAVE_USB_H)
1784 #include <dev/usb/usb.h>
1785 #include <dev/usb/usbhid.h>
1786 #if defined(HAVE_USBHID_H)
1788 #elif defined(HAVE_LIBUSB_H)
1790 #elif defined(HAVE_LIBUSBHID_H)
1791 #include <libusbhid.h>
1794 struct usb_ctl_report buf;
1795 if (buf.ucr_data) { }
1797 have_usbhid_ucr_data=yes
1799 if test x$have_usbhid_ucr_data = xyes; then
1800 CFLAGS="$CFLAGS -DUSBHID_UCR_DATA"
1802 AC_MSG_RESULT($have_usbhid_ucr_data)
1804 AC_MSG_CHECKING(for new usbhid API)
1807 #include <sys/types.h>
1808 #if defined(HAVE_USB_H)
1811 #include <dev/usb/usb.h>
1812 #include <dev/usb/usbhid.h>
1813 #if defined(HAVE_USBHID_H)
1815 #elif defined(HAVE_LIBUSB_H)
1817 #elif defined(HAVE_LIBUSBHID_H)
1818 #include <libusbhid.h>
1822 hid_start_parse(d, 1, 1);
1826 if test x$have_usbhid_new = xyes; then
1827 CFLAGS="$CFLAGS -DUSBHID_NEW"
1829 AC_MSG_RESULT($have_usbhid_new)
1831 JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS bsd"
1832 JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS bsd/libjoystick_bsd.la"
1837 dnl Check for altivec instruction support using gas syntax
1840 AC_MSG_CHECKING(for GCC Altivec instruction support)
1842 save_CFLAGS="${CFLAGS}"
1843 CFLAGS="${CFLAGS} -DGCC_ALTIVEC -DUSE_ALTIVEC_BLITTERS -faltivec"
1845 vector unsigned int vzero() {
1846 return vec_splat_u32(0);
1850 have_gcc_altivec=yes
1852 if test x$have_gcc_altivec = xno; then
1853 CFLAGS="${save_CFLAGS}"
1855 AC_MSG_RESULT($have_gcc_altivec)
1858 dnl Check for a valid linux/version.h
1861 AC_CHECK_HEADER(linux/version.h, have_linux_version_h=yes)
1862 if test x$have_linux_version_h = xyes; then
1863 CFLAGS="$CFLAGS -DHAVE_LINUX_VERSION_H"
1868 *-*-linux*|*-*-gnu*|*-*-k*bsd*-gnu)
1870 *-*-linux*) ARCH=linux ;;
1871 *-*-kfreebsd*-gnu) ARCH=kfreebsd-gnu ;;
1872 *-*-knetbsd*-gnu) ARCH=knetbsd-gnu ;;
1873 *-*-kopenbsd*-gnu) ARCH=kopenbsd-gnu ;;
1874 *-*-gnu*) ARCH=gnu ;; # must be last
1903 # Set up files for the main() stub
1904 if test "x$video_qtopia" = "xyes"; then
1905 SDL_CFLAGS="$SDL_CFLAGS -Dmain=SDL_main"
1906 SDL_LIBS="-lSDLmain $SDL_LIBS"
1908 # Set up files for the audio library
1909 # We use the OSS and ALSA API's, not the Sun audio API
1910 #if test x$enable_audio = xyes; then
1911 # CFLAGS="$CFLAGS -DSUNAUDIO_SUPPORT"
1912 # AUDIO_SUBDIRS="$AUDIO_SUBDIRS sun"
1913 # AUDIO_DRIVERS="$AUDIO_DRIVERS sun/libaudio_sun.la"
1915 # Set up files for the joystick library
1916 if test x$enable_joystick = xyes; then
1919 JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS linux"
1920 JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS linux/libjoystick_linux.la"
1923 JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS dummy"
1924 JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS dummy/libjoystick_dummy.la"
1927 JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS bsd"
1928 JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS bsd/libjoystick_bsd.la"
1932 # Set up files for the cdrom library
1933 if test x$enable_cdrom = xyes; then
1936 CDROM_SUBDIRS="$CDROM_SUBDIRS linux"
1937 CDROM_DRIVERS="$CDROM_DRIVERS linux/libcdrom_linux.la"
1940 CDROM_SUBDIRS="$CDROM_SUBDIRS dummy"
1941 CDROM_DRIVERS="$CDROM_DRIVERS dummy/libcdrom_dummy.la"
1944 CDROM_SUBDIRS="$CDROM_SUBDIRS freebsd"
1945 CDROM_DRIVERS="$CDROM_DRIVERS freebsd/libcdrom_freebsd.la"
1947 knetbsd-gnu|kopenbsd-gnu)
1948 CDROM_SUBDIRS="$CDROM_SUBDIRS openbsd"
1949 CDROM_DRIVERS="$CDROM_DRIVERS openbsd/libcdrom_openbsd.la"
1953 # Set up files for the thread library
1954 if test x$enable_threads = xyes; then
1955 CopyUnixThreadSource
1957 # Set up files for the timer library
1958 if test x$enable_timers = xyes; then
1959 COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
1979 # Set up files for the audio library
1980 # We use the OSS and ALSA API's, not the Sun audio API
1981 #if test x$enable_audio = xyes; then
1982 # CFLAGS="$CFLAGS -DSUNAUDIO_SUPPORT"
1983 # AUDIO_SUBDIRS="$AUDIO_SUBDIRS sun"
1984 # AUDIO_DRIVERS="$AUDIO_DRIVERS sun/libaudio_sun.la"
1986 # Set up files for the joystick library
1987 # (No joystick support yet)
1988 if test x$enable_joystick = xyes; then
1989 JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS dummy"
1990 JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS dummy/libjoystick_dummy.la"
1992 # Set up files for the cdrom library
1993 if test x$enable_cdrom = xyes; then
1994 CDROM_SUBDIRS="$CDROM_SUBDIRS bsdi"
1995 CDROM_DRIVERS="$CDROM_DRIVERS bsdi/libcdrom_bsdi.la"
1997 # Set up files for the thread library
1998 if test x$enable_threads = xyes; then
1999 CopyUnixThreadSource
2001 # Set up files for the timer library
2002 if test x$enable_timers = xyes; then
2003 COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
2025 # Set up files for the audio library
2026 # We use the OSS and ALSA API's, not the Sun audio API
2027 #if test x$enable_audio = xyes; then
2028 # CFLAGS="$CFLAGS -DSUNAUDIO_SUPPORT"
2029 # AUDIO_SUBDIRS="$AUDIO_SUBDIRS sun"
2030 # AUDIO_DRIVERS="$AUDIO_DRIVERS sun/libaudio_sun.la"
2032 # Set up files for the cdrom library
2033 if test x$enable_cdrom = xyes; then
2034 CDROM_SUBDIRS="$CDROM_SUBDIRS freebsd"
2035 CDROM_DRIVERS="$CDROM_DRIVERS freebsd/libcdrom_freebsd.la"
2037 # Set up files for the thread library
2038 if test x$enable_threads = xyes; then
2039 CopyUnixThreadSource
2041 # Set up files for the timer library
2042 if test x$enable_timers = xyes; then
2043 COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
2062 # Set up files for the audio library
2063 if test x$enable_audio = xyes; then
2064 CFLAGS="$CFLAGS -DSUNAUDIO_SUPPORT"
2065 AUDIO_SUBDIRS="$AUDIO_SUBDIRS sun"
2066 AUDIO_DRIVERS="$AUDIO_DRIVERS sun/libaudio_sun.la"
2068 # Set up files for the cdrom library
2069 if test x$enable_cdrom = xyes; then
2070 CDROM_SUBDIRS="$CDROM_SUBDIRS openbsd"
2071 CDROM_DRIVERS="$CDROM_DRIVERS openbsd/libcdrom_openbsd.la"
2073 # Set up files for the thread library
2074 if test x$enable_threads = xyes; then
2075 if test x$use_pthreads = xyes; then
2076 CFLAGS="$CFLAGS -D_POSIX_THREAD_SYSCALL_SOFT=1"
2078 CopyUnixThreadSource
2080 # Set up files for the timer library
2081 if test x$enable_timers = xyes; then
2082 COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
2084 # NetBSD does not define "unix"
2085 CFLAGS="$CFLAGS -Dunix"
2103 # Set up files for the audio library
2104 if test x$enable_audio = xyes; then
2105 CFLAGS="$CFLAGS -DOPENBSD_AUDIO_SUPPORT"
2106 AUDIO_SUBDIRS="$AUDIO_SUBDIRS openbsd"
2107 AUDIO_DRIVERS="$AUDIO_DRIVERS openbsd/libaudio_openbsd.la"
2109 # OpenBSD needs linking with ossaudio emulation library
2110 if test x$have_oss = xyes; then
2111 SYSTEM_LIBS="$SYSTEM_LIBS -lossaudio"
2113 # Set up files for the cdrom library
2114 if test x$enable_cdrom = xyes; then
2115 CDROM_SUBDIRS="$CDROM_SUBDIRS openbsd"
2116 CDROM_DRIVERS="$CDROM_DRIVERS openbsd/libcdrom_openbsd.la"
2118 # Set up files for the thread library
2119 if test x$enable_threads = xyes; then
2120 CopyUnixThreadSource
2122 # Set up files for the timer library
2123 if test x$enable_timers = xyes; then
2124 COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
2126 # OpenBSD does not define "unix"
2127 CFLAGS="$CFLAGS -Dunix"
2144 # Set up files for the audio library
2145 if test x$enable_audio = xyes; then
2146 CFLAGS="$CFLAGS -DSUNAUDIO_SUPPORT"
2147 AUDIO_SUBDIRS="$AUDIO_SUBDIRS sun"
2148 AUDIO_DRIVERS="$AUDIO_DRIVERS sun/libaudio_sun.la"
2150 # Set up files for the joystick library
2151 # (No joystick support yet)
2152 if test x$enable_joystick = xyes; then
2153 JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS dummy"
2154 JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS dummy/libjoystick_dummy.la"
2156 # Set up files for the cdrom library
2157 if test x$enable_cdrom = xyes; then
2158 CDROM_SUBDIRS="$CDROM_SUBDIRS dummy"
2159 CDROM_DRIVERS="$CDROM_DRIVERS dummy/libcdrom_dummy.la"
2161 # Set up files for the thread library
2162 if test x$enable_threads = xyes; then
2163 CopyUnixThreadSource
2165 # Set up files for the timer library
2166 if test x$enable_timers = xyes; then
2167 COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
2172 CFLAGS="$CFLAGS -D__ELF__" # Fix for nasm on Solaris x86
2186 # Set up files for the audio library
2187 if test x$enable_audio = xyes; then
2188 CFLAGS="$CFLAGS -DSUNAUDIO_SUPPORT"
2189 AUDIO_SUBDIRS="$AUDIO_SUBDIRS sun"
2190 AUDIO_DRIVERS="$AUDIO_DRIVERS sun/libaudio_sun.la"
2192 # Set up files for the joystick library
2193 # (No joystick support yet)
2194 if test x$enable_joystick = xyes; then
2195 JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS dummy"
2196 JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS dummy/libjoystick_dummy.la"
2198 # Set up files for the cdrom library
2199 if test x$enable_cdrom = xyes; then
2200 CDROM_SUBDIRS="$CDROM_SUBDIRS linux"
2201 CDROM_DRIVERS="$CDROM_DRIVERS linux/libcdrom_linux.la"
2203 # Set up files for the thread library
2204 if test x$enable_threads = xyes; then
2205 CopyUnixThreadSource
2207 # Set up files for the timer library
2208 if test x$enable_timers = xyes; then
2209 COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
2225 # We use the dmedia audio API, not the Sun audio API
2226 #if test x$enable_audio = xyes; then
2227 # CFLAGS="$CFLAGS -DSUNAUDIO_SUPPORT"
2228 # AUDIO_SUBDIRS="$AUDIO_SUBDIRS sun"
2229 # AUDIO_DRIVERS="$AUDIO_DRIVERS sun/libaudio_sun.la"
2231 # Set up files for the joystick library
2232 # (No joystick support yet)
2233 if test x$enable_joystick = xyes; then
2234 JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS dummy"
2235 JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS dummy/libjoystick_dummy.la"
2237 # Set up files for the cdrom library
2238 # (No CD-ROM support yet)
2239 if test x$enable_cdrom = xyes; then
2240 CDROM_SUBDIRS="$CDROM_SUBDIRS dummy"
2241 CDROM_DRIVERS="$CDROM_DRIVERS dummy/libcdrom_dummy.la"
2243 # Set up files for the thread library
2244 if test x$enable_threads = xyes; then
2245 if test x$use_pthreads = xyes -o x$use_pth = xyes; then
2246 CopyUnixThreadSource
2248 COPY_ARCH_SRC(src/thread, irix, SDL_systhread.c)
2249 COPY_ARCH_SRC(src/thread, irix, SDL_systhread_c.h)
2250 COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex.c)
2251 COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex_c.h)
2252 COPY_ARCH_SRC(src/thread, linux, SDL_syssem.c)
2253 COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
2254 COPY_ARCH_SRC(src/thread, generic, SDL_syscond.c)
2255 COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
2258 # Set up files for the timer library
2259 if test x$enable_timers = xyes; then
2260 COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
2276 # Set up files for the audio library
2277 if test x$enable_audio = xyes; then
2278 CFLAGS="$CFLAGS -DSUNAUDIO_SUPPORT"
2279 AUDIO_SUBDIRS="$AUDIO_SUBDIRS sun"
2280 AUDIO_DRIVERS="$AUDIO_DRIVERS sun/libaudio_sun.la"
2282 # Set up files for the joystick library
2283 # (No joystick support yet)
2284 if test x$enable_joystick = xyes; then
2285 JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS dummy"
2286 JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS dummy/libjoystick_dummy.la"
2288 # Set up files for the cdrom library
2289 # (No CD-ROM support yet)
2290 if test x$enable_cdrom = xyes; then
2291 CDROM_SUBDIRS="$CDROM_SUBDIRS dummy"
2292 CDROM_DRIVERS="$CDROM_DRIVERS dummy/libcdrom_dummy.la"
2294 # Set up files for the thread library
2295 if test x$enable_threads = xyes; then
2296 CopyUnixThreadSource
2298 # Set up files for the timer library
2299 if test x$enable_timers = xyes; then
2300 COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
2316 # Set up files for the audio library
2317 if test x$enable_audio = xyes; then
2318 AUDIO_SUBDIRS="$AUDIO_SUBDIRS paudio"
2319 AUDIO_DRIVERS="$AUDIO_DRIVERS paudio/libaudio_paudio.la"
2321 # Set up files for the joystick library
2322 # (No joystick support yet)
2323 if test x$enable_joystick = xyes; then
2324 JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS dummy"
2325 JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS dummy/libjoystick_dummy.la"
2327 # Set up files for the cdrom library
2328 if test x$enable_cdrom = xyes; then
2329 CDROM_SUBDIRS="$CDROM_SUBDIRS aix"
2330 CDROM_DRIVERS="$CDROM_DRIVERS aix/libcdrom_aix.la"
2332 # Set up files for the thread library
2333 if test x$enable_threads = xyes; then
2334 CopyUnixThreadSource
2336 # Set up files for the timer library
2337 if test x$enable_timers = xyes; then
2338 COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
2353 # Set up files for the audio library
2354 if test x$enable_audio = xyes; then
2355 CFLAGS="$CFLAGS -I/usr/include/mme -DMMEAUDIO_SUPPORT"
2356 SYSTEM_LIBS="$SYSTEM_LIBS -lmme"
2357 AUDIO_SUBDIRS="$AUDIO_SUBDIRS mme"
2358 AUDIO_DRIVERS="$AUDIO_DRIVERS mme/libaudio_mme.la"
2360 # Set up files for the joystick library
2361 # (No joystick support yet)
2362 if test x$enable_joystick = xyes; then
2363 JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS dummy"
2364 JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS dummy/libjoystick_dummy.la"
2366 # Set up files for the cdrom library
2367 # (No cdrom support yet)
2368 if test x$enable_cdrom = xyes; then
2369 CDROM_SUBDIRS="$CDROM_SUBDIRS osf"
2370 CDROM_DRIVERS="$CDROM_DRIVERS osf/libcdrom_osf.la"
2372 # Set up files for the thread library
2373 if test x$enable_threads = xyes; then
2374 CopyUnixThreadSource
2376 # Set up files for the timer library
2377 if test x$enable_timers = xyes; then
2378 COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
2393 # Set up files for the audio library
2394 if test x$enable_audio = xyes; then
2395 CFLAGS="$CFLAGS -DQNXNTOAUDIO_SUPPORT"
2396 SYSTEM_LIBS="$SYSTEM_LIBS -lasound"
2397 AUDIO_SUBDIRS="$AUDIO_SUBDIRS nto"
2398 AUDIO_DRIVERS="$AUDIO_DRIVERS nto/libaudio_nto.la"
2400 # Set up files for the joystick library
2401 if test x$enable_joystick = xyes; then
2402 # (No joystick support yet)
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 qnx"
2409 CDROM_DRIVERS="$CDROM_DRIVERS qnx/libcdrom_qnx.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)
2420 *-*-cygwin* | *-*-mingw32*)
2422 if test "$build" != "$target"; then # cross-compiling
2423 # Default cross-compile location
2424 ac_default_prefix=/usr/local/cross-tools/i386-mingw32msvc
2426 # Look for the location of the tools and install there
2427 if test "$BUILD_PREFIX" != ""; then
2428 ac_default_prefix=$BUILD_PREFIX
2436 # Set up files for the audio library
2437 if test x$enable_audio = xyes; then
2438 AUDIO_SUBDIRS="$AUDIO_SUBDIRS windib"
2439 AUDIO_DRIVERS="$AUDIO_DRIVERS windib/libaudio_windib.la"
2440 if test x$use_directx = xyes; then
2441 AUDIO_SUBDIRS="$AUDIO_SUBDIRS windx5"
2442 AUDIO_DRIVERS="$AUDIO_DRIVERS windx5/libaudio_windx5.la"
2445 # Set up files for the joystick library
2446 if test x$enable_joystick = xyes; then
2447 JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS win32"
2448 JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS win32/libjoystick_winmm.la"
2450 # Set up files for the cdrom library
2451 if test x$enable_cdrom = xyes; then
2452 CDROM_SUBDIRS="$CDROM_SUBDIRS win32"
2453 CDROM_DRIVERS="$CDROM_DRIVERS win32/libcdrom_win32.la"
2455 # Set up files for the thread library
2456 if test x$enable_threads = xyes; then
2457 COPY_ARCH_SRC(src/thread, win32, SDL_systhread.c)
2458 COPY_ARCH_SRC(src/thread, win32, SDL_systhread_c.h)
2459 COPY_ARCH_SRC(src/thread, win32, SDL_sysmutex.c)
2460 COPY_ARCH_SRC(src/thread, generic, SDL_sysmutex_c.h)
2461 COPY_ARCH_SRC(src/thread, win32, SDL_syssem.c)
2462 COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
2463 COPY_ARCH_SRC(src/thread, generic, SDL_syscond.c)
2464 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, win32, SDL_systimer.c)
2470 # The Win32 platform requires special setup
2471 SDL_CFLAGS="$SDL_CFLAGS -Dmain=SDL_main"
2474 CFLAGS="$CFLAGS -I/usr/include/mingw -DWIN32 -Uunix -mno-cygwin"
2475 SDL_CFLAGS="$SDL_CFLAGS -I/usr/include/mingw -DWIN32 -Uunix -mno-cygwin"
2476 LIBS="$LIBS -mno-cygwin"
2477 SDL_LIBS="-lmingw32 -lSDLmain $SDL_LIBS -mwindows -mno-cygwin"
2480 SDL_LIBS="-lmingw32 -lSDLmain $SDL_LIBS -mwindows"
2486 ac_default_prefix=/boot/develop/tools/gnupro
2492 # Set up files for the audio library
2493 if test x$enable_audio = xyes; then
2494 AUDIO_SUBDIRS="$AUDIO_SUBDIRS baudio"
2495 AUDIO_DRIVERS="$AUDIO_DRIVERS baudio/libaudio_baudio.la"
2497 # Set up files for the joystick library
2498 if test x$enable_joystick = xyes; then
2499 JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS beos"
2500 JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS beos/libjoystick_beos.la"
2502 # Set up files for the cdrom library
2503 if test x$enable_cdrom = xyes; then
2504 CDROM_SUBDIRS="$CDROM_SUBDIRS beos"
2505 CDROM_DRIVERS="$CDROM_DRIVERS beos/libcdrom_beos.la"
2507 # Set up files for the thread library
2508 if test x$enable_threads = xyes; then
2509 COPY_ARCH_SRC(src/thread, beos, SDL_systhread.c)
2510 COPY_ARCH_SRC(src/thread, beos, SDL_systhread_c.h)
2511 COPY_ARCH_SRC(src/thread, generic, SDL_sysmutex.c)
2512 COPY_ARCH_SRC(src/thread, generic, SDL_sysmutex_c.h)
2513 COPY_ARCH_SRC(src/thread, beos, SDL_syssem.c)
2514 COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
2515 COPY_ARCH_SRC(src/thread, generic, SDL_syscond.c)
2516 COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
2518 # Set up files for the timer library
2519 if test x$enable_timers = xyes; then
2520 COPY_ARCH_SRC(src/timer, beos, SDL_systimer.c)
2522 # The BeOS platform requires special libraries
2523 SYSTEM_LIBS="$SYSTEM_LIBS -lroot -lbe -lmedia -lgame -ldevice -ltextencoding"
2526 # This would be used if cross-compiling to MacOS 9. No way to
2527 # use it at present, but Apple is working on a X-to-9 compiler
2528 # for which this case would be handy.
2534 # Set up files for the audio library
2535 if test x$enable_audio = xyes; then
2536 AUDIO_SUBDIRS="$AUDIO_SUBDIRS macrom"
2537 AUDIO_DRIVERS="$AUDIO_DRIVERS macrom/libaudio_macrom.la"
2539 # Set up files for the joystick library
2540 if test x$enable_joystick = xyes; then
2541 JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS macos"
2542 JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS macos/libjoystick_macos.la"
2544 # Set up files for the cdrom library
2545 if test x$enable_cdrom = xyes; then
2546 CDROM_SUBDIRS="$CDROM_SUBDIRS macos"
2547 CDROM_DRIVERS="$CDROM_DRIVERS macos/libcdrom_macos.la"
2549 # Set up files for the thread library
2550 if test x$enable_threads = xyes; then
2551 COPY_ARCH_SRC(src/thread, macos, SDL_systhread.c)
2552 COPY_ARCH_SRC(src/thread, macos, SDL_systhread_c.h)
2553 COPY_ARCH_SRC(src/thread, generic, SDL_sysmutex.c)
2554 COPY_ARCH_SRC(src/thread, generic, SDL_sysmutex_c.h)
2555 COPY_ARCH_SRC(src/thread, macos, SDL_syssem.c)
2556 COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
2557 COPY_ARCH_SRC(src/thread, generic, SDL_syscond.c)
2558 COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
2560 # Set up files for the timer library
2561 if test x$enable_timers = xyes; then
2562 COPY_ARCH_SRC(src/timer, macos, SDL_systimer.c)
2564 # The MacOS platform requires special setup
2565 SDL_CFLAGS="$SDL_CFLAGS -Dmain=SDL_main"
2566 SDL_LIBS="-lSDLmain $SDL_LIBS"
2569 # Strictly speaking, we want "Mac OS X", not "Darwin", which is
2570 # just the OS X kernel sans upper layers like Carbon and Cocoa.
2571 # But config.guess comes back with "darwin", so go with the flow.
2580 # If either the audio or CD driver is used, add the AudioUnit framework
2581 if test x$enable_audio = xyes -o x$enable_cdrom = xyes; then
2582 SYSTEM_LIBS="$SYSTEM_LIBS -framework AudioToolbox -framework AudioUnit"
2584 # Set up files for the audio library
2585 if test x$enable_audio = xyes; then
2586 AUDIO_SUBDIRS="$AUDIO_SUBDIRS macosx"
2587 AUDIO_DRIVERS="$AUDIO_DRIVERS macosx/libaudio_macosx.la"
2588 AUDIO_SUBDIRS="$AUDIO_SUBDIRS macrom"
2589 AUDIO_DRIVERS="$AUDIO_DRIVERS macrom/libaudio_macrom.la"
2591 # Set up files for the joystick library
2592 if test x$enable_joystick = xyes; then
2593 JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS darwin"
2594 JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS darwin/libjoystick_darwin.la"
2595 SYSTEM_LIBS="$SYSTEM_LIBS -framework IOKit"
2597 # Set up files for the cdrom library
2598 if test x$enable_cdrom = xyes; then
2599 CDROM_SUBDIRS="$CDROM_SUBDIRS macosx"
2600 CDROM_DRIVERS="$CDROM_DRIVERS macosx/libcdrom_macosx.la"
2601 SYSTEM_LIBS="$SYSTEM_LIBS -lstdc++"
2603 # Set up files for the thread library
2604 if test x$enable_threads = xyes; then
2605 CopyUnixThreadSource
2607 # Set up files for the timer library
2608 if test x$enable_timers = xyes; then
2609 COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
2611 # The MacOS X platform requires special setup.
2612 SDL_LIBS="-lSDLmain $SDL_LIBS"
2613 # The Cocoa backend still needs Carbon, and the YUV code QuickTime
2614 SYSTEM_LIBS="$SYSTEM_LIBS -framework Cocoa -framework Carbon -framework QuickTime"
2621 CheckAtariXbiosVideo
2627 # Set up files for the audio library
2628 if test x$enable_threads = xyes -a x$enable_pth = xyes; then
2629 if test x$enable_audio = xyes; then
2630 CFLAGS="$CFLAGS -DSUNAUDIO_SUPPORT"
2631 AUDIO_SUBDIRS="$AUDIO_SUBDIRS sun"
2632 AUDIO_DRIVERS="$AUDIO_DRIVERS sun/libaudio_sun.la"
2635 # Set up files for the joystick library
2636 if test x$enable_joystick = xyes; then
2637 JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS mint"
2638 JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS mint/libjoystick_mint.la"
2640 # Set up files for the cdrom library
2641 if test x$enable_cdrom = xyes; then
2642 CDROM_SUBDIRS="$CDROM_SUBDIRS mint"
2643 CDROM_DRIVERS="$CDROM_DRIVERS mint/libcdrom_mint.la"
2645 # Set up files for the thread library
2646 if test x$enable_threads = xyes; then
2647 CopyUnixThreadSource
2649 # Set up files for the timer library
2650 if test x$enable_timers = xyes; then
2651 if test x$enable_threads = xyes -a x$enable_pth = xyes; then
2652 COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
2654 COPY_ARCH_SRC(src/timer, mint, SDL_systimer.c)
2657 # MiNT does not define "unix"
2658 CFLAGS="$CFLAGS -Dunix"
2662 # Set up files for the video library
2663 if test x$enable_video = xyes; then
2664 VIDEO_SUBDIRS="$VIDEO_SUBDIRS riscos"
2665 VIDEO_DRIVERS="$VIDEO_DRIVERS riscos/libvideo_riscos.la"
2667 # Set up files for the audio library
2668 if test x$enable_audio = xyes; then
2669 CFLAGS="$CFLAGS -DOSS_SUPPORT"
2670 AUDIO_SUBDIRS="$AUDIO_SUBDIRS dsp"
2671 AUDIO_DRIVERS="$AUDIO_DRIVERS dsp/libaudio_dsp.la"
2672 AUDIO_SUBDIRS="$AUDIO_SUBDIRS dma"
2673 AUDIO_DRIVERS="$AUDIO_DRIVERS dma/libaudio_dma.la"
2675 # Set up files for the joystick library
2676 if test x$enable_joystick = xyes; then
2677 JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS riscos"
2678 JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS riscos/libjoystick_riscos.la"
2680 # Set up files for the cdrom library
2681 if test x$enable_cdrom = xyes; then
2682 CDROM_SUBDIRS="$CDROM_SUBDIRS dummy"
2683 CDROM_DRIVERS="$CDROM_DRIVERS dummy/libcdrom_dummy.la"
2685 # Set up files for the thread library
2686 if test x$enable_threads = xyes; then
2687 COPY_ARCH_SRC(src/thread, riscos, SDL_systhread.c)
2688 COPY_ARCH_SRC(src/thread, riscos, SDL_systhread_c.h)
2689 COPY_ARCH_SRC(src/thread, riscos, SDL_sysmutex.c)
2690 COPY_ARCH_SRC(src/thread, riscos, SDL_sysmutex_c.h)
2691 COPY_ARCH_SRC(src/thread, riscos, SDL_syssem.c)
2692 COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
2693 COPY_ARCH_SRC(src/thread, riscos, SDL_syscond.c)
2694 COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
2696 CFLAGS="$CFLAGS -DDISABLE_THREADS"
2698 # Set up files for the timer library
2699 if test x$enable_timers = xyes; then
2700 COPY_ARCH_SRC(src/timer, riscos, SDL_systimer.c)
2703 CFLAGS="$CFLAGS -DENABLE_RISCOS"
2705 SYSTEM_LIBS="$SYSTEM_LIBS -ljpeg -ltiff -lpng -lz"
2708 AC_MSG_ERROR(Unsupported target: Please add to configure.in)
2713 # Set the conditional variables for this target
2714 AM_CONDITIONAL(TARGET_LINUX, test $ARCH = linux)
2715 AM_CONDITIONAL(TARGET_QTOPIA, test "x$video_qtopia" = "xyes")
2716 AM_CONDITIONAL(TARGET_SOLARIS, test $ARCH = solaris)
2717 AM_CONDITIONAL(TARGET_IRIX, test $ARCH = irix)
2718 AM_CONDITIONAL(TARGET_BSDI, test $ARCH = bsdi)
2719 AM_CONDITIONAL(TARGET_FREEBSD, test $ARCH = freebsd)
2720 AM_CONDITIONAL(TARGET_NETBSD, test $ARCH = netbsd)
2721 AM_CONDITIONAL(TARGET_OPENBSD, test $ARCH = openbsd)
2722 AM_CONDITIONAL(TARGET_AIX, test $ARCH = aix)
2723 AM_CONDITIONAL(TARGET_WIN32, test $ARCH = win32)
2724 AM_CONDITIONAL(TARGET_BEOS, test $ARCH = beos)
2725 AM_CONDITIONAL(TARGET_MACOS, test $ARCH = macos)
2726 AM_CONDITIONAL(TARGET_MACOSX, test $ARCH = macosx)
2727 AM_CONDITIONAL(TARGET_QNX, test $ARCH = qnx)
2728 AM_CONDITIONAL(TARGET_MINT, test $ARCH = mint)
2730 # More automake conditionals
2731 AM_CONDITIONAL(USE_DIRECTX, test x$use_directx = xyes)
2732 AM_CONDITIONAL(USE_CLONE, test x$use_clone = xyes)
2733 AM_CONDITIONAL(HAVE_NASM, test x$use_nasm = xyes)
2735 # Set conditional variables for shared and static library selection.
2736 # These are not used in any Makefile.am but in sdl-config.in.
2737 AM_CONDITIONAL([ENABLE_SHARED], [test "$enable_shared" = yes])
2738 AM_CONDITIONAL([ENABLE_STATIC], [test "$enable_static" = yes])
2740 # Set runtime shared library paths as needed
2742 if test $ARCH = linux -o $ARCH = freebsd -o $ARCH = bsdi; then
2743 SDL_RLD_FLAGS="-Wl,-rpath,\${exec_prefix}/lib"
2745 if test $ARCH = solaris; then
2746 SDL_RLD_FLAGS="-R\${exec_prefix}/lib"
2750 openbsd | netbsd | bsdi)
2751 SHARED_SYSTEM_LIBS="$SYSTEM_LIBS"
2754 SHARED_SYSTEM_LIBS="$SYSTEM_LIBS"
2757 SHARED_SYSTEM_LIBS="-framework Cocoa"
2758 if test x$enable_video = xyes -a x$enable_video_opengl = xyes; then
2759 SHARED_SYSTEM_LIBS="$SHARED_SYSTEM_LIBS -framework OpenGL"
2763 SHARED_SYSTEM_LIBS=""
2769 # Evil hack to allow static linking on Mac OS X
2770 SDL_STATIC_LIBS="\${exec_prefix}/lib/libSDLmain.a \${exec_prefix}/lib/libSDL.a"
2773 SDL_STATIC_LIBS="$SDL_LIBS"
2778 STATIC_SYSTEM_LIBS="$SYSTEM_LIBS"
2780 dnl Output the video drivers we use
2781 if test x$enable_video = xtrue; then
2782 if test "$VIDEO_SUBDIRS" = ""; then
2783 AC_MSG_ERROR(*** No video drivers are enabled!)
2786 AC_SUBST(AUDIO_SUBDIRS)
2787 AC_SUBST(AUDIO_DRIVERS)
2788 AC_SUBST(VIDEO_SUBDIRS)
2789 AC_SUBST(VIDEO_DRIVERS)
2790 AC_SUBST(JOYSTICK_SUBDIRS)
2791 AC_SUBST(JOYSTICK_DRIVERS)
2792 AC_SUBST(CDROM_SUBDIRS)
2793 AC_SUBST(CDROM_DRIVERS)
2794 AC_SUBST(SDL_EXTRADIRS)
2795 AC_SUBST(SDL_EXTRALIBS)
2797 dnl Expand the cflags and libraries needed by apps using SDL
2798 AC_SUBST(SDL_CFLAGS)
2800 AC_SUBST(SDL_STATIC_LIBS)
2801 AC_SUBST(SDL_RLD_FLAGS)
2803 dnl Expand the libraries needed for static and dynamic linking
2804 AC_SUBST(STATIC_SYSTEM_LIBS)
2805 AC_SUBST(SHARED_SYSTEM_LIBS)
2806 AC_SUBST(SYSTEM_LIBS)
2808 dnl Expand the include directories for building SDL
2809 CFLAGS="$CFLAGS -I\$(top_srcdir)/include"
2810 CFLAGS="$CFLAGS -I\$(top_srcdir)/include/SDL"
2811 CFLAGS="$CFLAGS -I\$(top_srcdir)/src -I\$(top_srcdir)/src/main/$ARCH"
2812 CFLAGS="$CFLAGS -I\$(top_srcdir)/src/audio"
2813 CFLAGS="$CFLAGS -I\$(top_srcdir)/src/video"
2814 CFLAGS="$CFLAGS -I\$(top_srcdir)/src/video/XFree86/extensions"
2815 CFLAGS="$CFLAGS -I\$(top_srcdir)/src/events"
2816 CFLAGS="$CFLAGS -I\$(top_srcdir)/src/joystick"
2817 CFLAGS="$CFLAGS -I\$(top_srcdir)/src/cdrom"
2818 CFLAGS="$CFLAGS -I\$(top_srcdir)/src/thread"
2819 CFLAGS="$CFLAGS -I\$(top_srcdir)/src/timer"
2820 CFLAGS="$CFLAGS -I\$(top_srcdir)/src/endian"
2821 CFLAGS="$CFLAGS -I\$(top_srcdir)/src/file"
2822 CFLAGS="$CFLAGS -I\$(top_builddir)/src/thread"
2826 # Check for darwin at the very end and set up the Objective C compiler
2827 # We do this here so that we get the full CFLAGS into OBJCFLAGS
2830 dnl AC_PROG_OBJC doesn't seem to exist, this is the SDL workaround
2831 AC_MSG_CHECKING(for an Objective-C compiler)
2836 dnl _AM_DEPENDENCIES(OBJC) doesn't work, so hard code OBJCDEPMODE here
2837 dnl _AM_DEPENDENCIES(OBJC)
2838 dnl Of course, hard coding doesn't work for some versions of automake
2839 OBJCDEPMODE="depmode=gcc"
2840 AC_SUBST(OBJCDEPMODE)
2841 dnl Trying this to satisfy everybody...
2842 AC_MSG_RESULT(not implemented yet)
2846 # Finally create all the generated files
2847 dnl Important: Any directory that you want to be in the distcheck should
2848 dnl have a file listed here, so that configure generates the
2849 dnl subdirectories on the build target.
2858 src/main/macosx/Makefile
2859 src/main/macosx/Info.plist
2861 src/audio/alsa/Makefile
2862 src/audio/arts/Makefile
2863 src/audio/baudio/Makefile
2864 src/audio/dc/Makefile
2865 src/audio/disk/Makefile
2866 src/audio/dma/Makefile
2867 src/audio/dmedia/Makefile
2868 src/audio/dsp/Makefile
2869 src/audio/esd/Makefile
2870 src/audio/macosx/Makefile
2871 src/audio/macrom/Makefile
2872 src/audio/mint/Makefile
2873 src/audio/mme/Makefile
2874 src/audio/nas/Makefile
2875 src/audio/nto/Makefile
2876 src/audio/openbsd/Makefile
2877 src/audio/paudio/Makefile
2878 src/audio/sun/Makefile
2879 src/audio/ums/Makefile
2880 src/audio/windib/Makefile
2881 src/audio/windx5/Makefile
2883 src/video/aalib/Makefile
2884 src/video/ataricommon/Makefile
2885 src/video/bwindow/Makefile
2886 src/video/cybergfx/Makefile
2887 src/video/dc/Makefile
2888 src/video/dga/Makefile
2889 src/video/directfb/Makefile
2890 src/video/dummy/Makefile
2891 src/video/epoc/Makefile
2892 src/video/fbcon/Makefile
2893 src/video/gem/Makefile
2894 src/video/ggi/Makefile
2895 src/video/maccommon/Makefile
2896 src/video/macdsp/Makefile
2897 src/video/macrom/Makefile
2898 src/video/nanox/Makefile
2899 src/video/photon/Makefile
2900 src/video/picogui/Makefile
2901 src/video/ps2gs/Makefile
2902 src/video/qtopia/Makefile
2903 src/video/quartz/Makefile
2904 src/video/riscos/Makefile
2905 src/video/svga/Makefile
2906 src/video/vgl/Makefile
2907 src/video/wincommon/Makefile
2908 src/video/windib/Makefile
2909 src/video/windx5/Makefile
2910 src/video/x11/Makefile
2911 src/video/xbios/Makefile
2912 src/video/XFree86/Makefile
2913 src/video/XFree86/extensions/Makefile
2914 src/video/XFree86/Xinerama/Makefile
2915 src/video/XFree86/Xv/Makefile
2916 src/video/XFree86/Xxf86dga/Makefile
2917 src/video/XFree86/Xxf86vm/Makefile
2919 src/joystick/Makefile
2920 src/joystick/amigaos/Makefile
2921 src/joystick/beos/Makefile
2922 src/joystick/bsd/Makefile
2923 src/joystick/darwin/Makefile
2924 src/joystick/dc/Makefile
2925 src/joystick/dummy/Makefile
2926 src/joystick/linux/Makefile
2927 src/joystick/macos/Makefile
2928 src/joystick/mint/Makefile
2929 src/joystick/riscos/Makefile
2930 src/joystick/win32/Makefile
2932 src/cdrom/aix/Makefile
2933 src/cdrom/beos/Makefile
2934 src/cdrom/dc/Makefile
2935 src/cdrom/dummy/Makefile
2936 src/cdrom/bsdi/Makefile
2937 src/cdrom/freebsd/Makefile
2938 src/cdrom/linux/Makefile
2939 src/cdrom/macos/Makefile
2940 src/cdrom/macosx/Makefile
2941 src/cdrom/mint/Makefile
2942 src/cdrom/openbsd/Makefile
2943 src/cdrom/osf/Makefile
2944 src/cdrom/qnx/Makefile
2945 src/cdrom/win32/Makefile
2950 src/cpuinfo/Makefile
2955 ], [chmod +x sdl-config])