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 <soundcard.h>
258 #include <sys/soundcard.h>
261 int arg = SNDCTL_DSP_SETFRAGMENT;
265 AC_MSG_RESULT($have_oss)
266 if test x$have_oss = xyes; then
267 CFLAGS="$CFLAGS -DOSS_SUPPORT"
268 AUDIO_SUBDIRS="$AUDIO_SUBDIRS dsp"
269 AUDIO_DRIVERS="$AUDIO_DRIVERS dsp/libaudio_dsp.la"
270 AUDIO_SUBDIRS="$AUDIO_SUBDIRS dma"
271 AUDIO_DRIVERS="$AUDIO_DRIVERS dma/libaudio_dma.la"
276 dnl See if the ALSA audio interface is supported
280 [ --enable-alsa support the ALSA audio API [default=yes]],
282 if test x$enable_audio = xyes -a x$enable_alsa = xyes; then
284 AC_CHECK_HEADER(sys/asoundlib.h, have_alsa_hdr=yes)
285 AC_CHECK_LIB(asound, snd_pcm_open, have_alsa_lib=yes)
286 if test x$have_alsa_hdr = xyes -a x$have_alsa_lib = xyes; then
287 CFLAGS="$CFLAGS -DALSA_SUPPORT"
288 SYSTEM_LIBS="$SYSTEM_LIBS -lasound"
289 AUDIO_SUBDIRS="$AUDIO_SUBDIRS alsa"
290 AUDIO_DRIVERS="$AUDIO_DRIVERS alsa/libaudio_alsa.la"
295 dnl Find the ESD includes and libraries
299 [ --enable-esd support the Enlightened Sound Daemon [default=yes]],
301 if test x$enable_audio = xyes -a x$enable_esd = xyes; then
303 CFLAGS="$CFLAGS -DESD_SUPPORT $ESD_CFLAGS"
304 SYSTEM_LIBS="$SYSTEM_LIBS $ESD_LIBS"
305 AUDIO_SUBDIRS="$AUDIO_SUBDIRS esd"
306 AUDIO_DRIVERS="$AUDIO_DRIVERS esd/libaudio_esd.la"
314 [ --enable-arts support the Analog Real Time Synthesizer [default=yes]],
316 if test x$enable_audio = xyes -a x$enable_arts = xyes; then
317 AC_PATH_PROG(ARTSCCONFIG, artsc-config)
318 if test x$ARTSCCONFIG = x -o x$ARTSCCONFIG = x'"$ARTSCCONFIG"'; then
319 : # arts isn't installed
321 ARTSC_CFLAGS=`$ARTSCCONFIG --cflags`
322 ARTSC_LIBS=`$ARTSCCONFIG --libs`
323 AC_MSG_CHECKING(for aRts development environment)
325 save_CFLAGS="$CFLAGS"
326 CFLAGS="$CFLAGS $ARTSC_CFLAGS"
330 arts_stream_t stream;
334 CFLAGS="$save_CFLAGS"
335 AC_MSG_RESULT($audio_arts)
336 if test x$audio_arts = xyes; then
337 CFLAGS="$CFLAGS -DARTSC_SUPPORT $ARTSC_CFLAGS"
338 SYSTEM_LIBS="$SYSTEM_LIBS $ARTSC_LIBS"
339 AUDIO_SUBDIRS="$AUDIO_SUBDIRS arts"
340 AUDIO_DRIVERS="$AUDIO_DRIVERS arts/libaudio_arts.la"
346 dnl See if the NAS audio interface is supported
350 [ --enable-nas support the NAS audio API [default=yes]],
352 if test x$enable_audio = xyes -a x$enable_nas = xyes; then
353 AC_MSG_CHECKING(for NAS audio support)
355 if test -r /usr/X11R6/include/audio/audiolib.h ; then
358 AC_MSG_RESULT($have_nas)
359 if test x$have_nas = xyes; then
360 CFLAGS="$CFLAGS -DNAS_SUPPORT"
361 SYSTEM_LIBS="$SYSTEM_LIBS -laudio -lXt"
362 AUDIO_SUBDIRS="$AUDIO_SUBDIRS nas"
363 AUDIO_DRIVERS="$AUDIO_DRIVERS nas/libaudio_nas.la"
368 dnl See if we can use x86 assembly blitters
371 dnl Make sure we are running on an x86 platform
380 dnl Check for NASM (for assembly blit routines)
382 [ --enable-nasm use nasm assembly blitters on x86 [default=yes]],
384 if test x$enable_video = xyes -a x$enable_nasm = xyes; then
385 AC_PATH_PROG(NASM, nasm)
386 if test x$NASM = x -o x$NASM = x'"$NASM"'; then
387 : # nasm isn't installed
389 CFLAGS="$CFLAGS -DUSE_ASMBLIT -I$srcdir/hermes"
399 CFLAGS="$CFLAGS -I\$(top_srcdir)/src/hermes"
400 SDL_EXTRADIRS="$SDL_EXTRADIRS hermes"
401 SDL_EXTRALIBS="$SDL_EXTRALIBS hermes/libhermes.la"
406 dnl Find the X11 include and library directories
409 AC_ARG_ENABLE(video-x11,
410 [ --enable-video-x11 use X11 video driver [default=yes]],
411 , enable_video_x11=yes)
412 if test x$enable_video = xyes -a x$enable_video_x11 = xyes; then
415 if test x$have_x = xyes; then
416 CFLAGS="$CFLAGS $X_CFLAGS -DENABLE_X11"
417 if test x$ac_cv_func_shmat != xyes; then
418 CFLAGS="$CFLAGS -DNO_SHARED_MEMORY"
420 SYSTEM_LIBS="$SYSTEM_LIBS $X_LIBS -lX11 -lXext"
421 VIDEO_SUBDIRS="$VIDEO_SUBDIRS x11"
422 VIDEO_DRIVERS="$VIDEO_DRIVERS x11/libvideo_x11.la"
424 AC_ARG_ENABLE(video-x11-vm,
425 [ --enable-video-x11-vm use X11 VM extension for fullscreen [default=yes]],
426 , enable_video_x11_vm=yes)
427 if test x$enable_video_x11_vm = xyes; then
428 AC_MSG_CHECKING(for XFree86 VidMode 1.0 support)
431 #include <X11/Xlib.h>
432 #include <X11/extensions/xf86vmode.h>
437 AC_MSG_RESULT($video_x11_vm)
438 if test x$video_x11_vm = xyes; then
439 CFLAGS="$CFLAGS -DXFREE86_VM"
440 # Check for nasty XFree86 4.0/Glide hack
441 AC_ARG_ENABLE(xfree86_glidehack,
442 [ --enable-xfree86-glidehack Alternate vidmode lib for old Glide [default=no]],
443 , enable_xfreeglidehack=no)
444 if test x$enable_xfree86_glidehack = xyes; then
446 LIBS="$LIBS $X_LIBS -lX11 -lXext"
447 if test x$xfree86_glidehack = x; then
448 AC_CHECK_LIB(Xxf86vm, XF40VidModeQueryExtension, xfree86_glidehack=Xxf86vm)
450 if test x$xfree86_glidehack = x; then
451 AC_CHECK_LIB(Xxf86vm40, XF40VidModeQueryExtension, xfree86_glidehack=Xxf86vm40)
455 if test x$xfree86_glidehack != x; then
456 CFLAGS="$CFLAGS -DXFREE86_VM_DYNAMIC_HACK"
457 SYSTEM_LIBS="$SYSTEM_LIBS -l$xfree86_glidehack"
459 SYSTEM_LIBS="$SYSTEM_LIBS -lXxf86vm"
461 AC_MSG_CHECKING(for XFree86 VidMode gamma support)
464 #include <X11/Xlib.h>
465 #include <X11/extensions/xf86vmode.h>
467 XF86VidModeGamma gamma;
469 video_x11_vmgamma=yes
471 AC_MSG_RESULT($video_x11_vmgamma)
472 if test x$video_x11_vmgamma = xyes; then
473 CFLAGS="$CFLAGS -DXFREE86_VMGAMMA"
477 AC_ARG_ENABLE(video-x11-dgamouse,
478 [ --enable-video-x11-dgamouse use X11 DGA for mouse events [default=yes]],
479 , enable_video_x11_dgamouse=yes)
480 AC_MSG_CHECKING(for XFree86 DGA 1.0 support)
483 #include <X11/Xlib.h>
484 #include <X11/extensions/xf86dga.h>
489 AC_MSG_RESULT($video_x11_dga)
490 if test x$video_x11_dga = xyes; then
491 CFLAGS="$CFLAGS -DXFREE86_DGAMOUSE"
492 if test x$enable_video_x11_dgamouse = xyes; then
493 CFLAGS="$CFLAGS -DDEFAULT_DGAMOUSE"
495 SYSTEM_LIBS="$SYSTEM_LIBS -lXxf86dga"
497 AC_ARG_ENABLE(video-x11-xv,
498 [ --enable-video-x11-xv use X11 XvImage extension for video [default=yes]],
499 , enable_video_x11_xv=yes)
500 if test x$enable_video_x11_xv = xyes; then
501 AC_MSG_CHECKING(for XFree86 XvImage support)
504 #include <X11/Xlib.h>
507 #include <X11/extensions/XShm.h>
508 #include <X11/extensions/Xvlib.h>
514 AC_MSG_RESULT($video_x11_xv)
515 if test x$video_x11_xv = xyes; then
516 CFLAGS="$CFLAGS -DXFREE86_XV"
517 SYSTEM_LIBS="$SYSTEM_LIBS -lXv"
525 AC_ARG_ENABLE(video-photon,
526 [ --enable-video-photon use QNX Photonvideo driver [default=yes]],
527 , enable_video_photon=yes)
528 if test x$enable_video = xyes -a x$enable_video_photon = xyes; then
529 AC_MSG_CHECKING(for QNX Photon support)
534 #include <photon/Pg.h>
535 #include <photon/PdDirect.h>
537 PgDisplaySettings_t *visual;
541 AC_MSG_RESULT($video_photon)
542 if test x$video_photon = xyes; then
543 SYSTEM_LIBS="$SYSTEM_LIBS -lph"
544 VIDEO_SUBDIRS="$VIDEO_SUBDIRS photon"
545 VIDEO_DRIVERS="$VIDEO_DRIVERS photon/libvideo_photon.la"
550 dnl Find the X11 DGA 2.0 include and library directories
553 AC_ARG_ENABLE(video-dga,
554 [ --enable-video-dga use DGA 2.0 video driver [default=yes]],
555 , enable_video_dga=yes)
556 if test x$video_x11_dga = xyes -a x$enable_video_dga = xyes; then
557 AC_MSG_CHECKING(for XFree86 DGA 2.0 support)
560 #include <X11/Xlib.h>
561 #include <X11/extensions/xf86dga.h>
567 AC_MSG_RESULT($video_x11_dga2)
568 if test x$video_x11_dga2 = xyes; then
569 CFLAGS="$CFLAGS -DENABLE_DGA"
570 VIDEO_SUBDIRS="$VIDEO_SUBDIRS dga"
571 VIDEO_DRIVERS="$VIDEO_DRIVERS dga/libvideo_dga.la"
576 dnl Find the framebuffer console includes
579 AC_ARG_ENABLE(video-fbcon,
580 [ --enable-video-fbcon use framebuffer console video driver [default=yes]],
581 , enable_video_fbcon=yes)
582 if test x$enable_video = xyes -a x$enable_video_fbcon = xyes; then
583 AC_MSG_CHECKING(for framebuffer console support)
586 #include <linux/fb.h>
587 #include <linux/kd.h>
588 #include <linux/keyboard.h>
593 AC_MSG_RESULT($video_fbcon)
594 if test x$video_fbcon = xyes; then
595 CFLAGS="$CFLAGS -DENABLE_FBCON"
596 VIDEO_SUBDIRS="$VIDEO_SUBDIRS fbcon"
597 VIDEO_DRIVERS="$VIDEO_DRIVERS fbcon/libvideo_fbcon.la"
602 dnl Find the GGI includes
605 AC_ARG_ENABLE(video-ggi,
606 [ --enable-video-ggi use GGI video driver [default=no]],
607 , enable_video_ggi=no)
608 if test x$enable_video = xyes -a x$enable_video_ggi = xyes; then
609 AC_MSG_CHECKING(for GGI support)
618 AC_MSG_RESULT($video_ggi)
619 if test x$video_ggi = xyes; then
620 CFLAGS="$CFLAGS $X_CFLAGS -DENABLE_GGI"
621 SYSTEM_LIBS="$SYSTEM_LIBS -lggi -lgii -lgg"
623 VIDEO_SUBDIRS="$VIDEO_SUBDIRS ggi"
624 VIDEO_DRIVERS="$VIDEO_DRIVERS ggi/libvideo_ggi.la"
629 dnl Find the SVGAlib includes and libraries
632 AC_ARG_ENABLE(video-svga,
633 [ --enable-video-svga use SVGAlib video driver [default=no]],
634 , enable_video_svga=no)
635 if test x$enable_video = xyes -a x$enable_video_svga = xyes; then
636 AC_MSG_CHECKING(for SVGAlib (1.4.0+) support)
640 #include <vgamouse.h>
641 #include <vgakeyboard.h>
643 if ( SCANCODE_RIGHTWIN && SCANCODE_LEFTWIN ) {
649 AC_MSG_RESULT($video_svga)
650 if test x$video_svga = xyes; then
651 CFLAGS="$CFLAGS -DENABLE_SVGALIB"
652 SYSTEM_LIBS="$SYSTEM_LIBS -lvga"
654 VIDEO_SUBDIRS="$VIDEO_SUBDIRS svga"
655 VIDEO_DRIVERS="$VIDEO_DRIVERS svga/libvideo_svga.la"
660 dnl Find the AAlib includes
663 AC_ARG_ENABLE(video-aalib,
664 [ --enable-video-aalib use AAlib video driver [default=no]],
665 , enable_video_aalib=no)
666 if test x$enable_video = xyes -a x$enable_video_aalib = xyes; then
667 AC_MSG_CHECKING(for AAlib support)
675 AC_MSG_RESULT($video_aalib)
676 if test x$video_aalib = xyes; then
677 CFLAGS="$CFLAGS -DENABLE_AALIB"
678 SYSTEM_LIBS="$SYSTEM_LIBS -laa"
680 VIDEO_SUBDIRS="$VIDEO_SUBDIRS aalib"
681 VIDEO_DRIVERS="$VIDEO_DRIVERS aalib/libvideo_aa.la"
686 dnl rcg04172001 Set up the Null video driver.
689 AC_ARG_ENABLE(video-dummy,
690 [ --enable-video-dummy use dummy video driver [default=no]],
691 , enable_video_dummy=no)
692 if test x$enable_video_dummy = xyes; then
693 CFLAGS="$CFLAGS -DENABLE_DUMMYVIDEO"
694 VIDEO_SUBDIRS="$VIDEO_SUBDIRS dummy"
695 VIDEO_DRIVERS="$VIDEO_DRIVERS dummy/libvideo_null.la"
699 dnl Check to see if OpenGL support is desired
700 AC_ARG_ENABLE(video-opengl,
701 [ --enable-video-opengl include OpenGL context creation [default=yes]],
702 , enable_video_opengl=yes)
707 if test x$enable_video = xyes -a x$enable_video_opengl = xyes; then
708 AC_MSG_CHECKING(for OpenGL (GLX) support)
713 #include <dlfcn.h> /* For loading extensions */
718 AC_MSG_RESULT($video_opengl)
719 if test x$video_opengl = xyes; then
720 CFLAGS="$CFLAGS -DHAVE_OPENGL"
721 AC_CHECK_LIB(dl, dlopen, SYSTEM_LIBS="$SYSTEM_LIBS -ldl")
726 dnl Check for BeOS OpenGL
729 if test x$enable_video = xyes -a x$enable_video_opengl = xyes; then
730 CFLAGS="$CFLAGS -DHAVE_OPENGL"
731 SYSTEM_LIBS="$SYSTEM_LIBS -lGL"
735 dnl Check for MacOS OpenGL
738 if test x$enable_video = xyes -a x$enable_video_opengl = xyes; then
739 CFLAGS="$CFLAGS -DHAVE_OPENGL"
742 SDL_LIBS="$SDL_LIBS -framework OpenGL -framework AGL"
747 dnl See if we can use the new unified event interface in Linux 2.4
750 dnl Check for Linux 2.4 unified input event interface support
751 AC_ARG_ENABLE(input-events,
752 [ --enable-input-events use Linux 2.4 unified input interface [default=yes]],
753 , enable_input_events=yes)
754 if test x$enable_input_events = xyes; then
755 AC_MSG_CHECKING(for Linux 2.4 unified input interface)
758 #include <linux/input.h>
761 #error EVIOCGNAME() ioctl not available
766 AC_MSG_RESULT($use_input_events)
767 if test x$use_input_events = xyes; then
768 CFLAGS="$CFLAGS -DUSE_INPUT_EVENTS"
773 dnl See what type of thread model to use on Linux and Solaris
776 dnl Check for pthread support
777 AC_ARG_ENABLE(pthreads,
778 [ --enable-pthreads use POSIX threads for multi-threading [default=yes]],
779 , enable_pthreads=yes)
780 dnl This is used on Linux for glibc binary compatibility (Doh!)
781 AC_ARG_ENABLE(pthread-sem,
782 [ --enable-pthread-sem use pthread semaphores [default=yes]],
783 , enable_pthread_sem=yes)
787 pthread_cflags="-D_REENTRANT -D_THREAD_SAFE"
791 pthread_cflags="-D_THREAD_SAFE"
792 # causes Carbon.p complaints?
793 # pthread_cflags="-D_REENTRANT -D_THREAD_SAFE"
796 pthread_cflags="-D_REENTRANT -D_THREAD_SAFE"
797 pthread_lib="-pthread"
800 pthread_cflags="-D_REENTRANT"
801 pthread_lib="-pthread"
804 pthread_cflags="-D_REENTRANT"
805 pthread_lib="-lpthread -lposix4"
808 pthread_cflags="-D_REENTRANT -Kthread"
812 pthread_cflags="-D_SGI_MP_SOURCE"
813 pthread_lib="-lpthread"
816 pthread_cflags="-D_REENTRANT -mthreads"
817 pthread_lib="-lpthread"
824 pthread_cflags="-D_REENTRANT"
825 pthread_lib="-lpthread"
828 LIBS="$LIBS $pthread_lib"
829 if test x$enable_threads = xyes -a x$enable_pthreads = xyes; then
830 AC_MSG_CHECKING(for pthreads)
836 pthread_attr_init(&type);
840 AC_MSG_RESULT($use_pthreads)
841 if test x$use_pthreads = xyes; then
842 CFLAGS="$CFLAGS $pthread_cflags -DSDL_USE_PTHREADS"
843 SDL_CFLAGS="$SDL_CFLAGS $pthread_cflags"
844 SDL_LIBS="$SDL_LIBS $pthread_lib"
846 # Check to see if recursive mutexes are available
847 AC_MSG_CHECKING(for recursive mutexes)
848 has_recursive_mutexes=no
852 pthread_mutexattr_t attr;
854 pthread_mutexattr_setkind_np(&attr, PTHREAD_MUTEX_RECURSIVE_NP);
856 pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
859 has_recursive_mutexes=yes
861 # Some systems have broken recursive mutex implementations
864 has_recursive_mutexes=no
867 AC_MSG_RESULT($has_recursive_mutexes)
868 if test x$has_recursive_mutexes != xyes; then
869 CFLAGS="$CFLAGS -DPTHREAD_NO_RECURSIVE_MUTEX"
872 # Check to see if this is broken glibc 2.0 pthreads
875 AC_MSG_CHECKING(for broken glibc 2.0 pthreads)
878 #include <features.h>
879 #if (__GLIBC__ == 2) && (__GLIBC_MINOR__ == 0)
880 #warning Working around a bug in glibc 2.0 pthreads
882 #error pthread implementation okay
883 #endif /* glibc 2.0 */
888 AC_MSG_RESULT($glibc20_pthreads)
894 AC_MSG_CHECKING(whether semun is defined in /usr/include/sys/sem.h)
897 #include <sys/types.h>
904 AC_MSG_RESULT($have_semun)
905 if test x$have_semun = xyes; then
906 CFLAGS="$CFLAGS -DHAVE_SEMUN"
909 # See if we can use clone() on Linux directly
911 if test x$enable_threads = xyes -a x$use_pthreads != xyes; then
917 CFLAGS="$CFLAGS -DFORK_HACK"
921 AM_CONDITIONAL(USE_CLONE, test x$use_clone = xyes)
924 dnl Determine whether the compiler can produce Win32 executables
927 AC_MSG_CHECKING(Win32 compiler)
935 AC_MSG_RESULT($have_win32_gcc)
936 if test x$have_win32_gcc != xyes; then
938 *** Your compiler ($CC) does not produce Win32 executables!
942 dnl See if the user wants to redirect standard output to files
943 AC_ARG_ENABLE(stdio-redirect,
944 [ --enable-stdio-redirect Redirect STDIO to files on Win32 [default=yes]],
945 , enable_stdio_redirect=yes)
946 if test x$enable_stdio_redirect != xyes; then
947 CFLAGS="$CFLAGS -DNO_STDIO_REDIRECT"
951 dnl Find the DirectX includes and libraries
954 AC_ARG_ENABLE(directx,
955 [ --enable-directx use DirectX for Win32 audio/video [default=yes]],
956 , enable_directx=yes)
957 if test x$enable_directx = xyes; then
958 AC_MSG_CHECKING(for DirectX headers and libraries)
961 #include "src/video/windx5/directx.h"
966 AC_MSG_RESULT($use_directx)
968 AM_CONDITIONAL(USE_DIRECTX, test x$use_directx = xyes)
970 CFLAGS="$CFLAGS -I\$(top_srcdir)/src/video/wincommon"
971 SYSTEM_LIBS="$SYSTEM_LIBS -luser32 -lgdi32 -lwinmm"
972 VIDEO_SUBDIRS="$VIDEO_SUBDIRS wincommon"
973 VIDEO_DRIVERS="$VIDEO_DRIVERS wincommon/libvideo_wincommon.la"
974 # Enable the DIB driver
975 CFLAGS="$CFLAGS -DENABLE_WINDIB"
976 VIDEO_SUBDIRS="$VIDEO_SUBDIRS windib"
977 VIDEO_DRIVERS="$VIDEO_DRIVERS windib/libvideo_windib.la"
978 # See if we should enable the DirectX driver
979 if test x$use_directx = xyes; then
980 CFLAGS="$CFLAGS -DENABLE_DIRECTX"
981 SYSTEM_LIBS="$SYSTEM_LIBS -ldxguid"
982 VIDEO_SUBDIRS="$VIDEO_SUBDIRS windx5"
983 VIDEO_DRIVERS="$VIDEO_DRIVERS windx5/libvideo_windx5.la"
987 dnl Set up the BWindow video driver on BeOS
990 CFLAGS="$CFLAGS -DENABLE_BWINDOW"
991 VIDEO_SUBDIRS="$VIDEO_SUBDIRS bwindow"
992 VIDEO_DRIVERS="$VIDEO_DRIVERS bwindow/libvideo_bwindow.la"
995 dnl Set up the Mac toolbox video driver for Mac OS 7-9
998 VIDEO_SUBDIRS="$VIDEO_SUBDIRS maccommon"
999 VIDEO_DRIVERS="$VIDEO_DRIVERS maccommon/libvideo_maccommon.la"
1000 VIDEO_SUBDIRS="$VIDEO_SUBDIRS macrom"
1001 VIDEO_DRIVERS="$VIDEO_DRIVERS macrom/libvideo_macrom.la"
1004 dnl Set up the Mac toolbox video driver for Mac OS X
1007 # "MACOSX" is not an official definition, but it's commonly
1008 # accepted as a way to differentiate between what runs on X
1009 # and what runs on older Macs - while in theory "Carbon" defns
1010 # are consistent between the two, in practice Carbon is still
1011 # changing. -sts Aug 2000
1012 mac_autoconf_target_workaround="MAC"
1013 CFLAGS="$CFLAGS -I/System/Library/Frameworks/Carbon.framework/Headers \
1014 -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"
1015 VIDEO_SUBDIRS="$VIDEO_SUBDIRS maccommon"
1016 VIDEO_DRIVERS="$VIDEO_DRIVERS maccommon/libvideo_maccommon.la"
1017 VIDEO_SUBDIRS="$VIDEO_SUBDIRS macrom"
1018 VIDEO_DRIVERS="$VIDEO_DRIVERS macrom/libvideo_macrom.la"
1021 dnl Set up the kernel statistics library for Solaris
1024 CFLAGS="$CFLAGS -DHAVE_KSTAT"
1025 SYSTEM_LIBS="$SYSTEM_LIBS -lkstat"
1047 # Set up files for the main() stub
1048 COPY_ARCH_SRC(src/main, linux, SDL_main.c)
1049 # Set up files for the audio library
1050 # We use the OSS and ALSA API's, not the Sun audio API
1051 #if test x$enable_audio = xyes; then
1052 # AUDIO_SUBDIRS="$AUDIO_SUBDIRS sun"
1053 # AUDIO_DRIVERS="$AUDIO_DRIVERS sun/libaudio_sun.la"
1055 # Set up files for the joystick library
1056 if test x$enable_joystick = xyes; then
1057 JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS linux"
1058 JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS linux/libjoystick_linux.la"
1060 # Set up files for the cdrom library
1061 if test x$enable_cdrom = xyes; then
1062 COPY_ARCH_SRC(src/cdrom, linux, SDL_syscdrom.c)
1064 # Set up files for the thread library
1065 if test x$enable_threads = xyes; then
1066 if test x$use_pthreads != xyes; then
1067 COPY_ARCH_SRC(src/thread, linux, clone.S)
1069 COPY_ARCH_SRC(src/thread, linux, SDL_systhread.c)
1070 COPY_ARCH_SRC(src/thread, linux, SDL_systhread_c.h)
1071 if test x$use_pthreads = xyes -a x$enable_pthread_sem != xyes; then
1072 COPY_ARCH_SRC(src/thread, generic, SDL_syssem.c)
1074 COPY_ARCH_SRC(src/thread, linux, SDL_syssem.c)
1076 COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
1077 if test x$glibc20_pthreads = xyes; then
1078 COPY_ARCH_SRC(src/thread, generic, SDL_sysmutex.c)
1079 COPY_ARCH_SRC(src/thread, generic, SDL_sysmutex_c.h)
1080 COPY_ARCH_SRC(src/thread, generic, SDL_syscond.c)
1081 COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
1083 COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex.c)
1084 COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex_c.h)
1085 COPY_ARCH_SRC(src/thread, linux, SDL_syscond.c)
1086 COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
1089 # Set up files for the timer library
1090 if test x$enable_timers = xyes; then
1091 COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
1106 # Set up files for the main() stub
1107 COPY_ARCH_SRC(src/main, linux, SDL_main.c)
1108 # Set up files for the joystick library
1109 # (No joystick support yet)
1110 if test x$enable_joystick = xyes; then
1111 JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS dummy"
1112 JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS dummy/libjoystick_dummy.la"
1114 # Set up files for the cdrom library
1115 # (No cdrom support yet)
1116 if test x$enable_cdrom = xyes; then
1117 COPY_ARCH_SRC(src/cdrom, dummy, SDL_syscdrom.c)
1119 # Set up files for the thread library
1120 if test x$enable_threads = xyes; then
1121 COPY_ARCH_SRC(src/thread, linux, SDL_systhread.c)
1122 COPY_ARCH_SRC(src/thread, linux, SDL_systhread_c.h)
1123 COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex.c)
1124 COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex_c.h)
1125 COPY_ARCH_SRC(src/thread, generic, SDL_syssem.c)
1126 COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
1127 COPY_ARCH_SRC(src/thread, linux, SDL_syscond.c)
1128 COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
1130 # Set up files for the timer library
1131 if test x$enable_timers = xyes; then
1132 COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
1149 # Set up files for the main() stub
1150 COPY_ARCH_SRC(src/main, linux, SDL_main.c)
1151 # Set up files for the audio library
1152 # We use the OSS and ALSA API's, not the Sun audio API
1153 #if test x$enable_audio = xyes; then
1154 # AUDIO_SUBDIRS="$AUDIO_SUBDIRS sun"
1155 # AUDIO_DRIVERS="$AUDIO_DRIVERS sun/libaudio_sun.la"
1157 # Set up files for the joystick library
1158 # (No joystick support yet)
1159 if test x$enable_joystick = xyes; then
1160 JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS dummy"
1161 JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS dummy/libjoystick_dummy.la"
1163 # Set up files for the cdrom library
1164 if test x$enable_cdrom = xyes; then
1165 COPY_ARCH_SRC(src/cdrom, freebsd, SDL_syscdrom.c)
1167 # Set up files for the thread library
1168 if test x$enable_threads = xyes; then
1169 COPY_ARCH_SRC(src/thread, linux, SDL_systhread.c)
1170 COPY_ARCH_SRC(src/thread, linux, SDL_systhread_c.h)
1171 COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex.c)
1172 COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex_c.h)
1173 if test x$use_pthreads = xyes -a x$enable_pthread_sem != xyes; then
1174 COPY_ARCH_SRC(src/thread, generic, SDL_syssem.c)
1176 COPY_ARCH_SRC(src/thread, linux, SDL_syssem.c)
1178 COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
1179 COPY_ARCH_SRC(src/thread, linux, SDL_syscond.c)
1180 COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
1182 # Set up files for the timer library
1183 if test x$enable_timers = xyes; then
1184 COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
1199 # Set up files for the main() stub
1200 COPY_ARCH_SRC(src/main, linux, SDL_main.c)
1201 # Set up files for the audio library
1202 if test x$enable_audio = xyes; then
1203 AUDIO_SUBDIRS="$AUDIO_SUBDIRS sun"
1204 AUDIO_DRIVERS="$AUDIO_DRIVERS sun/libaudio_sun.la"
1206 # Set up files for the joystick library
1207 # (No joystick support yet)
1208 if test x$enable_joystick = xyes; then
1209 JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS dummy"
1210 JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS dummy/libjoystick_dummy.la"
1212 # Set up files for the cdrom library
1213 if test x$enable_cdrom = xyes; then
1214 COPY_ARCH_SRC(src/cdrom, openbsd, SDL_syscdrom.c)
1216 # Set up files for the thread library
1217 if test x$enable_threads = xyes; then
1218 COPY_ARCH_SRC(src/thread, linux, SDL_systhread.c)
1219 COPY_ARCH_SRC(src/thread, linux, SDL_systhread_c.h)
1220 COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex.c)
1221 COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex_c.h)
1222 if test x$use_pthreads = xyes -a x$enable_pthread_sem != xyes; then
1223 COPY_ARCH_SRC(src/thread, generic, SDL_syssem.c)
1225 COPY_ARCH_SRC(src/thread, linux, SDL_syssem.c)
1227 COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
1228 COPY_ARCH_SRC(src/thread, linux, SDL_syscond.c)
1229 COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
1231 # Set up files for the timer library
1232 if test x$enable_timers = xyes; then
1233 COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
1235 # NetBSD does not define "unix"
1236 CFLAGS="$CFLAGS -Dunix"
1240 CFLAGS="$CFLAGS -Dunix"
1251 # Set up files for the main() stub
1252 COPY_ARCH_SRC(src/main, linux, SDL_main.c)
1253 # Set up files for the audio library
1254 if test x$enable_audio = xyes; then
1255 AUDIO_SUBDIRS="$AUDIO_SUBDIRS sun"
1256 AUDIO_DRIVERS="$AUDIO_DRIVERS sun/libaudio_sun.la"
1258 # Set up files for the joystick library
1259 # (No joystick support yet)
1260 if test x$enable_joystick = xyes; then
1261 JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS dummy"
1262 JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS dummy/libjoystick_dummy.la"
1264 # Set up files for the cdrom library
1265 if test x$enable_cdrom = xyes; then
1266 COPY_ARCH_SRC(src/cdrom, openbsd, SDL_syscdrom.c)
1268 # Set up files for the thread library
1269 if test x$enable_threads = xyes; then
1270 COPY_ARCH_SRC(src/thread, linux, SDL_systhread.c)
1271 COPY_ARCH_SRC(src/thread, linux, SDL_systhread_c.h)
1272 COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex.c)
1273 COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex_c.h)
1274 if test x$use_pthreads = xyes -a x$enable_pthread_sem != xyes; then
1275 COPY_ARCH_SRC(src/thread, generic, SDL_syssem.c)
1277 COPY_ARCH_SRC(src/thread, linux, SDL_syssem.c)
1279 COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
1280 COPY_ARCH_SRC(src/thread, linux, SDL_syscond.c)
1281 COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
1283 # Set up files for the timer library
1284 if test x$enable_timers = xyes; then
1285 COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
1301 # Set up files for the main() stub
1302 COPY_ARCH_SRC(src/main, linux, SDL_main.c)
1303 # Set up files for the audio library
1304 if test x$enable_audio = xyes; then
1305 AUDIO_SUBDIRS="$AUDIO_SUBDIRS sun"
1306 AUDIO_DRIVERS="$AUDIO_DRIVERS sun/libaudio_sun.la"
1308 # Set up files for the joystick library
1309 # (No joystick support yet)
1310 if test x$enable_joystick = xyes; then
1311 JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS dummy"
1312 JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS dummy/libjoystick_dummy.la"
1314 # Set up files for the cdrom library
1315 if test x$enable_cdrom = xyes; then
1316 COPY_ARCH_SRC(src/cdrom, dummy, SDL_syscdrom.c)
1318 # Set up files for the thread library
1319 if test x$enable_threads = xyes; then
1320 COPY_ARCH_SRC(src/thread, generic, SDL_systhread.c)
1321 COPY_ARCH_SRC(src/thread, generic, SDL_systhread_c.h)
1322 COPY_ARCH_SRC(src/thread, generic, SDL_sysmutex.c)
1323 COPY_ARCH_SRC(src/thread, generic, SDL_sysmutex_c.h)
1324 COPY_ARCH_SRC(src/thread, generic, SDL_syssem.c)
1325 COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
1326 COPY_ARCH_SRC(src/thread, generic, SDL_syscond.c)
1327 COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
1329 # Set up files for the timer library
1330 if test x$enable_timers = xyes; then
1331 COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
1336 CFLAGS="$CFLAGS -D__ELF__" # Fix for nasm on Solaris x86
1347 # Set up files for the main() stub
1348 COPY_ARCH_SRC(src/main, linux, SDL_main.c)
1349 # Set up files for the audio library
1350 if test x$enable_audio = xyes; then
1351 AUDIO_SUBDIRS="$AUDIO_SUBDIRS sun"
1352 AUDIO_DRIVERS="$AUDIO_DRIVERS sun/libaudio_sun.la"
1354 # Set up files for the joystick library
1355 # (No joystick support yet)
1356 if test x$enable_joystick = xyes; then
1357 JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS dummy"
1358 JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS dummy/libjoystick_dummy.la"
1360 # Set up files for the cdrom library
1361 if test x$enable_cdrom = xyes; then
1362 COPY_ARCH_SRC(src/cdrom, linux, SDL_syscdrom.c)
1364 # Set up files for the thread library
1365 if test x$enable_threads = xyes; then
1366 COPY_ARCH_SRC(src/thread, linux, SDL_systhread.c)
1367 COPY_ARCH_SRC(src/thread, linux, SDL_systhread_c.h)
1368 COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex.c)
1369 COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex_c.h)
1370 COPY_ARCH_SRC(src/thread, linux, SDL_syssem.c)
1371 COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
1372 COPY_ARCH_SRC(src/thread, generic, SDL_syscond.c)
1373 COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
1375 # Set up files for the timer library
1376 if test x$enable_timers = xyes; then
1377 COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
1388 # Set up files for the main() stub
1389 COPY_ARCH_SRC(src/main, linux, SDL_main.c)
1390 # Set up files for the audio library
1391 if test x$enable_audio = xyes; then
1392 AUDIO_SUBDIRS="$AUDIO_SUBDIRS dmedia"
1393 AUDIO_DRIVERS="$AUDIO_DRIVERS dmedia/libaudio_dmedia.la"
1394 LIBS="$LIBS -laudio"
1396 # Set up files for the joystick library
1397 # (No joystick support yet)
1398 if test x$enable_joystick = xyes; then
1399 JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS dummy"
1400 JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS dummy/libjoystick_dummy.la"
1402 # Set up files for the cdrom library
1403 # (No CD-ROM support yet)
1404 if test x$enable_cdrom = xyes; then
1405 COPY_ARCH_SRC(src/cdrom, dummy, SDL_syscdrom.c)
1407 # Set up files for the thread library
1408 if test x$enable_threads = xyes; then
1409 if test x$use_pthreads = xyes; then
1410 COPY_ARCH_SRC(src/thread, linux, SDL_systhread.c)
1411 COPY_ARCH_SRC(src/thread, linux, SDL_systhread_c.h)
1412 COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex.c)
1413 COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex_c.h)
1414 if test x$enable_pthread_sem != xyes; then
1415 COPY_ARCH_SRC(src/thread, generic, SDL_syssem.c)
1417 COPY_ARCH_SRC(src/thread, linux, SDL_syssem.c)
1419 COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
1420 COPY_ARCH_SRC(src/thread, linux, SDL_syscond.c)
1421 COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
1423 COPY_ARCH_SRC(src/thread, irix, SDL_systhread.c)
1424 COPY_ARCH_SRC(src/thread, irix, SDL_systhread_c.h)
1425 COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex.c)
1426 COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex_c.h)
1427 COPY_ARCH_SRC(src/thread, linux, SDL_syssem.c)
1428 COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
1429 COPY_ARCH_SRC(src/thread, generic, SDL_syscond.c)
1430 COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
1433 # Set up files for the timer library
1434 if test x$enable_timers = xyes; then
1435 COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
1447 # Set up files for the main() stub
1448 COPY_ARCH_SRC(src/main, linux, SDL_main.c)
1449 # Set up files for the audio library
1450 if test x$enable_audio = xyes; then
1451 AUDIO_SUBDIRS="$AUDIO_SUBDIRS sun"
1452 AUDIO_DRIVERS="$AUDIO_DRIVERS sun/libaudio_sun.la"
1454 # Set up files for the joystick library
1455 # (No joystick support yet)
1456 if test x$enable_joystick = xyes; then
1457 JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS dummy"
1458 JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS dummy/libjoystick_dummy.la"
1460 # Set up files for the cdrom library
1461 # (No CD-ROM support yet)
1462 if test x$enable_cdrom = xyes; then
1463 COPY_ARCH_SRC(src/cdrom, dummy, SDL_syscdrom.c)
1465 # Set up files for the thread library
1466 if test x$enable_threads = xyes; then
1467 COPY_ARCH_SRC(src/thread, linux, SDL_systhread.c)
1468 COPY_ARCH_SRC(src/thread, linux, SDL_systhread_c.h)
1469 COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex.c)
1470 COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex_c.h)
1471 COPY_ARCH_SRC(src/thread, linux, SDL_syssem.c)
1472 COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
1473 COPY_ARCH_SRC(src/thread, linux, SDL_syscond.c)
1474 COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
1476 # Set up files for the timer library
1477 if test x$enable_timers = xyes; then
1478 COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
1490 # Set up files for the main() stub
1491 COPY_ARCH_SRC(src/main, linux, SDL_main.c)
1492 # Set up files for the audio library
1493 if test x$enable_audio = xyes; then
1494 AUDIO_SUBDIRS="$AUDIO_SUBDIRS paudio"
1495 AUDIO_DRIVERS="$AUDIO_DRIVERS paudio/libaudio_paudio.la"
1497 # Set up files for the joystick library
1498 # (No joystick support yet)
1499 if test x$enable_joystick = xyes; then
1500 JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS dummy"
1501 JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS dummy/libjoystick_dummy.la"
1503 # Set up files for the cdrom library
1504 if test x$enable_cdrom = xyes; then
1505 COPY_ARCH_SRC(src/cdrom, aix, SDL_syscdrom.c)
1507 # Set up files for the thread library
1508 if test x$enable_threads = xyes; then
1509 COPY_ARCH_SRC(src/thread, linux, SDL_systhread.c)
1510 COPY_ARCH_SRC(src/thread, linux, SDL_systhread_c.h)
1511 COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex.c)
1512 COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex_c.h)
1513 COPY_ARCH_SRC(src/thread, linux, SDL_syssem.c)
1514 COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
1515 COPY_ARCH_SRC(src/thread, linux, SDL_syscond.c)
1516 COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
1518 # Set up files for the timer library
1519 if test x$enable_timers = xyes; then
1520 COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
1532 # Set up files for the main() stub
1533 COPY_ARCH_SRC(src/main, linux, SDL_main.c)
1534 # Set up files for the audio library
1535 if test x$enable_audio = xyes; then
1536 AUDIO_SUBDIRS="$AUDIO_SUBDIRS sun"
1537 AUDIO_DRIVERS="$AUDIO_DRIVERS sun/libaudio_sun.la"
1539 # Set up files for the joystick library
1540 # (No joystick support yet)
1541 if test x$enable_joystick = xyes; then
1542 JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS dummy"
1543 JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS dummy/libjoystick_dummy.la"
1545 # Set up files for the cdrom library
1546 # (No cdrom support yet)
1547 if test x$enable_cdrom = xyes; then
1548 COPY_ARCH_SRC(src/cdrom, dummy, SDL_syscdrom.c)
1550 # Set up files for the thread library
1551 if test x$enable_threads = xyes; then
1552 COPY_ARCH_SRC(src/thread, linux, SDL_systhread.c)
1553 COPY_ARCH_SRC(src/thread, linux, SDL_systhread_c.h)
1554 COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex.c)
1555 COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex_c.h)
1556 COPY_ARCH_SRC(src/thread, generic, SDL_syssem.c)
1557 COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
1558 COPY_ARCH_SRC(src/thread, linux, SDL_syscond.c)
1559 COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
1561 # Set up files for the timer library
1562 if test x$enable_timers = xyes; then
1563 COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
1574 # Set up files for the main() stub
1575 COPY_ARCH_SRC(src/main, linux, SDL_main.c)
1576 # Set up files for the audio library
1577 if test x$enable_audio = xyes; then
1578 CFLAGS="$CFLAGS -DALSA_SUPPORT"
1579 SYSTEM_LIBS="$SYSTEM_LIBS -lasound"
1580 AUDIO_SUBDIRS="$AUDIO_SUBDIRS nto"
1581 AUDIO_DRIVERS="$AUDIO_DRIVERS nto/libaudio_nto.la"
1582 AUDIO_SUBDIRS="$AUDIO_SUBDIRS sun"
1583 AUDIO_DRIVERS="$AUDIO_DRIVERS sun/libaudio_sun.la"
1585 # Set up files for the joystick library
1586 if test x$enable_joystick = xyes; then
1587 # (No joystick support yet)
1588 JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS dummy"
1589 JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS dummy/libjoystick_dummy.la"
1591 # Set up files for the cdrom library
1592 if test x$enable_cdrom = xyes; then
1593 COPY_ARCH_SRC(src/cdrom, qnx, SDL_syscdrom.c)
1595 # Set up files for the thread library
1596 if test x$enable_threads = xyes; then
1597 COPY_ARCH_SRC(src/thread, linux, SDL_systhread.c)
1598 COPY_ARCH_SRC(src/thread, linux, SDL_systhread_c.h)
1599 COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex.c)
1600 COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex_c.h)
1601 COPY_ARCH_SRC(src/thread, linux, SDL_syssem.c)
1602 COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
1603 COPY_ARCH_SRC(src/thread, linux, SDL_syscond.c)
1604 COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
1606 # Set up files for the timer library
1607 if test x$enable_timers = xyes; then
1608 COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
1611 *-*-cygwin* | *-*-mingw32*)
1613 if test "$build" != "$target"; then # cross-compiling
1614 # Default cross-compile location
1615 ac_default_prefix=/usr/local/cross-tools/i386-mingw32msvc
1617 # Look for the location of the tools and install there
1618 if [ "$BUILD_PREFIX" != "" ]; then
1619 ac_default_prefix=$BUILD_PREFIX
1626 # Set up files for the main() stub
1627 COPY_ARCH_SRC(src/main, win32, SDL_main.c)
1628 # Set up files for the audio library
1629 if test x$enable_audio = xyes; then
1630 AUDIO_SUBDIRS="$AUDIO_SUBDIRS windib"
1631 AUDIO_DRIVERS="$AUDIO_DRIVERS windib/libaudio_windib.la"
1632 if test x$use_directx = xyes; then
1633 AUDIO_SUBDIRS="$AUDIO_SUBDIRS windx5"
1634 AUDIO_DRIVERS="$AUDIO_DRIVERS windx5/libaudio_windx5.la"
1637 # Set up files for the joystick library
1638 if test x$enable_joystick = xyes; then
1639 JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS win32"
1640 JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS win32/libjoystick_winmm.la"
1642 # Set up files for the cdrom library
1643 if test x$enable_cdrom = xyes; then
1644 COPY_ARCH_SRC(src/cdrom, win32, SDL_syscdrom.c)
1646 # Set up files for the thread library
1647 if test x$enable_threads = xyes; then
1648 COPY_ARCH_SRC(src/thread, win32, SDL_systhread.c)
1649 COPY_ARCH_SRC(src/thread, win32, SDL_systhread_c.h)
1650 COPY_ARCH_SRC(src/thread, win32, SDL_sysmutex.c)
1651 COPY_ARCH_SRC(src/thread, generic, SDL_sysmutex_c.h)
1652 COPY_ARCH_SRC(src/thread, win32, SDL_syssem.c)
1653 COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
1654 COPY_ARCH_SRC(src/thread, generic, SDL_syscond.c)
1655 COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
1657 # Set up files for the timer library
1658 if test x$enable_timers = xyes; then
1659 COPY_ARCH_SRC(src/timer, win32, SDL_systimer.c)
1661 # The Win32 platform requires special setup
1662 SDL_CFLAGS="$SDL_CFLAGS -Dmain=SDL_main"
1665 CFLAGS="$CFLAGS -I/usr/include/mingw -DWIN32 -Uunix"
1666 SDL_CFLAGS="$SDL_CFLAGS -I/usr/include/mingw -DWIN32 -Uunix"
1667 LIBS="$LIBS -mno-cygwin"
1668 SDL_LIBS="-lmingw32 -lSDLmain $SDL_LIBS -mwindows -mno-cygwin"
1671 SDL_LIBS="-lmingw32 -lSDLmain $SDL_LIBS -mwindows"
1677 ac_default_prefix=/boot/develop/tools/gnupro
1682 # Set up files for the main() stub
1683 COPY_ARCH_SRC(src/main, linux, SDL_main.c)
1684 COPY_ARCH_SRC(src/main, beos, SDL_BeApp.cc)
1685 COPY_ARCH_SRC(src/main, beos, SDL_BeApp.h)
1686 # Set up files for the audio library
1687 if test x$enable_audio = xyes; then
1688 AUDIO_SUBDIRS="$AUDIO_SUBDIRS baudio"
1689 AUDIO_DRIVERS="$AUDIO_DRIVERS baudio/libaudio_baudio.la"
1691 # Set up files for the joystick library
1692 if test x$enable_joystick = xyes; then
1693 JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS beos"
1694 JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS beos/libjoystick_beos.la"
1696 # Set up files for the cdrom library
1697 if test x$enable_cdrom = xyes; then
1698 COPY_ARCH_SRC(src/cdrom, beos, SDL_syscdrom.c)
1700 # Set up files for the thread library
1701 if test x$enable_threads = xyes; then
1702 COPY_ARCH_SRC(src/thread, beos, SDL_systhread.c)
1703 COPY_ARCH_SRC(src/thread, beos, SDL_systhread_c.h)
1704 COPY_ARCH_SRC(src/thread, generic, SDL_sysmutex.c)
1705 COPY_ARCH_SRC(src/thread, generic, SDL_sysmutex_c.h)
1706 COPY_ARCH_SRC(src/thread, beos, SDL_syssem.c)
1707 COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
1708 COPY_ARCH_SRC(src/thread, generic, SDL_syscond.c)
1709 COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
1711 # Set up files for the timer library
1712 if test x$enable_timers = xyes; then
1713 COPY_ARCH_SRC(src/timer, beos, SDL_systimer.c)
1715 # The BeOS platform requires special libraries
1716 SYSTEM_LIBS="$SYSTEM_LIBS -lroot -lbe -lmedia -lgame -ldevice -ltextencoding"
1719 # This would be used if cross-compiling to MacOS 9. No way to
1720 # use it at present, but Apple is working on a X-to-9 compiler
1721 # for which this case would be handy.
1726 # Set up files for the main() stub
1727 COPY_ARCH_SRC(src/main, macos, SDL_main.c)
1728 # Set up files for the audio library
1729 if test x$enable_audio = xyes; then
1730 AUDIO_SUBDIRS="$AUDIO_SUBDIRS macrom"
1731 AUDIO_DRIVERS="$AUDIO_DRIVERS macrom/libaudio_macrom.la"
1733 # Set up files for the joystick library
1734 if test x$enable_joystick = xyes; then
1735 JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS macos"
1736 JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS macos/libjoystick_macos.la"
1738 # Set up files for the cdrom library
1739 if test x$enable_cdrom = xyes; then
1740 COPY_ARCH_SRC(src/cdrom, macos, SDL_syscdrom.c)
1742 # Set up files for the thread library
1743 if test x$enable_threads = xyes; then
1744 COPY_ARCH_SRC(src/thread, macos, SDL_systhread.c)
1745 COPY_ARCH_SRC(src/thread, macos, SDL_systhread_c.h)
1746 COPY_ARCH_SRC(src/thread, generic, SDL_sysmutex.c)
1747 COPY_ARCH_SRC(src/thread, generic, SDL_sysmutex_c.h)
1748 COPY_ARCH_SRC(src/thread, macos, SDL_syssem.c)
1749 COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
1750 COPY_ARCH_SRC(src/thread, generic, SDL_syscond.c)
1751 COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
1753 # Set up files for the timer library
1754 if test x$enable_timers = xyes; then
1755 COPY_ARCH_SRC(src/timer, macos, SDL_systimer.c)
1757 # The MacOS platform requires special setup
1758 SDL_CFLAGS="$SDL_CFLAGS -Dmain=SDL_main"
1759 SDL_LIBS="-lSDLmain $SDL_LIBS"
1762 # Strictly speaking, we want "Mac OS X", not "Darwin", which is
1763 # just the OS X kernel sans upper layers like Carbon. But
1764 # config.guess comes back with "darwin", so go with the flow.
1770 # Set up files for the main() stub
1771 # COPY_ARCH_SRC(src/main, macos, SDL_main.c)
1772 COPY_ARCH_SRC(src/main, linux, SDL_main.c)
1773 # Set up files for the audio library
1774 if test x$enable_audio = xyes; then
1775 AUDIO_SUBDIRS="$AUDIO_SUBDIRS macrom"
1776 AUDIO_DRIVERS="$AUDIO_DRIVERS macrom/libaudio_macrom.la"
1778 # Set up files for the joystick library
1779 if test x$enable_joystick = xyes; then
1780 JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS dummy"
1781 JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS dummy/libjoystick_dummy.la"
1783 # Set up files for the cdrom library
1784 if test x$enable_cdrom = xyes; then
1785 COPY_ARCH_SRC(src/cdrom, dummy, SDL_syscdrom.c)
1787 # Set up files for the thread library
1788 if test x$enable_threads = xyes; then
1789 COPY_ARCH_SRC(src/thread, linux, SDL_systhread.c)
1790 COPY_ARCH_SRC(src/thread, linux, SDL_systhread_c.h)
1791 COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex.c)
1792 COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex_c.h)
1793 if test x$use_pthreads = xyes -a x$enable_pthread_sem != xyes; then
1794 COPY_ARCH_SRC(src/thread, generic, SDL_syssem.c)
1796 COPY_ARCH_SRC(src/thread, linux, SDL_syssem.c)
1798 COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
1799 COPY_ARCH_SRC(src/thread, generic, SDL_syscond.c)
1800 COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
1802 # Set up files for the timer library
1803 if test x$enable_timers = xyes; then
1804 COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
1806 # The MacOS X platform requires special setup
1807 SDL_CFLAGS="$SDL_CFLAGS -F/System/Library/Frameworks/Carbon.framework"
1808 SDL_LIBS="$SDL_LIBS -framework Carbon"
1811 AC_MSG_ERROR(Unsupported target: Please add to configure.in)
1816 # Set the conditional variables for this target
1817 AM_CONDITIONAL(TARGET_LINUX, test $ARCH = linux)
1818 AM_CONDITIONAL(TARGET_SOLARIS, test $ARCH = solaris)
1819 AM_CONDITIONAL(TARGET_IRIX, test $ARCH = irix)
1820 AM_CONDITIONAL(TARGET_BSDI, test $ARCH = bsdi)
1821 AM_CONDITIONAL(TARGET_FREEBSD, test $ARCH = freebsd)
1822 AM_CONDITIONAL(TARGET_OPENBSD, test $ARCH = openbsd)
1823 AM_CONDITIONAL(TARGET_AIX, test $ARCH = aix)
1824 AM_CONDITIONAL(TARGET_WIN32, test $ARCH = win32)
1825 AM_CONDITIONAL(TARGET_BEOS, test $ARCH = beos)
1826 AM_CONDITIONAL(TARGET_MACOS, test $ARCH = macos)
1828 # Set conditional variables for shared and static library selection.
1829 # These are not used in any Makefile.am but in sdl-config.in.
1830 AM_CONDITIONAL([ENABLE_SHARED], [test "$enable_shared" = yes])
1831 AM_CONDITIONAL([ENABLE_STATIC], [test "$enable_static" = yes])
1833 # Set runtime shared library paths as needed
1835 if test $ARCH = linux -o $ARCH = freebsd -o $ARCH = bsdi; then
1836 SDL_RLD_FLAGS="-Wl,-rpath,\${exec_prefix}/lib"
1839 if test $ARCH = solaris; then
1840 SDL_RLD_FLAGS="-R\${exec_prefix}/lib"
1843 if test $ARCH = openbsd; then
1844 SDL_RLD_FLAGS="-Wl,-R\${exec_prefix}/lib -Wl,-R\${X11BASE}/lib"
1847 dnl Output the video drivers we use
1848 if test x$enable_video = xtrue; then
1849 if test "$VIDEO_SUBDIRS" = ""; then
1850 AC_MSG_ERROR(*** No video drivers are enabled!)
1853 AC_SUBST(AUDIO_SUBDIRS)
1854 AC_SUBST(AUDIO_DRIVERS)
1855 AC_SUBST(VIDEO_SUBDIRS)
1856 AC_SUBST(VIDEO_DRIVERS)
1857 AC_SUBST(JOYSTICK_SUBDIRS)
1858 AC_SUBST(JOYSTICK_DRIVERS)
1859 AC_SUBST(SDL_EXTRADIRS)
1860 AC_SUBST(SDL_EXTRALIBS)
1861 AC_SUBST(SYSTEM_LIBS)
1863 dnl Expand the cflags and libraries needed by apps using SDL
1864 AC_SUBST(SDL_CFLAGS)
1866 AC_SUBST(SDL_RLD_FLAGS)
1868 dnl Expand the libraries needed for static linking
1869 AC_SUBST(SYSTEM_LIBS)
1870 dnl Expand the include directories for building SDL
1871 CFLAGS="$CFLAGS -I\$(top_srcdir)/include"
1872 CFLAGS="$CFLAGS -I\$(top_srcdir)/include/SDL"
1873 CFLAGS="$CFLAGS -I\$(top_srcdir)/src -I\$(top_srcdir)/src/$ARCH"
1874 CFLAGS="$CFLAGS -I\$(top_srcdir)/src/main"
1875 CFLAGS="$CFLAGS -I\$(top_srcdir)/src/audio"
1876 CFLAGS="$CFLAGS -I\$(top_srcdir)/src/video"
1877 CFLAGS="$CFLAGS -I\$(top_srcdir)/src/events"
1878 CFLAGS="$CFLAGS -I\$(top_srcdir)/src/joystick"
1879 CFLAGS="$CFLAGS -I\$(top_srcdir)/src/cdrom"
1880 CFLAGS="$CFLAGS -I\$(top_srcdir)/src/thread"
1881 CFLAGS="$CFLAGS -I\$(top_srcdir)/src/timer"
1882 CFLAGS="$CFLAGS -I\$(top_srcdir)/src/endian"
1883 CFLAGS="$CFLAGS -I\$(top_srcdir)/src/file"
1886 # Finally create all the generated files
1887 dnl Important: Any directory that you want to be in the distcheck should
1888 dnl have a file listed here, so that configure generates the
1889 dnl subdirectories on the build target.
1899 src/audio/alsa/Makefile
1900 src/audio/arts/Makefile
1901 src/audio/baudio/Makefile
1902 src/audio/dma/Makefile
1903 src/audio/dmedia/Makefile
1904 src/audio/dsp/Makefile
1905 src/audio/esd/Makefile
1906 src/audio/macrom/Makefile
1907 src/audio/nas/Makefile
1908 src/audio/nto/Makefile
1909 src/audio/paudio/Makefile
1910 src/audio/sun/Makefile
1911 src/audio/ums/Makefile
1912 src/audio/windib/Makefile
1913 src/audio/windx5/Makefile
1915 src/video/cybergfx/Makefile
1916 src/video/x11/Makefile
1917 src/video/dga/Makefile
1918 src/video/fbcon/Makefile
1919 src/video/ggi/Makefile
1920 src/video/maccommon/Makefile
1921 src/video/macdsp/Makefile
1922 src/video/macrom/Makefile
1923 src/video/svga/Makefile
1924 src/video/aalib/Makefile
1925 src/video/wincommon/Makefile
1926 src/video/windib/Makefile
1927 src/video/windx5/Makefile
1928 src/video/bwindow/Makefile
1929 src/video/photon/Makefile
1930 src/video/dummy/Makefile
1932 src/joystick/Makefile
1933 src/joystick/beos/Makefile
1934 src/joystick/dummy/Makefile
1935 src/joystick/linux/Makefile
1936 src/joystick/macos/Makefile
1937 src/joystick/win32/Makefile
1946 ], [chmod +x sdl-config])