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 Setup for automake
41 AM_INIT_AUTOMAKE(SDL, $SDL_VERSION)
43 dnl Detect the canonical host and target build environment
62 # This is stupid, but necessary on some versions of Linux (joysticks)
70 dnl The alpha architecture needs special flags for binary portability
73 if test x$ac_cv_prog_gcc = xyes; then
74 CFLAGS="$CFLAGS -mcpu=ev4 -Wa,-mall"
79 dnl Add compiler-specific optimization flags
81 dnl See if the user wants aggressive optimizations of the code
83 [ --enable-debug Disable aggressive optimizations [default=yes]],
85 if test x$enable_debug != xyes; then
86 if test x$ac_cv_prog_gcc = xyes; then
87 CFLAGS="$CFLAGS -fexpensive-optimizations"
88 # Ack! This breaks the MMX YV12 conversion on gcc 2.95.2
89 # CFLAGS="$CFLAGS -fomit-frame-pointer"
93 if test x$ac_cv_prog_gcc = xyes; then
94 CFLAGS="$CFLAGS -march=486"
98 if test x$ac_cv_prog_gcc = xyes; then
99 CFLAGS="$CFLAGS -march=pentium -mcpu=pentiumpro"
103 if test x$ac_cv_prog_gcc != xyes; then
104 CFLAGS="-g3 -fast -arch host"
110 dnl Add verbose warnings by default, and allow ANSI compliance checking
111 AC_ARG_ENABLE(strict-ansi,
112 [ --enable-strict-ansi Enable strict ANSI compliance build [default=no]],
113 , enable_strict_ansi=no)
114 if test x$ac_cv_prog_gcc = xyes; then
115 CFLAGS="$CFLAGS -Wall"
116 if test x$enable_strict_ansi = xyes; then
117 CFLAGS="$CFLAGS -ansi -pedantic -D_XOPEN_SOURCE"
121 dnl Initialize the compiler and linker flags for SDL applications
126 dnl Add the math library for the new gamma correction support
129 *-*-cygwin* | *-*-mingw32*)
142 SYSTEM_LIBS="$SYSTEM_LIBS $MATHLIB"
144 dnl Enable/disable various subsystems of the SDL library
147 [ --enable-audio Enable the audio subsystem [default=yes]],
149 if test x$enable_audio = xyes; then
150 SDL_EXTRADIRS="$SDL_EXTRADIRS audio"
151 SDL_EXTRALIBS="$SDL_EXTRALIBS audio/libaudio.la"
153 CFLAGS="$CFLAGS -DDISABLE_AUDIO"
156 [ --enable-video Enable the video subsystem [default=yes]],
158 if test x$enable_video = xyes; then
159 SDL_EXTRADIRS="$SDL_EXTRADIRS video"
160 SDL_EXTRALIBS="$SDL_EXTRALIBS video/libvideo.la"
162 CFLAGS="$CFLAGS -DDISABLE_VIDEO"
164 AC_ARG_ENABLE(events,
165 [ --enable-events Enable the events subsystem [default=yes]],
167 if test x$enable_video = xyes -a x$enable_events = xyes; then
168 SDL_EXTRADIRS="$SDL_EXTRADIRS events"
169 SDL_EXTRALIBS="$SDL_EXTRALIBS events/libevents.la"
171 CFLAGS="$CFLAGS -DDISABLE_EVENTS"
173 AC_ARG_ENABLE(joystick,
174 [ --enable-joystick Enable the joystick subsystem [default=yes]],
175 , enable_joystick=yes)
176 if test x$enable_joystick = xyes; then
177 SDL_EXTRADIRS="$SDL_EXTRADIRS joystick"
178 SDL_EXTRALIBS="$SDL_EXTRALIBS joystick/libjoystick.la"
180 CFLAGS="$CFLAGS -DDISABLE_JOYSTICK"
183 [ --enable-cdrom Enable the cdrom subsystem [default=yes]],
185 if test x$enable_cdrom = xyes; then
186 SDL_EXTRADIRS="$SDL_EXTRADIRS cdrom"
187 SDL_EXTRALIBS="$SDL_EXTRALIBS cdrom/libcdrom.la"
189 CFLAGS="$CFLAGS -DDISABLE_CDROM"
191 AC_ARG_ENABLE(threads,
192 [ --enable-threads Enable the threading subsystem [default=yes]],
193 , enable_threads=yes)
194 SDL_EXTRADIRS="$SDL_EXTRADIRS thread"
195 SDL_EXTRALIBS="$SDL_EXTRALIBS thread/libthread.la"
196 if test x$enable_threads != xyes; then
197 CFLAGS="$CFLAGS -DDISABLE_THREADS"
198 COPY_ARCH_SRC(src/thread, generic, SDL_systhread.c)
199 COPY_ARCH_SRC(src/thread, generic, SDL_systhread_c.h)
200 COPY_ARCH_SRC(src/thread, generic, SDL_sysmutex.c)
201 COPY_ARCH_SRC(src/thread, generic, SDL_sysmutex_c.h)
202 COPY_ARCH_SRC(src/thread, generic, SDL_syssem.c)
203 COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
204 COPY_ARCH_SRC(src/thread, generic, SDL_syscond.c)
205 COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
207 AC_ARG_ENABLE(timers,
208 [ --enable-timers Enable the timer subsystem [default=yes]],
210 if test x$enable_timers = xyes; then
211 SDL_EXTRADIRS="$SDL_EXTRADIRS timer"
212 SDL_EXTRALIBS="$SDL_EXTRALIBS timer/libtimer.la"
214 CFLAGS="$CFLAGS -DDISABLE_TIMERS"
216 AC_ARG_ENABLE(endian,
217 [ --enable-endian Enable the endian subsystem [default=yes]],
219 if test x$enable_endian = xyes; then
220 SDL_EXTRADIRS="$SDL_EXTRADIRS endian"
221 SDL_EXTRALIBS="$SDL_EXTRALIBS endian/libendian.la"
223 CFLAGS="$CFLAGS -DDISABLE_ENDIAN"
226 [ --enable-file Enable the file subsystem [default=yes]],
228 if test x$enable_file = xyes; then
229 SDL_EXTRADIRS="$SDL_EXTRADIRS file"
230 SDL_EXTRALIBS="$SDL_EXTRALIBS file/libfile.la"
232 CFLAGS="$CFLAGS -DDISABLE_FILE"
235 dnl See if the OSS audio interface is supported
239 [ --enable-oss support the OSS audio API [default=yes]],
241 if test x$enable_audio = xyes -a x$enable_oss = xyes; then
242 AC_MSG_CHECKING(for OSS audio support)
246 #include <linux/soundcard.h>
249 #include <machine/soundcard.h>
252 #include <sys/soundcard.h>
255 #include <sys/soundcard.h>
258 int arg = SNDCTL_DSP_SETFRAGMENT;
262 AC_MSG_RESULT($have_oss)
263 if test x$have_oss = xyes; then
264 CFLAGS="$CFLAGS -DOSS_SUPPORT"
265 AUDIO_SUBDIRS="$AUDIO_SUBDIRS dsp"
266 AUDIO_DRIVERS="$AUDIO_DRIVERS dsp/libaudio_dsp.la"
267 AUDIO_SUBDIRS="$AUDIO_SUBDIRS dma"
268 AUDIO_DRIVERS="$AUDIO_DRIVERS dma/libaudio_dma.la"
273 dnl See if the ALSA audio interface is supported
277 [ --enable-alsa support the ALSA audio API [default=yes]],
279 if test x$enable_audio = xyes -a x$enable_alsa = xyes; then
281 AC_CHECK_HEADER(sys/asoundlib.h, have_alsa_hdr=yes)
282 AC_CHECK_LIB(asound, snd_pcm_open, have_alsa_lib=yes)
283 if test x$have_alsa_hdr = xyes -a x$have_alsa_lib = xyes; then
284 CFLAGS="$CFLAGS -DALSA_SUPPORT"
285 SYSTEM_LIBS="$SYSTEM_LIBS -lasound"
286 AUDIO_SUBDIRS="$AUDIO_SUBDIRS alsa"
287 AUDIO_DRIVERS="$AUDIO_DRIVERS alsa/libaudio_alsa.la"
292 dnl Find the ESD includes and libraries
296 [ --enable-esd support the Enlightened Sound Daemon [default=yes]],
298 if test x$enable_audio = xyes -a x$enable_esd = xyes; then
300 CFLAGS="$CFLAGS -DESD_SUPPORT $ESD_CFLAGS"
301 SYSTEM_LIBS="$SYSTEM_LIBS $ESD_LIBS"
302 AUDIO_SUBDIRS="$AUDIO_SUBDIRS esd"
303 AUDIO_DRIVERS="$AUDIO_DRIVERS esd/libaudio_esd.la"
311 [ --enable-arts support the Analog Real Time Synthesizer [default=yes]],
313 if test x$enable_audio = xyes -a x$enable_arts = xyes; then
314 AC_PATH_PROG(ARTSCCONFIG, artsc-config)
315 if test x$ARTSCCONFIG = x -o x$ARTSCCONFIG = x'"$ARTSCCONFIG"'; then
316 : # arts isn't installed
318 ARTSC_CFLAGS=`$ARTSCCONFIG --cflags`
319 ARTSC_LIBS=`$ARTSCCONFIG --libs`
320 AC_MSG_CHECKING(for aRts development environment)
322 save_CFLAGS="$CFLAGS"
323 CFLAGS="$CFLAGS $ARTSC_CFLAGS"
327 arts_stream_t stream;
331 CFLAGS="$save_CFLAGS"
332 AC_MSG_RESULT($audio_arts)
333 if test x$audio_arts = xyes; then
334 CFLAGS="$CFLAGS -DARTSC_SUPPORT $ARTSC_CFLAGS"
335 SYSTEM_LIBS="$SYSTEM_LIBS $ARTSC_LIBS"
336 AUDIO_SUBDIRS="$AUDIO_SUBDIRS arts"
337 AUDIO_DRIVERS="$AUDIO_DRIVERS arts/libaudio_arts.la"
343 dnl See if the NAS audio interface is supported
347 [ --enable-nas support the NAS audio API [default=yes]],
349 if test x$enable_audio = xyes -a x$enable_nas = xyes; then
350 AC_MSG_CHECKING(for NAS audio support)
352 if test -r /usr/X11R6/include/audio/audiolib.h ; then
355 AC_MSG_RESULT($have_nas)
356 if test x$have_nas = xyes; then
357 CFLAGS="$CFLAGS -DNAS_SUPPORT"
358 SYSTEM_LIBS="$SYSTEM_LIBS -laudio -lXt"
359 AUDIO_SUBDIRS="$AUDIO_SUBDIRS nas"
360 AUDIO_DRIVERS="$AUDIO_DRIVERS nas/libaudio_nas.la"
365 dnl See if we can use x86 assembly blitters
368 dnl Make sure we are running on an x86 platform
377 dnl Check for NASM (for assembly blit routines)
379 [ --enable-nasm use nasm assembly blitters on x86 [default=yes]],
381 if test x$enable_video = xyes -a x$enable_nasm = xyes; then
382 AC_PATH_PROG(NASM, nasm)
383 if test x$NASM = x -o x$NASM = x'"$NASM"'; then
384 : # nasm isn't installed
386 CFLAGS="$CFLAGS -DUSE_ASMBLIT -I$srcdir/hermes"
396 CFLAGS="$CFLAGS -I\$(top_srcdir)/src/hermes"
397 SDL_EXTRADIRS="$SDL_EXTRADIRS hermes"
398 SDL_EXTRALIBS="$SDL_EXTRALIBS hermes/libhermes.la"
403 dnl Find the X11 include and library directories
406 AC_ARG_ENABLE(video-x11,
407 [ --enable-video-x11 use X11 video driver [default=yes]],
408 , enable_video_x11=yes)
409 if test x$enable_video = xyes -a x$enable_video_x11 = xyes; then
412 if test x$have_x = xyes; then
413 CFLAGS="$CFLAGS $X_CFLAGS -DENABLE_X11"
414 if test x$ac_cv_func_shmat != xyes; then
415 CFLAGS="$CFLAGS -DNO_SHARED_MEMORY"
417 SYSTEM_LIBS="$SYSTEM_LIBS $X_LIBS -lX11 -lXext"
418 VIDEO_SUBDIRS="$VIDEO_SUBDIRS x11"
419 VIDEO_DRIVERS="$VIDEO_DRIVERS x11/libvideo_x11.la"
421 AC_ARG_ENABLE(video-x11-vm,
422 [ --enable-video-x11-vm use X11 VM extension for fullscreen [default=yes]],
423 , enable_video_x11_vm=yes)
424 if test x$enable_video_x11_vm = xyes; then
425 AC_MSG_CHECKING(for XFree86 VidMode 1.0 support)
428 #include <X11/Xlib.h>
429 #include <X11/extensions/xf86vmode.h>
434 AC_MSG_RESULT($video_x11_vm)
435 if test x$video_x11_vm = xyes; then
436 CFLAGS="$CFLAGS -DXFREE86_VM"
437 # Check for nasty XFree86 4.0/Glide hack
438 AC_ARG_ENABLE(xfree86_glidehack,
439 [ --enable-xfree86-glidehack Alternate vidmode lib for old Glide [default=no]],
440 , enable_xfreeglidehack=no)
441 if test x$enable_xfree86_glidehack = xyes; then
443 LIBS="$LIBS $X_LIBS -lX11 -lXext"
444 if test x$xfree86_glidehack = x; then
445 AC_CHECK_LIB(Xxf86vm, XF40VidModeQueryExtension, xfree86_glidehack=Xxf86vm)
447 if test x$xfree86_glidehack = x; then
448 AC_CHECK_LIB(Xxf86vm40, XF40VidModeQueryExtension, xfree86_glidehack=Xxf86vm40)
452 if test x$xfree86_glidehack != x; then
453 CFLAGS="$CFLAGS -DXFREE86_VM_DYNAMIC_HACK"
454 SYSTEM_LIBS="$SYSTEM_LIBS -l$xfree86_glidehack"
456 SYSTEM_LIBS="$SYSTEM_LIBS -lXxf86vm"
458 AC_MSG_CHECKING(for XFree86 VidMode gamma support)
461 #include <X11/Xlib.h>
462 #include <X11/extensions/xf86vmode.h>
464 XF86VidModeGamma gamma;
466 video_x11_vmgamma=yes
468 AC_MSG_RESULT($video_x11_vmgamma)
469 if test x$video_x11_vmgamma = xyes; then
470 CFLAGS="$CFLAGS -DXFREE86_VMGAMMA"
474 AC_ARG_ENABLE(video-x11-dgamouse,
475 [ --enable-video-x11-dgamouse use X11 DGA for mouse events [default=yes]],
476 , enable_video_x11_dgamouse=yes)
477 AC_MSG_CHECKING(for XFree86 DGA 1.0 support)
480 #include <X11/Xlib.h>
481 #include <X11/extensions/xf86dga.h>
486 AC_MSG_RESULT($video_x11_dga)
487 if test x$video_x11_dga = xyes; then
488 CFLAGS="$CFLAGS -DXFREE86_DGAMOUSE"
489 if test x$enable_video_x11_dgamouse = xyes; then
490 CFLAGS="$CFLAGS -DDEFAULT_DGAMOUSE"
492 SYSTEM_LIBS="$SYSTEM_LIBS -lXxf86dga"
494 AC_ARG_ENABLE(video-x11-xv,
495 [ --enable-video-x11-xv use X11 XvImage extension for video [default=yes]],
496 , enable_video_x11_xv=yes)
497 if test x$enable_video_x11_xv = xyes; then
498 AC_MSG_CHECKING(for XFree86 XvImage support)
501 #include <X11/Xlib.h>
504 #include <X11/extensions/XShm.h>
505 #include <X11/extensions/Xvlib.h>
511 AC_MSG_RESULT($video_x11_xv)
512 if test x$video_x11_xv = xyes; then
513 CFLAGS="$CFLAGS -DXFREE86_XV"
514 SYSTEM_LIBS="$SYSTEM_LIBS -lXv"
522 AC_ARG_ENABLE(video-photon,
523 [ --enable-video-photon use QNX Photonvideo driver [default=yes]],
524 , enable_video_photon=yes)
525 if test x$enable_video = xyes -a x$enable_video_photon = xyes; then
526 AC_MSG_CHECKING(for QNX Photon support)
531 #include <photon/Pg.h>
532 #include <photon/PdDirect.h>
534 PgDisplaySettings_t *visual;
538 AC_MSG_RESULT($video_photon)
539 if test x$video_photon = xyes; then
540 SYSTEM_LIBS="$SYSTEM_LIBS -lph"
541 VIDEO_SUBDIRS="$VIDEO_SUBDIRS photon"
542 VIDEO_DRIVERS="$VIDEO_DRIVERS photon/libvideo_photon.la"
547 dnl Find the X11 DGA 2.0 include and library directories
550 AC_ARG_ENABLE(video-dga,
551 [ --enable-video-dga use DGA 2.0 video driver [default=yes]],
552 , enable_video_dga=yes)
553 if test x$video_x11_dga = xyes -a x$enable_video_dga = xyes; then
554 AC_MSG_CHECKING(for XFree86 DGA 2.0 support)
557 #include <X11/Xlib.h>
558 #include <X11/extensions/xf86dga.h>
564 AC_MSG_RESULT($video_x11_dga2)
565 if test x$video_x11_dga2 = xyes; then
566 CFLAGS="$CFLAGS -DENABLE_DGA"
567 VIDEO_SUBDIRS="$VIDEO_SUBDIRS dga"
568 VIDEO_DRIVERS="$VIDEO_DRIVERS dga/libvideo_dga.la"
573 dnl Find the framebuffer console includes
576 AC_ARG_ENABLE(video-fbcon,
577 [ --enable-video-fbcon use framebuffer console video driver [default=yes]],
578 , enable_video_fbcon=yes)
579 if test x$enable_video = xyes -a x$enable_video_fbcon = xyes; then
580 AC_MSG_CHECKING(for framebuffer console support)
583 #include <linux/fb.h>
584 #include <linux/kd.h>
585 #include <linux/keyboard.h>
590 AC_MSG_RESULT($video_fbcon)
591 if test x$video_fbcon = xyes; then
592 CFLAGS="$CFLAGS -DENABLE_FBCON"
593 VIDEO_SUBDIRS="$VIDEO_SUBDIRS fbcon"
594 VIDEO_DRIVERS="$VIDEO_DRIVERS fbcon/libvideo_fbcon.la"
599 dnl Find the GGI includes
602 AC_ARG_ENABLE(video-ggi,
603 [ --enable-video-ggi use GGI video driver [default=no]],
604 , enable_video_ggi=no)
605 if test x$enable_video = xyes -a x$enable_video_ggi = xyes; then
606 AC_MSG_CHECKING(for GGI support)
615 AC_MSG_RESULT($video_ggi)
616 if test x$video_ggi = xyes; then
617 CFLAGS="$CFLAGS $X_CFLAGS -DENABLE_GGI"
618 SYSTEM_LIBS="$SYSTEM_LIBS -lggi -lgii -lgg"
620 VIDEO_SUBDIRS="$VIDEO_SUBDIRS ggi"
621 VIDEO_DRIVERS="$VIDEO_DRIVERS ggi/libvideo_ggi.la"
626 dnl Find the SVGAlib includes and libraries
629 AC_ARG_ENABLE(video-svga,
630 [ --enable-video-svga use SVGAlib video driver [default=no]],
631 , enable_video_svga=no)
632 if test x$enable_video = xyes -a x$enable_video_svga = xyes; then
633 AC_MSG_CHECKING(for SVGAlib (1.4.0+) support)
637 #include <vgamouse.h>
638 #include <vgakeyboard.h>
640 if ( SCANCODE_RIGHTWIN && SCANCODE_LEFTWIN ) {
646 AC_MSG_RESULT($video_svga)
647 if test x$video_svga = xyes; then
648 CFLAGS="$CFLAGS -DENABLE_SVGALIB"
649 SYSTEM_LIBS="$SYSTEM_LIBS -lvga"
651 VIDEO_SUBDIRS="$VIDEO_SUBDIRS svga"
652 VIDEO_DRIVERS="$VIDEO_DRIVERS svga/libvideo_svga.la"
657 dnl Find the AAlib includes
660 AC_ARG_ENABLE(video-aalib,
661 [ --enable-video-aalib use AAlib video driver [default=no]],
662 , enable_video_aalib=no)
663 if test x$enable_video = xyes -a x$enable_video_aalib = xyes; then
664 AC_MSG_CHECKING(for AAlib support)
672 AC_MSG_RESULT($video_aalib)
673 if test x$video_aalib = xyes; then
674 CFLAGS="$CFLAGS -DENABLE_AALIB"
675 SYSTEM_LIBS="$SYSTEM_LIBS -laa"
677 VIDEO_SUBDIRS="$VIDEO_SUBDIRS aalib"
678 VIDEO_DRIVERS="$VIDEO_DRIVERS aalib/libvideo_aa.la"
683 dnl Check to see if OpenGL support is desired
684 AC_ARG_ENABLE(video-opengl,
685 [ --enable-video-opengl include OpenGL context creation [default=yes]],
686 , enable_video_opengl=yes)
691 if test x$enable_video = xyes -a x$enable_video_opengl = xyes; then
692 AC_MSG_CHECKING(for OpenGL (GLX) support)
697 #include <dlfcn.h> /* For loading extensions */
702 AC_MSG_RESULT($video_opengl)
703 if test x$video_opengl = xyes; then
704 CFLAGS="$CFLAGS -DHAVE_OPENGL"
705 AC_CHECK_LIB(dl, dlopen, SYSTEM_LIBS="$SYSTEM_LIBS -ldl")
710 dnl Check for BeOS OpenGL
713 if test x$enable_video = xyes -a x$enable_video_opengl = xyes; then
714 CFLAGS="$CFLAGS -DHAVE_OPENGL"
715 SYSTEM_LIBS="$SYSTEM_LIBS -lGL"
719 dnl Check for MacOS OpenGL
722 if test x$enable_video = xyes -a x$enable_video_opengl = xyes; then
723 CFLAGS="$CFLAGS -DHAVE_OPENGL"
726 SDL_LIBS="$SDL_LIBS -framework OpenGL -framework AGL"
731 dnl See if we can use the new unified event interface in Linux 2.4
734 dnl Check for Linux 2.4 unified input event interface support
735 AC_ARG_ENABLE(input-events,
736 [ --enable-input-events use Linux 2.4 unified input interface [default=yes]],
737 , enable_input_events=yes)
738 if test x$enable_input_events = xyes; then
739 AC_MSG_CHECKING(for Linux 2.4 unified input interface)
742 #include <linux/input.h>
745 #error EVIOCGNAME() ioctl not available
750 AC_MSG_RESULT($use_input_events)
751 if test x$use_input_events = xyes; then
752 CFLAGS="$CFLAGS -DUSE_INPUT_EVENTS"
757 dnl See what type of thread model to use on Linux and Solaris
760 dnl Check for pthread support
761 AC_ARG_ENABLE(pthreads,
762 [ --enable-pthreads use POSIX threads for multi-threading [default=yes]],
763 , enable_pthreads=yes)
764 dnl This is used on Linux for glibc binary compatibility (Doh!)
765 AC_ARG_ENABLE(pthread-sem,
766 [ --enable-pthread-sem use pthread semaphores [default=yes]],
767 , enable_pthread_sem=yes)
771 pthread_cflags="-D_REENTRANT -D_THREAD_SAFE"
775 pthread_cflags="-D_THREAD_SAFE"
776 # causes Carbon.p complaints?
777 # pthread_cflags="-D_REENTRANT -D_THREAD_SAFE"
780 pthread_cflags="-D_REENTRANT -D_THREAD_SAFE"
781 pthread_lib="-pthread"
784 pthread_cflags="-D_REENTRANT"
785 pthread_lib="-pthread"
788 pthread_cflags="-D_REENTRANT"
789 pthread_lib="-lpthread -lposix4"
792 pthread_cflags="-D_REENTRANT -Kthread"
796 pthread_cflags="-D_SGI_MP_SOURCE"
797 pthread_lib="-lpthread"
800 pthread_cflags="-D_REENTRANT -mthreads"
801 pthread_lib="-lpthread"
808 pthread_cflags="-D_REENTRANT"
809 pthread_lib="-lpthread"
812 LIBS="$LIBS $pthread_lib"
813 if test x$enable_threads = xyes -a x$enable_pthreads = xyes; then
814 AC_MSG_CHECKING(for pthreads)
820 pthread_attr_init(&type);
824 AC_MSG_RESULT($use_pthreads)
825 if test x$use_pthreads = xyes; then
826 CFLAGS="$CFLAGS $pthread_cflags -DSDL_USE_PTHREADS"
827 SDL_CFLAGS="$SDL_CFLAGS $pthread_cflags"
828 SDL_LIBS="$SDL_LIBS $pthread_lib"
830 # Check to see if recursive mutexes are available
831 AC_MSG_CHECKING(for recursive mutexes)
832 has_recursive_mutexes=no
836 pthread_mutexattr_t attr;
838 pthread_mutexattr_setkind_np(&attr, PTHREAD_MUTEX_RECURSIVE_NP);
840 pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
843 has_recursive_mutexes=yes
845 # Some systems have broken recursive mutex implementations
848 has_recursive_mutexes=no
851 AC_MSG_RESULT($has_recursive_mutexes)
852 if test x$has_recursive_mutexes != xyes; then
853 CFLAGS="$CFLAGS -DPTHREAD_NO_RECURSIVE_MUTEX"
856 # Check to see if this is broken glibc 2.0 pthreads
859 AC_MSG_CHECKING(for broken glibc 2.0 pthreads)
862 #include <features.h>
863 #if (__GLIBC__ == 2) && (__GLIBC_MINOR__ == 0)
864 #warning Working around a bug in glibc 2.0 pthreads
866 #error pthread implementation okay
867 #endif /* glibc 2.0 */
872 AC_MSG_RESULT($glibc20_pthreads)
878 AC_MSG_CHECKING(whether semun is defined in /usr/include/sys/sem.h)
881 #include <sys/types.h>
888 AC_MSG_RESULT($have_semun)
889 if test x$have_semun = xyes; then
890 CFLAGS="$CFLAGS -DHAVE_SEMUN"
893 # See if we can use clone() on Linux directly
895 if test x$enable_threads = xyes -a x$use_pthreads != xyes; then
901 CFLAGS="$CFLAGS -DFORK_HACK"
905 AM_CONDITIONAL(USE_CLONE, test x$use_clone = xyes)
908 dnl Determine whether the compiler can produce Win32 executables
911 AC_MSG_CHECKING(Win32 compiler)
919 AC_MSG_RESULT($have_win32_gcc)
920 if test x$have_win32_gcc != xyes; then
922 *** Your compiler ($CC) does not produce Win32 executables!
926 dnl See if the user wants to redirect standard output to files
927 AC_ARG_ENABLE(stdio-redirect,
928 [ --enable-stdio-redirect Redirect STDIO to files on Win32 [default=yes]],
929 , enable_stdio_redirect=yes)
930 if test x$enable_stdio_redirect != xyes; then
931 CFLAGS="$CFLAGS -DNO_STDIO_REDIRECT"
935 dnl Find the DirectX includes and libraries
938 AC_ARG_ENABLE(directx,
939 [ --enable-directx use DirectX for Win32 audio/video [default=yes]],
940 , enable_directx=yes)
941 if test x$enable_directx = xyes; then
942 AC_MSG_CHECKING(for DirectX headers and libraries)
945 #include "src/video/windx5/directx.h"
950 AC_MSG_RESULT($use_directx)
952 AM_CONDITIONAL(USE_DIRECTX, test x$use_directx = xyes)
954 CFLAGS="$CFLAGS -I\$(top_srcdir)/src/video/wincommon"
955 SYSTEM_LIBS="$SYSTEM_LIBS -luser32 -lgdi32 -lwinmm"
956 VIDEO_SUBDIRS="$VIDEO_SUBDIRS wincommon"
957 VIDEO_DRIVERS="$VIDEO_DRIVERS wincommon/libvideo_wincommon.la"
958 # Enable the DIB driver
959 CFLAGS="$CFLAGS -DENABLE_WINDIB"
960 VIDEO_SUBDIRS="$VIDEO_SUBDIRS windib"
961 VIDEO_DRIVERS="$VIDEO_DRIVERS windib/libvideo_windib.la"
962 # See if we should enable the DirectX driver
963 if test x$use_directx = xyes; then
964 CFLAGS="$CFLAGS -DENABLE_DIRECTX"
965 SYSTEM_LIBS="$SYSTEM_LIBS -ldxguid"
966 VIDEO_SUBDIRS="$VIDEO_SUBDIRS windx5"
967 VIDEO_DRIVERS="$VIDEO_DRIVERS windx5/libvideo_windx5.la"
971 dnl Set up the BWindow video driver on BeOS
974 CFLAGS="$CFLAGS -DENABLE_BWINDOW"
975 VIDEO_SUBDIRS="$VIDEO_SUBDIRS bwindow"
976 VIDEO_DRIVERS="$VIDEO_DRIVERS bwindow/libvideo_bwindow.la"
979 dnl Set up the Mac toolbox video driver for Mac OS 7-9
982 VIDEO_SUBDIRS="$VIDEO_SUBDIRS maccommon"
983 VIDEO_DRIVERS="$VIDEO_DRIVERS maccommon/libvideo_maccommon.la"
984 VIDEO_SUBDIRS="$VIDEO_SUBDIRS macrom"
985 VIDEO_DRIVERS="$VIDEO_DRIVERS macrom/libvideo_macrom.la"
988 dnl Set up the Mac toolbox video driver for Mac OS X
991 # "MACOSX" is not an official definition, but it's commonly
992 # accepted as a way to differentiate between what runs on X
993 # and what runs on older Macs - while in theory "Carbon" defns
994 # are consistent between the two, in practice Carbon is still
995 # changing. -sts Aug 2000
996 mac_autoconf_target_workaround="MAC"
997 CFLAGS="$CFLAGS -I/System/Library/Frameworks/Carbon.framework/Headers \
998 -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"
999 VIDEO_SUBDIRS="$VIDEO_SUBDIRS maccommon"
1000 VIDEO_DRIVERS="$VIDEO_DRIVERS maccommon/libvideo_maccommon.la"
1001 VIDEO_SUBDIRS="$VIDEO_SUBDIRS macrom"
1002 VIDEO_DRIVERS="$VIDEO_DRIVERS macrom/libvideo_macrom.la"
1005 dnl Set up the kernel statistics library for Solaris
1008 CFLAGS="$CFLAGS -DHAVE_KSTAT"
1009 SYSTEM_LIBS="$SYSTEM_LIBS -lkstat"
1030 # Set up files for the main() stub
1031 COPY_ARCH_SRC(src/main, linux, SDL_main.c)
1032 # Set up files for the audio library
1033 # We use the OSS and ALSA API's, not the Sun audio API
1034 #if test x$enable_audio = xyes; then
1035 # AUDIO_SUBDIRS="$AUDIO_SUBDIRS sun"
1036 # AUDIO_DRIVERS="$AUDIO_DRIVERS sun/libaudio_sun.la"
1038 # Set up files for the joystick library
1039 if test x$enable_joystick = xyes; then
1040 JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS linux"
1041 JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS linux/libjoystick_linux.la"
1043 # Set up files for the cdrom library
1044 if test x$enable_cdrom = xyes; then
1045 COPY_ARCH_SRC(src/cdrom, linux, SDL_syscdrom.c)
1047 # Set up files for the thread library
1048 if test x$enable_threads = xyes; then
1049 if test x$use_pthreads != xyes; then
1050 COPY_ARCH_SRC(src/thread, linux, clone.S)
1052 COPY_ARCH_SRC(src/thread, linux, SDL_systhread.c)
1053 COPY_ARCH_SRC(src/thread, linux, SDL_systhread_c.h)
1054 if test x$use_pthreads = xyes -a x$enable_pthread_sem != xyes; then
1055 COPY_ARCH_SRC(src/thread, generic, SDL_syssem.c)
1057 COPY_ARCH_SRC(src/thread, linux, SDL_syssem.c)
1059 COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
1060 if test x$glibc20_pthreads = xyes; then
1061 COPY_ARCH_SRC(src/thread, generic, SDL_sysmutex.c)
1062 COPY_ARCH_SRC(src/thread, generic, SDL_sysmutex_c.h)
1063 COPY_ARCH_SRC(src/thread, generic, SDL_syscond.c)
1064 COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
1066 COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex.c)
1067 COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex_c.h)
1068 COPY_ARCH_SRC(src/thread, linux, SDL_syscond.c)
1069 COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
1072 # Set up files for the timer library
1073 if test x$enable_timers = xyes; then
1074 COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
1088 # Set up files for the main() stub
1089 COPY_ARCH_SRC(src/main, linux, SDL_main.c)
1090 # Set up files for the joystick library
1091 # (No joystick support yet)
1092 if test x$enable_joystick = xyes; then
1093 JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS dummy"
1094 JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS dummy/libjoystick_dummy.la"
1096 # Set up files for the cdrom library
1097 # (No cdrom support yet)
1098 if test x$enable_cdrom = xyes; then
1099 COPY_ARCH_SRC(src/cdrom, dummy, SDL_syscdrom.c)
1101 # Set up files for the thread library
1102 if test x$enable_threads = xyes; then
1103 COPY_ARCH_SRC(src/thread, linux, SDL_systhread.c)
1104 COPY_ARCH_SRC(src/thread, linux, SDL_systhread_c.h)
1105 COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex.c)
1106 COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex_c.h)
1107 COPY_ARCH_SRC(src/thread, generic, SDL_syssem.c)
1108 COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
1109 COPY_ARCH_SRC(src/thread, linux, SDL_syscond.c)
1110 COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
1112 # Set up files for the timer library
1113 if test x$enable_timers = xyes; then
1114 COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
1130 # Set up files for the main() stub
1131 COPY_ARCH_SRC(src/main, linux, SDL_main.c)
1132 # Set up files for the audio library
1133 # We use the OSS and ALSA API's, not the Sun audio API
1134 #if test x$enable_audio = xyes; then
1135 # AUDIO_SUBDIRS="$AUDIO_SUBDIRS sun"
1136 # AUDIO_DRIVERS="$AUDIO_DRIVERS sun/libaudio_sun.la"
1138 # Set up files for the joystick library
1139 # (No joystick support yet)
1140 if test x$enable_joystick = xyes; then
1141 JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS dummy"
1142 JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS dummy/libjoystick_dummy.la"
1144 # Set up files for the cdrom library
1145 if test x$enable_cdrom = xyes; then
1146 COPY_ARCH_SRC(src/cdrom, freebsd, SDL_syscdrom.c)
1148 # Set up files for the thread library
1149 if test x$enable_threads = xyes; then
1150 COPY_ARCH_SRC(src/thread, linux, SDL_systhread.c)
1151 COPY_ARCH_SRC(src/thread, linux, SDL_systhread_c.h)
1152 COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex.c)
1153 COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex_c.h)
1154 if test x$use_pthreads = xyes -a x$enable_pthread_sem != xyes; then
1155 COPY_ARCH_SRC(src/thread, generic, SDL_syssem.c)
1157 COPY_ARCH_SRC(src/thread, linux, SDL_syssem.c)
1159 COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
1160 COPY_ARCH_SRC(src/thread, linux, SDL_syscond.c)
1161 COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
1163 # Set up files for the timer library
1164 if test x$enable_timers = xyes; then
1165 COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
1179 # Set up files for the main() stub
1180 COPY_ARCH_SRC(src/main, linux, SDL_main.c)
1181 # Set up files for the audio library
1182 if test x$enable_audio = xyes; then
1183 AUDIO_SUBDIRS="$AUDIO_SUBDIRS sun"
1184 AUDIO_DRIVERS="$AUDIO_DRIVERS sun/libaudio_sun.la"
1186 # Set up files for the joystick library
1187 # (No joystick support yet)
1188 if test x$enable_joystick = xyes; then
1189 JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS dummy"
1190 JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS dummy/libjoystick_dummy.la"
1192 # Set up files for the cdrom library
1193 if test x$enable_cdrom = xyes; then
1194 COPY_ARCH_SRC(src/cdrom, openbsd, SDL_syscdrom.c)
1196 # Set up files for the thread library
1197 if test x$enable_threads = xyes; then
1198 COPY_ARCH_SRC(src/thread, linux, SDL_systhread.c)
1199 COPY_ARCH_SRC(src/thread, linux, SDL_systhread_c.h)
1200 COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex.c)
1201 COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex_c.h)
1202 COPY_ARCH_SRC(src/thread, linux, SDL_syssem.c)
1203 COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
1204 COPY_ARCH_SRC(src/thread, linux, SDL_syscond.c)
1205 COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
1207 # Set up files for the timer library
1208 if test x$enable_timers = xyes; then
1209 COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
1211 # NetBSD does not define "unix"
1212 CFLAGS="$CFLAGS -Dunix"
1225 # Set up files for the main() stub
1226 COPY_ARCH_SRC(src/main, linux, SDL_main.c)
1227 # Set up files for the audio library
1228 if test x$enable_audio = xyes; then
1229 AUDIO_SUBDIRS="$AUDIO_SUBDIRS sun"
1230 AUDIO_DRIVERS="$AUDIO_DRIVERS sun/libaudio_sun.la"
1232 # Set up files for the joystick library
1233 # (No joystick support yet)
1234 if test x$enable_joystick = xyes; then
1235 JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS dummy"
1236 JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS dummy/libjoystick_dummy.la"
1238 # Set up files for the cdrom library
1239 if test x$enable_cdrom = xyes; then
1240 COPY_ARCH_SRC(src/cdrom, openbsd, SDL_syscdrom.c)
1242 # Set up files for the thread library
1243 if test x$enable_threads = xyes; then
1244 COPY_ARCH_SRC(src/thread, linux, SDL_systhread.c)
1245 COPY_ARCH_SRC(src/thread, linux, SDL_systhread_c.h)
1246 COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex.c)
1247 COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex_c.h)
1248 if test x$use_pthreads = xyes -a x$enable_pthread_sem != xyes; then
1249 COPY_ARCH_SRC(src/thread, generic, SDL_syssem.c)
1251 COPY_ARCH_SRC(src/thread, linux, SDL_syssem.c)
1253 COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
1254 COPY_ARCH_SRC(src/thread, linux, SDL_syscond.c)
1255 COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
1257 # Set up files for the timer library
1258 if test x$enable_timers = xyes; then
1259 COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
1274 # Set up files for the main() stub
1275 COPY_ARCH_SRC(src/main, linux, SDL_main.c)
1276 # Set up files for the audio library
1277 if test x$enable_audio = xyes; then
1278 AUDIO_SUBDIRS="$AUDIO_SUBDIRS sun"
1279 AUDIO_DRIVERS="$AUDIO_DRIVERS sun/libaudio_sun.la"
1281 # Set up files for the joystick library
1282 # (No joystick support yet)
1283 if test x$enable_joystick = xyes; then
1284 JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS dummy"
1285 JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS dummy/libjoystick_dummy.la"
1287 # Set up files for the cdrom library
1288 if test x$enable_cdrom = xyes; then
1289 COPY_ARCH_SRC(src/cdrom, dummy, SDL_syscdrom.c)
1291 # Set up files for the thread library
1292 if test x$enable_threads = xyes; then
1293 COPY_ARCH_SRC(src/thread, generic, SDL_systhread.c)
1294 COPY_ARCH_SRC(src/thread, generic, SDL_systhread_c.h)
1295 COPY_ARCH_SRC(src/thread, generic, SDL_sysmutex.c)
1296 COPY_ARCH_SRC(src/thread, generic, SDL_sysmutex_c.h)
1297 COPY_ARCH_SRC(src/thread, generic, SDL_syssem.c)
1298 COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
1299 COPY_ARCH_SRC(src/thread, generic, SDL_syscond.c)
1300 COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
1302 # Set up files for the timer library
1303 if test x$enable_timers = xyes; then
1304 COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
1318 # Set up files for the main() stub
1319 COPY_ARCH_SRC(src/main, linux, SDL_main.c)
1320 # Set up files for the audio library
1321 if test x$enable_audio = xyes; then
1322 AUDIO_SUBDIRS="$AUDIO_SUBDIRS sun"
1323 AUDIO_DRIVERS="$AUDIO_DRIVERS sun/libaudio_sun.la"
1325 # Set up files for the joystick library
1326 # (No joystick support yet)
1327 if test x$enable_joystick = xyes; then
1328 JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS dummy"
1329 JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS dummy/libjoystick_dummy.la"
1331 # Set up files for the cdrom library
1332 if test x$enable_cdrom = xyes; then
1333 COPY_ARCH_SRC(src/cdrom, linux, SDL_syscdrom.c)
1335 # Set up files for the thread library
1336 if test x$enable_threads = xyes; then
1337 COPY_ARCH_SRC(src/thread, linux, SDL_systhread.c)
1338 COPY_ARCH_SRC(src/thread, linux, SDL_systhread_c.h)
1339 COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex.c)
1340 COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex_c.h)
1341 COPY_ARCH_SRC(src/thread, linux, SDL_syssem.c)
1342 COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
1343 COPY_ARCH_SRC(src/thread, generic, SDL_syscond.c)
1344 COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
1346 # Set up files for the timer library
1347 if test x$enable_timers = xyes; then
1348 COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
1358 # Set up files for the main() stub
1359 COPY_ARCH_SRC(src/main, linux, SDL_main.c)
1360 # Set up files for the audio library
1361 if test x$enable_audio = xyes; then
1362 AUDIO_SUBDIRS="$AUDIO_SUBDIRS dmedia"
1363 AUDIO_DRIVERS="$AUDIO_DRIVERS dmedia/libaudio_dmedia.la"
1364 LIBS="$LIBS -laudio"
1366 # Set up files for the joystick library
1367 # (No joystick support yet)
1368 if test x$enable_joystick = xyes; then
1369 JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS dummy"
1370 JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS dummy/libjoystick_dummy.la"
1372 # Set up files for the cdrom library
1373 # (No CD-ROM support yet)
1374 if test x$enable_cdrom = xyes; then
1375 COPY_ARCH_SRC(src/cdrom, dummy, SDL_syscdrom.c)
1377 # Set up files for the thread library
1378 if test x$enable_threads = xyes; then
1379 if test x$use_pthreads = xyes; then
1380 COPY_ARCH_SRC(src/thread, linux, SDL_systhread.c)
1381 COPY_ARCH_SRC(src/thread, linux, SDL_systhread_c.h)
1382 COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex.c)
1383 COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex_c.h)
1384 if test x$enable_pthread_sem != xyes; then
1385 COPY_ARCH_SRC(src/thread, generic, SDL_syssem.c)
1387 COPY_ARCH_SRC(src/thread, linux, SDL_syssem.c)
1389 COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
1390 COPY_ARCH_SRC(src/thread, linux, SDL_syscond.c)
1391 COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
1393 COPY_ARCH_SRC(src/thread, irix, SDL_systhread.c)
1394 COPY_ARCH_SRC(src/thread, irix, SDL_systhread_c.h)
1395 COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex.c)
1396 COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex_c.h)
1397 COPY_ARCH_SRC(src/thread, linux, SDL_syssem.c)
1398 COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
1399 COPY_ARCH_SRC(src/thread, generic, SDL_syscond.c)
1400 COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
1403 # Set up files for the timer library
1404 if test x$enable_timers = xyes; then
1405 COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
1416 # Set up files for the main() stub
1417 COPY_ARCH_SRC(src/main, linux, SDL_main.c)
1418 # Set up files for the audio library
1419 if test x$enable_audio = xyes; then
1420 AUDIO_SUBDIRS="$AUDIO_SUBDIRS sun"
1421 AUDIO_DRIVERS="$AUDIO_DRIVERS sun/libaudio_sun.la"
1423 # Set up files for the joystick library
1424 # (No joystick support yet)
1425 if test x$enable_joystick = xyes; then
1426 JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS dummy"
1427 JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS dummy/libjoystick_dummy.la"
1429 # Set up files for the cdrom library
1430 # (No CD-ROM support yet)
1431 if test x$enable_cdrom = xyes; then
1432 COPY_ARCH_SRC(src/cdrom, dummy, SDL_syscdrom.c)
1434 # Set up files for the thread library
1435 if test x$enable_threads = xyes; then
1436 COPY_ARCH_SRC(src/thread, linux, SDL_systhread.c)
1437 COPY_ARCH_SRC(src/thread, linux, SDL_systhread_c.h)
1438 COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex.c)
1439 COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex_c.h)
1440 COPY_ARCH_SRC(src/thread, linux, SDL_syssem.c)
1441 COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
1442 COPY_ARCH_SRC(src/thread, linux, SDL_syscond.c)
1443 COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
1445 # Set up files for the timer library
1446 if test x$enable_timers = xyes; then
1447 COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
1458 # Set up files for the main() stub
1459 COPY_ARCH_SRC(src/main, linux, SDL_main.c)
1460 # Set up files for the audio library
1461 if test x$enable_audio = xyes; then
1462 AUDIO_SUBDIRS="$AUDIO_SUBDIRS paudio"
1463 AUDIO_DRIVERS="$AUDIO_DRIVERS paudio/libaudio_paudio.la"
1465 # Set up files for the joystick library
1466 # (No joystick support yet)
1467 if test x$enable_joystick = xyes; then
1468 JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS dummy"
1469 JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS dummy/libjoystick_dummy.la"
1471 # Set up files for the cdrom library
1472 if test x$enable_cdrom = xyes; then
1473 COPY_ARCH_SRC(src/cdrom, aix, SDL_syscdrom.c)
1475 # Set up files for the thread library
1476 if test x$enable_threads = xyes; then
1477 COPY_ARCH_SRC(src/thread, linux, SDL_systhread.c)
1478 COPY_ARCH_SRC(src/thread, linux, SDL_systhread_c.h)
1479 COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex.c)
1480 COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex_c.h)
1481 COPY_ARCH_SRC(src/thread, linux, SDL_syssem.c)
1482 COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
1483 COPY_ARCH_SRC(src/thread, linux, SDL_syscond.c)
1484 COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
1486 # Set up files for the timer library
1487 if test x$enable_timers = xyes; then
1488 COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
1499 # Set up files for the main() stub
1500 COPY_ARCH_SRC(src/main, linux, SDL_main.c)
1501 # Set up files for the audio library
1502 if test x$enable_audio = xyes; then
1503 AUDIO_SUBDIRS="$AUDIO_SUBDIRS sun"
1504 AUDIO_DRIVERS="$AUDIO_DRIVERS sun/libaudio_sun.la"
1506 # Set up files for the joystick library
1507 # (No joystick support yet)
1508 if test x$enable_joystick = xyes; then
1509 JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS dummy"
1510 JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS dummy/libjoystick_dummy.la"
1512 # Set up files for the cdrom library
1513 # (No cdrom support yet)
1514 if test x$enable_cdrom = xyes; then
1515 COPY_ARCH_SRC(src/cdrom, dummy, SDL_syscdrom.c)
1517 # Set up files for the thread library
1518 if test x$enable_threads = xyes; then
1519 COPY_ARCH_SRC(src/thread, linux, SDL_systhread.c)
1520 COPY_ARCH_SRC(src/thread, linux, SDL_systhread_c.h)
1521 COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex.c)
1522 COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex_c.h)
1523 COPY_ARCH_SRC(src/thread, generic, SDL_syssem.c)
1524 COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
1525 COPY_ARCH_SRC(src/thread, linux, SDL_syscond.c)
1526 COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
1528 # Set up files for the timer library
1529 if test x$enable_timers = xyes; then
1530 COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
1540 # Set up files for the main() stub
1541 COPY_ARCH_SRC(src/main, linux, SDL_main.c)
1542 # Set up files for the audio library
1543 if test x$enable_audio = xyes; then
1544 CFLAGS="$CFLAGS -DALSA_SUPPORT"
1545 SYSTEM_LIBS="$SYSTEM_LIBS -lasound"
1546 AUDIO_SUBDIRS="$AUDIO_SUBDIRS nto"
1547 AUDIO_DRIVERS="$AUDIO_DRIVERS nto/libaudio_nto.la"
1548 AUDIO_SUBDIRS="$AUDIO_SUBDIRS sun"
1549 AUDIO_DRIVERS="$AUDIO_DRIVERS sun/libaudio_sun.la"
1551 # Set up files for the joystick library
1552 if test x$enable_joystick = xyes; then
1553 # (No joystick support yet)
1554 JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS dummy"
1555 JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS dummy/libjoystick_dummy.la"
1557 # Set up files for the cdrom library
1558 if test x$enable_cdrom = xyes; then
1559 COPY_ARCH_SRC(src/cdrom, qnx, SDL_syscdrom.c)
1561 # Set up files for the thread library
1562 if test x$enable_threads = xyes; then
1563 COPY_ARCH_SRC(src/thread, linux, SDL_systhread.c)
1564 COPY_ARCH_SRC(src/thread, linux, SDL_systhread_c.h)
1565 COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex.c)
1566 COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex_c.h)
1567 COPY_ARCH_SRC(src/thread, linux, SDL_syssem.c)
1568 COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
1569 COPY_ARCH_SRC(src/thread, linux, SDL_syscond.c)
1570 COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
1572 # Set up files for the timer library
1573 if test x$enable_timers = xyes; then
1574 COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
1577 *-*-cygwin* | *-*-mingw32*)
1579 if test "$build" != "$target"; then # cross-compiling
1580 # Default cross-compile location
1581 ac_default_prefix=/usr/local/cross-tools/i386-mingw32msvc
1583 # Look for the location of the tools and install there
1584 ac_default_prefix=$BUILD_PREFIX
1589 # Set up files for the main() stub
1590 COPY_ARCH_SRC(src/main, win32, SDL_main.c)
1591 # Set up files for the audio library
1592 if test x$enable_audio = xyes; then
1593 AUDIO_SUBDIRS="$AUDIO_SUBDIRS windib"
1594 AUDIO_DRIVERS="$AUDIO_DRIVERS windib/libaudio_windib.la"
1595 if test x$use_directx = xyes; then
1596 AUDIO_SUBDIRS="$AUDIO_SUBDIRS windx5"
1597 AUDIO_DRIVERS="$AUDIO_DRIVERS windx5/libaudio_windx5.la"
1600 # Set up files for the joystick library
1601 if test x$enable_joystick = xyes; then
1602 JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS win32"
1603 JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS win32/libjoystick_winmm.la"
1605 # Set up files for the cdrom library
1606 if test x$enable_cdrom = xyes; then
1607 COPY_ARCH_SRC(src/cdrom, win32, SDL_syscdrom.c)
1609 # Set up files for the thread library
1610 if test x$enable_threads = xyes; then
1611 COPY_ARCH_SRC(src/thread, win32, SDL_systhread.c)
1612 COPY_ARCH_SRC(src/thread, win32, SDL_systhread_c.h)
1613 COPY_ARCH_SRC(src/thread, win32, SDL_sysmutex.c)
1614 COPY_ARCH_SRC(src/thread, generic, SDL_sysmutex_c.h)
1615 COPY_ARCH_SRC(src/thread, win32, SDL_syssem.c)
1616 COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
1617 COPY_ARCH_SRC(src/thread, generic, SDL_syscond.c)
1618 COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
1620 # Set up files for the timer library
1621 if test x$enable_timers = xyes; then
1622 COPY_ARCH_SRC(src/timer, win32, SDL_systimer.c)
1624 # The Win32 platform requires special setup
1625 SDL_CFLAGS="$SDL_CFLAGS -Dmain=SDL_main"
1626 SDL_LIBS="-lmingw32 -lSDLmain $SDL_LIBS -mwindows"
1630 ac_default_prefix=/boot/develop/tools/gnupro
1634 # Set up files for the main() stub
1635 COPY_ARCH_SRC(src/main, linux, SDL_main.c)
1636 COPY_ARCH_SRC(src/main, beos, SDL_BeApp.cc)
1637 COPY_ARCH_SRC(src/main, beos, SDL_BeApp.h)
1638 # Set up files for the audio library
1639 if test x$enable_audio = xyes; then
1640 AUDIO_SUBDIRS="$AUDIO_SUBDIRS baudio"
1641 AUDIO_DRIVERS="$AUDIO_DRIVERS baudio/libaudio_baudio.la"
1643 # Set up files for the joystick library
1644 if test x$enable_joystick = xyes; then
1645 JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS beos"
1646 JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS beos/libjoystick_beos.la"
1648 # Set up files for the cdrom library
1649 if test x$enable_cdrom = xyes; then
1650 COPY_ARCH_SRC(src/cdrom, beos, SDL_syscdrom.c)
1652 # Set up files for the thread library
1653 if test x$enable_threads = xyes; then
1654 COPY_ARCH_SRC(src/thread, beos, SDL_systhread.c)
1655 COPY_ARCH_SRC(src/thread, beos, SDL_systhread_c.h)
1656 COPY_ARCH_SRC(src/thread, generic, SDL_sysmutex.c)
1657 COPY_ARCH_SRC(src/thread, generic, SDL_sysmutex_c.h)
1658 COPY_ARCH_SRC(src/thread, beos, SDL_syssem.c)
1659 COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
1660 COPY_ARCH_SRC(src/thread, generic, SDL_syscond.c)
1661 COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
1663 # Set up files for the timer library
1664 if test x$enable_timers = xyes; then
1665 COPY_ARCH_SRC(src/timer, beos, SDL_systimer.c)
1667 # The BeOS platform requires special libraries
1668 SYSTEM_LIBS="$SYSTEM_LIBS -lroot -lbe -lmedia -lgame -ldevice -ltextencoding"
1671 # This would be used if cross-compiling to MacOS 9. No way to
1672 # use it at present, but Apple is working on a X-to-9 compiler
1673 # for which this case would be handy.
1677 # Set up files for the main() stub
1678 COPY_ARCH_SRC(src/main, macos, SDL_main.c)
1679 # Set up files for the audio library
1680 if test x$enable_audio = xyes; then
1681 AUDIO_SUBDIRS="$AUDIO_SUBDIRS macrom"
1682 AUDIO_DRIVERS="$AUDIO_DRIVERS macrom/libaudio_macrom.la"
1684 # Set up files for the joystick library
1685 if test x$enable_joystick = xyes; then
1686 JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS macos"
1687 JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS macos/libjoystick_macos.la"
1689 # Set up files for the cdrom library
1690 if test x$enable_cdrom = xyes; then
1691 COPY_ARCH_SRC(src/cdrom, macos, SDL_syscdrom.c)
1693 # Set up files for the thread library
1694 if test x$enable_threads = xyes; then
1695 COPY_ARCH_SRC(src/thread, macos, SDL_systhread.c)
1696 COPY_ARCH_SRC(src/thread, macos, SDL_systhread_c.h)
1697 COPY_ARCH_SRC(src/thread, generic, SDL_sysmutex.c)
1698 COPY_ARCH_SRC(src/thread, generic, SDL_sysmutex_c.h)
1699 COPY_ARCH_SRC(src/thread, macos, SDL_syssem.c)
1700 COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
1701 COPY_ARCH_SRC(src/thread, generic, SDL_syscond.c)
1702 COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
1704 # Set up files for the timer library
1705 if test x$enable_timers = xyes; then
1706 COPY_ARCH_SRC(src/timer, macos, SDL_systimer.c)
1708 # The MacOS platform requires special setup
1709 SDL_CFLAGS="$SDL_CFLAGS -Dmain=SDL_main"
1710 SDL_LIBS="-lSDLmain $SDL_LIBS"
1713 # Strictly speaking, we want "Mac OS X", not "Darwin", which is
1714 # just the OS X kernel sans upper layers like Carbon. But
1715 # config.guess comes back with "darwin", so go with the flow.
1720 # Set up files for the main() stub
1721 # COPY_ARCH_SRC(src/main, macos, SDL_main.c)
1722 COPY_ARCH_SRC(src/main, linux, SDL_main.c)
1723 # Set up files for the audio library
1724 if test x$enable_audio = xyes; then
1725 AUDIO_SUBDIRS="$AUDIO_SUBDIRS macrom"
1726 AUDIO_DRIVERS="$AUDIO_DRIVERS macrom/libaudio_macrom.la"
1728 # Set up files for the joystick library
1729 if test x$enable_joystick = xyes; then
1730 JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS dummy"
1731 JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS dummy/libjoystick_dummy.la"
1733 # Set up files for the cdrom library
1734 if test x$enable_cdrom = xyes; then
1735 COPY_ARCH_SRC(src/cdrom, dummy, SDL_syscdrom.c)
1737 # Set up files for the thread library
1738 if test x$enable_threads = xyes; then
1739 COPY_ARCH_SRC(src/thread, linux, SDL_systhread.c)
1740 COPY_ARCH_SRC(src/thread, linux, SDL_systhread_c.h)
1741 COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex.c)
1742 COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex_c.h)
1743 if test x$use_pthreads = xyes -a x$enable_pthread_sem != xyes; then
1744 COPY_ARCH_SRC(src/thread, generic, SDL_syssem.c)
1746 COPY_ARCH_SRC(src/thread, linux, SDL_syssem.c)
1748 COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
1749 COPY_ARCH_SRC(src/thread, generic, SDL_syscond.c)
1750 COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
1752 # Set up files for the timer library
1753 if test x$enable_timers = xyes; then
1754 COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
1756 # The MacOS X platform requires special setup
1757 SDL_CFLAGS="$SDL_CFLAGS -F/System/Library/Frameworks/Carbon.framework"
1758 SDL_LIBS="$SDL_LIBS -framework Carbon"
1761 AC_MSG_ERROR(Unsupported target: Please add to configure.in)
1766 # Set the conditional variables for this target
1767 AM_CONDITIONAL(TARGET_LINUX, test $ARCH = linux)
1768 AM_CONDITIONAL(TARGET_SOLARIS, test $ARCH = solaris)
1769 AM_CONDITIONAL(TARGET_IRIX, test $ARCH = irix)
1770 AM_CONDITIONAL(TARGET_BSDI, test $ARCH = bsdi)
1771 AM_CONDITIONAL(TARGET_FREEBSD, test $ARCH = freebsd)
1772 AM_CONDITIONAL(TARGET_OPENBSD, test $ARCH = openbsd)
1773 AM_CONDITIONAL(TARGET_AIX, test $ARCH = aix)
1774 AM_CONDITIONAL(TARGET_WIN32, test $ARCH = win32)
1775 AM_CONDITIONAL(TARGET_BEOS, test $ARCH = beos)
1776 AM_CONDITIONAL(TARGET_MACOS, test $ARCH = macos)
1778 # Set conditional variables for shared and static library selection.
1779 # These are not used in any Makefile.am but in sdl-config.in.
1780 AM_CONDITIONAL([ENABLE_SHARED], [test "$enable_shared" = yes])
1781 AM_CONDITIONAL([ENABLE_STATIC], [test "$enable_static" = yes])
1783 # Set runtime shared library paths as needed
1785 if test $ARCH = linux -o $ARCH = freebsd -o $ARCH = bsdi; then
1786 SDL_RLD_FLAGS="-Wl,-rpath,\${exec_prefix}/lib"
1789 if test $ARCH = solaris; then
1790 SDL_RLD_FLAGS="-R\${exec_prefix}/lib"
1793 dnl Output the video drivers we use
1794 if test x$enable_video = xtrue; then
1795 if test "$VIDEO_SUBDIRS" = ""; then
1796 AC_MSG_ERROR(*** No video drivers are enabled!)
1799 AC_SUBST(AUDIO_SUBDIRS)
1800 AC_SUBST(AUDIO_DRIVERS)
1801 AC_SUBST(VIDEO_SUBDIRS)
1802 AC_SUBST(VIDEO_DRIVERS)
1803 AC_SUBST(JOYSTICK_SUBDIRS)
1804 AC_SUBST(JOYSTICK_DRIVERS)
1805 AC_SUBST(SDL_EXTRADIRS)
1806 AC_SUBST(SDL_EXTRALIBS)
1807 AC_SUBST(SYSTEM_LIBS)
1809 dnl Expand the cflags and libraries needed by apps using SDL
1810 AC_SUBST(SDL_CFLAGS)
1812 AC_SUBST(SDL_RLD_FLAGS)
1814 dnl Expand the libraries needed for static linking
1815 AC_SUBST(SYSTEM_LIBS)
1816 dnl Expand the include directories for building SDL
1817 CFLAGS="$CFLAGS -I\$(top_srcdir)/include"
1818 CFLAGS="$CFLAGS -I\$(top_srcdir)/include/SDL"
1819 CFLAGS="$CFLAGS -I\$(top_srcdir)/src -I\$(top_srcdir)/src/$ARCH"
1820 CFLAGS="$CFLAGS -I\$(top_srcdir)/src/main"
1821 CFLAGS="$CFLAGS -I\$(top_srcdir)/src/audio"
1822 CFLAGS="$CFLAGS -I\$(top_srcdir)/src/video"
1823 CFLAGS="$CFLAGS -I\$(top_srcdir)/src/events"
1824 CFLAGS="$CFLAGS -I\$(top_srcdir)/src/joystick"
1825 CFLAGS="$CFLAGS -I\$(top_srcdir)/src/cdrom"
1826 CFLAGS="$CFLAGS -I\$(top_srcdir)/src/thread"
1827 CFLAGS="$CFLAGS -I\$(top_srcdir)/src/timer"
1828 CFLAGS="$CFLAGS -I\$(top_srcdir)/src/endian"
1829 CFLAGS="$CFLAGS -I\$(top_srcdir)/src/file"
1832 # Finally create all the generated files
1833 dnl Important: Any directory that you want to be in the distcheck should
1834 dnl have a file listed here, so that configure generates the
1835 dnl subdirectories on the build target.
1845 src/audio/alsa/Makefile
1846 src/audio/arts/Makefile
1847 src/audio/baudio/Makefile
1848 src/audio/dma/Makefile
1849 src/audio/dmedia/Makefile
1850 src/audio/dsp/Makefile
1851 src/audio/esd/Makefile
1852 src/audio/macrom/Makefile
1853 src/audio/nas/Makefile
1854 src/audio/nto/Makefile
1855 src/audio/paudio/Makefile
1856 src/audio/sun/Makefile
1857 src/audio/ums/Makefile
1858 src/audio/windib/Makefile
1859 src/audio/windx5/Makefile
1861 src/video/cybergfx/Makefile
1862 src/video/x11/Makefile
1863 src/video/dga/Makefile
1864 src/video/fbcon/Makefile
1865 src/video/ggi/Makefile
1866 src/video/maccommon/Makefile
1867 src/video/macdsp/Makefile
1868 src/video/macrom/Makefile
1869 src/video/svga/Makefile
1870 src/video/aalib/Makefile
1871 src/video/wincommon/Makefile
1872 src/video/windib/Makefile
1873 src/video/windx5/Makefile
1874 src/video/bwindow/Makefile
1875 src/video/photon/Makefile
1877 src/joystick/Makefile
1878 src/joystick/beos/Makefile
1879 src/joystick/dummy/Makefile
1880 src/joystick/linux/Makefile
1881 src/joystick/macos/Makefile
1882 src/joystick/win32/Makefile
1891 ], [chmod +x sdl-config])