From 0cc05bc994c556bd4f8dc1d577c440e3b44bb7b7 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Thu, 16 Feb 2006 10:11:48 +0000 Subject: [PATCH] New configure-based build system. Still work in progress, but much improved --- Makefile.am | 114 - SDL.spec.in | 13 +- TODO | 5 + acinclude.m4 | 27 +- autogen.sh | 14 +- config.guess => build-scripts/config.guess | 0 config.sub => build-scripts/config.sub | 0 build-scripts/install-sh | 323 ++ ltmain.sh => build-scripts/ltmain.sh | 0 build-scripts/makedep.sh | 66 + build-scripts/mkinstalldirs | 99 + strip_fPIC.sh => build-scripts/strip_fPIC.sh | 0 configure.in | 2803 ++++++----------- include/SDL_config.h | 295 ++ include/SDL_config.h.in | 179 +- include/SDL_error.h | 2 + include/SDL_stdinc.h | 5 +- include/SDL_syswm.h | 19 +- sdl-config.in | 9 - src/Makefile.am | 44 - src/SDL.c | 42 +- src/SDL_error.c | 13 +- src/SDL_loadso.c | 56 - src/audio/Makefile.am | 55 - src/audio/SDL_audio.c | 64 +- src/audio/SDL_audiomem.c | 67 - src/audio/SDL_audiomem.h | 9 +- src/audio/SDL_sysaudio.h | 46 +- src/audio/SDL_wave.c | 4 - src/audio/alsa/Makefile.am | 11 - src/audio/alsa/SDL_alsa_audio.c | 21 +- src/audio/alsa/SDL_alsa_audio.h | 3 +- src/audio/amigaos/Makefile.am | 8 - src/audio/amigaos/SDL_ahiaudio.c | 3 +- src/audio/amigaos/SDL_ahiaudio.h | 3 +- src/audio/arts/Makefile.am | 11 - src/audio/arts/SDL_artsaudio.c | 50 +- src/audio/arts/SDL_artsaudio.h | 3 +- src/audio/baudio/Makefile.am | 9 - src/audio/baudio/SDL_beaudio.cc | 6 +- src/audio/baudio/SDL_beaudio.h | 2 +- src/audio/dart/SDL_dart.c | 2 +- src/audio/dart/SDL_dart.h | 4 +- src/audio/dc/Makefile.am | 11 - src/audio/dc/SDL_dcaudio.c | 6 +- src/audio/dc/SDL_dcaudio.h | 2 +- src/audio/disk/Makefile.am | 9 - src/audio/disk/SDL_diskaudio.c | 6 +- src/audio/disk/SDL_diskaudio.h | 2 +- src/audio/dma/Makefile.am | 9 - src/audio/dma/SDL_dmaaudio.c | 10 +- src/audio/dma/SDL_dmaaudio.h | 2 +- src/audio/dmedia/Makefile.am | 9 - src/audio/dmedia/SDL_irixaudio.c | 4 +- src/audio/dmedia/SDL_irixaudio.h | 2 +- src/audio/dsp/Makefile.am | 9 - src/audio/dsp/SDL_dspaudio.c | 11 +- src/audio/dsp/SDL_dspaudio.h | 2 +- src/audio/esd/Makefile.am | 11 - src/audio/esd/SDL_esdaudio.c | 14 +- src/audio/esd/SDL_esdaudio.h | 2 +- src/audio/macosx/Makefile.am | 9 - src/audio/macosx/SDL_coreaudio.c | 5 +- src/audio/macosx/SDL_coreaudio.h | 2 +- src/audio/macrom/Makefile.am | 9 - src/audio/macrom/SDL_romaudio.c | 5 +- src/audio/macrom/SDL_romaudio.h | 2 +- src/audio/mint/Makefile.am | 19 - src/audio/mint/SDL_mintaudio.h | 2 +- src/audio/mint/SDL_mintaudio_dma8.c | 5 +- src/audio/mint/SDL_mintaudio_gsxb.c | 5 +- src/audio/mint/SDL_mintaudio_mcsn.c | 5 +- src/audio/mint/SDL_mintaudio_stfa.c | 9 +- src/audio/mint/SDL_mintaudio_xbios.c | 5 +- src/audio/mme/Makefile.am | 9 - src/audio/mme/SDL_mmeaudio.c | 3 +- src/audio/mme/SDL_mmeaudio.h | 3 +- src/audio/nas/Makefile.am | 9 - src/audio/nas/SDL_nasaudio.c | 6 +- src/audio/nas/SDL_nasaudio.h | 3 +- src/audio/nto/Makefile.am | 9 - src/audio/nto/SDL_nto_audio.c | 4 +- src/audio/nto/SDL_nto_audio.h | 3 +- src/audio/openbsd/Makefile.am | 9 - src/audio/openbsd/SDL_openbsdaudio.c | 6 +- src/audio/openbsd/SDL_openbsdaudio.h | 2 +- src/audio/paudio/Makefile.am | 9 - src/audio/paudio/SDL_paudio.c | 6 +- src/audio/paudio/SDL_paudio.h | 2 +- src/audio/sun/Makefile.am | 9 - src/audio/sun/SDL_sunaudio.c | 6 +- src/audio/sun/SDL_sunaudio.h | 2 +- src/audio/ums/Makefile.am | 9 - src/audio/ums/SDL_umsaudio.c | 4 +- src/audio/ums/SDL_umsaudio.h | 4 +- src/audio/windib/Makefile.am | 9 - src/audio/windib/SDL_dibaudio.c | 2 +- src/audio/windib/SDL_dibaudio.h | 2 +- src/audio/windx5/Makefile.am | 10 - src/audio/windx5/SDL_dx5audio.c | 2 +- src/audio/windx5/SDL_dx5audio.h | 2 +- src/cdrom/Makefile.am | 33 - src/cdrom/aix/Makefile.am | 8 - src/cdrom/aix/SDL_syscdrom.c | 4 +- src/cdrom/beos/Makefile.am | 8 - src/cdrom/beos/SDL_syscdrom.cc | 2 +- src/cdrom/bsdi/Makefile.am | 8 - src/cdrom/bsdi/SDL_syscdrom.c | 2 +- src/cdrom/dc/Makefile.am | 8 - src/cdrom/dc/SDL_syscdrom.c | 2 +- src/cdrom/dummy/Makefile.am | 8 - src/cdrom/dummy/SDL_syscdrom.c | 2 +- src/cdrom/freebsd/Makefile.am | 8 - src/cdrom/freebsd/SDL_syscdrom.c | 2 +- src/cdrom/linux/Makefile.am | 8 - src/cdrom/linux/SDL_syscdrom.c | 2 +- src/cdrom/macos/Makefile.am | 8 - src/cdrom/macos/SDL_syscdrom.c | 2 +- src/cdrom/macosx/Makefile.am | 16 - src/cdrom/macosx/SDL_syscdrom_c.h | 2 +- src/cdrom/mint/Makefile.am | 8 - src/cdrom/mint/SDL_syscdrom.c | 2 +- src/cdrom/openbsd/Makefile.am | 8 - src/cdrom/openbsd/SDL_syscdrom.c | 2 +- src/cdrom/os2/SDL_syscdrom.c | 2 +- src/cdrom/osf/Makefile.am | 8 - src/cdrom/osf/SDL_syscdrom.c | 2 +- src/cdrom/qnx/Makefile.am | 8 - src/cdrom/qnx/SDL_syscdrom.c | 2 +- src/cdrom/win32/Makefile.am | 8 - src/cdrom/win32/SDL_syscdrom.c | 2 +- src/cpuinfo/Makefile.am | 8 - src/cpuinfo/SDL_cpuinfo.c | 41 +- src/events/Makefile.am | 19 - src/events/SDL_events.c | 23 +- src/events/SDL_mouse.c | 4 +- src/events/SDL_resize.c | 2 +- src/events/SDL_sysevents.h | 2 +- src/file/Makefile.am | 11 - src/hermes/Makefile.am | 39 - src/joystick/Makefile.am | 20 - src/joystick/SDL_joystick.c | 34 +- src/joystick/amigaos/Makefile.am | 8 - src/joystick/amigaos/SDL_sysjoystick.c | 4 +- src/joystick/beos/Makefile.am | 8 - src/joystick/beos/SDL_bejoystick.cc | 4 +- src/joystick/bsd/Makefile.am | 8 - src/joystick/bsd/SDL_sysjoystick.c | 4 +- src/joystick/darwin/Makefile.am | 10 - src/joystick/darwin/SDL_sysjoystick.c | 4 +- src/joystick/dc/Makefile.am | 8 - src/joystick/dc/SDL_sysjoystick.c | 4 +- src/joystick/dummy/Makefile.am | 8 - src/joystick/dummy/SDL_sysjoystick.c | 4 +- src/joystick/linux/Makefile.am | 8 - src/joystick/linux/SDL_sysjoystick.c | 32 +- src/joystick/macos/Makefile.am | 8 - src/joystick/macos/SDL_sysjoystick.c | 4 +- src/joystick/mint/Makefile.am | 8 - src/joystick/mint/SDL_sysjoystick.c | 4 +- src/joystick/os2/SDL_sysjoystick.c | 4 +- src/joystick/riscos/Makefile.am | 8 - src/joystick/riscos/SDL_sysjoystick.c | 4 +- src/joystick/win32/Makefile.am | 8 - src/joystick/win32/SDL_mmjoystick.c | 4 +- .../beos/{SDL_loadso.c => SDL_sysloadso.c} | 8 - .../dlopen/{SDL_loadso.c => SDL_sysloadso.c} | 17 +- .../dummy/{SDL_loadso.c => SDL_sysloadso.c} | 4 - .../macos/{SDL_loadso.c => SDL_sysloadso.c} | 8 - .../macosx/{SDL_loadso.c => SDL_sysloadso.c} | 11 - .../mint/{SDL_loadso.c => SDL_sysloadso.c} | 9 - .../os2/{SDL_loadso.c => SDL_sysloadso.c} | 8 - .../SDL_loadso.c => win32/SDL_sysloadso.c} | 8 - src/main/Makefile.am | 19 +- src/main/win32/SDL_win32_main.c | 15 - src/stdlib/Makefile.am | 15 - src/thread/Makefile.am | 52 - src/thread/SDL_systhread.h | 6 +- src/thread/SDL_thread_c.h | 31 +- src/thread/amigaos/SDL_syssem.c | 29 +- src/thread/amigaos/SDL_systhread.c | 4 +- src/thread/amigaos/SDL_thread.c | 4 +- src/thread/beos/SDL_systhread.c | 4 +- src/thread/bsdi/SDL_syssem.c | 498 --- src/thread/dc/SDL_sysmutex.c | 10 +- src/thread/dc/SDL_syssem.c | 4 +- src/thread/dc/SDL_systhread.c | 4 +- src/thread/dc/SDL_systhread_c.h | 6 - src/thread/epoc/SDL_systhread.cpp | 2 +- src/thread/generic/SDL_syscond_c.h | 22 - src/thread/generic/SDL_sysmutex.c | 8 +- src/thread/generic/SDL_syssem.c | 4 +- src/thread/generic/SDL_syssem_c.h | 22 - src/thread/generic/SDL_systhread.c | 2 +- src/thread/generic/SDL_systhread_c.h | 4 - src/thread/{linux => irix}/SDL_syssem.c | 178 +- src/thread/irix/SDL_systhread.c | 2 +- src/thread/linux/SDL_systhread.c | 244 -- src/thread/linux/clone.S | 181 -- src/thread/os2/SDL_systhread.c | 2 +- src/thread/pth/SDL_syscond.c | 6 +- src/thread/pth/SDL_syscond_c.h | 9 - src/thread/pth/SDL_systhread.c | 6 +- src/thread/{linux => pthread}/SDL_syscond.c | 28 - src/thread/{linux => pthread}/SDL_sysmutex.c | 43 +- .../{linux => pthread}/SDL_sysmutex_c.h | 8 - src/thread/pthread/SDL_syssem.c | 174 + src/thread/pthread/SDL_systhread.c | 104 + .../{linux => pthread}/SDL_systhread_c.h | 10 - src/thread/riscos/SDL_syscond.c | 2 +- src/thread/riscos/SDL_sysmutex.c | 20 +- src/thread/riscos/SDL_sysmutex_c.h | 2 +- src/thread/riscos/SDL_syssem.c | 4 +- src/thread/riscos/SDL_systhread.c | 4 +- src/thread/riscos/SDL_systhread_c.h | 2 +- src/thread/win32/SDL_systhread.c | 3 +- src/timer/Makefile.am | 39 - src/timer/amigaos/SDL_systimer.c | 6 +- src/timer/beos/SDL_systimer.c | 2 +- src/timer/dc/SDL_systimer.c | 2 +- src/timer/dummy/SDL_systimer.c | 83 + src/timer/epoc/SDL_systimer.cpp | 2 +- src/timer/macos/SDL_MPWtimer.c | 2 +- src/timer/macos/SDL_systimer.c | 2 +- src/timer/mint/SDL_systimer.c | 2 +- src/timer/os2/SDL_systimer.c | 2 +- src/timer/riscos/SDL_systimer.c | 16 +- src/timer/{linux => unix}/SDL_systimer.c | 140 +- src/timer/win32/SDL_systimer.c | 2 +- src/timer/wince/SDL_systimer.c | 2 +- src/video/Makefile.am | 55 - src/video/SDL_RLEaccel.c | 2 +- src/video/SDL_blit.c | 2 +- src/video/SDL_blit_A.c | 38 +- src/video/SDL_blit_N.c | 25 +- src/video/SDL_bmp.c | 4 - src/video/SDL_cursor.c | 4 +- src/video/SDL_stretch.c | 9 +- src/video/SDL_sysvideo.h | 97 +- src/video/SDL_video.c | 84 +- src/video/SDL_yuv_mmx.c | 2 +- src/video/SDL_yuv_sw.c | 4 +- src/video/Xext/Makefile.am | 4 - src/video/Xext/XME/Makefile.am | 6 - src/video/Xext/XME/xme.c | 2 +- src/video/Xext/Xinerama/Makefile.am | 5 - src/video/Xext/Xinerama/Xinerama.c | 8 +- src/video/Xext/Xv/Makefile.am | 5 - src/video/Xext/Xv/Xv.c | 2 +- src/video/Xext/Xv/Xvlibint.h | 4 +- src/video/Xext/Xxf86dga/Makefile.am | 5 - src/video/Xext/Xxf86dga/XF86DGA.c | 8 +- src/video/Xext/Xxf86dga/XF86DGA2.c | 6 +- src/video/Xext/Xxf86vm/Makefile.am | 5 - src/video/Xext/Xxf86vm/XF86VMode.c | 4 +- src/video/Xext/extensions/Makefile.am | 17 - src/video/Xext/extensions/Xvlib.h | 2 +- src/video/Xext/extensions/xf86dga.h | 2 +- src/video/Xext/extensions/xf86dgastr.h | 2 +- src/video/Xext/extensions/xf86vmstr.h | 2 +- src/video/aalib/Makefile.am | 15 - src/video/aalib/SDL_aaevents.c | 4 +- src/video/aalib/SDL_aamouse.c | 2 +- src/video/aalib/SDL_aavideo.c | 6 +- src/video/aalib/SDL_aavideo.h | 2 +- src/video/ataricommon/Makefile.am | 31 - src/video/ataricommon/SDL_atarievents.c | 4 +- src/video/ataricommon/SDL_atarievents_c.h | 2 +- src/video/ataricommon/SDL_atarigl.c | 32 +- src/video/ataricommon/SDL_atarigl_c.h | 8 +- src/video/ataricommon/SDL_biosevents.c | 4 +- src/video/ataricommon/SDL_biosevents_c.h | 2 +- src/video/ataricommon/SDL_gemdosevents.c | 4 +- src/video/ataricommon/SDL_gemdosevents_c.h | 2 +- src/video/ataricommon/SDL_ikbdevents.c | 4 +- src/video/ataricommon/SDL_ikbdevents_c.h | 2 +- src/video/ataricommon/SDL_xbiosevents.c | 2 +- src/video/ataricommon/SDL_xbiosevents_c.h | 2 +- src/video/bwindow/Makefile.am | 21 - src/video/bwindow/SDL_BView.h | 2 +- src/video/bwindow/SDL_BWin.h | 22 +- src/video/bwindow/SDL_lowvideo.h | 2 +- src/video/bwindow/SDL_sysevents.cc | 4 +- src/video/bwindow/SDL_sysvideo.cc | 20 +- src/video/bwindow/SDL_sysyuv.cc | 2 +- src/video/cybergfx/Makefile.am | 25 - src/video/cybergfx/SDL_amigaevents.c | 6 +- src/video/cybergfx/SDL_amigamouse.c | 40 +- src/video/cybergfx/SDL_cgxaccel.c | 4 +- src/video/cybergfx/SDL_cgxgl.c | 12 +- src/video/cybergfx/SDL_cgxgl_c.h | 9 +- src/video/cybergfx/SDL_cgxmodes.c | 19 +- src/video/cybergfx/SDL_cgxvideo.c | 12 +- src/video/cybergfx/SDL_cgxvideo.h | 2 +- src/video/cybergfx/SDL_cgxwm.c | 271 +- src/video/cybergfx/SDL_cgxyuv.c | 183 -- src/video/cybergfx/SDL_cgxyuv_c.h | 40 - src/video/dc/Makefile.am | 14 - src/video/dc/SDL_dcevents.c | 4 +- src/video/dc/SDL_dcmouse.c | 2 +- src/video/dc/SDL_dcvideo.c | 24 +- src/video/dc/SDL_dcvideo.h | 2 +- src/video/dga/Makefile.am | 14 - src/video/dga/SDL_dgaevents.c | 6 +- src/video/dga/SDL_dgamouse.c | 2 +- src/video/dga/SDL_dgavideo.c | 8 +- src/video/dga/SDL_dgavideo.h | 2 +- src/video/directfb/Makefile.am | 17 - src/video/directfb/SDL_DirectFB_events.c | 6 +- src/video/directfb/SDL_DirectFB_video.c | 6 +- src/video/directfb/SDL_DirectFB_video.h | 2 +- src/video/directfb/SDL_DirectFB_yuv.c | 2 +- src/video/dummy/Makefile.am | 15 - src/video/dummy/SDL_nullevents.c | 5 +- src/video/dummy/SDL_nullmouse.c | 2 +- src/video/dummy/SDL_nullvideo.c | 6 +- src/video/dummy/SDL_nullvideo.h | 4 +- src/video/epoc/Makefile.am | 12 - src/video/epoc/SDL_epocevents.cpp | 2 +- src/video/epoc/SDL_epocevents_c.h | 2 +- src/video/epoc/SDL_epocvideo.cpp | 2 +- src/video/epoc/SDL_epocvideo.h | 2 +- src/video/fbcon/Makefile.am | 29 - src/video/fbcon/SDL_fb3dfx.c | 2 +- src/video/fbcon/SDL_fbevents.c | 20 +- src/video/fbcon/SDL_fbmatrox.c | 2 +- src/video/fbcon/SDL_fbmouse.c | 2 +- src/video/fbcon/SDL_fbriva.c | 2 +- src/video/fbcon/SDL_fbvideo.c | 10 +- src/video/fbcon/SDL_fbvideo.h | 10 +- src/video/gapi/Makefile.am | 10 - src/video/gapi/SDL_gapivideo.c | 6 +- src/video/gapi/SDL_gapivideo.h | 2 +- src/video/gem/Makefile.am | 16 - src/video/gem/SDL_gemevents.c | 4 +- src/video/gem/SDL_gemmouse.c | 4 +- src/video/gem/SDL_gemvideo.c | 20 +- src/video/gem/SDL_gemvideo.h | 2 +- src/video/ggi/Makefile.am | 16 - src/video/ggi/SDL_ggievents.c | 6 +- src/video/ggi/SDL_ggimouse.c | 2 +- src/video/ggi/SDL_ggivideo.c | 6 +- src/video/ggi/SDL_ggivideo.h | 2 +- src/video/ipod/Makefile.am | 5 - src/video/ipod/SDL_ipodvideo.c | 6 +- src/video/maccommon/Makefile.am | 18 - src/video/maccommon/SDL_lowvideo.h | 8 +- src/video/maccommon/SDL_macevents.c | 8 +- src/video/maccommon/SDL_macgl.c | 8 +- src/video/maccommon/SDL_macgl_c.h | 6 +- src/video/macdsp/Makefile.am | 10 - src/video/macdsp/SDL_dspvideo.c | 12 +- src/video/macrom/Makefile.am | 10 - src/video/macrom/SDL_romvideo.c | 4 +- src/video/math_private.h | 5 +- src/video/nanox/Makefile.am | 20 - src/video/nanox/SDL_nxevents.c | 2 +- src/video/nanox/SDL_nxmouse.c | 2 +- src/video/nanox/SDL_nxvideo.c | 6 +- src/video/nanox/SDL_nxvideo.h | 2 +- src/video/nanox/SDL_nxwm.c | 2 +- src/video/os2fslib/Makefile.am | 11 - src/video/os2fslib/SDL_os2fslib.c | 6 +- src/video/photon/Makefile.am | 24 - src/video/photon/SDL_ph_events.c | 8 +- src/video/photon/SDL_ph_gl.c | 6 +- src/video/photon/SDL_ph_gl.h | 4 +- src/video/photon/SDL_ph_image.c | 22 +- src/video/photon/SDL_ph_image_c.h | 2 +- src/video/photon/SDL_ph_modes.c | 18 +- src/video/photon/SDL_ph_mouse.c | 4 +- src/video/photon/SDL_ph_video.c | 26 +- src/video/photon/SDL_ph_video.h | 14 +- src/video/photon/SDL_ph_wm.c | 6 +- src/video/photon/SDL_phyuv.c | 2 +- src/video/picogui/Makefile.am | 13 - src/video/picogui/SDL_pgevents.c | 4 +- src/video/picogui/SDL_pgvideo.c | 6 +- src/video/picogui/SDL_pgvideo.h | 2 +- src/video/ps2gs/Makefile.am | 17 - src/video/ps2gs/SDL_gsevents.c | 6 +- src/video/ps2gs/SDL_gsmouse.c | 4 +- src/video/ps2gs/SDL_gsvideo.c | 8 +- src/video/ps2gs/SDL_gsvideo.h | 2 +- src/video/ps2gs/SDL_gsyuv.c | 2 +- src/video/qtopia/Makefile.am | 18 - src/video/qtopia/SDL_QWin.h | 2 +- src/video/qtopia/SDL_lowvideo.h | 2 +- src/video/qtopia/SDL_sysevents.cc | 4 +- src/video/qtopia/SDL_sysvideo.cc | 6 +- src/video/quartz/Makefile.am | 18 - src/video/quartz/SDL_QuartzVideo.h | 8 +- src/video/quartz/SDL_QuartzYUV.m | 2 +- src/video/riscos/Makefile.am | 21 - src/video/riscos/SDL_riscosFullScreenVideo.c | 6 +- src/video/riscos/SDL_riscosevents.c | 12 +- src/video/riscos/SDL_riscosmouse.c | 2 +- src/video/riscos/SDL_riscostask.c | 4 +- src/video/riscos/SDL_riscosvideo.c | 6 +- src/video/riscos/SDL_riscosvideo.h | 2 +- src/video/riscos/SDL_wimppoll.c | 17 +- src/video/riscos/SDL_wimpvideo.c | 6 +- src/video/svga/Makefile.am | 15 - src/video/svga/SDL_svgaevents.c | 4 +- src/video/svga/SDL_svgamouse.c | 2 +- src/video/svga/SDL_svgavideo.c | 6 +- src/video/svga/SDL_svgavideo.h | 2 +- src/video/vgl/Makefile.am | 15 - src/video/vgl/SDL_vglevents.c | 4 +- src/video/vgl/SDL_vglmouse.c | 2 +- src/video/vgl/SDL_vglvideo.c | 6 +- src/video/vgl/SDL_vglvideo.h | 2 +- src/video/wincommon/Makefile.am | 17 - src/video/wincommon/SDL_lowvideo.h | 2 +- src/video/wincommon/SDL_sysevents.c | 8 +- src/video/wincommon/SDL_sysmouse.c | 4 +- src/video/wincommon/SDL_syswm.c | 11 +- src/video/wincommon/SDL_wingl.c | 18 +- src/video/wincommon/SDL_wingl_c.h | 10 +- src/video/windib/Makefile.am | 13 - src/video/windib/SDL_dibevents.c | 6 +- src/video/windib/SDL_dibevents_c.h | 2 +- src/video/windib/SDL_dibvideo.c | 20 +- src/video/windx5/Makefile.am | 15 - src/video/windx5/SDL_dx5events.c | 6 +- src/video/windx5/SDL_dx5events_c.h | 2 +- src/video/windx5/SDL_dx5video.c | 16 +- src/video/windx5/SDL_dx5yuv.c | 2 +- src/video/windx5/SDL_dx5yuv_c.h | 2 +- src/video/wscons/Makefile.am | 14 - src/video/wscons/SDL_wsconsevents.c | 4 +- src/video/wscons/SDL_wsconsmouse.c | 2 +- src/video/wscons/SDL_wsconsvideo.c | 6 +- src/video/wscons/SDL_wsconsvideo.h | 3 +- src/video/x11/Makefile.am | 35 - src/video/x11/SDL_x11dga.c | 16 +- src/video/x11/SDL_x11dyn.c | 14 +- src/video/x11/SDL_x11dyn.h | 4 +- src/video/x11/SDL_x11events.c | 6 +- src/video/x11/SDL_x11gamma.c | 6 +- src/video/x11/SDL_x11gl.c | 95 +- src/video/x11/SDL_x11gl_c.h | 14 +- src/video/x11/SDL_x11image.c | 2 +- src/video/x11/SDL_x11modes.c | 52 +- src/video/x11/SDL_x11mouse.c | 4 +- src/video/x11/SDL_x11video.c | 26 +- src/video/x11/SDL_x11video.h | 23 +- src/video/x11/SDL_x11wm.c | 4 +- src/video/x11/SDL_x11yuv.c | 11 +- src/video/x11/SDL_x11yuv_c.h | 4 +- src/video/xbios/Makefile.am | 16 - src/video/xbios/SDL_xbios.c | 20 +- src/video/xbios/SDL_xbios.h | 2 +- 453 files changed, 3533 insertions(+), 6706 deletions(-) delete mode 100644 Makefile.am rename config.guess => build-scripts/config.guess (100%) rename config.sub => build-scripts/config.sub (100%) create mode 100755 build-scripts/install-sh rename ltmain.sh => build-scripts/ltmain.sh (100%) create mode 100755 build-scripts/makedep.sh create mode 100755 build-scripts/mkinstalldirs rename strip_fPIC.sh => build-scripts/strip_fPIC.sh (100%) create mode 100644 include/SDL_config.h delete mode 100644 src/Makefile.am delete mode 100644 src/SDL_loadso.c delete mode 100644 src/audio/Makefile.am delete mode 100644 src/audio/SDL_audiomem.c delete mode 100644 src/audio/alsa/Makefile.am delete mode 100644 src/audio/amigaos/Makefile.am delete mode 100644 src/audio/arts/Makefile.am delete mode 100644 src/audio/baudio/Makefile.am delete mode 100644 src/audio/dc/Makefile.am delete mode 100644 src/audio/disk/Makefile.am delete mode 100644 src/audio/dma/Makefile.am delete mode 100644 src/audio/dmedia/Makefile.am delete mode 100644 src/audio/dsp/Makefile.am delete mode 100644 src/audio/esd/Makefile.am delete mode 100644 src/audio/macosx/Makefile.am delete mode 100644 src/audio/macrom/Makefile.am delete mode 100644 src/audio/mint/Makefile.am delete mode 100644 src/audio/mme/Makefile.am delete mode 100644 src/audio/nas/Makefile.am delete mode 100644 src/audio/nto/Makefile.am delete mode 100644 src/audio/openbsd/Makefile.am delete mode 100644 src/audio/paudio/Makefile.am delete mode 100644 src/audio/sun/Makefile.am delete mode 100644 src/audio/ums/Makefile.am delete mode 100644 src/audio/windib/Makefile.am delete mode 100644 src/audio/windx5/Makefile.am delete mode 100644 src/cdrom/Makefile.am delete mode 100644 src/cdrom/aix/Makefile.am delete mode 100644 src/cdrom/beos/Makefile.am delete mode 100644 src/cdrom/bsdi/Makefile.am delete mode 100644 src/cdrom/dc/Makefile.am delete mode 100644 src/cdrom/dummy/Makefile.am delete mode 100644 src/cdrom/freebsd/Makefile.am delete mode 100644 src/cdrom/linux/Makefile.am delete mode 100644 src/cdrom/macos/Makefile.am delete mode 100644 src/cdrom/macosx/Makefile.am delete mode 100644 src/cdrom/mint/Makefile.am delete mode 100644 src/cdrom/openbsd/Makefile.am delete mode 100644 src/cdrom/osf/Makefile.am delete mode 100644 src/cdrom/qnx/Makefile.am delete mode 100644 src/cdrom/win32/Makefile.am delete mode 100644 src/cpuinfo/Makefile.am delete mode 100644 src/events/Makefile.am delete mode 100644 src/file/Makefile.am delete mode 100644 src/hermes/Makefile.am delete mode 100644 src/joystick/Makefile.am delete mode 100644 src/joystick/amigaos/Makefile.am delete mode 100644 src/joystick/beos/Makefile.am delete mode 100644 src/joystick/bsd/Makefile.am delete mode 100644 src/joystick/darwin/Makefile.am delete mode 100644 src/joystick/dc/Makefile.am delete mode 100644 src/joystick/dummy/Makefile.am delete mode 100644 src/joystick/linux/Makefile.am delete mode 100644 src/joystick/macos/Makefile.am delete mode 100644 src/joystick/mint/Makefile.am delete mode 100644 src/joystick/riscos/Makefile.am delete mode 100644 src/joystick/win32/Makefile.am rename src/loadso/beos/{SDL_loadso.c => SDL_sysloadso.c} (91%) rename src/loadso/dlopen/{SDL_loadso.c => SDL_sysloadso.c} (85%) rename src/loadso/dummy/{SDL_loadso.c => SDL_sysloadso.c} (93%) rename src/loadso/macos/{SDL_loadso.c => SDL_sysloadso.c} (93%) rename src/loadso/macosx/{SDL_loadso.c => SDL_sysloadso.c} (99%) rename src/loadso/mint/{SDL_loadso.c => SDL_sysloadso.c} (86%) rename src/loadso/os2/{SDL_loadso.c => SDL_sysloadso.c} (92%) rename src/loadso/{windows/SDL_loadso.c => win32/SDL_sysloadso.c} (94%) delete mode 100644 src/stdlib/Makefile.am delete mode 100644 src/thread/Makefile.am delete mode 100644 src/thread/bsdi/SDL_syssem.c delete mode 100644 src/thread/generic/SDL_syscond_c.h delete mode 100644 src/thread/generic/SDL_syssem_c.h rename src/thread/{linux => irix}/SDL_syssem.c (58%) delete mode 100644 src/thread/linux/SDL_systhread.c delete mode 100644 src/thread/linux/clone.S delete mode 100644 src/thread/pth/SDL_syscond_c.h rename src/thread/{linux => pthread}/SDL_syscond.c (81%) rename src/thread/{linux => pthread}/SDL_sysmutex.c (77%) rename src/thread/{linux => pthread}/SDL_sysmutex_c.h (84%) create mode 100644 src/thread/pthread/SDL_syssem.c create mode 100644 src/thread/pthread/SDL_systhread.c rename src/thread/{linux => pthread}/SDL_systhread_c.h (88%) delete mode 100644 src/timer/Makefile.am create mode 100644 src/timer/dummy/SDL_systimer.c rename src/timer/{linux => unix}/SDL_systimer.c (58%) delete mode 100644 src/video/Makefile.am delete mode 100644 src/video/Xext/Makefile.am delete mode 100644 src/video/Xext/XME/Makefile.am delete mode 100644 src/video/Xext/Xinerama/Makefile.am delete mode 100644 src/video/Xext/Xv/Makefile.am delete mode 100644 src/video/Xext/Xxf86dga/Makefile.am delete mode 100644 src/video/Xext/Xxf86vm/Makefile.am delete mode 100644 src/video/Xext/extensions/Makefile.am delete mode 100644 src/video/aalib/Makefile.am delete mode 100644 src/video/ataricommon/Makefile.am delete mode 100644 src/video/bwindow/Makefile.am delete mode 100644 src/video/cybergfx/Makefile.am delete mode 100644 src/video/cybergfx/SDL_cgxyuv.c delete mode 100644 src/video/cybergfx/SDL_cgxyuv_c.h delete mode 100644 src/video/dc/Makefile.am delete mode 100644 src/video/dga/Makefile.am delete mode 100644 src/video/directfb/Makefile.am delete mode 100644 src/video/dummy/Makefile.am delete mode 100644 src/video/epoc/Makefile.am delete mode 100644 src/video/fbcon/Makefile.am delete mode 100644 src/video/gapi/Makefile.am delete mode 100644 src/video/gem/Makefile.am delete mode 100644 src/video/ggi/Makefile.am delete mode 100644 src/video/ipod/Makefile.am delete mode 100644 src/video/maccommon/Makefile.am delete mode 100644 src/video/macdsp/Makefile.am delete mode 100644 src/video/macrom/Makefile.am delete mode 100644 src/video/nanox/Makefile.am delete mode 100644 src/video/os2fslib/Makefile.am delete mode 100644 src/video/photon/Makefile.am delete mode 100644 src/video/picogui/Makefile.am delete mode 100644 src/video/ps2gs/Makefile.am delete mode 100644 src/video/qtopia/Makefile.am delete mode 100644 src/video/quartz/Makefile.am delete mode 100644 src/video/riscos/Makefile.am delete mode 100644 src/video/svga/Makefile.am delete mode 100644 src/video/vgl/Makefile.am delete mode 100644 src/video/wincommon/Makefile.am delete mode 100644 src/video/windib/Makefile.am delete mode 100644 src/video/windx5/Makefile.am delete mode 100644 src/video/wscons/Makefile.am delete mode 100644 src/video/x11/Makefile.am delete mode 100644 src/video/xbios/Makefile.am diff --git a/Makefile.am b/Makefile.am deleted file mode 100644 index d1aaddbac..000000000 --- a/Makefile.am +++ /dev/null @@ -1,114 +0,0 @@ -# The top-level input Makefile for SDL - -# require automake 1.4 -AUTOMAKE_OPTIONS = 1.4 - -## Any directories that you want built and installed should go here. -SUBDIRS = src include docs - -## Any directories you want a part of the distribution should be listed -## here, as well as have a Makefile generated at the end of configure.in -## -## This only works for subdirectories one level deep. -DIST_SUBDIRS = $(SUBDIRS) - -# SDL runtime configuration script -bin_SCRIPTS = sdl-config - -# All the rest of the distributed files -EXTRA_DIST = \ - BUGS \ - TODO \ - COPYING \ - CREDITS \ - INSTALL \ - README \ - README.AmigaOS \ - README.CVS \ - README.DC \ - README.Epoc \ - README.MacOS \ - README.MacOSX \ - README.MiNT \ - README.NanoX \ - README.PicoGUI \ - README.QNX \ - README.Qtopia \ - README.WinCE \ - README-SDL.txt \ - Borland.html \ - Borland.zip \ - VisualC.html \ - VisualC.zip \ - VisualCE.zip \ - Makefile.dc \ - MPWmake.sea.bin \ - CWprojects.sea.bin \ - PBProjects.tar.gz \ - EpocBuildFiles.zip \ - Xcode.tar.gz \ - Xcode21.tar.gz \ - XcodeUniversal.tar.gz \ - WhatsNew \ - docs.html \ - sdl.m4 \ - SDL.spec \ - autogen.sh \ - strip_fPIC.sh - -# M4 macro file for inclusion with autoconf -m4datadir = $(datadir)/aclocal -m4data_DATA = sdl.m4 - -# Rule to build tar-gzipped distribution package -$(PACKAGE)-$(VERSION).tar.gz: dist - -# Rule to build RPM distribution package -rpm: $(PACKAGE)-$(VERSION).tar.gz - rpm -ta $(PACKAGE)-$(VERSION).tar.gz - -# Rule to rebuild the export lists for BeOS, MacOS and Win32. -exports: - (cd src/main/beos/exports; $(MAKE)) - (cd src/main/macos/exports; $(MAKE)) - (cd src/main/macosx/exports; $(MAKE)) - (cd src/main/win32/exports; $(MAKE)) - -# Rule to build the Project Builder archive in MacOS X -PBProjects.tar.gz: - rm -f `find . -name .DS_Store` - if [ -d PBProjects ]; then \ - tar zcvf $@ PBProjects; \ - fi - -# Rule to install the libraries only - prevent rebuilding apps -install-lib: - cd src && $(MAKE) install-libLTLIBRARIES - -# Run ldconfig after installing the library: -install-hook: - -ldconfig - -# Grab the test programs for the distribution: -dist-hook: - if test -f test/Makefile; then (cd test; make distclean); fi - rm -rf $(srcdir)/test/autom4te* - cp -rp $(srcdir)/test $(distdir) - rm -rf `find $(distdir) -type d -name CVS -print` - -# Create a CVS snapshot that people can run update -d on -CVSROOT = :pserver:guest@libsdl.org:/home/sdlweb/libsdl.org/cvs -snapshot: - cvs -d $(CVSROOT) login - cvs -d $(CVSROOT) checkout SDL12 - (cd SDL12 && ./autogen.sh && rm -rf autom4te.cache) - mv SDL12 SDL-1.2 - tar zcvf $(HOME)/SDL-1.2.tar.gz SDL-1.2 - rm -rf SDL-1.2 -snapshot13: - cvs -d $(CVSROOT) login - cvs -d $(CVSROOT) checkout -r branch_1_3_x SDL12 - (cd SDL12 && ./autogen.sh && rm -rf autom4te.cache) - mv SDL12 SDL-1.3 - tar zcvf $(HOME)/SDL-1.3.tar.gz SDL-1.3 - rm -rf SDL-1.3 diff --git a/SDL.spec.in b/SDL.spec.in index 0e95ee6d9..d41693a1d 100644 --- a/SDL.spec.in +++ b/SDL.spec.in @@ -1,6 +1,6 @@ Summary: Simple DirectMedia Layer -Name: @PACKAGE@ -Version: @VERSION@ +Name: SDL +Version: @SDL_VERSION@ Release: 1 Source: http://www.libsdl.org/release/%{name}-%{version}.tar.gz URL: http://www.libsdl.org/ @@ -45,7 +45,12 @@ make %install rm -rf $RPM_BUILD_ROOT %ifos linux -make install prefix=$RPM_BUILD_ROOT/%{prefix} +make install prefix=$RPM_BUILD_ROOT/%{prefix} \ + bindir=$RPM_BUILD_ROOT/%{_bindir} \ + libdir=$RPM_BUILD_ROOT/%{_libdir} \ + includedir=$RPM_BUILD_ROOT/%{_includedir} \ + datadir=$RPM_BUILD_ROOT/%{_datadir} \ + mandir=$RPM_BUILD_ROOT/%{_mandir} ln -s libSDL-1.2.so.0 $RPM_BUILD_ROOT/%{prefix}/lib/libSDL-1.1.so.0 %else %makeinstall @@ -81,8 +86,8 @@ rm -rf $RPM_BUILD_ROOT %{_libdir}/lib*.%{__soext} %dir %{_includedir}/SDL %{_includedir}/SDL/*.h -%{_mandir}/man3/* %{_datadir}/aclocal/* +%{_mandir}/man3/* %changelog * Mon Jan 03 2004 Anders Bjorklund diff --git a/TODO b/TODO index 2690e357c..fc3a97857 100644 --- a/TODO +++ b/TODO @@ -1,4 +1,9 @@ +Update project files +Create general SDL_config.h +Create stubs for all the disabled subsystems +Test all the platforms and drivers + Wish list for the 1.3 development branch: * Use /etc/fb.modes, if available, like GGI does diff --git a/acinclude.m4 b/acinclude.m4 index afd60019e..ab1ba5a08 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -1,24 +1,3 @@ -# Local macros for the SDL configure.in script - -dnl Function to link an architecture specific file -dnl LINK_ARCH_SRC(source_dir, arch, source_file) -AC_DEFUN([COPY_ARCH_SRC], -[ - old="$srcdir/$1/$2/$3" - new="$1/$3" - if test ! -d $1; then - echo "Creating directory $1" - mkdir -p $1 - fi - echo "Copying $old -> $new" - cat >$new <<__EOF__ -/* WARNING: This file was automatically generated! - * Original: $old - */ -__EOF__ - cat >>$new <$old -]) - ############################################################################## dnl Configure Paths for Alsa dnl Some modifications by Richard Boulton @@ -1010,6 +989,12 @@ AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl lt_cv_sys_max_cmd_len=8192; ;; + beos*) + # On BeOS, this test takes a really really long time. + # So we just punt and use a minimum line length of 8192. + lt_cv_sys_max_cmd_len=8192; + ;; + amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. diff --git a/autogen.sh b/autogen.sh index c139a3b90..2f5a1f030 100755 --- a/autogen.sh +++ b/autogen.sh @@ -1,19 +1,11 @@ #!/bin/sh # -echo "Generating build information using aclocal, automake and autoconf" +echo "Generating build information using aclocal and autoconf" echo "This may take a while ..." -# Touch the timestamps on all the files since CVS messes them up -directory=`dirname $0` -touch $directory/configure.in -touch $directory/include/SDL_config.h.in - # Regenerate configuration files -aclocal || exit 1 -automake --foreign --include-deps --add-missing --copy || exit 1 -autoconf || exit 1 -(cd test; aclocal; automake --foreign --include-deps --add-missing --copy; autoconf) +(aclocal && autoconf) || exit $? +(cd test; aclocal; autoconf) # Run configure for this platform -#./configure $* echo "Now you are ready to run ./configure" diff --git a/config.guess b/build-scripts/config.guess similarity index 100% rename from config.guess rename to build-scripts/config.guess diff --git a/config.sub b/build-scripts/config.sub similarity index 100% rename from config.sub rename to build-scripts/config.sub diff --git a/build-scripts/install-sh b/build-scripts/install-sh new file mode 100755 index 000000000..1a8353401 --- /dev/null +++ b/build-scripts/install-sh @@ -0,0 +1,323 @@ +#!/bin/sh +# install - install a program, script, or datafile + +scriptversion=2005-02-02.21 + +# This originates from X11R5 (mit/util/scripts/install.sh), which was +# later released in X11R6 (xc/config/util/install.sh) with the +# following copyright and license. +# +# Copyright (C) 1994 X Consortium +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- +# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# +# Except as contained in this notice, the name of the X Consortium shall not +# be used in advertising or otherwise to promote the sale, use or other deal- +# ings in this Software without prior written authorization from the X Consor- +# tium. +# +# +# FSF changes to this file are in the public domain. +# +# Calling this script install-sh is preferred over install.sh, to prevent +# `make' implicit rules from creating a file called install from it +# when there is no Makefile. +# +# This script is compatible with the BSD install script, but was written +# from scratch. It can only install one file at a time, a restriction +# shared with many OS's install programs. + +# set DOITPROG to echo to test this script + +# Don't use :- since 4.3BSD and earlier shells don't like it. +doit="${DOITPROG-}" + +# put in absolute paths if you don't have them in your path; or use env. vars. + +mvprog="${MVPROG-mv}" +cpprog="${CPPROG-cp}" +chmodprog="${CHMODPROG-chmod}" +chownprog="${CHOWNPROG-chown}" +chgrpprog="${CHGRPPROG-chgrp}" +stripprog="${STRIPPROG-strip}" +rmprog="${RMPROG-rm}" +mkdirprog="${MKDIRPROG-mkdir}" + +chmodcmd="$chmodprog 0755" +chowncmd= +chgrpcmd= +stripcmd= +rmcmd="$rmprog -f" +mvcmd="$mvprog" +src= +dst= +dir_arg= +dstarg= +no_target_directory= + +usage="Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE + or: $0 [OPTION]... SRCFILES... DIRECTORY + or: $0 [OPTION]... -t DIRECTORY SRCFILES... + or: $0 [OPTION]... -d DIRECTORIES... + +In the 1st form, copy SRCFILE to DSTFILE. +In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. +In the 4th, create DIRECTORIES. + +Options: +-c (ignored) +-d create directories instead of installing files. +-g GROUP $chgrpprog installed files to GROUP. +-m MODE $chmodprog installed files to MODE. +-o USER $chownprog installed files to USER. +-s $stripprog installed files. +-t DIRECTORY install into DIRECTORY. +-T report an error if DSTFILE is a directory. +--help display this help and exit. +--version display version info and exit. + +Environment variables override the default commands: + CHGRPPROG CHMODPROG CHOWNPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG +" + +while test -n "$1"; do + case $1 in + -c) shift + continue;; + + -d) dir_arg=true + shift + continue;; + + -g) chgrpcmd="$chgrpprog $2" + shift + shift + continue;; + + --help) echo "$usage"; exit $?;; + + -m) chmodcmd="$chmodprog $2" + shift + shift + continue;; + + -o) chowncmd="$chownprog $2" + shift + shift + continue;; + + -s) stripcmd=$stripprog + shift + continue;; + + -t) dstarg=$2 + shift + shift + continue;; + + -T) no_target_directory=true + shift + continue;; + + --version) echo "$0 $scriptversion"; exit $?;; + + *) # When -d is used, all remaining arguments are directories to create. + # When -t is used, the destination is already specified. + test -n "$dir_arg$dstarg" && break + # Otherwise, the last argument is the destination. Remove it from $@. + for arg + do + if test -n "$dstarg"; then + # $@ is not empty: it contains at least $arg. + set fnord "$@" "$dstarg" + shift # fnord + fi + shift # arg + dstarg=$arg + done + break;; + esac +done + +if test -z "$1"; then + if test -z "$dir_arg"; then + echo "$0: no input file specified." >&2 + exit 1 + fi + # It's OK to call `install-sh -d' without argument. + # This can happen when creating conditional directories. + exit 0 +fi + +for src +do + # Protect names starting with `-'. + case $src in + -*) src=./$src ;; + esac + + if test -n "$dir_arg"; then + dst=$src + src= + + if test -d "$dst"; then + mkdircmd=: + chmodcmd= + else + mkdircmd=$mkdirprog + fi + else + # Waiting for this to be detected by the "$cpprog $src $dsttmp" command + # might cause directories to be created, which would be especially bad + # if $src (and thus $dsttmp) contains '*'. + if test ! -f "$src" && test ! -d "$src"; then + echo "$0: $src does not exist." >&2 + exit 1 + fi + + if test -z "$dstarg"; then + echo "$0: no destination specified." >&2 + exit 1 + fi + + dst=$dstarg + # Protect names starting with `-'. + case $dst in + -*) dst=./$dst ;; + esac + + # If destination is a directory, append the input filename; won't work + # if double slashes aren't ignored. + if test -d "$dst"; then + if test -n "$no_target_directory"; then + echo "$0: $dstarg: Is a directory" >&2 + exit 1 + fi + dst=$dst/`basename "$src"` + fi + fi + + # This sed command emulates the dirname command. + dstdir=`echo "$dst" | sed -e 's,/*$,,;s,[^/]*$,,;s,/*$,,;s,^$,.,'` + + # Make sure that the destination directory exists. + + # Skip lots of stat calls in the usual case. + if test ! -d "$dstdir"; then + defaultIFS=' + ' + IFS="${IFS-$defaultIFS}" + + oIFS=$IFS + # Some sh's can't handle IFS=/ for some reason. + IFS='%' + set x `echo "$dstdir" | sed -e 's@/@%@g' -e 's@^%@/@'` + shift + IFS=$oIFS + + pathcomp= + + while test $# -ne 0 ; do + pathcomp=$pathcomp$1 + shift + if test ! -d "$pathcomp"; then + $mkdirprog "$pathcomp" + # mkdir can fail with a `File exist' error in case several + # install-sh are creating the directory concurrently. This + # is OK. + test -d "$pathcomp" || exit + fi + pathcomp=$pathcomp/ + done + fi + + if test -n "$dir_arg"; then + $doit $mkdircmd "$dst" \ + && { test -z "$chowncmd" || $doit $chowncmd "$dst"; } \ + && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } \ + && { test -z "$stripcmd" || $doit $stripcmd "$dst"; } \ + && { test -z "$chmodcmd" || $doit $chmodcmd "$dst"; } + + else + dstfile=`basename "$dst"` + + # Make a couple of temp file names in the proper directory. + dsttmp=$dstdir/_inst.$$_ + rmtmp=$dstdir/_rm.$$_ + + # Trap to clean up those temp files at exit. + trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 + trap '(exit $?); exit' 1 2 13 15 + + # Copy the file name to the temp name. + $doit $cpprog "$src" "$dsttmp" && + + # and set any options; do chmod last to preserve setuid bits. + # + # If any of these fail, we abort the whole thing. If we want to + # ignore errors from any of these, just make sure not to ignore + # errors from the above "$doit $cpprog $src $dsttmp" command. + # + { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } \ + && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } \ + && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } \ + && { test -z "$chmodcmd" || $doit $chmodcmd "$dsttmp"; } && + + # Now rename the file to the real destination. + { $doit $mvcmd -f "$dsttmp" "$dstdir/$dstfile" 2>/dev/null \ + || { + # The rename failed, perhaps because mv can't rename something else + # to itself, or perhaps because mv is so ancient that it does not + # support -f. + + # Now remove or move aside any old file at destination location. + # We try this two ways since rm can't unlink itself on some + # systems and the destination file might be busy for other + # reasons. In this case, the final cleanup might fail but the new + # file should still install successfully. + { + if test -f "$dstdir/$dstfile"; then + $doit $rmcmd -f "$dstdir/$dstfile" 2>/dev/null \ + || $doit $mvcmd -f "$dstdir/$dstfile" "$rmtmp" 2>/dev/null \ + || { + echo "$0: cannot unlink or rename $dstdir/$dstfile" >&2 + (exit 1); exit 1 + } + else + : + fi + } && + + # Now rename the file to the real destination. + $doit $mvcmd "$dsttmp" "$dstdir/$dstfile" + } + } + fi || { (exit 1); exit 1; } +done + +# The final little trick to "correctly" pass the exit status to the exit trap. +{ + (exit 0); exit 0 +} + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-end: "$" +# End: diff --git a/ltmain.sh b/build-scripts/ltmain.sh similarity index 100% rename from ltmain.sh rename to build-scripts/ltmain.sh diff --git a/build-scripts/makedep.sh b/build-scripts/makedep.sh new file mode 100755 index 000000000..c8be8b147 --- /dev/null +++ b/build-scripts/makedep.sh @@ -0,0 +1,66 @@ +#!/bin/sh +# +# Generate dependencies from a list of source files + +# Check to make sure our environment variables are set +if test x"$INCLUDE" = x -o x"$SOURCES" = x -o x"$objects" = x -o x"$output" = x; then + echo "SOURCES, INCLUDE, objects, and output needs to be set" + exit 1 +fi +cache_prefix=".#$$" + +generate_var() +{ + echo $1 | sed -e 's|^.*/||' -e 's|\.|_|g' +} + +search_deps() +{ + base=`echo $1 | sed 's|/[^/]*$||'` + grep '#include "' <$1 | sed -e 's|.*"\([^"]*\)".*|\1|' | \ + while read file + do cache=${cache_prefix}_`generate_var $file` + if test -f $cache; then + # We already ahve this cached + cat $cache + continue; + fi + for path in $base `echo $INCLUDE | sed 's|-I||g'` + do dep="$path/$file" + if test -f "$dep"; then + echo " $dep \\" >$cache + echo " $dep \\" + generate_dep $dep + break + fi + done + done +} + +generate_dep() +{ + cat >>${output}.new <<__EOF__ +$1: \\ +`search_deps $1` + +__EOF__ +} + +:>${output}.new +for src in $SOURCES +do echo "Generating dependencies for $src" + generate_dep $src + ext=`echo $src | sed 's|.*\.\(.*\)|\1|'` + obj=`echo $src | sed "s|^.*/\([^ ]*\)\..*|$objects/\1.lo|g"` + echo "$obj: $src" >>${output}.new + case $ext in + asm) echo " \$(BUILDASM)" >>${output}.new;; + cc) echo " \$(BUILDCC)" >>${output}.new;; + c) echo " \$(BUILDC)" >>${output}.new;; + m) echo " \$(BUILDM)" >>${output}.new;; + *) echo "Unknown file extension: $ext";; + esac + echo "" >>${output}.new +done +rm -f ${cache_prefix}* +mv ${output}.new ${output} diff --git a/build-scripts/mkinstalldirs b/build-scripts/mkinstalldirs new file mode 100755 index 000000000..8ab885ec9 --- /dev/null +++ b/build-scripts/mkinstalldirs @@ -0,0 +1,99 @@ +#! /bin/sh +# mkinstalldirs --- make directory hierarchy +# Author: Noah Friedman +# Created: 1993-05-16 +# Public domain + +errstatus=0 +dirmode="" + +usage="\ +Usage: mkinstalldirs [-h] [--help] [-m mode] dir ..." + +# process command line arguments +while test $# -gt 0 ; do + case "${1}" in + -h | --help | --h* ) # -h for help + echo "${usage}" 1>&2; exit 0 ;; + -m ) # -m PERM arg + shift + test $# -eq 0 && { echo "${usage}" 1>&2; exit 1; } + dirmode="${1}" + shift ;; + -- ) shift; break ;; # stop option processing + -* ) echo "${usage}" 1>&2; exit 1 ;; # unknown option + * ) break ;; # first non-opt arg + esac +done + +for file +do + if test -d "$file"; then + shift + else + break + fi +done + +case $# in +0) exit 0 ;; +esac + +case $dirmode in +'') + if mkdir -p -- . 2>/dev/null; then + echo "mkdir -p -- $*" + exec mkdir -p -- "$@" + fi ;; +*) + if mkdir -m "$dirmode" -p -- . 2>/dev/null; then + echo "mkdir -m $dirmode -p -- $*" + exec mkdir -m "$dirmode" -p -- "$@" + fi ;; +esac + +for file +do + set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` + shift + + pathcomp= + for d + do + pathcomp="$pathcomp$d" + case "$pathcomp" in + -* ) pathcomp=./$pathcomp ;; + esac + + if test ! -d "$pathcomp"; then + echo "mkdir $pathcomp" + + mkdir "$pathcomp" || lasterr=$? + + if test ! -d "$pathcomp"; then + errstatus=$lasterr + else + if test ! -z "$dirmode"; then + echo "chmod $dirmode $pathcomp" + + lasterr="" + chmod "$dirmode" "$pathcomp" || lasterr=$? + + if test ! -z "$lasterr"; then + errstatus=$lasterr + fi + fi + fi + fi + + pathcomp="$pathcomp/" + done +done + +exit $errstatus + +# Local Variables: +# mode: shell-script +# sh-indentation: 3 +# End: +# mkinstalldirs ends here diff --git a/strip_fPIC.sh b/build-scripts/strip_fPIC.sh similarity index 100% rename from strip_fPIC.sh rename to build-scripts/strip_fPIC.sh diff --git a/configure.in b/configure.in index 6cf890f9b..afa0b5da7 100644 --- a/configure.in +++ b/configure.in @@ -40,6 +40,7 @@ AC_SUBST(LT_REVISION) AC_SUBST(LT_AGE) dnl Detect the canonical host and target build environment +AC_CONFIG_AUX_DIRS($srcdir/build-scripts) AC_CANONICAL_SYSTEM AC_C_BIGENDIAN if test x$ac_cv_c_bigendian = xyes; then @@ -48,101 +49,54 @@ else AC_DEFINE(SDL_BYTEORDER, 1234) fi -dnl Setup for automake -AM_INIT_AUTOMAKE(SDL, $SDL_VERSION) - -dnl Disable autoheader -AUTOHEADER=: - dnl Check for tools - +#AC_LIBTOOL_DLOPEN AC_LIBTOOL_WIN32_DLL -AM_PROG_LIBTOOL -AC_PROG_MAKE_SET +AC_PROG_LIBTOOL AC_PROG_CC AC_PROG_CXX AC_PROG_INSTALL -ASFLAGS="" -AC_SUBST(ASFLAGS) -CCAS="$CC" -AC_SUBST(CCAS) -CCASFLAGS="" -AC_SUBST(CCASFLAGS) -AM_CONDITIONAL([am__fastdepOBJC], false) - -dnl The alpha architecture needs special flags for binary portability -case "$target" in - alpha*-*-linux*) - if test x$ac_cv_prog_gcc = xyes; then - CFLAGS="$CFLAGS -mcpu=ev4 -Wa,-mall" - fi - ;; -esac - -dnl Add compiler-specific optimization flags - -dnl See if the user wants aggressive optimizations of the code -AC_ARG_ENABLE(debug, -[ --enable-debug Disable aggressive optimizations [default=yes]], - , enable_debug=yes) -if test x$enable_debug != xyes; then - if test x$ac_cv_prog_gcc = xyes; then - CFLAGS="$CFLAGS -fexpensive-optimizations" - # Ack! This breaks the MMX YV12 conversion on gcc 2.95.2 - # CFLAGS="$CFLAGS -fomit-frame-pointer" - fi - case "$target" in - i486-*-*) - if test x$ac_cv_prog_gcc = xyes; then - CFLAGS="$CFLAGS -march=i486" - fi - ;; - i?86-*-*) - if test x$ac_cv_prog_gcc = xyes; then - CFLAGS="$CFLAGS -march=pentium -mcpu=pentiumpro" - fi - ;; - *-*-osf*) - if test x$ac_cv_prog_gcc != xyes; then - CFLAGS="-g3 -fast -arch host" - fi - ;; - esac -fi - -dnl Add verbose warnings by default, and allow ANSI compliance checking -AC_ARG_ENABLE(strict-ansi, -[ --enable-strict-ansi Enable strict ANSI compliance build [default=no]], - , enable_strict_ansi=no) -if test x$ac_cv_prog_gcc = xyes; then - CFLAGS="$CFLAGS -Wall" - if test x$enable_strict_ansi = xyes; then - CFLAGS="$CFLAGS -ansi -pedantic -D_XOPEN_SOURCE" - fi -fi - -dnl See whether we are allowed to use the system C library -AC_ARG_ENABLE(libc, -[ --enable-libc Use the system C library [default=yes]], - , AC_DEFINE(HAVE_LIBC)) dnl Check for compiler characteristics AC_C_CONST AC_C_INLINE AC_C_VOLATILE -dnl Check for header files -AC_HEADER_STDC -AC_CHECK_HEADERS(sys/types.h stdio.h stdlib.h stddef.h stdarg.h malloc.h memory.h string.h strings.h inttypes.h stdint.h ctype.h signal.h) +dnl See whether we are allowed to use the system C library +AC_ARG_ENABLE(libc, +AC_HELP_STRING([--enable-libc], [Use the system C library [default=yes]]), + , enable_libc=yes) +if test x$enable_libc = xyes; then + AC_DEFINE(HAVE_LIBC) + + dnl Check for C library headers + AC_HEADER_STDC + AC_CHECK_HEADERS(sys/types.h stdio.h stdlib.h stddef.h stdarg.h malloc.h memory.h string.h strings.h inttypes.h stdint.h ctype.h math.h signal.h) + + dnl Check for typedefs, structures, etc. + AC_TYPE_SIZE_T + if test x$ac_cv_header_inttypes_h = xyes -o x$ac_cv_header_stdint_h = xyes; then + AC_CHECK_TYPE(int64_t) + if test x$ac_cv_type_int64_t = xyes; then + AC_DEFINE(SDL_HAS_64BIT_TYPE) + fi + have_inttypes=yes + fi -dnl Check for typedefs, structures, etc. -AC_TYPE_SIZE_T -if test x$ac_cv_header_inttypes_h = xyes -o x$ac_cv_header_stdint_h = xyes; then - AC_CHECK_TYPE(int64_t) - if test x$ac_cv_type_int64_t = xyes; then - AC_DEFINE(SDL_HAS_64BIT_TYPE) + dnl Checks for library functions. + AC_FUNC_ALLOCA + AC_FUNC_MEMCMP + if test x$ac_cv_func_memcmp_working = xyes; then + AC_DEFINE(HAVE_MEMCMP) fi -else + AC_FUNC_STRTOD + if test x$ac_cv_func_strtod = xyes; then + AC_DEFINE(HAVE_STRTOD) + fi + AC_CHECK_FUNCS(malloc calloc realloc free getenv putenv unsetenv qsort abs bcopy memset memcpy memmove strlen strcpy strncpy strcat strncat strdup _strrev _strupr _strlwr strchr strrchr strstr itoa _ltoa _uitoa _ultoa strtol _i64toa _ui64toa strtoll atoi atof strcmp strncmp stricmp strcasecmp sscanf snprintf vsnprint sigaction setjmp nanosleep) +fi + +if test x$have_inttypes != xyes; then AC_CHECK_SIZEOF(char, 1) AC_CHECK_SIZEOF(short, 2) AC_CHECK_SIZEOF(int, 4) @@ -181,21 +135,32 @@ else AC_DEFINE(SDL_HAS_64BIT_TYPE) fi fi - AC_CHECK_TYPE(uintptr_t, unsigned long) + AC_DEFINE(size_t, unsigned int) + AC_DEFINE(uintptr_t, unsigned long) fi -dnl Checks for library functions. -AC_FUNC_ALLOCA -AC_FUNC_MEMCMP -if test x$ac_cv_func_memcmp_working = xyes; then - AC_DEFINE(HAVE_MEMCMP) +# Set up the build preprocessor flags +INCLUDE="-I$srcdir/include" +if test x$srcdir != x.; then + INCLUDE="-Iinclude $INCLUDE" fi -AC_FUNC_STRTOD -if test x$ac_cv_func_strtod = xyes; then - AC_DEFINE(HAVE_STRTOD) -fi -AC_CHECK_FUNCS(malloc calloc realloc free getenv putenv unsetenv qsort abs bcopy memset memcpy memmove strlen strcpy strncpy strcat strncat strdup _strrev _strupr _strlwr strchr strrchr strstr itoa _ltoa _uitoa _ultoa strtol _i64toa _ui64toa strtoll atoi atof strcmp strncmp stricmp strcasecmp sscanf snprintf vsnprint) - +BUILD_CFLAGS='-D_GNU_SOURCE=1 $(INCLUDE)' + +# Standard C sources +SOURCES="$SOURCES $srcdir/src/*.c" +SOURCES="$SOURCES $srcdir/src/audio/*.c" +SOURCES="$SOURCES $srcdir/src/cdrom/*.c" +SOURCES="$SOURCES $srcdir/src/cpuinfo/*.c" +SOURCES="$SOURCES $srcdir/src/events/*.c" +SOURCES="$SOURCES $srcdir/src/file/*.c" +SOURCES="$SOURCES $srcdir/src/joystick/*.c" +SOURCES="$SOURCES $srcdir/src/stdlib/*.c" +SOURCES="$SOURCES $srcdir/src/thread/*.c" +SOURCES="$SOURCES $srcdir/src/timer/*.c" +SOURCES="$SOURCES $srcdir/src/video/*.c" + +# Set up the build libraries needed +BUILD_LIBS="" dnl Initialize the compiler and linker flags for SDL applications @@ -218,104 +183,82 @@ case "$target" in MATHLIB="-lm" ;; esac -SYSTEM_LIBS="$SYSTEM_LIBS $MATHLIB" +BUILD_LIBS="$BUILD_LIBS $MATHLIB" dnl Enable/disable various subsystems of the SDL library AC_ARG_ENABLE(audio, -[ --enable-audio Enable the audio subsystem [default=yes]], +AC_HELP_STRING([--enable-audio], [Enable the audio subsystem [default=yes]]), , enable_audio=yes) -if test x$enable_audio = xyes; then - SDL_EXTRADIRS="$SDL_EXTRADIRS audio" - SDL_EXTRALIBS="$SDL_EXTRALIBS audio/libaudio.la" -else - CFLAGS="$CFLAGS -DDISABLE_AUDIO" +if test x$enable_audio != xyes; then + AC_DEFINE(SDL_AUDIO_DISABLED) fi AC_ARG_ENABLE(video, -[ --enable-video Enable the video subsystem [default=yes]], +AC_HELP_STRING([--enable-video], [Enable the video subsystem [default=yes]]), , enable_video=yes) -if test x$enable_video = xyes; then - SDL_EXTRADIRS="$SDL_EXTRADIRS video" - SDL_EXTRALIBS="$SDL_EXTRALIBS video/libvideo.la" -else - CFLAGS="$CFLAGS -DDISABLE_VIDEO" +if test x$enable_video != xyes; then + AC_DEFINE(SDL_VIDEO_DISABLED) fi AC_ARG_ENABLE(events, -[ --enable-events Enable the events subsystem [default=yes]], +AC_HELP_STRING([--enable-events], [Enable the events subsystem [default=yes]]), , enable_events=yes) -if test x$enable_video = xyes -a x$enable_events = xyes; then - SDL_EXTRADIRS="$SDL_EXTRADIRS events" - SDL_EXTRALIBS="$SDL_EXTRALIBS events/libevents.la" -else - CFLAGS="$CFLAGS -DDISABLE_EVENTS" +if test x$enable_events != xyes; then + AC_DEFINE(SDL_EVENTS_DISABLED) fi AC_ARG_ENABLE(joystick, -[ --enable-joystick Enable the joystick subsystem [default=yes]], +AC_HELP_STRING([--enable-joystick], [Enable the joystick subsystem [default=yes]]), , enable_joystick=yes) -if test x$enable_joystick = xyes; then - SDL_EXTRADIRS="$SDL_EXTRADIRS joystick" - SDL_EXTRALIBS="$SDL_EXTRALIBS joystick/libjoystick.la" -else - CFLAGS="$CFLAGS -DDISABLE_JOYSTICK" +if test x$enable_joystick != xyes; then + AC_DEFINE(SDL_JOYSTICK_DISABLED) fi AC_ARG_ENABLE(cdrom, -[ --enable-cdrom Enable the cdrom subsystem [default=yes]], +AC_HELP_STRING([--enable-cdrom], [Enable the cdrom subsystem [default=yes]]), , enable_cdrom=yes) -if test x$enable_cdrom = xyes; then - SDL_EXTRADIRS="$SDL_EXTRADIRS cdrom" - SDL_EXTRALIBS="$SDL_EXTRALIBS cdrom/libcdrom.la" -else - CFLAGS="$CFLAGS -DDISABLE_CDROM" +if test x$enable_cdrom != xyes; then + AC_DEFINE(SDL_CDROM_DISABLED) fi AC_ARG_ENABLE(threads, -[ --enable-threads Enable the threading subsystem [default=yes]], +AC_HELP_STRING([--enable-threads], [Enable the threading subsystem [default=yes]]), , enable_threads=yes) -SDL_EXTRADIRS="$SDL_EXTRADIRS thread" -SDL_EXTRALIBS="$SDL_EXTRALIBS thread/libthread.la" if test x$enable_threads != xyes; then - CFLAGS="$CFLAGS -DDISABLE_THREADS" - COPY_ARCH_SRC(src/thread, generic, SDL_systhread.c) - COPY_ARCH_SRC(src/thread, generic, SDL_systhread_c.h) - COPY_ARCH_SRC(src/thread, generic, SDL_sysmutex.c) - COPY_ARCH_SRC(src/thread, generic, SDL_sysmutex_c.h) - COPY_ARCH_SRC(src/thread, generic, SDL_syssem.c) - COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h) - COPY_ARCH_SRC(src/thread, generic, SDL_syscond.c) - COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h) + AC_DEFINE(SDL_THREADS_DISABLED) fi AC_ARG_ENABLE(timers, -[ --enable-timers Enable the timer subsystem [default=yes]], +AC_HELP_STRING([--enable-timers], [Enable the timer subsystem [default=yes]]), , enable_timers=yes) -if test x$enable_timers = xyes; then - SDL_EXTRADIRS="$SDL_EXTRADIRS timer" - SDL_EXTRALIBS="$SDL_EXTRALIBS timer/libtimer.la" -else - CFLAGS="$CFLAGS -DDISABLE_TIMERS" +if test x$enable_timers != xyes; then + AC_DEFINE(SDL_TIMERS_DISABLED) fi AC_ARG_ENABLE(file, -[ --enable-file Enable the file subsystem [default=yes]], +AC_HELP_STRING([--enable-file], [Enable the file subsystem [default=yes]]), , enable_file=yes) -if test x$enable_file = xyes; then - SDL_EXTRADIRS="$SDL_EXTRADIRS file" - SDL_EXTRALIBS="$SDL_EXTRALIBS file/libfile.la" -else - CFLAGS="$CFLAGS -DDISABLE_FILE" +if test x$enable_file != xyes; then + AC_DEFINE(SDL_FILE_DISABLED) +fi +AC_ARG_ENABLE(loadso, +AC_HELP_STRING([--enable-loadso], [Enable the shared object loading subsystem [default=yes]]), + , enable_loadso=yes) +if test x$enable_loadso != xyes; then + AC_DEFINE(SDL_LOADSO_DISABLED) fi AC_ARG_ENABLE(cpuinfo, -[ --enable-cpuinfo Enable the cpuinfo subsystem [default=yes]], +AC_HELP_STRING([--enable-cpuinfo], [Enable the cpuinfo subsystem [default=yes]]), , enable_cpuinfo=yes) -if test x$enable_cpuinfo = xyes; then - SDL_EXTRADIRS="$SDL_EXTRADIRS cpuinfo" - SDL_EXTRALIBS="$SDL_EXTRALIBS cpuinfo/libcpuinfo.la" -else - CFLAGS="$CFLAGS -DDISABLE_CPUINFO" +if test x$enable_cpuinfo != xyes; then + AC_DEFINE(SDL_CPUINFO_DISABLED) +fi +AC_ARG_ENABLE(assembly-blit, +AC_HELP_STRING([--enable-asm-blit], [Enable assembly blitters [default=yes]]), + , enable_asm_blit=yes) +if test x$enable_asm_blit = xyes; then + AC_DEFINE(SDL_ASSEMBLY_BLITTERS) fi dnl See if the OSS audio interface is supported CheckOSS() { AC_ARG_ENABLE(oss, -[ --enable-oss support the OSS audio API [default=yes]], +AC_HELP_STRING([--enable-oss], [support the OSS audio API [default=yes]]), , enable_oss=yes) if test x$enable_audio = xyes -a x$enable_oss = xyes; then AC_MSG_CHECKING(for OSS audio support) @@ -336,16 +279,21 @@ CheckOSS() int arg = SNDCTL_DSP_SETFRAGMENT; ],[ have_oss=yes - CFLAGS="$CFLAGS -DOSS_USE_SOUNDCARD_H" + AC_DEFINE(SDL_AUDIO_DRIVER_OSS_SOUNDCARD_H) ]) fi AC_MSG_RESULT($have_oss) if test x$have_oss = xyes; then - CFLAGS="$CFLAGS -DOSS_SUPPORT" - AUDIO_SUBDIRS="$AUDIO_SUBDIRS dsp" - AUDIO_DRIVERS="$AUDIO_DRIVERS dsp/libaudio_dsp.la" - AUDIO_SUBDIRS="$AUDIO_SUBDIRS dma" - AUDIO_DRIVERS="$AUDIO_DRIVERS dma/libaudio_dma.la" + AC_DEFINE(SDL_AUDIO_DRIVER_OSS) + SOURCES="$SOURCES $srcdir/src/audio/dsp/*.c" + SOURCES="$SOURCES $srcdir/src/audio/dma/*.c" + have_audio=yes + + # OpenBSD needs linking with ossaudio emulation library + case "$target" in + *-*-openbsd*) + BUILD_LIBS="$BUILD_LIBS -lossaudio";; + esac fi fi } @@ -354,7 +302,7 @@ dnl See if the ALSA audio interface is supported CheckALSA() { AC_ARG_ENABLE(alsa, -[ --enable-alsa support the ALSA audio API [default=yes]], +AC_HELP_STRING([--enable-alsa], [support the ALSA audio API [default=yes]]), , enable_alsa=yes) if test x$enable_audio = xyes -a x$enable_alsa = xyes; then AM_PATH_ALSA(0.9.0, have_alsa=yes, have_alsa=no) @@ -364,6 +312,39 @@ CheckALSA() LIBS="$alsa_save_LIBS" if test x$have_alsa = xyes; then AC_ARG_ENABLE(alsa-shared, +AC_HELP_STRING([--enable-alsa-shared], [dynamically load ALSA audio support [default=yes]]), + , enable_alsa_shared=yes) + if test "x`echo $ALSA_LIBS | grep -- -L`" = "x"; then + if test "x`ls /lib/libasound.so.* 2> /dev/null`" != "x"; then + ALSA_LIBS="-L/lib $ALSA_LIBS" + elif test "x`ls /usr/lib/libasound.so.* 2> /dev/null`" != "x"; then + ALSA_LIBS="-L/usr/lib $ALSA_LIBS" + elif test "x`ls /usr/local/lib/libasound.so.* 2> /dev/null`" != "x"; then + ALSA_LIBS="-L/usr/local/lib $ALSA_LIBS" + fi + fi + alsa_lib_spec=`echo $ALSA_LIBS | sed 's/.*-L\([[^ ]]*\).*/\1\/libasound.so.*/'` + alsa_lib=`ls $alsa_lib_spec | sed 's/.*\/\(.*\)/\1/; q'` + echo "-- $alsa_lib_spec -> $alsa_lib" + + AC_DEFINE(SDL_AUDIO_DRIVER_ALSA) + SOURCES="$SOURCES $srcdir/src/audio/alsa/*.c" + BUILD_CFLAGS="$BUILD_CFLAGS $ALSA_CFLAGS" + if test x$have_loadso != xyes && \ + test x$enable_alsa_shared = xyes; then + AC_MSG_ERROR([You must have SDL_LoadObject() support]) + fi + if test x$have_loadso = xyes && \ + test x$enable_alsa_shared = xyes && test x$alsa_lib != x; then + AC_DEFINE_UNQUOTED(SDL_AUDIO_DRIVER_ALSA_DYNAMIC, "$alsa_lib") + else + BUILD_LIBS="$BUILD_LIBS $ALSA_LIBS" + fi + have_audio=yes + fi + fi + if test x$have_alsa = xyes; then + AC_ARG_ENABLE(alsa-shared, [ --enable-alsa-shared dynamically load ALSA audio support [default=yes]], , enable_alsa_shared=yes) if test "x`echo $ALSA_LIBS | grep -- -L`" = "x"; then @@ -397,10 +378,8 @@ CheckALSA() CFLAGS="$CFLAGS -DALSA_SUPPORT $ALSA_CFLAGS" SYSTEM_LIBS="$SYSTEM_LIBS $ALSA_LIBS" fi - AUDIO_SUBDIRS="$AUDIO_SUBDIRS alsa" - AUDIO_DRIVERS="$AUDIO_DRIVERS alsa/libaudio_alsa.la" + SDL_SRCS="$SDL_SRCS `(cd $srcdir && ls audio/alsa/*.c)`" fi - fi } dnl Check whether we want to use IRIX 6.5+ native audio or not @@ -419,10 +398,10 @@ CheckDMEDIA() AC_MSG_RESULT($have_dmedia) # Set up files for the audio library if test x$have_dmedia = xyes; then - CFLAGS="$CFLAGS -DDMEDIA_SUPPORT" - AUDIO_SUBDIRS="$AUDIO_SUBDIRS dmedia" - AUDIO_DRIVERS="$AUDIO_DRIVERS dmedia/libaudio_dmedia.la" - SYSTEM_LIBS="$SYSTEM_LIBS -laudio" + AC_DEFINE(SDL_AUDIO_DRIVER_DMEDIA) + SOURCES="$SOURCES $srcdir/src/audio/dmedia/*.c" + BUILD_LIBS="$BUILD_LIBS -laudio" + have_audio=yes fi fi } @@ -431,13 +410,13 @@ dnl Find the ESD includes and libraries CheckESD() { AC_ARG_ENABLE(esd, -[ --enable-esd support the Enlightened Sound Daemon [default=yes]], +AC_HELP_STRING([--enable-esd], [support the Enlightened Sound Daemon [default=yes]]), , enable_esd=yes) if test x$enable_audio = xyes -a x$enable_esd = xyes; then AM_PATH_ESD(0.2.8, have_esd=yes, have_esd=no) if test x$have_esd = xyes; then AC_ARG_ENABLE(esd-shared, -[ --enable-esd-shared dynamically load ESD audio support [default=yes]], +AC_HELP_STRING([--enable-esd-shared], [dynamically load ESD audio support [default=yes]]), , enable_esd_shared=yes) esd_lib_spec=`echo $ESD_LIBS | sed 's/.*-L\([[^ ]]*\).*/\1\/libesd.so.*/'` esd_lib=`ls $esd_lib_spec | sed 's/.*\/\(.*\)/\1/; q'` @@ -448,14 +427,13 @@ CheckESD() fi if test x$have_loadso = xyes && \ test x$enable_esd_shared = xyes && test x$esd_lib != x; then - CFLAGS="$CFLAGS -DESD_SUPPORT -DESD_DYNAMIC=\$(esd_lib) $ESD_CFLAGS" - AC_SUBST(esd_lib) - else - CFLAGS="$CFLAGS -DESD_SUPPORT $ESD_CFLAGS" - SYSTEM_LIBS="$SYSTEM_LIBS $ESD_LIBS" + AC_DEFINE_UNQUOTED(SDL_AUDIO_DRIVER_ESD_DYNAMIC, "$esd_lib") fi - AUDIO_SUBDIRS="$AUDIO_SUBDIRS esd" - AUDIO_DRIVERS="$AUDIO_DRIVERS esd/libaudio_esd.la" + AC_DEFINE(SDL_AUDIO_DRIVER_ESD) + SOURCES="$SOURCES $srcdir/src/audio/esd/*.c" + BUILD_CFLAGS="$BUILD_CFLAGS $ESD_CFLAGS" + BUILD_LIBS="$BUILD_LIBS $ESD_LIBS" + have_audio=yes fi fi } @@ -463,20 +441,20 @@ CheckESD() CheckARTSC() { AC_ARG_ENABLE(arts, -[ --enable-arts support the Analog Real Time Synthesizer [default=yes]], +AC_HELP_STRING([--enable-arts], [support the Analog Real Time Synthesizer [default=yes]]), , enable_arts=yes) if test x$enable_audio = xyes -a x$enable_arts = xyes; then - AC_PATH_PROG(ARTSCCONFIG, artsc-config) - if test x$ARTSCCONFIG = x -o x$ARTSCCONFIG = x'"$ARTSCCONFIG"'; then + AC_PATH_PROG(ARTSCONFIG, artsc-config) + if test x$ARTSCONFIG = x -o x$ARTSCONFIG = x'"$ARTSCONFIG"'; then : # arts isn't installed else - ARTSC_CFLAGS=`$ARTSCCONFIG --cflags` - ARTSC_LIBS=`$ARTSCCONFIG --libs` - ARTSC_PREFIX=`$ARTSCCONFIG --arts-prefix` + ARTS_CFLAGS=`$ARTSCONFIG --cflags` + ARTS_LIBS=`$ARTSCONFIG --libs` + ARTS_PREFIX=`$ARTSCONFIG --arts-prefix` AC_MSG_CHECKING(for aRts development environment) audio_arts=no save_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS $ARTSC_CFLAGS" + CFLAGS="$CFLAGS $ARTS_CFLAGS" AC_TRY_COMPILE([ #include ],[ @@ -488,9 +466,9 @@ CheckARTSC() AC_MSG_RESULT($audio_arts) if test x$audio_arts = xyes; then AC_ARG_ENABLE(arts-shared, -[ --enable-arts-shared dynamically load aRts audio support [default=yes]], +AC_HELP_STRING([--enable-arts-shared], [dynamically load aRts audio support [default=yes]]), , enable_arts_shared=yes) - arts_lib_spec="$ARTSC_PREFIX/lib/libartsc.so.*" + arts_lib_spec="$ARTS_PREFIX/lib/libartsc.so.*" arts_lib=`ls $arts_lib_spec | sed 's/.*\/\(.*\)/\1/; q'` echo "-- $arts_lib_spec -> $arts_lib" if test x$have_loadso != xyes && \ @@ -499,14 +477,13 @@ CheckARTSC() fi if test x$have_loadso = xyes && \ test x$enable_arts_shared = xyes && test x$arts_lib != x; then - CFLAGS="$CFLAGS -DARTSC_SUPPORT -DARTSC_DYNAMIC=\$(arts_lib) $ARTSC_CFLAGS" - AC_SUBST(arts_lib) - else - CFLAGS="$CFLAGS -DARTSC_SUPPORT $ARTSC_CFLAGS" - SYSTEM_LIBS="$SYSTEM_LIBS $ARTSC_LIBS" + AC_DEFINE_UNQUOTED(SDL_AUDIO_DRIVER_ARTS_DYNAMIC, "$arts_lib") fi - AUDIO_SUBDIRS="$AUDIO_SUBDIRS arts" - AUDIO_DRIVERS="$AUDIO_DRIVERS arts/libaudio_arts.la" + AC_DEFINE(SDL_AUDIO_DRIVER_ARTS) + SOURCES="$SOURCES $srcdir/src/audio/arts/*.c" + BUILD_CFLAGS="$BUILD_CFLAGS $ARTS_CFLAGS" + BUILD_LIBS="$BUILD_LIBS $ARTS_LIBS" + have_audio=yes fi fi fi @@ -516,29 +493,31 @@ dnl See if the NAS audio interface is supported CheckNAS() { AC_ARG_ENABLE(nas, -[ --enable-nas support the NAS audio API [default=yes]], +AC_HELP_STRING([--enable-nas], [support the NAS audio API [default=yes]]), , enable_nas=yes) if test x$enable_audio = xyes -a x$enable_nas = xyes; then AC_MSG_CHECKING(for NAS audio support) have_nas=no if test -r /usr/X11R6/include/audio/audiolib.h; then have_nas=yes - CFLAGS="$CFLAGS -DNAS_SUPPORT -I/usr/X11R6/include/" - SYSTEM_LIBS="$SYSTEM_LIBS -laudio -lXt" - AUDIO_SUBDIRS="$AUDIO_SUBDIRS nas" - AUDIO_DRIVERS="$AUDIO_DRIVERS nas/libaudio_nas.la" + NAS_CFLAGS="-I/usr/X11R6/include/" + NAS_LIBS="-laudio -lXt" dnl On IRIX, the NAS includes are in a different directory, dnl and libnas must be explicitly linked in elif test -r /usr/freeware/include/nas/audiolib.h; then have_nas=yes - CFLAGS="$CFLAGS -DNAS_SUPPORT" - SYSTEM_LIBS="$SYSTEM_LIBS -lnas -lXt" - AUDIO_SUBDIRS="$AUDIO_SUBDIRS nas" - AUDIO_DRIVERS="$AUDIO_DRIVERS nas/libaudio_nas.la" + NAS_LIBS="-lnas -lXt" fi AC_MSG_RESULT($have_nas) + if test x$have_nas = xyes; then + AC_DEFINE(SDL_AUDIO_DRIVER_NAS) + SOURCES="$SOURCES $srcdir/src/audio/nas/*.c" + BUILD_CFLAGS="$BUILD_CFLAGS $NAS_CFLAGS" + BUILD_LIBS="$BUILD_LIBS $NAS_LIBS" + have_audio=yes + fi fi } @@ -546,12 +525,11 @@ dnl rcg07142001 See if the user wants the disk writer audio driver... CheckDiskAudio() { AC_ARG_ENABLE(diskaudio, -[ --enable-diskaudio support the disk writer audio driver [default=yes]], +AC_HELP_STRING([--enable-diskaudio], [support the disk writer audio driver [default=yes]]), , enable_diskaudio=yes) if test x$enable_audio = xyes -a x$enable_diskaudio = xyes; then - CFLAGS="$CFLAGS -DDISKAUD_SUPPORT" - AUDIO_SUBDIRS="$AUDIO_SUBDIRS disk" - AUDIO_DRIVERS="$AUDIO_DRIVERS disk/libaudio_disk.la" + AC_DEFINE(SDL_AUDIO_DRIVER_DISK) + SOURCES="$SOURCES $srcdir/src/audio/disk/*.c" fi } @@ -559,22 +537,22 @@ dnl Set up the Atari Audio driver CheckAtariAudio() { AC_ARG_ENABLE(mintaudio, -[ --enable-mintaudio support Atari audio driver [default=yes]], +AC_HELP_STRING([--enable-mintaudio], [support Atari audio driver [default=yes]]), , enable_mintaudio=yes) if test x$enable_audio = xyes -a x$enable_mintaudio = xyes; then mintaudio=no AC_CHECK_HEADER(mint/falcon.h, have_mint_falcon_hdr=yes) if test x$have_mint_falcon_hdr = xyes; then mintaudio=yes - CFLAGS="$CFLAGS -DMINTAUDIO_SUPPORT" - AUDIO_SUBDIRS="$AUDIO_SUBDIRS mint" - AUDIO_DRIVERS="$AUDIO_DRIVERS mint/libaudio_mintaudio.la" + AC_DEFINE(SDL_AUDIO_DRIVER_MINT) + SOURCES="$SOURCES $srcdir/src/audio/ming/*.c" + have_audio=yes fi fi } dnl See if we can use x86 assembly blitters -# NASM is available from: http://nasm.octium.net/ +# NASM is available from: http://nasm.sourceforge.net CheckNASM() { dnl Make sure we are running on an x86 platform @@ -588,14 +566,13 @@ CheckNASM() esac dnl Check for NASM (for assembly blit routines) AC_ARG_ENABLE(nasm, -[ --enable-nasm use nasm assembly blitters on x86 [default=yes]], +AC_HELP_STRING([--enable-nasm], [use nasm assembly blitters on x86 [default=yes]]), , enable_nasm=yes) - if test x$enable_video = xyes -a x$enable_nasm = xyes; then + if test x$enable_video = xyes -a x$enable_asm_blit = xyes -a x$enable_nasm = xyes; then AC_PATH_PROG(NASM, nasm) - if test x$NASM = x -o x$NASM = x'"$NASM"'; then - : # nasm isn't installed - else - CFLAGS="$CFLAGS -DUSE_ASMBLIT -I$srcdir/hermes" + if test x$NASM != x -a x$NASM != x'"$NASM"'; then + AC_DEFINE(SDL_HERMES_BLITTERS) + SOURCES="$SOURCES $srcdir/src/hermes/*.asm" case $ARCH in win32) NASMFLAGS="-f win32" @@ -607,19 +584,94 @@ CheckNASM() NASMFLAGS="-f elf" ;; esac + AC_SUBST(NASM) AC_SUBST(NASMFLAGS) - CFLAGS="$CFLAGS -I\$(top_srcdir)/src/hermes" - SDL_EXTRADIRS="$SDL_EXTRADIRS hermes" - SDL_EXTRALIBS="$SDL_EXTRALIBS hermes/libhermes.la" - use_nasm=yes - + case "$target" in # this line is needed for QNX, because it's not defined the __ELF__ - *-*-qnx*) CFLAGS="$CFLAGS -D__ELF__" - ;; - + *-*-qnx*) + BUILD_CFLAGS="$BUILD_CFLAGS -D__ELF__";; + *-*-solaris*) + BUILD_CFLAGS="$BUILD_CFLAGS -D__ELF__";; esac + fi + fi +} + +dnl Check for altivec instruction support using gas syntax +CheckAltivec() +{ + AC_ARG_ENABLE(altivec, +AC_HELP_STRING([--enable-altivec], [use altivec assembly blitters on PPC [default=yes]]), + , enable_altivec=yes) + if test x$enable_video = xyes -a x$enable_asm_blit = xyes -a x$enable_altivec = xyes; then + have_altivec_h_hdr=no + AC_CHECK_HEADER(altivec.h, have_altivec_h_hdr=yes) + + save_CFLAGS="$CFLAGS" + have_gcc_altivec=no + AC_MSG_CHECKING(for Altivec with GCC -maltivec option) + altivec_CFLAGS="-maltivec" + CFLAGS="$save_CFLAGS $altivec_CFLAGS" + + if test x$have_altivec_h_hdr = xyes; then + AC_TRY_COMPILE([ + #include + vector unsigned int vzero() { + return vec_splat_u32(0); + } + ],[ + ],[ + have_gcc_altivec=yes + ]) + AC_MSG_RESULT($have_gcc_altivec) + else + AC_TRY_COMPILE([ + vector unsigned int vzero() { + return vec_splat_u32(0); + } + ],[ + ],[ + have_gcc_altivec=yes + ]) + AC_MSG_RESULT($have_gcc_altivec) + fi + + if test x$have_gcc_altivec = xno; then + AC_MSG_CHECKING(for Altivec with GCC -faltivec option) + altivec_CFLAGS="-faltivec" + CFLAGS="$save_CFLAGS $altivec_CFLAGS" + if test x$have_altivec_h_hdr = xyes; then + AC_TRY_COMPILE([ + #include + vector unsigned int vzero() { + return vec_splat_u32(0); + } + ],[ + ],[ + have_gcc_altivec=yes + ]) + AC_MSG_RESULT($have_gcc_altivec) + else + AC_TRY_COMPILE([ + vector unsigned int vzero() { + return vec_splat_u32(0); + } + ],[ + ],[ + have_gcc_altivec=yes + ]) + AC_MSG_RESULT($have_gcc_altivec) + fi + fi + CFLAGS="$save_CFLAGS" + if test x$have_gcc_altivec = xyes; then + AC_DEFINE(SDL_ALTIVEC_BLITTERS) + if test x$have_altivec_h_hdr = xyes; then + AC_DEFINE(HAVE_ALTIVEC_H) + fi + BUILD_CFLAGS="$BUILD_CFLAGS $altivec_CFLAGS" fi fi } @@ -628,49 +680,49 @@ dnl Do the iPod thing CheckIPod() { AC_ARG_ENABLE(ipod, -[ --enable-ipod configure SDL to work with iPodLinux [default=yes on arm-elf]], - , enable_ipod=yes) +AC_HELP_STRING([--enable-ipod], [configure SDL to work with iPodLinux [default=yes on arm-elf]]), + , enable_ipod=yes) if test x$enable_ipod = xyes; then - CFLAGS="$CFLAGS -DENABLE_IPOD -DIPOD" - VIDEO_SUBDIRS="$VIDEO_SUBDIRS ipod" - VIDEO_DRIVERS="$VIDEO_DRIVERS ipod/libvideo_ipod.la" + BUILD_CFLAGS="$BUILD_CFLAGS -DIPOD" + AC_DEFINE(SDL_VIDEO_DRIVER_IPOD) + SOURCES="$SOURCES $srcdir/src/video/ipod/*.c" fi -} +} dnl Find the nanox include and library directories CheckNANOX() { AC_ARG_ENABLE(video-nanox, - [ --enable-video-nanox use nanox video driver [default=no]], + AC_HELP_STRING([--enable-video-nanox], [use nanox video driver [default=no]]), , enable_video_nanox=no) - AC_ARG_ENABLE(nanox-debug, - [ --enable-nanox-debug print debug messages [default=no]], - , enable_nanox_debug=no) - AC_ARG_ENABLE(nanox-share-memory, - [ --enable-nanox-share-memory use share memory [default=no]], - , enable_nanox_share_memory=no) - AC_ARG_ENABLE(nanox_direct_fb, - [ --enable-nanox-direct-fb use direct framebuffer access [default=no]], - , enable_nanox_direct_fb=no) if test x$enable_video = xyes -a x$enable_video_nanox = xyes; then + AC_ARG_ENABLE(nanox-debug, + AC_HELP_STRING([--enable-nanox-debug], [print debug messages [default=no]]), + , enable_nanox_debug=no) if test x$enable_nanox_debug = xyes; then - CFLAGS="$CFLAGS -DENABLE_NANOX_DEBUG" + BUILD_CFLAGS="$BUILD_CFLAGS -DENABLE_NANOX_DEBUG" fi + AC_ARG_ENABLE(nanox-share-memory, + AC_HELP_STRING([--enable-nanox-share-memory], [use share memory [default=no]]), + , enable_nanox_share_memory=no) if test x$enable_nanox_share_memory = xyes; then - CFLAGS="$CFLAGS -DNANOX_SHARE_MEMORY" + BUILD_CFLAGS="$BUILD_CFLAGS -DNANOX_SHARE_MEMORY" fi + AC_ARG_ENABLE(nanox_direct_fb, + AC_HELP_STRING([--enable-nanox-direct-fb], [use direct framebuffer access [default=no]]), + , enable_nanox_direct_fb=no) if test x$enable_nanox_direct_fb = xyes; then - CFLAGS="$CFLAGS -DENABLE_NANOX_DIRECT_FB" + BUILD_CFLAGS="$BUILD_CFLAGS -DENABLE_NANOX_DIRECT_FB" fi - CFLAGS="$CFLAGS $X_CFLAGS -DENABLE_NANOX" - SYSTEM_LIBS="$SYSTEM_LIBS -lnano-X" - VIDEO_SUBDIRS="$VIDEO_SUBDIRS nanox" - VIDEO_DRIVERS="$VIDEO_DRIVERS nanox/libvideo_nanox.la" + AC_DEFINE(SDL_VIDEO_DRIVER_NANOX) + SOURCES="$SOURCES $srcdir/src/video/nanox/*.c" + BUILD_LIBS="$BUILD_LIBS -lnano-X" + have_video=yes fi } @@ -678,17 +730,16 @@ dnl Find the X11 include and library directories CheckX11() { AC_ARG_ENABLE(video-x11, -[ --enable-video-x11 use X11 video driver [default=yes]], +AC_HELP_STRING([--enable-video-x11], [use X11 video driver [default=yes]]), , enable_video_x11=yes) if test x$enable_video = xyes -a x$enable_video_x11 = xyes; then AC_PATH_X AC_PATH_XTRA if test x$have_x = xyes; then AC_ARG_ENABLE(x11-shared, -[ --enable-x11-shared dynamically load X11 support [default=yes]], +AC_HELP_STRING([--enable-x11-shared], [dynamically load X11 support [default=yes]]), , enable_x11_shared=yes) - dnl !!! FIXME: if a platform needs more than this, fill it in! case "$target" in *-*-darwin* ) x11_lib='/usr/X11R6/lib/libX11.6.dylib' @@ -704,6 +755,10 @@ CheckX11() ;; esac + X_CFLAGS="$X_CFLAGS -DXTHREADS" + if test x$ac_cv_func_shmat != xyes; then + X_CFLAGS="$X_CFLAGS -DNO_SHARED_MEMORY" + fi if test x$have_loadso != xyes && \ test x$enable_x11_shared = xyes; then AC_MSG_ERROR([You must have SDL_LoadObject() support]) @@ -711,85 +766,77 @@ CheckX11() if test x$have_loadso = xyes && \ test x$enable_x11_shared = xyes && test x$x11_lib != x && test x$x11ext_lib != x; then - CFLAGS="$CFLAGS $X_CFLAGS -DENABLE_X11 -DXTHREADS -DX11_DYNAMIC=\$(x11_lib) -DX11EXT_DYNAMIC=\$(x11ext_lib) -I$srcdir/include -I$srcdir/src/video" - SYSTEM_LIBS="$SYSTEM_LIBS $X_LIBS" echo "-- dynamic libX11 -> $x11_lib" echo "-- dynamic libX11ext -> $x11ext_lib" - AC_SUBST(x11_lib) - AC_SUBST(x11ext_lib) + AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_X11_DYNAMIC, "$x11_lib") + AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_X11_DYNAMIC_XEXT, "$x11ext_lib") else - CFLAGS="$CFLAGS $X_CFLAGS -DENABLE_X11 -DXTHREADS -I$srcdir/include -I$srcdir/src/video" - SYSTEM_LIBS="$SYSTEM_LIBS $X_LIBS -lX11 -lXext" + X_LIBS="$X_LIBS -lX11 -lXext" fi - if test x$ac_cv_func_shmat != xyes; then - CFLAGS="$CFLAGS -DNO_SHARED_MEMORY" - fi - VIDEO_SUBDIRS="$VIDEO_SUBDIRS x11" - VIDEO_DRIVERS="$VIDEO_DRIVERS x11/libvideo_x11.la" + AC_DEFINE(SDL_VIDEO_DRIVER_X11) + SOURCES="$SOURCES $srcdir/src/video/x11/*.c" + BUILD_CFLAGS="$BUILD_CFLAGS $X_CFLAGS" + BUILD_LIBS="$BUILD_LIBS $X_LIBS" + have_video=yes AC_ARG_ENABLE(dga, -[ --enable-dga allow use of X11 DGA code [default=yes]], +AC_HELP_STRING([--enable-dga], [allow use of X11 DGA code [default=yes]]), , enable_dga=yes) if test x$enable_dga = xyes; then - VIDEO_SUBDIRS="$VIDEO_SUBDIRS Xext/Xxf86dga" - VIDEO_DRIVERS="$VIDEO_DRIVERS Xext/Xxf86dga/libXext_Xxf86dga.la" + SOURCES="$SOURCES $srcdir/src/video/Xext/Xxf86dga/*.c" fi AC_ARG_ENABLE(video-dga, -[ --enable-video-dga use DGA 2.0 video driver [default=yes]], +AC_HELP_STRING([--enable-video-dga], [use DGA 2.0 video driver [default=yes]]), , enable_video_dga=yes) if test x$enable_dga = xyes -a x$enable_video_dga = xyes; then - CFLAGS="$CFLAGS -DENABLE_DGA" - VIDEO_SUBDIRS="$VIDEO_SUBDIRS dga" - VIDEO_DRIVERS="$VIDEO_DRIVERS dga/libvideo_dga.la" + AC_DEFINE(SDL_VIDEO_DRIVER_DGA) + SOURCES="$SOURCES $srcdir/src/video/dga/*.c" fi AC_ARG_ENABLE(video-x11-dgamouse, -[ --enable-video-x11-dgamouse use X11 DGA for mouse events [default=yes]], +AC_HELP_STRING([--enable-video-x11-dgamouse], [use X11 DGA for mouse events [default=yes]]), , enable_video_x11_dgamouse=yes) if test x$enable_dga = xyes -a x$enable_video_x11_dgamouse = xyes; then - CFLAGS="$CFLAGS -DXFREE86_DGAMOUSE -DDEFAULT_DGAMOUSE" + AC_DEFINE(SDL_VIDEO_DRIVER_X11_DGAMOUSE) fi AC_ARG_ENABLE(video-x11-vm, -[ --enable-video-x11-vm use X11 VM extension for fullscreen [default=yes]], +AC_HELP_STRING([--enable-video-x11-vm], [use X11 VM extension for fullscreen [default=yes]]), , enable_video_x11_vm=yes) if test x$enable_video_x11_vm = xyes; then - CFLAGS="$CFLAGS -DXFREE86_VM -DXFREE86_VMGAMMA" - VIDEO_SUBDIRS="$VIDEO_SUBDIRS Xext/Xxf86vm" - VIDEO_DRIVERS="$VIDEO_DRIVERS Xext/Xxf86vm/libXext_Xxf86vm.la" + AC_DEFINE(SDL_VIDEO_DRIVER_X11_VIDMODE) + SOURCES="$SOURCES $srcdir/src/video/Xext/Xxf86vm/*.c" fi AC_ARG_ENABLE(video-x11-xv, -[ --enable-video-x11-xv use X11 XvImage extension for video [default=yes]], +AC_HELP_STRING([--enable-video-x11-xv], [use X11 XvImage extension for video [default=yes]]), , enable_video_x11_xv=yes) if test x$enable_video_x11_xv = xyes; then - CFLAGS="$CFLAGS -DXFREE86_XV" - VIDEO_SUBDIRS="$VIDEO_SUBDIRS Xext/Xv" - VIDEO_DRIVERS="$VIDEO_DRIVERS Xext/Xv/libXext_Xv.la" + AC_DEFINE(SDL_VIDEO_DRIVER_X11_XV) + SOURCES="$SOURCES $srcdir/src/video/Xext/Xv/*.c" fi AC_ARG_ENABLE(video-x11-xinerama, -[ --enable-video-x11-xinerama enable X11 Xinerama support [default=yes]], +AC_HELP_STRING([--enable-video-x11-xinerama], [enable X11 Xinerama support [default=yes]]), , enable_video_x11_xinerama=yes) if test x$enable_video_x11_xinerama = xyes; then - CFLAGS="$CFLAGS -DHAVE_XINERAMA" - VIDEO_SUBDIRS="$VIDEO_SUBDIRS Xext/Xinerama" - VIDEO_DRIVERS="$VIDEO_DRIVERS Xext/Xinerama/libXext_Xinerama.la" + AC_DEFINE(SDL_VIDEO_DRIVER_X11_XINERAMA) + SOURCES="$SOURCES $srcdir/src/video/Xext/Xinerama/*.c" fi AC_ARG_ENABLE(video-x11-xme, -[ --enable-video-x11-xme enable Xi Graphics XME for fullscreen [default=yes]], +AC_HELP_STRING([--enable-video-x11-xme], [enable Xi Graphics XME for fullscreen [default=yes]]), , enable_video_x11_xme=yes) if test x$enable_video_x11_xme = xyes; then - CFLAGS="$CFLAGS -DHAVE_XIGXME" - VIDEO_SUBDIRS="$VIDEO_SUBDIRS Xext/XME" - VIDEO_DRIVERS="$VIDEO_DRIVERS Xext/XME/libXME.la" + AC_DEFINE(SDL_VIDEO_DRIVER_X11_XME) + SOURCES="$SOURCES $srcdir/src/video/Xext/XME/*.c" fi fi fi } +dnl Check for QNX photon video driver CheckPHOTON() { AC_ARG_ENABLE(video-photon, -[ --enable-video-photon use QNX Photon video driver [default=yes]], +AC_HELP_STRING([--enable-video-photon], [use QNX Photon video driver [default=yes]]), , enable_video_photon=yes) if test x$enable_video = xyes -a x$enable_video_photon = xyes; then AC_MSG_CHECKING(for QNX Photon support) @@ -806,20 +853,84 @@ CheckPHOTON() ]) AC_MSG_RESULT($video_photon) if test x$video_photon = xyes; then - CFLAGS="$CFLAGS -DENABLE_PHOTON" - SYSTEM_LIBS="$SYSTEM_LIBS -lph" - VIDEO_SUBDIRS="$VIDEO_SUBDIRS photon" - VIDEO_DRIVERS="$VIDEO_DRIVERS photon/libvideo_photon.la" + AC_DEFINE(SDL_VIDEO_DRIVER_PHOTON) + SOURCES="$SOURCES $srcdir/src/video/photon/*.c" + BUILD_LIBS="$BUILD_LIBS -lph" + have_video=yes + CheckOpenGLQNX fi fi } +dnl Set up the BWindow video driver if enabled +CheckBWINDOW() +{ + if test x$enable_video = xyes; then + AC_DEFINE(SDL_VIDEO_DRIVER_BWINDOW) + SOURCES="$SOURCES $srcdir/src/video/bwindow/*.cc" + have_video=yes + fi +} + +dnl Set up the Carbon/QuickDraw video driver for Mac OS X (but not Darwin) +CheckCARBON() +{ + AC_ARG_ENABLE(video-carbon, +AC_HELP_STRING([--enable-video-carbon], [use Carbon/QuickDraw video driver [default=no]]), + , enable_video_carbon=no) + if test x$enable_video = xyes -a x$enable_video_carbon = xyes; then + AC_MSG_CHECKING(for Carbon framework) + have_carbon=no + AC_TRY_COMPILE([ + #include + ],[ + ],[ + have_carbon=yes + ]) + AC_MSG_RESULT($have_carbon) + if test x$have_carbon = xyes; then + AC_DEFINE(SDL_VIDEO_DRIVER_TOOLBOX) + SOURCES="$SOURCES $srcdir/src/video/maccommon/*.c" + SOURCES="$SOURCES $srcdir/src/video/macrom/*.c" + have_video=yes + fi + fi +} + +dnl Set up the Cocoa/Quartz video driver for Mac OS X (but not Darwin) +CheckCOCOA() +{ + AC_ARG_ENABLE(video-cocoa, +AC_HELP_STRING([--enable-video-cocoa], [use Cocoa/Quartz video driver [default=yes]]), + , enable_video_cocoa=yes) + if test x$enable_video = xyes -a x$enable_video_cocoa = xyes; then + save_CFLAGS="$CFLAGS" + dnl work around that we don't have Objective-C support in autoconf + CFLAGS="$CFLAGS -x objective-c" + AC_MSG_CHECKING(for Cocoa framework) + have_cocoa=no + AC_TRY_COMPILE([ + #import + ],[ + ],[ + have_cocoa=yes + ]) + AC_MSG_RESULT($have_cocoa) + CFLAGS="$save_CFLAGS" + if test x$have_cocoa = xyes; then + AC_DEFINE(SDL_VIDEO_DRIVER_QUARTZ) + SOURCES="$SOURCES $srcdir/src/video/quartz/*.m" + have_video=yes + fi + fi +} + dnl Find the framebuffer console includes CheckFBCON() { AC_ARG_ENABLE(video-fbcon, -[ --enable-video-fbcon use framebuffer console video driver [default=yes]], +AC_HELP_STRING([--enable-video-fbcon], [use framebuffer console video driver [default=yes]]), , enable_video_fbcon=yes) if test x$enable_video = xyes -a x$enable_video_fbcon = xyes; then AC_MSG_CHECKING(for framebuffer console support) @@ -834,9 +945,9 @@ CheckFBCON() ]) AC_MSG_RESULT($video_fbcon) if test x$video_fbcon = xyes; then - CFLAGS="$CFLAGS -DENABLE_FBCON" - VIDEO_SUBDIRS="$VIDEO_SUBDIRS fbcon" - VIDEO_DRIVERS="$VIDEO_DRIVERS fbcon/libvideo_fbcon.la" + AC_DEFINE(SDL_VIDEO_DRIVER_FBCON) + SOURCES="$SOURCES $srcdir/src/video/fbcon/*.c" + have_video=yes fi fi } @@ -845,7 +956,7 @@ dnl Find DirectFB CheckDirectFB() { AC_ARG_ENABLE(video-directfb, -[ --enable-video-directfb use DirectFB video driver [default=no]], +AC_HELP_STRING([--enable-video-directfb], [use DirectFB video driver [default=no]]), , enable_video_directfb=no) if test x$enable_video = xyes -a x$enable_video_directfb = xyes; then video_directfb=no @@ -871,12 +982,11 @@ CheckDirectFB() AC_MSG_RESULT($video_directfb) if test x$video_directfb = xyes; then - CFLAGS="$CFLAGS -DENABLE_DIRECTFB" - VIDEO_SUBDIRS="$VIDEO_SUBDIRS directfb" - VIDEO_DRIVERS="$VIDEO_DRIVERS directfb/libvideo_directfb.la" - - AC_SUBST(DIRECTFB_CFLAGS) - AC_SUBST(DIRECTFB_LIBS) + AC_DEFINE(SDL_VIDEO_DRIVER_DIRECTFB) + SOURCES="$SOURCES $srcdir/src/video/directfb/*.c" + BUILD_CFLAGS="$BUILD_CFLAGS $DIRECTFB_CFLAGS" + BUILD_LIBS="$BUILD_LIBS $DIRECTFB_LIBS" + have_video=yes fi fi } @@ -885,7 +995,7 @@ dnl See if we're running on PlayStation 2 hardware CheckPS2GS() { AC_ARG_ENABLE(video-ps2gs, -[ --enable-video-ps2gs use PlayStation 2 GS video driver [default=yes]], +AC_HELP_STRING([--enable-video-ps2gs], [use PlayStation 2 GS video driver [default=yes]]), , enable_video_ps2gs=yes) if test x$enable_video = xyes -a x$enable_video_ps2gs = xyes; then AC_MSG_CHECKING(for PlayStation 2 GS support) @@ -899,9 +1009,9 @@ CheckPS2GS() ]) AC_MSG_RESULT($video_ps2gs) if test x$video_ps2gs = xyes; then - CFLAGS="$CFLAGS -DENABLE_PS2GS" - VIDEO_SUBDIRS="$VIDEO_SUBDIRS ps2gs" - VIDEO_DRIVERS="$VIDEO_DRIVERS ps2gs/libvideo_ps2gs.la" + AC_DEFINE(SDL_VIDEO_DRIVER_PS2GS) + SOURCES="$SOURCES $srcdir/src/video/ps2gs/*.c" + have_video=yes fi fi } @@ -910,7 +1020,7 @@ dnl Find the GGI includes CheckGGI() { AC_ARG_ENABLE(video-ggi, -[ --enable-video-ggi use GGI video driver [default=no]], +AC_HELP_STRING([--enable-video-ggi], [use GGI video driver [default=no]]), , enable_video_ggi=no) if test x$enable_video = xyes -a x$enable_video_ggi = xyes; then AC_MSG_CHECKING(for GGI support) @@ -924,11 +1034,10 @@ CheckGGI() ]) AC_MSG_RESULT($video_ggi) if test x$video_ggi = xyes; then - CFLAGS="$CFLAGS $X_CFLAGS -DENABLE_GGI" - SYSTEM_LIBS="$SYSTEM_LIBS -lggi -lgii -lgg" - - VIDEO_SUBDIRS="$VIDEO_SUBDIRS ggi" - VIDEO_DRIVERS="$VIDEO_DRIVERS ggi/libvideo_ggi.la" + AC_DEFINE(SDL_VIDEO_DRIVER_GGI) + SOURCES="$SOURCES $srcdir/src/video/ggi/*.c" + BUILD_LIBS="$BUILD_LIBS -lggi -lgii -lgg" + have_video=yes fi fi } @@ -937,7 +1046,7 @@ dnl Find the SVGAlib includes and libraries CheckSVGA() { AC_ARG_ENABLE(video-svga, -[ --enable-video-svga use SVGAlib video driver [default=no]], +AC_HELP_STRING([--enable-video-svga], [use SVGAlib video driver [default=no]]), , enable_video_svga=no) if test x$enable_video = xyes -a x$enable_video_svga = xyes; then AC_MSG_CHECKING(for SVGAlib (1.4.0+) support) @@ -955,11 +1064,10 @@ CheckSVGA() ]) AC_MSG_RESULT($video_svga) if test x$video_svga = xyes; then - CFLAGS="$CFLAGS -DENABLE_SVGALIB" - SYSTEM_LIBS="$SYSTEM_LIBS -lvga" - - VIDEO_SUBDIRS="$VIDEO_SUBDIRS svga" - VIDEO_DRIVERS="$VIDEO_DRIVERS svga/libvideo_svga.la" + AC_DEFINE(SDL_VIDEO_DRIVER_SVGALIB) + SOURCES="$SOURCES $srcdir/src/video/svga/*.c" + BUILD_LIBS="$BUILD_LIBS -lvga" + have_video=yes fi fi } @@ -968,7 +1076,7 @@ dnl Find the VGL includes and libraries CheckVGL() { AC_ARG_ENABLE(video-vgl, -[ --enable-video-vgl use VGL video driver [default=no]], +AC_HELP_STRING([--enable-video-vgl], [use VGL video driver [default=no]]), , enable_video_vgl=no) if test x$enable_video = xyes -a x$enable_video_vgl = xyes; then AC_MSG_CHECKING(for libVGL support) @@ -986,20 +1094,45 @@ CheckVGL() ]) AC_MSG_RESULT($video_vgl) if test x$video_vgl = xyes; then - CFLAGS="$CFLAGS -DENABLE_VGL" - SYSTEM_LIBS="$SYSTEM_LIBS -lvgl" + AC_DEFINE(SDL_VIDEO_DRIVER_VGL) + SOURCES="$SOURCES $srcdir/src/video/vgl/*.c" + BUILD_LIBS="$BUILD_LIBS -lvgl" + have_video=yes + fi + fi +} - VIDEO_SUBDIRS="$VIDEO_SUBDIRS vgl" - VIDEO_DRIVERS="$VIDEO_DRIVERS vgl/libvideo_vgl.la" +dnl Set up the wscons video driver if enabled +CheckWscons() +{ + AC_ARG_ENABLE(video-wscons, +AC_HELP_STRING([--enable-video-wscons], [use wscons video driver [default=yes]]), + , enable_video_wscons=yes) + if test x$enable_video = xyes -a x$enable_video_wscons = xyes; then + AC_MSG_CHECKING(for wscons support) + video_wscons=no + AC_TRY_COMPILE([ + #include + #include + ],[ + ],[ + video_wscons=yes + ]) + AC_MSG_RESULT($video_wscons) + if test x$video_wscons = xyes; then + AC_DEFINE(SDL_VIDEO_DRIVER_WSCONS) + SOURCES="$SOURCES $srcdir/src/video/wscons/*.c" + have_video=yes fi fi } + dnl Find the AAlib includes CheckAAlib() { AC_ARG_ENABLE(video-aalib, -[ --enable-video-aalib use AAlib video driver [default=no]], +AC_HELP_STRING([--enable-video-aalib], [use AAlib video driver [default=no]]), , enable_video_aalib=no) if test x$enable_video = xyes -a x$enable_video_aalib = xyes; then AC_MSG_CHECKING(for AAlib support) @@ -1012,27 +1145,90 @@ CheckAAlib() ]) AC_MSG_RESULT($video_aalib) if test x$video_aalib = xyes; then - CFLAGS="$CFLAGS -DENABLE_AALIB" - SYSTEM_LIBS="$SYSTEM_LIBS -laa" + AC_DEFINE(SDL_VIDEO_DRIVER_AALIB) + SOURCES="$SOURCES $srcdir/src/video/aalib/*.c" + BUILD_LIBS="$BUILD_LIBS -laa" + have_video=yes + fi + fi +} + +dnl Set up the QTopia video driver if enabled +CheckQtopia() +{ + AC_ARG_ENABLE(video-qtopia, +AC_HELP_STRING([--enable-video-qtopia], [use Qtopia video driver [default=no]]), + , enable_video_qtopia=no) + if test x$enable_video = xyes -a x$enable_video_qtopia = xyes; then + AC_MSG_CHECKING(for Qtopia support) + video_qtopia=no + QTOPIA_FLAGS="-DQT_QWS_EBX -DQT_QWS_CUSTOM -DQWS -I${QPEDIR}/include -I${QTDIR}/include/ -DNO_DEBUG -fno-rtti -fno-exceptions" + AC_LANG_CPLUSPLUS + OLD_CXX="$CXXFLAGS" + CXXFLAGS="$QTOPIA_FLAGS" + AC_TRY_COMPILE([ + #include + ],[ + ],[ + video_qtopia=yes + ]) + CXXFLAGS="$OLD_CXX" + AC_MSG_RESULT($video_qtopia) + if test x$video_qtopia = xyes; then + AC_DEFINE(SDL_VIDEO_DRIVER_QTOPIA) + SOURCES="$SOURCES $srcdir/src/video/qtopia/*.cc" + BUILD_CFLAGS="$BUILD_CFLAGS $QTOPIA_FLAGS" + SDL_CFLAGS="$SDL_CFLAGS -DQWS -Dmain=SDL_main" + SDL_LIBS="-lSDLmain $SDL_LIBS -L${QPEDIR}/lib -L${QTDIR}/lib/ -lqpe -lqte" + have_video=yes + fi + AC_LANG_C + fi +} - VIDEO_SUBDIRS="$VIDEO_SUBDIRS aalib" - VIDEO_DRIVERS="$VIDEO_DRIVERS aalib/libvideo_aa.la" +dnl Set up the PicoGUI video driver if enabled +CheckPicoGUI() +{ + AC_ARG_ENABLE(video-picogui, +AC_HELP_STRING([--enable-video-picogui], [use PicoGUI video driver [default=no]]), + , enable_video_picogui=no) + if test x$enable_video = xyes -a x$enable_video_picogui = xyes; then + AC_MSG_CHECKING(for PicoGUI support) + video_picogui=no + AC_TRY_COMPILE([ + #include + ],[ + ],[ + video_picogui=yes + ]) + AC_MSG_RESULT($video_picogui) + if test x$video_picogui = xyes; then + AC_DEFINE(SDL_VIDEO_DRIVER_PICOGUI) + SOURCES="$SOURCES $srcdir/src/video/picogui/*.c" + SDL_LIBS="$SDL_LIBS -lpgui" + have_video=yes fi fi } +dnl Set up the Atari Bios keyboard driver +CheckAtariBiosEvent() +{ + SOURCES="$SOURCES $srcdir/src/video/ataricommon/*.c" +} + dnl Set up the Atari Xbios driver CheckAtariXbiosVideo() { AC_ARG_ENABLE(xbios, -[ --enable-video-xbios use Atari Xbios video driver [default=yes]], +AC_HELP_STRING([--enable-video-xbios], [use Atari Xbios video driver [default=yes]]), , enable_video_xbios=yes) video_xbios=no if test x$enable_video = xyes -a x$enable_video_xbios = xyes; then video_xbios=yes - CFLAGS="$CFLAGS -DENABLE_XBIOS" - VIDEO_SUBDIRS="$VIDEO_SUBDIRS xbios" - VIDEO_DRIVERS="$VIDEO_DRIVERS xbios/libvideo_xbios.la" + AC_DEFINE(SDL_VIDEO_DRIVER_XBIOS) + SOURCES="$SOURCES $srcdir/src/video/xbios/*.c" + have_video=yes fi } @@ -1040,46 +1236,37 @@ dnl Set up the Atari Gem driver CheckAtariGemVideo() { AC_ARG_ENABLE(gem, -[ --enable-video-gem use Atari Gem video driver [default=yes]], +AC_HELP_STRING([--enable-video-gem], [use Atari Gem video driver [default=yes]]), , enable_video_gem=yes) if test x$enable_video = xyes -a x$enable_video_gem = xyes; then video_gem=no AC_CHECK_HEADER(gem.h, have_gem_hdr=yes) AC_CHECK_LIB(gem, appl_init, have_gem_lib=yes) if test x$have_gem_hdr = xyes -a x$have_gem_lib = xyes; then - video_gem=yes - CFLAGS="$CFLAGS -DENABLE_GEM" - SYSTEM_LIBS="$SYSTEM_LIBS -lgem" - VIDEO_SUBDIRS="$VIDEO_SUBDIRS gem" - VIDEO_DRIVERS="$VIDEO_DRIVERS gem/libvideo_gem.la" + AC_DEFINE(SDL_VIDEO_DRIVER_GEM) + SOURCES="$SOURCES $srcdir/src/video/gem/*.c" + BUILD_LIBS="$BUILD_LIBS -lgem" + have_video=yes fi fi } -dnl Set up the Atari Bios keyboard driver -CheckAtariBiosEvent() -{ - CFLAGS="$CFLAGS -I\$(top_srcdir)/src/video/ataricommon" - VIDEO_SUBDIRS="$VIDEO_SUBDIRS ataricommon" - VIDEO_DRIVERS="$VIDEO_DRIVERS ataricommon/libvideo_ataricommon.la" -} - dnl rcg04172001 Set up the Null video driver. CheckDummyVideo() { AC_ARG_ENABLE(video-dummy, -[ --enable-video-dummy use dummy video driver [default=yes]], +AC_HELP_STRING([--enable-video-dummy], [use dummy video driver [default=yes]]), , enable_video_dummy=yes) if test x$enable_video_dummy = xyes; then - CFLAGS="$CFLAGS -DENABLE_DUMMYVIDEO" - VIDEO_SUBDIRS="$VIDEO_SUBDIRS dummy" - VIDEO_DRIVERS="$VIDEO_DRIVERS dummy/libvideo_null.la" + AC_DEFINE(SDL_VIDEO_DRIVER_DUMMY) + SOURCES="$SOURCES $srcdir/src/video/dummy/*.c" + have_video=yes fi } dnl Check to see if OpenGL support is desired AC_ARG_ENABLE(video-opengl, -[ --enable-video-opengl include OpenGL context creation [default=yes]], +AC_HELP_STRING([--enable-video-opengl], [include OpenGL context creation [default=yes]]), , enable_video_opengl=yes) dnl Find OpenGL @@ -1091,17 +1278,14 @@ CheckOpenGLX11() AC_TRY_COMPILE([ #include #include - #include /* For loading extensions */ ],[ ],[ video_opengl=yes ]) AC_MSG_RESULT($video_opengl) if test x$video_opengl = xyes; then - CFLAGS="$CFLAGS -DHAVE_OPENGL -DHAVE_OPENGL_X11" - if test x$have_loadso != xyes; then - AC_CHECK_LIB(dl, dlopen, SYSTEM_LIBS="$SYSTEM_LIBS -ldl") - fi + AC_DEFINE(SDL_VIDEO_OPENGL) + AC_DEFINE(SDL_VIDEO_OPENGL_GLX) fi fi } @@ -1120,21 +1304,27 @@ CheckOpenGLQNX() ]) AC_MSG_RESULT($video_opengl) if test x$video_opengl = xyes; then - CFLAGS="$CFLAGS -DHAVE_OPENGL" - SYSTEM_LIBS="$SYSTEM_LIBS -lGL" - if test x$have_loadso != xyes; then - AC_CHECK_LIB(c, dlopen, SYSTEM_LIBS="$SYSTEM_LIBS", AC_CHECK_LIB(ltdl, dlopen, SYSTEM_LIBS="$SYSTEM_LIBS -lltdl")) - fi + AC_DEFINE(SDL_VIDEO_OPENGL) + BUILD_LIBS="$BUILD_LIBS -lGL" fi fi } +dnl Check for Win32 OpenGL +CheckWIN32GL() +{ + if test x$enable_video = xyes -a x$enable_video_opengl = xyes; then + AC_DEFINE(SDL_VIDEO_OPENGL) + AC_DEFINE(SDL_VIDEO_OPENGL_WGL) + fi +} + dnl Check for BeOS OpenGL CheckBeGL() { if test x$enable_video = xyes -a x$enable_video_opengl = xyes; then - CFLAGS="$CFLAGS -DHAVE_OPENGL" - SYSTEM_LIBS="$SYSTEM_LIBS -lGL" + AC_DEFINE(SDL_VIDEO_OPENGL) + BUILD_LIBS="$BUILD_LIBS -lGL" fi } @@ -1142,12 +1332,12 @@ dnl Check for MacOS OpenGL CheckMacGL() { if test x$enable_video = xyes -a x$enable_video_opengl = xyes; then - CFLAGS="$CFLAGS -DHAVE_OPENGL" + AC_DEFINE(SDL_VIDEO_OPENGL) case "$target" in *-*-darwin*) - SYSTEM_LIBS="$SYSTEM_LIBS -framework OpenGL" + BUILD_LIBS="$BUILD_LIBS -framework OpenGL" # The following is probably not available in Darwin: - SYSTEM_LIBS="$SYSTEM_LIBS -framework AGL" + BUILD_LIBS="$BUILD_LIBS -framework AGL" esac fi } @@ -1164,26 +1354,27 @@ CheckAtariOSMesa() if test "x$OSMESA_CONFIG" = "xno" -o "x$enable_atari_ldg" = "xno"; then # -lOSMesa is really the static library if test "x$have_osmesa_hdr" = "xyes" -a "x$have_osmesa_lib" = "xyes"; then - CFLAGS="$CFLAGS -DHAVE_OPENGL" - SYSTEM_LIBS="$SYSTEM_LIBS -lOSMesa" + OSMESA_LIBS="-lOSMesa" fi else # -lOSMesa is a loader for OSMesa.ldg OSMESA_CFLAGS=`$OSMESA_CONFIG --cflags` OSMESA_LIBS=`$OSMESA_CONFIG --libs` - CFLAGS="$CFLAGS -DHAVE_OPENGL $OSMESA_CFLAGS" - SYSTEM_LIBS="$SYSTEM_LIBS $OSMESA_LIBS" fi + AC_DEFINE(SDL_VIDEO_OPENGL) + AC_DEFINE(SDL_VIDEO_OPENGL_OSMESA) + BUILD_CFLAGS="$BUILD_CFLAGS $OSMESA_CFLAGS" + BUILD_LIBS="$BUILD_LIBS $OSMESA_LIBS" AC_ARG_ENABLE(osmesa-shared, -[ --enable-osmesa-shared dynamically load OSMesa OpenGL support [default=yes]], +AC_HELP_STRING([--enable-osmesa-shared], [dynamically load OSMesa OpenGL support [default=yes]]), , enable_osmesa_shared=yes) if test "x$enable_osmesa_shared" = "xyes" -a "x$enable_atari_ldg" = "xyes"; then # Dynamic linking if test "x$have_osmesa_hdr" = "xyes"; then - CFLAGS="$CFLAGS -DENABLE_OSMESA_SHARED" + AC_DEFINE(SDL_VIDEO_OPENGL_OSMESA_DYNAMIC) fi - fi + fi fi } @@ -1192,7 +1383,7 @@ CheckInputEvents() { dnl Check for Linux 2.4 unified input event interface support AC_ARG_ENABLE(input-events, -[ --enable-input-events use Linux 2.4 unified input interface [default=yes]], +AC_HELP_STRING([--enable-input-events], [use Linux 2.4 unified input interface [default=yes]]), , enable_input_events=yes) if test x$enable_input_events = xyes; then AC_MSG_CHECKING(for Linux 2.4 unified input interface) @@ -1208,7 +1399,7 @@ CheckInputEvents() ]) AC_MSG_RESULT($use_input_events) if test x$use_input_events = xyes; then - CFLAGS="$CFLAGS -DUSE_INPUT_EVENTS" + AC_DEFINE(SDL_INPUT_LINUXEV) fi fi } @@ -1217,7 +1408,7 @@ dnl See if we can use the Touchscreen input library CheckTslib() { AC_ARG_ENABLE(input-tslib, -[ --enable-input-tslib use the Touchscreen library for input [default=yes]], +AC_HELP_STRING([--enable-input-tslib], [use the Touchscreen library for input [default=yes]]), , enable_input_tslib=yes) if test x$enable_input_tslib = xyes; then AC_MSG_CHECKING(for Touchscreen library support) @@ -1230,8 +1421,8 @@ CheckTslib() ]) AC_MSG_RESULT($enable_input_tslib) if test x$enable_input_tslib = xyes; then - CFLAGS="$CFLAGS -DHAVE_TSLIB" - SYSTEM_LIBS="$SYSTEM_LIBS -lts" + AC_DEFINE(SDL_INPUT_TSLIB) + BUILD_LIBS="$BUILD_LIBS -lts" fi fi } @@ -1241,25 +1432,24 @@ CheckPTH() { dnl Check for pth support AC_ARG_ENABLE(pth, -[ --enable-pth use GNU pth library for multi-threading [default=yes]], +AC_HELP_STRING([--enable-pth], [use GNU pth library for multi-threading [default=yes]]), , enable_pth=yes) if test x$enable_threads = xyes -a x$enable_pth = xyes; then AC_PATH_PROG(PTH_CONFIG, pth-config, no) if test "$PTH_CONFIG" = "no"; then use_pth=no else - PTH_CFLAGS=`$PTH_CONFIG --cflags` - PTH_LIBS=`$PTH_CONFIG --libs --all` - SDL_CFLAGS="$SDL_CFLAGS $PTH_CFLAGS" - SDL_LIBS="$SDL_LIBS $PTH_LIBS" - CFLAGS="$CFLAGS -DENABLE_PTH" use_pth=yes fi AC_MSG_CHECKING(pth) + AC_MSG_RESULT($use_pth) if test "x$use_pth" = xyes; then - AC_MSG_RESULT(yes) - else - AC_MSG_RESULT(no) + AC_DEFINE(SDL_THREAD_PTH) + SOURCES="$SOURCES $srcdir/src/thread/pth/*.c" + SOURCES="$SOURCES $srcdir/src/thread/generic/SDL_syssem.c" + SDL_CFLAGS="$SDL_CFLAGS `$PTH_CONFIG --cflags`" + SDL_LIBS="$SDL_LIBS `$PTH_CONFIG --libs --all`" + have_threads=yes fi fi } @@ -1269,15 +1459,15 @@ CheckPTHREAD() { dnl Check for pthread support AC_ARG_ENABLE(pthreads, -[ --enable-pthreads use POSIX threads for multi-threading [default=yes]], +AC_HELP_STRING([--enable-pthreads], [use POSIX threads for multi-threading [default=yes]]), , enable_pthreads=yes) dnl This is used on Linux for glibc binary compatibility (Doh!) AC_ARG_ENABLE(pthread-sem, -[ --enable-pthread-sem use pthread semaphores [default=yes]], +AC_HELP_STRING([--enable-pthread-sem], [use pthread semaphores [default=yes]]), , enable_pthread_sem=yes) case "$target" in *-*-linux*) - pthread_cflags="-D_REENTRANT -D_GNU_SOURCE" + pthread_cflags="-D_REENTRANT" pthread_lib="-lpthread" ;; *-*-bsdi*) @@ -1294,7 +1484,7 @@ CheckPTHREAD() pthread_lib="-pthread" ;; *-*-netbsd*) - pthread_cflags="-I/usr/include -D_REENTRANT -D_THREAD_SAFE" + pthread_cflags="-I/usr/include -D_REENTRANT -D_THREAD_SAFE -D_POSIX_THREAD_SYSCALL_SOFT=1" pthread_lib="-L/usr/lib -lpthread" ;; *-*-openbsd*) @@ -1357,10 +1547,12 @@ CheckPTHREAD() AC_MSG_RESULT($use_pthreads) # Restore the compiler flags and libraries CFLAGS="$ac_save_cflags"; LIBS="$ac_save_libs" + # Do futher testing if we have pthread support... if test x$use_pthreads = xyes; then - CFLAGS="$CFLAGS $pthread_cflags -DSDL_USE_PTHREADS" - LIBS="$LIBS $pthread_lib" + AC_DEFINE(SDL_THREAD_PTHREAD) + BUILD_CFLAGS="$BUILD_CFLAGS $pthread_cflags" + BUILD_LIBS="$BUILD_LIBS $pthread_lib" SDL_CFLAGS="$SDL_CFLAGS $pthread_cflags" SDL_LIBS="$SDL_LIBS $pthread_lib" @@ -1375,7 +1567,7 @@ CheckPTHREAD() pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE); ],[ has_recursive_mutexes=yes - CFLAGS="$CFLAGS -DPTHREAD_RECURSIVE_MUTEX" + AC_DEFINE(SDL_THREAD_PTHREAD_RECURSIVE_MUTEX) ]) fi if test x$has_recursive_mutexes = xno; then @@ -1386,13 +1578,10 @@ CheckPTHREAD() pthread_mutexattr_setkind_np(&attr, PTHREAD_MUTEX_RECURSIVE_NP); ],[ has_recursive_mutexes=yes - CFLAGS="$CFLAGS -DPTHREAD_RECURSIVE_MUTEX_NP" + AC_DEFINE(SDL_THREAD_PTHREAD_RECURSIVE_MUTEX_NP) ]) fi AC_MSG_RESULT($has_recursive_mutexes) - if test x$has_recursive_mutexes = xno; then - CFLAGS="$CFLAGS -DPTHREAD_NO_RECURSIVE_MUTEX" - fi # Check to see if pthread semaphore support is missing if test x$enable_pthread_sem = xyes; then @@ -1408,139 +1597,28 @@ CheckPTHREAD() AC_MSG_RESULT($have_pthread_sem) fi - # Check to see if this is broken glibc 2.0 pthreads - case "$target" in - *-*-linux*) - AC_MSG_CHECKING(for broken glibc 2.0 pthreads) - glibc20_pthreads=no - AC_TRY_COMPILE([ - #include - #if (__GLIBC__ == 2) && (__GLIBC_MINOR__ == 0) - #warning Working around a bug in glibc 2.0 pthreads - #else - #error pthread implementation okay - #endif /* glibc 2.0 */ - ],[ - ],[ - glibc20_pthreads=yes - ]) - AC_MSG_RESULT($glibc20_pthreads) - esac - fi - fi - - AC_MSG_CHECKING(whether semun is defined in /usr/include/sys/sem.h) - have_semun=no - AC_TRY_COMPILE([ - #include - #include - ],[ - union semun t; - ],[ - have_semun=yes - ]) - AC_MSG_RESULT($have_semun) - if test x$have_semun = xyes; then - CFLAGS="$CFLAGS -DHAVE_SEMUN" - fi + # Basic thread creation functions + SOURCES="$SOURCES $srcdir/src/thread/pthread/SDL_systhread.c" - # See if we can use GNU Pth or clone() on Linux directly - if test x$enable_threads = xyes -a x$use_pthreads != xyes; then - CheckPTH - if test x$use_pth != xyes; then - case "$target" in - *-*-linux*) - use_clone=yes - ;; - esac - fi - fi -} + # Semaphores + # We can fake these with mutexes and condition variables if necessary + if test x$have_pthread_sem = xyes; then + SOURCES="$SOURCES $srcdir/src/thread/pthread/SDL_syssem.c" + else + SOURCES="$SOURCES $srcdir/src/thread/generic/SDL_syssem.c" + fi -# Note that we need to have either semaphores or to have mutexes and -# condition variables to implement all thread synchronization primitives -CopyUnixThreadSource() -{ - if test x$use_pthreads = xyes -o x$use_clone = xyes; then - # Basic thread creation functions - COPY_ARCH_SRC(src/thread, linux, SDL_systhread.c) - COPY_ARCH_SRC(src/thread, linux, SDL_systhread_c.h) - - # Semaphores - # We can fake these with mutexes and condition variables if necessary - if test x$use_pthreads = xyes -a x$have_pthread_sem != xyes; then - COPY_ARCH_SRC(src/thread, generic, SDL_syssem.c) - else - COPY_ARCH_SRC(src/thread, linux, SDL_syssem.c) - fi - COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h) + # Mutexes + # We can fake these with semaphores if necessary + SOURCES="$SOURCES $srcdir/src/thread/pthread/SDL_sysmutex.c" - # Mutexes - # We can fake these with semaphores if necessary - case "$target" in - *-*-bsdi*) - COPY_ARCH_SRC(src/thread, bsdi, SDL_syssem.c) - COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h) - COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex.c) - COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex_c.h) - ;; - *) - if test x$glibc20_pthreads = xyes; then - COPY_ARCH_SRC(src/thread, generic, SDL_sysmutex.c) - COPY_ARCH_SRC(src/thread, generic, SDL_sysmutex_c.h) - else - COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex.c) - COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex_c.h) - fi - ;; - esac + # Condition variables + # We can fake these with semaphores and mutexes if necessary + SOURCES="$SOURCES $srcdir/src/thread/pthread/SDL_syscond.c" - # Condition variables - # We can fake these with semaphores and mutexes if necessary - if test x$glibc20_pthreads = xyes -o x$has_recursive_mutexes != xyes; then - COPY_ARCH_SRC(src/thread, generic, SDL_syscond.c) + have_threads=yes else - COPY_ARCH_SRC(src/thread, linux, SDL_syscond.c) - fi - COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h) - - elif test x$use_pth = xyes; then - COPY_ARCH_SRC(src/thread, pth, SDL_systhread.c) - COPY_ARCH_SRC(src/thread, pth, SDL_systhread_c.h) - COPY_ARCH_SRC(src/thread, pth, SDL_sysmutex.c) - COPY_ARCH_SRC(src/thread, pth, SDL_sysmutex_c.h) - COPY_ARCH_SRC(src/thread, pth, SDL_syscond.c) - COPY_ARCH_SRC(src/thread, pth, SDL_syscond_c.h) - COPY_ARCH_SRC(src/thread, generic, SDL_syssem.c) - COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h) - else - AC_MSG_ERROR([ -*** No thread support detected - ]) - fi -} - -dnl See if we can use sigaction() instead of signal() -CheckSIGACTION() -{ - dnl Check for sigaction support - AC_ARG_ENABLE(sigaction, -[ --enable-sigaction use sigaction instead of signal [default=yes]], - , enable_sigaction=yes) - if test x$enable_sigaction = xyes; then - AC_MSG_CHECKING(sigaction) - have_sigaction=no - AC_TRY_COMPILE([ - #include - ],[ - struct sigaction junk; - sigaction(0, &junk, &junk); - ],[ - have_sigaction=yes - ]) - AC_MSG_RESULT($have_sigaction) - if test x$have_sigaction = xyes; then - CFLAGS="$CFLAGS -DHAVE_SIGACTION" + CheckPTH fi fi } @@ -1565,10 +1643,17 @@ CheckWIN32() dnl See if the user wants to redirect standard output to files AC_ARG_ENABLE(stdio-redirect, -[ --enable-stdio-redirect Redirect STDIO to files on Win32 [default=yes]], +AC_HELP_STRING([--enable-stdio-redirect], [Redirect STDIO to files on Win32 [default=yes]]), , enable_stdio_redirect=yes) if test x$enable_stdio_redirect != xyes; then - CFLAGS="$CFLAGS -DNO_STDIO_REDIRECT" + BUILD_CFLAGS="$BUILD_CFLAGS -DNO_STDIO_REDIRECT" + fi + + if test x$enable_video = xyes; then + AC_DEFINE(SDL_VIDEO_DRIVER_WINDIB) + SOURCES="$SOURCES $srcdir/src/video/wincommon/*.c" + SOURCES="$SOURCES $srcdir/src/video/windib/*.c" + have_video=yes fi } @@ -1576,249 +1661,52 @@ dnl Find the DirectX includes and libraries CheckDIRECTX() { AC_ARG_ENABLE(directx, -[ --enable-directx use DirectX for Win32 audio/video [default=yes]], +AC_HELP_STRING([--enable-directx], [use DirectX for Win32 audio/video [default=yes]]), , enable_directx=yes) if test x$enable_directx = xyes; then - AC_MSG_CHECKING(for DirectX headers and libraries) - use_directx=no - tmp_cflags=$CFLAGS - CFLAGS="$CFLAGS -I$srcdir" - AC_TRY_COMPILE([ - #include "src/video/windx5/directx.h" - ],[ - ],[ - use_directx=yes - ]) - CFLAGS=$tmp_cflags - AC_MSG_RESULT($use_directx) - fi - - CFLAGS="$CFLAGS -I\$(top_srcdir)/src/video/wincommon" - SYSTEM_LIBS="$SYSTEM_LIBS -luser32 -lgdi32 -lwinmm" - VIDEO_SUBDIRS="$VIDEO_SUBDIRS wincommon" - VIDEO_DRIVERS="$VIDEO_DRIVERS wincommon/libvideo_wincommon.la" - # Enable the DIB driver - CFLAGS="$CFLAGS -DENABLE_WINDIB" - VIDEO_SUBDIRS="$VIDEO_SUBDIRS windib" - VIDEO_DRIVERS="$VIDEO_DRIVERS windib/libvideo_windib.la" - # See if we should enable the DirectX driver - if test x$use_directx = xyes; then - CFLAGS="$CFLAGS -DENABLE_DIRECTX" - SYSTEM_LIBS="$SYSTEM_LIBS -ldxguid" - VIDEO_SUBDIRS="$VIDEO_SUBDIRS windx5" - VIDEO_DRIVERS="$VIDEO_DRIVERS windx5/libvideo_windx5.la" - fi -} - -dnl Set up the BWindow video driver on BeOS -CheckBWINDOW() -{ - CFLAGS="$CFLAGS -DENABLE_BWINDOW" - VIDEO_SUBDIRS="$VIDEO_SUBDIRS bwindow" - VIDEO_DRIVERS="$VIDEO_DRIVERS bwindow/libvideo_bwindow.la" -} - -dnl Set up the QTopia video driver if enabled -CheckQtopia() -{ - AC_ARG_ENABLE(video-qtopia, -[ --enable-video-qtopia use Qtopia video driver [default=no]], - , enable_video_qtopia=no) - if test x$enable_video = xyes -a x$enable_video_qtopia = xyes; then - AC_MSG_CHECKING(for Qtopia support) - video_qtopia=no - AC_LANG_CPLUSPLUS - OLD_CXX="$CXXFLAGS" - CXXFLAGS="-DQT_QWS_EBX -fno-rtti -fno-exceptions -DQT_QWS_CUSTOM -DQWS -I${QPEDIR}/include -I${QTDIR}/include/ -DNO_DEBUG" - AC_TRY_COMPILE([ - #include - ],[ - ],[ - video_qtopia=yes - ]) - CXXFLAGS="$OLD_CXX" - AC_MSG_RESULT($video_qtopia) - if test x$video_qtopia = xyes; then - CFLAGS="$CFLAGS -DENABLE_QTOPIA -DQT_QWS_EBX -DQT_QWS_CUSTOM -DQWS -I${QPEDIR}/include -I${QTDIR}/include/ -DNO_DEBUG -fno-rtti -fno-exceptions" - SDL_LIBS="$SDL_LIBS -L${QPEDIR}/lib -L${QTDIR}/lib/ -lqpe -lqte" - SDL_CFLAGS="$SDL_CFLAGS -DQWS" - VIDEO_SUBDIRS="$VIDEO_SUBDIRS qtopia" - VIDEO_DRIVERS="$VIDEO_DRIVERS qtopia/libvideo_qtopia.la" - else - AC_MSG_ERROR([ -*** Failed to find Qtopia includes. Make sure that the QTDIR and QPEDIR -*** environment variables are set correctly.]) + have_directx=no + AC_CHECK_HEADER(ddraw.h, have_ddraw=yes) + AC_CHECK_HEADER(dsound.h, have_dsound=yes) + AC_CHECK_HEADER(dinput.h, use_dinput=yes) + if test x$have_ddraw = xyes -a x$have_dsound = xyes -a x$use_dinput = xyes; then + have_directx=yes fi - AC_LANG_C - fi -} - -dnl Set up the wscons video driver if enabled -CheckWscons() -{ - AC_ARG_ENABLE(video-wscons, -[ --enable-video-wscons use wscons video driver [default=no]], - , enable_video_wscons=no) - if test x$enable_video = xyes -a x$enable_video_wscons = xyes; then - AC_MSG_CHECKING(for wscons support) - video_wscons=no - AC_LANG_C - AC_TRY_COMPILE([ - #include - #include - ],[ - ],[ - video_wscons=yes - ]) - AC_MSG_RESULT($video_wscons) - if test x$video_wscons = xyes; then - CFLAGS="$CFLAGS -DENABLE_WSCONS" - VIDEO_SUBDIRS="$VIDEO_SUBDIRS wscons" - VIDEO_DRIVERS="$VIDEO_DRIVERS wscons/libvideo_wscons.la" - else - AC_MSG_ERROR([ -*** Failed to find wscons includes.]) + if test x$enable_video = xyes -a x$have_directx = xyes; then + AC_DEFINE(SDL_VIDEO_DRIVER_DDRAW) + SOURCES="$SOURCES $srcdir/src/video/windx5/*.c" + have_video=yes fi - AC_LANG_C fi } - -dnl Set up the PicoGUI video driver if enabled -CheckPicoGUI() -{ - AC_ARG_ENABLE(video-picogui, -[ --enable-video-picogui use PicoGUI video driver [default=no]], - , enable_video_picogui=no) - if test x$enable_video = xyes -a x$enable_video_picogui = xyes; then - AC_MSG_CHECKING(for PicoGUI support) - video_picogui=no - AC_TRY_COMPILE([ - #include - ],[ - ],[ - video_picogui=yes - ]) - AC_MSG_RESULT($video_picogui) - if test x$video_picogui = xyes; then - SDL_LIBS="$SDL_LIBS -lpgui" - CFLAGS="$CFLAGS -DENABLE_PICOGUI" - VIDEO_SUBDIRS="$VIDEO_SUBDIRS picogui" - VIDEO_DRIVERS="$VIDEO_DRIVERS picogui/libvideo_picogui.la" - fi - AC_LANG_C - fi -} - -dnl Set up the Mac toolbox video driver for Mac OS 7-9 -CheckTOOLBOX() -{ - CFLAGS="$CFLAGS -DENABLE_TOOLBOX -DENABLE_DRAWSPROCKET" - VIDEO_SUBDIRS="$VIDEO_SUBDIRS maccommon" - VIDEO_DRIVERS="$VIDEO_DRIVERS maccommon/libvideo_maccommon.la" - VIDEO_SUBDIRS="$VIDEO_SUBDIRS macrom" - VIDEO_DRIVERS="$VIDEO_DRIVERS macrom/libvideo_macrom.la" - VIDEO_SUBDIRS="$VIDEO_SUBDIRS macdsp" - VIDEO_DRIVERS="$VIDEO_DRIVERS macdsp/libvideo_macdsp.la" -} - -dnl Set up the Carbon/QuickDraw video driver for Mac OS X (but not Darwin) -CheckCARBON() -{ - AC_ARG_ENABLE(video-carbon, -[ --enable-video-carbon use Carbon/QuickDraw video driver [default=no]], - , enable_video_carbon=no) - if test x$enable_video = xyes -a x$enable_video_carbon = xyes; then - AC_MSG_CHECKING(for Carbon framework) - have_carbon=no - if test x$have_carbon != xyes; then - AC_TRY_COMPILE([ - #include - ],[ - ],[ - have_carbon=yes - ]) - fi - AC_MSG_RESULT($have_carbon) - if test x$have_carbon = xyes; then - # "MACOSX" is not an official definition, but it's commonly - # accepted as a way to differentiate between what runs on X - # and what runs on older Macs - while in theory "Carbon" defns - # are consistent between the two, in practice Carbon is still - # changing. -sts Aug 2000 - mac_autoconf_target_workaround="MAC" - CFLAGS="$CFLAGS -I/System/Library/Frameworks/Carbon.framework/Headers \ - -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" - VIDEO_SUBDIRS="$VIDEO_SUBDIRS maccommon" - VIDEO_DRIVERS="$VIDEO_DRIVERS maccommon/libvideo_maccommon.la" - VIDEO_SUBDIRS="$VIDEO_SUBDIRS macrom" - VIDEO_DRIVERS="$VIDEO_DRIVERS macrom/libvideo_macrom.la" - #VIDEO_SUBDIRS="$VIDEO_SUBDIRS macdsp" - #VIDEO_DRIVERS="$VIDEO_DRIVERS macdsp/libvideo_macdsp.la" - fi - fi -} - -dnl Set up the Cocoa/Quartz video driver for Mac OS X (but not Darwin) -CheckCOCOA() -{ - AC_ARG_ENABLE(video-cocoa, -[ --enable-video-cocoa use Cocoa/Quartz video driver [default=yes]], - , enable_video_cocoa=yes) - if test x$enable_video = xyes -a x$enable_video_cocoa = xyes; then - old_CFLAGS="$CFLAGS" - dnl work around that we don't have Objective-C support in autoconf - CFLAGS="$CFLAGS -x objective-c" - AC_MSG_CHECKING(for Cocoa framework) - have_cocoa=no - if test x$have_cocoa != xyes; then - AC_TRY_COMPILE([ - #import - ],[ - ],[ - have_cocoa=yes - ]) - fi - AC_MSG_RESULT($have_cocoa) - CFLAGS="$old_CFLAGS" - if test x$have_cocoa = xyes; then - # "MACOSX" is not an official definition, but it's commonly - # accepted as a way to differentiate between what runs on X - # and what runs on older Macs - while in theory "Carbon" defns - # are consistent between the two, in practice Carbon is still - # changing. -sts Aug 2000 - mac_autoconf_target_workaround="MAC" - CFLAGS="$CFLAGS -I/System/Library/Frameworks/Carbon.framework/Headers \ - -I/System/Library/Frameworks/Cocoa.framework/Headers -fpascal-strings \ - -DENABLE_QUARTZ -DMACOSX -DTARGET_API_${mac_autoconf_target_workaround}_CARBON=1 -I\$(top_srcdir)/src/video/quartz" - VIDEO_SUBDIRS="$VIDEO_SUBDIRS quartz" - VIDEO_DRIVERS="$VIDEO_DRIVERS quartz/libvideo_quartz.la" - fi - fi -} - dnl Check for the dlfcn.h interface for dynamically loading objects CheckDLOPEN() { AC_ARG_ENABLE(sdl-dlopen, -[ --enable-sdl-dlopen use dlopen for shared object loading [default=yes]], +AC_HELP_STRING([--enable-sdl-dlopen], [use dlopen for shared object loading [default=yes]]), , enable_sdl_dlopen=yes) if test x$enable_sdl_dlopen = xyes; then AC_MSG_CHECKING(for dlopen) - have_loadso=no + have_dlopen=no AC_TRY_COMPILE([ #include ],[ ],[ - have_loadso=yes + have_dlopen=yes ]) - AC_MSG_RESULT($have_loadso) - - if test x$have_loadso = xyes; then - CFLAGS="$CFLAGS -DUSE_DLOPEN" - AC_CHECK_LIB(c, dlopen, SYSTEM_LIBS="$SYSTEM_LIBS", - AC_CHECK_LIB(dl, dlopen, SYSTEM_LIBS="$SYSTEM_LIBS -ldl", - AC_CHECK_LIB(ltdl, dlopen, SYSTEM_LIBS="$SYSTEM_LIBS -lltdl"))) + AC_MSG_RESULT($have_dlopen) + + if test x$have_dlopen = xyes; then + AC_CHECK_LIB(c, dlopen, BUILD_LIBS="$BUILD_LIBS", + AC_CHECK_LIB(dl, dlopen, BUILD_LIBS="$BUILD_LIBS -ldl", + AC_CHECK_LIB(ltdl, dlopen, BUILD_LIBS="$BUILD_LIBS -lltdl"))) + AC_CHECK_LIB(dl, dlvsym, have_dlvsym=yes) + if test x$have_dlvsym = xyes; then + AC_DEFINE(HAVE_DLVSYM) + fi + AC_DEFINE(SDL_LOADSO_DLOPEN) + SOURCES="$SOURCES $srcdir/src/loadso/dlopen/*.c" + have_loadso=yes fi fi } @@ -1827,15 +1715,16 @@ dnl Set up the Atari LDG (shared object loader) CheckAtariLdg() { AC_ARG_ENABLE(atari-ldg, -[ --enable-atari-ldg use Atari LDG for shared object loading [default=yes]], +AC_HELP_STRING([--enable-atari-ldg], [use Atari LDG for shared object loading [default=yes]]), , enable_atari_ldg=yes) if test x$video_gem = xyes -a x$enable_atari_ldg = xyes; then AC_CHECK_HEADER(ldg.h, have_ldg_hdr=yes) AC_CHECK_LIB(ldg, ldg_open, have_ldg_lib=yes, have_ldg_lib=no, -lgem) if test x$have_ldg_hdr = xyes -a x$have_ldg_lib = xyes; then + AC_DEFINE(SDL_LOADSO_LDG) + SOURCES="$SOURCES $srcdir/src/loadso/mint/*.c" + BUILD_LIBS="$BUILD_LIBS -lldg -lgem" have_loadso=yes - CFLAGS="$CFLAGS -DENABLE_LDG" - SYSTEM_LIBS="$SYSTEM_LIBS -lldg -lgem" fi fi } @@ -1844,33 +1733,16 @@ dnl Check for the usbhid(3) library on *BSD CheckUSBHID() { if test x$enable_joystick = xyes; then - have_libusbhid=no - have_libusb=no - AC_CHECK_LIB(usbhid, hid_init, have_libusbhid=yes) - AC_CHECK_LIB(usb, hid_init, have_libusb=yes) - if test x$have_libusbhid = xyes; then - SYSTEM_LIBS="$SYSTEM_LIBS -lusbhid" - fi - if test x$have_libusb = xyes; then - SYSTEM_LIBS="$SYSTEM_LIBS -lusb" - fi + AC_CHECK_HEADER(usb.h, [USB_CFLAGS="-DHAVE_USB_H"]) + AC_CHECK_HEADER(usbhid.h, [USB_CFLAGS="-DHAVE_USBHID_H"]) + AC_CHECK_HEADER(libusb.h, [USB_CFLAGS="-DHAVE_LIBUSB_H"]) + AC_CHECK_HEADER(libusbhid.h, [USB_CFLAGS="-DHAVE_LIBUSBHID_H"]) + + AC_CHECK_LIB(usbhid, hid_init, [USB_LIBS="$USB_LIBS -lusbhid"]) + AC_CHECK_LIB(usb, hid_init, [USB_LIBS="$USB_LIBS -lusb"]) - AC_CHECK_HEADER(usb.h, have_usb_h=yes) - AC_CHECK_HEADER(usbhid.h, have_usbhid_h=yes) - AC_CHECK_HEADER(libusb.h, have_libusb_h=yes) - AC_CHECK_HEADER(libusbhid.h, have_libusbhid_h=yes) - if test x$have_usb_h = xyes; then - CFLAGS="$CFLAGS -DHAVE_USB_H" - fi - if test x$have_usbhid_h = xyes; then - CFLAGS="$CFLAGS -DHAVE_USBHID_H" - fi - if test x$have_libusb_h = xyes; then - CFLAGS="$CFLAGS -DHAVE_LIBUSB_H" - fi - if test x$have_libusbhid_h = xyes; then - CFLAGS="$CFLAGS -DHAVE_LIBUSBHID_H" - fi + save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS $USB_CFLAGS" AC_MSG_CHECKING(for usbhid) have_usbhid=no @@ -1921,11 +1793,11 @@ CheckUSBHID() have_usbhid_ucr_data=yes ]) if test x$have_usbhid_ucr_data = xyes; then - CFLAGS="$CFLAGS -DUSBHID_UCR_DATA" + USB_CFLAGS="$USB_CFLAGS -DUSBHID_UCR_DATA" fi AC_MSG_RESULT($have_usbhid_ucr_data) - AC_MSG_CHECKING(for new usbhid API) + AC_MSG_CHECKING(for new usbhid API) have_usbhid_new=no AC_TRY_COMPILE([ #include @@ -1939,648 +1811,219 @@ CheckUSBHID() #elif defined(HAVE_LIBUSB_H) #include #elif defined(HAVE_LIBUSBHID_H) - #include - #endif - ],[ - report_desc_t d; - hid_start_parse(d, 1, 1); - ],[ - have_usbhid_new=yes - ]) - if test x$have_usbhid_new = xyes; then - CFLAGS="$CFLAGS -DUSBHID_NEW" - fi - AC_MSG_RESULT($have_usbhid_new) - - JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS bsd" - JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS bsd/libjoystick_bsd.la" - fi - fi -} - -dnl Check for altivec instruction support using gas syntax -CheckAltivec() -{ - have_altivec_h_hdr=no - AC_CHECK_HEADER(altivec.h, have_altivec_h_hdr=yes) - - save_CFLAGS="${CFLAGS}" - have_gcc_altivec=no - AC_MSG_CHECKING(for Altivec with GCC -maltivec option) - CFLAGS="${save_CFLAGS} -DGCC_ALTIVEC -DUSE_ALTIVEC_BLITTERS -maltivec" - - if test x$have_altivec_h_hdr = xyes; then - AC_TRY_COMPILE([ - #include - vector unsigned int vzero() { - return vec_splat_u32(0); - } - ],[ - ],[ - have_gcc_altivec=yes - ]) - AC_MSG_RESULT($have_gcc_altivec) - else - AC_TRY_COMPILE([ - vector unsigned int vzero() { - return vec_splat_u32(0); - } - ],[ - ],[ - have_gcc_altivec=yes - ]) - AC_MSG_RESULT($have_gcc_altivec) - fi - - if test x$have_gcc_altivec = xno; then - AC_MSG_CHECKING(for Altivec with GCC -faltivec option) - CFLAGS="${save_CFLAGS} -DGCC_ALTIVEC -DUSE_ALTIVEC_BLITTERS -faltivec" - if test x$have_altivec_h_hdr = xyes; then - AC_TRY_COMPILE([ - #include - vector unsigned int vzero() { - return vec_splat_u32(0); - } - ],[ - ],[ - have_gcc_altivec=yes - ]) - AC_MSG_RESULT($have_gcc_altivec) - else - AC_TRY_COMPILE([ - vector unsigned int vzero() { - return vec_splat_u32(0); - } - ],[ - ],[ - have_gcc_altivec=yes - ]) - AC_MSG_RESULT($have_gcc_altivec) - fi - fi - - if test x$have_gcc_altivec = xno; then - CFLAGS="${save_CFLAGS}" - else - if test x$have_altivec_h_hdr = xyes; then - CFLAGS="${CFLAGS} -DHAVE_ALTIVEC_H" - fi - fi -} - -dnl Check for a valid linux/version.h -CheckLinuxVersion() -{ - AC_CHECK_HEADER(linux/version.h, have_linux_version_h=yes) - if test x$have_linux_version_h = xyes; then - CFLAGS="$CFLAGS -DHAVE_LINUX_VERSION_H" - fi -} - -dnl Check if we want to use RPATH -CheckRPATH() -{ - AC_ARG_ENABLE(rpath, -[ --enable-rpath use an rpath when linking SDL [default=yes]], - , enable_rpath=yes) -} - -have_loadso=no -case "$target" in - arm-*-elf*) - ARCH=linux - CheckDummyVideo - CheckIPod - # Set up files for the timer library - if test x$enable_timers = xyes; then - COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c) - fi - ;; - *-*-linux*|*-*-gnu*|*-*-k*bsd*-gnu) - case "$target" in - *-*-linux*) ARCH=linux ;; - *-*-kfreebsd*-gnu) ARCH=kfreebsd-gnu ;; - *-*-knetbsd*-gnu) ARCH=knetbsd-gnu ;; - *-*-kopenbsd*-gnu) ARCH=kopenbsd-gnu ;; - *-*-gnu*) ARCH=gnu ;; # must be last - esac - CheckDummyVideo - CheckDiskAudio - CheckDLOPEN - CheckNASM - CheckOSS - CheckALSA - CheckARTSC - CheckESD - CheckNAS - CheckX11 - CheckNANOX - CheckFBCON - CheckDirectFB - CheckPS2GS - CheckGGI - CheckSVGA - CheckAAlib - CheckQtopia - CheckPicoGUI - CheckOpenGLX11 - CheckInputEvents - CheckTslib - CheckPTHREAD - CheckSIGACTION - CheckAltivec - CheckLinuxVersion - CheckRPATH - - # Set up files for the main() stub - if test "x$video_qtopia" = "xyes"; then - SDL_CFLAGS="$SDL_CFLAGS -Dmain=SDL_main" - SDL_LIBS="-lSDLmain $SDL_LIBS" - fi - # Set up files for the audio library - # We use the OSS and ALSA API's, not the Sun audio API - #if test x$enable_audio = xyes; then - # CFLAGS="$CFLAGS -DSUNAUDIO_SUPPORT" - # AUDIO_SUBDIRS="$AUDIO_SUBDIRS sun" - # AUDIO_DRIVERS="$AUDIO_DRIVERS sun/libaudio_sun.la" - #fi - # Set up files for the joystick library - if test x$enable_joystick = xyes; then - case $ARCH in - linux) - JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS linux" - JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS linux/libjoystick_linux.la" - ;; - gnu) - JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS dummy" - JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS dummy/libjoystick_dummy.la" - ;; - k*bsd-gnu) - JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS bsd" - JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS bsd/libjoystick_bsd.la" - ;; - esac - fi - # Set up files for the cdrom library - if test x$enable_cdrom = xyes; then - case $ARCH in - linux) - CDROM_SUBDIRS="$CDROM_SUBDIRS linux" - CDROM_DRIVERS="$CDROM_DRIVERS linux/libcdrom_linux.la" - ;; - gnu) - CDROM_SUBDIRS="$CDROM_SUBDIRS dummy" - CDROM_DRIVERS="$CDROM_DRIVERS dummy/libcdrom_dummy.la" - ;; - kfreebsd-gnu) - CDROM_SUBDIRS="$CDROM_SUBDIRS freebsd" - CDROM_DRIVERS="$CDROM_DRIVERS freebsd/libcdrom_freebsd.la" - ;; - knetbsd-gnu|kopenbsd-gnu) - CDROM_SUBDIRS="$CDROM_SUBDIRS openbsd" - CDROM_DRIVERS="$CDROM_DRIVERS openbsd/libcdrom_openbsd.la" - ;; - esac - fi - # Set up files for the thread library - if test x$enable_threads = xyes; then - CopyUnixThreadSource - fi - # Set up files for the timer library - if test x$enable_timers = xyes; then - COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c) - fi - ;; - *-*-bsdi*) - ARCH=bsdi - CheckDummyVideo - CheckDiskAudio - CheckDLOPEN - CheckNASM - CheckOSS - CheckARTSC - CheckESD - CheckNAS - CheckX11 - CheckSVGA - CheckAAlib - CheckOpenGLX11 - CheckPTHREAD - CheckSIGACTION - CheckRPATH - # Set up files for the audio library - # We use the OSS and ALSA API's, not the Sun audio API - #if test x$enable_audio = xyes; then - # CFLAGS="$CFLAGS -DSUNAUDIO_SUPPORT" - # AUDIO_SUBDIRS="$AUDIO_SUBDIRS sun" - # AUDIO_DRIVERS="$AUDIO_DRIVERS sun/libaudio_sun.la" - #fi - # Set up files for the joystick library - # (No joystick support yet) - if test x$enable_joystick = xyes; then - JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS dummy" - JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS dummy/libjoystick_dummy.la" - fi - # Set up files for the cdrom library - if test x$enable_cdrom = xyes; then - CDROM_SUBDIRS="$CDROM_SUBDIRS bsdi" - CDROM_DRIVERS="$CDROM_DRIVERS bsdi/libcdrom_bsdi.la" - fi - # Set up files for the thread library - if test x$enable_threads = xyes; then - CopyUnixThreadSource - fi - # Set up files for the timer library - if test x$enable_timers = xyes; then - COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c) - fi - ;; - *-*-freebsd*) - ARCH=freebsd - CheckDummyVideo - CheckDiskAudio - CheckDLOPEN - CheckVGL - CheckNASM - CheckOSS - CheckARTSC - CheckESD - CheckNAS - CheckX11 - CheckSVGA - CheckAAlib - CheckOpenGLX11 - CheckPTHREAD - CheckSIGACTION - CheckUSBHID - CheckRPATH - # Set up files for the audio library - # We use the OSS and ALSA API's, not the Sun audio API - #if test x$enable_audio = xyes; then - # CFLAGS="$CFLAGS -DSUNAUDIO_SUPPORT" - # AUDIO_SUBDIRS="$AUDIO_SUBDIRS sun" - # AUDIO_DRIVERS="$AUDIO_DRIVERS sun/libaudio_sun.la" - #fi - # Set up files for the cdrom library - if test x$enable_cdrom = xyes; then - CDROM_SUBDIRS="$CDROM_SUBDIRS freebsd" - CDROM_DRIVERS="$CDROM_DRIVERS freebsd/libcdrom_freebsd.la" - fi - # Set up files for the thread library - if test x$enable_threads = xyes; then - CopyUnixThreadSource - fi - # Set up files for the timer library - if test x$enable_timers = xyes; then - COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c) - fi - ;; - *-*-netbsd*) - ARCH=netbsd - CheckDummyVideo - CheckDiskAudio - CheckDLOPEN - CheckNASM - CheckOSS - CheckARTSC - CheckESD - CheckNAS - CheckX11 - CheckAAlib - CheckWscons - CheckOpenGLX11 - CheckPTHREAD - CheckSIGACTION - CheckUSBHID - CheckRPATH - # Set up files for the audio library - if test x$enable_audio = xyes; then - CFLAGS="$CFLAGS -DSUNAUDIO_SUPPORT" - AUDIO_SUBDIRS="$AUDIO_SUBDIRS sun" - AUDIO_DRIVERS="$AUDIO_DRIVERS sun/libaudio_sun.la" - fi - # Set up files for the cdrom library - if test x$enable_cdrom = xyes; then - CDROM_SUBDIRS="$CDROM_SUBDIRS openbsd" - CDROM_DRIVERS="$CDROM_DRIVERS openbsd/libcdrom_openbsd.la" - fi - # Set up files for the thread library - if test x$enable_threads = xyes; then - if test x$use_pthreads = xyes; then - CFLAGS="$CFLAGS -D_POSIX_THREAD_SYSCALL_SOFT=1" - fi - CopyUnixThreadSource - fi - # Set up files for the timer library - if test x$enable_timers = xyes; then - COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c) - fi - # NetBSD does not define "unix" - CFLAGS="$CFLAGS -Dunix" - ;; - *-*-openbsd*) - ARCH=openbsd - CheckDummyVideo - CheckDiskAudio - CheckDLOPEN - CheckNASM - CheckOSS - CheckARTSC - CheckESD - CheckNAS - CheckX11 - CheckAAlib - CheckOpenGLX11 - CheckPTHREAD - CheckSIGACTION - CheckUSBHID - CheckRPATH - # Set up files for the audio library - if test x$enable_audio = xyes; then - CFLAGS="$CFLAGS -DOPENBSD_AUDIO_SUPPORT" - AUDIO_SUBDIRS="$AUDIO_SUBDIRS openbsd" - AUDIO_DRIVERS="$AUDIO_DRIVERS openbsd/libaudio_openbsd.la" - fi - # OpenBSD needs linking with ossaudio emulation library - if test x$have_oss = xyes; then - SYSTEM_LIBS="$SYSTEM_LIBS -lossaudio" - fi - # Set up files for the cdrom library - if test x$enable_cdrom = xyes; then - CDROM_SUBDIRS="$CDROM_SUBDIRS openbsd" - CDROM_DRIVERS="$CDROM_DRIVERS openbsd/libcdrom_openbsd.la" - fi - # Set up files for the thread library - if test x$enable_threads = xyes; then - CopyUnixThreadSource - fi - # Set up files for the timer library - if test x$enable_timers = xyes; then - COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c) - fi - # OpenBSD does not define "unix" - CFLAGS="$CFLAGS -Dunix" - ;; - *-*-sysv5*) - ARCH=sysv5 - CheckDummyVideo - CheckDiskAudio - CheckDLOPEN - CheckNASM - CheckOSS - CheckARTSC - CheckESD - CheckNAS - CheckX11 - CheckAAlib - CheckOpenGLX11 - CheckPTHREAD - CheckSIGACTION - CheckRPATH - # Set up files for the audio library - if test x$enable_audio = xyes; then - CFLAGS="$CFLAGS -DSUNAUDIO_SUPPORT" - AUDIO_SUBDIRS="$AUDIO_SUBDIRS sun" - AUDIO_DRIVERS="$AUDIO_DRIVERS sun/libaudio_sun.la" - fi - # Set up files for the joystick library - # (No joystick support yet) - if test x$enable_joystick = xyes; then - JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS dummy" - JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS dummy/libjoystick_dummy.la" - fi - # Set up files for the cdrom library - if test x$enable_cdrom = xyes; then - CDROM_SUBDIRS="$CDROM_SUBDIRS dummy" - CDROM_DRIVERS="$CDROM_DRIVERS dummy/libcdrom_dummy.la" + #include + #endif + ],[ + report_desc_t d; + hid_start_parse(d, 1, 1); + ],[ + have_usbhid_new=yes + ]) + if test x$have_usbhid_new = xyes; then + USB_CFLAGS="$USB_CFLAGS -DUSBHID_NEW" + fi + AC_MSG_RESULT($have_usbhid_new) + + AC_DEFINE(SDL_JOYSTICK_USBHID) + SOURCES="$SOURCES $srcdir/src/joystick/bsd/*.c" + BUILD_CFLAGS="$BUILD_CFLAGS $USB_CFLAGS" + BUILD_LIBS="$BUILD_CFLAGS $USB_LIBS" + have_joystick=yes fi - # Set up files for the thread library - if test x$enable_threads = xyes; then - CopyUnixThreadSource + CFLAGS="$save_CFLAGS" + fi +} + +dnl Check for clock_gettime() +CheckClockGettime() +{ + AC_ARG_ENABLE(clock_gettime, +AC_HELP_STRING([--enable-clock_gettime], [use clock_gettime() instead of gettimeofday() on UNIX [default=no]]), + , enable_clock_gettime=no) + if test x$enable_clock_gettime = xyes; then + AC_CHECK_LIB(rt, clock_gettime, have_clock_gettime=yes) + if test x$have_clock_gettime = xyes; then + AC_DEFINE(HAVE_CLOCK_GETTIME) + BUILD_LIBS="$BUILD_LIBS -lrt" fi + fi +} + +dnl Check for a valid linux/version.h +CheckLinuxVersion() +{ + AC_CHECK_HEADER(linux/version.h, have_linux_version_h=yes) + if test x$have_linux_version_h = xyes; then + BUILD_CFLAGS="$BUILD_CFLAGS -DHAVE_LINUX_VERSION_H" + fi +} + +dnl Check if we want to use RPATH +CheckRPATH() +{ + AC_ARG_ENABLE(rpath, +AC_HELP_STRING([--enable-rpath], [use an rpath when linking SDL [default=yes]]), + , enable_rpath=yes) +} + +dnl Set up the configuration based on the target platform! +case "$target" in + arm-*-elf*) # FIXME: Can we get more specific for iPodLinux? + ARCH=linux + CheckDummyVideo + CheckIPod # Set up files for the timer library if test x$enable_timers = xyes; then - COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c) + AC_DEFINE(SDL_TIMER_UNIX) + SOURCES="$SOURCES $srcdir/src/timer/unix/*.c" + have_timers=yes fi ;; - *-*-solaris*) - ARCH=solaris - CFLAGS="$CFLAGS -D__ELF__" # Fix for nasm on Solaris x86 + *-*-linux*|*-*-gnu*|*-*-k*bsd*-gnu|*-*-bsdi*|*-*-freebsd*|*-*-netbsd*|*-*-openbsd*|*-*-sysv5*|*-*-solaris*|*-*-hpux*|*-*-irix*|*-*-aix*|*-*-osf*) + case "$target" in + *-*-linux*) ARCH=linux ;; + *-*-kfreebsd*-gnu) ARCH=kfreebsd-gnu ;; + *-*-knetbsd*-gnu) ARCH=knetbsd-gnu ;; + *-*-kopenbsd*-gnu) ARCH=kopenbsd-gnu ;; + *-*-gnu*) ARCH=gnu ;; # must be last of the gnu variants + *-*-bsdi*) ARCH=bsdi ;; + *-*-freebsd*) ARCH=freebsd ;; + *-*-netbsd*) ARCH=netbsd ;; + *-*-openbsd*) ARCH=openbsd ;; + *-*-sysv5*) ARCH=sysv5 ;; + *-*-solaris*) ARCH=solaris ;; + *-*-hpux*) ARCH=hpux ;; + *-*-irix*) ARCH=irix ;; + *-*-aix*) ARCH=aix ;; + *-*-osf*) ARCH=osf ;; + esac CheckDummyVideo CheckDiskAudio CheckDLOPEN CheckNASM + CheckAltivec CheckOSS - CheckARTSC - CheckESD - CheckNAS - CheckX11 - CheckAAlib - CheckOpenGLX11 - CheckPTHREAD - CheckSIGACTION - CheckRPATH - # Set up files for the audio library - if test x$enable_audio = xyes; then - CFLAGS="$CFLAGS -DSUNAUDIO_SUPPORT" - AUDIO_SUBDIRS="$AUDIO_SUBDIRS sun" - AUDIO_DRIVERS="$AUDIO_DRIVERS sun/libaudio_sun.la" - fi - # Set up files for the joystick library - # (No joystick support yet) - if test x$enable_joystick = xyes; then - JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS dummy" - JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS dummy/libjoystick_dummy.la" - fi - # Set up files for the cdrom library - if test x$enable_cdrom = xyes; then - CDROM_SUBDIRS="$CDROM_SUBDIRS linux" - CDROM_DRIVERS="$CDROM_DRIVERS linux/libcdrom_linux.la" - fi - # Set up files for the thread library - if test x$enable_threads = xyes; then - CopyUnixThreadSource - fi - # Set up files for the timer library - if test x$enable_timers = xyes; then - COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c) - fi - ;; - *-*-irix*) - ARCH=irix - CheckDummyVideo - CheckDiskAudio - CheckDLOPEN CheckDMEDIA + CheckALSA + CheckARTSC CheckESD CheckNAS CheckX11 - CheckAAlib - CheckOpenGLX11 - CheckPTHREAD - CheckSIGACTION - # We use the dmedia audio API, not the Sun audio API - #if test x$enable_audio = xyes; then - # CFLAGS="$CFLAGS -DSUNAUDIO_SUPPORT" - # AUDIO_SUBDIRS="$AUDIO_SUBDIRS sun" - # AUDIO_DRIVERS="$AUDIO_DRIVERS sun/libaudio_sun.la" - #fi - # Set up files for the joystick library - # (No joystick support yet) - if test x$enable_joystick = xyes; then - JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS dummy" - JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS dummy/libjoystick_dummy.la" - fi - # Set up files for the cdrom library - # (No CD-ROM support yet) - if test x$enable_cdrom = xyes; then - CDROM_SUBDIRS="$CDROM_SUBDIRS dummy" - CDROM_DRIVERS="$CDROM_DRIVERS dummy/libcdrom_dummy.la" - fi - # Set up files for the thread library - if test x$enable_threads = xyes; then - if test x$use_pthreads = xyes -o x$use_pth = xyes; then - CopyUnixThreadSource - else - COPY_ARCH_SRC(src/thread, irix, SDL_systhread.c) - COPY_ARCH_SRC(src/thread, irix, SDL_systhread_c.h) - COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex.c) - COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex_c.h) - COPY_ARCH_SRC(src/thread, linux, SDL_syssem.c) - COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h) - COPY_ARCH_SRC(src/thread, generic, SDL_syscond.c) - COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h) - fi - fi - # Set up files for the timer library - if test x$enable_timers = xyes; then - COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c) - fi - ;; - *-*-hpux*) - ARCH=hpux - CheckDummyVideo - CheckDiskAudio - CheckDLOPEN - CheckOSS - CheckNAS - CheckX11 - CheckGGI - CheckAAlib - CheckOpenGLX11 - CheckPTHREAD - CheckSIGACTION - # Set up files for the audio library - if test x$enable_audio = xyes; then - CFLAGS="$CFLAGS -DSUNAUDIO_SUPPORT" - AUDIO_SUBDIRS="$AUDIO_SUBDIRS sun" - AUDIO_DRIVERS="$AUDIO_DRIVERS sun/libaudio_sun.la" - fi - # Set up files for the joystick library - # (No joystick support yet) - if test x$enable_joystick = xyes; then - JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS dummy" - JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS dummy/libjoystick_dummy.la" - fi - # Set up files for the cdrom library - # (No CD-ROM support yet) - if test x$enable_cdrom = xyes; then - CDROM_SUBDIRS="$CDROM_SUBDIRS dummy" - CDROM_DRIVERS="$CDROM_DRIVERS dummy/libcdrom_dummy.la" - fi - # Set up files for the thread library - if test x$enable_threads = xyes; then - CopyUnixThreadSource - fi - # Set up files for the timer library - if test x$enable_timers = xyes; then - COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c) - fi - ;; - *-*-aix*) - ARCH=aix - CheckDummyVideo - CheckDiskAudio - CheckDLOPEN - CheckOSS - CheckNAS - CheckX11 - CheckGGI - CheckAAlib - CheckOpenGLX11 - CheckPTHREAD - CheckSIGACTION - # Set up files for the audio library - if test x$enable_audio = xyes; then - AUDIO_SUBDIRS="$AUDIO_SUBDIRS paudio" - AUDIO_DRIVERS="$AUDIO_DRIVERS paudio/libaudio_paudio.la" - fi - # Set up files for the joystick library - # (No joystick support yet) - if test x$enable_joystick = xyes; then - JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS dummy" - JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS dummy/libjoystick_dummy.la" - fi - # Set up files for the cdrom library - if test x$enable_cdrom = xyes; then - CDROM_SUBDIRS="$CDROM_SUBDIRS aix" - CDROM_DRIVERS="$CDROM_DRIVERS aix/libcdrom_aix.la" - fi - # Set up files for the thread library - if test x$enable_threads = xyes; then - CopyUnixThreadSource - fi - # Set up files for the timer library - if test x$enable_timers = xyes; then - COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c) - fi - ;; - *-*-osf*) - ARCH=osf - CheckDummyVideo - CheckDiskAudio - CheckDLOPEN - CheckNAS - CheckX11 + CheckNANOX + CheckFBCON + CheckDirectFB + CheckPS2GS CheckGGI + CheckSVGA + CheckVGL + CheckWscons CheckAAlib + CheckQtopia + CheckPicoGUI CheckOpenGLX11 + CheckInputEvents + CheckTslib + CheckUSBHID CheckPTHREAD - CheckSIGACTION + CheckClockGettime + CheckLinuxVersion + CheckRPATH # Set up files for the audio library if test x$enable_audio = xyes; then - CFLAGS="$CFLAGS -I/usr/include/mme -DMMEAUDIO_SUPPORT" - SYSTEM_LIBS="$SYSTEM_LIBS -lmme" - AUDIO_SUBDIRS="$AUDIO_SUBDIRS mme" - AUDIO_DRIVERS="$AUDIO_DRIVERS mme/libaudio_mme.la" + case $ARCH in + netbsd|sysv5|solaris|hpux) + AC_DEFINE(SDL_AUDIO_DRIVER_SUNAUDIO) + SOURCES="$SOURCES $srcdir/src/audio/sun/*.c" + have_audio=yes + ;; + openbsd) + AC_DEFINE(SDL_AUDIO_DRIVER_OPENBSD) + SOURCES="$SOURCES $srcdir/src/audio/openbsd/*.c" + have_audio=yes + ;; + aix) + AC_DEFINE(SDL_AUDIO_DRIVER_PAUD) + SOURCES="$SOURCES $srcdir/src/audio/paudio/*.c" + have_audio=yes + ;; + osf) + AC_DEFINE(SDL_AUDIO_DRIVER_MMEAUDIO) + SOURCES="$SOURCES $srcdir/src/audio/mme/*.c" + BUILD_LIBS="$BUILD_LIBS -lmme" + have_audio=yes + ;; + esac fi # Set up files for the joystick library - # (No joystick support yet) if test x$enable_joystick = xyes; then - JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS dummy" - JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS dummy/libjoystick_dummy.la" + case $ARCH in + linux) + AC_DEFINE(SDL_JOYSTICK_LINUX) + SOURCES="$SOURCES $srcdir/src/joystick/linux/*.c" + have_joystick=yes + ;; + esac fi # Set up files for the cdrom library - # (No cdrom support yet) if test x$enable_cdrom = xyes; then - CDROM_SUBDIRS="$CDROM_SUBDIRS osf" - CDROM_DRIVERS="$CDROM_DRIVERS osf/libcdrom_osf.la" + case $ARCH in + linux|solaris) + AC_DEFINE(SDL_CDROM_LINUX) + SOURCES="$SOURCES $srcdir/src/cdrom/linux/*.c" + have_cdrom=yes + ;; + *freebsd*) + AC_DEFINE(SDL_CDROM_FREEBSD) + SOURCES="$SOURCES $srcdir/src/cdrom/freebsd/*.c" + have_cdrom=yes + ;; + *netbsd*|*openbsd*) + AC_DEFINE(SDL_CDROM_OPENBSD) + SOURCES="$SOURCES $srcdir/src/cdrom/openbsd/*.c" + have_cdrom=yes + ;; + bsdi) + AC_DEFINE(SDL_CDROM_BSDI) + SOURCES="$SOURCES $srcdir/src/cdrom/bsdi/*.c" + have_cdrom=yes + ;; + aix) + AC_DEFINE(SDL_CDROM_AIX) + SOURCES="$SOURCES $srcdir/src/cdrom/aix/*.c" + have_cdrom=yes + ;; + osf) + AC_DEFINE(SDL_CDROM_OSF) + SOURCES="$SOURCES $srcdir/src/cdrom/osf/*.c" + have_cdrom=yes + ;; + esac fi # Set up files for the thread library - if test x$enable_threads = xyes; then - CopyUnixThreadSource + if test x$enable_threads = xyes -a x$use_pthreads != xyes -a x$use_pth != xyes -a x$ARCH = xirix; then + AC_DEFINE(SDL_THREAD_SPROC) + SOURCES="$SOURCES $srcdir/src/thread/irix/*.c" + SOURCES="$SOURCES $srcdir/src/thread/generic/SDL_sysmutex.c" + SOURCES="$SOURCES $srcdir/src/thread/generic/SDL_syscond.c" + have_threads=yes fi # Set up files for the timer library if test x$enable_timers = xyes; then - COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c) - fi - # FIXME: If building without -lX11, you get the following messages. - # Xlib: connection to ":0.0" refused by server - # Xlib: XDM authorization key matches an existing client! - # It only has to run xhost +localhost in a such case. - #if test x$enable_x11_shared = xyes; then - # SYSTEM_LIBS="$SYSTEM_LIBS -lX11" - #fi + AC_DEFINE(SDL_TIMER_UNIX) + SOURCES="$SOURCES $srcdir/src/timer/unix/*.c" + have_timers=yes + fi + # Do any final platform setup + case $ARCH in + netbsd) + # NetBSD does not define "unix" + BUILD_CFLAGS="$BUILD_CFLAGS -Dunix" + ;; + openbsd) + # OpenBSD does not define "unix" + BUILD_CFLAGS="$BUILD_CFLAGS -Dunix" + ;; + esac ;; *-*-qnx*) ARCH=qnx @@ -2593,37 +2036,28 @@ case "$target" in CheckX11 CheckOpenGLX11 CheckPTHREAD - CheckSIGACTION # Set up files for the audio library if test x$enable_audio = xyes; then - CFLAGS="$CFLAGS -DQNXNTOAUDIO_SUPPORT" - SYSTEM_LIBS="$SYSTEM_LIBS -lasound" - AUDIO_SUBDIRS="$AUDIO_SUBDIRS nto" - AUDIO_DRIVERS="$AUDIO_DRIVERS nto/libaudio_nto.la" - fi - # Set up files for the joystick library - if test x$enable_joystick = xyes; then - # (No joystick support yet) - JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS dummy" - JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS dummy/libjoystick_dummy.la" + AC_DEFINE(SDL_AUDIO_DRIVER_QNXNTO) + SOURCES="$SOURCES $srcdir/src/audio/nto/*.c" + BUILD_LIBS="$BUILD_LIBS -lasound" + have_audio=yes fi # Set up files for the cdrom library if test x$enable_cdrom = xyes; then - CDROM_SUBDIRS="$CDROM_SUBDIRS qnx" - CDROM_DRIVERS="$CDROM_DRIVERS qnx/libcdrom_qnx.la" - fi - # Set up files for the thread library - if test x$enable_threads = xyes; then - CopyUnixThreadSource + AC_DEFINE(SDL_CDROM_QNX) + SOURCES="$SOURCES $srcdir/src/cdrom/qnx/*.c" + have_cdrom=yes fi # Set up files for the timer library if test x$enable_timers = xyes; then - COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c) + AC_DEFINE(SDL_TIMER_UNIX) + SOURCES="$SOURCES $srcdir/src/timer/unix/*.c" + have_timers=yes fi ;; *-*-cygwin* | *-*-mingw32*) ARCH=win32 - have_loadso=yes if test "$build" != "$target"; then # cross-compiling # Default cross-compile location ac_default_prefix=/usr/local/cross-tools/i386-mingw32msvc @@ -2636,49 +2070,64 @@ case "$target" in CheckDummyVideo CheckDiskAudio CheckWIN32 + CheckWIN32GL CheckDIRECTX CheckNASM # Set up files for the audio library if test x$enable_audio = xyes; then - AUDIO_SUBDIRS="$AUDIO_SUBDIRS windib" - AUDIO_DRIVERS="$AUDIO_DRIVERS windib/libaudio_windib.la" - if test x$use_directx = xyes; then - AUDIO_SUBDIRS="$AUDIO_SUBDIRS windx5" - AUDIO_DRIVERS="$AUDIO_DRIVERS windx5/libaudio_windx5.la" + AC_DEFINE(SDL_AUDIO_DRIVER_WAVEOUT) + SOURCES="$SOURCES $srcdir/src/audio/windib/*.c" + if test x$have_directx = xyes; then + AC_DEFINE(SDL_AUDIO_DRIVER_DSOUND) + SOURCES="$SOURCES $srcdir/src/audio/windx5/*.c" fi + have_audio=yes fi # Set up files for the joystick library if test x$enable_joystick = xyes; then - JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS win32" - JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS win32/libjoystick_winmm.la" + AC_DEFINE(SDL_JOYSTICK_WINMM) + SOURCES="$SOURCES $srcdir/src/joystick/win32/*.c" + have_joystick=yes fi # Set up files for the cdrom library if test x$enable_cdrom = xyes; then - CDROM_SUBDIRS="$CDROM_SUBDIRS win32" - CDROM_DRIVERS="$CDROM_DRIVERS win32/libcdrom_win32.la" + AC_DEFINE(SDL_CDROM_WIN32) + SOURCES="$SOURCES $srcdir/src/cdrom/win32/*.c" + have_cdrom=yes fi # Set up files for the thread library if test x$enable_threads = xyes; then - COPY_ARCH_SRC(src/thread, win32, SDL_systhread.c) - COPY_ARCH_SRC(src/thread, win32, SDL_systhread_c.h) - COPY_ARCH_SRC(src/thread, win32, SDL_sysmutex.c) - COPY_ARCH_SRC(src/thread, generic, SDL_sysmutex_c.h) - COPY_ARCH_SRC(src/thread, win32, SDL_syssem.c) - COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h) - COPY_ARCH_SRC(src/thread, generic, SDL_syscond.c) - COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h) + AC_DEFINE(SDL_THREAD_WIN32) + SOURCES="$SOURCES $srcdir/src/thread/win32/SDL_sysmutex.c" + SOURCES="$SOURCES $srcdir/src/thread/win32/SDL_syssem.c" + SOURCES="$SOURCES $srcdir/src/thread/win32/SDL_systhread.c" + SOURCES="$SOURCES $srcdir/src/thread/generic/SDL_syscond.c" + have_threads=yes fi # Set up files for the timer library if test x$enable_timers = xyes; then - COPY_ARCH_SRC(src/timer, win32, SDL_systimer.c) + AC_DEFINE(SDL_TIMER_WIN32) + SOURCES="$SOURCES $srcdir/src/timer/win32/*.c" + have_timers=yes + fi + # Set up files for the shared object loading library + if test x$enable_loadso = xyes; then + AC_DEFINE(SDL_LOADSO_WIN32) + SOURCES="$SOURCES $srcdir/src/loadso/win32/*.c" + have_loadso=yes + fi + # Set up the system libraries we need + BUILD_LIBS="$BUILD_LIBS -luser32 -lgdi32 -lwinmm" + if test x$have_directx = xyes; then + BUILD_LIBS="$BUILD_LIBS -ldxguid" fi # The Win32 platform requires special setup SDL_CFLAGS="$SDL_CFLAGS -Dmain=SDL_main" case "$target" in *-*-cygwin*) - CFLAGS="$CFLAGS -I/usr/include/mingw -DWIN32 -Uunix -mno-cygwin" + BUILD_CFLAGS="$BUILD_CFLAGS -I/usr/include/mingw -DWIN32 -Uunix -mno-cygwin" SDL_CFLAGS="$SDL_CFLAGS -I/usr/include/mingw -DWIN32 -Uunix -mno-cygwin" - LIBS="$LIBS -mno-cygwin" + BUILD_LIBS="$BUILD_LIBS -mno-cygwin" SDL_LIBS="-lmingw32 -lSDLmain $SDL_LIBS -mwindows -mno-cygwin" ;; *-*-mingw32*) @@ -2689,7 +2138,6 @@ case "$target" in *-*-beos*) ARCH=beos ac_default_prefix=/boot/develop/tools/gnupro - have_loadso=yes CheckDummyVideo CheckDiskAudio CheckNASM @@ -2697,139 +2145,108 @@ case "$target" in CheckBeGL # Set up files for the audio library if test x$enable_audio = xyes; then - AUDIO_SUBDIRS="$AUDIO_SUBDIRS baudio" - AUDIO_DRIVERS="$AUDIO_DRIVERS baudio/libaudio_baudio.la" + AC_DEFINE(SDL_AUDIO_DRIVER_BAUDIO) + SOURCES="$SOURCES $srcdir/src/audio/baudio/*.cc" + have_audio=yes fi # Set up files for the joystick library if test x$enable_joystick = xyes; then - JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS beos" - JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS beos/libjoystick_beos.la" + AC_DEFINE(SDL_JOYSTICK_BEOS) + SOURCES="$SOURCES $srcdir/src/joystick/beos/*.cc" + have_joystick=yes fi # Set up files for the cdrom library if test x$enable_cdrom = xyes; then - CDROM_SUBDIRS="$CDROM_SUBDIRS beos" - CDROM_DRIVERS="$CDROM_DRIVERS beos/libcdrom_beos.la" + AC_DEFINE(SDL_CDROM_BEOS) + SOURCES="$SOURCES $srcdir/src/cdrom/beos/*.cc" + have_cdrom=yes fi # Set up files for the thread library if test x$enable_threads = xyes; then - COPY_ARCH_SRC(src/thread, beos, SDL_systhread.c) - COPY_ARCH_SRC(src/thread, beos, SDL_systhread_c.h) - COPY_ARCH_SRC(src/thread, generic, SDL_sysmutex.c) - COPY_ARCH_SRC(src/thread, generic, SDL_sysmutex_c.h) - COPY_ARCH_SRC(src/thread, beos, SDL_syssem.c) - COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h) - COPY_ARCH_SRC(src/thread, generic, SDL_syscond.c) - COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h) + AC_DEFINE(SDL_THREAD_BEOS) + SOURCES="$SOURCES $srcdir/src/thread/beos/*.c" + SOURCES="$SOURCES $srcdir/src/thread/generic/SDL_sysmutex.c" + SOURCES="$SOURCES $srcdir/src/thread/generic/SDL_syscond.c" + have_threads=yes fi # Set up files for the timer library if test x$enable_timers = xyes; then - COPY_ARCH_SRC(src/timer, beos, SDL_systimer.c) + AC_DEFINE(SDL_TIMER_BEOS) + SOURCES="$SOURCES $srcdir/src/timer/beos/*.c" + have_timers=yes + fi + # Set up files for the shared object loading library + if test x$enable_loadso = xyes; then + AC_DEFINE(SDL_LOADSO_BEOS) + SOURCES="$SOURCES $srcdir/src/loadso/beos/*.c" + have_loadso=yes fi # The BeOS platform requires special libraries - SYSTEM_LIBS="$SYSTEM_LIBS -lroot -lbe -lmedia -lgame -ldevice -ltextencoding" - ;; - *-*-macos*) - # This would be used if cross-compiling to MacOS 9. No way to - # use it at present, but Apple is working on a X-to-9 compiler - # for which this case would be handy. - ARCH=macos - have_loadso=yes - CheckDummyVideo - CheckDiskAudio - CheckTOOLBOX - CheckMacGL - # Set up files for the audio library - if test x$enable_audio = xyes; then - AUDIO_SUBDIRS="$AUDIO_SUBDIRS macrom" - AUDIO_DRIVERS="$AUDIO_DRIVERS macrom/libaudio_macrom.la" - fi - # Set up files for the joystick library - if test x$enable_joystick = xyes; then - JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS macos" - JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS macos/libjoystick_macos.la" - fi - # Set up files for the cdrom library - if test x$enable_cdrom = xyes; then - CDROM_SUBDIRS="$CDROM_SUBDIRS macos" - CDROM_DRIVERS="$CDROM_DRIVERS macos/libcdrom_macos.la" - fi - # Set up files for the thread library - if test x$enable_threads = xyes; then - COPY_ARCH_SRC(src/thread, macos, SDL_systhread.c) - COPY_ARCH_SRC(src/thread, macos, SDL_systhread_c.h) - COPY_ARCH_SRC(src/thread, generic, SDL_sysmutex.c) - COPY_ARCH_SRC(src/thread, generic, SDL_sysmutex_c.h) - COPY_ARCH_SRC(src/thread, macos, SDL_syssem.c) - COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h) - COPY_ARCH_SRC(src/thread, generic, SDL_syscond.c) - COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h) - fi - # Set up files for the timer library - if test x$enable_timers = xyes; then - COPY_ARCH_SRC(src/timer, macos, SDL_systimer.c) - fi - # The MacOS platform requires special setup - SDL_CFLAGS="$SDL_CFLAGS -Dmain=SDL_main" - SDL_LIBS="-lSDLmain $SDL_LIBS" + BUILD_LIBS="$BUILD_LIBS -lroot -lbe -lmedia -lgame -ldevice -ltextencoding" ;; *-*-darwin* ) # This could be either full "Mac OS X", or plain "Darwin" which is # just the OS X kernel sans upper layers like Carbon and Cocoa. # Next line is broken, and a few files below require Mac OS X (full) ARCH=macosx - have_loadso=yes CheckDummyVideo CheckDiskAudio + CheckDLOPEN CheckCOCOA CheckCARBON CheckX11 CheckMacGL CheckOpenGLX11 CheckPTHREAD - CheckSIGACTION CheckAltivec - # If either the audio or CD driver is used, add the AudioUnit framework - if test x$enable_audio = xyes -o x$enable_cdrom = xyes; then - SYSTEM_LIBS="$SYSTEM_LIBS -framework AudioToolbox -framework AudioUnit" - fi # Set up files for the audio library if test x$enable_audio = xyes; then - AUDIO_SUBDIRS="$AUDIO_SUBDIRS macosx" - AUDIO_DRIVERS="$AUDIO_DRIVERS macosx/libaudio_macosx.la" - AUDIO_SUBDIRS="$AUDIO_SUBDIRS macrom" - AUDIO_DRIVERS="$AUDIO_DRIVERS macrom/libaudio_macrom.la" + AC_DEFINE(SDL_AUDIO_DRIVER_COREAUDIO) + SOURCES="$SOURCES $srcdir/src/audio/macosx/*.c" + AC_DEFINE(SDL_AUDIO_DRIVER_SNDMGR) + SOURCES="$SOURCES $srcdir/src/audio/macrom/*.c" + have_audio=yes fi # Set up files for the joystick library if test x$enable_joystick = xyes; then - JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS darwin" - JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS darwin/libjoystick_darwin.la" - SYSTEM_LIBS="$SYSTEM_LIBS -framework IOKit" + AC_DEFINE(SDL_JOYSTICK_IOKIT) + SOURCES="$SOURCES $srcdir/src/joystick/darwin/*.c" + BUILD_LIBS="$BUILD_LIBS -framework IOKit" + have_joystick=yes fi # Set up files for the cdrom library if test x$enable_cdrom = xyes; then - CDROM_SUBDIRS="$CDROM_SUBDIRS macosx" - CDROM_DRIVERS="$CDROM_DRIVERS macosx/libcdrom_macosx.la" - fi - # Set up files for the thread library - if test x$enable_threads = xyes; then - CopyUnixThreadSource + AC_DEFINE(SDL_CDROM_MACOSX) + SOURCES="$SOURCES $srcdir/src/cdrom/macosx/*.c" + have_cdrom=yes fi # Set up files for the timer library if test x$enable_timers = xyes; then - COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c) + AC_DEFINE(SDL_TIMER_UNIX) + SOURCES="$SOURCES $srcdir/src/timer/unix/*.c" + have_timers=yes + fi + # Set up files for the shared object loading library + if test x$enable_loadso = xyes -a x$have_dlopen != xyes; then + AC_DEFINE(SDL_LOADSO_DLCOMPAT) + SOURCES="$SOURCES $srcdir/src/loadso/macosx/*.c" + have_loadso=yes fi # The MacOS X platform requires special setup. + AC_DEFINE(TARGET_API_MAC_CARBON) + BUILD_CFLAGS="$BUILD_CFLAGS -fpascal-strings -DMACOSX" SDL_LIBS="-lSDLmain $SDL_LIBS" if test x$enable_video_cocoa = xyes; then - SYSTEM_LIBS="$SYSTEM_LIBS -framework Cocoa" + BUILD_LIBS="$BUILD_LIBS -framework Cocoa" fi if test x$enable_video_carbon = xyes -o x$enable_video_cocoa = xyes; then # The Cocoa backend still needs Carbon, and the YUV code QuickTime - SYSTEM_LIBS="$SYSTEM_LIBS -framework Carbon -framework QuickTime" + BUILD_LIBS="$BUILD_LIBS -framework Carbon -framework QuickTime" + fi + # If either the audio or CD driver is used, add the AudioUnit framework + if test x$enable_audio = xyes -o x$enable_cdrom = xyes; then + BUILD_LIBS="$BUILD_LIBS -framework AudioToolbox -framework AudioUnit" fi - #if test x$enable_video_carbon = xyes; then - # SYSTEM_LIBS="$SYSTEM_LIBS -framework DrawSprocket" - #fi ;; *-*-mint*) ARCH=mint @@ -2840,123 +2257,110 @@ case "$target" in CheckAtariGemVideo CheckAtariAudio CheckAtariLdg - CheckAtariOSMesa + CheckAtariOSMesa CheckPTH # Set up files for the audio library if test x$enable_threads = xyes -a x$enable_pth = xyes; then if test x$enable_audio = xyes; then - CFLAGS="$CFLAGS -DSUNAUDIO_SUPPORT" - AUDIO_SUBDIRS="$AUDIO_SUBDIRS sun" - AUDIO_DRIVERS="$AUDIO_DRIVERS sun/libaudio_sun.la" + AC_DEFINE(SDL_AUDIO_DRIVER_SUNAUDIO) + SOURCES="$SOURCES $srcdir/src/audio/sun/*.c" + have_audio=yes fi fi # Set up files for the joystick library if test x$enable_joystick = xyes; then - JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS mint" - JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS mint/libjoystick_mint.la" + AC_DEFINE(SDL_JOYSTICK_MINT) + SOURCES="$SOURCES $srcdir/src/joystick/mint/*.c" + have_joystick=yes fi # Set up files for the cdrom library if test x$enable_cdrom = xyes; then - CDROM_SUBDIRS="$CDROM_SUBDIRS mint" - CDROM_DRIVERS="$CDROM_DRIVERS mint/libcdrom_mint.la" - fi - # Set up files for the thread library - if test x$enable_threads = xyes; then - CopyUnixThreadSource + AC_DEFINE(SDL_CDROM_MINT) + SOURCES="$SOURCES $srcdir/src/cdrom/mint/*.c" + have_cdrom=yes fi # Set up files for the timer library if test x$enable_timers = xyes; then if test x$enable_threads = xyes -a x$enable_pth = xyes; then - COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c) + AC_DEFINE(SDL_TIMER_UNIX) + SOURCES="$SOURCES $srcdir/src/timer/unix/*.c" else - COPY_ARCH_SRC(src/timer, mint, SDL_systimer.c) + AC_DEFINE(SDL_TIMER_MINT) + SOURCES="$SOURCES $srcdir/src/timer/mint/*.c" fi + have_timers=yes fi # MiNT does not define "unix" - CFLAGS="$CFLAGS -Dunix" + BUILD_CFLAGS="$BUILD_CFLAGS -Dunix" ;; *-riscos) ARCH=riscos + CheckOSS + CheckPTHREAD # Set up files for the video library if test x$enable_video = xyes; then - VIDEO_SUBDIRS="$VIDEO_SUBDIRS riscos" - VIDEO_DRIVERS="$VIDEO_DRIVERS riscos/libvideo_riscos.la" - fi - # Set up files for the audio library - if test x$enable_audio = xyes; then - CFLAGS="$CFLAGS -DOSS_SUPPORT" - AUDIO_SUBDIRS="$AUDIO_SUBDIRS dsp" - AUDIO_DRIVERS="$AUDIO_DRIVERS dsp/libaudio_dsp.la" - AUDIO_SUBDIRS="$AUDIO_SUBDIRS dma" - AUDIO_DRIVERS="$AUDIO_DRIVERS dma/libaudio_dma.la" + AC_DEFINE(SDL_VIDEO_DRIVER_RISCOS) + SOURCES="$SOURCES $srcdir/src/video/riscos/*.c" + have_video=yes fi # Set up files for the joystick library if test x$enable_joystick = xyes; then - JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS riscos" - JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS riscos/libjoystick_riscos.la" - fi - # Set up files for the cdrom library - if test x$enable_cdrom = xyes; then - CDROM_SUBDIRS="$CDROM_SUBDIRS dummy" - CDROM_DRIVERS="$CDROM_DRIVERS dummy/libcdrom_dummy.la" - fi - # Set up files for the thread library - if test x$enable_threads = xyes; then - COPY_ARCH_SRC(src/thread, riscos, SDL_systhread.c) - COPY_ARCH_SRC(src/thread, riscos, SDL_systhread_c.h) - COPY_ARCH_SRC(src/thread, riscos, SDL_sysmutex.c) - COPY_ARCH_SRC(src/thread, riscos, SDL_sysmutex_c.h) - COPY_ARCH_SRC(src/thread, riscos, SDL_syssem.c) - COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h) - COPY_ARCH_SRC(src/thread, riscos, SDL_syscond.c) - COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h) - else - CFLAGS="$CFLAGS -DDISABLE_THREADS" + AC_DEFINE(SDL_JOYSTICK_RISCOS) + SOURCES="$SOURCES $srcdir/src/joystick/riscos/*.c" + have_joystick=yes fi # Set up files for the timer library if test x$enable_timers = xyes; then - COPY_ARCH_SRC(src/timer, riscos, SDL_systimer.c) + AC_DEFINE(SDL_TIMER_RISCOS) + SOURCES="$SOURCES $srcdir/src/timer/riscos/*.c" + have_timers=yes fi - - CFLAGS="$CFLAGS -DENABLE_RISCOS" - - SYSTEM_LIBS="$SYSTEM_LIBS -ljpeg -ltiff -lpng -lz" + # The RISC OS platform requires special setup. + BUILD_LIBS="$BUILD_LIBS -ljpeg -ltiff -lpng -lz" ;; *) - AC_MSG_ERROR(Unsupported target: Please add to configure.in) + AC_MSG_ERROR([ +*** Unsupported target: Please add to configure.in + ]) ;; esac -AC_SUBST(ARCH) - -# Set the conditional variables for this target -AM_CONDITIONAL(TARGET_LINUX, test $ARCH = linux) -AM_CONDITIONAL(TARGET_QTOPIA, test "x$video_qtopia" = "xyes") -AM_CONDITIONAL(TARGET_SOLARIS, test $ARCH = solaris) -AM_CONDITIONAL(TARGET_IRIX, test $ARCH = irix) -AM_CONDITIONAL(TARGET_BSDI, test $ARCH = bsdi) -AM_CONDITIONAL(TARGET_FREEBSD, test $ARCH = freebsd) -AM_CONDITIONAL(TARGET_NETBSD, test $ARCH = netbsd) -AM_CONDITIONAL(TARGET_OPENBSD, test $ARCH = openbsd) -AM_CONDITIONAL(TARGET_AIX, test $ARCH = aix) -AM_CONDITIONAL(TARGET_WIN32, test $ARCH = win32) -AM_CONDITIONAL(TARGET_BEOS, test $ARCH = beos) -AM_CONDITIONAL(TARGET_MACOS, test $ARCH = macos) -AM_CONDITIONAL(TARGET_MACOSX, test $ARCH = macosx) -AM_CONDITIONAL(TARGET_QNX, test $ARCH = qnx) -AM_CONDITIONAL(TARGET_MINT, test $ARCH = mint) -AM_CONDITIONAL(TARGET_IPOD, test x$enable_ipod = xyes) - -# More automake conditionals -AM_CONDITIONAL(USE_DIRECTX, test x$use_directx = xyes) -AM_CONDITIONAL(USE_CLONE, test x$use_clone = xyes) -AM_CONDITIONAL(HAVE_NASM, test x$use_nasm = xyes) -AM_CONDITIONAL(USE_COCOA, test x$enable_video_cocoa = xyes) -AM_CONDITIONAL(USE_CARBON, test x$enable_video_carbon = xyes) - -# Set conditional variables for shared and static library selection. -# These are not used in any Makefile.am but in sdl-config.in. -AM_CONDITIONAL([ENABLE_SHARED], [test "$enable_shared" = yes]) -AM_CONDITIONAL([ENABLE_STATIC], [test "$enable_static" = yes]) + +# Verify that we have all the platform specific files we need +if test x$have_joystick != xyes; then + if test x$enable_joystick = xyes; then + AC_DEFINE(SDL_JOYSTICK_DISABLED) + fi + SOURCES="$SOURCES $srcdir/src/joystick/dummy/*.c" +fi +if test x$have_cdrom != xyes; then + if test x$enable_cdrom = xyes; then + AC_DEFINE(SDL_CDROM_DISABLED) + fi + SOURCES="$SOURCES $srcdir/src/cdrom/dummy/*.c" +fi +if test x$have_threads != xyes; then + if test x$enable_threads = xyes; then + AC_DEFINE(SDL_THREADS_DISABLED) + fi + SOURCES="$SOURCES $srcdir/src/thread/generic/*.c" +fi +if test x$have_timers != xyes; then + if test x$enable_timers = xyes; then + AC_DEFINE(SDL_TIMERS_DISABLED) + fi + SOURCES="$SOURCES $srcdir/src/timer/dummy/*.c" +fi +if test x$have_loadso != xyes; then + if test x$enable_loadso = xyes; then + AC_DEFINE(SDL_LOADSO_DISABLED) + fi + SOURCES="$SOURCES $srcdir/src/loadso/dummy/*.c" +fi + +OBJECTS=`echo $SOURCES | sed 's,[[^ ]]*/\([[^ ]]*\)\.asm,$(objects)/\1.lo,g'` +OBJECTS=`echo $OBJECTS | sed 's,[[^ ]]*/\([[^ ]]*\)\.cc,$(objects)/\1.lo,g'` +OBJECTS=`echo $OBJECTS | sed 's,[[^ ]]*/\([[^ ]]*\)\.m,$(objects)/\1.lo,g'` +OBJECTS=`echo $OBJECTS | sed 's,[[^ ]]*/\([[^ ]]*\)\.c,$(objects)/\1.lo,g'` # Set runtime shared library paths as needed @@ -3005,181 +2409,48 @@ case "$ARCH" in ;; esac - STATIC_SYSTEM_LIBS="$SYSTEM_LIBS" -dnl Output the video drivers we use -if test x$enable_video = xtrue; then - if test "$VIDEO_SUBDIRS" = ""; then - AC_MSG_ERROR(*** No video drivers are enabled!) - fi -fi -AC_SUBST(AUDIO_SUBDIRS) -AC_SUBST(AUDIO_DRIVERS) -AC_SUBST(VIDEO_SUBDIRS) -AC_SUBST(VIDEO_DRIVERS) -AC_SUBST(JOYSTICK_SUBDIRS) -AC_SUBST(JOYSTICK_DRIVERS) -AC_SUBST(CDROM_SUBDIRS) -AC_SUBST(CDROM_DRIVERS) -AC_SUBST(SDL_EXTRADIRS) -AC_SUBST(SDL_EXTRALIBS) - dnl Expand the cflags and libraries needed by apps using SDL AC_SUBST(SDL_CFLAGS) AC_SUBST(SDL_LIBS) AC_SUBST(SDL_STATIC_LIBS) AC_SUBST(SDL_RLD_FLAGS) +if test x$enable_shared = xyes; then + ENABLE_SHARED_TRUE= + ENABLE_SHARED_FALSE="#" +else + ENABLE_SHARED_TRUE="#" + ENABLE_SHARED_FALSE= +fi +if test x$enable_static = xyes; then + ENABLE_STATIC_TRUE= + ENABLE_STATIC_FALSE="#" +else + ENABLE_STATIC_TRUE="#" + ENABLE_STATIC_FALSE= +fi +AC_SUBST(ENABLE_SHARED_TRUE) +AC_SUBST(ENABLE_SHARED_FALSE) +AC_SUBST(ENABLE_STATIC_TRUE) +AC_SUBST(ENABLE_STATIC_FALSE) dnl Expand the libraries needed for static and dynamic linking AC_SUBST(STATIC_SYSTEM_LIBS) AC_SUBST(SHARED_SYSTEM_LIBS) AC_SUBST(SYSTEM_LIBS) -dnl Expand the include directories for building SDL -CFLAGS="$CFLAGS -I\$(top_srcdir)/include" -CFLAGS="$CFLAGS -I\$(top_srcdir)/include/SDL" -CFLAGS="$CFLAGS -I\$(top_srcdir)/src -I\$(top_srcdir)/src/main/$ARCH" -CFLAGS="$CFLAGS -I\$(top_srcdir)/src/audio" -CFLAGS="$CFLAGS -I\$(top_srcdir)/src/video" -CFLAGS="$CFLAGS -I\$(top_srcdir)/src/video/Xext/extensions" -CFLAGS="$CFLAGS -I\$(top_srcdir)/src/events" -CFLAGS="$CFLAGS -I\$(top_srcdir)/src/joystick" -CFLAGS="$CFLAGS -I\$(top_srcdir)/src/cdrom" -CFLAGS="$CFLAGS -I\$(top_srcdir)/src/thread" -CFLAGS="$CFLAGS -I\$(top_srcdir)/src/timer" -CFLAGS="$CFLAGS -I\$(top_srcdir)/src/file" -CFLAGS="$CFLAGS -I\$(top_builddir)/src/thread" -CXXFLAGS="$CFLAGS" - - -# Check for darwin at the very end and set up the Objective C compiler -# We do this here so that we get the full CFLAGS into OBJCFLAGS -case "$target" in - *-*-darwin*) - dnl AC_PROG_OBJC doesn't seem to exist, this is the SDL workaround - AC_MSG_CHECKING(for an Objective-C compiler) - OBJC="$CC" - AC_SUBST(OBJC) - OBJCFLAGS="$CFLAGS" - AC_SUBST(OBJCFLAGS) - _AM_DEPENDENCIES(OBJC) - ;; -esac +dnl Expand the sources and objects needed to build the library +AC_SUBST(ac_aux_dir) +AC_SUBST(INCLUDE) +AC_SUBST(SOURCES) +AC_SUBST(OBJECTS) +AC_SUBST(BUILD_CFLAGS) +AC_SUBST(BUILD_LIBS) -# Finally create all the generated files -dnl Important: Any directory that you want to be in the distcheck should -dnl have a file listed here, so that configure generates the -dnl subdirectories on the build target. AC_OUTPUT([ -Makefile -docs/Makefile -docs/html/Makefile -docs/man3/Makefile -include/Makefile -src/Makefile -src/main/Makefile -src/main/macos/Makefile -src/main/macosx/Makefile -src/main/macosx/Info.plist -src/stdlib/Makefile -src/audio/Makefile -src/audio/alsa/Makefile -src/audio/arts/Makefile -src/audio/baudio/Makefile -src/audio/dc/Makefile -src/audio/disk/Makefile -src/audio/dma/Makefile -src/audio/dmedia/Makefile -src/audio/dsp/Makefile -src/audio/esd/Makefile -src/audio/macosx/Makefile -src/audio/macrom/Makefile -src/audio/mint/Makefile -src/audio/mme/Makefile -src/audio/nas/Makefile -src/audio/nto/Makefile -src/audio/openbsd/Makefile -src/audio/paudio/Makefile -src/audio/sun/Makefile -src/audio/ums/Makefile -src/audio/windib/Makefile -src/audio/windx5/Makefile -src/video/Makefile -src/video/aalib/Makefile -src/video/ataricommon/Makefile -src/video/bwindow/Makefile -src/video/cybergfx/Makefile -src/video/dc/Makefile -src/video/dga/Makefile -src/video/directfb/Makefile -src/video/dummy/Makefile -src/video/epoc/Makefile -src/video/fbcon/Makefile -src/video/gem/Makefile -src/video/ggi/Makefile -src/video/ipod/Makefile -src/video/os2fslib/Makefile -src/video/maccommon/Makefile -src/video/macdsp/Makefile -src/video/macrom/Makefile -src/video/nanox/Makefile -src/video/photon/Makefile -src/video/picogui/Makefile -src/video/ps2gs/Makefile -src/video/qtopia/Makefile -src/video/wscons/Makefile -src/video/quartz/Makefile -src/video/riscos/Makefile -src/video/svga/Makefile -src/video/vgl/Makefile -src/video/wincommon/Makefile -src/video/windib/Makefile -src/video/windx5/Makefile -src/video/gapi/Makefile -src/video/x11/Makefile -src/video/xbios/Makefile -src/video/Xext/Makefile -src/video/Xext/extensions/Makefile -src/video/Xext/Xinerama/Makefile -src/video/Xext/Xv/Makefile -src/video/Xext/Xxf86dga/Makefile -src/video/Xext/Xxf86vm/Makefile -src/video/Xext/XME/Makefile -src/events/Makefile -src/joystick/Makefile -src/joystick/amigaos/Makefile -src/joystick/beos/Makefile -src/joystick/bsd/Makefile -src/joystick/darwin/Makefile -src/joystick/dc/Makefile -src/joystick/dummy/Makefile -src/joystick/linux/Makefile -src/joystick/macos/Makefile -src/joystick/mint/Makefile -src/joystick/riscos/Makefile -src/joystick/win32/Makefile -src/cdrom/Makefile -src/cdrom/aix/Makefile -src/cdrom/beos/Makefile -src/cdrom/dc/Makefile -src/cdrom/dummy/Makefile -src/cdrom/bsdi/Makefile -src/cdrom/freebsd/Makefile -src/cdrom/linux/Makefile -src/cdrom/macos/Makefile -src/cdrom/macosx/Makefile -src/cdrom/mint/Makefile -src/cdrom/openbsd/Makefile -src/cdrom/osf/Makefile -src/cdrom/qnx/Makefile -src/cdrom/win32/Makefile -src/thread/Makefile -src/timer/Makefile -src/file/Makefile -src/cpuinfo/Makefile -src/hermes/Makefile -sdl-config -SDL.spec -SDL.qpg -], [chmod +x sdl-config]) + Makefile sdl-config SDL.spec SDL.qpg +], [ + : >build-deps + make depend +]) diff --git a/include/SDL_config.h b/include/SDL_config.h new file mode 100644 index 000000000..1dd5d702f --- /dev/null +++ b/include/SDL_config.h @@ -0,0 +1,295 @@ +/* include/SDL_config.h. Generated by configure. */ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2006 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ + +#ifndef _SDL_config_h +#define _SDL_config_h + +/* This is a set of defines to configure the SDL features */ + +/* C language features */ +/* #undef const */ +/* #undef inline */ +/* #undef volatile */ + +/* C datatypes */ +/* #undef size_t */ +/* #undef int8_t */ +/* #undef uint8_t */ +/* #undef int16_t */ +/* #undef uint16_t */ +/* #undef int32_t */ +/* #undef uint32_t */ +#define SDL_HAS_64BIT_TYPE 1 +/* #undef int64_t */ +/* #undef uint64_t */ +/* #undef uintptr_t */ + +/* Endianness */ +#define SDL_BYTEORDER 1234 + +/* Comment this if you want to build without any C library requirements */ +#define HAVE_LIBC 1 +#ifdef HAVE_LIBC + +/* Useful headers */ +#define HAVE_SYS_TYPES_H 1 +#define HAVE_STDIO_H 1 +#define STDC_HEADERS 1 +#define HAVE_STDLIB_H 1 +#define HAVE_STDARG_H 1 +#define HAVE_MALLOC_H 1 +#define HAVE_MEMORY_H 1 +#define HAVE_STRING_H 1 +#define HAVE_STRINGS_H 1 +#define HAVE_INTTYPES_H 1 +#define HAVE_STDINT_H 1 +#define HAVE_CTYPE_H 1 +#define HAVE_MATH_H 1 +#define HAVE_SIGNAL_H 1 +/* #undef HAVE_ALTIVEC_H */ + +/* C library functions */ +#define HAVE_MALLOC 1 +#define HAVE_CALLOC 1 +#define HAVE_REALLOC 1 +#define HAVE_FREE 1 +#define HAVE_ALLOCA 1 +#ifndef _WIN32 /* Don't use C runtime versions of these on Windows */ +#define HAVE_GETENV 1 +#define HAVE_PUTENV 1 +#define HAVE_UNSETENV 1 +#endif +#define HAVE_QSORT 1 +#define HAVE_ABS 1 +#define HAVE_BCOPY 1 +#define HAVE_MEMSET 1 +#define HAVE_MEMCPY 1 +#define HAVE_MEMMOVE 1 +#define HAVE_MEMCMP 1 +#define HAVE_STRLEN 1 +#define HAVE_STRCPY 1 +#define HAVE_STRNCPY 1 +#define HAVE_STRCAT 1 +#define HAVE_STRNCAT 1 +#define HAVE_STRDUP 1 +/* #undef HAVE__STRREV */ +/* #undef HAVE__STRUPR */ +/* #undef HAVE__STRLWR */ +/* #undef HAVE_INDEX */ +/* #undef HAVE_RINDEX */ +#define HAVE_STRCHR 1 +#define HAVE_STRRCHR 1 +#define HAVE_STRSTR 1 +/* #undef HAVE_ITOA */ +/* #undef HAVE__LTOA */ +/* #undef HAVE__UITOA */ +/* #undef HAVE__ULTOA */ +#define HAVE_STRTOL 1 +/* #undef HAVE__I64TOA */ +/* #undef HAVE__UI64TOA */ +#define HAVE_STRTOLL 1 +#define HAVE_STRTOD 1 +#define HAVE_ATOI 1 +#define HAVE_ATOF 1 +#define HAVE_STRCMP 1 +#define HAVE_STRNCMP 1 +/* #undef HAVE_STRICMP */ +#define HAVE_STRCASECMP 1 +#define HAVE_SSCANF 1 +#define HAVE_SNPRINTF 1 +/* #undef HAVE_VSNPRINTF */ +#define HAVE_SIGACTION 1 +#define HAVE_SETJMP 1 +#define HAVE_NANOSLEEP 1 +/* #undef HAVE_CLOCK_GETTIME */ +#define HAVE_DLVSYM 1 + +#else +/* We may need some replacement for stdarg.h here */ +#include +#endif /* HAVE_LIBC */ + +/* General platform specific identifiers */ +/* #undef TARGET_API_MAC_CARBON */ +/* #undef TARGET_API_MAC_OSX */ + +/* Allow disabling of core subsystems */ +/* #undef SDL_AUDIO_DISABLED */ +/* #undef SDL_CDROM_DISABLED */ +/* #undef SDL_CPUINFO_DISABLED */ +/* #undef SDL_EVENTS_DISABLED */ +/* #undef SDL_FILE_DISABLED */ +/* #undef SDL_JOYSTICK_DISABLED */ +/* #undef SDL_LOADSO_DISABLED */ +/* #undef SDL_THREADS_DISABLED */ +/* #undef SDL_TIMERS_DISABLED */ +/* #undef SDL_VIDEO_DISABLED */ + +/* Enable various audio drivers */ +/* #undef SDL_AUDIO_DRIVER_AHI */ +#define SDL_AUDIO_DRIVER_ALSA 1 +#define SDL_AUDIO_DRIVER_ALSA_DYNAMIC "libasound.so.2" +/* #undef SDL_AUDIO_DRIVER_ARTS */ +/* #undef SDL_AUDIO_DRIVER_ARTS_DYNAMIC */ +/* #undef SDL_AUDIO_DRIVER_BAUDIO */ +/* #undef SDL_AUDIO_DRIVER_COREAUDIO */ +/* #undef SDL_AUDIO_DRIVER_DART */ +/* #undef SDL_AUDIO_DRIVER_DC */ +#define SDL_AUDIO_DRIVER_DISK 1 +/* #undef SDL_AUDIO_DRIVER_DMEDIA */ +/* #undef SDL_AUDIO_DRIVER_DRENDERER */ +/* #undef SDL_AUDIO_DRIVER_DSOUND */ +/* #undef SDL_AUDIO_DRIVER_ESD */ +/* #undef SDL_AUDIO_DRIVER_ESD_DYNAMIC */ +/* #undef SDL_AUDIO_DRIVER_MINT */ +/* #undef SDL_AUDIO_DRIVER_MMEAUDIO */ +/* #undef SDL_AUDIO_DRIVER_NAS */ +/* #undef SDL_AUDIO_DRIVER_OPENBSD */ +#define SDL_AUDIO_DRIVER_OSS 1 +/* #undef SDL_AUDIO_DRIVER_OSS_SOUNDCARD_H */ +/* #undef SDL_AUDIO_DRIVER_PAUD */ +/* #undef SDL_AUDIO_DRIVER_QNXNTO */ +/* #undef SDL_AUDIO_DRIVER_SNDMGR */ +/* #undef SDL_AUDIO_DRIVER_SUNAUDIO */ +/* #undef SDL_AUDIO_DRIVER_WAVEOUT */ + +/* Enable various cdrom drivers */ +/* #undef SDL_CDROM_AIX */ +/* #undef SDL_CDROM_BEOS */ +/* #undef SDL_CDROM_BSDI */ +/* #undef SDL_CDROM_DC */ +/* #undef SDL_CDROM_DUMMY */ +/* #undef SDL_CDROM_FREEBSD */ +#define SDL_CDROM_LINUX 1 +/* #undef SDL_CDROM_MACOS */ +/* #undef SDL_CDROM_MACOSX */ +/* #undef SDL_CDROM_MINT */ +/* #undef SDL_CDROM_OPENBSD */ +/* #undef SDL_CDROM_OS2 */ +/* #undef SDL_CDROM_OSF */ +/* #undef SDL_CDROM_QNX */ +/* #undef SDL_CDROM_WIN32 */ + +/* Enable various input drivers */ +/* #undef SDL_INPUT_TSLIB */ +/* #undef SDL_JOYSTICK_AMIGA */ +/* #undef SDL_JOYSTICK_BEOS */ +/* #undef SDL_JOYSTICK_DC */ +/* #undef SDL_JOYSTICK_DUMMY */ +/* #undef SDL_JOYSTICK_IOKIT */ +#define SDL_JOYSTICK_LINUX 1 +/* #undef SDL_JOYSTICK_LINUXEV */ +/* #undef SDL_JOYSTICK_MACOS */ +/* #undef SDL_JOYSTICK_MINT */ +/* #undef SDL_JOYSTICK_OS2 */ +/* #undef SDL_JOYSTICK_RISCOS */ +/* #undef SDL_JOYSTICK_WINMM */ +/* #undef SDL_JOYSTICK_USBHID */ + +/* Enable various shared object loading systems */ +/* #undef SDL_LOADSO_BEOS */ +/* #undef SDL_LOADSO_DLCOMPAT */ +#define SDL_LOADSO_DLOPEN 1 +/* #undef SDL_LOADSO_LDG */ +/* #undef SDL_LOADSO_MACOS */ +/* #undef SDL_LOADSO_OS2 */ +/* #undef SDL_LOADSO_WIN32 */ + +/* Enable various threading systems */ +/* #undef SDL_THREAD_AMIGA */ +/* #undef SDL_THREAD_BEOS */ +/* #undef SDL_THREAD_DC */ +/* #undef SDL_THREAD_EPOC */ +/* #undef SDL_THREAD_OS2 */ +/* #undef SDL_THREAD_PTH */ +#define SDL_THREAD_PTHREAD 1 +#define SDL_THREAD_PTHREAD_RECURSIVE_MUTEX 1 +/* #undef SDL_THREAD_PTHREAD_RECURSIVE_MUTEX_NP */ +/* #undef SDL_THREAD_SPROC */ +/* #undef SDL_THREAD_WIN32 */ + +/* Enable various timer systems */ +/* #undef SDL_TIMER_AMIGA */ +/* #undef SDL_TIMER_BEOS */ +/* #undef SDL_TIMER_DC */ +/* #undef SDL_TIMER_EPOC */ +/* #undef SDL_TIMER_MACOS */ +/* #undef SDL_TIMER_MINT */ +/* #undef SDL_TIMER_OS2 */ +/* #undef SDL_TIMER_RISCOS */ +#define SDL_TIMER_UNIX 1 +/* #undef SDL_TIMER_WIN32 */ +/* #undef SDL_TIMER_WINCE */ + +/* Enable various video drivers */ +/* #undef SDL_VIDEO_DRIVER_AALIB */ +/* #undef SDL_VIDEO_DRIVER_BWINDOW */ +/* #undef SDL_VIDEO_DRIVER_CYBERGRAPHICS */ +/* #undef SDL_VIDEO_DRIVER_DC */ +/* #undef SDL_VIDEO_DRIVER_DDRAW */ +#define SDL_VIDEO_DRIVER_DGA 1 +/* #undef SDL_VIDEO_DRIVER_DIRECTFB */ +/* #undef SDL_VIDEO_DRIVER_DRAWSPROCKET */ +#define SDL_VIDEO_DRIVER_DUMMY 1 +/* #undef SDL_VIDEO_DRIVER_EPOC */ +#define SDL_VIDEO_DRIVER_FBCON 1 +/* #undef SDL_VIDEO_DRIVER_GAPI */ +/* #undef SDL_VIDEO_DRIVER_GEM */ +/* #undef SDL_VIDEO_DRIVER_GGI */ +/* #undef SDL_VIDEO_DRIVER_IPOD */ +/* #undef SDL_VIDEO_DRIVER_NANOX */ +/* #undef SDL_VIDEO_DRIVER_OS2FS */ +/* #undef SDL_VIDEO_DRIVER_PHOTON */ +/* #undef SDL_VIDEO_DRIVER_PICOGUI */ +/* #undef SDL_VIDEO_DRIVER_PS2GS */ +/* #undef SDL_VIDEO_DRIVER_QTOPIA */ +/* #undef SDL_VIDEO_DRIVER_QUARTZ */ +/* #undef SDL_VIDEO_DRIVER_RISCOS */ +/* #undef SDL_VIDEO_DRIVER_SVGALIB */ +/* #undef SDL_VIDEO_DRIVER_TOOLBOX */ +/* #undef SDL_VIDEO_DRIVER_VGL */ +/* #undef SDL_VIDEO_DRIVER_WINDIB */ +/* #undef SDL_VIDEO_DRIVER_WSCONS */ +#define SDL_VIDEO_DRIVER_X11 1 +#define SDL_VIDEO_DRIVER_X11_DGAMOUSE 1 +#define SDL_VIDEO_DRIVER_X11_DYNAMIC "libX11.so.6" +#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XEXT "libXext.so.6" +#define SDL_VIDEO_DRIVER_X11_VIDMODE 1 +#define SDL_VIDEO_DRIVER_X11_XINERAMA 1 +#define SDL_VIDEO_DRIVER_X11_XME 1 +#define SDL_VIDEO_DRIVER_X11_XV 1 +/* #undef SDL_VIDEO_DRIVER_XBIOS */ + +/* Enable OpenGL support */ +#define SDL_VIDEO_OPENGL 1 +#define SDL_VIDEO_OPENGL_GLX 1 +/* #undef SDL_VIDEO_OPENGL_WGL */ +/* #undef SDL_VIDEO_OPENGL_OSMESA */ +/* #undef SDL_VIDEO_OPENGL_OSMESA_DYNAMIC */ + +/* Enable assembly blit routines */ +#define SDL_ASSEMBLY_BLITTERS 1 +#define SDL_HERMES_BLITTERS 1 +/* #undef SDL_ALTIVEC_BLITTERS */ + +#endif /* _SDL_config_h */ diff --git a/include/SDL_config.h.in b/include/SDL_config.h.in index a5ff395be..27ef6fde7 100644 --- a/include/SDL_config.h.in +++ b/include/SDL_config.h.in @@ -63,7 +63,9 @@ #undef HAVE_INTTYPES_H #undef HAVE_STDINT_H #undef HAVE_CTYPE_H +#undef HAVE_MATH_H #undef HAVE_SIGNAL_H +#undef HAVE_ALTIVEC_H /* C library functions */ #undef HAVE_MALLOC @@ -115,19 +117,178 @@ #undef HAVE_SSCANF #undef HAVE_SNPRINTF #undef HAVE_VSNPRINTF +#undef HAVE_SIGACTION +#undef HAVE_SETJMP +#undef HAVE_NANOSLEEP +#undef HAVE_CLOCK_GETTIME +#undef HAVE_DLVSYM +#else +/* We may need some replacement for stdarg.h here */ +#include #endif /* HAVE_LIBC */ +/* General platform specific identifiers */ +#undef TARGET_API_MAC_CARBON +#undef TARGET_API_MAC_OSX /* Allow disabling of core subsystems */ -#undef DISABLE_AUDIO -#undef DISABLE_VIDEO -#undef DISABLE_EVENTS -#undef DISABLE_JOYSTICK -#undef DISABLE_CDROM -#undef DISABLE_THREADS -#undef DISABLE_TIMERS -#undef DISABLE_FILE -#undef DISABLE_CPUINFO +#undef SDL_AUDIO_DISABLED +#undef SDL_CDROM_DISABLED +#undef SDL_CPUINFO_DISABLED +#undef SDL_EVENTS_DISABLED +#undef SDL_FILE_DISABLED +#undef SDL_JOYSTICK_DISABLED +#undef SDL_LOADSO_DISABLED +#undef SDL_THREADS_DISABLED +#undef SDL_TIMERS_DISABLED +#undef SDL_VIDEO_DISABLED + +/* Enable various audio drivers */ +#undef SDL_AUDIO_DRIVER_AHI +#undef SDL_AUDIO_DRIVER_ALSA +#undef SDL_AUDIO_DRIVER_ALSA_DYNAMIC +#undef SDL_AUDIO_DRIVER_ARTS +#undef SDL_AUDIO_DRIVER_ARTS_DYNAMIC +#undef SDL_AUDIO_DRIVER_BAUDIO +#undef SDL_AUDIO_DRIVER_COREAUDIO +#undef SDL_AUDIO_DRIVER_DART +#undef SDL_AUDIO_DRIVER_DC +#undef SDL_AUDIO_DRIVER_DISK +#undef SDL_AUDIO_DRIVER_DMEDIA +#undef SDL_AUDIO_DRIVER_DRENDERER +#undef SDL_AUDIO_DRIVER_DSOUND +#undef SDL_AUDIO_DRIVER_ESD +#undef SDL_AUDIO_DRIVER_ESD_DYNAMIC +#undef SDL_AUDIO_DRIVER_MINT +#undef SDL_AUDIO_DRIVER_MMEAUDIO +#undef SDL_AUDIO_DRIVER_NAS +#undef SDL_AUDIO_DRIVER_OPENBSD +#undef SDL_AUDIO_DRIVER_OSS +#undef SDL_AUDIO_DRIVER_OSS_SOUNDCARD_H +#undef SDL_AUDIO_DRIVER_PAUD +#undef SDL_AUDIO_DRIVER_QNXNTO +#undef SDL_AUDIO_DRIVER_SNDMGR +#undef SDL_AUDIO_DRIVER_SUNAUDIO +#undef SDL_AUDIO_DRIVER_WAVEOUT + +/* Enable various cdrom drivers */ +#undef SDL_CDROM_AIX +#undef SDL_CDROM_BEOS +#undef SDL_CDROM_BSDI +#undef SDL_CDROM_DC +#undef SDL_CDROM_DUMMY +#undef SDL_CDROM_FREEBSD +#undef SDL_CDROM_LINUX +#undef SDL_CDROM_MACOS +#undef SDL_CDROM_MACOSX +#undef SDL_CDROM_MINT +#undef SDL_CDROM_OPENBSD +#undef SDL_CDROM_OS2 +#undef SDL_CDROM_OSF +#undef SDL_CDROM_QNX +#undef SDL_CDROM_WIN32 + +/* Enable various input drivers */ +#undef SDL_INPUT_TSLIB +#undef SDL_JOYSTICK_AMIGA +#undef SDL_JOYSTICK_BEOS +#undef SDL_JOYSTICK_DC +#undef SDL_JOYSTICK_DUMMY +#undef SDL_JOYSTICK_IOKIT +#undef SDL_JOYSTICK_LINUX +#undef SDL_JOYSTICK_LINUXEV +#undef SDL_JOYSTICK_MACOS +#undef SDL_JOYSTICK_MINT +#undef SDL_JOYSTICK_OS2 +#undef SDL_JOYSTICK_RISCOS +#undef SDL_JOYSTICK_WINMM +#undef SDL_JOYSTICK_USBHID + +/* Enable various shared object loading systems */ +#undef SDL_LOADSO_BEOS +#undef SDL_LOADSO_DLCOMPAT +#undef SDL_LOADSO_DLOPEN +#undef SDL_LOADSO_LDG +#undef SDL_LOADSO_MACOS +#undef SDL_LOADSO_OS2 +#undef SDL_LOADSO_WIN32 + +/* Enable various threading systems */ +#undef SDL_THREAD_AMIGA +#undef SDL_THREAD_BEOS +#undef SDL_THREAD_DC +#undef SDL_THREAD_EPOC +#undef SDL_THREAD_OS2 +#undef SDL_THREAD_PTH +#undef SDL_THREAD_PTHREAD +#undef SDL_THREAD_PTHREAD_RECURSIVE_MUTEX +#undef SDL_THREAD_PTHREAD_RECURSIVE_MUTEX_NP +#undef SDL_THREAD_SPROC +#undef SDL_THREAD_WIN32 + +/* Enable various timer systems */ +#undef SDL_TIMER_AMIGA +#undef SDL_TIMER_BEOS +#undef SDL_TIMER_DC +#undef SDL_TIMER_EPOC +#undef SDL_TIMER_MACOS +#undef SDL_TIMER_MINT +#undef SDL_TIMER_OS2 +#undef SDL_TIMER_RISCOS +#undef SDL_TIMER_UNIX +#undef SDL_TIMER_WIN32 +#undef SDL_TIMER_WINCE + +/* Enable various video drivers */ +#undef SDL_VIDEO_DRIVER_AALIB +#undef SDL_VIDEO_DRIVER_BWINDOW +#undef SDL_VIDEO_DRIVER_CYBERGRAPHICS +#undef SDL_VIDEO_DRIVER_DC +#undef SDL_VIDEO_DRIVER_DDRAW +#undef SDL_VIDEO_DRIVER_DGA +#undef SDL_VIDEO_DRIVER_DIRECTFB +#undef SDL_VIDEO_DRIVER_DRAWSPROCKET +#undef SDL_VIDEO_DRIVER_DUMMY +#undef SDL_VIDEO_DRIVER_EPOC +#undef SDL_VIDEO_DRIVER_FBCON +#undef SDL_VIDEO_DRIVER_GAPI +#undef SDL_VIDEO_DRIVER_GEM +#undef SDL_VIDEO_DRIVER_GGI +#undef SDL_VIDEO_DRIVER_IPOD +#undef SDL_VIDEO_DRIVER_NANOX +#undef SDL_VIDEO_DRIVER_OS2FS +#undef SDL_VIDEO_DRIVER_PHOTON +#undef SDL_VIDEO_DRIVER_PICOGUI +#undef SDL_VIDEO_DRIVER_PS2GS +#undef SDL_VIDEO_DRIVER_QTOPIA +#undef SDL_VIDEO_DRIVER_QUARTZ +#undef SDL_VIDEO_DRIVER_RISCOS +#undef SDL_VIDEO_DRIVER_SVGALIB +#undef SDL_VIDEO_DRIVER_TOOLBOX +#undef SDL_VIDEO_DRIVER_VGL +#undef SDL_VIDEO_DRIVER_WINDIB +#undef SDL_VIDEO_DRIVER_WSCONS +#undef SDL_VIDEO_DRIVER_X11 +#undef SDL_VIDEO_DRIVER_X11_DGAMOUSE +#undef SDL_VIDEO_DRIVER_X11_DYNAMIC +#undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XEXT +#undef SDL_VIDEO_DRIVER_X11_VIDMODE +#undef SDL_VIDEO_DRIVER_X11_XINERAMA +#undef SDL_VIDEO_DRIVER_X11_XME +#undef SDL_VIDEO_DRIVER_X11_XV +#undef SDL_VIDEO_DRIVER_XBIOS + +/* Enable OpenGL support */ +#undef SDL_VIDEO_OPENGL +#undef SDL_VIDEO_OPENGL_GLX +#undef SDL_VIDEO_OPENGL_WGL +#undef SDL_VIDEO_OPENGL_OSMESA +#undef SDL_VIDEO_OPENGL_OSMESA_DYNAMIC + +/* Enable assembly blit routines */ +#undef SDL_ASSEMBLY_BLITTERS +#undef SDL_HERMES_BLITTERS +#undef SDL_ALTIVEC_BLITTERS #endif /* _SDL_config_h */ diff --git a/include/SDL_error.h b/include/SDL_error.h index 3871953f5..26d6bfaef 100644 --- a/include/SDL_error.h +++ b/include/SDL_error.h @@ -40,11 +40,13 @@ extern DECLSPEC void SDLCALL SDL_ClearError(void); /* Private error message function - used internally */ #define SDL_OutOfMemory() SDL_Error(SDL_ENOMEM) +#define SDL_Unsupported() SDL_Error(SDL_UNSUPPORTED) typedef enum { SDL_ENOMEM, SDL_EFREAD, SDL_EFWRITE, SDL_EFSEEK, + SDL_UNSUPPORTED, SDL_LASTERROR } SDL_errorcode; extern DECLSPEC void SDLCALL SDL_Error(SDL_errorcode code); diff --git a/include/SDL_stdinc.h b/include/SDL_stdinc.h index 1e64c5118..517f2fd6d 100644 --- a/include/SDL_stdinc.h +++ b/include/SDL_stdinc.h @@ -55,14 +55,13 @@ char *alloca (); #else # if HAVE_STDLIB_H # include +# elif HAVE_MALLOC_H +# include # endif # if HAVE_STDARG_H # include # endif #endif -#if HAVE_MALLOC_H -# include -#endif #if HAVE_STRING_H # if !STDC_HEADERS && HAVE_MEMORY_H # include diff --git a/include/SDL_syswm.h b/include/SDL_syswm.h index 2f74735b7..b3ff754a9 100644 --- a/include/SDL_syswm.h +++ b/include/SDL_syswm.h @@ -45,18 +45,13 @@ struct SDL_SysWMinfo; typedef struct SDL_SysWMinfo SDL_SysWMinfo; #else +/* This is the structure for custom window manager events */ +#if SDL_VIDEO_DRIVER_X11 #if defined(__APPLE__) && defined(__MACH__) // conflicts with Quickdraw.h #define Cursor X11Cursor #endif -/* This is the structure for custom window manager events */ -#if (defined(unix) || defined(__unix__) || defined(_AIX) || \ - defined(__OpenBSD__) || defined(__NetBSD__) || \ - (defined(__APPLE__) && defined(__MACH__))) && \ - (!defined(DISABLE_X11) && !defined(__CYGWIN32__) && !defined(ENABLE_NANOX) && \ - !defined(__QNXNTO__)) - /* AIX is unix, of course, but the native compiler CSet doesn't define unix */ #include #include @@ -105,7 +100,7 @@ typedef struct SDL_SysWMinfo { } info; } SDL_SysWMinfo; -#elif defined(ENABLE_NANOX) +#elif SDL_VIDEO_DRIVER_NANOX #include /* The generic custom event structure */ @@ -120,7 +115,7 @@ typedef struct SDL_SysWMinfo { GR_WINDOW_ID window ; /* The display window */ } SDL_SysWMinfo; -#elif defined(WIN32) +#elif SDL_VIDEO_DRIVER_WINDIB || SDL_VIDEO_DRIVER_DDRAW #include "SDL_windows.h" /* The windows custom event structure */ @@ -139,7 +134,7 @@ typedef struct SDL_SysWMinfo { HGLRC hglrc; /* The OpenGL context, if any */ } SDL_SysWMinfo; -#elif defined(__riscos__) +#elif SDL_VIDEO_DRIVER_RISCOS /* RISC OS custom event structure */ struct SDL_SysWMmsg { @@ -156,7 +151,7 @@ typedef struct SDL_SysWMinfo { int window; /* The RISC OS display window */ } SDL_SysWMinfo; -#elif defined(__QNXNTO__) +#elif SDL_VIDEO_DRIVER_PHOTON #include #include @@ -186,7 +181,7 @@ typedef struct SDL_SysWMinfo { int data; } SDL_SysWMinfo; -#endif /* OS type */ +#endif /* video driver type */ #endif /* SDL_PROTOTYPES_ONLY */ diff --git a/sdl-config.in b/sdl-config.in index 132db863d..b147490cc 100644 --- a/sdl-config.in +++ b/sdl-config.in @@ -40,15 +40,6 @@ while test $# -gt 0; do ;; --cflags) echo -I@includedir@/SDL @SDL_CFLAGS@ - - # The portable way of including SDL is #include "SDL.h" - #if test @includedir@ != /usr/include ; then - # # Handle oddities in Win32 path handling (assumes prefix) - # prefix=`echo ${prefix} | sed 's,^//\([A-Z]\),\1:,'` - # - # includes=-I@includedir@ - #fi - #echo $includes -I@includedir@/SDL @SDL_CFLAGS@ ;; @ENABLE_SHARED_TRUE@ --libs) @ENABLE_SHARED_TRUE@ libdirs="-L@libdir@ @SDL_RLD_FLAGS@" diff --git a/src/Makefile.am b/src/Makefile.am deleted file mode 100644 index fe873297c..000000000 --- a/src/Makefile.am +++ /dev/null @@ -1,44 +0,0 @@ - -## Makefile.am for the main SDL library - -# These are the subdirectories that are always built -CORE_SUBDIRS = \ - main stdlib - -# These are the subdirectories which may be built -EXTRA_SUBDIRS = \ - audio video events joystick cdrom thread timer file cpuinfo hermes - -# These are the subdirectories which will be built now -SUBDIRS = $(CORE_SUBDIRS) @SDL_EXTRADIRS@ - -# These are the subdirectories which will be distributed with "make dist" -DIST_SUBDIRS = $(CORE_SUBDIRS) $(EXTRA_SUBDIRS) - -# The SDL library target -lib_LTLIBRARIES = libSDL.la - -libSDL_la_SOURCES = $(GENERAL_SRCS) -libSDL_la_LDFLAGS = \ - -no-undefined \ - -release $(LT_RELEASE) \ - -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) -libSDL_la_LIBADD = \ - main/libarch.la \ - stdlib/libstdlib.la \ - @SDL_EXTRALIBS@ \ - @SYSTEM_LIBS@ -libSDL_la_DEPENDENCIES = \ - main/libarch.la \ - stdlib/libstdlib.la \ - @SDL_EXTRALIBS@ - -# The SDL library sources -GENERAL_SRCS = \ - SDL.c \ - SDL_error.c \ - SDL_error_c.h \ - SDL_fatal.c \ - SDL_fatal.h \ - SDL_loadso.c - diff --git a/src/SDL.c b/src/SDL.c index dd0c0ef4c..971973681 100644 --- a/src/SDL.c +++ b/src/SDL.c @@ -22,26 +22,26 @@ /* Initialization code for SDL */ -#ifdef ENABLE_PTH -#include -#endif - #include "SDL.h" #include "SDL_fatal.h" -#ifndef DISABLE_VIDEO -#include "SDL_leaks.h" +#if !SDL_VIDEO_DISABLED +#include "video/SDL_leaks.h" +#endif + +#if SDL_THREAD_PTH +#include #endif /* Initialization/Cleanup routines */ -#ifndef DISABLE_JOYSTICK +#if !SDL_JOYSTICK_DISABLED extern int SDL_JoystickInit(void); extern void SDL_JoystickQuit(void); #endif -#ifndef DISABLE_CDROM +#if !SDL_CDROM_DISABLED extern int SDL_CDROMInit(void); extern void SDL_CDROMQuit(void); #endif -#ifndef DISABLE_TIMERS +#if !SDL_TIMERS_DISABLED extern void SDL_StartTicks(void); extern int SDL_TimerInit(void); extern void SDL_TimerQuit(void); @@ -61,7 +61,7 @@ int surfaces_allocated = 0; int SDL_InitSubSystem(Uint32 flags) { -#ifndef DISABLE_VIDEO +#if !SDL_VIDEO_DISABLED /* Initialize the video/event subsystem */ if ( (flags & SDL_INIT_VIDEO) && !(SDL_initialized & SDL_INIT_VIDEO) ) { if ( SDL_VideoInit(SDL_getenv("SDL_VIDEODRIVER"), @@ -77,7 +77,7 @@ int SDL_InitSubSystem(Uint32 flags) } #endif -#ifndef DISABLE_AUDIO +#if !SDL_AUDIO_DISABLED /* Initialize the audio subsystem */ if ( (flags & SDL_INIT_AUDIO) && !(SDL_initialized & SDL_INIT_AUDIO) ) { if ( SDL_AudioInit(SDL_getenv("SDL_AUDIODRIVER")) < 0 ) { @@ -92,7 +92,7 @@ int SDL_InitSubSystem(Uint32 flags) } #endif -#ifndef DISABLE_TIMERS +#if !SDL_TIMERS_DISABLED /* Initialize the timer subsystem */ if ( ! ticks_started ) { SDL_StartTicks(); @@ -111,7 +111,7 @@ int SDL_InitSubSystem(Uint32 flags) } #endif -#ifndef DISABLE_JOYSTICK +#if !SDL_JOYSTICK_DISABLED /* Initialize the joystick subsystem */ if ( (flags & SDL_INIT_JOYSTICK) && !(SDL_initialized & SDL_INIT_JOYSTICK) ) { @@ -127,7 +127,7 @@ int SDL_InitSubSystem(Uint32 flags) } #endif -#ifndef DISABLE_CDROM +#if !SDL_CDROM_DISABLED /* Initialize the CD-ROM subsystem */ if ( (flags & SDL_INIT_CDROM) && !(SDL_initialized & SDL_INIT_CDROM) ) { if ( SDL_CDROMInit() < 0 ) { @@ -146,7 +146,7 @@ int SDL_InitSubSystem(Uint32 flags) int SDL_Init(Uint32 flags) { -#if !defined(DISABLE_THREADS) && defined(ENABLE_PTH) +#if !SDL_THREADS_DISABLED && SDL_THREAD_PTH if (!pth_init()) { return -1; } @@ -170,31 +170,31 @@ int SDL_Init(Uint32 flags) void SDL_QuitSubSystem(Uint32 flags) { /* Shut down requested initialized subsystems */ -#ifndef DISABLE_CDROM +#if !SDL_CDROM_DISABLED if ( (flags & SDL_initialized & SDL_INIT_CDROM) ) { SDL_CDROMQuit(); SDL_initialized &= ~SDL_INIT_CDROM; } #endif -#ifndef DISABLE_JOYSTICK +#if !SDL_JOYSTICK_DISABLED if ( (flags & SDL_initialized & SDL_INIT_JOYSTICK) ) { SDL_JoystickQuit(); SDL_initialized &= ~SDL_INIT_JOYSTICK; } #endif -#ifndef DISABLE_TIMERS +#if !SDL_TIMERS_DISABLED if ( (flags & SDL_initialized & SDL_INIT_TIMER) ) { SDL_TimerQuit(); SDL_initialized &= ~SDL_INIT_TIMER; } #endif -#ifndef DISABLE_AUDIO +#if !SDL_AUDIO_DISABLED if ( (flags & SDL_initialized & SDL_INIT_AUDIO) ) { SDL_AudioQuit(); SDL_initialized &= ~SDL_INIT_AUDIO; } #endif -#ifndef DISABLE_VIDEO +#if !SDL_VIDEO_DISABLED if ( (flags & SDL_initialized & SDL_INIT_VIDEO) ) { SDL_VideoQuit(); SDL_initialized &= ~SDL_INIT_VIDEO; @@ -236,7 +236,7 @@ void SDL_Quit(void) /* Uninstall any parachute signal handlers */ SDL_UninstallParachute(); -#if !defined(DISABLE_THREADS) && defined(ENABLE_PTH) +#if !SDL_THREADS_DISABLED && SDL_THREAD_PTH pth_kill(); #endif #ifdef DEBUG_BUILD diff --git a/src/SDL_error.c b/src/SDL_error.c index c0cde54db..ea59aeb5e 100644 --- a/src/SDL_error.c +++ b/src/SDL_error.c @@ -24,16 +24,15 @@ #include "SDL_error.h" #include "SDL_error_c.h" -#ifndef DISABLE_THREADS -#include "SDL_thread_c.h" -#endif -#ifdef DISABLE_THREADS -/* The default (non-thread-safe) global error variable */ +/* Routine to get the thread-specific error variable */ +#if SDL_THREADS_DISABLED +/* The SDL_arraysize(The ),default (non-thread-safe) global error variable */ static SDL_error SDL_global_error; - #define SDL_GetErrBuf() (&SDL_global_error) -#endif /* DISABLE_THREADS */ +#else +extern SDL_error *SDL_GetErrBuf(void); +#endif /* SDL_THREADS_DISABLED */ #define SDL_ERRBUFIZE 1024 diff --git a/src/SDL_loadso.c b/src/SDL_loadso.c deleted file mode 100644 index 795f6c62c..000000000 --- a/src/SDL_loadso.c +++ /dev/null @@ -1,56 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2006 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ - -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* System dependent library loading routines */ - -/* - * Mac OS X >= 10.3 are guaranteed to have dlopen support in a system - * framework, which means we don't have to roll our own on non-PowerPC - * systems to guarantee compatibility (x86 Macs started at 10.4). --ryan. - */ -#if ( (defined(MACOSX)) && (!defined(__POWERPC__)) ) -# define USE_DLOPEN 1 -#endif - -/* !!! FIXME: includes so I don't have to update all the project files... */ -#define SDL_INTERNAL_BUILDING_LOADSO 1 -#if defined(USE_DUMMY_LOADSO) -# include "loadso/dummy/SDL_loadso.c" -#elif defined(USE_DLOPEN) -# include "loadso/dlopen/SDL_loadso.c" -#elif defined(MACOSX) -# include "loadso/macosx/SDL_loadso.c" -#elif defined(macintosh) -# include "loadso/macos/SDL_loadso.c" -#elif defined(WIN32) || defined(_WIN32_WCE) -# include "loadso/windows/SDL_loadso.c" -#elif defined(__BEOS__) -# include "loadso/beos/SDL_loadso.c" -#elif defined(__MINT__) && defined(ENABLE_LDG) -# include "loadso/mint/SDL_loadso.c" -#elif defined(__OS2__) -# include "loadso/os2/SDL_loadso.c" -#else -# include "loadso/dummy/SDL_loadso.c" -#endif /* system type */ - diff --git a/src/audio/Makefile.am b/src/audio/Makefile.am deleted file mode 100644 index e8a680690..000000000 --- a/src/audio/Makefile.am +++ /dev/null @@ -1,55 +0,0 @@ - -## Makefile.am for the SDL audio library - -noinst_LTLIBRARIES = libaudio.la - -# Define which subdirectories need to be built -SUBDIRS = @AUDIO_SUBDIRS@ -DIST_SUBDIRS = \ - alsa \ - arts \ - baudio \ - dc \ - disk \ - dma \ - dmedia \ - dsp \ - esd \ - macosx \ - macrom \ - mint \ - mme \ - nas \ - nto \ - openbsd \ - paudio \ - sun \ - ums \ - windib \ - windx5 - -DRIVERS = @AUDIO_DRIVERS@ - -# Include the architecture-independent sources -COMMON_SRCS = \ - SDL_audio.c \ - SDL_audio_c.h \ - SDL_audiocvt.c \ - SDL_audiodev.c \ - SDL_audiodev_c.h \ - SDL_audiomem.c \ - SDL_audiomem.h \ - SDL_mixer.c \ - SDL_sysaudio.h \ - SDL_wave.c \ - SDL_wave.h \ - SDL_mixer_MMX.c \ - SDL_mixer_MMX.h \ - SDL_mixer_MMX_VC.c \ - SDL_mixer_MMX_VC.h \ - SDL_mixer_m68k.c \ - SDL_mixer_m68k.h - -libaudio_la_SOURCES = $(COMMON_SRCS) -libaudio_la_LIBADD = $(DRIVERS) -libaudio_la_DEPENDENCIES = $(DRIVERS) diff --git a/src/audio/SDL_audio.c b/src/audio/SDL_audio.c index dc66eb39a..3fa5b12de 100644 --- a/src/audio/SDL_audio.c +++ b/src/audio/SDL_audio.c @@ -35,76 +35,76 @@ /* Available audio drivers */ static AudioBootStrap *bootstrap[] = { -#ifdef OPENBSD_AUDIO_SUPPORT +#if SDL_AUDIO_DRIVER_OPENBSD &OPENBSD_AUDIO_bootstrap, #endif -#ifdef OSS_SUPPORT +#if SDL_AUDIO_DRIVER_OSS &DSP_bootstrap, &DMA_bootstrap, #endif -#ifdef ALSA_SUPPORT +#if SDL_AUDIO_DRIVER_ALSA &ALSA_bootstrap, #endif -#ifdef QNXNTOAUDIO_SUPPORT +#if SDL_AUDIO_DRIVER_QNXNTO &QNXNTOAUDIO_bootstrap, #endif -#ifdef SUNAUDIO_SUPPORT +#if SDL_AUDIO_DRIVER_SUNAUDIO &SUNAUDIO_bootstrap, #endif -#ifdef DMEDIA_SUPPORT +#if SDL_AUDIO_DRIVER_DMEDIA &DMEDIA_bootstrap, #endif -#ifdef ARTSC_SUPPORT - &ARTSC_bootstrap, +#if SDL_AUDIO_DRIVER_ARTS + &ARTS_bootstrap, #endif -#ifdef ESD_SUPPORT +#if SDL_AUDIO_DRIVER_ESD &ESD_bootstrap, #endif -#ifdef NAS_SUPPORT +#if SDL_AUDIO_DRIVER_NAS &NAS_bootstrap, #endif -#ifdef ENABLE_DIRECTX +#if SDL_AUDIO_DRIVER_DSOUND &DSOUND_bootstrap, #endif -#ifdef ENABLE_WINDIB +#if SDL_AUDIO_DRIVER_WAVEOUT &WAVEOUT_bootstrap, #endif -#ifdef __BEOS__ +#if SDL_AUDIO_DRIVER_PAUD + &Paud_bootstrap, +#endif +#if SDL_AUDIO_DRIVER_BAUDIO &BAUDIO_bootstrap, #endif -#ifdef MACOSX +#if SDL_AUDIO_DRIVER_COREAUDIO &COREAUDIO_bootstrap, #endif -#if defined(macintosh) || TARGET_API_MAC_CARBON +#if SDL_AUDIO_DRIVER_SNDMGR &SNDMGR_bootstrap, #endif -#ifdef _AIX - &Paud_bootstrap, -#endif -#ifdef ENABLE_AHI +#if SDL_AUDIO_DRIVER_AHI &AHI_bootstrap, #endif -#ifdef MMEAUDIO_SUPPORT - &MMEAUDIO_bootstrap, -#endif -#ifdef MINTAUDIO_SUPPORT +#if SDL_AUDIO_DRIVER_MINT &MINTAUDIO_GSXB_bootstrap, &MINTAUDIO_MCSN_bootstrap, &MINTAUDIO_STFA_bootstrap, &MINTAUDIO_XBIOS_bootstrap, &MINTAUDIO_DMA8_bootstrap, #endif -#ifdef DISKAUD_SUPPORT +#if SDL_AUDIO_DRIVER_DISK &DISKAUD_bootstrap, #endif -#ifdef ENABLE_DC +#if SDL_AUDIO_DRIVER_DC &DCAUD_bootstrap, #endif -#ifdef DRENDERER_SUPPORT +#if SDL_AUDIO_DRIVER_DRENDERER &DRENDERER_bootstrap, #endif -#ifdef __OS2__ - &DART_bootstrap, +#if SDL_AUDIO_DRIVER_MMEAUDIO + &MMEAUDIO_bootstrap, +#endif +#if SDL_AUDIO_DRIVER_DART + &DART_bootstrap, #endif NULL }; @@ -294,7 +294,7 @@ int SDL_AudioInit(const char *driver_name) /* Select the proper audio driver */ audio = NULL; idx = 0; -#ifdef unix +#if SDL_AUDIO_DRIVER_ESD if ( (driver_name == NULL) && (SDL_getenv("ESPEAKER") != NULL) ) { /* Ahem, we know that if ESPEAKER is set, user probably wants to use ESD, but don't start it if it's not already running. @@ -323,7 +323,7 @@ int SDL_AudioInit(const char *driver_name) } } } -#endif /* unix */ +#endif /* SDL_AUDIO_DRIVER_ESD */ if ( audio == NULL ) { if ( driver_name != NULL ) { #if 0 /* This will be replaced with a better driver selection API */ @@ -414,10 +414,10 @@ int SDL_OpenAudio(SDL_AudioSpec *desired, SDL_AudioSpec *obtained) return(-1); } -#if defined(macintosh) || (defined(__riscos__) && defined(DISABLE_THREADS)) +#if defined(macintosh) || (defined(__riscos__) && SDL_THREADS_DISABLED) /* FIXME: Need to implement PPC interrupt asm for SDL_LockAudio() */ #else -#if defined(__MINT__) && !defined(ENABLE_THREADS) +#if defined(__MINT__) && SDL_THREADS_DISABLED /* Uses interrupt driven audio, without thread */ #else /* Create a semaphore for locking the sound buffers */ diff --git a/src/audio/SDL_audiomem.c b/src/audio/SDL_audiomem.c deleted file mode 100644 index 03f3cfc5c..000000000 --- a/src/audio/SDL_audiomem.c +++ /dev/null @@ -1,67 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2006 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ - -/* Functions to allocate audio buffer memory, shareable across threads - (necessary because SDL audio emulates threads with fork() - */ - -#ifdef FORK_HACK -#include -#include -#include -#include -#endif - -#include "SDL_stdinc.h" -#include "SDL_audiomem.h" - -/* Allocate memory that will be shared between threads (freed on exit) */ -void *SDL_AllocAudioMem(int size) -{ - void *chunk; - -#ifdef FORK_HACK - int semid; - - /* Create and get the address of a shared memory segment */ - semid = shmget(IPC_PRIVATE, size, (IPC_CREAT|0600)); - if ( semid < 0 ) { - return(NULL); - } - chunk = shmat(semid, NULL, 0); - - /* Set the segment for deletion when it is detatched */ - shmctl(semid, IPC_RMID, NULL); /* Delets semid if shmat() fails */ -#else - chunk = SDL_malloc(size); -#endif - return((void *)chunk); -} - -void SDL_FreeAudioMem(void *chunk) -{ -#ifdef FORK_HACK - shmdt(chunk); -#else - SDL_free(chunk); -#endif -} diff --git a/src/audio/SDL_audiomem.h b/src/audio/SDL_audiomem.h index ce73d8062..a60e2c7d0 100644 --- a/src/audio/SDL_audiomem.h +++ b/src/audio/SDL_audiomem.h @@ -20,10 +20,5 @@ slouken@libsdl.org */ -/* Functions to allocate audio buffer memory, shareable across threads - (necessary because SDL audio emulates threads with fork() - */ - -extern void *SDL_AllocAudioMem(int size); -extern void SDL_FreeAudioMem(void *mem); - +#define SDL_AllocAudioMem SDL_malloc +#define SDL_FreeAudioMem SDL_free diff --git a/src/audio/SDL_sysaudio.h b/src/audio/SDL_sysaudio.h index 32754e4c1..b7e8377de 100644 --- a/src/audio/SDL_sysaudio.h +++ b/src/audio/SDL_sysaudio.h @@ -99,75 +99,75 @@ typedef struct AudioBootStrap { SDL_AudioDevice *(*create)(int devindex); } AudioBootStrap; -#ifdef OPENBSD_AUDIO_SUPPORT +#if SDL_AUDIO_DRIVER_OPENBSD extern AudioBootStrap OPENBSD_AUDIO_bootstrap; #endif -#ifdef OSS_SUPPORT +#if SDL_AUDIO_DRIVER_OSS extern AudioBootStrap DSP_bootstrap; extern AudioBootStrap DMA_bootstrap; #endif -#ifdef ALSA_SUPPORT +#if SDL_AUDIO_DRIVER_ALSA extern AudioBootStrap ALSA_bootstrap; #endif -#ifdef QNXNTOAUDIO_SUPPORT +#if SDL_AUDIO_DRIVER_QNXNTO extern AudioBootStrap QNXNTOAUDIO_bootstrap; #endif -#ifdef SUNAUDIO_SUPPORT +#if SDL_AUDIO_DRIVER_SUNAUDIO extern AudioBootStrap SUNAUDIO_bootstrap; #endif -#ifdef DMEDIA_SUPPORT +#if SDL_AUDIO_DRIVER_DMEDIA extern AudioBootStrap DMEDIA_bootstrap; #endif -#ifdef ARTSC_SUPPORT -extern AudioBootStrap ARTSC_bootstrap; +#if SDL_AUDIO_DRIVER_ARTS +extern AudioBootStrap ARTS_bootstrap; #endif -#ifdef ESD_SUPPORT +#if SDL_AUDIO_DRIVER_ESD extern AudioBootStrap ESD_bootstrap; #endif -#ifdef NAS_SUPPORT +#if SDL_AUDIO_DRIVER_NAS extern AudioBootStrap NAS_bootstrap; #endif -#ifdef ENABLE_DIRECTX +#if SDL_AUDIO_DRIVER_DSOUND extern AudioBootStrap DSOUND_bootstrap; #endif -#ifdef ENABLE_WINDIB +#if SDL_AUDIO_DRIVER_WAVEOUT extern AudioBootStrap WAVEOUT_bootstrap; #endif -#ifdef _AIX +#if SDL_AUDIO_DRIVER_PAUD extern AudioBootStrap Paud_bootstrap; #endif -#ifdef __BEOS__ +#if SDL_AUDIO_DRIVER_BAUDIO extern AudioBootStrap BAUDIO_bootstrap; #endif -#ifdef MACOSX +#if SDL_AUDIO_DRIVER_COREAUDIO extern AudioBootStrap COREAUDIO_bootstrap; #endif -#if defined(macintosh) || TARGET_API_MAC_CARBON +#if SDL_AUDIO_DRIVER_SNDMGR extern AudioBootStrap SNDMGR_bootstrap; #endif -#ifdef ENABLE_AHI +#if SDL_AUDIO_DRIVER_AHI extern AudioBootStrap AHI_bootstrap; #endif -#ifdef MINTAUDIO_SUPPORT +#if SDL_AUDIO_DRIVER_MINT extern AudioBootStrap MINTAUDIO_GSXB_bootstrap; extern AudioBootStrap MINTAUDIO_MCSN_bootstrap; extern AudioBootStrap MINTAUDIO_STFA_bootstrap; extern AudioBootStrap MINTAUDIO_XBIOS_bootstrap; extern AudioBootStrap MINTAUDIO_DMA8_bootstrap; #endif -#ifdef DISKAUD_SUPPORT +#if SDL_AUDIO_DRIVER_DISK extern AudioBootStrap DISKAUD_bootstrap; #endif -#ifdef ENABLE_DC +#if SDL_AUDIO_DRIVER_DC extern AudioBootStrap DCAUD_bootstrap; #endif -#ifdef DRENDERER_SUPPORT +#if SDL_AUDIO_DRIVER_DRENDERER extern AudioBootStrap DRENDERER_bootstrap; #endif -#ifdef MMEAUDIO_SUPPORT +#if SDL_AUDIO_DRIVER_MMEAUDIO extern AudioBootStrap MMEAUDIO_bootstrap; #endif -#ifdef __OS2__ +#if SDL_AUDIO_DRIVER_DART extern AudioBootStrap DART_bootstrap; #endif diff --git a/src/audio/SDL_wave.c b/src/audio/SDL_wave.c index f76d78c65..b11759c06 100644 --- a/src/audio/SDL_wave.c +++ b/src/audio/SDL_wave.c @@ -20,8 +20,6 @@ slouken@libsdl.org */ -#ifndef DISABLE_FILE - /* Microsoft WAVE file loading routines */ #include "SDL_audio.h" @@ -590,5 +588,3 @@ static int ReadChunk(SDL_RWops *src, Chunk *chunk) } return(chunk->length); } - -#endif /* ENABLE_FILE */ diff --git a/src/audio/alsa/Makefile.am b/src/audio/alsa/Makefile.am deleted file mode 100644 index 4f30d158f..000000000 --- a/src/audio/alsa/Makefile.am +++ /dev/null @@ -1,11 +0,0 @@ - -## Makefile.am for SDL using the ALSA PCM audio API - -noinst_LTLIBRARIES = libaudio_alsa.la -libaudio_alsa_la_SOURCES = $(SRCS) - -alsa_lib = \"@alsa_lib@\" - -# The SDL audio driver sources -SRCS = SDL_alsa_audio.c \ - SDL_alsa_audio.h diff --git a/src/audio/alsa/SDL_alsa_audio.c b/src/audio/alsa/SDL_alsa_audio.c index 08c7abb7c..fc091f570 100644 --- a/src/audio/alsa/SDL_alsa_audio.c +++ b/src/audio/alsa/SDL_alsa_audio.c @@ -27,18 +27,13 @@ #include #include /* For kill() */ -#include "SDL_audio.h" -#include "SDL_audiomem.h" -#include "SDL_audio_c.h" #include "SDL_timer.h" +#include "SDL_audio.h" +#include "../SDL_audiomem.h" +#include "../SDL_audio_c.h" #include "SDL_alsa_audio.h" -#ifdef ALSA_DYNAMIC -#ifdef USE_DLVSYM -#ifndef __USE_GNU -#define __USE_GNU -#endif -#endif +#ifdef SDL_AUDIO_DRIVER_ALSA_DYNAMIC #include #include "SDL_name.h" #include "SDL_loadso.h" @@ -60,9 +55,9 @@ static void ALSA_PlayAudio(_THIS); static Uint8 *ALSA_GetAudioBuf(_THIS); static void ALSA_CloseAudio(_THIS); -#ifdef ALSA_DYNAMIC +#ifdef SDL_AUDIO_DRIVER_ALSA_DYNAMIC -static const char *alsa_library = ALSA_DYNAMIC; +static const char *alsa_library = SDL_AUDIO_DRIVER_ALSA_DYNAMIC; static void *alsa_handle = NULL; static int alsa_loaded = 0; @@ -131,7 +126,7 @@ static int LoadALSALibrary(void) { retval = 0; for (i = 0; i < SDL_TABLESIZE(alsa_functions); i++) { /* *alsa_functions[i].func = SDL_LoadFunction(alsa_handle,alsa_functions[i].name);*/ -#ifdef USE_DLVSYM +#if HAVE_DLVSYM *alsa_functions[i].func = dlvsym(alsa_handle,alsa_functions[i].name,"ALSA_0.9"); if (!*alsa_functions[i].func) #endif @@ -156,7 +151,7 @@ static int LoadALSALibrary(void) { return 0; } -#endif /* ALSA_DYNAMIC */ +#endif /* SDL_AUDIO_DRIVER_ALSA_DYNAMIC */ static const char *get_audio_device(int channels) { diff --git a/src/audio/alsa/SDL_alsa_audio.h b/src/audio/alsa/SDL_alsa_audio.h index a0a5632c4..cbe27dba1 100644 --- a/src/audio/alsa/SDL_alsa_audio.h +++ b/src/audio/alsa/SDL_alsa_audio.h @@ -23,11 +23,12 @@ #ifndef _ALSA_PCM_audio_h #define _ALSA_PCM_audio_h -#include "SDL_sysaudio.h" #define ALSA_PCM_OLD_HW_PARAMS_API #define ALSA_PCM_OLD_SW_PARAMS_API #include +#include "../SDL_sysaudio.h" + /* Hidden "this" pointer for the video functions */ #define _THIS SDL_AudioDevice *this diff --git a/src/audio/amigaos/Makefile.am b/src/audio/amigaos/Makefile.am deleted file mode 100644 index 99d95d8ac..000000000 --- a/src/audio/amigaos/Makefile.am +++ /dev/null @@ -1,8 +0,0 @@ - -## Makefile.am for the SDL AmigaOS audio subsystem - -noinst_LTLIBRARIES = libaudio_arch.la - -ARCH_SRCS = SDL_ahiaudio.c SDL_ahiaudio.h - -libaudio_arch_la_SOURCES = $(ARCH_SRCS) diff --git a/src/audio/amigaos/SDL_ahiaudio.c b/src/audio/amigaos/SDL_ahiaudio.c index 0130e66c7..a6b5a6ad1 100644 --- a/src/audio/amigaos/SDL_ahiaudio.c +++ b/src/audio/amigaos/SDL_ahiaudio.c @@ -23,8 +23,7 @@ /* Allow access to a raw mixing buffer (for AmigaOS) */ #include "SDL_audio.h" -#include "SDL_audiomem.h" -#include "SDL_audio_c.h" +#include "../SDL_audio_c.h" #include "SDL_ahiaudio.h" /* Audio driver functions */ diff --git a/src/audio/amigaos/SDL_ahiaudio.h b/src/audio/amigaos/SDL_ahiaudio.h index fd5c9bd9a..c059086c7 100644 --- a/src/audio/amigaos/SDL_ahiaudio.h +++ b/src/audio/amigaos/SDL_ahiaudio.h @@ -33,7 +33,8 @@ #include #include "mydebug.h" -#include "SDL_sysaudio.h" + +#include "../SDL_sysaudio.h" /* Hidden "this" pointer for the audio functions */ #define _THIS SDL_AudioDevice *this diff --git a/src/audio/arts/Makefile.am b/src/audio/arts/Makefile.am deleted file mode 100644 index e0d409ef2..000000000 --- a/src/audio/arts/Makefile.am +++ /dev/null @@ -1,11 +0,0 @@ - -## Makefile.am for SDL using the Analog Realtime Synthesizer sound driver - -noinst_LTLIBRARIES = libaudio_arts.la -libaudio_arts_la_SOURCES = $(SRCS) - -arts_lib = \"@arts_lib@\" - -# The SDL audio driver sources -SRCS = SDL_artsaudio.c \ - SDL_artsaudio.h diff --git a/src/audio/arts/SDL_artsaudio.c b/src/audio/arts/SDL_artsaudio.c index 68b14ae18..b4e950823 100644 --- a/src/audio/arts/SDL_artsaudio.c +++ b/src/audio/arts/SDL_artsaudio.c @@ -24,12 +24,12 @@ #include "SDL_timer.h" #include "SDL_audio.h" -#include "SDL_audiomem.h" -#include "SDL_audio_c.h" -#include "SDL_audiodev_c.h" +#include "../SDL_audiomem.h" +#include "../SDL_audio_c.h" +#include "../SDL_audiodev_c.h" #include "SDL_artsaudio.h" -#ifdef ARTSC_DYNAMIC +#ifdef SDL_AUDIO_DRIVER_ARTS_DYNAMIC #include "SDL_name.h" #include "SDL_loadso.h" #else @@ -37,18 +37,18 @@ #endif /* The tag name used by artsc audio */ -#define ARTSC_DRIVER_NAME "arts" +#define ARTS_DRIVER_NAME "arts" /* Audio driver functions */ -static int ARTSC_OpenAudio(_THIS, SDL_AudioSpec *spec); -static void ARTSC_WaitAudio(_THIS); -static void ARTSC_PlayAudio(_THIS); -static Uint8 *ARTSC_GetAudioBuf(_THIS); -static void ARTSC_CloseAudio(_THIS); +static int ARTS_OpenAudio(_THIS, SDL_AudioSpec *spec); +static void ARTS_WaitAudio(_THIS); +static void ARTS_PlayAudio(_THIS); +static Uint8 *ARTS_GetAudioBuf(_THIS); +static void ARTS_CloseAudio(_THIS); -#ifdef ARTSC_DYNAMIC +#ifdef SDL_AUDIO_DRIVER_ARTS_DYNAMIC -static const char *arts_library = ARTSC_DYNAMIC; +static const char *arts_library = SDL_AUDIO_DRIVER_ARTS_DYNAMIC; static void *arts_handle = NULL; static int arts_loaded = 0; @@ -114,7 +114,7 @@ static int LoadARTSLibrary(void) return 0; } -#endif /* ARTSC_DYNAMIC */ +#endif /* SDL_AUDIO_DRIVER_ARTS_DYNAMIC */ /* Audio driver bootstrap functions */ @@ -171,24 +171,24 @@ static SDL_AudioDevice *Audio_CreateDevice(int devindex) stream = 0; /* Set the function pointers */ - this->OpenAudio = ARTSC_OpenAudio; - this->WaitAudio = ARTSC_WaitAudio; - this->PlayAudio = ARTSC_PlayAudio; - this->GetAudioBuf = ARTSC_GetAudioBuf; - this->CloseAudio = ARTSC_CloseAudio; + this->OpenAudio = ARTS_OpenAudio; + this->WaitAudio = ARTS_WaitAudio; + this->PlayAudio = ARTS_PlayAudio; + this->GetAudioBuf = ARTS_GetAudioBuf; + this->CloseAudio = ARTS_CloseAudio; this->free = Audio_DeleteDevice; return this; } -AudioBootStrap ARTSC_bootstrap = { - ARTSC_DRIVER_NAME, "Analog Realtime Synthesizer", +AudioBootStrap ARTS_bootstrap = { + ARTS_DRIVER_NAME, "Analog Realtime Synthesizer", Audio_Available, Audio_CreateDevice }; /* This function waits until it is possible to write a full sound buffer */ -static void ARTSC_WaitAudio(_THIS) +static void ARTS_WaitAudio(_THIS) { Sint32 ticks; @@ -211,7 +211,7 @@ static void ARTSC_WaitAudio(_THIS) } } -static void ARTSC_PlayAudio(_THIS) +static void ARTS_PlayAudio(_THIS) { int written; @@ -232,12 +232,12 @@ static void ARTSC_PlayAudio(_THIS) #endif } -static Uint8 *ARTSC_GetAudioBuf(_THIS) +static Uint8 *ARTS_GetAudioBuf(_THIS) { return(mixbuf); } -static void ARTSC_CloseAudio(_THIS) +static void ARTS_CloseAudio(_THIS) { if ( mixbuf != NULL ) { SDL_FreeAudioMem(mixbuf); @@ -250,7 +250,7 @@ static void ARTSC_CloseAudio(_THIS) SDL_NAME(arts_free)(); } -static int ARTSC_OpenAudio(_THIS, SDL_AudioSpec *spec) +static int ARTS_OpenAudio(_THIS, SDL_AudioSpec *spec) { int bits, frag_spec; Uint16 test_format, format; diff --git a/src/audio/arts/SDL_artsaudio.h b/src/audio/arts/SDL_artsaudio.h index 9e50f21b2..114170f98 100644 --- a/src/audio/arts/SDL_artsaudio.h +++ b/src/audio/arts/SDL_artsaudio.h @@ -24,7 +24,8 @@ #define _SDL_artscaudio_h #include -#include "SDL_sysaudio.h" + +#include "../SDL_sysaudio.h" /* Hidden "this" pointer for the video functions */ #define _THIS SDL_AudioDevice *this diff --git a/src/audio/baudio/Makefile.am b/src/audio/baudio/Makefile.am deleted file mode 100644 index a98d9d9ed..000000000 --- a/src/audio/baudio/Makefile.am +++ /dev/null @@ -1,9 +0,0 @@ - -## Makefile.am for SDL using the BeOS BSoundPlayer sound driver - -noinst_LTLIBRARIES = libaudio_baudio.la -libaudio_baudio_la_SOURCES = $(SRCS) - -# The SDL audio driver sources -SRCS = SDL_beaudio.cc \ - SDL_beaudio.h diff --git a/src/audio/baudio/SDL_beaudio.cc b/src/audio/baudio/SDL_beaudio.cc index 29ab97f4d..9758bc8ab 100644 --- a/src/audio/baudio/SDL_beaudio.cc +++ b/src/audio/baudio/SDL_beaudio.cc @@ -29,9 +29,9 @@ extern "C" { #include "SDL_audio.h" -#include "SDL_audio_c.h" -#include "SDL_sysaudio.h" -#include "SDL_systhread_c.h" +#include "../SDL_audio_c.h" +#include "../SDL_sysaudio.h" +#include "../../thread/SDL_systhread_c.h" #include "SDL_beaudio.h" diff --git a/src/audio/baudio/SDL_beaudio.h b/src/audio/baudio/SDL_beaudio.h index 1506b67f4..5a5e34c81 100644 --- a/src/audio/baudio/SDL_beaudio.h +++ b/src/audio/baudio/SDL_beaudio.h @@ -23,7 +23,7 @@ #ifndef _SDL_lowaudio_h #define _SDL_lowaudio_h -#include "SDL_sysaudio.h" +#include "../SDL_sysaudio.h" /* Hidden "this" pointer for the video functions */ #define _THIS SDL_AudioDevice *_this diff --git a/src/audio/dart/SDL_dart.c b/src/audio/dart/SDL_dart.c index f1d3b3e4f..00f58ae1d 100644 --- a/src/audio/dart/SDL_dart.c +++ b/src/audio/dart/SDL_dart.c @@ -24,7 +24,7 @@ #include "SDL_timer.h" #include "SDL_audio.h" -#include "SDL_audio_c.h" +#include "../SDL_audio_c.h" #include "SDL_dart.h" // Buffer states: diff --git a/src/audio/dart/SDL_dart.h b/src/audio/dart/SDL_dart.h index def9b8c54..27a7faa3a 100644 --- a/src/audio/dart/SDL_dart.h +++ b/src/audio/dart/SDL_dart.h @@ -23,8 +23,6 @@ #ifndef _SDL_lowaudio_h #define _SDL_lowaudio_h -#include "SDL_sysaudio.h" - #define INCL_TYPES #define INCL_DOSSEMAPHORES #define INCL_DOSRESOURCES @@ -37,6 +35,8 @@ #include #include // DART stuff and MMIO stuff +#include "../SDL_sysaudio.h" + /* Hidden "this" pointer for the audio functions */ #define _THIS SDL_AudioDevice *_this diff --git a/src/audio/dc/Makefile.am b/src/audio/dc/Makefile.am deleted file mode 100644 index a5d0e1cfe..000000000 --- a/src/audio/dc/Makefile.am +++ /dev/null @@ -1,11 +0,0 @@ - -## Makefile.am for SDL on the Dreamcast console - -noinst_LTLIBRARIES = libaudio_dc.la -libaudio_dc_la_SOURCES = $(SRCS) - -# The SDL audio driver sources -SRCS = SDL_dcaudio.c \ - SDL_dcaudio.h \ - aica.c \ - aica.h diff --git a/src/audio/dc/SDL_dcaudio.c b/src/audio/dc/SDL_dcaudio.c index 41f5efd63..d6327f7f4 100644 --- a/src/audio/dc/SDL_dcaudio.c +++ b/src/audio/dc/SDL_dcaudio.c @@ -32,9 +32,9 @@ #include "SDL_timer.h" #include "SDL_audio.h" -#include "SDL_audiomem.h" -#include "SDL_audio_c.h" -#include "SDL_audiodev_c.h" +#include "../SDL_audiomem.h" +#include "../SDL_audio_c.h" +#include "../SDL_audiodev_c.h" #include "SDL_dcaudio.h" #include "aica.h" diff --git a/src/audio/dc/SDL_dcaudio.h b/src/audio/dc/SDL_dcaudio.h index 58a9291d0..b2d66a11a 100644 --- a/src/audio/dc/SDL_dcaudio.h +++ b/src/audio/dc/SDL_dcaudio.h @@ -23,7 +23,7 @@ #ifndef _SDL_diskaudio_h #define _SDL_diskaudio_h -#include "SDL_sysaudio.h" +#include "../SDL_sysaudio.h" /* Hidden "this" pointer for the video functions */ #define _THIS SDL_AudioDevice *this diff --git a/src/audio/disk/Makefile.am b/src/audio/disk/Makefile.am deleted file mode 100644 index ab3310a8b..000000000 --- a/src/audio/disk/Makefile.am +++ /dev/null @@ -1,9 +0,0 @@ - -## Makefile.am for SDL audio "driver" that writes to a file. - -noinst_LTLIBRARIES = libaudio_disk.la -libaudio_disk_la_SOURCES = $(SRCS) - -# The SDL audio driver sources -SRCS = SDL_diskaudio.c \ - SDL_diskaudio.h diff --git a/src/audio/disk/SDL_diskaudio.c b/src/audio/disk/SDL_diskaudio.c index 6b6af41bb..cc5e9a324 100644 --- a/src/audio/disk/SDL_diskaudio.c +++ b/src/audio/disk/SDL_diskaudio.c @@ -37,9 +37,9 @@ #include "SDL_timer.h" #include "SDL_audio.h" -#include "SDL_audiomem.h" -#include "SDL_audio_c.h" -#include "SDL_audiodev_c.h" +#include "../SDL_audiomem.h" +#include "../SDL_audio_c.h" +#include "../SDL_audiodev_c.h" #include "SDL_diskaudio.h" /* The tag name used by DISK audio */ diff --git a/src/audio/disk/SDL_diskaudio.h b/src/audio/disk/SDL_diskaudio.h index 4a1996bf3..7a80bf29c 100644 --- a/src/audio/disk/SDL_diskaudio.h +++ b/src/audio/disk/SDL_diskaudio.h @@ -23,7 +23,7 @@ #ifndef _SDL_diskaudio_h #define _SDL_diskaudio_h -#include "SDL_sysaudio.h" +#include "../SDL_sysaudio.h" /* Hidden "this" pointer for the video functions */ #define _THIS SDL_AudioDevice *this diff --git a/src/audio/dma/Makefile.am b/src/audio/dma/Makefile.am deleted file mode 100644 index fa4ce467d..000000000 --- a/src/audio/dma/Makefile.am +++ /dev/null @@ -1,9 +0,0 @@ - -## Makefile.am for SDL using the OSS /dev/dsp DMA sound driver - -noinst_LTLIBRARIES = libaudio_dma.la -libaudio_dma_la_SOURCES = $(SRCS) - -# The SDL audio driver sources -SRCS = SDL_dmaaudio.c \ - SDL_dmaaudio.h diff --git a/src/audio/dma/SDL_dmaaudio.c b/src/audio/dma/SDL_dmaaudio.c index 6cdb7592d..10d4547f8 100644 --- a/src/audio/dma/SDL_dmaaudio.c +++ b/src/audio/dma/SDL_dmaaudio.c @@ -33,7 +33,10 @@ #include #include #include -#ifdef OSS_USE_SOUNDCARD_H + +#include "SDL_config.h" + +#if SDL_AUDIO_DRIVER_OSS_SOUNDCARD_H /* This is installed on some systems */ #include #else @@ -47,9 +50,8 @@ #include "SDL_timer.h" #include "SDL_audio.h" -#include "SDL_audiomem.h" -#include "SDL_audio_c.h" -#include "SDL_audiodev_c.h" +#include "../SDL_audio_c.h" +#include "../SDL_audiodev_c.h" #include "SDL_dmaaudio.h" /* The tag name used by DMA audio */ diff --git a/src/audio/dma/SDL_dmaaudio.h b/src/audio/dma/SDL_dmaaudio.h index 3174a0e67..f48e79196 100644 --- a/src/audio/dma/SDL_dmaaudio.h +++ b/src/audio/dma/SDL_dmaaudio.h @@ -23,7 +23,7 @@ #ifndef _SDL_dspaudio_h #define _SDL_dspaudio_h -#include "SDL_sysaudio.h" +#include "../SDL_sysaudio.h" /* Hidden "this" pointer for the video functions */ #define _THIS SDL_AudioDevice *this diff --git a/src/audio/dmedia/Makefile.am b/src/audio/dmedia/Makefile.am deleted file mode 100644 index 149385eb3..000000000 --- a/src/audio/dmedia/Makefile.am +++ /dev/null @@ -1,9 +0,0 @@ - -## Makefile.am for SDL using the IRIX DMedia sound driver - -noinst_LTLIBRARIES = libaudio_dmedia.la -libaudio_dmedia_la_SOURCES = $(SRCS) - -# The SDL audio driver sources -SRCS = SDL_irixaudio.c \ - SDL_irixaudio.h diff --git a/src/audio/dmedia/SDL_irixaudio.c b/src/audio/dmedia/SDL_irixaudio.c index 632ee98cf..406a9375c 100644 --- a/src/audio/dmedia/SDL_irixaudio.c +++ b/src/audio/dmedia/SDL_irixaudio.c @@ -25,8 +25,8 @@ #include "SDL_timer.h" #include "SDL_audio.h" -#include "SDL_audiomem.h" -#include "SDL_audio_c.h" +#include "../SDL_audiomem.h" +#include "../SDL_audio_c.h" #include "SDL_irixaudio.h" diff --git a/src/audio/dmedia/SDL_irixaudio.h b/src/audio/dmedia/SDL_irixaudio.h index 7e1771eef..dd8df3620 100644 --- a/src/audio/dmedia/SDL_irixaudio.h +++ b/src/audio/dmedia/SDL_irixaudio.h @@ -25,7 +25,7 @@ #include -#include "SDL_sysaudio.h" +#include "../SDL_sysaudio.h" /* Hidden "this" pointer for the audio functions */ #define _THIS SDL_AudioDevice *this diff --git a/src/audio/dsp/Makefile.am b/src/audio/dsp/Makefile.am deleted file mode 100644 index bccca129c..000000000 --- a/src/audio/dsp/Makefile.am +++ /dev/null @@ -1,9 +0,0 @@ - -## Makefile.am for SDL using the OSS /dev/dsp standard sound driver - -noinst_LTLIBRARIES = libaudio_dsp.la -libaudio_dsp_la_SOURCES = $(SRCS) - -# The SDL audio driver sources -SRCS = SDL_dspaudio.c \ - SDL_dspaudio.h diff --git a/src/audio/dsp/SDL_dspaudio.c b/src/audio/dsp/SDL_dspaudio.c index dd424f54d..6804f1c51 100644 --- a/src/audio/dsp/SDL_dspaudio.c +++ b/src/audio/dsp/SDL_dspaudio.c @@ -34,7 +34,10 @@ #include #include #include -#ifdef OSS_USE_SOUNDCARD_H + +#include "SDL_config.h" + +#if SDL_AUDIO_DRIVER_OSS_SOUNDCARD_H /* This is installed on some systems */ #include #else @@ -44,9 +47,9 @@ #include "SDL_timer.h" #include "SDL_audio.h" -#include "SDL_audiomem.h" -#include "SDL_audio_c.h" -#include "SDL_audiodev_c.h" +#include "../SDL_audiomem.h" +#include "../SDL_audio_c.h" +#include "../SDL_audiodev_c.h" #include "SDL_dspaudio.h" /* The tag name used by DSP audio */ diff --git a/src/audio/dsp/SDL_dspaudio.h b/src/audio/dsp/SDL_dspaudio.h index cbb7f975d..8d62993bc 100644 --- a/src/audio/dsp/SDL_dspaudio.h +++ b/src/audio/dsp/SDL_dspaudio.h @@ -23,7 +23,7 @@ #ifndef _SDL_dspaudio_h #define _SDL_dspaudio_h -#include "SDL_sysaudio.h" +#include "../SDL_sysaudio.h" /* Hidden "this" pointer for the video functions */ #define _THIS SDL_AudioDevice *this diff --git a/src/audio/esd/Makefile.am b/src/audio/esd/Makefile.am deleted file mode 100644 index a9ac22e8a..000000000 --- a/src/audio/esd/Makefile.am +++ /dev/null @@ -1,11 +0,0 @@ - -## Makefile.am for SDL using the Enlightened Sound Daemon sound driver - -noinst_LTLIBRARIES = libaudio_esd.la -libaudio_esd_la_SOURCES = $(SRCS) - -esd_lib = \"@esd_lib@\" - -# The SDL audio driver sources -SRCS = SDL_esdaudio.c \ - SDL_esdaudio.h diff --git a/src/audio/esd/SDL_esdaudio.c b/src/audio/esd/SDL_esdaudio.c index 3445d5b38..bd2d9863e 100644 --- a/src/audio/esd/SDL_esdaudio.c +++ b/src/audio/esd/SDL_esdaudio.c @@ -30,12 +30,12 @@ #include "SDL_timer.h" #include "SDL_audio.h" -#include "SDL_audiomem.h" -#include "SDL_audio_c.h" -#include "SDL_audiodev_c.h" +#include "../SDL_audiomem.h" +#include "../SDL_audio_c.h" +#include "../SDL_audiodev_c.h" #include "SDL_esdaudio.h" -#ifdef ESD_DYNAMIC +#ifdef SDL_AUDIO_DRIVER_ESD_DYNAMIC #include "SDL_name.h" #include "SDL_loadso.h" #else @@ -52,9 +52,9 @@ static void ESD_PlayAudio(_THIS); static Uint8 *ESD_GetAudioBuf(_THIS); static void ESD_CloseAudio(_THIS); -#ifdef ESD_DYNAMIC +#ifdef SDL_AUDIO_DRIVER_ESD_DYNAMIC -static const char *esd_library = ESD_DYNAMIC; +static const char *esd_library = SDL_AUDIO_DRIVER_ESD_DYNAMIC; static void *esd_handle = NULL; static int esd_loaded = 0; @@ -112,7 +112,7 @@ static int LoadESDLibrary(void) return 0; } -#endif /* ESD_DYNAMIC */ +#endif /* SDL_AUDIO_DRIVER_ESD_DYNAMIC */ /* Audio driver bootstrap functions */ diff --git a/src/audio/esd/SDL_esdaudio.h b/src/audio/esd/SDL_esdaudio.h index 82a3e2143..cdfa09732 100644 --- a/src/audio/esd/SDL_esdaudio.h +++ b/src/audio/esd/SDL_esdaudio.h @@ -23,7 +23,7 @@ #ifndef _SDL_esdaudio_h #define _SDL_esdaudio_h -#include "SDL_sysaudio.h" +#include "../SDL_sysaudio.h" /* Hidden "this" pointer for the video functions */ #define _THIS SDL_AudioDevice *this diff --git a/src/audio/macosx/Makefile.am b/src/audio/macosx/Makefile.am deleted file mode 100644 index 2b71efb84..000000000 --- a/src/audio/macosx/Makefile.am +++ /dev/null @@ -1,9 +0,0 @@ - -## Makefile.am for SDL using the Mac OS X CoreAudio driver - -noinst_LTLIBRARIES = libaudio_macosx.la -libaudio_macosx_la_SOURCES = $(SRCS) - -# The SDL audio driver sources -SRCS = SDL_coreaudio.c \ - SDL_coreaudio.h diff --git a/src/audio/macosx/SDL_coreaudio.c b/src/audio/macosx/SDL_coreaudio.c index 1f8e9bd8d..425b48986 100644 --- a/src/audio/macosx/SDL_coreaudio.c +++ b/src/audio/macosx/SDL_coreaudio.c @@ -23,9 +23,8 @@ #include #include "SDL_audio.h" -#include "SDL_audio_c.h" -#include "SDL_audiomem.h" -#include "SDL_sysaudio.h" +#include "../SDL_audio_c.h" +#include "../SDL_sysaudio.h" #include "SDL_coreaudio.h" diff --git a/src/audio/macosx/SDL_coreaudio.h b/src/audio/macosx/SDL_coreaudio.h index 4da6f2e1b..93080a1f9 100644 --- a/src/audio/macosx/SDL_coreaudio.h +++ b/src/audio/macosx/SDL_coreaudio.h @@ -23,7 +23,7 @@ #ifndef _SDL_coreaudio_h #define _SDL_coreaudio_h -#include "SDL_sysaudio.h" +#include "../SDL_sysaudio.h" /* Hidden "this" pointer for the video functions */ #define _THIS SDL_AudioDevice *this diff --git a/src/audio/macrom/Makefile.am b/src/audio/macrom/Makefile.am deleted file mode 100644 index 31ee995ce..000000000 --- a/src/audio/macrom/Makefile.am +++ /dev/null @@ -1,9 +0,0 @@ - -## Makefile.am for SDL using the MacOS SoundManager audio driver - -noinst_LTLIBRARIES = libaudio_macrom.la -libaudio_macrom_la_SOURCES = $(SRCS) - -# The SDL audio driver sources -SRCS = SDL_romaudio.c \ - SDL_romaudio.h diff --git a/src/audio/macrom/SDL_romaudio.c b/src/audio/macrom/SDL_romaudio.c index d88f9f600..f9002e2a3 100644 --- a/src/audio/macrom/SDL_romaudio.c +++ b/src/audio/macrom/SDL_romaudio.c @@ -40,9 +40,8 @@ #endif #include "SDL_audio.h" -#include "SDL_audio_c.h" -#include "SDL_audiomem.h" -#include "SDL_sysaudio.h" +#include "../SDL_audio_c.h" +#include "../SDL_sysaudio.h" #include "SDL_romaudio.h" /* Audio driver functions */ diff --git a/src/audio/macrom/SDL_romaudio.h b/src/audio/macrom/SDL_romaudio.h index 38fe77e94..28296d8d2 100644 --- a/src/audio/macrom/SDL_romaudio.h +++ b/src/audio/macrom/SDL_romaudio.h @@ -23,7 +23,7 @@ #ifndef _SDL_romaudio_h #define _SDL_romaudio_h -#include "SDL_sysaudio.h" +#include "../SDL_sysaudio.h" /* This is Ryan's improved MacOS sound code, with locking support */ #define USE_RYANS_SOUNDCODE diff --git a/src/audio/mint/Makefile.am b/src/audio/mint/Makefile.am deleted file mode 100644 index 21d910d94..000000000 --- a/src/audio/mint/Makefile.am +++ /dev/null @@ -1,19 +0,0 @@ -## Makefile.am for SDL using Xbios/Dma/whatever available audio functions - -noinst_LTLIBRARIES = libaudio_mintaudio.la -libaudio_mintaudio_la_SOURCES = $(SRCS) - -# The SDL audio driver sources -SRCS = \ - SDL_mintaudio.c \ - SDL_mintaudio.h \ - SDL_mintaudio_dma8.c \ - SDL_mintaudio_dma8.h \ - SDL_mintaudio_gsxb.c \ - SDL_mintaudio_gsxb.h \ - SDL_mintaudio_it.S \ - SDL_mintaudio_mcsn.c \ - SDL_mintaudio_mcsn.h \ - SDL_mintaudio_stfa.c \ - SDL_mintaudio_stfa.h \ - SDL_mintaudio_xbios.c diff --git a/src/audio/mint/SDL_mintaudio.h b/src/audio/mint/SDL_mintaudio.h index 3a0d320d4..f679124ff 100644 --- a/src/audio/mint/SDL_mintaudio.h +++ b/src/audio/mint/SDL_mintaudio.h @@ -29,7 +29,7 @@ #ifndef _SDL_mintaudio_h #define _SDL_mintaudio_h -#include "SDL_sysaudio.h" +#include "../SDL_sysaudio.h" #include "SDL_mintaudio_stfa.h" /* Hidden "this" pointer for the audio functions */ diff --git a/src/audio/mint/SDL_mintaudio_dma8.c b/src/audio/mint/SDL_mintaudio_dma8.c index f8379d649..2b9fea3a4 100644 --- a/src/audio/mint/SDL_mintaudio_dma8.c +++ b/src/audio/mint/SDL_mintaudio_dma8.c @@ -33,9 +33,8 @@ #include #include "SDL_audio.h" -#include "SDL_audio_c.h" -#include "SDL_audiomem.h" -#include "SDL_sysaudio.h" +#include "../SDL_audio_c.h" +#include "../SDL_sysaudio.h" #include "SDL_atarimxalloc_c.h" diff --git a/src/audio/mint/SDL_mintaudio_gsxb.c b/src/audio/mint/SDL_mintaudio_gsxb.c index 4719a5bcc..5af835d11 100644 --- a/src/audio/mint/SDL_mintaudio_gsxb.c +++ b/src/audio/mint/SDL_mintaudio_gsxb.c @@ -33,9 +33,8 @@ #include #include "SDL_audio.h" -#include "SDL_audio_c.h" -#include "SDL_audiomem.h" -#include "SDL_sysaudio.h" +#include "../SDL_audio_c.h" +#include "../SDL_sysaudio.h" #include "SDL_atarimxalloc_c.h" diff --git a/src/audio/mint/SDL_mintaudio_mcsn.c b/src/audio/mint/SDL_mintaudio_mcsn.c index c3229ae31..99bcd2c3d 100644 --- a/src/audio/mint/SDL_mintaudio_mcsn.c +++ b/src/audio/mint/SDL_mintaudio_mcsn.c @@ -35,9 +35,8 @@ #include #include "SDL_audio.h" -#include "SDL_audio_c.h" -#include "SDL_audiomem.h" -#include "SDL_sysaudio.h" +#include "../SDL_audio_c.h" +#include "../SDL_sysaudio.h" #include "SDL_atarimxalloc_c.h" diff --git a/src/audio/mint/SDL_mintaudio_stfa.c b/src/audio/mint/SDL_mintaudio_stfa.c index ab905edf0..65a9e8448 100644 --- a/src/audio/mint/SDL_mintaudio_stfa.c +++ b/src/audio/mint/SDL_mintaudio_stfa.c @@ -33,9 +33,8 @@ #include #include "SDL_audio.h" -#include "SDL_audio_c.h" -#include "SDL_audiomem.h" -#include "SDL_sysaudio.h" +#include "../SDL_audio_c.h" +#include "../SDL_sysaudio.h" #include "SDL_atarimxalloc_c.h" @@ -161,8 +160,8 @@ static void Mint_LockAudio(_THIS) /* Stop replay */ oldpile=(void *)Super(0); - cookie_stfa->sound_enable=STFA_PLAY_DISABLE; - Super(oldpile); + cookie_stfa->sound_enable=STFA_PLAY_SDL_DISABLE; + Super( SDL_arraysize(Super),oldpile); } static void Mint_UnlockAudio(_THIS) diff --git a/src/audio/mint/SDL_mintaudio_xbios.c b/src/audio/mint/SDL_mintaudio_xbios.c index 1b96b43d0..89c0afac5 100644 --- a/src/audio/mint/SDL_mintaudio_xbios.c +++ b/src/audio/mint/SDL_mintaudio_xbios.c @@ -36,9 +36,8 @@ #include #include "SDL_audio.h" -#include "SDL_audio_c.h" -#include "SDL_audiomem.h" -#include "SDL_sysaudio.h" +#include "../SDL_audio_c.h" +#include "../SDL_sysaudio.h" #include "SDL_atarimxalloc_c.h" diff --git a/src/audio/mme/Makefile.am b/src/audio/mme/Makefile.am deleted file mode 100644 index b5ab2d6d0..000000000 --- a/src/audio/mme/Makefile.am +++ /dev/null @@ -1,9 +0,0 @@ - -## Makefile.am for SDL using the Tru64 MME sound driver - -noinst_LTLIBRARIES = libaudio_mme.la -libaudio_mme_la_SOURCES = $(SRCS) - -# The SDL audio driver sources -SRCS = SDL_mmeaudio.c \ - SDL_mmeaudio.h diff --git a/src/audio/mme/SDL_mmeaudio.c b/src/audio/mme/SDL_mmeaudio.c index f48b4435a..77435905c 100644 --- a/src/audio/mme/SDL_mmeaudio.c +++ b/src/audio/mme/SDL_mmeaudio.c @@ -25,8 +25,7 @@ #include "SDL_timer.h" #include "SDL_audio.h" -#include "SDL_audio_c.h" - +#include "../SDL_audio_c.h" #include "SDL_mmeaudio.h" static BOOL inUse[NUM_BUFFERS]; diff --git a/src/audio/mme/SDL_mmeaudio.h b/src/audio/mme/SDL_mmeaudio.h index 36e99f59c..f589dedb9 100644 --- a/src/audio/mme/SDL_mmeaudio.h +++ b/src/audio/mme/SDL_mmeaudio.h @@ -24,7 +24,8 @@ #ifndef _SDL_lowaudio_h #define _SDL_lowaudio_h -#include "SDL_sysaudio.h" + +#include "../SDL_sysaudio.h" /* Hidden "this" pointer for the video functions */ #define _THIS SDL_AudioDevice *this diff --git a/src/audio/nas/Makefile.am b/src/audio/nas/Makefile.am deleted file mode 100644 index abb6f131f..000000000 --- a/src/audio/nas/Makefile.am +++ /dev/null @@ -1,9 +0,0 @@ - -## Makefile.am for SDL using the Network Audio System sound driver - -noinst_LTLIBRARIES = libaudio_nas.la -libaudio_nas_la_SOURCES = $(SRCS) - -# The SDL audio driver sources -SRCS = SDL_nasaudio.c \ - SDL_nasaudio.h diff --git a/src/audio/nas/SDL_nasaudio.c b/src/audio/nas/SDL_nasaudio.c index af4f59221..dd479a74e 100644 --- a/src/audio/nas/SDL_nasaudio.c +++ b/src/audio/nas/SDL_nasaudio.c @@ -31,9 +31,9 @@ #include "SDL_timer.h" #include "SDL_audio.h" -#include "SDL_audiomem.h" -#include "SDL_audio_c.h" -#include "SDL_audiodev_c.h" +#include "../SDL_audiomem.h" +#include "../SDL_audio_c.h" +#include "../SDL_audiodev_c.h" #include "SDL_nasaudio.h" /* The tag name used by artsc audio */ diff --git a/src/audio/nas/SDL_nasaudio.h b/src/audio/nas/SDL_nasaudio.h index 7278d5a53..658ade12f 100644 --- a/src/audio/nas/SDL_nasaudio.h +++ b/src/audio/nas/SDL_nasaudio.h @@ -33,7 +33,8 @@ #include